Hi Guys,

>
> > I think a list of macros, ordered in terms of their simplicity would be
> > useful in learning how to approach writing them oneself
>
> good idea.
>
>
Seconded. This is a great idea. There is a gap between people picking
tiddlywiki up and then using it as the extensible flexible platform
that it is to create useful and interesting applications.

><script>
>var ref = store.getReferringTiddlers(tiddler.title);
>if (ref.length > 0) {
>
>jQuery('#tiddler'+tiddler.title).find('.command_references').css("color","red");
>}
>
></script>

This is cool. Simple but effective.
I had a little play with it and noticed that it didn't work if the
tiddler title had a space in it (e.g. Test Tiddler).
jQuery('#tiddler'+tiddler.title) wouldn't pick it up.
So I changed that line to
jQuery(story.findContainingTiddler(place)).find('.command_references').css("color","red");
which uses tiddlywiki's place reference.

I haven't made it into a fully fledged plugin but I have created a
macro for it:

config.macros.referringTiddlers = {
    handler: function (place, macroName, params, wikifier,
paramString, tiddler) {

        var tids = store.getReferringTiddlers(tiddler.title);
        if (tids.length > 0) {
            var id = story.findContainingTiddler(place);
        
jQuery(story.findContainingTiddler(place)).find('.command_references').css("color","red");
        }
    }
};

You can then use it in a tiddler where you want this functionality by
using <<referringTiddlers>>
Or you can add it to the ViewTemplate so that it applies to all
tiddlers, using something like <span class='test'
macro='referringTiddlers' ></span>

If I get time I might work on this further.

Hope that helps,

Colm

-- 
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.

Reply via email to