mirror of
https://github.com/FrankerFaceZ/FrankerFaceZ.git
synced 2025-07-24 19:48:30 +00:00
4.2.5
* Fixed: Words being highlighted as mentions incorrectly when they start with the user's name. * API Changed: New `<react-link>` and `<aspect>` global Vue components.
This commit is contained in:
parent
8582626269
commit
4e0539103a
5 changed files with 38 additions and 3 deletions
|
@ -151,7 +151,7 @@ ${typeof x[1] === 'string' ? x[1] : JSON.stringify(x[1], null, 4)}`
|
||||||
FrankerFaceZ.Logger = Logger;
|
FrankerFaceZ.Logger = Logger;
|
||||||
|
|
||||||
const VER = FrankerFaceZ.version_info = {
|
const VER = FrankerFaceZ.version_info = {
|
||||||
major: 4, minor: 2, revision: 4,
|
major: 4, minor: 2, revision: 5,
|
||||||
commit: __git_commit__,
|
commit: __git_commit__,
|
||||||
build: __webpack_hash__,
|
build: __webpack_hash__,
|
||||||
toString: () =>
|
toString: () =>
|
||||||
|
|
|
@ -13,7 +13,7 @@ import {TWITCH_EMOTE_BASE, REPLACEMENT_BASE, REPLACEMENTS} from 'utilities/const
|
||||||
const EMOTE_CLASS = 'chat-image chat-line__message--emote',
|
const EMOTE_CLASS = 'chat-image chat-line__message--emote',
|
||||||
LINK_REGEX = /([^\w@#%\-+=:~])?((?:(https?:\/\/)?(?:[\w@#%\-+=:~]+\.)+[a-z]{2,6}(?:\/[\w./@#%&()\-+=:?~]*)?))([^\w./@#%&()\-+=:?~]|\s|$)/g,
|
LINK_REGEX = /([^\w@#%\-+=:~])?((?:(https?:\/\/)?(?:[\w@#%\-+=:~]+\.)+[a-z]{2,6}(?:\/[\w./@#%&()\-+=:?~]*)?))([^\w./@#%&()\-+=:?~]|\s|$)/g,
|
||||||
//MENTION_REGEX = /([^\w@#%\-+=:~])?(@([^\u0000-\u007F]+|\w+)+)([^\w./@#%&()\-+=:?~]|\s|$)/g; // eslint-disable-line no-control-regex
|
//MENTION_REGEX = /([^\w@#%\-+=:~])?(@([^\u0000-\u007F]+|\w+)+)([^\w./@#%&()\-+=:?~]|\s|$)/g; // eslint-disable-line no-control-regex
|
||||||
MENTION_REGEX = /^(['"*([{<\\/]*)(@)((?:[^\u0000-\u007F]|[\w-])+)/; // eslint-disable-line no-control-regex
|
MENTION_REGEX = /^(['"*([{<\\/]*)(@)((?:[^\u0000-\u007F]|[\w-])+)(?:\b|$)/; // eslint-disable-line no-control-regex
|
||||||
|
|
||||||
|
|
||||||
// ============================================================================
|
// ============================================================================
|
||||||
|
@ -232,7 +232,7 @@ export const Mentions = {
|
||||||
display = null;
|
display = null;
|
||||||
|
|
||||||
mentionable = true;
|
mentionable = true;
|
||||||
regex = new RegExp(`^(['"*([{<\\/]*)(?:(@?)(${user.login.toLowerCase()}${display ? `|${display}` : ''})|@((?:[^\u0000-\u007F]|[\\w-])+))`, 'i');
|
regex = new RegExp(`^(['"*([{<\\/]*)(?:(@?)(${user.login.toLowerCase()}${display ? `|${display}` : ''})|@((?:[^\u0000-\u007F]|[\\w-])+))(?:\\b|$)`, 'i');
|
||||||
} else
|
} else
|
||||||
regex = MENTION_REGEX;
|
regex = MENTION_REGEX;
|
||||||
|
|
||||||
|
|
12
src/std-components/aspect.vue
Normal file
12
src/std-components/aspect.vue
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
<template functional>
|
||||||
|
<div
|
||||||
|
:class="`tw-aspect--align-${props.align||'top'}`"
|
||||||
|
class="tw-aspect"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
:style="{paddingBottom: (100 * (1 / (props.ratio || 1))) + '%'}"
|
||||||
|
class="tw-aspect__spacer"
|
||||||
|
/>
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
</template>
|
13
src/std-components/react-link.vue
Normal file
13
src/std-components/react-link.vue
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
<template>
|
||||||
|
<a :href="href" @click="reactNavigate(href, $event)">
|
||||||
|
<slot />
|
||||||
|
</a>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: ['href']
|
||||||
|
}
|
||||||
|
|
||||||
|
</script>
|
|
@ -99,6 +99,16 @@ export class Vue extends Module {
|
||||||
|
|
||||||
vue.mixin({
|
vue.mixin({
|
||||||
methods: {
|
methods: {
|
||||||
|
reactNavigate(url, event) {
|
||||||
|
const router = t.resolve('site.router');
|
||||||
|
if ( router && router.history ) {
|
||||||
|
if ( event ) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
}
|
||||||
|
router.history.push(url);
|
||||||
|
}
|
||||||
|
},
|
||||||
t(key, phrase, options) {
|
t(key, phrase, options) {
|
||||||
return this.$i18n.t_(key, phrase, options);
|
return this.$i18n.t_(key, phrase, options);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue