kopia lustrzana https://github.com/miklobit/TiddlyWiki5
Fixed bug with negated title filter
rodzic
94c7a4fc39
commit
e42a062dcc
|
@ -78,10 +78,15 @@ exports.filterFragments = {
|
||||||
exports.operators = {
|
exports.operators = {
|
||||||
"title": { // Filter by title
|
"title": { // Filter by title
|
||||||
selector: function(operator) {
|
selector: function(operator) {
|
||||||
return "$tw.utils.pushTop(subResults,\"" + $tw.utils.stringify(operator.operand) + "\");";
|
if(operator.prefix === "!") {
|
||||||
|
return "for(title in source) {if(title !== \"" + $tw.utils.stringify(operator.operand) + "\") {$tw.utils.pushTop(subResults,title);}}";
|
||||||
|
} else {
|
||||||
|
return "$tw.utils.pushTop(subResults,\"" + $tw.utils.stringify(operator.operand) + "\");";
|
||||||
|
}
|
||||||
},
|
},
|
||||||
filter: function(operator) {
|
filter: function(operator) {
|
||||||
return "if(subResults.indexOf(\"" + $tw.utils.stringify(operator.operand) + "\") !== -1) {subResults = [\"" + $tw.utils.stringify(operator.operand) + "\"];} else {subResults = [];}";
|
var op = operator.prefix === "!" ? "!" : "=";
|
||||||
|
return "if(subResults.indexOf(\"" + $tw.utils.stringify(operator.operand) + "\") " + op + "== -1) {subResults = [\"" + $tw.utils.stringify(operator.operand) + "\"];} else {subResults = [];}";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"prefix": { // Filter by title prefix
|
"prefix": { // Filter by title prefix
|
||||||
|
|
Ładowanie…
Reference in New Issue