Hello,

I've been playing around with Udo's "pagewise" script for
ForEachTiddler usage.  I thought it was my "Big Answer "to what I have
in mind but have come up against a large block in the road:

it seems that the variable "window.fetStartIndex" is global, not "per
tiddler".  What I had in mind was to be able to have more than one
tiddler open at a time, each displaying a subset of a long list of
tiddlers, but each showing only tiddlers with a certain tag (different
for each tiddler).  What I've realized, however, is that when you
click the button to skip to the next set of tiddlers in the
progression of one set, the index is changed globally and when you go
back to the other tiddler and click to see the next set, the count
doesn't match where you left off because of the changes you just made
in the prior tiddler.

***
Does anyone know a way around this?
***
thanks,
Dave Parker

Here's the pagewise script for reference (the "@" in it I replace with
whatever tag I'm looking to list):

<<forEachTiddler
 where
 'tiddler.tags.contains("@")'
    script '
        window.fetItemsPerPage = 15;

        function getHeader(context,count) {
            if (!window.fetStartIndex || window.fetStartIndex < 0)
                window.fetStartIndex = 0;

            // ensure not to page behind the last page
            if (window.fetStartIndex >= count)
                window.fetStartIndex = Math.min(Math.max
(window.fetStartIndex-window.fetItemsPerPage,0),count-1);

            createTiddlyButton(context.place,"<",null,
                    function(e) {
                        window.fetStartIndex -=
window.fetItemsPerPage;
                        story.refreshTiddler
(context.viewerTiddler.title,null,true);
                    });
            createTiddlyButton(context.place,">",null,
                    function(e) {
                        window.fetStartIndex +=
window.fetItemsPerPage;
                        story.refreshTiddler
(context.viewerTiddler.title,null,true);
                    });

            var startNo = window.fetStartIndex+1;
            var endNo = Math.min(count,window.fetStartIndex
+window.fetItemsPerPage);

            return "("+startNo+" - "+endNo+ " of "+ count + " verses)\n
\n";
        }
    '

    write
            '(index >= window.fetStartIndex) && (index <
window.fetStartIndex + 15) ?  "<<tiddler "+"[["+tiddler.title+"]]"+"\>
\>\n": ""'


        begin
            'getHeader(context,count)'
>>



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to TiddlyWiki@googlegroups.com
To unsubscribe from this group, send email to 
tiddlywiki+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/TiddlyWiki?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to