-
Notifications
You must be signed in to change notification settings - Fork 10.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update mention links and their ticks
- Loading branch information
Showing
13 changed files
with
265 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,13 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
import { callbacks } from '../../callbacks'; | ||
import { settings } from '../../settings'; | ||
import Mentions from '../lib/Mentions'; | ||
import { MentionsParser } from '../lib/MentionsParser'; | ||
|
||
const MentionsClient = new Mentions({ | ||
pattern() { | ||
return settings.get('UTF8_Names_Validation'); | ||
}, | ||
useRealName() { | ||
return settings.get('UI_Use_Real_Name'); | ||
}, | ||
me() { | ||
const me = Meteor.user(); | ||
return me && me.username; | ||
}, | ||
const instance = new MentionsParser({ | ||
pattern: () => settings.get('UTF8_Names_Validation'), | ||
useRealName: () => settings.get('UI_Use_Real_Name'), | ||
me: () => Meteor.userId() && Meteor.user().username, | ||
}); | ||
|
||
callbacks.add('renderMessage', (message) => MentionsClient.parse(message), callbacks.priority.MEDIUM, 'mentions-message'); | ||
callbacks.add('renderMentions', (message) => MentionsClient.parse(message), callbacks.priority.MEDIUM, 'mentions-mentions'); | ||
callbacks.add('renderMessage', (message) => instance.parse(message), callbacks.priority.MEDIUM, 'mentions-message'); | ||
callbacks.add('renderMentions', (message) => instance.parse(message), callbacks.priority.MEDIUM, 'mentions-mentions'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
import './client'; | ||
import './mentionLink.css'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
.mention-link { | ||
padding: 0 6px 2px; | ||
|
||
transition: border-radius 0.3s; | ||
|
||
color: var(--mention-link-text-color) !important; | ||
|
||
border-radius: var(--mention-link-radius); | ||
|
||
background-color: var(--mention-link-background) !important; | ||
|
||
font-weight: 700; | ||
|
||
&:hover { | ||
border-radius: var(--border-radius); | ||
} | ||
|
||
&--me { | ||
color: var(--mention-link-me-text-color) !important; | ||
background-color: var(--mention-link-me-background) !important; | ||
} | ||
|
||
&--group { | ||
color: var(--mention-link-group-text-color) !important; | ||
background-color: var(--mention-link-group-background) !important; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.