> and did some renaming, since I think <<referringTiddlers>> is
> missleading

Good point

> named the plugin: ColorfulToolbarPlugin, which left some space for
> more new macros
> and named the macro <<colorfulReferences>>

Much better.

> see:
> http://hoster.peermore.com/recipes/TeamWork/tiddlers.wiki#ColorfulToo...

I had a look and made a couple more tweaks. Hope you don't mind.
I edited it so that it can now take variables so a user can decide to
style the reference command in whatever way they want. And they could
use multiple styling rules too.

Here's the updated code;
if(!version.extensions.ColorfulToolbarPlugin) { //# ensure that the
plugin is only installed once
version.extensions.ColorfulToolbarPlugin = { installed: true };

config.macros.colorfulReferences = {
handler: function (place, macroName, params, wikifier,paramString,
tiddler) {
        var refAttribute = params[0] || 'color';
        var attValue    = params[1] || 'red';

        var tids = store.getReferringTiddlers(tiddler.title);
        if (tids.length > 0) {
                var id = story.findContainingTiddler(place);
                
jQuery(id).find('.command_references').css(refAttribute,attValue);
        } //; if
} // handler

}; // config.macros

} //# end of "install only once"


We can now use it with any CSS combo that the jQuery .css() method
takes. E.g.
<<colorfulReferences color green>>
<<colorfulReferences text-decoration underline>>

This macro is coming along nicely. Looking forward to seeing whatelse
can be added to it!

Cheers,

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