1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 17:10:29 +00:00

Get rid of the info macro

We may bring it back, but it's a hassle to keep it up to date at the
moment
This commit is contained in:
Jeremy Ruston 2012-02-21 21:56:27 +00:00
parent bc385abe23
commit 5a51604fdb

View File

@ -1,50 +0,0 @@
/*\
title: js/macros/info.js
\*/
(function(){
/*jslint node: true */
"use strict";
var Renderer = require("../Renderer.js").Renderer,
utils = require("../Utils.js");
exports.macro = {
name: "info",
types: ["text/html","text/plain"],
params: {
info: {byName: "default", type: "text"}
},
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";
if(tiddler) {
var parseTree = store.parseTiddler(tiddler.title);
switch(info) {
case "parsetree":
return [Renderer.SliderNode("parsetree",
"Parse tree",
"The parse tree for this tiddler",
(parseTree.toString(type)))];
//break;
case "compiled":
return [Renderer.SliderNode("compiled",
"Render functions",
"The render functions for this tiddler",
(parseTree.compile(type).toString(type)))];
//break;
}
}
}
};
})();