mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-07-04 19:23:29 +00:00
a857b4ab9a
* Changed the filterrunprefixes to use LinkedList * Testing for Linked List * Finishing touches to LinkedList * Minor corrections to link-list coding style * Corrected for sneaky bug in linkedList
32 lines
657 B
JavaScript
32 lines
657 B
JavaScript
/*\
|
|
title: $:/core/modules/filterrunprefixes/filter.js
|
|
type: application/javascript
|
|
module-type: filterrunprefix
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.filter = function(operationSubFunction,options) {
|
|
return function(results,source,widget) {
|
|
if(results.length > 0) {
|
|
var resultsToRemove = [];
|
|
results.each(function(result) {
|
|
var filtered = operationSubFunction(options.wiki.makeTiddlerIterator([result]),widget);
|
|
if(filtered.length === 0) {
|
|
resultsToRemove.push(result);
|
|
}
|
|
});
|
|
results.remove(resultsToRemove);
|
|
}
|
|
}
|
|
};
|
|
|
|
})();
|