From f1453c8cb16b620b56504be26f74bb162a01110a Mon Sep 17 00:00:00 2001 From: Alex Xu Date: Sat, 3 Aug 2013 16:40:58 -0400 Subject: fix jshint errors --- www/js/api.js | 1 - www/js/html5ks.js | 26 +++++++++++++------------- www/js/menu.js | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/www/js/api.js b/www/js/api.js index da45467..d05611e 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -332,7 +332,6 @@ window.html5ks.api = { } if (char.kind === "nvl") { - var deferred = when.defer(); html5ks.elements.nvlsay.innerHTML += "" + text + ""; html5ks.elements.nvlctc.style.display = "block"; html5ks.next = function () { diff --git a/www/js/html5ks.js b/www/js/html5ks.js index ab50cea..11cbf78 100644 --- a/www/js/html5ks.js +++ b/www/js/html5ks.js @@ -23,20 +23,20 @@ window.html5ks = { language: "en" }; var loaded = localStorage.persistent ? JSON.parse(localStorage.persistent) : {}; + var defProp = function (v) { + Object.defineProperty(html5ks.persistent, k, { + get: function () { + return v; + }, + set: function (value) { + v = value; + localStorage.persistent = JSON.stringify(html5ks.persistent); + }, + enumerable: true + }); + }; for (var k in defaultPersistent) { - (function () { - var v = typeof loaded[k] === "undefined" ? defaultPersistent[k] : loaded[k]; - Object.defineProperty(html5ks.persistent, k, { - get: function () { - return v; - }, - set: function (value) { - v = value; - localStorage.persistent = JSON.stringify(html5ks.persistent); - }, - enumerable: true - }); - }()); + defProp(typeof loaded[k] === "undefined" ? defaultPersistent[k] : loaded[k]); } }, store: { diff --git a/www/js/menu.js b/www/js/menu.js index b940b30..c7e7a3a 100644 --- a/www/js/menu.js +++ b/www/js/menu.js @@ -193,7 +193,7 @@ }.bind(this)); }, - context: function (show, transitional) { + context: function (show) { switch (show) { case true: this._hadWindow = html5ks.elements.window.style.display !== "none"; -- cgit v1.2.3-70-g09d2