From 42056cee40e9d0e0f0cfb2260fa168555e792fcb Mon Sep 17 00:00:00 2001 From: William Toohey Date: Tue, 29 Sep 2015 13:25:50 +1000 Subject: [PATCH] Minor code cleanup --- js/HuesCanvas.js | 20 ++++++++++---------- js/HuesCore.js | 4 ++-- js/ResourcePack.js | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/js/HuesCanvas.js b/js/HuesCanvas.js index a0b6a38..39609ad 100644 --- a/js/HuesCanvas.js +++ b/js/HuesCanvas.js @@ -32,17 +32,17 @@ function HuesCanvas(element, aContext, core) { this.image = null; this.smartAlign = true; // avoid string comparisons every frame - this.animTimeout; - this.animFrame; + this.animTimeout = null; + this.animFrame = null; // set later - this.blurDecay; - this.blurAmount; - this.blurIterations; - this.blurMin; - this.blurMax; - this.blurDelta; - this.blurAlpha; + this.blurDecay = null; + this.blurAmount = null; + this.blurIterations = null; + this.blurMin = null; + this.blurMax = null; + this.blurDelta = null; + this.blurAlpha = null; // dynamic this.blurStart = 0; this.blurDistance = 0; @@ -51,7 +51,7 @@ function HuesCanvas(element, aContext, core) { this.blackout = false; this.blackoutColour = "#000"; // for the whiteout case we must store this - this.blackoutTimeout; + this.blackoutTimeout = null; this.colourFade = false; this.colourFadeStart=0; diff --git a/js/HuesCore.js b/js/HuesCore.js index 3ff8461..385cb5c 100644 --- a/js/HuesCore.js +++ b/js/HuesCore.js @@ -24,8 +24,8 @@ HuesCore = function(defaults) { this.version = "0x01"; this.beatIndex = 0; this.beatLength=-1; - this.currentSong; - this.currentImage; + this.currentSong = null; + this.currentImage = null; this.songIndex=-1; this.colourIndex=0x3f; this.imageIndex=-1; diff --git a/js/ResourcePack.js b/js/ResourcePack.js index 29a6e06..2593f64 100644 --- a/js/ResourcePack.js +++ b/js/ResourcePack.js @@ -346,7 +346,7 @@ Respack.prototype.parseImageFile = function(text) { debug(" WARNING!", image.name, "has no full name!"); } image.source = el.getTag("source"); - // self reference strings to avoid changing strings twice in future + // self reference defaults to avoid changing strings twice in future image.align = el.getTag("align", image.align); var frameDur = el.getTag("frameDuration"); if(frameDur) {