Some more linting

alternate-visualiser
William Toohey 10 years ago
parent 33f492cc7e
commit f4c587b47c
  1. 53
      js/HuesUI.js

@ -192,8 +192,9 @@ HuesUI.prototype.updateVolume = function(vol) {};
HuesUI.prototype.setSongText = function() {
var song = this.core.currentSong;
if(!song)
if(!song) {
return;
}
this.songLink.textContent = song.title.toUpperCase();
this.songLink.href = song.source;
@ -202,8 +203,9 @@ HuesUI.prototype.setSongText = function() {
HuesUI.prototype.setImageText = function() {
var image = this.core.currentImage;
if(!image)
if(!image) {
return;
}
var name = image.fullname ? image.fullname : image.name;
@ -374,8 +376,9 @@ RetroUI.prototype.modeUpdated = function() {
RetroUI.prototype.setImageText = function() {
var image = this.core.currentImage;
if(!image)
if(!image) {
return;
}
this.imageLink.textContent = "I=" + image.name.toUpperCase();
this.imageLink.href = image.source;
@ -666,6 +669,7 @@ ModernUI.prototype.toggleHide = function() {
case 1:
this.beatBar.className = "hues-m-beatbar hidden";
this.beatCenter.className = "hues-m-beatcenter hidden";
/* falls through */
case 0:
this.controls.className = "hues-m-controls hidden";
this.hideRestore.className = "hues-m-hiderestore hidden";
@ -737,8 +741,9 @@ ModernUI.prototype.resizeImage = function() {
ModernUI.prototype.setSongText = function() {
HuesUI.prototype.setSongText.call(this);
if(!this.core.currentSong)
if(!this.core.currentSong) {
return;
}
this.resizeSong();
};
@ -746,8 +751,9 @@ ModernUI.prototype.setSongText = function() {
ModernUI.prototype.setImageText = function() {
HuesUI.prototype.setImageText.call(this);
if(!this.core.currentImage)
if(!this.core.currentImage) {
return;
}
this.resizeImage();
};
@ -760,7 +766,12 @@ function XmasUI() {
this.controls.removeChild(this.rightInfo);
this.controls.removeChild(this.leftInfo);
this.leftBox = this.rightBox = this.hueName = this.xBlur = this.yBlur = this.timer = null;
this.leftBox = null;
this.rightBox = null;
this.hueName = null;
this.xBlur = null;
this.yBlur = null;
this.timer = null;
this.controls.className = "hues-x-controls";
this.beatBar.className = "hues-x-beatbar";
@ -772,38 +783,35 @@ function XmasUI() {
var left = document.createElement("div");
left.className = "hues-x-wiresleft";
for(var i = 0; i < xleft.length; i++) {
var l = xleft[i];
xleft.forEach(function(l, i, a) {
var light = this.newLight(l, left);
light.style.transform = "rotate(" + l.angle + "deg)";
light.style.left = l.x + "px";
light.style.top = l.y + "px";
this.lights.push(light);
}
}, this);
var right = document.createElement("div");
right.className = "hues-x-wiresright";
for(var i = 0; i < xright.length; i++) {
var l = xright[i];
xright.forEach(function(l, i, a) {
var light = this.newLight(l, right);
light.style.transform = "rotate(" + (-l.angle) + "deg)";
light.style.right = l.x + "px";
light.style.top = l.y + "px";
this.lights.push(light);
}
}, this);
var bottomHelper = document.createElement("div");
bottomHelper.className = "hues-x-wiresbottomhelper";
var bottom = document.createElement("div");
bottom.className = "hues-x-wiresbottom";
for(var i = 0; i < xbottom.length; i++) {
var l = xbottom[i];
xbottom.forEach(function(l, i, a) {
var light = this.newLight(l, bottom);
light.style.transform = "rotate(" + l.angle + "deg)";
light.style.left = l.x + "px";
light.style.bottom = l.y + "px";
this.lights.push(light);
}
}, this);
wires.appendChild(left);
wires.appendChild(right);
@ -877,20 +885,19 @@ XmasUI.prototype.newLight = function(l, parent) {
XmasUI.prototype.beat = function() {
ModernUI.prototype.beat.call(this);
if(this.currentBeat != ".") {
for(var i = 0; i < this.lights.length; i++) {
var l = this.lights[i];
this.lights.forEach(function(light, i, a) {
switch(this.currentBeat) {
case ": ":
this.lightOn(l);
this.lightRecolour(l);
this.lightOn(light);
this.lightRecolour(light);
break;
case "+":
this.lightFadeOut(l);
this.lightFadeOut(light);
break;
default:
this.randomLight(this.lights[i]);
}
this.randomLight(light);
}
}, this);
}
};
@ -902,6 +909,7 @@ XmasUI.prototype.toggleHide = function() {
case 1:
this.beatBar.className = "hues-x-beatbar hidden";
this.beatCenter.className = "hues-m-beatcenter hidden";
/* falls through */
case 0:
this.controls.className = "hues-x-controls hidden";
}
@ -912,6 +920,7 @@ XmasUI.prototype.setColourText = function(colour) {};
XmasUI.prototype.blurUpdated = function(x, y) {};
XmasUI.prototype.updateTime = function(time) {};
// Positions and angles for the Xmas lights
var xleft = [
{"angle": 122.529582194, "x": 19.4, "y": -19.35},
{"angle": 92.5309436511, "x": 25.4, "y": 38.7},

Loading…
Cancel
Save