From 2d3ef0b0510e4c0be49cb6025e312fcb932789fd Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Mon, 29 Jun 2015 15:20:49 -0400 Subject: @all and @channel now auto-complete --- web/react/utils/constants.jsx | 1 + 1 file changed, 1 insertion(+) (limited to 'web/react/utils') diff --git a/web/react/utils/constants.jsx b/web/react/utils/constants.jsx index e5f42c8a0..f3f3399d9 100644 --- a/web/react/utils/constants.jsx +++ b/web/react/utils/constants.jsx @@ -36,6 +36,7 @@ module.exports = { SERVER_ACTION: null, VIEW_ACTION: null }), + SPECIAL_MENTIONS: ['all', 'channel'], CHARACTER_LIMIT: 4000, IMAGE_TYPES: ['jpg', 'gif', 'bmp', 'png'], AUDIO_TYPES: ['mp3', 'wav', 'wma', 'm4a', 'flac', 'aac'], -- cgit v1.2.3-1-g7c22 From f030476ff5f438b96d7282c37ad7a42ffc61ae85 Mon Sep 17 00:00:00 2001 From: JoramWilander Date: Tue, 30 Jun 2015 09:06:10 -0400 Subject: @all and @channel now highlight like other mentions --- web/react/utils/utils.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'web/react/utils') diff --git a/web/react/utils/utils.jsx b/web/react/utils/utils.jsx index 75c583c8f..d50a044bc 100644 --- a/web/react/utils/utils.jsx +++ b/web/react/utils/utils.jsx @@ -421,10 +421,13 @@ module.exports.textToJsx = function(text, options) { highlightSearchClass = " search-highlight"; } - if (explicitMention && UserStore.getProfileByUsername(explicitMention[1])) { + if (explicitMention && + (UserStore.getProfileByUsername(explicitMention[1]) || + Constants.SPECIAL_MENTIONS.indexOf(explicitMention[1]) !== -1)) + { var name = explicitMention[1]; // do both a non-case sensitive and case senstive check - var mClass = (name.toLowerCase() in implicitKeywords || name in implicitKeywords) ? mentionClass : ""; + var mClass = (('@'+name.toLowerCase()) in implicitKeywords || ('@'+name) in implicitKeywords) ? mentionClass : ""; var suffix = word.match(puncEndRegex); var prefix = word.match(puncStartRegex); -- cgit v1.2.3-1-g7c22