mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-07-16 00:44:22 +00:00
31 lines
634 B
JavaScript
31 lines
634 B
JavaScript
/*\
|
|
title: $:/core/modules/filters/modulestring.js
|
|
type: application/javascript
|
|
module-type: filteroperator
|
|
|
|
Filter [[module-name]modulestring[en-gb]] retrieve a module strings in a particular language
|
|
|
|
\*/
|
|
(function(){
|
|
|
|
/*jslint node: true, browser: true */
|
|
/*global $tw: false */
|
|
"use strict";
|
|
|
|
/*
|
|
Export our filter function
|
|
*/
|
|
exports.modulestring = function(source,operator,options) {
|
|
var results = [];
|
|
source(function(tiddler,title) {
|
|
var s = $tw.modules.getModuleString(title,operator.operands[0] || "",operator.operands[1] || "");
|
|
if(s !== null) {
|
|
results.push(s);
|
|
}
|
|
});
|
|
results.sort();
|
|
return results;
|
|
};
|
|
|
|
})();
|