1
0
Fork 0
mirror of https://github.com/FrankerFaceZ/FrankerFaceZ.git synced 2025-10-13 22:41:57 +00:00

Emote Menu? Emote Menu.

* Add the emote menu.
* Add an option to replace the emote menu icon with the FFZ icon.
* Add icons to the icon font.
* Add a basic human duration formatting method to i18n.
* Add methods to the emotes module to get sets including the providers.
* Add a method to the emotes module to load an arbitrary set.
* Add a map to the emotes module for identifying providers.
* Add new events for when emote sets change.
* Add support for loading featured channel emotes.
* Add an option to suppress source sets in emote tooltips.
* Add an option to display a sellout line in emote tooltips.
* Remove emote menu from the WIP section of the home page of the menu.
* Fix a typo in rich content.
* Remove a bit of logging from fine.
* Add helper methods for set comparison and basic debouncing to utilities/object.
* Add constants for the emote menu.
* Add methods to show/hide a tooltip to the tooltip data object.
This commit is contained in:
SirStendec 2018-04-06 21:12:12 -04:00
parent 92130ebac4
commit e6e11fe562
23 changed files with 1423 additions and 26 deletions

View file

@ -330,7 +330,7 @@ export default class Fine extends Module {
if ( idx !== -1 )
this._waiting.splice(idx, 1);
this.log.info(`Found class for "${w.name}" at depth ${d.depth}`, d);
this.log.info(`Found class for "${w.name}" at depth ${d.depth}`);
w._set(d.cls, d.instances);
}
}

View file

@ -6,6 +6,33 @@ export const SERVER = DEBUG ? '//localhost:8000' : 'https://cdn.frankerfacez.com
export const CLIENT_ID = 'a3bc9znoz6vi8ozsoca0inlcr4fcvkl';
export const API_SERVER = '//api.frankerfacez.com';
export const TWITCH_EMOTE_BASE = '//static-cdn.jtvnw.net/emoticons/v1/';
export const KNOWN_CODES = {
'#-?[\\\\/]': '#-/',
':-?(?:7|L)': ':-7',
'\\&lt\\;\\]': '<]',
'\\:-?(S|s)': ':-S',
'\\:-?\\\\': ':-\\',
'\\:\\&gt\\;': ':>',
'B-?\\)': 'B-)',
'\\:-?[z|Z|\\|]': ':-Z',
'\\:-?\\)': ':-)',
'\\:-?\\(': ':-(',
'\\:-?(p|P)': ':-P',
'\\;-?(p|P)': ';-P',
'\\&lt\\;3': '<3',
'\\:-?[\\\\/]': ':-/',
'\\;-?\\)': ';-)',
'R-?\\)': 'R-)',
'[oO](_|\\.)[oO]': 'O.o',
'[o|O](_|\\.)[o|O]': 'O.o',
'\\:-?D': ':-D',
'\\:-?(o|O)': ':-O',
'\\&gt\\;\\(': '>(',
'Gr(a|e)yFace': 'GrayFace'
};
export const WS_CLUSTERS = {
Production: [
['wss://catbag.frankerfacez.com/', 0.25],

View file

@ -39,6 +39,39 @@ export function timeout(promise, delay) {
}
/**
* Make sure that a given asynchronous function is only called once
* at a time.
*/
export function once(fn) {
let waiters;
return function(...args) {
return new Promise(async (s,f) => {
if ( waiters )
return waiters.push([s,f]);
waiters = [[s,f]];
let result;
try {
result = await fn.call(this, ...args); // eslint-disable-line no-invalid-this
} catch(err) {
for(const w of waiters)
w[1](err);
waiters = null;
return;
}
for(const w of waiters)
w[0](result);
waiters = null;
})
}
}
/**
* Check that two arrays are the same length and that each array has the same
* items in the same indices.
@ -59,6 +92,18 @@ export function array_equals(a, b) {
}
export function set_equals(a,b) {
if ( !(a instanceof Set) || !(b instanceof Set) || a.size !== b.size )
return false;
for(const v of a)
if ( ! b.has(v) )
return false;
return true;
}
/**
* Special logic to ensure that a target object is matched by a filter.
* @param {object} filter The filter object

View file

@ -193,6 +193,8 @@ export class Tooltip {
// Set this early in case content uses it early.
tip.update = () => tip._update(); // tip.popper && tip.popper.scheduleUpdate();
tip.show = () => this.show(tip);
tip.hide = () => this.hide(tip);
tip.rerender = () => {
if ( tip.visible ) {
this.hide(tip);