summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2014-01-25 14:51:45 -0500
committerAlex Xu <alex_y_xu@yahoo.ca>2014-01-25 14:51:45 -0500
commitd9af299843dca9b6c9c890a6c7bbce99b2b32fb1 (patch)
treeee625ebe6987e0223829ec86676520d72267e38a
parente75aa4e89dcc79383e49a954fc268307736b2b98 (diff)
downloadhtml5ks-d9af299843dca9b6c9c890a6c7bbce99b2b32fb1.tar.xz
html5ks-d9af299843dca9b6c9c890a6c7bbce99b2b32fb1.zip
stuff.
-rw-r--r--Makefile12
-rw-r--r--www/js/html5ks.js7
2 files changed, 12 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 5c7e09e..482a32f 100644
--- a/Makefile
+++ b/Makefile
@@ -118,7 +118,9 @@ $(DUMP)/ui/ctc_anim.webp: $(CTC_ANIM_TMP_WEBP)
# === JS ===
-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
+JSCODE := www/js/html5ks.js www/js/menu.js www/js/api.js www/js/characters.js www/js/imachine.js www/js/i18n.js
+JSDATA := www/js/play.js www/js/images.js
+JS := $(JSCODE) $(JSDATA)
js: www/js/all.min.js
@@ -130,11 +132,13 @@ www/js/all.min.js: $(JS)
clean:
$(RM) $(CVIDEO) $(CAUDIO) $(WEBP) www/favicon.ico
-jshint: $(JS)
+jshint: $(JSCODE)
jshint $^
space:
- find $(DUMP) \( -name '*.wav' -o -name '*.mkv' -o -path "$(DUMP)/font*" -o -name 'ctc_strip-*.*' \) -print -delete
+ find $(DUMP)/bgm $(DUMP)/sfx $(DUMP)/video \( -name '*.wav' -o -name '*.mkv' \) -delete
+ $(RM) -r $(DUMP)/font
+ $(RM) $(DUMP)/ui/ctc_strip-*.*
watch:
while inotifywait -r -e modify,delete,move --exclude="^\./\.git" --exclude="\.swp$$" .; do \
@@ -142,4 +146,6 @@ watch:
done
.PHONY: video audio images js jshint clean space watch
+
+# disable default rules, increases `make` speed by 3 seconds
.SUFFIXES:
diff --git a/www/js/html5ks.js b/www/js/html5ks.js
index 093505e..50555b3 100644
--- a/www/js/html5ks.js
+++ b/www/js/html5ks.js
@@ -19,11 +19,10 @@ window.html5ks = {
sfxVolume: 1,
language: "en"
};
+ var loaded = {};
try {
- var loaded = localStorage.persistent ? JSON.parse(localStorage.persistent) : {};
- } catch (e) {
- var loaded = {};
- }
+ loaded = JSON.parse(localStorage.persistent);
+ } catch (e) {}
var defProp = function (v) {
Object.defineProperty(html5ks.persistent, k, {
get: function () {