@@ -18,7 +20,7 @@
{{ > social withParagraph }}
-
+
diff --git a/client/views/app/message-popup-config.coffee b/client/views/app/message-popup-config.coffee
new file mode 100644
index 000000000000..0c6776987f2e
--- /dev/null
+++ b/client/views/app/message-popup-config.coffee
@@ -0,0 +1,61 @@
+Template.messagePopupConfig.helpers
+ popupUserConfig: ->
+ self = this
+ template = Template.instance()
+ config =
+ title: 'People'
+ collection: Meteor.users
+ template: 'messagePopupUser'
+ getInput: self.getInput
+ getFilter: (collection, filter) ->
+ exp = new RegExp(filter, 'i')
+ return collection.find({username: {$exists: true}, $or: [{name: exp}, {username: exp}]}, {limit: 10})
+ getValue: (_id, collection) ->
+ return collection.findOne(_id)?.username
+
+ return config
+
+ popupChannelConfig: ->
+ self = this
+ template = Template.instance()
+ config =
+ title: 'Channels'
+ collection: ChatRoom
+ trigger: '#'
+ template: 'messagePopupChannel'
+ getInput: self.getInput
+ getFilter: (collection, filter) ->
+ return collection.find({t: 'c', name: new RegExp(filter, 'i')}, {limit: 10})
+ getValue: (_id, collection) ->
+ return collection.findOne(_id)?.name
+
+ return config
+
+ popupEmojiConfig: ->
+ self = this
+ template = Template.instance()
+ config =
+ title: 'Emoji'
+ collection: emojione.emojioneList
+ template: 'messagePopupEmoji'
+ trigger: ':'
+ prefix: ''
+ getInput: self.getInput
+ getFilter: (collection, filter) ->
+ results = []
+ for shortname, data of collection
+ if shortname.indexOf(filter) > -1
+ results.push
+ _id: shortname
+ data: data
+
+ if results.length > 10
+ break
+
+ if filter.length >= 3
+ results.sort (a, b) ->
+ a.length > b.length
+
+ return results
+
+ return config
\ No newline at end of file
diff --git a/client/views/app/message-popup-config.html b/client/views/app/message-popup-config.html
new file mode 100644
index 000000000000..e93df1fdee0c
--- /dev/null
+++ b/client/views/app/message-popup-config.html
@@ -0,0 +1,5 @@
+
+ {{> messagePopup popupEmojiConfig}}
+ {{> messagePopup popupChannelConfig}}
+ {{> messagePopup popupUserConfig}}
+
\ No newline at end of file
diff --git a/client/views/app/message-popup.coffee b/client/views/app/message-popup.coffee
index 78e47b0be77b..3a919cb4bd2e 100644
--- a/client/views/app/message-popup.coffee
+++ b/client/views/app/message-popup.coffee
@@ -77,7 +77,7 @@ Template.messagePopup.onCreated ->
event.preventDefault()
event.stopPropagation()
- if event.which is 13
+ if event.which in [13, 9]
template.open.set false
template.enterValue()
diff --git a/client/views/app/message-popup.html b/client/views/app/message-popup.html
index 016098e6dee5..8307aa603b9c 100644
--- a/client/views/app/message-popup.html
+++ b/client/views/app/message-popup.html
@@ -1,15 +1,17 @@
{{#if isOpen}}
-