mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-25 06:43:15 +00:00
Return all tiddlers when "is" filter operand is missing
This commit is contained in:
parent
1a2ec12831
commit
0b4669621a
|
@ -28,11 +28,20 @@ Export our filter function
|
||||||
exports.is = function(source,operator,options) {
|
exports.is = function(source,operator,options) {
|
||||||
// Dispatch to the correct isfilteroperator
|
// Dispatch to the correct isfilteroperator
|
||||||
var isFilterOperators = getIsFilterOperators();
|
var isFilterOperators = getIsFilterOperators();
|
||||||
var isFilterOperator = isFilterOperators[operator.operand];
|
if(operator.operand) {
|
||||||
if(isFilterOperator) {
|
var isFilterOperator = isFilterOperators[operator.operand];
|
||||||
return isFilterOperator(source,operator.prefix,options);
|
if(isFilterOperator) {
|
||||||
|
return isFilterOperator(source,operator.prefix,options);
|
||||||
|
} else {
|
||||||
|
return [$tw.language.getString("Error/IsFilterOperator")];
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return [$tw.language.getString("Error/IsFilterOperator")];
|
// Return all tiddlers if the operand is missing
|
||||||
|
var results = [];
|
||||||
|
source(function(tiddler,title) {
|
||||||
|
results.push(title);
|
||||||
|
});
|
||||||
|
return results;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
created: 20140410103123179
|
created: 20140410103123179
|
||||||
modified: 20150220161001000
|
modified: 20161127142329969
|
||||||
tags: [[Filter Operators]] [[Common Operators]] [[Negatable Operators]]
|
tags: [[Filter Operators]] [[Common Operators]] [[Negatable Operators]]
|
||||||
title: is Operator
|
title: is Operator
|
||||||
type: text/vnd.tiddlywiki
|
type: text/vnd.tiddlywiki
|
||||||
|
@ -23,7 +23,7 @@ The parameter <<.place C>> is one of the following fundamental categories:
|
||||||
|^`tag` |is in use as a tag |
|
|^`tag` |is in use as a tag |
|
||||||
|^`tiddler` |exists as a non-shadow tiddler |
|
|^`tiddler` |exists as a non-shadow tiddler |
|
||||||
|
|
||||||
If <<.place C>> is anything else, the output is an error message.
|
If <<.place C>> is anything else an error message is returned. <<.from-version "5.1.14"> if <<.place C>> is blank, the output is passed through unchanged (in earlier versions an error message was returned).
|
||||||
|
|
||||||
`!is[tiddler]` is a synonym for `is[missing]`, and vice versa.
|
`!is[tiddler]` is a synonym for `is[missing]`, and vice versa.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user