mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-12-25 17:40:29 +00:00
Added some shortcut filters needed for cooking TiddlyWiki documents
This commit is contained in:
parent
bf8100201d
commit
3520454a47
@ -31,30 +31,47 @@ exports.filters = {
|
||||
},
|
||||
is: function(results,match) {
|
||||
switch(match[3]) {
|
||||
case "pluginModule":
|
||||
this.forEachTiddler(function(title,tiddler) {
|
||||
if(title.indexOf("$:/plugins/") === 0 && tiddler.fields.type === "application/javascript") {
|
||||
case "shadowStyle":
|
||||
this.shadows.forEachTiddler(function(title,tiddler) {
|
||||
if(tiddler.fields.type === "text/css") {
|
||||
if(results.indexOf(title) === -1) {
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "pluginTiddler":
|
||||
this.forEachTiddler(function(title,tiddler) {
|
||||
if(title.indexOf("$:/plugins/") === 0 && tiddler.fields.type !== "application/javascript") {
|
||||
case "shadowModule":
|
||||
this.shadows.forEachTiddler(function(title,tiddler) {
|
||||
if(tiddler.fields.type === "application/javascript" && tiddler.fields["module-type"]) {
|
||||
if(results.indexOf(title) === -1) {
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "shadowPlain":
|
||||
this.shadows.forEachTiddler(function(title,tiddler) {
|
||||
if((tiddler.fields.type !== "application/javascript" || !tiddler.fields["module-type"]) &&
|
||||
tiddler.fields.type !== "text/css") {
|
||||
if(results.indexOf(title) === -1) {
|
||||
results.push(title);
|
||||
}
|
||||
}
|
||||
});
|
||||
break;
|
||||
case "tiddler":
|
||||
this.forEachTiddler(function(title,tiddler) {
|
||||
if(results.indexOf(title) === -1) {
|
||||
results.push(title);
|
||||
}
|
||||
});
|
||||
break;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// Return the tiddler titles from the store that match a filter expression
|
||||
// filter - filter expression (eg "tidlertitle [[multi word tiddler title]] [tag[systemConfig]]")
|
||||
// filter - filter expression (eg "tiddlertitle [[multi word tiddler title]] [tag[systemConfig]]")
|
||||
// Returns an array of tiddler titles that match the filter expression
|
||||
exports.filterTiddlers = function(filter) {
|
||||
// text or [foo[bar]] or [[tiddler title]]
|
||||
|
Loading…
Reference in New Issue
Block a user