diff options
-rw-r--r-- | Makefile | 12 | ||||
-rw-r--r-- | www/js/html5ks.js | 7 |
2 files changed, 12 insertions, 7 deletions
@@ -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 () { |