1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-22 19:27:40 +00:00

Obeisance to JSHint for core modules

There are still some warnings about making functions in a loop, but
I’ll fix those as a separate pull request because the fixes are more
than typographic errors.
This commit is contained in:
Jermolene
2014-08-30 20:44:26 +01:00
parent 2a3e54b064
commit 3a67fdb768
48 changed files with 173 additions and 169 deletions

View File

@@ -24,15 +24,16 @@ exports.repackPlugin = function(title,additionalTiddlers,excludeTiddlers) {
throw "No such tiddler as " + title;
}
// Extract the JSON
var jsonPluginTiddler;
try {
var jsonPluginTiddler = JSON.parse(pluginTiddler.fields.text);
jsonPluginTiddler = JSON.parse(pluginTiddler.fields.text);
} catch(e) {
throw "Cannot parse plugin tiddler " + title + "\nError: " + e;
}
// Get the list of tiddlers
var tiddlers = Object.keys(jsonPluginTiddler.tiddlers);
// Add the additional tiddlers
$tw.utils.pushTop(tiddlers,additionalTiddlers)
$tw.utils.pushTop(tiddlers,additionalTiddlers);
// Remove any excluded tiddlers
for(var t=tiddlers.length-1; t>=0; t--) {
if(excludeTiddlers.indexOf(tiddlers[t]) !== -1) {
@@ -75,6 +76,6 @@ exports.repackPlugin = function(title,additionalTiddlers,excludeTiddlers) {
$tw.rootWidget.dispatchEvent({type: "tw-auto-save-wiki"});
// Return a heartwarming confirmation
return "Plugin " + title + " successfully saved";
}
};
})();