Make wrapper compatible with sidebar console function
This commit is contained in:
parent
f979ed133f
commit
72b6d6c676
4 changed files with 24 additions and 16 deletions
|
@ -63,6 +63,9 @@ class Wrapper
|
||||||
# Incoming message from UiServer websocket
|
# Incoming message from UiServer websocket
|
||||||
onMessageWebsocket: (e) =>
|
onMessageWebsocket: (e) =>
|
||||||
message = JSON.parse(e.data)
|
message = JSON.parse(e.data)
|
||||||
|
@handleMessageWebsocket(message)
|
||||||
|
|
||||||
|
handleMessageWebsocket: (message) =>
|
||||||
cmd = message.cmd
|
cmd = message.cmd
|
||||||
if cmd == "response"
|
if cmd == "response"
|
||||||
if @ws.waiting_cb[message.to]? # We are waiting for response
|
if @ws.waiting_cb[message.to]? # We are waiting for response
|
||||||
|
|
|
@ -142,16 +142,16 @@ a { color: black }
|
||||||
.loadingscreen.ready .loading-config { top: 0px; }
|
.loadingscreen.ready .loading-config { top: 0px; }
|
||||||
|
|
||||||
|
|
||||||
/* Console */
|
/* Loading console */
|
||||||
.console { line-height: 24px; font-family: monospace; font-size: 14px; color: #ADADAD; text-transform: uppercase; opacity: 0; transform: translateY(-20px); }
|
.loadingscreen .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 }
|
.loadingscreen .console-line:last-child { color: #6C6767 }
|
||||||
.console .cursor {
|
.loadingscreen .console .cursor {
|
||||||
background-color: #999; color: #999; animation: pulse 1.5s infinite ease-in-out; margin-right: -9px;
|
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;
|
display: inline-block; width: 9px; height: 19px; vertical-align: -4px;
|
||||||
}
|
}
|
||||||
.console .console-error { color: #e74c3c; font-weight: bold; animation: pulse 2s infinite linear }
|
.loadingscreen .console .console-error { color: #e74c3c; font-weight: bold; animation: pulse 2s infinite linear }
|
||||||
.console .console-warning { color: #8e44ad; }
|
.loadingscreen .console .console-warning { color: #8e44ad; }
|
||||||
.console .button { margin: 20px; display: inline-block; text-transform: none; padding: 10px 20px }
|
.loadingscreen .console .button { margin: 20px; display: inline-block; text-transform: none; padding: 10px 20px }
|
||||||
|
|
||||||
|
|
||||||
/* Flipper loading anim */
|
/* Flipper loading anim */
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
|
|
||||||
|
|
||||||
/* ---- src/Ui/media/Wrapper.css ---- */
|
/* ---- src/Ui/media/Wrapper.css ---- */
|
||||||
|
|
||||||
|
|
||||||
|
@ -156,16 +155,16 @@ a { color: black }
|
||||||
.loadingscreen.ready .loading-config { top: 0px; }
|
.loadingscreen.ready .loading-config { top: 0px; }
|
||||||
|
|
||||||
|
|
||||||
/* Console */
|
/* Loading 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) ; }
|
.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) ; }
|
||||||
.console-line:last-child { color: #6C6767 }
|
.loadingscreen .console-line:last-child { color: #6C6767 }
|
||||||
.console .cursor {
|
.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;
|
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;
|
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 }
|
.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 }
|
||||||
.console .console-warning { color: #8e44ad; }
|
.loadingscreen .console .console-warning { color: #8e44ad; }
|
||||||
.console .button { margin: 20px; display: inline-block; text-transform: none; padding: 10px 20px }
|
.loadingscreen .console .button { margin: 20px; display: inline-block; text-transform: none; padding: 10px 20px }
|
||||||
|
|
||||||
|
|
||||||
/* Flipper loading anim */
|
/* Flipper loading anim */
|
||||||
|
|
|
@ -924,6 +924,7 @@ $.extend( $.easing,
|
||||||
this.handleMessage = bind(this.handleMessage, this);
|
this.handleMessage = bind(this.handleMessage, this);
|
||||||
this.cmd = bind(this.cmd, this);
|
this.cmd = bind(this.cmd, this);
|
||||||
this.onMessageInner = bind(this.onMessageInner, this);
|
this.onMessageInner = bind(this.onMessageInner, this);
|
||||||
|
this.handleMessageWebsocket = bind(this.handleMessageWebsocket, this);
|
||||||
this.onMessageWebsocket = bind(this.onMessageWebsocket, this);
|
this.onMessageWebsocket = bind(this.onMessageWebsocket, this);
|
||||||
this.verifyEvent = bind(this.verifyEvent, this);
|
this.verifyEvent = bind(this.verifyEvent, this);
|
||||||
this.log("Created!");
|
this.log("Created!");
|
||||||
|
@ -1002,8 +1003,13 @@ $.extend( $.easing,
|
||||||
};
|
};
|
||||||
|
|
||||||
Wrapper.prototype.onMessageWebsocket = function(e) {
|
Wrapper.prototype.onMessageWebsocket = function(e) {
|
||||||
var cmd, id, message, ref, script_tag, type;
|
var message;
|
||||||
message = JSON.parse(e.data);
|
message = JSON.parse(e.data);
|
||||||
|
return this.handleMessageWebsocket(message);
|
||||||
|
};
|
||||||
|
|
||||||
|
Wrapper.prototype.handleMessageWebsocket = function(message) {
|
||||||
|
var cmd, id, ref, script_tag, type;
|
||||||
cmd = message.cmd;
|
cmd = message.cmd;
|
||||||
if (cmd === "response") {
|
if (cmd === "response") {
|
||||||
if (this.ws.waiting_cb[message.to] != null) {
|
if (this.ws.waiting_cb[message.to] != null) {
|
||||||
|
|
Loading…
Reference in a new issue