From 90ec9c4d443c8d032364de0c5d09cdaa8ce75bdf Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Fri, 8 Jul 2016 00:06:26 +0300 Subject: [PATCH] Fixed non-latin chars autocomplete Closes #1184 --- app/js/message_composer.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/js/message_composer.js b/app/js/message_composer.js index 722f5a21..b6309808 100644 --- a/app/js/message_composer.js +++ b/app/js/message_composer.js @@ -716,7 +716,7 @@ function MessageComposer (textarea, options) { this.commands = options.commands } -MessageComposer.autoCompleteRegEx = /(\s|^)(:|@|\/)([A-Za-z0-9\-\+\*@_]*)$/ +MessageComposer.autoCompleteRegEx = /(\s|^)(:|@|\/)([\S]*)$/ MessageComposer.prototype.setUpInput = function () { this.inlinePlaceholderWrap = $('
').prependTo(this.textareaEl[0].parentNode) @@ -1193,7 +1193,7 @@ MessageComposer.prototype.onEmojiSelected = function (code, autocomplete) { var pos = valueCaret[1] >= 0 ? valueCaret[1] : fullValue.length var suffix = fullValue.substr(pos) var prefix = fullValue.substr(0, pos) - var matches = prefix.match(/:([A-Za-z0-9\-\+\*_]*)$/) + var matches = prefix.match(/:([\S]*)$/) var emoji = EmojiHelper.emojis[code] var newValuePrefix @@ -1247,7 +1247,7 @@ MessageComposer.prototype.onEmojiSelected = function (code, autocomplete) { var pos = this.isActive ? getFieldSelection(textarea) : fullValue.length var suffix = fullValue.substr(pos) var prefix = fullValue.substr(0, pos) - var matches = autocomplete && prefix.match(/:([A-Za-z0-9\-\+\*_]*)$/) + var matches = autocomplete && prefix.match(/:([\S]*)$/) var emoji = EmojiHelper.emojis[code] if (matches && matches[0]) { @@ -1292,7 +1292,7 @@ MessageComposer.prototype.onMentionSelected = function (username, firstName) { var pos = valueCaret[1] >= 0 ? valueCaret[1] : fullValue.length var suffix = fullValue.substr(pos) var prefix = fullValue.substr(0, pos) - var matches = prefix.match(/@([A-Za-z0-9\-\+\*_]*)$/) + var matches = prefix.match(/@([\S]*)$/) var newValuePrefix if (matches && matches[0]) { @@ -1325,7 +1325,7 @@ MessageComposer.prototype.onMentionSelected = function (username, firstName) { var pos = this.isActive ? getFieldSelection(textarea) : fullValue.length var suffix = fullValue.substr(pos) var prefix = fullValue.substr(0, pos) - var matches = prefix.match(/@([A-Za-z0-9\-\+\*_]*)$/) + var matches = prefix.match(/@([\S]*)$/) var newValuePrefix var newValue