From d6623c2eaa246fb87d7c3641a2034920972d101c Mon Sep 17 00:00:00 2001 From: fonzerelly Date: Wed, 24 Jun 2015 18:05:47 +0200 Subject: [PATCH 1/2] ignore vim backup files --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 225191a..f41806b 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,5 @@ node_modules npm-debug.log tmp photobox +*.*~ +*.swp From d979caf5500feb6a98599f5f6ddbeadfe3e1c4da Mon Sep 17 00:00:00 2001 From: fonzerelly Date: Wed, 24 Jun 2015 18:07:28 +0200 Subject: [PATCH 2/2] Bugfix for Chrome Version 43.0.2357.130 m The latest Chrome seems to have problems with setting a message-callback with by 'addEventListener' --- tasks/assets/scripts/worker.js | 2 +- tasks/tpl/canvas.tpl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/assets/scripts/worker.js b/tasks/assets/scripts/worker.js index 115dd65..5fd376b 100644 --- a/tasks/assets/scripts/worker.js +++ b/tasks/assets/scripts/worker.js @@ -94,7 +94,7 @@ function diff( pixelsA, pixelsB, config ) { } -var onmessage = function( event ) { +this.onmessage = function( event ) { 'use strict'; var data = event.data; var result = diff( data.a, data.b, data.config ); diff --git a/tasks/tpl/canvas.tpl b/tasks/tpl/canvas.tpl index dea788d..014e25f 100644 --- a/tasks/tpl/canvas.tpl +++ b/tasks/tpl/canvas.tpl @@ -349,11 +349,11 @@ var worker = new Worker( 'scripts/worker.js' ); worker.postMessage( data ); - worker.addEventListener( 'message', function( e ) { + worker.onmessage = function( e ) { ctx.putImageData( e.data.imageData, 0, 0 ); processing.style.display = 'none' console.warn( 'Found ', e.data.amount, 'different pixels' ); - }, false); + }; }