Added filter to search for text in a given tiddler

eg [searchVia[mySearchTermTiddler]] will return all the tiddlers
containing the string in the mySearchTermTiddler.
print-window-tiddler
Jeremy Ruston 2012-10-17 14:34:34 +01:00
rodzic abd2693352
commit 89819f533f
1 zmienionych plików z 12 dodań i 0 usunięć

Wyświetl plik

@ -207,6 +207,18 @@ exports.operators = {
"for(r=subResults.length-1; r>=0; r--) {if(list.indexOf(title) " + op + " -1) {subResults.splice(r,1);}}";
}
},
"searchVia": { // Search for the string in the operand tiddler
selector: function(operator) {
var op = operator.prefix === "!" ? "true" : "false";
return "var term = this.getTiddler(\"" + $tw.utils.stringify(operator.operand) + "\").fields.text;" +
"$tw.utils.pushTop(subResults,this.search(term,source," + op + "));";
},
filter: function(operator) {
var op = operator.prefix === "!" ? "true" : "false";
return "var term = this.getTiddler(\"" + $tw.utils.stringify(operator.operand) + "\").fields.text;" +
"$tw.utils.pushTop(subResults,this.search(term,subResults," + op + "));";
}
},
"field": { // Special handler for field comparisons
selector: function(operator) {
var op = operator.prefix === "!" ? "!" : "=";