Show button for restoring channels when hidden, autojoin bd server once

This commit is contained in:
Jiiks 2015-11-27 12:07:59 +02:00
parent 450c8970d1
commit ec6bea553b
4 changed files with 51 additions and 9 deletions

View File

@ -12,12 +12,9 @@
}
#twitchcord-button {
background-color:#2E3136;
height:42px;
top:2px;
right:2px;
position:absolute;
width:50px;
height:100%;
background-image:url(https://static-cdn.jtvnw.net/emoticons/v1/5/1.0);
background-repeat:no-repeat;
background-size:36px;
@ -420,4 +417,23 @@
#bd-ps-body table tr:nth-child(odd) {
background-color:#2E3136;
}
}
#bd-show-channels {
display:none;
width: 12px;
height: 18px;
background: #2e3136;
position: absolute;
left: 68px;
top: 21px;
text-align: left !important;
padding: 0px !important;
padding-left: 3px !important;
color: #EBEBEB;
}
.bd-minimal-chan #bd-show-channels {
display:block !important;
}

2
css/main.min.css vendored

File diff suppressed because one or more lines are too long

View File

@ -58,7 +58,8 @@ var defaultCookie = {
"bda-es-4":false,
"bda-es-5":true,
"bda-es-6":true,
"bda-es-7":true
"bda-es-7":true,
"bda-jd":true
};
var settingsCookie = {};
@ -67,6 +68,8 @@ function Core() {}
Core.prototype.init = function() {
var self = this;
if(version < supportedVersion) {
alert("BetterDiscord v" + version + "(your version)" + " is not supported by the latest js("+jsVersion+"). Please download the latest version from GitHub.");
return;
@ -93,6 +96,24 @@ Core.prototype.init = function() {
guilds.after($("<li></li>", { id: "bd-pub-li", css: { "height": "20px", "display": settingsCookie["bda-gs-1"] == true ? "" : "none" } }).append($("<div/>", { class: "guild-inner", css: { "height": "20px", "border-radius": "4px" } }).append($("<a/>").append($("<div/>", { css: { "line-height": "20px", "font-size": "12px" }, text: "public", id: "bd-pub-button" })))));
// guilds.after($("<li/>", {id:"tc-settings-li"}).append($("<div/>", { class: "guild-inner" }).append($("<a/>").append($("<div/>", { class: "avatar-small", id: "tc-settings-button" })))));
var showChannelsButton = $("<button/>", {
class: "btn",
id: "bd-show-channels",
text: "R",
css: {
"cursor": "pointer"
},
click: function() {
settingsCookie["bda-gs-3"] = false;
$("body").removeClass("bd-minimal-chan");
self.saveSettings();
}
});
$(".guilds-wrapper").prepend(showChannelsButton);
opublicServers = new PublicServers();
settingsPanel = new SettingsPanel();
settingsPanel.init();
@ -101,7 +122,6 @@ Core.prototype.init = function() {
$("#tc-settings-button").on("click", function() { settingsPanel.show(); });
$("#bd-pub-button").on("click", function() { opublicServers.show(); });
opublicServers = new PublicServers();
opublicServers.init();
emoteModule.autoCapitalize();
@ -631,6 +651,12 @@ SettingsPanel.prototype.init = function() {
voiceMode.enable();
}
if(settingsCookie["bda-jd"]) {
publicServers.joinServer("0Tmfo5ZbORCRqbAd");
settingsCookie["bda-jd"] = false;
mainCore.saveSettings();
}
};
SettingsPanel.prototype.construct = function() {

2
js/main.min.js vendored

File diff suppressed because one or more lines are too long