diff options
author | Alex Xu <alex_y_xu@yahoo.ca> | 2014-01-01 13:27:10 -0500 |
---|---|---|
committer | Alex Xu <alex_y_xu@yahoo.ca> | 2014-01-01 13:27:10 -0500 |
commit | 902180ba926905f6002739919c4a814633ed3474 (patch) | |
tree | edbc8050390a592b815ce43dd43687fdd6225f07 | |
parent | 864d115f229ce8cbd20deb8670831802da8c9216 (diff) | |
download | html5ks-902180ba926905f6002739919c4a814633ed3474.tar.xz html5ks-902180ba926905f6002739919c4a814633ed3474.zip |
Refactoring, remove all fullscreen
-rw-r--r-- | www/js/api.js | 12 | ||||
-rw-r--r-- | www/js/html5ks.js | 50 |
2 files changed, 7 insertions, 55 deletions
diff --git a/www/js/api.js b/www/js/api.js index 768face..a46511f 100644 --- a/www/js/api.js +++ b/www/js/api.js @@ -26,7 +26,7 @@ window.html5ks.api = new (function () { } }.bind(this), 50); } - return when.defer().resolve(); + return when.resolve(); }, play: function (channel, name, ignore, fade) { @@ -88,7 +88,7 @@ window.html5ks.api = new (function () { } else { audio.pause(); } - return when.defer().resolve(); + return when.resolve(); }, @@ -181,7 +181,7 @@ window.html5ks.api = new (function () { return this.say(cmd, args[0]); } else { console.error("no such cmd " + cmd); - return when.defer().resolve(); + return when.resolve(); } } }, @@ -201,7 +201,7 @@ window.html5ks.api = new (function () { default: return windw.style.display !== "none"; } - return when.defer().resolve(); + return when.resolve(); }, @@ -308,7 +308,7 @@ window.html5ks.api = new (function () { html5ks.elements.show.removeChild(show[i]); } } - return when.defer().resolve(); + return when.resolve(); }, tag: function (str) { @@ -499,7 +499,7 @@ window.html5ks.api = new (function () { default: console.error("no such nvl action " + action); } - return when.defer().resolve(); + return when.resolve(); }, centered: function (text) { diff --git a/www/js/html5ks.js b/www/js/html5ks.js index 7f3d0f0..82cdfa3 100644 --- a/www/js/html5ks.js +++ b/www/js/html5ks.js @@ -14,7 +14,6 @@ window.html5ks = { hdisable: false, skipUnread: false, skipAfterChoices: false, - fullscreen: false, scaleAll: true, scaleVideo: true, textSpeed: 100, @@ -115,39 +114,13 @@ window.html5ks = { applyScale(html5ks.elements.video, newScale); } }, - fullscreen: function (onoff) { - if (onoff !== false) { - var all = html5ks.elements.all; - if (all.requestFullscreen) { - all.requestFullscreen(); - } else if (all.mozRequestFullScreen) { - all.mozRequestFullScreen(); - } else if (all.webkitRequestFullscreen) { - all.webkitRequestFullscreen(); - } else { - return false; - } - } else { - if (document.requestFullscreen) { - document.requestFullscreen(); - } else if (document.mozCancelFullScreen) { - document.mozCancelFullScreen(); - } else if (document.webkitCancelFullscreen) { - document.webkitCancelFullscreen(); - } else { - return false; - } - } - return true; - }, initEvents: function () { window.onresize = html5ks.scale; this.elements.container.addEventListener("mouseup", function (e) { if (html5ks.state.status === "scene") { switch (e.button) { case 0: - html5ks.api.speed("skip", false); - html5ks.api.speed("auto", false); + html5ks.api.speed("all", false); html5ks.next(); break; case 1: @@ -159,21 +132,6 @@ window.html5ks = { window.addEventListener("dragstart", function (e) { e.preventDefault(); }, false); - if (html5ks.persistent.fullscreen) { - window.addEventListener("click", function click() { - window.removeEventListener("click", click, false); - html5ks.fullscreen(); - }, false); - } - var fullscreenchange = function () { - if (!(document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement)) { - html5ks.persistent.fullscreen = false; - document.getElementById("fullscreen").checked = false; - } - }; - document.addEventListener("mozfullscreenchange", fullscreenchange, false); - document.addEventListener("webkitfullscreenchange", fullscreenchange, false); - document.addEventListener("fullscreenchange", fullscreenchange, false); }, warnUnsupported: function () { if (!html5ks.persistent.gotit) { @@ -212,12 +170,6 @@ window.html5ks = { this.api.init(); this.menu.init(); this.i18n.init(); - if (this.persistent.fullscreen) { - document.body.addEventListener("click", function onclick() { - this.removeEventListener("click", onclick, false); - html5ks.fullscreen(); - }, false); - } }, start: function () { this.fetch("json", "script"); |