From aecb7000ca49665ad82a537d0940a0c0480b5d23 Mon Sep 17 00:00:00 2001 From: pohky Date: Fri, 8 Apr 2016 00:11:38 +0200 Subject: [PATCH] added disconnect voice on exit --- js/main.min.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/main.min.js b/js/main.min.js index 253d94e31..c78c303cd 100644 --- a/js/main.min.js +++ b/js/main.min.js @@ -35,6 +35,7 @@ var settings = { "Override Default Emotes": { "id": "bda-es-5", "info": "Override default emotes", "implemented": false, "hidden": false}, "Show Names": { "id": "bda-es-6", "info": "Show emote names on hover", "implemented": true, "hidden": false}, "Show emote modifiers": { "id": "bda-es-8", "info": "Enable/Disable emote mods", "implemented": true, "hidden": false}, + "Disconnect Voice on exit": { "id": "bda-dc-0", "info": "", "implemented": true, "hidden": false}, "Custom css live update": { "id": "bda-css-0", "info": "", "implemented": true, "hidden": true }, "Custom css auto udpate": { "id": "bda-css-1", "info": "", "implemented": true, "hidden": true } }; @@ -63,6 +64,7 @@ var defaultCookie = { "bda-es-8": true, "bda-jd": true, "bda-es-8": true, + "bda-dc-0": false, "bda-css-0": false, "bda-css-1": false }; @@ -169,7 +171,13 @@ Core.prototype.init = function () { $("#tc-settings-button").on("click", function () { settingsPanel.show(); }); - + + window.addEventListener("beforeunload", function(){ + if(settingsCookie["bda-dc-0"]){ + $('.btn.btn-disconnect').click(); + } + }); + opublicServers.init(); emoteModule.autoCapitalize();