diff --git a/src/addons.js b/src/addons.js index 26bd39d9..11a6e522 100644 --- a/src/addons.js +++ b/src/addons.js @@ -82,6 +82,21 @@ export default class AddonManager extends Module { this.emit(':ready'); } + generateLog() { + const out = ['Known']; + for(const [id, addon] of Object.entries(this.addons)) + out.push(`${id} | ${this.isAddonEnabled(id) ? 'enabled' : 'disabled'} | ${addon.dev ? 'dev | ' : ''}${this.isAddonExternal(id) ? 'external | ' : ''}${addon.short_name} v${addon.version}`); + + out.push(''); + out.push('Modules'); + for(const [key, module] of Object.entries(this.__modules)) { + if ( module ) + out.push(`${module.loaded ? 'loaded ' : module.loading ? 'loading ' : 'unloaded'} | ${module.enabled ? 'enabled ' : module.enabling ? 'enabling' : 'disabled'} | ${key}`) + } + + return out.join('\n'); + } + onProviderChange(key, value) { if ( key != 'addons.enabled' ) return; diff --git a/src/main.js b/src/main.js index 9596b781..a2955702 100644 --- a/src/main.js +++ b/src/main.js @@ -151,7 +151,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}` FrankerFaceZ.Logger = Logger; const VER = FrankerFaceZ.version_info = { - major: 4, minor: 2, revision: 3, + major: 4, minor: 2, revision: 4, commit: __git_commit__, build: __webpack_hash__, toString: () => @@ -161,12 +161,15 @@ const VER = FrankerFaceZ.version_info = { FrankerFaceZ.utilities = { addon: require('utilities/addon'), - dom: require('utilities/dom'), color: require('utilities/color'), - events: require('utilities/events'), - module: require('utilities/module'), constants: require('utilities/constants'), + dialog: require('utilities/dialog'), + dom: require('utilities/dom'), + events: require('utilities/events'), + fontAwesome: require('utilities/font-awesome'), + graphql: require('utilities/graphql'), logging: require('utilities/logging'), + module: require('utilities/module'), object: require('utilities/object'), time: require('utilities/time'), tooltip: require('utilities/tooltip'), diff --git a/src/sites/twitch-twilight/modules/directory/recommended_channels.gql b/src/sites/twitch-twilight/modules/directory/recommended_channels.gql index a4242e72..f8eab56f 100644 --- a/src/sites/twitch-twilight/modules/directory/recommended_channels.gql +++ b/src/sites/twitch-twilight/modules/directory/recommended_channels.gql @@ -1,11 +1,9 @@ query RecommendedChannels { - currentUser { - recommendations { - liveRecommendations { - nodes { - createdAt - type - } + recommendedStreams { + edges { + node { + createdAt + type } } } diff --git a/src/utilities/dialog.js b/src/utilities/dialog.js index ed72e3ef..a5fdd5e9 100644 --- a/src/utilities/dialog.js +++ b/src/utilities/dialog.js @@ -8,21 +8,29 @@ import {EventEmitter} from 'utilities/events'; import Site from 'site'; - -export default class Dialog extends EventEmitter { - constructor(element) { +export class Dialog extends EventEmitter { + constructor(element, options = {}) { super(); + this.selectors = { + exclusive: Dialog.EXCLUSIVE, + maximized: Dialog.MAXIMIZED, + normal: Dialog.SELECTOR + }; + + if ( options.selectors ) + this.selectors = Object.assign(this.selectors, options.selectors); + + this._maximized = options.maximized || false; + this._exclusive = options.exclusive || false; + this._element = null; + this._visible = false; if ( typeof element === 'function' ) this.factory = element; else this.element = element; - - this._visible = false; - this._maximized = false; - this._exclusive = false; } // ======================================================================== @@ -40,6 +48,8 @@ export default class Dialog extends EventEmitter { if ( this._visible ) this.toggleSize(); + else + this._maximized = val; } get visible() { @@ -102,9 +112,9 @@ export default class Dialog extends EventEmitter { getContainer() { return document.querySelector( - this._exclusive ? Dialog.EXCLUSIVE : - this._maximized ? Dialog.MAXIMIZED : - Dialog.SELECTOR + this._exclusive ? this.selectors.exclusive : + this._maximized ? this.selectors.maximized : + this.selectors.normal ); } @@ -188,4 +198,7 @@ Dialog.lastZ = 99999999; Dialog.EXCLUSIVE = Site.DIALOG_EXCLUSIVE; Dialog.MAXIMIZED = Site.DIALOG_MAXIMIZED; -Dialog.SELECTOR = Site.DIALOG_SELECTOR; \ No newline at end of file +Dialog.SELECTOR = Site.DIALOG_SELECTOR; + + +export default Dialog; \ No newline at end of file diff --git a/src/utilities/logging.js b/src/utilities/logging.js index 72d82ea2..514930ef 100644 --- a/src/utilities/logging.js +++ b/src/utilities/logging.js @@ -8,7 +8,7 @@ const RAVEN_LEVELS = { }; -export default class Logger { +export class Logger { constructor(parent, name, level, raven) { this.root = parent ? parent.root : this; this.parent = parent; @@ -116,4 +116,6 @@ Logger.DEBUG = 1; Logger.INFO = 2; Logger.WARN = 4; Logger.ERROR = 8; -Logger.OFF = 99; \ No newline at end of file +Logger.OFF = 99; + +export default Logger; \ No newline at end of file