Hi!

In order to create buttons with scripts I use the wikify function with
<script>...</script>. This often includes a lot of escaping, so I've
decided to learn how to use the createTiddlyButton function.
Unfortunately, I'm missing something.

This is what I had before in a for-loop:
wikify("{{scriptbutton{<script label=\"Add to
"+listnsf[i].toTitleCase()+"\" title=\"Add to
"+listnsf[i].toTitleCase()+"\">store.setTiddlerTag(\""+ltr+"\",true,
\""+listnsf[i]+"\"); saveChanges(); refreshDisplay();<\/script>}}}<br/
>",place);

This is what I came up for createTiddlyButton:
var labelA = "Add to "+listnsf[i].toTitleCase();
var tooltipA = "Add to "+listnsf[i].toTitleCase();
var add = function() {store.setTiddlerTag("+ltr+",true,"+listnsf[i]
+"); saveChanges(); refreshDisplay();};
createTiddlyButton(place, labelA, tooltipA, add, "scriptbutton");
document.write("<br/>");

I get the buttons, but they don't have the "scriptbutton" class and
they don't work (add the tags). Can someone point me in the right
direction?

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.

Reply via email to