mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 18:59:42 +00:00
42d130d49d
The change affects the default display of the story river, reversing the order of entries.
36 lines
805 B
JavaScript
36 lines
805 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/list.js
|
|
type: application/javascript
|
|
module-type: filteroperator
|
|
|
|
Filter operator returning the tiddlers whose title is listed in the operand tiddler
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.list = function(source,operator,options) {
|
|
var results = [],
|
|
tr = $tw.utils.parseTextReference(operator.operand),
|
|
currTiddlerTitle = options.widget && options.widget.getVariable("currentTiddler"),
|
|
list = options.wiki.getTiddlerList(tr.title || currTiddlerTitle,tr.field,tr.index);
|
|
if(operator.prefix === "!") {
|
|
source(function(tiddler,title) {
|
|
if(list.indexOf(title) === -1) {
|
|
results.push(title);
|
|
}
|
|
});
|
|
} else {
|
|
results = list;
|
|
}
|
|
return results;
|
|
};
|
|
|
|
})();
|