Thanks for the feedback Mark,
I like the wikify suggestion, might start using that instead or
return . . . any disadvantages?
(much better than document.write, and you can only use return once -
at least that is what I found. . .)
As for the conditions. . .
Is their a way to put multiple conditions on one line I.E.
if (store.getTiddlerSlice(val1,"Purchased") != "Yes,
yes, Y, y") continue;
I appreciate the feedback,
Mike
On Feb 12, 11:47 pm, "Mark S." <[email protected]> wrote:
> Hi Mike,
>
> Without actually trying it, it looks pretty good. Small things only.
> The rr variable goes unused. It looks like you were testing using
> document.write. Usually I test using
>
> wikify("string", place) ;
>
> But I don't know if it matters, but I believe it will work in most
> cases whereas document.write might write to the wrong place. Variable
> "place" is provided by the plugin script.
>
> The setTimeout routine looks useful. Is this something that is
> documented somewhere?
>
> If you're planning to have people besides yourself do data entry, then
> you might consider adding additional validation on your various
> responses. Look for "Y/y/Yes/yes/true" for the places requiring
> affirmative inputs, and maybe multiple formats for "Not Rated" (like
> "N/R", "Not", "NR","not rated","Not rated") ... users will always
> forget and punch in something novel.
>
> Good luck!
> Mark
>
> On Feb 12, 12:40 pm, Mike <[email protected]> wrote:
>
> > I tend to take the long way of doing things . . .
> > So here is my code (working) (script placed in div fD)
> > Looking for any suggestions or areas of improvement
>
> > Using MatchTagsPlugin + Inline JavascriptPlugin (www.tiddlytools.com)
>
> > {{center{<script>
> > var tids=store.getMatchingTiddlers("Cigar && ! excludeLists && !
> > Trash","modified").reverse();
> > var rr=tids.length
> > //check Raw Array
> > //document.write('<br>' + rr + ' raw array items' + '<br>')
>
> > var fmt='[[%0|%0]]';
> > var filter=[];
> > for (var i=0; i<tids.length; i++) {
> > var val1=tids[i].title;
> > if (store.getTiddlerSlice(val1,"PersonalRank") < 9)
> > continue;
> > if (store.getTiddlerSlice(val1,"PersonalRank") == "Not
> > Rated")
> > continue;
> > if (store.getTiddlerSlice(val1,"Purchased") != "Yes")
> > continue;
> > filter.push(fmt.format([val1]));
> > }
> > filter.join('\n');
> > var ra=filter.length
> > //check filtered array
> > //document.write('<br>' + ra + ' filtered array items' + '<br>')
>
> > var out=[];
> > if (!filter.length) out=["No Cigars found"];
> > var ry=Math.floor(Math.random()*filter.length)
>
> > return(filter[ry] + ' {{small{(random cigar rated 9 or above) ' +ry
> > +'/'+ra+'}}}')
> > </script><script>
>
> > setTimeout("config.refreshers.content(document.getElementById('fD'))",
> > 60000);
> > </script>}}}
>
> > Thanks,
>
> > Mike
--
You received this message because you are subscribed to the Google Groups
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/tiddlywiki?hl=en.