From 45d3ec2cc020c8ca514ad16aaedca326e2ca2463 Mon Sep 17 00:00:00 2001 From: pohky Date: Fri, 8 Jan 2016 16:33:43 +0100 Subject: [PATCH] compact mode fix --- js/main.js | 1232 +++++++++++++++++++++++++++--------------------- js/main.min.js | 7 +- 2 files changed, 707 insertions(+), 532 deletions(-) diff --git a/js/main.js b/js/main.js index a215de6b..70f6d9f8 100644 --- a/js/main.js +++ b/js/main.js @@ -5,8 +5,6 @@ * Last Update: 24/010/2015 - 17:27 * https://github.com/Jiiks/BetterDiscordApp */ - - var settingsPanel, emoteModule, utils, quickEmoteMenu, opublicServers, voiceMode, pluginModule, themeModule; var jsVersion = 1.57; var supportedVersion = "0.2.3"; @@ -36,7 +34,7 @@ var settings = { "Emote Auto Capitalization": { "id": "bda-es-4", "info": "Autocapitalize emote commands", "implemented": true }, "Override Default Emotes": { "id": "bda-es-5", "info": "Override default emotes", "implemented": false }, "Show Names": { "id": "bda-es-6", "info": "Show emote names on hover", "implemented": true } -} +}; var links = { "Jiiks.net": { "text": "Jiiks.net", "href": "http://jiiks.net", "target": "_blank" }, @@ -45,7 +43,7 @@ var links = { }; var defaultCookie = { - "version": jsVersion, + "version": jsVersion, "bda-gs-0": false, "bda-gs-1": true, "bda-gs-2": false, @@ -59,7 +57,7 @@ var defaultCookie = { "bda-es-5": true, "bda-es-6": true, "bda-es-7": true, - "bda-jd": true + "bda-jd": true }; var bdchangelog = { @@ -81,7 +79,7 @@ var bdchangelog = { "text": "Discord sub emotes are now replaced by BetterDiscord sub emotes and can be favorited!", "img": "" } - }, + }, "upcoming": { "ignore": { "title": "Ignore User!", @@ -95,16 +93,16 @@ var settingsCookie = {}; function Core() {} -Core.prototype.init = function() { +Core.prototype.init = function () { var self = this; - if(version < supportedVersion) { - this.alert("Not Supported", "BetterDiscord v" + version + "(your version)" + " is not supported by the latest js("+jsVersion+").

Please download the latest version from BetterDiscord.net"); + if (version < supportedVersion) { + this.alert("Not Supported", "BetterDiscord v" + version + "(your version)" + " is not supported by the latest js(" + jsVersion + ").

Please download the latest version from BetterDiscord.net"); return; } - + utils = new Utils(); var sock = new BdWSocket(); @@ -122,11 +120,30 @@ Core.prototype.init = function() { //Incase were too fast function gwDefer() { console.log(new Date().getTime() + " Defer"); - if($(".guilds-wrapper .guilds").children().length > 0) { + if ($(".guilds-wrapper .guilds").children().length > 0) { console.log(new Date().getTime() + " Defer Loaded"); var guilds = $(".guilds li:first-child"); - guilds.after($("
  • ", { id: "bd-pub-li", css: { "height": "20px", "display": settingsCookie["bda-gs-1"] == true ? "" : "none" } }).append($("
    ", { class: "guild-inner", css: { "height": "20px", "border-radius": "4px" } }).append($("").append($("
    ", { css: { "line-height": "20px", "font-size": "12px" }, text: "public", id: "bd-pub-button" }))))); + guilds.after($("
  • ", { + id: "bd-pub-li", + css: { + "height": "20px", + "display": settingsCookie["bda-gs-1"] == true ? "" : "none" + } + }).append($("
    ", { + class: "guild-inner", + css: { + "height": "20px", + "border-radius": "4px" + } + }).append($("").append($("
    ", { + css: { + "line-height": "20px", + "font-size": "12px" + }, + text: "public", + id: "bd-pub-button" + }))))); var showChannelsButton = $("