Skip to content

Commit

Permalink
Improve handling of popup state
Browse files Browse the repository at this point in the history
An improvement to 6fb9926

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).
  • Loading branch information
Jermolene committed Jun 22, 2014
1 parent 12b5ebb commit 0fae9ee
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion core/templates/save-all.tid
@@ -1,6 +1,6 @@
title: $:/core/save/all

\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
{{$:/core/templates/tiddlywiki5.html}}
2 changes: 1 addition & 1 deletion core/templates/save-empty.tid
@@ -1,6 +1,6 @@
title: $:/core/save/empty

\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
{{$:/core/templates/tiddlywiki5.html}}
2 changes: 1 addition & 1 deletion core/templates/save-lazy-images.tid
@@ -1,6 +1,6 @@
title: $:/core/save/lazy-images

\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
{{$:/core/templates/tiddlywiki5.html}}
6 changes: 3 additions & 3 deletions core/ui/EditTemplate/tags.tid
Expand Up @@ -15,8 +15,8 @@ background-color:$(backgroundColor)$;

<div class="tw-edit-add-tag">
<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"/>
</span> <$button popup=<<qualify "$:/state/tagsAutoComplete">> class="btn-invisible btn-dropdown">{{$:/core/images/down-arrow}}</$button> <span class="tw-add-tag-button">
<$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/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="">
<<lingo Tags/Add/Button>>
</$button>
Expand All @@ -25,7 +25,7 @@ background-color:$(backgroundColor)$;

<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">

Expand Down
4 changes: 2 additions & 2 deletions core/ui/EditTemplate/type.tid
Expand Up @@ -2,10 +2,10 @@ title: $:/core/ui/EditTemplate/type
tags: $:/tags/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">
<$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">
<$linkcatcher to="!!type">
<$list filter='[all[shadows+tiddlers]prefix[$:/language/Docs/Types/]each[group]sort[group]]'>
Expand Down
4 changes: 2 additions & 2 deletions core/ui/MissingTemplate.tid
@@ -1,10 +1,10 @@
title: $:/core/ui/MissingTemplate

<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" />
</$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">
<$transclude tiddler="$:/core/ui/ListItemTemplate"/>
<hr>
Expand Down
4 changes: 2 additions & 2 deletions core/ui/TagManager.tid
Expand Up @@ -2,9 +2,9 @@ title: $:/TagManager

\define lingo-base() $:/language/TagManager/
\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">
<$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">
<div class="tw-block-dropdown tw-edit-type-dropdown">
<$list filter="[all[shadows+tiddlers]is[image]] [all[shadows+tiddlers]tag[$:/tags/Image]] +[sort[title]]">
Expand Down
4 changes: 2 additions & 2 deletions core/ui/TagTemplate.tid
Expand Up @@ -5,11 +5,11 @@ background-color:$(backgroundColor)$;
\end
<span class="tw-tag-list-item">
<$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" />
</$button>
</$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>
<$list filter="[all[current]tagging[]]" template="$:/core/ui/ListItemTemplate"/>
</div>
Expand Down
4 changes: 2 additions & 2 deletions core/ui/UntaggedTemplate.tid
@@ -1,10 +1,10 @@
title: $:/core/ui/UntaggedTemplate

\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>>
</$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">
<$list filter="[untagged[]!is[system]] -[tags[]] +[sort[title]]" template="$:/core/ui/ListItemTemplate"/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion core/ui/ViewTemplate.tid
Expand Up @@ -3,6 +3,6 @@ title: $:/core/ui/ViewTemplate
\define frame-classes()
tw-tiddler-frame tw-tiddler-view-frame $(missingTiddlerClass)$ $(shadowTiddlerClass)$ $(systemTiddlerClass)$
\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>
</$tiddler></$set></$set>

0 comments on commit 0fae9ee

Please sign in to comment.