diff --git a/devjs/core.js b/devjs/core.js index 7294b14..973579e 100644 --- a/devjs/core.js +++ b/devjs/core.js @@ -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(); diff --git a/devjs/main.js b/devjs/main.js index 6cb4b95..55e5823 100644 --- a/devjs/main.js +++ b/devjs/main.js @@ -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 diff --git a/devjs/settingspanel.js b/devjs/settingspanel.js index 26fc637..0b925e3 100644 --- a/devjs/settingspanel.js +++ b/devjs/settingspanel.js @@ -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(); } \ No newline at end of file diff --git a/devjs/voicemode.js b/devjs/voicemode.js new file mode 100644 index 0000000..8d18b12 --- /dev/null +++ b/devjs/voicemode.js @@ -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", ""); +} \ No newline at end of file