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:
@@ -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";
|
||||
}
|
||||
};
|
||||
|
||||
})();
|
||||
|
||||
Reference in New Issue
Block a user