From d385c9ee22f78177871b67b6e6bb8973c81261dd Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Fri, 22 May 2015 17:14:09 +0200 Subject: [PATCH] Test changes and removed useless function stuff --- js/prototype/Coin.js | 18 +++++++----------- server.js | 2 +- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/js/prototype/Coin.js b/js/prototype/Coin.js index 45bb86b..f2225ca 100644 --- a/js/prototype/Coin.js +++ b/js/prototype/Coin.js @@ -51,18 +51,14 @@ Coin.prototype.get = function() { var music = document.getElementById('music'); var wasPlaying = !music.paused; music.pause(); - (function(music, wasPlaying) { + setTimeout(function() { + Coin.lastSound.play(); setTimeout(function() { - Coin.lastSound.play(); - (function(wasPlaying) { - setTimeout(function() { - if (wasPlaying) { - music.play(); - } - }, Coin.lastSound.duration*1000); - })(wasPlaying); - }, Coin.nextSound.duration*1000); - })(music, wasPlaying); + if (wasPlaying) { + music.play(); + } + }, Coin.lastSound.duration*1000); + }, Coin.nextSound.duration*1000); } else { Coin.nextSound = new Audio('/static/data/music/redcoins/' + Coin.total + Coin.extension); Coin.nextSound.preload = "auto"; diff --git a/server.js b/server.js index 8100491..eb31add 100644 --- a/server.js +++ b/server.js @@ -85,5 +85,5 @@ if ( app.get('env') === 'development' ) { } // Start server -console.log("Server ready : " + server_ip_address + ":" + server_port); +console.log("Server ready : now listening " + server_ip_address + ":" + server_port); app.listen(server_port, server_ip_address);