mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-24 11:38:30 +00:00
4.2.4
Fixed: Issue with Recommended Channels query. Changed: Add information on loaded add-ons to generated logs. API Changed: Add the missing utility modules to `FrankerFaceZ.utilities` exports, for use in add-ons. API Changed: Make the Dialog class a bit more flexible.
This commit is contained in:
parent
a0bb84deef
commit
8582626269
5 changed files with 55 additions and 24 deletions
|
@ -82,6 +82,21 @@ export default class AddonManager extends Module {
|
||||||
this.emit(':ready');
|
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) {
|
onProviderChange(key, value) {
|
||||||
if ( key != 'addons.enabled' )
|
if ( key != 'addons.enabled' )
|
||||||
return;
|
return;
|
||||||
|
|
11
src/main.js
11
src/main.js
|
@ -151,7 +151,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`
|
||||||
FrankerFaceZ.Logger = Logger;
|
FrankerFaceZ.Logger = Logger;
|
||||||
|
|
||||||
const VER = FrankerFaceZ.version_info = {
|
const VER = FrankerFaceZ.version_info = {
|
||||||
major: 4, minor: 2, revision: 3,
|
major: 4, minor: 2, revision: 4,
|
||||||
commit: __git_commit__,
|
commit: __git_commit__,
|
||||||
build: __webpack_hash__,
|
build: __webpack_hash__,
|
||||||
toString: () =>
|
toString: () =>
|
||||||
|
@ -161,12 +161,15 @@ const VER = FrankerFaceZ.version_info = {
|
||||||
|
|
||||||
FrankerFaceZ.utilities = {
|
FrankerFaceZ.utilities = {
|
||||||
addon: require('utilities/addon'),
|
addon: require('utilities/addon'),
|
||||||
dom: require('utilities/dom'),
|
|
||||||
color: require('utilities/color'),
|
color: require('utilities/color'),
|
||||||
events: require('utilities/events'),
|
|
||||||
module: require('utilities/module'),
|
|
||||||
constants: require('utilities/constants'),
|
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'),
|
logging: require('utilities/logging'),
|
||||||
|
module: require('utilities/module'),
|
||||||
object: require('utilities/object'),
|
object: require('utilities/object'),
|
||||||
time: require('utilities/time'),
|
time: require('utilities/time'),
|
||||||
tooltip: require('utilities/tooltip'),
|
tooltip: require('utilities/tooltip'),
|
||||||
|
|
|
@ -1,11 +1,9 @@
|
||||||
query RecommendedChannels {
|
query RecommendedChannels {
|
||||||
currentUser {
|
recommendedStreams {
|
||||||
recommendations {
|
edges {
|
||||||
liveRecommendations {
|
node {
|
||||||
nodes {
|
createdAt
|
||||||
createdAt
|
type
|
||||||
type
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,21 +8,29 @@ import {EventEmitter} from 'utilities/events';
|
||||||
|
|
||||||
import Site from 'site';
|
import Site from 'site';
|
||||||
|
|
||||||
|
export class Dialog extends EventEmitter {
|
||||||
export default class Dialog extends EventEmitter {
|
constructor(element, options = {}) {
|
||||||
constructor(element) {
|
|
||||||
super();
|
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._element = null;
|
||||||
|
this._visible = false;
|
||||||
|
|
||||||
if ( typeof element === 'function' )
|
if ( typeof element === 'function' )
|
||||||
this.factory = element;
|
this.factory = element;
|
||||||
else
|
else
|
||||||
this.element = element;
|
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 )
|
if ( this._visible )
|
||||||
this.toggleSize();
|
this.toggleSize();
|
||||||
|
else
|
||||||
|
this._maximized = val;
|
||||||
}
|
}
|
||||||
|
|
||||||
get visible() {
|
get visible() {
|
||||||
|
@ -102,9 +112,9 @@ export default class Dialog extends EventEmitter {
|
||||||
|
|
||||||
getContainer() {
|
getContainer() {
|
||||||
return document.querySelector(
|
return document.querySelector(
|
||||||
this._exclusive ? Dialog.EXCLUSIVE :
|
this._exclusive ? this.selectors.exclusive :
|
||||||
this._maximized ? Dialog.MAXIMIZED :
|
this._maximized ? this.selectors.maximized :
|
||||||
Dialog.SELECTOR
|
this.selectors.normal
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -188,4 +198,7 @@ Dialog.lastZ = 99999999;
|
||||||
|
|
||||||
Dialog.EXCLUSIVE = Site.DIALOG_EXCLUSIVE;
|
Dialog.EXCLUSIVE = Site.DIALOG_EXCLUSIVE;
|
||||||
Dialog.MAXIMIZED = Site.DIALOG_MAXIMIZED;
|
Dialog.MAXIMIZED = Site.DIALOG_MAXIMIZED;
|
||||||
Dialog.SELECTOR = Site.DIALOG_SELECTOR;
|
Dialog.SELECTOR = Site.DIALOG_SELECTOR;
|
||||||
|
|
||||||
|
|
||||||
|
export default Dialog;
|
|
@ -8,7 +8,7 @@ const RAVEN_LEVELS = {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export default class Logger {
|
export class Logger {
|
||||||
constructor(parent, name, level, raven) {
|
constructor(parent, name, level, raven) {
|
||||||
this.root = parent ? parent.root : this;
|
this.root = parent ? parent.root : this;
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
|
@ -116,4 +116,6 @@ Logger.DEBUG = 1;
|
||||||
Logger.INFO = 2;
|
Logger.INFO = 2;
|
||||||
Logger.WARN = 4;
|
Logger.WARN = 4;
|
||||||
Logger.ERROR = 8;
|
Logger.ERROR = 8;
|
||||||
Logger.OFF = 99;
|
Logger.OFF = 99;
|
||||||
|
|
||||||
|
export default Logger;
|
Loading…
Add table
Add a link
Reference in a new issue