mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-28 11:00:27 +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:
parent
f285f850d7
commit
0be6bf84d1
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user