1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-04-05 18:26:56 +00:00

make filtering the story-river work

This commit is contained in:
BurningTreeC 2024-10-10 19:34:49 +02:00
parent a26716c998
commit 569ec747fa
6 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,9 @@
title: $:/core/ui/KeyboardShortcuts/filter-river
tags: $:/tags/KeyboardShortcut
key: ((filter-river))
<%if [{$:/state/story-river/filter}!match[yes]] %>
<$action-setfield $tiddler="$:/state/story-river/filter" text="yes"/>
<% else %>
<$action-deletetiddler $tiddler="$:/state/story-river/filter"/>
<% endif %>

View File

@ -14,7 +14,11 @@ tags: $:/tags/PageTemplate
</section>
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" template="$:/core/ui/StoryTiddlerTemplate" storyview={{$:/view}} emptyMessage={{$:/config/EmptyStoryMessage}}/>
<$vars searchPrefix="[" searchSuffix="]">
<$list filter=<<tf.story-river.filter>> history="$:/HistoryList" template="$:/core/ui/StoryTiddlerTemplate" storyview={{$:/view}} emptyMessage={{$:/config/EmptyStoryMessage}}/>
</$vars>
<section class="story-frontdrop">

View File

@ -67,6 +67,14 @@ tags: $:/tags/SideBarSegment
<<advanced-search-actions>>
{{$:/core/images/advanced-search-button}}
</$button>
<$button tooltip="filter" class={{{ [{$:/state/story-river/filter}match[yes]then[tc-selected]] tc-btn-invisible +[join[ ]] }}}>
<%if [{$:/state/story-river/filter}!match[yes]] %>
<$action-setfield $tiddler="$:/state/story-river/filter" text="yes"/>
<% else %>
<$action-deletetiddler $tiddler="$:/state/story-river/filter"/>
<% endif %>
{{$:/core/images/github}}
</$button>
<$button class="tc-btn-invisible">
<<cancel-search-actions>><$action-sendmessage $message="tm-focus-selector" $param=".tc-search input"/>
{{$:/core/images/close-button}}

View File

@ -0,0 +1,3 @@
title: $:/config/StoryFilter/fields
*

View File

@ -0,0 +1,3 @@
title: $:/config/StoryFilter/flags
words

View File

@ -1,3 +1,4 @@
title: $:/core/wiki/functions/search
tags: $:/tags/Global
\function tf.story-river.filter() [[list]addsuffix[<tv-story-list>]addsuffix[$(searchSuffix)$]substitute[]addsuffix[ ]addsuffix[:filter]addsuffix[$(searchPrefix)$]substitute[]addsuffix[{$:/state/story-river/filter}match]addsuffix[$(searchPrefix)$]substitute[]addsuffix[yes]addsuffix[$(searchSuffix)$]substitute[]addsuffix[then<currentTiddler>]addsuffix[search:]addsuffix{$:/config/StoryFilter/fields}addsuffix[:]addsuffix{$:/config/StoryFilter/flags}addsuffix[{$:/temp/search/input}]addsuffix[else{$:/state/story-river/filter}!match]addsuffix[$(searchPrefix)$]substitute[]addsuffix[yes]addsuffix[$(searchSuffix)$]substitute[]addsuffix[then<currentTiddler>]] +[addprefix[$(searchPrefix)$]substitute[]addsuffix[$(searchSuffix)$]substitute[]]