summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorAlex Xu <alex_y_xu@yahoo.ca>2014-01-14 09:33:38 -0500
committerAlex Xu <alex_y_xu@yahoo.ca>2014-01-14 09:33:38 -0500
commitfcde5bf01f7cd7029cfabd929483a72ba669039a (patch)
treee146e8f6501901c3be6ec353f735e4afba450a91 /www
parentfd81c33c904ac13e66a1c6f945be05f8b4599b9e (diff)
downloadhtml5ks-fcde5bf01f7cd7029cfabd929483a72ba669039a.tar.xz
html5ks-fcde5bf01f7cd7029cfabd929483a72ba669039a.zip
Stuff.
Diffstat (limited to 'www')
-rw-r--r--www/js/api.js13
1 files changed, 10 insertions, 3 deletions
diff --git a/www/js/api.js b/www/js/api.js
index 89ecdd3..8afa4a6 100644
--- a/www/js/api.js
+++ b/www/js/api.js
@@ -21,8 +21,12 @@ window.html5ks.api = new (function () {
this._fading[channel] = setInterval(function () {
// clamp new volume 0-1
audio.volume = Math.min(Math.max(audio.volume + step, 0), 1);
- if (audio.volume === 0 || audio.volume === 1) {
- clearInterval(this._fading);
+ switch (audio.volume) {
+ case 0:
+ audio.pause();
+ // break;
+ case 1:
+ clearInterval(this._fading);
}
}.bind(this), 50);
}
@@ -79,6 +83,8 @@ window.html5ks.api = new (function () {
} else {
throw new Error(e);
}
+ } else {
+ throw new Error(e);
}
};
audio.load();
@@ -383,6 +389,7 @@ window.html5ks.api = new (function () {
},
say: function (chrName, str, extend) {
+ if (extend) debugger;
var deferred = when.defer(),
chr = typeof chrName === "string" ? html5ks.data.characters[chrName] : chrName,
w = /{w=?(\d*\.\d*)?}(.*)/.exec(str);
@@ -426,7 +433,7 @@ window.html5ks.api = new (function () {
}
say = html5ks.elements.say;
- say.innerHTML = "";
+ if (!extend) say.innerHTML = "";
ctc = html5ks.elements.ctc;
}