Hi TWizards
I'm using ITW (BidiX's Iphone tw-adaption)
I am using toggletagplugin (http://trac.tiddlywiki.org/browser/Trunk/
contributors/SimonBaird/mptw/trunk/core/ToggleTagPlugin.js?rev=4331)
to tag other tiddlers in the TW.
ITW uses tiddleruploadplugin - and uploads individual tiddlers
automatically when you click finish.
The tiddlers don't get uploaded when i use toggletag - therefore I
have to use TiddlyTweakerPlugin to select all tiddlers tagged with a
certain tag - and afterwards I hit the "update tiddlers"-button.
TiddlerTweakerPlugin doesnt provide any tweakable macros for making
your own dedicated tag button..
I think I need something like:
<a href="javascript:;" \
title="select tiddlers with at least one
matching tag"\
onclick="\
var t=prompt(\'Enter space-separated tags
(match ONE)\');\
if (!t||!t.length) return false;\
var tags=t.readBracketedList();\
var f=this; while
(f&&f.nodeName.toLowerCase()!=\'form\')
f=f.parentNode;\
for (var t=0; t<f.list.options.length; t++) {\
f.list.options[t].selected=false;\
var
tid=store.getTiddler(f.list.options[t].value);\
if (tid&&tid.tags.containsAny(tags))
f.list.options
[t].selected=true;\
}\
config.macros.tiddlerTweaker.selecttiddlers(f.list);\
return false">tags</a>
and the tiddler update button - some of this code:
settiddlers: function(here) {
var f=here.form; var list=f.list;
var tids=[];
for (i=0;i<list.length;i++) if (list.options[i].selected)
tids.push
(list.options[i].value);
if (!tids.length) { alert("please select at least one tiddler");
return; }
var cdate=new Date
(f.cy.value,f.cm.value-1,f.cd.value,f.ch.value,f.cn.value);
var mdate=new Date
(f.my.value,f.mm.value-1,f.md.value,f.mh.value,f.mn.value);
if (tids.length>1 && !confirm("Are you sure you want to update
these
tiddlers:\n\n"+tids.join(', '))) return;
store.suspendNotifications();
for (t=0;t<tids.length;t++) {
var tid=store.getTiddler(tids[t]); if (!tid) continue;
var title=!f.settitle.checked?tid.title:f.title.value;
var who=!f.setwho.checked?tid.modifier:f.who.value;
var text=tid.text;
if (f.replacetext.checked) text=text.replace(new RegExp
(f.pattern.value,'mg'),f.replacement.value);
var tags=tid.tags;
if (f.settags.checked) {
var intags=f.tags.value.readBracketedList();
var addtags=[]; var deltags=[]; var reptags=[];
for (i=0;i<intags.length;i++) {
if (intags[i].substr(0,1)=='+')
addtags.push(intags[i].substr(1));
else if (intags[i].substr(0,1)=='-')
deltags.push(intags[i].substr(1));
else
reptags.push(intags[i]);
I would be very glad if someone could clean up my mess and explain how
I can make this work - If i can....
YS Måns Mårtensson
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---