From 0ba03cdece9fadea5d75a881101bbb4162acbdd0 Mon Sep 17 00:00:00 2001 From: Thomas FORGIONE Date: Mon, 22 Jun 2015 14:08:11 +0200 Subject: [PATCH] Added warning before leaving the page --- js/prototype/main.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/js/prototype/main.js b/js/prototype/main.js index ad6e7ff..ae509b5 100644 --- a/js/prototype/main.js +++ b/js/prototype/main.js @@ -42,6 +42,15 @@ var loader; var coins = []; var previousTime; +window.onbeforeunload = function() { + + if (initMainScene !== initPeach && initMainScene !== initSponza && Coin.total !== 9) { + + return 'Warning : you are going to leave the page and abort the current test !'; + + } + +} init();