mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-10-22 10:35:50 +00:00
570cad1c7f
Prompted by @sukima’s work on #586
32 lines
582 B
JavaScript
32 lines
582 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/get.js
|
|
type: application/javascript
|
|
module-type: filteroperator
|
|
|
|
Filter operator for replacing tiddler titles by the value of the field specified in the operand.
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.get = function(source,operator,options) {
|
|
var results = [];
|
|
source(function(tiddler,title) {
|
|
if(tiddler) {
|
|
var value = tiddler.getFieldString(operator.operand);
|
|
if(value) {
|
|
results.push(value);
|
|
}
|
|
}
|
|
});
|
|
return results;
|
|
};
|
|
|
|
})();
|