Join server button
This commit is contained in:
parent
71b94ee664
commit
42cea45430
18
js/main.js
18
js/main.js
|
@ -359,6 +359,8 @@ PublicServers.prototype.init = function() {
|
|||
text: "Language"
|
||||
})).append($("<th/>", {
|
||||
text: "Description"
|
||||
})).append($("<th/>", {
|
||||
text: "Join"
|
||||
}));
|
||||
|
||||
headers.appendTo(thead);
|
||||
|
@ -391,7 +393,7 @@ PublicServers.prototype.init = function() {
|
|||
};
|
||||
|
||||
PublicServers.prototype.addServer = function(name, code, title, language, description) {
|
||||
|
||||
var self = this;
|
||||
var tableBody = $("#bd-ps-tbody");
|
||||
|
||||
|
||||
|
@ -418,6 +420,11 @@ PublicServers.prototype.addServer = function(name, code, title, language, descri
|
|||
text: language
|
||||
}));
|
||||
|
||||
tr.append($("<button/>", {
|
||||
text: "Join",
|
||||
click: function() { self.joinServer(code); }
|
||||
}));
|
||||
|
||||
tr.append(desc);
|
||||
|
||||
tableBody.append(tr);
|
||||
|
@ -432,6 +439,15 @@ PublicServers.prototype.show = function() {
|
|||
}
|
||||
};
|
||||
|
||||
//Workaround for joining a server
|
||||
PublicServers.prototype.joinServer = function(code) {
|
||||
console.log("Code: " + code);
|
||||
$(".guilds-add").click();
|
||||
$(".action.join .btn").click();
|
||||
$(".create-guild-container input").val(code);
|
||||
$(".form.join-server .btn-primary").click();
|
||||
}
|
||||
|
||||
/* BetterDiscordApp QuickEmoteMenu JavaScript
|
||||
* Version: 1.3
|
||||
* Author: Jiiks | http://jiiks.net
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue