diff --git a/core/language/en-GB/EditTemplate.multids b/core/language/en-GB/EditTemplate.multids index 90ee4975f..31f18765a 100644 --- a/core/language/en-GB/EditTemplate.multids +++ b/core/language/en-GB/EditTemplate.multids @@ -8,7 +8,7 @@ Field/Remove/Hint: Remove field Field/Dropdown/Caption: field list Field/Dropdown/Hint: Show field list Fields/Add/Button: add -Fields/Add/Button/Hint: add field +Fields/Add/Button/Hint: Add the new field to the tiddler Fields/Add/Name/Placeholder: field name Fields/Add/Prompt: Add a new field: Fields/Add/Value/Placeholder: field value diff --git a/core/ui/EditTemplate.tid b/core/ui/EditTemplate.tid index 273f06c0e..f3e82fa8f 100644 --- a/core/ui/EditTemplate.tid +++ b/core/ui/EditTemplate.tid @@ -1,11 +1,11 @@ title: $:/core/ui/EditTemplate -\define actions() -<$action-sendmessage $message="tm-add-tag" $param={{$:/temp/NewTagName}}/> -<$action-deletetiddler $tiddler="$:/temp/NewTagName"/> -<$action-sendmessage $message="tm-add-field" $name={{$:/temp/newfieldname}} $value={{$:/temp/newfieldvalue}}/> -<$action-deletetiddler $tiddler="$:/temp/newfieldname"/> -<$action-deletetiddler $tiddler="$:/temp/newfieldvalue"/> +\define save-tiddler-actions() +<$action-sendmessage $message="tm-add-tag" $param={{{ [get[text]] }}}/> +<$action-deletetiddler $tiddler=<>/> +<$action-sendmessage $message="tm-add-field" $name={{{ [get[text]] }}} $value={{{ [get[text]] }}}/> +<$action-deletetiddler $tiddler=<>/> +<$action-deletetiddler $tiddler=<>/> <$action-sendmessage $message="tm-save-tiddler"/> \end \define frame-classes() @@ -13,9 +13,9 @@ tc-tiddler-frame tc-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerCl \end
> data-tiddler-title=<>> <$fieldmangler> -<$set name="storyTiddler" value=<>> +<$vars storyTiddler=<> newTagNameTiddler=<> newFieldNameTiddler=<> newFieldValueTiddler=<>> <$keyboard key="((cancel-edit-tiddler))" message="tm-cancel-tiddler"> -<$keyboard key="((save-tiddler))" actions=<>> +<$keyboard key="((save-tiddler))" actions=<>> <$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem"> <$set name="tv-config-toolbar-class" filter="[] [encodeuricomponent[]addprefix[tc-btn-]]"> <$transclude tiddler=<>/> @@ -23,6 +23,6 @@ tc-tiddler-frame tc-tiddler-edit-frame $(missingTiddlerClass)$ $(shadowTiddlerCl - +
diff --git a/core/ui/EditTemplate/fields.tid b/core/ui/EditTemplate/fields.tid index f65454a17..5368404a3 100644 --- a/core/ui/EditTemplate/fields.tid +++ b/core/ui/EditTemplate/fields.tid @@ -10,15 +10,26 @@ $:/config/EditTemplateFields/Visibility/$(currentField)$ [[hide]] -[title{$(config-title)$}] \end +\define current-tiddler-new-field-selector() +[data-tiddler-title="$(currentTiddlerCSSescaped)$"] .tc-edit-field-add-name input +\end + +\define new-field-actions() +<$action-sendmessage $message="tm-add-field" $name={{{ [get[text]] }}} $value={{{ [get[text]] }}}/> +<$action-deletetiddler $tiddler=<>/> +<$action-deletetiddler $tiddler=<>/> +<$action-sendmessage $message="tm-focus-selector" $param=<>/> +\end + \define new-field() -<$vars name={{$:/temp/newfieldname}}> +<$vars name={{{ [get[text]] }}}> <$reveal type="nomatch" text="" default=<>> <$button tooltip=<>> <$action-sendmessage $message="tm-add-field" $name=<> -$value={{$:/temp/newfieldvalue}}/> -<$action-deletetiddler $tiddler="$:/temp/newfieldname"/> -<$action-deletetiddler $tiddler="$:/temp/newfieldvalue"/> +$value={{{ [get[text]] }}}/> +<$action-deletetiddler $tiddler=<>/> +<$action-deletetiddler $tiddler=<>/> <> @@ -67,11 +78,12 @@ $value={{$:/temp/newfieldvalue}}/> <$reveal state=<> type="nomatch" text="" default="">
<$set name="tv-show-missing-links" value="yes"> -<$linkcatcher to="$:/temp/newfieldname"> +<$linkcatcher to=<>>
<>
-<$list filter="[!is[shadow]!is[system]fields[]search:title{$:/temp/newfieldname}sort[]] -created -creator -draft.of -draft.title -modified -modifier -tags -text -title -type" variable="currentField"> +<$set name="newFieldName" value={{{ [get[text]] }}}> +<$list filter="[!is[shadow]!is[system]fields[]search:titlesort[]] -created -creator -draft.of -draft.title -modified -modifier -tags -text -title -type" variable="currentField"> <$link to=<>> <$text text=<>/> @@ -79,17 +91,22 @@ $value={{$:/temp/newfieldvalue}}/>
<>
-<$list filter="[fields[]search:title{$:/temp/newfieldname}sort[]] -[!is[shadow]!is[system]fields[]]" variable="currentField"> +<$list filter="[fields[]search:titlesort[]] -[!is[shadow]!is[system]fields[]]" variable="currentField"> <$link to=<>> <$text text=<>/> +
-<$edit-text tiddler="$:/temp/newfieldvalue" tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} class="tc-edit-texteditor" tabindex={{$:/config/EditTabIndex}}/> +<$set name="currentTiddlerCSSescaped" value={{{ [escapecss[]] }}}> +<$keyboard key="((add-field))" actions=<>> +<$edit-text tiddler=<> tag="input" default="" placeholder={{$:/language/EditTemplate/Fields/Add/Value/Placeholder}} class="tc-edit-texteditor" tabindex={{$:/config/EditTabIndex}}/> + +   <$macrocall $name="new-field"/> diff --git a/core/ui/EditToolbar/save.tid b/core/ui/EditToolbar/save.tid index 8c5a81b01..cd69d7686 100644 --- a/core/ui/EditToolbar/save.tid +++ b/core/ui/EditToolbar/save.tid @@ -3,13 +3,9 @@ tags: $:/tags/EditToolbar caption: {{$:/core/images/done-button}} {{$:/language/Buttons/Save/Caption}} description: {{$:/language/Buttons/Save/Hint}} +\define save-tiddler-button() <$fieldmangler><$button tooltip={{$:/language/Buttons/Save/Hint}} aria-label={{$:/language/Buttons/Save/Caption}} class=<>> -<$action-sendmessage $message="tm-add-tag" $param={{$:/temp/NewTagName}}/> -<$action-deletetiddler $tiddler="$:/temp/NewTagName"/> -<$action-sendmessage $message="tm-add-field" $name={{$:/temp/newfieldname}} $value={{$:/temp/newfieldvalue}}/> -<$action-deletetiddler $tiddler="$:/temp/newfieldname"/> -<$action-deletetiddler $tiddler="$:/temp/newfieldvalue"/> -<$action-sendmessage $message="tm-save-tiddler"/> +<> <$list filter="[match[yes]]"> {{$:/core/images/done-button}} @@ -17,3 +13,5 @@ description: {{$:/language/Buttons/Save/Hint}} <$text text={{$:/language/Buttons/Save/Caption}}/> +\end +<> diff --git a/core/wiki/config/ShortcutInfo.multids b/core/wiki/config/ShortcutInfo.multids index 2c67ec29e..e1dd4e179 100644 --- a/core/wiki/config/ShortcutInfo.multids +++ b/core/wiki/config/ShortcutInfo.multids @@ -1,5 +1,6 @@ title: $:/config/ShortcutInfo/ +add-field: {{$:/language/EditTemplate/Fields/Add/Button/Hint}} advanced-search: {{$:/language/Buttons/AdvancedSearch/Hint}} bold: {{$:/language/Buttons/Bold/Hint}} cancel-edit-tiddler: {{$:/language/Buttons/Cancel/Hint}} diff --git a/core/wiki/config/shortcuts/shortcuts.multids b/core/wiki/config/shortcuts/shortcuts.multids index 1d192df9a..1fbb9576b 100644 --- a/core/wiki/config/shortcuts/shortcuts.multids +++ b/core/wiki/config/shortcuts/shortcuts.multids @@ -1,5 +1,6 @@ title: $:/config/shortcuts/ +add-field: enter advanced-search: ctrl-shift-A cancel-edit-tiddler: escape excise: ctrl-E diff --git a/core/wiki/macros/tag-picker.tid b/core/wiki/macros/tag-picker.tid index 2d36b2eb3..ce7738df0 100644 --- a/core/wiki/macros/tag-picker.tid +++ b/core/wiki/macros/tag-picker.tid @@ -2,14 +2,14 @@ title: $:/core/macros/tag-picker tags: $:/tags/Macro \define add-tag-actions() -<$action-sendmessage $message="tm-add-tag" $param={{$:/temp/NewTagName}}/> -<$action-deletetiddler $tiddler="$:/temp/NewTagName"/> +<$action-sendmessage $message="tm-add-tag" $param={{{ [get[text]] }}}/> +<$action-deletetiddler $tiddler=<>/> \end \define tag-button() <$button class="tc-btn-invisible" tag="a" tooltip={{$:/language/EditTemplate/Tags/Add/Button/Hint}}> <$action-sendmessage $message="tm-add-tag" $param=<>/> -<$action-deletetiddler $tiddler="$:/temp/NewTagName"/> +<$action-deletetiddler $tiddler=<>/> <$macrocall $name="tag-pill" tag=<>/> \end @@ -18,13 +18,13 @@ tags: $:/tags/Macro
<$keyboard key="ENTER" actions=<>> -<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<> class="tc-edit-texteditor tc-popup-handle" tabindex=<> focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}}/> +<$edit-text tiddler=<> tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<> class="tc-edit-texteditor tc-popup-handle" tabindex=<> focus={{{ [{$:/config/AutoFocus}match[tags]then[true]] ~[[false]] }}}/> <$button popup=<> class="tc-btn-invisible" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}} -<$set name="tag" value={{$:/temp/NewTagName}}> +<$set name="tag" value={{{ [get[text]] }}}> <$button set="$:/temp/NewTagName" setTo="" class=""> <> -<$action-deletetiddler $tiddler="$:/temp/NewTagName"/> +<$action-deletetiddler $tiddler=<>/> {{$:/language/EditTemplate/Tags/Add/Button}} @@ -33,15 +33,17 @@ tags: $:/tags/Macro
<$reveal state=<> type="nomatch" text="" default="">
-<$list filter="[{$:/temp/NewTagName}minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="""
{{$:/language/Search/Search/TooShort}}
""" variable="listItem"> -<$list filter="[tags[]!is[system]search:title{$:/temp/NewTagName}sort[]]" variable="tag"> +<$set name="newTagName" value={{{ [get[text]] }}}> +<$list filter="[minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="""
{{$:/language/Search/Search/TooShort}}
""" variable="listItem"> +<$list filter="[tags[]!is[system]search:titlesort[]]" variable="tag"> <>
-<$list filter="[{$:/temp/NewTagName}minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="""
{{$:/language/Search/Search/TooShort}}
""" variable="listItem"> -<$list filter="[tags[]is[system]search:title{$:/temp/NewTagName}sort[]]" variable="tag"> +<$list filter="[minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="""
{{$:/language/Search/Search/TooShort}}
""" variable="listItem"> +<$list filter="[tags[]is[system]search:titlesort[]]" variable="tag"> <> +