1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-22 19:27:40 +00:00

Simplify metaparameters implementation

This commit is contained in:
jeremy@jermolene.com
2022-06-03 11:21:32 +01:00
parent b57a6da548
commit 542df63ccf
2 changed files with 19 additions and 19 deletions

View File

@@ -306,19 +306,22 @@ TranscludeWidget.prototype.getTransclusionParameter = function(name,index,defaul
/*
Get one of the special parameters to be provided by the parameters widget
*/
TranscludeWidget.prototype.getTransclusionMetaParameter = function(name) {
switch(name) {
case "parseAsInline":
return this.parseAsInline ? "yes" : "no";
case "parseTreeNodes":
return JSON.stringify(this.parseTreeNode);
case "slotFillParseTrees":
return JSON.stringify(this.slotFillParseTrees);
case "params":
return JSON.stringify(this.stringParametersByName);
default:
return "";
}
TranscludeWidget.prototype.getTransclusionMetaParameters = function() {
var self = this;
return {
"parseAsInline": function() {
return self.parseAsInline ? "yes" : "no";
},
"parseTreeNodes": function() {
return JSON.stringify(self.parseTreeNode);
},
"slotFillParseTrees": function() {
return JSON.stringify(self.slotFillParseTrees);
},
"params": function() {
JSON.stringify(self.stringParametersByName);
}
};
};
/*