mirror of
https://github.com/wekan/wekan.git
synced 2025-12-16 23:40:13 +01:00
Upgrade ESLint to v2
This commit also tweak the code style following backward-incompatible v2 rules.
This commit is contained in:
parent
b8aefedcc3
commit
90601eacae
14 changed files with 161 additions and 164 deletions
|
|
@ -61,18 +61,20 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
|
|||
const mentionRegex = /\B@(\w*)/gi;
|
||||
let content = Blaze.toHTML(view.templateContentBlock);
|
||||
|
||||
let currentMention, knowedUser, linkClass, linkValue, link;
|
||||
while (Boolean(currentMention = mentionRegex.exec(content))) {
|
||||
|
||||
knowedUser = _.findWhere(knowedUsers, { username: currentMention[1] });
|
||||
if (!knowedUser)
|
||||
let currentMention;
|
||||
while ((currentMention = mentionRegex.exec(content)) !== null) {
|
||||
const [fullMention, username] = currentMention;
|
||||
const knowedUser = _.findWhere(knowedUsers, { username });
|
||||
if (!knowedUser) {
|
||||
continue;
|
||||
}
|
||||
|
||||
linkValue = [' ', at, knowedUser.username];
|
||||
linkClass = 'atMention js-open-member';
|
||||
if (knowedUser.userId === Meteor.userId())
|
||||
const linkValue = [' ', at, knowedUser.username];
|
||||
let linkClass = 'atMention js-open-member';
|
||||
if (knowedUser.userId === Meteor.userId()) {
|
||||
linkClass += ' me';
|
||||
link = HTML.A({
|
||||
}
|
||||
const link = HTML.A({
|
||||
'class': linkClass,
|
||||
// XXX Hack. Since we stringify this render function result below with
|
||||
// `Blaze.toHTML` we can't rely on blaze data contexts to pass the
|
||||
|
|
@ -81,7 +83,7 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() {
|
|||
'data-userId': knowedUser.userId,
|
||||
}, linkValue);
|
||||
|
||||
content = content.replace(currentMention[0], Blaze.toHTML(link));
|
||||
content = content.replace(fullMention, Blaze.toHTML(link));
|
||||
}
|
||||
|
||||
return HTML.Raw(content);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue