Skip to content
This repository has been archived by the owner on Aug 3, 2022. It is now read-only.

Commit

Permalink
added voice auto-disconnect on exit
Browse files Browse the repository at this point in the history
  • Loading branch information
pohky committed Apr 7, 2016
1 parent 00d4911 commit 6078006
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
};
Expand Down Expand Up @@ -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
};
Expand Down Expand Up @@ -170,6 +172,12 @@ Core.prototype.init = function () {
settingsPanel.show();
});

window.addEventListener("beforeunload", function(){
if(settingsCookie["bda-dc-0"]){
$('.btn.btn-disconnect').click();
}
});

opublicServers.init();

emoteModule.autoCapitalize();
Expand Down

0 comments on commit 6078006

Please sign in to comment.