From 8c894612914e21cf941a1daa953538c28ce91d8e Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Mon, 16 Sep 2019 16:16:03 +0100 Subject: [PATCH] Adding [is[binary]] filter -- Missed off 1150c87ed --- core/modules/filters/is/binary.js | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 core/modules/filters/is/binary.js diff --git a/core/modules/filters/is/binary.js b/core/modules/filters/is/binary.js new file mode 100644 index 000000000..01b9aabd3 --- /dev/null +++ b/core/modules/filters/is/binary.js @@ -0,0 +1,36 @@ +/*\ +title: $:/core/modules/filters/is/binary.js +type: application/javascript +module-type: isfilteroperator + +Filter function for [is[binary]] + +\*/ +(function(){ + +/*jslint node: true, browser: true */ +/*global $tw: false */ +"use strict"; + +/* +Export our filter function +*/ +exports.binary = function(source,prefix,options) { + var results = []; + if(prefix === "!") { + source(function(tiddler,title) { + if(!options.wiki.isBinaryTiddler(title)) { + results.push(title); + } + }); + } else { + source(function(tiddler,title) { + if(options.wiki.isBinaryTiddler(title)) { + results.push(title); + } + }); + } + return results; +}; + +})();