1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-06-25 14:43:01 +00:00

Clean up whitespace

This commit is contained in:
Jermolene 2014-05-13 10:26:02 +01:00
parent 75fee26b58
commit b77d5f9725

View File

@ -186,7 +186,7 @@ $tw.utils.deepDefaults = function(object /*, sourceObjectList */) {
object[p] = source[p]; object[p] = source[p];
} }
if(typeof object[p] === "object" && typeof source[p] === "object") { if(typeof object[p] === "object" && typeof source[p] === "object") {
$tw.utils.deepDefaults(object[p],source[p]); $tw.utils.deepDefaults(object[p],source[p]);
} }
} }
} }
@ -225,8 +225,8 @@ $tw.utils.pad = function(value,length) {
$tw.utils.stringifyDate = function(value) { $tw.utils.stringifyDate = function(value) {
return value.getUTCFullYear() + return value.getUTCFullYear() +
$tw.utils.pad(value.getUTCMonth() + 1) + $tw.utils.pad(value.getUTCMonth() + 1) +
$tw.utils.pad(value.getUTCDate()) + $tw.utils.pad(value.getUTCDate()) +
$tw.utils.pad(value.getUTCHours()) + $tw.utils.pad(value.getUTCHours()) +
$tw.utils.pad(value.getUTCMinutes()) + $tw.utils.pad(value.getUTCMinutes()) +
$tw.utils.pad(value.getUTCSeconds()) + $tw.utils.pad(value.getUTCSeconds()) +
$tw.utils.pad(value.getUTCMilliseconds(),3); $tw.utils.pad(value.getUTCMilliseconds(),3);
@ -387,8 +387,8 @@ options: {flags: flags,deserializerType: deserializerType}
*/ */
$tw.utils.registerFileType = function(type,encoding,extension,options) { $tw.utils.registerFileType = function(type,encoding,extension,options) {
options = options || {}; options = options || {};
$tw.config.fileExtensionInfo[extension] = {type: type}; $tw.config.fileExtensionInfo[extension] = {type: type};
$tw.config.contentTypeInfo[type] = {encoding: encoding, extension: extension, flags: options.flags || [], deserializerType: options.deserializerType || type}; $tw.config.contentTypeInfo[type] = {encoding: encoding, extension: extension, flags: options.flags || [], deserializerType: options.deserializerType || type};
}; };
/* /*
@ -420,7 +420,7 @@ $tw.utils.evalGlobal = function(code,context,filename) {
if($tw.browser) { if($tw.browser) {
fn = window["eval"](code + "\n\n//# sourceURL=" + filename); fn = window["eval"](code + "\n\n//# sourceURL=" + filename);
} else { } else {
fn = vm.runInThisContext(code,filename); fn = vm.runInThisContext(code,filename);
} }
// Call the function and return the exports // Call the function and return the exports
return fn.apply(null,contextValues); return fn.apply(null,contextValues);
@ -571,7 +571,7 @@ $tw.utils.Crypto = function() {
} }
} catch(ex) { } catch(ex) {
console.log("Crypto error:" + ex); console.log("Crypto error:" + ex);
outputText = null; outputText = null;
} }
return outputText; return outputText;
}; };
@ -659,7 +659,7 @@ $tw.modules.execute = function(moduleName,moduleRoot) {
return window.require(moduleName); return window.require(moduleName);
} catch(e) {} } catch(e) {}
} }
throw "Cannot find module named '" + moduleName + "' required by module '" + moduleRoot + "', resolved to " + name; throw "Cannot find module named '" + moduleName + "' required by module '" + moduleRoot + "', resolved to " + name;
} else { } else {
// If we don't have a module with that name, let node.js try to find it // If we don't have a module with that name, let node.js try to find it
return require(moduleName); return require(moduleName);
@ -774,7 +774,7 @@ $tw.Tiddler = function(/* [fields,] fields */) {
} }
// Freeze the field to keep it immutable // Freeze the field to keep it immutable
if(typeof value === "object") { if(typeof value === "object") {
Object.freeze(value); Object.freeze(value);
} }
this.fields[t] = value; this.fields[t] = value;
} }
@ -844,7 +844,7 @@ $tw.Wiki = function(options) {
tiddlers[title] = tiddler; tiddlers[title] = tiddler;
this.clearCache(title); this.clearCache(title);
this.clearGlobalCache(); this.clearGlobalCache();
this.enqueueTiddlerEvent(title); this.enqueueTiddlerEvent(title);
} }
} }
}; };
@ -1031,15 +1031,15 @@ $tw.Wiki = function(options) {
}; };
// Dummy methods that will be filled in after boot // Dummy methods that will be filled in after boot
$tw.Wiki.prototype.clearCache = $tw.Wiki.prototype.clearCache =
$tw.Wiki.prototype.clearGlobalCache = $tw.Wiki.prototype.clearGlobalCache =
$tw.Wiki.prototype.enqueueTiddlerEvent = function() {}; $tw.Wiki.prototype.enqueueTiddlerEvent = function() {};
// Add an array of tiddlers // Add an array of tiddlers
$tw.Wiki.prototype.addTiddlers = function(tiddlers) { $tw.Wiki.prototype.addTiddlers = function(tiddlers) {
for(var t=0; t<tiddlers.length; t++) { for(var t=0; t<tiddlers.length; t++) {
this.addTiddler(tiddlers[t]); this.addTiddler(tiddlers[t]);
} }
}; };
/* /*
@ -1616,7 +1616,7 @@ $tw.loadTiddlersNode = function() {
} }
}; };
// End of if($tw.node) // End of if($tw.node)
} }
/////////////////////////// Main startup function called once tiddlers have been decrypted /////////////////////////// Main startup function called once tiddlers have been decrypted