1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-26 19:47:20 +00:00

Cleaning up further coding style inconsistencies that have crept in

This commit is contained in:
Jermolene 2014-01-03 10:50:00 +00:00
parent 8fc5c1d4a0
commit 1a74e2538c
6 changed files with 8 additions and 8 deletions

View File

@ -246,7 +246,7 @@ $tw.utils.parseDate = function(value) {
parseInt(value.substr(10,2)||"00",10), parseInt(value.substr(10,2)||"00",10),
parseInt(value.substr(12,2)||"00",10), parseInt(value.substr(12,2)||"00",10),
parseInt(value.substr(14,3)||"000",10))); parseInt(value.substr(14,3)||"000",10)));
} else if ($tw.utils.isDate(value)) { } else if($tw.utils.isDate(value)) {
return value; return value;
} else { } else {
return null; return null;
@ -282,7 +282,7 @@ $tw.utils.parseStringArray = function(value) {
} }
} while(match); } while(match);
return results; return results;
} else if ($tw.utils.isArray(value)) { } else if($tw.utils.isArray(value)) {
return value; return value;
} else { } else {
return null; return null;

View File

@ -59,7 +59,7 @@ exports.parse = function() {
// before handling the cite, parse the body of the quote // before handling the cite, parse the body of the quote
var tree= this.parser.parseBlocks(reEndString); var tree= this.parser.parseBlocks(reEndString);
// If we got a cite, put it before the text // If we got a cite, put it before the text
if ( cite.length > 0 ) { if(cite.length > 0) {
tree.unshift({ tree.unshift({
type: "element", type: "element",
tag: "cite", tag: "cite",
@ -71,7 +71,7 @@ exports.parse = function() {
this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true}); this.parser.skipWhitespace({treatNewlinesAsNonWhitespace: true});
var cite = this.parser.parseInlineRun(/(\r?\n)/mg); var cite = this.parser.parseInlineRun(/(\r?\n)/mg);
// If we got a cite, push it // If we got a cite, push it
if ( cite.length > 0 ) { if(cite.length > 0) {
tree.push({ tree.push({
type: "element", type: "element",
tag: "cite", tag: "cite",

View File

@ -32,7 +32,7 @@ FSOSaver.prototype.save = function(text,method,callback) {
if(/^\/[A-Z]\:\\[^\\]+/i.test(pathname)) { // ie: ^/[a-z]:/[^/]+ if(/^\/[A-Z]\:\\[^\\]+/i.test(pathname)) { // ie: ^/[a-z]:/[^/]+
// Remove the leading slash // Remove the leading slash
pathname = pathname.substr(1); 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 // Remove the leading slash
pathname = pathname.substr(1); pathname = pathname.substr(1);
// reconstruct UNC path // reconstruct UNC path

View File

@ -275,7 +275,7 @@ exports.unescapeLineBreaks = function(s) {
// Copied from peg.js, thanks to David Majda // Copied from peg.js, thanks to David Majda
exports.escape = function(ch) { exports.escape = function(ch) {
var charCode = ch.charCodeAt(0); var charCode = ch.charCodeAt(0);
if (charCode <= 0xFF) { if(charCode <= 0xFF) {
return '\\x' + $tw.utils.pad(charCode.toString(16).toUpperCase()); return '\\x' + $tw.utils.pad(charCode.toString(16).toUpperCase());
} else { } else {
return '\\u' + $tw.utils.pad(charCode.toString(16).toUpperCase(),4); return '\\u' + $tw.utils.pad(charCode.toString(16).toUpperCase(),4);

View File

@ -84,7 +84,7 @@ RadioWidget.prototype.setValue = function() {
}; };
RadioWidget.prototype.handleChangeEvent = function(event) { RadioWidget.prototype.handleChangeEvent = function(event) {
if (this.inputDomNode.checked) { if(this.inputDomNode.checked) {
this.setValue(); this.setValue();
} }
}; };

View File

@ -312,7 +312,7 @@ exports.sortTiddlers = function(titles,sortField,isDescending,isCaseSensitive,is
a = self.getTiddler(a).fields[sortField] || ""; a = self.getTiddler(a).fields[sortField] || "";
b = self.getTiddler(b).fields[sortField] || ""; b = self.getTiddler(b).fields[sortField] || "";
} }
if (!isNumeric || isNaN(a) || isNaN(b)) { if(!isNumeric || isNaN(a) || isNaN(b)) {
if(!isCaseSensitive) { if(!isCaseSensitive) {
if(typeof a === "string") { if(typeof a === "string") {
a = a.toLowerCase(); a = a.toLowerCase();