1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-31 07:32:59 +00:00

Renamed 'handler' member of macros

Used to be called "code". And associated documentation changes
This commit is contained in:
Jeremy Ruston
2012-01-15 12:16:28 +00:00
parent 58bd8744e9
commit e2a0955ced
11 changed files with 10 additions and 12 deletions

View File

@@ -15,7 +15,7 @@ exports.macro = {
params: {
text: {byPos: 0, type: "text", optional: false}
},
code: function(type,tiddler,store,params) {
handler: function(type,tiddler,store,params) {
if(type === "text/html") {
return utils.htmlEncode(params.text);
} else {

View File

@@ -14,7 +14,7 @@ exports.macro = {
types: ["text/html","text/plain"],
params: {
},
code: function(type,tiddler,store,params) {
handler: function(type,tiddler,store,params) {
var encoder = type === "text/html" ? utils.htmlEncode : function(x) {return x;},
parseTree = store.parseTiddler(tiddler.fields.title);
if(parseTree) {

View File

@@ -41,7 +41,7 @@ exports.macro = {
template: {byName: true, type: "tiddler", optional: true},
emptyMessage: {byName: true, type: "text", optional: true}
},
code: function(type,tiddler,store,params) {
handler: function(type,tiddler,store,params) {
var templateType = "text/x-tiddlywiki",
templateText = "<<view title link>>",
template = params.template ? store.getTiddler(params.template) : null,

View File

@@ -16,7 +16,7 @@ exports.macro = {
story: {byName: "default", type: "text", optional: false},
template: {byName: true, type: "text", optional: true}
},
code: function(type,tiddler,store,params) {
handler: function(type,tiddler,store,params) {
var tiddlers = store.getTiddlerText(params.story).split("\n"),
t,
output = [];

View File

@@ -17,7 +17,7 @@ exports.macro = {
target: {byName: "default", type: "tiddler", optional: false},
"with": {byName: true, type: "text", optional: true, dependentAll: true}
},
code: function(type,tiddler,store,params) {
handler: function(type,tiddler,store,params) {
if(params["with"]) {
// Parameterised transclusion
var targetTiddler = store.getTiddler(params.target),

View File

@@ -14,7 +14,7 @@ exports.macro = {
types: ["text/html","text/plain"],
params: {
},
code: function(type,tiddler,store,params) {
handler: function(type,tiddler,store,params) {
return "5.0.0";
}
};

View File

@@ -17,7 +17,7 @@ exports.macro = {
format: {byPos: 1, type: "text", optional: true},
template: {byPos: 2, type: "text", optional: true}
},
code: function(type,tiddler,store,params) {
handler: function(type,tiddler,store,params) {
var v = tiddler.fields[params.field],
encoder = type === "text/html" ? utils.htmlEncode : function(x) {return x;};
if(v) {