/* BetterDiscordApp PublicSevers JavaScripts * Version: 1.0 * Author: Jiiks | http://jiiks.net * Date: 27/08/2015 - 14:16 * https://github.com/Jiiks/BetterDiscordApp */ var publicServers = { "servers": { "server": { "code": 0, "icon": null, "title": "title", "language": "EN", "description": "description" } } }; //for ide function PublicServers() { } PublicServers.prototype.getPanel = function() { return this.container; }; PublicServers.prototype.init = function() { var self = this; this.container = $("
", { id: "bd-ps-container", style: "display:none" }); var header = $("
", { id: "bd-ps-header" }); $("

", { text: "Public Servers" }).appendTo(header); $("", { id: "bd-ps-close", style:"cursor:pointer;", text: "X" }).appendTo(header); header.appendTo(this.getPanel()); var psbody = $("
", { id: "bd-ps-body" }); psbody.appendTo(this.getPanel()); var table = $("", { border:"0" }); var thead = $(""); thead.appendTo(table); var headers = $("", { }).append($("", { id: "bd-ps-tbody" }); tbody.appendTo(table); table.appendTo(psbody); $("body").append(this.getPanel()); $("#bd-ps-close").on("click", function() { self.show(); }); var servers = publicServers.servers; for(var server in servers) { if(servers.hasOwnProperty(server)) { var s = servers[server]; var code = s.code; var title = s.title; var language = s.language; var description = s.description; this.addServer(server, code, title, language, description); } } }; PublicServers.prototype.addServer = function(name, code, title, language, description) { var self = this; var tableBody = $("#bd-ps-tbody"); var desc = $(""); tr.append($("
", { text: "Name" })).append($("", { text: "Code" })).append($("", { text: "Language" })).append($("", { text: "Description" })).append($("", { text: "Join" })); headers.appendTo(thead); var tbody = $("
").append($("
", { class: "bd-ps-description", text: description })); var tr = $("
", { text: title })); tr.append($("", { css: { "-webkit-user-select":"initial", "user-select":"initial" }, text: code })); tr.append($("", { text: language })); tr.append(desc); tr.append($("").append($("