From 72b6d6c67638c1e3fd5886d981a09547135920d6 Mon Sep 17 00:00:00 2001 From: shortcutme Date: Mon, 1 Jul 2019 16:26:37 +0200 Subject: [PATCH] Make wrapper compatible with sidebar console function --- src/Ui/media/Wrapper.coffee | 3 +++ src/Ui/media/Wrapper.css | 14 +++++++------- src/Ui/media/all.css | 15 +++++++-------- src/Ui/media/all.js | 8 +++++++- 4 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/Ui/media/Wrapper.coffee b/src/Ui/media/Wrapper.coffee index bdaa2c0c..e57a1868 100644 --- a/src/Ui/media/Wrapper.coffee +++ b/src/Ui/media/Wrapper.coffee @@ -63,6 +63,9 @@ class Wrapper # Incoming message from UiServer websocket onMessageWebsocket: (e) => message = JSON.parse(e.data) + @handleMessageWebsocket(message) + + handleMessageWebsocket: (message) => cmd = message.cmd if cmd == "response" if @ws.waiting_cb[message.to]? # We are waiting for response diff --git a/src/Ui/media/Wrapper.css b/src/Ui/media/Wrapper.css index 4b90bcfb..b78427d6 100644 --- a/src/Ui/media/Wrapper.css +++ b/src/Ui/media/Wrapper.css @@ -142,16 +142,16 @@ a { color: black } .loadingscreen.ready .loading-config { top: 0px; } -/* Console */ -.console { line-height: 24px; font-family: monospace; font-size: 14px; color: #ADADAD; text-transform: uppercase; opacity: 0; transform: translateY(-20px); } -.console-line:last-child { color: #6C6767 } -.console .cursor { +/* Loading console */ +.loadingscreen .console { line-height: 24px; font-family: monospace; font-size: 14px; color: #ADADAD; text-transform: uppercase; opacity: 0; transform: translateY(-20px); } +.loadingscreen .console-line:last-child { color: #6C6767 } +.loadingscreen .console .cursor { background-color: #999; color: #999; animation: pulse 1.5s infinite ease-in-out; margin-right: -9px; display: inline-block; width: 9px; height: 19px; vertical-align: -4px; } -.console .console-error { color: #e74c3c; font-weight: bold; animation: pulse 2s infinite linear } -.console .console-warning { color: #8e44ad; } -.console .button { margin: 20px; display: inline-block; text-transform: none; padding: 10px 20px } +.loadingscreen .console .console-error { color: #e74c3c; font-weight: bold; animation: pulse 2s infinite linear } +.loadingscreen .console .console-warning { color: #8e44ad; } +.loadingscreen .console .button { margin: 20px; display: inline-block; text-transform: none; padding: 10px 20px } /* Flipper loading anim */ diff --git a/src/Ui/media/all.css b/src/Ui/media/all.css index eedcc074..d742c3b5 100644 --- a/src/Ui/media/all.css +++ b/src/Ui/media/all.css @@ -1,5 +1,4 @@ - /* ---- src/Ui/media/Wrapper.css ---- */ @@ -156,16 +155,16 @@ a { color: black } .loadingscreen.ready .loading-config { top: 0px; } -/* Console */ -.console { line-height: 24px; font-family: monospace; font-size: 14px; color: #ADADAD; text-transform: uppercase; opacity: 0; -webkit-transform: translateY(-20px); -moz-transform: translateY(-20px); -o-transform: translateY(-20px); -ms-transform: translateY(-20px); transform: translateY(-20px) ; } -.console-line:last-child { color: #6C6767 } -.console .cursor { +/* Loading console */ +.loadingscreen .console { line-height: 24px; font-family: monospace; font-size: 14px; color: #ADADAD; text-transform: uppercase; opacity: 0; -webkit-transform: translateY(-20px); -moz-transform: translateY(-20px); -o-transform: translateY(-20px); -ms-transform: translateY(-20px); transform: translateY(-20px) ; } +.loadingscreen .console-line:last-child { color: #6C6767 } +.loadingscreen .console .cursor { background-color: #999; color: #999; -webkit-animation: pulse 1.5s infinite ease-in-out; -moz-animation: pulse 1.5s infinite ease-in-out; -o-animation: pulse 1.5s infinite ease-in-out; -ms-animation: pulse 1.5s infinite ease-in-out; animation: pulse 1.5s infinite ease-in-out ; margin-right: -9px; display: inline-block; width: 9px; height: 19px; vertical-align: -4px; } -.console .console-error { color: #e74c3c; font-weight: bold; -webkit-animation: pulse 2s infinite linear ; -moz-animation: pulse 2s infinite linear ; -o-animation: pulse 2s infinite linear ; -ms-animation: pulse 2s infinite linear ; animation: pulse 2s infinite linear } -.console .console-warning { color: #8e44ad; } -.console .button { margin: 20px; display: inline-block; text-transform: none; padding: 10px 20px } +.loadingscreen .console .console-error { color: #e74c3c; font-weight: bold; -webkit-animation: pulse 2s infinite linear ; -moz-animation: pulse 2s infinite linear ; -o-animation: pulse 2s infinite linear ; -ms-animation: pulse 2s infinite linear ; animation: pulse 2s infinite linear } +.loadingscreen .console .console-warning { color: #8e44ad; } +.loadingscreen .console .button { margin: 20px; display: inline-block; text-transform: none; padding: 10px 20px } /* Flipper loading anim */ diff --git a/src/Ui/media/all.js b/src/Ui/media/all.js index 24bb2a81..fc7d6fda 100644 --- a/src/Ui/media/all.js +++ b/src/Ui/media/all.js @@ -924,6 +924,7 @@ $.extend( $.easing, this.handleMessage = bind(this.handleMessage, this); this.cmd = bind(this.cmd, this); this.onMessageInner = bind(this.onMessageInner, this); + this.handleMessageWebsocket = bind(this.handleMessageWebsocket, this); this.onMessageWebsocket = bind(this.onMessageWebsocket, this); this.verifyEvent = bind(this.verifyEvent, this); this.log("Created!"); @@ -1002,8 +1003,13 @@ $.extend( $.easing, }; Wrapper.prototype.onMessageWebsocket = function(e) { - var cmd, id, message, ref, script_tag, type; + var message; message = JSON.parse(e.data); + return this.handleMessageWebsocket(message); + }; + + Wrapper.prototype.handleMessageWebsocket = function(message) { + var cmd, id, ref, script_tag, type; cmd = message.cmd; if (cmd === "response") { if (this.ws.waiting_cb[message.to] != null) {