mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-26 01:50:28 +00:00
144ec28552
@pmario this adds the tc-tagged- classes to the edit template, do you think that's useful?
26 lines
1.6 KiB
Plaintext
26 lines
1.6 KiB
Plaintext
title: $:/core/ui/EditTemplate
|
|
|
|
\define save-tiddler-actions()
|
|
<$action-sendmessage $message="tm-add-tag" $param={{{ [<newTagNameTiddler>get[text]] }}}/>
|
|
<$action-deletetiddler $tiddler=<<newTagNameTiddler>>/>
|
|
<$action-sendmessage $message="tm-add-field" $name={{{ [<newFieldNameTiddler>get[text]] }}} $value={{{ [<newFieldValueTiddler>get[text]] }}}/>
|
|
<$action-deletetiddler $tiddler=<<newFieldNameTiddler>>/>
|
|
<$action-deletetiddler $tiddler=<<newFieldValueTiddler>>/>
|
|
<$action-sendmessage $message="tm-save-tiddler"/>
|
|
\end
|
|
<div data-tiddler-title=<<currentTiddler>> data-tags={{!!tags}} class={{{ tc-tiddler-frame tc-tiddler-edit-frame [<currentTiddler>is[tiddler]then[tc-tiddler-exists]] [<currentTiddler>is[missing]!is[shadow]then[tc-tiddler-missing]] [<currentTiddler>is[shadow]then[tc-tiddler-exists tc-tiddler-shadow]] [<currentTiddler>is[system]then[tc-tiddler-system]] [{!!class}] [<currentTiddler>tags[]encodeuricomponent[]addprefix[tc-tagged-]] +[join[ ]] }}}>
|
|
<$fieldmangler>
|
|
<$vars storyTiddler=<<currentTiddler>> newTagNameTiddler=<<qualify "$:/temp/NewTagName">> newFieldNameTiddler=<<qualify "$:/temp/NewFieldName">> newFieldValueTiddler=<<qualify "$:/temp/NewFieldValue">>>
|
|
<$keyboard key="((cancel-edit-tiddler))" message="tm-cancel-tiddler">
|
|
<$keyboard key="((save-tiddler))" actions=<<save-tiddler-actions>>>
|
|
<$list filter="[all[shadows+tiddlers]tag[$:/tags/EditTemplate]!has[draft.of]]" variable="listItem">
|
|
<$set name="tv-config-toolbar-class" filter="[<tv-config-toolbar-class>] [<listItem>encodeuricomponent[]addprefix[tc-btn-]]">
|
|
<$transclude tiddler=<<listItem>>/>
|
|
</$set>
|
|
</$list>
|
|
</$keyboard>
|
|
</$keyboard>
|
|
</$vars>
|
|
</$fieldmangler>
|
|
</div>
|