1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-28 16:23:15 +00:00
TiddlyWiki5/core/modules/filters/tags.js
Jermolene b7f674c51a First pass at refactoring filter execution
This is the beginning of addressing #523.
2014-04-03 20:49:16 +01:00

29 lines
523 B
JavaScript

/*\
title: $:/core/modules/filters/tags.js
type: application/javascript
module-type: filteroperator
Filter operator returning all the tags of the selected tiddlers
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";
/*
Export our filter function
*/
exports.tags = function(source,operator,options) {
var results = [];
source(function(tiddler,title) {
if(tiddler && tiddler.fields.tags) {
$tw.utils.pushTop(results,tiddler.fields.tags);
}
});
return results;
};
})();