summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2014-01-05 19:35:43 -0500
committerAlex Xu <alex_y_xu@yahoo.ca>2014-01-05 19:35:43 -0500
commit78b5b9f3ce3911755e041f30fbe48698f8f9f809 (patch)
tree310e374954f19bcc84dfdad31e3303e160c1b660
parent1b6eedc7b19b9dbc51b58a5cc95fb17254b47231 (diff)
downloadhtml5ks-78b5b9f3ce3911755e041f30fbe48698f8f9f809.tar.xz
html5ks-78b5b9f3ce3911755e041f30fbe48698f8f9f809.zip
Stuff. Reduce memory usage.
-rw-r--r--Makefile2
-rw-r--r--www/js/html5ks.js10
2 files changed, 9 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 1f5061b..8114faf 100644
--- a/Makefile
+++ b/Makefile
@@ -94,7 +94,7 @@ $(DUMP)/ui/ctc_anim.webp: $(CTC_ANIM_TMP_WEBP)
js: www/js/all.min.js
www/js/all.min.js: www/js/html5ks.js www/js/menu.js www/js/api.js www/js/play.js www/js/images.js www/js/characters.js www/js/imachine.js www/js/i18n.js
- $(UGLIFYJS) $^ -o $@ --source-map $@.map --source-map-root / -p 2 -m -c
+ $(UGLIFYJS) $^ -o $@ --source-map $@.map -p 2 -m -c
clean:
$(RM) $(CVIDEO) $(CAUDIO) $(WEBP) www/favicon.ico
diff --git a/www/js/html5ks.js b/www/js/html5ks.js
index a413ed5..b637eb1 100644
--- a/www/js/html5ks.js
+++ b/www/js/html5ks.js
@@ -187,8 +187,14 @@ window.html5ks = {
} else {
xhr.open("GET", "json/" + name + ".json");
xhr.onload = function () {
- html5ks.data[name] = JSON.parse(xhr.responseText);
- deferred.resolve(html5ks.data[name]);
+ d = JSON.parse(xhr.responseText);
+ for (var k in d) {
+ if (k.slice(0, 3) === (html5ks.persistent.language === "en" ? "fr_" : "en_")) {
+ delete d[k];
+ }
+ }
+ html5ks.data[name] = d;
+ deferred.resolve(d);
};
xhr.send();
}