summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-07-25 12:48:16 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-07-25 12:48:16 -0400
commit4db774c1ec0c0b20611fea938d2603e6a3dfe4ca (patch)
treeb41afaaee6cd85846b4bb68f692ee503e918e01c /www
parent23518a31d24e62caeecbfafe7708f4c7ffcd24f5 (diff)
downloadhtml5ks-4db774c1ec0c0b20611fea938d2603e6a3dfe4ca.tar.xz
html5ks-4db774c1ec0c0b20611fea938d2603e6a3dfe4ca.zip
pre-gzip script.json as part of build process
Diffstat (limited to 'www')
-rw-r--r--www/js/html5ks.js15
1 files changed, 6 insertions, 9 deletions
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();
}
};