a3 Lazy Load - Version 2.4.3

Version Description

This is an important maintenance release that updates our scripts for compatibility with the latest version of jQuery released in WordPress 5.6

Download this release

Release Info

Developer a3rev
Plugin Icon 128x128 a3 Lazy Load
Version 2.4.3
Comparing to
See all releases

Code changes from version 2.4.2 to 2.4.3

a3-lazy-load.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: a3 Lazy Load
4
  Description: Speed up your site and enhance frontend user's visual experience in PC's, Tablets and mobile with a3 Lazy Load.
5
- Version: 2.4.2
6
  Author: a3rev Software
7
  Author URI: https://a3rev.com/
8
  Requires at least: 4.9
@@ -31,7 +31,7 @@ define('A3_LAZY_LOAD_IMAGES_URL', A3_LAZY_LOAD_URL . '/assets/images');
31
 
32
  define( 'A3_LAZY_LOAD_KEY', 'a3_lazy_load' );
33
  define( 'A3_LAZY_LOAD_PREFIX', 'a3_lazy_load_' );
34
- define( 'A3_LAZY_VERSION', '2.4.2' );
35
  define( 'A3_LAZY_LOAD_G_FONTS', false );
36
 
37
  use \A3Rev\LazyLoad\FrameWork;
2
  /*
3
  Plugin Name: a3 Lazy Load
4
  Description: Speed up your site and enhance frontend user's visual experience in PC's, Tablets and mobile with a3 Lazy Load.
5
+ Version: 2.4.3
6
  Author: a3rev Software
7
  Author URI: https://a3rev.com/
8
  Requires at least: 4.9
31
 
32
  define( 'A3_LAZY_LOAD_KEY', 'a3_lazy_load' );
33
  define( 'A3_LAZY_LOAD_PREFIX', 'a3_lazy_load_' );
34
+ define( 'A3_LAZY_VERSION', '2.4.3' );
35
  define( 'A3_LAZY_LOAD_G_FONTS', false );
36
 
37
  use \A3Rev\LazyLoad\FrameWork;
admin/admin-ui.php CHANGED
@@ -33,7 +33,7 @@ class Admin_UI
33
  * You must change to correct plugin name that you are working
34
  */
35
 
36
- public $framework_version = '2.3.0';
37
  public $plugin_name = A3_LAZY_LOAD_KEY;
38
  public $plugin_path = A3_LAZY_LOAD_NAME;
39
  public $google_api_key_option = '';
33
  * You must change to correct plugin name that you are working
34
  */
35
 
36
+ public $framework_version = '2.4.0';
37
  public $plugin_name = A3_LAZY_LOAD_KEY;
38
  public $plugin_path = A3_LAZY_LOAD_NAME;
39
  public $google_api_key_option = '';
admin/assets/js/admin-ui-script.js CHANGED
@@ -165,7 +165,7 @@
165
  /* Apply for normal checkbox */
166
  $('.a3rev_panel_container .hide_options_if_checked').each(function(){
167
 
168
- $(this).find('input:eq(0)').change(function() {
169
 
170
  if ($(this).is(':checked')) {
171
  $(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').hide();
@@ -178,7 +178,7 @@
178
  });
179
  $('.a3rev_panel_container .show_options_if_checked').each(function(){
180
 
181
- $(this).find('input:eq(0)').change(function() {
182
 
183
  if ($(this).is(':checked')) {
184
  $(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').show();
@@ -234,9 +234,9 @@
234
  });
235
 
236
  /* Apply Sub tab selected script */
237
- $('div.a3_subsubsub_section ul.subsubsub li a:eq(0)').addClass('current');
238
- $('div.a3_subsubsub_section .section:gt(0)').hide();
239
- $('div.a3_subsubsub_section ul.subsubsub li a:gt(0)').each(function(){
240
  if( $(this).attr('class') == 'current') {
241
  $('div.a3_subsubsub_section ul.subsubsub li a').removeClass('current');
242
  $(this).addClass('current');
@@ -251,7 +251,7 @@
251
 
252
  section.find('a').removeClass('current');
253
 
254
- if ( section.find('.section:visible').size() > 0 ) {
255
  section.find('.section:visible').fadeOut( 100, function() {
256
  section.find( target ).fadeIn('fast');
257
  });
@@ -336,7 +336,7 @@
336
  version_checking_status.css('display', 'none');
337
 
338
  // Get response
339
- data = $.parseJSON( response );
340
  if ( 0 == data.has_new_version ) {
341
  version_message_container.removeClass('a3rev-ui-new-version-message');
342
  version_message_container.addClass('a3rev-ui-latest-version-message');
@@ -417,7 +417,7 @@
417
  url: submit_data.ajax_url,
418
  data: submit_data.data,
419
  success: function ( response ) {
420
- data = $.parseJSON( response );
421
  $('#' + bt_ajax_submit.attr('id') ).trigger("a3rev-ui-ajax_submit-completed", [ bt_ajax_submit, data ]);
422
 
423
  setTimeout( function() {
@@ -522,7 +522,7 @@
522
  url: submit_data.ajax_url,
523
  data: submit_data.data,
524
  success: function ( response ) {
525
- result = $.parseJSON( response );
526
 
527
  new_items = result.current_items;
528
 
165
  /* Apply for normal checkbox */
166
  $('.a3rev_panel_container .hide_options_if_checked').each(function(){
167
 
168
+ $(this).find('input').eq(0).change(function() {
169
 
170
  if ($(this).is(':checked')) {
171
  $(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').hide();
178
  });
179
  $('.a3rev_panel_container .show_options_if_checked').each(function(){
180
 
181
+ $(this).find('input').eq(0).change(function() {
182
 
183
  if ($(this).is(':checked')) {
184
  $(this).closest('fieldset, tr').nextUntil( '.hide_options_if_checked, .show_options_if_checked', '.hidden_option').show();
234
  });
235
 
236
  /* Apply Sub tab selected script */
237
+ $('div.a3_subsubsub_section ul.subsubsub li a').eq(0).addClass('current');
238
+ $('div.a3_subsubsub_section .section').slice(1).hide();
239
+ $('div.a3_subsubsub_section ul.subsubsub li a').slice(1).each(function(){
240
  if( $(this).attr('class') == 'current') {
241
  $('div.a3_subsubsub_section ul.subsubsub li a').removeClass('current');
242
  $(this).addClass('current');
251
 
252
  section.find('a').removeClass('current');
253
 
254
+ if ( section.find('.section:visible').length > 0 ) {
255
  section.find('.section:visible').fadeOut( 100, function() {
256
  section.find( target ).fadeIn('fast');
257
  });
336
  version_checking_status.css('display', 'none');
337
 
338
  // Get response
339
+ data = JSON.parse( response );
340
  if ( 0 == data.has_new_version ) {
341
  version_message_container.removeClass('a3rev-ui-new-version-message');
342
  version_message_container.addClass('a3rev-ui-latest-version-message');
417
  url: submit_data.ajax_url,
418
  data: submit_data.data,
419
  success: function ( response ) {
420
+ data = JSON.parse( response );
421
  $('#' + bt_ajax_submit.attr('id') ).trigger("a3rev-ui-ajax_submit-completed", [ bt_ajax_submit, data ]);
422
 
423
  setTimeout( function() {
522
  url: submit_data.ajax_url,
523
  data: submit_data.data,
524
  success: function ( response ) {
525
+ result = JSON.parse( response );
526
 
527
  new_items = result.current_items;
528
 
admin/assets/js/chosen/chosen-sprite.png CHANGED
Binary file
admin/assets/js/chosen/chosen-sprite@2x.png CHANGED
Binary file
admin/assets/js/chosen/chosen.ajaxify.js CHANGED
@@ -2,7 +2,7 @@
2
 
3
  $.fn.bindWithDelay = function( type, data, fn, timeout, throttle ) {
4
 
5
- if ( $.isFunction( data ) ) {
6
  throttle = timeout;
7
  timeout = fn;
8
  fn = data;
@@ -31,7 +31,7 @@
31
 
32
  cb.guid = fn.guid;
33
 
34
- $(this).bind(type, data, cb);
35
  });
36
  };
37
 
2
 
3
  $.fn.bindWithDelay = function( type, data, fn, timeout, throttle ) {
4
 
5
+ if ( typeof data === "function" ) {
6
  throttle = timeout;
7
  timeout = fn;
8
  fn = data;
31
 
32
  cb.guid = fn.guid;
33
 
34
+ $(this).on(type, data, cb);
35
  });
36
  };
37
 
admin/assets/js/chosen/chosen.css CHANGED
@@ -2,9 +2,9 @@
2
  Chosen, a Select Box Enhancer for jQuery and Prototype
3
  by Patrick Filler for Harvest, http://getharvest.com
4
 
5
- Version 1.1.0
6
  Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011 Harvest http://getharvest.com
8
 
9
  MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
  This file is generated by `grunt build`, do not edit it by hand.
@@ -16,33 +16,57 @@ This file is generated by `grunt build`, do not edit it by hand.
16
  display: inline-block;
17
  vertical-align: middle;
18
  font-size: 13px;
19
- zoom: 1;
20
- *display: inline;
21
  -webkit-user-select: none;
22
- -moz-user-select: none;
23
- user-select: none;
 
24
  }
 
 
 
 
 
 
25
  .chosen-container .chosen-drop {
26
  position: absolute;
27
  top: 100%;
28
- left: -9999px;
29
  z-index: 1010;
30
- -webkit-box-sizing: border-box;
31
- -moz-box-sizing: border-box;
32
- box-sizing: border-box;
33
  width: 100%;
34
  border: 1px solid #aaa;
35
  border-top: 0;
36
  background: #fff;
37
- box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
 
 
 
 
38
  }
 
39
  .chosen-container.chosen-with-drop .chosen-drop {
40
- left: 0;
 
 
41
  }
 
42
  .chosen-container a {
43
  cursor: pointer;
44
  }
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  /* @end */
47
  /* @group Single Chosen */
48
  .chosen-container-single .chosen-single {
@@ -50,25 +74,25 @@ This file is generated by `grunt build`, do not edit it by hand.
50
  display: block;
51
  overflow: hidden;
52
  padding: 0 0 0 8px;
53
- height: 23px;
54
  border: 1px solid #aaa;
55
  border-radius: 5px;
56
  background-color: #fff;
57
- background: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
58
- background: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
59
- background: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
60
- background: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
61
- background: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
62
  background-clip: padding-box;
63
- box-shadow: 0 0 3px white inset, 0 1px 1px rgba(0, 0, 0, 0.1);
 
64
  color: #444;
65
  text-decoration: none;
66
  white-space: nowrap;
67
  line-height: 24px;
68
  }
 
69
  .chosen-container-single .chosen-default {
70
  color: #999;
71
  }
 
72
  .chosen-container-single .chosen-single span {
73
  display: block;
74
  overflow: hidden;
@@ -76,9 +100,11 @@ This file is generated by `grunt build`, do not edit it by hand.
76
  text-overflow: ellipsis;
77
  white-space: nowrap;
78
  }
 
79
  .chosen-container-single .chosen-single-with-deselect span {
80
  margin-right: 38px;
81
  }
 
82
  .chosen-container-single .chosen-single abbr {
83
  position: absolute;
84
  top: 6px;
@@ -86,15 +112,18 @@ This file is generated by `grunt build`, do not edit it by hand.
86
  display: block;
87
  width: 12px;
88
  height: 12px;
89
- background: url('chosen-sprite.png') -42px 1px no-repeat;
90
  font-size: 1px;
91
  }
 
92
  .chosen-container-single .chosen-single abbr:hover {
93
  background-position: -42px -10px;
94
  }
 
95
  .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
96
  background-position: -42px -10px;
97
  }
 
98
  .chosen-container-single .chosen-single div {
99
  position: absolute;
100
  top: 0;
@@ -103,12 +132,14 @@ This file is generated by `grunt build`, do not edit it by hand.
103
  width: 18px;
104
  height: 100%;
105
  }
 
106
  .chosen-container-single .chosen-single div b {
107
  display: block;
108
  width: 100%;
109
  height: 100%;
110
- background: url('chosen-sprite.png') no-repeat 0px 2px;
111
  }
 
112
  .chosen-container-single .chosen-search {
113
  position: relative;
114
  z-index: 1010;
@@ -116,36 +147,38 @@ This file is generated by `grunt build`, do not edit it by hand.
116
  padding: 3px 4px;
117
  white-space: nowrap;
118
  }
 
119
  .chosen-container-single .chosen-search input[type="text"] {
120
- -webkit-box-sizing: border-box;
121
- -moz-box-sizing: border-box;
122
- box-sizing: border-box;
123
  margin: 1px 0;
124
  padding: 4px 20px 4px 5px;
125
  width: 100%;
126
  height: auto;
127
  outline: 0;
128
  border: 1px solid #aaa;
129
- background: white url('chosen-sprite.png') no-repeat 100% -20px;
130
- background: url('chosen-sprite.png') no-repeat 100% -20px;
131
  font-size: 1em;
132
  font-family: sans-serif;
133
  line-height: normal;
134
  border-radius: 0;
135
  }
 
136
  .chosen-container-single .chosen-drop {
137
  margin-top: -1px;
138
  border-radius: 0 0 4px 4px;
139
  background-clip: padding-box;
140
  }
 
141
  .chosen-container-single.chosen-container-single-nosearch .chosen-search {
142
  position: absolute;
143
- left: -9999px;
 
 
144
  }
145
 
146
  /* @end */
147
  /* @group Results */
148
  .chosen-container .chosen-results {
 
149
  position: relative;
150
  overflow-x: hidden;
151
  overflow-y: auto;
@@ -154,44 +187,51 @@ This file is generated by `grunt build`, do not edit it by hand.
154
  max-height: 240px;
155
  -webkit-overflow-scrolling: touch;
156
  }
 
157
  .chosen-container .chosen-results li {
158
  display: none;
159
  margin: 0;
160
  padding: 5px 6px;
161
  list-style: none;
162
  line-height: 15px;
 
163
  -webkit-touch-callout: none;
164
  }
 
165
  .chosen-container .chosen-results li.active-result {
166
  display: list-item;
167
  cursor: pointer;
168
  }
 
169
  .chosen-container .chosen-results li.disabled-result {
170
  display: list-item;
171
  color: #ccc;
172
  cursor: default;
173
  }
 
174
  .chosen-container .chosen-results li.highlighted {
175
  background-color: #3875d7;
176
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
177
- background-image: -webkit-linear-gradient(#3875d7 20%, #2a62bc 90%);
178
- background-image: -moz-linear-gradient(#3875d7 20%, #2a62bc 90%);
179
- background-image: -o-linear-gradient(#3875d7 20%, #2a62bc 90%);
180
  background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
181
  color: #fff;
182
  }
 
183
  .chosen-container .chosen-results li.no-results {
 
184
  display: list-item;
185
  background: #f4f4f4;
186
  }
 
187
  .chosen-container .chosen-results li.group-result {
188
  display: list-item;
189
  font-weight: bold;
190
  cursor: default;
191
  }
 
192
  .chosen-container .chosen-results li.group-option {
193
  padding-left: 15px;
194
  }
 
195
  .chosen-container .chosen-results li em {
196
  font-style: normal;
197
  text-decoration: underline;
@@ -202,67 +242,69 @@ This file is generated by `grunt build`, do not edit it by hand.
202
  .chosen-container-multi .chosen-choices {
203
  position: relative;
204
  overflow: hidden;
205
- -webkit-box-sizing: border-box;
206
- -moz-box-sizing: border-box;
207
- box-sizing: border-box;
208
  margin: 0;
209
- padding: 0;
210
  width: 100%;
211
- height: auto !important;
212
- height: 1%;
213
  border: 1px solid #aaa;
214
  background-color: #fff;
215
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
216
- background-image: -webkit-linear-gradient(#eeeeee 1%, #ffffff 15%);
217
- background-image: -moz-linear-gradient(#eeeeee 1%, #ffffff 15%);
218
- background-image: -o-linear-gradient(#eeeeee 1%, #ffffff 15%);
219
- background-image: linear-gradient(#eeeeee 1%, #ffffff 15%);
220
  cursor: text;
221
  }
 
222
  .chosen-container-multi .chosen-choices li {
223
  float: left;
224
  list-style: none;
225
  }
 
226
  .chosen-container-multi .chosen-choices li.search-field {
227
  margin: 0;
228
  padding: 0;
229
  white-space: nowrap;
230
  }
 
231
  .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
232
  margin: 1px 0;
233
- padding: 5px;
234
- height: 15px;
235
  outline: 0;
236
  border: 0 !important;
237
  background: transparent !important;
238
- box-shadow: none;
239
- color: #666;
 
240
  font-size: 100%;
241
  font-family: sans-serif;
242
  line-height: normal;
243
  border-radius: 0;
 
244
  }
245
- .chosen-container-multi .chosen-choices li.search-field .default {
246
- color: #999;
247
- }
248
  .chosen-container-multi .chosen-choices li.search-choice {
249
  position: relative;
250
- margin: 3px 0 3px 5px;
251
  padding: 3px 20px 3px 5px;
252
  border: 1px solid #aaa;
 
253
  border-radius: 3px;
254
- background-color: #e4e4e4;
255
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
256
- background-image: -webkit-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
257
- background-image: -moz-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
258
- background-image: -o-linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
259
- background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
260
  background-clip: padding-box;
261
- box-shadow: 0 0 2px white inset, 0 1px 0 rgba(0, 0, 0, 0.05);
 
262
  color: #333;
263
  line-height: 13px;
264
  cursor: default;
265
  }
 
 
 
 
 
266
  .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
267
  position: absolute;
268
  top: 4px;
@@ -270,33 +312,36 @@ This file is generated by `grunt build`, do not edit it by hand.
270
  display: block;
271
  width: 12px;
272
  height: 12px;
273
- background: url('chosen-sprite.png') -42px 1px no-repeat;
274
  font-size: 1px;
275
  }
 
276
  .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
277
  background-position: -42px -10px;
278
  }
 
279
  .chosen-container-multi .chosen-choices li.search-choice-disabled {
280
  padding-right: 5px;
281
  border: 1px solid #ccc;
282
  background-color: #e4e4e4;
283
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), color-stop(100%, #eeeeee));
284
- background-image: -webkit-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
285
- background-image: -moz-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
286
- background-image: -o-linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
287
- background-image: linear-gradient(top, #f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eeeeee 100%);
288
  color: #666;
289
  }
 
290
  .chosen-container-multi .chosen-choices li.search-choice-focus {
291
  background: #d4d4d4;
292
  }
 
293
  .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
294
  background-position: -42px -10px;
295
  }
 
296
  .chosen-container-multi .chosen-results {
297
  margin: 0;
298
  padding: 0;
299
  }
 
300
  .chosen-container-multi .chosen-drop .result-selected {
301
  display: list-item;
302
  color: #ccc;
@@ -307,34 +352,37 @@ This file is generated by `grunt build`, do not edit it by hand.
307
  /* @group Active */
308
  .chosen-container-active .chosen-single {
309
  border: 1px solid #5897fb;
310
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
 
311
  }
 
312
  .chosen-container-active.chosen-with-drop .chosen-single {
313
  border: 1px solid #aaa;
314
- -moz-border-radius-bottomright: 0;
315
  border-bottom-right-radius: 0;
316
- -moz-border-radius-bottomleft: 0;
317
  border-bottom-left-radius: 0;
318
- background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
319
- background-image: -webkit-linear-gradient(#eeeeee 20%, #ffffff 80%);
320
- background-image: -moz-linear-gradient(#eeeeee 20%, #ffffff 80%);
321
- background-image: -o-linear-gradient(#eeeeee 20%, #ffffff 80%);
322
- background-image: linear-gradient(#eeeeee 20%, #ffffff 80%);
323
- box-shadow: 0 1px 0 #fff inset;
324
  }
 
325
  .chosen-container-active.chosen-with-drop .chosen-single div {
326
  border-left: none;
327
  background: transparent;
328
  }
 
329
  .chosen-container-active.chosen-with-drop .chosen-single div b {
330
  background-position: -18px 2px;
331
  }
 
332
  .chosen-container-active .chosen-choices {
333
  border: 1px solid #5897fb;
334
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
 
335
  }
 
336
  .chosen-container-active .chosen-choices li.search-field input[type="text"] {
337
- color: #111 !important;
338
  }
339
 
340
  /* @end */
@@ -343,9 +391,11 @@ This file is generated by `grunt build`, do not edit it by hand.
343
  opacity: 0.5 !important;
344
  cursor: default;
345
  }
 
346
  .chosen-disabled .chosen-single {
347
  cursor: default;
348
  }
 
349
  .chosen-disabled .chosen-choices .search-choice .search-choice-close {
350
  cursor: default;
351
  }
@@ -355,71 +405,81 @@ This file is generated by `grunt build`, do not edit it by hand.
355
  .chosen-rtl {
356
  text-align: right;
357
  }
 
358
  .chosen-rtl .chosen-single {
359
  overflow: visible;
360
  padding: 0 8px 0 0;
361
  }
 
362
  .chosen-rtl .chosen-single span {
363
  margin-right: 0;
364
  margin-left: 26px;
365
  direction: rtl;
366
  }
 
367
  .chosen-rtl .chosen-single-with-deselect span {
368
  margin-left: 38px;
369
  }
 
370
  .chosen-rtl .chosen-single div {
371
  right: auto;
372
  left: 3px;
373
  }
 
374
  .chosen-rtl .chosen-single abbr {
375
  right: auto;
376
  left: 26px;
377
  }
 
378
  .chosen-rtl .chosen-choices li {
379
  float: right;
380
  }
 
381
  .chosen-rtl .chosen-choices li.search-field input[type="text"] {
382
  direction: rtl;
383
  }
 
384
  .chosen-rtl .chosen-choices li.search-choice {
385
  margin: 3px 5px 3px 0;
386
  padding: 3px 5px 3px 19px;
387
  }
 
388
  .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
389
  right: auto;
390
  left: 4px;
391
  }
392
- .chosen-rtl.chosen-container-single-nosearch .chosen-search,
393
- .chosen-rtl .chosen-drop {
394
- left: 9999px;
395
- }
396
  .chosen-rtl.chosen-container-single .chosen-results {
397
  margin: 0 0 4px 4px;
398
  padding: 0 4px 0 0;
399
  }
 
400
  .chosen-rtl .chosen-results li.group-option {
401
  padding-right: 15px;
402
  padding-left: 0;
403
  }
 
404
  .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
405
  border-right: none;
406
  }
 
407
  .chosen-rtl .chosen-search input[type="text"] {
408
  padding: 4px 5px 4px 20px;
409
- background: white url('chosen-sprite.png') no-repeat -30px -20px;
410
- background: url('chosen-sprite.png') no-repeat -30px -20px;
411
  direction: rtl;
412
  }
 
413
  .chosen-rtl.chosen-container-single .chosen-single div b {
414
  background-position: 6px 2px;
415
  }
 
416
  .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
417
  background-position: -12px 2px;
418
  }
419
 
420
  /* @end */
421
  /* @group Retina compatibility */
422
- @media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-resolution: 144dpi) {
423
  .chosen-rtl .chosen-search input[type="text"],
424
  .chosen-container-single .chosen-single abbr,
425
  .chosen-container-single .chosen-single div b,
@@ -427,9 +487,10 @@ This file is generated by `grunt build`, do not edit it by hand.
427
  .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
428
  .chosen-container .chosen-results-scroll-down span,
429
  .chosen-container .chosen-results-scroll-up span {
430
- background-image: url('chosen-sprite@2x.png') !important;
431
  background-size: 52px 37px !important;
432
  background-repeat: no-repeat !important;
433
  }
434
  }
 
435
  /* @end */
2
  Chosen, a Select Box Enhancer for jQuery and Prototype
3
  by Patrick Filler for Harvest, http://getharvest.com
4
 
5
+ Version 1.8.7
6
  Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2018 Harvest http://getharvest.com
8
 
9
  MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
  This file is generated by `grunt build`, do not edit it by hand.
16
  display: inline-block;
17
  vertical-align: middle;
18
  font-size: 13px;
 
 
19
  -webkit-user-select: none;
20
+ -moz-user-select: none;
21
+ -ms-user-select: none;
22
+ user-select: none;
23
  }
24
+
25
+ .chosen-container * {
26
+ -webkit-box-sizing: border-box;
27
+ box-sizing: border-box;
28
+ }
29
+
30
  .chosen-container .chosen-drop {
31
  position: absolute;
32
  top: 100%;
 
33
  z-index: 1010;
 
 
 
34
  width: 100%;
35
  border: 1px solid #aaa;
36
  border-top: 0;
37
  background: #fff;
38
+ -webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
39
+ box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
40
+ clip: rect(0, 0, 0, 0);
41
+ -webkit-clip-path: inset(100% 100%);
42
+ clip-path: inset(100% 100%);
43
  }
44
+
45
  .chosen-container.chosen-with-drop .chosen-drop {
46
+ clip: auto;
47
+ -webkit-clip-path: none;
48
+ clip-path: none;
49
  }
50
+
51
  .chosen-container a {
52
  cursor: pointer;
53
  }
54
 
55
+ .chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
56
+ margin-right: 4px;
57
+ overflow: hidden;
58
+ white-space: nowrap;
59
+ text-overflow: ellipsis;
60
+ font-weight: normal;
61
+ color: #999999;
62
+ }
63
+
64
+ .chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
65
+ content: ":";
66
+ padding-left: 2px;
67
+ vertical-align: top;
68
+ }
69
+
70
  /* @end */
71
  /* @group Single Chosen */
72
  .chosen-container-single .chosen-single {
74
  display: block;
75
  overflow: hidden;
76
  padding: 0 0 0 8px;
77
+ height: 25px;
78
  border: 1px solid #aaa;
79
  border-radius: 5px;
80
  background-color: #fff;
81
+ background: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #fff), color-stop(50%, #f6f6f6), color-stop(52%, #eee), to(#f4f4f4));
82
+ background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
 
 
 
83
  background-clip: padding-box;
84
+ -webkit-box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
85
+ box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
86
  color: #444;
87
  text-decoration: none;
88
  white-space: nowrap;
89
  line-height: 24px;
90
  }
91
+
92
  .chosen-container-single .chosen-default {
93
  color: #999;
94
  }
95
+
96
  .chosen-container-single .chosen-single span {
97
  display: block;
98
  overflow: hidden;
100
  text-overflow: ellipsis;
101
  white-space: nowrap;
102
  }
103
+
104
  .chosen-container-single .chosen-single-with-deselect span {
105
  margin-right: 38px;
106
  }
107
+
108
  .chosen-container-single .chosen-single abbr {
109
  position: absolute;
110
  top: 6px;
112
  display: block;
113
  width: 12px;
114
  height: 12px;
115
+ background: url("chosen-sprite.png") -42px 1px no-repeat;
116
  font-size: 1px;
117
  }
118
+
119
  .chosen-container-single .chosen-single abbr:hover {
120
  background-position: -42px -10px;
121
  }
122
+
123
  .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
124
  background-position: -42px -10px;
125
  }
126
+
127
  .chosen-container-single .chosen-single div {
128
  position: absolute;
129
  top: 0;
132
  width: 18px;
133
  height: 100%;
134
  }
135
+
136
  .chosen-container-single .chosen-single div b {
137
  display: block;
138
  width: 100%;
139
  height: 100%;
140
+ background: url("chosen-sprite.png") no-repeat 0px 2px;
141
  }
142
+
143
  .chosen-container-single .chosen-search {
144
  position: relative;
145
  z-index: 1010;
147
  padding: 3px 4px;
148
  white-space: nowrap;
149
  }
150
+
151
  .chosen-container-single .chosen-search input[type="text"] {
 
 
 
152
  margin: 1px 0;
153
  padding: 4px 20px 4px 5px;
154
  width: 100%;
155
  height: auto;
156
  outline: 0;
157
  border: 1px solid #aaa;
158
+ background: url("chosen-sprite.png") no-repeat 100% -20px;
 
159
  font-size: 1em;
160
  font-family: sans-serif;
161
  line-height: normal;
162
  border-radius: 0;
163
  }
164
+
165
  .chosen-container-single .chosen-drop {
166
  margin-top: -1px;
167
  border-radius: 0 0 4px 4px;
168
  background-clip: padding-box;
169
  }
170
+
171
  .chosen-container-single.chosen-container-single-nosearch .chosen-search {
172
  position: absolute;
173
+ clip: rect(0, 0, 0, 0);
174
+ -webkit-clip-path: inset(100% 100%);
175
+ clip-path: inset(100% 100%);
176
  }
177
 
178
  /* @end */
179
  /* @group Results */
180
  .chosen-container .chosen-results {
181
+ color: #444;
182
  position: relative;
183
  overflow-x: hidden;
184
  overflow-y: auto;
187
  max-height: 240px;
188
  -webkit-overflow-scrolling: touch;
189
  }
190
+
191
  .chosen-container .chosen-results li {
192
  display: none;
193
  margin: 0;
194
  padding: 5px 6px;
195
  list-style: none;
196
  line-height: 15px;
197
+ word-wrap: break-word;
198
  -webkit-touch-callout: none;
199
  }
200
+
201
  .chosen-container .chosen-results li.active-result {
202
  display: list-item;
203
  cursor: pointer;
204
  }
205
+
206
  .chosen-container .chosen-results li.disabled-result {
207
  display: list-item;
208
  color: #ccc;
209
  cursor: default;
210
  }
211
+
212
  .chosen-container .chosen-results li.highlighted {
213
  background-color: #3875d7;
214
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
 
 
 
215
  background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
216
  color: #fff;
217
  }
218
+
219
  .chosen-container .chosen-results li.no-results {
220
+ color: #777;
221
  display: list-item;
222
  background: #f4f4f4;
223
  }
224
+
225
  .chosen-container .chosen-results li.group-result {
226
  display: list-item;
227
  font-weight: bold;
228
  cursor: default;
229
  }
230
+
231
  .chosen-container .chosen-results li.group-option {
232
  padding-left: 15px;
233
  }
234
+
235
  .chosen-container .chosen-results li em {
236
  font-style: normal;
237
  text-decoration: underline;
242
  .chosen-container-multi .chosen-choices {
243
  position: relative;
244
  overflow: hidden;
 
 
 
245
  margin: 0;
246
+ padding: 0 5px;
247
  width: 100%;
248
+ height: auto;
 
249
  border: 1px solid #aaa;
250
  background-color: #fff;
251
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #eee), color-stop(15%, #fff));
252
+ background-image: linear-gradient(#eee 1%, #fff 15%);
 
 
 
253
  cursor: text;
254
  }
255
+
256
  .chosen-container-multi .chosen-choices li {
257
  float: left;
258
  list-style: none;
259
  }
260
+
261
  .chosen-container-multi .chosen-choices li.search-field {
262
  margin: 0;
263
  padding: 0;
264
  white-space: nowrap;
265
  }
266
+
267
  .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
268
  margin: 1px 0;
269
+ padding: 0;
270
+ height: 25px;
271
  outline: 0;
272
  border: 0 !important;
273
  background: transparent !important;
274
+ -webkit-box-shadow: none;
275
+ box-shadow: none;
276
+ color: #999;
277
  font-size: 100%;
278
  font-family: sans-serif;
279
  line-height: normal;
280
  border-radius: 0;
281
+ width: 25px;
282
  }
283
+
 
 
284
  .chosen-container-multi .chosen-choices li.search-choice {
285
  position: relative;
286
+ margin: 3px 5px 3px 0;
287
  padding: 3px 20px 3px 5px;
288
  border: 1px solid #aaa;
289
+ max-width: 100%;
290
  border-radius: 3px;
291
+ background-color: #eeeeee;
292
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), to(#eee));
293
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
294
+ background-size: 100% 19px;
295
+ background-repeat: repeat-x;
 
296
  background-clip: padding-box;
297
+ -webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
298
+ box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
299
  color: #333;
300
  line-height: 13px;
301
  cursor: default;
302
  }
303
+
304
+ .chosen-container-multi .chosen-choices li.search-choice span {
305
+ word-wrap: break-word;
306
+ }
307
+
308
  .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
309
  position: absolute;
310
  top: 4px;
312
  display: block;
313
  width: 12px;
314
  height: 12px;
315
+ background: url("chosen-sprite.png") -42px 1px no-repeat;
316
  font-size: 1px;
317
  }
318
+
319
  .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
320
  background-position: -42px -10px;
321
  }
322
+
323
  .chosen-container-multi .chosen-choices li.search-choice-disabled {
324
  padding-right: 5px;
325
  border: 1px solid #ccc;
326
  background-color: #e4e4e4;
327
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), to(#eee));
328
+ background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
 
 
 
329
  color: #666;
330
  }
331
+
332
  .chosen-container-multi .chosen-choices li.search-choice-focus {
333
  background: #d4d4d4;
334
  }
335
+
336
  .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
337
  background-position: -42px -10px;
338
  }
339
+
340
  .chosen-container-multi .chosen-results {
341
  margin: 0;
342
  padding: 0;
343
  }
344
+
345
  .chosen-container-multi .chosen-drop .result-selected {
346
  display: list-item;
347
  color: #ccc;
352
  /* @group Active */
353
  .chosen-container-active .chosen-single {
354
  border: 1px solid #5897fb;
355
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
356
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
357
  }
358
+
359
  .chosen-container-active.chosen-with-drop .chosen-single {
360
  border: 1px solid #aaa;
 
361
  border-bottom-right-radius: 0;
 
362
  border-bottom-left-radius: 0;
363
+ background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #eee), color-stop(80%, #fff));
364
+ background-image: linear-gradient(#eee 20%, #fff 80%);
365
+ -webkit-box-shadow: 0 1px 0 #fff inset;
366
+ box-shadow: 0 1px 0 #fff inset;
 
 
367
  }
368
+
369
  .chosen-container-active.chosen-with-drop .chosen-single div {
370
  border-left: none;
371
  background: transparent;
372
  }
373
+
374
  .chosen-container-active.chosen-with-drop .chosen-single div b {
375
  background-position: -18px 2px;
376
  }
377
+
378
  .chosen-container-active .chosen-choices {
379
  border: 1px solid #5897fb;
380
+ -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
381
+ box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
382
  }
383
+
384
  .chosen-container-active .chosen-choices li.search-field input[type="text"] {
385
+ color: #222 !important;
386
  }
387
 
388
  /* @end */
391
  opacity: 0.5 !important;
392
  cursor: default;
393
  }
394
+
395
  .chosen-disabled .chosen-single {
396
  cursor: default;
397
  }
398
+
399
  .chosen-disabled .chosen-choices .search-choice .search-choice-close {
400
  cursor: default;
401
  }
405
  .chosen-rtl {
406
  text-align: right;
407
  }
408
+
409
  .chosen-rtl .chosen-single {
410
  overflow: visible;
411
  padding: 0 8px 0 0;
412
  }
413
+
414
  .chosen-rtl .chosen-single span {
415
  margin-right: 0;
416
  margin-left: 26px;
417
  direction: rtl;
418
  }
419
+
420
  .chosen-rtl .chosen-single-with-deselect span {
421
  margin-left: 38px;
422
  }
423
+
424
  .chosen-rtl .chosen-single div {
425
  right: auto;
426
  left: 3px;
427
  }
428
+
429
  .chosen-rtl .chosen-single abbr {
430
  right: auto;
431
  left: 26px;
432
  }
433
+
434
  .chosen-rtl .chosen-choices li {
435
  float: right;
436
  }
437
+
438
  .chosen-rtl .chosen-choices li.search-field input[type="text"] {
439
  direction: rtl;
440
  }
441
+
442
  .chosen-rtl .chosen-choices li.search-choice {
443
  margin: 3px 5px 3px 0;
444
  padding: 3px 5px 3px 19px;
445
  }
446
+
447
  .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
448
  right: auto;
449
  left: 4px;
450
  }
451
+
 
 
 
452
  .chosen-rtl.chosen-container-single .chosen-results {
453
  margin: 0 0 4px 4px;
454
  padding: 0 4px 0 0;
455
  }
456
+
457
  .chosen-rtl .chosen-results li.group-option {
458
  padding-right: 15px;
459
  padding-left: 0;
460
  }
461
+
462
  .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
463
  border-right: none;
464
  }
465
+
466
  .chosen-rtl .chosen-search input[type="text"] {
467
  padding: 4px 5px 4px 20px;
468
+ background: url("chosen-sprite.png") no-repeat -30px -20px;
 
469
  direction: rtl;
470
  }
471
+
472
  .chosen-rtl.chosen-container-single .chosen-single div b {
473
  background-position: 6px 2px;
474
  }
475
+
476
  .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
477
  background-position: -12px 2px;
478
  }
479
 
480
  /* @end */
481
  /* @group Retina compatibility */
482
+ @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
483
  .chosen-rtl .chosen-search input[type="text"],
484
  .chosen-container-single .chosen-single abbr,
485
  .chosen-container-single .chosen-single div b,
487
  .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
488
  .chosen-container .chosen-results-scroll-down span,
489
  .chosen-container .chosen-results-scroll-up span {
490
+ background-image: url("chosen-sprite@2x.png") !important;
491
  background-size: 52px 37px !important;
492
  background-repeat: no-repeat !important;
493
  }
494
  }
495
+
496
  /* @end */
admin/assets/js/chosen/chosen.jquery.js CHANGED
@@ -2,18 +2,19 @@
2
  Chosen, a Select Box Enhancer for jQuery and Prototype
3
  by Patrick Filler for Harvest, http://getharvest.com
4
 
5
- Version 1.1.0
6
  Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011 Harvest http://getharvest.com
8
 
9
  MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
  This file is generated by `grunt build`, do not edit it by hand.
11
  */
12
 
13
  (function() {
14
- var $, AbstractChosen, Chosen, SelectParser, _ref,
15
- __hasProp = {}.hasOwnProperty,
16
- __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
 
17
 
18
  SelectParser = (function() {
19
  function SelectParser() {
@@ -30,22 +31,24 @@ This file is generated by `grunt build`, do not edit it by hand.
30
  };
31
 
32
  SelectParser.prototype.add_group = function(group) {
33
- var group_position, option, _i, _len, _ref, _results;
34
  group_position = this.parsed.length;
35
  this.parsed.push({
36
  array_index: group_position,
37
  group: true,
38
- label: this.escapeExpression(group.label),
 
39
  children: 0,
40
- disabled: group.disabled
 
41
  });
42
- _ref = group.childNodes;
43
- _results = [];
44
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
45
- option = _ref[_i];
46
- _results.push(this.add_option(option, group_position, group.disabled));
47
  }
48
- return _results;
49
  };
50
 
51
  SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
@@ -60,9 +63,11 @@ This file is generated by `grunt build`, do not edit it by hand.
60
  value: option.value,
61
  text: option.text,
62
  html: option.innerHTML,
 
63
  selected: option.selected,
64
  disabled: group_disabled === true ? group_disabled : option.disabled,
65
  group_array_index: group_position,
 
66
  classes: option.className,
67
  style: option.style.cssText
68
  });
@@ -77,46 +82,26 @@ This file is generated by `grunt build`, do not edit it by hand.
77
  }
78
  };
79
 
80
- SelectParser.prototype.escapeExpression = function(text) {
81
- var map, unsafe_chars;
82
- if ((text == null) || text === false) {
83
- return "";
84
- }
85
- if (!/[\&\<\>\"\'\`]/.test(text)) {
86
- return text;
87
- }
88
- map = {
89
- "<": "&lt;",
90
- ">": "&gt;",
91
- '"': "&quot;",
92
- "'": "&#x27;",
93
- "`": "&#x60;"
94
- };
95
- unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
96
- return text.replace(unsafe_chars, function(chr) {
97
- return map[chr] || "&amp;";
98
- });
99
- };
100
-
101
  return SelectParser;
102
 
103
  })();
104
 
105
  SelectParser.select_to_array = function(select) {
106
- var child, parser, _i, _len, _ref;
107
  parser = new SelectParser();
108
- _ref = select.childNodes;
109
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
110
- child = _ref[_i];
111
  parser.add_node(child);
112
  }
113
  return parser.parsed;
114
  };
115
 
116
  AbstractChosen = (function() {
117
- function AbstractChosen(form_field, options) {
118
  this.form_field = form_field;
119
- this.options = options != null ? options : {};
 
120
  if (!AbstractChosen.browser_is_supported()) {
121
  return;
122
  }
@@ -126,20 +111,25 @@ This file is generated by `grunt build`, do not edit it by hand.
126
  this.setup();
127
  this.set_up_html();
128
  this.register_observers();
 
129
  }
130
 
131
  AbstractChosen.prototype.set_default_values = function() {
132
- var _this = this;
133
- this.click_test_action = function(evt) {
134
- return _this.test_active_click(evt);
135
- };
136
- this.activate_action = function(evt) {
137
- return _this.activate_field(evt);
138
- };
 
 
 
139
  this.active_field = false;
140
  this.mouse_on_container = false;
141
  this.results_showing = false;
142
  this.result_highlighted = null;
 
143
  this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
144
  this.disable_search_threshold = this.options.disable_search_threshold || 0;
145
  this.disable_search = this.options.disable_search || false;
@@ -150,7 +140,11 @@ This file is generated by `grunt build`, do not edit it by hand.
150
  this.max_selected_options = this.options.max_selected_options || Infinity;
151
  this.inherit_select_classes = this.options.inherit_select_classes || false;
152
  this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
153
- return this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
 
 
 
 
154
  };
155
 
156
  AbstractChosen.prototype.set_default_text = function() {
@@ -161,9 +155,18 @@ This file is generated by `grunt build`, do not edit it by hand.
161
  } else {
162
  this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
163
  }
 
164
  return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
165
  };
166
 
 
 
 
 
 
 
 
 
167
  AbstractChosen.prototype.mouse_enter = function() {
168
  return this.mouse_on_container = true;
169
  };
@@ -173,12 +176,13 @@ This file is generated by `grunt build`, do not edit it by hand.
173
  };
174
 
175
  AbstractChosen.prototype.input_focus = function(evt) {
176
- var _this = this;
177
  if (this.is_multiple) {
178
  if (!this.active_field) {
179
- return setTimeout((function() {
180
- return _this.container_mousedown();
181
- }), 50);
 
 
182
  }
183
  } else {
184
  if (!this.active_field) {
@@ -188,33 +192,51 @@ This file is generated by `grunt build`, do not edit it by hand.
188
  };
189
 
190
  AbstractChosen.prototype.input_blur = function(evt) {
191
- var _this = this;
192
  if (!this.mouse_on_container) {
193
  this.active_field = false;
194
- return setTimeout((function() {
195
- return _this.blur_test();
196
- }), 100);
 
 
 
 
 
 
 
 
 
 
197
  }
198
  };
199
 
200
  AbstractChosen.prototype.results_option_build = function(options) {
201
- var content, data, _i, _len, _ref;
202
  content = '';
203
- _ref = this.results_data;
204
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
205
- data = _ref[_i];
 
 
206
  if (data.group) {
207
- content += this.result_add_group(data);
208
  } else {
209
- content += this.result_add_option(data);
 
 
 
 
210
  }
211
  if (options != null ? options.first : void 0) {
212
  if (data.selected && this.is_multiple) {
213
  this.choice_build(data);
214
  } else if (data.selected && !this.is_multiple) {
215
- this.single_set_selected_text(data.text);
216
  }
217
  }
 
 
 
218
  }
219
  return content;
220
  };
@@ -245,23 +267,36 @@ This file is generated by `grunt build`, do not edit it by hand.
245
  }
246
  option_el = document.createElement("li");
247
  option_el.className = classes.join(" ");
248
- option_el.style.cssText = option.style;
 
 
249
  option_el.setAttribute("data-option-array-index", option.array_index);
250
- option_el.innerHTML = option.search_text;
 
 
 
251
  return this.outerHTML(option_el);
252
  };
253
 
254
  AbstractChosen.prototype.result_add_group = function(group) {
255
- var group_el;
256
  if (!(group.search_match || group.group_match)) {
257
  return '';
258
  }
259
  if (!(group.active_options > 0)) {
260
  return '';
261
  }
 
 
 
 
 
262
  group_el = document.createElement("li");
263
- group_el.className = "group-result";
264
- group_el.innerHTML = group.search_text;
 
 
 
265
  return this.outerHTML(group_el);
266
  };
267
 
@@ -278,18 +313,18 @@ This file is generated by `grunt build`, do not edit it by hand.
278
  };
279
 
280
  AbstractChosen.prototype.reset_single_select_options = function() {
281
- var result, _i, _len, _ref, _results;
282
- _ref = this.results_data;
283
- _results = [];
284
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
285
- result = _ref[_i];
286
  if (result.selected) {
287
- _results.push(result.selected = false);
288
  } else {
289
- _results.push(void 0);
290
  }
291
  }
292
- return _results;
293
  };
294
 
295
  AbstractChosen.prototype.results_toggle = function() {
@@ -308,20 +343,20 @@ This file is generated by `grunt build`, do not edit it by hand.
308
  }
309
  };
310
 
311
- AbstractChosen.prototype.winnow_results = function() {
312
- var escapedSearchText, option, regex, regexAnchor, results, results_group, searchText, startpos, text, zregex, _i, _len, _ref;
313
  this.no_results_clear();
314
  results = 0;
315
- searchText = this.get_search_text();
316
- escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
317
- regexAnchor = this.search_contains ? "" : "^";
318
- regex = new RegExp(regexAnchor + escapedSearchText, 'i');
319
- zregex = new RegExp(escapedSearchText, 'i');
320
- _ref = this.results_data;
321
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
322
- option = _ref[_i];
323
  option.search_match = false;
324
  results_group = null;
 
 
325
  if (this.include_option_in_results(option)) {
326
  if (option.group) {
327
  option.group_match = false;
@@ -334,17 +369,20 @@ This file is generated by `grunt build`, do not edit it by hand.
334
  }
335
  results_group.active_options += 1;
336
  }
 
337
  if (!(option.group && !this.group_search)) {
338
- option.search_text = option.group ? option.label : option.html;
339
- option.search_match = this.search_string_match(option.search_text, regex);
340
  if (option.search_match && !option.group) {
341
  results += 1;
342
  }
343
  if (option.search_match) {
344
- if (searchText.length) {
345
- startpos = option.search_text.search(zregex);
346
- text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
347
- option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
 
 
348
  }
349
  if (results_group != null) {
350
  results_group.group_match = true;
@@ -356,41 +394,45 @@ This file is generated by `grunt build`, do not edit it by hand.
356
  }
357
  }
358
  this.result_clear_highlight();
359
- if (results < 1 && searchText.length) {
360
  this.update_results_content("");
361
- return this.no_results(searchText);
362
  } else {
363
  this.update_results_content(this.results_option_build());
364
- return this.winnow_results_set_highlight();
 
 
 
 
 
 
 
 
 
 
365
  }
 
 
366
  };
367
 
368
  AbstractChosen.prototype.search_string_match = function(search_string, regex) {
369
- var part, parts, _i, _len;
370
- if (regex.test(search_string)) {
371
- return true;
372
- } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
373
- parts = search_string.replace(/\[|\]/g, "").split(" ");
374
- if (parts.length) {
375
- for (_i = 0, _len = parts.length; _i < _len; _i++) {
376
- part = parts[_i];
377
- if (regex.test(part)) {
378
- return true;
379
- }
380
- }
381
- }
382
  }
 
383
  };
384
 
385
  AbstractChosen.prototype.choices_count = function() {
386
- var option, _i, _len, _ref;
387
  if (this.selected_option_count != null) {
388
  return this.selected_option_count;
389
  }
390
  this.selected_option_count = 0;
391
- _ref = this.form_field.options;
392
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
393
- option = _ref[_i];
394
  if (option.selected) {
395
  this.selected_option_count += 1;
396
  }
@@ -400,59 +442,109 @@ This file is generated by `grunt build`, do not edit it by hand.
400
 
401
  AbstractChosen.prototype.choices_click = function(evt) {
402
  evt.preventDefault();
 
403
  if (!(this.results_showing || this.is_disabled)) {
404
  return this.results_show();
405
  }
406
  };
407
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
408
  AbstractChosen.prototype.keyup_checker = function(evt) {
409
- var stroke, _ref;
410
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
411
  this.search_field_scale();
412
  switch (stroke) {
413
  case 8:
414
  if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
415
- return this.keydown_backstroke();
416
  } else if (!this.pending_backstroke) {
417
  this.result_clear_highlight();
418
- return this.results_search();
419
  }
420
  break;
421
  case 13:
422
  evt.preventDefault();
423
  if (this.results_showing) {
424
- return this.result_select(evt);
425
  }
426
  break;
427
  case 27:
428
  if (this.results_showing) {
429
  this.results_hide();
430
  }
431
- return true;
432
  case 9:
 
 
 
433
  case 38:
434
  case 40:
435
- case 16:
436
  case 91:
437
- case 17:
438
  break;
439
  default:
440
- return this.results_search();
 
441
  }
442
  };
443
 
444
  AbstractChosen.prototype.clipboard_event_checker = function(evt) {
445
- var _this = this;
446
- return setTimeout((function() {
447
- return _this.results_search();
448
- }), 50);
 
 
 
 
449
  };
450
 
451
  AbstractChosen.prototype.container_width = function() {
452
  if (this.options.width != null) {
453
  return this.options.width;
454
  } else {
455
- return "" + this.form_field.offsetWidth + "px";
456
  }
457
  };
458
 
@@ -495,18 +587,25 @@ This file is generated by `grunt build`, do not edit it by hand.
495
  return tmp.innerHTML;
496
  };
497
 
 
 
 
 
 
 
 
 
 
 
 
 
498
  AbstractChosen.browser_is_supported = function() {
499
- if (window.navigator.appName === "Microsoft Internet Explorer") {
500
  return document.documentMode >= 8;
501
  }
502
- if (/iP(od|hone)/i.test(window.navigator.userAgent)) {
503
  return false;
504
  }
505
- if (/Android/i.test(window.navigator.userAgent)) {
506
- if (/Mobile/i.test(window.navigator.userAgent)) {
507
- return false;
508
- }
509
- }
510
  return true;
511
  };
512
 
@@ -531,27 +630,29 @@ This file is generated by `grunt build`, do not edit it by hand.
531
  var $this, chosen;
532
  $this = $(this);
533
  chosen = $this.data('chosen');
534
- if (options === 'destroy' && chosen) {
535
- chosen.destroy();
536
- } else if (!chosen) {
 
 
 
 
537
  $this.data('chosen', new Chosen(this, options));
538
  }
539
  });
540
  }
541
  });
542
 
543
- Chosen = (function(_super) {
544
- __extends(Chosen, _super);
545
 
546
  function Chosen() {
547
- _ref = Chosen.__super__.constructor.apply(this, arguments);
548
- return _ref;
549
  }
550
 
551
  Chosen.prototype.setup = function() {
552
  this.form_field_jq = $(this.form_field);
553
- this.current_selectedIndex = this.form_field.selectedIndex;
554
- return this.is_rtl = this.form_field_jq.hasClass("chosen-rtl");
555
  };
556
 
557
  Chosen.prototype.set_up_html = function() {
@@ -566,17 +667,17 @@ This file is generated by `grunt build`, do not edit it by hand.
566
  }
567
  container_props = {
568
  'class': container_classes.join(' '),
569
- 'style': "width: " + (this.container_width()) + ";",
570
  'title': this.form_field.title
571
  };
572
  if (this.form_field.id.length) {
573
  container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
574
  }
575
  this.container = $("<div />", container_props);
 
576
  if (this.is_multiple) {
577
- this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>');
578
  } else {
579
- this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
580
  }
581
  this.form_field_jq.hide().after(this.container);
582
  this.dropdown = this.container.find('div.chosen-drop').first();
@@ -593,90 +694,149 @@ This file is generated by `grunt build`, do not edit it by hand.
593
  }
594
  this.results_build();
595
  this.set_tab_index();
596
- this.set_label_behavior();
 
 
 
597
  return this.form_field_jq.trigger("chosen:ready", {
598
  chosen: this
599
  });
600
  };
601
 
602
  Chosen.prototype.register_observers = function() {
603
- var _this = this;
604
- this.container.bind('mousedown.chosen', function(evt) {
605
- _this.container_mousedown(evt);
606
- });
607
- this.container.bind('mouseup.chosen', function(evt) {
608
- _this.container_mouseup(evt);
609
- });
610
- this.container.bind('mouseenter.chosen', function(evt) {
611
- _this.mouse_enter(evt);
612
- });
613
- this.container.bind('mouseleave.chosen', function(evt) {
614
- _this.mouse_leave(evt);
615
- });
616
- this.search_results.bind('mouseup.chosen', function(evt) {
617
- _this.search_results_mouseup(evt);
618
- });
619
- this.search_results.bind('mouseover.chosen', function(evt) {
620
- _this.search_results_mouseover(evt);
621
- });
622
- this.search_results.bind('mouseout.chosen', function(evt) {
623
- _this.search_results_mouseout(evt);
624
- });
625
- this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
626
- _this.search_results_mousewheel(evt);
627
- });
628
- this.search_results.bind('touchstart.chosen', function(evt) {
629
- _this.search_results_touchstart(evt);
630
- });
631
- this.search_results.bind('touchmove.chosen', function(evt) {
632
- _this.search_results_touchmove(evt);
633
- });
634
- this.search_results.bind('touchend.chosen', function(evt) {
635
- _this.search_results_touchend(evt);
636
- });
637
- this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
638
- _this.results_update_field(evt);
639
- });
640
- this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
641
- _this.activate_field(evt);
642
- });
643
- this.form_field_jq.bind("chosen:open.chosen", function(evt) {
644
- _this.container_mousedown(evt);
645
- });
646
- this.form_field_jq.bind("chosen:close.chosen", function(evt) {
647
- _this.input_blur(evt);
648
- });
649
- this.search_field.bind('blur.chosen', function(evt) {
650
- _this.input_blur(evt);
651
- });
652
- this.search_field.bind('keyup.chosen', function(evt) {
653
- _this.keyup_checker(evt);
654
- });
655
- this.search_field.bind('keydown.chosen', function(evt) {
656
- _this.keydown_checker(evt);
657
- });
658
- this.search_field.bind('focus.chosen', function(evt) {
659
- _this.input_focus(evt);
660
- });
661
- this.search_field.bind('cut.chosen', function(evt) {
662
- _this.clipboard_event_checker(evt);
663
- });
664
- this.search_field.bind('paste.chosen', function(evt) {
665
- _this.clipboard_event_checker(evt);
666
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
667
  if (this.is_multiple) {
668
- return this.search_choices.bind('click.chosen', function(evt) {
669
- _this.choices_click(evt);
670
- });
 
 
671
  } else {
672
- return this.container.bind('click.chosen', function(evt) {
673
  evt.preventDefault();
674
  });
675
  }
676
  };
677
 
678
  Chosen.prototype.destroy = function() {
679
- $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
 
 
 
680
  if (this.search_field[0].tabIndex) {
681
  this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
682
  }
@@ -686,41 +846,39 @@ This file is generated by `grunt build`, do not edit it by hand.
686
  };
687
 
688
  Chosen.prototype.search_field_disabled = function() {
689
- this.is_disabled = this.form_field_jq[0].disabled;
 
 
 
 
 
690
  if (this.is_disabled) {
691
- this.container.addClass('chosen-disabled');
692
- this.search_field[0].disabled = true;
693
- if (!this.is_multiple) {
694
- this.selected_item.unbind("focus.chosen", this.activate_action);
695
- }
696
  return this.close_field();
697
- } else {
698
- this.container.removeClass('chosen-disabled');
699
- this.search_field[0].disabled = false;
700
- if (!this.is_multiple) {
701
- return this.selected_item.bind("focus.chosen", this.activate_action);
702
- }
703
  }
704
  };
705
 
706
  Chosen.prototype.container_mousedown = function(evt) {
707
- if (!this.is_disabled) {
708
- if (evt && evt.type === "mousedown" && !this.results_showing) {
709
- evt.preventDefault();
710
- }
711
- if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
712
- if (!this.active_field) {
713
- if (this.is_multiple) {
714
- this.search_field.val("");
715
- }
716
- $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
717
- this.results_show();
718
- } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
719
- evt.preventDefault();
720
- this.results_toggle();
721
  }
722
- return this.activate_field();
 
 
 
 
723
  }
 
724
  }
725
  };
726
 
@@ -733,7 +891,7 @@ This file is generated by `grunt build`, do not edit it by hand.
733
  Chosen.prototype.search_results_mousewheel = function(evt) {
734
  var delta;
735
  if (evt.originalEvent) {
736
- delta = -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
737
  }
738
  if (delta != null) {
739
  evt.preventDefault();
@@ -751,16 +909,20 @@ This file is generated by `grunt build`, do not edit it by hand.
751
  };
752
 
753
  Chosen.prototype.close_field = function() {
754
- $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
755
  this.active_field = false;
756
  this.results_hide();
757
  this.container.removeClass("chosen-container-active");
758
  this.clear_backstroke();
759
  this.show_search_field_default();
760
- return this.search_field_scale();
 
761
  };
762
 
763
  Chosen.prototype.activate_field = function() {
 
 
 
764
  this.container.addClass("chosen-container-active");
765
  this.active_field = true;
766
  this.search_field.val(this.search_field.val());
@@ -783,7 +945,7 @@ This file is generated by `grunt build`, do not edit it by hand.
783
  this.results_data = SelectParser.select_to_array(this.form_field);
784
  if (this.is_multiple) {
785
  this.search_choices.find("li.search-choice").remove();
786
- } else if (!this.is_multiple) {
787
  this.single_set_selected_text();
788
  if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
789
  this.search_field[0].readOnly = true;
@@ -838,7 +1000,7 @@ This file is generated by `grunt build`, do not edit it by hand.
838
  this.container.addClass("chosen-with-drop");
839
  this.results_showing = true;
840
  this.search_field.focus();
841
- this.search_field.val(this.search_field.val());
842
  this.winnow_results();
843
  return this.form_field_jq.trigger("chosen:showing_dropdown", {
844
  chosen: this
@@ -870,19 +1032,12 @@ This file is generated by `grunt build`, do not edit it by hand.
870
  };
871
 
872
  Chosen.prototype.set_label_behavior = function() {
873
- var _this = this;
874
  this.form_field_label = this.form_field_jq.parents("label");
875
  if (!this.form_field_label.length && this.form_field.id.length) {
876
  this.form_field_label = $("label[for='" + this.form_field.id + "']");
877
  }
878
  if (this.form_field_label.length > 0) {
879
- return this.form_field_label.bind('click.chosen', function(evt) {
880
- if (_this.is_multiple) {
881
- return _this.container_mousedown(evt);
882
- } else {
883
- return _this.activate_field();
884
- }
885
- });
886
  }
887
  };
888
 
@@ -915,17 +1070,16 @@ This file is generated by `grunt build`, do not edit it by hand.
915
  };
916
 
917
  Chosen.prototype.search_results_mouseout = function(evt) {
918
- if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
919
  return this.result_clear_highlight();
920
  }
921
  };
922
 
923
  Chosen.prototype.choice_build = function(item) {
924
- var choice, close_link,
925
- _this = this;
926
  choice = $('<li />', {
927
  "class": "search-choice"
928
- }).html("<span>" + item.html + "</span>");
929
  if (item.disabled) {
930
  choice.addClass('search-choice-disabled');
931
  } else {
@@ -933,9 +1087,11 @@ This file is generated by `grunt build`, do not edit it by hand.
933
  "class": 'search-choice-close',
934
  'data-option-array-index': item.array_index
935
  });
936
- close_link.bind('click.chosen', function(evt) {
937
- return _this.choice_destroy_link_click(evt);
938
- });
 
 
939
  choice.append(close_link);
940
  }
941
  return this.search_container.before(choice);
@@ -951,8 +1107,12 @@ This file is generated by `grunt build`, do not edit it by hand.
951
 
952
  Chosen.prototype.choice_destroy = function(link) {
953
  if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
954
- this.show_search_field_default();
955
- if (this.is_multiple && this.choices_count() > 0 && this.search_field.val().length < 1) {
 
 
 
 
956
  this.results_hide();
957
  }
958
  link.parents('li').first().remove();
@@ -966,7 +1126,7 @@ This file is generated by `grunt build`, do not edit it by hand.
966
  this.single_set_selected_text();
967
  this.show_search_field_default();
968
  this.results_reset_cleanup();
969
- this.form_field_jq.trigger("change");
970
  if (this.active_field) {
971
  return this.results_hide();
972
  }
@@ -993,6 +1153,7 @@ This file is generated by `grunt build`, do not edit it by hand.
993
  } else {
994
  this.reset_single_select_options();
995
  }
 
996
  item = this.results_data[high[0].getAttribute("data-option-array-index")];
997
  item.selected = true;
998
  this.form_field.options[item.options_index].selected = true;
@@ -1000,18 +1161,28 @@ This file is generated by `grunt build`, do not edit it by hand.
1000
  if (this.is_multiple) {
1001
  this.choice_build(item);
1002
  } else {
1003
- this.single_set_selected_text(item.text);
1004
  }
1005
- if (!((evt.metaKey || evt.ctrlKey) && this.is_multiple)) {
 
 
 
 
 
 
 
 
 
1006
  this.results_hide();
 
1007
  }
1008
- this.search_field.val("");
1009
  if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1010
- this.form_field_jq.trigger("change", {
1011
- 'selected': this.form_field.options[item.options_index].value
1012
  });
1013
  }
1014
  this.current_selectedIndex = this.form_field.selectedIndex;
 
1015
  return this.search_field_scale();
1016
  }
1017
  };
@@ -1026,7 +1197,7 @@ This file is generated by `grunt build`, do not edit it by hand.
1026
  this.single_deselect_control_build();
1027
  this.selected_item.removeClass("chosen-default");
1028
  }
1029
- return this.selected_item.find("span").text(text);
1030
  };
1031
 
1032
  Chosen.prototype.result_deselect = function(pos) {
@@ -1040,7 +1211,7 @@ This file is generated by `grunt build`, do not edit it by hand.
1040
  if (this.results_showing) {
1041
  this.winnow_results();
1042
  }
1043
- this.form_field_jq.trigger("change", {
1044
  deselected: this.form_field.options[result_data.options_index].value
1045
  });
1046
  this.search_field_scale();
@@ -1060,12 +1231,16 @@ This file is generated by `grunt build`, do not edit it by hand.
1060
  return this.selected_item.addClass("chosen-single-with-deselect");
1061
  };
1062
 
 
 
 
 
1063
  Chosen.prototype.get_search_text = function() {
1064
- if (this.search_field.val() === this.default_text) {
1065
- return "";
1066
- } else {
1067
- return $('<div/>').text($.trim(this.search_field.val())).html();
1068
- }
1069
  };
1070
 
1071
  Chosen.prototype.winnow_results_set_highlight = function() {
@@ -1079,8 +1254,7 @@ This file is generated by `grunt build`, do not edit it by hand.
1079
 
1080
  Chosen.prototype.no_results = function(terms) {
1081
  var no_results_html;
1082
- no_results_html = $('<li class="no-results">' + this.results_none_found + ' "<span></span>"</li>');
1083
- no_results_html.find("span").first().html(terms);
1084
  this.search_results.append(no_results_html);
1085
  return this.form_field_jq.trigger("chosen:no_results", {
1086
  chosen: this
@@ -1145,63 +1319,37 @@ This file is generated by `grunt build`, do not edit it by hand.
1145
  return this.pending_backstroke = null;
1146
  };
1147
 
1148
- Chosen.prototype.keydown_checker = function(evt) {
1149
- var stroke, _ref1;
1150
- stroke = (_ref1 = evt.which) != null ? _ref1 : evt.keyCode;
1151
- this.search_field_scale();
1152
- if (stroke !== 8 && this.pending_backstroke) {
1153
- this.clear_backstroke();
1154
  }
1155
- switch (stroke) {
1156
- case 8:
1157
- this.backstroke_length = this.search_field.val().length;
1158
- break;
1159
- case 9:
1160
- if (this.results_showing && !this.is_multiple) {
1161
- this.result_select(evt);
1162
- }
1163
- this.mouse_on_container = false;
1164
- break;
1165
- case 13:
1166
- evt.preventDefault();
1167
- break;
1168
- case 38:
1169
- evt.preventDefault();
1170
- this.keyup_arrow();
1171
- break;
1172
- case 40:
1173
- evt.preventDefault();
1174
- this.keydown_arrow();
1175
- break;
1176
  }
 
1177
  };
1178
 
1179
- Chosen.prototype.search_field_scale = function() {
1180
- var div, f_width, h, style, style_block, styles, w, _i, _len;
1181
- if (this.is_multiple) {
1182
- h = 0;
1183
- w = 0;
1184
- style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
1185
- styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
1186
- for (_i = 0, _len = styles.length; _i < _len; _i++) {
1187
- style = styles[_i];
1188
- style_block += style + ":" + this.search_field.css(style) + ";";
1189
- }
1190
- div = $('<div />', {
1191
- 'style': style_block
1192
- });
1193
- div.text(this.search_field.val());
1194
- $('body').append(div);
1195
- w = div.width() + 25;
1196
- div.remove();
1197
- f_width = this.container.outerWidth();
1198
- if (w > f_width - 10) {
1199
- w = f_width - 10;
1200
- }
1201
- return this.search_field.css({
1202
- 'width': w + 'px'
1203
- });
1204
- }
1205
  };
1206
 
1207
  return Chosen;
2
  Chosen, a Select Box Enhancer for jQuery and Prototype
3
  by Patrick Filler for Harvest, http://getharvest.com
4
 
5
+ Version 1.8.7
6
  Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2018 Harvest http://getharvest.com
8
 
9
  MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
  This file is generated by `grunt build`, do not edit it by hand.
11
  */
12
 
13
  (function() {
14
+ var $, AbstractChosen, Chosen, SelectParser,
15
+ bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
16
+ extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
17
+ hasProp = {}.hasOwnProperty;
18
 
19
  SelectParser = (function() {
20
  function SelectParser() {
31
  };
32
 
33
  SelectParser.prototype.add_group = function(group) {
34
+ var group_position, i, len, option, ref, results1;
35
  group_position = this.parsed.length;
36
  this.parsed.push({
37
  array_index: group_position,
38
  group: true,
39
+ label: group.label,
40
+ title: group.title ? group.title : void 0,
41
  children: 0,
42
+ disabled: group.disabled,
43
+ classes: group.className
44
  });
45
+ ref = group.childNodes;
46
+ results1 = [];
47
+ for (i = 0, len = ref.length; i < len; i++) {
48
+ option = ref[i];
49
+ results1.push(this.add_option(option, group_position, group.disabled));
50
  }
51
+ return results1;
52
  };
53
 
54
  SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
63
  value: option.value,
64
  text: option.text,
65
  html: option.innerHTML,
66
+ title: option.title ? option.title : void 0,
67
  selected: option.selected,
68
  disabled: group_disabled === true ? group_disabled : option.disabled,
69
  group_array_index: group_position,
70
+ group_label: group_position != null ? this.parsed[group_position].label : null,
71
  classes: option.className,
72
  style: option.style.cssText
73
  });
82
  }
83
  };
84
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  return SelectParser;
86
 
87
  })();
88
 
89
  SelectParser.select_to_array = function(select) {
90
+ var child, i, len, parser, ref;
91
  parser = new SelectParser();
92
+ ref = select.childNodes;
93
+ for (i = 0, len = ref.length; i < len; i++) {
94
+ child = ref[i];
95
  parser.add_node(child);
96
  }
97
  return parser.parsed;
98
  };
99
 
100
  AbstractChosen = (function() {
101
+ function AbstractChosen(form_field, options1) {
102
  this.form_field = form_field;
103
+ this.options = options1 != null ? options1 : {};
104
+ this.label_click_handler = bind(this.label_click_handler, this);
105
  if (!AbstractChosen.browser_is_supported()) {
106
  return;
107
  }
111
  this.setup();
112
  this.set_up_html();
113
  this.register_observers();
114
+ this.on_ready();
115
  }
116
 
117
  AbstractChosen.prototype.set_default_values = function() {
118
+ this.click_test_action = (function(_this) {
119
+ return function(evt) {
120
+ return _this.test_active_click(evt);
121
+ };
122
+ })(this);
123
+ this.activate_action = (function(_this) {
124
+ return function(evt) {
125
+ return _this.activate_field(evt);
126
+ };
127
+ })(this);
128
  this.active_field = false;
129
  this.mouse_on_container = false;
130
  this.results_showing = false;
131
  this.result_highlighted = null;
132
+ this.is_rtl = this.options.rtl || /\bchosen-rtl\b/.test(this.form_field.className);
133
  this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
134
  this.disable_search_threshold = this.options.disable_search_threshold || 0;
135
  this.disable_search = this.options.disable_search || false;
140
  this.max_selected_options = this.options.max_selected_options || Infinity;
141
  this.inherit_select_classes = this.options.inherit_select_classes || false;
142
  this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
143
+ this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
144
+ this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
145
+ this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
146
+ this.case_sensitive_search = this.options.case_sensitive_search || false;
147
+ return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;
148
  };
149
 
150
  AbstractChosen.prototype.set_default_text = function() {
155
  } else {
156
  this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
157
  }
158
+ this.default_text = this.escape_html(this.default_text);
159
  return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
160
  };
161
 
162
+ AbstractChosen.prototype.choice_label = function(item) {
163
+ if (this.include_group_label_in_selected && (item.group_label != null)) {
164
+ return "<b class='group-name'>" + (this.escape_html(item.group_label)) + "</b>" + item.html;
165
+ } else {
166
+ return item.html;
167
+ }
168
+ };
169
+
170
  AbstractChosen.prototype.mouse_enter = function() {
171
  return this.mouse_on_container = true;
172
  };
176
  };
177
 
178
  AbstractChosen.prototype.input_focus = function(evt) {
 
179
  if (this.is_multiple) {
180
  if (!this.active_field) {
181
+ return setTimeout(((function(_this) {
182
+ return function() {
183
+ return _this.container_mousedown();
184
+ };
185
+ })(this)), 50);
186
  }
187
  } else {
188
  if (!this.active_field) {
192
  };
193
 
194
  AbstractChosen.prototype.input_blur = function(evt) {
 
195
  if (!this.mouse_on_container) {
196
  this.active_field = false;
197
+ return setTimeout(((function(_this) {
198
+ return function() {
199
+ return _this.blur_test();
200
+ };
201
+ })(this)), 100);
202
+ }
203
+ };
204
+
205
+ AbstractChosen.prototype.label_click_handler = function(evt) {
206
+ if (this.is_multiple) {
207
+ return this.container_mousedown(evt);
208
+ } else {
209
+ return this.activate_field();
210
  }
211
  };
212
 
213
  AbstractChosen.prototype.results_option_build = function(options) {
214
+ var content, data, data_content, i, len, ref, shown_results;
215
  content = '';
216
+ shown_results = 0;
217
+ ref = this.results_data;
218
+ for (i = 0, len = ref.length; i < len; i++) {
219
+ data = ref[i];
220
+ data_content = '';
221
  if (data.group) {
222
+ data_content = this.result_add_group(data);
223
  } else {
224
+ data_content = this.result_add_option(data);
225
+ }
226
+ if (data_content !== '') {
227
+ shown_results++;
228
+ content += data_content;
229
  }
230
  if (options != null ? options.first : void 0) {
231
  if (data.selected && this.is_multiple) {
232
  this.choice_build(data);
233
  } else if (data.selected && !this.is_multiple) {
234
+ this.single_set_selected_text(this.choice_label(data));
235
  }
236
  }
237
+ if (shown_results >= this.max_shown_results) {
238
+ break;
239
+ }
240
  }
241
  return content;
242
  };
267
  }
268
  option_el = document.createElement("li");
269
  option_el.className = classes.join(" ");
270
+ if (option.style) {
271
+ option_el.style.cssText = option.style;
272
+ }
273
  option_el.setAttribute("data-option-array-index", option.array_index);
274
+ option_el.innerHTML = option.highlighted_html || option.html;
275
+ if (option.title) {
276
+ option_el.title = option.title;
277
+ }
278
  return this.outerHTML(option_el);
279
  };
280
 
281
  AbstractChosen.prototype.result_add_group = function(group) {
282
+ var classes, group_el;
283
  if (!(group.search_match || group.group_match)) {
284
  return '';
285
  }
286
  if (!(group.active_options > 0)) {
287
  return '';
288
  }
289
+ classes = [];
290
+ classes.push("group-result");
291
+ if (group.classes) {
292
+ classes.push(group.classes);
293
+ }
294
  group_el = document.createElement("li");
295
+ group_el.className = classes.join(" ");
296
+ group_el.innerHTML = group.highlighted_html || this.escape_html(group.label);
297
+ if (group.title) {
298
+ group_el.title = group.title;
299
+ }
300
  return this.outerHTML(group_el);
301
  };
302
 
313
  };
314
 
315
  AbstractChosen.prototype.reset_single_select_options = function() {
316
+ var i, len, ref, result, results1;
317
+ ref = this.results_data;
318
+ results1 = [];
319
+ for (i = 0, len = ref.length; i < len; i++) {
320
+ result = ref[i];
321
  if (result.selected) {
322
+ results1.push(result.selected = false);
323
  } else {
324
+ results1.push(void 0);
325
  }
326
  }
327
+ return results1;
328
  };
329
 
330
  AbstractChosen.prototype.results_toggle = function() {
343
  }
344
  };
345
 
346
+ AbstractChosen.prototype.winnow_results = function(options) {
347
+ var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;
348
  this.no_results_clear();
349
  results = 0;
350
+ query = this.get_search_text();
351
+ escapedQuery = query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
352
+ regex = this.get_search_regex(escapedQuery);
353
+ ref = this.results_data;
354
+ for (i = 0, len = ref.length; i < len; i++) {
355
+ option = ref[i];
 
 
356
  option.search_match = false;
357
  results_group = null;
358
+ search_match = null;
359
+ option.highlighted_html = '';
360
  if (this.include_option_in_results(option)) {
361
  if (option.group) {
362
  option.group_match = false;
369
  }
370
  results_group.active_options += 1;
371
  }
372
+ text = option.group ? option.label : option.text;
373
  if (!(option.group && !this.group_search)) {
374
+ search_match = this.search_string_match(text, regex);
375
+ option.search_match = search_match != null;
376
  if (option.search_match && !option.group) {
377
  results += 1;
378
  }
379
  if (option.search_match) {
380
+ if (query.length) {
381
+ startpos = search_match.index;
382
+ prefix = text.slice(0, startpos);
383
+ fix = text.slice(startpos, startpos + query.length);
384
+ suffix = text.slice(startpos + query.length);
385
+ option.highlighted_html = (this.escape_html(prefix)) + "<em>" + (this.escape_html(fix)) + "</em>" + (this.escape_html(suffix));
386
  }
387
  if (results_group != null) {
388
  results_group.group_match = true;
394
  }
395
  }
396
  this.result_clear_highlight();
397
+ if (results < 1 && query.length) {
398
  this.update_results_content("");
399
+ return this.no_results(query);
400
  } else {
401
  this.update_results_content(this.results_option_build());
402
+ if (!(options != null ? options.skip_highlight : void 0)) {
403
+ return this.winnow_results_set_highlight();
404
+ }
405
+ }
406
+ };
407
+
408
+ AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
409
+ var regex_flag, regex_string;
410
+ regex_string = this.search_contains ? escaped_search_string : "(^|\\s|\\b)" + escaped_search_string + "[^\\s]*";
411
+ if (!(this.enable_split_word_search || this.search_contains)) {
412
+ regex_string = "^" + regex_string;
413
  }
414
+ regex_flag = this.case_sensitive_search ? "" : "i";
415
+ return new RegExp(regex_string, regex_flag);
416
  };
417
 
418
  AbstractChosen.prototype.search_string_match = function(search_string, regex) {
419
+ var match;
420
+ match = regex.exec(search_string);
421
+ if (!this.search_contains && (match != null ? match[1] : void 0)) {
422
+ match.index += 1;
 
 
 
 
 
 
 
 
 
423
  }
424
+ return match;
425
  };
426
 
427
  AbstractChosen.prototype.choices_count = function() {
428
+ var i, len, option, ref;
429
  if (this.selected_option_count != null) {
430
  return this.selected_option_count;
431
  }
432
  this.selected_option_count = 0;
433
+ ref = this.form_field.options;
434
+ for (i = 0, len = ref.length; i < len; i++) {
435
+ option = ref[i];
436
  if (option.selected) {
437
  this.selected_option_count += 1;
438
  }
442
 
443
  AbstractChosen.prototype.choices_click = function(evt) {
444
  evt.preventDefault();
445
+ this.activate_field();
446
  if (!(this.results_showing || this.is_disabled)) {
447
  return this.results_show();
448
  }
449
  };
450
 
451
+ AbstractChosen.prototype.keydown_checker = function(evt) {
452
+ var ref, stroke;
453
+ stroke = (ref = evt.which) != null ? ref : evt.keyCode;
454
+ this.search_field_scale();
455
+ if (stroke !== 8 && this.pending_backstroke) {
456
+ this.clear_backstroke();
457
+ }
458
+ switch (stroke) {
459
+ case 8:
460
+ this.backstroke_length = this.get_search_field_value().length;
461
+ break;
462
+ case 9:
463
+ if (this.results_showing && !this.is_multiple) {
464
+ this.result_select(evt);
465
+ }
466
+ this.mouse_on_container = false;
467
+ break;
468
+ case 13:
469
+ if (this.results_showing) {
470
+ evt.preventDefault();
471
+ }
472
+ break;
473
+ case 27:
474
+ if (this.results_showing) {
475
+ evt.preventDefault();
476
+ }
477
+ break;
478
+ case 32:
479
+ if (this.disable_search) {
480
+ evt.preventDefault();
481
+ }
482
+ break;
483
+ case 38:
484
+ evt.preventDefault();
485
+ this.keyup_arrow();
486
+ break;
487
+ case 40:
488
+ evt.preventDefault();
489
+ this.keydown_arrow();
490
+ break;
491
+ }
492
+ };
493
+
494
  AbstractChosen.prototype.keyup_checker = function(evt) {
495
+ var ref, stroke;
496
+ stroke = (ref = evt.which) != null ? ref : evt.keyCode;
497
  this.search_field_scale();
498
  switch (stroke) {
499
  case 8:
500
  if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
501
+ this.keydown_backstroke();
502
  } else if (!this.pending_backstroke) {
503
  this.result_clear_highlight();
504
+ this.results_search();
505
  }
506
  break;
507
  case 13:
508
  evt.preventDefault();
509
  if (this.results_showing) {
510
+ this.result_select(evt);
511
  }
512
  break;
513
  case 27:
514
  if (this.results_showing) {
515
  this.results_hide();
516
  }
517
+ break;
518
  case 9:
519
+ case 16:
520
+ case 17:
521
+ case 18:
522
  case 38:
523
  case 40:
 
524
  case 91:
 
525
  break;
526
  default:
527
+ this.results_search();
528
+ break;
529
  }
530
  };
531
 
532
  AbstractChosen.prototype.clipboard_event_checker = function(evt) {
533
+ if (this.is_disabled) {
534
+ return;
535
+ }
536
+ return setTimeout(((function(_this) {
537
+ return function() {
538
+ return _this.results_search();
539
+ };
540
+ })(this)), 50);
541
  };
542
 
543
  AbstractChosen.prototype.container_width = function() {
544
  if (this.options.width != null) {
545
  return this.options.width;
546
  } else {
547
+ return this.form_field.offsetWidth + "px";
548
  }
549
  };
550
 
587
  return tmp.innerHTML;
588
  };
589
 
590
+ AbstractChosen.prototype.get_single_html = function() {
591
+ return "<a class=\"chosen-single chosen-default\">\n <span>" + this.default_text + "</span>\n <div><b></b></div>\n</a>\n<div class=\"chosen-drop\">\n <div class=\"chosen-search\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" />\n </div>\n <ul class=\"chosen-results\"></ul>\n</div>";
592
+ };
593
+
594
+ AbstractChosen.prototype.get_multi_html = function() {
595
+ return "<ul class=\"chosen-choices\">\n <li class=\"search-field\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" value=\"" + this.default_text + "\" />\n </li>\n</ul>\n<div class=\"chosen-drop\">\n <ul class=\"chosen-results\"></ul>\n</div>";
596
+ };
597
+
598
+ AbstractChosen.prototype.get_no_results_html = function(terms) {
599
+ return "<li class=\"no-results\">\n " + this.results_none_found + " <span>" + (this.escape_html(terms)) + "</span>\n</li>";
600
+ };
601
+
602
  AbstractChosen.browser_is_supported = function() {
603
+ if ("Microsoft Internet Explorer" === window.navigator.appName) {
604
  return document.documentMode >= 8;
605
  }
606
+ if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {
607
  return false;
608
  }
 
 
 
 
 
609
  return true;
610
  };
611
 
630
  var $this, chosen;
631
  $this = $(this);
632
  chosen = $this.data('chosen');
633
+ if (options === 'destroy') {
634
+ if (chosen instanceof Chosen) {
635
+ chosen.destroy();
636
+ }
637
+ return;
638
+ }
639
+ if (!(chosen instanceof Chosen)) {
640
  $this.data('chosen', new Chosen(this, options));
641
  }
642
  });
643
  }
644
  });
645
 
646
+ Chosen = (function(superClass) {
647
+ extend(Chosen, superClass);
648
 
649
  function Chosen() {
650
+ return Chosen.__super__.constructor.apply(this, arguments);
 
651
  }
652
 
653
  Chosen.prototype.setup = function() {
654
  this.form_field_jq = $(this.form_field);
655
+ return this.current_selectedIndex = this.form_field.selectedIndex;
 
656
  };
657
 
658
  Chosen.prototype.set_up_html = function() {
667
  }
668
  container_props = {
669
  'class': container_classes.join(' '),
 
670
  'title': this.form_field.title
671
  };
672
  if (this.form_field.id.length) {
673
  container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
674
  }
675
  this.container = $("<div />", container_props);
676
+ this.container.width(this.container_width());
677
  if (this.is_multiple) {
678
+ this.container.html(this.get_multi_html());
679
  } else {
680
+ this.container.html(this.get_single_html());
681
  }
682
  this.form_field_jq.hide().after(this.container);
683
  this.dropdown = this.container.find('div.chosen-drop').first();
694
  }
695
  this.results_build();
696
  this.set_tab_index();
697
+ return this.set_label_behavior();
698
+ };
699
+
700
+ Chosen.prototype.on_ready = function() {
701
  return this.form_field_jq.trigger("chosen:ready", {
702
  chosen: this
703
  });
704
  };
705
 
706
  Chosen.prototype.register_observers = function() {
707
+ this.container.on('touchstart.chosen', (function(_this) {
708
+ return function(evt) {
709
+ _this.container_mousedown(evt);
710
+ };
711
+ })(this));
712
+ this.container.on('touchend.chosen', (function(_this) {
713
+ return function(evt) {
714
+ _this.container_mouseup(evt);
715
+ };
716
+ })(this));
717
+ this.container.on('mousedown.chosen', (function(_this) {
718
+ return function(evt) {
719
+ _this.container_mousedown(evt);
720
+ };
721
+ })(this));
722
+ this.container.on('mouseup.chosen', (function(_this) {
723
+ return function(evt) {
724
+ _this.container_mouseup(evt);
725
+ };
726
+ })(this));
727
+ this.container.on('mouseenter.chosen', (function(_this) {
728
+ return function(evt) {
729
+ _this.mouse_enter(evt);
730
+ };
731
+ })(this));
732
+ this.container.on('mouseleave.chosen', (function(_this) {
733
+ return function(evt) {
734
+ _this.mouse_leave(evt);
735
+ };
736
+ })(this));
737
+ this.search_results.on('mouseup.chosen', (function(_this) {
738
+ return function(evt) {
739
+ _this.search_results_mouseup(evt);
740
+ };
741
+ })(this));
742
+ this.search_results.on('mouseover.chosen', (function(_this) {
743
+ return function(evt) {
744
+ _this.search_results_mouseover(evt);
745
+ };
746
+ })(this));
747
+ this.search_results.on('mouseout.chosen', (function(_this) {
748
+ return function(evt) {
749
+ _this.search_results_mouseout(evt);
750
+ };
751
+ })(this));
752
+ this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen', (function(_this) {
753
+ return function(evt) {
754
+ _this.search_results_mousewheel(evt);
755
+ };
756
+ })(this));
757
+ this.search_results.on('touchstart.chosen', (function(_this) {
758
+ return function(evt) {
759
+ _this.search_results_touchstart(evt);
760
+ };
761
+ })(this));
762
+ this.search_results.on('touchmove.chosen', (function(_this) {
763
+ return function(evt) {
764
+ _this.search_results_touchmove(evt);
765
+ };
766
+ })(this));
767
+ this.search_results.on('touchend.chosen', (function(_this) {
768
+ return function(evt) {
769
+ _this.search_results_touchend(evt);
770
+ };
771
+ })(this));
772
+ this.form_field_jq.on("chosen:updated.chosen", (function(_this) {
773
+ return function(evt) {
774
+ _this.results_update_field(evt);
775
+ };
776
+ })(this));
777
+ this.form_field_jq.on("chosen:activate.chosen", (function(_this) {
778
+ return function(evt) {
779
+ _this.activate_field(evt);
780
+ };
781
+ })(this));
782
+ this.form_field_jq.on("chosen:open.chosen", (function(_this) {
783
+ return function(evt) {
784
+ _this.container_mousedown(evt);
785
+ };
786
+ })(this));
787
+ this.form_field_jq.on("chosen:close.chosen", (function(_this) {
788
+ return function(evt) {
789
+ _this.close_field(evt);
790
+ };
791
+ })(this));
792
+ this.search_field.on('blur.chosen', (function(_this) {
793
+ return function(evt) {
794
+ _this.input_blur(evt);
795
+ };
796
+ })(this));
797
+ this.search_field.on('keyup.chosen', (function(_this) {
798
+ return function(evt) {
799
+ _this.keyup_checker(evt);
800
+ };
801
+ })(this));
802
+ this.search_field.on('keydown.chosen', (function(_this) {
803
+ return function(evt) {
804
+ _this.keydown_checker(evt);
805
+ };
806
+ })(this));
807
+ this.search_field.on('focus.chosen', (function(_this) {
808
+ return function(evt) {
809
+ _this.input_focus(evt);
810
+ };
811
+ })(this));
812
+ this.search_field.on('cut.chosen', (function(_this) {
813
+ return function(evt) {
814
+ _this.clipboard_event_checker(evt);
815
+ };
816
+ })(this));
817
+ this.search_field.on('paste.chosen', (function(_this) {
818
+ return function(evt) {
819
+ _this.clipboard_event_checker(evt);
820
+ };
821
+ })(this));
822
  if (this.is_multiple) {
823
+ return this.search_choices.on('click.chosen', (function(_this) {
824
+ return function(evt) {
825
+ _this.choices_click(evt);
826
+ };
827
+ })(this));
828
  } else {
829
+ return this.container.on('click.chosen', function(evt) {
830
  evt.preventDefault();
831
  });
832
  }
833
  };
834
 
835
  Chosen.prototype.destroy = function() {
836
+ $(this.container[0].ownerDocument).off('click.chosen', this.click_test_action);
837
+ if (this.form_field_label.length > 0) {
838
+ this.form_field_label.off('click.chosen');
839
+ }
840
  if (this.search_field[0].tabIndex) {
841
  this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
842
  }
846
  };
847
 
848
  Chosen.prototype.search_field_disabled = function() {
849
+ this.is_disabled = this.form_field.disabled || this.form_field_jq.parents('fieldset').is(':disabled');
850
+ this.container.toggleClass('chosen-disabled', this.is_disabled);
851
+ this.search_field[0].disabled = this.is_disabled;
852
+ if (!this.is_multiple) {
853
+ this.selected_item.off('focus.chosen', this.activate_field);
854
+ }
855
  if (this.is_disabled) {
 
 
 
 
 
856
  return this.close_field();
857
+ } else if (!this.is_multiple) {
858
+ return this.selected_item.on('focus.chosen', this.activate_field);
 
 
 
 
859
  }
860
  };
861
 
862
  Chosen.prototype.container_mousedown = function(evt) {
863
+ var ref;
864
+ if (this.is_disabled) {
865
+ return;
866
+ }
867
+ if (evt && ((ref = evt.type) === 'mousedown' || ref === 'touchstart') && !this.results_showing) {
868
+ evt.preventDefault();
869
+ }
870
+ if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
871
+ if (!this.active_field) {
872
+ if (this.is_multiple) {
873
+ this.search_field.val("");
 
 
 
874
  }
875
+ $(this.container[0].ownerDocument).on('click.chosen', this.click_test_action);
876
+ this.results_show();
877
+ } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
878
+ evt.preventDefault();
879
+ this.results_toggle();
880
  }
881
+ return this.activate_field();
882
  }
883
  };
884
 
891
  Chosen.prototype.search_results_mousewheel = function(evt) {
892
  var delta;
893
  if (evt.originalEvent) {
894
+ delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
895
  }
896
  if (delta != null) {
897
  evt.preventDefault();
909
  };
910
 
911
  Chosen.prototype.close_field = function() {
912
+ $(this.container[0].ownerDocument).off("click.chosen", this.click_test_action);
913
  this.active_field = false;
914
  this.results_hide();
915
  this.container.removeClass("chosen-container-active");
916
  this.clear_backstroke();
917
  this.show_search_field_default();
918
+ this.search_field_scale();
919
+ return this.search_field.blur();
920
  };
921
 
922
  Chosen.prototype.activate_field = function() {
923
+ if (this.is_disabled) {
924
+ return;
925
+ }
926
  this.container.addClass("chosen-container-active");
927
  this.active_field = true;
928
  this.search_field.val(this.search_field.val());
945
  this.results_data = SelectParser.select_to_array(this.form_field);
946
  if (this.is_multiple) {
947
  this.search_choices.find("li.search-choice").remove();
948
+ } else {
949
  this.single_set_selected_text();
950
  if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
951
  this.search_field[0].readOnly = true;
1000
  this.container.addClass("chosen-with-drop");
1001
  this.results_showing = true;
1002
  this.search_field.focus();
1003
+ this.search_field.val(this.get_search_field_value());
1004
  this.winnow_results();
1005
  return this.form_field_jq.trigger("chosen:showing_dropdown", {
1006
  chosen: this
1032
  };
1033
 
1034
  Chosen.prototype.set_label_behavior = function() {
 
1035
  this.form_field_label = this.form_field_jq.parents("label");
1036
  if (!this.form_field_label.length && this.form_field.id.length) {
1037
  this.form_field_label = $("label[for='" + this.form_field.id + "']");
1038
  }
1039
  if (this.form_field_label.length > 0) {
1040
+ return this.form_field_label.on('click.chosen', this.label_click_handler);
 
 
 
 
 
 
1041
  }
1042
  };
1043
 
1070
  };
1071
 
1072
  Chosen.prototype.search_results_mouseout = function(evt) {
1073
+ if ($(evt.target).hasClass("active-result") || $(evt.target).parents('.active-result').first()) {
1074
  return this.result_clear_highlight();
1075
  }
1076
  };
1077
 
1078
  Chosen.prototype.choice_build = function(item) {
1079
+ var choice, close_link;
 
1080
  choice = $('<li />', {
1081
  "class": "search-choice"
1082
+ }).html("<span>" + (this.choice_label(item)) + "</span>");
1083
  if (item.disabled) {
1084
  choice.addClass('search-choice-disabled');
1085
  } else {
1087
  "class": 'search-choice-close',
1088
  'data-option-array-index': item.array_index
1089
  });
1090
+ close_link.on('click.chosen', (function(_this) {
1091
+ return function(evt) {
1092
+ return _this.choice_destroy_link_click(evt);
1093
+ };
1094
+ })(this));
1095
  choice.append(close_link);
1096
  }
1097
  return this.search_container.before(choice);
1107
 
1108
  Chosen.prototype.choice_destroy = function(link) {
1109
  if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
1110
+ if (this.active_field) {
1111
+ this.search_field.focus();
1112
+ } else {
1113
+ this.show_search_field_default();
1114
+ }
1115
+ if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {
1116
  this.results_hide();
1117
  }
1118
  link.parents('li').first().remove();
1126
  this.single_set_selected_text();
1127
  this.show_search_field_default();
1128
  this.results_reset_cleanup();
1129
+ this.trigger_form_field_change();
1130
  if (this.active_field) {
1131
  return this.results_hide();
1132
  }
1153
  } else {
1154
  this.reset_single_select_options();
1155
  }
1156
+ high.addClass("result-selected");
1157
  item = this.results_data[high[0].getAttribute("data-option-array-index")];
1158
  item.selected = true;
1159
  this.form_field.options[item.options_index].selected = true;
1161
  if (this.is_multiple) {
1162
  this.choice_build(item);
1163
  } else {
1164
+ this.single_set_selected_text(this.choice_label(item));
1165
  }
1166
+ if (this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey))) {
1167
+ if (evt.metaKey || evt.ctrlKey) {
1168
+ this.winnow_results({
1169
+ skip_highlight: true
1170
+ });
1171
+ } else {
1172
+ this.search_field.val("");
1173
+ this.winnow_results();
1174
+ }
1175
+ } else {
1176
  this.results_hide();
1177
+ this.show_search_field_default();
1178
  }
 
1179
  if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1180
+ this.trigger_form_field_change({
1181
+ selected: this.form_field.options[item.options_index].value
1182
  });
1183
  }
1184
  this.current_selectedIndex = this.form_field.selectedIndex;
1185
+ evt.preventDefault();
1186
  return this.search_field_scale();
1187
  }
1188
  };
1197
  this.single_deselect_control_build();
1198
  this.selected_item.removeClass("chosen-default");
1199
  }
1200
+ return this.selected_item.find("span").html(text);
1201
  };
1202
 
1203
  Chosen.prototype.result_deselect = function(pos) {
1211
  if (this.results_showing) {
1212
  this.winnow_results();
1213
  }
1214
+ this.trigger_form_field_change({
1215
  deselected: this.form_field.options[result_data.options_index].value
1216
  });
1217
  this.search_field_scale();
1231
  return this.selected_item.addClass("chosen-single-with-deselect");
1232
  };
1233
 
1234
+ Chosen.prototype.get_search_field_value = function() {
1235
+ return this.search_field.val();
1236
+ };
1237
+
1238
  Chosen.prototype.get_search_text = function() {
1239
+ return this.get_search_field_value().trim();
1240
+ };
1241
+
1242
+ Chosen.prototype.escape_html = function(text) {
1243
+ return $('<div/>').text(text).html();
1244
  };
1245
 
1246
  Chosen.prototype.winnow_results_set_highlight = function() {
1254
 
1255
  Chosen.prototype.no_results = function(terms) {
1256
  var no_results_html;
1257
+ no_results_html = this.get_no_results_html(terms);
 
1258
  this.search_results.append(no_results_html);
1259
  return this.form_field_jq.trigger("chosen:no_results", {
1260
  chosen: this
1319
  return this.pending_backstroke = null;
1320
  };
1321
 
1322
+ Chosen.prototype.search_field_scale = function() {
1323
+ var div, i, len, style, style_block, styles, width;
1324
+ if (!this.is_multiple) {
1325
+ return;
 
 
1326
  }
1327
+ style_block = {
1328
+ position: 'absolute',
1329
+ left: '-1000px',
1330
+ top: '-1000px',
1331
+ display: 'none',
1332
+ whiteSpace: 'pre'
1333
+ };
1334
+ styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];
1335
+ for (i = 0, len = styles.length; i < len; i++) {
1336
+ style = styles[i];
1337
+ style_block[style] = this.search_field.css(style);
1338
+ }
1339
+ div = $('<div />').css(style_block);
1340
+ div.text(this.get_search_field_value());
1341
+ $('body').append(div);
1342
+ width = div.width() + 25;
1343
+ div.remove();
1344
+ if (this.container.is(':visible')) {
1345
+ width = Math.min(this.container.outerWidth() - 10, width);
 
 
1346
  }
1347
+ return this.search_field.width(width);
1348
  };
1349
 
1350
+ Chosen.prototype.trigger_form_field_change = function(extra) {
1351
+ this.form_field_jq.trigger("input", extra);
1352
+ return this.form_field_jq.trigger("change", extra);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1353
  };
1354
 
1355
  return Chosen;
admin/assets/js/chosen/chosen.jquery.min.js CHANGED
@@ -1,2 +1,3 @@
1
- /* Chosen v1.1.0 | (c) 2011-2013 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
- !function(){var a,AbstractChosen,Chosen,SelectParser,b,c={}.hasOwnProperty,d=function(a,b){function d(){this.constructor=a}for(var e in b)c.call(b,e)&&(a[e]=b[e]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};SelectParser=function(){function SelectParser(){this.options_index=0,this.parsed=[]}return SelectParser.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},SelectParser.prototype.add_group=function(a){var b,c,d,e,f,g;for(b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:this.escapeExpression(a.label),children:0,disabled:a.disabled}),f=a.childNodes,g=[],d=0,e=f.length;e>d;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},SelectParser.prototype.add_option=function(a,b,c){return"OPTION"===a.nodeName.toUpperCase()?(""!==a.text?(null!=b&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1):void 0},SelectParser.prototype.escapeExpression=function(a){var b,c;return null==a||a===!1?"":/[\&\<\>\"\'\`]/.test(a)?(b={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},c=/&(?!\w+;)|[\<\>\"\'\`]/g,a.replace(c,function(a){return b[a]||"&amp;"})):a},SelectParser}(),SelectParser.select_to_array=function(a){var b,c,d,e,f;for(c=new SelectParser,f=a.childNodes,d=0,e=f.length;e>d;d++)b=f[d],c.add_node(b);return c.parsed},AbstractChosen=function(){function AbstractChosen(a,b){this.form_field=a,this.options=null!=b?b:{},AbstractChosen.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers())}return AbstractChosen.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null!=this.options.enable_split_word_search?this.options.enable_split_word_search:!0,this.group_search=null!=this.options.group_search?this.options.group_search:!0,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null!=this.options.single_backstroke_delete?this.options.single_backstroke_delete:!0,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null!=this.options.display_selected_options?this.options.display_selected_options:!0,this.display_disabled_options=null!=this.options.display_disabled_options?this.options.display_disabled_options:!0},AbstractChosen.prototype.set_default_text=function(){return this.default_text=this.form_field.getAttribute("data-placeholder")?this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.options.placeholder_text_multiple||this.options.placeholder_text||AbstractChosen.default_multiple_text:this.options.placeholder_text_single||this.options.placeholder_text||AbstractChosen.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||AbstractChosen.default_no_result_text},AbstractChosen.prototype.mouse_enter=function(){return this.mouse_on_container=!0},AbstractChosen.prototype.mouse_leave=function(){return this.mouse_on_container=!1},AbstractChosen.prototype.input_focus=function(){var a=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return a.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},AbstractChosen.prototype.input_blur=function(){var a=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return a.blur_test()},100))},AbstractChosen.prototype.results_option_build=function(a){var b,c,d,e,f;for(b="",f=this.results_data,d=0,e=f.length;e>d;d++)c=f[d],b+=c.group?this.result_add_group(c):this.result_add_option(c),(null!=a?a.first:void 0)&&(c.selected&&this.is_multiple?this.choice_build(c):c.selected&&!this.is_multiple&&this.single_set_selected_text(c.text));return b},AbstractChosen.prototype.result_add_option=function(a){var b,c;return a.search_match?this.include_option_in_results(a)?(b=[],a.disabled||a.selected&&this.is_multiple||b.push("active-result"),!a.disabled||a.selected&&this.is_multiple||b.push("disabled-result"),a.selected&&b.push("result-selected"),null!=a.group_array_index&&b.push("group-option"),""!==a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.style.cssText=a.style,c.setAttribute("data-option-array-index",a.array_index),c.innerHTML=a.search_text,this.outerHTML(c)):"":""},AbstractChosen.prototype.result_add_group=function(a){var b;return a.search_match||a.group_match?a.active_options>0?(b=document.createElement("li"),b.className="group-result",b.innerHTML=a.search_text,this.outerHTML(b)):"":""},AbstractChosen.prototype.results_update_field=function(){return this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing?this.winnow_results():void 0},AbstractChosen.prototype.reset_single_select_options=function(){var a,b,c,d,e;for(d=this.results_data,e=[],b=0,c=d.length;c>b;b++)a=d[b],a.selected?e.push(a.selected=!1):e.push(void 0);return e},AbstractChosen.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},AbstractChosen.prototype.results_search=function(){return this.results_showing?this.winnow_results():this.results_show()},AbstractChosen.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l,m;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.search_contains?"":"^",c=new RegExp(d+a,"i"),j=new RegExp(a,"i"),m=this.results_data,k=0,l=m.length;l>k;k++)b=m[k],b.search_match=!1,f=null,this.include_option_in_results(b)&&(b.group&&(b.group_match=!1,b.active_options=0),null!=b.group_array_index&&this.results_data[b.group_array_index]&&(f=this.results_data[b.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),(!b.group||this.group_search)&&(b.search_text=b.group?b.label:b.html,b.search_match=this.search_string_match(b.search_text,c),b.search_match&&!b.group&&(e+=1),b.search_match?(g.length&&(h=b.search_text.search(j),i=b.search_text.substr(0,h+g.length)+"</em>"+b.search_text.substr(h+g.length),b.search_text=i.substr(0,h)+"<em>"+i.substr(h)),null!=f&&(f.group_match=!0)):null!=b.group_array_index&&this.results_data[b.group_array_index].search_match&&(b.search_match=!0)));return this.result_clear_highlight(),1>e&&g.length?(this.update_results_content(""),this.no_results(g)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight())},AbstractChosen.prototype.search_string_match=function(a,b){var c,d,e,f;if(b.test(a))return!0;if(this.enable_split_word_search&&(a.indexOf(" ")>=0||0===a.indexOf("["))&&(d=a.replace(/\[|\]/g,"").split(" "),d.length))for(e=0,f=d.length;f>e;e++)if(c=d[e],b.test(c))return!0},AbstractChosen.prototype.choices_count=function(){var a,b,c,d;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,d=this.form_field.options,b=0,c=d.length;c>b;b++)a=d[b],a.selected&&(this.selected_option_count+=1);return this.selected_option_count},AbstractChosen.prototype.choices_click=function(a){return a.preventDefault(),this.results_showing||this.is_disabled?void 0:this.results_show()},AbstractChosen.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(a.preventDefault(),this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},AbstractChosen.prototype.clipboard_event_checker=function(){var a=this;return setTimeout(function(){return a.results_search()},50)},AbstractChosen.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},AbstractChosen.prototype.include_option_in_results=function(a){return this.is_multiple&&!this.display_selected_options&&a.selected?!1:!this.display_disabled_options&&a.disabled?!1:a.empty?!1:!0},AbstractChosen.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},AbstractChosen.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},AbstractChosen.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},AbstractChosen.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},AbstractChosen.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:/iP(od|hone)/i.test(window.navigator.userAgent)?!1:/Android/i.test(window.navigator.userAgent)&&/Mobile/i.test(window.navigator.userAgent)?!1:!0},AbstractChosen.default_multiple_text="Select Some Options",AbstractChosen.default_single_text="Select an Option",AbstractChosen.default_no_result_text="No results match",AbstractChosen}(),a=jQuery,a.fn.extend({chosen:function(b){return AbstractChosen.browser_is_supported()?this.each(function(){var c,d;c=a(this),d=c.data("chosen"),"destroy"===b&&d?d.destroy():d||c.data("chosen",new Chosen(this,b))}):this}}),Chosen=function(c){function Chosen(){return b=Chosen.__super__.constructor.apply(this,arguments)}return d(Chosen,c),Chosen.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},Chosen.prototype.set_up_html=function(){var b,c;return b=["chosen-container"],b.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&b.push(this.form_field.className),this.is_rtl&&b.push("chosen-rtl"),c={"class":b.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(c.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=a("<div />",c),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>'),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},Chosen.prototype.register_observers=function(){var a=this;return this.container.bind("mousedown.chosen",function(b){a.container_mousedown(b)}),this.container.bind("mouseup.chosen",function(b){a.container_mouseup(b)}),this.container.bind("mouseenter.chosen",function(b){a.mouse_enter(b)}),this.container.bind("mouseleave.chosen",function(b){a.mouse_leave(b)}),this.search_results.bind("mouseup.chosen",function(b){a.search_results_mouseup(b)}),this.search_results.bind("mouseover.chosen",function(b){a.search_results_mouseover(b)}),this.search_results.bind("mouseout.chosen",function(b){a.search_results_mouseout(b)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(b){a.search_results_mousewheel(b)}),this.search_results.bind("touchstart.chosen",function(b){a.search_results_touchstart(b)}),this.search_results.bind("touchmove.chosen",function(b){a.search_results_touchmove(b)}),this.search_results.bind("touchend.chosen",function(b){a.search_results_touchend(b)}),this.form_field_jq.bind("chosen:updated.chosen",function(b){a.results_update_field(b)}),this.form_field_jq.bind("chosen:activate.chosen",function(b){a.activate_field(b)}),this.form_field_jq.bind("chosen:open.chosen",function(b){a.container_mousedown(b)}),this.form_field_jq.bind("chosen:close.chosen",function(b){a.input_blur(b)}),this.search_field.bind("blur.chosen",function(b){a.input_blur(b)}),this.search_field.bind("keyup.chosen",function(b){a.keyup_checker(b)}),this.search_field.bind("keydown.chosen",function(b){a.keydown_checker(b)}),this.search_field.bind("focus.chosen",function(b){a.input_focus(b)}),this.search_field.bind("cut.chosen",function(b){a.clipboard_event_checker(b)}),this.search_field.bind("paste.chosen",function(b){a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.bind("click.chosen",function(b){a.choices_click(b)}):this.container.bind("click.chosen",function(a){a.preventDefault()})},Chosen.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},Chosen.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},Chosen.prototype.container_mousedown=function(b){return this.is_disabled||(b&&"mousedown"===b.type&&!this.results_showing&&b.preventDefault(),null!=b&&a(b.target).hasClass("search-choice-close"))?void 0:(this.active_field?this.is_multiple||!b||a(b.target)[0]!==this.selected_item[0]&&!a(b.target).parents("a.chosen-single").length||(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},Chosen.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},Chosen.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=-a.originalEvent.wheelDelta||a.originalEvent.detail),null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop(b+this.search_results.scrollTop())):void 0},Chosen.prototype.blur_test=function(){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},Chosen.prototype.close_field=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},Chosen.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},Chosen.prototype.test_active_click=function(b){var c;return c=a(b.target).closest(".chosen-container"),c.length&&this.container[0]===c[0]?this.active_field=!0:this.close_field()},Chosen.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=SelectParser.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},Chosen.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){if(this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight(),b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(f>c)return this.search_results.scrollTop(c)}},Chosen.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},Chosen.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},Chosen.prototype.update_results_content=function(a){return this.search_results.html(a)},Chosen.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},Chosen.prototype.set_tab_index=function(){var a;return this.form_field.tabIndex?(a=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=a):void 0},Chosen.prototype.set_label_behavior=function(){var b=this;return this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=a("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0?this.form_field_label.bind("click.chosen",function(a){return b.is_multiple?b.container_mousedown(a):b.activate_field()}):void 0},Chosen.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},Chosen.prototype.search_results_mouseup=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c.length?(this.result_highlight=c,this.result_select(b),this.search_field.focus()):void 0},Chosen.prototype.search_results_mouseover=function(b){var c;return c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first(),c?this.result_do_highlight(c):void 0},Chosen.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},Chosen.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+b.html+"</span>"),b.disabled?c.addClass("search-choice-disabled"):(d=a("<a />",{"class":"search-choice-close","data-option-array-index":b.array_index}),d.bind("click.chosen",function(a){return e.choice_destroy_link_click(a)}),c.append(d)),this.search_container.before(c)},Chosen.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},Chosen.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),a.parents("li").first().remove(),this.search_field_scale()):void 0},Chosen.prototype.results_reset=function(){return this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.form_field_jq.trigger("change"),this.active_field?this.results_hide():void 0},Chosen.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},Chosen.prototype.result_select=function(a){var b,c;return this.result_highlight?(b=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClass("active-result"):this.reset_single_select_options(),c=this.results_data[b[0].getAttribute("data-option-array-index")],c.selected=!0,this.form_field.options[c.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(c):this.single_set_selected_text(c.text),(a.metaKey||a.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.form_field_jq.trigger("change",{selected:this.form_field.options[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())):void 0},Chosen.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").text(a)},Chosen.prototype.result_deselect=function(a){var b;return b=this.results_data[a],this.form_field.options[b.options_index].disabled?!1:(b.selected=!1,this.form_field.options[b.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},Chosen.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")):void 0},Chosen.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html()},Chosen.prototype.winnow_results_set_highlight=function(){var a,b;return b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first(),null!=a?this.result_do_highlight(a):void 0},Chosen.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},Chosen.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},Chosen.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(a):void 0:this.results_show()},Chosen.prototype.keyup_arrow=function(){var a;return this.results_showing||this.is_multiple?this.result_highlight?(a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},Chosen.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(a=this.search_container.siblings("li.search-choice").last(),a.length&&!a.hasClass("search-choice-disabled")?(this.pending_backstroke=a,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},Chosen.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},Chosen.prototype.keydown_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),8!==b&&this.pending_backstroke&&this.clear_backstroke(),b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},Chosen.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){for(d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],i=0,j=g.length;j>i;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return b=a("<div />",{style:f}),b.text(this.search_field.val()),a("body").append(b),h=b.width()+25,b.remove(),c=this.container.outerWidth(),h>c-10&&(h=c-10),this.search_field.css({width:h+"px"})}},Chosen}(AbstractChosen)}.call(this);
 
1
+ /* Chosen v1.8.7 | (c) 2011-2018 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
+
3
+ (function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},o={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s<i;s++)n=r[s],o.push(this.add_option(n,e,t.disabled));return o},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,title:t.title?t.title:void 0,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,group_label:null!=e?this.parsed[e].label:null,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(t){var e,s,n,r,o;for(r=new i,s=0,n=(o=t.childNodes).length;s<n;s++)e=o[s],r.add_node(e);return r.parsed},e=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},this.label_click_handler=n(this.label_click_handler,this),t.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return t.prototype.set_default_values=function(){return this.click_test_action=function(t){return function(e){return t.test_active_click(e)}}(this),this.activate_action=function(t){return function(e){return t.activate_field(e)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},t.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.choice_label=function(t){return this.include_group_label_in_selected&&null!=t.group_label?"<b class='group-name'>"+this.escape_html(t.group_label)+"</b>"+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n<r&&(s=o[n],i="",""!==(i=s.group?this.result_add_group(s):this.result_add_option(s))&&(h++,e+=i),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(h>=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t<e;t++)(i=s[t]).selected?n.push(i.selected=!1):n.push(void 0);return n},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.winnow_results=function(t){var e,s,i,n,r,o,h,l,c,_,a,u,d,p,f;for(this.no_results_clear(),_=0,e=(h=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(e),i=0,n=(l=this.results_data).length;i<n;i++)(r=l[i]).search_match=!1,a=null,u=null,r.highlighted_html="",this.include_option_in_results(r)&&(r.group&&(r.group_match=!1,r.active_options=0),null!=r.group_array_index&&this.results_data[r.group_array_index]&&(0===(a=this.results_data[r.group_array_index]).active_options&&a.search_match&&(_+=1),a.active_options+=1),f=r.group?r.label:r.text,r.group&&!this.group_search||(u=this.search_string_match(f,c),r.search_match=null!=u,r.search_match&&!r.group&&(_+=1),r.search_match?(h.length&&(d=u.index,o=f.slice(0,d),s=f.slice(d,d+h.length),p=f.slice(d+h.length),r.highlighted_html=this.escape_html(o)+"<em>"+this.escape_html(s)+"</em>"+this.escape_html(p)),null!=a&&(a.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),_<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},t.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&t.preventDefault();break;case 32:this.disable_search&&t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},t.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){if(!this.is_disabled)return setTimeout(function(t){return function(){return t.results_search()}}(this),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},t.prototype.get_no_results_html=function(t){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(t)+"</span>\n</li>"},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),s={"class":e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("touchend.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mousedown.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("mouseup.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mouseenter.chosen",function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.on("mouseleave.chosen",function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.on("mouseup.chosen",function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.on("mouseover.chosen",function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.on("mouseout.chosen",function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.search_results.on("touchstart.chosen",function(t){return function(e){t.search_results_touchstart(e)}}(this)),this.search_results.on("touchmove.chosen",function(t){return function(e){t.search_results_touchmove(e)}}(this)),this.search_results.on("touchend.chosen",function(t){return function(e){t.search_results_touchend(e)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(t){return function(e){t.close_field(e)}}(this)),this.search_field.on("blur.chosen",function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.on("keyup.chosen",function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.on("keydown.chosen",function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.on("focus.chosen",function(t){return function(e){t.input_focus(e)}}(this)),this.search_field.on("cut.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.search_field.on("paste.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(t){return function(e){t.choices_click(e)}}(this)):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chosen-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chosen-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),r=this.search_results.scrollTop(),n=i+r,s=this.result_highlight.position().top+this.search_results.scrollTop(),(e=s+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<r)return this.search_results.scrollTop(s)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(t){return this.search_results.html(t)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chosen-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},n.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i;return s=t("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(e)+"</span>"),e.disabled?s.addClass("search-choice-disabled"):((i=t("<a />",{"class":"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return this.get_search_field_value().trim()},n.prototype.escape_html=function(e){return t("<div/>").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(t=e.length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s<i;s++)r[n=o[s]]=this.search_field.css(n);return(e=t("<div />").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}).call(this);
admin/assets/js/chosen/chosen.min.css CHANGED
@@ -1,3 +1,11 @@
1
- /* Chosen v1.1.0 | (c) 2011-2013 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
 
 
2
 
3
- .chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;zoom:1;*display:inline;-webkit-user-select:none;-moz-user-select:none;user-select:none}.chosen-container .chosen-drop{position:absolute;top:100%;left:-9999px;z-index:1010;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;width:100%;border:1px solid #aaa;border-top:0;background:#fff;box-shadow:0 4px 5px rgba(0,0,0,.15)}.chosen-container.chosen-with-drop .chosen-drop{left:0}.chosen-container a{cursor:pointer}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:23px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),color-stop(100%,#f4f4f4));background:-webkit-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-moz-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:-o-linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background:linear-gradient(top,#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:#fff url(chosen-sprite.png) no-repeat 100% -20px;background:url(chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;left:-9999px}.chosen-container .chosen-results{position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:-webkit-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-moz-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:-o-linear-gradient(#3875d7 20%,#2a62bc 90%);background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;margin:0;padding:0;width:100%;height:auto!important;height:1%;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(1%,#eee),color-stop(15%,#fff));background-image:-webkit-linear-gradient(#eee 1%,#fff 15%);background-image:-moz-linear-gradient(#eee 1%,#fff 15%);background-image:-o-linear-gradient(#eee 1%,#fff 15%);background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:5px;height:15px;outline:0;border:0!important;background:transparent!important;box-shadow:none;color:#666;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-multi .chosen-choices li.search-field .default{color:#999}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 0 3px 5px;padding:3px 20px 3px 5px;border:1px solid #aaa;border-radius:3px;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-clip:padding-box;box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),color-stop(100%,#eee));background-image:-webkit-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-moz-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:-o-linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-image:linear-gradient(top,#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;-moz-border-radius-bottomright:0;border-bottom-right-radius:0;-moz-border-radius-bottomleft:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,50% 0,50% 100%,color-stop(20%,#eee),color-stop(80%,#fff));background-image:-webkit-linear-gradient(#eee 20%,#fff 80%);background-image:-moz-linear-gradient(#eee 20%,#fff 80%);background-image:-o-linear-gradient(#eee 20%,#fff 80%);background-image:linear-gradient(#eee 20%,#fff 80%);box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:0;background:transparent}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#111!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single-nosearch .chosen-search,.chosen-rtl .chosen-drop{left:9999px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:0}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:#fff url(chosen-sprite.png) no-repeat -30px -20px;background:url(chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:2),only screen and (min-resolution:144dpi){.chosen-rtl .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-container-single .chosen-search input[type=text],.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span{background-image:url(chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
 
 
 
 
 
 
1
+ /*!
2
+ Chosen, a Select Box Enhancer for jQuery and Prototype
3
+ by Patrick Filler for Harvest, http://getharvest.com
4
 
5
+ Version 1.8.7
6
+ Full source at https://github.com/harvesthq/chosen
7
+ Copyright (c) 2011-2018 Harvest http://getharvest.com
8
+
9
+ MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
10
+ This file is generated by `grunt build`, do not edit it by hand.
11
+ */.chosen-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chosen-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.chosen-container .chosen-drop{position:absolute;top:100%;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;-webkit-box-shadow:0 4px 5px rgba(0,0,0,.15);box-shadow:0 4px 5px rgba(0,0,0,.15);clip:rect(0,0,0,0);-webkit-clip-path:inset(100% 100%);clip-path:inset(100% 100%)}.chosen-container.chosen-with-drop .chosen-drop{clip:auto;-webkit-clip-path:none;clip-path:none}.chosen-container a{cursor:pointer}.chosen-container .chosen-single .group-name,.chosen-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .chosen-single .group-name:after,.chosen-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chosen-container-single .chosen-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),to(#f4f4f4));background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;-webkit-box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chosen-container-single .chosen-default{color:#999}.chosen-container-single .chosen-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chosen-container-single .chosen-single-with-deselect span{margin-right:38px}.chosen-container-single .chosen-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-single .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single.chosen-disabled .chosen-single abbr:hover{background-position:-42px -10px}.chosen-container-single .chosen-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chosen-container-single .chosen-single div b{display:block;width:100%;height:100%;background:url(chosen-sprite.png) no-repeat 0 2px}.chosen-container-single .chosen-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chosen-container-single .chosen-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:url(chosen-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chosen-container-single .chosen-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chosen-container-single.chosen-container-single-nosearch .chosen-search{position:absolute;clip:rect(0,0,0,0);-webkit-clip-path:inset(100% 100%);clip-path:inset(100% 100%)}.chosen-container .chosen-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chosen-container .chosen-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chosen-container .chosen-results li.active-result{display:list-item;cursor:pointer}.chosen-container .chosen-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chosen-container .chosen-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chosen-container .chosen-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chosen-container .chosen-results li.group-result{display:list-item;font-weight:700;cursor:default}.chosen-container .chosen-results li.group-option{padding-left:15px}.chosen-container .chosen-results li em{font-style:normal;text-decoration:underline}.chosen-container-multi .chosen-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(1%,#eee),color-stop(15%,#fff));background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chosen-container-multi .chosen-choices li{float:left;list-style:none}.chosen-container-multi .chosen-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chosen-container-multi .chosen-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:0 0!important;-webkit-box-shadow:none;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px}.chosen-container-multi .chosen-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),to(#eee));background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;-webkit-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chosen-container-multi .chosen-choices li.search-choice span{word-wrap:break-word}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(chosen-sprite.png) -42px 1px no-repeat;font-size:1px}.chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chosen-container-multi .chosen-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),to(#eee));background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chosen-container-multi .chosen-choices li.search-choice-focus{background:#d4d4d4}.chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chosen-container-multi .chosen-results{margin:0;padding:0}.chosen-container-multi .chosen-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chosen-container-active .chosen-single{border:1px solid #5897fb;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active.chosen-with-drop .chosen-single{border:1px solid #aaa;border-bottom-right-radius:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#eee),color-stop(80%,#fff));background-image:linear-gradient(#eee 20%,#fff 80%);-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset}.chosen-container-active.chosen-with-drop .chosen-single div{border-left:none;background:0 0}.chosen-container-active.chosen-with-drop .chosen-single div b{background-position:-18px 2px}.chosen-container-active .chosen-choices{border:1px solid #5897fb;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.chosen-container-active .chosen-choices li.search-field input[type=text]{color:#222!important}.chosen-disabled{opacity:.5!important;cursor:default}.chosen-disabled .chosen-single{cursor:default}.chosen-disabled .chosen-choices .search-choice .search-choice-close{cursor:default}.chosen-rtl{text-align:right}.chosen-rtl .chosen-single{overflow:visible;padding:0 8px 0 0}.chosen-rtl .chosen-single span{margin-right:0;margin-left:26px;direction:rtl}.chosen-rtl .chosen-single-with-deselect span{margin-left:38px}.chosen-rtl .chosen-single div{right:auto;left:3px}.chosen-rtl .chosen-single abbr{right:auto;left:26px}.chosen-rtl .chosen-choices li{float:right}.chosen-rtl .chosen-choices li.search-field input[type=text]{direction:rtl}.chosen-rtl .chosen-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chosen-rtl .chosen-choices li.search-choice .search-choice-close{right:auto;left:4px}.chosen-rtl.chosen-container-single .chosen-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chosen-rtl .chosen-results li.group-option{padding-right:15px;padding-left:0}.chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div{border-right:none}.chosen-rtl .chosen-search input[type=text]{padding:4px 5px 4px 20px;background:url(chosen-sprite.png) no-repeat -30px -20px;direction:rtl}.chosen-rtl.chosen-container-single .chosen-single div b{background-position:6px 2px}.chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chosen-container .chosen-results-scroll-down span,.chosen-container .chosen-results-scroll-up span,.chosen-container-multi .chosen-choices .search-choice .search-choice-close,.chosen-container-single .chosen-search input[type=text],.chosen-container-single .chosen-single abbr,.chosen-container-single .chosen-single div b,.chosen-rtl .chosen-search input[type=text]{background-image:url(chosen-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
admin/assets/js/data-meta-boxes.js CHANGED
@@ -3,7 +3,8 @@ jQuery( function ( $ ) {
3
  // TABS
4
  $('ul.a3-metabox-data-tabs').show();
5
  $('div.a3-metabox-panel-wrap').each(function(){
6
- $(this).find('div.a3-metabox-panel:not(:first)').hide();
 
7
  });
8
  $('ul.a3-metabox-data-tabs a').click(function(){
9
  var panel_wrap = $(this).closest('div.a3-metabox-panel-wrap');
3
  // TABS
4
  $('ul.a3-metabox-data-tabs').show();
5
  $('div.a3-metabox-panel-wrap').each(function(){
6
+ $(this).find('div.a3-metabox-panel').hide();
7
+ $(this).find('div.a3-metabox-panel').first().show();
8
  });
9
  $('ul.a3-metabox-data-tabs a').click(function(){
10
  var panel_wrap = $(this).closest('div.a3-metabox-panel-wrap');
admin/assets/js/datetimepicker/jquery.datetimepicker.js CHANGED
@@ -600,11 +600,11 @@
600
  $(this).parent().parent().hide();
601
 
602
  datetimepicker.trigger('xchange.xdsoft');
603
- if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
604
  options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
605
  }
606
 
607
- if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
608
  options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
609
  }
610
  });
@@ -612,11 +612,11 @@
612
  datetimepicker.setOptions = function (_options) {
613
  options = $.extend(true, {}, options, _options);
614
 
615
- if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) {
616
  options.allowTimes = $.extend(true, [], _options.allowTimes);
617
  }
618
 
619
- if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) {
620
  options.weekends = $.extend(true, [], _options.weekends);
621
  }
622
 
@@ -732,7 +732,7 @@
732
  .replace(/s/g, '59');
733
  }
734
 
735
- if ($.type(options.mask) === 'string') {
736
  if (!isValidValue(options.mask, input.val())) {
737
  input.val(options.mask.replace(/[0-9]/g, '_'));
738
  }
@@ -757,7 +757,7 @@
757
  }
758
 
759
  val = val.substr(0, pos) + digit + val.substr(pos + 1);
760
- if ($.trim(val) === '') {
761
  val = options.mask.replace(/[0-9]/g, '_');
762
  } else {
763
  if (pos === options.mask.length) {
@@ -774,7 +774,7 @@
774
  if (isValidValue(options.mask, val)) {
775
  this.value = val;
776
  setCaretPos(this, pos);
777
- } else if ($.trim(val) === '') {
778
  this.value = options.mask.replace(/[0-9]/g, '_');
779
  } else {
780
  input.trigger('error_input.xdsoft');
@@ -794,7 +794,7 @@
794
  input
795
  .off('blur.xdsoft')
796
  .on('blur.xdsoft', function () {
797
- if (options.allowBlank && !$.trim($(this).val()).length) {
798
  $(this).val(null);
799
  datetimepicker.data('xdsoft_datetime').empty();
800
  } else if (!Date.parseDate($(this).val(), options.format)) {
@@ -912,11 +912,11 @@
912
  );
913
  _this.currentTime.setMonth(month);
914
 
915
- if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
916
  options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
917
  }
918
 
919
- if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) {
920
  options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
921
  }
922
 
@@ -937,7 +937,7 @@
937
  )
938
  );
939
  _this.currentTime.setMonth(month);
940
- if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) {
941
  options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
942
  }
943
  datetimepicker.trigger('xchange.xdsoft');
@@ -1135,7 +1135,7 @@
1135
 
1136
  classes.push('xdsoft_date');
1137
 
1138
- if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) {
1139
  customDateSettings = options.beforeShowDay.call(datetimepicker, start);
1140
  } else {
1141
  customDateSettings = null;
@@ -1165,7 +1165,7 @@
1165
  classes.push('xdsoft_weekend');
1166
  }
1167
 
1168
- if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) {
1169
  classes.push(options.beforeShowDay(start));
1170
  }
1171
 
@@ -1223,7 +1223,7 @@
1223
  time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + now.dateFormat(options.formatTime) + '</div>';
1224
  };
1225
 
1226
- if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) {
1227
  for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) {
1228
  for (j = 0; j < 60; j += options.step) {
1229
  h = (i < 10 ? '0' : '') + i;
@@ -1310,7 +1310,7 @@
1310
  datetimepicker.trigger('close.xdsoft');
1311
  }
1312
 
1313
- if (options.onSelectDate && $.isFunction(options.onSelectDate)) {
1314
  options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
1315
  }
1316
 
@@ -1345,7 +1345,7 @@
1345
  datetimepicker.trigger('close.xdsoft');
1346
  }
1347
 
1348
- if (options.onSelectTime && $.isFunction(options.onSelectTime)) {
1349
  options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
1350
  }
1351
  datetimepicker.data('changed', true);
@@ -1394,7 +1394,7 @@
1394
 
1395
  datetimepicker
1396
  .on('changedatetime.xdsoft', function (event) {
1397
- if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) {
1398
  var $input = datetimepicker.data('input');
1399
  options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
1400
  delete options.value;
@@ -1402,7 +1402,7 @@
1402
  }
1403
  })
1404
  .on('generate.xdsoft', function () {
1405
- if (options.onGenerate && $.isFunction(options.onGenerate)) {
1406
  options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1407
  }
1408
  if (triggerAfterOpen) {
@@ -1442,7 +1442,7 @@
1442
  datetimepicker
1443
  .on('open.xdsoft', function (event) {
1444
  var onShow = true;
1445
- if (options.onShow && $.isFunction(options.onShow)) {
1446
  onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
1447
  }
1448
  if (onShow !== false) {
@@ -1466,7 +1466,7 @@
1466
  .find('.xdsoft_month,.xdsoft_year')
1467
  .find('.xdsoft_select')
1468
  .hide();
1469
- if (options.onClose && $.isFunction(options.onClose)) {
1470
  onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
1471
  }
1472
  if (onClose !== false && !options.opened && !options.inline) {
@@ -1576,7 +1576,7 @@
1576
  return this.each(function () {
1577
  var datetimepicker = $(this).data('xdsoft_datetimepicker');
1578
  if (datetimepicker) {
1579
- if ($.type(opt) === 'string') {
1580
  switch (opt) {
1581
  case 'show':
1582
  $(this).select().focus();
@@ -1602,7 +1602,7 @@
1602
  }
1603
  return 0;
1604
  }
1605
- if ($.type(opt) !== 'string') {
1606
  if (!options.lazyInit || options.open || options.inline) {
1607
  createDateTimePicker($(this));
1608
  } else {
@@ -1622,7 +1622,7 @@
1622
  *
1623
  * Requires: jQuery 1.2.2+
1624
  */
1625
- !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
1626
 
1627
  // Parse and Format Library
1628
  //http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/
600
  $(this).parent().parent().hide();
601
 
602
  datetimepicker.trigger('xchange.xdsoft');
603
+ if (options.onChangeMonth && typeof options.onChangeMonth === "function" ) {
604
  options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
605
  }
606
 
607
+ if (year !== _xdsoft_datetime.currentTime.getFullYear() && typeof options.onChangeYear === "function" ) {
608
  options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
609
  }
610
  });
612
  datetimepicker.setOptions = function (_options) {
613
  options = $.extend(true, {}, options, _options);
614
 
615
+ if (_options.allowTimes && Array.isArray(_options.allowTimes) && _options.allowTimes.length) {
616
  options.allowTimes = $.extend(true, [], _options.allowTimes);
617
  }
618
 
619
+ if (_options.weekends && Array.isArray(_options.weekends) && _options.weekends.length) {
620
  options.weekends = $.extend(true, [], _options.weekends);
621
  }
622
 
732
  .replace(/s/g, '59');
733
  }
734
 
735
+ if (typeof options.mask === 'string') {
736
  if (!isValidValue(options.mask, input.val())) {
737
  input.val(options.mask.replace(/[0-9]/g, '_'));
738
  }
757
  }
758
 
759
  val = val.substr(0, pos) + digit + val.substr(pos + 1);
760
+ if (val.trim() === '') {
761
  val = options.mask.replace(/[0-9]/g, '_');
762
  } else {
763
  if (pos === options.mask.length) {
774
  if (isValidValue(options.mask, val)) {
775
  this.value = val;
776
  setCaretPos(this, pos);
777
+ } else if (val.trim() === '') {
778
  this.value = options.mask.replace(/[0-9]/g, '_');
779
  } else {
780
  input.trigger('error_input.xdsoft');
794
  input
795
  .off('blur.xdsoft')
796
  .on('blur.xdsoft', function () {
797
+ if (options.allowBlank && !$(this).val().trim().length) {
798
  $(this).val(null);
799
  datetimepicker.data('xdsoft_datetime').empty();
800
  } else if (!Date.parseDate($(this).val(), options.format)) {
912
  );
913
  _this.currentTime.setMonth(month);
914
 
915
+ if (options.onChangeMonth && typeof options.onChangeMonth === "function" ) {
916
  options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
917
  }
918
 
919
+ if (year !== _this.currentTime.getFullYear() && typeof options.onChangeYear === "function" ) {
920
  options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
921
  }
922
 
937
  )
938
  );
939
  _this.currentTime.setMonth(month);
940
+ if (options.onChangeMonth && typeof options.onChangeMonth === "function" ) {
941
  options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
942
  }
943
  datetimepicker.trigger('xchange.xdsoft');
1135
 
1136
  classes.push('xdsoft_date');
1137
 
1138
+ if (options.beforeShowDay && typeof options.beforeShowDay.call === "function" ) {
1139
  customDateSettings = options.beforeShowDay.call(datetimepicker, start);
1140
  } else {
1141
  customDateSettings = null;
1165
  classes.push('xdsoft_weekend');
1166
  }
1167
 
1168
+ if (options.beforeShowDay && typeof options.beforeShowDay === "function" ) {
1169
  classes.push(options.beforeShowDay(start));
1170
  }
1171
 
1223
  time += '<div class="xdsoft_time ' + classes.join(' ') + '" data-hour="' + h + '" data-minute="' + m + '">' + now.dateFormat(options.formatTime) + '</div>';
1224
  };
1225
 
1226
+ if (!options.allowTimes || !Array.isArray(options.allowTimes) || !options.allowTimes.length) {
1227
  for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) {
1228
  for (j = 0; j < 60; j += options.step) {
1229
  h = (i < 10 ? '0' : '') + i;
1310
  datetimepicker.trigger('close.xdsoft');
1311
  }
1312
 
1313
+ if (options.onSelectDate && typeof options.onSelectDate === "function" ) {
1314
  options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
1315
  }
1316
 
1345
  datetimepicker.trigger('close.xdsoft');
1346
  }
1347
 
1348
+ if (options.onSelectTime && typeof options.onSelectTime === "function" ) {
1349
  options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent);
1350
  }
1351
  datetimepicker.data('changed', true);
1394
 
1395
  datetimepicker
1396
  .on('changedatetime.xdsoft', function (event) {
1397
+ if (options.onChangeDateTime && typeof options.onChangeDateTime === "function" ) {
1398
  var $input = datetimepicker.data('input');
1399
  options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event);
1400
  delete options.value;
1402
  }
1403
  })
1404
  .on('generate.xdsoft', function () {
1405
+ if (options.onGenerate && typeof options.onGenerate === "function" ) {
1406
  options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'));
1407
  }
1408
  if (triggerAfterOpen) {
1442
  datetimepicker
1443
  .on('open.xdsoft', function (event) {
1444
  var onShow = true;
1445
+ if (options.onShow && typeof options.onShow === "function" ) {
1446
  onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
1447
  }
1448
  if (onShow !== false) {
1466
  .find('.xdsoft_month,.xdsoft_year')
1467
  .find('.xdsoft_select')
1468
  .hide();
1469
+ if (options.onClose && typeof options.onClose === "function" ) {
1470
  onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event);
1471
  }
1472
  if (onClose !== false && !options.opened && !options.inline) {
1576
  return this.each(function () {
1577
  var datetimepicker = $(this).data('xdsoft_datetimepicker');
1578
  if (datetimepicker) {
1579
+ if (typeof opt === 'string') {
1580
  switch (opt) {
1581
  case 'show':
1582
  $(this).select().focus();
1602
  }
1603
  return 0;
1604
  }
1605
+ if ( typeof opt !== 'string') {
1606
  if (!options.lazyInit || options.open || options.inline) {
1607
  createDateTimePicker($(this));
1608
  } else {
1622
  *
1623
  * Requires: jQuery 1.2.2+
1624
  */
1625
+ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.on("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.off("mousewheel",a)}})});
1626
 
1627
  // Parse and Format Library
1628
  //http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/
admin/assets/js/iphone-style-checkboxes.js CHANGED
@@ -47,7 +47,7 @@
47
  this.offSpan = this.offLabel.children('span');
48
  this.onLabel = $("<label class='" + this.labelOnClass + "'>\n <span>" + this.checkedLabel + "</span>\n</label>").appendTo(this.container);
49
  this.onSpan = this.onLabel.children('span');
50
- return this.handle = $("<div class='" + this.handleClass + "'>\n <div class='" + this.handleRightClass + "'>\n <div class='" + this.handleCenterClass + "' />\n </div>\n</div>").appendTo(this.container).before("<span class='iPhoneCheckBeforeContainer'>&nbsp;</span><span class='iPhoneCheckAfterContainer'>&nbsp;</span>");
51
  };
52
 
53
  iOSCheckbox.prototype.disableTextSelection = function() {
@@ -74,6 +74,9 @@
74
  if (mode === "container") {
75
  newWidth = onLabelWidth > offLabelWidth ? onLabelWidth : offLabelWidth;
76
  newWidth += this._getDimension(this.handle, "width") + this.handleMargin;
 
 
 
77
  return this.container.css({
78
  width: newWidth
79
  });
@@ -194,16 +197,16 @@
194
  };
195
  localMouseUp = function(event) {
196
  self.onGlobalUp.apply(self, arguments);
197
- $(document).unbind('mousemove touchmove', localMouseMove);
198
- return $(document).unbind('mouseup touchend', localMouseUp);
199
  };
200
  this.elem.change(function() {
201
  return self.refresh();
202
  });
203
- return this.container.bind('mousedown touchstart', function(event) {
204
  self.onMouseDown.apply(self, arguments);
205
- $(document).bind('mousemove touchmove', localMouseMove);
206
- return $(document).bind('mouseup touchend', localMouseUp);
207
  });
208
  };
209
 
@@ -268,6 +271,8 @@
268
  };
269
 
270
  iOSCheckbox.defaults = {
 
 
271
  duration: 200,
272
  checkedLabel: 'ON',
273
  uncheckedLabel: 'OFF',
@@ -336,6 +341,8 @@
336
  options = {};
337
  }
338
  opts = $.extend({}, options, {
 
 
339
  resizeHandle: false,
340
  disabledClass: 'iOSCheckDisabled',
341
  containerClass: 'iOSCheckContainer',
47
  this.offSpan = this.offLabel.children('span');
48
  this.onLabel = $("<label class='" + this.labelOnClass + "'>\n <span>" + this.checkedLabel + "</span>\n</label>").appendTo(this.container);
49
  this.onSpan = this.onLabel.children('span');
50
+ return this.handle = $("<div class='" + this.handleClass + "'>\n <div class='" + this.handleRightClass + "'>\n <div class='" + this.handleCenterClass + "'>\n </div>\n</div>").appendTo(this.container).before("<span class='iPhoneCheckBeforeContainer'>&nbsp;</span><span class='iPhoneCheckAfterContainer'>&nbsp;</span>");
51
  };
52
 
53
  iOSCheckbox.prototype.disableTextSelection = function() {
74
  if (mode === "container") {
75
  newWidth = onLabelWidth > offLabelWidth ? onLabelWidth : offLabelWidth;
76
  newWidth += this._getDimension(this.handle, "width") + this.handleMargin;
77
+ if( this.customWidth === true ){
78
+ newWidth = this.containerWidth;
79
+ }
80
  return this.container.css({
81
  width: newWidth
82
  });
197
  };
198
  localMouseUp = function(event) {
199
  self.onGlobalUp.apply(self, arguments);
200
+ $(document).off('mousemove touchmove', localMouseMove);
201
+ return $(document).off('mouseup touchend', localMouseUp);
202
  };
203
  this.elem.change(function() {
204
  return self.refresh();
205
  });
206
+ return this.container.on('mousedown touchstart', function(event) {
207
  self.onMouseDown.apply(self, arguments);
208
+ $(document).on('mousemove touchmove', localMouseMove);
209
+ return $(document).on('mouseup touchend', localMouseUp);
210
  });
211
  };
212
 
271
  };
272
 
273
  iOSCheckbox.defaults = {
274
+ customWidth: false,
275
+ containerWidth: 80,
276
  duration: 200,
277
  checkedLabel: 'ON',
278
  uncheckedLabel: 'OFF',
341
  options = {};
342
  }
343
  opts = $.extend({}, options, {
344
+ customWidth: false,
345
+ containerWidth: 80,
346
  resizeHandle: false,
347
  disabledClass: 'iOSCheckDisabled',
348
  containerClass: 'iOSCheckContainer',
admin/assets/js/iphone-style-checkboxes.rtl.js CHANGED
@@ -47,7 +47,7 @@
47
  this.offSpan = this.offLabel.children('span');
48
  this.onLabel = $("<label class='" + this.labelOnClass + "'>\n <span>" + this.checkedLabel + "</span>\n</label>").appendTo(this.container);
49
  this.onSpan = this.onLabel.children('span');
50
- return this.handle = $("<div class='" + this.handleClass + "'>\n <div class='" + this.handleRightClass + "'>\n <div class='" + this.handleCenterClass + "' />\n </div>\n</div>").appendTo(this.container).before("<span class='iPhoneCheckBeforeContainer'>&nbsp;</span><span class='iPhoneCheckAfterContainer'>&nbsp;</span>");
51
  };
52
 
53
  iOSCheckbox.prototype.disableTextSelection = function() {
@@ -74,6 +74,9 @@
74
  if (mode === "container") {
75
  newWidth = onLabelWidth > offLabelWidth ? onLabelWidth : offLabelWidth;
76
  newWidth += this._getDimension(this.handle, "width") + this.handleMargin;
 
 
 
77
  return this.container.css({
78
  width: newWidth
79
  });
@@ -194,16 +197,16 @@
194
  };
195
  localMouseUp = function(event) {
196
  self.onGlobalUp.apply(self, arguments);
197
- $(document).unbind('mousemove touchmove', localMouseMove);
198
- return $(document).unbind('mouseup touchend', localMouseUp);
199
  };
200
  this.elem.change(function() {
201
  return self.refresh();
202
  });
203
- return this.container.bind('mousedown touchstart', function(event) {
204
  self.onMouseDown.apply(self, arguments);
205
- $(document).bind('mousemove touchmove', localMouseMove);
206
- return $(document).bind('mouseup touchend', localMouseUp);
207
  });
208
  };
209
 
@@ -268,6 +271,8 @@
268
  };
269
 
270
  iOSCheckbox.defaults = {
 
 
271
  duration: 200,
272
  checkedLabel: 'ON',
273
  uncheckedLabel: 'OFF',
@@ -336,6 +341,8 @@
336
  options = {};
337
  }
338
  opts = $.extend({}, options, {
 
 
339
  resizeHandle: false,
340
  disabledClass: 'iOSCheckDisabled',
341
  containerClass: 'iOSCheckContainer',
47
  this.offSpan = this.offLabel.children('span');
48
  this.onLabel = $("<label class='" + this.labelOnClass + "'>\n <span>" + this.checkedLabel + "</span>\n</label>").appendTo(this.container);
49
  this.onSpan = this.onLabel.children('span');
50
+ return this.handle = $("<div class='" + this.handleClass + "'>\n <div class='" + this.handleRightClass + "'>\n <div class='" + this.handleCenterClass + "'>\n </div>\n</div>").appendTo(this.container).before("<span class='iPhoneCheckBeforeContainer'>&nbsp;</span><span class='iPhoneCheckAfterContainer'>&nbsp;</span>");
51
  };
52
 
53
  iOSCheckbox.prototype.disableTextSelection = function() {
74
  if (mode === "container") {
75
  newWidth = onLabelWidth > offLabelWidth ? onLabelWidth : offLabelWidth;
76
  newWidth += this._getDimension(this.handle, "width") + this.handleMargin;
77
+ if( this.customWidth === true ){
78
+ newWidth = this.containerWidth;
79
+ }
80
  return this.container.css({
81
  width: newWidth
82
  });
197
  };
198
  localMouseUp = function(event) {
199
  self.onGlobalUp.apply(self, arguments);
200
+ $(document).off('mousemove touchmove', localMouseMove);
201
+ return $(document).off('mouseup touchend', localMouseUp);
202
  };
203
  this.elem.change(function() {
204
  return self.refresh();
205
  });
206
+ return this.container.on('mousedown touchstart', function(event) {
207
  self.onMouseDown.apply(self, arguments);
208
+ $(document).on('mousemove touchmove', localMouseMove);
209
+ return $(document).on('mouseup touchend', localMouseUp);
210
  });
211
  };
212
 
271
  };
272
 
273
  iOSCheckbox.defaults = {
274
+ customWidth: false,
275
+ containerWidth: 80,
276
  duration: 200,
277
  checkedLabel: 'ON',
278
  uncheckedLabel: 'OFF',
341
  options = {};
342
  }
343
  opts = $.extend({}, options, {
344
+ customWidth: false,
345
+ containerWidth: 80,
346
  resizeHandle: false,
347
  disabledClass: 'iOSCheckDisabled',
348
  containerClass: 'iOSCheckContainer',
admin/assets/js/rwdImageMaps/jquery.rwdImageMaps.min.js CHANGED
@@ -1,11 +1,11 @@
1
  /*
2
- * rwdImageMaps jQuery plugin v1.5
3
  *
4
  * Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize
5
  *
6
- * Copyright (c) 2013 Matt Stow
7
  * https://github.com/stowball/jQuery-rwdImageMaps
8
  * http://mattstow.com
9
  * Licensed under the MIT license
10
  */
11
- ;(function(a){a.fn.rwdImageMaps=function(){var c=this;var b=function(){c.each(function(){if(typeof(a(this).attr("usemap"))=="undefined"){return}var e=this,d=a(e);a("<img />").load(function(){var g="width",m="height",n=d.attr(g),j=d.attr(m);if(!n||!j){var o=new Image();o.src=d.attr("src");if(!n){n=o.width}if(!j){j=o.height}}var f=d.width()/100,k=d.height()/100,i=d.attr("usemap").replace("#",""),l="coords";a('map[name="'+i+'"]').find("area").each(function(){var r=a(this);if(!r.data(l)){r.data(l,r.attr(l))}var q=r.data(l).split(","),p=new Array(q.length);for(var h=0;h<p.length;++h){if(h%2===0){p[h]=parseInt(((q[h]/n)*100)*f)}else{p[h]=parseInt(((q[h]/j)*100)*k)}}r.attr(l,p.toString())})}).attr("src",d.attr("src"))})};a(window).resize(b).trigger("resize");return this}})(jQuery);
1
  /*
2
+ * rwdImageMaps jQuery plugin v1.6
3
  *
4
  * Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize
5
  *
6
+ * Copyright (c) 2016 Matt Stow
7
  * https://github.com/stowball/jQuery-rwdImageMaps
8
  * http://mattstow.com
9
  * Licensed under the MIT license
10
  */
11
+ ;(function(a){a.fn.rwdImageMaps=function(){var c=this;var b=function(){c.each(function(){if(typeof(a(this).attr("usemap"))=="undefined"){return}var e=this,d=a(e);a("<img />").on('load',function(){var g="width",m="height",n=d.attr(g),j=d.attr(m);if(!n||!j){var o=new Image();o.src=d.attr("src");if(!n){n=o.width}if(!j){j=o.height}}var f=d.width()/100,k=d.height()/100,i=d.attr("usemap").replace("#",""),l="coords";a('map[name="'+i+'"]').find("area").each(function(){var r=a(this);if(!r.data(l)){r.data(l,r.attr(l))}var q=r.data(l).split(","),p=new Array(q.length);for(var h=0;h<p.length;++h){if(h%2===0){p[h]=parseInt(((q[h]/n)*100)*f)}else{p[h]=parseInt(((q[h]/j)*100)*k)}}r.attr(l,p.toString())})}).attr("src",d.attr("src"))})};a(window).resize(b).trigger("resize");return this}})(jQuery);
admin/assets/js/ui-slider/jquery.ui.slider.rtl.js CHANGED
@@ -242,7 +242,7 @@ $.widget( "ui.slider", $.ui.mouse, {
242
  " ui-widget-content" +
243
  " ui-corner-all" )
244
  .removeData( "slider" )
245
- .unbind( ".slider" );
246
 
247
  this._mouseDestroy();
248
 
@@ -305,7 +305,7 @@ $.widget( "ui.slider", $.ui.mouse, {
305
  .focus();
306
 
307
  offset = closestHandle.offset();
308
- mouseOverHandle = !$( event.target ).parents().andSelf().is( ".ui-slider-handle" );
309
  this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
310
  left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
311
  top: event.pageY - offset.top -
@@ -492,7 +492,7 @@ $.widget( "ui.slider", $.ui.mouse, {
492
  }
493
 
494
  if ( arguments.length ) {
495
- if ( $.isArray( arguments[ 0 ] ) ) {
496
  vals = this.options.values;
497
  newValues = arguments[ 0 ];
498
  for ( i = 0; i < vals.length; i += 1 ) {
@@ -516,7 +516,7 @@ $.widget( "ui.slider", $.ui.mouse, {
516
  var i,
517
  valsLength = 0;
518
 
519
- if ( $.isArray( this.options.values ) ) {
520
  valsLength = this.options.values.length;
521
  }
522
 
242
  " ui-widget-content" +
243
  " ui-corner-all" )
244
  .removeData( "slider" )
245
+ .off( ".slider" );
246
 
247
  this._mouseDestroy();
248
 
305
  .focus();
306
 
307
  offset = closestHandle.offset();
308
+ mouseOverHandle = !$( event.target ).parents().addBack().is( ".ui-slider-handle" );
309
  this._clickOffset = mouseOverHandle ? { left: 0, top: 0 } : {
310
  left: event.pageX - offset.left - ( closestHandle.width() / 2 ),
311
  top: event.pageY - offset.top -
492
  }
493
 
494
  if ( arguments.length ) {
495
+ if ( Array.isArray( arguments[ 0 ] ) ) {
496
  vals = this.options.values;
497
  newValues = arguments[ 0 ];
498
  for ( i = 0; i < vals.length; i += 1 ) {
516
  var i,
517
  valsLength = 0;
518
 
519
+ if ( Array.isArray( this.options.values ) ) {
520
  valsLength = this.options.values.length;
521
  }
522
 
admin/assets/js/ui-slider/jquery.ui.slider.rtl.min.js CHANGED
@@ -12,4 +12,4 @@
12
  * jquery.ui.mouse.js
13
  * jquery.ui.widget.js
14
  */
15
- (function($,g){var h=5;$.widget("ui.slider",$.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",isRTL:false,range:false,step:1,value:0,values:null},_create:function(){var f=this,o=this.options;this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+(o.isRTL?" ui-slider-rtl":"")+" ui-widget"+" ui-widget-content"+" ui-corner-all");if(o.disabled){this.element.addClass("ui-slider-disabled ui-disabled")}this.range=$([]);if(o.range){if(o.range===true){this.range=$("<div></div>");if(!o.values){o.values=[this._valueMin(),this._valueMin()]}if(o.values.length&&o.values.length!==2){o.values=[o.values[0],o.values[0]]}}else{this.range=$("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(o.range==="min"||o.range==="max"){this.range.addClass("ui-slider-range-"+o.range)}this.range.addClass("ui-widget-header")}if($(".ui-slider-handle",this.element).length===0){$("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")}if(o.values&&o.values.length){while($(".ui-slider-handle",this.element).length<o.values.length){$("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")}}this.handles=$(".ui-slider-handle",this.element).addClass("ui-state-default"+" ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){if(!o.disabled){$(this).addClass("ui-state-hover")}},function(){$(this).removeClass("ui-state-hover")}).focus(function(){if(!o.disabled){$(".ui-slider .ui-state-focus").removeClass("ui-state-focus");$(this).addClass("ui-state-focus")}else{$(this).blur()}}).blur(function(){$(this).removeClass("ui-state-focus")});this.handles.each(function(i){$(this).data("index.ui-slider-handle",i)});this.handles.keydown(function(c){var d=true,index=$(this).data("index.ui-slider-handle"),allowed,curVal,newVal,step;if(f.options.disabled){return}switch(c.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:d=false;if(!f._keySliding){f._keySliding=true;$(this).addClass("ui-state-active");allowed=f._start(c,index);if(allowed===false){return}}break}step=f.options.step;if(f.options.values&&f.options.values.length){curVal=newVal=f.values(index)}else{curVal=newVal=f.value()}var e=function(a,b){if(curVal===a){return}newVal=f._trimAlignValue(curVal+b)};switch(c.keyCode){case $.ui.keyCode.HOME:newVal=f._valueMin();break;case $.ui.keyCode.END:newVal=f._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=f._trimAlignValue(curVal+((f._valueMax()-f._valueMin())/h));break;case $.ui.keyCode.PAGE_DOWN:newVal=f._trimAlignValue(curVal-((f._valueMax()-f._valueMin())/h));break;case $.ui.keyCode.UP:e(f._valueMax(),step);break;case $.ui.keyCode.RIGHT:e(f._valueMax(),f.options.isRTL?-step:step);break;case $.ui.keyCode.DOWN:e(f._valueMin(),-step);break;case $.ui.keyCode.LEFT:e(f._valueMin(),f.options.isRTL?step:-step);break}f._slide(c,index,newVal);return d}).keyup(function(a){var b=$(this).data("index.ui-slider-handle");if(f._keySliding){f._keySliding=false;f._stop(a,b);f._change(a,b);$(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider"+" ui-slider-horizontal"+" ui-slider-vertical"+" ui-slider-disabled"+" ui-widget"+" ui-widget-content"+" ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();return this},_mouseCapture:function(b){var o=this.options,position,normValue,distance,closestHandle,self,index,allowed,offset,mouseOverHandle;if(o.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();position={x:b.pageX,y:b.pageY};normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;self=this;this.handles.each(function(i){var a=Math.abs(normValue-self.values(i));if(distance>a){distance=a;closestHandle=$(this);index=i}});if(o.range===true&&this.values(1)===o.min){index+=1;closestHandle=$(this.handles[index])}allowed=this._start(b,index);if(allowed===false){return false}this._mouseSliding=true;self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();offset=closestHandle.offset();mouseOverHandle=!$(b.target).parents().andSelf().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:b.pageX-offset.left-(closestHandle.width()/2),top:b.pageY-offset.top-(closestHandle.height()/2)-(parseInt(closestHandle.css("borderTopWidth"),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(b,index,normValue)}this._animateOff=true;return true},_mouseStart:function(a){return true},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},normValue=this._normValueFromMouse(b);this._slide(a,this._handleIndex,normValue);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){b=this.elementSize.width;pixelMouse=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;pixelMouse=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}percentMouse=(pixelMouse/b);if(percentMouse>1){percentMouse=1}if(percentMouse<0){percentMouse=0}if(this.orientation==="vertical"){percentMouse=1-percentMouse}if(this.options.isRTL){percentMouse=1-percentMouse}valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var d,newValues,allowed;if(this.options.values&&this.options.values.length){d=this.values(b?0:1);if((this.options.values.length===2&&this.options.range===true)&&((b===0&&c>d)||(b===1&&c<d))){c=d}if(c!==this.values(b)){newValues=this.values();newValues[b]=c;allowed=this._trigger("slide",a,{handle:this.handles[b],value:c,values:newValues});d=this.values(b?0:1);if(allowed!==false){this.values(b,c,true)}}}else{if(c!==this.value()){allowed=this._trigger("slide",a,{handle:this.handles[b],value:c});if(allowed!==false){this.value(c)}}}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a);this._refreshValue();this._change(null,0)}return this._value()},values:function(a,b){var c,newValues,i;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length){if($.isArray(arguments[0])){c=this.options.values;newValues=arguments[0];for(i=0;i<c.length;i+=1){c[i]=this._trimAlignValue(newValues[i]);this._change(null,i)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(a)}else{return this.value()}}}else{return this._values()}},_setOption:function(a,b){var i,valsLength=0;if($.isArray(this.options.values)){valsLength=this.options.values.length}$.Widget.prototype._setOption.apply(this,arguments);switch(a){case"disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"isRTL":this.element.toggleClass("ui-slider-rtl",b);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(i=0;i<valsLength;i+=1){this._change(null,i)}this._animateOff=false;break}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,vals,i;if(arguments.length){b=this.options.values[a];b=this._trimAlignValue(b);return b}else{vals=this.options.values.slice();for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(vals[i])}return vals}},_trimAlignValue:function(a){if(a<=this._valueMin()){return this._valueMin()}if(a>=this._valueMax()){return this._valueMax()}var b=(this.options.step>0)?this.options.step:1,valModStep=(a-this._valueMin())%b;alignValue=a-valModStep;if(Math.abs(valModStep)*2>=b){alignValue+=(valModStep>0)?b:(-b)}return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=this.options.range,o=this.options,self=this,animate=(!this._animateOff)?o.animate:false,valPercent,_set={},lastValPercent,value,valueMin,valueMax;if(this.options.values&&this.options.values.length){this.handles.each(function(i,j){valPercent=(self.values(i)-self._valueMin())/(self._valueMax()-self._valueMin())*100;valPercent=(self.options.isRTL?100-valPercent:valPercent);_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(self.options.range===true){if(self.orientation==="horizontal"){if(i===0){self.range.stop(1,1)[animate?"animate":"css"](self.options.isRTL?{right:(100-valPercent)+"%"}:{left:valPercent+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({width:((self.options.isRTL?-1:+1)*(valPercent-lastValPercent))+"%"},{queue:false,duration:o.animate})}}else{if(i===0){self.range.stop(1,1)[animate?"animate":"css"](self.options.isRTL?{top:(100-valPercent)+"%"}:{bottom:(valPercent)+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({height:((self.options.isRTL?-1:+1)*(valPercent-lastValPercent))+"%"},{queue:false,duration:o.animate})}}}lastValPercent=valPercent})}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=(valueMax!==valueMin)?(value-valueMin)/(valueMax-valueMin)*100:0;valPercent=(self.options.isRTL?100-valPercent:valPercent);_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(a==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:(self.options.isRTL?100-valPercent:valPercent)+"%"},o.animate)}if(a==="max"&&this.orientation==="horizontal"){this.range[animate?"animate":"css"]({width:(self.options.isRTL?valPercent:100-valPercent)+"%"},{queue:false,duration:o.animate})}if(a==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:(self.options.isRTL?100-valPercent:valPercent)+"%"},o.animate)}if(a==="max"&&this.orientation==="vertical"){this.range[animate?"animate":"css"]({height:(self.options.isRTL?valPercent:100-valPercent)+"%"},{queue:false,duration:o.animate})}}}});$.extend($.ui.slider,{version:"1.8.9"})}(jQuery));
12
  * jquery.ui.mouse.js
13
  * jquery.ui.widget.js
14
  */
15
+ (function($,g){var h=5;$.widget("ui.slider",$.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",isRTL:false,range:false,step:1,value:0,values:null},_create:function(){var f=this,o=this.options;this._keySliding=false;this._mouseSliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider"+" ui-slider-"+this.orientation+(o.isRTL?" ui-slider-rtl":"")+" ui-widget"+" ui-widget-content"+" ui-corner-all");if(o.disabled){this.element.addClass("ui-slider-disabled ui-disabled")}this.range=$([]);if(o.range){if(o.range===true){this.range=$("<div></div>");if(!o.values){o.values=[this._valueMin(),this._valueMin()]}if(o.values.length&&o.values.length!==2){o.values=[o.values[0],o.values[0]]}}else{this.range=$("<div></div>")}this.range.appendTo(this.element).addClass("ui-slider-range");if(o.range==="min"||o.range==="max"){this.range.addClass("ui-slider-range-"+o.range)}this.range.addClass("ui-widget-header")}if($(".ui-slider-handle",this.element).length===0){$("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")}if(o.values&&o.values.length){while($(".ui-slider-handle",this.element).length<o.values.length){$("<a href='#'></a>").appendTo(this.element).addClass("ui-slider-handle")}}this.handles=$(".ui-slider-handle",this.element).addClass("ui-state-default"+" ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(a){a.preventDefault()}).hover(function(){if(!o.disabled){$(this).addClass("ui-state-hover")}},function(){$(this).removeClass("ui-state-hover")}).focus(function(){if(!o.disabled){$(".ui-slider .ui-state-focus").removeClass("ui-state-focus");$(this).addClass("ui-state-focus")}else{$(this).blur()}}).blur(function(){$(this).removeClass("ui-state-focus")});this.handles.each(function(i){$(this).data("index.ui-slider-handle",i)});this.handles.keydown(function(c){var d=true,index=$(this).data("index.ui-slider-handle"),allowed,curVal,newVal,step;if(f.options.disabled){return}switch(c.keyCode){case $.ui.keyCode.HOME:case $.ui.keyCode.END:case $.ui.keyCode.PAGE_UP:case $.ui.keyCode.PAGE_DOWN:case $.ui.keyCode.UP:case $.ui.keyCode.RIGHT:case $.ui.keyCode.DOWN:case $.ui.keyCode.LEFT:d=false;if(!f._keySliding){f._keySliding=true;$(this).addClass("ui-state-active");allowed=f._start(c,index);if(allowed===false){return}}break}step=f.options.step;if(f.options.values&&f.options.values.length){curVal=newVal=f.values(index)}else{curVal=newVal=f.value()}var e=function(a,b){if(curVal===a){return}newVal=f._trimAlignValue(curVal+b)};switch(c.keyCode){case $.ui.keyCode.HOME:newVal=f._valueMin();break;case $.ui.keyCode.END:newVal=f._valueMax();break;case $.ui.keyCode.PAGE_UP:newVal=f._trimAlignValue(curVal+((f._valueMax()-f._valueMin())/h));break;case $.ui.keyCode.PAGE_DOWN:newVal=f._trimAlignValue(curVal-((f._valueMax()-f._valueMin())/h));break;case $.ui.keyCode.UP:e(f._valueMax(),step);break;case $.ui.keyCode.RIGHT:e(f._valueMax(),f.options.isRTL?-step:step);break;case $.ui.keyCode.DOWN:e(f._valueMin(),-step);break;case $.ui.keyCode.LEFT:e(f._valueMin(),f.options.isRTL?step:-step);break}f._slide(c,index,newVal);return d}).keyup(function(a){var b=$(this).data("index.ui-slider-handle");if(f._keySliding){f._keySliding=false;f._stop(a,b);f._change(a,b);$(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider"+" ui-slider-horizontal"+" ui-slider-vertical"+" ui-slider-disabled"+" ui-widget"+" ui-widget-content"+" ui-corner-all").removeData("slider").off(".slider");this._mouseDestroy();return this},_mouseCapture:function(b){var o=this.options,position,normValue,distance,closestHandle,self,index,allowed,offset,mouseOverHandle;if(o.disabled){return false}this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();position={x:b.pageX,y:b.pageY};normValue=this._normValueFromMouse(position);distance=this._valueMax()-this._valueMin()+1;self=this;this.handles.each(function(i){var a=Math.abs(normValue-self.values(i));if(distance>a){distance=a;closestHandle=$(this);index=i}});if(o.range===true&&this.values(1)===o.min){index+=1;closestHandle=$(this.handles[index])}allowed=this._start(b,index);if(allowed===false){return false}this._mouseSliding=true;self._handleIndex=index;closestHandle.addClass("ui-state-active").focus();offset=closestHandle.offset();mouseOverHandle=!$(b.target).parents().addBack().is(".ui-slider-handle");this._clickOffset=mouseOverHandle?{left:0,top:0}:{left:b.pageX-offset.left-(closestHandle.width()/2),top:b.pageY-offset.top-(closestHandle.height()/2)-(parseInt(closestHandle.css("borderTopWidth"),10)||0)-(parseInt(closestHandle.css("borderBottomWidth"),10)||0)+(parseInt(closestHandle.css("marginTop"),10)||0)};if(!this.handles.hasClass("ui-state-hover")){this._slide(b,index,normValue)}this._animateOff=true;return true},_mouseStart:function(a){return true},_mouseDrag:function(a){var b={x:a.pageX,y:a.pageY},normValue=this._normValueFromMouse(b);this._slide(a,this._handleIndex,normValue);return false},_mouseStop:function(a){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(a,this._handleIndex);this._change(a,this._handleIndex);this._handleIndex=null;this._clickOffset=null;this._animateOff=false;return false},_detectOrientation:function(){this.orientation=(this.options.orientation==="vertical")?"vertical":"horizontal"},_normValueFromMouse:function(a){var b,pixelMouse,percentMouse,valueTotal,valueMouse;if(this.orientation==="horizontal"){b=this.elementSize.width;pixelMouse=a.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{b=this.elementSize.height;pixelMouse=a.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}percentMouse=(pixelMouse/b);if(percentMouse>1){percentMouse=1}if(percentMouse<0){percentMouse=0}if(this.orientation==="vertical"){percentMouse=1-percentMouse}if(this.options.isRTL){percentMouse=1-percentMouse}valueTotal=this._valueMax()-this._valueMin();valueMouse=this._valueMin()+percentMouse*valueTotal;return this._trimAlignValue(valueMouse)},_start:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}return this._trigger("start",a,c)},_slide:function(a,b,c){var d,newValues,allowed;if(this.options.values&&this.options.values.length){d=this.values(b?0:1);if((this.options.values.length===2&&this.options.range===true)&&((b===0&&c>d)||(b===1&&c<d))){c=d}if(c!==this.values(b)){newValues=this.values();newValues[b]=c;allowed=this._trigger("slide",a,{handle:this.handles[b],value:c,values:newValues});d=this.values(b?0:1);if(allowed!==false){this.values(b,c,true)}}}else{if(c!==this.value()){allowed=this._trigger("slide",a,{handle:this.handles[b],value:c});if(allowed!==false){this.value(c)}}}},_stop:function(a,b){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("stop",a,c)},_change:function(a,b){if(!this._keySliding&&!this._mouseSliding){var c={handle:this.handles[b],value:this.value()};if(this.options.values&&this.options.values.length){c.value=this.values(b);c.values=this.values()}this._trigger("change",a,c)}},value:function(a){if(arguments.length){this.options.value=this._trimAlignValue(a);this._refreshValue();this._change(null,0)}return this._value()},values:function(a,b){var c,newValues,i;if(arguments.length>1){this.options.values[a]=this._trimAlignValue(b);this._refreshValue();this._change(null,a)}if(arguments.length){if(Array.isArray(arguments[0])){c=this.options.values;newValues=arguments[0];for(i=0;i<c.length;i+=1){c[i]=this._trimAlignValue(newValues[i]);this._change(null,i)}this._refreshValue()}else{if(this.options.values&&this.options.values.length){return this._values(a)}else{return this.value()}}}else{return this._values()}},_setOption:function(a,b){var i,valsLength=0;if(Array.isArray(this.options.values)){valsLength=this.options.values.length}$.Widget.prototype._setOption.apply(this,arguments);switch(a){case"disabled":if(b){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.attr("disabled","disabled");this.element.addClass("ui-disabled")}else{this.handles.removeAttr("disabled");this.element.removeClass("ui-disabled")}break;case"orientation":this._detectOrientation();this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case"isRTL":this.element.toggleClass("ui-slider-rtl",b);this._refreshValue();break;case"value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case"values":this._animateOff=true;this._refreshValue();for(i=0;i<valsLength;i+=1){this._change(null,i)}this._animateOff=false;break}},_value:function(){var a=this.options.value;a=this._trimAlignValue(a);return a},_values:function(a){var b,vals,i;if(arguments.length){b=this.options.values[a];b=this._trimAlignValue(b);return b}else{vals=this.options.values.slice();for(i=0;i<vals.length;i+=1){vals[i]=this._trimAlignValue(vals[i])}return vals}},_trimAlignValue:function(a){if(a<=this._valueMin()){return this._valueMin()}if(a>=this._valueMax()){return this._valueMax()}var b=(this.options.step>0)?this.options.step:1,valModStep=(a-this._valueMin())%b;alignValue=a-valModStep;if(Math.abs(valModStep)*2>=b){alignValue+=(valModStep>0)?b:(-b)}return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var a=this.options.range,o=this.options,self=this,animate=(!this._animateOff)?o.animate:false,valPercent,_set={},lastValPercent,value,valueMin,valueMax;if(this.options.values&&this.options.values.length){this.handles.each(function(i,j){valPercent=(self.values(i)-self._valueMin())/(self._valueMax()-self._valueMin())*100;valPercent=(self.options.isRTL?100-valPercent:valPercent);_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";$(this).stop(1,1)[animate?"animate":"css"](_set,o.animate);if(self.options.range===true){if(self.orientation==="horizontal"){if(i===0){self.range.stop(1,1)[animate?"animate":"css"](self.options.isRTL?{right:(100-valPercent)+"%"}:{left:valPercent+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({width:((self.options.isRTL?-1:+1)*(valPercent-lastValPercent))+"%"},{queue:false,duration:o.animate})}}else{if(i===0){self.range.stop(1,1)[animate?"animate":"css"](self.options.isRTL?{top:(100-valPercent)+"%"}:{bottom:(valPercent)+"%"},o.animate)}if(i===1){self.range[animate?"animate":"css"]({height:((self.options.isRTL?-1:+1)*(valPercent-lastValPercent))+"%"},{queue:false,duration:o.animate})}}}lastValPercent=valPercent})}else{value=this.value();valueMin=this._valueMin();valueMax=this._valueMax();valPercent=(valueMax!==valueMin)?(value-valueMin)/(valueMax-valueMin)*100:0;valPercent=(self.options.isRTL?100-valPercent:valPercent);_set[self.orientation==="horizontal"?"left":"bottom"]=valPercent+"%";this.handle.stop(1,1)[animate?"animate":"css"](_set,o.animate);if(a==="min"&&this.orientation==="horizontal"){this.range.stop(1,1)[animate?"animate":"css"]({width:(self.options.isRTL?100-valPercent:valPercent)+"%"},o.animate)}if(a==="max"&&this.orientation==="horizontal"){this.range[animate?"animate":"css"]({width:(self.options.isRTL?valPercent:100-valPercent)+"%"},{queue:false,duration:o.animate})}if(a==="min"&&this.orientation==="vertical"){this.range.stop(1,1)[animate?"animate":"css"]({height:(self.options.isRTL?100-valPercent:valPercent)+"%"},o.animate)}if(a==="max"&&this.orientation==="vertical"){this.range[animate?"animate":"css"]({height:(self.options.isRTL?valPercent:100-valPercent)+"%"},{queue:false,duration:o.animate})}}}});$.extend($.ui.slider,{version:"1.8.9"})}(jQuery));
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: a3rev, a3rev Software, nguyencongtuan
3
  Tags: a3 lazy load, Lazy Loading, image lazy load, lazyload
4
  Requires at least: 4.9
5
  Tested up to: 5.6
6
- Stable tag: 2.4.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -208,6 +208,28 @@ Filter tags to add to class name of theme to exclude lazy load on images or vide
208
 
209
  == Changelog ==
210
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
211
  = 2.4.2 - 2020/12/08 =
212
  * This maintenance release has tweaks and bug fixes for compatibility with WordPress major version 5.6, PHP 7.4.8 and WooCommerce 4.7.1
213
  * Tweak - Test and Tweak for compatibility with PHP 7.4.8
@@ -524,6 +546,9 @@ Filter tags to add to class name of theme to exclude lazy load on images or vide
524
 
525
  == Upgrade Notice ==
526
 
 
 
 
527
  = 2.4.2 =
528
  This maintenance release has tweaks and bug fixes for compatibility with WordPress major version 5.6, PHP 7.4.8 and WooCommerce 4.7.1
529
 
3
  Tags: a3 lazy load, Lazy Loading, image lazy load, lazyload
4
  Requires at least: 4.9
5
  Tested up to: 5.6
6
+ Stable tag: 2.4.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
9
 
208
 
209
  == Changelog ==
210
 
211
+ = 2.4.3 - 2020/12/30 =
212
+ * This is an important maintenance release that updates our scripts for compatibility with the latest version of jQuery released in WordPress 5.6
213
+ * Tweak - Update JavaScript on plugin framework for work compatibility with latest version of jQuery
214
+ * Fix - Replace .bind( event, handler ) by .on( event, handler ) for compatibility with latest version of jQuery
215
+ * Fix - Replace :eq() Selector by .eq() for compatibility with latest version of jQuery
216
+ * Fix - Replace .error() by .on( “error” ) for compatibility with latest version of jQuery
217
+ * Fix - Replace :first Selector by .first() for compatibility with latest version of jQuery
218
+ * Fix - Replace :gt(0) Selector by .slice(1) for compatibility with latest version of jQuery
219
+ * Fix - Remove jQuery.browser for compatibility with latest version of jQuery
220
+ * Fix - Replace jQuery.isArray() by Array.isArray() for compatibility with latest version of jQuery
221
+ * Fix - Replace jQuery.isFunction(x) by typeof x === “function” for compatibility with latest version of jQuery
222
+ * Fix - Replace jQuery.isNumeric(x) by typeof x === “number” for compatibility with latest version of jQuery
223
+ * Fix - Replace jQuery.now() by Date.now() for compatibility with latest version of jQuery
224
+ * Fix - Replace jQuery.parseJSON() by JSON.parse() for compatibility with latest version of jQuery
225
+ * Fix - Remove jQuery.support for compatibility with latest version of jQuery
226
+ * Fix - Replace jQuery.trim(x) by x.trim() for compatibility with latest version of jQuery
227
+ * Fix - Replace jQuery.type(x) by typeof x for compatibility with latest version of jQuery
228
+ * Fix - Replace .load( handler ) by .on( “load”, handler ) for compatibility with latest version of jQuery
229
+ * Fix - Replace .size() by .length for compatibility with latest version of jQuery
230
+ * Fix - Replace .unbind( event ) by .off( event ) for compatibility with latest version of jQuery
231
+ * Fix - Replace .unload( handler ) by .on( “unload”, handler ) for compatibility with latest version of jQuery
232
+
233
  = 2.4.2 - 2020/12/08 =
234
  * This maintenance release has tweaks and bug fixes for compatibility with WordPress major version 5.6, PHP 7.4.8 and WooCommerce 4.7.1
235
  * Tweak - Test and Tweak for compatibility with PHP 7.4.8
546
 
547
  == Upgrade Notice ==
548
 
549
+ = 2.4.3 =
550
+ This is an important maintenance release that updates our scripts for compatibility with the latest version of jQuery released in WordPress 5.6
551
+
552
  = 2.4.2 =
553
  This maintenance release has tweaks and bug fixes for compatibility with WordPress major version 5.6, PHP 7.4.8 and WooCommerce 4.7.1
554