2017-11-13 01:23:39 -05:00
|
|
|
'use strict';
|
|
|
|
|
2019-10-28 14:56:55 -04:00
|
|
|
import {make_enum} from 'utilities/object';
|
|
|
|
|
|
|
|
|
2017-11-13 01:23:39 -05:00
|
|
|
export const DEBUG = localStorage.ffzDebugMode === 'true' && document.body.classList.contains('ffz-dev');
|
|
|
|
export const SERVER = DEBUG ? '//localhost:8000' : 'https://cdn.frankerfacez.com';
|
|
|
|
|
2017-11-15 21:59:13 -05:00
|
|
|
export const CLIENT_ID = 'a3bc9znoz6vi8ozsoca0inlcr4fcvkl';
|
2017-11-13 01:23:39 -05:00
|
|
|
export const API_SERVER = '//api.frankerfacez.com';
|
2020-11-12 17:02:04 -05:00
|
|
|
export const NEW_API = '//api2.frankerfacez.com';
|
2017-11-13 01:23:39 -05:00
|
|
|
|
2019-12-13 21:20:39 -05:00
|
|
|
//export const SENTRY_ID = 'https://1c3b56f127254d3ba1bd1d6ad8805eee@sentry.io/1186960';
|
2020-11-14 14:08:27 -05:00
|
|
|
//export const SENTRY_ID = 'https://07ded545d3224ca59825daee02dc7745@catbag.frankerfacez.com:444/2';
|
|
|
|
export const SENTRY_ID = 'https://74b46b3894114f399d51949c6d237489@sentry.frankerfacez.com/2';
|
2018-04-11 17:05:31 -04:00
|
|
|
|
2018-05-18 02:10:00 -04:00
|
|
|
export const LV_SERVER = 'https://cbenni.com/api';
|
|
|
|
export const LV_SOCKET_SERVER = 'wss://cbenni.com/socket.io/';
|
|
|
|
|
|
|
|
|
2021-04-24 14:37:01 -04:00
|
|
|
export const BAD_HOTKEYS = [
|
|
|
|
'f',
|
|
|
|
'space',
|
|
|
|
'k',
|
|
|
|
'shift+up',
|
|
|
|
'shift+down',
|
|
|
|
'esc',
|
|
|
|
'm',
|
|
|
|
'?',
|
|
|
|
'alt+t',
|
|
|
|
'alt+x'
|
|
|
|
];
|
|
|
|
|
|
|
|
|
4.25.0
* Fixed: Smooth Scrolling no longer causing chat to scroll. (Closes #1068)
* Fixed: Issue with users using certain external stylesheets causing chat messages to become impossible to read on mouse hover. (Closes #1066)
* Fixed: Issues with badge sorting causing some badges to be overridden when they shouldn't be.
* Changed: Improve caching of badge data, such that re-rendering chat lines requires less computation.
* Changed: Refactor how chat lines listen for settings changes to reduce code duplication.
* Changed: Refactor how chat lines are invalidated to minimize work when changing settings.
* API Added: `chat:rerender-lines` event that, when emitted, causes all chat lines to be re-rendered.
* API Added: `chat:update-line-tokens` event that, when emitted, causes all chat lines to have their tokens invalidated and recalculated.
* API Added: `chat:update-line-badges` event that, when emitted, causes all chat lines to have their cached badges invalidated and recalculated.
* API Changed: `chat:update-lines-by-user` now has extra properties for separately invalidating tokens or badges. The full signature is `chat:update-lines-by-user(id, login, invalidate_tokens = true, invalidate_badges = true)`
2021-06-23 16:08:57 -04:00
|
|
|
export const RERENDER_SETTINGS = [
|
|
|
|
'chat.name-format',
|
|
|
|
'chat.me-style',
|
|
|
|
'chat.rituals.show',
|
|
|
|
'chat.subs.show',
|
|
|
|
'chat.subs.compact',
|
|
|
|
'chat.actions.inline',
|
|
|
|
'chat.timestamp-format',
|
|
|
|
'chat.points.allow-highlight',
|
|
|
|
'chat.filtering.display-deleted',
|
|
|
|
'chat.filtering.display-mod-action',
|
2021-07-12 13:46:04 -04:00
|
|
|
'chat.replies.style',
|
|
|
|
'chat.bits.cheer-notice'
|
4.25.0
* Fixed: Smooth Scrolling no longer causing chat to scroll. (Closes #1068)
* Fixed: Issue with users using certain external stylesheets causing chat messages to become impossible to read on mouse hover. (Closes #1066)
* Fixed: Issues with badge sorting causing some badges to be overridden when they shouldn't be.
* Changed: Improve caching of badge data, such that re-rendering chat lines requires less computation.
* Changed: Refactor how chat lines listen for settings changes to reduce code duplication.
* Changed: Refactor how chat lines are invalidated to minimize work when changing settings.
* API Added: `chat:rerender-lines` event that, when emitted, causes all chat lines to be re-rendered.
* API Added: `chat:update-line-tokens` event that, when emitted, causes all chat lines to have their tokens invalidated and recalculated.
* API Added: `chat:update-line-badges` event that, when emitted, causes all chat lines to have their cached badges invalidated and recalculated.
* API Changed: `chat:update-lines-by-user` now has extra properties for separately invalidating tokens or badges. The full signature is `chat:update-lines-by-user(id, login, invalidate_tokens = true, invalidate_badges = true)`
2021-06-23 16:08:57 -04:00
|
|
|
];
|
|
|
|
|
|
|
|
export const UPDATE_BADGE_SETTINGS = [
|
|
|
|
'chat.badges.style',
|
|
|
|
'chat.badges.hidden',
|
|
|
|
'chat.badges.custom-mod',
|
|
|
|
'chat.badges.custom-vip',
|
|
|
|
];
|
|
|
|
|
|
|
|
export const UPDATE_TOKEN_SETTINGS = [
|
|
|
|
'chat.emotes.enabled',
|
|
|
|
'chat.emotes.2x',
|
|
|
|
'chat.emotes.animated',
|
|
|
|
'chat.emoji.style',
|
|
|
|
'chat.bits.stack',
|
|
|
|
'chat.rich.enabled',
|
2021-11-15 17:12:01 -05:00
|
|
|
'chat.rich.want-mid',
|
4.25.0
* Fixed: Smooth Scrolling no longer causing chat to scroll. (Closes #1068)
* Fixed: Issue with users using certain external stylesheets causing chat messages to become impossible to read on mouse hover. (Closes #1066)
* Fixed: Issues with badge sorting causing some badges to be overridden when they shouldn't be.
* Changed: Improve caching of badge data, such that re-rendering chat lines requires less computation.
* Changed: Refactor how chat lines listen for settings changes to reduce code duplication.
* Changed: Refactor how chat lines are invalidated to minimize work when changing settings.
* API Added: `chat:rerender-lines` event that, when emitted, causes all chat lines to be re-rendered.
* API Added: `chat:update-line-tokens` event that, when emitted, causes all chat lines to have their tokens invalidated and recalculated.
* API Added: `chat:update-line-badges` event that, when emitted, causes all chat lines to have their cached badges invalidated and recalculated.
* API Changed: `chat:update-lines-by-user` now has extra properties for separately invalidating tokens or badges. The full signature is `chat:update-lines-by-user(id, login, invalidate_tokens = true, invalidate_badges = true)`
2021-06-23 16:08:57 -04:00
|
|
|
'chat.rich.hide-tokens',
|
|
|
|
'chat.rich.all-links',
|
|
|
|
'chat.rich.minimum-level',
|
|
|
|
'chat.filtering.process-own',
|
|
|
|
'chat.filtering.mention-priority',
|
|
|
|
'chat.filtering.debug',
|
|
|
|
'chat.fix-bad-emotes',
|
|
|
|
'__filter:highlight-terms',
|
|
|
|
'__filter:highlight-users',
|
|
|
|
'__filter:highlight-badges',
|
|
|
|
'__filter:block-terms',
|
|
|
|
'__filter:block-users',
|
|
|
|
'__filter:block-badges'
|
|
|
|
];
|
|
|
|
|
|
|
|
|
2019-02-05 14:24:45 -05:00
|
|
|
export const KEYS = {
|
2021-02-10 16:53:10 -05:00
|
|
|
Tab: 9,
|
2019-02-05 14:24:45 -05:00
|
|
|
Enter: 13,
|
2020-08-04 18:26:11 -04:00
|
|
|
Shift: 16,
|
|
|
|
Control: 17,
|
|
|
|
Alt: 18,
|
2019-02-05 14:24:45 -05:00
|
|
|
Escape: 27,
|
2020-07-02 14:54:46 -04:00
|
|
|
Space: 32,
|
|
|
|
PageUp: 33,
|
|
|
|
PageDown: 34,
|
|
|
|
End: 35,
|
|
|
|
Home: 36,
|
|
|
|
ArrowLeft: 37,
|
|
|
|
ArrowUp: 38,
|
|
|
|
ArrowRight: 39,
|
2020-08-04 18:26:11 -04:00
|
|
|
ArrowDown: 40,
|
|
|
|
Meta: 91,
|
|
|
|
Context: 93
|
2019-02-05 14:24:45 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2018-04-06 21:12:12 -04:00
|
|
|
export const TWITCH_EMOTE_BASE = '//static-cdn.jtvnw.net/emoticons/v1/';
|
2021-06-17 14:27:04 -04:00
|
|
|
export const TWITCH_EMOTE_V2 = '//static-cdn.jtvnw.net/emoticons/v2';
|
2018-04-06 21:12:12 -04:00
|
|
|
|
|
|
|
export const KNOWN_CODES = {
|
|
|
|
'#-?[\\\\/]': '#-/',
|
|
|
|
':-?(?:7|L)': ':-7',
|
|
|
|
'\\<\\;\\]': '<]',
|
|
|
|
'\\:-?(S|s)': ':-S',
|
|
|
|
'\\:-?\\\\': ':-\\',
|
|
|
|
'\\:\\>\\;': ':>',
|
|
|
|
'B-?\\)': 'B-)',
|
|
|
|
'\\:-?[z|Z|\\|]': ':-Z',
|
|
|
|
'\\:-?\\)': ':-)',
|
|
|
|
'\\:-?\\(': ':-(',
|
|
|
|
'\\:-?(p|P)': ':-P',
|
|
|
|
'\\;-?(p|P)': ';-P',
|
|
|
|
'\\<\\;3': '<3',
|
|
|
|
'\\:-?[\\\\/]': ':-/',
|
|
|
|
'\\;-?\\)': ';-)',
|
|
|
|
'R-?\\)': 'R-)',
|
|
|
|
'[oO](_|\\.)[oO]': 'O.o',
|
|
|
|
'[o|O](_|\\.)[o|O]': 'O.o',
|
|
|
|
'\\:-?D': ':-D',
|
|
|
|
'\\:-?(o|O)': ':-O',
|
|
|
|
'\\>\\;\\(': '>(',
|
|
|
|
'Gr(a|e)yFace': 'GrayFace'
|
|
|
|
};
|
|
|
|
|
2020-11-12 17:02:04 -05:00
|
|
|
export const REPLACEMENT_BASE = `${SERVER}/static/replacements/`;
|
2018-04-09 19:57:05 -04:00
|
|
|
|
|
|
|
export const REPLACEMENTS = {
|
|
|
|
15: '15-JKanStyle.png',
|
|
|
|
16: '16-OptimizePrime.png',
|
|
|
|
17: '17-StoneLightning.png',
|
|
|
|
18: '18-TheRinger.png',
|
|
|
|
//19: '19-PazPazowitz.png',
|
|
|
|
//20: '20-EagleEye.png',
|
|
|
|
//21: '21-CougarHunt.png',
|
|
|
|
22: '22-RedCoat.png',
|
|
|
|
26: '26-JonCarnage.png',
|
|
|
|
//27: '27-PicoMause.png',
|
|
|
|
30: '30-BCWarrior.png',
|
|
|
|
33: '33-DansGame.png',
|
|
|
|
36: '36-PJSalt.png'
|
|
|
|
};
|
|
|
|
|
|
|
|
|
2017-11-13 01:23:39 -05:00
|
|
|
export const WS_CLUSTERS = {
|
|
|
|
Production: [
|
|
|
|
['wss://catbag.frankerfacez.com/', 0.25],
|
2019-05-31 16:42:26 -04:00
|
|
|
['wss://andknuckles.frankerfacez.com/', 0.8],
|
2020-02-10 16:54:51 -05:00
|
|
|
['wss://tuturu.frankerfacez.com/', 0.7],
|
2018-05-31 18:34:15 -04:00
|
|
|
['wss://lilz.frankerfacez.com/', 1],
|
2019-06-09 19:48:26 -04:00
|
|
|
['wss://yoohoo.frankerfacez.com/', 1],
|
2020-02-10 16:54:51 -05:00
|
|
|
['wss://pog.frankerfacez.com/', 1],
|
2020-03-15 14:43:02 -04:00
|
|
|
['wss://ayaya.frankerfacez.com/', 1],
|
|
|
|
['wss://champ.frankerfacez.com/', 1]
|
2017-11-13 01:23:39 -05:00
|
|
|
],
|
|
|
|
|
|
|
|
Development: [
|
|
|
|
['wss://127.0.0.1:8003/', 1]
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
export const IS_OSX = navigator.platform ? navigator.platform.indexOf('Mac') !== -1 : /OS X/.test(navigator.userAgent);
|
|
|
|
export const IS_WIN = navigator.platform ? navigator.platform.indexOf('Win') !== -1 : /Windows/.test(navigator.userAgent);
|
2017-11-28 02:03:59 -05:00
|
|
|
export const IS_WEBKIT = navigator.userAgent.indexOf('AppleWebKit/') !== -1 && navigator.userAgent.indexOf('Edge/') === -1;
|
2021-02-15 17:48:30 -05:00
|
|
|
export const IS_FIREFOX = (navigator.userAgent.indexOf('Firefox/') !== -1) || (window.InstallTrigger !== undefined);
|
2017-11-28 02:03:59 -05:00
|
|
|
|
2019-10-28 14:56:55 -04:00
|
|
|
export const WEBKIT_CSS = IS_WEBKIT ? '-webkit-' : '';
|
|
|
|
|
|
|
|
|
|
|
|
export const TWITCH_GLOBAL_SETS = [0, 33, 42];
|
|
|
|
export const TWITCH_POINTS_SETS = [300238151];
|
|
|
|
export const TWITCH_PRIME_SETS = [457, 793, 19151, 19194];
|
|
|
|
|
|
|
|
export const EmoteTypes = make_enum(
|
|
|
|
'Unknown',
|
|
|
|
'Prime',
|
|
|
|
'Turbo',
|
|
|
|
'LimitedTime',
|
|
|
|
'ChannelPoints',
|
|
|
|
'Unavailable',
|
|
|
|
'Subscription',
|
2019-12-12 18:44:19 -05:00
|
|
|
'BitsTier',
|
2020-04-03 19:30:28 -04:00
|
|
|
'Global',
|
2021-06-30 15:51:37 -04:00
|
|
|
'TwoFactor',
|
|
|
|
'Follower'
|
2019-10-28 14:56:55 -04:00
|
|
|
);
|