{
- return target.dataset.title;
- }
+ this.types.html = target => target.dataset.title;
}
onEnable() {
diff --git a/src/modules/translation_ui/nondex.js b/src/modules/translation_ui/nondex.js
index 4c237e57..cbd37336 100644
--- a/src/modules/translation_ui/nondex.js
+++ b/src/modules/translation_ui/nondex.js
@@ -5,7 +5,7 @@
// ============================================================================
import Module from 'utilities/module';
-import {createElement} from 'utilities/dom';
+//import {createElement} from 'utilities/dom';
export default class TranslationUI extends Module {
constructor(...args) {
@@ -27,7 +27,7 @@ export default class TranslationUI extends Module {
);
}
- async onEnable(event) {
+ async onEnable() {
await this.site.awaitElement('.twilight-root');
this.ps = this.site.web_munch.getModule('ps');
}
diff --git a/src/settings/context.js b/src/settings/context.js
index 28b183d8..d54ee8db 100644
--- a/src/settings/context.js
+++ b/src/settings/context.js
@@ -273,7 +273,7 @@ export default class SettingsContext extends EventEmitter {
return type.get(key, this.profiles(), this.manager.log);
}
-/* for(const profile of this.__profiles)
+ /* for(const profile of this.__profiles)
if ( profile.has(key) )
return [profile.get(key), profile]
}*/
diff --git a/src/settings/index.js b/src/settings/index.js
index 703f4ce5..5e152ec2 100644
--- a/src/settings/index.js
+++ b/src/settings/index.js
@@ -76,7 +76,7 @@ export default class SettingsManager extends Module {
this.loadProfiles(true);
// Handle migrations.
- await this.migrations.process('core');
+ //await this.migrations.process('core');
// Now we can tell our context(s) about the profiles we have.
for(const context of this.__contexts)
diff --git a/src/settings/migration.js b/src/settings/migration.js
index 54916422..de997ccf 100644
--- a/src/settings/migration.js
+++ b/src/settings/migration.js
@@ -10,7 +10,7 @@ export default class MigrationManager {
this.provider = manager.provider;
}
- process(key) {
- return false;
+ process() { // eslint-disable-line class-methods-use-this
+ throw new Error('Not Implemented');
}
}
\ No newline at end of file
diff --git a/src/sites/twitch-twilight/modules/compat_emote_menu.js b/src/sites/twitch-twilight/modules/compat_emote_menu.js
index 9f0520d4..082cdbaf 100644
--- a/src/sites/twitch-twilight/modules/compat_emote_menu.js
+++ b/src/sites/twitch-twilight/modules/compat_emote_menu.js
@@ -1,5 +1,7 @@
'use strict';
+/* global emoteMenu: false */
+
// ============================================================================
// Compatibility Layer
// Emote Menu for Twitch (BTTV Emote Menu)
diff --git a/src/sites/twitch-twilight/modules/directory/index.jsx b/src/sites/twitch-twilight/modules/directory/index.jsx
index 5d4bd1cd..c3f697a4 100644
--- a/src/sites/twitch-twilight/modules/directory/index.jsx
+++ b/src/sites/twitch-twilight/modules/directory/index.jsx
@@ -289,7 +289,7 @@ export default class Directory extends SiteModule {
return;
// Get the old element.
- let channel_avatar = card.querySelector('.ffz-channel-avatar');
+ const channel_avatar = card.querySelector('.ffz-channel-avatar');
if ( ! data || ! data.profileImageURL || setting === 0 ) {
if ( channel_avatar !== null )
diff --git a/src/sites/twitch-twilight/modules/host_button.js b/src/sites/twitch-twilight/modules/host_button.js
index 3ccb50d7..22ed601f 100644
--- a/src/sites/twitch-twilight/modules/host_button.js
+++ b/src/sites/twitch-twilight/modules/host_button.js
@@ -56,9 +56,7 @@ export default class HostButton extends Module {
order: 150,
button: true,
- disabled: () => {
- return this._host_updating || this._host_error;
- },
+ disabled: () => this._host_updating || this._host_error,
click: data => {
if (data.channel) this.sendHostUnhostCommand(data.channel.login);
@@ -108,9 +106,9 @@ export default class HostButton extends Module {
} else {
return this.i18n.t('metadata.host.button.tooltip',
'Currently hosting: %{channel}',
- {
- channel: this._last_hosted_channel || this.i18n.t('metadata.host.button.tooltip.none', 'None')
- });
+ {
+ channel: this._last_hosted_channel || this.i18n.t('metadata.host.button.tooltip.none', 'None')
+ });
}
}
};
diff --git a/src/socket.js b/src/socket.js
index cce44be6..16155c63 100644
--- a/src/socket.js
+++ b/src/socket.js
@@ -107,12 +107,13 @@ export default class SocketClient extends Module {
selectHost() {
const cluster_id = this.settings.get('socket.cluster'),
- cluster = WS_CLUSTERS[cluster_id];
+ cluster = WS_CLUSTERS[cluster_id],
+ l = cluster && cluster.length;
- if ( ! cluster || ! cluster.length )
+ if ( ! l )
return null;
- let total = 0, i = cluster.length, l = i;
+ let total = 0, i = l;
while(i-- > 0)
total += cluster[i][1];
diff --git a/src/utilities/compat/apollo.js b/src/utilities/compat/apollo.js
index 01bb3a3d..30f246fa 100644
--- a/src/utilities/compat/apollo.js
+++ b/src/utilities/compat/apollo.js
@@ -19,7 +19,7 @@ export default class Apollo extends Module {
this.inject('..fine');
}
- async onEnable() {
+ onEnable() {
// TODO: Come up with a better way to await something existing.
let client = this.client;
@@ -48,7 +48,7 @@ export default class Apollo extends Module {
const old_qm_init = this.client.queryManager.queryStore.initQuery;
this.hooked_query_init = true;
this.client.queryManager.queryStore.initQuery = function(e) {
- let t = this.store[e.queryId];
+ const t = this.store[e.queryId];
if ( t && t.queryString !== e.queryString )
t.queryString = e.queryString;
@@ -59,7 +59,8 @@ export default class Apollo extends Module {
const ApolloLink = this.ApolloLink = this.client.link.constructor;
this.link = new ApolloLink((operation, forward) => {
- //this.log.info('Link Start', operation.operationName, operation);
+ if ( ! this.enabled )
+ return forward(operation);
try {
// ONLY do this if we've hooked query init, thus letting us ignore certain issues
@@ -120,23 +121,8 @@ export default class Apollo extends Module {
onDisable() {
- // TODO: Remove Apollo middleware.
-
- // Tear down the parsed queries.
- for(const key in this.modifiers)
- if ( has(this.modifiers, key) ) {
- const modifiers = this.modifiers[key];
- if ( modifiers )
- for(const mod of modifiers) {
- if ( typeof mod === 'function' )
- continue;
-
- mod[1] = null;
- }
- }
-
- // And finally, remove our references.
- this.client = this.graphql = null;
+ // Remove our references to things.
+ this.client = this.printer = this.gql_print = this.old_link = this.old_qm_dedup = this.old_qm_link = null;
}
diff --git a/src/utilities/dom.js b/src/utilities/dom.js
index ca30cdf1..da7e72ad 100644
--- a/src/utilities/dom.js
+++ b/src/utilities/dom.js
@@ -135,7 +135,7 @@ export class ManagedStyle {
}
set(key, value) {
- let block = this._blocks[key];
+ const block = this._blocks[key];
if ( block )
block.textContent = value;
else
diff --git a/src/utilities/module.js b/src/utilities/module.js
index 856fc475..47817881 100644
--- a/src/utilities/module.js
+++ b/src/utilities/module.js
@@ -521,9 +521,9 @@ export class Module extends EventEmitter {
for(const raw_path of ctx.keys()) {
const raw_module = ctx(raw_path),
module = raw_module.module || raw_module.default,
- name = raw_path.slice(2, raw_path.length - (raw_path.endsWith('/index.jsx') ? 10 : raw_path.endsWith('/index.js') ? 9 : raw_path.endsWith('.jsx') ? 4 : 3));
-
- // TODO: rewrite the name code to not have like 4 endsWith in it.
+ lix = raw_path.lastIndexOf('.'),
+ trimmed = lix > 2 ? raw_path.slice(2, lix) : raw_path,
+ name = trimmed.endsWith('/index') ? trimmed.slice(0, -6) : trimmed;
try {
added[name] = this.register(name, module);
diff --git a/src/utilities/tooltip.js b/src/utilities/tooltip.js
index 892b46c8..0b1cd382 100644
--- a/src/utilities/tooltip.js
+++ b/src/utilities/tooltip.js
@@ -229,7 +229,7 @@ export class Tooltip {
el.classList.toggle('interactive', interactive || false);
if ( ! opts.manual ) {
- el.addEventListener('mouseover', () => {
+ el.addEventListener('mouseover', el._ffz_over_handler = () => {
if ( ! document.contains(target) )
this.hide(tip);
@@ -239,7 +239,7 @@ export class Tooltip {
this._exit(target);
});
- el.addEventListener('mouseout', () => this._exit(target));
+ el.addEventListener('mouseout', el._ffz_out_handler = () => this._exit(target));
}
// Assign our content. If there's a Promise, we'll need
@@ -311,13 +311,19 @@ export class Tooltip {
}
if ( tip.outer ) {
- tip.outer.remove();
- tip.outer = null;
+ const el = tip.outer;
+ if ( el._ffz_over_handler )
+ el.removeEventListener('mouseover', el._ffz_over_handler);
+
+ if ( el._ffz_out_handler )
+ el.removeEventListener('mouseout', el._ffz_out_handler);
+
+ el.remove();
+ tip.outer = el._ffz_out_handler = el._ffz_over_handler = null;
}
- tip.update = null;
tip._update = noop;
- tip.element = null;
+ tip.update = tip.element = null;
tip.visible = false;
}
}