mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-02 17:18:31 +00:00
Added: Report subscriber emoticon set information to the server for the purpose of mapping emote set IDs to channels.
Fixed: CSS bug with the menu when no FFZ emotes are present.
This commit is contained in:
parent
ee1380f95d
commit
adaf77dabf
2 changed files with 15 additions and 1 deletions
|
@ -2,6 +2,8 @@ var FFZ = window.FrankerFaceZ,
|
|||
constants = require('../constants'),
|
||||
utils = require('../utils'),
|
||||
|
||||
reported_sets = [],
|
||||
|
||||
fix_menu_position = function(container) {
|
||||
var swapped = document.body.classList.contains('ffz-sidebar-swap') && ! document.body.classList.contains('ffz-portrait');
|
||||
|
||||
|
@ -540,6 +542,8 @@ FFZ.menu_pages.channel = {
|
|||
header.innerHTML = '<span class="right">Twitch</span>Subscriber Emoticons';
|
||||
grid.appendChild(header);
|
||||
|
||||
var known_sets = [];
|
||||
|
||||
for(var emotes=product.get("emoticons") || [], i=0; i < emotes.length; i++) {
|
||||
var emote = emotes[i];
|
||||
if ( emote.state !== "active" )
|
||||
|
@ -551,6 +555,9 @@ FFZ.menu_pages.channel = {
|
|||
|
||||
s.className = 'emoticon ffz-tooltip ffz-tooltip-no-credit' + (!can_use ? " locked" : "");
|
||||
|
||||
if ( known_sets.indexOf(emote.emoticon_set) === -1 )
|
||||
known_sets.push(emote.emoticon_set);
|
||||
|
||||
if ( emote.emoticon_set ) {
|
||||
var favs = this.settings.favorite_emotes["twitch-" + emote.emoticon_set];
|
||||
s.classList.add('ffz-can-favorite');
|
||||
|
@ -583,6 +590,13 @@ FFZ.menu_pages.channel = {
|
|||
c++;
|
||||
}
|
||||
|
||||
if ( reported_sets.indexOf(product.get('id')) === -1 && known_sets.length ) {
|
||||
reported_sets.push(product.get('id'));
|
||||
this.log("Sets for " + product.get('id') + " [" + product.get('ticketProductId') + "]: " + JSON.stringify(known_sets));
|
||||
this.ws_send("report_twitch_set", [product.get('id'), product.get('ticketProductId'), known_sets]);
|
||||
}
|
||||
|
||||
|
||||
if ( c > 0 )
|
||||
inner.appendChild(grid);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue