mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-10-31 15:42:59 +00:00 
			
		
		
		
	Extend fieldmodules to include an "editType" field
This will allow us to provide the right HTML5 input element for things like colours and dates
This commit is contained in:
		| @@ -606,7 +606,7 @@ $tw.Tiddler = function(/* [fields,] fields */) { | ||||
| 			} else { | ||||
| 				// Parse the field with the associated field module (if any) | ||||
| 				var fieldModule = $tw.Tiddler.fieldModules[t]; | ||||
| 				if(fieldModule) { | ||||
| 				if(fieldModule && fieldModule.parse) { | ||||
| 					this.fields[t] = fieldModule.parse.call(this,src[t]); | ||||
| 				} else { | ||||
| 					this.fields[t] = src[t]; | ||||
| @@ -633,6 +633,10 @@ $tw.modules.define("$:/boot/tiddlerfields/created","tiddlerfield",{ | ||||
| 	parse: $tw.utils.parseDate, | ||||
| 	stringify: $tw.utils.stringifyDate | ||||
| }); | ||||
| $tw.modules.define("$:/boot/tiddlerfields/color","tiddlerfield",{ | ||||
| 	name: "color", | ||||
| 	editType: "color" | ||||
| }); | ||||
| $tw.modules.define("$:/boot/tiddlerfields/tags","tiddlerfield",{ | ||||
| 	name: "tags", | ||||
| 	parse: $tw.utils.parseStringArray, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jeremy Ruston
					Jeremy Ruston