Join server button
This commit is contained in:
parent
303b31f568
commit
d2d7d0ca40
|
@ -64,7 +64,9 @@ PublicServers.prototype.init = function() {
|
|||
text: "Language"
|
||||
})).append($("<th/>", {
|
||||
text: "Description"
|
||||
}));
|
||||
})).append($("<th/>", {
|
||||
text: "Join"
|
||||
}));
|
||||
|
||||
headers.appendTo(thead);
|
||||
|
||||
|
@ -96,7 +98,7 @@ PublicServers.prototype.init = function() {
|
|||
};
|
||||
|
||||
PublicServers.prototype.addServer = function(name, code, title, language, description) {
|
||||
|
||||
var self = this;
|
||||
var tableBody = $("#bd-ps-tbody");
|
||||
|
||||
|
||||
|
@ -122,6 +124,11 @@ PublicServers.prototype.addServer = function(name, code, title, language, descri
|
|||
tr.append($("<td/>", {
|
||||
text: language
|
||||
}));
|
||||
|
||||
tr.append($("<button/>", {
|
||||
text: "Join",
|
||||
click: function() { self.joinServer(code); }
|
||||
}));
|
||||
|
||||
tr.append(desc);
|
||||
|
||||
|
@ -135,4 +142,13 @@ PublicServers.prototype.show = function() {
|
|||
if(this.getPanel().is(":visible")) {
|
||||
li.addClass("active");
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
//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();
|
||||
}
|
Loading…
Reference in New Issue