summaryrefslogtreecommitdiff
path: root/www/js
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2013-08-02 21:59:14 -0400
committerAlex Xu <alex_y_xu@yahoo.ca>2013-08-02 21:59:14 -0400
commit1f1c60fc12c04a4a086df356650fdec4de051fc2 (patch)
tree7e1725495ffdd28f83c7b9786963b6e06ab03961 /www/js
parent5407f77a593360aa1d48ad5935c393a8f137efaf (diff)
downloadhtml5ks-1f1c60fc12c04a4a086df356650fdec4de051fc2.tar.xz
html5ks-1f1c60fc12c04a4a086df356650fdec4de051fc2.zip
add skip/auto indicators, fix auto mode
Diffstat (limited to 'www/js')
-rw-r--r--www/js/api.js7
-rw-r--r--www/js/menu.js8
2 files changed, 10 insertions, 5 deletions
diff --git a/www/js/api.js b/www/js/api.js
index 4c5a48f..44923ac 100644
--- a/www/js/api.js
+++ b/www/js/api.js
@@ -392,7 +392,7 @@ window.html5ks.api = {
if (html5ks.state.skip || str.indexOf("{nw}") > -1) {
html5ks.next();
} else if (html5ks.state.auto) {
- setTimeout(html5ks.next, 1000 + html5ks.persistent.autospeed * text.length);
+ setTimeout(html5ks.next, 1000 + html5ks.persistent.autoModeDelay * text.length);
}
}
return deferred.promise;
@@ -465,5 +465,10 @@ window.html5ks.api = {
html5ks.elements.choices.appendChild(frag);
return deferred.promise;
+ },
+
+ speed: function (type, status) {
+ html5ks.state[type] = status;
+ document.getElementById(type).style.display = status ? "block" : "none";
}
};
diff --git a/www/js/menu.js b/www/js/menu.js
index c8e9bd4..c03212e 100644
--- a/www/js/menu.js
+++ b/www/js/menu.js
@@ -87,8 +87,8 @@
switch (html5ks.state.status) {
case "scene":
case "context":
- html5ks.state.skip = false;
- html5ks.state.auto = false;
+ html5ks.api.speed("skip", false);
+ html5ks.api.speed("auto", false);
this.context();
}
e.preventDefault();
@@ -136,13 +136,13 @@
document.getElementById("skip-mode").addEventListener("click", function () {
html5ks.menu.context(false);
- html5ks.state.skip = true;
+ html5ks.api.speed("skip", true);
html5ks.next();
}, false);
document.getElementById("auto-mode").addEventListener("click", function () {
html5ks.menu.context(false);
- html5ks.state.auto = true;
+ html5ks.api.speed("auto", true);
html5ks.next();
}, false);