BetterDiscordApp-v1/dev/js/08voiceMode.js

38 lines
1.4 KiB
JavaScript
Raw Normal View History

/* BetterDiscordApp VoiceMode JavaScript
* Version: 1.0
* Author: Jiiks | http://jiiks.net
* Date: 25/10/2015 - 19:10
* https://github.com/Jiiks/BetterDiscordApp
*/
function VoiceMode() {
}
2016-04-10 14:43:27 +02:00
VoiceMode.prototype.obsCallback = function () {
2015-12-16 12:21:46 +01:00
var self = this;
2016-04-10 14:43:27 +02:00
if (settingsCookie["bda-gs-4"]) {
2015-12-16 12:21:46 +01:00
self.disable();
2016-04-10 14:43:27 +02:00
setTimeout(function () {
2015-12-16 12:21:46 +01:00
self.enable();
}, 300);
}
2016-04-10 14:43:27 +02:00
};
2015-12-16 12:21:46 +01:00
2016-04-10 14:43:27 +02:00
VoiceMode.prototype.enable = function () {
$(".scroller.guild-channels ul").first().css("display", "none");
$(".scroller.guild-channels header").first().css("display", "none");
2015-12-16 12:21:46 +01:00
$(".app.flex-vertical").first().css("overflow", "hidden");
$(".chat.flex-vertical.flex-spacer").first().css("visibility", "hidden").css("min-width", "0px");
2015-12-16 12:21:46 +01:00
$(".flex-vertical.channels-wrap").first().css("flex-grow", "100000");
$(".guild-header .btn.btn-hamburger").first().css("visibility", "hidden");
};
2016-04-10 14:43:27 +02:00
VoiceMode.prototype.disable = function () {
$(".scroller.guild-channels ul").first().css("display", "");
$(".scroller.guild-channels header").first().css("display", "");
2015-12-16 12:21:46 +01:00
$(".app.flex-vertical").first().css("overflow", "");
$(".chat.flex-vertical.flex-spacer").first().css("visibility", "").css("min-width", "");
2015-12-16 12:21:46 +01:00
$(".flex-vertical.channels-wrap").first().css("flex-grow", "");
$(".guild-header .btn.btn-hamburger").first().css("visibility", "");
2016-04-10 14:43:27 +02:00
};