1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +00:00

eslint: run pnpm eslint --fix

This commit is contained in:
lemonslut 2025-06-07 16:09:55 -06:00
parent d089002698
commit a69832e3a3
No known key found for this signature in database
53 changed files with 633 additions and 615 deletions

View file

@ -97,7 +97,7 @@
// Now, inject our script into the page context.
const HOST = location.hostname,
SERVER = browser.runtime.getURL("web"),
SERVER = browser.runtime.getURL('web'),
script = document.createElement('script');
let FLAVOR =

View file

@ -55,7 +55,7 @@ class FFZESBridge {
msg,
location.origin,
transfer ? (Array.isArray(transfer) ? transfer : [transfer]) : undefined
);
);
} catch(err) {
this.log.error('Error sending message to window.', err, msg, transfer);
}
@ -63,21 +63,21 @@ class FFZESBridge {
onWindowMessage(event) {
if ( event.origin !== location.origin )
return;
return;
const msg = event.data,
id = msg?.id,
type = msg?.ffz_esb_type;
id = msg?.id,
type = msg?.ffz_esb_type;
if ( ! type )
return;
return;
this.log.info('Received Message from Page', type, id, msg);
if ( type === 'init' ) {
this.received_init = true;
if ( this.active )
this.runtimeHeartbeat();
this.runtimeHeartbeat();
}
this.runtimeSend(msg);
@ -89,7 +89,7 @@ class FFZESBridge {
runtimeOpen() {
if ( this.active )
return Promise.resolve();
return Promise.resolve();
this.log.info('Connecting to worker.');
@ -99,7 +99,7 @@ class FFZESBridge {
this.port.onDisconnect.addListener(this.onRuntimeDisconnect);
if ( this.received_init )
this.runtimeHeartbeat();
this.runtimeHeartbeat();
}
onRuntimeMessage(msg) {
@ -118,27 +118,27 @@ class FFZESBridge {
runtimeHeartbeat() {
if ( this._heartbeat )
return;
return;
this._heartbeat = setInterval(() => {
if ( this.active )
this.runtimeSend('heartbeat');
this.runtimeSend('heartbeat');
}, 30000);
}
runtimeSend(msg) {
if ( typeof msg === 'string' )
msg = {ffz_esb_type: msg};
msg = {ffz_esb_type: msg};
if ( ! this.active )
// We need to create our port.
this.runtimeOpen();
this.runtimeOpen();
// Send the message, knowing we have an open port.
this.port.postMessage(msg);
}
};
}
FFZESBridge.Logger = Logger;
@ -151,7 +151,7 @@ const VER = FFZESBridge.version_info = Object.freeze({
build: __version_build__,
hash: __webpack_hash__,
toString: () =>
`${VER.major}.${VER.minor}.${VER.revision}${VER.extra || ''}${VER.build ? `+${VER.build}` : ''}`
`${VER.major}.${VER.minor}.${VER.revision}${VER.extra || ''}${VER.build ? `+${VER.build}` : ''}`
});
window.FFZESBridge = FFZESBridge;

View file

@ -27,7 +27,7 @@ export default class Actions extends Module {
this.actions = {};
this.renderers = {};
this.filterAction = (x) => x.appearance &&
this.filterAction = x => x.appearance &&
this.renderers[x.appearance.type] &&
(! this.renderers[x.appearance.type].load || this.renderers[x.appearance.type].load(x.appearance)) &&
(! x.action || this.actions[x.action]);

View file

@ -61,7 +61,6 @@
{{ t('setting.actions.chat.target-incompatible', 'Note: This is not compatible with pasting a message into chat, and will not function if that is enabled.') }}
</div>
</div>
</div>
</div>
</template>

View file

@ -15,7 +15,9 @@
v-for="profile in profiles"
:key="profile.value"
:value="profile.value"
>{{ profile.i18n_key ? t(profile.i18n_key, profile.name) : profile.name }}</option>
>
{{ profile.i18n_key ? t(profile.i18n_key, profile.name) : profile.name }}
</option>
</select>
</div>
</div>

View file

@ -40,7 +40,7 @@ export const pin = {
},
hidden(data, message, current_room, current_user, mod_icons, instance) {
let line = instance;
const line = instance;
if ( ! line )
return true;

View file

@ -739,10 +739,10 @@ export default class Badges extends Module {
}
return {
room_id: room_id,
room_login: room_login,
user_id: user_id,
user_login: user_login,
room_id,
room_login,
user_id,
user_login,
data
};
}
@ -1279,11 +1279,11 @@ export default class Badges extends Module {
return;
if ( d.lifetime )
return '\n' + this.i18n.t('badges.subwoofer.lifetime', 'Lifetime Subwoofer');
return `\n${ this.i18n.t('badges.subwoofer.lifetime', 'Lifetime Subwoofer')}`;
return '\n' + this.i18n.t('badges.subwoofer.months', '({count, plural, one {# Month} other {# Months}})', {
return `\n${ this.i18n.t('badges.subwoofer.months', '({count, plural, one {# Month} other {# Months}})', {
count: d.months
});
})}`;
})
};
}

View file

@ -1,5 +1,4 @@
<template>
</template>
<script>

View file

@ -639,7 +639,7 @@ export default class Emotes extends Module {
const overrides = {},
warnings = {};
overrides.addFilter = (filter) => {
overrides.addFilter = filter => {
if ( filter )
filter.__source = addon_id;
@ -648,7 +648,7 @@ export default class Emotes extends Module {
overrides.setProvider = (provider, data) => {
if ( is_dev && ! id_checker.test(provider) )
module.log.warn('[DEV-CHECK] Call to emotes.setProvider did not include addon ID in provider:', provider);
module.log.warn('[DEV-CHECK] Call to emotes.setProvider did not include addon ID in provider:', provider);
if ( data )
data.__source = addon_id;
@ -707,7 +707,7 @@ export default class Emotes extends Module {
}
if ( is_dev ) {
overrides.removeFilter = (filter) => {
overrides.removeFilter = filter => {
let type;
if ( typeof filter === 'string' ) type = filter;
else type = filter.type;
@ -1073,7 +1073,7 @@ export default class Emotes extends Module {
return;
// Get the current channel.
let room_id = this.parent.context.get('context.channelID'),
const room_id = this.parent.context.get('context.channelID'),
room_login = this.parent.context.get('context.channel');
// And now get the current user's available emote sets.
@ -2269,9 +2269,9 @@ export default class Emotes extends Module {
if ( ! set )
throw new Error(`Invalid emote set "${set_id}"`);
let processed = this.processEmote(emote, set_id);
const processed = this.processEmote(emote, set_id);
if ( ! processed )
throw new Error("Invalid emote data object.");
throw new Error('Invalid emote data object.');
const is_disabled = this.shouldFilterEmote(processed, set, set_id);
@ -2284,7 +2284,7 @@ export default class Emotes extends Module {
// 6. Old emote disabled. New emote disabled.
// Are we removing a disabled emote?
let removed = set.disabled_emotes[processed.id];
const removed = set.disabled_emotes[processed.id];
if ( removed ) {
delete set.disabled_emotes[processed.id];
set.disabled_count--;
@ -2456,7 +2456,7 @@ export default class Emotes extends Module {
const bad_emotes = [];
for(const emote of ems) {
let processed = this.processEmote(emote, set_id);
const processed = this.processEmote(emote, set_id);
if ( ! processed ) {
bad_emotes.push(emote);
continue;
@ -2554,7 +2554,7 @@ export default class Emotes extends Module {
}
if ( emote.modifier && emote.mask?.[1] ) {
output = (output || '') + `.modified-emote[data-modifiers~="${emote.id}"] > .chat-line__message--emote {
output = `${output || '' }.modified-emote[data-modifiers~="${emote.id}"] > .chat-line__message--emote {
-webkit-mask-image: url("${emote.mask[1]}");
-webkit-mask-position: center center;
}`

View file

@ -134,9 +134,7 @@ export default class Chat extends Module {
});*/
this.settings.add('debug.link-resolver.source', {
process: (ctx, val) => {
return LINK_DATA_HOSTS[val] ?? LINK_DATA_HOSTS.Production;
},
process: (ctx, val) => LINK_DATA_HOSTS[val] ?? LINK_DATA_HOSTS.Production,
default: null,
ui: {
@ -1404,17 +1402,17 @@ export default class Chat extends Module {
user_ids: 'Please use getUser()'
}, true);
overrides.iterateUsers = function*() {
overrides.iterateUsers = function *() {
for(const user of this.iterateUsers())
yield new Proxy(user, user_proxy);
}
overrides.iterateRooms = function*() {
overrides.iterateRooms = function *() {
for(const room of this.iterateRooms())
yield new Proxy(room, room_proxy);
}
overrides.iterateAllRoomsAndUsers = function*() {
overrides.iterateAllRoomsAndUsers = function *() {
for(const thing of this.iterateAllRoomsAndUsers())
yield new Proxy(thing, (thing instanceof Room)
? room_proxy
@ -1463,13 +1461,13 @@ export default class Chat extends Module {
if ( is_dev ) {
overrides.getUser = (...args) => {
let result = this.getUser(...args);
const result = this.getUser(...args);
if ( result )
return new Proxy(result, user_proxy);
}
overrides.getRoom = (...args) => {
let result = this.getRoom(...args);
const result = this.getRoom(...args);
if ( result )
return new Proxy(result, room_proxy);
}
@ -1579,7 +1577,7 @@ export default class Chat extends Module {
this.emit('chat:reload-data');
});
this.on('load_tracker:complete:chat-data', (list) => {
this.on('load_tracker:complete:chat-data', list => {
if ( this.triggered_reload ) {
const sc = this.resolve('site.chat');
if ( sc?.addNotice )
@ -1649,7 +1647,7 @@ export default class Chat extends Module {
result.then(value => {
// If something is already running, don't override it.
let info = this._link_info[url];
const info = this._link_info[url];
if ( info )
return;
@ -2599,7 +2597,7 @@ export default class Chat extends Module {
emote = emote_set?.emotes?.[token.id];
if ( emote ) {
let urls = (animated ? emote.animated : null) ?? emote.urls;
const urls = (animated ? emote.animated : null) ?? emote.urls;
let pair = getBiggestImage(urls);
if (! pair )
return null;

View file

@ -76,7 +76,7 @@ export const Clip = {
if ( ! clip || ! clip.broadcaster )
return null;
const game = clip.game,
const game = clip.game,
game_display = game && game.displayName;
let user = {
@ -406,7 +406,7 @@ export const Video = {
}
};
let length = video.lengthSeconds;
const length = video.lengthSeconds;
return {
v: 5,
@ -483,7 +483,7 @@ export const Video = {
type: 'icon',
name: 'twitch'
},
" Twitch • ",
' Twitch • ',
{
type: 'format',
format: 'datetime',

View file

@ -93,7 +93,7 @@ export default class Room {
this.manager.room_ids[this._id] = null;
}
0
0
merge(other) {
if ( ! this.login && other.login )
this.login = other.login;

View file

@ -1312,13 +1312,13 @@ export const AddonEmotes = {
hoverSrcSet = big ? token.animSrcSet2 : token.animSrcSet;
}
let style = undefined, outerStyle = undefined;
let style, outerStyle;
const mods = token.modifiers || [], ml = mods.length,
effects = token.modifier_flags,
is_big = (token.big && ! token.can_big && token.height);
let as_bg = (this.emotes.activeAsBackgroundMask & effects) !== 0;
let no_wide = (this.emotes.activeNoWideMask & effects) !== 0;
const no_wide = (this.emotes.activeNoWideMask & effects) !== 0;
if ( no_wide || effects || ml ) {
// We need to calculate the size of the emote and the biggest
@ -1620,19 +1620,19 @@ export const AddonEmotes = {
const target = this.emotes.getTargetEmote();
let style = {
const style = {
width: (target.width ?? 28) * 2,
height: (target.height ?? 28) * 2
};
let outerStyle = {
const outerStyle = {
width: style.width,
height: style.height
};
let as_bg = (this.emotes.activeAsBackgroundMask & effects) !== 0;
let no_wide = (this.emotes.activeNoWideMask & effects) !== 0;
const as_bg = (this.emotes.activeAsBackgroundMask & effects) !== 0;
const no_wide = (this.emotes.activeNoWideMask & effects) !== 0;
let changed = false;
@ -1861,10 +1861,10 @@ export const AddonEmotes = {
last_token.modifiers.push(
Object.assign({
big,
anim
},
emote.token
big,
anim
},
emote.token
)
);
}
@ -2010,7 +2010,7 @@ export const Emoji = {
}
const text = replace ?
token.text.replace(JOINER_REPLACEMENT, "\u200d") :
token.text.replace(JOINER_REPLACEMENT, '\u200d') :
token.text;
splitter.lastIndex = 0;

View file

@ -94,10 +94,12 @@
@click="toggleFavorite"
>
<span class="tw-button-icon__icon">
<figure :class="{
'ffz-i-star': isFavorite,
'ffz-i-star-empty': ! isFavorite
}" />
<figure
:class="{
'ffz-i-star': isFavorite,
'ffz-i-star-empty': ! isFavorite
}"
/>
</span>
</button>
<div class="tw-flex tw-flex-column tw-align-self-start">
@ -175,20 +177,20 @@
<ReportForm
v-if="reporting"
:emote="emote"
:getFFZ="getFFZ"
:get-f-f-z="getFFZ"
@close="close"
/>
<component
v-if="! reporting && loaded && hasBody"
:is="bodyComponent"
v-if="! reporting && loaded && hasBody"
:emote="emote"
:getFFZ="getFFZ"
:get-f-f-z="getFFZ"
@close="close"
/>
<Modifiers
v-if="! reporting && raw_modifiers && raw_modifiers.length"
:raw_modifiers="raw_modifiers"
:getFFZ="getFFZ"
:get-f-f-z="getFFZ"
/>
</div>
</template>
@ -352,13 +354,13 @@ export default {
if ( entry.type === 'report-ffz' )
this.reporting = true;
this.$nextTick(() => this.handleResize());
this.$nextTick(() => this.handleResize());
if ( entry.type === 'report-twitch' ) {
if ( this.reportTwitchEmote(this.emote.id, this.emote.channel_id) )
this.close();
return;
}
},
@ -371,7 +373,7 @@ export default {
parent = document.body;
const box = el.getBoundingClientRect();
let pbox = parent.getBoundingClientRect();
const pbox = parent.getBoundingClientRect();
if ( box.top < pbox.top ) {
el.style.top = `${el.offsetTop + (pbox.top - box.top)}px`;

View file

@ -19,7 +19,7 @@
<img
class="tw-block tw-image tw-image-avatar"
:src="image"
/>
>
</figure>
<div class="tw-flex-grow-1">
{{ collection.title }}
@ -161,11 +161,11 @@ export default {
throw new Error('collection at limit');
const resp = await fetch(url, {
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`
}
}).then(r => r.ok ? r.json() : null);
method: 'PUT',
headers: {
Authorization: `Bearer ${token}`
}
}).then(r => r.ok ? r.json() : null);
this.isInCollection = true;

View file

@ -36,12 +36,12 @@
{{ t('emote-card.error', 'There was an error loading data.') }}
</div>
<CollectionEntry
v-else
v-for="collection in collections"
v-else
:key="collection.id"
:collection="collection"
:emote="emote"
:getFFZ="getFFZ"
:get-f-f-z="getFFZ"
:initial="presence.includes(collection.id)"
/>
</simplebar>

View file

@ -19,8 +19,8 @@
/>
</div>
<div
v-if="expanded"
v-for="(mod, idx) in modifiers"
v-if="expanded"
:key="idx"
class="tw-pd-05 tw-flex tw-align-items-center tw-border-t"
>
@ -48,7 +48,9 @@
</figure>
</div>
<div class="tw-align-left tw-flex-grow-1 tw-ellipsis tw-mg-x-1">
<h4 class="tw-inline" :title="mod.name">{{ mod.name }}</h4>
<h4 class="tw-inline" :title="mod.name">
{{ mod.name }}
</h4>
<p
v-if="mod.source"
class="tw-c-text-alt-2 tw-font-size-6"

View file

@ -48,7 +48,9 @@
phrase="emote-card.report-details"
default="You are reporting this emote for {reason}. Please enter any additional details below:"
>
<template #reason><code>{{ category.i18n ? t(category.i18n, category.title, category) : category.title }}</code></template>
<template #reason>
<code>{{ category.i18n ? t(category.i18n, category.title, category) : category.title }}</code>
</template>
</t-list>
</p>
@ -88,12 +90,12 @@
>
<input
:id="'report$' + id + '$reason$' + idx"
:name="'report-reasons$' + id"
v-model="pendingCategory"
:name="'report-reasons$' + id"
:value="reason"
type="radio"
class="ffz-radio__input"
/>
>
<label
:for="'report$' + id + '$reason$' + idx"
class="tw-block ffz-radio__label tw-pd-r-1 tw-pd-y-1"
@ -117,7 +119,6 @@
</span>
</button>
</div>
</template>
</section>
</template>
@ -155,7 +156,7 @@ export default {
data() {
return {
REASONS: REASONS,
REASONS,
id: id++,
message: '',
pendingCategory: null,

View file

@ -16,7 +16,6 @@
<figure class="ffz-emote-card__live-indicator tw-mg-r-05" />
{{ t('emote-card.live', 'LIVE') }}
</div>
</section>
<template v-if="isSubscriptionEmote">
<p v-if="emote.unlocked">
@ -75,7 +74,7 @@
:data-title="extra.name"
class="ffz-tooltip"
>
<img :src="extra.src" :srcset="extra.srcSet" :alt="extra.name" />
<img :src="extra.src" :srcset="extra.srcSet" :alt="extra.name">
</div>
</div>
<div v-if="emote.channel_id" class="tw-mg-t-1 tw-flex">

View file

@ -213,7 +213,7 @@ export default class EmoteCard extends Module {
}
source = this.i18n.t('emote-card.sub', 'Tier {tier} Sub Emote ({source})', {
tier: tier,
tier,
source: data.owner?.displayName || data.owner?.login
});
@ -287,12 +287,12 @@ export default class EmoteCard extends Module {
// Check if we can actually submit a report.
if ( this.canReportTwitch() )
out.more.push({
type: 'report-twitch',
title_i18n: 'emote-card.report',
title: 'Report Emote',
icon: 'ffz-i-flag'
});
out.more.push({
type: 'report-twitch',
title_i18n: 'emote-card.report',
title: 'Report Emote',
icon: 'ffz-i-flag'
});
}
if ( data.bitsBadgeTierSummary?.threshold ) {
@ -511,7 +511,7 @@ export default class EmoteCard extends Module {
props: {
raw_emote: deep_copy(emote),
raw_modifiers: modifiers,
data: data,
data,
getFFZ: () => this,
reportTwitchEmote: (...args) => this.reportTwitchEmote(...args),

View file

@ -145,13 +145,13 @@
<ManageFFZ
v-if="active_tab === 'manage' && ffzEmote"
:emote="ffzEmote"
:getFFZ="getFFZ"
:get-f-f-z="getFFZ"
:no-header="true"
/>
</keep-alive>
<div
class="tw-c-background-base tw-pd-05"
v-if="active_tab === 'urls'"
class="tw-c-background-base tw-pd-05"
>
<table v-if="embed && embed.urls && embed.urls.length">
<tbody
@ -159,7 +159,9 @@
:key="idx"
>
<tr>
<td class="tw-c-text-alt-2">{{ tNumber(idx + 1) }}.</td>
<td class="tw-c-text-alt-2">
{{ tNumber(idx + 1) }}.
</td>
<td class="tw-pd-x-05 tw-word-break-all">
<a
:data-url="url.url"
@ -180,8 +182,8 @@
class="ffz-pill"
>{{ t('link-card.shortened', 'shortened') }}</span>
<span
v-if="url.flags"
v-for="flag in url.flags"
v-if="url.flags"
class="ffz-pill ffz-pill--live"
>{{ flag }}</span>
</td>

View file

@ -88,7 +88,7 @@ export default class LinkCard extends Module {
out.push(createElement('span', url.host));
let suffix = url.toString().slice(url.origin.length);
const suffix = url.toString().slice(url.origin.length);
if ( suffix.length && suffix !== '/' )
out.push(createElement('span', {
@ -112,7 +112,7 @@ export default class LinkCard extends Module {
return;
}
let pos_x = event ? event.clientX : window.innerWidth / 2,
const pos_x = event ? event.clientX : window.innerWidth / 2,
pos_y = event ? event.clientY + 15 : window.innerHeight / 2;
/*if ( this.last_card ) {
@ -150,7 +150,7 @@ export default class LinkCard extends Module {
render: h => h('link-card', {
props: {
url: link,
data: data,
data,
use_dest: this.settings.get('link-cards.use-destination'),

View file

@ -827,7 +827,7 @@ export default {
},
maybeDynamic(data) {
let ap = data.appearance;
const ap = data.appearance;
if (ap?.type === 'dynamic') {
const act = this.action_def,
ffz = this.vuectx.getFFZ(),

View file

@ -156,13 +156,9 @@ const TITLE_MATCH = /^(.+?)?\s*v?(\d+\.\d+\.\d+(?:\-[a-z0-9-]+)?)$/i,
function linkify(text, repo) {
text = text.replace(SETTING_REGEX, (_, link) => {
return `](~${link})`
});
text = text.replace(SETTING_REGEX, (_, link) => `](~${link})`);
return text.replace(ISSUE_REGEX, (_, space, number) => {
return `${space}[#${number}](https://github.com/FrankerFaceZ/${repo}/issues/${number})`;
});
return text.replace(ISSUE_REGEX, (_, space, number) => `${space}[#${number}](https://github.com/FrankerFaceZ/${repo}/issues/${number})`);
}
@ -248,7 +244,7 @@ export default {
description = lines;
}
let message = description.join('\n').trim();
const message = description.join('\n').trim();
const segments = [];

View file

@ -296,7 +296,7 @@
:act="maybeDynamic(preset)"
:process-color="color"
:renderers="data.renderers"
/>
/>
</div>
</button>
</template>
@ -794,7 +794,7 @@ export default {
},
maybeDynamic(data) {
let ap = data.appearance;
const ap = data.appearance;
if (ap?.type === 'dynamic') {
const act = this.data.actions[data.action],
ffz = this.context.getFFZ(),

View file

@ -36,7 +36,7 @@
class="tw-block tw-font-size-6 tw-full-width ffz-textarea ffz-mg-t-1p"
@blur="updateMessage"
@input="onMessageChange"
/>
>
<textarea
ref="message"
class="tw-block tw-font-size-6 tw-full-width ffz-textarea ffz-mg-t-1p tw-border-bottom-left-radius-medium tw-border-bottom-right-radius-medium"
@ -151,17 +151,25 @@
{{ tTime(item.timestamp, 'HH:mm:ss') }}
</time>
<div v-if="item.pubsub" class="tw-flex-grow-1">
<div class="tw-mg-b-05 tw-border-b tw-pd-b-05">{{ item.topic }}</div>
<div class="tw-mg-b-05 tw-border-b tw-pd-b-05">
{{ item.topic }}
</div>
<div v-html="highlightJson(item.data)" />
</div>
<div v-else-if="item.chat" class="tw-flex-grow-1">
<div v-if="item.tags" class="ffz-ct--tags">
@<template v-for="(tag, key) in item.tags"><span class="ffz-ct--tag">{{ key }}</span>=<span class="ffz-ct--tag-value">{{ tag }}</span>;</template>
@<template v-for="(tag, key) in item.tags">
<span class="ffz-ct--tag">{{ key }}</span>=<span class="ffz-ct--tag-value">{{ tag }}</span>;
</template>
</div>
<div class="ffz-ct--prefix">
<template v-if="item.prefix">:<span v-if="item.user" class="ffz-ct--user">{{ item.user }}</span><span class="ffz-ct--prefix">{{ item.prefix }}</span></template>
<template v-if="item.prefix">
:<span v-if="item.user" class="ffz-ct--user">{{ item.user }}</span><span class="ffz-ct--prefix">{{ item.prefix }}</span>
</template>
<span class="ffz-ct--command">{{ item.command }}</span>
<template v-if="item.channel">#<span class="ffz-ct--channel">{{ item.channel }}</span></template>
<template v-if="item.channel">
#<span class="ffz-ct--channel">{{ item.channel }}</span>
</template>
</div>
<div v-if="item.last_param" class="ffz-ct--params">
<span v-for="para in item.params" class="ffz-ct--param">{{ para }}</span>
@ -212,8 +220,8 @@ const IGNORE_COMMANDS = [
let LOADED_SAMPLES = [
{
"name": "Ping",
"data": "PING :tmi.twitch.tv"
'name': 'Ping',
'data': 'PING :tmi.twitch.tv'
}
];
@ -228,7 +236,7 @@ export default {
const message = state?.ffz_ct_message ?? samples[0].data;
const topic = state?.ffz_ct_topic ?? samples[0].topic ?? '';
let is_custom = true;
const is_custom = true;
/*for(const item of samples) {
if ( ! item.topic )
item.topic = '';
@ -384,7 +392,7 @@ export default {
if ( conn.ws )
conn.ws.onmessage = conn.onSocketMessage;
this.addLog("Started capturing chat.");
this.addLog('Started capturing chat.');
this.listening_chat = true;
},
@ -400,7 +408,7 @@ export default {
if ( conn.ws )
conn.ws.onmessage = conn.onSocketMessage;
this.addLog("Stopped capturing chat.");
this.addLog('Stopped capturing chat.');
this.listening_chat = false;
},
@ -451,7 +459,7 @@ export default {
return;
this.chat.on('site.subpump:pubsub-message', this.handlePubsub, this);
this.addLog("Started capturing PubSub.");
this.addLog('Started capturing PubSub.');
this.listening_pubsub = true;
},
@ -461,7 +469,7 @@ export default {
return;
this.chat.off('site.subpump:pubsub-message', this.handlePubsub, this);
this.addLog("Stopped capturing PubSub.");
this.addLog('Stopped capturing PubSub.');
this.listening_pubsub = false;
},
@ -589,7 +597,7 @@ export default {
data = JSON.parse(this.message);
} catch(err) {
console.error(err);
alert("Unable to parse message.");
alert('Unable to parse message.');
return;
}
@ -612,7 +620,7 @@ export default {
} catch (err) {
console.error(err);
alert("Unable to parse message.");
alert('Unable to parse message.');
return;
}
}

View file

@ -56,17 +56,19 @@
<img
:src="provider.icon"
class="tw-image"
/>
>
</div>
<div>
<h4 v-if="! provider.name">
{{ t('emote-source.unknown', 'Unknown ({id})', provider) }}
</h4>
<h4 v-else>{{
provider.i18n_key
? t(provider.i18n_key, provider.name, provider)
: provider.name
}}</h4>
<h4 v-else>
{{
provider.i18n_key
? t(provider.i18n_key, provider.name, provider)
: provider.name
}}
</h4>
<div v-if="provider.description">
{{ provider.desc_i18n_key ? t(provider.desc_i18n_key, provider.description, provider) : provider.description }}
</div>
@ -83,7 +85,7 @@ import settingMixin from '../setting-mixin';
import Sortable from 'sortablejs';
import { deep_copy } from 'utilities/object';
let last_id = 0;
const last_id = 0;
export default {
mixins: [settingMixin],

View file

@ -8,8 +8,8 @@
{{ t('setting.filters.missing', 'This rule of type "{type}" cannot be loaded. It may be from an add-on that is not loaded.', {type: editing && editing.type}) }}
</div>
<component
v-else
:is="component"
v-else
v-model="editing"
:type="type"
:filters="filters"

View file

@ -212,7 +212,7 @@
<h1 class="tw-mg-5 ffz-i-zreknarf loading" />
</div>
<code v-else-if="typeof raw_data === 'string'">{{ raw_data }}</code>
<code v-else v-html="highlightJson(raw_data, true)"></code>
<code v-else v-html="highlightJson(raw_data, true)" />
</div>
</div>
</div>

View file

@ -100,8 +100,8 @@
<input
id="ffz:editor:name"
ref="name"
:disabled="isEphemeral"
v-model="name"
:disabled="isEphemeral"
class="tw-full-width tw-border-radius-medium tw-font-size-6 tw-pd-x-1 tw-pd-y-05 ffz-input"
>
</div>
@ -114,8 +114,8 @@
<textarea
id="ffz:editor:description"
ref="desc"
:disabled="isEphemeral"
v-model="desc"
:disabled="isEphemeral"
class="tw-full-width tw-border-radius-medium tw-font-size-6 tw-pd-x-1 tw-pd-y-05 ffz-input"
/>
</div>
@ -129,8 +129,8 @@
<key-picker
id="ffz:editor:hotkey"
ref="hotkey"
:disabled="isEphemeral"
v-model="hotkey"
:disabled="isEphemeral"
/>
</div>

View file

@ -541,7 +541,7 @@ export default {
prof.update({
i18n_key: undefined,
desc_i18n_key: undefined,
description: `${prof.description ? prof.description + '\n' : ''}${this.t('setting.backup-restore.imported-at', 'Imported at {now,datetime}.', {now: new Date})}`
description: `${prof.description ? `${prof.description }\n` : ''}${this.t('setting.backup-restore.imported-at', 'Imported at {now,datetime}.', {now: new Date})}`
});
let i = 0;

View file

@ -58,7 +58,6 @@
{{ t('setting.filter.add-default-tip', 'Add all of the default values to this profile.') }}
</span>
</button>
</div>
<filter-editor
@ -68,7 +67,6 @@
:preview="preview"
@input="onInput"
/>
</div>
</template>

View file

@ -42,12 +42,16 @@
<div v-if="page == 'versions'">
<table>
<thead class="tw-border-b tw-pd-b-05 tw-mg-b-05 tw-strong">
<th class="tw-pd-r-1">{{ t('socket.info.version', 'Version') }}</th>
<th class="tw-pd-r-1">
{{ t('socket.info.version', 'Version') }}
</th>
<th>{{ t('socket.info.count', 'Count') }}</th>
</thead>
<tbody>
<tr v-for="entry in version_list" :key="entry[0]">
<td class="tw-pd-r-1">{{ entry[0] }}</td>
<td class="tw-pd-r-1">
{{ entry[0] }}
</td>
<td>{{ tNumber(entry[1]) }}</td>
</tr>
</tbody>
@ -56,12 +60,16 @@
<div v-if="page == 'commands'">
<table>
<thead class="tw-border-b tw-pd-b-05 tw-mg-b-05 tw-strong">
<th class="tw-pd-r-1">{{ t('socket.info.command', 'Command') }}</th>
<th class="tw-pd-r-1">
{{ t('socket.info.command', 'Command') }}
</th>
<th>{{ t('socket.info.count', 'Count') }}</th>
</thead>
<tbody>
<tr v-for="entry in command_list" :key="entry[0]">
<td class="tw-pd-r-1">{{ entry[0] }}</td>
<td class="tw-pd-r-1">
{{ entry[0] }}
</td>
<td>{{ tNumber(entry[1]) }}</td>
</tr>
</tbody>

View file

@ -7,8 +7,8 @@
</div>
<template v-else>
<button
@click="accept"
class="tw-button tw-mg-b-05"
@click="accept"
>
<span class="tw-button__text">
{{ acceptText }}
@ -16,8 +16,8 @@
</button>
<button
v-if="! declined"
@click="reject"
class="tw-button tw-button--text tw-block"
@click="reject"
>
<span class="tw-button__text">
{{ t('tooltip.decline-tos', 'I do not accept.') }}

View file

@ -30,11 +30,15 @@
</div>
<div class="ffz--i18n-sub-entry tw-mg-l-05 tw-flex-grow-1">
<div v-if="error && ! open">
<div class="tw-strong">{{ t('i18n.ui.error', 'Error') }}</div>
<div class="tw-strong">
{{ t('i18n.ui.error', 'Error') }}
</div>
<code class="tw-font-size-7 tw-c-text-alt-2">{{ error }}</code>
</div>
<div v-if="source">
<div class="tw-strong">{{ t('i18n.ui.source', 'Source') }}</div>
<div class="tw-strong">
{{ t('i18n.ui.source', 'Source') }}
</div>
<div
v-for="(line, idx) in source"
:key="idx"
@ -50,7 +54,9 @@
</div>
</div>
<div v-if="context_str && ! open">
<div class="tw-strong">{{ t('i18n.ui.context', 'Context') }}</div>
<div class="tw-strong">
{{ t('i18n.ui.context', 'Context') }}
</div>
<code class="tw-font-size-7 tw-c-text-alt-2">{{ context_str }}</code>
</div>
</div>

View file

@ -4,7 +4,9 @@
class="ffz-dialog tw-elevation-3 tw-c-background-alt tw-c-text-base tw-border tw-flex tw-flex-nowrap tw-flex-column"
>
<header class="tw-c-background-base tw-full-width tw-align-items-center tw-flex tw-flex-nowrap" @dblclick="resize">
<h3 class="ffz-i-zreknarf ffz-i-pd-1">{{ t('i18n.ui.title', 'Translation Tester') }}</h3>
<h3 class="ffz-i-zreknarf ffz-i-pd-1">
{{ t('i18n.ui.title', 'Translation Tester') }}
</h3>
<div class="tw-flex-grow-1 tw-pd-x-2">
<div class="tw-search-input">
<label for="ffz-main-menu.search" class="tw-hide-accessible">{{ t('i18n.ui.search', 'Search Strings') }}</label>

View file

@ -120,7 +120,7 @@
:channel="channel"
:user="user"
:self="self"
:getFFZ="getFFZ"
:get-f-f-z="getFFZ"
@close="close"
/>
</keep-alive>

View file

@ -1,7 +1,5 @@
<template>
<div>
</div>
<div />
</template>
<script>

View file

@ -42,10 +42,6 @@ export default {
}
},
created() {
this.detectMonitors();
},
watch: {
selected() {
if ( ! this.ready || ! this.selected )
@ -62,6 +58,10 @@ export default {
}
},
created() {
this.detectMonitors();
},
methods: {
async detectMonitors() {
let data;

View file

@ -42,7 +42,7 @@ export default class BaseSite extends Module {
if ( this._reactDom )
return this._reactDom;
let reactDom = this.resolve('site.web_munch')?.getModule?.('react-dom');
const reactDom = this.resolve('site.web_munch')?.getModule?.('react-dom');
if ( reactDom?.createPortal )
return this._reactDom = reactDom;
}

View file

@ -644,7 +644,7 @@ export default class Metadata extends Module {
if ( order != null )
el.style.order = order;
let subcontainer = container;
const subcontainer = container;
/*if ( button )
subcontainer = container.querySelector('.tw-flex:last-child') || container;

View file

@ -633,7 +633,7 @@ export default class PlayerBase extends Module {
default: false,
ui: {
path: 'Player > General >> Playback',
title: "Pause/Unpause the player by clicking.",
title: 'Pause/Unpause the player by clicking.',
component: 'setting-check-box'
}
});

View file

@ -2491,8 +2491,8 @@ export default class EmoteMenu extends Module {
title = (provider === 'ffz-main' || emote_set.title_is_channel)
? source_name
? t.i18n.t('emote-menu.source-set', '{channel}\'s Emotes', {channel: source_name})
: t.i18n.t('emote-menu.main-set', 'Channel Emotes')
? t.i18n.t('emote-menu.source-set', '{channel}\'s Emotes', {channel: source_name})
: t.i18n.t('emote-menu.main-set', 'Channel Emotes')
: (emote_set.title || t.i18n.t('emote-menu.unknown-set', `Set #{set_id}`, {set_id: emote_set.id}));
let sort_key = pdata && pdata.sort_key || emote_set.sort;
@ -2572,7 +2572,7 @@ export default class EmoteMenu extends Module {
effect_prefix: emote.modifier ? emote.modifier_prefix : false,
name: emote.name,
favorite: is_fav,
locked: locked,
locked,
hidden: known_hidden.includes(emote.id),
height: emote.height,
width: emote.width

View file

@ -163,31 +163,31 @@ const INLINE_CALLOUT_TYPES = {
};
const CALLOUT_TYPES = {
"AppointedModerator": "appointed-moderator",
"BitsBadgeTier": "bits-badge-tier",
"BitsPowerUps": "bits-power-ups",
"ClipLiveNudge": "clip-live-nudge",
"CommunityMoment": "community-moment",
"CommunityPointsRewards": "community-points-rewards",
"CosmicAbyss": "cosmic-abyss",
"CreatorAnniversaries": "creator-anniversaries",
"Drop": "drop",
"EarnedSubBadge": "earned-sub-badge",
"FavoritedGuestCollab": "favorited-guest-collab",
"GiftBadgeExpiration": "gift-badge-expiration",
"GiftBadgeRestored": "gift-badge-restored",
"GiftBundleUpSell": "gift-bundle-up-sell",
"HypeTrainRewards": "hype-train-rewards",
"LapsedBitsUser": "lapsed-bits-user",
"PartnerPlusUpSellNudge": "partner-plus-up-sell-nudge",
"ReplyByKeyboard": "reply-by-keyboard",
"RequestToJoinAccepted": "request-to-join-accepted",
"STPromo": "st-promo",
"ShareResub": "share-resub",
"SubtemberPromoBits": "subtember-promo-bits",
"ThankSubGifter": "thank-sub-gifter",
"TurnOffAnimatedEmotes": "turn-off-animated-emotes",
"WalletDrop": "wallet-drop"
'AppointedModerator': 'appointed-moderator',
'BitsBadgeTier': 'bits-badge-tier',
'BitsPowerUps': 'bits-power-ups',
'ClipLiveNudge': 'clip-live-nudge',
'CommunityMoment': 'community-moment',
'CommunityPointsRewards': 'community-points-rewards',
'CosmicAbyss': 'cosmic-abyss',
'CreatorAnniversaries': 'creator-anniversaries',
'Drop': 'drop',
'EarnedSubBadge': 'earned-sub-badge',
'FavoritedGuestCollab': 'favorited-guest-collab',
'GiftBadgeExpiration': 'gift-badge-expiration',
'GiftBadgeRestored': 'gift-badge-restored',
'GiftBundleUpSell': 'gift-bundle-up-sell',
'HypeTrainRewards': 'hype-train-rewards',
'LapsedBitsUser': 'lapsed-bits-user',
'PartnerPlusUpSellNudge': 'partner-plus-up-sell-nudge',
'ReplyByKeyboard': 'reply-by-keyboard',
'RequestToJoinAccepted': 'request-to-join-accepted',
'STPromo': 'st-promo',
'ShareResub': 'share-resub',
'SubtemberPromoBits': 'subtember-promo-bits',
'ThankSubGifter': 'thank-sub-gifter',
'TurnOffAnimatedEmotes': 'turn-off-animated-emotes',
'WalletDrop': 'wallet-drop'
};
const UNBLOCKABLE_CALLOUTS = [];
@ -1641,7 +1641,7 @@ export default class ChatHook extends Module {
return;
t.insertChannelPointMessage(msg);
return;
} catch(err) {
t.log.error('Error handling reward event:', err);
@ -2001,7 +2001,7 @@ export default class ChatHook extends Module {
const event = inst.props?.event?.callout?.contextMenuProps?.event ?? inst.props?.event,
type = event?.type;
if ( type !== 'drop' || inst._ffz_clicking || ! this.chat.context.get("chat.drops.auto-rewards") )
if ( type !== 'drop' || inst._ffz_clicking || ! this.chat.context.get('chat.drops.auto-rewards') )
return;
//console.warn('autoClickDrop', event, inst);
@ -2021,7 +2021,7 @@ export default class ChatHook extends Module {
const event = inst.props?.event?.callout?.contextMenuProps?.event ?? inst.props?.event,
type = event?.type;
if ( type !== 'drop' || ! this.chat.context.get("chat.drops.auto-rewards") )
if ( type !== 'drop' || ! this.chat.context.get('chat.drops.auto-rewards') )
return;
btn.click();
@ -3317,7 +3317,7 @@ export default class ChatHook extends Module {
id: out.id,
displayName: out.user.userDisplayName,
login: out.user.userLogin,
reward: reward,
reward,
message: out,
userID: out.user.userID,
animationID: e.animationID,

View file

@ -1184,7 +1184,7 @@ export default class Input extends Module {
for(const emote of emotes) {
const match_type = inst.doesEmoteMatchTerm(emote, search);
if (match_type < emoteMatchingType)
continue;
continue;
const element = {
current: input,

View file

@ -41,9 +41,7 @@ export default class ChatLine extends Module {
this.line_types = {};
this.line_types.unknown = {
renderNotice: (msg, current_user, room, inst, e) => {
return `Unknown message type: ${msg.ffz_type}`
}
renderNotice: (msg, current_user, room, inst, e) => `Unknown message type: ${msg.ffz_type}`
};
this.line_types.notice = {
@ -179,19 +177,17 @@ export default class ChatLine extends Module {
};
this.line_types.cheer = {
renderNotice: (msg, current_user, room, inst, e) => {
return this.i18n.tList(
'chat.bits-message',
'Cheered {count, plural, one {# Bit} other {# Bits}}',
{
count: msg.bits || 0
}
);
}
renderNotice: (msg, current_user, room, inst, e) => this.i18n.tList(
'chat.bits-message',
'Cheered {count, plural, one {# Bit} other {# Bits}}',
{
count: msg.bits || 0
}
)
};
this.line_types.points = {
getClass: (msg) => {
getClass: msg => {
const highlight = msg.ffz_reward_highlight && this.chat.context.get('chat.points.allow-highlight') === 2;
return `ffz--points-line tw-pd-l-1 tw-pd-r-2 ${highlight ? 'ffz-custom-color ffz--points-highlight' : ''}`;
@ -1099,7 +1095,7 @@ other {# messages were deleted by a moderator.}
hl_position === 1
? 'ffz-highlight-tags__above'
: 'tw-mg-r-05'
}`
}`
}, highlight_tags);
else
highlight_tags = null;
@ -1173,7 +1169,7 @@ other {# messages were deleted by a moderator.}
className: 'tw-font-size-8 tw-mg-t-05'
}, t.i18n.t('chat.sent-from-source', 'Sent from {source}', {source: source.displayName ?? source.login}))
: null
]
]
)
]
: want_source_tip

View file

@ -873,9 +873,9 @@ export default class Directory extends Module {
else if ( ! el.contains(el.ffz_flags_el) )
container.appendChild(el.ffz_flags_el);
el.ffz_flags_tt.textContent = this.i18n.t('metadata.flags.tooltip', 'Intended for certain audiences. May contain:')
+ '\n\n'
+ el._ffz_flags.map(x => x.localizedName).join('\n');
el.ffz_flags_tt.textContent = `${this.i18n.t('metadata.flags.tooltip', 'Intended for certain audiences. May contain:')
}\n\n${
el._ffz_flags.map(x => x.localizedName).join('\n')}`;
}
clearFlags(el) {

View file

@ -105,7 +105,7 @@ export default class ModView extends Module {
const root = this.fine.getReactInstance(el);
let channel = null;
let node = this.fine.searchNode(root, n => {
const node = this.fine.searchNode(root, n => {
let i = 0;
let state = n.memoizedState;
while(state != null && channel == null && i < 50) {

View file

@ -185,7 +185,7 @@ export default class VideoChatHook extends Module {
render() {
//if ( ! t.VideoChatMenu._class )
return null;
return null;
/*return (<div class={`tw-flex-shrink-0 video-chat__message-menu${this.state.force ? ' video-chat__message-menu--force-visible' : ''}`}>
<t.VideoChatMenu._class

View file

@ -5,7 +5,7 @@
<div class="tw-relative">
<div class="tw-absolute tw-align-items-center tw-c-text-alt-2 tw-flex tw-full-height ffz-input__icon tw-justify-content-center tw-left-0 tw-top-0 tw-z-default">
<figure class="tw-mg-y-05 tw-mg-x-05">
<img class="ffz-preview-emote" v-if="val.src" :src="val.src" />
<img v-if="val.src" class="ffz-preview-emote" :src="val.src">
</figure>
</div>
<input
@ -24,7 +24,7 @@
@focus="onFocus"
@blur="onBlur"
@keydown.escape="open = false"
/>
>
<button
v-if="clearable"
class="tw-absolute tw-right-0 tw-top-0 tw-button tw-button--text ffz-il-tooltip__container"
@ -65,7 +65,7 @@
@blur="onBlur"
>
<figure :class="`tw-mg-y-05 tw-mg-x-1`">
<img :src="i.src" />
<img :src="i.src">
</figure>
</div>
</div>

View file

@ -87,7 +87,7 @@ export default {
return [];
//if ( ! this.context.matches_only )
return this.item.tabs;
return this.item.tabs;
//return this.item.tabs.filter(tab => this.shouldShow(tab));
},

File diff suppressed because it is too large Load diff

View file

@ -673,7 +673,7 @@ function header_vue(token, h, ctx) {
background = renderWithCapture(token.background, h, ctx, token.markdown).content;
}
let subtok = resolveToken(token.sub_logo, ctx);
const subtok = resolveToken(token.sub_logo, ctx);
if ( ! token.compact && subtok && canShowImage(subtok, ctx) ) {
const aspect = subtok.aspect;
@ -848,7 +848,7 @@ function header_normal(token, createElement, ctx) {
background = renderWithCapture(token.background, createElement, ctx, token.markdown).content;
}
let subtok = resolveToken(token.sub_logo, ctx);
const subtok = resolveToken(token.sub_logo, ctx);
if ( ! token.compact && subtok && canShowImage(subtok, ctx) ) {
const aspect = subtok.aspect;
@ -1124,7 +1124,7 @@ function findMatchingLocale(locale, list) {
}
// What about partials?
let prefixed = `${locale.toLowerCase()}-`;
const prefixed = `${locale.toLowerCase()}-`;
for(const item of list) {
if ( item.toLowerCase().startsWith(prefixed) )
return item;
@ -1141,7 +1141,7 @@ TOKEN_TYPES.i18n_select = function(token, createElement, ctx) {
// What locale and choices do we have.
const choices = token.choices || {};
let locale = ctx.i18n?.locale ?? 'en';
const locale = ctx.i18n?.locale ?? 'en';
// Try to find a valid match, or use the default.
let selected = findMatchingLocale(locale, Object.keys(choices));
@ -1182,7 +1182,7 @@ TOKEN_TYPES.link = function(token, createElement, ctx) {
klass.push(`ffz-link--inherit`);
if ( ctx.vue ) {
let on = {};
const on = {};
if ( ctx.link_click_handler )
on.click = ctx.link_click_handler;
@ -1317,8 +1317,8 @@ TOKEN_TYPES.player = function(token, createElement, ctx) {
const style = {};
const aspect = token.active_aspect ?? token.aspect;
if ( aspect )
style.aspectRatio = aspect;
if ( aspect )
style.aspectRatio = aspect;
if ( ctx.vue )
return createElement(token.audio ? 'audio' : 'video', {