mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-03-30 07:16:56 +00:00
Fixed problem with prefix filter
This commit is contained in:
parent
e2ea8ff436
commit
72de3d4206
@ -86,12 +86,12 @@ exports.operators = {
|
||||
},
|
||||
"prefix": {
|
||||
selector: function(operator) {
|
||||
var op = operator.prefix === "!" ? "!" : "";
|
||||
return "for(var title in source) {if(" + op + "title.substr(0,\"" + operator.operand.length + "\")===\"" + $tw.utils.stringify(operator.operand) + "\") {$tw.utils.pushTop(subResults,title);}}";
|
||||
var op = operator.prefix === "!" ? "!" : "=";
|
||||
return "for(var title in source) {if(title.substr(0," + operator.operand.length + ")" + op + "==\"" + $tw.utils.stringify(operator.operand) + "\") {$tw.utils.pushTop(subResults,title);}}";
|
||||
},
|
||||
filter: function(operator) {
|
||||
var op = operator.prefix === "!" ? "" : "!";
|
||||
return "for(var r=subResults.length-1; r>=0; r--) {if(" + op + "title.substr(0,\"" + operator.operand.length + "\")===\"" + $tw.utils.stringify(operator.operand) + "\") {subResults.splice(r,1);}}";
|
||||
var op = operator.prefix === "!" ? "=" : "!";
|
||||
return "for(var r=subResults.length-1; r>=0; r--) {if(title.substr(0," + operator.operand.length + ")" + op + "==\"" + $tw.utils.stringify(operator.operand) + "\") {subResults.splice(r,1);}}";
|
||||
}
|
||||
},
|
||||
"is": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user