mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-08-07 06:14:44 +00:00
Allow filter operators to return an iterator
Previously filter operators were only permitted to return an array of tiddler titles
This commit is contained in:
parent
bd3e955821
commit
21b2d6fdc7
@ -203,9 +203,21 @@ exports.compileFilter = function(filterString) {
|
|||||||
wiki: self,
|
wiki: self,
|
||||||
widget: widget
|
widget: widget
|
||||||
});
|
});
|
||||||
accumulator = self.makeTiddlerIterator(results);
|
if($tw.utils.isArray(results)) {
|
||||||
|
accumulator = self.makeTiddlerIterator(results);
|
||||||
|
} else {
|
||||||
|
accumulator = results;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
return results;
|
if($tw.utils.isArray(results)) {
|
||||||
|
return results;
|
||||||
|
} else {
|
||||||
|
var resultArray = [];
|
||||||
|
results(function(tiddler,title) {
|
||||||
|
resultArray.push(title);
|
||||||
|
});
|
||||||
|
return resultArray;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
// Wrap the operator functions in a wrapper function that depends on the prefix
|
// Wrap the operator functions in a wrapper function that depends on the prefix
|
||||||
operationFunctions.push((function() {
|
operationFunctions.push((function() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user