From 4db774c1ec0c0b20611fea938d2603e6a3dfe4ca Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Thu, 25 Jul 2013 12:48:16 -0400 Subject: pre-gzip script.json as part of build process --- www/js/html5ks.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'www') diff --git a/www/js/html5ks.js b/www/js/html5ks.js index 059cbbe..0c2c1f7 100644 --- a/www/js/html5ks.js +++ b/www/js/html5ks.js @@ -172,7 +172,7 @@ window.html5ks = { } }, start: function () { - this.fetch("script", "a1-monday").then(function () { + this.fetch("script").then(function () { html5ks.api.movie_cutscene("4ls", true).then(function () { html5ks.menu.mainMenu(); }); @@ -183,18 +183,15 @@ window.html5ks = { var xhr = new XMLHttpRequest(); switch (type) { case "script": - var script = html5ks.data.script; - if (script[name]) { + if (html5ks.data._scriptFetched) { deferred.resolve(); } else { - xhr.open("GET", "scripts/script-" + name + ".json"); + xhr.open("GET", "scripts/script.json"); xhr.onreadystatechange = function () { - script[name] = true; if (xhr.readyState === 4) { - var resp = JSON.parse(xhr.responseText); - for (var label in resp) { - script[label] = resp[label]; - } + html5ks.data._scriptFetched = true; + var script = JSON.parse(xhr.responseText); + html5ks.data.script = script; deferred.resolve(); } }; -- cgit v1.2.3-70-g09d2