mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-09-19 18:59:42 +00:00
29 lines
600 B
JavaScript
29 lines
600 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/addsuffix.js
|
|
type: application/javascript
|
|
module-type: filteroperator
|
|
|
|
Filter operator for adding a suffix to each title in the list. This is
|
|
especially useful in contexts where only a filter expression is allowed
|
|
and macro substitution isn't available.
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.addsuffix = function(source,operator,options) {
|
|
var results = [];
|
|
source(function(tiddler,title) {
|
|
results.push(title + operator.operand);
|
|
});
|
|
return results;
|
|
};
|
|
|
|
})();
|