mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2026-10-02 14:11:43 +00:00
Obeisance to JSHint for core modules
There are still some warnings about making functions in a loop, but I’ll fix those as a separate pull request because the fixes are more than typographic errors.
This commit is contained in:
@@ -126,7 +126,7 @@ DropZoneWidget.prototype.importData = function(dataTransfer) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
DropZoneWidget.prototype.importDataTypes = [
|
||||
|
||||
@@ -120,7 +120,7 @@ EditBitmapWidget.prototype.loadCanvas = function() {
|
||||
self.initCanvas(self.currCanvas,DEFAULT_IMAGE_WIDTH,DEFAULT_IMAGE_HEIGHT);
|
||||
// Set the width and height input boxes
|
||||
self.updateSize();
|
||||
}
|
||||
};
|
||||
// Get the current bitmap into an image object
|
||||
currImage.src = "data:" + tiddler.fields.type + ";base64," + tiddler.fields.text;
|
||||
};
|
||||
@@ -135,7 +135,7 @@ EditBitmapWidget.prototype.initCanvas = function(canvas,width,height,image) {
|
||||
ctx.fillStyle = "#fff";
|
||||
ctx.fillRect(0,0,canvas.width,canvas.height);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
** Update the input boxes with the actual size of the canvas
|
||||
|
||||
@@ -78,7 +78,7 @@ FieldsWidget.prototype.execute = function() {
|
||||
row = row.replace("$name$",fieldName);
|
||||
row = row.replace("$value$",value);
|
||||
row = row.replace("$encoded_value$",$tw.utils.htmlEncode(value));
|
||||
text.push(row)
|
||||
text.push(row);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ LinkWidget.prototype.render = function(parent,nextSibling) {
|
||||
this.execute();
|
||||
// Get the value of the tv-wikilinks configuration macro
|
||||
var wikiLinksMacro = this.getVariable("tv-wikilinks"),
|
||||
useWikiLinks = wikiLinksMacro ? !(wikiLinksMacro.trim() === "no") : true;
|
||||
useWikiLinks = wikiLinksMacro ? (wikiLinksMacro.trim() !== "no") : true;
|
||||
// Render the link if required
|
||||
if(useWikiLinks) {
|
||||
this.renderLink(parent,nextSibling);
|
||||
|
||||
@@ -44,7 +44,7 @@ ListWidget.prototype.render = function(parent,nextSibling) {
|
||||
// Construct the storyview
|
||||
var StoryView = this.storyViews[this.storyViewName];
|
||||
if(StoryView && !this.document.isTiddlyWikiFakeDom) {
|
||||
this.storyview = new StoryView(this)
|
||||
this.storyview = new StoryView(this);
|
||||
} else {
|
||||
this.storyview = null;
|
||||
}
|
||||
|
||||
@@ -283,9 +283,10 @@ NavigatorWidget.prototype.makeDraftTiddler = function(targetTitle) {
|
||||
Generate a title for the draft of a given tiddler
|
||||
*/
|
||||
NavigatorWidget.prototype.generateDraftTitle = function(title) {
|
||||
var c = 0;
|
||||
var c = 0,
|
||||
draftTitle;
|
||||
do {
|
||||
var draftTitle = "Draft " + (c ? (c + 1) + " " : "") + "of '" + title + "'";
|
||||
draftTitle = "Draft " + (c ? (c + 1) + " " : "") + "of '" + title + "'";
|
||||
c++;
|
||||
} while(this.wiki.tiddlerExists(draftTitle));
|
||||
return draftTitle;
|
||||
|
||||
@@ -41,7 +41,7 @@ RevealWidget.prototype.render = function(parent,nextSibling) {
|
||||
$tw.utils.addClass(domNode,"tc-popup"); // Make sure that clicks don't dismiss popups within the revealed content
|
||||
}
|
||||
if(!this.isOpen) {
|
||||
domNode.setAttribute("hidden","true")
|
||||
domNode.setAttribute("hidden","true");
|
||||
}
|
||||
this.domNodes.push(domNode);
|
||||
};
|
||||
|
||||
@@ -44,7 +44,7 @@ TiddlerWidget.prototype.execute = function() {
|
||||
this.setVariable("missingTiddlerClass",(this.wiki.tiddlerExists(this.tiddlerTitle) || this.wiki.isShadowTiddler(this.tiddlerTitle)) ? "tc-tiddler-exists" : "tc-tiddler-missing");
|
||||
this.setVariable("shadowTiddlerClass",this.wiki.isShadowTiddler(this.tiddlerTitle) ? "tc-tiddler-shadow" : "");
|
||||
this.setVariable("systemTiddlerClass",this.wiki.isSystemTiddler(this.tiddlerTitle) ? "tc-tiddler-system" : "");
|
||||
this.setVariable("tiddlerTagClasses",this.getTagClasses())
|
||||
this.setVariable("tiddlerTagClasses",this.getTagClasses());
|
||||
// Construct the child widgets
|
||||
this.makeChildWidgets();
|
||||
};
|
||||
|
||||
@@ -171,7 +171,7 @@ Widget.prototype.evaluateMacroModule = function(name,actualParams,defaultValue)
|
||||
else for(var i=0; i<actualParams.length; ++i) {
|
||||
args.push(actualParams[i].value);
|
||||
}
|
||||
return macro.run.apply(this,args)
|
||||
return macro.run.apply(this,args);
|
||||
} else {
|
||||
return defaultValue;
|
||||
}
|
||||
@@ -289,7 +289,7 @@ Construct the widget object for a parse tree node
|
||||
Widget.prototype.makeChildWidget = function(parseTreeNode) {
|
||||
var WidgetClass = this.widgetClasses[parseTreeNode.type];
|
||||
if(!WidgetClass) {
|
||||
WidgetClass = this.widgetClasses["text"];
|
||||
WidgetClass = this.widgetClasses.text;
|
||||
parseTreeNode = {type: "text", text: "Undefined widget '" + parseTreeNode.type + "'"};
|
||||
}
|
||||
return new WidgetClass(parseTreeNode,{
|
||||
@@ -357,8 +357,7 @@ Widget.prototype.addEventListener = function(type,handler) {
|
||||
} else { // The handler is a function
|
||||
this.eventListeners[type] = function(event) {
|
||||
return handler.call(self,event);
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user