1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-07-02 17:18:31 +00:00

4.0.0-rc13.19

* Changed: By default, open a Twitch subscription page rather than TwitchEmotes when Shift-Clicking a subscriber emote.
* Changed: Add a link information provider for Pretzel Rocks.
* Fixed: Display better information for links to Twitch channels and to Twitch pages without video content.
* Fixed: Hide Rerun Bar setting incorrectly hiding video information on other channel pages.
* Fixed: Emote Menu icon not appearing correctly when the option to replace it with the FFZ logo is enabled.
This commit is contained in:
SirStendec 2019-01-15 16:14:21 -05:00
parent 57db0387ae
commit adbf50759c
6 changed files with 78 additions and 9 deletions

View file

@ -149,7 +149,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`
FrankerFaceZ.Logger = Logger;
const VER = FrankerFaceZ.version_info = {
major: 4, minor: 0, revision: 0, extra: '-rc13.18',
major: 4, minor: 0, revision: 0, extra: '-rc13.19',
commit: __git_commit__,
build: __webpack_hash__,
toString: () =>

View file

@ -0,0 +1,25 @@
query FFZ_GetEmoteInfo($id: ID!) {
emote(id: $id) {
id
setID
text
subscriptionProduct {
id
displayName
state
owner {
id
login
displayName
}
tier
url
self {
benefit {
id
endsAt
}
}
}
}
}

View file

@ -6,9 +6,11 @@
import Module from 'utilities/module';
import {ManagedStyle} from 'utilities/dom';
import {has, timeout, SourcedSet} from 'utilities/object';
import {get, has, timeout, SourcedSet} from 'utilities/object';
import {CLIENT_ID, NEW_API, API_SERVER, IS_OSX} from 'utilities/constants';
import GET_EMOTE from './emote_info.gql';
const MOD_KEY = IS_OSX ? 'metaKey' : 'ctrlKey';
const EXTRA_INVENTORY = [33563];
@ -201,15 +203,45 @@ export default class Emotes extends Module {
if ( ! ds )
return;
const provider = ds.provider;
const provider = ds.provider,
click_emote = this.parent.context.get('chat.click-emotes'),
click_sub = this.parent.context.get('chat.sub-emotes');
if ( event.shiftKey && this.parent.context.get('chat.click-emotes') ) {
if ( event.shiftKey && (click_emote || click_sub) ) {
let url;
if ( provider === 'twitch' )
if ( provider === 'twitch' ) {
url = `https://twitchemotes.com/emotes/${ds.id}`;
else if ( provider === 'ffz' ) {
if ( click_sub ) {
const apollo = this.resolve('site.apollo');
if ( apollo ) {
apollo.client.query({
query: GET_EMOTE,
variables: {
id: ds.id
}
}).then(result => {
const prod = get('data.emote.subscriptionProduct', result);
if ( prod && prod.state === 'ACTIVE' && prod.owner && prod.owner.login )
url = `https://www.twitch.tv/subs/${prod.owner.login}`;
else if ( ! click_emote )
return false;
if ( url ) {
const win = window.open();
if ( win ) {
win.opener = null;
win.location = url;
}
}
});
return true;
}
}
} else if ( provider === 'ffz' ) {
const emote_set = this.emote_sets[ds.set],
emote = emote_set && emote_set.emotes[ds.id];
@ -223,6 +255,9 @@ export default class Emotes extends Module {
url = `https://www.frankerfacez.com/emoticons/${emote.id}`;
}
if ( ! click_emote )
return false;
if ( url ) {
const win = window.open();
if ( win ) {

View file

@ -550,6 +550,15 @@ export default class Chat extends Module {
}
});
this.settings.add('chat.click-emotes.sub-pages', {
default: true,
ui: {
path: 'Chat > Behavior >> General',
title: 'Open Twitch subscription pages by Shift-Clicking emotes when relevant.',
component: 'setting-check-box'
}
});
const ts = new Date(0).toLocaleTimeString().toUpperCase(),
default_24 = ts.lastIndexOf('PM') === -1 && ts.lastIndexOf('AM') === -1;

View file

@ -25,7 +25,7 @@ const CLASSES = {
'player-ext-hover': '.player:not([data-controls="true"]) .extension-container',
'player-event-bar': '.channel-root .live-event-banner-ui__header',
'player-rerun-bar': '.channel-root div.tw-c-text-overlay:not([data-a-target="hosting-ui-header"])',
'player-rerun-bar': '.channel-root__player_container div.tw-c-text-overlay:not([data-a-target="hosting-ui-header"])',
'pinned-cheer': '.pinned-cheer,.pinned-cheer-v2',
'whispers': '.whispers',

View file

@ -1,8 +1,8 @@
.tw-button-icon[data-a-target="emote-picker-button"] {
.tw-button-icon__icon {
padding: .7rem .1rem .1rem .3rem;
padding: .6rem .4rem .2rem .4rem;
figure {
div > div {
&:before {
display: inline-block;
width: 2.4rem;