diff --git a/rabbithole/core/boot.js b/rabbithole/core/boot.js index c04b5a261..da365658c 100644 --- a/rabbithole/core/boot.js +++ b/rabbithole/core/boot.js @@ -24,8 +24,8 @@ In practice, each module is wrapped in a separate script block. \*/ (function() { -/*jslint node: true */ -/*global modules: false */ +/*jslint node: true, browser: true */ +/*global modules: false, $tw: false */ "use strict"; /////////////////////////// Setting up $tw @@ -40,7 +40,7 @@ $tw.boot = {}; // Modules store registers all the modules the system has seen $tw.modules = $tw.modules || {}; -$tw.modules.titles = $tw.modules.titles || {} // hashmap by module title of {fn:, exports:, moduleType:} +$tw.modules.titles = $tw.modules.titles || {}; // hashmap by module title of {fn:, exports:, moduleType:} // Plugins store organises module exports by module type $tw.plugins = $tw.plugins || {}; @@ -75,7 +75,7 @@ Determine if a value is an array */ $tw.utils.isArray = function(value) { return Object.prototype.toString.call(value) == "[object Array]"; -} +}; // Convert "&" to &, "<" to <, ">" to > and """ to " $tw.utils.htmlDecode = function(s) { @@ -88,8 +88,9 @@ Pad a string to a given length with "0"s. Length defaults to 2 $tw.utils.pad = function(value,length) { length = length || 2; var s = value.toString(); - if(s.length < length) + if(s.length < length) { s = "000000000000000000000000000".substr(0,length - s.length) + s; + } return s; }; @@ -367,8 +368,8 @@ $tw.Wiki.prototype.deserializeTiddlers = function(type,text,srcFields) { deserializer = $tw.Wiki.tiddlerDeserializerPlugins[type]; } for(var f in srcFields) { - fields[f] = srcFields[f] - }; + fields[f] = srcFields[f]; + } if(deserializer) { return deserializer.call(this,text,fields); } else { @@ -564,7 +565,7 @@ $tw.plugins.loadPlugins = function(filepath,basetitle,excludeRegExp) { $tw.plugins.loadTiddlersFromFile(filepath,basetitle); } } -} +}; /* Execute the module named 'moduleName'. The name can optionally be relative to the module named 'moduleRoot' @@ -599,7 +600,7 @@ $tw.modules.execute = function(moduleName,moduleRoot) { } // Return the exports of the module return module.exports; -} +}; // Load plugins from the plugins directory $tw.plugins.loadPlugins(path.resolve($tw.boot.bootPath,$tw.config.bootModuleSubDir)); diff --git a/rabbithole/core/modules/commander.js b/rabbithole/core/modules/commander.js index ece4b7e32..cab488704 100644 --- a/rabbithole/core/modules/commander.js +++ b/rabbithole/core/modules/commander.js @@ -9,6 +9,7 @@ The $tw.Commander class is a command interpreter (function(){ /*jslint node: true, browser: true */ +/*global $tw: false */ "use strict"; /* diff --git a/rabbithole/core/modules/commands/dump.js b/rabbithole/core/modules/commands/dump.js index a0d3ec899..a42b73f50 100644 --- a/rabbithole/core/modules/commands/dump.js +++ b/rabbithole/core/modules/commands/dump.js @@ -8,13 +8,14 @@ Dump command \*/ (function(){ -/*jslint node: true, browser: true */ +/*jshint node: true, browser: true */ +/*global $tw: false */ "use strict"; exports.info = { name: "dump", synchronous: true -} +}; var Command = function(params,commander) { this.params = params; @@ -32,13 +33,13 @@ Command.prototype.execute = function() { } else { return "Unknown subcommand (" + this.params[0] + ") for dump command"; } -} +}; Command.prototype.subcommands = {}; Command.prototype.subcommands.tiddlers = function() { - var tiddlers = this.commander.wiki.sortTiddlers() + var tiddlers = this.commander.wiki.sortTiddlers(); this.output.write("Wiki contains these tiddlers:\n"); for(var t=0; t