http://trac.tiddlywiki.org/changeset/12244
FND
2010-06-29 01:14:03 -0700 (Tue, 29 Jun 2010)
175
refactored macros to take advantage of createTiddlyElement's attribs arg
plenty more potential for similar enhancements - not to mention the
potential of using jQuery instead
---------------
U Trunk/core/js/Macros.js
---------------
Modified: Trunk/core/js/Macros.js
===================================================================
--- Trunk/core/js/Macros.js 2010-06-28 15:10:04 UTC (rev 12243)
+++ Trunk/core/js/Macros.js 2010-06-29 08:14:03 UTC (rev 12244)
@@ -116,9 +116,9 @@
var tiddlerName = names[0];
var className = names[1] || null;
var args = params[0]["with"];
- var wrapper = createTiddlyElement(place,"span",null,className);
- wrapper.setAttribute("refresh","content");
- wrapper.setAttribute("tiddler",tiddlerName);
+ var wrapper = createTiddlyElement(place,"span",null,className,null,{
+ refresh: "content", tiddler: tiddlerName
+ });
if(args!==undefined)
wrapper.setAttribute("args","[["+args.join("]] [[")+"]]");
this.transclude(wrapper,tiddlerName,args);
@@ -368,12 +368,10 @@
story.setDirty(tiddler.title,true);
var e,v;
if(field != "text" && !rows) {
- e = createTiddlyElement(null,"input");
- e.setAttribute("edit",field);
- e.setAttribute("type","text");
+ e = createTiddlyElement(null,"input",null,null,null,{
+ type: "text", edit: field, size: "40",
autocomplete: "off"
+ });
e.value = store.getValue(tiddler,field) || defVal;
- e.setAttribute("size","40");
- e.setAttribute("autocomplete","off");
place.appendChild(e);
} else {
var wrapper1 =
createTiddlyElement(null,"fieldset",null,"fieldsetFix");
--
You received this message because you are subscribed to the Google Groups
"TiddlyWikiDev" 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/tiddlywikidev?hl=en.