1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-12-24 00:50:28 +00:00

Use the built-in tabs macro for the tiddler info panel and the sidebar tabs

Now you can insert your own tabs, too - see the release note
This commit is contained in:
Jermolene 2013-11-09 19:21:37 +00:00
parent a7bb331412
commit 0c8ba71edd
28 changed files with 142 additions and 116 deletions

View File

@ -1,64 +0,0 @@
title: $:/core/ui/MoreSideBar
<div class="tw-tab-set tw-more-sidebar"><div class="tw-tab-buttons">
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="allTab" selectedClass="tw-tab-selected">All</$button>
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="recentTab" selectedClass="tw-tab-selected">Recent</$button>
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="tagsTab" selectedClass="tw-tab-selected">Tags</$button>
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="missingTab" selectedClass="tw-tab-selected">Missing</$button>
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="draftsTab" selectedClass="tw-tab-selected">Drafts</$button>
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="orphanTab" selectedClass="tw-tab-selected">Orphans</$button>
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="typeTab" selectedClass="tw-tab-selected">Types</$button>
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="systemTab" selectedClass="tw-tab-selected">System</$button>
<$button type="set" set=<<qualify "$:/state/moreSideBarTabSet">> setTo="shadowsTab" selectedClass="tw-tab-selected">Shadows</$button>
</div><div class="tw-tab-content">
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="allTab">
<$list filter="[!is[system]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="recentTab">
{{$:/snippets/recentchanges}}
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="tagsTab">
<$list filter="[tags[]sort[title]]" itemClass="tw-menu-list-item">
<$transclude tiddler="$:/core/ui/TagTemplate"/> <small class="tw-menu-list-count"><$count filter="[is[current]tagging[]]"/></small>
</$list>
----
{{$:/core/ui/UntaggedTemplate}} <small class="tw-menu-list-count"><$count filter="[untagged[]!is[system]] -[tags[]]"/></small>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="missingTab">
<$list filter="[is[missing]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/MissingTemplate"/>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="draftsTab">
<$list filter="[has[draft.of]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="orphanTab">
<$list filter="[is[orphan]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="typeTab">
<$list filter="[!is[system]has[type]each[type]sort[type]]">
<div class="tw-menu-list-item">
<$view field="type"/>
<$list filter="[type{!!type}!is[system]sort[title]]">
<div class="tw-menu-list-subitem">
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
</div>
</$list>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="systemTab">
<$list filter="[is[system]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/moreSideBarTabSet">> text="shadowsTab">
<$list filter="[is[shadow]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>
</$reveal>
</div></div>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/MoreSideBar/All
tags: $:/tags/MoreSideBar
caption: All
<$list filter="[!is[system]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/MoreSideBar/Drafts
tags: $:/tags/MoreSideBar
caption: Drafts
<$list filter="[has[draft.of]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/MoreSideBar/Missing
tags: $:/tags/MoreSideBar
caption: Missing
<$list filter="[is[missing]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/MissingTemplate"/>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/MoreSideBar/Orphans
tags: $:/tags/MoreSideBar
caption: Orphans
<$list filter="[is[orphan]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/MoreSideBar/Recent
tags: $:/tags/MoreSideBar
caption: Recent
{{$:/snippets/recentchanges}}

View File

@ -0,0 +1,5 @@
title: $:/core/ui/MoreSideBar/Shadows
tags: $:/tags/MoreSideBar
caption: Shadows
<$list filter="[is[shadow]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/MoreSideBar/System
tags: $:/tags/MoreSideBar
caption: System
<$list filter="[is[system]sort[title]]" itemClass="tw-menu-list-item" template="$:/core/ui/ListItemTemplate"/>

View File

@ -0,0 +1,9 @@
title: $:/core/ui/MoreSideBar/Tags
tags: $:/tags/MoreSideBar
caption: Tags
<$list filter="[tags[]sort[title]]" itemClass="tw-menu-list-item">
<$transclude tiddler="$:/core/ui/TagTemplate"/> <small class="tw-menu-list-count"><$count filter="[is[current]tagging[]]"/></small>
</$list>
----
{{$:/core/ui/UntaggedTemplate}} <small class="tw-menu-list-count"><$count filter="[untagged[]!is[system]] -[tags[]]"/></small>

View File

@ -0,0 +1,14 @@
title: $:/core/ui/MoreSideBar/Types
tags: $:/tags/MoreSideBar
caption: Types
<$list filter="[!is[system]has[type]each[type]sort[type]]">
<div class="tw-menu-list-item">
<$view field="type"/>
<$list filter="[type{!!type}!is[system]sort[title]]">
<div class="tw-menu-list-subitem">
<$link to={{!!title}}><$view field="title"/></$link>
</div>
</$list>
</div>
</$list>

View File

@ -24,28 +24,7 @@ title: $:/core/ui/SideBar
<$reveal state="$:/temp/search" type="match" text="">
<div class="tw-tab-set">
<div class="tw-tab-buttons"><$button type="set" set=<<qualify "$:/state/sideBarTabSet">> setTo="openTab" selectedClass="tw-tab-selected">Open</$button><$button type="set" set=<<qualify "$:/state/sideBarTabSet">> setTo="recentTab" selectedClass="tw-tab-selected">Recent</$button><$button type="set" set=<<qualify "$:/state/sideBarTabSet">> setTo="toolsTab" selectedClass="tw-tab-selected">Tools</$button><$button type="set" set=<<qualify "$:/state/sideBarTabSet">> setTo="moreTab" selectedClass="tw-tab-selected">More</$button></div>
<div class="tw-tab-divider tw-sidebar-tab-divider">
</div>
<div class="tw-tab-content">
<$reveal type="match" state=<<qualify "$:/state/sideBarTabSet">> text="openTab">
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" storyview="pop" itemClass="tw-menu-list-item tw-open-tiddler-list">
<$button message="tw-close-tiddler" class="btn-invisible btn-mini">&times;</$button> <$link to={{!!title}}><$view field="title"/></$link>
</$list>
<$button message="tw-close-all-tiddlers" class="btn-invisible btn-mini">close all</$button>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/sideBarTabSet">> text="recentTab">
{{$:/snippets/recentchanges}}
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/sideBarTabSet">> text="toolsTab">
{{$:/core/ui/ToolsPanel}}
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/sideBarTabSet">> text="moreTab">
{{$:/core/ui/MoreSideBar}}
</$reveal>
</div>
</div>
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/SideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/SideBar]]" "$:/core/ui/SideBar/Open" "$:/sidebartab">>
</$reveal>
</div>

7
core/ui/SideBar/More.tid Normal file
View File

@ -0,0 +1,7 @@
title: $:/core/ui/SideBar/More
tags: $:/tags/SideBar
caption: More
<div class="tw-more-sidebar">
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]] [!is[shadow]!has[draft.of]tag[$:/tags/MoreSideBar]]" "$:/core/ui/MoreSideBar/Open" "$:/moresidebartab">>
</div>

8
core/ui/SideBar/Open.tid Normal file
View File

@ -0,0 +1,8 @@
title: $:/core/ui/SideBar/Open
tags: $:/tags/SideBar
caption: Open
<$list filter="[list[$:/StoryList]]" history="$:/HistoryList" storyview="pop" itemClass="tw-menu-list-item tw-open-tiddler-list">
<$button message="tw-close-tiddler" class="btn-invisible btn-mini">&times;</$button> <$link to={{!!title}}><$view field="title"/></$link>
</$list>
<$button message="tw-close-all-tiddlers" class="btn-invisible btn-mini">close all</$button>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/SideBar/Recent
tags: $:/tags/SideBar
caption: Recent
{{$:/snippets/recentchanges}}

View File

@ -1,4 +1,6 @@
title: $:/core/ui/ToolsPanel
title: $:/core/ui/SideBar/Tools
tags: $:/tags/SideBar
caption: Tools
[[Wiki Info|$:/WikiInfo]]

View File

@ -1,24 +1,3 @@
title: $:/core/ui/TiddlerInfo
<div class="tw-tab-set"><div class="tw-tab-buttons"><$button type="set" set=<<qualify "$:/state/tiddlerDropDownTabSet">> setTo="refTab" selectedClass="tw-tab-selected">References</$button><$button type="set" set=<<qualify "$:/state/tiddlerDropDownTabSet">> setTo="taggingTab" selectedClass="tw-tab-selected">Tagging</$button><$button type="set" set=<<qualify "$:/state/tiddlerDropDownTabSet">> setTo="listTab" selectedClass="tw-tab-selected">List</$button><$button type="set" set=<<qualify "$:/state/tiddlerDropDownTabSet">> setTo="listedTab" selectedClass="tw-tab-selected">Listed</$button><$button type="set" set=<<qualify "$:/state/tiddlerDropDownTabSet">> setTo="fieldsTab" selectedClass="tw-tab-selected">Fields</$button></div>
<div class="tw-tab-divider">
</div>
<div class="tw-tab-content">
<$reveal type="match" state=<<qualify "$:/state/tiddlerDropDownTabSet">> text="refTab" default="refTab">
<$list filter="[is[current]backlinks[]sort[title]]" emptyMessage="No tiddlers link to this one" template="$:/core/ui/ListItemTemplate">
</$list>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/tiddlerDropDownTabSet">> text="taggingTab">
<$list filter="[is[current]tagging[]]" itemClass="tw-menu-list-item" emptyMessage="No tiddlers are tagged with this one" template="$:/core/ui/ListItemTemplate"/>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/tiddlerDropDownTabSet">> text="listTab">
<$list filter="[list{!!title}]" itemClass="tw-menu-list-item" emptyMessage="This tiddler does not have a list" template="$:/core/ui/ListItemTemplate"/>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/tiddlerDropDownTabSet">> text="listedTab">
<$list filter="[is[current]listed[]!is[system]]" itemClass="tw-menu-list-item" emptyMessage="This tiddler is not listed by any others" template="$:/core/ui/ListItemTemplate"/>
</$reveal>
<$reveal type="match" state=<<qualify "$:/state/tiddlerDropDownTabSet">> text="fieldsTab">
<$transclude tiddler="$:/core/ui/TiddlerFields"/>
</$reveal>
</div>
</div>
<<tabs "[is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo]] [!is[shadow]!has[draft.of]tag[$:/tags/TiddlerInfo]]" "$:/core/ui/TiddlerInfo/References">>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/TiddlerInfo/Fields
tags: $:/tags/TiddlerInfo
caption: Fields
<$transclude tiddler="$:/core/ui/TiddlerFields"/>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/TiddlerInfo/List
tags: $:/tags/TiddlerInfo
caption: List
<$list filter="[list{!!title}]" itemClass="tw-menu-list-item" emptyMessage="This tiddler does not have a list" template="$:/core/ui/ListItemTemplate"/>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/TiddlerInfo/Listed
tags: $:/tags/TiddlerInfo
caption: Listed
<$list filter="[is[current]listed[]!is[system]]" itemClass="tw-menu-list-item" emptyMessage="This tiddler is not listed by any others" template="$:/core/ui/ListItemTemplate"/>

View File

@ -0,0 +1,6 @@
title: $:/core/ui/TiddlerInfo/References
tags: $:/tags/TiddlerInfo
caption: References
<$list filter="[is[current]backlinks[]sort[title]]" emptyMessage="No tiddlers link to this one" template="$:/core/ui/ListItemTemplate">
</$list>

View File

@ -0,0 +1,5 @@
title: $:/core/ui/TiddlerInfo/Tagging
tags: $:/tags/TiddlerInfo
caption: Tagging
<$list filter="[is[current]tagging[]]" itemClass="tw-menu-list-item" emptyMessage="No tiddlers are tagged with this one" template="$:/core/ui/ListItemTemplate"/>

View File

@ -1,3 +1,3 @@
title: $:/state/moreSideBarTabSet-{$:/core/ui/MoreSideBar|$:/core/ui/MoreSideBar||}{$:/core/ui/SideBar|$:/core/ui/SideBar||}{$:/core/ui/PageTemplate|$:/core/ui/PageTemplate||}
title: $:/moresidebartab-{$:/core/ui/SideBar|$:/core/ui/SideBar/More||}{$:/core/ui/SideBar|$:/core/ui/SideBar||}{$:/core/ui/PageTemplate|$:/core/ui/PageTemplate||}
tagsTab
$:/core/ui/MoreSideBar/Tags

View File

@ -1,3 +1,3 @@
title: $:/state/sideBarTabSet-{$:/core/ui/SideBar|$:/core/ui/SideBar||}{$:/core/ui/PageTemplate|$:/core/ui/PageTemplate||}
openTab
$:/core/ui/SideBar/Open

View File

@ -0,0 +1,3 @@
title: $:/tags/MoreSideBar
list: [[$:/core/ui/MoreSideBar/All]] [[$:/core/ui/MoreSideBar/Recent]] [[$:/core/ui/MoreSideBar/Tags]] [[$:/core/ui/MoreSideBar/Missing]] [[$:/core/ui/MoreSideBar/Drafts]] [[$:/core/ui/MoreSideBar/Orphans]] [[$:/core/ui/MoreSideBar/Types]] [[$:/core/ui/MoreSideBar/System]] [[$:/core/ui/MoreSideBar/Shadows]]

View File

@ -0,0 +1,3 @@
title: $:/tags/SideBar
list: [[$:/core/ui/SideBar/Open]] [[$:/core/ui/SideBar/Recent]] [[$:/core/ui/SideBar/Tools]] [[$:/core/ui/SideBar/More]]

View File

@ -0,0 +1,3 @@
title: $:/tags/TiddlerInfo
list: [[$:/core/ui/TiddlerInfo/References]] [[$:/core/ui/TiddlerInfo/Tagging]] [[$:/core/ui/TiddlerInfo/List]] [[$:/core/ui/TiddlerInfo/Listed]] [[$:/core/ui/TiddlerInfo/Fields]]

View File

@ -16,3 +16,10 @@ This release has several bug fixes:
* Made the modifier field in the subtitle be a link
* Styling improvements for the CodeMirror plugin
* Improved the ViewWidget so that it falls back to displaying its content if the field/property is missing or empty
* Extend use of the built-in `<<tabs>>` macro to the tiddler info panel, the control panel and the sidebar
** This means that you can add new tabs by creating tiddlers with these tags, and optionally a `caption` field for the text of the tab:
*** [[$:/tags/TiddlerInfo]] for tiddler info panel tabs
*** [[$:/tags/ControlPanel]] for control panel tabs
*** [[$:/tags/SideBar]] for sidebar tabs
*** [[$:/tags/MoreSideBar]] for tabs in the "more" sidebar
*** Change the order of tabs by adjusting the `list` field of the corresponding tag tiddler

View File

@ -875,18 +875,18 @@ canvas.tw-edit-bitmapeditor {
border-bottom: 1px solid #ececec;
}
.tw-sidebar-tab-divider.tw-tab-divider {
.tw-sidebar-lists .tw-tab-divider {
border-top: none;
height: 1px;
<<background-linear-gradient "left, rgb(216,216,216) 0%, rgb(236,236,236) 250px">>
}
.tw-more-sidebar.tw-tab-set {
.tw-more-sidebar {
white-space: nowrap;
}
@media (min-width: 770px) {
.tw-more-sidebar.tw-tab-set {
.tw-more-sidebar {
margin-left: -14px;
}
}
@ -899,6 +899,16 @@ canvas.tw-edit-bitmapeditor {
padding-left: 0;
}
.tw-more-sidebar .tw-tab-buttons button {
display: block;
width: 100%;
text-align: right;
}
.tw-sidebar-lists .tw-more-sidebar .tw-tab-divider {
display: none;
}
.tw-more-sidebar .tw-tab-content {
display: inline-block;
vertical-align: top;
@ -917,7 +927,7 @@ canvas.tw-edit-bitmapeditor {
.tw-more-sidebar .tw-tab-buttons button.tw-tab-selected {
background-color: #fff;
<<background-linear-gradient "left, rgb(236,236,236) 0%, rgb(255,255,255) 100%">>
<<background-linear-gradient "left, rgb(236,236,236) 0%, rgb(248,248,248) 100%">>
border: none;
}