title: $:/plugins/Gk0Wk/CPL-Repo/views/galleries/home
caption: <$text text={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[首页]else[Home]] }}} />
created: 20231010113426627
modified: 20231010200115158
tags: 
type: text/vnd.tiddlywiki

\import $:/plugins/Gk0Wk/CPL-Repo/views/plugins/list-item
\import $:/plugins/Gk0Wk/CPL-Repo/views/plugins/size
\import $:/plugins/Gk0Wk/CPL-Repo/views/plugins/paged-list
\define go-search()
<$action-sendmessage
    $message="cpl-search-plugins"
    query={{$:/temp/CPL-Repo/searchplugin-home/input}}
    saveTo="$:/temp/CPL-Repo/searchplugin-home/result"
/>
\end

<div style="width:100%;display:flex">
<div class="cpl-plugin-search">
<$macrocall
    $name="keyboard-driven-input"
    tiddler="$:/temp/CPL-Repo/searchplugin-home/input"
    tag="input"
    class="tc-edit-texteditor tc-popup-handle"
    focus="true"
    filterMinLength="2"
    placeholder={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]then[搜索插件...]else[Search for plugin...]] }}}
    inputAcceptActions=<<go-search>>
    class="tc-titlebar tc-edit-texteditor"
/>
</div>
<$button class="tc-primary-btn tc-btn-big-green cpl-plugin-search-go" disabled={{$:/temp/CPL-Repo/searching-plugin}}>
    <$text text={{{ [[$:/language]get[text]removeprefix[$:/languages/]else[en-GB]search[zh]] :then[{$:/temp/CPL-Repo/searching-plugin}match[yes]then[搜索中...]else[搜索]] :else[{$:/temp/CPL-Repo/searching-plugin}match[yes]then[Searching...]else[Search]] }}} />
    <<go-search>>
</$button>
</div>
<$list filter="[[$:/temp/CPL-Repo/searching-plugin]is[tiddler]!field:text[yes]]">
<div class="cpl-status-banner cpl-status-banner-error">
	<$text text={{{ [<chinese>match[yes]then[出现了一些问题]else[Some errors occured]] }}}/>: <$text text={{!!text}}/>
</div>
</$list>
<$list filter="[[$:/temp/CPL-Repo/searchplugin-home/result]is[tiddler]then[yes]else[no]]" variable="go">
<!-- 有搜索结果时展示 -->
<$list filter="[<go>match[yes]]" variable="t">
<<paged-plugin-list filter:"[{$:/temp/CPL-Repo/searchplugin-home/result}jsonget[]]" field:"home-gallery" class1:"cpl-plugin-info-box" class2:"cpl-paged-plugin-list-control">>
</$list>
</$list>