mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-15 17:46:55 +00:00
eslint: unused vars; this-less instance methods converted to class methods
This commit is contained in:
parent
4289075892
commit
5ef600a4b9
1 changed files with 12 additions and 11 deletions
|
@ -7,7 +7,7 @@
|
||||||
import Module from 'utilities/module';
|
import Module from 'utilities/module';
|
||||||
import { findReactFragment } from 'utilities/dom';
|
import { findReactFragment } from 'utilities/dom';
|
||||||
|
|
||||||
import { SourcedSet, getTwitchEmoteSrcSet } from 'utilities/object';
|
import { getTwitchEmoteSrcSet } from 'utilities/object';
|
||||||
import { TWITCH_POINTS_SETS, TWITCH_GLOBAL_SETS, TWITCH_PRIME_SETS, KNOWN_CODES, REPLACEMENTS, REPLACEMENT_BASE, KEYS } from 'utilities/constants';
|
import { TWITCH_POINTS_SETS, TWITCH_GLOBAL_SETS, TWITCH_PRIME_SETS, KNOWN_CODES, REPLACEMENTS, REPLACEMENT_BASE, KEYS } from 'utilities/constants';
|
||||||
|
|
||||||
import Twilight from 'site';
|
import Twilight from 'site';
|
||||||
|
@ -355,7 +355,7 @@ export default class Input extends Module {
|
||||||
this.ChatInput.on('mount', this.overrideChatInput, this);
|
this.ChatInput.on('mount', this.overrideChatInput, this);
|
||||||
|
|
||||||
this.ChatInput.on('mount', this.installPreviewObserver, this);
|
this.ChatInput.on('mount', this.installPreviewObserver, this);
|
||||||
this.ChatInput.on('unmount', this.removePreviewObserver, this);
|
this.ChatInput.on('unmount', this.constructor.removePreviewObserver, this);
|
||||||
|
|
||||||
this.EmoteSuggestions.on('mount', this.overrideEmoteMatcher, this);
|
this.EmoteSuggestions.on('mount', this.overrideEmoteMatcher, this);
|
||||||
this.MentionSuggestions.on('mount', this.overrideMentionMatcher, this);
|
this.MentionSuggestions.on('mount', this.overrideMentionMatcher, this);
|
||||||
|
@ -461,11 +461,14 @@ export default class Input extends Module {
|
||||||
this.updatePreview(inst, target);
|
this.updatePreview(inst, target);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
for(const target of node.querySelectorAll?.('img.chat-line__message--emote')) {
|
const img = node.querySelectorAll?.('img.chat-line__message--emote');
|
||||||
|
if ( img !== undefined ) {
|
||||||
|
for(const target of img) {
|
||||||
if ( target && (target.dataset.ffzId || target.src.startsWith('https://static-cdn.jtvnw.net/emoticons/v2/__FFZ__')) )
|
if ( target && (target.dataset.ffzId || target.src.startsWith('https://static-cdn.jtvnw.net/emoticons/v2/__FFZ__')) )
|
||||||
this.updatePreview(inst, target);
|
this.updatePreview(inst, target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updatePreview(inst, target) {
|
updatePreview(inst, target) {
|
||||||
let set_id = target.dataset.ffzSet,
|
let set_id = target.dataset.ffzSet,
|
||||||
|
@ -539,7 +542,7 @@ export default class Input extends Module {
|
||||||
evt.stopImmediatePropagation();
|
evt.stopImmediatePropagation();
|
||||||
}
|
}
|
||||||
|
|
||||||
removePreviewObserver(inst) {
|
static removePreviewObserver(inst) {
|
||||||
if ( inst._ffz_preview_observer ) {
|
if ( inst._ffz_preview_observer ) {
|
||||||
inst._ffz_preview_observer.disconnect();
|
inst._ffz_preview_observer.disconnect();
|
||||||
inst._ffz_preview_observer = null;
|
inst._ffz_preview_observer = null;
|
||||||
|
@ -580,8 +583,8 @@ export default class Input extends Module {
|
||||||
this.props.emotes.splice(idx, 1, data);
|
this.props.emotes.splice(idx, 1, data);
|
||||||
else if ( idx !== -1 && ! data )
|
else if ( idx !== -1 && ! data )
|
||||||
this.props.emotes.splice(idx, 1);
|
this.props.emotes.splice(idx, 1);
|
||||||
else
|
// else
|
||||||
return;
|
// return;
|
||||||
|
|
||||||
// TODO: Somehow update other React state to deal with our
|
// TODO: Somehow update other React state to deal with our
|
||||||
// injected changes. Making a shallow copy of the array
|
// injected changes. Making a shallow copy of the array
|
||||||
|
@ -864,7 +867,7 @@ export default class Input extends Module {
|
||||||
createElement = React?.createElement;
|
createElement = React?.createElement;
|
||||||
|
|
||||||
if ( createElement )
|
if ( createElement )
|
||||||
inst.renderCommandSuggestion = function(cmd, input) {
|
inst.renderCommandSuggestion = function(cmd) {
|
||||||
const args = Array.isArray(cmd?.commandArgs)
|
const args = Array.isArray(cmd?.commandArgs)
|
||||||
? cmd.commandArgs.map(arg => (<div class={`tw-mg-r-05${arg.isRequired ? '' : ' tw-c-text-alt'}`}>[{arg.name}]</div>))
|
? cmd.commandArgs.map(arg => (<div class={`tw-mg-r-05${arg.isRequired ? '' : ' tw-c-text-alt'}`}>[{arg.name}]</div>))
|
||||||
: null;
|
: null;
|
||||||
|
@ -911,8 +914,6 @@ export default class Input extends Module {
|
||||||
if ( ! set || ! set.emotes )
|
if ( ! set || ! set.emotes )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
const source = set.source || 'ffz';
|
|
||||||
|
|
||||||
for(const emote of Object.values(set.emotes)) {
|
for(const emote of Object.values(set.emotes)) {
|
||||||
if ( ! emote || ! emote.id || ! emote.name || added_emotes.has(emote.name) )
|
if ( ! emote || ! emote.id || ! emote.name || added_emotes.has(emote.name) )
|
||||||
continue;
|
continue;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue