1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-06-27 21:05:53 +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

@ -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 ) {