Hi!
On http://bookmark.noteboko.tiddlyspot.com/ I found the
RandomlinkMacro, which displays a random page onclick. The problem is,
that site uses TiddlyWiki version 2.2.5. I tried the macro on version
2.6.1, but it doesn't work. Here's the code:
config.macros.randomlink= {
label: "Random Tiddler",
prompt: "Show a random tiddler"
};
config.macros.randomlink.handler = function(place, macroName, params)
{
var randomlinkHandler = function(e)
{
if (!e) var e = window.event;
var la = [];
if (!params[0]) {
store.forEachTiddler(function(title,tiddler){la.push(tiddler);});
} else {
la = store.getTaggedTiddlers(params[0]);
}
var rndnum = Math.floor(Math.random() * la.length);
displayTiddler(resolveTarget(e), la[rndnum].title, 0, null, null,
true, false);
}
createTiddlyButton(place,this.label,this.prompt,randomlinkHandler);
}
Any ideas?
w
--
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.