mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-11-12 21:09:57 +00:00
78ace99685
* feat: t macro and docs
* feat: support block mode so you can transclude whole tiddler
* refactor: use lingo and procedure
* refactor: use function instead of set variable
* docs: about mode:"inline"
* Update LingoMacro.tid
* docs: more usage about inline
* refactor: update translate macro to reuse lingo macro
* Delete translateMacro.tid
* refactor: update translation of tiddlyweb
* docs: more tiddlyweb l10n
* feat: add comment, so when use <$text text=<<lingo>> by mistake, it shows
* i18n: add more l10n
* feat: add tree to plugin to reveal l10n structure
* i18n: add menubar translation for example
* i18n: more for menubal
* docs: Headings -> Heading
* refactor: remove the "tree" tid
* Revert "refactor: remove the "tree" tid"
This reverts commit fb70f0b146
.
59 lines
3.7 KiB
Plaintext
59 lines
3.7 KiB
Plaintext
title: $:/plugins/tiddlywiki/menubar/items/search
|
|
custom-menu-content: {{$:/plugins/tiddlywiki/menubar/items/search}}
|
|
description: <<lingo Items/Search/Name $:/plugins/tiddlywiki/menubar/language/>>
|
|
caption: <<lingo Items/Search/Name $:/plugins/tiddlywiki/menubar/language/>>
|
|
tags: $:/tags/MenuBar
|
|
|
|
\define cancel-search-actions()
|
|
<$set name="userInput" value={{{ [<__storeTitle__>get[text]] }}}>
|
|
<$list filter="[<__tiddler__>get[text]!match<userInput>]" emptyMessage="""<$action-deletetiddler $filter="[<__storeTitle__>] [<__tiddler__>] [<__selectionStateTitle__>]"/>""">
|
|
<$action-setfield $tiddler=<<__tiddler__>> text=<<userInput>>/><$action-setfield $tiddler=<<__refreshTitle__>> text="yes"/>
|
|
</$list>
|
|
</$set>
|
|
\end
|
|
|
|
\define input-accept-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>"""><$action-navigate $to={{{ [<__tiddler__>get[text]] }}}/></$list>
|
|
|
|
\define input-accept-variant-actions() <$list filter="[{$:/config/Search/NavigateOnEnter/enable}match[yes]]" emptyMessage="""<$list filter="[<__tiddler__>get[text]!is[missing]] ~[<__tiddler__>get[text]is[shadow]]"><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>"""><$list filter="[<__tiddler__>get[text]minlength[1]]"><$action-sendmessage $message="tm-edit-tiddler" $param={{{ [<__tiddler__>get[text]] }}}/></$list></$list>
|
|
|
|
\define set-next-input-tab(beforeafter:"after") <$macrocall $name="change-input-tab" stateTitle="$:/state/tab/search-results/sidebar" tag="$:/tags/SearchResults" beforeafter="$beforeafter$" defaultState={{$:/config/SearchResults/Default}} actions="""<$action-setfield $tiddler="$:/state/search/currentTab" text=<<nextTab>>/>"""/>
|
|
|
|
\whitespace trim
|
|
<$vars searchTiddler="$:/temp/menubarsearch/input" searchListState=<<qualify "$:/state/search-list/selected-item">>>
|
|
<span style="margin: 0 0.5em;">
|
|
<$keyboard key="((input-tab-right))" actions=<<set-next-input-tab>>>
|
|
<$keyboard key="((input-tab-left))" actions=<<set-next-input-tab "before">>>
|
|
<form class="tc-form-inline">
|
|
<$macrocall $name="keyboard-driven-input" tiddler="$:/temp/menubarsearch" storeTitle=<<searchTiddler>> selectionStateTitle=<<searchListState>>
|
|
refreshTitle="$:/temp/menubarsearch/refresh" tag="input" type="search" focusPopup="$:/state/popup/menubar-search-dropdown"
|
|
class="tc-popup-handle tc-menu-show-when-wide" placeholder="Search..." default="" cancelPopups="yes"
|
|
inputAcceptActions=<<input-accept-actions>> inputAcceptVariantActions=<<input-accept-variant-actions>> inputCancelActions=<<cancel-search-actions>>
|
|
filterMinLength={{$:/config/Search/MinLength}} configTiddlerFilter="[[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}]" />
|
|
</form>
|
|
</$keyboard>
|
|
</$keyboard>
|
|
</span>
|
|
<$reveal tag="div" class="tc-block-dropdown-wrapper" state="$:/state/popup/menubar-search-dropdown" type="nomatch" text="" default="">
|
|
|
|
<div class="tc-block-dropdown tc-search-drop-down">
|
|
|
|
<$list filter="[<searchTiddler>get[text]minlength[1]]" emptyMessage="""<div class="tc-search-results">Type your search terms</div>""" variable="ignore">
|
|
|
|
<$list filter="[<searchTiddler>get[text]minlength{$:/config/Search/MinLength}limit[1]]" emptyMessage="""<div class="tc-search-results">{{$:/language/Search/Search/TooShort}}</div>""" variable="listItem">
|
|
|
|
<$vars configTiddler={{{ [[$:/state/search/currentTab]!is[missing]get[text]] ~[{$:/config/SearchResults/Default}] }}} userInput={{{ [<searchTiddler>get[text]] }}}>
|
|
|
|
{{$:/core/ui/SearchResults}}
|
|
|
|
</$vars>
|
|
|
|
</$list>
|
|
|
|
</$list>
|
|
|
|
</div>
|
|
|
|
</$reveal>
|
|
|
|
</$vars>
|