From 1a74e2538c998c7f61ba9ce6127b85f8cbbc7124 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 3 Jan 2014 10:50:00 +0000 Subject: [PATCH] Cleaning up further coding style inconsistencies that have crept in --- boot/boot.js | 4 ++-- core/modules/parsers/wikiparser/rules/quoteblock.js | 4 ++-- core/modules/savers/fsosaver.js | 2 +- core/modules/utils/utils.js | 2 +- core/modules/widgets/radio.js | 2 +- core/modules/wiki.js | 2 +- 6 files changed, 8 insertions(+), 8 deletions(-) diff --git a/boot/boot.js b/boot/boot.js index a5c96cf07..0d05b832a 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -246,7 +246,7 @@ $tw.utils.parseDate = function(value) { parseInt(value.substr(10,2)||"00",10), parseInt(value.substr(12,2)||"00",10), parseInt(value.substr(14,3)||"000",10))); - } else if ($tw.utils.isDate(value)) { + } else if($tw.utils.isDate(value)) { return value; } else { return null; @@ -282,7 +282,7 @@ $tw.utils.parseStringArray = function(value) { } } while(match); return results; - } else if ($tw.utils.isArray(value)) { + } else if($tw.utils.isArray(value)) { return value; } else { return null; diff --git a/core/modules/parsers/wikiparser/rules/quoteblock.js b/core/modules/parsers/wikiparser/rules/quoteblock.js index e69c8edc8..c2c1884a8 100644 --- a/core/modules/parsers/wikiparser/rules/quoteblock.js +++ b/core/modules/parsers/wikiparser/rules/quoteblock.js @@ -59,7 +59,7 @@ exports.parse = function() { // before handling the cite, parse the body of the quote var tree= this.parser.parseBlocks(reEndString); // If we got a cite, put it before the text - if ( cite.length > 0 ) { + if(cite.length > 0) { tree.unshift({ type: "element", tag: "cite", @@ -71,7 +71,7 @@ exports.parse = function() { this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true}); var cite = this.parser.parseInlineRun(/(\r?\n)/mg); // If we got a cite, push it - if ( cite.length > 0 ) { + if(cite.length > 0) { tree.push({ type: "element", tag: "cite", diff --git a/core/modules/savers/fsosaver.js b/core/modules/savers/fsosaver.js index b036f3b88..bfff51681 100644 --- a/core/modules/savers/fsosaver.js +++ b/core/modules/savers/fsosaver.js @@ -32,7 +32,7 @@ FSOSaver.prototype.save = function(text,method,callback) { if(/^\/[A-Z]\:\\[^\\]+/i.test(pathname)) { // ie: ^/[a-z]:/[^/]+ // Remove the leading slash pathname = pathname.substr(1); - } else if (document.location.hostname !== "" && /^\/\\[^\\]+\\[^\\]+/i.test(pathname)) { // test for \\server\share\blah... - ^/[^/]+/[^/]+ + } else if(document.location.hostname !== "" && /^\/\\[^\\]+\\[^\\]+/i.test(pathname)) { // test for \\server\share\blah... - ^/[^/]+/[^/]+ // Remove the leading slash pathname = pathname.substr(1); // reconstruct UNC path diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 9e8811646..0bb936177 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -275,7 +275,7 @@ exports.unescapeLineBreaks = function(s) { // Copied from peg.js, thanks to David Majda exports.escape = function(ch) { var charCode = ch.charCodeAt(0); - if (charCode <= 0xFF) { + if(charCode <= 0xFF) { return '\\x' + $tw.utils.pad(charCode.toString(16).toUpperCase()); } else { return '\\u' + $tw.utils.pad(charCode.toString(16).toUpperCase(),4); diff --git a/core/modules/widgets/radio.js b/core/modules/widgets/radio.js index be18da8f9..66c4c7419 100644 --- a/core/modules/widgets/radio.js +++ b/core/modules/widgets/radio.js @@ -84,7 +84,7 @@ RadioWidget.prototype.setValue = function() { }; RadioWidget.prototype.handleChangeEvent = function(event) { - if (this.inputDomNode.checked) { + if(this.inputDomNode.checked) { this.setValue(); } }; diff --git a/core/modules/wiki.js b/core/modules/wiki.js index 80b8fbfe0..7ab147b44 100755 --- a/core/modules/wiki.js +++ b/core/modules/wiki.js @@ -312,7 +312,7 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is a = self.getTiddler(a).fields[sortField] || ""; b = self.getTiddler(b).fields[sortField] || ""; } - if (!isNumeric || isNaN(a) || isNaN(b)) { + if(!isNumeric || isNaN(a) || isNaN(b)) { if(!isCaseSensitive) { if(typeof a === "string") { a = a.toLowerCase();