mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-12-07 17:28:05 +00:00
style(App) eliminate whitespace at the end of code lines (#5735)
This commit is contained in:
@@ -38,7 +38,7 @@ exports.parseCsvStringWithHeader = function(text,options) {
|
||||
var columnName = headings[column];
|
||||
columnResult[columnName] = $tw.utils.trim(columns[column] || "");
|
||||
}
|
||||
results.push(columnResult);
|
||||
results.push(columnResult);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ Get the first parent element that has scrollbars or use the body as fallback.
|
||||
*/
|
||||
exports.getScrollContainer = function(el) {
|
||||
var doc = el.ownerDocument;
|
||||
while(el.parentNode) {
|
||||
while(el.parentNode) {
|
||||
el = el.parentNode;
|
||||
if(el.scrollTop) {
|
||||
return el;
|
||||
@@ -208,7 +208,7 @@ exports.addEventListeners = function(domNode,events) {
|
||||
if(eventInfo.handlerMethod) {
|
||||
handler = function(event) {
|
||||
eventInfo.handlerObject[eventInfo.handlerMethod].call(eventInfo.handlerObject,event);
|
||||
};
|
||||
};
|
||||
} else {
|
||||
handler = eventInfo.handlerObject;
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ exports.makeDraggable = function(options) {
|
||||
domNode = options.domNode;
|
||||
// Make the dom node draggable (not necessary for anchor tags)
|
||||
if((domNode.tagName || "").toLowerCase() !== "a") {
|
||||
domNode.setAttribute("draggable","true");
|
||||
domNode.setAttribute("draggable","true");
|
||||
}
|
||||
// Add event handlers
|
||||
$tw.utils.addEventListeners(domNode,[
|
||||
@@ -80,7 +80,7 @@ exports.makeDraggable = function(options) {
|
||||
}
|
||||
// Set up the data transfer
|
||||
if(dataTransfer.clearData) {
|
||||
dataTransfer.clearData();
|
||||
dataTransfer.clearData();
|
||||
}
|
||||
var jsonData = [];
|
||||
if(titles.length > 1) {
|
||||
|
||||
@@ -105,7 +105,7 @@ Modal.prototype.display = function(title,options) {
|
||||
parentWidget: $tw.rootWidget
|
||||
});
|
||||
navigatorWidgetNode.render(modalBody,null);
|
||||
|
||||
|
||||
// Render the title of the message
|
||||
var headerWidgetNode = this.wiki.makeTranscludeWidget(title,{
|
||||
field: "subtitle",
|
||||
|
||||
@@ -145,7 +145,7 @@ Popup.prototype.show = function(options) {
|
||||
}
|
||||
// Add the click handler if we have any popups
|
||||
if(this.popups.length > 0) {
|
||||
this.rootElement.addEventListener("click",this,true);
|
||||
this.rootElement.addEventListener("click",this,true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ PageScroller.prototype.handleEvent = function(event) {
|
||||
if(event.paramObject && event.paramObject.selector) {
|
||||
this.scrollSelectorIntoView(null,event.paramObject.selector);
|
||||
} else {
|
||||
this.scrollIntoView(event.target);
|
||||
this.scrollIntoView(event.target);
|
||||
}
|
||||
return false; // Event was handled
|
||||
}
|
||||
@@ -103,7 +103,7 @@ PageScroller.prototype.scrollIntoView = function(element,callback) {
|
||||
if(duration <= 0) {
|
||||
t = 1;
|
||||
} else {
|
||||
t = ((Date.now()) - self.startTime) / duration;
|
||||
t = ((Date.now()) - self.startTime) / duration;
|
||||
}
|
||||
if(t >= 1) {
|
||||
self.cancelScroll(srcWindow);
|
||||
@@ -126,7 +126,7 @@ PageScroller.prototype.scrollSelectorIntoView = function(baseElement,selector,ca
|
||||
baseElement = baseElement || document.body;
|
||||
var element = baseElement.querySelector(selector);
|
||||
if(element) {
|
||||
this.scrollIntoView(element,callback);
|
||||
this.scrollIntoView(element,callback);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ exports.generateTiddlerFilepath = function(title,options) {
|
||||
// If the resulting filename is blank (eg because the title is just punctuation)
|
||||
if(!filepath || /^_+$/g.test(filepath)) {
|
||||
// ...then just use the character codes of the title
|
||||
filepath = "";
|
||||
filepath = "";
|
||||
$tw.utils.each(title.split(""),function(char) {
|
||||
if(filepath) {
|
||||
filepath += "-";
|
||||
@@ -488,7 +488,7 @@ exports.deleteTiddlerFile = function(fileInfo,callback) {
|
||||
fs.unlink(fileInfo.filepath,function(err) {
|
||||
if(err) {
|
||||
return callback(err);
|
||||
}
|
||||
}
|
||||
// Delete the metafile if present
|
||||
if(fileInfo.hasMetaFile && fs.existsSync(fileInfo.filepath + ".meta")) {
|
||||
fs.unlink(fileInfo.filepath + ".meta",function(err) {
|
||||
|
||||
@@ -45,7 +45,7 @@ Logger.prototype.log = function(/* args */) {
|
||||
self.saveBufferLogger.buffer += " " + arg;
|
||||
});
|
||||
this.saveBufferLogger.buffer += "\n";
|
||||
this.saveBufferLogger.buffer = this.saveBufferLogger.buffer.slice(-this.saveBufferLogger.saveLimit);
|
||||
this.saveBufferLogger.buffer = this.saveBufferLogger.buffer.slice(-this.saveBufferLogger.saveLimit);
|
||||
}
|
||||
if(console !== undefined && console.log !== undefined) {
|
||||
return Function.apply.call(console.log, console, [$tw.utils.terminalColour(this.colour),this.componentName + ":"].concat(Array.prototype.slice.call(arguments,0)).concat($tw.utils.terminalColour()));
|
||||
@@ -111,7 +111,7 @@ Logger.prototype.alert = function(/* args */) {
|
||||
} else {
|
||||
// Print an orange message to the console if not in the browser
|
||||
console.error("\x1b[1;33m" + text + "\x1b[0m");
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ function Performance(enabled) {
|
||||
|
||||
Performance.prototype.showGreeting = function() {
|
||||
if($tw.browser) {
|
||||
this.logger.log("Execute $tw.perf.log(); to see filter execution timings");
|
||||
this.logger.log("Execute $tw.perf.log(); to see filter execution timings");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -150,7 +150,7 @@ Convert a string to title case (ie capitalise each initial letter)
|
||||
exports.toTitleCase = function(str) {
|
||||
return (str || "").replace(/(^|\s)\S/g, function(c) {return c.toUpperCase();});
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Find the line break preceding a given position in a string
|
||||
Returns position immediately after that line break, or the start of the string
|
||||
@@ -842,7 +842,7 @@ exports.makeDataUri = function(text,type,_canonical_uri) {
|
||||
parts.push(type);
|
||||
parts.push(isBase64 ? ";base64" : "");
|
||||
parts.push(",");
|
||||
parts.push(isBase64 ? text : encodeURIComponent(text));
|
||||
parts.push(isBase64 ? text : encodeURIComponent(text));
|
||||
}
|
||||
return parts.join("");
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user