1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 12:07:19 +00:00

Restored operation of sliders in info macro

Accidentally clobbered in the last refactoring
This commit is contained in:
Jeremy Ruston 2012-02-02 18:15:59 +00:00
parent 58ab36ef51
commit 15cfed83f4
2 changed files with 22 additions and 8 deletions

View File

@ -15,6 +15,14 @@ exports.macro = {
params: {
info: {byName: "default", type: "text", optional: false}
},
events: {
click: function(event,node,tiddler,store,params) {
var el = node.firstChild.firstChild.nextSibling;
el.style.display = el.style.display === "block" ? "none" : "block";
event.preventDefault();
return false;
}
},
render: function(type,tiddler,store,params) {
var encoder = type === "text/html" ? utils.htmlEncode : function(x) {return x;},
info = params.info || "parsetree";
@ -22,18 +30,23 @@ exports.macro = {
var parseTree = store.parseTiddler(tiddler.title);
switch(info) {
case "parsetree":
return utils.stitchSlider(type,"Parse tree","The parse tree for this tiddler",parseTree.toString(type));
return utils.stitchSlider(type,
"Parse tree",
"The parse tree for this tiddler",
parseTree.toString(type));
//break;
case "compiled":
return utils.stitchSlider(type,"Render functions","The render functions for this tiddler",parseTree.compile(type).toString(type));
return utils.stitchSlider(type,
"Render functions",
"The render functions for this tiddler",
parseTree.compile(type).toString(type));
//break;
case "dependencies":
if(parseTree.dependencies === null) {
return encoder("Dependencies: *");
} else {
return encoder("Dependencies: " + parseTree.dependencies.join(", "));
}
break;
return utils.stitchSlider(type,
"Dependencies",
"The dependencies for this tiddler",
(parseTree.dependencies === null) ? "*" : encoder(parseTree.dependencies.join(", ")));
//break;
}
}
}

View File

@ -8,4 +8,5 @@ modifier: JeremyRuston
{{body{
<<view text wikified>>}}}
<<info parsetree>>
<<info dependencies>>
<<info compiled>>