mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-05 02:28:31 +00:00
4.0.0-rc12.17
* Added: Setting to disable player auto-play. (Closes #515) * Fixed: Cheers not appearing in chat messages. * Fixed: Reasons not working for timeouts / bans in in-line actions. (Closes #513)
This commit is contained in:
parent
cf0245204e
commit
5cd0c11b0c
4 changed files with 22 additions and 15 deletions
|
@ -100,7 +100,7 @@ class FrankerFaceZ extends Module {
|
||||||
FrankerFaceZ.Logger = Logger;
|
FrankerFaceZ.Logger = Logger;
|
||||||
|
|
||||||
const VER = FrankerFaceZ.version_info = {
|
const VER = FrankerFaceZ.version_info = {
|
||||||
major: 4, minor: 0, revision: 0, extra: '-rc12.16',
|
major: 4, minor: 0, revision: 0, extra: '-rc12.17',
|
||||||
commit: __git_commit__,
|
commit: __git_commit__,
|
||||||
build: __webpack_hash__,
|
build: __webpack_hash__,
|
||||||
toString: () =>
|
toString: () =>
|
||||||
|
|
|
@ -136,7 +136,7 @@ export const ban = {
|
||||||
},
|
},
|
||||||
|
|
||||||
click(event, data) {
|
click(event, data) {
|
||||||
this.sendMessage(data.room.login, `/ban ${data.user.login} ${data.reason||''}`);
|
this.sendMessage(data.room.login, `/ban ${data.user.login} ${data.reason||data.options.reason||''}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -177,7 +177,7 @@ export const timeout = {
|
||||||
},
|
},
|
||||||
|
|
||||||
click(event, data) {
|
click(event, data) {
|
||||||
this.sendMessage(data.room.login, `/timeout ${data.user.login} ${data.options.duration} ${data.reason||''}`);
|
this.sendMessage(data.room.login, `/timeout ${data.user.login} ${data.options.duration} ${data.reason||data.options.reason||''}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -482,16 +482,13 @@ export const CheerEmotes = {
|
||||||
if ( ! tokens || ! tokens.length || ! msg.bits )
|
if ( ! tokens || ! tokens.length || ! msg.bits )
|
||||||
return tokens;
|
return tokens;
|
||||||
|
|
||||||
// TODO: Store the room onto the chat message so we don't need to look this up.
|
const room = this.getRoom(msg.roomID, msg.roomLogin, true),
|
||||||
const SiteChat = this.resolve('site.chat'),
|
actions = room && room.bitsConfig;
|
||||||
chat = SiteChat && SiteChat.currentChat,
|
|
||||||
bitsConfig = chat && chat.props.bitsConfig;
|
|
||||||
|
|
||||||
if ( ! bitsConfig )
|
if ( ! actions )
|
||||||
return tokens;
|
return tokens;
|
||||||
|
|
||||||
const actions = bitsConfig.indexedActions,
|
const matcher = new RegExp(`^(${Object.keys(actions).join('|')})(\\d+)$`, 'i');
|
||||||
matcher = new RegExp(`^(${Object.keys(actions).join('|')})(\\d+)$`, 'i');
|
|
||||||
|
|
||||||
const out = [],
|
const out = [],
|
||||||
collected = {},
|
collected = {},
|
||||||
|
@ -516,11 +513,11 @@ export const CheerEmotes = {
|
||||||
}
|
}
|
||||||
|
|
||||||
const amount = parseInt(match[2], 10),
|
const amount = parseInt(match[2], 10),
|
||||||
tiers = cheer.orderedTiers;
|
tiers = cheer.tiers;
|
||||||
|
|
||||||
let tier, token;
|
let tier, token;
|
||||||
for(let i=0, l = tiers.length; i < l; i++)
|
for(let i=0, l = tiers.length; i < l; i++)
|
||||||
if ( amount >= tiers[i].bits ) {
|
if ( amount >= tiers[i].amount ) {
|
||||||
tier = i;
|
tier = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -566,11 +563,11 @@ export const CheerEmotes = {
|
||||||
if ( has(collected, prefix) ) {
|
if ( has(collected, prefix) ) {
|
||||||
const cheers = collected[prefix],
|
const cheers = collected[prefix],
|
||||||
cheer = actions[prefix],
|
cheer = actions[prefix],
|
||||||
tiers = cheer.orderedTiers;
|
tiers = cheer.tiers;
|
||||||
|
|
||||||
let tier = 0;
|
let tier = 0;
|
||||||
for(let l = tiers.length; tier < l; tier++)
|
for(let l = tiers.length; tier < l; tier++)
|
||||||
if ( cheers.total >= tiers[tier].bits )
|
if ( cheers.total >= tiers[tier].amount )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
out.unshift({
|
out.unshift({
|
||||||
|
|
|
@ -137,6 +137,16 @@ export default class Player extends Module {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.settings.add('player.no-autoplay', {
|
||||||
|
default: false,
|
||||||
|
ui: {
|
||||||
|
path: 'Channel > Player >> Playback',
|
||||||
|
title: 'Do not automatically start playing videos or streams.',
|
||||||
|
description: 'Note: This feature does not apply when navigating directly from channel to channel.',
|
||||||
|
component: 'setting-check-box'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
this.settings.add('player.vod.autoplay', {
|
this.settings.add('player.vod.autoplay', {
|
||||||
default: true,
|
default: true,
|
||||||
ui: {
|
ui: {
|
||||||
|
@ -265,7 +275,7 @@ export default class Player extends Module {
|
||||||
if ( this.settings.get('player.theatre.auto-enter') && inst.onTheatreChange )
|
if ( this.settings.get('player.theatre.auto-enter') && inst.onTheatreChange )
|
||||||
inst.onTheatreChange(true);
|
inst.onTheatreChange(true);
|
||||||
|
|
||||||
if ( ! this.settings.get('player.home.autoplay') && this.router.current.name === 'front-page' ) {
|
if ( this.settings.get('player.no-autoplay') || (! this.settings.get('player.home.autoplay') && this.router.current.name === 'front-page') ) {
|
||||||
if ( inst.player )
|
if ( inst.player )
|
||||||
this.disableAutoplay(inst);
|
this.disableAutoplay(inst);
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue