mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-28 11:00:27 +00:00
Add experimental system tiddler browser
This commit is contained in:
parent
5d75dc7991
commit
a8ee6c7b7c
31
core/modules/filters/splitbefore.js
Normal file
31
core/modules/filters/splitbefore.js
Normal file
@ -0,0 +1,31 @@
|
||||
/*\
|
||||
title: $:/core/modules/filters/splitbefore.js
|
||||
type: application/javascript
|
||||
module-type: filteroperator
|
||||
|
||||
Filter operator that splits each result on the first occurance of the specified separator and returns the unique values.
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
/*
|
||||
Export our filter function
|
||||
*/
|
||||
exports.splitbefore = function(source,operator,options) {
|
||||
var results = [];
|
||||
source(function(tiddler,title) {
|
||||
var parts = title.split(operator.operand);
|
||||
if(parts.length === 1) {
|
||||
$tw.utils.pushTop(results,parts[0]);
|
||||
} else {
|
||||
$tw.utils.pushTop(results,parts[0] + operator.operand);
|
||||
}
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
})();
|
36
editions/prerelease/tiddlers/Explore.tid
Normal file
36
editions/prerelease/tiddlers/Explore.tid
Normal file
@ -0,0 +1,36 @@
|
||||
title: $:/core/ui/MoreSideBar/Explore
|
||||
tags: $:/tags/MoreSideBar
|
||||
caption: Explore
|
||||
|
||||
\define treenode-inner(prefix)
|
||||
<$reveal type="nomatch" text="" default="""$(chunk)$""">
|
||||
<li>
|
||||
<$list filter="""[[$prefix$$(chunk)$]is[shadow]] [[$prefix$$(chunk)$]is[tiddler]] +[limit[1]]""" emptyMessage="""<$text text="$prefix$$(chunk)$"/>""">
|
||||
<$link>
|
||||
<$view field="title"/>
|
||||
</$link>
|
||||
</$list>
|
||||
<$list filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]] +[limit[1]]""">
|
||||
(<$count filter="""[all[shadows+tiddlers]prefix[$prefix$$(chunk)$]] -[[$prefix$$(chunk)$]]"""/>)
|
||||
<$reveal type="nomatch" state="""$:/state/tree/$prefix$$(chunk)$""" text="show">
|
||||
<$button set="""$:/state/tree/$prefix$$(chunk)$""" setTo="show" class="tc-btn-invisible">{{$:/core/images/chevron-right}}</$button>
|
||||
</$reveal>
|
||||
<$reveal type="match" state="""$:/state/tree/$prefix$$(chunk)$""" text="show">
|
||||
<$button set="""$:/state/tree/$prefix$$(chunk)$""" setTo="hide" class="tc-btn-invisible">{{$:/core/images/chevron-down}}</$button>
|
||||
<$macrocall $name="treenode" prefix="""$prefix$$(chunk)$"""/>
|
||||
</$reveal>
|
||||
</$list>
|
||||
</li>
|
||||
</$reveal>
|
||||
\end
|
||||
|
||||
\define treenode(prefix)
|
||||
<ol>
|
||||
<$list filter="[all[shadows+tiddlers]removeprefix[$prefix$]splitbefore[/]sort[title]]" variable="chunk">
|
||||
<<treenode-inner """$prefix$""">>
|
||||
</$list>
|
||||
</ol>
|
||||
\end
|
||||
|
||||
<<treenode "$:/">>
|
||||
|
@ -4,3 +4,7 @@ modified: 20141013204930183
|
||||
This is a pre-release build of TiddlyWiki.
|
||||
|
||||
It is provided for testing purposes. Please don't try to use it for anything important -- you should use the latest official release from http://tiddlywiki.com.
|
||||
|
||||
Try out the experimental system tiddler browser:
|
||||
|
||||
$:/core/ui/MoreSideBar/Explore
|
||||
|
Loading…
Reference in New Issue
Block a user