From d9af299843dca9b6c9c890a6c7bbce99b2b32fb1 Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sat, 25 Jan 2014 14:51:45 -0500 Subject: stuff. --- Makefile | 12 +++++++++--- www/js/html5ks.js | 7 +++---- 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 () { -- cgit v1.2.3-70-g09d2