Ignore edition filters if not running on node (#5222)

browser-messaging-saver
Joshua Fontany 2020-12-07 07:59:32 -08:00 zatwierdzone przez GitHub
rodzic 85ff47366c
commit a878d82c7a
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 19 dodań i 15 usunięć

Wyświetl plik

@ -16,14 +16,16 @@ Filter operator for returning the descriptions of the specified edition names
Export our filter function
*/
exports.editiondescription = function(source,operator,options) {
var results = [],
editionInfo = $tw.utils.getEditionInfo();
if(editionInfo) {
source(function(tiddler,title) {
if($tw.utils.hop(editionInfo,title)) {
results.push(editionInfo[title].description || "");
}
});
var results = [];
if($tw.node) {
var editionInfo = $tw.utils.getEditionInfo();
if(editionInfo) {
source(function(tiddler,title) {
if($tw.utils.hop(editionInfo,title)) {
results.push(editionInfo[title].description || "");
}
});
}
}
return results;
};

Wyświetl plik

@ -16,14 +16,16 @@ Filter operator for returning the names of the available editions in this wiki
Export our filter function
*/
exports.editions = function(source,operator,options) {
var results = [],
editionInfo = $tw.utils.getEditionInfo();
if(editionInfo) {
$tw.utils.each(editionInfo,function(info,name) {
results.push(name);
});
var results = [];
if($tw.node) {
var editionInfo = $tw.utils.getEditionInfo();
if(editionInfo) {
$tw.utils.each(editionInfo,function(info,name) {
results.push(name);
});
}
results.sort();
}
results.sort();
return results;
};