TeaWeb/js/main.js

35 lines
1.5 KiB
JavaScript
Raw Normal View History

2018-02-27 16:20:49 +00:00
/// <reference path="chat.ts" />
/// <reference path="client.ts" />
2018-04-11 15:56:09 +00:00
/// <reference path="Identity.ts" />
2018-02-27 16:20:49 +00:00
/// <reference path="utils/modal.ts" />
2018-03-07 18:06:52 +00:00
/// <reference path="ui/modal/ModalConnect.ts" />
2018-04-11 15:56:09 +00:00
/// <reference path="codec/CodecWrapper.ts" />
/// <reference path="settings.ts" />
2018-03-24 22:38:01 +00:00
let globalClient;
let chat;
2018-04-11 15:56:09 +00:00
let forumIdentity;
2018-03-24 22:38:01 +00:00
function invokeMain() {
2018-04-11 15:56:09 +00:00
AudioController.initializeAudioController();
if (!TSIdentityHelper.setup()) {
console.error("Could not setup the TeamSpeak identity parser!");
return;
}
2018-03-24 22:38:01 +00:00
globalClient = new TSClient();
2018-04-11 15:56:09 +00:00
/** Setup the XF forum identity **/
if (globalClient.settings.static("forum_user_data")) {
forumIdentity = new TeaForumIdentity(globalClient.settings.static("forum_user_data"), globalClient.settings.static("forum_user_sign"));
}
2018-03-24 22:38:01 +00:00
chat = new ChatBox($("#chat"));
globalClient.setup();
//globalClient.startConnection("localhost:19974"); //TODO remove only for testing
//Modals.spawnConnectModal();
//Modals.spawnSettingsModal();
window.addEventListener("beforeunload", function (event) {
if (globalClient.serverConnection && globalClient.serverConnection.connected)
event.returnValue = "Are you really sure?<br>You're still connected!";
//event.preventDefault();
});
2018-04-11 15:56:09 +00:00
//console.log("XF: " + globalClient.settings.static("forum_user_data"));
//console.log("XF: " + globalClient.settings.static("forum_user_sign"));
2018-03-24 22:38:01 +00:00
}
2018-02-27 16:20:49 +00:00
//# sourceMappingURL=main.js.map