diff --git a/core/modules/filters.js b/core/modules/filters.js index 0de78b685..a5fbef221 100644 --- a/core/modules/filters.js +++ b/core/modules/filters.js @@ -107,6 +107,18 @@ exports.operators = { break; case "system": return "for(title in source) {if(" + op + "this.getTiddler(title).isSystem()) {$tw.utils.pushTop(subResults,title);}}"; + case "missing": + if(operator.prefix === "!") { + return "for(title in source) {$tw.utils.pushTop(subResults,title);}"; + } else { + return "var m = this.getMissingTitles(); for(t=0; t=0; r--) {if(" + op + "this.getTiddler(subResults[r]).isSystem()) {subResults.splice(r,1);}}"; + case "missing": + return "t = this.getMissingTitles(); for(r=subResults.length-1; r>=0; r--) {if(" + op + "!$tw.utils.hop(t,subResults[r])) {subResults.splice(r,1);}}"; + case "orphan": + if(operator.prefix === "!") { + return "t = this.getOrphanTitles(); for(r=subResults.length-1; r>=0; r--) {if(t.indexOf(subResults[r]) === -1) {subResults.splice(r,1);}}"; + } else { + return "t = this.getOrphanTitles(); for(r=subResults.length-1; r>=0; r--) {if(t.indexOf(subResults[r]) !== -1) {subResults.splice(r,1);}}"; + } default: throw "Unknown operand for 'is' filter operator"; } diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 71e29b2f7..cf7d1aa56 100644 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -256,12 +256,69 @@ exports.forEachTiddler = function(/* [sortField,[excludeTag,]]callback */) { } }; +/* +Return an array of tiddler titles that are directly linked from the specified tiddler +*/ +exports.getTiddlerLinks = function(title) { + var self = this; + // We'll cache the links so they only get computed if the tiddler changes + return this.getCacheForTiddler(title,"links",function() { + // Parse the tiddler + var parser = self.parseTiddler(title); + // Count up the links + var links = [], + checkParseTree = function(parseTree) { + for(var t=0; t +
<$button type="set" set="$:/state/moreSideBarTabSet" setTo="missingTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">Missing<$button type="set" set="$:/state/moreSideBarTabSet" setTo="orphanTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">Orphans<$button type="set" set="$:/state/moreSideBarTabSet" setTo="systemTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">System
+
+<$reveal type="match" state="$:/state/moreSideBarTabSet" text="missingTab" qualifyTiddlerTitles="yes"> +<$list filter="[is[missing]sort[title]]" itemClass="tw-menu-list-item"/> + +<$reveal type="match" state="$:/state/moreSideBarTabSet" text="orphanTab" qualifyTiddlerTitles="yes"> +<$list filter="[is[orphan]sort[title]]" itemClass="tw-menu-list-item"/> + +<$reveal type="match" state="$:/state/moreSideBarTabSet" text="systemTab" qualifyTiddlerTitles="yes"> +<$list filter="[is[system]sort[title]]" itemClass="tw-menu-list-item"/> + +
+ diff --git a/core/templates/SideBar.tid b/core/templates/SideBar.tid index 1ad5091ac..0b196c633 100644 --- a/core/templates/SideBar.tid +++ b/core/templates/SideBar.tid @@ -2,19 +2,20 @@ title: $:/templates/SideBar
-
<$button type="set" set="myTabset" setTo="openTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">Open<$button type="set" set="myTabset" setTo="allTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">All<$button type="set" set="myTabset" setTo="systemTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">System<$button type="set" set="myTabset" setTo="toolsTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">Tools
+
<$button type="set" set="$:/state/sideBarTabSet" setTo="openTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">Open<$button type="set" set="$:/state/sideBarTabSet" setTo="allTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">All<$button type="set" set="$:/state/sideBarTabSet" setTo="toolsTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">Tools<$button type="set" set="$:/state/sideBarTabSet" setTo="moreTab" qualifyTiddlerTitles="yes" selectedClass="tw-tab-selected">More
-<$reveal type="match" state="myTabset" text="openTab" qualifyTiddlerTitles="yes"> +<$reveal type="match" state="$:/state/sideBarTabSet" text="openTab" qualifyTiddlerTitles="yes"> <$list filter="[list[$:/StoryList]]" history="$:/HistoryList" itemClass="tw-menu-list-item"/> -<$reveal type="match" state="myTabset" text="allTab" qualifyTiddlerTitles="yes"> +<$reveal type="match" state="$:/state/sideBarTabSet" text="allTab" qualifyTiddlerTitles="yes"> <$list filter="[!is[system]sort[title]]" itemClass="tw-menu-list-item"/> -<$reveal type="match" state="myTabset" text="systemTab" qualifyTiddlerTitles="yes"> -<$list filter="[is[system]sort[title]]" itemClass="tw-menu-list-item"/> - -<$reveal type="match" state="myTabset" text="toolsTab" qualifyTiddlerTitles="yes"> +<$reveal type="match" state="$:/state/sideBarTabSet" text="toolsTab" qualifyTiddlerTitles="yes"> {{$:/templates/ControlPanel}}
+<$reveal type="match" state="$:/state/sideBarTabSet" text="moreTab" qualifyTiddlerTitles="yes"> +{{$:/templates/MoreSideBar}} + +
diff --git a/core/wiki/moreSideBarTabSet.tid b/core/wiki/moreSideBarTabSet.tid new file mode 100644 index 000000000..9e19a5931 --- /dev/null +++ b/core/wiki/moreSideBarTabSet.tid @@ -0,0 +1,3 @@ +title: $:/state/moreSideBarTabSet-tiddlerTitle:$:/templates/MoreSideBar;templateTitle:$:/templates/MoreSideBar;-tiddlerTitle:$:/templates/SideBar;templateTitle:$:/templates/SideBar;-tiddlerTitle:$:/templates/PageTemplate;- + +missingTab \ No newline at end of file diff --git a/core/wiki/myTabset.tid b/core/wiki/myTabset.tid deleted file mode 100644 index ebe1c1b00..000000000 --- a/core/wiki/myTabset.tid +++ /dev/null @@ -1,3 +0,0 @@ -title: myTabset-tiddlerTitle:$:/templates/SideBar;templateTitle:$:/templates/SideBar;-tiddlerTitle:$:/templates/PageTemplate;- - -openTab \ No newline at end of file diff --git a/core/wiki/sideBarTabSet.tid b/core/wiki/sideBarTabSet.tid new file mode 100644 index 000000000..ca6fe1dc9 --- /dev/null +++ b/core/wiki/sideBarTabSet.tid @@ -0,0 +1,3 @@ +title: $:/state/sideBarTabSet-tiddlerTitle:$:/templates/SideBar;templateTitle:$:/templates/SideBar;-tiddlerTitle:$:/templates/PageTemplate;- + +openTab \ No newline at end of file