mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-18 10:19:44 +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
666 B
JavaScript
32 lines
666 B
JavaScript
/*\
|
|
title: $:/core/modules/filterrunprefixes/intersection.js
|
|
type: application/javascript
|
|
module-type: filterrunprefix
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter prefix function
|
|
*/
|
|
exports.intersection = function(operationSubFunction) {
|
|
return function(results,source,widget) {
|
|
if(results.length !== 0) {
|
|
var secondRunResults = operationSubFunction(source,widget);
|
|
var firstRunResults = results.toArray();
|
|
results.clear();
|
|
$tw.utils.each(firstRunResults,function(title) {
|
|
if(secondRunResults.indexOf(title) !== -1) {
|
|
results.push(title);
|
|
}
|
|
});
|
|
}
|
|
};
|
|
};
|
|
|
|
})();
|