This commit is contained in:
choelzl 2022-02-06 19:18:26 +01:00
parent 1b0878bdc5
commit b20e90fc60
Signed by: sora
GPG Key ID: A362EA0491E2EEA0

View File

@ -1,17 +1,6 @@
$(function () {
var webSocket = getWebSocket(),
queryMap = getQueryMap(),
isDebug = localStorage.getItem('phantombot_overlay_debug') === 'true' || false;
queue = [];
const getWebSocket = () => {
let socketUri = ((window.location.protocol === 'https:' ? 'wss://' : 'ws://') + window.location.host + '/ws/overlay'), // URI of the socket.
reconnectInterval = 5000; // How often in milliseconds we should try reconnecting.
return new ReconnectingWebSocket(socketUri, null, {
reconnectInterval: reconnectInterval
});
}
const webSocket = window.socket,
queryMap = getQueryMap(),
const getQueryMap = () => {
let queryString = window.location.search,
@ -26,14 +15,6 @@ $(function () {
return queryMap;
}
const printDebug = (message, force) => {
if (isDebug || force) console.log('%c[PhantomBot Log]', 'color: #6441a5; font-weight: 900;', message);
}
window.toggleDebug = (toggle) => {
localStorage.setItem('phantombot_overlay_debug', toggle.toString());
window.location.reload();
}
const getOrElse = (option, def) => queryMap.has(option) ? queryMap.get(option): def;
const handleSocketMessage = (e)=>{