From 34352276297d2b04627d19807e3a2be313b4bf10 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 3 Mar 2014 20:39:17 +0100 Subject: Include new view in website --- website/assets/js/script.js | 46 --------------------------------------------- 1 file changed, 46 deletions(-) delete mode 100644 website/assets/js/script.js (limited to 'website/assets/js/script.js') diff --git a/website/assets/js/script.js b/website/assets/js/script.js deleted file mode 100644 index f433de0..0000000 --- a/website/assets/js/script.js +++ /dev/null @@ -1,46 +0,0 @@ -// Using deployJava.runApplet to target specific element -// from http://stackoverflow.com/questions/13517790/using-deployjava-runapplet-to-target-specific-element?answertab=active#answer-15139480 -function writeTo(func, node) { - var content = ""; - var oldwrite = document.write; - document.write = function(add) { - content += add; - }; - func(); - document.write = oldwrite; - node.innerHTML += content; -} - -function launchApplet() { - var attributes = { - code : "esieequest.Main", - archive : "/game/esieequest.jar" - }; - var parameters = { - //permissions : "sandbox" - }; - var version = "1.7"; - deployJava.runApplet(attributes, parameters, version); -} - -function launchGame() { - var wrapper = document.getElementById("play"); - if (deployJava.versionCheck("1.7+")) { - writeTo(launchApplet, wrapper); - } else { - wrapper.innerHTML = '

Java ≥7 is required to run this game.
Click here to get the latest Java Runtime Environment.

'; - } -} - -// Run the applet only when the user wants to play -// https://developer.mozilla.org/en-US/docs/Web/API/window.onhashchange -var launched = false; -function locationHashChanged() { - if (location.hash === "#play" && !launched) { - launched = true; - launchGame(); - } -} - -window.onhashchange = locationHashChanged; -locationHashChanged(); -- cgit v1.2.3