mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 07:32:59 +00:00 
			
		
		
		
	SetWidget: Add "subtiddler" attribute
This commit is contained in:
		| @@ -42,6 +42,7 @@ SetWidget.prototype.execute = function() { | ||||
| 	this.setFilter = this.getAttribute("filter"); | ||||
| 	this.setSelect = this.getAttribute("select"); | ||||
| 	this.setTiddler = this.getAttribute("tiddler"); | ||||
| 	this.setSubTiddler = this.getAttribute("subtiddler"); | ||||
| 	this.setField = this.getAttribute("field"); | ||||
| 	this.setIndex = this.getAttribute("index"); | ||||
| 	this.setValue = this.getAttribute("value"); | ||||
| @@ -58,7 +59,12 @@ Get the value to be assigned | ||||
| SetWidget.prototype.getValue = function() { | ||||
| 	var value = this.setValue; | ||||
| 	if(this.setTiddler) { | ||||
| 		var tiddler = this.wiki.getTiddler(this.setTiddler); | ||||
| 		var tiddler; | ||||
| 		if(this.setSubTiddler) { | ||||
| 			tiddler = this.wiki.getSubTiddler(this.setTiddler,this.setSubTiddler); | ||||
| 		} else { | ||||
| 			tiddler = this.wiki.getTiddler(this.setTiddler);			 | ||||
| 		} | ||||
| 		if(!tiddler) { | ||||
| 			value = this.setEmptyValue; | ||||
| 		} else if(this.setField) { | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| caption: set | ||||
| created: 20131115182700000 | ||||
| modified: 20170712153850528 | ||||
| modified: 20180315165405442 | ||||
| tags: Widgets | ||||
| title: SetWidget | ||||
| type: text/vnd.tiddlywiki | ||||
| @@ -17,6 +17,7 @@ The content of the `<$set>` widget is the scope for the value assigned to the va | ||||
| |name |The name of the variable to assign (defaults to "currentTiddler") | | ||||
| |value |The value to assign to the variable if the filter is missing or not empty | | ||||
| |tiddler |<<.from-version "5.1.15">> Optional title of the tiddler from which to read the value | | ||||
| |subtiddler |<<.from-version "5.1.16">> Optionally specifies the title of a subtiddler within a plugin tiddler identified by the ''tiddler'' attribute | | ||||
| |field |<<.from-version "5.1.15">> Optional field of the tiddler from which to read the value (only used if ''tiddler'' is used) | | ||||
| |index |<<.from-version "5.1.15">> Optional index of the tiddler from which to read the value (only used if ''tiddler'' is used) | | ||||
| |filter |An optional filter to be evaluated and assigned to the variable (see below) | | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jermolene
					Jermolene