From 07fb7a99bc64747e45d9d761a741ab73661462ca Mon Sep 17 00:00:00 2001 From: WolverinDEV Date: Sun, 30 Sep 2018 22:36:17 +0200 Subject: [PATCH] Two small fixes --- ChangeLog.md | 4 +++- js/proto.ts | 4 +++- js/ui/client.ts | 13 +++++++++++-- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index bb44c9d1..d932ee30 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,7 +1,9 @@ # Changelog: * **30.09.18** - Added the permission system (Assignments and management) - + * Fixed poke and client description with empty message + * Fixed channel tree icons + * **26.09.18**: - Added Safari support diff --git a/js/proto.ts b/js/proto.ts index e8d5b8dd..8962dd3b 100644 --- a/js/proto.ts +++ b/js/proto.ts @@ -109,7 +109,9 @@ if(typeof ($) !== "undefined") { if(!$.prototype.renderTag) { $.prototype.renderTag = function (values?: any) : JQuery { let result = $(this.render(values)); - result.find("node").each((index, element) => { $(element).replaceWith(values[$(element).attr("key")]); }); + result.find("node").each((index, element) => { + $(element).replaceWith(values[$(element).attr("key")] || values[0][$(element).attr("key")]); + }); return result; } } diff --git a/js/ui/client.ts b/js/ui/client.ts index 658e0988..5c1a9821 100644 --- a/js/ui/client.ts +++ b/js/ui/client.ts @@ -228,7 +228,7 @@ class ClientEntry { name: "Poke client", callback: function () { createInputModal("Poke client", "Poke message:
", text => true, result => { - if(result) { + if(typeof(result) === "string") { console.log("Poking client " + _this.clientNickName() + " with message " + result); _this.channelTree.client.serverConnection.sendCommand("clientpoke", { clid: _this.clientId(), @@ -244,7 +244,7 @@ class ClientEntry { name: "Change description", callback: function () { createInputModal("Change client description", "New description:
", text => true, result => { - if(result) { + if(typeof(result) === "string") { console.log("Changing " + _this.clientNickName() + "'s description to " + result); _this.channelTree.client.serverConnection.sendCommand("clientedit", { clid: _this.clientId(), @@ -501,11 +501,20 @@ class ClientEntry { } if(variable.key == "client_icon_id") this.updateClientIcon(); + if(variable.key =="client_channel_group_id" || variable.key == "client_servergroups") + this.updateGroupIcons(); } group.end(); } + updateGroupIcons() { + this.tag.find("span .group_icons").children().detach(); + for(let id of this.assignedServerGroupIds()) + this.updateGroupIcon(this.channelTree.client.groups.serverGroup(id)); + this.updateGroupIcon(this.channelTree.client.groups.channelGroup(this.properties.client_channel_group_id)); + } + updateClientVariables(){ if(this.lastVariableUpdate == 0 || new Date().getTime() - 10 * 60 * 1000 > this.lastVariableUpdate){ //Cache these only 10 min this.lastVariableUpdate = new Date().getTime();