carrier 0.0.6 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -1
- data/TODO +1 -0
- data/VERSION +1 -1
- data/app/assets/images/carrier/chosen-sprite.png +0 -0
- data/app/assets/javascripts/carrier/chosen.jquery.min.js +10 -0
- data/app/assets/javascripts/carrier/chosen.js +5 -0
- data/app/assets/stylesheets/{carrier.css → carrier/carrier.css} +43 -5
- data/app/assets/stylesheets/carrier/chosen.css +367 -0
- data/app/controllers/carrier/chains_controller.rb +7 -5
- data/app/controllers/carrier/messages_controller.rb +4 -6
- data/app/helpers/carrier/application_helper.rb +5 -8
- data/app/models/carrier/chain.rb +2 -2
- data/app/models/carrier/message.rb +23 -19
- data/app/models/carrier/message/validations.rb +1 -1
- data/app/validators/recipients/exclude_self.rb +1 -1
- data/app/validators/recipients/recipients_presence_validator.rb +8 -0
- data/app/validators/recipients/right_recipients_validator.rb +10 -0
- data/app/views/carrier/messages/_chosen.html.erb +7 -0
- data/app/views/carrier/messages/_form.html.erb +30 -24
- data/app/views/carrier/messages/_head.html.erb +1 -6
- data/app/views/carrier/messages/_index_message.html.erb +2 -2
- data/app/views/carrier/messages/{_message_expanded.html.erb → _message.html.erb} +0 -0
- data/app/views/carrier/messages/_message_collapsed.html.erb +1 -1
- data/app/views/carrier/messages/_nav_messages.html.erb +5 -5
- data/app/views/carrier/messages/_recipients.html.erb +1 -0
- data/app/views/carrier/messages/_reply.html.erb +17 -14
- data/app/views/carrier/messages/as_sent.html.erb +4 -0
- data/app/views/carrier/messages/create.js.erb +1 -1
- data/app/views/carrier/messages/index.html.erb +12 -1
- data/app/views/carrier/messages/new.html.erb +6 -0
- data/app/views/carrier/messages/reply.js.erb +1 -1
- data/app/views/carrier/messages/show.html.erb +34 -32
- data/app/views/layouts/carrier/application.html.erb +2 -2
- data/app/views/partials/_error_messages_for.html.erb +2 -2
- data/carrier.gemspec +21 -115
- data/config/locales/carrier.en.yml +11 -5
- data/config/locales/carrier.ru.yml +12 -1
- data/config/routes.rb +6 -2
- data/lib/carrier.rb +0 -1
- data/lib/carrier/configuration.rb +6 -8
- data/lib/carrier/configuration/routes.rb +19 -0
- data/lib/carrier/configuration/user.rb +24 -0
- data/lib/carrier/rails/engine.rb +15 -4
- data/lib/carrier/rails/helpers.rb +17 -3
- data/lib/carrier/version.rb +3 -0
- data/spec/dummy/config/initializers/carrier.rb +2 -0
- data/spec/integration/carrier_spec.rb +4 -2
- data/spec/requests/main_spec.rb +0 -1
- metadata +134 -223
- data/app/assets/javascripts/autocomplete.js +0 -4
- data/app/assets/javascripts/autocomplete/i18n/jquery-ui-i18n.js +0 -1379
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-af.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ar-DZ.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ar.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-az.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-bg.js +0 -24
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-bs.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ca.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-cs.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-da.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-de.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-el.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-en-AU.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-en-GB.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-en-NZ.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-eo.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-es.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-et.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-eu.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fa.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fi.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fo.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fr-CH.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-fr.js +0 -25
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-gl.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-he.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-hr.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-hu.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-hy.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-id.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-is.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-it.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ja.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ko.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-kz.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-lt.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-lv.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ml.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ms.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-nl.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-no.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-pl.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-pt-BR.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-pt.js +0 -22
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-rm.js +0 -21
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ro.js +0 -26
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ru.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sk.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sl.js +0 -24
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sq.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sr-SR.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sr.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-sv.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-ta.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-th.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-tj.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-tr.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-uk.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-vi.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-zh-CN.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-zh-HK.js +0 -23
- data/app/assets/javascripts/autocomplete/i18n/jquery.ui.datepicker-zh-TW.js +0 -23
- data/app/assets/javascripts/autocomplete/jquery.ui.autocomplete.min.js +0 -32
- data/app/assets/javascripts/autocomplete/jquery.ui.core.min.js +0 -17
- data/app/assets/javascripts/autocomplete/jquery.ui.position.min.js +0 -16
- data/app/assets/javascripts/autocomplete/jquery.ui.widget.min.js +0 -15
- data/app/assets/javascripts/carrier.js +0 -8
- data/app/assets/javascripts/rich-multiselect/jquery-ui.min.js +0 -405
- data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-de.js +0 -11
- data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-en.js +0 -11
- data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-es.js +0 -11
- data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-fr.js +0 -11
- data/app/assets/javascripts/rich-multiselect/locale/ui-multiselect-it.js +0 -13
- data/app/assets/javascripts/rich-multiselect/plugins/localisation/jquery.localisation-min.js +0 -7
- data/app/assets/javascripts/rich-multiselect/plugins/localisation/jquery.localisation-pack.js +0 -7
- data/app/assets/javascripts/rich-multiselect/plugins/localisation/jquery.localisation.js +0 -99
- data/app/assets/javascripts/rich-multiselect/plugins/scrollTo/README.txt +0 -37
- data/app/assets/javascripts/rich-multiselect/plugins/scrollTo/changes.txt +0 -82
- data/app/assets/javascripts/rich-multiselect/plugins/scrollTo/jquery.scrollTo-min.js +0 -11
- data/app/assets/javascripts/rich-multiselect/plugins/scrollTo/jquery.scrollTo.js +0 -207
- data/app/assets/javascripts/rich-multiselect/ui.multiselect.js +0 -339
- data/app/assets/stylesheets/carrier_rich.css +0 -48
- data/app/assets/stylesheets/carrier_simple.css +0 -15
- data/app/assets/stylesheets/rich-multiselect/ui.multiselect.css +0 -30
- data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_55_fbf9ee_40x100.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_65_ffffff_40x100.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_75_cccccc_40x100.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_75_dadada_40x100.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_75_e6e6e6_40x100.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-bg_flat_95_fef1ec_40x100.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-icons_2e83ff_256x240.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-icons_454545_256x240.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-icons_888888_256x240.png +0 -0
- data/app/assets/stylesheets/ui-lightness/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/app/assets/stylesheets/ui-lightness/jquery-ui-1.8.14.custom.css +0 -342
- data/app/helpers/carrier/post_helper.rb +0 -4
- data/app/validators/recipients/recipients_validator.rb +0 -10
- data/app/views/carrier/messages/rich/_multiselect.html.erb +0 -18
- data/app/views/carrier/messages/rich/_recipients.html.erb +0 -6
- data/app/views/carrier/messages/simple/_autocomplete.html.erb +0 -45
- data/app/views/carrier/messages/simple/_autocomplete_includes.html.erb +0 -7
- data/app/views/carrier/messages/simple/_recipients.html.erb +0 -3
- data/lib/carrier/configuration/ui.rb +0 -28
@@ -1,339 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* jQuery UI Multiselect
|
3
|
-
*
|
4
|
-
* Authors:
|
5
|
-
* Michael Aufreiter (quasipartikel.at)
|
6
|
-
* Yanick Rochon (yanick.rochon[at]gmail[dot]com)
|
7
|
-
*
|
8
|
-
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
9
|
-
* and GPL (GPL-LICENSE.txt) licenses.
|
10
|
-
*
|
11
|
-
* http://www.quasipartikel.at/multiselect/
|
12
|
-
*
|
13
|
-
*
|
14
|
-
* Depends:
|
15
|
-
* ui.core.js
|
16
|
-
* ui.sortable.js
|
17
|
-
*
|
18
|
-
* Optional:
|
19
|
-
* localization (http://plugins.jquery.com/project/localisation)
|
20
|
-
* scrollTo (http://plugins.jquery.com/project/ScrollTo)
|
21
|
-
*
|
22
|
-
* Todo:
|
23
|
-
* Make batch actions faster
|
24
|
-
* Implement dynamic insertion through remote calls
|
25
|
-
*/
|
26
|
-
|
27
|
-
|
28
|
-
(function($) {
|
29
|
-
|
30
|
-
$.widget("ui.multiselect", {
|
31
|
-
options: {
|
32
|
-
sortable: true,
|
33
|
-
searchable: true,
|
34
|
-
doubleClickable: true,
|
35
|
-
animated: 'fast',
|
36
|
-
show: 'slideDown',
|
37
|
-
hide: 'slideUp',
|
38
|
-
dividerLocation: 0.6,
|
39
|
-
nodeComparator: function(node1,node2) {
|
40
|
-
var text1 = node1.text(),
|
41
|
-
text2 = node2.text();
|
42
|
-
return text1 == text2 ? 0 : (text1 < text2 ? -1 : 1);
|
43
|
-
}
|
44
|
-
},
|
45
|
-
_create: function() {
|
46
|
-
this.element.hide();
|
47
|
-
this.id = this.element.attr("id");
|
48
|
-
this.container = $('<div class="ui-multiselect ui-helper-clearfix ui-widget"></div>').insertAfter(this.element);
|
49
|
-
this.count = 0; // number of currently selected options
|
50
|
-
|
51
|
-
// @stanislaw : next two lines's order changed
|
52
|
-
this.availableContainer = $('<div class="available"></div>').appendTo(this.container);
|
53
|
-
this.selectedContainer = $('<div class="selected"></div>').appendTo(this.container);
|
54
|
-
|
55
|
-
this.selectedActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><span class="count">0 '+$.ui.multiselect.locale.itemsCount+'</span><a href="#" class="remove-all">'+$.ui.multiselect.locale.removeAll+'</a></div>').appendTo(this.selectedContainer);
|
56
|
-
this.availableActions = $('<div class="actions ui-widget-header ui-helper-clearfix"><input type="text" class="search empty ui-widget-content ui-corner-all"/><a href="#" class="add-all">'+$.ui.multiselect.locale.addAll+'</a></div>').appendTo(this.availableContainer);
|
57
|
-
this.selectedList = $('<ul class="selected connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.selectedContainer);
|
58
|
-
this.availableList = $('<ul class="available connected-list"><li class="ui-helper-hidden-accessible"></li></ul>').bind('selectstart', function(){return false;}).appendTo(this.availableContainer);
|
59
|
-
|
60
|
-
var that = this;
|
61
|
-
|
62
|
-
// set dimensions
|
63
|
-
this.container.width(this.element.width()+1);
|
64
|
-
this.selectedContainer.width(Math.floor(this.element.width()*this.options.dividerLocation));
|
65
|
-
this.availableContainer.width(Math.floor(this.element.width()*(1-this.options.dividerLocation)));
|
66
|
-
|
67
|
-
// fix list height to match <option> depending on their individual header's heights
|
68
|
-
this.selectedList.height(Math.max(this.element.height()-this.selectedActions.height(),1));
|
69
|
-
this.availableList.height(Math.max(this.element.height()-this.availableActions.height(),1));
|
70
|
-
|
71
|
-
if ( !this.options.animated ) {
|
72
|
-
this.options.show = 'show';
|
73
|
-
this.options.hide = 'hide';
|
74
|
-
}
|
75
|
-
|
76
|
-
// init lists
|
77
|
-
this._populateLists(this.element.find('option'));
|
78
|
-
|
79
|
-
// make selection sortable
|
80
|
-
if (this.options.sortable) {
|
81
|
-
this.selectedList.sortable({
|
82
|
-
placeholder: 'ui-state-highlight',
|
83
|
-
axis: 'y',
|
84
|
-
update: function(event, ui) {
|
85
|
-
// apply the new sort order to the original selectbox
|
86
|
-
that.selectedList.find('li').each(function() {
|
87
|
-
if ($(this).data('optionLink'))
|
88
|
-
$(this).data('optionLink').remove().appendTo(that.element);
|
89
|
-
});
|
90
|
-
},
|
91
|
-
receive: function(event, ui) {
|
92
|
-
ui.item.data('optionLink').attr('selected', true);
|
93
|
-
// increment count
|
94
|
-
that.count += 1;
|
95
|
-
that._updateCount();
|
96
|
-
// workaround, because there's no way to reference
|
97
|
-
// the new element, see http://dev.jqueryui.com/ticket/4303
|
98
|
-
that.selectedList.children('.ui-draggable').each(function() {
|
99
|
-
$(this).removeClass('ui-draggable');
|
100
|
-
$(this).data('optionLink', ui.item.data('optionLink'));
|
101
|
-
$(this).data('idx', ui.item.data('idx'));
|
102
|
-
that._applyItemState($(this), true);
|
103
|
-
});
|
104
|
-
|
105
|
-
// workaround according to http://dev.jqueryui.com/ticket/4088
|
106
|
-
setTimeout(function() { ui.item.remove(); }, 1);
|
107
|
-
}
|
108
|
-
});
|
109
|
-
}
|
110
|
-
|
111
|
-
// set up livesearch
|
112
|
-
if (this.options.searchable) {
|
113
|
-
this._registerSearchEvents(this.availableContainer.find('input.search'));
|
114
|
-
} else {
|
115
|
-
$('.search').hide();
|
116
|
-
}
|
117
|
-
|
118
|
-
// batch actions
|
119
|
-
this.container.find(".remove-all").click(function() {
|
120
|
-
that._populateLists(that.element.find('option').removeAttr('selected'));
|
121
|
-
return false;
|
122
|
-
});
|
123
|
-
|
124
|
-
this.container.find(".add-all").click(function() {
|
125
|
-
var options = that.element.find('option').not(":selected");
|
126
|
-
if (that.availableList.children('li:hidden').length > 1) {
|
127
|
-
that.availableList.children('li').each(function(i) {
|
128
|
-
if ($(this).is(":visible")) $(options[i-1]).attr('selected', 'selected');
|
129
|
-
});
|
130
|
-
} else {
|
131
|
-
options.attr('selected', 'selected');
|
132
|
-
}
|
133
|
-
that._populateLists(that.element.find('option'));
|
134
|
-
return false;
|
135
|
-
});
|
136
|
-
},
|
137
|
-
destroy: function() {
|
138
|
-
this.element.show();
|
139
|
-
this.container.remove();
|
140
|
-
|
141
|
-
$.Widget.prototype.destroy.apply(this, arguments);
|
142
|
-
},
|
143
|
-
_populateLists: function(options) {
|
144
|
-
this.selectedList.children('.ui-element').remove();
|
145
|
-
this.availableList.children('.ui-element').remove();
|
146
|
-
this.count = 0;
|
147
|
-
|
148
|
-
var that = this;
|
149
|
-
var items = $(options.map(function(i) {
|
150
|
-
var item = that._getOptionNode(this).appendTo(this.selected ? that.selectedList : that.availableList).show();
|
151
|
-
|
152
|
-
if (this.selected) that.count += 1;
|
153
|
-
that._applyItemState(item, this.selected);
|
154
|
-
item.data('idx', i);
|
155
|
-
return item[0];
|
156
|
-
}));
|
157
|
-
|
158
|
-
// update count
|
159
|
-
this._updateCount();
|
160
|
-
that._filter.apply(this.availableContainer.find('input.search'), [that.availableList]);
|
161
|
-
},
|
162
|
-
_updateCount: function() {
|
163
|
-
this.selectedContainer.find('span.count').text(this.count+" "+$.ui.multiselect.locale.itemsCount);
|
164
|
-
},
|
165
|
-
_getOptionNode: function(option) {
|
166
|
-
option = $(option);
|
167
|
-
var node = $('<li class="ui-state-default ui-element" title="'+option.text()+'"><span class="ui-icon"/>'+option.text()+'<a href="#" class="action"><span class="ui-corner-all ui-icon"/></a></li>').hide();
|
168
|
-
node.data('optionLink', option);
|
169
|
-
return node;
|
170
|
-
},
|
171
|
-
// clones an item with associated data
|
172
|
-
// didn't find a smarter away around this
|
173
|
-
_cloneWithData: function(clonee) {
|
174
|
-
var clone = clonee.clone(false,false);
|
175
|
-
clone.data('optionLink', clonee.data('optionLink'));
|
176
|
-
clone.data('idx', clonee.data('idx'));
|
177
|
-
return clone;
|
178
|
-
},
|
179
|
-
_setSelected: function(item, selected) {
|
180
|
-
item.data('optionLink').attr('selected', selected);
|
181
|
-
|
182
|
-
if (selected) {
|
183
|
-
var selectedItem = this._cloneWithData(item);
|
184
|
-
item[this.options.hide](this.options.animated, function() { $(this).remove(); });
|
185
|
-
selectedItem.appendTo(this.selectedList).hide()[this.options.show](this.options.animated);
|
186
|
-
|
187
|
-
this._applyItemState(selectedItem, true);
|
188
|
-
return selectedItem;
|
189
|
-
} else {
|
190
|
-
|
191
|
-
// look for successor based on initial option index
|
192
|
-
var items = this.availableList.find('li'), comparator = this.options.nodeComparator;
|
193
|
-
var succ = null, i = item.data('idx'), direction = comparator(item, $(items[i]));
|
194
|
-
|
195
|
-
// TODO: test needed for dynamic list populating
|
196
|
-
if ( direction ) {
|
197
|
-
while (i>=0 && i<items.length) {
|
198
|
-
direction > 0 ? i++ : i--;
|
199
|
-
if ( direction != comparator(item, $(items[i])) ) {
|
200
|
-
// going up, go back one item down, otherwise leave as is
|
201
|
-
succ = items[direction > 0 ? i : i+1];
|
202
|
-
break;
|
203
|
-
}
|
204
|
-
}
|
205
|
-
} else {
|
206
|
-
succ = items[i];
|
207
|
-
}
|
208
|
-
|
209
|
-
var availableItem = this._cloneWithData(item);
|
210
|
-
succ ? availableItem.insertBefore($(succ)) : availableItem.appendTo(this.availableList);
|
211
|
-
item[this.options.hide](this.options.animated, function() { $(this).remove(); });
|
212
|
-
availableItem.hide()[this.options.show](this.options.animated);
|
213
|
-
|
214
|
-
this._applyItemState(availableItem, false);
|
215
|
-
return availableItem;
|
216
|
-
}
|
217
|
-
},
|
218
|
-
_applyItemState: function(item, selected) {
|
219
|
-
if (selected) {
|
220
|
-
if (this.options.sortable)
|
221
|
-
item.children('span').addClass('ui-icon-arrowthick-2-n-s').removeClass('ui-helper-hidden').addClass('ui-icon');
|
222
|
-
else
|
223
|
-
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
|
224
|
-
item.find('a.action span').addClass('ui-icon-minus').removeClass('ui-icon-plus');
|
225
|
-
this._registerRemoveEvents(item.find('a.action'));
|
226
|
-
|
227
|
-
} else {
|
228
|
-
item.children('span').removeClass('ui-icon-arrowthick-2-n-s').addClass('ui-helper-hidden').removeClass('ui-icon');
|
229
|
-
item.find('a.action span').addClass('ui-icon-plus').removeClass('ui-icon-minus');
|
230
|
-
this._registerAddEvents(item.find('a.action'));
|
231
|
-
}
|
232
|
-
|
233
|
-
this._registerDoubleClickEvents(item);
|
234
|
-
this._registerHoverEvents(item);
|
235
|
-
},
|
236
|
-
// taken from John Resig's liveUpdate script
|
237
|
-
_filter: function(list) {
|
238
|
-
var input = $(this);
|
239
|
-
var rows = list.children('li'),
|
240
|
-
cache = rows.map(function(){
|
241
|
-
|
242
|
-
return $(this).text().toLowerCase();
|
243
|
-
});
|
244
|
-
|
245
|
-
var term = $.trim(input.val().toLowerCase()), scores = [];
|
246
|
-
|
247
|
-
if (!term) {
|
248
|
-
rows.show();
|
249
|
-
} else {
|
250
|
-
rows.hide();
|
251
|
-
|
252
|
-
cache.each(function(i) {
|
253
|
-
if (this.indexOf(term)>-1) { scores.push(i); }
|
254
|
-
});
|
255
|
-
|
256
|
-
$.each(scores, function() {
|
257
|
-
$(rows[this]).show();
|
258
|
-
});
|
259
|
-
}
|
260
|
-
},
|
261
|
-
_registerDoubleClickEvents: function(elements) {
|
262
|
-
if (!this.options.doubleClickable) return;
|
263
|
-
elements.dblclick(function() {
|
264
|
-
elements.find('a.action').click();
|
265
|
-
});
|
266
|
-
},
|
267
|
-
_registerHoverEvents: function(elements) {
|
268
|
-
elements.removeClass('ui-state-hover');
|
269
|
-
elements.mouseover(function() {
|
270
|
-
$(this).addClass('ui-state-hover');
|
271
|
-
});
|
272
|
-
elements.mouseout(function() {
|
273
|
-
$(this).removeClass('ui-state-hover');
|
274
|
-
});
|
275
|
-
},
|
276
|
-
_registerAddEvents: function(elements) {
|
277
|
-
var that = this;
|
278
|
-
elements.click(function() {
|
279
|
-
var item = that._setSelected($(this).parent(), true);
|
280
|
-
that.count += 1;
|
281
|
-
that._updateCount();
|
282
|
-
return false;
|
283
|
-
});
|
284
|
-
|
285
|
-
// make draggable
|
286
|
-
if (this.options.sortable) {
|
287
|
-
elements.each(function() {
|
288
|
-
$(this).parent().draggable({
|
289
|
-
connectToSortable: that.selectedList,
|
290
|
-
helper: function() {
|
291
|
-
var selectedItem = that._cloneWithData($(this)).width($(this).width() - 50);
|
292
|
-
selectedItem.width($(this).width());
|
293
|
-
return selectedItem;
|
294
|
-
},
|
295
|
-
appendTo: that.container,
|
296
|
-
containment: that.container,
|
297
|
-
revert: 'invalid'
|
298
|
-
});
|
299
|
-
});
|
300
|
-
}
|
301
|
-
},
|
302
|
-
_registerRemoveEvents: function(elements) {
|
303
|
-
var that = this;
|
304
|
-
elements.click(function() {
|
305
|
-
that._setSelected($(this).parent(), false);
|
306
|
-
that.count -= 1;
|
307
|
-
that._updateCount();
|
308
|
-
return false;
|
309
|
-
});
|
310
|
-
},
|
311
|
-
_registerSearchEvents: function(input) {
|
312
|
-
var that = this;
|
313
|
-
|
314
|
-
input.focus(function() {
|
315
|
-
$(this).addClass('ui-state-active');
|
316
|
-
})
|
317
|
-
.blur(function() {
|
318
|
-
$(this).removeClass('ui-state-active');
|
319
|
-
})
|
320
|
-
.keypress(function(e) {
|
321
|
-
if (e.keyCode == 13)
|
322
|
-
return false;
|
323
|
-
})
|
324
|
-
.keyup(function() {
|
325
|
-
that._filter.apply(this, [that.availableList]);
|
326
|
-
});
|
327
|
-
}
|
328
|
-
});
|
329
|
-
|
330
|
-
$.extend($.ui.multiselect, {
|
331
|
-
locale: {
|
332
|
-
addAll:'Add all',
|
333
|
-
removeAll:'Remove all',
|
334
|
-
itemsCount:'items selected'
|
335
|
-
}
|
336
|
-
});
|
337
|
-
|
338
|
-
|
339
|
-
})(jQuery);
|
@@ -1,48 +0,0 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
/* two columns in "new" section */
|
5
|
-
|
6
|
-
.message_ma_new_wrapper_1 {float:left; width:460px;}
|
7
|
-
.message_ma_new_wrapper_2 {margin-left:490px; height:300px;}
|
8
|
-
|
9
|
-
.message_ma_new_wrapper .message_ma_new_wrapper_2 input[type="text"],
|
10
|
-
.message_ma_new_wrapper .message_ma_new_wrapper_2 textarea {
|
11
|
-
border:1px solid #ccc;
|
12
|
-
border-radius: 6px;
|
13
|
-
-moz-border-radius: 6px;
|
14
|
-
-webkit-border-radius: 6px;
|
15
|
-
padding:6px;
|
16
|
-
}
|
17
|
-
|
18
|
-
|
19
|
-
/* multiselect */
|
20
|
-
|
21
|
-
.ui-multiselect {
|
22
|
-
border:none;
|
23
|
-
border-radius: 6px;
|
24
|
-
-moz-border-radius: 6px;
|
25
|
-
-webkit-border-radius: 6px;
|
26
|
-
}
|
27
|
-
|
28
|
-
.ui-multiselect .ui-widget-header {
|
29
|
-
border-radius: 6px 6px 0 0;
|
30
|
-
-moz-border-radius: 6px 6px 0 0;
|
31
|
-
-webkit-border-radius: 6px 6px 0 0;
|
32
|
-
}
|
33
|
-
.ui-multiselect ul {
|
34
|
-
border-radius: 0 0 6px 6px;
|
35
|
-
-moz-border-radius: 0 0 6px 6px;
|
36
|
-
-webkit-border-radius: 0 0 6px 6px;
|
37
|
-
|
38
|
-
}
|
39
|
-
|
40
|
-
.ui-multiselect div.selected {margin-left:2px;}
|
41
|
-
.ui-multiselect div.selected ul.selected {//border: 1px solid #ccc;}
|
42
|
-
|
43
|
-
|
44
|
-
.ui-multiselect div.available {border:none;}
|
45
|
-
.ui-multiselect ul.available {background-color:#ccc;}
|
46
|
-
|
47
|
-
.ui-multiselect .remove-all {padding: 2px 6px; margin:6px; }
|
48
|
-
.ui-multiselect .add-all {padding: 2px 6px; margin:6px; }
|
@@ -1,15 +0,0 @@
|
|
1
|
-
.message_ma_new_wrapper_1 {width:90%;}
|
2
|
-
.message_ma_new_wrapper_2 {width:90%;}
|
3
|
-
|
4
|
-
|
5
|
-
.message_ma_new_wrapper input[type="text"],
|
6
|
-
.message_ma_new_wrapper textarea {width:95%;}
|
7
|
-
|
8
|
-
.message_ma_new_wrapper input[type="text"],
|
9
|
-
.message_ma_new_wrapper textarea {
|
10
|
-
border:1px solid #ccc;
|
11
|
-
border-radius: 6px;
|
12
|
-
-moz-border-radius: 6px;
|
13
|
-
-webkit-border-radius: 6px;
|
14
|
-
padding:6px;
|
15
|
-
}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
/* Multiselect
|
2
|
-
----------------------------------*/
|
3
|
-
|
4
|
-
.ui-multiselect { border: solid 1px; font-size: 0.8em; }
|
5
|
-
.ui-multiselect ul { -moz-user-select: none; }
|
6
|
-
.ui-multiselect li { margin: 0; padding: 0; cursor: default; line-height: 20px; height: 20px; font-size: 11px; list-style: none; }
|
7
|
-
.ui-multiselect li a { color: #999; text-decoration: none; padding: 0; display: block; float: left; cursor: pointer;}
|
8
|
-
.ui-multiselect li.ui-draggable-dragging { padding-left: 10px; }
|
9
|
-
|
10
|
-
.ui-multiselect div.selected { position: relative; padding: 0; margin: 0; border: 0; float:left; }
|
11
|
-
.ui-multiselect ul.selected { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; position: relative; width: 100%; }
|
12
|
-
.ui-multiselect ul.selected li { }
|
13
|
-
|
14
|
-
.ui-multiselect div.available { position: relative; padding: 0; margin: 0; border: 0; float:left; border-left: 1px solid; }
|
15
|
-
.ui-multiselect ul.available { position: relative; padding: 0; overflow: auto; overflow-x: hidden; background: #fff; margin: 0; list-style: none; border: 0; width: 100%; }
|
16
|
-
.ui-multiselect ul.available li { padding-left: 10px; }
|
17
|
-
|
18
|
-
.ui-multiselect .ui-state-default { border: none; margin-bottom: 1px; position: relative; padding-left: 20px;}
|
19
|
-
.ui-multiselect .ui-state-hover { border: none; }
|
20
|
-
.ui-multiselect .ui-widget-header {border: none; font-size: 11px; margin-bottom: 1px;}
|
21
|
-
|
22
|
-
.ui-multiselect .add-all { float: right; padding: 7px;}
|
23
|
-
.ui-multiselect .remove-all { float: right; padding: 7px;}
|
24
|
-
.ui-multiselect .search { float: left; padding: 4px;}
|
25
|
-
.ui-multiselect .count { float: left; padding: 7px;}
|
26
|
-
|
27
|
-
.ui-multiselect li span.ui-icon-arrowthick-2-n-s { position: absolute; left: 2px; }
|
28
|
-
.ui-multiselect li a.action { position: absolute; right: 2px; top: 2px; }
|
29
|
-
|
30
|
-
.ui-multiselect input.search { height: 14px; padding: 1px; opacity: 0.5; margin: 4px; width: 100px; }
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|