mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-01-12 02:10:27 +00:00
Added filter to search for text in a given tiddler
eg [searchVia[mySearchTermTiddler]] will return all the tiddlers containing the string in the mySearchTermTiddler.
This commit is contained in:
parent
abd2693352
commit
89819f533f
@ -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 === "!" ? "!" : "=";
|
||||
|
Loading…
Reference in New Issue
Block a user