1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-27 03:57:21 +00:00

refactor: format

This commit is contained in:
lin onetwo 2024-03-28 21:02:05 +08:00
parent 4fb841b6cf
commit 9298e2d70b

View File

@ -2,50 +2,63 @@ title: $:/core/ui/EditTemplate/type
tags: $:/tags/EditTemplate
first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[description]sort[group-sort]removeprefix[$:/language/Docs/Types/]search<userInput>]
\define lingo-base() $:/language/EditTemplate/
\define input-cancel-actions() <$list filter="[<storeTitle>get[text]] [<currentTiddler>get[type]] +[limit[1]]" emptyMessage="""<<cancel-delete-tiddler-actions "cancel">>"""><$action-sendmessage $message="tm-remove-field" $param="type"/><$action-deletetiddler $filter="[<typeInputTiddler>] [<refreshTitle>] [<typeSelectionTiddler>]"/></$list>
\whitespace trim
\procedure lingo-base() $:/language/EditTemplate/
\procedure input-cancel-actions()
<$list
filter="[<storeTitle>get[text]] [<currentTiddler>get[type]] +[limit[1]]"
emptyMessage="""<<cancel-delete-tiddler-actions "cancel">>"""
>
<$action-sendmessage
$message="tm-remove-field"
$param="type"
/>
<$action-deletetiddler
$filter="[<typeInputTiddler>] [<refreshTitle>] [<typeSelectionTiddler>]"
/>
</$list>
\end
<$set name="refreshTitle" value=<<qualify "$:/temp/type-search/refresh">>>
<div class="tc-edit-type-selector-wrapper">
<em class="tc-edit tc-small-gap-right"><<lingo Type/Prompt>></em>
<div class="tc-type-selector-dropdown-wrapper">
<div class="tc-type-selector">
<$fieldmangler>
<$macrocall
$name="keyboard-driven-input"
tiddler=<<currentTiddler>>
storeTitle=<<typeInputTiddler>>
refreshTitle=<<refreshTitle>>
selectionStateTitle=<<typeSelectionTiddler>>
field="type"
tag="input"
default=""
placeholder={{$:/language/EditTemplate/Type/Placeholder}}
focusPopup=<<qualify "$:/state/popup/type-dropdown">>
class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle"
tabindex={{$:/config/EditTabIndex}}
focus={{{ [{$:/config/AutoFocus}match[type]then[true]] ~[[false]] }}}
cancelPopups="yes"
configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]"
inputCancelActions=<<input-cancel-actions>>
<$macrocall
$name="keyboard-driven-input"
tiddler=<<currentTiddler>>
storeTitle=<<typeInputTiddler>>
refreshTitle=<<refreshTitle>>
selectionStateTitle=<<typeSelectionTiddler>>
field="type"
tag="input"
default=""
placeholder={{$:/language/EditTemplate/Type/Placeholder}}
focusPopup=<<qualify "$:/state/popup/type-dropdown">>
class="tc-edit-typeeditor tc-edit-texteditor tc-popup-handle"
tabindex={{$:/config/EditTabIndex}}
focus={{{ [{$:/config/AutoFocus}match[type]then[true]] ~[[false]] }}}
cancelPopups="yes"
configTiddlerFilter="[[$:/core/ui/EditTemplate/type]]"
inputCancelActions=<<input-cancel-actions>>
/>
<$button
popup=<<qualify "$:/state/popup/type-dropdown">>
class="tc-btn-invisible tc-btn-dropdown tc-small-gap"
tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}}
<$button
popup=<<qualify "$:/state/popup/type-dropdown">>
class="tc-btn-invisible tc-btn-dropdown tc-small-gap"
tooltip={{$:/language/EditTemplate/Type/Dropdown/Hint}}
aria-label={{$:/language/EditTemplate/Type/Dropdown/Caption}}
>
{{$:/core/images/down-arrow}}
</$button>
<$button
message="tm-remove-field"
param="type"
class="tc-btn-invisible tc-btn-icon"
tooltip={{$:/language/EditTemplate/Type/Delete/Hint}}
<$button
message="tm-remove-field"
param="type"
class="tc-btn-invisible tc-btn-icon"
tooltip={{$:/language/EditTemplate/Type/Delete/Hint}}
aria-label={{$:/language/EditTemplate/Type/Delete/Caption}}
>
{{$:/core/images/delete-button}}
<$action-deletetiddler
<$action-deletetiddler
$filter="[<typeInputTiddler>] [<storeTitle>] [<refreshTitle>] [<selectionStateTitle>]"
/>
</$button>
@ -53,37 +66,37 @@ first-search-filter: [all[shadows+tiddlers]prefix[$:/language/Docs/Types/]sort[d
</div>
<div class="tc-block-dropdown-wrapper">
<$set name="tv-show-missing-links" value="yes">
<$reveal
state=<<qualify "$:/state/popup/type-dropdown">>
type="nomatch"
text=""
<$reveal
state=<<qualify "$:/state/popup/type-dropdown">>
type="nomatch"
text=""
default=""
>
<div class="tc-block-dropdown tc-edit-type-dropdown">
<$linkcatcher to="!!type">
<$list
<$list
filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group-sort]]'
>
<div class="tc-dropdown-item">
<$text text={{!!group}}/>
</div>
<$set name="userInput" value={{{ [<typeInputTiddler>get[text]] }}}>
<$list
<$list
filter="[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]group{!!group}] +[sort[description]] +[removeprefix[$:/language/Docs/Types/]] +[search<userInput>]"
>
<span
<span
class={{{ [<currentTiddler>addsuffix[-primaryList]] -[<typeSelectionTiddler>get[text]] +[then[]else[tc-list-item-selected]] }}}
>
<$link
<$link
to={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]get[name]] }}}
>
<$view
tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}}
<$view
tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}}
field="description"
/>
<$text text=" "/>
(<$view
tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}}
(<$view
tiddler={{{ [<currentTiddler>addprefix[$:/language/Docs/Types/]] }}}
field="name"
/>)
</$link>