1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-23 11:47:38 +00:00

Add wikitext shortcut for new-style function definitions

This commit is contained in:
jeremy@jermolene.com
2022-04-30 12:44:26 +01:00
parent 886c8620f5
commit c9bd1b5274
6 changed files with 169 additions and 5 deletions

View File

@@ -48,7 +48,13 @@ SetWidget.prototype.execute = function() {
this.setValue = this.getAttribute("value");
this.setEmptyValue = this.getAttribute("emptyValue");
// Set context variable
this.setVariable(this.setName,this.getValue(),this.parseTreeNode.params,!!this.parseTreeNode.isMacroDefinition);
if(this.parseTreeNode.isMacroDefinition) {
this.setVariable(this.setName,this.getValue(),this.parseTreeNode.params,!!this.parseTreeNode.isMacroDefinition);
} else if(this.parseTreeNode.isFunctionDefinition) {
this.setVariable(this.setName,this.getValue(),undefined,undefined,{isFunctionDefinition: this.parseTreeNode.isFunctionDefinition,variableParams: this.parseTreeNode.variableParams});
} else {
this.setVariable(this.setName,this.getValue());
}
// Construct the child widgets
this.makeChildWidgets();
};