Commit 84c2242c authored by JC Brand's avatar JC Brand

Enable typeahead on the input and style the suggestions dropdown. updates #215

parent f1555774
...@@ -1999,6 +1999,19 @@ ...@@ -1999,6 +1999,19 @@
} }
}, },
initTypeAheadInviteWidget: function () {
this.$('input.invited-contact').typeahead({
minLength: 1,
highlight: true
}, {
name: 'contacts-dataset',
source: function (query, cb) {
cb([{ val: 'dog' }, { val: 'pig' }, { val: 'moose' }]);
}
});
return this;
},
renderChatArea: function () { renderChatArea: function () {
if (!this.$el.find('.chat-area').length) { if (!this.$el.find('.chat-area').length) {
this.$el.find('.chat-body').empty().append( this.$el.find('.chat-body').empty().append(
...@@ -2007,7 +2020,7 @@ ...@@ -2007,7 +2020,7 @@
'label_message': __('Message') 'label_message': __('Message')
}) })
); );
this.renderToolbar(); this.initTypeAheadInviteWidget().renderToolbar();
} }
return this; return this;
}, },
......
...@@ -567,10 +567,25 @@ span.spinner.hor_centered { ...@@ -567,10 +567,25 @@ span.spinner.hor_centered {
background-color: white; background-color: white;
overflow: auto; overflow: auto;
border-left: 1px solid #AAA; border-left: 1px solid #AAA;
width: 100px;
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
width: 100px;
height: 100%; height: 100%;
} }
#conversejs .tt-highlight {
background-color: #00230F;
}
#conversejs div.tt-suggestion p {
color: white;
text-shadow: rgba(0, 0, 0, 0.51) 0 -1px 0;
cursor: pointer;
}
#conversejs .tt-dropdown-menu {
margin: 0 1px 0 1px;
min-width: 96px;
background: #27774A;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
#conversejs .chatroom div.participants label { #conversejs .chatroom div.participants label {
font-style: italic; font-style: italic;
} }
...@@ -578,10 +593,10 @@ span.spinner.hor_centered { ...@@ -578,10 +593,10 @@ span.spinner.hor_centered {
margin-left: 2px; margin-left: 2px;
font-size: 12px; font-size: 12px;
} }
#conversejs .chatroom #invited-contact { #conversejs .chatroom .invited-contact {
margin: 1px; margin: 2px 1px 0 1px;
margin-top: 2px;
width: 96px; width: 96px;
border: 1px solid #999;
} }
#conversejs .participants ul.participant-list li { #conversejs .participants ul.participant-list li {
overflow: hidden; overflow: hidden;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* Converse.js (Web-based XMPP instant messaging client) * Converse.js (Web-based XMPP instant messaging client)
* http://conversejs.org * http://conversejs.org
* *
* Copyright (c) 2012-2014, Jan-Carel Brand <jc@opkode.com> * Copyright (c) 2012-2014, JC Brand <jc@opkode.com>
* Licensed under the Mozilla Public License * Licensed under the Mozilla Public License
*/ */
...@@ -609,11 +609,29 @@ span.spinner.hor_centered { ...@@ -609,11 +609,29 @@ span.spinner.hor_centered {
background-color: white; background-color: white;
overflow: auto; overflow: auto;
border-left: 1px solid #AAA; border-left: 1px solid #AAA;
width: 100px;
border-bottom-right-radius: 4px; border-bottom-right-radius: 4px;
width: 100px;
height: 100%; height: 100%;
} }
#conversejs .tt-highlight {
background-color: #00230F;
}
#conversejs div.tt-suggestion p {
color: white;
text-shadow: rgba(0,0,0,0.51) 0 -1px 0;
cursor: pointer;
}
#conversejs .tt-dropdown-menu {
margin: 0 1px 0 1px;
min-width: 96px;
background: #27774A;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
#conversejs .chatroom div.participants label { #conversejs .chatroom div.participants label {
font-style: italic; font-style: italic;
} }
...@@ -623,10 +641,10 @@ span.spinner.hor_centered { ...@@ -623,10 +641,10 @@ span.spinner.hor_centered {
font-size: 12px; font-size: 12px;
} }
#conversejs .chatroom #invited-contact { #conversejs .chatroom .invited-contact {
margin: 1px; margin: 2px 1px 0 1px;
margin-top: 2px;
width: 96px; width: 96px;
border: 1px solid #999;
} }
#conversejs .participants ul.participant-list li { #conversejs .participants ul.participant-list li {
......
...@@ -402,7 +402,7 @@ ...@@ -402,7 +402,7 @@
</div> </div>
<div class="participants"> <div class="participants">
<form class="room-invite"> <form class="room-invite">
<input id="invited-contact" placeholder="Invite someone" type="text"/> <input class="invited-contact" placeholder="Invite someone" type="text"/>
</form> </form>
<label>Participants:</label> <label>Participants:</label>
<ul class="participant-list"> <ul class="participant-list">
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
</div> </div>
<div class="participants"> <div class="participants">
<form class="room-invite"> <form class="room-invite">
<input id="invited-contact" placeholder="Invite someone" type="text"/> <input class="invited-contact" placeholder="Invite someone" type="text"/>
</form> </form>
<label>Participants:</label>
<ul class="participant-list"></ul> <ul class="participant-list"></ul>
</div> </div>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment