2016-11-28 19:17:25 +00:00
|
|
|
title: $:/core/macros/tag-picker
|
|
|
|
tags: $:/tags/Macro
|
|
|
|
|
2016-12-18 20:43:26 +00:00
|
|
|
\define add-tag-actions()
|
|
|
|
<$action-sendmessage $message="tm-add-tag" $param={{$:/temp/NewTagName}}/>
|
|
|
|
<$action-deletetiddler $tiddler="$:/temp/NewTagName"/>
|
|
|
|
\end
|
|
|
|
|
2016-11-28 19:17:25 +00:00
|
|
|
\define tag-button()
|
|
|
|
<$button class="tc-btn-invisible" tag="a">
|
|
|
|
$(actions)$
|
|
|
|
<$action-deletetiddler $tiddler="$:/temp/NewTagName"/>
|
|
|
|
<$macrocall $name="tag-pill" tag=<<tag>>/>
|
|
|
|
</$button>
|
|
|
|
\end
|
|
|
|
|
|
|
|
\define tag-picker(actions)
|
|
|
|
<$set name="actions" value="""$actions$""">
|
|
|
|
<div class="tc-edit-add-tag">
|
|
|
|
<span class="tc-add-tag-name">
|
2016-12-18 20:43:26 +00:00
|
|
|
<$keyboard key="ENTER" actions=<<add-tag-actions>>>
|
2016-11-28 19:17:25 +00:00
|
|
|
<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<<qualify "$:/state/popup/tags-auto-complete">> class="tc-edit-texteditor tc-popup-handle"/>
|
2016-12-18 20:43:26 +00:00
|
|
|
</$keyboard>
|
2016-11-28 19:17:25 +00:00
|
|
|
</span> <$button popup=<<qualify "$:/state/popup/tags-auto-complete">> class="tc-btn-invisible" tooltip={{$:/language/EditTemplate/Tags/Dropdown/Hint}} aria-label={{$:/language/EditTemplate/Tags/Dropdown/Caption}}>{{$:/core/images/down-arrow}}</$button> <span class="tc-add-tag-button">
|
|
|
|
<$set name="tag" value={{$:/temp/NewTagName}}>
|
|
|
|
<$button set="$:/temp/NewTagName" setTo="" class="">
|
|
|
|
$actions$
|
|
|
|
<$action-deletetiddler $tiddler="$:/temp/NewTagName"/>
|
|
|
|
{{$:/language/EditTemplate/Tags/Add/Button}}
|
|
|
|
</$button>
|
|
|
|
</$set>
|
|
|
|
</span>
|
|
|
|
</div>
|
|
|
|
<div class="tc-block-dropdown-wrapper">
|
|
|
|
<$reveal state=<<qualify "$:/state/popup/tags-auto-complete">> type="nomatch" text="" default="">
|
|
|
|
<div class="tc-block-dropdown">
|
|
|
|
<$list filter="[tags[]!is[system]search:title{$:/temp/NewTagName}sort[]]" variable="tag">
|
|
|
|
<<tag-button>>
|
|
|
|
</$list>
|
|
|
|
<hr>
|
|
|
|
<$list filter="[tags[]is[system]search:title{$:/temp/NewTagName}sort[]]" variable="tag">
|
|
|
|
<<tag-button>>
|
|
|
|
</$list>
|
|
|
|
</div>
|
|
|
|
</$reveal>
|
|
|
|
</div>
|
|
|
|
</$set>
|
|
|
|
\end
|