Make wrapper compatible with sidebar console function

This commit is contained in:
shortcutme 2019-07-01 16:26:37 +02:00
parent f979ed133f
commit 72b6d6c676
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
4 changed files with 24 additions and 16 deletions

View file

@ -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

View file

@ -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 */

View file

@ -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 */

View file

@ -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) {