2015-01-11 15:00:54 +00:00
|
|
|
/*\
|
|
|
|
title: $:/core/modules/filters/editiondescription.js
|
|
|
|
type: application/javascript
|
|
|
|
module-type: filteroperator
|
|
|
|
|
|
|
|
Filter operator for returning the descriptions of the specified edition names
|
|
|
|
|
|
|
|
\*/
|
|
|
|
(function(){
|
|
|
|
|
|
|
|
/*jslint node: true, browser: true */
|
|
|
|
/*global $tw: false */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
/*
|
|
|
|
Export our filter function
|
|
|
|
*/
|
|
|
|
exports.editiondescription = function(source,operator,options) {
|
2020-12-07 15:59:32 +00:00
|
|
|
var results = [];
|
|
|
|
if($tw.node) {
|
|
|
|
var editionInfo = $tw.utils.getEditionInfo();
|
|
|
|
if(editionInfo) {
|
|
|
|
source(function(tiddler,title) {
|
|
|
|
if($tw.utils.hop(editionInfo,title)) {
|
2021-05-30 18:20:17 +00:00
|
|
|
results.push(editionInfo[title].description || "");
|
2020-12-07 15:59:32 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
2015-01-11 15:00:54 +00:00
|
|
|
}
|
|
|
|
return results;
|
|
|
|
};
|
|
|
|
|
|
|
|
})();
|