diff --git a/scripts/image-app.js b/scripts/image-app.js index 7305398..b445dce 100644 --- a/scripts/image-app.js +++ b/scripts/image-app.js @@ -15,9 +15,9 @@ canvas.height = img.height; ctx.drawImage(img,0,0); original = ctx.getImageData(0, 0, canvas.width, canvas.height); - } + }; img.src = event.target.result; - } + }; reader.readAsDataURL(e.target.files[0]); } @@ -27,11 +27,11 @@ var buttons = document.querySelectorAll('button'); for (var i = 0; i < buttons.length; i++) { if (buttons[i].hasAttribute('disabled')) { - buttons[i].removeAttribute('disabled') + buttons[i].removeAttribute('disabled'); } else { buttons[i].setAttribute('disabled', null); } - }; + } } function manipulateImage(type) { @@ -57,7 +57,7 @@ } toggleButtonsAbledness(); return ctx.putImageData(imageData, 0, 0); - }; + } function revertImage() { return ctx.putImageData(original, 0, 0); @@ -78,4 +78,4 @@ document.querySelector('#revert').onclick = function() { revertImage(); }; -})(); \ No newline at end of file +})(); diff --git a/scripts/imageManips.js b/scripts/imageManips.js index ff8f2c3..9ef885d 100644 --- a/scripts/imageManips.js +++ b/scripts/imageManips.js @@ -1,7 +1,7 @@ // Image manipulation logic from github.com/jwill/psychic-lana function manipulate(type, r, g, b, a) { - + var func = function() {}; function makePixelInverted(r, g, b, a) { @@ -9,7 +9,7 @@ function manipulate(type, r, g, b, a) { g = 255 - g; b = 255 - b; return [r, g, b, a]; - }; + } function makePixelChroma(r, g, b, a) { var max; @@ -19,7 +19,7 @@ function manipulate(type, r, g, b, a) { } else { return [r, g, b, a]; } - }; + } function makePixelGreyScale(r, g, b, a) { var y; @@ -28,7 +28,7 @@ function manipulate(type, r, g, b, a) { g = y; b = y; return [r, g, b, a]; - }; + } function makePixelVibrant(r, g, b, a) { var amt, avg, bs, gs, mx, rs; @@ -39,7 +39,7 @@ function manipulate(type, r, g, b, a) { gs = g + (amt * (mx - g)); bs = b + (amt * (mx - b)); return [rs, gs, bs, a]; - }; + } switch (type) { case "invert": @@ -60,4 +60,4 @@ function manipulate(type, r, g, b, a) { } return func(r, g, b, a); -} \ No newline at end of file +} diff --git a/scripts/time-animator.js b/scripts/time-animator.js index 13c8084..980a4c6 100644 --- a/scripts/time-animator.js +++ b/scripts/time-animator.js @@ -35,7 +35,7 @@ "Thursday", "Friday", "Saturday" - ] + ]; var months = [ "January", @@ -50,7 +50,7 @@ "October", "November", "December" - ] + ]; var now = new Date(Date.now()); @@ -75,7 +75,7 @@ var dateString = days[day] + ", " + date + " " + months[month] + " " + parseInt(1900 + year); var timeString = hours + ":" + mins + ":" + secs + ":" + ms; - + // calc the time diff between frames, starting with the second frame if (lastTime > 0) { frameTimeDiff = now - lastTime; @@ -112,5 +112,5 @@ // save the data about this frame for future comparison lastTime = now; lastDiff = frameTimeDiff; - }; -})(); \ No newline at end of file + } +})(); diff --git a/scripts/worker.js b/scripts/worker.js index 4f7985b..4622d78 100644 --- a/scripts/worker.js +++ b/scripts/worker.js @@ -18,12 +18,11 @@ this.onmessage = function(e) { imageData.data[i * 4 + 3] = pixel[3]; } postMessage(imageData); - } catch (e) { + } catch (ex) { function ManipulationException(message) { this.name = "ManipulationException"; this.message = message; - }; + } throw new ManipulationException('Image manipulation error'); - postMessage(undefined); } -} \ No newline at end of file +};