From 8239275edb98437a9fbfc7f9427e0950155a91f9 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Mon, 10 Mar 2014 18:16:10 +0000 Subject: [PATCH] Add dropdown of canned filter searches Now you can pick from a dropdown of predefined filtered searches in the advanced search filter tab. --- core/language/en-GB/Filters.multids | 12 ++++++++++++ core/ui/AdvancedSearch/Filter.tid | 20 ++++++++++---------- core/ui/Filters/AllTags.tid | 5 +++++ core/ui/Filters/AllTiddlers.tid | 5 +++++ core/ui/Filters/Drafts.tid | 5 +++++ core/ui/Filters/Missing.tid | 5 +++++ core/ui/Filters/Orphans.tid | 5 +++++ core/ui/Filters/OverriddenShadowTiddlers.tid | 5 +++++ core/ui/Filters/RecentTiddlers.tid | 5 +++++ core/ui/Filters/ShadowTiddlers.tid | 5 +++++ core/ui/Filters/SystemTags.tid | 5 +++++ core/ui/Filters/SystemTiddlers.tid | 5 +++++ themes/tiddlywiki/vanilla/base.tid | 4 ++++ 13 files changed, 76 insertions(+), 10 deletions(-) create mode 100644 core/language/en-GB/Filters.multids create mode 100644 core/ui/Filters/AllTags.tid create mode 100644 core/ui/Filters/AllTiddlers.tid create mode 100644 core/ui/Filters/Drafts.tid create mode 100644 core/ui/Filters/Missing.tid create mode 100644 core/ui/Filters/Orphans.tid create mode 100644 core/ui/Filters/OverriddenShadowTiddlers.tid create mode 100644 core/ui/Filters/RecentTiddlers.tid create mode 100644 core/ui/Filters/ShadowTiddlers.tid create mode 100644 core/ui/Filters/SystemTags.tid create mode 100644 core/ui/Filters/SystemTiddlers.tid diff --git a/core/language/en-GB/Filters.multids b/core/language/en-GB/Filters.multids new file mode 100644 index 000000000..e004db926 --- /dev/null +++ b/core/language/en-GB/Filters.multids @@ -0,0 +1,12 @@ +title: $:/language/Filters/ + +AllTiddlers: All tiddlers except system tiddlers +RecentTiddlers: Recently modified tiddlers +AllTags: All tags except system tags +Missing: Missing tiddlers +Drafts: Draft tiddlers +Orphans: Orphan tiddlers +SystemTiddlers: System tiddlers +ShadowTiddlers: Shadow tiddlers +OverriddenShadowTiddlers: Overridden shadow tiddlers +SystemTags: System tags diff --git a/core/ui/AdvancedSearch/Filter.tid b/core/ui/AdvancedSearch/Filter.tid index e8c8b1488..c9394a177 100644 --- a/core/ui/AdvancedSearch/Filter.tid +++ b/core/ui/AdvancedSearch/Filter.tid @@ -7,22 +7,22 @@ caption: {{$:/language/Search/Filter/Caption}} <> - + + +
+<$reveal state=<> type="nomatch" text="" default=""> +
+<$list filter="[is[shadow]tag[$:/tags/Filter]] [!is[shadow]tag[$:/tags/Filter]] +[sort[description]]"><$link to={{!!filter}}><$transclude field="description"/> + +
+ +
<$reveal state="$:/temp/advancedsearch" type="nomatch" text=""> -
- <> - <$list filter={{$:/temp/advancedsearch}} template="$:/core/ui/ListItemTemplate"/> -
- - - -<$reveal state="$:/temp/advancedsearch" type="match" text=""> - diff --git a/core/ui/Filters/AllTags.tid b/core/ui/Filters/AllTags.tid new file mode 100644 index 000000000..c82ade230 --- /dev/null +++ b/core/ui/Filters/AllTags.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/AllTags +tags: $:/tags/Filter +filter: [tags[]!is[system]sort[title]] +description: {{$:/language/Filters/AllTags}} + diff --git a/core/ui/Filters/AllTiddlers.tid b/core/ui/Filters/AllTiddlers.tid new file mode 100644 index 000000000..b205df411 --- /dev/null +++ b/core/ui/Filters/AllTiddlers.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/AllTiddlers +tags: $:/tags/Filter +filter: [!is[system]sort[title]] +description: {{$:/language/Filters/AllTiddlers}} + diff --git a/core/ui/Filters/Drafts.tid b/core/ui/Filters/Drafts.tid new file mode 100644 index 000000000..67d26b6b6 --- /dev/null +++ b/core/ui/Filters/Drafts.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/Drafts +tags: $:/tags/Filter +filter: [has[draft.of]sort[title]] +description: {{$:/language/Filters/Drafts}} + diff --git a/core/ui/Filters/Missing.tid b/core/ui/Filters/Missing.tid new file mode 100644 index 000000000..9b0fecfac --- /dev/null +++ b/core/ui/Filters/Missing.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/Missing +tags: $:/tags/Filter +filter: [is[missing]sort[title]] +description: {{$:/language/Filters/Missing}} + diff --git a/core/ui/Filters/Orphans.tid b/core/ui/Filters/Orphans.tid new file mode 100644 index 000000000..74a08fd8f --- /dev/null +++ b/core/ui/Filters/Orphans.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/Orphans +tags: $:/tags/Filter +filter: [is[orphan]sort[title]] +description: {{$:/language/Filters/Orphans}} + diff --git a/core/ui/Filters/OverriddenShadowTiddlers.tid b/core/ui/Filters/OverriddenShadowTiddlers.tid new file mode 100644 index 000000000..d3da003f7 --- /dev/null +++ b/core/ui/Filters/OverriddenShadowTiddlers.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/OverriddenShadowTiddlers +tags: $:/tags/Filter +filter: [is[tiddler]is[shadow]] +description: {{$:/language/Filters/OverriddenShadowTiddlers}} + diff --git a/core/ui/Filters/RecentTiddlers.tid b/core/ui/Filters/RecentTiddlers.tid new file mode 100644 index 000000000..b3fe43e5a --- /dev/null +++ b/core/ui/Filters/RecentTiddlers.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/RecentTiddlers +tags: $:/tags/Filter +filter: [!is[system]has[modified]!sort[modified]] +description: {{$:/language/Filters/RecentTiddlers}} + diff --git a/core/ui/Filters/ShadowTiddlers.tid b/core/ui/Filters/ShadowTiddlers.tid new file mode 100644 index 000000000..dd86a8a0f --- /dev/null +++ b/core/ui/Filters/ShadowTiddlers.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/ShadowTiddlers +tags: $:/tags/Filter +filter: [is[shadow]sort[title]] +description: {{$:/language/Filters/ShadowTiddlers}} + diff --git a/core/ui/Filters/SystemTags.tid b/core/ui/Filters/SystemTags.tid new file mode 100644 index 000000000..44b05039b --- /dev/null +++ b/core/ui/Filters/SystemTags.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/SystemTags +tags: $:/tags/Filter +filter: [tags[]is[system]] [is[shadow]tags[]is[system]] +[sort[title]] +description: {{$:/language/Filters/SystemTags}} + diff --git a/core/ui/Filters/SystemTiddlers.tid b/core/ui/Filters/SystemTiddlers.tid new file mode 100644 index 000000000..4faaed263 --- /dev/null +++ b/core/ui/Filters/SystemTiddlers.tid @@ -0,0 +1,5 @@ +title: $:/core/Filters/SystemTiddlers +tags: $:/tags/Filter +filter: [is[system]sort[title]] +description: {{$:/language/Filters/SystemTiddlers}} + diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index a173a4cc0..cce13ebc6 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -317,6 +317,10 @@ a.tw-tiddlylink-external:hover { color: <>; } +.tw-advanced-search input { + width: 60%; +} + .tw-search a svg { height: 0.75em; }