1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-24 22:33:16 +00:00

Tag completion min length (#3190)

* tested with tw5.com index.html

* Controls the length of the input before the tag list is filtered
This commit is contained in:
Mario Pietsch 2018-04-02 20:43:18 +02:00 committed by Jeremy Ruston
parent e4660a8cc1
commit 2e8eb15536
3 changed files with 23 additions and 2 deletions

View File

@ -0,0 +1,3 @@
title: $:/config/Tags/MinLength
0

View File

@ -6,6 +6,11 @@ tags: $:/tags/Macro
<$action-deletetiddler $tiddler="$:/temp/NewTagName"/>
\end
\define add-tag-actions()
<$action-sendmessage $message="tm-add-tag" $param={{$:/temp/NewTagName}}/>
<$action-deletetiddler $tiddler="$:/temp/NewTagName"/>
\end
\define tag-button()
<$button class="tc-btn-invisible" tag="a">
$(actions)$
@ -34,13 +39,15 @@ $actions$
<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="[{$:/temp/NewTagName}minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$list filter="[tags[]!is[system]search:title{$:/temp/NewTagName}sort[]]" variable="tag">
<<tag-button>>
</$list>
</$list></$list>
<hr>
<$list filter="[{$:/temp/NewTagName}minlength{$:/config/Tags/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
<$list filter="[tags[]is[system]search:title{$:/temp/NewTagName}sort[]]" variable="tag">
<<tag-button>>
</$list>
</$list></$list>
</div>
</$reveal>
</div>

View File

@ -0,0 +1,11 @@
created: 201712032331
modified: 201712032331
tags: [[Hidden Settings]]
title: Hidden Setting: Tags Minimum Length
type: text/vnd.tiddlywiki
<<.from-version "5.1.16">> Tag Dropdown: Controls the minimum length of an input string before results are displayed.
Defaults to "0".
$:/config/Tags/MinLength