1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
= javascript_include_tag :jquery
= javascript_include_tag :mobile
:javascript
$(document).ready(function () {
var data = $.parseJSON( "#{escape_javascript(@contacts_json)}" ),
autocompleteInput = $("#contact_autocomplete");
autocompleteInput.autoSuggest(data, {
selectedItemProp: "name",
searchObjProps: "name",
asHtmlID: "contact_ids",
retrieveLimit: 10,
minChars: 1,
keyDelay: 0,
startText: '',
emptyText: "#{t('no_results')}",
preFill: [{name : "#{h params[:name]}",
value : "#{@contact_ids}"}]
});
autocompleteInput.focus();
});
.span6#new_conversation_pane
.span5#facebox_header
%h3
= t('conversations.index.new_conversation')
= form_for Conversation.new, html: {class: "new_conversation form_do_not_clear"}, remote: true do |conversation|
.span1
%h4
= t('.to')
.span4
= text_field_tag "contact_autocomplete"
.clearfix
%br
.span1
%h4
= t('.subject')
.span4
= conversation.text_field :subject
%br
.span4.offset1
= text_area_tag "conversation[text]", '', :rows => 5
.clearfix
.bottom_submit_section
= conversation.submit t('.send'), 'data-disable-with' => t('.sending'), :class => 'button creation'
|