Client: add ui.js; create Client object from ui.js

This commit is contained in:
Lexi / Zoe 2019-01-20 05:01:58 +01:00
parent e746a4e8ca
commit 36ba716ad8
Signed by: binaryDiv
GPG key ID: F8D4956E224DA232
4 changed files with 16 additions and 8 deletions

View file

@ -99,9 +99,3 @@ class Client {
}
}
}
// Run script after page is loaded
$(function() {
const wsUri = AppSettings.serverWsUri;
let client = new Client(wsUri);
});

View file

@ -1,7 +1,10 @@
"use strict";
// Global settings object
/**
* Global settings object.
*/
const AppSettings = {
// Alternative WebSocket URI for local testing:
// serverWsUri: "ws://localhost:32715",
serverWsUri: "wss://chat.glitch-in.space:443/ws/",
};

10
public_html/js/ui.js Normal file
View file

@ -0,0 +1,10 @@
"use strict";
// Global object for debugging purposes
let client;
// Execute this on start (wrapped in an anonymous function)
(function() {
const wsUri = AppSettings.serverWsUri;
client = new Client(wsUri);
})();