Improve handling of popup state

An improvement to 6fb992690d

By making sure that all the popup state tiddlers have the prefix
$:/state/popup/ we can be more selective and just exclude popup state
tiddlers when we save. The end result is that once again other kinds of
state are persisted as expected (eg tabs, and sidebar visibility).
print-window-tiddler
Jermolene 2014-06-22 11:14:11 +01:00
rodzic 12b5ebb946
commit 0fae9ee992
10 zmienionych plików z 17 dodań i 17 usunięć

Wyświetl plik

@ -1,6 +1,6 @@
title: $:/core/save/all title: $:/core/save/all
\define saveTiddlerFilter() \define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] [is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
\end \end
{{$:/core/templates/tiddlywiki5.html}} {{$:/core/templates/tiddlywiki5.html}}

Wyświetl plik

@ -1,6 +1,6 @@
title: $:/core/save/empty title: $:/core/save/empty
\define saveTiddlerFilter() \define saveTiddlerFilter()
[is[system]] -[prefix[$:/state/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]] [is[system]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] +[sort[title]]
\end \end
{{$:/core/templates/tiddlywiki5.html}} {{$:/core/templates/tiddlywiki5.html}}

Wyświetl plik

@ -1,6 +1,6 @@
title: $:/core/save/lazy-images title: $:/core/save/lazy-images
\define saveTiddlerFilter() \define saveTiddlerFilter()
[is[tiddler]] -[prefix[$:/state/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[!is[system]is[image]] +[sort[title]] [is[tiddler]] -[prefix[$:/state/popup/]] -[[$:/boot/boot.css]] -[type[application/javascript]library[yes]] -[[$:/boot/boot.js]] -[[$:/boot/bootprefix.js]] -[!is[system]is[image]] +[sort[title]]
\end \end
{{$:/core/templates/tiddlywiki5.html}} {{$:/core/templates/tiddlywiki5.html}}

Wyświetl plik

@ -15,8 +15,8 @@ background-color:$(backgroundColor)$;
<div class="tw-edit-add-tag"> <div class="tw-edit-add-tag">
<span class="tw-add-tag-name"> <span class="tw-add-tag-name">
<$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<<qualify "$:/state/tagsAutoComplete">> class="tw-edit-texteditor"/> <$edit-text tiddler="$:/temp/NewTagName" tag="input" default="" placeholder={{$:/language/EditTemplate/Tags/Add/Placeholder}} focusPopup=<<qualify "$:/state/popup/tags-auto-complete">> class="tw-edit-texteditor"/>
</span> <$button popup=<<qualify "$:/state/tagsAutoComplete">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <span class="tw-add-tag-button"> </span> <$button popup=<<qualify "$:/state/popup/tags-auto-complete">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <span class="tw-add-tag-button">
<$button message="tw-add-tag" param={{$:/temp/NewTagName}} set="$:/temp/NewTagName" setTo="" class=""> <$button message="tw-add-tag" param={{$:/temp/NewTagName}} set="$:/temp/NewTagName" setTo="" class="">
<<lingo Tags/Add/Button>> <<lingo Tags/Add/Button>>
</$button> </$button>
@ -25,7 +25,7 @@ background-color:$(backgroundColor)$;
<div class="tw-block-dropdown-wrapper"> <div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/tagsAutoComplete">> type="nomatch" text="" default=""> <$reveal state=<<qualify "$:/state/popup/tags-auto-complete">> type="nomatch" text="" default="">
<div class="tw-block-dropdown"> <div class="tw-block-dropdown">

Wyświetl plik

@ -2,10 +2,10 @@ title: $:/core/ui/EditTemplate/type
tags: $:/tags/EditTemplate tags: $:/tags/EditTemplate
\define lingo-base() $:/language/EditTemplate/ \define lingo-base() $:/language/EditTemplate/
<p><$fieldmangler><em class="tw-edit"><<lingo Type/Prompt>></em> <$edit-text field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/typeDropdown">> class="tw-edit-typeeditor"/> <$button popup=<<qualify "$:/state/typeDropdown">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <$button message="tw-remove-field" param="type" class="btn-invisible btn-icon">{{$:/core/images/delete-button}}</$button></$fieldmangler></p> <p><$fieldmangler><em class="tw-edit"><<lingo Type/Prompt>></em> <$edit-text field="type" tag="input" default="" placeholder={{$:/language/EditTemplate/Type/Placeholder}} focusPopup=<<qualify "$:/state/popup/type-dropdown">> class="tw-edit-typeeditor"/> <$button popup=<<qualify "$:/state/popup/type-dropdown">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <$button message="tw-remove-field" param="type" class="btn-invisible btn-icon">{{$:/core/images/delete-button}}</$button></$fieldmangler></p>
<div class="tw-block-dropdown-wrapper"> <div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/typeDropdown">> type="nomatch" text="" default=""> <$reveal state=<<qualify "$:/state/popup/type-dropdown">> type="nomatch" text="" default="">
<div class="tw-block-dropdown tw-edit-type-dropdown"> <div class="tw-block-dropdown tw-edit-type-dropdown">
<$linkcatcher to="!!type"> <$linkcatcher to="!!type">
<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]'> <$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]'>

Wyświetl plik

@ -1,10 +1,10 @@
title: $:/core/ui/MissingTemplate title: $:/core/ui/MissingTemplate
<div class="tw-tiddler-missing"> <div class="tw-tiddler-missing">
<$button popup=<<qualify "$:/state/missingpopup">> class="btn-invisible tw-missing-tiddler-label"> <$button popup=<<qualify "$:/state/popup/missing">> class="btn-invisible tw-missing-tiddler-label">
<$view field="title" format="text" /> <$view field="title" format="text" />
</$button> </$button>
<$reveal state=<<qualify "$:/state/missingpopup">> type="popup" position="below" animate="yes"> <$reveal state=<<qualify "$:/state/popup/missing">> type="popup" position="below" animate="yes">
<div class="tw-drop-down"> <div class="tw-drop-down">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/> <$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr> <hr>

Wyświetl plik

@ -2,9 +2,9 @@ title: $:/TagManager
\define lingo-base() $:/language/TagManager/ \define lingo-base() $:/language/TagManager/
\define iconEditor(title) \define iconEditor(title)
<$edit-text field="icon" tag="input" size="20"/> <$button popup=<<qualify "$:/state/iconDropdown/$title$">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <$edit-text field="icon" tag="input" size="20"/> <$button popup=<<qualify "$:/state/popup/icon/$title$">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button>
<div class="tw-block-dropdown-wrapper"> <div class="tw-block-dropdown-wrapper">
<$reveal state=<<qualify "$:/state/iconDropdown/$title$">> type="nomatch" text="" default=""> <$reveal state=<<qualify "$:/state/popup/icon/$title$">> type="nomatch" text="" default="">
<$linkcatcher to="$title$!!icon"> <$linkcatcher to="$title$!!icon">
<div class="tw-block-dropdown tw-edit-type-dropdown"> <div class="tw-block-dropdown tw-edit-type-dropdown">
<$list filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] +[sort[title]]"> <$list filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] +[sort[title]]">

Wyświetl plik

@ -5,11 +5,11 @@ background-color:$(backgroundColor)$;
\end \end
<span class="tw-tag-list-item"> <span class="tw-tag-list-item">
<$set name="backgroundColor" value={{!!color}}> <$set name="backgroundColor" value={{!!color}}>
<$button popup=<<qualify "$:/state/tagpopup">> class="btn-invisible tw-tag-label" style=<<tag-styles>>> <$button popup=<<qualify "$:/state/popup/tag">> class="btn-invisible tw-tag-label" style=<<tag-styles>>>
<$transclude tiddler={{!!icon}}/> <$view field="title" format="text" /> <$transclude tiddler={{!!icon}}/> <$view field="title" format="text" />
</$button> </$button>
</$set> </$set>
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/> <$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below" animate="yes"><div class="tw-drop-down"><$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr> <hr>
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/> <$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
</div> </div>

Wyświetl plik

@ -1,10 +1,10 @@
title: $:/core/ui/UntaggedTemplate title: $:/core/ui/UntaggedTemplate
\define lingo-base() $:/language/SideBar/ \define lingo-base() $:/language/SideBar/
<$button popup=<<qualify "$:/state/tagpopup">> class="btn-invisible tw-untagged-label tw-tag-label"> <$button popup=<<qualify "$:/state/popup/tag">> class="btn-invisible tw-untagged-label tw-tag-label">
<<lingo Tags/Untagged/Caption>> <<lingo Tags/Untagged/Caption>>
</$button> </$button>
<$reveal state=<<qualify "$:/state/tagpopup">> type="popup" position="below"> <$reveal state=<<qualify "$:/state/popup/tag">> type="popup" position="below">
<div class="tw-drop-down"> <div class="tw-drop-down">
<$list filter="[untagged[]!is[system]] -[tags[]] +[sort[title]]" template="$:/core/ui/ListItemTemplate"/> <$list filter="[untagged[]!is[system]] -[tags[]] +[sort[title]]" template="$:/core/ui/ListItemTemplate"/>
</div> </div>

Wyświetl plik

@ -3,6 +3,6 @@ title: $:/core/ui/ViewTemplate
\define frame-classes() \define frame-classes()
tw-tiddler-frame tw-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$ tw-tiddler-frame tw-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
\end \end
<$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/tiddlerInfo">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list> <$set name="storyTiddler" value=<<currentTiddler>>><$set name="tiddlerInfoState" value=<<qualify "$:/state/popup/tiddler-info">>><$tiddler tiddler=<<currentTiddler>>><div class=<<frame-classes>>><$list filter="[all[shadows+tiddlers]tag[$:/tags/ViewTemplate]!has[draft.of]]" variable="listItem"><$transclude tiddler=<<listItem>>/></$list>
</div> </div>
</$tiddler></$set></$set> </$tiddler></$set></$set>