Added some shortcut filters needed for cooking TiddlyWiki documents

print-window-tiddler
Jeremy Ruston 2012-05-05 14:16:05 +01:00
rodzic bf8100201d
commit 3520454a47
1 zmienionych plików z 24 dodań i 7 usunięć

Wyświetl plik

@ -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]]