diff options
Diffstat (limited to 'static')
| -rw-r--r-- | static/script/main.js | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/static/script/main.js b/static/script/main.js index c023851..f6534e3 100644 --- a/static/script/main.js +++ b/static/script/main.js @@ -72,7 +72,6 @@ class IVTClient { this.username = null; this.pwdreturn = false; this.oldprompt = null; - this.prelude = null; this.printTextCLS(BANNER, "term-bold term-centered"); this.stdinBox.addEventListener("submit", (event) => { event.preventDefault(); @@ -104,14 +103,6 @@ class IVTClient { this.stdinBtn.disabled = true; }) this.socket.addEventListener("message", (event) => { - if (this.prelude) { - var fxn = this["on_" + this.prelude + "_prelude"]; - if (fxn) { - fxn.call(this, event.data) - } - this.prelude = null; - return - } var data = JSON.parse(event.data); var fxn = this["on_" + data.act + "_msg"]; if (fxn) { @@ -157,13 +148,9 @@ class IVTClient { } } - on_prelude_msg(data) { - this.prelude = data.action; - } - - async on_music_prelude(data) { + async on_music_msg(data) { var elem = document.createElement("audio"); - elem.src = window.URL.createObjectURL(data); + elem.src = `dl/${data.uuid}.mp3`; elem.controls = true; elem.autoplay = true; this.stdout.append(elem); |
