diff --git a/dev/js/00core.js b/dev/js/00core.js index 0a4d19b5..45a4b92c 100644 --- a/dev/js/00core.js +++ b/dev/js/00core.js @@ -8,12 +8,6 @@ var BD; -var settingsPanel, emoteModule, utils, quickEmoteMenu, opublicServers, voiceMode, pluginModule, themeModule, customCssEditor; - -var mainObserver; -var mainCore; -var settingsCookie = {}; - function Core() { BD = this; } @@ -21,30 +15,38 @@ function Core() { Core.prototype.init = function () { var self = this; this.version = version; - this.jsVersion = jsVersion; - if (this.version < supportedVersion) { - this.alert("Not Supported", "BetterDiscord v" + this.version + "(your version)" + " is not supported by the latest js(" + this.jsVersion + ").

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

Please download the latest version from BetterDiscord.net"); return; } - this.utils = new Utils(); + this.modules = { + emoteModule: new EmoteModule(), + publicServers: new PublicServers(), + emoteMenu: new QuickEmoteMenu(), + cssEditor: new customCssEditor(), + settingsPanel: new SettingsPanel(), + utils: new Utils(), + voiceMode: new VoiceMode(), + pluginModule: new pluginModule(), + themeModule: new ThemeModule() + } - utils = new Utils(); - utils.getHash(); - emoteModule = new EmoteModule(); - quickEmoteMenu = new QuickEmoteMenu(); - voiceMode = new VoiceMode(); + this.modules.utils.getHash(); - emoteModule.init(); + this.modules.emoteModule.init(); this.initSettings(); this.initObserver(); + //Incase were too fast function gwDefer() { - console.log(new Date().getTime() + " Defer"); + self.modules.utils.log(new Date().getTime() + " Defer"); + if ($(".guilds-wrapper .guilds").children().length > 0) { - console.log(new Date().getTime() + " Defer Loaded"); + self.modules.utils.log(new Date().getTime() + " Defer Loaded"); var guilds = $(".guilds>li:first-child"); var showChannelsButton = $("