From bbb229b92138db36a9181d11c4d219978f6392d2 Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Mon, 16 Apr 2018 20:38:35 +0200 Subject: [PATCH] Updates --- .idea/workspace.xml | 1040 ++++++++++++------------ css/general.css | 24 + css/modals.css | 21 + css/ts/chat.css | 1 + css/ts/client.css | 62 +- css/ts/tab.css | 5 + img/script.png | Bin 0 -> 19270 bytes img/script.svg | 66 ++ index.php | 6 +- js/FileManager.js | 100 ++- js/FileManager.js.map | 2 +- js/FileManager.ts | 119 ++- js/InfoBar.js | 3 +- js/InfoBar.js.map | 2 +- js/InfoBar.ts | 4 +- js/chat.js | 49 +- js/chat.js.map | 2 +- js/chat.ts | 57 +- js/client.js | 7 +- js/client.js.map | 2 +- js/client.ts | 8 +- js/codec/compile.sh | 1 + js/connection.js | 55 +- js/connection.js.map | 2 +- js/connection.ts | 71 +- js/contextMenu.js | 2 +- js/contextMenu.js.map | 2 +- js/contextMenu.ts | 3 +- js/crypto/hex.ts | 20 + js/crypto/sha.ts | 9 + js/load.ts | 6 + js/log.ts | 121 +++ js/main.js | 31 +- js/main.js.map | 2 +- js/main.ts | 34 +- js/permission/PermissionManager.js | 84 +- js/permission/PermissionManager.js.map | 2 +- js/permission/PermissionManager.ts | 92 ++- js/proto.js.map | 2 +- js/proto.ts | 3 +- js/settings.js | 90 +- js/settings.js.map | 2 +- js/settings.ts | 97 ++- js/ui/ControlBar.js | 22 +- js/ui/ControlBar.js.map | 2 +- js/ui/ControlBar.ts | 22 +- js/ui/channel.js | 446 ++++++---- js/ui/channel.js.map | 2 +- js/ui/channel.ts | 474 +++++++---- js/ui/client.js | 185 +++-- js/ui/client.js.map | 2 +- js/ui/client.ts | 199 +++-- js/ui/modal/ModalConnect.js | 10 +- js/ui/modal/ModalConnect.js.map | 2 +- js/ui/modal/ModalConnect.ts | 10 +- js/ui/modal/ModalCreateChannel.js | 118 ++- js/ui/modal/ModalCreateChannel.js.map | 2 +- js/ui/modal/ModalCreateChannel.ts | 136 +++- js/ui/modal/ModalSettings.js | 10 +- js/ui/modal/ModalSettings.js.map | 2 +- js/ui/modal/ModalSettings.ts | 10 +- js/ui/server.js | 18 +- js/ui/server.js.map | 2 +- js/ui/server.ts | 19 +- js/ui/view.js | 77 +- js/ui/view.js.map | 2 +- js/ui/view.ts | 87 +- js/utils/helpers.ts | 11 + js/utils/modal.js | 15 +- js/utils/modal.js.map | 2 +- js/utils/modal.ts | 16 +- js/utils/tab.js | 25 +- js/utils/tab.js.map | 2 +- js/utils/tab.ts | 21 +- js/voice/VoiceHandler.js | 12 + js/voice/VoiceHandler.js.map | 2 +- js/voice/VoiceHandler.ts | 17 + js/voice/VoiceRecorder.js | 10 +- js/voice/VoiceRecorder.js.map | 2 +- js/voice/VoiceRecorder.ts | 10 +- package.json | 1 + public_files.sh | 3 + templates.html | 83 +- tsconfig.json | 11 +- 84 files changed, 2981 insertions(+), 1432 deletions(-) create mode 100644 css/modals.css create mode 100644 img/script.png create mode 100644 img/script.svg create mode 100755 js/codec/compile.sh create mode 100644 js/crypto/hex.ts create mode 100644 js/crypto/sha.ts create mode 100644 js/log.ts create mode 100644 js/utils/helpers.ts create mode 100755 public_files.sh diff --git a/.idea/workspace.xml b/.idea/workspace.xml index fb664e8e..f53eb4a0 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -2,30 +2,20 @@ - - - - - - - - - - - - - - - + + + + + - - - - - - + + + + + + @@ -35,9 +25,6 @@ - - - @@ -45,10 +32,12 @@ - - + + - + + + @@ -66,34 +55,33 @@ + + + - - - - - - + + + + + + + + + + - - - - - - - - @@ -108,65 +96,37 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - + + + + + + + + + @@ -897,146 +757,208 @@ - + - - + + - + + - - + + + + + + + + + + + + + + + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - + - - - - - - - - - - - - - + + - - + + - + - - + + - + - - + + - + - - - - - - - - - - + + - + - + - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1051,94 +973,172 @@ - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + - + - - - + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - + + - + + + + + + + + + + + + + + + + + diff --git a/css/general.css b/css/general.css index 9983c875..541eb448 100644 --- a/css/general.css +++ b/css/general.css @@ -57,6 +57,16 @@ cursor: not-allowed; } +.align_row { + display: flex; + flex-direction: row; +} + +.align_column { + display: flex; + flex-direction: column; +} + .icon_loading { border: 2px solid #f3f3f3; /* Light grey */ border-top: 2px solid #3498db; /* Blue */ @@ -67,6 +77,16 @@ height: 14px!important; } +.avatar_loading { + border: 2px solid #f3f3f3; /* Light grey */ + border-top: 2px solid #3498db; /* Blue */ + border-radius: 50%; + animation: spin 2s linear infinite; + + width: 14px!important; + height: 14px!important; +} + @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } @@ -177,6 +197,10 @@ width: 120px; } +.channel_general_properties .value { + width: 100%; +} + .main_container { padding: 4px; border: lightgray solid; diff --git a/css/modals.css b/css/modals.css new file mode 100644 index 00000000..4efc789f --- /dev/null +++ b/css/modals.css @@ -0,0 +1,21 @@ +.channel_general_properties .value { + width: 100%; +} + +.channel_general_properties .key { + width: 150px; +} + +.channel_general_properties .property_entry { + margin: 2px; +} + +.channel_perm_tbl .value { + width: 60px; +} + +.input_error { + border-radius: 1px; + border-style: solid; + border-color: red; +} \ No newline at end of file diff --git a/css/ts/chat.css b/css/ts/chat.css index f85cc7fa..396f0e1a 100644 --- a/css/ts/chat.css +++ b/css/ts/chat.css @@ -90,6 +90,7 @@ display: flex; height: auto; position: relative; + flex-shrink: 0; } #chat .input .input_box { diff --git a/css/ts/client.css b/css/ts/client.css index 541918c4..33d13313 100644 --- a/css/ts/client.css +++ b/css/ts/client.css @@ -7,18 +7,42 @@ -ms-user-select: none; user-select: none; vertical-align: center; + outline: none; +} +.channelTree * { + font-family: Arial; + font-size: 12px; + white-space: pre; + line-height: 1; +} +.channelTree div { + max-width: 100%; + height: 16px; + position: relative; +} + +.channelTree .channel_type { + margin-right: 4px; +} +.channelTree .icon_client_state { + margin-right: 4px; +} +.channelTree .server_type { + margin-right: 4px; +} + +.channelTree .icons .icon_entry { + margin-left: 2px; } -.channelTree *{ font-family: Arial; font-size: 12px; white-space: pre; line-height: 1; } -.channelTree div{ max-width: 100%;height: 16px;position: relative;margin-right:4px;} .channelTree img.loading {width: 50px;height: 50px;-webkit-animation:spin 2s linear infinite;-moz-animation:spin 2s linear infinite;animation:spin 2s linear infinite;} @-moz-keyframes spin { 100% { -moz-transform: rotate(360deg); } } @-webkit-keyframes spin { 100% { -webkit-transform: rotate(360deg); } } @keyframes spin { 100% { -webkit-transform: rotate(360deg); transform:rotate(360deg); } } -.channelTree div.l{text-align: left;} -.channelTree div.c{text-align: center;} -.channelTree div.r{text-align: right;} +.channelTree div.l {justify-content: flex-start; } +.channelTree div.c {justify-content: center;} +.channelTree div.r {justify-content: flex-end;} .channelTree div.solidline{ background: url('../images/viewer/spacer_solidline.gif') repeat-x left center;margin: 0px; } .channelTree div.dashline{ background: url('../images/viewer/spacer_dashline.gif') repeat-x left center;margin: 0px; } @@ -29,8 +53,26 @@ .channelTree div * {vertical-align: middle;display:inline-block;height: 16px;padding: 0px;} .channelTree div img {border: 0;} .channelTree div span {position: absolute; right: 0;} -.channelTree .name {vertical-align: middle; margin-top: 1px; height: 14px;} -.channelTree .own_name {font-weight: bold;} +.channelTree .name { + vertical-align: middle; + margin-top: 1px; + height: 14px; + display: inline; +} +.channelTree .own_name { + font-weight: bold; + display: inline; +} +.channelTree .channel_name { + display: flex; + align-items: center; +} + +.channelTree .channel_name_container { + display: inline-flex; + width: 100%; + overflow-x: hidden; +} .channelTree .country {width:16px;height:11px;} @@ -40,6 +82,7 @@ margin-bottom: -2px; display: grid; width: 100%; + left: 16px; } .channelTree .channel { @@ -53,6 +96,7 @@ margin-bottom: -2px; display: grid; width: 100%; + left: 16px; } .channelTree .client { @@ -70,6 +114,10 @@ .channelTree .channelLine { position: absolute; width: calc(100% - 16px); + display: flex; + flex-direction: row; + top: 0px; + left: 16px; } diff --git a/css/ts/tab.css b/css/ts/tab.css index ba26517a..8aab2901 100644 --- a/css/ts/tab.css +++ b/css/ts/tab.css @@ -42,6 +42,10 @@ x-tab { display:none } margin-bottom: -1px; display: flex; user-select: none; + + flex-direction: row; + justify-content: stretch; + width: 100%; } .tab .tab-header .entry { @@ -56,6 +60,7 @@ x-tab { display:none } padding-left: 5px; padding-right: 5px; cursor: pointer; + flex-grow: 1; } .tab .tab-content-invisible { diff --git a/img/script.png b/img/script.png new file mode 100644 index 0000000000000000000000000000000000000000..b2a6dc5fa62a9978335afb6dacc4745aa69c59bb GIT binary patch literal 19270 zcmeIaiCfI=7eD@wCd44>u?*8=i+ZcHAx{cr z30V@^vdok$PYPL|m=M`UmTdiAcb?Dpx_+PEAMpGAuItlvx$1tO`#$H~=bZc8=RWtj zZSk24{}MS3*%oQ#$^b zX-H89l%H(!czpkV@5hCrq9`hxqN*vXjY7-Cg>s3aT(T*bYRaXJ0Ha)}s3oQ` zgVDQ<&>=rjE-u+FF4ZnBZGUfS3jnjDT(YxWva4OP+Xz$WTOH+6 zo$XRx?NZ$a9x>FVEy|@W+oi4Ar43ZUHIRX6a0#{m17Y9>YT&})HZmd7#!q%sRCQET z8<`)-qLrN;m0cZ`-A1MhE&!~~j;gMXs&2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`%}Y*fn~DEBRmtY8fow8UQQ%x5Nh zt)8^EynQ~ypS~yaDdI?rBj45aNbsJoNsLThIUNZ(ACnM#eIgLpoO;oR@2|r1!}{Dh`ZnI$q1<)H`{t-p624kLIwR6v{>}WH^3_D} zI61%DDU?5lgm92gd)$t47ghP?6gRsSTEez}P(#FqGJS*P3qyB)|NZf}*RV66Cd{PR za?Y}w2h#8!u2_HQ1dMjnGR!}qk%u>(Z_BUd{JeSsFHWp-}P!q{Dt@ z%7@~??COZ`dvMGy{vK(Y%oLRt^fV9y2XZ6jPefxfJ9dC*7jo3BYjyU zwLinVz0UMPDu?%`-f2yLK1x#CpE-+HvlE|#ha3(MVcQxJ-#F(Oc0&`|_4kYAH5_&# zLbwaNIlM!FkLMeQ0*>csu2CA!)c)eRSlI_BsBR&L7`%v^D$ z>J}0e!5LKEq2F+wG3^TY9l&wiJqS21b%Qf0vdWJPVR>L1oH3J4>IE-UaCnZtpE1)( z?RCIMoLL^I>6|f}owyG0Dh^NZFMJD?hoa#lt}G9Cz@yoTae&ugVi4{LOzbEoW=gw8 zg0PKv?%wtn*X)g$7~oehF~E~d>Ep8?;{oEidw#>SIlL`^*YS;ofFHnkz^4L^BhtW0 zs#{1l1?N(E0uUa_^635hakv%}Bgz9j5%6799v|@0|NEaf{`WtS{O^BW`TzfaNb}F( c^S{PK59>VUW{&Y>3P0ZCCyp!jn6dW%0^P+bfB*mh literal 0 HcmV?d00001 diff --git a/img/script.svg b/img/script.svg new file mode 100644 index 00000000..ea32f4c0 --- /dev/null +++ b/img/script.svg @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/index.php b/index.php index 2e2afdcc..89628ce5 100644 --- a/index.php +++ b/index.php @@ -1,5 +1,5 @@ + '; + echo ''; } spawnProperty('connect_default_host', $localhost ? "localhost" : "ts.TeaSpeak.de"); @@ -44,7 +45,6 @@ window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); - gtag('config', 'UA-113151733-4'); diff --git a/js/FileManager.js b/js/FileManager.js index 09db9b63..02406377 100644 --- a/js/FileManager.js +++ b/js/FileManager.js @@ -41,8 +41,7 @@ class DownloadFileTransfer { let fileReader = new FileReader(); fileReader.onload = (event) => { this.onBinaryData(new Uint8Array(event.target.result)); - if (this._socket.readyState !== WebSocket.OPEN && !this._succeed) - this.on_fail("unexpected close"); + //if(this._socket.readyState != WebSocket.OPEN && !this._succeed) this.on_fail("unexpected close"); this._parseActive = false; }; fileReader.readAsArrayBuffer(data.data); @@ -66,7 +65,7 @@ class DownloadFileTransfer { if (!this._active) return; if (!this._parseActive) - this.on_fail("unexpected close"); + this.on_fail("unexpected close (remote closed)"); this.disconnect(); } disconnect() { @@ -81,6 +80,7 @@ class FileManager { this.downloadCounter = 0; this.handle = client; this.icons = new IconManager(this); + this.avatars = new AvatarManager(this); this.handle.serverConnection.commandHandler["notifyfilelist"] = this.notifyFileList.bind(this); this.handle.serverConnection.commandHandler["notifyfilelistfinished"] = this.notifyFileListFinished.bind(this); this.handle.serverConnection.commandHandler["notifystartdownload"] = this.notifyStartDownload.bind(this); @@ -209,6 +209,7 @@ class IconManager { let array = new Uint8Array(0); ft.on_fail = reason => { console.error("Could not download icon " + id + " -> " + reason); + chat.serverChat().appendError("Fail to download icon {0}. ({1})", id, JSON.stringify(reason)); reject(reason); }; ft.on_start = () => { }; @@ -227,6 +228,7 @@ class IconManager { ft.startTransfer(); }).catch(reason => { console.error("Error while downloading icon! (" + JSON.stringify(reason) + ")"); + chat.serverChat().appendError("Failed to request download for icon {0}. ({1})", id, JSON.stringify(reason)); reject(reason); }); }); @@ -237,7 +239,7 @@ class IconManager { return $("
"); else if (id < 1000) return $("
"); - let tag = $("
"); + let tag = $.spawn("div"); tag.addClass("icon_empty"); let img = $.spawn("img"); img.attr("width", 16).attr("height", 16).attr("alt", ""); @@ -248,7 +250,7 @@ class IconManager { } else { img.attr("src", "file://null"); - let loader = $("
"); + let loader = $.spawn("div"); loader.addClass("icon_loading"); tag.append(loader); this.loadIcon(id).then(icon => { @@ -262,6 +264,94 @@ class IconManager { }); }).catch(reason => { console.error("Could not load icon " + id + ". Reason: " + reason); + loader.removeClass("icon_loading").addClass("icon client-warning").attr("tag", "Could not load icon " + id); + }); + } + return tag; + } +} +class Avatar { +} +class AvatarManager { + constructor(handle) { + this.handle = handle; + } + downloadAvatar(client) { + return this.handle.requestFileDownload("", "/avatar_" + client.avatarId()); + } + resolveCached(client) { + let avatar = localStorage.getItem("avatar_" + client.properties.client_unique_identifier); + if (avatar) { + let i = JSON.parse(avatar); + if (i.base64.length > 0 && i.avatarId == client.properties.client_flag_avatar) { + return i; + } + } + return undefined; + } + loadAvatar(client) { + const _this = this; + return new Promise((resolve, reject) => { + let avatar = this.resolveCached(client); + if (avatar) { + resolve(avatar); + return; + } + _this.downloadAvatar(client).then(ft => { + let array = new Uint8Array(0); + ft.on_fail = reason => { + console.error("Could not download avatar " + client.properties.client_flag_avatar + " -> " + reason); + chat.serverChat().appendError("Fail to download avatar for {0}. ({1})", client.clientNickName(), JSON.stringify(reason)); + reject(reason); + }; + ft.on_start = () => { }; + ft.on_data = (data) => { + array = concatenate(Uint8Array, array, data); + }; + ft.on_complete = () => { + let base64 = btoa(String.fromCharCode.apply(null, array)); + let avatar = new Avatar(); + avatar.base64 = base64; + avatar.clientUid = client.clientUid(); + avatar.avatarId = client.properties.client_flag_avatar; + localStorage.setItem("avatar_" + client.properties.client_unique_identifier, JSON.stringify(avatar)); + resolve(avatar); + }; + ft.startTransfer(); + }).catch(reason => { + console.error("Error while downloading avatar! (" + JSON.stringify(reason) + ")"); + chat.serverChat().appendError("Failed to request avatar download for {0}. ({1})", client.clientNickName(), JSON.stringify(reason)); + reject(reason); + }); + }); + } + generateTag(client) { + let tag = $.spawn("div"); + let img = $.spawn("img"); + img.attr("alt", ""); + let avatar = this.resolveCached(client); + if (avatar) { + img.attr("src", "data:image/png;base64," + avatar.base64); + tag.append(img); + } + else { + img.attr("src", "file://null"); + let loader = $.spawn("div"); + loader.addClass("avatar_loading"); + tag.append(loader); + this.loadAvatar(client).then(avatar => { + img.attr("src", "data:image/png;base64," + avatar.base64); + console.debug("Avatar " + client.clientNickName() + " loaded :)"); + img.css("opacity", 0); + tag.append(img); + loader.animate({ opacity: 0 }, 50, function () { + $(this).detach(); + img.animate({ opacity: 1 }, 150); + }); + }).catch(reason => { + console.error("Could not load avatar for " + client.clientNickName() + ". Reason: " + reason); + //TODO Broken image + loader.removeClass("avatar_loading").addClass("icon client-warning").attr("tag", "Could not load avatar " + client.clientNickName()); }); } return tag; diff --git a/js/FileManager.js.map b/js/FileManager.js.map index e31a75d4..bbf9f74d 100644 --- a/js/FileManager.js.map +++ b/js/FileManager.js.map @@ -1 +1 @@ -{"version":3,"file":"FileManager.js","sourceRoot":"","sources":["FileManager.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAElC;CAKC;AAED;CAKC;AAED;IAuBI,YAAY,MAAmB,EAAE,EAAU;QAjB3C,gBAAW,GAAW,CAAC,CAAC;QAKxB,aAAQ,GAAe,GAAG,EAAE,GAAE,CAAC,CAAC;QAChC,gBAAW,GAAe,GAAG,EAAE,GAAE,CAAC,CAAC;QACnC,YAAO,GAA6B,CAAC,CAAC,EAAE,EAAE,GAAE,CAAC,CAAC;QAC9C,YAAO,GAA+B,CAAC,CAAC,EAAE,EAAE,GAAE,CAAC,CAAC;QAU5C,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED,aAAa;QACT,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;YAC9E,IAAI,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;YAC9B,MAAM,CAAC;QACX,CAAC;QAED,OA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AAC,IAAI,CAAC,MAAM,CAAC,EAAE;gBAClC,GAAG,CAAC,IAAI,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC1D,OAAO,CAAC,KAAK,CAAC,SAAS,GAAG,MAAM,CAAC,cAAc,EAAE,GAAG,YAAY,CAAC,CAAC;gBAElE,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;gBACtB,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;gBAChB,MAAM,CAAC,OAAO,CAAC,EAAC,OAAO,EAAE,CAAC,EAAC,EAAE,EAAE,EAAE;oBAC7B,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC;oBACjB,GAAG,CAAC,OAAO,CAAC,EAAC,OAAO,EAAE,CAAC,EAAC,EAAE,GAAG,CAAC,CAAC;gBACnC,CAAC,CAAC,CAAC;YACP,CAAC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;gBACd,OAAO,CAAC,KAAK,CAAC,4BAA4B,GAAG,MAAM,CAAC,cAAc,EAAE,GAAG,YAAY,GAAG,MAAM,CAAC,CAAC;gBAC9F,mBAAmB;gBACnB,MAAM,CAAC,WAAW,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAAC,cAAc,EAAE,CAAC,CAAC;YACzI,CAAC,CAAC,CAAC;QACP,CAAC;QAED,MAAM,CAAC,GAAG,CAAC;IACf,CAAC;CACJ"} \ No newline at end of file diff --git a/js/FileManager.ts b/js/FileManager.ts index 0e60f28f..462e17b3 100644 --- a/js/FileManager.ts +++ b/js/FileManager.ts @@ -74,7 +74,7 @@ class DownloadFileTransfer { let fileReader = new FileReader(); fileReader.onload = (event: any) => { this.onBinaryData(new Uint8Array(event.target.result)); - if(this._socket.readyState !== WebSocket.OPEN && !this._succeed) this.on_fail("unexpected close"); + //if(this._socket.readyState != WebSocket.OPEN && !this._succeed) this.on_fail("unexpected close"); this._parseActive = false; }; fileReader.readAsArrayBuffer(data.data); @@ -99,7 +99,7 @@ class DownloadFileTransfer { private onClose() { if(!this._active) return; - if(!this._parseActive) this.on_fail("unexpected close"); + if(!this._parseActive) this.on_fail("unexpected close (remote closed)"); this.disconnect(); } @@ -112,6 +112,7 @@ class DownloadFileTransfer { class FileManager { handle: TSClient; icons: IconManager; + avatars: AvatarManager; private listRequests: FileListRequest[] = []; private pendingDownloadTransfers: DownloadFileTransfer[] = []; @@ -120,6 +121,7 @@ class FileManager { constructor(client: TSClient) { this.handle = client; this.icons = new IconManager(this); + this.avatars = new AvatarManager(this); this.handle.serverConnection.commandHandler["notifyfilelist"] = this.notifyFileList.bind(this); this.handle.serverConnection.commandHandler["notifyfilelistfinished"] = this.notifyFileListFinished.bind(this); @@ -277,6 +279,7 @@ class IconManager { let array = new Uint8Array(0); ft.on_fail = reason => { console.error("Could not download icon " + id + " -> " + reason); + chat.serverChat().appendError("Fail to download icon {0}. ({1})", id, JSON.stringify(reason)); reject(reason); }; ft.on_start = () => {}; @@ -297,6 +300,7 @@ class IconManager { ft.startTransfer(); }).catch(reason => { console.error("Error while downloading icon! (" + JSON.stringify(reason) + ")"); + chat.serverChat().appendError("Failed to request download for icon {0}. ({1})", id, JSON.stringify(reason)); reject(reason); }); }); @@ -309,7 +313,7 @@ class IconManager { else if(id < 1000) return $("
"); - let tag = $("
"); + let tag = $.spawn("div"); tag.addClass("icon_empty"); let img = $.spawn("img"); @@ -322,7 +326,7 @@ class IconManager { } else { img.attr("src", "file://null"); - let loader = $("
"); + let loader = $.spawn("div"); loader.addClass("icon_loading"); tag.append(loader); @@ -338,6 +342,113 @@ class IconManager { }); }).catch(reason => { console.error("Could not load icon " + id + ". Reason: " + reason); + loader.removeClass("icon_loading").addClass("icon client-warning").attr("tag", "Could not load icon " + id); + }); + } + + return tag; + } +} + +class Avatar { + clientUid: string; + avatarId: string; + base64: string; +} + +class AvatarManager { + handle: FileManager; + + constructor(handle: FileManager) { + this.handle = handle; + } + + downloadAvatar(client: ClientEntry) : Promise { + return this.handle.requestFileDownload("", "/avatar_" + client.avatarId()); + } + + resolveCached?(client: ClientEntry) : Avatar { + let avatar = localStorage.getItem("avatar_" + client.properties.client_unique_identifier); + if(avatar) { + let i = JSON.parse(avatar) as Avatar; + if(i.base64.length > 0 && i.avatarId == client.properties.client_flag_avatar) { //TODO timestamp? + return i; + } + } + return undefined; + } + + loadAvatar(client: ClientEntry) : Promise { + const _this = this; + return new Promise((resolve, reject) => { + let avatar = this.resolveCached(client); + if(avatar){ + resolve(avatar); + return; + } + + _this.downloadAvatar(client).then(ft => { + let array = new Uint8Array(0); + ft.on_fail = reason => { + console.error("Could not download avatar " + client.properties.client_flag_avatar + " -> " + reason); + chat.serverChat().appendError("Fail to download avatar for {0}. ({1})", client.clientNickName(), JSON.stringify(reason)); + reject(reason); + }; + ft.on_start = () => {}; + ft.on_data = (data: Uint8Array) => { + array = concatenate(Uint8Array, array, data); + }; + ft.on_complete = () => { + let base64 = btoa(String.fromCharCode.apply(null, array)); + let avatar = new Avatar(); + avatar.base64 = base64; + avatar.clientUid = client.clientUid(); + avatar.avatarId = client.properties.client_flag_avatar; + + localStorage.setItem("avatar_" + client.properties.client_unique_identifier, JSON.stringify(avatar)); + resolve(avatar); + }; + + ft.startTransfer(); + }).catch(reason => { + console.error("Error while downloading avatar! (" + JSON.stringify(reason) + ")"); + chat.serverChat().appendError("Failed to request avatar download for {0}. ({1})", client.clientNickName(), JSON.stringify(reason)); + reject(reason); + }); + }); + } + + generateTag(client: ClientEntry) { + let tag = $.spawn("div"); + + let img = $.spawn("img"); + img.attr("alt", ""); + + let avatar = this.resolveCached(client); + if(avatar) { + img.attr("src", "data:image/png;base64," + avatar.base64); + tag.append(img); + } else { + img.attr("src", "file://null"); + + let loader = $.spawn("div"); + loader.addClass("avatar_loading"); + tag.append(loader); + + this.loadAvatar(client).then(avatar => { + img.attr("src", "data:image/png;base64," + avatar.base64); + console.debug("Avatar " + client.clientNickName() + " loaded :)"); + + img.css("opacity", 0); + tag.append(img); + loader.animate({opacity: 0}, 50, function () { + $(this).detach(); + img.animate({opacity: 1}, 150); + }); + }).catch(reason => { + console.error("Could not load avatar for " + client.clientNickName() + ". Reason: " + reason); + //TODO Broken image + loader.removeClass("avatar_loading").addClass("icon client-warning").attr("tag", "Could not load avatar " + client.clientNickName()); }); } diff --git a/js/InfoBar.js b/js/InfoBar.js index 9f98e16b..5cf02795 100644 --- a/js/InfoBar.js +++ b/js/InfoBar.js @@ -168,7 +168,8 @@ class InfoBar { } this._htmlTag.append(channelGroup); } - const _this = this; + if (this._currentSelected.properties.client_flag_avatar.length > 0) + this.handle.fileManager.avatars.generateTag(this._currentSelected).appendTo(this._htmlTag); this.intervals.push(setInterval(this.updateClientTimings.bind(this), 1000)); } } diff --git a/js/InfoBar.js.map b/js/InfoBar.js.map index 09f48174..35795269 100644 --- a/js/InfoBar.js.map +++ b/js/InfoBar.js.map @@ -1 +1 @@ -{"version":3,"file":"InfoBar.js","sourceRoot":"","sources":["InfoBar.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAElC;IASI,YAAY,MAAgB,EAAE,OAA4B;QAHlD,WAAM,GAAmB,EAAE,CAAC;QAC5B,cAAS,GAAa,EAAE,CAAC;QAG7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC5B,CAAC;IAGO,eAAe,CAAC,KAAU;QAC9B,IAAI,KAAK,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC;QAE1B,GAAG,CAAA,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC;YACjB,OAAO,CAAC,GAAG,CAAC,eAAe,GAAG,CAAC,CAAC,CAAC;YACjC,IAAI,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;YACvB,KAAK,CAAC,MAAM,CAAC,uBAA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 100644 --- a/js/InfoBar.ts +++ b/js/InfoBar.ts @@ -196,8 +196,8 @@ class InfoBar { this._htmlTag.append(channelGroup); } - const _this = this; - + if(this._currentSelected.properties.client_flag_avatar.length > 0) + this.handle.fileManager.avatars.generateTag(this._currentSelected).appendTo(this._htmlTag); this.intervals.push(setInterval(this.updateClientTimings.bind(this),1000)); } } diff --git a/js/chat.js b/js/chat.js index 46dfe2f2..0f572c4a 100644 --- a/js/chat.js +++ b/js/chat.js @@ -56,8 +56,6 @@ class ChatEntry { this.history = []; this.onClose = function () { return true; }; } - static tagify(message, ...args) { - } appendError(message, ...args) { this.appendMessage("{0}".format(ChatMessage.formatMessage(message).format(...args)), false); } @@ -215,23 +213,19 @@ class ChatEntry { class ChatBox { constructor(htmlTag) { this.htmlTag = htmlTag; - const _this = this; - $(this.htmlTag).find(".input button").click(this.onSend.bind(this)); - let chatBox = $(this.htmlTag).find(".input_box"); - chatBox.keypress(function (e) { - if (e.keyCode == 13 /* Enter */ && !e.shiftKey) { - _this.onSend(); + this.htmlTag.find(".input button").click(this.onSend.bind(this)); + this.htmlTag.find(".input_box").keypress(event => { + if (event.keyCode == 13 /* Enter */ && !event.shiftKey) { + this.onSend(); return false; } - }); - chatBox.on('input', function (e) { - let text = $(this).val().toString(); - if (_this.testMessage(text)) - $(_this.htmlTag).find(".input button").removeAttr("disabled"); + }).on('input', (event) => { + let text = $(event.target).val().toString(); + if (this.testMessage(text)) + this.htmlTag.find(".input button").removeAttr("disabled"); else - $(_this.htmlTag).find(".input button").attr("disabled", "true"); - }); - chatBox.trigger("input"); + this.htmlTag.find(".input button").attr("disabled", "true"); + }).trigger("input"); this.chats = []; this._activeChat = undefined; this.createChat("chat_server", ChatType.SERVER).onMessageSend = (text) => { @@ -248,11 +242,15 @@ class ChatBox { } globalClient.serverConnection.sendMessage(text, ChatType.CHANNEL, globalClient.getClient().currentChannel()); }; + globalClient.permissions.initializedListener.push(flag => { + if (flag) + this.activeChat0(this._activeChat); + }); } createChat(key, type = ChatType.CLIENT) { let chat = new ChatEntry(this, type, key); this.chats.push(chat); - $(this.htmlTag).find(".chats").append(chat.htmlTag); + this.htmlTag.find(".chats").append(chat.htmlTag); if (!this._activeChat) this.activeChat = chat; return chat; @@ -288,13 +286,30 @@ class ChatBox { return; if (this._activeChat == chat) return; + this.activeChat0(chat); + } + activeChat0(chat) { this._activeChat = chat; for (let e of this.chats) e.htmlTag.removeClass("active"); + let flagAllowSend = false; if (this._activeChat) { this._activeChat.htmlTag.addClass("active"); this._activeChat.displayHistory(); + if (globalClient && globalClient.permissions && globalClient.permissions.initialized()) + switch (this._activeChat.type) { + case ChatType.CLIENT: + flagAllowSend = true; + break; + case ChatType.SERVER: + flagAllowSend = globalClient.permissions.neededPermission(PermissionType.B_CLIENT_SERVER_TEXTMESSAGE_SEND).granted(1); + break; + case ChatType.CHANNEL: + flagAllowSend = globalClient.permissions.neededPermission(PermissionType.B_CLIENT_CHANNEL_TEXTMESSAGE_SEND).granted(1); + break; + } } + this.htmlTag.find(".input_box").prop("disabled", !flagAllowSend); } get activeChat() { return this._activeChat; } channelChat() { diff --git a/js/chat.js.map b/js/chat.js.map index 1088c18e..a4bd4ee8 100644 --- a/js/chat.js.map +++ b/js/chat.js.map @@ -1 +1 @@ -{"version":3,"file":"chat.js","sourceRoot":"","sources":["chat.ts"],"names":[],"mappings":"AAEA,IAAK,QAKJ;AALD,WAAK,QAAQ;IACT,6CAAO,CAAA;IACP,2CAAM,CAAA;IACN,6CAAO,CAAA;IACP,2CAAM,CAAA;AACV,CAAC,EALI,QAAQ,KAAR,QAAQ,QAKZ;AAED;IAKI,YAAY,OAAO;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAEO,GAAG,CAAC,GAAW;QACnB,IAAI,GAAG,GAAG,GAAG,CAAC,QAAQ,EAAE,CAAC;QACzB,OAAM,GAAG,CAAC,MAAM,GA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ACrB,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;aACnB,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC7B,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9B,CAAC;CACJ"} \ No newline at end of file diff --git a/js/chat.ts b/js/chat.ts index 5efa08ac..3ddd1622 100644 --- a/js/chat.ts +++ b/js/chat.ts @@ -82,10 +82,6 @@ class ChatEntry { this.onClose = function () { return true; } } - static tagify(message: string, ...args) { - - } - appendError(message: string, ...args) { this.appendMessage("{0}".format(ChatMessage.formatMessage(message).format(...args)), false); } @@ -248,30 +244,26 @@ class ChatEntry { class ChatBox { - htmlTag: any; + htmlTag: JQuery; chats: ChatEntry[]; private _activeChat: ChatEntry; - constructor(htmlTag) { + constructor(htmlTag: JQuery) { this.htmlTag = htmlTag; - const _this = this; - $(this.htmlTag).find(".input button").click(this.onSend.bind(this)); - let chatBox = $(this.htmlTag).find(".input_box"); - chatBox.keypress(function (e) { - if(e.keyCode == Key.Enter && !e.shiftKey) { - _this.onSend(); + this.htmlTag.find(".input button").click(this.onSend.bind(this)); + this.htmlTag.find(".input_box").keypress(event => { + if(event.keyCode == Key.Enter && !event.shiftKey) { + this.onSend(); return false; } - }); - chatBox.on('input', function (e) { - let text = $(this).val().toString(); - if(_this.testMessage(text)) - $(_this.htmlTag).find(".input button").removeAttr("disabled"); + }).on('input', (event) => { + let text = $(event.target).val().toString(); + if(this.testMessage(text)) + this.htmlTag.find(".input button").removeAttr("disabled"); else - $(_this.htmlTag).find(".input button").attr("disabled", "true"); - }); - chatBox.trigger("input"); + this.htmlTag.find(".input button").attr("disabled", "true"); + }).trigger("input"); this.chats = []; this._activeChat = undefined; @@ -291,12 +283,16 @@ class ChatBox { globalClient.serverConnection.sendMessage(text, ChatType.CHANNEL, globalClient.getClient().currentChannel()); }; + + globalClient.permissions.initializedListener.push(flag => { + if(flag) this.activeChat0(this._activeChat); + }); } createChat(key, type : ChatType = ChatType.CLIENT) : ChatEntry { let chat = new ChatEntry(this, type, key); this.chats.push(chat); - $(this.htmlTag).find(".chats").append(chat.htmlTag); + this.htmlTag.find(".chats").append(chat.htmlTag); if(!this._activeChat) this.activeChat = chat; return chat; } @@ -333,14 +329,33 @@ class ChatBox { set activeChat(chat : ChatEntry) { if(this.chats.indexOf(chat) === -1) return; if(this._activeChat == chat) return; + this.activeChat0(chat); + } + private activeChat0(chat: ChatEntry) { this._activeChat = chat; for(let e of this.chats) e.htmlTag.removeClass("active"); + + let flagAllowSend = false; if(this._activeChat) { this._activeChat.htmlTag.addClass("active"); this._activeChat.displayHistory(); + + if(globalClient && globalClient.permissions && globalClient.permissions.initialized()) + switch (this._activeChat.type) { + case ChatType.CLIENT: + flagAllowSend = true; + break; + case ChatType.SERVER: + flagAllowSend = globalClient.permissions.neededPermission(PermissionType.B_CLIENT_SERVER_TEXTMESSAGE_SEND).granted(1); + break; + case ChatType.CHANNEL: + flagAllowSend = globalClient.permissions.neededPermission(PermissionType.B_CLIENT_CHANNEL_TEXTMESSAGE_SEND).granted(1); + break; + } } + this.htmlTag.find(".input_box").prop("disabled", !flagAllowSend); } get activeChat(){ return this._activeChat; } diff --git a/js/client.js b/js/client.js index 154adf92..3296735e 100644 --- a/js/client.js +++ b/js/client.js @@ -46,7 +46,6 @@ var ViewReasonId; class TSClient { constructor() { this._clientId = 0; - this.settings = new Settings(this); this.selectInfo = new InfoBar(this, $("#select_info")); this.channelTree = new ChannelTree(this, $("#channelTree")); this.serverConnection = new ServerConnection(this); @@ -73,7 +72,7 @@ class TSClient { } else { host = addr; - port = 19974; + port = 9987; } console.log("Start connection to " + host + ":" + port); this.channelTree.initialiseHead(addr); @@ -95,9 +94,9 @@ class TSClient { onConnected() { console.log("Client connected!"); this.channelTree.registerClient(this._ownEntry); - this.settings.loadServer(); - this.serverConnection.sendCommand("channelsubscribeall"); + settings.setServer(this.channelTree.server); this.permissions.requestPermissionList(); + this.serverConnection.sendCommand("channelsubscribeall"); if (this.groups.serverGroups.length == 0) this.groups.requestGroups(); this.controlBar.updateProperties(); diff --git a/js/client.js.map b/js/client.js.map index a0652f63..90ca4c9c 100644 --- a/js/client.js.map +++ b/js/client.js.map @@ -1 +1 @@ -{"version":3,"file":"client.js","sourceRoot":"","sources":["client.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,iCAAiC;AACjC,mCAAmC;AACnC,sCAAsC;AACtC,oCAAoC;AACpC,mCAAmC;AACnC,uCAAuC;AACvC,wDAAwD;AACxD,mDAAmD;AACnD,yCAAyC;AAEzC,IAAK,gBAUJ;AAVD,WAAK,gBAAgB;IACjB,iEAAS,CAAA;IACT,6EAAe,CAAA;IACf,iFAAiB,CAAA;IACjB,2FAAsB,CAAA;IACtB,6FAAuB,CAAA;IACvB,yEAAa,CAAA;IACb,yEAAa,CAAA;IACb,yEAAa,CAAA;IACb,6DAAO,CAAA;AACX,CAAC,EAVI,gBAAgB,KAAhB,gBAAgB,QAUpB;AAED,IAAK,eAMJ;AAND,WAAK,eAAe;IAChB,mEAAW,CAAA;IACX,iEAAU,CAAA;IACV,qEAAY,CAAA;IACZ,+DAAS,CAAA;IACT,uEAAa,CAAA;AACjB,CAAC,EANI,eAAe,KAAf,eAAe,QAMnB;AAED,IAAK,YAaJ;AAbD,WAAK,YAAY;IACb,6EAAuB,CAAA;IACvB,iEAAiB,CAAA;IACjB,mEAAkB,CAAA;IAClB,qEAAmB,CAAA;IACnB,+EAAwB,CAAA;IACxB,6EAAuB,CAAA;IACvB,6DAAe,CAAA;IACf,mFAA0B,CAAA;IAC1B,6EAAuB,CAAA;IACvB,qFAA2B,CAAA;IAC3B,oEAAmB,CAAA;IACnB,sFAA4B,CAAA;AAChC,CAAC,EAbI,YAAY,KAAZ,YAAY,QAahB;AAED;IAcI;QAHQ,cAAS,GAAW,CAAC,CAAC;QAI1B,IAAI,CAAC,QAAQ,GAAG,IAAI,QAAQ,CAAC,IAAI,CAAC,CAAC;QACnC,IAAI,CAAC,UAAU,GAA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A0B,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACpB,KAAK,CAAC;QACd,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC;QACvC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;QACnC,EAAE,CAAA,CAAC,IAAI,CAAC,gBAAgB,CAAC;YAAC,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC;IACjE,CAAC;CACJ"} \ No newline at end of file +{"version":3,"file":"client.js","sourceRoot":"","sources":["client.ts"],"names":[],"mappings":"AAAA,iDAAiD;AACjD,iCAAiC;AACjC,mCAAmC;AACnC,sCAAsC;AACtC,oCAAoC;AACpC,mCAAmC;AACnC,uCAAuC;AACvC,wDAAwD;AACxD,mDAAmD;AACnD,yCAAyC;AAEzC,IAAK,gBAUJ;AAVD,WAAK,gBAAgB;IACjB,iEAAS,CAAA;IACT,6EAAe,CAAA;IACf,iFAAiB,CAAA;IACjB,2FAAsB,CAAA;IACtB,6FAAuB,CAAA;IACvB,yEAAa,CAAA;IACb,yEAAa,CAAA;IACb,yEAAa,CAAA;IACb,6DAAO,CAAA;AACX,CAAC,EAVI,gBAAgB,KAAhB,gBAAgB,QAUpB;AAED,IAAK,eAMJ;AAND,WAAK,eAAe;IAChB,mEAAW,CAAA;IACX,iEAAU,CAAA;IACV,qEAAY,CAAA;IACZ,+DAAS,CAAA;IACT,uEAAa,CAAA;AACjB,CAAC,EANI,eAAe,KAAf,eAAe,QAMnB;AAED,IAAK,YAaJ;AAbD,WAAK,YAAY;IACb,6EAAuB,CAAA;IACvB,iEAAiB,CAAA;IACjB,mEAAkB,CAAA;IAClB,qEAAmB,CAAA;IACnB,+EAAwB,CAAA;IACxB,6EAA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AAC,aAAa;gBAC/B,IAAI,CAAC,UAAU,EAAE,CAAC,WAAW,CAAC,qBAAqB,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;gBACrE,gBAAgB,CACZ,eAAe,EACf,2BAA2B;oBACnB,UAAU,GAAG,IAAI,CAAC,SAAS,CACtC,CAAC,IAAI,EAAE,CAAC;gBACT,KAAK,CAAC;YACV;gBACI,OAAO,CAAC,KAAK,CAAC,0BAA0B,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,QAAQ,CAAC,CAAC;gBAC1C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;gBACpB,KAAK,CAAC;QACd,CAAC;QAED,IAAI,CAAC,UAAU,CAAC,eAAe,GAAG,IAAI,CAAC;QACvC,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,eAAe,CAAC,WAAW,EAAE,CAAC;QACnC,EAAE,CAAA,CAAC,IAAI,CAAC,gBAAgB,CAAC;YAAC,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,CAAC;IACjE,CAAC;CACJ"} \ No newline at end of file diff --git a/js/client.ts b/js/client.ts index 19ab26f2..681f2d5a 100644 --- a/js/client.ts +++ b/js/client.ts @@ -53,13 +53,11 @@ class TSClient { permissions: PermissionManager; groups: GroupManager; controlBar: ControlBar; - settings: Settings; private _clientId: number = 0; private _ownEntry: LocalClientEntry; constructor() { - this.settings = new Settings(this); this.selectInfo = new InfoBar(this, $("#select_info")); this.channelTree = new ChannelTree(this, $("#channelTree")); this.serverConnection = new ServerConnection(this); @@ -89,7 +87,7 @@ class TSClient { host = addr.substr(0, idx); } else { host = addr; - port = 19974; + port = 9987; } console.log("Start connection to " + host + ":" + port); this.channelTree.initialiseHead(addr); @@ -118,9 +116,9 @@ class TSClient { onConnected() { console.log("Client connected!"); this.channelTree.registerClient(this._ownEntry); - this.settings.loadServer(); - this.serverConnection.sendCommand("channelsubscribeall"); + settings.setServer(this.channelTree.server); this.permissions.requestPermissionList(); + this.serverConnection.sendCommand("channelsubscribeall"); if(this.groups.serverGroups.length == 0) this.groups.requestGroups(); this.controlBar.updateProperties(); diff --git a/js/codec/compile.sh b/js/codec/compile.sh new file mode 100755 index 00000000..7e9bd35e --- /dev/null +++ b/js/codec/compile.sh @@ -0,0 +1 @@ +/usr/local/bin/tsc diff --git a/js/connection.js b/js/connection.js index cbd07551..ac7de271 100644 --- a/js/connection.js +++ b/js/connection.js @@ -128,17 +128,34 @@ class ServerConnection { } } handleCommand(json) { - console.log("Handling command '" + json["command"] + "'"); - let fn = this.commandHandler[json["command"]]; - if (fn === undefined) { - console.log("Missing command '" + json["command"] + "'"); - return; + let group = log.group(log.LogType.DEBUG, LogCategory.NETWORKING, "Handling command '%s'", json["command"]); + group.log("Handling command '" + json["command"] + "'"); + group.group(log.LogType.TRACE, "Json:").collapsed(true).log("%o", json).end(); + try { + let fn = this.commandHandler[json["command"]]; + if (fn === undefined) { + group.log("Missing command '" + json["command"] + "'"); + return; + } + fn.call(this.commandHandler, json["data"]); + } + finally { + group.end(); } - fn.call(this.commandHandler, json["data"]); } sendData(data) { this._socket.send(data); } + commandiefy(input) { + return JSON.stringify(input, (key, value) => { + switch (typeof value) { + case "boolean": return value == true ? "1" : "0"; + case "function": return value(); + default: + return value; + } + }); + } sendCommand(command, data = {}, logResult = true) { const _this = this; let result = new Promise((resolve, failed) => { @@ -154,7 +171,7 @@ class ServerConnection { listener.reject("timeout"); }, 1500); this._retListener.push(listener); - this._socket.send(JSON.stringify({ + this._socket.send(this.commandiefy({ "type": "command", "command": command, "data": _data @@ -298,8 +315,8 @@ class ConnectionCommandHandler { console.log("Setting up voice "); this.connection._client.voiceConnection.createSession(); json = json[0]; //Only one bulk - this.connection._client.clientId = json["aclid"]; - this.connection._client.getClient().updateVariable("client_nickname", json["acn"]); + this.connection._client.clientId = parseInt(json["aclid"]); + this.connection._client.getClient().updateVariables({ key: "client_nickname", value: json["acn"] }); for (let key in json) { if (key === "aclid") continue; @@ -313,7 +330,7 @@ class ConnectionCommandHandler { } createChannelFromJson(json, ignoreOrder = false) { let tree = this.connection._client.channelTree; - let channel = new ChannelEntry(json["cid"], json["channel_name"], tree.findChannel(json["cpid"])); + let channel = new ChannelEntry(parseInt(json["cid"]), json["channel_name"], tree.findChannel(json["cpid"])); tree.insertChannel(channel); if (json["channel_order"] !== "0") { let prev = tree.findChannel(json["channel_order"]); @@ -337,6 +354,7 @@ class ConnectionCommandHandler { } } } + let updates = []; for (let key in json) { if (key === "cid") continue; @@ -350,8 +368,9 @@ class ConnectionCommandHandler { continue; if (key === "reasonid") continue; - channel.updateProperty(key, json[key]); + updates.push({ key: key, value: json[key] }); } + channel.updateVariables(...updates); } handleCommandChannelList(json) { console.log("Got " + json.length + " new channels"); @@ -381,7 +400,7 @@ class ConnectionCommandHandler { let old_channel = tree.findChannel(json["cfid"]); client = tree.findClient(json["clid"]); if (!client) { - client = new ClientEntry(json["clid"], json["client_nickname"]); + client = new ClientEntry(parseInt(json["clid"]), json["client_nickname"]); client = tree.insertClient(client, channel); } else { @@ -397,6 +416,7 @@ class ConnectionCommandHandler { chat.serverChat().appendMessage("{0} connected to channel {1}", true, client.createChatTag(true), channel.createChatTag(true)); } } + let updates = []; for (let key in json) { if (key == "cfid") continue; @@ -410,8 +430,9 @@ class ConnectionCommandHandler { continue; if (key === "reasonid") continue; - client.updateVariable(key, json[key]); + updates.push({ key: key, value: json[key] }); } + client.updateVariables(...updates); } handleCommandClientLeftView(json) { json = json[0]; //Only one bulk @@ -517,6 +538,7 @@ class ConnectionCommandHandler { console.error("Unknown channel edit (Channel)!"); return 0; } + let updates = []; for (let key in json) { if (key === "cid") continue; @@ -528,8 +550,9 @@ class ConnectionCommandHandler { continue; if (key === "reasonid") continue; - channel.updateProperty(key, json[key]); + updates.push({ key: key, value: json[key] }); } + channel.updateVariables(...updates); } handleNotifyTextMessage(json) { json = json[0]; //Only one bulk @@ -567,11 +590,13 @@ class ConnectionCommandHandler { console.error("Tried to update an non existing client"); return; } + let updates = []; for (let key in json) { if (key == "clid") continue; - client.updateVariable(key, json[key]); + updates.push({ key: key, value: json[key] }); } + client.updateVariables(...updates); if (this.connection._client.selectInfo.currentSelected == client) this.connection._client.selectInfo.update(); } diff --git a/js/connection.js.map b/js/connection.js.map index 12f3a066..fb148d08 100644 --- a/js/connection.js.map +++ b/js/connection.js.map @@ -1 +1 @@ -{"version":3,"file":"connection.js","sourceRoot":"","sources":["connection.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kCAAkC;AAElC;IAQI,YAAY,IAAI;QACZ,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC;QAE3B,IAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,EAAE,CAAA,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAAC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;QAE7D,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;IAChC,CAAC;CACJ;AAED;CAMC;AAED;IAcI,YAAY,MAAiB;QAT7B,qBAAgB,GAAoB,eAAe,CAAC,WAAW,CAAC;QAIxD,2BAAsB,GAAiB,SAAS,CAAC;QAczD,eAAU,GAAe,GAAG,EAAE;YAC1B,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;YAChC,IAAI,CAAC,UAAU,EAAE,CAAC,aAAa,CAAC,eAAe,CAAC,CAAC;YACjD,IAAI,CAAC,iBAAiB,CAAC,cAAc,EAAE,CAAC;QAC5C,CAAC,CAAC;QAZE,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QAEtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QACpB,IAAI,CAAC,cA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;QAC9E,CAAC;QACD,IAAI,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC;QAC9C,EAAE,CAAA,CAAC,IAAI,CAAC,eAAe,YAAY,WAAW,CAAC;YAC3C,IAAI,CAAC,MAAM,EAAE,CAAC;IACtB,CAAC;CACJ"} \ No newline at end of file diff --git a/js/connection.ts b/js/connection.ts index d5994413..d9ea343a 100644 --- a/js/connection.ts +++ b/js/connection.ts @@ -158,20 +158,37 @@ class ServerConnection { } handleCommand(json) { - console.log("Handling command '" + json["command"] + "'"); + let group = log.group(log.LogType.DEBUG, LogCategory.NETWORKING, "Handling command '%s'", json["command"]); + group.log("Handling command '" + json["command"] + "'"); + group.group(log.LogType.TRACE, "Json:").collapsed(true).log("%o", json).end(); - let fn = this.commandHandler[json["command"]]; - if(fn === undefined) { - console.log("Missing command '" + json["command"] + "'"); - return; + try { + let fn = this.commandHandler[json["command"]]; + if(fn === undefined) { + group.log("Missing command '" + json["command"] + "'"); + return; + } + fn.call(this.commandHandler, json["data"]); + } finally { + group.end(); } - fn.call(this.commandHandler, json["data"]); } sendData(data: any) { //TODO check stuff? this._socket.send(data); } + private commandiefy(input: any) : string { + return JSON.stringify(input, (key, value) => { + switch (typeof value) { + case "boolean": return value == true ? "1" : "0"; + case "function": return value(); + default: + return value; + } + }); + } + sendCommand(command: string, data: any = {}, logResult: boolean = true) : Promise { const _this = this; let result = new Promise((resolve, failed) => { @@ -189,7 +206,7 @@ class ServerConnection { }, 1500); this._retListener.push(listener); - this._socket.send(JSON.stringify({ + this._socket.send(this.commandiefy({ "type": "command", "command": command, "data": _data @@ -352,8 +369,8 @@ class ConnectionCommandHandler { json = json[0]; //Only one bulk - this.connection._client.clientId = json["aclid"]; - this.connection._client.getClient().updateVariable("client_nickname", json["acn"]); + this.connection._client.clientId = parseInt(json["aclid"]); + this.connection._client.getClient().updateVariables({key: "client_nickname", value: json["acn"]}); for(let key in json) { if(key === "aclid") continue; @@ -368,7 +385,7 @@ class ConnectionCommandHandler { private createChannelFromJson(json, ignoreOrder: boolean = false) { let tree = this.connection._client.channelTree; - let channel = new ChannelEntry(json["cid"], json["channel_name"], tree.findChannel(json["cpid"])); + let channel = new ChannelEntry(parseInt(json["cid"]), json["channel_name"], tree.findChannel(json["cpid"])); tree.insertChannel(channel); if(json["channel_order"] !== "0") { let prev = tree.findChannel(json["channel_order"]); @@ -394,6 +411,10 @@ class ConnectionCommandHandler { } } + let updates: { + key: string, + value: string + }[] = []; for(let key in json) { if(key === "cid") continue; if(key === "cpid") continue; @@ -402,8 +423,9 @@ class ConnectionCommandHandler { if(key === "invokeruid") continue; if(key === "reasonid") continue; - channel.updateProperty(key, json[key]); + updates.push({key: key, value: json[key]}); } + channel.updateVariables(...updates); } handleCommandChannelList(json) { @@ -441,7 +463,7 @@ class ConnectionCommandHandler { client = tree.findClient(json["clid"]); if(!client) { - client = new ClientEntry(json["clid"], json["client_nickname"]); + client = new ClientEntry(parseInt(json["clid"]), json["client_nickname"]); client = tree.insertClient(client, channel); } else { if(client == this.connection._client.getClient()) @@ -458,6 +480,11 @@ class ConnectionCommandHandler { } } + let updates: { + key: string, + value: string + }[] = []; + for(let key in json) { if(key == "cfid") continue; if(key == "ctid") continue; @@ -466,8 +493,10 @@ class ConnectionCommandHandler { if(key === "invokeruid") continue; if(key === "reasonid") continue; - client.updateVariable(key, json[key]); + updates.push({key: key, value: json[key]}); } + + client.updateVariables(...updates); } handleCommandClientLeftView(json) { @@ -602,14 +631,20 @@ class ConnectionCommandHandler { console.error("Unknown channel edit (Channel)!"); return 0; } + + let updates: { + key: string, + value: string + }[] = []; for(let key in json) { if(key === "cid") continue; if(key === "invokerid") continue; if(key === "invokername") continue; if(key === "invokeruid") continue; if(key === "reasonid") continue; - channel.updateProperty(key, json[key]); + updates.push({key: key, value: json[key]}); } + channel.updateVariables(...updates); } handleNotifyTextMessage(json) { @@ -648,10 +683,16 @@ class ConnectionCommandHandler { console.error("Tried to update an non existing client"); return; } + + let updates: { + key: string, + value: string + }[] = []; for(let key in json) { if(key == "clid") continue; - client.updateVariable(key, json[key]); + updates.push({key: key, value: json[key]}); } + client.updateVariables(...updates); if(this.connection._client.selectInfo.currentSelected == client) this.connection._client.selectInfo.update(); } diff --git a/js/contextMenu.js b/js/contextMenu.js index 7a97063b..2adb6156 100644 --- a/js/contextMenu.js +++ b/js/contextMenu.js @@ -73,7 +73,7 @@ function spawnMenu(x, y, ...entries) { tag.append("
"); tag.append("
" + ($.isFunction(entry.name) ? entry.name() : entry.name) + "
"); menu.append(tag); - if (entry.disabled) + if (entry.disabled || entry.invalidPermission) tag.addClass("disabled"); else { tag.click(function () { diff --git a/js/contextMenu.js.map b/js/contextMenu.js.map index e30dc1ad..9f3a7304 100644 --- a/js/contextMenu.js.map +++ b/js/contextMenu.js.map @@ -1 +1 @@ -{"version":3,"file":"contextMenu.js","sourceRoot":"","sources":["contextMenu.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IACrC,yCAAyC;IACzC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;QAClD,UAAU;QACV,kBAAkB,EAAE,CAAC;IACzB,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,kBAAkB,GAAG,SAAS,CAAC;AACnC;IACI,IAAI,KAAK,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC;IAC9B,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;QAAC,MAAM,CAAC;IACjC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChB,EAAE,CAAA,CAAC,kBAAkB,CAAC;QAAC,kBAAkB,EAAE,CAAC;AAChD,CAAC;AAED,IAAK,aAKJ;AALD,WAAK,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,CAAC;IACL,CAAC;IAED,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACf,oCAAoC;IACpC,IAAI,CAAC,GAAG,CAAC;QACL,KAAK,EAAE,CAAC,GAAG,IAAI;QACf,MAAM,EAAE,CAAC,GAAG,IAAI;KACnB,CAAC,CAAC;AACP,CAAC"} \ No newline at end of file +{"version":3,"file":"contextMenu.js","sourceRoot":"","sources":["contextMenu.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,CAAC,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC;IACrC,yCAAyC;IACzC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,CAAC,CAAC;QAClD,UAAU;QACV,kBAAkB,EAAE,CAAC;IACzB,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,IAAI,kBAAkB,GAAG,SAAS,CAAC;AACnC;IACI,IAAI,KAAK,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC;IAC9B,EAAE,CAAA,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC;QAAC,MAAM,CAAC;IACjC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChB,EAAE,CAAA,CAAC,kBAAkB,CAAC;QAAC,kBAAkB,EAAE,CAAC;AAChD,CAAC;AAED,IAAK,aAKJ;AALD,WAAK,aAAa;IACd,mDAAK,CAAA;IACL,mDAAK,CAAA;IACL,6CAAE,CAAA;IACF,mDAAK,CAAA;AACT,CAAC,EALI,aAAa,KAAb,aAAa,QAKjB;AAED;IACI,MAAM,CAAC,EAAE;QACL,MAAM,CAAC;YACH,QAAQ,EAAE,GAAG,EAAE,GAAE,CAAC;YAClB,IAAI,EAAE,aAAa,CAAC,EAAE;YACtB,IAAI,EAAE,EAAE;YACR,IAAI,EAAE,EAAE;SACX,CAAC;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- a/js/contextMenu.ts +++ b/js/contextMenu.ts @@ -57,6 +57,7 @@ function spawnMenu(x, y, ...entries: { name: (() => string) | string; icon: (() => string) | string; disabled?: boolean; + invalidPermission?: boolean; }[]) { const menu = $("#contextMenu"); menu.empty(); @@ -82,7 +83,7 @@ function spawnMenu(x, y, ...entries: { menu.append(tag); - if(entry.disabled) tag.addClass("disabled"); + if(entry.disabled || entry.invalidPermission) tag.addClass("disabled"); else { tag.click(function () { if($.isFunction(entry.callback)) entry.callback(); diff --git a/js/crypto/hex.ts b/js/crypto/hex.ts new file mode 100644 index 00000000..9c700341 --- /dev/null +++ b/js/crypto/hex.ts @@ -0,0 +1,20 @@ +namespace hex { + export function encode(buffer) { + let hexCodes = []; + let view = new DataView(buffer); + for (let i = 0; i < view.byteLength % 4; i ++) { + let value = view.getUint32(i * 4); + let stringValue = value.toString(16); + let padding = '00000000'; + let paddedValue = (padding + stringValue).slice(-padding.length); + hexCodes.push(paddedValue); + } + for (let i = (view.byteLength % 4) * 4; i < view.byteLength; i++) { + let value = view.getUint8(i).toString(16); + let padding = '00'; + hexCodes.push((padding + value).slice(-padding.length)); + } + + return hexCodes.join(""); + } +} \ No newline at end of file diff --git a/js/crypto/sha.ts b/js/crypto/sha.ts new file mode 100644 index 00000000..d1532eb9 --- /dev/null +++ b/js/crypto/sha.ts @@ -0,0 +1,9 @@ +//Source: https://www.movable-type.co.uk/scripts/sha1.html + +namespace sha { + export function sha1(message: string | ArrayBuffer) : PromiseLike { + let buffer = message instanceof ArrayBuffer ? message : new TextEncoder("utf-8").encode(message); + return crypto.subtle.digest("SHA-1", buffer); + } + +} \ No newline at end of file diff --git a/js/load.ts b/js/load.ts index cc504161..7414b97a 100644 --- a/js/load.ts +++ b/js/load.ts @@ -69,8 +69,14 @@ function loadDebug() { awaitLoad(loadScripts([ //Load general API's + "js/log.js", + "js/utils/modal.js", "js/utils/tab.js", + "js/utils/helpers.js", + + "js/crypto/sha.js", + "js/crypto/hex.js", //Load UI "js/ui/modal/ModalConnect.js", diff --git a/js/log.ts b/js/log.ts new file mode 100644 index 00000000..d9a6dc1a --- /dev/null +++ b/js/log.ts @@ -0,0 +1,121 @@ +enum LogCategory { + CHANNEL, + CLIENT, + PERMISSIONS, + GENERAL, + NETWORKING +} + +namespace log { + export enum LogType { + TRACE, + DEBUG, + INFO, + WARNING, + ERROR + } + + let category_mapping = new Map([ + [LogCategory.CHANNEL, "Channel "], + [LogCategory.CLIENT, "Client "], + [LogCategory.PERMISSIONS, "Permission "], + [LogCategory.GENERAL, "General "], + [LogCategory.NETWORKING, "Network "] + ]); + + function logDirect(type: LogType, message: string, ...optionalParams: any[]) { + switch (type) { + case LogType.TRACE: + case LogType.DEBUG: + console.debug(message, ...optionalParams); + break; + case LogType.INFO: + console.log(message, ...optionalParams); + break; + case LogType.WARNING: + console.warn(message, ...optionalParams); + break; + case LogType.ERROR: + console.error(message, ...optionalParams); + break; + } + //console.log("This is %cMy stylish message", "color: yellow; font-style: italic; background-color: blue;padding: 2px"); + } + + export function log(type: LogType, category: LogCategory, message: string, ...optionalParams: any[]) { + optionalParams.unshift(category_mapping.get(category)); + message = "[%s] " + message; + logDirect(type, message, ...optionalParams); + } + + export function trace(category: LogCategory, message: string, ...optionalParams: any[]) { + log(LogType.TRACE, category, message, ...optionalParams); + } + + export function debug(category: LogCategory, message: string, ...optionalParams: any[]) { + log(LogType.DEBUG, category, message, ...optionalParams); + } + + export function info(category: LogCategory, message: string, ...optionalParams: any[]) { + log(LogType.INFO, category, message, ...optionalParams); + } + + export function warn(category: LogCategory, message: string, ...optionalParams: any[]) { + log(LogType.WARNING, category, message, ...optionalParams); + } + + export function error(category: LogCategory, message: string, ...optionalParams: any[]) { + log(LogType.ERROR, category, message, ...optionalParams); + } + + export function group(level: LogType, category: LogCategory, name: string, ...optionalParams: any[]) : Group { + name = "[%s] " + name; + optionalParams.unshift(category_mapping.get(category)); + + return new Group(level, category, name, optionalParams); + } + + export class Group { + readonly level: LogType; + readonly category: LogCategory; + owner: Group = undefined; + + private readonly name: string; + private readonly optionalParams: any[][]; + private _collapsed: boolean = true; + private initialized = false; + + constructor(level: LogType, category: LogCategory, name: string, optionalParams: any[][], owner: Group = undefined) { + this.level = level; + this.category = category; + this.name = name; + this.optionalParams = optionalParams; + } + + group(level: LogType, name: string, ...optionalParams: any[]) : Group { + return new Group(level, this.category, name, optionalParams, this); + } + + collapsed(flag: boolean = true) : this { + this._collapsed = flag; + return this; + } + + log(message: string, ...optionalParams: any[]) : this { + if(!this.initialized) { + if(this._collapsed && console.groupCollapsed) + console.groupCollapsed(this.name, ...this.optionalParams); + else + console.group(this.name, ...this.optionalParams); + this.initialized = true; + } + logDirect(this.level, message, ...optionalParams); + return this; + } + + end() { + if(this.initialized) + console.groupEnd(); + } + } +} \ No newline at end of file diff --git a/js/main.js b/js/main.js index d1cd1543..d0bfb6a5 100644 --- a/js/main.js +++ b/js/main.js @@ -3,33 +3,46 @@ /// /// /// +/// /// /// +/// +let settings; let globalClient; let chat; let forumIdentity; function invokeMain() { + //localhost:63343/Web-Client/index.php?disableUnloadDialog=1&default_connect_type=forum&default_connect_url=localhost AudioController.initializeAudioController(); if (!TSIdentityHelper.setup()) { console.error("Could not setup the TeamSpeak identity parser!"); return; } + settings = new Settings(); globalClient = new TSClient(); /** 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")); + if (settings.static("forum_user_data")) { + forumIdentity = new TeaForumIdentity(settings.static("forum_user_data"), settings.static("forum_user_sign")); } chat = new ChatBox($("#chat")); globalClient.setup(); //globalClient.startConnection("localhost:19974"); //TODO remove only for testing + if (!settings.static(Settings.KEY_DISABLE_UNLOAD_DIALOG, false)) { + window.addEventListener("beforeunload", function (event) { + if (globalClient.serverConnection && globalClient.serverConnection.connected) + event.returnValue = "Are you really sure?
You're still connected!"; + //event.preventDefault(); + }); + } //Modals.spawnConnectModal(); //Modals.spawnSettingsModal(); - window.addEventListener("beforeunload", function (event) { - if (globalClient.serverConnection && globalClient.serverConnection.connected) - event.returnValue = "Are you really sure?
You're still connected!"; - //event.preventDefault(); - }); - //console.log("XF: " + globalClient.settings.static("forum_user_data")); - //console.log("XF: " + globalClient.settings.static("forum_user_sign")); + //Modals.createChannelModal(undefined); + if (settings.static("default_connect_url")) { + if (settings.static("default_connect_type", "forum")) { + globalClient.startConnection(settings.static("default_connect_url"), forumIdentity); + } + else + Modals.spawnConnectModal(settings.static("default_connect_url")); + } } //# sourceMappingURL=main.js.map \ No newline at end of file diff --git a/js/main.js.map b/js/main.js.map index d944feaa..4e0101bc 100644 --- a/js/main.js.map +++ b/js/main.js.map @@ -1 +1 @@ -{"version":3,"file":"main.js","sourceRoot":"","sources":["main.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,kCAAkC;AAClC,oCAAoC;AACpC,uCAAuC;AACvC,iDAAiD;AACjD,8CAA8C;AAC9C,oCAAoC;AAEpC,IAAI,YAAsB,CAAC;AAC3B,IAAI,IAAa,CAAC;AAElB,IAAI,aAA+B,CAAC;AAEpC;IACI,eAAe,CAAC,yBAAyB,EAAE,CAAC;IAC5C,EAAE,CAAA,CAAC,CAAC,gBAAgB,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;QAAC,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;QAAC,MAAM,CAAC;IAAC,CAAC;IAE1G,YAAY,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC9B,mCAAmC;IACnC,EAAE,CAAA,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC;QACjD,aAAa,GAAG,IAAI,gBAAgB,CAAC,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC3I,CAAC;IAED,IAAI,GAAG,IAAI,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CAAC,CAAC;IACjH,CAAC;IAED,IAAI,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/B,YAAY,CAAC,KAAK,EAAE,CAAC;IACrB,iFAAiF;IAGjF,EAAE,CAAA,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;QAC7D,MAAM,CAAC,gBAAgB,CAAC,cAAc,EAAE,UAAU,KAAK;YACnD,EAAE,CAAA,CAAC,YAAY,CAAC,gBAAgB,IAAI,YAAY,CAAC,gBAAgB,CAAC,SAAS,CAAC;gBACxE,KAAK,CAAC,WAAW,GAAG,iDAAiD,CAAC;YAC1E,yBAAyB;QAC7B,CAAC,CAAC,CAAC;IACP,CAAC;IACD,6BAA6B;IAC7B,8BAA8B;IAC9B,uCAAuC;IAEvC,EAAE,CAAA,CAAC,QAAQ,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACxC,EAAE,CAAA,CAAC,QAAQ,CAAC,MAAM,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;YAClD,YAAY,CAAC,eAAe,CAAC,QAAQ,CAAC,MAAM,CAAC,qBAAqB,CAAC,EAAE,aAAa,CAAC,CAAC;QACxF,CAAC;QAAC,IAAI;YACF,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC;IACzE,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/js/main.ts b/js/main.ts index 0c24137d..a088a8b8 100644 --- a/js/main.ts +++ b/js/main.ts @@ -3,38 +3,50 @@ /// /// /// +/// /// /// +/// +let settings: Settings; let globalClient: TSClient; let chat: ChatBox; let forumIdentity: TeaForumIdentity; + function invokeMain() { + //localhost:63343/Web-Client/index.php?disableUnloadDialog=1&default_connect_type=forum&default_connect_url=localhost AudioController.initializeAudioController(); if(!TSIdentityHelper.setup()) { console.error("Could not setup the TeamSpeak identity parser!"); return; } + settings = new Settings(); globalClient = new TSClient(); /** 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")); + if(settings.static("forum_user_data")) { + forumIdentity = new TeaForumIdentity(settings.static("forum_user_data"), settings.static("forum_user_sign")); } chat = new ChatBox($("#chat")); globalClient.setup(); //globalClient.startConnection("localhost:19974"); //TODO remove only for testing + + if(!settings.static(Settings.KEY_DISABLE_UNLOAD_DIALOG, false)) { + window.addEventListener("beforeunload", function (event) { + if(globalClient.serverConnection && globalClient.serverConnection.connected) + event.returnValue = "Are you really sure?
You're still connected!"; + //event.preventDefault(); + }); + } //Modals.spawnConnectModal(); //Modals.spawnSettingsModal(); + //Modals.createChannelModal(undefined); - window.addEventListener("beforeunload", function (event) { - if(globalClient.serverConnection && globalClient.serverConnection.connected) - event.returnValue = "Are you really sure?
You're still connected!"; - //event.preventDefault(); - }); - - - //console.log("XF: " + globalClient.settings.static("forum_user_data")); - //console.log("XF: " + globalClient.settings.static("forum_user_sign")); + if(settings.static("default_connect_url")) { + if(settings.static("default_connect_type", "forum")) { + globalClient.startConnection(settings.static("default_connect_url"), forumIdentity); + } else + Modals.spawnConnectModal(settings.static("default_connect_url")); + } } \ No newline at end of file diff --git a/js/permission/PermissionManager.js b/js/permission/PermissionManager.js index 1ca63d9c..15e15c4a 100644 --- a/js/permission/PermissionManager.js +++ b/js/permission/PermissionManager.js @@ -294,9 +294,12 @@ class GrantedPermission { this.value = value; } granted(requiredValue, required = true) { + let result = false; if (this.value == -2) - return !required; - return this.value == -1 || this.value > requiredValue; + result = !required; + result = this.value == -1 || this.value >= requiredValue; + log.trace(LogCategory.PERMISSIONS, "Test needed required: %o | %i | %o => " + result, this, requiredValue, required); + return result; } hasValue() { return this.value != -2; @@ -312,41 +315,78 @@ class PermissionManager { constructor(client) { this.permissionList = []; this.neededPermissions = []; + this.initializedListener = []; this.handle = client; this.handle.serverConnection.commandHandler["notifyclientneededpermissions"] = this.onNeededPermissions.bind(this); this.handle.serverConnection.commandHandler["notifypermissionlist"] = this.onPermissionList.bind(this); } + initialized() { + return this.permissionList.length > 0; + } requestPermissionList() { this.handle.serverConnection.sendCommand("permissionlist"); } onPermissionList(json) { this.permissionList = []; - for (let e in json) { + let group = log.group(log.LogType.TRACE, LogCategory.PERMISSIONS, "Permission mapping"); + for (let e of json) { if (e["group_id_end"]) continue; //Skip all group ids (may use later?) let perm = new PermissionInfo(); perm.name = e["permname"]; - perm.id = e["permid"]; + perm.id = parseInt(e["permid"]); perm.description = e["permdesc"]; + group.log("%i <> %s -> %s", perm.id, perm.name, perm.description); this.permissionList.push(perm); } - console.log("Got " + this.permissionList.length + " permissions"); + group.end(); + log.info(LogCategory.PERMISSIONS, "Got %i permissions", this.permissionList.length); + if (this._cacheNeededPermissions) + this.onNeededPermissions(this._cacheNeededPermissions); + for (let listener of this.initializedListener) + listener(true); } onNeededPermissions(json) { - let copy = this.neededPermissions; - console.debug("[Permissions] Got " + json.length + " needed permissions."); - for (let e in json) { - for (let p of copy) - if (p.type.id == e["permid"]) { - copy.remove(p); - p.value = e["permvalue"]; - for (let listener of p.changeListener) - listener(p.value); - } + if (this.permissionList.length == 0) { + log.warn(LogCategory.PERMISSIONS, "Got needed permissions but don't have a permission list!"); + this._cacheNeededPermissions = json; + return; } - console.debug("[Permissions] Dropping " + copy.length + " needed permissions"); + this._cacheNeededPermissions = undefined; + let copy = this.neededPermissions.slice(); + let addcount = 0; + let group = log.group(log.LogType.TRACE, LogCategory.PERMISSIONS, "Got " + json.length + " needed permissions."); + for (let e of json) { + let entry = undefined; + for (let p of copy) { + if (p.type.id == e["permid"]) { + entry = p; + copy.remove(p); + break; + } + } + if (!entry) { + let info = this.resolveInfo(e["permid"]); + if (info) { + entry = new NeededGrantedPermission(info, -2); + this.neededPermissions.push(entry); + } + else { + log.warn(LogCategory.PERMISSIONS, "Could not resolve perm for id %s (%o|%o)", e["permid"], e, info); + continue; + } + addcount++; + } + if (entry.value == parseInt(e["permvalue"])) + continue; + entry.value = parseInt(e["permvalue"]); + group.log("Update needed permission " + entry.type.name + " to " + entry.value); + for (let listener of entry.changeListener) + listener(entry.value); + } + group.end(); + log.debug(LogCategory.PERMISSIONS, "Dropping " + copy.length + " needed permissions and added " + addcount + " permissions."); for (let e of copy) { - this.neededPermissions.remove(e); e.value = -2; for (let listener of e.changeListener) listener(e.value); @@ -362,7 +402,15 @@ class PermissionManager { for (let perm of this.neededPermissions) if (perm.type.id == key || perm.type.name == key || perm.type == key) return perm; - return new GrantedPermission(key instanceof PermissionInfo ? key : this.resolveInfo(key), -2); + log.debug(LogCategory.PERMISSIONS, "Could not resolve grant permission %o. Creating a new one.", key); + let info = key instanceof PermissionInfo ? key : this.resolveInfo(key); + if (!info) { + log.warn(LogCategory.PERMISSIONS, "Requested needed permission with invalid key! (%o)", key); + return undefined; + } + let result = new NeededGrantedPermission(info, -2); + this.neededPermissions.push(result); + return result; } } //# sourceMappingURL=PermissionManager.js.map \ No newline at end of file diff --git a/js/permission/PermissionManager.js.map b/js/permission/PermissionManager.js.map index 96af0048..0b9b85ae 100644 --- a/js/permission/PermissionManager.js.map +++ b/js/permission/PermissionManager.js.map @@ -1 +1 @@ -{"version":3,"file":"PermissionManager.js","sourceRoot":"","sources":["PermissionManager.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,IAAK,cA6RJ;AA7RD,WAAK,cAAc;IACf,2EAAyD,CAAA;IACzD,iFAA+D,CAAA;IAC/D,2EAAyD,CAAA;IACzD,6FAA2E,CAAA;IAC3E,iFAA+D,CAAA;IAC/D,uFAAqE,CAAA;IACrE,uFAAqE,CAAA;IACrE,mEAAiD,CAAA;IACjD,mEAAiD,CAAA;IACjD,yEAAuD,CAAA;IACvD,uEAAqD,CAAA;IACrD,yFAAuE,CAAA;IACvE,qFAAmE,CAAA;IACnE,6DAA2C,CAAA;IAC3C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AC;YAChC,EAAE,CAAA,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC;gBAClC,MAAM,CAAC,IAAI,CAAC;QACpB,MAAM,CAAC,SAAS,CAAC;IACrB,CAAC;IAED,gBAAgB,CAAC,GAAsD;QACnE,GAAG,CAAA,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC;YACnC,EAAE,CAAA,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC,IAAI,IAAI,GAAG,CAAC;gBAChE,MAAM,CAAC,IAAI,CAAC;QACpB,MAAM,CAAC,IAAI,iBAAiB,CAAC,GAAG,YAAY,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAClG,CAAC;CACJ"} \ No newline at end of file +{"version":3,"file":"PermissionManager.js","sourceRoot":"","sources":["PermissionManager.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,IAAK,cA6RJ;AA7RD,WAAK,cAAc;IACf,2EAAyD,CAAA;IACzD,iFAA+D,CAAA;IAC/D,2EAAyD,CAAA;IACzD,6FAA2E,CAAA;IAC3E,iFAA+D,CAAA;IAC/D,uFAAqE,CAAA;IACrE,uFAAqE,CAAA;IACrE,mEAAiD,CAAA;IACjD,mEAAiD,CAAA;IACjD,yEAAuD,CAAA;IACvD,uEAAqD,CAAA;IACrD,yFAAuE,CAAA;IACvE,qFAAmE,CAAA;IACnE,6DAA2C,CAAA;IAC3C,yFAAuE,CAAA;IACvE,yEAAuD,CAAA;IACvD,uEAAqD,CAAA;IACrD,iEAA+C,CAAA;IAC/C,uFAAqE,CAAA;IACrE,2FAAyE,CAAA;IACzE,yFAAuE,CAAA;IACvE,mEAAiD,CAAA;IACjD,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IAAI,GAAG,CAAC;gBAChE,MAAM,CAAC,IAAI,CAAC;QACpB,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,WAAW,EAAE,4DAA4D,EAAE,GAAG,CAAC,CAAC;QACtG,IAAI,IAAI,GAAG,GAAG,YAAY,cAAc,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;QACvE,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;YACP,GAAG,CAAC,IAAI,CAAC,WAAW,CAAC,WAAW,EAAE,oDAAoD,EAAE,GAAG,CAAC,CAAC;YAC7F,MAAM,CAAC,SAAS,CAAC;QACrB,CAAC;QACD,IAAI,MAAM,GAAG,IAAI,uBAAuB,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QACnD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACpC,MAAM,CAAC,MAAM,CAAC;IAElB,CAAC;CACJ"} \ No newline at end of file diff --git a/js/permission/PermissionManager.ts b/js/permission/PermissionManager.ts index 1e0c500b..383fda0b 100644 --- a/js/permission/PermissionManager.ts +++ b/js/permission/PermissionManager.ts @@ -303,9 +303,12 @@ class GrantedPermission { } granted(requiredValue: number, required: boolean = true) : boolean { + let result = false; if(this.value == -2) - return !required; - return this.value == -1 || this.value > requiredValue; + result = !required; + result = this.value == -1 || this.value >= requiredValue; + log.trace(LogCategory.PERMISSIONS, "Test needed required: %o | %i | %o => " + result , this, requiredValue, required); + return result; } hasValue() : boolean { @@ -327,6 +330,9 @@ class PermissionManager { permissionList: PermissionInfo[] = []; neededPermissions: NeededGrantedPermission[] = []; + initializedListener: ((initialized: boolean) => void)[] = []; + private _cacheNeededPermissions: any; + constructor(client: TSClient) { this.handle = client; @@ -334,44 +340,81 @@ class PermissionManager { this.handle.serverConnection.commandHandler["notifypermissionlist"] = this.onPermissionList.bind(this); } + initialized() : boolean { + return this.permissionList.length > 0; + } + public requestPermissionList() { this.handle.serverConnection.sendCommand("permissionlist"); } private onPermissionList(json) { this.permissionList = []; - for(let e in json) { + + let group = log.group(log.LogType.TRACE, LogCategory.PERMISSIONS, "Permission mapping"); + for(let e of json) { if(e["group_id_end"]) continue; //Skip all group ids (may use later?) let perm = new PermissionInfo(); perm.name = e["permname"]; - perm.id = e["permid"]; + perm.id = parseInt(e["permid"]); perm.description = e["permdesc"]; + group.log("%i <> %s -> %s", perm.id, perm.name, perm.description); this.permissionList.push(perm); } + group.end(); - console.log("Got " + this.permissionList.length + " permissions"); + log.info(LogCategory.PERMISSIONS, "Got %i permissions", this.permissionList.length); + if(this._cacheNeededPermissions) + this.onNeededPermissions(this._cacheNeededPermissions); + for(let listener of this.initializedListener) + listener(true); } private onNeededPermissions(json) { - let copy = this.neededPermissions; - - console.debug("[Permissions] Got " + json.length + " needed permissions."); - for(let e in json) { - for(let p of copy) - if(p.type.id == e["permid"]) { - copy.remove(p); - p.value = e["permvalue"]; - for(let listener of p.changeListener) - listener(p.value); - } + if(this.permissionList.length == 0) { + log.warn(LogCategory.PERMISSIONS, "Got needed permissions but don't have a permission list!"); + this._cacheNeededPermissions = json; + return; } + this._cacheNeededPermissions = undefined; - console.debug("[Permissions] Dropping " + copy.length + " needed permissions"); + let copy = this.neededPermissions.slice(); + let addcount = 0; + + let group = log.group(log.LogType.TRACE, LogCategory.PERMISSIONS, "Got " + json.length + " needed permissions."); + for(let e of json) { + let entry: NeededGrantedPermission = undefined; + for(let p of copy) { + if(p.type.id == e["permid"]) { + entry = p; + copy.remove(p); + break; + } + } + if(!entry) { + let info = this.resolveInfo(e["permid"]); + if(info) { + entry = new NeededGrantedPermission(info, -2); + this.neededPermissions.push(entry); + } else { + log.warn(LogCategory.PERMISSIONS, "Could not resolve perm for id %s (%o|%o)", e["permid"], e, info); + continue; + } + addcount++; + } + + if(entry.value == parseInt(e["permvalue"])) continue; + entry.value = parseInt(e["permvalue"]); + group.log("Update needed permission " + entry.type.name + " to " + entry.value); + for(let listener of entry.changeListener) + listener(entry.value); + } + group.end(); + + log.debug(LogCategory.PERMISSIONS, "Dropping " + copy.length + " needed permissions and added " + addcount + " permissions."); for(let e of copy) { - this.neededPermissions.remove(e); e.value = -2; - for(let listener of e.changeListener) listener(e.value); } @@ -388,6 +431,15 @@ class PermissionManager { for(let perm of this.neededPermissions) if(perm.type.id == key || perm.type.name == key || perm.type == key) return perm; - return new GrantedPermission(key instanceof PermissionInfo ? key : this.resolveInfo(key), -2); + log.debug(LogCategory.PERMISSIONS, "Could not resolve grant permission %o. Creating a new one.", key); + let info = key instanceof PermissionInfo ? key : this.resolveInfo(key); + if(!info) { + log.warn(LogCategory.PERMISSIONS, "Requested needed permission with invalid key! (%o)", key); + return undefined; + } + let result = new NeededGrantedPermission(info, -2); + this.neededPermissions.push(result); + return result; + } } \ No newline at end of file diff --git a/js/proto.js.map b/js/proto.js.map index a5b4296f..6b643858 100644 --- a/js/proto.js.map +++ b/js/proto.js.map @@ -1 +1 @@ -{"version":3,"file":"proto.js","sourceRoot":"","sources":["proto.ts"],"names":[],"mappings":"AAsBA,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1B,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,UAAY,IAAQ;QACzC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;QACpC,EAAE,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACb,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;YACtB,MAAM,CAAC,IAAI,CAAC;QAChB,CAAC;QACD,MAAM,CAAC,KAAK,CAAC;IACjB,CAAC,CAAA;AACL,CAAC;AAED,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC;IAC7B,KAAK,CAAC,SAAS,CAAC,S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K,GAAG,CAAC,IAAI,IAAI,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC;QAChE,MAAM,IAAI,OAAO,GAAG,WAAW,CAAC;IACpC,IAAI;QACA,MAAM,GAAG,MAAM,CAAC;IAEpB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;AAC/C,CAAC"} \ No newline at end of file diff --git a/js/proto.ts b/js/proto.ts index 76f565d2..65300962 100644 --- a/js/proto.ts +++ b/js/proto.ts @@ -13,8 +13,6 @@ interface JQueryStatic { spawn(tagName: K): JQuery; } - - interface String { format(...fmt): string; format(arguments: string[]): string; @@ -38,6 +36,7 @@ if (!Array.prototype.pop_front) { } } + if (!Array.prototype.last){ Array.prototype.last = function(){ if(this.length == 0) return undefined; diff --git a/js/settings.js b/js/settings.js index 29606e7b..6e1380ce 100644 --- a/js/settings.js +++ b/js/settings.js @@ -1,16 +1,17 @@ /// -class X_Properties extends HTMLElement { +if (typeof (customElements) !== "undefined") { + class X_Properties extends HTMLElement { + } + class X_Property extends HTMLElement { + } + customElements.define('x-properties', X_Properties, { extends: 'div' }); + customElements.define('x-property', X_Property, { extends: 'div' }); } -class X_Property extends HTMLElement { -} -customElements.define('x-properties', X_Properties, { extends: 'div' }); -customElements.define('x-property', X_Property, { extends: 'div' }); class Settings { - constructor(handle) { + constructor() { this.cacheGlobal = {}; this.cacheServer = {}; this.updated = false; - this.handle = handle; this._staticPropsTag = $("#properties"); this.cacheGlobal = JSON.parse(localStorage.getItem("settings.global")); if (!this.cacheGlobal) @@ -20,20 +21,56 @@ class Settings { if (_this.updated) _this.save(); }, 5 * 1000); + this.initializeStatic(); + } + initializeStatic() { + location.search.substr(1).split("&").forEach(part => { + let item = part.split("="); + $.spawn("div") + .attr("key", item[0]) + .attr("value", item[1]) + .appendTo(this._staticPropsTag); + }); + } + static transformStO(input, _default) { + if (typeof _default === "string") + return input; + else if (typeof _default === "number") + return parseInt(input); + else if (typeof _default === "boolean") + return (input == "1" || input == "true"); + else if (typeof _default == "undefined") + return input; + return JSON.parse(input); + } + static transformOtS(input) { + if (typeof input === "string") + return input; + else if (typeof input === "number") + return input.toString(); + else if (typeof input === "boolean") + return input ? "1" : "0"; + else if (typeof input == "undefined") + return undefined; + return JSON.stringify(input); } global(key, _default) { let result = this.cacheGlobal[key]; - return result ? result : _default; + return Settings.transformStO(result, _default); } server(key, _default) { let result = this.cacheServer[key]; - return result ? result : _default; + return Settings.transformStO(result, _default); + } + static(key, _default) { + let result = this._staticPropsTag.find("[key='" + key + "']"); + return Settings.transformStO(result.length > 0 ? decodeURIComponent(result.attr("value")) : undefined, _default); } changeGlobal(key, value) { if (this.cacheGlobal[key] == value) return; this.updated = true; - this.cacheGlobal[key] = value; + this.cacheGlobal[key] = Settings.transformOtS(value); if (Settings.UPDATE_DIRECT) this.save(); } @@ -41,42 +78,41 @@ class Settings { if (this.cacheServer[key] == value) return; this.updated = true; - this.cacheServer[key] = value; + this.cacheServer[key] = Settings.transformOtS(value); if (Settings.UPDATE_DIRECT) this.save(); } - loadServer() { - if (!this.handle.channelTree.server) { + setServer(server) { + if (this.currentServer) { + this.save(); this.cacheServer = {}; - console.warn("[Settings] tried to load settings for unknown server"); - return; + this.currentServer = undefined; + } + this.currentServer = server; + if (this.currentServer) { + let serverId = this.currentServer.properties.virtualserver_unique_identifier; + this.cacheServer = JSON.parse(localStorage.getItem("settings.server_" + serverId)); + if (!this.cacheServer) + this.cacheServer = {}; } - let serverId = this.handle.channelTree.server.properties.virtualserver_unique_identifier; - this.cacheServer = JSON.parse(localStorage.getItem("settings.server_" + serverId)); - if (!this.cacheServer) - this.cacheServer = {}; } save() { this.updated = false; - if (this.handle.channelTree.server) { - let serverId = this.handle.channelTree.server.properties.virtualserver_unique_identifier; + if (this.currentServer) { + let serverId = this.currentServer.properties.virtualserver_unique_identifier; let server = JSON.stringify(this.cacheServer); localStorage.setItem("settings.server_" + serverId, server); } let global = JSON.stringify(this.cacheGlobal); localStorage.setItem("settings.global", global); } - static(key, _default = undefined) { - let result = this._staticPropsTag.find("[key='" + key + "']"); - if (result.length == 0) - return _default; - return decodeURIComponent(result.attr("value")); - } deleteStatic(key) { let result = this._staticPropsTag.find("[key='" + key + "']"); if (result.length != 0) result.detach(); } } +Settings.KEY_DISABLE_CONTEXT_MENU = "disableContextMenu"; +Settings.KEY_DISABLE_UNLOAD_DIALOG = "disableUnloadDialog"; Settings.UPDATE_DIRECT = true; //# sourceMappingURL=settings.js.map \ No newline at end of file diff --git a/js/settings.js.map b/js/settings.js.map index 0adb74f8..eba28b79 100644 --- a/js/settings.js.map +++ b/js/settings.js.map @@ -1 +1 @@ -{"version":3,"file":"settings.js","sourceRoot":"","sources":["settings.ts"],"names":[],"mappings":"AAAA,kCAAkC;AAElC,kBAAmB,SAAQ,WAAW;CAAG;AACzC,gBAAiB,SAAQ,WAAW;CAAG;AAEvC,cAAc,CAAC,MAAM,CAAC,cAAc,EAAE,YAAY,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AACxE,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,UAAU,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;AAEpE;IAUI,YAAY,MAAgB;QANpB,gBAAW,GAAG,EAAE,CAAC;QACjB,gBAAW,GAAG,EAAE,CAAC;QAEjB,YAAO,GAAY,KAAK,CAAC;QAI7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,eAAe,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC;QAExC,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,iBAAiB,CAAC,CAAC,CAAC;QACvE,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC;YAAC,IAAI,CAAC,WAAW,GAAG,EAA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/settings.ts b/js/settings.ts index a773afa3..a7369953 100644 --- a/js/settings.ts +++ b/js/settings.ts @@ -1,23 +1,26 @@ /// -class X_Properties extends HTMLElement {} -class X_Property extends HTMLElement {} +if(typeof(customElements) !== "undefined") { + class X_Properties extends HTMLElement {} + class X_Property extends HTMLElement {} -customElements.define('x-properties', X_Properties, { extends: 'div' }); -customElements.define('x-property', X_Property, { extends: 'div' }); + customElements.define('x-properties', X_Properties, { extends: 'div' }); + customElements.define('x-property', X_Property, { extends: 'div' }); +} class Settings { - handle: TSClient; + static readonly KEY_DISABLE_CONTEXT_MENU = "disableContextMenu"; + static readonly KEY_DISABLE_UNLOAD_DIALOG = "disableUnloadDialog"; private static readonly UPDATE_DIRECT: boolean = true; private cacheGlobal = {}; private cacheServer = {}; + private currentServer: ServerEntry; private saveWorker: NodeJS.Timer; private updated: boolean = false; private _staticPropsTag: JQuery; - constructor(handle: TSClient) { - this.handle = handle; + constructor() { this._staticPropsTag = $("#properties"); this.cacheGlobal = JSON.parse(localStorage.getItem("settings.global")); @@ -27,55 +30,93 @@ class Settings { if(_this.updated) _this.save(); }, 5 * 1000); + + this.initializeStatic(); } - global?(key: string, _default?: string) : string { + private initializeStatic() { + location.search.substr(1).split("&").forEach(part => { + let item = part.split("="); + $.spawn("div") + .attr("key", item[0]) + .attr("value", item[1]) + .appendTo(this._staticPropsTag); + }); + } + + private static transformStO?(input: string, _default?: T) : T { + if (typeof _default === "string") return input as any; + else if (typeof _default === "number") return parseInt(input) as any; + else if (typeof _default === "boolean") return (input == "1" || input == "true") as any; + else if (typeof _default == "undefined") return input as any; + return JSON.parse(input) as any; + } + + private static transformOtS?(input: T) : string { + if (typeof input === "string") return input as string; + else if (typeof input === "number") return input.toString(); + else if (typeof input === "boolean") return input ? "1" : "0"; + else if (typeof input == "undefined") return undefined; + return JSON.stringify(input); + } + + global?(key: string, _default?: T) : T { let result = this.cacheGlobal[key]; - return result ? result : _default; + return Settings.transformStO(result, _default); } - server?(key: string, _default?: string) : string { + server?(key: string, _default?: T) : T { let result = this.cacheServer[key]; - return result ? result : _default; + return Settings.transformStO(result, _default); } - changeGlobal(key: string, value?: string){ + static?(key: string, _default?: T) : T { + let result = this._staticPropsTag.find("[key='" + key + "']"); + return Settings.transformStO(result.length > 0 ? decodeURIComponent(result.attr("value")) : undefined, _default); + } + + + changeGlobal(key: string, value?: T){ if(this.cacheGlobal[key] == value) return; this.updated = true; - this.cacheGlobal[key] = value; + this.cacheGlobal[key] = Settings.transformOtS(value); if(Settings.UPDATE_DIRECT) this.save(); } - changeServer(key: string, value?: string) { + changeServer(key: string, value?: T) { if(this.cacheServer[key] == value) return; this.updated = true; - this.cacheServer[key] = value; + this.cacheServer[key] = Settings.transformOtS(value); if(Settings.UPDATE_DIRECT) this.save(); } - loadServer() { - if(!this.handle.channelTree.server) { + setServer(server: ServerEntry) { + if(this.currentServer) { + this.save(); this.cacheServer = {}; - console.warn("[Settings] tried to load settings for unknown server"); - return; + this.currentServer = undefined; + } + this.currentServer = server; + + if(this.currentServer) { + let serverId = this.currentServer.properties.virtualserver_unique_identifier; + this.cacheServer = JSON.parse(localStorage.getItem("settings.server_" + serverId)); + if(!this.cacheServer) + this.cacheServer = {}; } - let serverId = this.handle.channelTree.server.properties.virtualserver_unique_identifier; - this.cacheServer = JSON.parse(localStorage.getItem("settings.server_" + serverId)); - if(!this.cacheServer) - this.cacheServer = {}; } save() { this.updated = false; - if(this.handle.channelTree.server) { - let serverId = this.handle.channelTree.server.properties.virtualserver_unique_identifier; + if(this.currentServer) { + let serverId = this.currentServer.properties.virtualserver_unique_identifier; let server = JSON.stringify(this.cacheServer); localStorage.setItem("settings.server_" + serverId, server); } @@ -84,12 +125,6 @@ class Settings { localStorage.setItem("settings.global", global); } - static?(key: string, _default: string = undefined) : string { - let result = this._staticPropsTag.find("[key='" + key + "']"); - if(result.length == 0) return _default; - return decodeURIComponent(result.attr("value")); - } - deleteStatic(key: string) { let result = this._staticPropsTag.find("[key='" + key + "']"); if(result.length != 0) result.detach(); diff --git a/js/ui/ControlBar.js b/js/ui/ControlBar.js index 4ce37af7..3f33a23b 100644 --- a/js/ui/ControlBar.js +++ b/js/ui/ControlBar.js @@ -23,8 +23,8 @@ class ControlBar { this.htmlTag.find(".btn_mute_output").click(this.onOutputMute.bind(this)); this.htmlTag.find(".btn_open_settings").click(this.onOpenSettings.bind(this)); //Need an initialise - this.muteInput = this.handle.settings.global("mute_input") == "1"; - this.muteOutput = this.handle.settings.global("mute_output") == "1"; + this.muteInput = settings.global("mute_input") == "1"; + this.muteOutput = settings.global("mute_output") == "1"; } onAway() { this.away = !this._away; @@ -52,9 +52,9 @@ class ControlBar { } if (this.handle.serverConnection.connected) this.handle.serverConnection.sendCommand("clientupdate", { - client_input_muted: this._muteInput ? 1 : 0 + client_input_muted: this._muteInput }); - this.handle.settings.changeGlobal("mute_input", this._muteInput ? "1" : "0"); + settings.changeGlobal("mute_input", this._muteInput); this.updateMicrophoneRecordState(); } get muteOutput() { return this._muteOutput; } @@ -75,9 +75,9 @@ class ControlBar { } if (this.handle.serverConnection.connected) this.handle.serverConnection.sendCommand("clientupdate", { - client_output_muted: this._muteOutput ? 1 : 0 + client_output_muted: this._muteOutput }); - this.handle.settings.changeGlobal("mute_output", this._muteOutput ? "1" : "0"); + settings.changeGlobal("mute_output", this._muteOutput); this.updateMicrophoneRecordState(); } set away(value) { @@ -102,7 +102,7 @@ class ControlBar { } if (this.handle.serverConnection.connected) this.handle.serverConnection.sendCommand("clientupdate", { - client_away: this._away ? 1 : 0, + client_away: this._away, client_away_message: this._awayMessage }); this.updateMicrophoneRecordState(); @@ -114,9 +114,9 @@ class ControlBar { updateProperties() { if (this.handle.serverConnection.connected) this.handle.serverConnection.sendCommand("clientupdate", { - client_input_muted: this._muteInput ? 1 : 0, - client_output_muted: this._muteOutput ? 1 : 0, - client_away: this._away ? 1 : 0, + client_input_muted: this._muteInput, + client_output_muted: this._muteOutput, + client_away: this._away, client_away_message: this._awayMessage, }); } @@ -124,7 +124,7 @@ class ControlBar { Modals.spawnSettingsModal(); } onConnect() { - Modals.spawnConnectModal(this.handle.settings.static("connect_default_host")); + Modals.spawnConnectModal(settings.static("connect_default_host", "ts.TeaSpeak.de")); } } //# sourceMappingURL=ControlBar.js.map \ No newline at end of file diff --git a/js/ui/ControlBar.js.map b/js/ui/ControlBar.js.map index 5df4ad89..1ef014ee 100644 --- a/js/ui/ControlBar.js.map +++ b/js/ui/ControlBar.js.map @@ -1 +1 @@ -{"version":3,"file":"ControlBar.js","sourceRoot":"","sources":["ControlBar.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,+CAA+C;AAC/C;;;;;;;;;;GAUG;AACH;IASI,YAAY,MAAgB,EAAE,OAAe;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IAC3B,CAAC;IAED,UAAU;QACN,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QACxE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC1E,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAG9E,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U,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC;QACnE,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC9D,CAAC;IAED,gBAAgB;QACZ,EAAE,CAAA,CAAC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,SAAS,CAAC;YACtC,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,cAAc,EAAE;gBACrD,kBAAkB,EAAE,IAAI,CAAC,UAAU;gBACnC,mBAAmB,EAAE,IAAI,CAAC,WAAW;gBACrC,WAAW,EAAE,IAAI,CAAC,KAAK;gBACvB,mBAAmB,EAAE,IAAI,CAAC,YAAY;aACzC,CAAC,CAAC;IACX,CAAC;IAEO,cAAc;QAClB,MAAM,CAAC,kBAAkB,EAAE,CAAC;IAChC,CAAC;IAEO,SAAS;QACb,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,sBAAsB,EAAE,gBAAgB,CAAC,CAAC,CAAC;IACxF,CAAC;CACJ"} \ No newline at end of file diff --git a/js/ui/ControlBar.ts b/js/ui/ControlBar.ts index cac65cca..f5cbfa84 100644 --- a/js/ui/ControlBar.ts +++ b/js/ui/ControlBar.ts @@ -34,8 +34,8 @@ class ControlBar { //Need an initialise - this.muteInput = this.handle.settings.global("mute_input") == "1"; - this.muteOutput = this.handle.settings.global("mute_output") == "1"; + this.muteInput = settings.global("mute_input") == "1"; + this.muteOutput = settings.global("mute_output") == "1"; } @@ -69,9 +69,9 @@ class ControlBar { if(this.handle.serverConnection.connected) this.handle.serverConnection.sendCommand("clientupdate", { - client_input_muted: this._muteInput ? 1 : 0 + client_input_muted: this._muteInput }); - this.handle.settings.changeGlobal("mute_input", this._muteInput ? "1" : "0"); + settings.changeGlobal("mute_input", this._muteInput); this.updateMicrophoneRecordState(); } @@ -94,9 +94,9 @@ class ControlBar { if(this.handle.serverConnection.connected) this.handle.serverConnection.sendCommand("clientupdate", { - client_output_muted: this._muteOutput ? 1 : 0 + client_output_muted: this._muteOutput }); - this.handle.settings.changeGlobal("mute_output", this._muteOutput ? "1" : "0"); + settings.changeGlobal("mute_output", this._muteOutput); this.updateMicrophoneRecordState(); } @@ -121,7 +121,7 @@ class ControlBar { if(this.handle.serverConnection.connected) this.handle.serverConnection.sendCommand("clientupdate", { - client_away: this._away ? 1 : 0, + client_away: this._away, client_away_message: this._awayMessage }); this.updateMicrophoneRecordState(); @@ -135,9 +135,9 @@ class ControlBar { updateProperties() { if(this.handle.serverConnection.connected) this.handle.serverConnection.sendCommand("clientupdate", { - client_input_muted: this._muteInput ? 1 : 0, - client_output_muted: this._muteOutput ? 1 : 0, - client_away: this._away ? 1 : 0, + client_input_muted: this._muteInput, + client_output_muted: this._muteOutput, + client_away: this._away, client_away_message: this._awayMessage, }); } @@ -147,6 +147,6 @@ class ControlBar { } private onConnect() { - Modals.spawnConnectModal(this.handle.settings.static("connect_default_host")); + Modals.spawnConnectModal(settings.static("connect_default_host", "ts.TeaSpeak.de")); } } \ No newline at end of file diff --git a/js/ui/channel.js b/js/ui/channel.js index 8d057fe5..7bce3c89 100644 --- a/js/ui/channel.js +++ b/js/ui/channel.js @@ -1,4 +1,5 @@ /// +/// var ChannelType; (function (ChannelType) { ChannelType[ChannelType["PERMANENT"] = 0] = "PERMANENT"; @@ -13,29 +14,45 @@ var ChannelType; } ChannelType.normalize = normalize; })(ChannelType || (ChannelType = {})); +class ChannelProperties { + constructor() { + this.channel_order = 0; + this.channel_name = ""; + this.channel_topic = ""; + this.channel_password = ""; + this.channel_description = ""; + this.channel_codec = 4; + this.channel_codec_quality = 0; + this.channel_codec_is_unencrypted = false; + this.channel_maxclients = -1; + this.channel_maxfamilyclients = -1; + this.channel_needed_talk_power = 1; + this.channel_flag_permanent = false; + this.channel_flag_semi_permanent = false; + this.channel_flag_default = false; + this.channel_flag_password = false; + this.channel_flag_maxclients_unlimited = false; + this.channel_flag_maxfamilyclients_inherited = false; + this.channel_flag_maxfamilyclients_unlimited = false; + } +} class ChannelEntry { constructor(channelId, channelName, parent = null, prevChannel = null) { - this.properties = { - channel_order: 0, - channel_name: "undefined", - channel_flag_permanent: 0, - channel_flag_semi_permanent: 0, - channel_flag_default: 0, - channel_flag_password: 0 - }; - this.properties = {}; + this.properties = new ChannelProperties(); + this.properties = new ChannelProperties(); this.channelId = channelId; - this._rawChannelName = channelName; + this._formatedChannelName = channelName; this.parent = parent; this.prevChannel = prevChannel; this.channelTree = null; - this.__updateChannelPropertiesFromName(); + this.initializeTag(); + this.__updateChannelName(); } channelName() { - return this.properties["channel_name"]; + return this.properties.channel_name; } - rawChannelName() { - return this._rawChannelName; + formatedChannelName() { + return this._formatedChannelName ? this._formatedChannelName : this.properties.channel_name; } parentChannel() { return this.parent; } hasParent() { return this.parent != null; } @@ -83,37 +100,73 @@ class ChannelEntry { }); return result; } - get htmlTag() { - if (this._htmlTag) - return this._htmlTag; - let tag = $.spawn("div"); - tag.attr("id", "channel_" + this.getChannelId()); - tag.addClass("channel"); - tag.append("
"); - let channelTag = $("
"); - channelTag.addClass("channelLine"); - channelTag.addClass(this._channelAlign); //For left - let channelType = $("
"); - channelType.addClass("channel_only_normal channel_type"); - channelType.addClass("icon"); - channelType.addClass("client-channel_green_subscribed"); - channelTag.append(channelType); - channelTag.append("" + this.channelName() + ""); - let channelIcon = $(""); - channelTag.append(channelIcon); - tag.append("
"); - tag.append("
"); - tag.append(channelTag); - return this._htmlTag = tag; + initializeTag() { + let rootTag = $.spawn("div"); + rootTag.attr("id", "channel_" + this.getChannelId()); + rootTag.addClass("channel"); + //rootTag.append($.spawn("div").addClass("icon_empty")); + //Tag channel + this._tag_channel = $.spawn("div"); + this._tag_channel.addClass("channelLine"); + this._tag_channel.addClass(this._channelAlign); //For left + let channelType = $.spawn("div"); + channelType.addClass("channel_only_normal channel_type icon client-channel_green_subscribed"); + this._tag_channel.append(channelType); + this._tag_channel.append($.spawn("div").addClass("channel_name_container").append($.spawn("a").addClass("channel_name").text(this.channelName()))); + //Icons + let iconTag = $.spawn("span").addClass("icons"); + iconTag.appendTo(this._tag_channel); + //Default icon (4) + iconTag.append($.spawn("div").addClass("channel_only_normal").append($.spawn("div").addClass("icon_entry icon_default icon client-channel_default").attr("title", "Default channel"))); + //Password icon (3) + iconTag.append($.spawn("div").addClass("channel_only_normal").append($.spawn("div").addClass("icon_entry icon_password icon client-register").attr("title", "The channel is password protected"))); + //Music icon (2) + iconTag.append($.spawn("div").addClass("channel_only_normal").append($.spawn("div").addClass("icon_entry icon_music icon client-music").attr("title", "Music quality"))); + //Channel Icon (1) + iconTag.append($.spawn("div").addClass("channel_only_normal").addClass("icon_entry channel_icon").attr("title", "Channel icon")); + //Default no sound (0) + let container = $.spawn("div"); + let noSound = $.spawn("div").addClass("icon_entry icon_no_sound icon client-conflict-icon").attr("title", "You don't support the channel codec"); + let bg = $.spawn("div") + .width(10) + .height(14) + .css("background", "red") + .css("position", "absolute") + .css("top", "1px") + .css("left", "3px"); + bg.appendTo(container); + noSound.appendTo(container); + iconTag.append(container); + /* + setInterval(() => { + let color = (Math.random() * 10000000).toString(16).substr(0, 6); + bg.css("background", "#" + color); + }, 150); + */ + //Build siblings + this._tag_siblings = $.spawn("div").addClass("siblings"); + let tag_siblings_box = $.spawn("div").css("position", "absolute").css("width", "calc(100% - 16px)").css("margin", "0px"); + this._tag_siblings.appendTo(tag_siblings_box); + //Build clients + this._tag_clients = $.spawn("div").addClass("clients"); + let tag_clients_box = $.spawn("div").css("position", "absolute").css("width", "calc(100% - 16px)").css("margin", "0px"); + this._tag_clients.appendTo(tag_clients_box); + this._tag_root = rootTag; + tag_clients_box.appendTo(this._tag_root); + tag_siblings_box.appendTo(this._tag_root); + this._tag_channel.appendTo(this._tag_root); } - get channelTag() { - return this.htmlTag.find(".channelLine").last(); + rootTag() { + return this._tag_root; + } + channelTag() { + return this._tag_channel; } siblingTag() { - return this.htmlTag.find(".siblings").first(); //Here the first because first comes the siblings tag than all other sibling comes + return this._tag_siblings; } clientTag() { - return this.htmlTag.find(".clients").last(); //Here last because from the sibling tag client tags could be before + return this._tag_clients; } adjustSize(parent = true) { const size = this.originalHeight; @@ -121,164 +174,207 @@ class ChannelEntry { let clientSize = 0; const sub = this.siblings(false); sub.forEach(function (e) { - subSize += e.htmlTag.outerHeight(true); + subSize += e.rootTag().outerHeight(true); }); const clients = this.clients(false); clients.forEach(function (e) { - clientSize += e.htmlTag.outerHeight(true); + clientSize += e.tag.outerHeight(true); }); - if (sub.length >= 1) - subSize -= 1; - if (clients.length >= 1) - clientSize -= 1; - this.htmlTag.css({ height: size + subSize + clientSize }); - this.siblingTag().css("margin-top", (clientSize + 16) + "px"); - this.clientTag().css({ height: clientSize }); + this._tag_root.css({ height: size + subSize + clientSize }); + this._tag_siblings.css("margin-top", (clientSize + 16) + "px"); + this._tag_clients.css({ height: clientSize }); if (parent && this.parentChannel()) this.parentChannel().adjustSize(parent); } initializeListener() { const _this = this; - this.channelTag.click(function () { + this.channelTag().click(function () { _this.channelTree.onSelect(_this); }); - this.channelTag.dblclick(function () { - _this.channelTree.client.serverConnection.joinChannel(_this); //TODO may ask for password - }); - this.channelTag.on("contextmenu", function (event) { - event.preventDefault(); - _this.channelTree.onSelect(_this); - _this.showContextMenu(event.pageX, event.pageY, () => { _this.channelTree.onSelect(undefined); }); - }); + this.channelTag().dblclick(() => this.joinChannel()); + if (!settings.static(Settings.KEY_DISABLE_CONTEXT_MENU, false)) { + this.channelTag().on("contextmenu", function (event) { + event.preventDefault(); + _this.channelTree.onSelect(_this); + _this.showContextMenu(event.pageX, event.pageY, () => { + _this.channelTree.onSelect(undefined); + }); + }); + } } showContextMenu(x, y, on_close = undefined) { - const _this = this; + let channelCreate = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_TEMPORARY).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_SEMI_PERMANENT).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_PERMANENT).granted(1); + let channelModify = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_DEFAULT).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_PERMANENT).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_SEMI_PERMANENT).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_TEMPORARY).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_NAME).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_TOPIC).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_DESCRIPTION).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_PASSWORD).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_CODEC).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_CODEC_QUALITY).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_CODEC_LATENCY_FACTOR).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAXCLIENTS).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAXFAMILYCLIENTS).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_SORTORDER).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_NEEDED_TALK_POWER).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_CODEC_ENCRYPTED).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_TEMP_DELETE_DELAY).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_ICON_MANAGE).granted(1); + let flagDelete = true; + if (this.clients(true).length > 0) + flagDelete = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_DELETE_FLAG_FORCE).granted(1); + if (flagDelete) { + if (this.properties.channel_flag_permanent) + flagDelete = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_DELETE_PERMANENT).granted(1); + else if (this.properties.channel_flag_semi_permanent) + flagDelete = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_DELETE_PERMANENT).granted(1); + else + flagDelete = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_DELETE_TEMPORARY).granted(1); + } spawnMenu(x, y, { type: MenuEntryType.ENTRY, icon: "client-channel_switch", name: "Switch to channel", callback: () => { - _this.channelTree.client.getServerConnection().joinChannel(_this); //TODO ask for password if required + this.joinChannel(); } + }, MenuEntry.HR(), { + type: MenuEntryType.ENTRY, + icon: "client-channel_edit", + name: "Edit channel", + invalidPermission: !channelModify, + callback: () => { + Modals.createChannelModal(this, undefined, (changes) => { + if (!changes) + return; + changes["cid"] = this.channelId; + log.info(LogCategory.CHANNEL, "Changed channel properties of channel %s: %o", this.channelName(), changes); + }); + } + }, { + type: MenuEntryType.ENTRY, + icon: "client-channel_delete", + name: "Delete channel", + invalidPermission: !flagDelete, + callback: () => this.channelTree.client.serverConnection.sendCommand("channeldelete", { cid: this.channelId }) }, MenuEntry.HR(), { type: MenuEntryType.ENTRY, icon: "client-channel_create_sub", name: "Create sub channel", - disabled: true, - callback: () => { - //TODO here - } + invalidPermission: !(channelCreate && this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_CHILD).granted(1)), + callback: () => this.channelTree.spawnCreateChannel(this) }, { type: MenuEntryType.ENTRY, icon: "client-channel_create", name: "Create channel", - disabled: true, - callback: () => { - //TODO here - } + invalidPermission: !channelCreate, + callback: () => this.channelTree.spawnCreateChannel() }, MenuEntry.CLOSE(on_close)); } - __updateChannelPropertiesFromName() { - parseType: if (this.parentChannel() == null && this._rawChannelName.charAt(0) == '[' && this._rawChannelName.indexOf(']') != -1) { - let typeData = this._rawChannelName.substr(1, this._rawChannelName.indexOf(']') - 1); - //console.log("Having spacer etc? -> " + typeData); - if (typeData.indexOf("spacer") == -1) + __updateChannelName() { + this._formatedChannelName = undefined; + parseType: if (this.parentChannel() == null && this.properties.channel_name.charAt(0) == '[') { + let end = this.properties.channel_name.indexOf(']'); + if (end == -1) break parseType; - let strAlign = typeData.substr(0, typeData.indexOf("spacer")); - if (strAlign.length > 0) { - if (strAlign.length != 1) { - if (strAlign.length != 2 || strAlign[0] != '*') - break parseType; - strAlign = strAlign.substr(1); - //TODO support repeating pattern! + let options = this.properties.channel_name.substr(1, end - 1); + if (options.indexOf("spacer") == -1) + break parseType; + options = options.substr(0, options.indexOf("spacer")); + console.log("Channel options: '" + options + "'"); + if (options.length == 0) + options = "l"; + else if (options.length > 1) + options = options[0]; + if (options == "r" || options == "l" || options == "c" || options == "*") + this._channelAlign = options; + else + break parseType; + this._formatedChannelName = this.properties.channel_name.substr(end + 1); + console.log("Got channel name: " + this._formatedChannelName); + } + let self = this.channelTag(); + let channelName = self.find(".channel_name"); + channelName.text(this.formatedChannelName()); + channelName.parent().removeClass("l r c *"); //Alignments + (this._formatedChannelName ? $.fn.hide : $.fn.show).apply(self.find(".channel_only_normal")); + if (this._formatedChannelName) { + channelName.parent().addClass(this._channelAlign); + if (this._channelAlign == "*") { + let lastSuccess = ""; + let index = 0; + do { + channelName.text((lastSuccess = channelName.text()) + this.formatedChannelName()); + console.log(channelName.parent().width() + " : " + channelName.width() + " : " + channelName.innerWidth() + " : " + channelName.outerWidth()); + } while (channelName.parent().width() >= channelName.width() && ++index < 255); + if (index == 255) + console.warn(LogCategory.CHANNEL, "Repeating spacer took too much repeats!"); + if (lastSuccess.length > 0) { + channelName.text(lastSuccess); + self.addClass("c"); } } - if (strAlign == "") - this._channelAlign = "l"; - else - this._channelAlign = strAlign; - var repeatData = typeData.substr(typeData.indexOf("spacer") + 6); - //console.log("Repeat data: " + repeatData); - this.properties["channel_name"] = this._rawChannelName.substr(this._rawChannelName.indexOf(']') + 1); } - if (this.properties.channel_name == undefined) { - this.properties.channel_name = this._rawChannelName; - this._channelAlign = "l"; - } - let self = this.channelTag; - if (this.properties.channel_name == this._rawChannelName) { - self.find(".channel_only_normal").show(); - } - else - self.find(".channel_only_normal").hide(); - self.find(".channel_name").text(this.channelName()); - self.removeClass("l r c"); //Alignments - self.addClass(this._channelAlign); console.log("Align: " + this._channelAlign); } - updateProperty(key, value) { - this.properties[key] = value; - console.debug("Updating channel " + this.channelId + ". Key: " + key + " Value: " + value); - if (key == "channel_name") { - this._rawChannelName = value; - this.properties.channel_name = undefined; - this.__updateChannelPropertiesFromName(); - } - else if (key == "channel_order") { - var order = this.channelTree.findChannel(value); - this.channelTree.moveChannel(this, order, this.parent); - } - else if (key == "channel_icon_id") { - let icons = this.channelTag.find("span"); - icons.find(".icon_property").detach(); - if (value > 0) { - let tag = this.channelTree.client.fileManager.icons.generateTag(value); - if (icons.children().length > 0) { - icons.children().last().after(tag); - } - else - icons.append(tag); - console.log("Channel icon: " + value); - } - } - else if (key == "channel_codec") { - this.displayMusicIcon = value == 5 || value == 3; - } - else if (key == "channel_flag_default") { - let icons = this.channelTag.find("span"); - icons.find(".icon_default").detach(); - if (value == "1") { - console.log("Default: '" + value + "'"); - let icon = $.spawn("div"); - icon.addClass("icon_default icon client-channel_default"); - icon.attr("title", "Default channel"); - if (icons.children().length > 0) { - icons.children().first().before(icon); - } - else - icons.append(icon); - } - } - } - set displayMusicIcon(flag) { - if (this._displayMusicIcon == flag) - return; - this._displayMusicIcon = flag; - let icons = this.channelTag.find("span"); - icons.find(".icon_music").detach(); - if (flag) { - let icon = $("
"); - icon.addClass("icon_music icon client-music"); - icon.attr("title", "Music quality"); - if (icons.children(".icon_default").length > 0) { - icons.children(".icon_default").first().before(icon); - } - else if (icons.children().length > 0) { - icons.children().first().before(icon); - } + updateVariables(...variables) { + let group = log.group(log.LogType.DEBUG, LogCategory.CHANNEL, "Update properties (%i) of %s (%i)", variables.length, this.channelName(), this.getChannelId()); + for (let variable of variables) { + let key = variable.key; + let value = variable.value; + if (typeof (this.properties[key]) == "number") + this.properties[key] = parseInt(value); + if (typeof (this.properties[key]) == "boolean") + this.properties[key] = value == "true" || value == "1"; else - icons.append(icon); + this.properties[key] = value; + group.log("Updating property " + key + " = '%s' -> %o", value, this.properties[key]); + if (key == "channel_name") { + this.__updateChannelName(); + } + else if (key == "channel_order") { + let order = this.channelTree.findChannel(this.properties.channel_order); + this.channelTree.moveChannel(this, order, this.parent); + } + else if (key == "channel_icon_id") { + let tag = this.channelTag().find(".icons .channel_icon"); + (this.properties.channel_icon_id > 0 ? $.fn.show : $.fn.hide).apply(tag); + if (this.properties.channel_icon_id > 0) { + tag.children().detach(); + this.channelTree.client.fileManager.icons.generateTag(this.properties.channel_icon_id).appendTo(tag); + } + } + else if (key == "channel_codec") { + (this.properties.channel_codec == 5 || this.properties.channel_codec == 3 ? $.fn.show : $.fn.hide).apply(this.channelTag().find(".icons .icon_music")); + (this.channelTree.client.voiceConnection.codecSupported(this.properties.channel_codec) ? $.fn.hide : $.fn.show).apply(this.channelTag().find(".icons .icon_no_sound")); + } + else if (key == "channel_flag_default") { + (this.properties.channel_flag_default ? $.fn.show : $.fn.hide).apply(this.channelTag().find(".icons .icon_default")); + } + else if (key == "channel_flag_password") + (this.properties.channel_flag_password ? $.fn.show : $.fn.hide).apply(this.channelTag().find(".icons .icon_password")); + if (key == "channel_maxclients" || key == "channel_maxfamilyclients" || key == "channel_flag_private" || key == "channel_flag_password") + this.updateChannelTypeIcon(); } + group.end(); + } + updateChannelTypeIcon() { + let tag = this.channelTag().find(".channel_type"); + tag.removeAttr('class'); + tag.addClass("channel_only_normal channel_type icon"); + let type; + if (this.properties.channel_flag_password == true && !this._cachedPassword) + type = "yellow"; + else if ((!this.properties.channel_flag_maxclients_unlimited && this.clients().length >= this.properties.channel_maxclients) || + (!this.properties.channel_flag_maxfamilyclients_unlimited && this.properties.channel_maxfamilyclients >= 0 && this.clients(true).length >= this.properties.channel_maxfamilyclients)) + type = "red"; + else + type = "green"; + tag.addClass("client-channel_" + type + "_subscribed"); } createChatTag(braces = false) { let tag = $.spawn("div"); @@ -296,12 +392,36 @@ class ChannelEntry { return tag.wrap("

").parent(); } channelType() { - if (this.properties.channel_flag_permanent == "1") + if (this.properties.channel_flag_permanent == true) return ChannelType.PERMANENT; - if (this.properties.channel_flag_semi_permanent == "1") + if (this.properties.channel_flag_semi_permanent == true) return ChannelType.SEMI_PERMANENT; return ChannelType.TEMPORARY; } + joinChannel() { + if (this.properties.channel_flag_password == true && + !this._cachedPassword && + !this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_JOIN_IGNORE_PASSWORD).granted(1)) { + createInputModal("Channel password", "Channel password:", () => true, text => { + if (typeof (text) == typeof (true)) + return; + helpers.hashPassword(text).then(result => { + this._cachedPassword = result; + this.joinChannel(); + this.updateChannelTypeIcon(); + }); + }).open(); + } + else + this.channelTree.client.getServerConnection().joinChannel(this, this._cachedPassword).catch(error => { + if (error instanceof CommandResult) { + if (error.id == 781) { + this._cachedPassword = undefined; + this.updateChannelTypeIcon(); + } + } + }); + } } //Global functions function chat_channel_contextmenu(_element, event) { diff --git a/js/ui/channel.js.map b/js/ui/channel.js.map index 22e09090..d46f92b8 100644 --- a/js/ui/channel.js.map +++ b/js/ui/channel.js.map @@ -1 +1 @@ -{"version":3,"file":"channel.js","sourceRoot":"","sources":["channel.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,IAAK,WAIJ;AAJD,WAAK,WAAW;IACZ,uDAAS,CAAA;IACT,iEAAc,CAAA;IACd,uDAAS,CAAA;AACb,CAAC,EAJI,WAAW,KAAX,WAAW,QAIf;AACD,WAAU,WAAW;IACjB,mBAA0B,IAAiB;QACvC,IAAI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C,KAAK,YAAY,aAAa,CAAC,CAAC,CAAC;oBAChC,EAAE,CAAA,CAAC,KAAK,CAAC,EAAE,IAAI,GAAG,CAAC,CAAC,CAAC;wBACjB,IAAI,CAAC,eAAe,GAAG,SAAS,CAAC;wBACjC,IAAI,CAAC,qBAAqB,EAAE,CAAC;oBACjC,CAAC;gBACL,CAAC;YACL,CAAC,CAAC,CAAC;IACX,CAAC;CACJ;AAED,kBAAkB;AAClB,kCAAkC,QAAa,EAAE,KAAU;IACvD,KAAK,CAAC,cAAc,EAAE,CAAC;IAEvB,IAAI,OAAO,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC;IAC1B,OAAO,CAAC,GAAG,CAAC,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC;IAChE,IAAI,IAAI,GAAY,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;IAC/D,IAAI,OAAO,GAAG,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IACzD,EAAE,CAAA,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACV,MAAM;QACN,MAAM,CAAC;IACX,CAAC;IAED,OAAO,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;AACtD,CAAC"} \ No newline at end of file diff --git a/js/ui/channel.ts b/js/ui/channel.ts index 39f1c54d..c35093e5 100644 --- a/js/ui/channel.ts +++ b/js/ui/channel.ts @@ -1,4 +1,5 @@ /// +/// enum ChannelType { PERMANENT, @@ -13,51 +14,80 @@ namespace ChannelType { } } +class ChannelProperties { + channel_order: number = 0; + channel_name: string = ""; + channel_topic: string = ""; + + channel_password: string = ""; + channel_description: string = ""; + + channel_codec: number = 4; + channel_codec_quality: number = 0; + channel_codec_is_unencrypted: boolean = false; + + channel_maxclients: number = -1; + channel_maxfamilyclients: number = -1; + + channel_needed_talk_power: number = 1; + + channel_flag_permanent: boolean = false; + channel_flag_semi_permanent: boolean = false; + channel_flag_default: boolean = false; + channel_flag_password: boolean = false; + channel_flag_maxclients_unlimited: boolean = false; + channel_flag_maxfamilyclients_inherited: boolean = false; + channel_flag_maxfamilyclients_unlimited: boolean = false; + + channel_icon_id: number; +} + class ChannelEntry { channelTree: ChannelTree; channelId: number; parent?: ChannelEntry; prevChannel?: ChannelEntry; - properties: any = { - channel_order: 0, - channel_name: "undefined", - - channel_flag_permanent: 0, - channel_flag_semi_permanent: 0, - channel_flag_default: 0, - channel_flag_password: 0 - }; + properties: ChannelProperties = new ChannelProperties(); originalHeight: number; private _channelAlign: string; - private _rawChannelName: string; - private _htmlTag: JQuery; - private _displayMusicIcon: boolean; + private _formatedChannelName: string; + + //HTML DOM elements + private _tag_root: JQuery; + private _tag_siblings: JQuery; + private _tag_clients: JQuery; + private _tag_channel: JQuery; + + private _cachedPassword: string; constructor(channelId, channelName, parent = null, prevChannel = null) { - this.properties = {}; + this.properties = new ChannelProperties(); this.channelId = channelId; - this._rawChannelName = channelName; + this._formatedChannelName = channelName; this.parent = parent; this.prevChannel = prevChannel; this.channelTree = null; - this.__updateChannelPropertiesFromName(); + + this.initializeTag(); + this.__updateChannelName(); } channelName(){ - return this.properties["channel_name"]; + return this.properties.channel_name; } - rawChannelName() { - return this._rawChannelName; + formatedChannelName() { + return this._formatedChannelName ? this._formatedChannelName : this.properties.channel_name; } parentChannel() { return this.parent; } hasParent(){ return this.parent != null; } getChannelId(){ return this.channelId; } channelClass() { return "channel_full"; } - siblings(deep = false) { - const result = []; + + siblings(deep = false) : ChannelEntry[] { + const result: ChannelEntry[] = []; if(this.channelTree == null) return []; const self = this; @@ -100,46 +130,85 @@ class ChannelEntry { return result; } - get htmlTag() : JQuery { - if(this._htmlTag) return this._htmlTag; + private initializeTag() { + let rootTag = $.spawn("div"); - let tag = $.spawn("div"); + rootTag.attr("id", "channel_" + this.getChannelId()); + rootTag.addClass("channel"); + //rootTag.append($.spawn("div").addClass("icon_empty")); - tag.attr("id", "channel_" + this.getChannelId()); - tag.addClass("channel"); - tag.append("

"); + //Tag channel + this._tag_channel = $.spawn("div"); + this._tag_channel.addClass("channelLine"); + this._tag_channel.addClass(this._channelAlign); //For left - let channelTag = $("
"); - channelTag.addClass("channelLine"); - channelTag.addClass(this._channelAlign); //For left + let channelType = $.spawn("div"); + channelType.addClass("channel_only_normal channel_type icon client-channel_green_subscribed"); + this._tag_channel.append(channelType); - let channelType = $("
"); - channelType.addClass("channel_only_normal channel_type"); - channelType.addClass("icon"); - channelType.addClass("client-channel_green_subscribed"); - channelTag.append(channelType); + this._tag_channel.append($.spawn("div").addClass("channel_name_container").append($.spawn("a").addClass("channel_name").text(this.channelName()))); - channelTag.append("" + this.channelName() + ""); + //Icons + let iconTag = $.spawn("span").addClass("icons"); + iconTag.appendTo(this._tag_channel); - let channelIcon = $(""); - channelTag.append(channelIcon); + //Default icon (4) + iconTag.append($.spawn("div").addClass("channel_only_normal").append($.spawn("div").addClass("icon_entry icon_default icon client-channel_default").attr("title", "Default channel"))); + //Password icon (3) + iconTag.append($.spawn("div").addClass("channel_only_normal").append($.spawn("div").addClass("icon_entry icon_password icon client-register").attr("title", "The channel is password protected"))); + //Music icon (2) + iconTag.append($.spawn("div").addClass("channel_only_normal").append($.spawn("div").addClass("icon_entry icon_music icon client-music").attr("title", "Music quality"))); + //Channel Icon (1) + iconTag.append($.spawn("div").addClass("channel_only_normal").addClass("icon_entry channel_icon").attr("title", "Channel icon")); + //Default no sound (0) + let container = $.spawn("div"); + let noSound = $.spawn("div").addClass("icon_entry icon_no_sound icon client-conflict-icon").attr("title", "You don't support the channel codec"); + let bg = $.spawn("div") + .width(10) + .height(14) + .css("background", "red") + .css("position", "absolute") + .css("top", "1px") + .css("left", "3px"); + bg.appendTo(container); + noSound.appendTo(container); + iconTag.append(container); + /* + setInterval(() => { + let color = (Math.random() * 10000000).toString(16).substr(0, 6); + bg.css("background", "#" + color); + }, 150); + */ - tag.append("
"); - tag.append("
"); - tag.append(channelTag); + //Build siblings + this._tag_siblings = $.spawn("div").addClass("siblings"); + let tag_siblings_box = $.spawn("div").css("position", "absolute").css("width", "calc(100% - 16px)").css("margin", "0px"); + this._tag_siblings.appendTo(tag_siblings_box); - return this._htmlTag = tag; + //Build clients + this._tag_clients = $.spawn("div").addClass("clients"); + let tag_clients_box = $.spawn("div").css("position", "absolute").css("width", "calc(100% - 16px)").css("margin", "0px"); + this._tag_clients.appendTo(tag_clients_box); + + this._tag_root = rootTag; + tag_clients_box.appendTo(this._tag_root); + tag_siblings_box.appendTo(this._tag_root); + this._tag_channel.appendTo(this._tag_root); } - get channelTag() : JQuery { - return this.htmlTag.find(".channelLine").last(); + rootTag() : JQuery { + return this._tag_root; + } + + channelTag() : JQuery { + return this._tag_channel; } siblingTag() : JQuery { - return this.htmlTag.find(".siblings").first(); //Here the first because first comes the siblings tag than all other sibling comes + return this._tag_siblings; } clientTag() : JQuery{ - return this.htmlTag.find(".clients").last(); //Here last because from the sibling tag client tags could be before + return this._tag_clients; } adjustSize(parent = true) { @@ -149,170 +218,230 @@ class ChannelEntry { const sub = this.siblings(false); sub.forEach(function (e) { - subSize += e.htmlTag.outerHeight(true); + subSize += e.rootTag().outerHeight(true); }); const clients = this.clients(false); clients.forEach(function (e) { - clientSize += e.htmlTag.outerHeight(true); + clientSize += e.tag.outerHeight(true); }); - if(sub.length >= 1) subSize -= 1; - if(clients.length >= 1) clientSize -= 1; - - this.htmlTag.css({height: size + subSize + clientSize}); - this.siblingTag().css("margin-top", (clientSize + 16) + "px"); - this.clientTag().css({height: clientSize}); + this._tag_root.css({height: size + subSize + clientSize}); + this._tag_siblings.css("margin-top", (clientSize + 16) + "px"); + this._tag_clients.css({height: clientSize}); if(parent && this.parentChannel()) this.parentChannel().adjustSize(parent); } - initializeListener(){ + initializeListener() { const _this = this; - this.channelTag.click(function () { + this.channelTag().click(function () { _this.channelTree.onSelect(_this); }); - this.channelTag.dblclick(function () { - _this.channelTree.client.serverConnection.joinChannel(_this); //TODO may ask for password - }); + this.channelTag().dblclick(() => this.joinChannel()); - this.channelTag.on("contextmenu", function (event) { - event.preventDefault(); - _this.channelTree.onSelect(_this); - _this.showContextMenu(event.pageX, event.pageY, () => { _this.channelTree.onSelect(undefined); }); - }); + if(!settings.static(Settings.KEY_DISABLE_CONTEXT_MENU, false)) { + this.channelTag().on("contextmenu", function (event) { + event.preventDefault(); + _this.channelTree.onSelect(_this); + _this.showContextMenu(event.pageX, event.pageY, () => { + _this.channelTree.onSelect(undefined); + }); + }); + } } showContextMenu(x: number, y: number, on_close: () => void = undefined) { - const _this = this; + let channelCreate = + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_TEMPORARY).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_SEMI_PERMANENT).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_PERMANENT).granted(1); + + let channelModify = + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_DEFAULT).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_PERMANENT).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_SEMI_PERMANENT).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_TEMPORARY).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_NAME).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_TOPIC).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_DESCRIPTION).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_PASSWORD).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_CODEC).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_CODEC_QUALITY).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_CODEC_LATENCY_FACTOR).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAXCLIENTS).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAXFAMILYCLIENTS).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_SORTORDER).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_NEEDED_TALK_POWER).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_MAKE_CODEC_ENCRYPTED).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_TEMP_DELETE_DELAY).granted(1) || + this.channelTree.client.permissions.neededPermission(PermissionType.B_ICON_MANAGE).granted(1); + + let flagDelete = true; + if(this.clients(true).length > 0) + flagDelete = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_DELETE_FLAG_FORCE).granted(1); + if(flagDelete) { + if (this.properties.channel_flag_permanent) + flagDelete = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_DELETE_PERMANENT).granted(1); + else if (this.properties.channel_flag_semi_permanent) + flagDelete = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_DELETE_PERMANENT).granted(1); + else + flagDelete = this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_DELETE_TEMPORARY).granted(1); + } + spawnMenu(x, y, { type: MenuEntryType.ENTRY, icon: "client-channel_switch", name: "Switch to channel", callback: () => { - _this.channelTree.client.getServerConnection().joinChannel(_this); //TODO ask for password if required + this.joinChannel(); } }, MenuEntry.HR(), + { + type: MenuEntryType.ENTRY, + icon: "client-channel_edit", + name: "Edit channel", + invalidPermission: !channelModify, + callback: () => { + Modals.createChannelModal(this, undefined, (changes?: ChannelProperties) => { + if(!changes) return; + changes["cid"] = this.channelId; + log.info(LogCategory.CHANNEL, "Changed channel properties of channel %s: %o", this.channelName(), changes); + }); + } + }, + { + type: MenuEntryType.ENTRY, + icon: "client-channel_delete", + name: "Delete channel", + invalidPermission: !flagDelete, + callback: () => this.channelTree.client.serverConnection.sendCommand("channeldelete", {cid: this.channelId}) + }, + MenuEntry.HR(), { type: MenuEntryType.ENTRY, icon: "client-channel_create_sub", name: "Create sub channel", - disabled: true, - callback: () => { - //TODO here - } + invalidPermission: !(channelCreate && this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_CHILD).granted(1)), + callback: () => this.channelTree.spawnCreateChannel(this) }, { type: MenuEntryType.ENTRY, icon: "client-channel_create", name: "Create channel", - disabled: true, - callback: () => { - //TODO here - } + invalidPermission: !channelCreate, + callback: () => this.channelTree.spawnCreateChannel() }, MenuEntry.CLOSE(on_close) ); } - private __updateChannelPropertiesFromName() { + private __updateChannelName() { + this._formatedChannelName = undefined; parseType: - if(this.parentChannel() == null && this._rawChannelName.charAt(0) == '[' && this._rawChannelName.indexOf(']') != -1) { - let typeData = this._rawChannelName.substr(1, this._rawChannelName.indexOf(']') - 1); - //console.log("Having spacer etc? -> " + typeData); - if(typeData.indexOf("spacer") == -1) break parseType; - let strAlign = typeData.substr(0, typeData.indexOf("spacer")); - if(strAlign.length > 0){ - if(strAlign.length != 1){ - if(strAlign.length != 2 || strAlign[0] != '*') - break parseType; - strAlign = strAlign.substr(1); - //TODO support repeating pattern! + if(this.parentChannel() == null && this.properties.channel_name.charAt(0) == '[') { + let end = this.properties.channel_name.indexOf(']'); + if(end == -1) break parseType; + + let options = this.properties.channel_name.substr(1, end - 1); + if(options.indexOf("spacer") == -1) break parseType; + options = options.substr(0, options.indexOf("spacer")); + + console.log("Channel options: '" + options + "'"); + if(options.length == 0) options = "l"; + else if(options.length > 1) options = options[0]; + + if(options == "r" || options == "l" || options == "c" || options == "*") + this._channelAlign = options; + else break parseType; + + this._formatedChannelName = this.properties.channel_name.substr(end + 1); + console.log("Got channel name: " + this._formatedChannelName); + } + + let self = this.channelTag(); + let channelName = self.find(".channel_name"); + channelName.text(this.formatedChannelName()); + channelName.parent().removeClass("l r c *"); //Alignments + (this._formatedChannelName ? $.fn.hide : $.fn.show).apply(self.find(".channel_only_normal")); + + if(this._formatedChannelName) { + channelName.parent().addClass(this._channelAlign); + + if(this._channelAlign == "*") { + let lastSuccess = ""; + let index = 0; + do { + channelName.text((lastSuccess = channelName.text()) + this.formatedChannelName()); + console.log(channelName.parent().width() + " : " + channelName.width() + " : " + channelName.innerWidth() + " : " + channelName.outerWidth()); + } while (channelName.parent().width() >= channelName.width() && ++index < 255); + if(index == 255) console.warn(LogCategory.CHANNEL, "Repeating spacer took too much repeats!"); + if(lastSuccess.length > 0) { + channelName.text(lastSuccess); + self.addClass("c"); } } - if(strAlign == "") this._channelAlign = "l"; - else this._channelAlign = strAlign; - - var repeatData = typeData.substr(typeData.indexOf("spacer") + 6); - //console.log("Repeat data: " + repeatData); - - this.properties["channel_name"] = this._rawChannelName.substr(this._rawChannelName.indexOf(']') + 1); } - if(this.properties.channel_name == undefined) { - this.properties.channel_name = this._rawChannelName; - this._channelAlign = "l"; - } - - let self = this.channelTag; - if(this.properties.channel_name == this._rawChannelName) { - self.find(".channel_only_normal").show(); - } else self.find(".channel_only_normal").hide(); - - self.find(".channel_name").text(this.channelName()); - - self.removeClass("l r c"); //Alignments - self.addClass(this._channelAlign); console.log("Align: " + this._channelAlign); } - updateProperty(key, value){ - this.properties[key] = value; - console.debug("Updating channel " + this.channelId + ". Key: " + key + " Value: " + value); - if(key == "channel_name") { - this._rawChannelName = value; - this.properties.channel_name = undefined; - this.__updateChannelPropertiesFromName(); - } else if(key == "channel_order") { - var order = this.channelTree.findChannel(value); - this.channelTree.moveChannel(this, order, this.parent); - } else if(key == "channel_icon_id") { - let icons = this.channelTag.find("span"); - icons.find(".icon_property").detach(); - if(value > 0) { - let tag = this.channelTree.client.fileManager.icons.generateTag(value); - if(icons.children().length > 0){ //Channel icons at the end :) - icons.children().last().after(tag); - } else - icons.append(tag); - console.log("Channel icon: " + value); - } - } else if(key == "channel_codec") { - this.displayMusicIcon = value == 5 || value == 3; - } else if(key == "channel_flag_default") { - let icons = this.channelTag.find("span"); - icons.find(".icon_default").detach(); - if(value == "1") { - console.log("Default: '" + value + "'"); - let icon = $.spawn("div"); - icon.addClass("icon_default icon client-channel_default"); - icon.attr("title", "Default channel"); + updateVariables(...variables: {key: string, value: string}[]) { + let group = log.group(log.LogType.DEBUG, LogCategory.CHANNEL, "Update properties (%i) of %s (%i)", variables.length, this.channelName(), this.getChannelId()); - if(icons.children().length > 0){ //Music icon at the begin - icons.children().first().before(icon); - } else - icons.append(icon); - } + for(let variable of variables) { + let key = variable.key; + let value = variable.value; + + if(typeof (this.properties[key]) == "number") + this.properties[key] = parseInt(value); + if(typeof (this.properties[key]) == "boolean") + this.properties[key] = value == "true" || value == "1"; + else + this.properties[key] = value; + group.log("Updating property " + key + " = '%s' -> %o", value, this.properties[key]); + + if(key == "channel_name") { + this.__updateChannelName(); + } else if(key == "channel_order") { + let order = this.channelTree.findChannel(this.properties.channel_order); + this.channelTree.moveChannel(this, order, this.parent); + } else if(key == "channel_icon_id") { + let tag = this.channelTag().find(".icons .channel_icon"); + (this.properties.channel_icon_id > 0 ? $.fn.show : $.fn.hide).apply(tag); + if(this.properties.channel_icon_id > 0) { + tag.children().detach(); + this.channelTree.client.fileManager.icons.generateTag(this.properties.channel_icon_id).appendTo(tag); + } + } else if(key == "channel_codec") { + (this.properties.channel_codec == 5 || this.properties.channel_codec == 3 ? $.fn.show : $.fn.hide).apply(this.channelTag().find(".icons .icon_music")); + (this.channelTree.client.voiceConnection.codecSupported(this.properties.channel_codec) ? $.fn.hide : $.fn.show).apply(this.channelTag().find(".icons .icon_no_sound")); + } else if(key == "channel_flag_default") { + (this.properties.channel_flag_default ? $.fn.show : $.fn.hide).apply(this.channelTag().find(".icons .icon_default")); + } else if(key == "channel_flag_password") + (this.properties.channel_flag_password ? $.fn.show : $.fn.hide).apply(this.channelTag().find(".icons .icon_password")); + + if(key == "channel_maxclients" || key == "channel_maxfamilyclients" || key == "channel_flag_private" || key == "channel_flag_password") + this.updateChannelTypeIcon(); } + group.end(); } - set displayMusicIcon(flag: boolean) { - if(this._displayMusicIcon == flag) return; + updateChannelTypeIcon() { + let tag = this.channelTag().find(".channel_type"); + tag.removeAttr('class'); + tag.addClass("channel_only_normal channel_type icon"); - this._displayMusicIcon = flag; + let type; + if(this.properties.channel_flag_password == true && !this._cachedPassword) + type = "yellow"; + else if( + (!this.properties.channel_flag_maxclients_unlimited && this.clients().length >= this.properties.channel_maxclients) || + (!this.properties.channel_flag_maxfamilyclients_unlimited && this.properties.channel_maxfamilyclients >= 0 && this.clients(true).length >= this.properties.channel_maxfamilyclients) + ) + type = "red"; + else + type = "green"; - let icons = this.channelTag.find("span"); - icons.find(".icon_music").detach(); - if(flag) { - let icon = $("
"); - icon.addClass("icon_music icon client-music"); - icon.attr("title", "Music quality"); - - if(icons.children(".icon_default").length > 0){ //Music icon after default icon - icons.children(".icon_default").first().before(icon); - } else if(icons.children().length > 0){ //Music icon at the begin - icons.children().first().before(icon); - } else - icons.append(icon); - } + tag.addClass("client-channel_" + type + "_subscribed"); } createChatTag(braces: boolean = false) : JQuery { @@ -333,10 +462,33 @@ class ChannelEntry { } channelType() : ChannelType { - if(this.properties.channel_flag_permanent == "1") return ChannelType.PERMANENT; - if(this.properties.channel_flag_semi_permanent == "1") return ChannelType.SEMI_PERMANENT; + if(this.properties.channel_flag_permanent == true) return ChannelType.PERMANENT; + if(this.properties.channel_flag_semi_permanent == true) return ChannelType.SEMI_PERMANENT; return ChannelType.TEMPORARY; } + + joinChannel() { + if(this.properties.channel_flag_password == true && + !this._cachedPassword && + !this.channelTree.client.permissions.neededPermission(PermissionType.B_CHANNEL_JOIN_IGNORE_PASSWORD).granted(1)) { + createInputModal("Channel password", "Channel password:", () => true, text => { + if(typeof(text) == typeof(true)) return; + helpers.hashPassword(text as string).then(result => { + this._cachedPassword = result; + this.joinChannel(); + this.updateChannelTypeIcon(); + }); + }).open(); + } else + this.channelTree.client.getServerConnection().joinChannel(this, this._cachedPassword).catch(error => { + if(error instanceof CommandResult) { + if(error.id == 781) { //Invalid password + this._cachedPassword = undefined; + this.updateChannelTypeIcon(); + } + } + }); + } } //Global functions diff --git a/js/ui/client.js b/js/ui/client.js index 0b358281..c041d567 100644 --- a/js/ui/client.js +++ b/js/ui/client.js @@ -1,14 +1,27 @@ /// /// +class ClientProperties { + constructor() { + this.client_version = ""; + this.client_platform = ""; + this.client_nickname = "unknown"; + this.client_unique_identifier = "unknown"; + this.client_description = ""; + this.client_servergroups = ""; + this.client_channel_group_id = 0; + this.client_lastconnected = 0; + this.client_flag_avatar = ""; + this.client_output_muted = false; + this.client_away_message = ""; + this.client_away = false; + this.client_input_hardware = false; + this.client_input_muted = false; + this.client_is_channel_commander = false; + } +} class ClientEntry { constructor(clientId, clientName) { - this.properties = { - client_nickname: "", - client_unique_identifier: "", - client_servergroups: "0", - client_channel_group_id: "0", - client_lastconnected: "0" - }; + this.properties = new ClientProperties(); this.lastVariableUpdate = 0; this._speaking = false; this._clientId = clientId; @@ -34,17 +47,19 @@ class ClientEntry { } initializeListener() { const _this = this; - this.htmlTag.click(event => { + this.tag.click(event => { _this.channelTree.onSelect(_this); }); - this.htmlTag.on("contextmenu", function (event) { - event.preventDefault(); - _this.channelTree.onSelect(_this); - _this.showContextMenu(event.pageX, event.pageY, () => { - _this.channelTree.onSelect(undefined); + if (!settings.static(Settings.KEY_DISABLE_CONTEXT_MENU, false)) { + this.tag.on("contextmenu", function (event) { + event.preventDefault(); + _this.channelTree.onSelect(_this); + _this.showContextMenu(event.pageX, event.pageY, () => { + _this.channelTree.onSelect(undefined); + }); + return false; }); - return false; - }); + } } showContextMenu(x, y, on_close = undefined) { const _this = this; @@ -140,7 +155,7 @@ class ClientEntry { name: "Change Volume", callback: () => { Modals.spawnChangeVolume(this.audioController.volume, volume => { - globalClient.settings.changeServer("volume_client_" + this.clientUid(), volume); + settings.changeServer("volume_client_" + this.clientUid(), volume); this.audioController.volume = volume; if (globalClient.selectInfo.currentSelected == this) globalClient.selectInfo.update(); @@ -148,21 +163,19 @@ class ClientEntry { } }, MenuEntry.CLOSE(on_close)); } - get htmlTag() { - if (this._htmlTag) - return this._htmlTag; + get tag() { + if (this._tag) + return this._tag; let tag = $.spawn("div"); tag.attr("id", "client_" + this.clientId()); tag.addClass("client"); - tag.append("
"); - let clientIcon = $.spawn("div"); - clientIcon.addClass("icon_client_state"); - tag.append(clientIcon); - tag.append("
" + this.clientNickName() + "
"); - tag.append("
" + this.clientNickName() + "
"); + tag.append($.spawn("div").addClass("icon_empty")); + tag.append($.spawn("div").addClass("icon_client_state").attr("title", "Client state")); + tag.append($.spawn("div").addClass("name").text(this.clientNickName())); + tag.append($.spawn("div").addClass("away").text(this.clientNickName())); let clientIcons = $.spawn("span"); tag.append(clientIcons); - return this._htmlTag = tag; + return this._tag = tag; } static chatTag(id, name, uid, braces = false) { let tag = $.spawn("div"); @@ -192,42 +205,42 @@ class ClientEntry { updateClientIcon() { let icon = ""; let clicon = ""; - if (this.properties.client_away == "1") { + if (this.properties.client_away) { icon = "client-away"; } - else if (this.properties.client_output_muted == "1") { + else if (this.properties.client_output_muted) { icon = "client-hardware_output_muted"; } - else if (this.properties.client_input_hardware == "0") { + else if (!this.properties.client_input_hardware) { icon = "client-hardware_input_muted"; } - else if (this.properties.client_input_muted == "1") { + else if (this.properties.client_input_muted) { icon = "client-input_muted"; } else { if (this._speaking) { - if (this.properties.client_is_channel_commander == 1) + if (this.properties.client_is_channel_commander) clicon = "client_cc_talk"; else clicon = "client_talk"; } else { - if (this.properties.client_is_channel_commander == 1) + if (this.properties.client_is_channel_commander) clicon = "client_cc_idle"; else clicon = "client_idle"; } } if (clicon.length > 0) - this.htmlTag.find(".icon_client_state").attr('class', 'icon_client_state clicon ' + clicon); + this.tag.find(".icon_client_state").attr('class', 'icon_client_state clicon ' + clicon); else if (icon.length > 0) - this.htmlTag.find(".icon_client_state").attr('class', 'icon_client_state icon ' + icon); + this.tag.find(".icon_client_state").attr('class', 'icon_client_state icon ' + icon); else - this.htmlTag.find(".icon_client_state").attr('class', 'icon_client_state icon_empty'); + this.tag.find(".icon_client_state").attr('class', 'icon_client_state icon_empty'); } updateAwayMessage() { - let tag = this.htmlTag.find(".away"); - if (this.properties.client_away == 1 && this.properties.client_away_message) { + let tag = this.tag.find(".away"); + if (this.properties.client_away == true && this.properties.client_away_message) { tag.text("[" + this.properties.client_away_message + "]"); tag.show(); } @@ -235,27 +248,37 @@ class ClientEntry { tag.hide(); } } - updateVariable(key, value) { - this.properties[key] = value; - console.debug("Updating client " + this.clientId() + ". Key " + key + " Value: '" + value + "'"); - if (key == "client_nickname") { - this.htmlTag.find(".name").text(value); - let chat = this.chat(false); - if (chat) - chat.name = value; - } - if (key == "client_away" || key == "client_output_muted" || key == "client_input_hardware" || key == "client_input_muted" || key == "client_is_channel_commander") { - this.updateClientIcon(); - } - if (key == "client_away_message" || key == "client_away") { - this.updateAwayMessage(); - } - if (key == "client_unique_identifier") { - this.audioController.volume = parseFloat(globalClient.settings.server("volume_client_" + this.clientUid(), "1")); - console.error("Updated volume from config " + this.audioController.volume + " - " + "volume_client_" + this.clientUid() + " - " + globalClient.settings.server("volume_client_" + this.clientUid(), "1")); + updateVariables(...variables) { + let group = log.group(log.LogType.DEBUG, LogCategory.CLIENT, "Update properties (%i) of %s (%i)", variables.length, this.clientNickName(), this.clientId()); + for (let variable of variables) { + if (typeof (this.properties[variable.key]) === "boolean") + this.properties[variable.key] = variable.value == "true" || variable.value == "1"; + else if (typeof (this.properties[variable.key]) === "number") + this.properties[variable.key] = parseInt(variable.value); + else + this.properties[variable.key] = variable.value; + group.log("Updating client " + this.clientId() + ". Key " + variable.key + " Value: '" + variable.value + "' (" + typeof (this.properties[variable.key]) + ")"); + if (variable.key == "client_nickname") { + this.tag.find(".name").text(variable.value); + let chat = this.chat(false); + if (chat) + chat.name = variable.value; + } + if (variable.key == "client_away" || variable.key == "client_output_muted" || variable.key == "client_input_hardware" || variable.key == "client_input_muted" || variable.key == "client_is_channel_commander") { + this.updateClientIcon(); + } + if (variable.key == "client_away_message" || variable.key == "client_away") { + this.updateAwayMessage(); + } + if (variable.key == "client_unique_identifier") { + this.audioController.volume = parseFloat(settings.server("volume_client_" + this.clientUid(), "1")); + console.error("Updated volume from config " + this.audioController.volume + " - " + "volume_client_" + this.clientUid() + " - " + settings.server("volume_client_" + this.clientUid(), "1")); + console.log(this.avatarId()); + } } + group.end(); } - updateVariables() { + updateClientVariables() { if (this.lastVariableUpdate == 0 || new Date().getTime() - 10 * 60 * 1000 > this.lastVariableUpdate) { this.lastVariableUpdate = new Date().getTime(); this.channelTree.client.serverConnection.sendCommand("clientgetvariables", { clid: this.clientId() }); @@ -282,10 +305,9 @@ class ClientEntry { } updateGroupIcon(group) { //TODO group icon order - this.htmlTag.find(".icon_group_" + group.id).detach(); - if (group.properties.iconid > 0) { - this.htmlTag.find("span").append(this.channelTree.client.fileManager.icons.generateTag(group.properties.iconid).addClass("icon_group_" + group.id)); - } + this.tag.find(".icon_group_" + group.id).detach(); + if (group.properties.iconid > 0) + this.tag.find("span").append(this.channelTree.client.fileManager.icons.generateTag(group.properties.iconid).addClass("icon_group_" + group.id)); } assignedServerGroupIds() { let result = []; @@ -297,7 +319,7 @@ class ClientEntry { return result; } assignedChannelGroup() { - return Number.parseInt(this.properties.client_channel_group_id); + return this.properties.client_channel_group_id; } groupAssigned(group) { if (group.target == GroupTarget.SERVER) { @@ -314,7 +336,37 @@ class ClientEntry { this.audioController = undefined; } calculateOnlineTime() { - return new Date().getTime() / 1000 - Number.parseInt(this.properties.client_lastconnected); + return new Date().getTime() / 1000 - this.properties.client_lastconnected; + } + avatarId() { + function str2ab(str) { + let buf = new ArrayBuffer(str.length); // 2 bytes for each char + let bufView = new Uint8Array(buf); + for (let i = 0, strLen = str.length; i < strLen; i++) { + bufView[i] = str.charCodeAt(i); + } + return buf; + } + try { + let raw = atob(this.properties.client_unique_identifier); + let input = hex.encode(str2ab(raw)); + let result = ""; + for (let index = 0; index < input.length; index++) { + let c = input.charAt(index); + let offset = 0; + if (c >= '0' && c <= '9') + offset = c.charCodeAt(0) - '0'.charCodeAt(0); + else if (c >= 'A' && c <= 'F') + offset = c.charCodeAt(0) - 'A'.charCodeAt(0) + 0x0A; + else if (c >= 'a' && c <= 'f') + offset = c.charCodeAt(0) - 'a'.charCodeAt(0) + 0x0A; + result += String.fromCharCode('a'.charCodeAt(0) + offset); + } + return result; + } + catch (e) { + return undefined; + } } } class LocalClientEntry extends ClientEntry { @@ -322,9 +374,6 @@ class LocalClientEntry extends ClientEntry { super(0, "local client"); this.handle = handle; } - updateVariable(key, value) { - super.updateVariable(key, value); - } showContextMenu(x, y, on_close = undefined) { const _self = this; spawnMenu(x, y, { @@ -351,15 +400,15 @@ class LocalClientEntry extends ClientEntry { } initializeListener() { super.initializeListener(); - this.htmlTag.find(".name").addClass("own_name"); + this.tag.find(".name").addClass("own_name"); const _self = this; - this.htmlTag.dblclick(function () { + this.tag.dblclick(function () { _self.openRename(); }); } openRename() { const _self = this; - const elm = this.htmlTag.find(".name"); + const elm = this.tag.find(".name"); elm.attr("contenteditable", "true"); elm.removeClass("own_name"); elm.css("background-color", "white"); diff --git a/js/ui/client.js.map b/js/ui/client.js.map index 6b3b0327..2f8ea4a5 100644 --- a/js/ui/client.js.map +++ b/js/ui/client.js.map @@ -1 +1 @@ -{"version":3,"file":"client.js","sourceRoot":"","sources":["client.ts"],"names":[],"mappings":"AAAA,mCAAmC;AACnC,mDAAmD;AAEnD;IAkBI,YAAY,QAAQ,EAAE,UAAU;QAbhC,eAAU,GAAQ;YACd,eAAe,EAAE,EAAE;YACnB,wBAAwB,EAAE,EAAE;YAC5B,mBAAmB,EAAE,GAAG;YACxB,uBAAuB,EAA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AAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACT,MAAM;QACN,MAAM,CAAC;IACX,CAAC;IACD,EAAE,CAAA,CAAC,MAAM,CAAC,SAAS,EAAE,IAAI,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACjD,MAAM;QACN,MAAM,CAAC;IACX,CAAC;IAED,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;AACrD,CAAC"} \ No newline at end of file diff --git a/js/ui/client.ts b/js/ui/client.ts index 411345c1..fb5ec9a5 100644 --- a/js/ui/client.ts +++ b/js/ui/client.ts @@ -1,18 +1,36 @@ /// /// +class ClientProperties { + client_version: string = ""; + client_platform: string = ""; + client_nickname: string = "unknown"; + client_unique_identifier: string = "unknown"; + client_description: string = ""; + client_servergroups: string = ""; + + client_channel_group_id: number = 0; + client_lastconnected: number = 0; + + client_flag_avatar: string = ""; + + client_output_muted: boolean = false; + + client_away_message: string = ""; + client_away: boolean = false; + + + client_input_hardware: boolean = false; + client_input_muted: boolean = false; + client_is_channel_commander: boolean = false; +} + class ClientEntry { private _clientId: number; private _channel: ChannelEntry; - private _htmlTag: JQuery; + private _tag: JQuery; - properties: any = { - client_nickname: "", - client_unique_identifier: "", - client_servergroups: "0", - client_channel_group_id: "0", - client_lastconnected: "0" - }; + properties: ClientProperties = new ClientProperties(); private lastVariableUpdate: number = 0; private _speaking: boolean = false; @@ -48,17 +66,20 @@ class ClientEntry { initializeListener(){ const _this = this; - this.htmlTag.click(event => { + this.tag.click(event => { _this.channelTree.onSelect(_this); }); - this.htmlTag.on("contextmenu", function (event) { - event.preventDefault(); - _this.channelTree.onSelect(_this); - _this.showContextMenu(event.pageX, event.pageY, () => { - _this.channelTree.onSelect(undefined); + + if(!settings.static(Settings.KEY_DISABLE_CONTEXT_MENU, false)) { + this.tag.on("contextmenu", function (event) { + event.preventDefault(); + _this.channelTree.onSelect(_this); + _this.showContextMenu(event.pageX, event.pageY, () => { + _this.channelTree.onSelect(undefined); + }); + return false; }); - return false; - }); + } } showContextMenu(x: number, y: number, on_close: () => void = undefined) { @@ -164,7 +185,7 @@ class ClientEntry { name: "Change Volume", callback: () => { Modals.spawnChangeVolume(this.audioController.volume, volume => { - globalClient.settings.changeServer("volume_client_" + this.clientUid(), volume); + settings.changeServer("volume_client_" + this.clientUid(), volume); this.audioController.volume = volume; if(globalClient.selectInfo.currentSelected == this) globalClient.selectInfo.update(); @@ -175,26 +196,24 @@ class ClientEntry { ); } - get htmlTag() : JQuery { - if(this._htmlTag) return this._htmlTag; + get tag() : JQuery { + if(this._tag) return this._tag; - let tag = $.spawn("div") + let tag = $.spawn("div"); tag.attr("id", "client_" + this.clientId()); tag.addClass("client"); - tag.append("
"); + tag.append($.spawn("div").addClass("icon_empty")); - let clientIcon = $.spawn("div"); - clientIcon.addClass("icon_client_state"); - tag.append(clientIcon); + tag.append($.spawn("div").addClass("icon_client_state").attr("title", "Client state")); - tag.append("
" + this.clientNickName() + "
"); - tag.append("
" + this.clientNickName() + "
"); + tag.append($.spawn("div").addClass("name").text(this.clientNickName())); + tag.append($.spawn("div").addClass("away").text(this.clientNickName())); let clientIcons = $.spawn("span"); tag.append(clientIcons); - return this._htmlTag = tag; + return this._tag = tag; } static chatTag(id: number, name: string, uid: string, braces: boolean = false) : JQuery { @@ -229,38 +248,38 @@ class ClientEntry { updateClientIcon() { let icon: string = ""; let clicon: string = ""; - if(this.properties.client_away == "1") { + if(this.properties.client_away) { icon = "client-away"; - } else if(this.properties.client_output_muted == "1") { + } else if(this.properties.client_output_muted) { icon = "client-hardware_output_muted"; - } else if(this.properties.client_input_hardware == "0") { + } else if(!this.properties.client_input_hardware) { icon = "client-hardware_input_muted"; - } else if(this.properties.client_input_muted == "1") { + } else if(this.properties.client_input_muted) { icon = "client-input_muted"; } else { if(this._speaking) { - if(this.properties.client_is_channel_commander == 1) + if(this.properties.client_is_channel_commander) clicon = "client_cc_talk"; else clicon = "client_talk"; } else { - if(this.properties.client_is_channel_commander == 1) + if(this.properties.client_is_channel_commander) clicon = "client_cc_idle"; else clicon = "client_idle"; } } if(clicon.length > 0) - this.htmlTag.find(".icon_client_state").attr('class', 'icon_client_state clicon ' + clicon); + this.tag.find(".icon_client_state").attr('class', 'icon_client_state clicon ' + clicon); else if(icon.length > 0) - this.htmlTag.find(".icon_client_state").attr('class', 'icon_client_state icon ' + icon); + this.tag.find(".icon_client_state").attr('class', 'icon_client_state icon ' + icon); else - this.htmlTag.find(".icon_client_state").attr('class', 'icon_client_state icon_empty'); + this.tag.find(".icon_client_state").attr('class', 'icon_client_state icon_empty'); } updateAwayMessage() { - let tag = this.htmlTag.find(".away"); - if(this.properties.client_away == 1 && this.properties.client_away_message){ + let tag = this.tag.find(".away"); + if(this.properties.client_away == true && this.properties.client_away_message){ tag.text("[" + this.properties.client_away_message + "]"); tag.show(); } else { @@ -268,28 +287,39 @@ class ClientEntry { } } - updateVariable(key: string, value: string) { - this.properties[key] = value; + updateVariables(...variables: {key: string, value: string}[]) { + let group = log.group(log.LogType.DEBUG, LogCategory.CLIENT, "Update properties (%i) of %s (%i)", variables.length, this.clientNickName(), this.clientId()); - console.debug("Updating client " + this.clientId() + ". Key " + key + " Value: '" + value + "'"); - if(key == "client_nickname") { - this.htmlTag.find(".name").text(value); - let chat = this.chat(false); - if(chat) chat.name = value; - } - if(key == "client_away" || key == "client_output_muted" || key == "client_input_hardware" || key == "client_input_muted" || key == "client_is_channel_commander"){ - this.updateClientIcon(); - } - if(key == "client_away_message" || key == "client_away") { - this.updateAwayMessage(); - } - if(key == "client_unique_identifier") { - this.audioController.volume = parseFloat(globalClient.settings.server("volume_client_" + this.clientUid(), "1")); - console.error("Updated volume from config " + this.audioController.volume + " - " + "volume_client_" + this.clientUid() + " - " + globalClient.settings.server("volume_client_" + this.clientUid(), "1")); + for(let variable of variables) { + if(typeof(this.properties[variable.key]) === "boolean") + this.properties[variable.key] = variable.value == "true" || variable.value == "1"; + else if(typeof (this.properties[variable.key]) === "number") + this.properties[variable.key] = parseInt(variable.value); + else + this.properties[variable.key] = variable.value; + group.log("Updating client " + this.clientId() + ". Key " + variable.key + " Value: '" + variable.value + "' (" + typeof (this.properties[variable.key]) + ")"); + if(variable.key == "client_nickname") { + this.tag.find(".name").text(variable.value); + let chat = this.chat(false); + if(chat) chat.name = variable.value; + } + if(variable.key == "client_away" || variable.key == "client_output_muted" || variable.key == "client_input_hardware" || variable.key == "client_input_muted" || variable.key == "client_is_channel_commander"){ + this.updateClientIcon(); + } + if(variable.key == "client_away_message" || variable.key == "client_away") { + this.updateAwayMessage(); + } + if(variable.key == "client_unique_identifier") { + this.audioController.volume = parseFloat(settings.server("volume_client_" + this.clientUid(), "1")); + console.error("Updated volume from config " + this.audioController.volume + " - " + "volume_client_" + this.clientUid() + " - " + settings.server("volume_client_" + this.clientUid(), "1")); + console.log(this.avatarId()); + } } + + group.end(); } - updateVariables(){ + updateClientVariables(){ if(this.lastVariableUpdate == 0 || new Date().getTime() - 10 * 60 * 1000 > this.lastVariableUpdate){ //Cache these only 10 min this.lastVariableUpdate = new Date().getTime(); this.channelTree.client.serverConnection.sendCommand("clientgetvariables", {clid: this.clientId()}); @@ -318,13 +348,13 @@ class ClientEntry { return c; } + updateGroupIcon(group: Group) { //TODO group icon order - this.htmlTag.find(".icon_group_" + group.id).detach(); + this.tag.find(".icon_group_" + group.id).detach(); - if(group.properties.iconid > 0){ - this.htmlTag.find("span").append(this.channelTree.client.fileManager.icons.generateTag(group.properties.iconid).addClass("icon_group_" + group.id)); - } + if(group.properties.iconid > 0) + this.tag.find("span").append(this.channelTree.client.fileManager.icons.generateTag(group.properties.iconid).addClass("icon_group_" + group.id)); } assignedServerGroupIds() : number[] { @@ -337,7 +367,7 @@ class ClientEntry { } assignedChannelGroup() : number { - return Number.parseInt(this.properties.client_channel_group_id); + return this.properties.client_channel_group_id; } groupAssigned(group: Group) : boolean { @@ -354,7 +384,39 @@ class ClientEntry { } calculateOnlineTime() : number { - return new Date().getTime() / 1000 - Number.parseInt(this.properties.client_lastconnected); + return new Date().getTime() / 1000 - this.properties.client_lastconnected; + } + + avatarId?() : string { + function str2ab(str) { + let buf = new ArrayBuffer(str.length); // 2 bytes for each char + let bufView = new Uint8Array(buf); + for (let i=0, strLen=str.length; i= '0' && c <= '9') + offset = c.charCodeAt(0) - '0'.charCodeAt(0); + else if(c >= 'A' && c <= 'F') + offset = c.charCodeAt(0) - 'A'.charCodeAt(0) + 0x0A; + else if(c >= 'a' && c <= 'f') + offset = c.charCodeAt(0) - 'a'.charCodeAt(0) + 0x0A; + result += String.fromCharCode('a'.charCodeAt(0) + offset); + } + return result; + } catch (e) { //invalid base 64 (like music bot etc) + return undefined; + } } } @@ -368,12 +430,6 @@ class LocalClientEntry extends ClientEntry { this.handle = handle; } - - updateVariable(key: string, value: string): void { - super.updateVariable(key, value); - } - - showContextMenu(x: number, y: number, on_close: () => void = undefined): void { const _self = this; @@ -406,10 +462,10 @@ class LocalClientEntry extends ClientEntry { initializeListener(): void { super.initializeListener(); - this.htmlTag.find(".name").addClass("own_name"); + this.tag.find(".name").addClass("own_name"); const _self = this; - this.htmlTag.dblclick(function () { + this.tag.dblclick(function () { _self.openRename(); }); } @@ -417,7 +473,7 @@ class LocalClientEntry extends ClientEntry { openRename() : void { const _self = this; - const elm = this.htmlTag.find(".name"); + const elm = this.tag.find(".name"); elm.attr("contenteditable", "true"); elm.removeClass("own_name"); elm.css("background-color", "white"); @@ -449,7 +505,6 @@ class LocalClientEntry extends ClientEntry { _self.openRename(); }); }); - } } //Global functions diff --git a/js/ui/modal/ModalConnect.js b/js/ui/modal/ModalConnect.js index ccc2d457..a08faf20 100644 --- a/js/ui/modal/ModalConnect.js +++ b/js/ui/modal/ModalConnect.js @@ -50,12 +50,12 @@ var Modals; tag.find(".connect_address").on("keyup", () => updateFields()); tag.find(".connect_nickname").on("keyup", () => updateFields()); tag.find(".identity_select").on('change', function () { - globalClient.settings.changeGlobal("connect_identity_type", this.value); + settings.changeGlobal("connect_identity_type", this.value); tag.find(".error_message").hide(); tag.find(".identity_config:not(" + ".identity_config_" + this.value + ")").hide(); tag.find(".identity_config_" + this.value).show().trigger('shown'); }); - tag.find(".identity_select").val(globalClient.settings.global("connect_identity_type", "forum")); + tag.find(".identity_select").val(settings.global("connect_identity_type", "forum")); setTimeout(() => tag.find(".identity_select").trigger('change'), 0); //For some reason could not be run instantly tag.find(".identity_file").change(function () { const reader = new FileReader(); @@ -66,7 +66,7 @@ var Modals; tag.find(".error_message").text("Could not read identity! " + TSIdentityHelper.last_error()); else { tag.find(".identity_string").val(connectIdentity.exported()); - globalClient.settings.changeGlobal("connect_identity_teamspeak_identity", connectIdentity.exported()); + settings.changeGlobal("connect_identity_teamspeak_identity", connectIdentity.exported()); } (!!connectIdentity ? tag.hide : tag.show).apply(tag.find(".error_message")); updateFields(); @@ -86,13 +86,13 @@ var Modals; if (!connectIdentity) tag.find(".error_message").text("Could not parse identity! " + TSIdentityHelper.last_error()); else - globalClient.settings.changeGlobal("connect_identity_teamspeak_identity", this.value); + settings.changeGlobal("connect_identity_teamspeak_identity", this.value); } (!!connectIdentity ? tag.hide : tag.show).apply(tag.find(".error_message")); tag.find(".identity_file").val(""); updateFields(); }); - tag.find(".identity_string").val(globalClient.settings.global("connect_identity_teamspeak_identity", "")); + tag.find(".identity_string").val(settings.global("connect_identity_teamspeak_identity", "")); tag.find(".identity_config_teamspeak").on('shown', ev => { tag.find(".identity_string").trigger('change'); }); if (!forumIdentity) tag.find(".identity_config_forum").html("You cant use your TeaSpeak forum account.
You're not connected!"); diff --git a/js/ui/modal/ModalConnect.js.map b/js/ui/modal/ModalConnect.js.map index 11bb2001..f0f8ca38 100644 --- a/js/ui/modal/ModalConnect.js.map +++ b/js/ui/modal/ModalConnect.js.map @@ -1 +1 @@ -{"version":3,"file":"ModalConnect.js","sourceRoot":"","sources":["ModalConnect.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,IAAU,MAAM,CA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AAG,EAAE,CAAC,QAAQ,EAAE,CAAC;oBAC7C,YAAY,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACrI,CAAC,CAAC,CAAC;gBACH,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBACnB,MAAM,CAAC,GAAG,CAAC;YACf,CAAC;YAED,KAAK,EAAE,GAAG;SAEb,CAAC,CAAC;QACH,YAAY,CAAC,IAAI,EAAE,CAAC;IACxB,CAAC;IAlIe,wBAAiB,oBAkIhC,CAAA;IAED,IAAI,KAAK,GAAG;QACR,eAAe;QACf,MAAM,EAAE,kKAAkK;QAC1K,WAAW;QACX,KAAK,EAAE,sKAAsK;QAC7K,KAAK,EAAE,qpBAAqpB;QAC5pB,EAAE,EAAE,mwCAAmwC;KAC1wC,CAAC;AACN,CAAC,EA7IS,MAAM,KAAN,MAAM,QA6If;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG"} \ No newline at end of file diff --git a/js/ui/modal/ModalConnect.ts b/js/ui/modal/ModalConnect.ts index cd31a975..db658084 100644 --- a/js/ui/modal/ModalConnect.ts +++ b/js/ui/modal/ModalConnect.ts @@ -53,12 +53,12 @@ namespace Modals { tag.find(".connect_nickname").on("keyup", () => updateFields()); tag.find(".identity_select").on('change', function (this: HTMLSelectElement) { - globalClient.settings.changeGlobal("connect_identity_type", this.value); + settings.changeGlobal("connect_identity_type", this.value); tag.find(".error_message").hide(); tag.find(".identity_config:not(" + ".identity_config_" + this.value + ")").hide(); tag.find(".identity_config_" + this.value).show().trigger('shown'); }); - tag.find(".identity_select").val(globalClient.settings.global("connect_identity_type", "forum")); + tag.find(".identity_select").val(settings.global("connect_identity_type", "forum")); setTimeout(() => tag.find(".identity_select").trigger('change'), 0); //For some reason could not be run instantly tag.find(".identity_file").change(function (this: HTMLInputElement) { @@ -70,7 +70,7 @@ namespace Modals { if(!connectIdentity) tag.find(".error_message").text("Could not read identity! " + TSIdentityHelper.last_error()); else { tag.find(".identity_string").val((connectIdentity as TeamSpeakIdentity).exported()); - globalClient.settings.changeGlobal("connect_identity_teamspeak_identity", (connectIdentity as TeamSpeakIdentity).exported()); + settings.changeGlobal("connect_identity_teamspeak_identity", (connectIdentity as TeamSpeakIdentity).exported()); } (!!connectIdentity ? tag.hide : tag.show).apply(tag.find(".error_message")); @@ -89,13 +89,13 @@ namespace Modals { } else { connectIdentity = TSIdentityHelper.loadIdentity(this.value); if(!connectIdentity) tag.find(".error_message").text("Could not parse identity! " + TSIdentityHelper.last_error()); - else globalClient.settings.changeGlobal("connect_identity_teamspeak_identity", this.value); + else settings.changeGlobal("connect_identity_teamspeak_identity", this.value); } (!!connectIdentity ? tag.hide : tag.show).apply(tag.find(".error_message")); tag.find(".identity_file").val(""); updateFields(); }); - tag.find(".identity_string").val(globalClient.settings.global("connect_identity_teamspeak_identity", "")); + tag.find(".identity_string").val(settings.global("connect_identity_teamspeak_identity", "")); tag.find(".identity_config_teamspeak").on('shown', ev => { tag.find(".identity_string").trigger('change'); }); if(!forumIdentity) diff --git a/js/ui/modal/ModalCreateChannel.js b/js/ui/modal/ModalCreateChannel.js index be4b92a2..57512a07 100644 --- a/js/ui/modal/ModalCreateChannel.js +++ b/js/ui/modal/ModalCreateChannel.js @@ -1,37 +1,125 @@ /// var Modals; (function (Modals) { - function createChannelModal(channel) { + function createChannelModal(channel, parent, callback) { + let properties = {}; //The changes properties const modal = createModal({ - header: "Create channel", + header: channel ? "Edit channel" : "Create channel", body: () => { - let template = $("#tmpl_channel_edit").tmpl({ - channel_name: "Hello World", - myArray: [ - "A", - "B", - "C" - ] - }); + let template = $("#tmpl_channel_edit").tmpl(channel ? channel.properties : new ChannelProperties()); template = $.spawn("div").append(template); - let tag = template.tabify(); - return tag; + return template.tabify(); }, footer: () => { let footer = $.spawn("div"); footer.addClass("modal-button-group"); - footer.css("margin-top", "5px"); + footer.css("margin", "5px"); let buttonCancel = $.spawn("button"); - buttonCancel.text("Cancel"); + buttonCancel.text("Cancel").addClass("button_cancel"); let buttonOk = $.spawn("button"); - buttonOk.text("Ok"); + buttonOk.text("Ok").addClass("button_ok"); footer.append(buttonCancel); footer.append(buttonOk); return footer; }, width: 500 }); + applyGeneralListener(properties, modal.htmlTag.find(".channel_general_properties"), modal.htmlTag.find(".button_ok"), !channel); + applyStandardListener(properties, modal.htmlTag.find(".settings_standard"), modal.htmlTag.find(".button_ok"), parent, !channel); + modal.htmlTag.find(".button_ok").click(() => { + modal.close(); + callback(properties); + }); + modal.htmlTag.find(".button_cancel").click(() => { + modal.close(); + callback(); + }); + modal.open(); } Modals.createChannelModal = createChannelModal; + function applyGeneralListener(properties, tag, button, create) { + let updateButton = () => { + if (tag.find(".input_error").length == 0) + button.removeAttr("disabled"); + else + button.attr("disabled", "true"); + }; + tag.find(".channel_name").change(function () { + properties.channel_name = this.value; + $(this).removeClass("input_error"); + if (this.value.length < 1 || this.value.length > 40) + $(this).addClass("input_error"); + updateButton(); + }).prop("disabled", !create && !globalClient.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_NAME).granted(1)); + tag.find(".channel_password").change(function () { + properties.channel_flag_password = this.value.length != 0; + if (properties.channel_flag_password) + helpers.hashPassword(this.value).then(pass => properties.channel_password = pass); + $(this).removeClass("input_error"); + if (!properties.channel_flag_password) + if (globalClient.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_MODIFY_WITH_FORCE_PASSWORD).granted(1)) + $(this).addClass("input_error"); + updateButton(); + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_PASSWORD : PermissionType.B_CHANNEL_MODIFY_PASSWORD).granted(1)); + tag.find(".channel_topic").change(function () { + properties.channel_topic = this.value; + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_TOPIC : PermissionType.B_CHANNEL_MODIFY_TOPIC).granted(1)); + tag.find(".channel_description").change(function () { + properties.channel_description = this.value; + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_DESCRIPTION : PermissionType.B_CHANNEL_MODIFY_DESCRIPTION).granted(1)); + if (create) { + tag.find(".channel_name").trigger("change"); + tag.find(".channel_password").trigger('change'); + } + } + function applyStandardListener(properties, tag, button, parent, create) { + tag.find("input[name=\"channel_type\"]").change(function () { + switch (this.value) { + case "semi": + properties.channel_flag_permanent = false; + properties.channel_flag_semi_permanent = true; + break; + case "perm": + properties.channel_flag_permanent = true; + properties.channel_flag_semi_permanent = false; + break; + default: + properties.channel_flag_permanent = false; + properties.channel_flag_semi_permanent = false; + break; + } + }); + tag.find("input[name=\"channel_type\"][value=\"temp\"]") + .prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_TEMPORARY : PermissionType.B_CHANNEL_MODIFY_MAKE_TEMPORARY).granted(1)); + tag.find("input[name=\"channel_type\"][value=\"semi\"]") + .prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_SEMI_PERMANENT : PermissionType.B_CHANNEL_MODIFY_MAKE_SEMI_PERMANENT).granted(1)); + tag.find("input[name=\"channel_type\"][value=\"perm\"]") + .prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_PERMANENT : PermissionType.B_CHANNEL_MODIFY_MAKE_PERMANENT).granted(1)); + tag.find("input[name=\"channel_type\"]:not(:disabled)").last().prop("checked", true).trigger('change'); + tag.find("input[name=\"channel_default\"]").change(function () { + console.log(this.checked); + properties.channel_flag_default = this.checked; + let elements = tag.find("input[name=\"channel_type\"]"); + if (this.checked) { + elements.prop("enabled", false); + elements.prop("checked", false); + tag.find("input[name=\"channel_type\"][value=\"perm\"]").prop("checked", true).trigger("change"); + } + else + elements.removeProp("enabled"); + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_PERMANENT : PermissionType.B_CHANNEL_MODIFY_MAKE_PERMANENT).granted(1) || + !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_DEFAULT : PermissionType.B_CHANNEL_MODIFY_MAKE_DEFAULT).granted(1)); + tag.find("input[name=\"talk_power\"]").change(function () { + properties.channel_needed_talk_power = parseInt(this.value); + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_NEEDED_TALK_POWER : PermissionType.B_CHANNEL_MODIFY_NEEDED_TALK_POWER).granted(1)); + let orderTag = tag.find(".order_id"); + for (let channel of (parent ? parent.siblings() : globalClient.channelTree.rootChannel())) + $.spawn("option").attr("channelId", channel.channelId.toString()).text(channel.channelName()).appendTo(orderTag); + orderTag.change(function () { + let selected = $(this.options.item(this.selectedIndex)); + properties.channel_order = parseInt(selected.attr("channelId")); + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_SORTORDER : PermissionType.B_CHANNEL_MODIFY_SORTORDER).granted(1)); + orderTag.find("option").last().prop("selected", true); + } })(Modals || (Modals = {})); //# sourceMappingURL=ModalCreateChannel.js.map \ No newline at end of file diff --git a/js/ui/modal/ModalCreateChannel.js.map b/js/ui/modal/ModalCreateChannel.js.map index 5afc575a..eaa7e60a 100644 --- a/js/ui/modal/ModalCreateChannel.js.map +++ b/js/ui/modal/ModalCreateChannel.js.map @@ -1 +1 @@ -{"version":3,"file":"ModalCreateChannel.js","sourceRoot":"","sources":["ModalCreateChannel.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C,IAAU,MAAM,CAqCf;AArCD,WAAU,MAAM;IACZ,4BAAmC,OAAsB;QACrD,MAAM,KAAK,GAAG,WAAW,CAAC;YACtB,MAAM,EAAE,gBAAgB;YACxB,IAAI,EAAE,GAAG,EAAE;gBACP,IAAI,QAAQ,GAAG,CAAC,CAAC,oBAAoB,CAAC,CAA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,CAAC;AACL,CAAC,EA7IS,MAAM,KAAN,MAAM,QA6If"} \ No newline at end of file diff --git a/js/ui/modal/ModalCreateChannel.ts b/js/ui/modal/ModalCreateChannel.ts index d77c8339..29875ee6 100644 --- a/js/ui/modal/ModalCreateChannel.ts +++ b/js/ui/modal/ModalCreateChannel.ts @@ -1,33 +1,25 @@ /// namespace Modals { - export function createChannelModal(channel?: ChannelEntry) { + export function createChannelModal(channel: ChannelEntry | undefined, parent: ChannelEntry | undefined, callback: (ChannelProperties?: ChannelProperties) => void) { + let properties: ChannelProperties = { } as ChannelProperties; //The changes properties const modal = createModal({ - header: "Create channel", + header: channel ? "Edit channel" : "Create channel", body: () => { - let template = $("#tmpl_channel_edit").tmpl({ - channel_name: "Hello World", - myArray: [ - "A", - "B", - "C" - ] - }); + let template = $("#tmpl_channel_edit").tmpl(channel ? channel.properties : new ChannelProperties()); template = $.spawn("div").append(template); - let tag = template.tabify(); - - return tag; + return template.tabify(); }, footer: () => { let footer = $.spawn("div"); footer.addClass("modal-button-group"); - footer.css("margin-top", "5px"); + footer.css("margin", "5px"); let buttonCancel = $.spawn("button"); - buttonCancel.text("Cancel"); + buttonCancel.text("Cancel").addClass("button_cancel"); let buttonOk = $.spawn("button"); - buttonOk.text("Ok"); + buttonOk.text("Ok").addClass("button_ok"); footer.append(buttonCancel); footer.append(buttonOk); @@ -36,5 +28,117 @@ namespace Modals { }, width: 500 }); + + + applyGeneralListener(properties, modal.htmlTag.find(".channel_general_properties"), modal.htmlTag.find(".button_ok"), !channel); + applyStandardListener(properties, modal.htmlTag.find(".settings_standard"), modal.htmlTag.find(".button_ok"), parent, !channel); + + modal.htmlTag.find(".button_ok").click(() => { + modal.close(); + callback(properties); + }); + + modal.htmlTag.find(".button_cancel").click(() => { + modal.close(); + callback(); + }); + + modal.open(); + } + + function applyGeneralListener(properties: ChannelProperties, tag: JQuery, button: JQuery, create: boolean) { + let updateButton = () => { + if(tag.find(".input_error").length == 0) + button.removeAttr("disabled"); + else button.attr("disabled", "true"); + }; + + tag.find(".channel_name").change(function (this: HTMLInputElement) { + properties.channel_name = this.value; + + $(this).removeClass("input_error"); + if(this.value.length < 1 || this.value.length > 40) + $(this).addClass("input_error"); + updateButton(); + }).prop("disabled", !create && !globalClient.permissions.neededPermission(PermissionType.B_CHANNEL_MODIFY_NAME).granted(1)); + + tag.find(".channel_password").change(function (this: HTMLInputElement) { + properties.channel_flag_password = this.value.length != 0; + if(properties.channel_flag_password) + helpers.hashPassword(this.value).then(pass => properties.channel_password = pass); + + $(this).removeClass("input_error"); + if(!properties.channel_flag_password) + if(globalClient.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_MODIFY_WITH_FORCE_PASSWORD).granted(1)) + $(this).addClass("input_error"); + updateButton(); + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_PASSWORD : PermissionType.B_CHANNEL_MODIFY_PASSWORD).granted(1)); + + tag.find(".channel_topic").change(function (this: HTMLInputElement) { + properties.channel_topic = this.value; + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_TOPIC : PermissionType.B_CHANNEL_MODIFY_TOPIC).granted(1)); + + tag.find(".channel_description").change(function (this: HTMLInputElement) { + properties.channel_description = this.value; + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_DESCRIPTION : PermissionType.B_CHANNEL_MODIFY_DESCRIPTION).granted(1)); + + if(create) { + tag.find(".channel_name").trigger("change"); + tag.find(".channel_password").trigger('change'); + } + } + + function applyStandardListener(properties: ChannelProperties, tag: JQuery, button: JQuery, parent: ChannelEntry, create: boolean) { + tag.find("input[name=\"channel_type\"]").change(function (this: HTMLInputElement) { + switch(this.value) { + case "semi": + properties.channel_flag_permanent = false; + properties.channel_flag_semi_permanent = true; + break; + case "perm": + properties.channel_flag_permanent = true; + properties.channel_flag_semi_permanent = false; + break; + default: + properties.channel_flag_permanent = false; + properties.channel_flag_semi_permanent = false; + break; + } + }); + tag.find("input[name=\"channel_type\"][value=\"temp\"]") + .prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_TEMPORARY : PermissionType.B_CHANNEL_MODIFY_MAKE_TEMPORARY).granted(1)); + tag.find("input[name=\"channel_type\"][value=\"semi\"]") + .prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_SEMI_PERMANENT : PermissionType.B_CHANNEL_MODIFY_MAKE_SEMI_PERMANENT).granted(1)); + tag.find("input[name=\"channel_type\"][value=\"perm\"]") + .prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_PERMANENT : PermissionType.B_CHANNEL_MODIFY_MAKE_PERMANENT).granted(1)); + tag.find("input[name=\"channel_type\"]:not(:disabled)").last().prop("checked", true).trigger('change'); + + tag.find("input[name=\"channel_default\"]").change(function (this: HTMLInputElement) { + console.log(this.checked); + properties.channel_flag_default = this.checked; + + let elements = tag.find("input[name=\"channel_type\"]"); + if(this.checked) { + elements.prop("enabled", false); + elements.prop("checked", false); + tag.find("input[name=\"channel_type\"][value=\"perm\"]").prop("checked", true).trigger("change"); + } else elements.removeProp("enabled"); + }).prop("disabled", + !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_PERMANENT : PermissionType.B_CHANNEL_MODIFY_MAKE_PERMANENT).granted(1) || + !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_DEFAULT : PermissionType.B_CHANNEL_MODIFY_MAKE_DEFAULT).granted(1)); + + tag.find("input[name=\"talk_power\"]").change(function (this: HTMLInputElement) { + properties.channel_needed_talk_power = parseInt(this.value); + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_NEEDED_TALK_POWER : PermissionType.B_CHANNEL_MODIFY_NEEDED_TALK_POWER).granted(1)); + + let orderTag = tag.find(".order_id"); + for(let channel of (parent ? parent.siblings() : globalClient.channelTree.rootChannel())) + $.spawn("option").attr("channelId", channel.channelId.toString()).text(channel.channelName()).appendTo(orderTag); + + orderTag.change(function (this: HTMLSelectElement) { + let selected = $(this.options.item(this.selectedIndex)); + properties.channel_order = parseInt(selected.attr("channelId")); + }).prop("disabled", !globalClient.permissions.neededPermission(create ? PermissionType.B_CHANNEL_CREATE_WITH_SORTORDER : PermissionType.B_CHANNEL_MODIFY_SORTORDER).granted(1)); + orderTag.find("option").last().prop("selected", true); } } \ No newline at end of file diff --git a/js/ui/modal/ModalSettings.js b/js/ui/modal/ModalSettings.js index d9f435c3..d7245175 100644 --- a/js/ui/modal/ModalSettings.js +++ b/js/ui/modal/ModalSettings.js @@ -35,16 +35,16 @@ var Modals; initialiseVoiceListeners(modal, tag.find(".settings_voice")); } function initialiseVoiceListeners(modal, tag) { - let currentVAD = globalClient.settings.global("vad_type"); + let currentVAD = settings.global("vad_type"); tag.find("input[type=radio][name=\"vad_type\"]").change(function () { tag.find(".vad_settings .vad_type").text($(this).attr("display")); tag.find(".vad_settings .vad_type_settings").hide(); tag.find(".vad_settings .vad_type_" + this.value).show(); - globalClient.settings.changeGlobal("vad_type", this.value); + settings.changeGlobal("vad_type", this.value); globalClient.voiceConnection.voiceRecorder.reinitialiseVAD(); switch (this.value) { case "ppt": - let keyCode = parseInt(globalClient.settings.global("vad_ppt_key", 84 /* T */.toString())); + let keyCode = parseInt(settings.global("vad_ppt_key", 84 /* T */.toString())); tag.find(".vat_ppt_key").text(String.fromCharCode(keyCode)); break; case "vad": @@ -78,7 +78,7 @@ var Modals; $(document).one("keypress", function (e) { console.log("Got key " + e.keyCode); modal.close(); - globalClient.settings.changeGlobal("vad_ppt_key", e.keyCode.toString()); + settings.changeGlobal("vad_ppt_key", e.keyCode.toString()); globalClient.voiceConnection.voiceRecorder.reinitialiseVAD(); tag.find(".vat_ppt_key").text(String.fromCharCode(e.keyCode)); }); @@ -87,7 +87,7 @@ var Modals; //VAD VAD let slider = tag.find(".vad_vad_slider"); slider.on("input change", () => { - globalClient.settings.changeGlobal("vad_threshold", slider.val().toString()); + settings.changeGlobal("vad_threshold", slider.val().toString()); let vad = globalClient.voiceConnection.voiceRecorder.getVADHandler(); if (vad instanceof VoiceActivityDetectorVAD) vad.percentageThreshold = slider.val(); diff --git a/js/ui/modal/ModalSettings.js.map b/js/ui/modal/ModalSettings.js.map index 647eb8bc..d3fa8ff4 100644 --- a/js/ui/modal/ModalSettings.js.map +++ b/js/ui/modal/ModalSettings.js.map @@ -1 +1 @@ -{"version":3,"file":"ModalSettings.js","sourceRoot":"","sources":["ModalSettings.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,2CAA2C;AAC3C,uCAAuC;AAEvC,IAAU,MAAM,CAuJf;AAvJD,WAAU,MAAM;IACZ;QACI,IAAI,KAAK,CAAC;QACV,KAAK,GAAG,WAAW,CAAC;YAChB,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,GAAG,EAAE;gBACP,IAAI,QAAQ,GAAG,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC1C,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;gBAC3C,0BAA0B,CAAC,KAAK,EAAC,QAAQ,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC/D,MAAM,CAAC,QAAQ,CAAC;YACpB,CAAC;YACD,MAAM,EAAE,GAAG,EAAE;gBACT,IAAI,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;gBAC5B,MAAM,CAAC,QAAQ,CAAC,oBAAoB,CAAC,CAAC;gBACtC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;gBAChC,MAAM,CAAC,GAAG,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC;gBACnC,MAAM,CAAC,GAAG,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;gBAElC,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BACxC,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;oBAC1C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;oBACxB,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;oBAErB,EAAE,CAAA,CAAC,eAAe,IAAI,MAAM,CAAC,QAAQ,IAAI,eAAe,CAAC;wBACrD,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;gBACrC,CAAC;YACL,CAAC;QACL,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;YACb,OAAO,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;YACnD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YACrB,YAAY,CAAC,IAAI,CAAC,4BAA4B,CAAC,CAAC,IAAI,EAAE,CAAC;QAC3D,CAAC,CAAC,CAAC;QAEH,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;YACnB,IAAI,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC;YACrD,IAAI,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;YAChD,OAAO,CAAC,GAAG,CAAC,mBAAmB,GAAG,QAAQ,CAAC,CAAC;YAC5C,YAAY,CAAC,eAAe,CAAC,aAAa,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;QACtE,CAAC,CAAC,CAAC;IACR,CAAC;AACJ,CAAC,EAvJS,MAAM,KAAN,MAAM,QAuJf"} \ No newline at end of file diff --git a/js/ui/modal/ModalSettings.ts b/js/ui/modal/ModalSettings.ts index a6250d01..e342c1f0 100644 --- a/js/ui/modal/ModalSettings.ts +++ b/js/ui/modal/ModalSettings.ts @@ -38,18 +38,18 @@ namespace Modals { } function initialiseVoiceListeners(modal: Modal, tag: JQuery) { - let currentVAD = globalClient.settings.global("vad_type"); + let currentVAD = settings.global("vad_type"); tag.find("input[type=radio][name=\"vad_type\"]").change(function (this: HTMLButtonElement) { tag.find(".vad_settings .vad_type").text($(this).attr("display")); tag.find(".vad_settings .vad_type_settings").hide(); tag.find(".vad_settings .vad_type_" + this.value).show(); - globalClient.settings.changeGlobal("vad_type", this.value); + settings.changeGlobal("vad_type", this.value); globalClient.voiceConnection.voiceRecorder.reinitialiseVAD(); switch (this.value) { case "ppt": - let keyCode: number = parseInt(globalClient.settings.global("vad_ppt_key", Key.T.toString())); + let keyCode: number = parseInt(settings.global("vad_ppt_key", Key.T.toString())); tag.find(".vat_ppt_key").text(String.fromCharCode(keyCode)); break; case "vad": @@ -86,7 +86,7 @@ namespace Modals { $(document).one("keypress", function (e) { console.log("Got key " + e.keyCode); modal.close(); - globalClient.settings.changeGlobal("vad_ppt_key", e.keyCode.toString()); + settings.changeGlobal("vad_ppt_key", e.keyCode.toString()); globalClient.voiceConnection.voiceRecorder.reinitialiseVAD(); tag.find(".vat_ppt_key").text(String.fromCharCode(e.keyCode)); }); @@ -97,7 +97,7 @@ namespace Modals { //VAD VAD let slider = tag.find(".vad_vad_slider"); slider.on("input change", () => { - globalClient.settings.changeGlobal("vad_threshold", slider.val().toString()); + settings.changeGlobal("vad_threshold", slider.val().toString()); let vad = globalClient.voiceConnection.voiceRecorder.getVADHandler(); if(vad instanceof VoiceActivityDetectorVAD) vad.percentageThreshold = slider.val() as number; diff --git a/js/ui/server.js b/js/ui/server.js index 476102c9..5aa1a8da 100644 --- a/js/ui/server.js +++ b/js/ui/server.js @@ -24,7 +24,7 @@ class ServerEntry { let tag = $.spawn("div"); tag.attr("id", "server"); tag.addClass("server"); - tag.append("
"); + tag.append($.spawn("div").addClass("server_type icon client-server_green")); tag.append("" + this.properties.virtualserver_name + ""); const serverIcon = $(""); //we cant spawn an icon on creation :) @@ -37,13 +37,15 @@ class ServerEntry { this._htmlTag.click(function () { _this.channelTree.onSelect(_this); }); - this.htmlTag.on("contextmenu", function (event) { - _this.channelTree.onSelect(_this); - event.preventDefault(); - _this.spawnContextMenue(event.pageY, event.pageY, () => { _this.channelTree.onSelect(undefined); }); - }); + if (!settings.static(Settings.KEY_DISABLE_CONTEXT_MENU, false)) { + this.htmlTag.on("contextmenu", function (event) { + event.preventDefault(); + _this.channelTree.onSelect(_this); + _this.spawnContextMenu(event.pageX, event.pageY, () => { _this.channelTree.onSelect(undefined); }); + }); + } } - spawnContextMenue(x, y, on_close = () => { }) { + spawnContextMenu(x, y, on_close = () => { }) { spawnMenu(x, y, { type: MenuEntryType.ENTRY, icon: "", @@ -52,7 +54,7 @@ class ServerEntry { }, MenuEntry.CLOSE(on_close)); } updateProperty(key, value) { - console.trace("Updating property " + key + " => '" + value + "' for the server"); + console.log("Updating property " + key + " => '" + value + "' for the server"); this.properties[key] = value; if (key == "virtualserver_name") { this.htmlTag.find(".name").text(value); diff --git a/js/ui/server.js.map b/js/ui/server.js.map index 03ea7e1a..73338c3b 100644 --- a/js/ui/server.js.map +++ b/js/ui/server.js.map @@ -1 +1 @@ -{"version":3,"file":"server.js","sourceRoot":"","sources":["server.ts"],"names":[],"mappings":"AAAA,mCAAmC;AAEnC;IAoBI,YAAY,IAAI,EAAE,IAAI;QAlBtB,eAAU,GAAQ;YACd,kBAAkB,EAAE,EAAE;YACtB,qBAAqB,EAAE,CAAC;YACxB,qBAAqB,EAAE,SAAS;YAChC,sBAAsB,EAAE,SAAS;YACjC,+BAA+B,EAAE,EAAE;YAEnC,2BAA2B,EAAE,CAAC;YAC9B,gCAAgC,EAAE,CAAC;YACnC,4BAA4B,EAAE,CAAC;YAC/B,oBAAoB,EAAE,CAAC;YACvB,wBAAwB,EAAE,CAAC;SAC9B,CAAC;QAEF,oBAAe,GAAW,CAAC,CAAC;QAC5B,oBAAe,GAAW,CAAC,CAAC;QAIxB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,UAAU,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAC9C,CAAC;IAED,IAAI,OA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C,WAAW,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;QAChL,CAAC;IACL,CAAC;IAED,gBAAgB;QACZ,IAAI,CAAC,eAAe,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;QAC5C,IAAI,CAAC,eAAe,GAAI,IAAI,CAAC,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC;QACzD,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,oBAAoB,CAAC,CAAC;IAC/E,CAAC;IAED,sBAAsB;QAClB,MAAM,CAAC,IAAI,CAAC,eAAe,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;IACvD,CAAC;IAED,eAAe;QACX,EAAE,CAAA,CAAC,IAAI,CAAC,UAAU,CAAC,oBAAoB,IAAI,CAAC,IAAI,IAAI,CAAC,eAAe,IAAI,CAAC,CAAC;YAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;QACxI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,oBAAoB,CAAC,GAAG,CAAC,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC;IACxH,CAAC;CACJ"} \ No newline at end of file diff --git a/js/ui/server.ts b/js/ui/server.ts index e8de229f..8e1d6f7a 100644 --- a/js/ui/server.ts +++ b/js/ui/server.ts @@ -32,7 +32,7 @@ class ServerEntry { tag.attr("id", "server"); tag.addClass("server"); - tag.append("
"); + tag.append($.spawn("div").addClass("server_type icon client-server_green")); tag.append("" + this.properties.virtualserver_name + ""); @@ -50,14 +50,17 @@ class ServerEntry { this._htmlTag.click(function () { _this.channelTree.onSelect(_this); }); - this.htmlTag.on("contextmenu", function (event) { - _this.channelTree.onSelect(_this); - event.preventDefault(); - _this.spawnContextMenue(event.pageY, event.pageY, () => { _this.channelTree.onSelect(undefined); }); - }); + + if(!settings.static(Settings.KEY_DISABLE_CONTEXT_MENU, false)) { + this.htmlTag.on("contextmenu", function (event) { + event.preventDefault(); + _this.channelTree.onSelect(_this); + _this.spawnContextMenu(event.pageX, event.pageY, () => { _this.channelTree.onSelect(undefined); }); + }); + } } - spawnContextMenue(x: number, y: number, on_close: () => void = () => {}) { + spawnContextMenu(x: number, y: number, on_close: () => void = () => {}) { spawnMenu(x, y, { type: MenuEntryType.ENTRY, icon: "", @@ -69,7 +72,7 @@ class ServerEntry { } updateProperty(key, value) : void { - console.trace("Updating property " + key + " => '" + value + "' for the server"); + console.log("Updating property " + key + " => '" + value + "' for the server"); this.properties[key] = value; if(key == "virtualserver_name") { this.htmlTag.find(".name").text(value); diff --git a/js/ui/view.js b/js/ui/view.js index 935e8de6..7630752a 100644 --- a/js/ui/view.js +++ b/js/ui/view.js @@ -4,11 +4,34 @@ /// /// /// +/// class ChannelTree { constructor(client, htmlTree) { this.client = client; this.htmlTree = htmlTree; this.reset(); + if (!settings.static(Settings.KEY_DISABLE_CONTEXT_MENU, false)) { + let _this = this; + this.htmlTree.parent().on("contextmenu", function (event) { + if (event.isDefaultPrevented()) + return; + event.preventDefault(); + _this.onSelect(undefined); + _this.showContextMenu(event.pageX, event.pageY); + }); + } + } + showContextMenu(x, y, on_close = undefined) { + let channelCreate = this.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_TEMPORARY).granted(1) || + this.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_SEMI_PERMANENT).granted(1) || + this.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_PERMANENT).granted(1); + spawnMenu(x, y, { + type: MenuEntryType.ENTRY, + icon: "client-channel_create", + name: "Create channel", + invalidPermission: !channelCreate, + callback: () => this.spawnCreateChannel() + }, MenuEntry.CLOSE(on_close)); } initialiseHead(serverName) { this.server = new ServerEntry(this, serverName); @@ -16,8 +39,9 @@ class ChannelTree { this.server.initializeListener(); } __deleteAnimation(element) { - $(this.htmlTree).find(element.htmlTag).fadeOut("slow", function () { - $(this).remove(); + let tag = element instanceof ChannelEntry ? element.rootTag() : element.tag; + this.htmlTree.find(tag).fadeOut("slow", () => { + tag.remove(); if (element instanceof ChannelEntry) { if (element.parentChannel()) element.parentChannel().adjustSize(true); @@ -27,6 +51,9 @@ class ChannelTree { } }); } + rootChannel() { + return this.channels.filter(e => e.parent == undefined); + } deleteChannel(channel) { const _this = this; for (let index = 0; index < this.channels.length; index++) { @@ -58,19 +85,19 @@ class ChannelTree { let parent = channel.parentChannel(); let siblings = parent.siblings(); if (siblings.length == 0) { - elm = parent.htmlTag; + elm = parent.rootTag(); prevChannel = null; } else { prevChannel = siblings.last(); - elm = prevChannel.htmlTag; + elm = prevChannel.tag; } tag = parent.siblingTag(); } channel.prevChannel = prevChannel; - let entry = channel.htmlTag.css({ display: "none" }).fadeIn("slow"); + let entry = channel.rootTag().css({ display: "none" }).fadeIn("slow"); entry.appendTo(tag); - channel.originalHeight = entry.outerHeight(true); + channel.originalHeight = entry.outerHeight(false); if (elm != undefined) elm.after(entry); channel.adjustSize(true); @@ -91,21 +118,21 @@ class ChannelTree { channel.prevChannel = prevChannel; channel.parent = parent; if (prevChannel) - prevChannel.htmlTag.after(channel.htmlTag); + prevChannel.rootTag().after(channel.rootTag()); else { if (parent) { - var siblings = parent.siblings(); + let siblings = parent.siblings(); if (siblings.length <= 1) { - var left = channel.htmlTag; + let left = channel.rootTag(); left.appendTo($(parent.siblingTag())); } else { channel.prevChannel = siblings[siblings.length - 2]; - channel.prevChannel.htmlTag.after(channel.htmlTag); + channel.prevChannel.rootTag().after(channel.rootTag()); } } else - this.htmlTree.find(".server").after(channel.htmlTag); + this.htmlTree.find(".server").after(channel.rootTag()); } if (oldParent) oldParent.adjustSize(); @@ -125,10 +152,11 @@ class ChannelTree { this.clients.push(client); client.channelTree = this; client["_channel"] = channel; - let tag = client.htmlTag.css({ display: "none" }).fadeIn("slow"); + let tag = client.tag.css({ display: "none" }).fadeIn("slow"); tag.appendTo(channel.clientTag()); channel.adjustSize(true); client.initializeListener(); + channel.updateChannelTypeIcon(); return client; } registerClient(client) { @@ -139,13 +167,17 @@ class ChannelTree { moveClient(client, channel) { let oldChannel = client.currentChannel(); client["_channel"] = channel; - let tag = client.htmlTag; + let tag = client.tag; tag.detach(); tag.appendTo(client.currentChannel().clientTag()); - if (oldChannel) + if (oldChannel) { oldChannel.adjustSize(); - if (client.currentChannel()) + oldChannel.updateChannelTypeIcon(); + } + if (client.currentChannel()) { client.currentChannel().adjustSize(); + client.currentChannel().updateChannelTypeIcon(); + } } findClient(clientId) { for (let index = 0; index < this.clients.length; index++) @@ -154,13 +186,13 @@ class ChannelTree { return null; } onSelect(entry) { - $(this.htmlTree).find(".selected").each(function (idx, e) { + this.htmlTree.find(".selected").each(function (idx, e) { $(e).removeClass("selected"); }); if (entry instanceof ChannelEntry) - entry.htmlTag.find("> .channelLine").addClass("selected"); + entry.rootTag().find("> .channelLine").addClass("selected"); else if (entry instanceof ClientEntry) - entry.htmlTag.addClass("selected"); + entry.tag.addClass("selected"); else if (entry instanceof ServerEntry) entry.htmlTag.addClass("selected"); this.client.selectInfo.currentSelected = entry; @@ -187,5 +219,14 @@ class ChannelTree { this.channels = []; this.htmlTree.empty(); } + spawnCreateChannel(parent) { + Modals.createChannelModal(undefined, parent, (properties) => { + if (!properties) + return; + properties["cpid"] = parent ? parent.channelId : 0; + log.debug(LogCategory.CHANNEL, "Creating new channel with properties: %o", properties); + this.client.serverConnection.sendCommand("channelcreate", properties); + }); + } } //# sourceMappingURL=view.js.map \ No newline at end of file diff --git a/js/ui/view.js.map b/js/ui/view.js.map index 644c976d..ded83bd0 100644 --- a/js/ui/view.js.map +++ b/js/ui/view.js.map @@ -1 +1 @@ -{"version":3,"file":"view.js","sourceRoot":"","sources":["view.ts"],"names":[],"mapp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AAC;IAED,KAAK;QACD,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,IAAI,CAAC,QAAQ,GAAG,EAAE,CAAC;QACnB,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED,kBAAkB,CAAC,MAAqB;QACpC,MAAM,CAAC,kBAAkB,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,UAA8B,EAAE,EAAE;YAC5E,EAAE,CAAA,CAAC,CAAC,UAAU,CAAC;gBAAC,MAAM,CAAC;YACvB,UAAU,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC;YACnD,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,OAAO,EAAE,0CAA0C,EAAE,UAAU,CAAC,CAAC;YACvF,IAAI,CAAC,MAAM,CAAC,gBAAgB,CAAC,WAAW,CAAC,eAAe,EAAE,UAAU,CAAC,CAAC;QAC1E,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"} \ No newline at end of file diff --git a/js/ui/view.ts b/js/ui/view.ts index d54366ec..1ba013db 100644 --- a/js/ui/view.ts +++ b/js/ui/view.ts @@ -4,6 +4,7 @@ /// /// /// +/// class ChannelTree { client: TSClient; @@ -16,6 +17,35 @@ class ChannelTree { this.client = client; this.htmlTree = htmlTree; this.reset(); + + if(!settings.static(Settings.KEY_DISABLE_CONTEXT_MENU, false)) { + let _this = this; + this.htmlTree.parent().on("contextmenu", function (event) { + if(event.isDefaultPrevented()) return; + + event.preventDefault(); + _this.onSelect(undefined); + _this.showContextMenu(event.pageX, event.pageY); + }); + } + } + + showContextMenu(x: number, y: number, on_close: () => void = undefined) { + let channelCreate = + this.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_TEMPORARY).granted(1) || + this.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_SEMI_PERMANENT).granted(1) || + this.client.permissions.neededPermission(PermissionType.B_CHANNEL_CREATE_PERMANENT).granted(1); + + spawnMenu(x, y, + { + type: MenuEntryType.ENTRY, + icon: "client-channel_create", + name: "Create channel", + invalidPermission: !channelCreate, + callback: () => this.spawnCreateChannel() + }, + MenuEntry.CLOSE(on_close) + ); } initialiseHead(serverName: string) { @@ -25,8 +55,9 @@ class ChannelTree { } private __deleteAnimation(element: ChannelEntry | ClientEntry) { - $(this.htmlTree).find(element.htmlTag).fadeOut("slow", function () { - $(this).remove(); + let tag = element instanceof ChannelEntry ? element.rootTag() : element.tag; + this.htmlTree.find(tag).fadeOut("slow", () => { + tag.remove(); if(element instanceof ChannelEntry) { if(element.parentChannel()) element.parentChannel().adjustSize(true); @@ -36,6 +67,10 @@ class ChannelTree { }); } + rootChannel() : ChannelEntry[] { + return this.channels.filter(e => e.parent == undefined); + } + deleteChannel(channel: ChannelEntry) { const _this = this; for(let index = 0; index < this.channels.length; index++) { @@ -68,19 +103,19 @@ class ChannelTree { let parent = channel.parentChannel(); let siblings = parent.siblings(); if(siblings.length == 0) { - elm = parent.htmlTag; + elm = parent.rootTag(); prevChannel = null; } else { prevChannel = siblings.last(); - elm = prevChannel.htmlTag; + elm = prevChannel.tag; } tag = parent.siblingTag(); } channel.prevChannel = prevChannel; - let entry = channel.htmlTag.css({display: "none"}).fadeIn("slow"); + let entry = channel.rootTag().css({display: "none"}).fadeIn("slow"); entry.appendTo(tag); - channel.originalHeight = entry.outerHeight(true); + channel.originalHeight = entry.outerHeight(false); if(elm != undefined) elm.after(entry); @@ -104,19 +139,19 @@ class ChannelTree { channel.parent = parent; if(prevChannel) - prevChannel.htmlTag.after(channel.htmlTag); + prevChannel.rootTag().after(channel.rootTag()); else { if(parent) { - var siblings = parent.siblings(); + let siblings = parent.siblings(); if(siblings.length <= 1) { //Self should be already in there - var left = channel.htmlTag; + let left = channel.rootTag(); left.appendTo($(parent.siblingTag())); } else { channel.prevChannel = siblings[siblings.length - 2]; - channel.prevChannel.htmlTag.after(channel.htmlTag); + channel.prevChannel.rootTag().after(channel.rootTag()); } } else - this.htmlTree.find(".server").after(channel.htmlTag); + this.htmlTree.find(".server").after(channel.rootTag()); } @@ -138,11 +173,12 @@ class ChannelTree { client.channelTree = this; client["_channel"] = channel; - let tag = client.htmlTag.css({display: "none"}).fadeIn("slow"); + let tag = client.tag.css({display: "none"}).fadeIn("slow"); tag.appendTo(channel.clientTag()); channel.adjustSize(true); client.initializeListener(); + channel.updateChannelTypeIcon(); return client; } @@ -156,11 +192,17 @@ class ChannelTree { let oldChannel = client.currentChannel(); client["_channel"] = channel; - let tag = client.htmlTag; + let tag = client.tag; tag.detach(); tag.appendTo(client.currentChannel().clientTag()); - if(oldChannel) oldChannel.adjustSize(); - if(client.currentChannel()) client.currentChannel().adjustSize(); + if(oldChannel) { + oldChannel.adjustSize(); + oldChannel.updateChannelTypeIcon(); + } + if(client.currentChannel()) { + client.currentChannel().adjustSize(); + client.currentChannel().updateChannelTypeIcon(); + } } findClient(clientId) : ClientEntry { @@ -170,14 +212,14 @@ class ChannelTree { } onSelect(entry?: ChannelEntry | ClientEntry | ServerEntry) { - $(this.htmlTree).find(".selected").each(function (idx, e) { + this.htmlTree.find(".selected").each(function (idx, e) { $(e).removeClass("selected"); }); if(entry instanceof ChannelEntry) - (entry as ChannelEntry).htmlTag.find("> .channelLine").addClass("selected"); + (entry as ChannelEntry).rootTag().find("> .channelLine").addClass("selected"); else if(entry instanceof ClientEntry) - (entry as ClientEntry).htmlTag.addClass("selected"); + (entry as ClientEntry).tag.addClass("selected"); else if(entry instanceof ServerEntry) (entry as ServerEntry).htmlTag.addClass("selected"); this.client.selectInfo.currentSelected = entry; @@ -211,4 +253,13 @@ class ChannelTree { this.channels = []; this.htmlTree.empty(); } + + spawnCreateChannel(parent?: ChannelEntry) { + Modals.createChannelModal(undefined, parent, (properties?: ChannelProperties) => { + if(!properties) return; + properties["cpid"] = parent ? parent.channelId : 0; + log.debug(LogCategory.CHANNEL, "Creating new channel with properties: %o", properties); + this.client.serverConnection.sendCommand("channelcreate", properties); + }); + } } \ No newline at end of file diff --git a/js/utils/helpers.ts b/js/utils/helpers.ts new file mode 100644 index 00000000..d9bf0041 --- /dev/null +++ b/js/utils/helpers.ts @@ -0,0 +1,11 @@ +/// + +namespace helpers { + export function hashPassword(password: string) : Promise { + return new Promise((resolve, reject) => { + sha.sha1(password).then(result => { + resolve(btoa(String.fromCharCode.apply(null, new Uint8Array(result)))); + }); + }); + } +} \ No newline at end of file diff --git a/js/utils/modal.js b/js/utils/modal.js index bc7141d1..1f7b802a 100644 --- a/js/utils/modal.js +++ b/js/utils/modal.js @@ -67,9 +67,12 @@ class Modal { constructor(props) { this.properties = props; } + get htmlTag() { + if (!this._htmlTag) + this._create(); + return this._htmlTag; + } _create() { - if (this.htmlTag) - return; let modal = $.spawn("div"); modal.addClass("modal"); let content = $.spawn("div"); @@ -88,10 +91,9 @@ class Modal { if (this.properties.closeable) this.close(); }.bind(this)); - this.htmlTag = modal; + this._htmlTag = modal; } open() { - this._create(); this.htmlTag.appendTo($("body")); this.htmlTag.show(); } @@ -117,10 +119,9 @@ function createInputModal(headMessage, question, validator, callback, props = {} let body = $.spawn("div"); ModalFunctions.divify(ModalFunctions.jqueriefy(question)).appendTo(body); let input = $.spawn("input"); - input.width("100%"); - if (props.maxLength) - input.attr("maxlength", props.maxLength); + input.css("width", "100%"); input.appendTo(body); + console.log(input); let footer = $.spawn("div"); footer.addClass("modal-button-group"); footer.css("margin-top", "5px"); diff --git a/js/utils/modal.js.map b/js/utils/modal.js.map index b5da0e72..fbced071 100644 --- a/js/utils/modal.js.map +++ b/js/utils/modal.js.map @@ -1 +1 @@ -{"version":3,"file":"modal.js","sourceRoot":"","sources":["modal.ts"],"names":[],"mappings":"AAAA,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,WAAW,EAAC,UAAU,CAAC;IAClC,EAAE,CAAA,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,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AAC;IAClB,CAAC,CAAC,CAAC;IAEH,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IACpB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,KAAK,CAAC,aAAa,GAAG,GAAG,EAAE,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACnD,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC;IAC3B,MAAM,CAAC,KAAK,CAAC;AACjB,CAAC;AAED,0BAA0B,MAAmB,EAAE,OAAoB,EAAE,QAA+B,EAAE,MAAM,EAAE,EAAE,EAAE;IAC9G,KAAK,GAAG,cAAc,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IAE7C,IAAI,IAAI,GAAG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC1B,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC;IAClC,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACvE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IAEpB,KAAK,CAAC,IAAI,GAAG,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC;IACtE,KAAK,CAAC,MAAM,GAAG,cAAc,CAAC,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,CAAC;IAEnE,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC"} \ No newline at end of file diff --git a/js/utils/modal.ts b/js/utils/modal.ts index 7e0fcc6d..76aa2764 100644 --- a/js/utils/modal.ts +++ b/js/utils/modal.ts @@ -66,15 +66,19 @@ class ModalProperties { } class Modal { - htmlTag: JQuery; + private _htmlTag: JQuery; properties: ModalProperties; constructor(props: ModalProperties) { this.properties = props; } + get htmlTag() : JQuery { + if(!this._htmlTag) this._create(); + return this._htmlTag; + } + private _create() { - if(this.htmlTag) return; let modal = $.spawn("div"); modal.addClass("modal"); @@ -99,11 +103,10 @@ class Modal { this.close(); }.bind(this)); - this.htmlTag = modal; + this._htmlTag = modal; } open() { - this._create(); this.htmlTag.appendTo($("body")); this.htmlTag.show(); } @@ -137,10 +140,9 @@ function createInputModal(headMessage: BodyCreator, question: BodyCreator, valid let body = $.spawn("div"); ModalFunctions.divify(ModalFunctions.jqueriefy(question)).appendTo(body); let input = $.spawn("input"); - input.width("100%"); - if(props.maxLength) - input.attr("maxlength", props.maxLength); + input.css("width", "100%"); input.appendTo(body); + console.log(input); let footer = $.spawn("div"); footer.addClass("modal-button-group"); diff --git a/js/utils/tab.js b/js/utils/tab.js index 3c4b6674..3da7ce54 100644 --- a/js/utils/tab.js +++ b/js/utils/tab.js @@ -1,15 +1,20 @@ -class X_Tab extends HTMLElement { +if (typeof (customElements) !== "undefined") { + class X_Tab extends HTMLElement { + } + class X_Entry extends HTMLElement { + } + class X_Tag extends HTMLElement { + } + class X_Content extends HTMLElement { + } + customElements.define('x-tab', X_Tab, { extends: 'div' }); + customElements.define('x-entry', X_Entry, { extends: 'div' }); + customElements.define('x-tag', X_Tag, { extends: 'div' }); + customElements.define('x-content', X_Content, { extends: 'div' }); } -class X_Entry extends HTMLElement { +else { + console.warn("Could not defied tab customElements!"); } -class X_Tag extends HTMLElement { -} -class X_Content extends HTMLElement { -} -customElements.define('x-tab', X_Tab, { extends: 'div' }); -customElements.define('x-entry', X_Entry, { extends: 'div' }); -customElements.define('x-tag', X_Tag, { extends: 'div' }); -customElements.define('x-content', X_Content, { extends: 'div' }); var TabFunctions = { tabify(template) { console.log("Tabify:"); diff --git a/js/utils/tab.js.map b/js/utils/tab.js.map index 82255604..b5f26c9c 100644 --- a/js/utils/tab.js.map +++ b/js/utils/tab.js.map @@ -1 +1 @@ -{"version":3,"file":"tab.js","sourceRoot":"","sources":["tab.ts"],"names":[],"mappings":"AAQA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AC;QACH,MAAM,CAAC,IAAI,CAAC;IAChB,CAAC,CAAA;AACL,CAAC"} \ No newline at end of file diff --git a/js/utils/tab.ts b/js/utils/tab.ts index b75885e7..956231fd 100644 --- a/js/utils/tab.ts +++ b/js/utils/tab.ts @@ -6,15 +6,20 @@ interface JQuery { changeElementType(type: string) : JQuery; } -class X_Tab extends HTMLElement {} -class X_Entry extends HTMLElement {} -class X_Tag extends HTMLElement {} -class X_Content extends HTMLElement {} +if(typeof (customElements) !== "undefined") { + class X_Tab extends HTMLElement {} + class X_Entry extends HTMLElement {} + class X_Tag extends HTMLElement {} + class X_Content extends HTMLElement {} + + customElements.define('x-tab', X_Tab, { extends: 'div' }); + customElements.define('x-entry', X_Entry, { extends: 'div' }); + customElements.define('x-tag', X_Tag, { extends: 'div' }); + customElements.define('x-content', X_Content, { extends: 'div' }); +} else { + console.warn("Could not defied tab customElements!"); +} -customElements.define('x-tab', X_Tab, { extends: 'div' }); -customElements.define('x-entry', X_Entry, { extends: 'div' }); -customElements.define('x-tag', X_Tag, { extends: 'div' }); -customElements.define('x-content', X_Content, { extends: 'div' }); var TabFunctions = { tabify(template: JQuery) : JQuery { console.log("Tabify:"); diff --git a/js/voice/VoiceHandler.js b/js/voice/VoiceHandler.js index 5c5167bf..c180b730 100644 --- a/js/voice/VoiceHandler.js +++ b/js/voice/VoiceHandler.js @@ -11,6 +11,13 @@ class CodecPool { this.handle = handle; this.codecIndex = index; } + initialize(cached) { + for (let i = 0; i < cached; i++) + this.ownCodec(i); + for (let i = 0; i < cached; i++) + this.releaseCodec(i); + } + supported() { return this.creator != undefined; } ownCodec(clientId, create = true) { if (!this.creator) return null; @@ -64,6 +71,11 @@ class VoiceConnection { this.voiceRecorder.on_data = this.handleVoiceData.bind(this); this.voiceRecorder.on_end = this.handleVoiceEnded.bind(this); this.voiceRecorder.reinitialiseVAD(); + this.codecPool[4].initialize(2); + this.codecPool[5].initialize(2); + } + codecSupported(type) { + return this.codecPool.length > type && this.codecPool[type].supported(); } sendVoicePacket(data, codec) { if (this.dataChannel) { diff --git a/js/voice/VoiceHandler.js.map b/js/voice/VoiceHandler.js.map index 16bef064..7f41011b 100644 --- a/js/voice/VoiceHandler.js.map +++ b/js/voice/VoiceHandler.js.map @@ -1 +1 @@ -{"version":3,"file":"VoiceHandler.js","sourceRoot":"","sources":["VoiceHandler.ts"],"names":[],"mappings":"AAAA,qCAAqC;AACrC,0CAA0C;AAC1C,yCAAyC;AAEzC;CAKC;AAED;IA0CI,YAAY,MAAuB,EAAE,KAAa,EAAE,OAAyB;QArC7E,YAAO,GAAqB,EAAE,CAAC;QAC/B,iBAAY,GAAW,CAAC,CAAC;QAqCrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;IAC5B,CAAC;IAtCD,QAAQ,CAAE,QAAgB,EAAE,SAAkB,IAAI;QAC9C,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC;QAE9B,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,GAAG,CAAA,CAAC,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC;YACtD,EAAE,CAAA,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,KAAK,IAAI,QAAQ,CAAC,CAAC,CAAC;gBACvC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;gBACvD,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC;YACxC,CAAC;YAAC,IAAI,CAAC,EAAE,CAAA,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,KAAK,CA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AAC,kBAAkB,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,EAAC,IAAI,CAAC,CAAC,CAAC,yBAAyB;QACjH,0DAA0D;IAC9D,CAAC;IAEO,gBAAgB;QACpB,EAAE,CAAA,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC;YAAC,MAAM,CAAC;QAE/B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAC3B,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,QAAQ,GAAG,KAAK,CAAC;QACzC,IAAI,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,yBAAyB;IACzE,CAAC;CACJ"} \ No newline at end of file diff --git a/js/voice/VoiceHandler.ts b/js/voice/VoiceHandler.ts index 75c25346..9b94392e 100644 --- a/js/voice/VoiceHandler.ts +++ b/js/voice/VoiceHandler.ts @@ -17,6 +17,15 @@ class CodecPool { entries: CodecPoolEntry[] = []; maxInstances: number = 2; + initialize(cached: number) { + for(let i = 0; i < cached; i++) + this.ownCodec(i); + for(let i = 0; i < cached; i++) + this.releaseCodec(i); + } + + supported() { return this.creator != undefined; } + ownCodec?(clientId: number, create: boolean = true) : BasicCodec { if(!this.creator) return null; @@ -72,6 +81,7 @@ class VoiceConnection { new CodecPool(this,3,undefined), //CELT Mono new CodecPool(this,4,() => { return new CodecWrapper(CodecWorkerType.WORKER_OPUS, 1) }), //opus voice new CodecPool(this,5,() => { return new CodecWrapper(CodecWorkerType.WORKER_OPUS, 2) }) //opus music + //FIXME Why is it at index 5 currently only 1? ]; @@ -84,6 +94,13 @@ class VoiceConnection { this.voiceRecorder.on_data = this.handleVoiceData.bind(this); this.voiceRecorder.on_end = this.handleVoiceEnded.bind(this); this.voiceRecorder.reinitialiseVAD(); + + this.codecPool[4].initialize(2); + this.codecPool[5].initialize(2); + } + + codecSupported(type: number) : boolean { + return this.codecPool.length > type && this.codecPool[type].supported(); } sendVoicePacket(data: Uint8Array, codec: number) { diff --git a/js/voice/VoiceRecorder.js b/js/voice/VoiceRecorder.js index 2bd27e81..0f4cd6f4 100644 --- a/js/voice/VoiceRecorder.js +++ b/js/voice/VoiceRecorder.js @@ -21,7 +21,7 @@ class VoiceRecorder { this._chunkCount = 0; this.handle = handle; this.userMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; - this._deviceId = handle.client.settings.global("microphone_id", "default"); + this._deviceId = settings.global("microphone_id", "default"); this.audioContext = AudioController.globalContext; this.processor = this.audioContext.createScriptProcessor(VoiceRecorder.BUFFER_SIZE, VoiceRecorder.CHANNELS, VoiceRecorder.CHANNELS); this.processor.addEventListener('audioprocess', ev => { @@ -57,9 +57,9 @@ class VoiceRecorder { return this.microphoneStream; } reinitialiseVAD() { - let type = this.handle.client.settings.global("vad_type", "vad"); + let type = settings.global("vad_type", "vad"); if (type == "ppt") { - let keyCode = parseInt(this.handle.client.settings.global("vad_ppt_key", 84 /* T */.toString())); + let keyCode = parseInt(settings.global("vad_ppt_key", 84 /* T */.toString())); if (!(this.getVADHandler() instanceof PushToTalkVAD)) this.setVADHander(new PushToTalkVAD(keyCode)); else @@ -72,7 +72,7 @@ class VoiceRecorder { else if (type == "vad") { if (!(this.getVADHandler() instanceof VoiceActivityDetectorVAD)) this.setVADHander(new VoiceActivityDetectorVAD()); - let threshold = parseInt(this.handle.client.settings.global("vad_threshold", "50")); + let threshold = parseInt(settings.global("vad_threshold", "50")); this.getVADHandler().percentageThreshold = threshold; } else { @@ -104,7 +104,7 @@ class VoiceRecorder { if (this._deviceId == device) return; this._deviceId = device; - this.handle.client.settings.changeGlobal("microphone_id", device); + settings.changeGlobal("microphone_id", device); if (this._recording) { this.stop(); this.start(device); diff --git a/js/voice/VoiceRecorder.js.map b/js/voice/VoiceRecorder.js.map index 8b63aa0c..344dbe80 100644 --- a/js/voice/VoiceRecorder.js.map +++ b/js/voice/VoiceRecorder.js.map @@ -1 +1 @@ -{"version":3,"file":"Vo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,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC5B,CAAC;IAED,IAAI,MAAM,CAAC,IAAa;QACpB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;IAED,IAAI,GAAG,CAAC,GAAW;QACf,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC;QAChB,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,YAAY,CAAC,MAAmB;QAC5B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ"} \ No newline at end of file diff --git a/js/voice/VoiceRecorder.ts b/js/voice/VoiceRecorder.ts index f216cf2a..be70d4a7 100644 --- a/js/voice/VoiceRecorder.ts +++ b/js/voice/VoiceRecorder.ts @@ -45,7 +45,7 @@ class VoiceRecorder { this.handle = handle; this.userMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia; - this._deviceId = handle.client.settings.global("microphone_id", "default"); + this._deviceId = settings.global("microphone_id", "default"); this.audioContext = AudioController.globalContext; this.processor = this.audioContext.createScriptProcessor(VoiceRecorder.BUFFER_SIZE, VoiceRecorder.CHANNELS, VoiceRecorder.CHANNELS); @@ -91,9 +91,9 @@ class VoiceRecorder { } reinitialiseVAD() { - let type = this.handle.client.settings.global("vad_type", "vad"); + let type = settings.global("vad_type", "vad"); if(type == "ppt") { - let keyCode: number = parseInt(this.handle.client.settings.global("vad_ppt_key", Key.T.toString())); + let keyCode: number = parseInt(settings.global("vad_ppt_key", Key.T.toString())); if(!(this.getVADHandler() instanceof PushToTalkVAD)) this.setVADHander(new PushToTalkVAD(keyCode)); else (this.getVADHandler() as PushToTalkVAD).key = keyCode; @@ -103,7 +103,7 @@ class VoiceRecorder { } else if(type == "vad") { if(!(this.getVADHandler() instanceof VoiceActivityDetectorVAD)) this.setVADHander(new VoiceActivityDetectorVAD()); - let threshold = parseInt(this.handle.client.settings.global("vad_threshold", "50")); + let threshold = parseInt(settings.global("vad_threshold", "50")); (this.getVADHandler() as VoiceActivityDetectorVAD).percentageThreshold = threshold; } else { console.warn("Invalid VAD handler! (" + type + ")"); @@ -134,7 +134,7 @@ class VoiceRecorder { changeDevice(device: string) { if(this._deviceId == device) return; this._deviceId = device; - this.handle.client.settings.changeGlobal("microphone_id", device); + settings.changeGlobal("microphone_id", device); if(this._recording) { this.stop(); this.start(device); diff --git a/package.json b/package.json index fe7998a9..ac5a5b5a 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "dependencies": { "@types/emscripten": "0.0.31", "@types/jquery": "^3.3.0", + "@types/text-encoding": "0.0.32", "@types/websocket": "0.0.38" } } diff --git a/public_files.sh b/public_files.sh new file mode 100755 index 00000000..924d3d14 --- /dev/null +++ b/public_files.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +tsc -p tsconfig/tsconfig_release.json +uglifyjs -c --source-map --verbose -o generated/js/client.min.js generated/js/client.js \ No newline at end of file diff --git a/templates.html b/templates.html index 9084f7ab..66f8a755 100644 --- a/templates.html +++ b/templates.html @@ -15,35 +15,40 @@ diff --git a/tsconfig.json b/tsconfig.json index a0d9966b..e3ac1fef 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,4 +1,11 @@ { - "extends": "./tsconfig/tsconfig_debug.json" - //"extends": "./tsconfig/tsconfig_release.json" + "compilerOptions": { + "module": "none", + "target": "es6", + "sourceMap": true + }, + "exclude": [ + "node_modules", + "js/codec/workers" + ] } \ No newline at end of file