From dd3ee2a603cba35770a8f109e070f271d72861f8 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Wed, 12 Mar 2014 21:56:46 +0000 Subject: [PATCH] Extend tag manager to edit icons assigned to tags Add a dropdown for choosing available images for a tag. As part of this change we need to tag tiddlers that contain images typed as wikitext (these are inline SVG icons) so that we can display them in the dropdown. --- core/images/cancel-button.tid | 1 + core/images/close-button.tid | 1 + core/images/delete-button.tid | 1 + core/images/done-button.tid | 1 + core/images/down-arrow.tid | 1 + core/images/edit-button.tid | 1 + core/images/info-button.tid | 1 + core/images/new-button.tid | 1 + core/images/options-button.tid | 1 + core/images/save-button.tid | 1 + core/ui/TagManager.tid | 15 +++++++++++++++ themes/tiddlywiki/vanilla/base.tid | 2 +- 12 files changed, 26 insertions(+), 1 deletion(-) diff --git a/core/images/cancel-button.tid b/core/images/cancel-button.tid index e8f0ef210..2ce32e674 100644 --- a/core/images/cancel-button.tid +++ b/core/images/cancel-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/cancel-button +tags: $:/tags/Image \ No newline at end of file diff --git a/core/images/close-button.tid b/core/images/close-button.tid index 46b276279..f438edcc1 100644 --- a/core/images/close-button.tid +++ b/core/images/close-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/close-button +tags: $:/tags/Image diff --git a/core/images/delete-button.tid b/core/images/delete-button.tid index c25e8c081..c0c25b50e 100644 --- a/core/images/delete-button.tid +++ b/core/images/delete-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/delete-button +tags: $:/tags/Image diff --git a/core/images/done-button.tid b/core/images/done-button.tid index 93d7fba2a..e89efaa1d 100644 --- a/core/images/done-button.tid +++ b/core/images/done-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/done-button +tags: $:/tags/Image diff --git a/core/images/down-arrow.tid b/core/images/down-arrow.tid index b1ac83e65..e4e543636 100644 --- a/core/images/down-arrow.tid +++ b/core/images/down-arrow.tid @@ -1,3 +1,4 @@ title: $:/core/images/down-arrow +tags: $:/tags/Image diff --git a/core/images/edit-button.tid b/core/images/edit-button.tid index 4ee3bb44c..8600bca71 100644 --- a/core/images/edit-button.tid +++ b/core/images/edit-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/edit-button +tags: $:/tags/Image diff --git a/core/images/info-button.tid b/core/images/info-button.tid index 1d0a17cec..6da295c56 100644 --- a/core/images/info-button.tid +++ b/core/images/info-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/info-button +tags: $:/tags/Image diff --git a/core/images/new-button.tid b/core/images/new-button.tid index e9bd63e4a..760181001 100644 --- a/core/images/new-button.tid +++ b/core/images/new-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/new-button +tags: $:/tags/Image diff --git a/core/images/options-button.tid b/core/images/options-button.tid index f2c2610a5..2365cec17 100644 --- a/core/images/options-button.tid +++ b/core/images/options-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/options-button +tags: $:/tags/Image diff --git a/core/images/save-button.tid b/core/images/save-button.tid index 701c6892c..88e55fd4e 100644 --- a/core/images/save-button.tid +++ b/core/images/save-button.tid @@ -1,3 +1,4 @@ title: $:/core/images/save-button +tags: $:/tags/Image diff --git a/core/ui/TagManager.tid b/core/ui/TagManager.tid index 3d52f40c2..09410e6c9 100644 --- a/core/ui/TagManager.tid +++ b/core/ui/TagManager.tid @@ -1,17 +1,32 @@ title: $:/TagManager +\define iconEditor(title) +<$edit-text field="icon" tag="input"/> <$button popup=<> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}} +
+<$reveal state=<> type="nomatch" text="" default=""> +<$linkcatcher to="$title$!!icon"> +
+<$list filter="[is[shadow]is[image]] [!is[shadow]is[image]] [is[shadow]tag[$:/tags/Image]] [!is[shadow]tag[$:/tags/Image]] +[sort[title]]"><$link to={{!!title}}><$view field="title"/> + +
+ + +
+\end + <$list filter="[tags[]!is[system]sort[title]]"> + diff --git a/themes/tiddlywiki/vanilla/base.tid b/themes/tiddlywiki/vanilla/base.tid index 72beac63c..405e8cf99 100644 --- a/themes/tiddlywiki/vanilla/base.tid +++ b/themes/tiddlywiki/vanilla/base.tid @@ -302,7 +302,7 @@ a.tw-tiddlylink-external:hover { background-color: <>; } -.tw-tag-label svg { +.tw-tag-label svg, .tw-tag-label img { height: 1em; width: 1em; fill: <>;
Tag Count ColourIcon
<$transclude tiddler="$:/core/ui/TagTemplate"/> <$count filter="[is[current]tagging[]]"/> <$edit-text field="color" tag="input" type="color"/><$macrocall $name="iconEditor" title={{!!title}}/>