Voice only mode

This commit is contained in:
Jiiks 2015-10-25 19:33:34 +02:00
parent 32110e8c9c
commit 9c3169d80f
4 changed files with 85 additions and 2 deletions

View File

@ -14,7 +14,7 @@
* --Voice mode
*/
var settingsPanel, emoteModule, utils, quickEmoteMenu, opublicServers;
var settingsPanel, emoteModule, utils, quickEmoteMenu, opublicServers, voiceMode;
var jsVersion = 1.3;
var mainObserver;
@ -63,6 +63,7 @@ Core.prototype.init = function() {
utils = new Utils();
emoteModule = new EmoteModule();
quickEmoteMenu = new QuickEmoteMenu();
voideMode = new VoiceMode();
emoteModule.init();
emoteModule.autoCapitalize();

View File

@ -14,7 +14,7 @@
* --Voice mode
*/
var settingsPanel, emoteModule, utils, quickEmoteMenu, opublicServers;
var settingsPanel, emoteModule, utils, quickEmoteMenu, opublicServers, voiceMode;
var jsVersion = 1.3;
var mainObserver;
@ -63,6 +63,7 @@ Core.prototype.init = function() {
utils = new Utils();
emoteModule = new EmoteModule();
quickEmoteMenu = new QuickEmoteMenu();
voideMode = new VoiceMode();
emoteModule.init();
emoteModule.autoCapitalize();
@ -566,6 +567,10 @@ SettingsPanel.prototype.init = function() {
} else {
$("body").removeClass("bd-minimal-chan");
}
if(settingsCookie["bda-gs-4"]) {
voiceMode.enable();
}
}
@ -617,10 +622,47 @@ SettingsPanel.prototype.handler = function(e){
} else {
$("#bd-pub-li").hide();
}
if(settingsCookie["bda-gs-4"]){
voideMode.enable();
} else {
voiceMode.disable();
}
mainCore.saveSettings();
}
/* BetterDiscordApp VoiceMode JavaScript
* Version: 1.0
* Author: Jiiks | http://jiiks.net
* Date: 25/10/2015 - 19:10
* https://github.com/Jiiks/BetterDiscordApp
*/
function VoiceMode() {
}
VoiceMode.prototype.enable = function() {
$($(".scroller.guild-channels ul")[0]).css("display", "none");
$($(".scroller.guild-channels header")[0]).css("display", "none");
$($(".flex-horizontal.flex-spacer")[0]).css("overflow", "hidden");
$($(".chat.flex-vertical.flex-spacer")[0]).css("visibility", "hidden");
$($(".chat.flex-vertical.flex-spacer")[0]).css("min-width", "0px");
$($(".flex-vertical.channels-wrap")[0]).css("width", "100%");
$($(".guild-header .btn.btn-hamburger")[0]).css("visibility", "hidden");
}
VoiceMode.prototype.disable = function() {
$($(".scroller.guild-channels ul")[0]).css("display", "");
$($(".scroller.guild-channels header")[0]).css("display", "");
$($(".flex-horizontal.flex-spacer")[0]).css("overflow", "");
$($(".chat.flex-vertical.flex-spacer")[0]).css("visibility", "");
$($(".chat.flex-vertical.flex-spacer")[0]).css("min-width", "");
$($(".flex-vertical.channels-wrap")[0]).css("width", "");
$($(".guild-header .btn.btn-hamburger")[0]).css("visibility", "");
}
/* BetterDiscordApp Utilities JavaScript
* Version: 1.0
* Author: Jiiks | http://jiiks.net

View File

@ -69,6 +69,10 @@ SettingsPanel.prototype.init = function() {
} else {
$("body").removeClass("bd-minimal-chan");
}
if(settingsCookie["bda-gs-4"]) {
voiceMode.enable();
}
}
@ -120,6 +124,11 @@ SettingsPanel.prototype.handler = function(e){
} else {
$("#bd-pub-li").hide();
}
if(settingsCookie["bda-gs-4"]){
voideMode.enable();
} else {
voiceMode.disable();
}
mainCore.saveSettings();
}

31
devjs/voicemode.js Normal file
View File

@ -0,0 +1,31 @@
/* BetterDiscordApp VoiceMode JavaScript
* Version: 1.0
* Author: Jiiks | http://jiiks.net
* Date: 25/10/2015 - 19:10
* https://github.com/Jiiks/BetterDiscordApp
*/
function VoiceMode() {
}
VoiceMode.prototype.enable = function() {
$($(".scroller.guild-channels ul")[0]).css("display", "none");
$($(".scroller.guild-channels header")[0]).css("display", "none");
$($(".flex-horizontal.flex-spacer")[0]).css("overflow", "hidden");
$($(".chat.flex-vertical.flex-spacer")[0]).css("visibility", "hidden");
$($(".chat.flex-vertical.flex-spacer")[0]).css("min-width", "0px");
$($(".flex-vertical.channels-wrap")[0]).css("width", "100%");
$($(".guild-header .btn.btn-hamburger")[0]).css("visibility", "hidden");
}
VoiceMode.prototype.disable = function() {
$($(".scroller.guild-channels ul")[0]).css("display", "");
$($(".scroller.guild-channels header")[0]).css("display", "");
$($(".flex-horizontal.flex-spacer")[0]).css("overflow", "");
$($(".chat.flex-vertical.flex-spacer")[0]).css("visibility", "");
$($(".chat.flex-vertical.flex-spacer")[0]).css("min-width", "");
$($(".flex-vertical.channels-wrap")[0]).css("width", "");
$($(".guild-header .btn.btn-hamburger")[0]).css("visibility", "");
}