Tag completion min length (#3190)

* tested with tw5.com index.html

* Controls the length of the input before the tag list is filtered
print-window-tiddler
Mario Pietsch 2018-04-02 20:43:18 +02:00 zatwierdzone przez Jeremy Ruston
rodzic e4660a8cc1
commit 2e8eb15536
3 zmienionych plików z 23 dodań i 2 usunięć

Wyświetl plik

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

Wyświetl plik

@ -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>

Wyświetl plik

@ -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