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:
parent
8fc5c1d4a0
commit
1a74e2538c
@ -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;
|
||||
|
@ -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",
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
@ -84,7 +84,7 @@ RadioWidget.prototype.setValue = function() {
|
||||
};
|
||||
|
||||
RadioWidget.prototype.handleChangeEvent = function(event) {
|
||||
if (this.inputDomNode.checked) {
|
||||
if(this.inputDomNode.checked) {
|
||||
this.setValue();
|
||||
}
|
||||
};
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user