mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-09-17 02:16:54 +00:00
4.20.69
Nice. * Changed: Warn users that they have `Show Mod Icons` disabled within [Chat > Actions](~chat.actions). * Changed: Blocked Badges, Highlight Badges, and Blocked Types within [Chat > Filtering](~chat.filtering) no longer have a default item. This will hopefully minimize user confusion. * Changed: Blocked Badges also has a new description telling users that it isn't for hiding badges, with a link to the correct place to change badge visibility. * Changed: Remove the New Link Tokenization experiment, making it enabled for all users. * Changed: When navigating within the FFZ Control Center in a pop-out window, update the URL so that it can be shared to link to a specific settings page. * Changed: Disable the websocket connection for users in the API Links experiment to reduce load on the socket cluster. * Fixed: Bug with the FFZ Control Center failing to load if experiments haven't been populated correctly. * Fixed: Badge Visibility not being populated when opening the FFZ Control Center on a page without chat. * API Added: `<markdown />` now supports a link syntax for navigating to a new section of the FFZ Control Center. * API Fixed: Better tokenization for settings paths. Brackets can now be used safely in embedded JSON. * API Fixed: `deep_equals` and `shallow_object_equals` returning false when objects were otherwise equal but had keys in a different order.
This commit is contained in:
parent
f5135ad291
commit
77d6cf56d2
27 changed files with 365 additions and 96 deletions
|
@ -12,8 +12,8 @@ import {CATEGORIES} from './emoji';
|
|||
|
||||
|
||||
const EMOTE_CLASS = 'chat-image chat-line__message--emote',
|
||||
WHITESPACE = /^\s*$/,
|
||||
LINK_REGEX = /([^\w@#%\-+=:~])?((?:(https?:\/\/)?(?:[\w@#%\-+=:~]+\.)+[a-z]{2,6}(?:\/[\w./@#%&()\-+=:?~]*)?))([^\w./@#%&()\-+=:?~]|\s|$)/g,
|
||||
//WHITESPACE = /^\s*$/,
|
||||
//LINK_REGEX = /([^\w@#%\-+=:~])?((?:(https?:\/\/)?(?:[\w@#%\-+=:~]+\.)+[a-z]{2,6}(?:\/[\w./@#%&()\-+=:?~]*)?))([^\w./@#%&()\-+=:?~]|\s|$)/g,
|
||||
NEW_LINK_REGEX = /(?:(https?:\/\/)?((?:[\w#%\-+=:~]+\.)+[a-z]{2,10}(?:\/[\w./#%&@()\-+=:?~]*)?))/g,
|
||||
//MENTION_REGEX = /([^\w@#%\-+=:~])?(@([^\u0000-\u007F]+|\w+)+)([^\w./@#%&()\-+=:?~]|\s|$)/g; // eslint-disable-line no-control-regex
|
||||
MENTION_REGEX = /^(['"*([{<\\/]*)(@)((?:[^\u0000-\u007F]|[\w-])+)(?:\b|$)/; // eslint-disable-line no-control-regex
|
||||
|
@ -148,7 +148,7 @@ export const Links = {
|
|||
if ( ! tokens || ! tokens.length )
|
||||
return tokens;
|
||||
|
||||
const use_new = this.experiments.getAssignment('new_links');
|
||||
//const use_new = this.experiments.getAssignment('new_links');
|
||||
|
||||
const out = [];
|
||||
for(const token of tokens) {
|
||||
|
@ -157,28 +157,28 @@ export const Links = {
|
|||
continue;
|
||||
}
|
||||
|
||||
LINK_REGEX.lastIndex = 0;
|
||||
//LINK_REGEX.lastIndex = 0;
|
||||
NEW_LINK_REGEX.lastIndex = 0;
|
||||
const text = token.text;
|
||||
let idx = 0, match;
|
||||
|
||||
if ( use_new ) {
|
||||
while((match = NEW_LINK_REGEX.exec(text))) {
|
||||
const nix = match.index;
|
||||
if ( idx !== nix )
|
||||
out.push({type: 'text', text: text.slice(idx, nix)});
|
||||
//if ( use_new ) {
|
||||
while((match = NEW_LINK_REGEX.exec(text))) {
|
||||
const nix = match.index;
|
||||
if ( idx !== nix )
|
||||
out.push({type: 'text', text: text.slice(idx, nix)});
|
||||
|
||||
out.push({
|
||||
type: 'link',
|
||||
url: `${match[1] ? '' : 'https://'}${match[0]}`,
|
||||
is_mail: false,
|
||||
text: match[0]
|
||||
});
|
||||
out.push({
|
||||
type: 'link',
|
||||
url: `${match[1] ? '' : 'https://'}${match[0]}`,
|
||||
is_mail: false,
|
||||
text: match[0]
|
||||
});
|
||||
|
||||
idx = nix + match[0].length;
|
||||
}
|
||||
idx = nix + match[0].length;
|
||||
}
|
||||
|
||||
} else {
|
||||
/*} else {
|
||||
while((match = LINK_REGEX.exec(text))) {
|
||||
const nix = match.index + (match[1] ? match[1].length : 0);
|
||||
if ( idx !== nix )
|
||||
|
@ -195,7 +195,7 @@ export const Links = {
|
|||
|
||||
idx = nix + match[2].length;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
if ( idx < text.length )
|
||||
out.push({type: 'text', text: text.slice(idx)});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue