diff options
author | Lauri Ojansivu <x@xet7.org> | 2017-08-26 03:24:55 +0300 |
---|---|---|
committer | Lauri Ojansivu <x@xet7.org> | 2017-08-26 03:24:55 +0300 |
commit | 27340ec8f7e9407973fc1b3046997dd4612de0d2 (patch) | |
tree | 4a1cbe34e85e370addb35b6010979e82b31c7afa | |
parent | 84d40bd3e397165b879e15035823dcb92ad1e5ee (diff) | |
parent | fe5ea60847ef26d470ffd346e666cb0f49b000c9 (diff) | |
download | wekan-27340ec8f7e9407973fc1b3046997dd4612de0d2.tar.gz wekan-27340ec8f7e9407973fc1b3046997dd4612de0d2.tar.bz2 wekan-27340ec8f7e9407973fc1b3046997dd4612de0d2.zip |
Merge branch 'username-matching' of https://github.com/jonasob/wekan into jonasob-username-matching
-rw-r--r-- | client/components/lists/listBody.js | 2 | ||||
-rwxr-xr-x | client/components/main/editor.js | 4 | ||||
-rw-r--r-- | sandstorm.js | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/client/components/lists/listBody.js b/client/components/lists/listBody.js index bdc812c7..724e805b 100644 --- a/client/components/lists/listBody.js +++ b/client/components/lists/listBody.js @@ -180,7 +180,7 @@ BlazeComponent.extendComponent({ $textarea.escapeableTextComplete([ // User mentions { - match: /\B@(\w*)$/, + match: /\B@([\w.]*)$/, search(term, callback) { const currentBoard = Boards.findOne(Session.get('currentBoard')); callback($.map(currentBoard.activeMembers(), (member) => { diff --git a/client/components/main/editor.js b/client/components/main/editor.js index da15407a..5987b772 100755 --- a/client/components/main/editor.js +++ b/client/components/main/editor.js @@ -25,7 +25,7 @@ Template.editor.onRendered(() => { // User mentions { - match: /\B@(\w*)$/, + match: /\B@([\w.]*)$/, search(term, callback) { const currentBoard = Boards.findOne(Session.get('currentBoard')); callback(currentBoard.activeMembers().map((member) => { @@ -60,7 +60,7 @@ Blaze.Template.registerHelper('mentions', new Template('mentions', function() { member.username = Users.findOne(member.userId).username; return member; }); - const mentionRegex = /\B@(\w*)/gi; + const mentionRegex = /\B@([\w.]*)/gi; let content = Blaze.toHTML(view.templateContentBlock); let currentMention; diff --git a/sandstorm.js b/sandstorm.js index 80910dc3..6b7c8172 100644 --- a/sandstorm.js +++ b/sandstorm.js @@ -188,7 +188,7 @@ if (isSandstorm && Meteor.isServer) { caption = { defaultText: comment.text }; const activeMembers = _.pluck(Boards.findOne(sandstormBoard._id).activeMembers(), 'userId'); - (comment.text.match(/\B@(\w*)/g) || []).forEach((username) => { + (comment.text.match(/\B@([\w.]*)/g) || []).forEach((username) => { const user = Meteor.users.findOne({ username: username.slice(1)}); if (user && activeMembers.indexOf(user._id) !== -1) { mentionedUser(user._id); |