mirror of
https://github.com/Jermolene/TiddlyWiki5.git
synced 2025-12-27 12:22:04 -08: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
1 changed files with 14 additions and 2 deletions
|
|
@ -203,9 +203,21 @@ exports.compileFilter = function(filterString) {
|
|||
wiki: self,
|
||||
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
|
||||
operationFunctions.push((function() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue