Thanks FND

Retag works well when you want to remove two (maybe three) tags only.


When I used
<<reTag "WasComm" "=comms" "=place" "=pinged" ''=pingpong'' ''=ponged'' >>

The resultant message was
Work Comms: added WasComm and removed =comms; =place; =pinged;* ;
=pingpong''; ; =ponged''*

But
 =pingpong =ponged

remained taged.

Is there an easy way to generalise it further ?

config.macros.reTag = {
        btnLabel: "reTag",

        btnTooltip: "change tiddler tagging",

        handler: function(place, macroName, params, wikifier, paramString, 
tiddler) {
                var newTag = params.shift() || null;
                var delTags = params;
                var btn = createTiddlyButton(place, this.btnLabel, 
this.btnTooltip,

                        this.onClick);
                jQuery(btn).data("tiddler", tiddler).data("newTag", newTag).
                        data("delTags", delTags);
        },
        onClick: function(ev) {
                var btn = jQuery(this);
                var tiddler = btn.data("tiddler");

                var newTag = btn.data("newTag");
                var delTags = btn.data("delTags");
                for(var i = 0; i < delTags.length; i++) {
                        tiddler.tags.remove(delTags[i]);
                }
                if(newTag) {
                        tiddler.tags.pushUnique(newTag);

                }
                store.saveTiddler(tiddler.title, tiddler.title, tiddler.text,
                        tiddler.modifier, tiddler.modified, tiddler.tags, 
tiddler.fields,
                        false, tiddler.created, tiddler.creator);
                displayMessage(tiddler.title + ": added " + newTag + " and 
removed " +

                        delTags.join("; "));
        }

};





TonyM

If you have not found an easy way to do it with TiddlyWiki, you have missed
something.
www.tiddlywiki.com



On Thu, Feb 25, 2010 at 06:47, FND <[email protected]> wrote:

>  That seems to work for standard tags. Unfortunately I have tags beginning
>> with "=" and other punctuation characters.
>>
>
> I don't see why that'd make any difference. In fact, I've just tested this,
> and it seems to work fine:
>    <<reTag qux =foo @bar %baz>>
>
>
>  eg; <<reTag ".task" "=comms =place =ping">>
>>
>
> Your quotes are off; each tag should be a separate parameter:
>
>    <<reTag ".task" "=comms" "=place" "=ping">>
>    or simply
>
>    <<reTag ".task" =comms =place =ping>>
>
>
> -- F.
>
>
> --
> 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]<tiddlywiki%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/tiddlywiki?hl=en.
>
>

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