Advanced Custom Fields: Font Awesome Field - Version 3.0.0-beta3

Version Description

  • Added new 'custom icon set' builder which allows FontAwesome ACF fields to be created with a limited set of icons individually selected from the full list of FontAwesome icons
  • Added field options to FontAwesome v5 fields to limit which of the icon sets ( Brands, Regular, Lite, Solid ) you want to allow in the field
  • Removing support for ACF v4 now that v5 is out with a free version
  • Performance improvements
Download this release

Release Info

Developer mattkeys
Plugin Icon 128x128 Advanced Custom Fields: Font Awesome Field
Version 3.0.0-beta3
Comparing to
See all releases

Code changes from version 3.0.0-beta2 to 3.0.0-beta3

Files changed (39) hide show
  1. acf-font-awesome.php +7 -4
  2. admin/class-ACFFA-Admin.php +362 -24
  3. assets/css/input.css +6 -22
  4. assets/inc/chosen/bower.json +0 -44
  5. assets/inc/chosen/chosen-sprite.png +0 -0
  6. assets/inc/chosen/chosen-sprite@2x.png +0 -0
  7. assets/inc/chosen/chosen.css +0 -476
  8. assets/inc/chosen/chosen.jquery.js +0 -1321
  9. assets/inc/chosen/chosen.jquery.min.js +0 -2
  10. assets/inc/chosen/chosen.min.css +0 -3
  11. assets/inc/chosen/chosen.proto.js +0 -1364
  12. assets/inc/chosen/chosen.proto.min.js +0 -2
  13. assets/inc/chosen/docsupport/chosen.png +0 -0
  14. assets/inc/chosen/docsupport/init.js +0 -11
  15. assets/inc/chosen/docsupport/init.proto.js +0 -16
  16. assets/inc/chosen/docsupport/oss-credit.png +0 -0
  17. assets/inc/chosen/docsupport/prism.css +0 -108
  18. assets/inc/chosen/docsupport/prism.js +0 -9
  19. assets/inc/chosen/docsupport/style.css +0 -219
  20. assets/inc/chosen/index.html +0 -1473
  21. assets/inc/chosen/index.proto.html +0 -1472
  22. assets/inc/chosen/options.html +0 -306
  23. assets/inc/class-ACFFA-Loader-4.php +21 -1
  24. assets/inc/class-ACFFA-Loader-5.php +28 -6
  25. assets/inc/multi-select/LICENSE.txt +25 -0
  26. assets/inc/multi-select/jquery.multi-select.js +544 -0
  27. assets/inc/multi-select/multi-select.css +114 -0
  28. assets/inc/multi-select/switch.png +0 -0
  29. assets/inc/quicksearch/README.markdown +161 -0
  30. assets/inc/quicksearch/jquery.quicksearch.js +181 -0
  31. assets/inc/spyc/COPYING +0 -0
  32. assets/inc/spyc/spyc.php +0 -0
  33. assets/js/input-v4.js +0 -131
  34. assets/js/input-v5.js +25 -5
  35. assets/js/settings.js +120 -0
  36. fields/acf-font-awesome-v4.php +0 -342
  37. fields/acf-font-awesome-v5.php +92 -47
  38. lang/acf-font-awesome.pot +2 -3
  39. readme.txt +17 -6
acf-font-awesome.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Advanced Custom Fields: Font Awesome
5
  Plugin URI: https://wordpress.org/plugins/advanced-custom-fields-font-awesome/
6
  Description: Adds a new 'Font Awesome Icon' field to the popular Advanced Custom Fields plugin.
7
- Version: 3.0.0-beta2
8
  Author: mattkeys
9
  Author URI: http://mattkeys.me/
10
  License: GPLv2 or later
@@ -15,6 +15,10 @@ if ( ! defined( 'ABSPATH' ) ) {
15
  exit;
16
  }
17
 
 
 
 
 
18
  if ( is_admin() ) {
19
  require 'admin/class-ACFFA-Admin.php';
20
  }
@@ -37,7 +41,7 @@ if ( ! class_exists('acf_plugin_font_awesome') ) :
37
  public function __construct()
38
  {
39
  $this->settings = array(
40
- 'version' => '3.0.0-beta2',
41
  'url' => plugin_dir_url( __FILE__ ),
42
  'path' => plugin_dir_path( __FILE__ )
43
  );
@@ -45,13 +49,12 @@ if ( ! class_exists('acf_plugin_font_awesome') ) :
45
  load_plugin_textdomain( 'acf-font-awesome', false, plugin_basename( dirname( __FILE__ ) ) . '/lang' );
46
 
47
  add_action('acf/include_field_types', array($this, 'include_field_types'), 10 ); // v5
48
- add_action('acf/register_fields', array($this, 'include_field_types'), 10 ); // v4
49
  }
50
 
51
  public function include_field_types( $version = false )
52
  {
53
  if ( ! $version ) {
54
- $version = 4;
55
  }
56
 
57
  include_once('fields/acf-font-awesome-v' . $version . '.php');
4
  Plugin Name: Advanced Custom Fields: Font Awesome
5
  Plugin URI: https://wordpress.org/plugins/advanced-custom-fields-font-awesome/
6
  Description: Adds a new 'Font Awesome Icon' field to the popular Advanced Custom Fields plugin.
7
+ Version: 3.0.0-beta3
8
  Author: mattkeys
9
  Author URI: http://mattkeys.me/
10
  License: GPLv2 or later
15
  exit;
16
  }
17
 
18
+ if ( ! defined( 'ACFFA_PUBLIC_PATH' ) ) {
19
+ define( 'ACFFA_PUBLIC_PATH', plugin_dir_url( __FILE__ ) );
20
+ }
21
+
22
  if ( is_admin() ) {
23
  require 'admin/class-ACFFA-Admin.php';
24
  }
41
  public function __construct()
42
  {
43
  $this->settings = array(
44
+ 'version' => '3.0.0-beta3',
45
  'url' => plugin_dir_url( __FILE__ ),
46
  'path' => plugin_dir_path( __FILE__ )
47
  );
49
  load_plugin_textdomain( 'acf-font-awesome', false, plugin_basename( dirname( __FILE__ ) ) . '/lang' );
50
 
51
  add_action('acf/include_field_types', array($this, 'include_field_types'), 10 ); // v5
 
52
  }
53
 
54
  public function include_field_types( $version = false )
55
  {
56
  if ( ! $version ) {
57
+ $version = 5;
58
  }
59
 
60
  include_once('fields/acf-font-awesome-v' . $version . '.php');
admin/class-ACFFA-Admin.php CHANGED
@@ -11,10 +11,53 @@
11
  class ACFFA_Admin
12
  {
13
 
 
 
14
  public function init()
15
  {
 
 
 
 
16
  add_action( 'admin_menu', array( $this, 'add_settings_page' ), 100 );
17
  add_action( 'admin_init', array( $this, 'register_settings' ) );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  }
19
 
20
  public function add_settings_page()
@@ -42,9 +85,9 @@ class ACFFA_Admin
42
 
43
  public function fontawesome_settings()
44
  {
45
- if ( isset( $_GET['settings-updated'] ) ) {
 
46
  add_settings_error( 'acffa_messages', 'acffa_message', __( 'Settings Saved', 'acf-font-awesome' ), 'updated' );
47
- do_action( 'ACFFA_refresh_latest_icons' );
48
  }
49
 
50
  settings_errors( 'acffa_messages' );
@@ -66,7 +109,13 @@ class ACFFA_Admin
66
 
67
  public function register_settings()
68
  {
69
- register_setting( 'acffa', 'acffa_settings' );
 
 
 
 
 
 
70
 
71
  add_settings_section(
72
  'acffa_section_developers',
@@ -98,13 +147,82 @@ class ACFFA_Admin
98
  'class' => 'acffa_row pro_icons'
99
  )
100
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  }
102
 
103
  public function acffa_section_developers_cb( $args )
104
  {
105
  ?>
106
  <p id="<?php echo esc_attr( $args['id'] ); ?>">
107
- <?php esc_html_e( 'FontAwesome underwent big changes with the release of version 5. It is best to choose a version and stick with it.', 'acf-font-awesome' ); ?><br>
108
  <em><?php _e( 'Any icon selections saved prior to switching versions will need to be re-selected and re-saved after switching.', 'acf-font-awesome' ); ?></em>
109
  </p>
110
  <?php
@@ -116,14 +234,12 @@ class ACFFA_Admin
116
  ?>
117
  <select id="<?php echo esc_attr( $args['label_for'] ); ?>" name="acffa_settings[<?php echo esc_attr( $args['label_for'] ); ?>]">
118
  <option value="4" <?php echo isset( $options[ $args[ 'label_for'] ] ) ? ( selected( $options[ $args[ 'label_for'] ], 4, false ) ) : ( '' ); ?>>
119
- <?php esc_html_e( '4.x', 'acf-font-awesome' ); ?>
120
  </option>
121
  <option value="5" <?php echo isset( $options[ $args[ 'label_for'] ] ) ? ( selected( $options[ $args[ 'label_for'] ], 5, false ) ) : ( '' ); ?>>
122
- <?php esc_html_e( '5.x', 'acf-font-awesome' ); ?>
123
  </option>
124
  </select>
125
-
126
-
127
  <?php
128
  }
129
 
@@ -131,7 +247,7 @@ class ACFFA_Admin
131
  {
132
  $options = get_option( 'acffa_settings' );
133
  ?>
134
- <p id="<?php echo esc_attr( $args['id'] ); ?>">
135
  <?php _e( 'If you have a FontAwesome Pro license, check the box below to enable the pro icons.', 'acf-font-awesome' ); ?><br>
136
  <em><?php _e( 'NOTE: You MUST add this domain in your FontAwesome "Pro CDN Domains" in order for this to work!', 'acf-font-awesome' ); ?></em>
137
  </p>
@@ -140,27 +256,249 @@ class ACFFA_Admin
140
  <input type="checkbox" value="1" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="acffa_settings[<?php echo esc_attr( $args['label_for'] ); ?>]" <?php echo isset( $options[ $args[ 'label_for'] ] ) ? ( checked( $options[ $args[ 'label_for'] ] ) ) : ( '' ); ?> />
141
  <label for="<?php echo esc_attr( $args['label_for'] ); ?>"><?php _e( 'I have enabled this domain for CDN use. Turn on the pro icons!', 'acf-font-awesome' ); ?></label>
142
  </p>
143
- <script>
144
- function evaluate_pro_visibility() {
145
- var selected_major_version = jQuery('#acffa_major_version').val();
 
 
 
 
 
 
 
 
 
 
 
 
146
 
147
- if ( 5 == selected_major_version ) {
148
- jQuery('.acffa_row.pro_icons').show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  } else {
150
- jQuery('.acffa_row.pro_icons').hide();
151
- jQuery('#pro_icons').prop( 'checked', false );
 
152
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
153
  }
 
 
 
 
 
 
 
 
 
 
 
 
154
 
155
- jQuery(document).ready( function() {
156
- evaluate_pro_visibility();
157
- });
158
 
159
- jQuery('#acffa_major_version').on( 'change', function() {
160
- evaluate_pro_visibility();
161
- });
162
- </script>
163
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  }
165
 
166
  }
11
  class ACFFA_Admin
12
  {
13
 
14
+ private $version;
15
+
16
  public function init()
17
  {
18
+ $this->version = 'v' . ACFFA_MAJOR_VERSION;
19
+
20
+ add_action( 'admin_notices', array( $this, 'maybe_notify_cdn_error' ) );
21
+ add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
22
  add_action( 'admin_menu', array( $this, 'add_settings_page' ), 100 );
23
  add_action( 'admin_init', array( $this, 'register_settings' ) );
24
+ add_filter( 'pre_update_option_acffa_settings', array( $this, 'intercept_icon_set_save' ), 10, 2 );
25
+ add_filter( 'pre_update_option_acffa_settings', array( $this, 'maybe_refresh_icons' ), 20, 2 );
26
+ add_action( 'wp_ajax_ACFFA_delete_icon_set', array( $this, 'ajax_remove_icon_set' ) );
27
+ }
28
+
29
+ public function maybe_notify_cdn_error()
30
+ {
31
+ if ( ! get_option( 'ACFFA_cdn_error' ) ) {
32
+ return;
33
+ }
34
+
35
+ delete_option( 'ACFFA_cdn_error' );
36
+ $curl_info = curl_version();
37
+ ?>
38
+ <div class="notice notice-error is-dismissible">
39
+ <p><?php echo __( 'The plugin "Advanced Custom Fields: Font Awesome" has detected an error while retrieving the latest FontAwesome icons. This may be due to temporary CDN downtime. However if problems persist, please contact your hosting provider to ensure cURL is installed and up to date. Detected cURL version: ', 'acf-font-awesome' ) . $curl_info['version']; ?></p>
40
+ </div>
41
+ <?php
42
+ }
43
+
44
+ public function enqueue_scripts( $hook )
45
+ {
46
+ if ( 'custom-fields_page_fontawesome-settings' != $hook ) {
47
+ return;
48
+ }
49
+
50
+ wp_register_style( 'font-awesome', apply_filters( 'ACFFA_get_fa_url', '' ) );
51
+ wp_enqueue_style( 'multi-select-css', ACFFA_PUBLIC_PATH . 'assets/inc/multi-select/multi-select.css', array( 'font-awesome' ) );
52
+
53
+ wp_register_script( 'quicksearch-js', ACFFA_PUBLIC_PATH . 'assets/inc/quicksearch/jquery.quicksearch.js', array( 'jquery' ), '1.0.0', true );
54
+ wp_register_script( 'multi-select-js', ACFFA_PUBLIC_PATH . 'assets/inc/multi-select/jquery.multi-select.js', array( 'jquery' ), '0.9.12', true );
55
+ wp_enqueue_script( 'acffa-settings', ACFFA_PUBLIC_PATH . 'assets/js/settings.js', array( 'multi-select-js', 'quicksearch-js' ), '1.0.0', true );
56
+ wp_localize_script( 'acffa-settings', 'ACFFA', array(
57
+ 'search_string' => __( 'Search List', 'acf-font-awesome' ),
58
+ 'confirm_delete' => __( 'Are you sure you want to delete this icon set?', 'acf-font-awesome' ),
59
+ 'delete_fail' => __( 'There was an error while trying to delete the icon set, please refresh the page and try again.', 'acf-font-awesome' )
60
+ ));
61
  }
62
 
63
  public function add_settings_page()
85
 
86
  public function fontawesome_settings()
87
  {
88
+ $errors = get_settings_errors( 'acffa_messages' );
89
+ if ( isset( $_GET['settings-updated'] ) && ! $errors ) {
90
  add_settings_error( 'acffa_messages', 'acffa_message', __( 'Settings Saved', 'acf-font-awesome' ), 'updated' );
 
91
  }
92
 
93
  settings_errors( 'acffa_messages' );
109
 
110
  public function register_settings()
111
  {
112
+ register_setting(
113
+ 'acffa',
114
+ 'acffa_settings',
115
+ array(
116
+ 'sanitize_callback' => array( $this, 'sanitize_new_icon_set' )
117
+ )
118
+ );
119
 
120
  add_settings_section(
121
  'acffa_section_developers',
147
  'class' => 'acffa_row pro_icons'
148
  )
149
  );
150
+
151
+ add_settings_section(
152
+ 'acffa_section_icon_set_builder',
153
+ __( 'Icon Set Builder', 'acf-font-awesome' ),
154
+ array( $this, 'acffa_section_icon_set_builder_cb' ),
155
+ 'acffa'
156
+ );
157
+
158
+ add_settings_field(
159
+ 'acffa_new_icon_set_label',
160
+ __( 'New Icon Set Label', 'acf-font-awesome' ),
161
+ array( $this, 'acffa_new_icon_set_label_cb' ),
162
+ 'acffa',
163
+ 'acffa_section_icon_set_builder',
164
+ array(
165
+ 'label_for' => 'acffa_new_icon_set_label',
166
+ 'class' => 'acffa_row custom-icon-set'
167
+ )
168
+ );
169
+
170
+ add_settings_field(
171
+ 'acffa_new_icon_set',
172
+ __( 'New Icon Set', 'acf-font-awesome' ),
173
+ array( $this, 'acffa_new_icon_set_cb' ),
174
+ 'acffa',
175
+ 'acffa_section_icon_set_builder',
176
+ array(
177
+ 'label_for' => 'acffa_new_icon_set',
178
+ 'class' => 'acffa_row custom-icon-set'
179
+ )
180
+ );
181
+
182
+ add_settings_field(
183
+ 'acffa_existing_icon_sets',
184
+ __( 'Existing Icon Sets', 'acf-font-awesome' ),
185
+ array( $this, 'acffa_existing_icon_sets_cb' ),
186
+ 'acffa',
187
+ 'acffa_section_icon_set_builder',
188
+ array(
189
+ 'label_for' => 'acffa_existing_icon_sets',
190
+ 'class' => 'acffa_row custom-icon-set'
191
+ )
192
+ );
193
+ }
194
+
195
+ public function sanitize_new_icon_set( $data )
196
+ {
197
+ if ( isset( $data['acffa_new_icon_set_label'] ) || ! empty( $data['acffa_new_icon_set_label'] ) ) {
198
+ $data['acffa_new_icon_set_label'] = sanitize_text_field( $data['acffa_new_icon_set_label'] );
199
+ } else {
200
+ $data['acffa_new_icon_set_label'] = false;
201
+ }
202
+
203
+ if ( isset( $data['acffa_new_icon_set'] ) || ! empty( $data['acffa_new_icon_set'] ) ) {
204
+ $data['acffa_new_icon_set'] = array_map(
205
+ 'sanitize_text_field',
206
+ wp_unslash( $data['acffa_new_icon_set'] )
207
+ );
208
+ } else {
209
+ $data['acffa_new_icon_set'] = false;
210
+ }
211
+
212
+ if ( $data['acffa_new_icon_set_label'] && ! $data['acffa_new_icon_set'] ) {
213
+ add_settings_error( 'acffa_messages', 'missing_label', __( 'Please select at least one icon when adding a new custom icon set.', 'acf-font-awesome' ), 'error' );
214
+ } else if ( $data['acffa_new_icon_set'] && ! $data['acffa_new_icon_set_label'] ) {
215
+ add_settings_error( 'acffa_messages', 'missing_icons', __( 'Label is required when adding a new custom icon set.', 'acf-font-awesome' ), 'error' );
216
+ }
217
+
218
+ return $data;
219
  }
220
 
221
  public function acffa_section_developers_cb( $args )
222
  {
223
  ?>
224
  <p id="<?php echo esc_attr( $args['id'] ); ?>">
225
+ <?php _e( 'FontAwesome underwent big changes with the release of version 5. It is best to choose a version and stick with it.', 'acf-font-awesome' ); ?><br>
226
  <em><?php _e( 'Any icon selections saved prior to switching versions will need to be re-selected and re-saved after switching.', 'acf-font-awesome' ); ?></em>
227
  </p>
228
  <?php
234
  ?>
235
  <select id="<?php echo esc_attr( $args['label_for'] ); ?>" name="acffa_settings[<?php echo esc_attr( $args['label_for'] ); ?>]">
236
  <option value="4" <?php echo isset( $options[ $args[ 'label_for'] ] ) ? ( selected( $options[ $args[ 'label_for'] ], 4, false ) ) : ( '' ); ?>>
237
+ <?php _e( '4.x', 'acf-font-awesome' ); ?>
238
  </option>
239
  <option value="5" <?php echo isset( $options[ $args[ 'label_for'] ] ) ? ( selected( $options[ $args[ 'label_for'] ], 5, false ) ) : ( '' ); ?>>
240
+ <?php _e( '5.x', 'acf-font-awesome' ); ?>
241
  </option>
242
  </select>
 
 
243
  <?php
244
  }
245
 
247
  {
248
  $options = get_option( 'acffa_settings' );
249
  ?>
250
+ <p>
251
  <?php _e( 'If you have a FontAwesome Pro license, check the box below to enable the pro icons.', 'acf-font-awesome' ); ?><br>
252
  <em><?php _e( 'NOTE: You MUST add this domain in your FontAwesome "Pro CDN Domains" in order for this to work!', 'acf-font-awesome' ); ?></em>
253
  </p>
256
  <input type="checkbox" value="1" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="acffa_settings[<?php echo esc_attr( $args['label_for'] ); ?>]" <?php echo isset( $options[ $args[ 'label_for'] ] ) ? ( checked( $options[ $args[ 'label_for'] ] ) ) : ( '' ); ?> />
257
  <label for="<?php echo esc_attr( $args['label_for'] ); ?>"><?php _e( 'I have enabled this domain for CDN use. Turn on the pro icons!', 'acf-font-awesome' ); ?></label>
258
  </p>
259
+ <?php
260
+ }
261
+
262
+ public function acffa_section_icon_set_builder_cb( $args )
263
+ {
264
+ ?>
265
+ <p id="<?php echo esc_attr( $args['id'] ); ?>">
266
+ <?php _e( 'Use the icon set builder to create custom collections of FontAwesome icons to be used in your ACF FontAwesome fields', 'acf-font-awesome' ); ?><br>
267
+ <em><?php _e( 'If you\'ve made changes the the FontAwesome version you are loading above, please refresh this page to see those changes reflected in the list below.', 'acf-font-awesome' ); ?></em>
268
+ </p>
269
+ <p class="icon-builder-complete-changes-notice">
270
+ <strong><?php _e( 'You must save your changes to the major version before using the icon set builder.', 'acf-font-awesome' ); ?></strong>
271
+ </p>
272
+ <?php
273
+ }
274
 
275
+ public function acffa_new_icon_set_label_cb( $args )
276
+ {
277
+ ?>
278
+ <input type="text" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="acffa_settings[<?php echo esc_attr( $args['label_for'] ); ?>]" placeholder="<?php _e( 'Custom Icon Set Name', 'acf-font-awesome' ); ?>">
279
+ <p>
280
+ <em><?php _e( 'NOTE: Providing a label that is already in use will overwrite the existing custom icon set.', 'acf-font-awesome' ); ?></em>
281
+ </p>
282
+ <?php
283
+ }
284
+
285
+ public function acffa_new_icon_set_cb( $args )
286
+ {
287
+ $options = get_option( 'acffa_settings' );
288
+ ?>
289
+ <select multiple="multiple" id="<?php echo esc_attr( $args['label_for'] ); ?>" name="acffa_settings[<?php echo esc_attr( $args['label_for'] ); ?>][]">
290
+ <?php
291
+ $fa_icons = apply_filters( 'ACFFA_get_icons', array() );
292
+ if ( $fa_icons ) {
293
+ if ( version_compare( ACFFA_MAJOR_VERSION, 5, '>=' ) ) {
294
+ foreach ( $fa_icons['list'] as $prefix => $icons ) {
295
+ $optgroup_label = apply_filters( 'ACFFA_icon_prefix_label', 'Regular', $prefix );
296
+ echo '<optgroup label="' . $optgroup_label . '">';
297
+
298
+ foreach( $icons as $k => $v ) {
299
+ $value = str_replace( array( 'fas ', 'far ', 'fab ', 'fal ', 'fa-' ), '', $k );
300
+ ?>
301
+ <option value="<?php echo $k; ?>"><?php echo $value; ?></option>
302
+ <?php
303
+ }
304
+
305
+ echo '</optgroup>';
306
+ }
307
+ } else {
308
+ foreach ( $fa_icons['list'] as $k => $v ) {
309
+ $value = str_replace( array( 'fa-' ), '', $k );
310
+ ?>
311
+ <option value="<?php echo $k; ?>"><?php echo $value; ?></option>
312
+ <?php
313
+ }
314
+ }
315
  } else {
316
+ ?>
317
+ <option value=""><?php _e( 'No Icons Found', 'acf-font-awesome' ); ?></option>
318
+ <?php
319
  }
320
+ ?>
321
+ </select>
322
+ <?php
323
+ }
324
+
325
+ public function acffa_existing_icon_sets_cb( $args )
326
+ {
327
+ $custom_icon_sets_list = get_option( 'ACFFA_custom_icon_sets_list' );
328
+
329
+ if ( isset( $custom_icon_sets_list[ $this->version ] ) && ! empty( $custom_icon_sets_list[ $this->version ] ) ) {
330
+ ?>
331
+ <ul class="existing-custom-icon-sets">
332
+ <?php
333
+ foreach ( $custom_icon_sets_list[ $this->version ] as $icon_set_name => $icon_set_label ) {
334
+ $icon_set = get_option( $icon_set_name );
335
+
336
+ if ( ! $icon_set ) {
337
+ $this->remove_icon_set( $custom_icon_sets_list, $icon_set_name, true );
338
+ }
339
+ ?>
340
+ <li class="icon-set" data-set-label="<?php echo esc_html( $icon_set_label ); ?>" data-set-name="<?php echo esc_html( $icon_set_name ); ?>">
341
+ <span><strong><?php echo esc_html( $icon_set_label ); ?></strong> <span class="actions">( <a href="#" class="edit-icon-set"><?php _e( 'Load For Editing', 'acf-font-awesome' ); ?></a> | <a href="#" class="view-icon-list"><?php _e( 'Toggle Icon List', 'acf-font-awesome' ); ?></a> | <a href="#" class="delete-icon-set" data-icon-set-name="<?php echo esc_html( $icon_set_name ); ?>" data-nonce="<?php echo wp_create_nonce( 'acffa_delete_set_' . $icon_set_name ); ?>"><?php _e( 'Delete Icon Set', 'acf-font-awesome' ); ?></a> )</span></span>
342
+ <ul class="icon-list">
343
+ <?php
344
+ if ( version_compare( ACFFA_MAJOR_VERSION, 5, '>=' ) ) {
345
+ foreach ( $icon_set as $prefix => $icons ) {
346
+ ?>
347
+ <li>
348
+ <?php echo apply_filters( 'ACFFA_icon_prefix_label', 'Regular', $prefix ); ?>
349
+ <ul>
350
+ <?php
351
+ foreach ( $icons as $class => $label ) {
352
+ echo '<li class="icon" data-icon="' . $class . '">' . $label . '</li>';
353
+ }
354
+ ?>
355
+ </ul>
356
+ </li>
357
+ <?php
358
+ }
359
+ } else {
360
+ foreach ( $icon_set as $class => $label ) {
361
+ ?>
362
+ <li>
363
+ <?php
364
+ echo '<li class="icon" data-icon="' . $class . '">' . $label . '</li>';
365
+ ?>
366
+ </li>
367
+ <?php
368
+ }
369
+ }
370
+ ?>
371
+ </ul>
372
+ </li>
373
+ <?php
374
  }
375
+ ?>
376
+ </ul>
377
+ <?php
378
+ } else {
379
+ _e( 'No existing custom icon set(s) found.', 'acf-font-awesome' );
380
+ }
381
+ }
382
+
383
+ public function intercept_icon_set_save( $new_value, $old_value )
384
+ {
385
+ $label = $new_value['acffa_new_icon_set_label'];
386
+ $icons = $new_value['acffa_new_icon_set'];
387
 
388
+ unset( $new_value['acffa_new_icon_set_label'] );
389
+ unset( $new_value['acffa_new_icon_set'] );
 
390
 
391
+ if ( $label && $icons ) {
392
+ $this->save_new_icon_set( $label, $icons );
393
+ }
394
+
395
+ return $new_value;
396
+ }
397
+
398
+ public function maybe_refresh_icons( $new_value, $old_value )
399
+ {
400
+ $refresh_icons = false;
401
+
402
+ if ( $new_value['acffa_major_version'] !== $old_value['acffa_major_version'] ) {
403
+ $refresh_icons = true;
404
+ }
405
+
406
+ if ( ! $refresh_icons ) {
407
+ if ( ( isset( $new_value['acffa_pro_cdn'] ) && ! isset( $old_value['acffa_pro_cdn'] ) )
408
+ || ( ! isset( $new_value['acffa_pro_cdn'] ) && isset( $old_value['acffa_pro_cdn'] ) )
409
+ ) {
410
+ $refresh_icons = true;
411
+ }
412
+ }
413
+
414
+ if ( $refresh_icons ) {
415
+ do_action( 'ACFFA_refresh_latest_icons' );
416
+ }
417
+
418
+ return $new_value;
419
+ }
420
+
421
+ private function save_new_icon_set( $label, $icons )
422
+ {
423
+ $new_icon_set = array();
424
+
425
+ $fa_icons = apply_filters( 'ACFFA_get_icons', array() );
426
+
427
+ if ( version_compare( ACFFA_MAJOR_VERSION, 5, '>=' ) ) {
428
+ foreach( $icons as $icon ) {
429
+ $prefix = substr( $icon, 0, 3 );
430
+
431
+ if ( isset( $fa_icons['list'][ $prefix ][ $icon ] ) ) {
432
+ if ( ! isset( $new_icon_set[ $prefix ] ) ) {
433
+ $new_icon_set[ $prefix ] = array();
434
+ }
435
+ $new_icon_set[ $prefix ][ $icon ] = $fa_icons['list'][ $prefix ][ $icon ];
436
+ }
437
+ }
438
+ } else {
439
+ foreach( $icons as $icon ) {
440
+ if ( isset( $fa_icons['list'][ $icon ] ) ) {
441
+ $new_icon_set[ $icon ] = $fa_icons['list'][ $icon ];
442
+ }
443
+ }
444
+ }
445
+
446
+ if ( ! empty( $new_icon_set ) ) {
447
+ $option_name = 'ACFFA_custom_icon_list_' . $this->version . '_' . sanitize_html_class( $label );
448
+ update_option( $option_name, $new_icon_set, false );
449
+ $this->update_custom_icon_sets_list( $option_name, $label );
450
+ }
451
+ }
452
+
453
+ private function update_custom_icon_sets_list( $option_name, $label )
454
+ {
455
+ $icon_sets_list = get_option( 'ACFFA_custom_icon_sets_list' );
456
+
457
+ if ( ! $icon_sets_list ) {
458
+ $icon_sets_list = array();
459
+ }
460
+
461
+ if ( ! isset( $icon_sets_list[ $this->version ] ) ) {
462
+ $icon_sets_list[ $this->version ] = array();
463
+ }
464
+
465
+ if ( ! isset( $icon_sets_list[ $this->version ][ 'ACFFA_custom_icon_list_' . $option_name ] ) ) {
466
+ $icon_sets_list[ $this->version ][ $option_name ] = $label;
467
+ }
468
+
469
+ update_option( 'ACFFA_custom_icon_sets_list', $icon_sets_list, false );
470
+ }
471
+
472
+ private function remove_icon_set( $custom_icon_sets_list = false, $icon_set_name, $list_only = false )
473
+ {
474
+ if ( ! $custom_icon_sets_list ) {
475
+ $custom_icon_sets_list = get_option( 'ACFFA_custom_icon_sets_list' );
476
+ }
477
+
478
+ if ( ! isset( $custom_icon_sets_list[ $this->version ][ $icon_set_name ] ) ) {
479
+ return;
480
+ }
481
+
482
+ unset( $custom_icon_sets_list[ $this->version ][ $icon_set_name ] );
483
+
484
+ update_option( 'ACFFA_custom_icon_sets_list', $custom_icon_sets_list );
485
+
486
+ if ( ! $list_only ) {
487
+ delete_option( $icon_set_name );
488
+ }
489
+ }
490
+
491
+ public function ajax_remove_icon_set()
492
+ {
493
+ $valid_nonce = check_ajax_referer( 'acffa_delete_set_' . $_POST['icon_set_name'], 'nonce', false );
494
+
495
+ if ( ! $valid_nonce ) {
496
+ wp_die( 'fail' );
497
+ }
498
+
499
+ $this->remove_icon_set( false, $_POST['icon_set_name'] );
500
+
501
+ wp_die( 'success' );
502
  }
503
 
504
  }
assets/css/input.css CHANGED
@@ -4,6 +4,11 @@
4
  font-size: 50px;
5
  }
6
 
 
 
 
 
 
7
  .acf-input .icon_preview i {
8
  margin: 0 0 10px 0;
9
  }
@@ -13,15 +18,11 @@
13
  margin: 0 0 10px 0;
14
  }
15
 
16
- .field_option_font-awesome .chosen-container.fa4,
17
- .field_type-font-awesome .chosen-container.fa4,
18
  .fa-select2.fa4,
19
  .fa-select2-drop.fa4 {
20
  font-family: FontAwesome,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
21
  }
22
 
23
- .field_option_font-awesome .chosen-container.fa5,
24
- .field_type-font-awesome .chosen-container.fa5,
25
  .fa-select2.fa5,
26
  .fa-select2-drop.fa5 {
27
  font-family: "Font Awesome 5 Brands","Font Awesome 5 Free",-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
@@ -30,21 +31,4 @@
30
  .fa-select2.fa5 i.fas,
31
  .fa-select2-drop.fa5 i.fas {
32
  font-weight: 900;
33
- }
34
-
35
- .field_option_font-awesome .chosen-container.fa5 .chosen-results li,
36
- .field_type-font-awesome .chosen-container.fa5 .chosen-results li {
37
- font-weight: normal;
38
- }
39
-
40
- .field_option_font-awesome .chosen-container.fa5 .chosen-results li.fas:before,
41
- .field_type-font-awesome .chosen-container.fa5 .chosen-results li.fas:before {
42
- font-weight: 900;
43
- }
44
-
45
- .field_option_font-awesome .chosen-container.fa5 .chosen-results li:before,
46
- .field_type-font-awesome .chosen-container.fa5 .chosen-results li:before {
47
- display: inline-block;
48
- width: 20px;
49
- text-align: center;
50
- }
4
  font-size: 50px;
5
  }
6
 
7
+ .acf-field-object-font-awesome .acf-field-setting-default_label,
8
+ .acf-field-object-font-awesome .acf-field-setting-custom_icon_sets {
9
+ display: none;
10
+ }
11
+
12
  .acf-input .icon_preview i {
13
  margin: 0 0 10px 0;
14
  }
18
  margin: 0 0 10px 0;
19
  }
20
 
 
 
21
  .fa-select2.fa4,
22
  .fa-select2-drop.fa4 {
23
  font-family: FontAwesome,-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
24
  }
25
 
 
 
26
  .fa-select2.fa5,
27
  .fa-select2-drop.fa5 {
28
  font-family: "Font Awesome 5 Brands","Font Awesome 5 Free",-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
31
  .fa-select2.fa5 i.fas,
32
  .fa-select2-drop.fa5 i.fas {
33
  font-weight: 900;
34
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/bower.json DELETED
@@ -1,44 +0,0 @@
1
- {
2
- "name": "chosen",
3
- "description": "Chosen is a JavaScript plugin that makes select boxes user-friendly. It is currently available in both jQuery and Prototype flavors.",
4
- "keywords": [
5
- "select",
6
- "multiselect",
7
- "dropdown",
8
- "form",
9
- "input",
10
- "ui"
11
- ],
12
- "homepage": "https://harvesthq.github.io/chosen/",
13
- "license": "https://github.com/harvesthq/chosen/blob/master/LICENSE.md",
14
- "authors": [
15
- {
16
- "name": "Patrick Filler",
17
- "url": "https://github.com/pfiller"
18
- },
19
- {
20
- "name": "Christophe Coevoet",
21
- "url": "https://github.com/stof"
22
- },
23
- {
24
- "name": "Ken Earley",
25
- "url": "https://github.com/kenearley"
26
- },
27
- {
28
- "name": "Koen Punt",
29
- "url": "https://github.com/koenpunt"
30
- }
31
- ],
32
- "dependencies": {},
33
- "main": [
34
- "chosen.jquery.js",
35
- "chosen.css",
36
- "chosen-sprite@2x.png",
37
- "chosen-sprite.png"
38
- ],
39
- "ignore": [],
40
- "repository": {
41
- "type": "git",
42
- "url": "https://github.com/harvesthq/chosen.git"
43
- }
44
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/chosen-sprite.png DELETED
Binary file
assets/inc/chosen/chosen-sprite@2x.png DELETED
Binary file
assets/inc/chosen/chosen.css DELETED
@@ -1,476 +0,0 @@
1
- /*!
2
- Chosen, a Select Box Enhancer for jQuery and Prototype
3
- by Patrick Filler for Harvest, http://getharvest.com
4
-
5
- Version 1.7.0
6
- Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011-2017 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
- /* @group Base */
14
- .chosen-container {
15
- position: relative;
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
- box-sizing: border-box;
27
- }
28
-
29
- .chosen-container .chosen-drop {
30
- position: absolute;
31
- top: 100%;
32
- z-index: 1010;
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
- clip: rect(0, 0, 0, 0);
39
- }
40
-
41
- .chosen-container.chosen-with-drop .chosen-drop {
42
- clip: auto;
43
- }
44
-
45
- .chosen-container a {
46
- cursor: pointer;
47
- }
48
-
49
- .chosen-container .search-choice .group-name, .chosen-container .chosen-single .group-name {
50
- margin-right: 4px;
51
- overflow: hidden;
52
- white-space: nowrap;
53
- text-overflow: ellipsis;
54
- font-weight: normal;
55
- color: #999999;
56
- }
57
-
58
- .chosen-container .search-choice .group-name:after, .chosen-container .chosen-single .group-name:after {
59
- content: ":";
60
- padding-left: 2px;
61
- vertical-align: top;
62
- }
63
-
64
- /* @end */
65
- /* @group Single Chosen */
66
- .chosen-container-single .chosen-single {
67
- position: relative;
68
- display: block;
69
- overflow: hidden;
70
- padding: 0 0 0 8px;
71
- height: 25px;
72
- border: 1px solid #aaa;
73
- border-radius: 5px;
74
- background-color: #fff;
75
- background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
76
- background-clip: padding-box;
77
- box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
78
- color: #444;
79
- text-decoration: none;
80
- white-space: nowrap;
81
- line-height: 24px;
82
- }
83
-
84
- .chosen-container-single .chosen-default {
85
- color: #999;
86
- }
87
-
88
- .chosen-container-single .chosen-single span {
89
- display: block;
90
- overflow: hidden;
91
- margin-right: 26px;
92
- text-overflow: ellipsis;
93
- white-space: nowrap;
94
- }
95
-
96
- .chosen-container-single .chosen-single-with-deselect span {
97
- margin-right: 38px;
98
- }
99
-
100
- .chosen-container-single .chosen-single abbr {
101
- position: absolute;
102
- top: 6px;
103
- right: 26px;
104
- display: block;
105
- width: 12px;
106
- height: 12px;
107
- background: url("chosen-sprite.png") -42px 1px no-repeat;
108
- font-size: 1px;
109
- }
110
-
111
- .chosen-container-single .chosen-single abbr:hover {
112
- background-position: -42px -10px;
113
- }
114
-
115
- .chosen-container-single.chosen-disabled .chosen-single abbr:hover {
116
- background-position: -42px -10px;
117
- }
118
-
119
- .chosen-container-single .chosen-single div {
120
- position: absolute;
121
- top: 0;
122
- right: 0;
123
- display: block;
124
- width: 18px;
125
- height: 100%;
126
- }
127
-
128
- .chosen-container-single .chosen-single div b {
129
- display: block;
130
- width: 100%;
131
- height: 100%;
132
- background: url("chosen-sprite.png") no-repeat 0px 2px;
133
- }
134
-
135
- .chosen-container-single .chosen-search {
136
- position: relative;
137
- z-index: 1010;
138
- margin: 0;
139
- padding: 3px 4px;
140
- white-space: nowrap;
141
- }
142
-
143
- .chosen-container-single .chosen-search input[type="text"] {
144
- margin: 1px 0;
145
- padding: 4px 20px 4px 5px;
146
- width: 100%;
147
- height: auto;
148
- outline: 0;
149
- border: 1px solid #aaa;
150
- background: url("chosen-sprite.png") no-repeat 100% -20px;
151
- font-size: 1em;
152
- font-family: sans-serif;
153
- line-height: normal;
154
- border-radius: 0;
155
- }
156
-
157
- .chosen-container-single .chosen-drop {
158
- margin-top: -1px;
159
- border-radius: 0 0 4px 4px;
160
- background-clip: padding-box;
161
- }
162
-
163
- .chosen-container-single.chosen-container-single-nosearch .chosen-search {
164
- position: absolute;
165
- clip: rect(0, 0, 0, 0);
166
- }
167
-
168
- /* @end */
169
- /* @group Results */
170
- .chosen-container .chosen-results {
171
- color: #444;
172
- position: relative;
173
- overflow-x: hidden;
174
- overflow-y: auto;
175
- margin: 0 4px 4px 0;
176
- padding: 0 0 0 4px;
177
- max-height: 240px;
178
- -webkit-overflow-scrolling: touch;
179
- }
180
-
181
- .chosen-container .chosen-results li {
182
- display: none;
183
- margin: 0;
184
- padding: 5px 6px;
185
- list-style: none;
186
- line-height: 15px;
187
- word-wrap: break-word;
188
- -webkit-touch-callout: none;
189
- }
190
-
191
- .chosen-container .chosen-results li.active-result {
192
- display: list-item;
193
- cursor: pointer;
194
- }
195
-
196
- .chosen-container .chosen-results li.disabled-result {
197
- display: list-item;
198
- color: #ccc;
199
- cursor: default;
200
- }
201
-
202
- .chosen-container .chosen-results li.highlighted {
203
- background-color: #3875d7;
204
- background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
205
- color: #fff;
206
- }
207
-
208
- .chosen-container .chosen-results li.no-results {
209
- color: #777;
210
- display: list-item;
211
- background: #f4f4f4;
212
- }
213
-
214
- .chosen-container .chosen-results li.group-result {
215
- display: list-item;
216
- font-weight: bold;
217
- cursor: default;
218
- }
219
-
220
- .chosen-container .chosen-results li.group-option {
221
- padding-left: 15px;
222
- }
223
-
224
- .chosen-container .chosen-results li em {
225
- font-style: normal;
226
- text-decoration: underline;
227
- }
228
-
229
- /* @end */
230
- /* @group Multi Chosen */
231
- .chosen-container-multi .chosen-choices {
232
- position: relative;
233
- overflow: hidden;
234
- margin: 0;
235
- padding: 0 5px;
236
- width: 100%;
237
- height: auto;
238
- border: 1px solid #aaa;
239
- background-color: #fff;
240
- background-image: linear-gradient(#eee 1%, #fff 15%);
241
- cursor: text;
242
- }
243
-
244
- .chosen-container-multi .chosen-choices li {
245
- float: left;
246
- list-style: none;
247
- }
248
-
249
- .chosen-container-multi .chosen-choices li.search-field {
250
- margin: 0;
251
- padding: 0;
252
- white-space: nowrap;
253
- }
254
-
255
- .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
256
- margin: 1px 0;
257
- padding: 0;
258
- height: 25px;
259
- outline: 0;
260
- border: 0 !important;
261
- background: transparent !important;
262
- box-shadow: none;
263
- color: #999;
264
- font-size: 100%;
265
- font-family: sans-serif;
266
- line-height: normal;
267
- border-radius: 0;
268
- width: 25px;
269
- }
270
-
271
- .chosen-container-multi .chosen-choices li.search-choice {
272
- position: relative;
273
- margin: 3px 5px 3px 0;
274
- padding: 3px 20px 3px 5px;
275
- border: 1px solid #aaa;
276
- max-width: 100%;
277
- border-radius: 3px;
278
- background-color: #eeeeee;
279
- background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
280
- background-size: 100% 19px;
281
- background-repeat: repeat-x;
282
- background-clip: padding-box;
283
- box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
284
- color: #333;
285
- line-height: 13px;
286
- cursor: default;
287
- }
288
-
289
- .chosen-container-multi .chosen-choices li.search-choice span {
290
- word-wrap: break-word;
291
- }
292
-
293
- .chosen-container-multi .chosen-choices li.search-choice .search-choice-close {
294
- position: absolute;
295
- top: 4px;
296
- right: 3px;
297
- display: block;
298
- width: 12px;
299
- height: 12px;
300
- background: url("chosen-sprite.png") -42px 1px no-repeat;
301
- font-size: 1px;
302
- }
303
-
304
- .chosen-container-multi .chosen-choices li.search-choice .search-choice-close:hover {
305
- background-position: -42px -10px;
306
- }
307
-
308
- .chosen-container-multi .chosen-choices li.search-choice-disabled {
309
- padding-right: 5px;
310
- border: 1px solid #ccc;
311
- background-color: #e4e4e4;
312
- background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
313
- color: #666;
314
- }
315
-
316
- .chosen-container-multi .chosen-choices li.search-choice-focus {
317
- background: #d4d4d4;
318
- }
319
-
320
- .chosen-container-multi .chosen-choices li.search-choice-focus .search-choice-close {
321
- background-position: -42px -10px;
322
- }
323
-
324
- .chosen-container-multi .chosen-results {
325
- margin: 0;
326
- padding: 0;
327
- }
328
-
329
- .chosen-container-multi .chosen-drop .result-selected {
330
- display: list-item;
331
- color: #ccc;
332
- cursor: default;
333
- }
334
-
335
- /* @end */
336
- /* @group Active */
337
- .chosen-container-active .chosen-single {
338
- border: 1px solid #5897fb;
339
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
340
- }
341
-
342
- .chosen-container-active.chosen-with-drop .chosen-single {
343
- border: 1px solid #aaa;
344
- border-bottom-right-radius: 0;
345
- border-bottom-left-radius: 0;
346
- background-image: linear-gradient(#eee 20%, #fff 80%);
347
- box-shadow: 0 1px 0 #fff inset;
348
- }
349
-
350
- .chosen-container-active.chosen-with-drop .chosen-single div {
351
- border-left: none;
352
- background: transparent;
353
- }
354
-
355
- .chosen-container-active.chosen-with-drop .chosen-single div b {
356
- background-position: -18px 2px;
357
- }
358
-
359
- .chosen-container-active .chosen-choices {
360
- border: 1px solid #5897fb;
361
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
362
- }
363
-
364
- .chosen-container-active .chosen-choices li.search-field input[type="text"] {
365
- color: #222 !important;
366
- }
367
-
368
- /* @end */
369
- /* @group Disabled Support */
370
- .chosen-disabled {
371
- opacity: 0.5 !important;
372
- cursor: default;
373
- }
374
-
375
- .chosen-disabled .chosen-single {
376
- cursor: default;
377
- }
378
-
379
- .chosen-disabled .chosen-choices .search-choice .search-choice-close {
380
- cursor: default;
381
- }
382
-
383
- /* @end */
384
- /* @group Right to Left */
385
- .chosen-rtl {
386
- text-align: right;
387
- }
388
-
389
- .chosen-rtl .chosen-single {
390
- overflow: visible;
391
- padding: 0 8px 0 0;
392
- }
393
-
394
- .chosen-rtl .chosen-single span {
395
- margin-right: 0;
396
- margin-left: 26px;
397
- direction: rtl;
398
- }
399
-
400
- .chosen-rtl .chosen-single-with-deselect span {
401
- margin-left: 38px;
402
- }
403
-
404
- .chosen-rtl .chosen-single div {
405
- right: auto;
406
- left: 3px;
407
- }
408
-
409
- .chosen-rtl .chosen-single abbr {
410
- right: auto;
411
- left: 26px;
412
- }
413
-
414
- .chosen-rtl .chosen-choices li {
415
- float: right;
416
- }
417
-
418
- .chosen-rtl .chosen-choices li.search-field input[type="text"] {
419
- direction: rtl;
420
- }
421
-
422
- .chosen-rtl .chosen-choices li.search-choice {
423
- margin: 3px 5px 3px 0;
424
- padding: 3px 5px 3px 19px;
425
- }
426
-
427
- .chosen-rtl .chosen-choices li.search-choice .search-choice-close {
428
- right: auto;
429
- left: 4px;
430
- }
431
-
432
- .chosen-rtl.chosen-container-single .chosen-results {
433
- margin: 0 0 4px 4px;
434
- padding: 0 4px 0 0;
435
- }
436
-
437
- .chosen-rtl .chosen-results li.group-option {
438
- padding-right: 15px;
439
- padding-left: 0;
440
- }
441
-
442
- .chosen-rtl.chosen-container-active.chosen-with-drop .chosen-single div {
443
- border-right: none;
444
- }
445
-
446
- .chosen-rtl .chosen-search input[type="text"] {
447
- padding: 4px 5px 4px 20px;
448
- background: url("chosen-sprite.png") no-repeat -30px -20px;
449
- direction: rtl;
450
- }
451
-
452
- .chosen-rtl.chosen-container-single .chosen-single div b {
453
- background-position: 6px 2px;
454
- }
455
-
456
- .chosen-rtl.chosen-container-single.chosen-with-drop .chosen-single div b {
457
- background-position: -12px 2px;
458
- }
459
-
460
- /* @end */
461
- /* @group Retina compatibility */
462
- @media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
463
- .chosen-rtl .chosen-search input[type="text"],
464
- .chosen-container-single .chosen-single abbr,
465
- .chosen-container-single .chosen-single div b,
466
- .chosen-container-single .chosen-search input[type="text"],
467
- .chosen-container-multi .chosen-choices .search-choice .search-choice-close,
468
- .chosen-container .chosen-results-scroll-down span,
469
- .chosen-container .chosen-results-scroll-up span {
470
- background-image: url("chosen-sprite@2x.png") !important;
471
- background-size: 52px 37px !important;
472
- background-repeat: no-repeat !important;
473
- }
474
- }
475
-
476
- /* @end */
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/chosen.jquery.js DELETED
@@ -1,1321 +0,0 @@
1
- /*!
2
- Chosen, a Select Box Enhancer for jQuery and Prototype
3
- by Patrick Filler for Harvest, http://getharvest.com
4
-
5
- Version 1.7.0
6
- Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011-2017 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
- __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
16
- __hasProp = {}.hasOwnProperty,
17
- __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; };
18
-
19
- SelectParser = (function() {
20
- function SelectParser() {
21
- this.options_index = 0;
22
- this.parsed = [];
23
- }
24
-
25
- SelectParser.prototype.add_node = function(child) {
26
- if (child.nodeName.toUpperCase() === "OPTGROUP") {
27
- return this.add_group(child);
28
- } else {
29
- return this.add_option(child);
30
- }
31
- };
32
-
33
- SelectParser.prototype.add_group = function(group) {
34
- var group_position, option, _i, _len, _ref, _results;
35
- group_position = this.parsed.length;
36
- this.parsed.push({
37
- array_index: group_position,
38
- group: true,
39
- label: this.escapeExpression(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
- _results = [];
47
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
48
- option = _ref[_i];
49
- _results.push(this.add_option(option, group_position, group.disabled));
50
- }
51
- return _results;
52
- };
53
-
54
- SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
55
- if (option.nodeName.toUpperCase() === "OPTION") {
56
- if (option.text !== "") {
57
- if (group_position != null) {
58
- this.parsed[group_position].children += 1;
59
- }
60
- this.parsed.push({
61
- array_index: this.parsed.length,
62
- options_index: this.options_index,
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
- });
74
- } else {
75
- this.parsed.push({
76
- array_index: this.parsed.length,
77
- options_index: this.options_index,
78
- empty: true
79
- });
80
- }
81
- return this.options_index += 1;
82
- }
83
- };
84
-
85
- SelectParser.prototype.escapeExpression = function(text) {
86
- var map, unsafe_chars;
87
- if ((text == null) || text === false) {
88
- return "";
89
- }
90
- if (!/[\&\<\>\"\'\`]/.test(text)) {
91
- return text;
92
- }
93
- map = {
94
- "<": "&lt;",
95
- ">": "&gt;",
96
- '"': "&quot;",
97
- "'": "&#x27;",
98
- "`": "&#x60;"
99
- };
100
- unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
101
- return text.replace(unsafe_chars, function(chr) {
102
- return map[chr] || "&amp;";
103
- });
104
- };
105
-
106
- return SelectParser;
107
-
108
- })();
109
-
110
- SelectParser.select_to_array = function(select) {
111
- var child, parser, _i, _len, _ref;
112
- parser = new SelectParser();
113
- _ref = select.childNodes;
114
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
115
- child = _ref[_i];
116
- parser.add_node(child);
117
- }
118
- return parser.parsed;
119
- };
120
-
121
- AbstractChosen = (function() {
122
- function AbstractChosen(form_field, options) {
123
- this.form_field = form_field;
124
- this.options = options != null ? options : {};
125
- this.label_click_handler = __bind(this.label_click_handler, this);
126
- if (!AbstractChosen.browser_is_supported()) {
127
- return;
128
- }
129
- this.is_multiple = this.form_field.multiple;
130
- this.set_default_text();
131
- this.set_default_values();
132
- this.setup();
133
- this.set_up_html();
134
- this.register_observers();
135
- this.on_ready();
136
- }
137
-
138
- AbstractChosen.prototype.set_default_values = function() {
139
- var _this = this;
140
- this.click_test_action = function(evt) {
141
- return _this.test_active_click(evt);
142
- };
143
- this.activate_action = function(evt) {
144
- return _this.activate_field(evt);
145
- };
146
- this.active_field = false;
147
- this.mouse_on_container = false;
148
- this.results_showing = false;
149
- this.result_highlighted = null;
150
- this.is_rtl = this.options.rtl || /\bchosen-rtl\b/.test(this.form_field.className);
151
- 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;
152
- this.disable_search_threshold = this.options.disable_search_threshold || 0;
153
- this.disable_search = this.options.disable_search || false;
154
- this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
155
- this.group_search = this.options.group_search != null ? this.options.group_search : true;
156
- this.search_contains = this.options.search_contains || false;
157
- this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
158
- this.max_selected_options = this.options.max_selected_options || Infinity;
159
- this.inherit_select_classes = this.options.inherit_select_classes || false;
160
- this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
161
- this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
162
- this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
163
- this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
164
- this.case_sensitive_search = this.options.case_sensitive_search || false;
165
- return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;
166
- };
167
-
168
- AbstractChosen.prototype.set_default_text = function() {
169
- if (this.form_field.getAttribute("data-placeholder")) {
170
- this.default_text = this.form_field.getAttribute("data-placeholder");
171
- } else if (this.is_multiple) {
172
- this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
173
- } else {
174
- this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
175
- }
176
- this.default_text = this.escape_html(this.default_text);
177
- return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
178
- };
179
-
180
- AbstractChosen.prototype.choice_label = function(item) {
181
- if (this.include_group_label_in_selected && (item.group_label != null)) {
182
- return "<b class='group-name'>" + item.group_label + "</b>" + item.html;
183
- } else {
184
- return item.html;
185
- }
186
- };
187
-
188
- AbstractChosen.prototype.mouse_enter = function() {
189
- return this.mouse_on_container = true;
190
- };
191
-
192
- AbstractChosen.prototype.mouse_leave = function() {
193
- return this.mouse_on_container = false;
194
- };
195
-
196
- AbstractChosen.prototype.input_focus = function(evt) {
197
- var _this = this;
198
- if (this.is_multiple) {
199
- if (!this.active_field) {
200
- return setTimeout((function() {
201
- return _this.container_mousedown();
202
- }), 50);
203
- }
204
- } else {
205
- if (!this.active_field) {
206
- return this.activate_field();
207
- }
208
- }
209
- };
210
-
211
- AbstractChosen.prototype.input_blur = function(evt) {
212
- var _this = this;
213
- if (!this.mouse_on_container) {
214
- this.active_field = false;
215
- return setTimeout((function() {
216
- return _this.blur_test();
217
- }), 100);
218
- }
219
- };
220
-
221
- AbstractChosen.prototype.label_click_handler = function(evt) {
222
- if (this.is_multiple) {
223
- return this.container_mousedown(evt);
224
- } else {
225
- return this.activate_field();
226
- }
227
- };
228
-
229
- AbstractChosen.prototype.results_option_build = function(options) {
230
- var content, data, data_content, shown_results, _i, _len, _ref;
231
- content = '';
232
- shown_results = 0;
233
- _ref = this.results_data;
234
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
235
- data = _ref[_i];
236
- data_content = '';
237
- if (data.group) {
238
- data_content = this.result_add_group(data);
239
- } else {
240
- data_content = this.result_add_option(data);
241
- }
242
- if (data_content !== '') {
243
- shown_results++;
244
- content += data_content;
245
- }
246
- if (options != null ? options.first : void 0) {
247
- if (data.selected && this.is_multiple) {
248
- this.choice_build(data);
249
- } else if (data.selected && !this.is_multiple) {
250
- this.single_set_selected_text(this.choice_label(data));
251
- }
252
- }
253
- if (shown_results >= this.max_shown_results) {
254
- break;
255
- }
256
- }
257
- return content;
258
- };
259
-
260
- AbstractChosen.prototype.result_add_option = function(option) {
261
- var classes, option_el;
262
- if (!option.search_match) {
263
- return '';
264
- }
265
- if (!this.include_option_in_results(option)) {
266
- return '';
267
- }
268
- classes = [];
269
- if (!option.disabled && !(option.selected && this.is_multiple)) {
270
- classes.push("active-result");
271
- }
272
- if (option.disabled && !(option.selected && this.is_multiple)) {
273
- classes.push("disabled-result");
274
- }
275
- if (option.selected) {
276
- classes.push("result-selected");
277
- }
278
- if (option.group_array_index != null) {
279
- classes.push("group-option");
280
- }
281
- if (option.classes !== "") {
282
- classes.push(option.classes);
283
- }
284
- option_el = document.createElement("li");
285
- option_el.className = classes.join(" ");
286
- option_el.style.cssText = option.style;
287
- option_el.setAttribute("data-option-array-index", option.array_index);
288
- option_el.innerHTML = option.search_text;
289
- if (option.title) {
290
- option_el.title = option.title;
291
- }
292
- return this.outerHTML(option_el);
293
- };
294
-
295
- AbstractChosen.prototype.result_add_group = function(group) {
296
- var classes, group_el;
297
- if (!(group.search_match || group.group_match)) {
298
- return '';
299
- }
300
- if (!(group.active_options > 0)) {
301
- return '';
302
- }
303
- classes = [];
304
- classes.push("group-result");
305
- if (group.classes) {
306
- classes.push(group.classes);
307
- }
308
- group_el = document.createElement("li");
309
- group_el.className = classes.join(" ");
310
- group_el.innerHTML = group.search_text;
311
- if (group.title) {
312
- group_el.title = group.title;
313
- }
314
- return this.outerHTML(group_el);
315
- };
316
-
317
- AbstractChosen.prototype.results_update_field = function() {
318
- this.set_default_text();
319
- if (!this.is_multiple) {
320
- this.results_reset_cleanup();
321
- }
322
- this.result_clear_highlight();
323
- this.results_build();
324
- if (this.results_showing) {
325
- return this.winnow_results();
326
- }
327
- };
328
-
329
- AbstractChosen.prototype.reset_single_select_options = function() {
330
- var result, _i, _len, _ref, _results;
331
- _ref = this.results_data;
332
- _results = [];
333
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
334
- result = _ref[_i];
335
- if (result.selected) {
336
- _results.push(result.selected = false);
337
- } else {
338
- _results.push(void 0);
339
- }
340
- }
341
- return _results;
342
- };
343
-
344
- AbstractChosen.prototype.results_toggle = function() {
345
- if (this.results_showing) {
346
- return this.results_hide();
347
- } else {
348
- return this.results_show();
349
- }
350
- };
351
-
352
- AbstractChosen.prototype.results_search = function(evt) {
353
- if (this.results_showing) {
354
- return this.winnow_results();
355
- } else {
356
- return this.results_show();
357
- }
358
- };
359
-
360
- AbstractChosen.prototype.winnow_results = function() {
361
- var escapedSearchText, highlightRegex, option, regex, results, results_group, searchText, startpos, text, _i, _len, _ref;
362
- this.no_results_clear();
363
- results = 0;
364
- searchText = this.get_search_text();
365
- escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
366
- regex = this.get_search_regex(escapedSearchText);
367
- highlightRegex = this.get_highlight_regex(escapedSearchText);
368
- _ref = this.results_data;
369
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
370
- option = _ref[_i];
371
- option.search_match = false;
372
- results_group = null;
373
- if (this.include_option_in_results(option)) {
374
- if (option.group) {
375
- option.group_match = false;
376
- option.active_options = 0;
377
- }
378
- if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
379
- results_group = this.results_data[option.group_array_index];
380
- if (results_group.active_options === 0 && results_group.search_match) {
381
- results += 1;
382
- }
383
- results_group.active_options += 1;
384
- }
385
- option.search_text = option.group ? option.label : option.html;
386
- if (!(option.group && !this.group_search)) {
387
- option.search_match = this.search_string_match(option.search_text, regex);
388
- if (option.search_match && !option.group) {
389
- results += 1;
390
- }
391
- if (option.search_match) {
392
- if (searchText.length) {
393
- startpos = option.search_text.search(highlightRegex);
394
- text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
395
- option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
396
- }
397
- if (results_group != null) {
398
- results_group.group_match = true;
399
- }
400
- } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
401
- option.search_match = true;
402
- }
403
- }
404
- }
405
- }
406
- this.result_clear_highlight();
407
- if (results < 1 && searchText.length) {
408
- this.update_results_content("");
409
- return this.no_results(searchText);
410
- } else {
411
- this.update_results_content(this.results_option_build());
412
- return this.winnow_results_set_highlight();
413
- }
414
- };
415
-
416
- AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
417
- var regex_anchor, regex_flag;
418
- regex_anchor = this.search_contains ? "" : "^";
419
- regex_flag = this.case_sensitive_search ? "" : "i";
420
- return new RegExp(regex_anchor + escaped_search_string, regex_flag);
421
- };
422
-
423
- AbstractChosen.prototype.get_highlight_regex = function(escaped_search_string) {
424
- var regex_anchor, regex_flag;
425
- regex_anchor = this.search_contains ? "" : "\\b";
426
- regex_flag = this.case_sensitive_search ? "" : "i";
427
- return new RegExp(regex_anchor + escaped_search_string, regex_flag);
428
- };
429
-
430
- AbstractChosen.prototype.search_string_match = function(search_string, regex) {
431
- var part, parts, _i, _len;
432
- if (regex.test(search_string)) {
433
- return true;
434
- } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
435
- parts = search_string.replace(/\[|\]/g, "").split(" ");
436
- if (parts.length) {
437
- for (_i = 0, _len = parts.length; _i < _len; _i++) {
438
- part = parts[_i];
439
- if (regex.test(part)) {
440
- return true;
441
- }
442
- }
443
- }
444
- }
445
- };
446
-
447
- AbstractChosen.prototype.choices_count = function() {
448
- var option, _i, _len, _ref;
449
- if (this.selected_option_count != null) {
450
- return this.selected_option_count;
451
- }
452
- this.selected_option_count = 0;
453
- _ref = this.form_field.options;
454
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
455
- option = _ref[_i];
456
- if (option.selected) {
457
- this.selected_option_count += 1;
458
- }
459
- }
460
- return this.selected_option_count;
461
- };
462
-
463
- AbstractChosen.prototype.choices_click = function(evt) {
464
- evt.preventDefault();
465
- this.activate_field();
466
- if (!(this.results_showing || this.is_disabled)) {
467
- return this.results_show();
468
- }
469
- };
470
-
471
- AbstractChosen.prototype.keydown_checker = function(evt) {
472
- var stroke, _ref;
473
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
474
- this.search_field_scale();
475
- if (stroke !== 8 && this.pending_backstroke) {
476
- this.clear_backstroke();
477
- }
478
- switch (stroke) {
479
- case 8:
480
- this.backstroke_length = this.get_search_field_value().length;
481
- break;
482
- case 9:
483
- if (this.results_showing && !this.is_multiple) {
484
- this.result_select(evt);
485
- }
486
- this.mouse_on_container = false;
487
- break;
488
- case 13:
489
- if (this.results_showing) {
490
- evt.preventDefault();
491
- }
492
- break;
493
- case 27:
494
- if (this.results_showing) {
495
- evt.preventDefault();
496
- }
497
- break;
498
- case 32:
499
- if (this.disable_search) {
500
- evt.preventDefault();
501
- }
502
- break;
503
- case 38:
504
- evt.preventDefault();
505
- this.keyup_arrow();
506
- break;
507
- case 40:
508
- evt.preventDefault();
509
- this.keydown_arrow();
510
- break;
511
- }
512
- };
513
-
514
- AbstractChosen.prototype.keyup_checker = function(evt) {
515
- var stroke, _ref;
516
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
517
- this.search_field_scale();
518
- switch (stroke) {
519
- case 8:
520
- if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
521
- this.keydown_backstroke();
522
- } else if (!this.pending_backstroke) {
523
- this.result_clear_highlight();
524
- this.results_search();
525
- }
526
- break;
527
- case 13:
528
- evt.preventDefault();
529
- if (this.results_showing) {
530
- this.result_select(evt);
531
- }
532
- break;
533
- case 27:
534
- if (this.results_showing) {
535
- this.results_hide();
536
- }
537
- break;
538
- case 9:
539
- case 16:
540
- case 17:
541
- case 18:
542
- case 38:
543
- case 40:
544
- case 91:
545
- break;
546
- default:
547
- this.results_search();
548
- break;
549
- }
550
- };
551
-
552
- AbstractChosen.prototype.clipboard_event_checker = function(evt) {
553
- var _this = this;
554
- if (this.is_disabled) {
555
- return;
556
- }
557
- return setTimeout((function() {
558
- return _this.results_search();
559
- }), 50);
560
- };
561
-
562
- AbstractChosen.prototype.container_width = function() {
563
- if (this.options.width != null) {
564
- return this.options.width;
565
- } else {
566
- return "" + this.form_field.offsetWidth + "px";
567
- }
568
- };
569
-
570
- AbstractChosen.prototype.include_option_in_results = function(option) {
571
- if (this.is_multiple && (!this.display_selected_options && option.selected)) {
572
- return false;
573
- }
574
- if (!this.display_disabled_options && option.disabled) {
575
- return false;
576
- }
577
- if (option.empty) {
578
- return false;
579
- }
580
- return true;
581
- };
582
-
583
- AbstractChosen.prototype.search_results_touchstart = function(evt) {
584
- this.touch_started = true;
585
- return this.search_results_mouseover(evt);
586
- };
587
-
588
- AbstractChosen.prototype.search_results_touchmove = function(evt) {
589
- this.touch_started = false;
590
- return this.search_results_mouseout(evt);
591
- };
592
-
593
- AbstractChosen.prototype.search_results_touchend = function(evt) {
594
- if (this.touch_started) {
595
- return this.search_results_mouseup(evt);
596
- }
597
- };
598
-
599
- AbstractChosen.prototype.outerHTML = function(element) {
600
- var tmp;
601
- if (element.outerHTML) {
602
- return element.outerHTML;
603
- }
604
- tmp = document.createElement("div");
605
- tmp.appendChild(element);
606
- return tmp.innerHTML;
607
- };
608
-
609
- AbstractChosen.prototype.get_single_html = function() {
610
- 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>";
611
- };
612
-
613
- AbstractChosen.prototype.get_multi_html = function() {
614
- 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>";
615
- };
616
-
617
- AbstractChosen.prototype.get_no_results_html = function(terms) {
618
- return "<li class=\"no-results\">\n " + this.results_none_found + " <span>" + terms + "</span>\n</li>";
619
- };
620
-
621
- AbstractChosen.browser_is_supported = function() {
622
- if ("Microsoft Internet Explorer" === window.navigator.appName) {
623
- return document.documentMode >= 8;
624
- }
625
- 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)) {
626
- return false;
627
- }
628
- return true;
629
- };
630
-
631
- AbstractChosen.default_multiple_text = "Select Some Options";
632
-
633
- AbstractChosen.default_single_text = "Select an Option";
634
-
635
- AbstractChosen.default_no_result_text = "No results match";
636
-
637
- return AbstractChosen;
638
-
639
- })();
640
-
641
- $ = jQuery;
642
-
643
- $.fn.extend({
644
- chosen: function(options) {
645
- if (!AbstractChosen.browser_is_supported()) {
646
- return this;
647
- }
648
- return this.each(function(input_field) {
649
- var $this, chosen;
650
- $this = $(this);
651
- chosen = $this.data('chosen');
652
- if (options === 'destroy') {
653
- if (chosen instanceof Chosen) {
654
- chosen.destroy();
655
- }
656
- return;
657
- }
658
- if (!(chosen instanceof Chosen)) {
659
- $this.data('chosen', new Chosen(this, options));
660
- }
661
- });
662
- }
663
- });
664
-
665
- Chosen = (function(_super) {
666
- __extends(Chosen, _super);
667
-
668
- function Chosen() {
669
- _ref = Chosen.__super__.constructor.apply(this, arguments);
670
- return _ref;
671
- }
672
-
673
- Chosen.prototype.setup = function() {
674
- this.form_field_jq = $(this.form_field);
675
- return this.current_selectedIndex = this.form_field.selectedIndex;
676
- };
677
-
678
- Chosen.prototype.set_up_html = function() {
679
- var container_classes, container_props;
680
- container_classes = ["chosen-container"];
681
- container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
682
- if (this.inherit_select_classes && this.form_field.className) {
683
- container_classes.push(this.form_field.className);
684
- }
685
- if (this.is_rtl) {
686
- container_classes.push("chosen-rtl");
687
- }
688
- container_props = {
689
- 'class': container_classes.join(' '),
690
- 'title': this.form_field.title
691
- };
692
- if (this.form_field.id.length) {
693
- container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
694
- }
695
- this.container = $("<div />", container_props);
696
- this.container.width(this.container_width());
697
- if (this.is_multiple) {
698
- this.container.html(this.get_multi_html());
699
- } else {
700
- this.container.html(this.get_single_html());
701
- }
702
- this.form_field_jq.hide().after(this.container);
703
- this.dropdown = this.container.find('div.chosen-drop').first();
704
- this.search_field = this.container.find('input').first();
705
- this.search_results = this.container.find('ul.chosen-results').first();
706
- this.search_field_scale();
707
- this.search_no_results = this.container.find('li.no-results').first();
708
- if (this.is_multiple) {
709
- this.search_choices = this.container.find('ul.chosen-choices').first();
710
- this.search_container = this.container.find('li.search-field').first();
711
- } else {
712
- this.search_container = this.container.find('div.chosen-search').first();
713
- this.selected_item = this.container.find('.chosen-single').first();
714
- }
715
- this.results_build();
716
- this.set_tab_index();
717
- return this.set_label_behavior();
718
- };
719
-
720
- Chosen.prototype.on_ready = function() {
721
- return this.form_field_jq.trigger("chosen:ready", {
722
- chosen: this
723
- });
724
- };
725
-
726
- Chosen.prototype.register_observers = function() {
727
- var _this = this;
728
- this.container.bind('touchstart.chosen', function(evt) {
729
- _this.container_mousedown(evt);
730
- });
731
- this.container.bind('touchend.chosen', function(evt) {
732
- _this.container_mouseup(evt);
733
- });
734
- this.container.bind('mousedown.chosen', function(evt) {
735
- _this.container_mousedown(evt);
736
- });
737
- this.container.bind('mouseup.chosen', function(evt) {
738
- _this.container_mouseup(evt);
739
- });
740
- this.container.bind('mouseenter.chosen', function(evt) {
741
- _this.mouse_enter(evt);
742
- });
743
- this.container.bind('mouseleave.chosen', function(evt) {
744
- _this.mouse_leave(evt);
745
- });
746
- this.search_results.bind('mouseup.chosen', function(evt) {
747
- _this.search_results_mouseup(evt);
748
- });
749
- this.search_results.bind('mouseover.chosen', function(evt) {
750
- _this.search_results_mouseover(evt);
751
- });
752
- this.search_results.bind('mouseout.chosen', function(evt) {
753
- _this.search_results_mouseout(evt);
754
- });
755
- this.search_results.bind('mousewheel.chosen DOMMouseScroll.chosen', function(evt) {
756
- _this.search_results_mousewheel(evt);
757
- });
758
- this.search_results.bind('touchstart.chosen', function(evt) {
759
- _this.search_results_touchstart(evt);
760
- });
761
- this.search_results.bind('touchmove.chosen', function(evt) {
762
- _this.search_results_touchmove(evt);
763
- });
764
- this.search_results.bind('touchend.chosen', function(evt) {
765
- _this.search_results_touchend(evt);
766
- });
767
- this.form_field_jq.bind("chosen:updated.chosen", function(evt) {
768
- _this.results_update_field(evt);
769
- });
770
- this.form_field_jq.bind("chosen:activate.chosen", function(evt) {
771
- _this.activate_field(evt);
772
- });
773
- this.form_field_jq.bind("chosen:open.chosen", function(evt) {
774
- _this.container_mousedown(evt);
775
- });
776
- this.form_field_jq.bind("chosen:close.chosen", function(evt) {
777
- _this.close_field(evt);
778
- });
779
- this.search_field.bind('blur.chosen', function(evt) {
780
- _this.input_blur(evt);
781
- });
782
- this.search_field.bind('keyup.chosen', function(evt) {
783
- _this.keyup_checker(evt);
784
- });
785
- this.search_field.bind('keydown.chosen', function(evt) {
786
- _this.keydown_checker(evt);
787
- });
788
- this.search_field.bind('focus.chosen', function(evt) {
789
- _this.input_focus(evt);
790
- });
791
- this.search_field.bind('cut.chosen', function(evt) {
792
- _this.clipboard_event_checker(evt);
793
- });
794
- this.search_field.bind('paste.chosen', function(evt) {
795
- _this.clipboard_event_checker(evt);
796
- });
797
- if (this.is_multiple) {
798
- return this.search_choices.bind('click.chosen', function(evt) {
799
- _this.choices_click(evt);
800
- });
801
- } else {
802
- return this.container.bind('click.chosen', function(evt) {
803
- evt.preventDefault();
804
- });
805
- }
806
- };
807
-
808
- Chosen.prototype.destroy = function() {
809
- $(this.container[0].ownerDocument).unbind('click.chosen', this.click_test_action);
810
- if (this.form_field_label.length > 0) {
811
- this.form_field_label.unbind('click.chosen');
812
- }
813
- if (this.search_field[0].tabIndex) {
814
- this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
815
- }
816
- this.container.remove();
817
- this.form_field_jq.removeData('chosen');
818
- return this.form_field_jq.show();
819
- };
820
-
821
- Chosen.prototype.search_field_disabled = function() {
822
- this.is_disabled = this.form_field.disabled || this.form_field_jq.parents('fieldset').is(':disabled');
823
- this.container.toggleClass('chosen-disabled', this.is_disabled);
824
- this.search_field[0].disabled = this.is_disabled;
825
- if (!this.is_multiple) {
826
- this.selected_item.unbind('focus.chosen', this.activate_field);
827
- }
828
- if (this.is_disabled) {
829
- return this.close_field();
830
- } else if (!this.is_multiple) {
831
- return this.selected_item.bind('focus.chosen', this.activate_field);
832
- }
833
- };
834
-
835
- Chosen.prototype.container_mousedown = function(evt) {
836
- var _ref1;
837
- if (this.is_disabled) {
838
- return;
839
- }
840
- if (evt && ((_ref1 = evt.type) === 'mousedown' || _ref1 === 'touchstart') && !this.results_showing) {
841
- evt.preventDefault();
842
- }
843
- if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
844
- if (!this.active_field) {
845
- if (this.is_multiple) {
846
- this.search_field.val("");
847
- }
848
- $(this.container[0].ownerDocument).bind('click.chosen', this.click_test_action);
849
- this.results_show();
850
- } else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chosen-single").length)) {
851
- evt.preventDefault();
852
- this.results_toggle();
853
- }
854
- return this.activate_field();
855
- }
856
- };
857
-
858
- Chosen.prototype.container_mouseup = function(evt) {
859
- if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
860
- return this.results_reset(evt);
861
- }
862
- };
863
-
864
- Chosen.prototype.search_results_mousewheel = function(evt) {
865
- var delta;
866
- if (evt.originalEvent) {
867
- delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
868
- }
869
- if (delta != null) {
870
- evt.preventDefault();
871
- if (evt.type === 'DOMMouseScroll') {
872
- delta = delta * 40;
873
- }
874
- return this.search_results.scrollTop(delta + this.search_results.scrollTop());
875
- }
876
- };
877
-
878
- Chosen.prototype.blur_test = function(evt) {
879
- if (!this.active_field && this.container.hasClass("chosen-container-active")) {
880
- return this.close_field();
881
- }
882
- };
883
-
884
- Chosen.prototype.close_field = function() {
885
- $(this.container[0].ownerDocument).unbind("click.chosen", this.click_test_action);
886
- this.active_field = false;
887
- this.results_hide();
888
- this.container.removeClass("chosen-container-active");
889
- this.clear_backstroke();
890
- this.show_search_field_default();
891
- this.search_field_scale();
892
- return this.search_field.blur();
893
- };
894
-
895
- Chosen.prototype.activate_field = function() {
896
- if (this.is_disabled) {
897
- return;
898
- }
899
- this.container.addClass("chosen-container-active");
900
- this.active_field = true;
901
- this.search_field.val(this.search_field.val());
902
- return this.search_field.focus();
903
- };
904
-
905
- Chosen.prototype.test_active_click = function(evt) {
906
- var active_container;
907
- active_container = $(evt.target).closest('.chosen-container');
908
- if (active_container.length && this.container[0] === active_container[0]) {
909
- return this.active_field = true;
910
- } else {
911
- return this.close_field();
912
- }
913
- };
914
-
915
- Chosen.prototype.results_build = function() {
916
- this.parsing = true;
917
- this.selected_option_count = null;
918
- this.results_data = SelectParser.select_to_array(this.form_field);
919
- if (this.is_multiple) {
920
- this.search_choices.find("li.search-choice").remove();
921
- } else if (!this.is_multiple) {
922
- this.single_set_selected_text();
923
- if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
924
- this.search_field[0].readOnly = true;
925
- this.container.addClass("chosen-container-single-nosearch");
926
- } else {
927
- this.search_field[0].readOnly = false;
928
- this.container.removeClass("chosen-container-single-nosearch");
929
- }
930
- }
931
- this.update_results_content(this.results_option_build({
932
- first: true
933
- }));
934
- this.search_field_disabled();
935
- this.show_search_field_default();
936
- this.search_field_scale();
937
- return this.parsing = false;
938
- };
939
-
940
- Chosen.prototype.result_do_highlight = function(el) {
941
- var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
942
- if (el.length) {
943
- this.result_clear_highlight();
944
- this.result_highlight = el;
945
- this.result_highlight.addClass("highlighted");
946
- maxHeight = parseInt(this.search_results.css("maxHeight"), 10);
947
- visible_top = this.search_results.scrollTop();
948
- visible_bottom = maxHeight + visible_top;
949
- high_top = this.result_highlight.position().top + this.search_results.scrollTop();
950
- high_bottom = high_top + this.result_highlight.outerHeight();
951
- if (high_bottom >= visible_bottom) {
952
- return this.search_results.scrollTop((high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0);
953
- } else if (high_top < visible_top) {
954
- return this.search_results.scrollTop(high_top);
955
- }
956
- }
957
- };
958
-
959
- Chosen.prototype.result_clear_highlight = function() {
960
- if (this.result_highlight) {
961
- this.result_highlight.removeClass("highlighted");
962
- }
963
- return this.result_highlight = null;
964
- };
965
-
966
- Chosen.prototype.results_show = function() {
967
- if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
968
- this.form_field_jq.trigger("chosen:maxselected", {
969
- chosen: this
970
- });
971
- return false;
972
- }
973
- this.container.addClass("chosen-with-drop");
974
- this.results_showing = true;
975
- this.search_field.focus();
976
- this.search_field.val(this.get_search_field_value());
977
- this.winnow_results();
978
- return this.form_field_jq.trigger("chosen:showing_dropdown", {
979
- chosen: this
980
- });
981
- };
982
-
983
- Chosen.prototype.update_results_content = function(content) {
984
- return this.search_results.html(content);
985
- };
986
-
987
- Chosen.prototype.results_hide = function() {
988
- if (this.results_showing) {
989
- this.result_clear_highlight();
990
- this.container.removeClass("chosen-with-drop");
991
- this.form_field_jq.trigger("chosen:hiding_dropdown", {
992
- chosen: this
993
- });
994
- }
995
- return this.results_showing = false;
996
- };
997
-
998
- Chosen.prototype.set_tab_index = function(el) {
999
- var ti;
1000
- if (this.form_field.tabIndex) {
1001
- ti = this.form_field.tabIndex;
1002
- this.form_field.tabIndex = -1;
1003
- return this.search_field[0].tabIndex = ti;
1004
- }
1005
- };
1006
-
1007
- Chosen.prototype.set_label_behavior = function() {
1008
- this.form_field_label = this.form_field_jq.parents("label");
1009
- if (!this.form_field_label.length && this.form_field.id.length) {
1010
- this.form_field_label = $("label[for='" + this.form_field.id + "']");
1011
- }
1012
- if (this.form_field_label.length > 0) {
1013
- return this.form_field_label.bind('click.chosen', this.label_click_handler);
1014
- }
1015
- };
1016
-
1017
- Chosen.prototype.show_search_field_default = function() {
1018
- if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
1019
- this.search_field.val(this.default_text);
1020
- return this.search_field.addClass("default");
1021
- } else {
1022
- this.search_field.val("");
1023
- return this.search_field.removeClass("default");
1024
- }
1025
- };
1026
-
1027
- Chosen.prototype.search_results_mouseup = function(evt) {
1028
- var target;
1029
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
1030
- if (target.length) {
1031
- this.result_highlight = target;
1032
- this.result_select(evt);
1033
- return this.search_field.focus();
1034
- }
1035
- };
1036
-
1037
- Chosen.prototype.search_results_mouseover = function(evt) {
1038
- var target;
1039
- target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
1040
- if (target) {
1041
- return this.result_do_highlight(target);
1042
- }
1043
- };
1044
-
1045
- Chosen.prototype.search_results_mouseout = function(evt) {
1046
- if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())) {
1047
- return this.result_clear_highlight();
1048
- }
1049
- };
1050
-
1051
- Chosen.prototype.choice_build = function(item) {
1052
- var choice, close_link,
1053
- _this = this;
1054
- choice = $('<li />', {
1055
- "class": "search-choice"
1056
- }).html("<span>" + (this.choice_label(item)) + "</span>");
1057
- if (item.disabled) {
1058
- choice.addClass('search-choice-disabled');
1059
- } else {
1060
- close_link = $('<a />', {
1061
- "class": 'search-choice-close',
1062
- 'data-option-array-index': item.array_index
1063
- });
1064
- close_link.bind('click.chosen', function(evt) {
1065
- return _this.choice_destroy_link_click(evt);
1066
- });
1067
- choice.append(close_link);
1068
- }
1069
- return this.search_container.before(choice);
1070
- };
1071
-
1072
- Chosen.prototype.choice_destroy_link_click = function(evt) {
1073
- evt.preventDefault();
1074
- evt.stopPropagation();
1075
- if (!this.is_disabled) {
1076
- return this.choice_destroy($(evt.target));
1077
- }
1078
- };
1079
-
1080
- Chosen.prototype.choice_destroy = function(link) {
1081
- if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
1082
- if (this.active_field) {
1083
- this.search_field.focus();
1084
- } else {
1085
- this.show_search_field_default();
1086
- }
1087
- if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {
1088
- this.results_hide();
1089
- }
1090
- link.parents('li').first().remove();
1091
- return this.search_field_scale();
1092
- }
1093
- };
1094
-
1095
- Chosen.prototype.results_reset = function() {
1096
- this.reset_single_select_options();
1097
- this.form_field.options[0].selected = true;
1098
- this.single_set_selected_text();
1099
- this.show_search_field_default();
1100
- this.results_reset_cleanup();
1101
- this.trigger_form_field_change();
1102
- if (this.active_field) {
1103
- return this.results_hide();
1104
- }
1105
- };
1106
-
1107
- Chosen.prototype.results_reset_cleanup = function() {
1108
- this.current_selectedIndex = this.form_field.selectedIndex;
1109
- return this.selected_item.find("abbr").remove();
1110
- };
1111
-
1112
- Chosen.prototype.result_select = function(evt) {
1113
- var high, item;
1114
- if (this.result_highlight) {
1115
- high = this.result_highlight;
1116
- this.result_clear_highlight();
1117
- if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1118
- this.form_field_jq.trigger("chosen:maxselected", {
1119
- chosen: this
1120
- });
1121
- return false;
1122
- }
1123
- if (this.is_multiple) {
1124
- high.removeClass("active-result");
1125
- } else {
1126
- this.reset_single_select_options();
1127
- }
1128
- high.addClass("result-selected");
1129
- item = this.results_data[high[0].getAttribute("data-option-array-index")];
1130
- item.selected = true;
1131
- this.form_field.options[item.options_index].selected = true;
1132
- this.selected_option_count = null;
1133
- if (this.is_multiple) {
1134
- this.choice_build(item);
1135
- } else {
1136
- this.single_set_selected_text(this.choice_label(item));
1137
- }
1138
- if (!(this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey)))) {
1139
- this.results_hide();
1140
- this.show_search_field_default();
1141
- }
1142
- if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1143
- this.trigger_form_field_change({
1144
- selected: this.form_field.options[item.options_index].value
1145
- });
1146
- }
1147
- this.current_selectedIndex = this.form_field.selectedIndex;
1148
- evt.preventDefault();
1149
- return this.search_field_scale();
1150
- }
1151
- };
1152
-
1153
- Chosen.prototype.single_set_selected_text = function(text) {
1154
- if (text == null) {
1155
- text = this.default_text;
1156
- }
1157
- if (text === this.default_text) {
1158
- this.selected_item.addClass("chosen-default");
1159
- } else {
1160
- this.single_deselect_control_build();
1161
- this.selected_item.removeClass("chosen-default");
1162
- }
1163
- return this.selected_item.find("span").html(text);
1164
- };
1165
-
1166
- Chosen.prototype.result_deselect = function(pos) {
1167
- var result_data;
1168
- result_data = this.results_data[pos];
1169
- if (!this.form_field.options[result_data.options_index].disabled) {
1170
- result_data.selected = false;
1171
- this.form_field.options[result_data.options_index].selected = false;
1172
- this.selected_option_count = null;
1173
- this.result_clear_highlight();
1174
- if (this.results_showing) {
1175
- this.winnow_results();
1176
- }
1177
- this.trigger_form_field_change({
1178
- deselected: this.form_field.options[result_data.options_index].value
1179
- });
1180
- this.search_field_scale();
1181
- return true;
1182
- } else {
1183
- return false;
1184
- }
1185
- };
1186
-
1187
- Chosen.prototype.single_deselect_control_build = function() {
1188
- if (!this.allow_single_deselect) {
1189
- return;
1190
- }
1191
- if (!this.selected_item.find("abbr").length) {
1192
- this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
1193
- }
1194
- return this.selected_item.addClass("chosen-single-with-deselect");
1195
- };
1196
-
1197
- Chosen.prototype.get_search_field_value = function() {
1198
- return this.search_field.val();
1199
- };
1200
-
1201
- Chosen.prototype.get_search_text = function() {
1202
- return this.escape_html($.trim(this.get_search_field_value()));
1203
- };
1204
-
1205
- Chosen.prototype.escape_html = function(text) {
1206
- return $('<div/>').text(text).html();
1207
- };
1208
-
1209
- Chosen.prototype.winnow_results_set_highlight = function() {
1210
- var do_high, selected_results;
1211
- selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
1212
- do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
1213
- if (do_high != null) {
1214
- return this.result_do_highlight(do_high);
1215
- }
1216
- };
1217
-
1218
- Chosen.prototype.no_results = function(terms) {
1219
- var no_results_html;
1220
- no_results_html = this.get_no_results_html(terms);
1221
- this.search_results.append(no_results_html);
1222
- return this.form_field_jq.trigger("chosen:no_results", {
1223
- chosen: this
1224
- });
1225
- };
1226
-
1227
- Chosen.prototype.no_results_clear = function() {
1228
- return this.search_results.find(".no-results").remove();
1229
- };
1230
-
1231
- Chosen.prototype.keydown_arrow = function() {
1232
- var next_sib;
1233
- if (this.results_showing && this.result_highlight) {
1234
- next_sib = this.result_highlight.nextAll("li.active-result").first();
1235
- if (next_sib) {
1236
- return this.result_do_highlight(next_sib);
1237
- }
1238
- } else {
1239
- return this.results_show();
1240
- }
1241
- };
1242
-
1243
- Chosen.prototype.keyup_arrow = function() {
1244
- var prev_sibs;
1245
- if (!this.results_showing && !this.is_multiple) {
1246
- return this.results_show();
1247
- } else if (this.result_highlight) {
1248
- prev_sibs = this.result_highlight.prevAll("li.active-result");
1249
- if (prev_sibs.length) {
1250
- return this.result_do_highlight(prev_sibs.first());
1251
- } else {
1252
- if (this.choices_count() > 0) {
1253
- this.results_hide();
1254
- }
1255
- return this.result_clear_highlight();
1256
- }
1257
- }
1258
- };
1259
-
1260
- Chosen.prototype.keydown_backstroke = function() {
1261
- var next_available_destroy;
1262
- if (this.pending_backstroke) {
1263
- this.choice_destroy(this.pending_backstroke.find("a").first());
1264
- return this.clear_backstroke();
1265
- } else {
1266
- next_available_destroy = this.search_container.siblings("li.search-choice").last();
1267
- if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
1268
- this.pending_backstroke = next_available_destroy;
1269
- if (this.single_backstroke_delete) {
1270
- return this.keydown_backstroke();
1271
- } else {
1272
- return this.pending_backstroke.addClass("search-choice-focus");
1273
- }
1274
- }
1275
- }
1276
- };
1277
-
1278
- Chosen.prototype.clear_backstroke = function() {
1279
- if (this.pending_backstroke) {
1280
- this.pending_backstroke.removeClass("search-choice-focus");
1281
- }
1282
- return this.pending_backstroke = null;
1283
- };
1284
-
1285
- Chosen.prototype.search_field_scale = function() {
1286
- var container_width, div, style, style_block, styles, width, _i, _len;
1287
- if (!this.is_multiple) {
1288
- return;
1289
- }
1290
- style_block = {
1291
- position: 'absolute',
1292
- left: '-1000px',
1293
- top: '-1000px',
1294
- display: 'none',
1295
- whiteSpace: 'pre'
1296
- };
1297
- styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];
1298
- for (_i = 0, _len = styles.length; _i < _len; _i++) {
1299
- style = styles[_i];
1300
- style_block[style] = this.search_field.css(style);
1301
- }
1302
- div = $('<div />').css(style_block);
1303
- div.text(this.get_search_field_value());
1304
- $('body').append(div);
1305
- width = div.width() + 25;
1306
- div.remove();
1307
- container_width = this.container.outerWidth();
1308
- width = Math.min(container_width - 10, width);
1309
- return this.search_field.width(width);
1310
- };
1311
-
1312
- Chosen.prototype.trigger_form_field_change = function(extra) {
1313
- this.form_field_jq.trigger("input", extra);
1314
- return this.form_field_jq.trigger("change", extra);
1315
- };
1316
-
1317
- return Chosen;
1318
-
1319
- })(AbstractChosen);
1320
-
1321
- }).call(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/chosen.jquery.min.js DELETED
@@ -1,2 +0,0 @@
1
- /* Chosen v1.7.0 | (c) 2011-2017 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
- (function(){var a,b,c,d,e,f=function(a,b){return function(){return a.apply(b,arguments)}},g={}.hasOwnProperty,h=function(a,b){function c(){this.constructor=a}for(var d in b)g.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};d=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},a.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),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),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},a.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,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,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},a.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},a}(),d.select_to_array=function(a){var b,c,e,f,g;for(c=new d,g=a.childNodes,e=0,f=g.length;f>e;e++)b=g[e],c.add_node(b);return c.parsed},b=function(){function a(b,c){this.form_field=b,this.options=null!=c?c:{},this.label_click_handler=f(this.label_click_handler,this),a.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 a.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.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:!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,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:!0},a.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||a.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||a.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||a.default_no_result_text},a.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},a.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},a.prototype.label_click_handler=function(a){return this.is_multiple?this.container_mousedown(a):this.activate_field()},a.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(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(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},a.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,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.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},a.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},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.get_search_regex(a),b=this.get_highlight_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)c=l[j],c.search_match=!1,f=null,this.include_option_in_results(c)&&(c.group&&(c.group_match=!1,c.active_options=0),null!=c.group_array_index&&this.results_data[c.group_array_index]&&(f=this.results_data[c.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),c.search_text=c.group?c.label:c.html,(!c.group||this.group_search)&&(c.search_match=this.search_string_match(c.search_text,d),c.search_match&&!c.group&&(e+=1),c.search_match?(g.length&&(h=c.search_text.search(b),i=c.search_text.substr(0,h+g.length)+"</em>"+c.search_text.substr(h+g.length),c.search_text=i.substr(0,h)+"<em>"+i.substr(h)),null!=f&&(f.group_match=!0)):null!=c.group_array_index&&this.results_data[c.group_array_index].search_match&&(c.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())},a.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},a.prototype.get_highlight_regex=function(a){var b,c;return b=this.search_contains?"":"\\b",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},a.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},a.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},a.prototype.choices_click=function(a){return a.preventDefault(),this.activate_field(),this.results_showing||this.is_disabled?void 0:this.results_show()},a.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.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 27:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},a.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){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:a.preventDefault(),this.results_showing&&this.result_select(a);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()}},a.prototype.clipboard_event_checker=function(a){var b=this;if(!this.is_disabled)return setTimeout(function(){return b.results_search()},50)},a.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},a.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},a.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},a.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},a.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},a.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},a.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>'},a.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>'},a.prototype.get_no_results_html=function(a){return'<li class="no-results">\n '+this.results_none_found+" <span>"+a+"</span>\n</li>"},a.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)?!1:!0},a.default_multiple_text="Select Some Options",a.default_single_text="Select an Option",a.default_no_result_text="No results match",a}(),a=jQuery,a.fn.extend({chosen:function(d){return b.browser_is_supported()?this.each(function(b){var e,f;return e=a(this),f=e.data("chosen"),"destroy"===d?void(f instanceof c&&f.destroy()):void(f instanceof c||e.data("chosen",new c(this,d)))}):this}}),c=function(b){function c(){return e=c.__super__.constructor.apply(this,arguments)}return h(c,b),c.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},c.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(" "),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.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()},c.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},c.prototype.register_observers=function(){var a=this;return this.container.bind("touchstart.chosen",function(b){a.container_mousedown(b)}),this.container.bind("touchend.chosen",function(b){a.container_mouseup(b)}),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.close_field(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()})},c.prototype.destroy=function(){return a(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.unbind("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()},c.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.unbind("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_field)},c.prototype.container_mousedown=function(b){var c;if(!this.is_disabled)return!b||"mousedown"!==(c=b.type)&&"touchstart"!==c||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())},c.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},c.prototype.search_results_mousewheel=function(a){var b;return a.originalEvent&&(b=a.originalEvent.deltaY||-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},c.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClass("chosen-container-active")?this.close_field():void 0},c.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(),this.search_field.blur()},c.prototype.activate_field=function(){return this.is_disabled?void 0:(this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus())},c.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()},c.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=d.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},c.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)}},c.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},c.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}))},c.prototype.update_results_content=function(a){return this.search_results.html(a)},c.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},c.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=b):void 0},c.prototype.set_label_behavior=function(){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",this.label_click_handler):void 0},c.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"))},c.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},c.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},c.prototype.search_results_mouseout=function(b){return a(b.target).hasClass("active-result")?this.result_clear_highlight():void 0},c.prototype.choice_build=function(b){var c,d,e=this;return c=a("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(b)+"</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)},c.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),b.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a(b.target))},c.prototype.choice_destroy=function(a){return this.result_deselect(a[0].getAttribute("data-option-array-index"))?(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(),a.parents("li").first().remove(),this.search_field_scale()):void 0},c.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.trigger_form_field_change(),this.active_field?this.results_hide():void 0},c.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},c.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(),b.addClass("result-selected"),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(this.choice_label(c)),(!this.is_multiple||this.hide_results_on_select&&!a.metaKey&&!a.ctrlKey)&&(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[c.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},c.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").html(a)},c.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.trigger_form_field_change({deselected:this.form_field.options[b.options_index].value}),this.search_field_scale(),!0)},c.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},c.prototype.get_search_field_value=function(){return this.search_field.val()},c.prototype.get_search_text=function(){return this.escape_html(a.trim(this.get_search_field_value()))},c.prototype.escape_html=function(b){return a("<div/>").text(b).html()},c.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},c.prototype.no_results=function(a){var b;return b=this.get_no_results_html(a),this.search_results.append(b),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},c.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},c.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()},c.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()},c.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)},c.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},c.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i;if(this.is_multiple){for(e={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},f=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"],h=0,i=f.length;i>h;h++)d=f[h],e[d]=this.search_field.css(d);return c=a("<div />").css(e),c.text(this.get_search_field_value()),a("body").append(c),g=c.width()+25,c.remove(),b=this.container.outerWidth(),g=Math.min(b-10,g),this.search_field.width(g)}},c.prototype.trigger_form_field_change=function(a){return this.form_field_jq.trigger("input",a),this.form_field_jq.trigger("change",a)},c}(b)}).call(this);
 
 
assets/inc/chosen/chosen.min.css DELETED
@@ -1,3 +0,0 @@
1
- /* Chosen v1.7.0 | (c) 2011-2017 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;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chosen-container *{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;box-shadow:0 4px 5px rgba(0,0,0,.15);clip:rect(0,0,0,0)}.chosen-container.chosen-with-drop .chosen-drop{clip:auto}.chosen-container a{cursor:pointer}.chosen-container .search-choice .group-name,.chosen-container .chosen-single .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chosen-container .search-choice .group-name:after,.chosen-container .chosen-single .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:linear-gradient(#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]{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)}.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: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: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:transparent!important;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:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;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 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: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;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: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:#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:0}.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-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}}
 
 
 
assets/inc/chosen/chosen.proto.js DELETED
@@ -1,1364 +0,0 @@
1
- /*!
2
- Chosen, a Select Box Enhancer for jQuery and Prototype
3
- by Patrick Filler for Harvest, http://getharvest.com
4
-
5
- Version 1.7.0
6
- Full source at https://github.com/harvesthq/chosen
7
- Copyright (c) 2011-2017 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, SelectParser, _ref,
15
- __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
16
- __hasProp = {}.hasOwnProperty,
17
- __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; };
18
-
19
- SelectParser = (function() {
20
- function SelectParser() {
21
- this.options_index = 0;
22
- this.parsed = [];
23
- }
24
-
25
- SelectParser.prototype.add_node = function(child) {
26
- if (child.nodeName.toUpperCase() === "OPTGROUP") {
27
- return this.add_group(child);
28
- } else {
29
- return this.add_option(child);
30
- }
31
- };
32
-
33
- SelectParser.prototype.add_group = function(group) {
34
- var group_position, option, _i, _len, _ref, _results;
35
- group_position = this.parsed.length;
36
- this.parsed.push({
37
- array_index: group_position,
38
- group: true,
39
- label: this.escapeExpression(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
- _results = [];
47
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
48
- option = _ref[_i];
49
- _results.push(this.add_option(option, group_position, group.disabled));
50
- }
51
- return _results;
52
- };
53
-
54
- SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
55
- if (option.nodeName.toUpperCase() === "OPTION") {
56
- if (option.text !== "") {
57
- if (group_position != null) {
58
- this.parsed[group_position].children += 1;
59
- }
60
- this.parsed.push({
61
- array_index: this.parsed.length,
62
- options_index: this.options_index,
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
- });
74
- } else {
75
- this.parsed.push({
76
- array_index: this.parsed.length,
77
- options_index: this.options_index,
78
- empty: true
79
- });
80
- }
81
- return this.options_index += 1;
82
- }
83
- };
84
-
85
- SelectParser.prototype.escapeExpression = function(text) {
86
- var map, unsafe_chars;
87
- if ((text == null) || text === false) {
88
- return "";
89
- }
90
- if (!/[\&\<\>\"\'\`]/.test(text)) {
91
- return text;
92
- }
93
- map = {
94
- "<": "&lt;",
95
- ">": "&gt;",
96
- '"': "&quot;",
97
- "'": "&#x27;",
98
- "`": "&#x60;"
99
- };
100
- unsafe_chars = /&(?!\w+;)|[\<\>\"\'\`]/g;
101
- return text.replace(unsafe_chars, function(chr) {
102
- return map[chr] || "&amp;";
103
- });
104
- };
105
-
106
- return SelectParser;
107
-
108
- })();
109
-
110
- SelectParser.select_to_array = function(select) {
111
- var child, parser, _i, _len, _ref;
112
- parser = new SelectParser();
113
- _ref = select.childNodes;
114
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
115
- child = _ref[_i];
116
- parser.add_node(child);
117
- }
118
- return parser.parsed;
119
- };
120
-
121
- AbstractChosen = (function() {
122
- function AbstractChosen(form_field, options) {
123
- this.form_field = form_field;
124
- this.options = options != null ? options : {};
125
- this.label_click_handler = __bind(this.label_click_handler, this);
126
- if (!AbstractChosen.browser_is_supported()) {
127
- return;
128
- }
129
- this.is_multiple = this.form_field.multiple;
130
- this.set_default_text();
131
- this.set_default_values();
132
- this.setup();
133
- this.set_up_html();
134
- this.register_observers();
135
- this.on_ready();
136
- }
137
-
138
- AbstractChosen.prototype.set_default_values = function() {
139
- var _this = this;
140
- this.click_test_action = function(evt) {
141
- return _this.test_active_click(evt);
142
- };
143
- this.activate_action = function(evt) {
144
- return _this.activate_field(evt);
145
- };
146
- this.active_field = false;
147
- this.mouse_on_container = false;
148
- this.results_showing = false;
149
- this.result_highlighted = null;
150
- this.is_rtl = this.options.rtl || /\bchosen-rtl\b/.test(this.form_field.className);
151
- 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;
152
- this.disable_search_threshold = this.options.disable_search_threshold || 0;
153
- this.disable_search = this.options.disable_search || false;
154
- this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
155
- this.group_search = this.options.group_search != null ? this.options.group_search : true;
156
- this.search_contains = this.options.search_contains || false;
157
- this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
158
- this.max_selected_options = this.options.max_selected_options || Infinity;
159
- this.inherit_select_classes = this.options.inherit_select_classes || false;
160
- this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
161
- this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
162
- this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
163
- this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
164
- this.case_sensitive_search = this.options.case_sensitive_search || false;
165
- return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;
166
- };
167
-
168
- AbstractChosen.prototype.set_default_text = function() {
169
- if (this.form_field.getAttribute("data-placeholder")) {
170
- this.default_text = this.form_field.getAttribute("data-placeholder");
171
- } else if (this.is_multiple) {
172
- this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
173
- } else {
174
- this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
175
- }
176
- this.default_text = this.escape_html(this.default_text);
177
- return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
178
- };
179
-
180
- AbstractChosen.prototype.choice_label = function(item) {
181
- if (this.include_group_label_in_selected && (item.group_label != null)) {
182
- return "<b class='group-name'>" + item.group_label + "</b>" + item.html;
183
- } else {
184
- return item.html;
185
- }
186
- };
187
-
188
- AbstractChosen.prototype.mouse_enter = function() {
189
- return this.mouse_on_container = true;
190
- };
191
-
192
- AbstractChosen.prototype.mouse_leave = function() {
193
- return this.mouse_on_container = false;
194
- };
195
-
196
- AbstractChosen.prototype.input_focus = function(evt) {
197
- var _this = this;
198
- if (this.is_multiple) {
199
- if (!this.active_field) {
200
- return setTimeout((function() {
201
- return _this.container_mousedown();
202
- }), 50);
203
- }
204
- } else {
205
- if (!this.active_field) {
206
- return this.activate_field();
207
- }
208
- }
209
- };
210
-
211
- AbstractChosen.prototype.input_blur = function(evt) {
212
- var _this = this;
213
- if (!this.mouse_on_container) {
214
- this.active_field = false;
215
- return setTimeout((function() {
216
- return _this.blur_test();
217
- }), 100);
218
- }
219
- };
220
-
221
- AbstractChosen.prototype.label_click_handler = function(evt) {
222
- if (this.is_multiple) {
223
- return this.container_mousedown(evt);
224
- } else {
225
- return this.activate_field();
226
- }
227
- };
228
-
229
- AbstractChosen.prototype.results_option_build = function(options) {
230
- var content, data, data_content, shown_results, _i, _len, _ref;
231
- content = '';
232
- shown_results = 0;
233
- _ref = this.results_data;
234
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
235
- data = _ref[_i];
236
- data_content = '';
237
- if (data.group) {
238
- data_content = this.result_add_group(data);
239
- } else {
240
- data_content = this.result_add_option(data);
241
- }
242
- if (data_content !== '') {
243
- shown_results++;
244
- content += data_content;
245
- }
246
- if (options != null ? options.first : void 0) {
247
- if (data.selected && this.is_multiple) {
248
- this.choice_build(data);
249
- } else if (data.selected && !this.is_multiple) {
250
- this.single_set_selected_text(this.choice_label(data));
251
- }
252
- }
253
- if (shown_results >= this.max_shown_results) {
254
- break;
255
- }
256
- }
257
- return content;
258
- };
259
-
260
- AbstractChosen.prototype.result_add_option = function(option) {
261
- var classes, option_el;
262
- if (!option.search_match) {
263
- return '';
264
- }
265
- if (!this.include_option_in_results(option)) {
266
- return '';
267
- }
268
- classes = [];
269
- if (!option.disabled && !(option.selected && this.is_multiple)) {
270
- classes.push("active-result");
271
- }
272
- if (option.disabled && !(option.selected && this.is_multiple)) {
273
- classes.push("disabled-result");
274
- }
275
- if (option.selected) {
276
- classes.push("result-selected");
277
- }
278
- if (option.group_array_index != null) {
279
- classes.push("group-option");
280
- }
281
- if (option.classes !== "") {
282
- classes.push(option.classes);
283
- }
284
- option_el = document.createElement("li");
285
- option_el.className = classes.join(" ");
286
- option_el.style.cssText = option.style;
287
- option_el.setAttribute("data-option-array-index", option.array_index);
288
- option_el.innerHTML = option.search_text;
289
- if (option.title) {
290
- option_el.title = option.title;
291
- }
292
- return this.outerHTML(option_el);
293
- };
294
-
295
- AbstractChosen.prototype.result_add_group = function(group) {
296
- var classes, group_el;
297
- if (!(group.search_match || group.group_match)) {
298
- return '';
299
- }
300
- if (!(group.active_options > 0)) {
301
- return '';
302
- }
303
- classes = [];
304
- classes.push("group-result");
305
- if (group.classes) {
306
- classes.push(group.classes);
307
- }
308
- group_el = document.createElement("li");
309
- group_el.className = classes.join(" ");
310
- group_el.innerHTML = group.search_text;
311
- if (group.title) {
312
- group_el.title = group.title;
313
- }
314
- return this.outerHTML(group_el);
315
- };
316
-
317
- AbstractChosen.prototype.results_update_field = function() {
318
- this.set_default_text();
319
- if (!this.is_multiple) {
320
- this.results_reset_cleanup();
321
- }
322
- this.result_clear_highlight();
323
- this.results_build();
324
- if (this.results_showing) {
325
- return this.winnow_results();
326
- }
327
- };
328
-
329
- AbstractChosen.prototype.reset_single_select_options = function() {
330
- var result, _i, _len, _ref, _results;
331
- _ref = this.results_data;
332
- _results = [];
333
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
334
- result = _ref[_i];
335
- if (result.selected) {
336
- _results.push(result.selected = false);
337
- } else {
338
- _results.push(void 0);
339
- }
340
- }
341
- return _results;
342
- };
343
-
344
- AbstractChosen.prototype.results_toggle = function() {
345
- if (this.results_showing) {
346
- return this.results_hide();
347
- } else {
348
- return this.results_show();
349
- }
350
- };
351
-
352
- AbstractChosen.prototype.results_search = function(evt) {
353
- if (this.results_showing) {
354
- return this.winnow_results();
355
- } else {
356
- return this.results_show();
357
- }
358
- };
359
-
360
- AbstractChosen.prototype.winnow_results = function() {
361
- var escapedSearchText, highlightRegex, option, regex, results, results_group, searchText, startpos, text, _i, _len, _ref;
362
- this.no_results_clear();
363
- results = 0;
364
- searchText = this.get_search_text();
365
- escapedSearchText = searchText.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
366
- regex = this.get_search_regex(escapedSearchText);
367
- highlightRegex = this.get_highlight_regex(escapedSearchText);
368
- _ref = this.results_data;
369
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
370
- option = _ref[_i];
371
- option.search_match = false;
372
- results_group = null;
373
- if (this.include_option_in_results(option)) {
374
- if (option.group) {
375
- option.group_match = false;
376
- option.active_options = 0;
377
- }
378
- if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
379
- results_group = this.results_data[option.group_array_index];
380
- if (results_group.active_options === 0 && results_group.search_match) {
381
- results += 1;
382
- }
383
- results_group.active_options += 1;
384
- }
385
- option.search_text = option.group ? option.label : option.html;
386
- if (!(option.group && !this.group_search)) {
387
- option.search_match = this.search_string_match(option.search_text, regex);
388
- if (option.search_match && !option.group) {
389
- results += 1;
390
- }
391
- if (option.search_match) {
392
- if (searchText.length) {
393
- startpos = option.search_text.search(highlightRegex);
394
- text = option.search_text.substr(0, startpos + searchText.length) + '</em>' + option.search_text.substr(startpos + searchText.length);
395
- option.search_text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
396
- }
397
- if (results_group != null) {
398
- results_group.group_match = true;
399
- }
400
- } else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
401
- option.search_match = true;
402
- }
403
- }
404
- }
405
- }
406
- this.result_clear_highlight();
407
- if (results < 1 && searchText.length) {
408
- this.update_results_content("");
409
- return this.no_results(searchText);
410
- } else {
411
- this.update_results_content(this.results_option_build());
412
- return this.winnow_results_set_highlight();
413
- }
414
- };
415
-
416
- AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
417
- var regex_anchor, regex_flag;
418
- regex_anchor = this.search_contains ? "" : "^";
419
- regex_flag = this.case_sensitive_search ? "" : "i";
420
- return new RegExp(regex_anchor + escaped_search_string, regex_flag);
421
- };
422
-
423
- AbstractChosen.prototype.get_highlight_regex = function(escaped_search_string) {
424
- var regex_anchor, regex_flag;
425
- regex_anchor = this.search_contains ? "" : "\\b";
426
- regex_flag = this.case_sensitive_search ? "" : "i";
427
- return new RegExp(regex_anchor + escaped_search_string, regex_flag);
428
- };
429
-
430
- AbstractChosen.prototype.search_string_match = function(search_string, regex) {
431
- var part, parts, _i, _len;
432
- if (regex.test(search_string)) {
433
- return true;
434
- } else if (this.enable_split_word_search && (search_string.indexOf(" ") >= 0 || search_string.indexOf("[") === 0)) {
435
- parts = search_string.replace(/\[|\]/g, "").split(" ");
436
- if (parts.length) {
437
- for (_i = 0, _len = parts.length; _i < _len; _i++) {
438
- part = parts[_i];
439
- if (regex.test(part)) {
440
- return true;
441
- }
442
- }
443
- }
444
- }
445
- };
446
-
447
- AbstractChosen.prototype.choices_count = function() {
448
- var option, _i, _len, _ref;
449
- if (this.selected_option_count != null) {
450
- return this.selected_option_count;
451
- }
452
- this.selected_option_count = 0;
453
- _ref = this.form_field.options;
454
- for (_i = 0, _len = _ref.length; _i < _len; _i++) {
455
- option = _ref[_i];
456
- if (option.selected) {
457
- this.selected_option_count += 1;
458
- }
459
- }
460
- return this.selected_option_count;
461
- };
462
-
463
- AbstractChosen.prototype.choices_click = function(evt) {
464
- evt.preventDefault();
465
- this.activate_field();
466
- if (!(this.results_showing || this.is_disabled)) {
467
- return this.results_show();
468
- }
469
- };
470
-
471
- AbstractChosen.prototype.keydown_checker = function(evt) {
472
- var stroke, _ref;
473
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
474
- this.search_field_scale();
475
- if (stroke !== 8 && this.pending_backstroke) {
476
- this.clear_backstroke();
477
- }
478
- switch (stroke) {
479
- case 8:
480
- this.backstroke_length = this.get_search_field_value().length;
481
- break;
482
- case 9:
483
- if (this.results_showing && !this.is_multiple) {
484
- this.result_select(evt);
485
- }
486
- this.mouse_on_container = false;
487
- break;
488
- case 13:
489
- if (this.results_showing) {
490
- evt.preventDefault();
491
- }
492
- break;
493
- case 27:
494
- if (this.results_showing) {
495
- evt.preventDefault();
496
- }
497
- break;
498
- case 32:
499
- if (this.disable_search) {
500
- evt.preventDefault();
501
- }
502
- break;
503
- case 38:
504
- evt.preventDefault();
505
- this.keyup_arrow();
506
- break;
507
- case 40:
508
- evt.preventDefault();
509
- this.keydown_arrow();
510
- break;
511
- }
512
- };
513
-
514
- AbstractChosen.prototype.keyup_checker = function(evt) {
515
- var stroke, _ref;
516
- stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
517
- this.search_field_scale();
518
- switch (stroke) {
519
- case 8:
520
- if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
521
- this.keydown_backstroke();
522
- } else if (!this.pending_backstroke) {
523
- this.result_clear_highlight();
524
- this.results_search();
525
- }
526
- break;
527
- case 13:
528
- evt.preventDefault();
529
- if (this.results_showing) {
530
- this.result_select(evt);
531
- }
532
- break;
533
- case 27:
534
- if (this.results_showing) {
535
- this.results_hide();
536
- }
537
- break;
538
- case 9:
539
- case 16:
540
- case 17:
541
- case 18:
542
- case 38:
543
- case 40:
544
- case 91:
545
- break;
546
- default:
547
- this.results_search();
548
- break;
549
- }
550
- };
551
-
552
- AbstractChosen.prototype.clipboard_event_checker = function(evt) {
553
- var _this = this;
554
- if (this.is_disabled) {
555
- return;
556
- }
557
- return setTimeout((function() {
558
- return _this.results_search();
559
- }), 50);
560
- };
561
-
562
- AbstractChosen.prototype.container_width = function() {
563
- if (this.options.width != null) {
564
- return this.options.width;
565
- } else {
566
- return "" + this.form_field.offsetWidth + "px";
567
- }
568
- };
569
-
570
- AbstractChosen.prototype.include_option_in_results = function(option) {
571
- if (this.is_multiple && (!this.display_selected_options && option.selected)) {
572
- return false;
573
- }
574
- if (!this.display_disabled_options && option.disabled) {
575
- return false;
576
- }
577
- if (option.empty) {
578
- return false;
579
- }
580
- return true;
581
- };
582
-
583
- AbstractChosen.prototype.search_results_touchstart = function(evt) {
584
- this.touch_started = true;
585
- return this.search_results_mouseover(evt);
586
- };
587
-
588
- AbstractChosen.prototype.search_results_touchmove = function(evt) {
589
- this.touch_started = false;
590
- return this.search_results_mouseout(evt);
591
- };
592
-
593
- AbstractChosen.prototype.search_results_touchend = function(evt) {
594
- if (this.touch_started) {
595
- return this.search_results_mouseup(evt);
596
- }
597
- };
598
-
599
- AbstractChosen.prototype.outerHTML = function(element) {
600
- var tmp;
601
- if (element.outerHTML) {
602
- return element.outerHTML;
603
- }
604
- tmp = document.createElement("div");
605
- tmp.appendChild(element);
606
- return tmp.innerHTML;
607
- };
608
-
609
- AbstractChosen.prototype.get_single_html = function() {
610
- 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>";
611
- };
612
-
613
- AbstractChosen.prototype.get_multi_html = function() {
614
- 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>";
615
- };
616
-
617
- AbstractChosen.prototype.get_no_results_html = function(terms) {
618
- return "<li class=\"no-results\">\n " + this.results_none_found + " <span>" + terms + "</span>\n</li>";
619
- };
620
-
621
- AbstractChosen.browser_is_supported = function() {
622
- if ("Microsoft Internet Explorer" === window.navigator.appName) {
623
- return document.documentMode >= 8;
624
- }
625
- 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)) {
626
- return false;
627
- }
628
- return true;
629
- };
630
-
631
- AbstractChosen.default_multiple_text = "Select Some Options";
632
-
633
- AbstractChosen.default_single_text = "Select an Option";
634
-
635
- AbstractChosen.default_no_result_text = "No results match";
636
-
637
- return AbstractChosen;
638
-
639
- })();
640
-
641
- this.Chosen = (function(_super) {
642
- var triggerHtmlEvent;
643
-
644
- __extends(Chosen, _super);
645
-
646
- function Chosen() {
647
- _ref = Chosen.__super__.constructor.apply(this, arguments);
648
- return _ref;
649
- }
650
-
651
- Chosen.prototype.setup = function() {
652
- return this.current_selectedIndex = this.form_field.selectedIndex;
653
- };
654
-
655
- Chosen.prototype.set_default_values = function() {
656
- Chosen.__super__.set_default_values.call(this);
657
- return this.no_results_temp = new Template(this.get_no_results_html('#{terms}'));
658
- };
659
-
660
- Chosen.prototype.set_up_html = function() {
661
- var container_classes, container_props;
662
- container_classes = ["chosen-container"];
663
- container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
664
- if (this.inherit_select_classes && this.form_field.className) {
665
- container_classes.push(this.form_field.className);
666
- }
667
- if (this.is_rtl) {
668
- container_classes.push("chosen-rtl");
669
- }
670
- container_props = {
671
- 'class': container_classes.join(' '),
672
- 'title': this.form_field.title
673
- };
674
- if (this.form_field.id.length) {
675
- container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
676
- }
677
- this.container = new Element('div', container_props);
678
- this.container.setStyle({
679
- width: this.container_width()
680
- });
681
- if (this.is_multiple) {
682
- this.container.update(this.get_multi_html());
683
- } else {
684
- this.container.update(this.get_single_html());
685
- }
686
- this.form_field.hide().insert({
687
- after: this.container
688
- });
689
- this.dropdown = this.container.down('div.chosen-drop');
690
- this.search_field = this.container.down('input');
691
- this.search_results = this.container.down('ul.chosen-results');
692
- this.search_field_scale();
693
- this.search_no_results = this.container.down('li.no-results');
694
- if (this.is_multiple) {
695
- this.search_choices = this.container.down('ul.chosen-choices');
696
- this.search_container = this.container.down('li.search-field');
697
- } else {
698
- this.search_container = this.container.down('div.chosen-search');
699
- this.selected_item = this.container.down('.chosen-single');
700
- }
701
- this.results_build();
702
- this.set_tab_index();
703
- return this.set_label_behavior();
704
- };
705
-
706
- Chosen.prototype.on_ready = function() {
707
- return this.form_field.fire("chosen:ready", {
708
- chosen: this
709
- });
710
- };
711
-
712
- Chosen.prototype.register_observers = function() {
713
- var _this = this;
714
- this.container.observe("touchstart", function(evt) {
715
- return _this.container_mousedown(evt);
716
- });
717
- this.container.observe("touchend", function(evt) {
718
- return _this.container_mouseup(evt);
719
- });
720
- this.container.observe("mousedown", function(evt) {
721
- return _this.container_mousedown(evt);
722
- });
723
- this.container.observe("mouseup", function(evt) {
724
- return _this.container_mouseup(evt);
725
- });
726
- this.container.observe("mouseenter", function(evt) {
727
- return _this.mouse_enter(evt);
728
- });
729
- this.container.observe("mouseleave", function(evt) {
730
- return _this.mouse_leave(evt);
731
- });
732
- this.search_results.observe("mouseup", function(evt) {
733
- return _this.search_results_mouseup(evt);
734
- });
735
- this.search_results.observe("mouseover", function(evt) {
736
- return _this.search_results_mouseover(evt);
737
- });
738
- this.search_results.observe("mouseout", function(evt) {
739
- return _this.search_results_mouseout(evt);
740
- });
741
- this.search_results.observe("mousewheel", function(evt) {
742
- return _this.search_results_mousewheel(evt);
743
- });
744
- this.search_results.observe("DOMMouseScroll", function(evt) {
745
- return _this.search_results_mousewheel(evt);
746
- });
747
- this.search_results.observe("touchstart", function(evt) {
748
- return _this.search_results_touchstart(evt);
749
- });
750
- this.search_results.observe("touchmove", function(evt) {
751
- return _this.search_results_touchmove(evt);
752
- });
753
- this.search_results.observe("touchend", function(evt) {
754
- return _this.search_results_touchend(evt);
755
- });
756
- this.form_field.observe("chosen:updated", function(evt) {
757
- return _this.results_update_field(evt);
758
- });
759
- this.form_field.observe("chosen:activate", function(evt) {
760
- return _this.activate_field(evt);
761
- });
762
- this.form_field.observe("chosen:open", function(evt) {
763
- return _this.container_mousedown(evt);
764
- });
765
- this.form_field.observe("chosen:close", function(evt) {
766
- return _this.close_field(evt);
767
- });
768
- this.search_field.observe("blur", function(evt) {
769
- return _this.input_blur(evt);
770
- });
771
- this.search_field.observe("keyup", function(evt) {
772
- return _this.keyup_checker(evt);
773
- });
774
- this.search_field.observe("keydown", function(evt) {
775
- return _this.keydown_checker(evt);
776
- });
777
- this.search_field.observe("focus", function(evt) {
778
- return _this.input_focus(evt);
779
- });
780
- this.search_field.observe("cut", function(evt) {
781
- return _this.clipboard_event_checker(evt);
782
- });
783
- this.search_field.observe("paste", function(evt) {
784
- return _this.clipboard_event_checker(evt);
785
- });
786
- if (this.is_multiple) {
787
- return this.search_choices.observe("click", function(evt) {
788
- return _this.choices_click(evt);
789
- });
790
- } else {
791
- return this.container.observe("click", function(evt) {
792
- return evt.preventDefault();
793
- });
794
- }
795
- };
796
-
797
- Chosen.prototype.destroy = function() {
798
- var event, _i, _len, _ref1;
799
- this.container.ownerDocument.stopObserving("click", this.click_test_action);
800
- _ref1 = ['chosen:updated', 'chosen:activate', 'chosen:open', 'chosen:close'];
801
- for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
802
- event = _ref1[_i];
803
- this.form_field.stopObserving(event);
804
- }
805
- this.container.stopObserving();
806
- this.search_results.stopObserving();
807
- this.search_field.stopObserving();
808
- if (this.form_field_label != null) {
809
- this.form_field_label.stopObserving();
810
- }
811
- if (this.is_multiple) {
812
- this.search_choices.stopObserving();
813
- this.container.select(".search-choice-close").each(function(choice) {
814
- return choice.stopObserving();
815
- });
816
- } else {
817
- this.selected_item.stopObserving();
818
- }
819
- if (this.search_field.tabIndex) {
820
- this.form_field.tabIndex = this.search_field.tabIndex;
821
- }
822
- this.container.remove();
823
- return this.form_field.show();
824
- };
825
-
826
- Chosen.prototype.search_field_disabled = function() {
827
- var _ref1;
828
- this.is_disabled = this.form_field.disabled || ((_ref1 = this.form_field.up('fieldset')) != null ? _ref1.disabled : void 0) || false;
829
- if (this.is_disabled) {
830
- this.container.addClassName('chosen-disabled');
831
- } else {
832
- this.container.removeClassName('chosen-disabled');
833
- }
834
- this.search_field.disabled = this.is_disabled;
835
- if (!this.is_multiple) {
836
- this.selected_item.stopObserving('focus', this.activate_field);
837
- }
838
- if (this.is_disabled) {
839
- return this.close_field();
840
- } else if (!this.is_multiple) {
841
- return this.selected_item.observe('focus', this.activate_field);
842
- }
843
- };
844
-
845
- Chosen.prototype.container_mousedown = function(evt) {
846
- var _ref1;
847
- if (this.is_disabled) {
848
- return;
849
- }
850
- if (evt && ((_ref1 = evt.type) === 'mousedown' || _ref1 === 'touchstart') && !this.results_showing) {
851
- evt.preventDefault();
852
- }
853
- if (!((evt != null) && evt.target.hasClassName("search-choice-close"))) {
854
- if (!this.active_field) {
855
- if (this.is_multiple) {
856
- this.search_field.clear();
857
- }
858
- this.container.ownerDocument.observe("click", this.click_test_action);
859
- this.results_show();
860
- } else if (!this.is_multiple && evt && (evt.target === this.selected_item || evt.target.up("a.chosen-single"))) {
861
- this.results_toggle();
862
- }
863
- return this.activate_field();
864
- }
865
- };
866
-
867
- Chosen.prototype.container_mouseup = function(evt) {
868
- if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
869
- return this.results_reset(evt);
870
- }
871
- };
872
-
873
- Chosen.prototype.search_results_mousewheel = function(evt) {
874
- var delta;
875
- delta = evt.deltaY || -evt.wheelDelta || evt.detail;
876
- if (delta != null) {
877
- evt.preventDefault();
878
- if (evt.type === 'DOMMouseScroll') {
879
- delta = delta * 40;
880
- }
881
- return this.search_results.scrollTop = delta + this.search_results.scrollTop;
882
- }
883
- };
884
-
885
- Chosen.prototype.blur_test = function(evt) {
886
- if (!this.active_field && this.container.hasClassName("chosen-container-active")) {
887
- return this.close_field();
888
- }
889
- };
890
-
891
- Chosen.prototype.close_field = function() {
892
- this.container.ownerDocument.stopObserving("click", this.click_test_action);
893
- this.active_field = false;
894
- this.results_hide();
895
- this.container.removeClassName("chosen-container-active");
896
- this.clear_backstroke();
897
- this.show_search_field_default();
898
- this.search_field_scale();
899
- return this.search_field.blur();
900
- };
901
-
902
- Chosen.prototype.activate_field = function() {
903
- if (this.is_disabled) {
904
- return;
905
- }
906
- this.container.addClassName("chosen-container-active");
907
- this.active_field = true;
908
- this.search_field.value = this.get_search_field_value();
909
- return this.search_field.focus();
910
- };
911
-
912
- Chosen.prototype.test_active_click = function(evt) {
913
- if (evt.target.up('.chosen-container') === this.container) {
914
- return this.active_field = true;
915
- } else {
916
- return this.close_field();
917
- }
918
- };
919
-
920
- Chosen.prototype.results_build = function() {
921
- this.parsing = true;
922
- this.selected_option_count = null;
923
- this.results_data = SelectParser.select_to_array(this.form_field);
924
- if (this.is_multiple) {
925
- this.search_choices.select("li.search-choice").invoke("remove");
926
- } else if (!this.is_multiple) {
927
- this.single_set_selected_text();
928
- if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
929
- this.search_field.readOnly = true;
930
- this.container.addClassName("chosen-container-single-nosearch");
931
- } else {
932
- this.search_field.readOnly = false;
933
- this.container.removeClassName("chosen-container-single-nosearch");
934
- }
935
- }
936
- this.update_results_content(this.results_option_build({
937
- first: true
938
- }));
939
- this.search_field_disabled();
940
- this.show_search_field_default();
941
- this.search_field_scale();
942
- return this.parsing = false;
943
- };
944
-
945
- Chosen.prototype.result_do_highlight = function(el) {
946
- var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
947
- this.result_clear_highlight();
948
- this.result_highlight = el;
949
- this.result_highlight.addClassName("highlighted");
950
- maxHeight = parseInt(this.search_results.getStyle('maxHeight'), 10);
951
- visible_top = this.search_results.scrollTop;
952
- visible_bottom = maxHeight + visible_top;
953
- high_top = this.result_highlight.positionedOffset().top;
954
- high_bottom = high_top + this.result_highlight.getHeight();
955
- if (high_bottom >= visible_bottom) {
956
- return this.search_results.scrollTop = (high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0;
957
- } else if (high_top < visible_top) {
958
- return this.search_results.scrollTop = high_top;
959
- }
960
- };
961
-
962
- Chosen.prototype.result_clear_highlight = function() {
963
- if (this.result_highlight) {
964
- this.result_highlight.removeClassName('highlighted');
965
- }
966
- return this.result_highlight = null;
967
- };
968
-
969
- Chosen.prototype.results_show = function() {
970
- if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
971
- this.form_field.fire("chosen:maxselected", {
972
- chosen: this
973
- });
974
- return false;
975
- }
976
- this.container.addClassName("chosen-with-drop");
977
- this.results_showing = true;
978
- this.search_field.focus();
979
- this.search_field.value = this.get_search_field_value();
980
- this.winnow_results();
981
- return this.form_field.fire("chosen:showing_dropdown", {
982
- chosen: this
983
- });
984
- };
985
-
986
- Chosen.prototype.update_results_content = function(content) {
987
- return this.search_results.update(content);
988
- };
989
-
990
- Chosen.prototype.results_hide = function() {
991
- if (this.results_showing) {
992
- this.result_clear_highlight();
993
- this.container.removeClassName("chosen-with-drop");
994
- this.form_field.fire("chosen:hiding_dropdown", {
995
- chosen: this
996
- });
997
- }
998
- return this.results_showing = false;
999
- };
1000
-
1001
- Chosen.prototype.set_tab_index = function(el) {
1002
- var ti;
1003
- if (this.form_field.tabIndex) {
1004
- ti = this.form_field.tabIndex;
1005
- this.form_field.tabIndex = -1;
1006
- return this.search_field.tabIndex = ti;
1007
- }
1008
- };
1009
-
1010
- Chosen.prototype.set_label_behavior = function() {
1011
- this.form_field_label = this.form_field.up("label");
1012
- if (this.form_field_label == null) {
1013
- this.form_field_label = $$("label[for='" + this.form_field.id + "']").first();
1014
- }
1015
- if (this.form_field_label != null) {
1016
- return this.form_field_label.observe("click", this.label_click_handler);
1017
- }
1018
- };
1019
-
1020
- Chosen.prototype.show_search_field_default = function() {
1021
- if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
1022
- this.search_field.value = this.default_text;
1023
- return this.search_field.addClassName("default");
1024
- } else {
1025
- this.search_field.value = "";
1026
- return this.search_field.removeClassName("default");
1027
- }
1028
- };
1029
-
1030
- Chosen.prototype.search_results_mouseup = function(evt) {
1031
- var target;
1032
- target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
1033
- if (target) {
1034
- this.result_highlight = target;
1035
- this.result_select(evt);
1036
- return this.search_field.focus();
1037
- }
1038
- };
1039
-
1040
- Chosen.prototype.search_results_mouseover = function(evt) {
1041
- var target;
1042
- target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
1043
- if (target) {
1044
- return this.result_do_highlight(target);
1045
- }
1046
- };
1047
-
1048
- Chosen.prototype.search_results_mouseout = function(evt) {
1049
- if (evt.target.hasClassName('active-result') || evt.target.up('.active-result')) {
1050
- return this.result_clear_highlight();
1051
- }
1052
- };
1053
-
1054
- Chosen.prototype.choice_build = function(item) {
1055
- var choice, close_link,
1056
- _this = this;
1057
- choice = new Element('li', {
1058
- "class": "search-choice"
1059
- }).update("<span>" + (this.choice_label(item)) + "</span>");
1060
- if (item.disabled) {
1061
- choice.addClassName('search-choice-disabled');
1062
- } else {
1063
- close_link = new Element('a', {
1064
- href: '#',
1065
- "class": 'search-choice-close',
1066
- rel: item.array_index
1067
- });
1068
- close_link.observe("click", function(evt) {
1069
- return _this.choice_destroy_link_click(evt);
1070
- });
1071
- choice.insert(close_link);
1072
- }
1073
- return this.search_container.insert({
1074
- before: choice
1075
- });
1076
- };
1077
-
1078
- Chosen.prototype.choice_destroy_link_click = function(evt) {
1079
- evt.preventDefault();
1080
- evt.stopPropagation();
1081
- if (!this.is_disabled) {
1082
- return this.choice_destroy(evt.target);
1083
- }
1084
- };
1085
-
1086
- Chosen.prototype.choice_destroy = function(link) {
1087
- if (this.result_deselect(link.readAttribute("rel"))) {
1088
- if (this.active_field) {
1089
- this.search_field.focus();
1090
- } else {
1091
- this.show_search_field_default();
1092
- }
1093
- if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {
1094
- this.results_hide();
1095
- }
1096
- link.up('li').remove();
1097
- return this.search_field_scale();
1098
- }
1099
- };
1100
-
1101
- Chosen.prototype.results_reset = function() {
1102
- this.reset_single_select_options();
1103
- this.form_field.options[0].selected = true;
1104
- this.single_set_selected_text();
1105
- this.show_search_field_default();
1106
- this.results_reset_cleanup();
1107
- this.trigger_form_field_change();
1108
- if (this.active_field) {
1109
- return this.results_hide();
1110
- }
1111
- };
1112
-
1113
- Chosen.prototype.results_reset_cleanup = function() {
1114
- var deselect_trigger;
1115
- this.current_selectedIndex = this.form_field.selectedIndex;
1116
- deselect_trigger = this.selected_item.down("abbr");
1117
- if (deselect_trigger) {
1118
- return deselect_trigger.remove();
1119
- }
1120
- };
1121
-
1122
- Chosen.prototype.result_select = function(evt) {
1123
- var high, item;
1124
- if (this.result_highlight) {
1125
- high = this.result_highlight;
1126
- this.result_clear_highlight();
1127
- if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
1128
- this.form_field.fire("chosen:maxselected", {
1129
- chosen: this
1130
- });
1131
- return false;
1132
- }
1133
- if (this.is_multiple) {
1134
- high.removeClassName("active-result");
1135
- } else {
1136
- this.reset_single_select_options();
1137
- }
1138
- high.addClassName("result-selected");
1139
- item = this.results_data[high.getAttribute("data-option-array-index")];
1140
- item.selected = true;
1141
- this.form_field.options[item.options_index].selected = true;
1142
- this.selected_option_count = null;
1143
- if (this.is_multiple) {
1144
- this.choice_build(item);
1145
- } else {
1146
- this.single_set_selected_text(this.choice_label(item));
1147
- }
1148
- if (!(this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey)))) {
1149
- this.results_hide();
1150
- this.show_search_field_default();
1151
- }
1152
- if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
1153
- this.trigger_form_field_change();
1154
- }
1155
- this.current_selectedIndex = this.form_field.selectedIndex;
1156
- evt.preventDefault();
1157
- return this.search_field_scale();
1158
- }
1159
- };
1160
-
1161
- Chosen.prototype.single_set_selected_text = function(text) {
1162
- if (text == null) {
1163
- text = this.default_text;
1164
- }
1165
- if (text === this.default_text) {
1166
- this.selected_item.addClassName("chosen-default");
1167
- } else {
1168
- this.single_deselect_control_build();
1169
- this.selected_item.removeClassName("chosen-default");
1170
- }
1171
- return this.selected_item.down("span").update(text);
1172
- };
1173
-
1174
- Chosen.prototype.result_deselect = function(pos) {
1175
- var result_data;
1176
- result_data = this.results_data[pos];
1177
- if (!this.form_field.options[result_data.options_index].disabled) {
1178
- result_data.selected = false;
1179
- this.form_field.options[result_data.options_index].selected = false;
1180
- this.selected_option_count = null;
1181
- this.result_clear_highlight();
1182
- if (this.results_showing) {
1183
- this.winnow_results();
1184
- }
1185
- this.trigger_form_field_change();
1186
- this.search_field_scale();
1187
- return true;
1188
- } else {
1189
- return false;
1190
- }
1191
- };
1192
-
1193
- Chosen.prototype.single_deselect_control_build = function() {
1194
- if (!this.allow_single_deselect) {
1195
- return;
1196
- }
1197
- if (!this.selected_item.down("abbr")) {
1198
- this.selected_item.down("span").insert({
1199
- after: "<abbr class=\"search-choice-close\"></abbr>"
1200
- });
1201
- }
1202
- return this.selected_item.addClassName("chosen-single-with-deselect");
1203
- };
1204
-
1205
- Chosen.prototype.get_search_field_value = function() {
1206
- return this.search_field.value;
1207
- };
1208
-
1209
- Chosen.prototype.get_search_text = function() {
1210
- return this.escape_html(this.get_search_field_value().strip());
1211
- };
1212
-
1213
- Chosen.prototype.escape_html = function(text) {
1214
- return text.escapeHTML();
1215
- };
1216
-
1217
- Chosen.prototype.winnow_results_set_highlight = function() {
1218
- var do_high;
1219
- if (!this.is_multiple) {
1220
- do_high = this.search_results.down(".result-selected.active-result");
1221
- }
1222
- if (do_high == null) {
1223
- do_high = this.search_results.down(".active-result");
1224
- }
1225
- if (do_high != null) {
1226
- return this.result_do_highlight(do_high);
1227
- }
1228
- };
1229
-
1230
- Chosen.prototype.no_results = function(terms) {
1231
- this.search_results.insert(this.no_results_temp.evaluate({
1232
- terms: terms
1233
- }));
1234
- return this.form_field.fire("chosen:no_results", {
1235
- chosen: this
1236
- });
1237
- };
1238
-
1239
- Chosen.prototype.no_results_clear = function() {
1240
- var nr, _results;
1241
- nr = null;
1242
- _results = [];
1243
- while (nr = this.search_results.down(".no-results")) {
1244
- _results.push(nr.remove());
1245
- }
1246
- return _results;
1247
- };
1248
-
1249
- Chosen.prototype.keydown_arrow = function() {
1250
- var next_sib;
1251
- if (this.results_showing && this.result_highlight) {
1252
- next_sib = this.result_highlight.next('.active-result');
1253
- if (next_sib) {
1254
- return this.result_do_highlight(next_sib);
1255
- }
1256
- } else {
1257
- return this.results_show();
1258
- }
1259
- };
1260
-
1261
- Chosen.prototype.keyup_arrow = function() {
1262
- var actives, prevs, sibs;
1263
- if (!this.results_showing && !this.is_multiple) {
1264
- return this.results_show();
1265
- } else if (this.result_highlight) {
1266
- sibs = this.result_highlight.previousSiblings();
1267
- actives = this.search_results.select("li.active-result");
1268
- prevs = sibs.intersect(actives);
1269
- if (prevs.length) {
1270
- return this.result_do_highlight(prevs.first());
1271
- } else {
1272
- if (this.choices_count() > 0) {
1273
- this.results_hide();
1274
- }
1275
- return this.result_clear_highlight();
1276
- }
1277
- }
1278
- };
1279
-
1280
- Chosen.prototype.keydown_backstroke = function() {
1281
- var next_available_destroy;
1282
- if (this.pending_backstroke) {
1283
- this.choice_destroy(this.pending_backstroke.down("a"));
1284
- return this.clear_backstroke();
1285
- } else {
1286
- next_available_destroy = this.search_container.siblings().last();
1287
- if (next_available_destroy && next_available_destroy.hasClassName("search-choice") && !next_available_destroy.hasClassName("search-choice-disabled")) {
1288
- this.pending_backstroke = next_available_destroy;
1289
- if (this.pending_backstroke) {
1290
- this.pending_backstroke.addClassName("search-choice-focus");
1291
- }
1292
- if (this.single_backstroke_delete) {
1293
- return this.keydown_backstroke();
1294
- } else {
1295
- return this.pending_backstroke.addClassName("search-choice-focus");
1296
- }
1297
- }
1298
- }
1299
- };
1300
-
1301
- Chosen.prototype.clear_backstroke = function() {
1302
- if (this.pending_backstroke) {
1303
- this.pending_backstroke.removeClassName("search-choice-focus");
1304
- }
1305
- return this.pending_backstroke = null;
1306
- };
1307
-
1308
- Chosen.prototype.search_field_scale = function() {
1309
- var container_width, div, style, style_block, styles, width, _i, _len;
1310
- if (!this.is_multiple) {
1311
- return;
1312
- }
1313
- style_block = {
1314
- position: 'absolute',
1315
- left: '-1000px',
1316
- top: '-1000px',
1317
- display: 'none',
1318
- whiteSpace: 'pre'
1319
- };
1320
- styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];
1321
- for (_i = 0, _len = styles.length; _i < _len; _i++) {
1322
- style = styles[_i];
1323
- style_block[style] = this.search_field.getStyle(style);
1324
- }
1325
- div = new Element('div').update(this.escape_html(this.get_search_field_value()));
1326
- div.setStyle(style_block);
1327
- document.body.appendChild(div);
1328
- width = div.measure('width') + 25;
1329
- div.remove();
1330
- container_width = this.container.getWidth();
1331
- width = Math.min(container_width - 10, width);
1332
- return this.search_field.setStyle({
1333
- width: width + 'px'
1334
- });
1335
- };
1336
-
1337
- Chosen.prototype.trigger_form_field_change = function() {
1338
- triggerHtmlEvent(this.form_field, 'input');
1339
- return triggerHtmlEvent(this.form_field, 'change');
1340
- };
1341
-
1342
- triggerHtmlEvent = function(element, eventType) {
1343
- var evt;
1344
- if (element.dispatchEvent) {
1345
- try {
1346
- evt = new Event(eventType, {
1347
- bubbles: true,
1348
- cancelable: true
1349
- });
1350
- } catch (_error) {
1351
- evt = document.createEvent('HTMLEvents');
1352
- evt.initEvent(eventType, true, true);
1353
- }
1354
- return element.dispatchEvent(evt);
1355
- } else {
1356
- return element.fireEvent("on" + eventType, document.createEventObject());
1357
- }
1358
- };
1359
-
1360
- return Chosen;
1361
-
1362
- })(AbstractChosen);
1363
-
1364
- }).call(this);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/chosen.proto.min.js DELETED
@@ -1,2 +0,0 @@
1
- /* Chosen v1.7.0 | (c) 2011-2017 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
2
- (function(){var a,b,c,d=function(a,b){return function(){return a.apply(b,arguments)}},e={}.hasOwnProperty,f=function(a,b){function c(){this.constructor=a}for(var d in b)e.call(b,d)&&(a[d]=b[d]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a};b=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return"OPTGROUP"===a.nodeName.toUpperCase()?this.add_group(a):this.add_option(a)},a.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),title:a.title?a.title:void 0,children:0,disabled:a.disabled,classes:a.className}),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},a.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,title:a.title?a.title:void 0,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,group_label:null!=b?this.parsed[b].label:null,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},a.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},a}(),b.select_to_array=function(a){var c,d,e,f,g;for(d=new b,g=a.childNodes,e=0,f=g.length;f>e;e++)c=g[e],d.add_node(c);return d.parsed},a=function(){function a(b,c){this.form_field=b,this.options=null!=c?c:{},this.label_click_handler=d(this.label_click_handler,this),a.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 a.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.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:!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,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:!0},a.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||a.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||a.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||a.default_no_result_text},a.prototype.choice_label=function(a){return this.include_group_label_in_selected&&null!=a.group_label?"<b class='group-name'>"+a.group_label+"</b>"+a.html:a.html},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},a.prototype.input_blur=function(a){var b=this;return this.mouse_on_container?void 0:(this.active_field=!1,setTimeout(function(){return b.blur_test()},100))},a.prototype.label_click_handler=function(a){return this.is_multiple?this.container_mousedown(a):this.activate_field()},a.prototype.results_option_build=function(a){var b,c,d,e,f,g,h;for(b="",e=0,h=this.results_data,f=0,g=h.length;g>f&&(c=h[f],d="",d=c.group?this.result_add_group(c):this.result_add_option(c),""!==d&&(e++,b+=d),(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(this.choice_label(c))),!(e>=this.max_shown_results));f++);return b},a.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,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.prototype.result_add_group=function(a){var b,c;return(a.search_match||a.group_match)&&a.active_options>0?(b=[],b.push("group-result"),a.classes&&b.push(a.classes),c=document.createElement("li"),c.className=b.join(" "),c.innerHTML=a.search_text,a.title&&(c.title=a.title),this.outerHTML(c)):""},a.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},a.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},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.winnow_results=function(){var a,b,c,d,e,f,g,h,i,j,k,l;for(this.no_results_clear(),e=0,g=this.get_search_text(),a=g.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),d=this.get_search_regex(a),b=this.get_highlight_regex(a),l=this.results_data,j=0,k=l.length;k>j;j++)c=l[j],c.search_match=!1,f=null,this.include_option_in_results(c)&&(c.group&&(c.group_match=!1,c.active_options=0),null!=c.group_array_index&&this.results_data[c.group_array_index]&&(f=this.results_data[c.group_array_index],0===f.active_options&&f.search_match&&(e+=1),f.active_options+=1),c.search_text=c.group?c.label:c.html,(!c.group||this.group_search)&&(c.search_match=this.search_string_match(c.search_text,d),c.search_match&&!c.group&&(e+=1),c.search_match?(g.length&&(h=c.search_text.search(b),i=c.search_text.substr(0,h+g.length)+"</em>"+c.search_text.substr(h+g.length),c.search_text=i.substr(0,h)+"<em>"+i.substr(h)),null!=f&&(f.group_match=!0)):null!=c.group_array_index&&this.results_data[c.group_array_index].search_match&&(c.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())},a.prototype.get_search_regex=function(a){var b,c;return b=this.search_contains?"":"^",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},a.prototype.get_highlight_regex=function(a){var b,c;return b=this.search_contains?"":"\\b",c=this.case_sensitive_search?"":"i",new RegExp(b+a,c)},a.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},a.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},a.prototype.choices_click=function(a){return a.preventDefault(),this.activate_field(),this.results_showing||this.is_disabled?void 0:this.results_show()},a.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.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:this.results_showing&&a.preventDefault();break;case 27:this.results_showing&&a.preventDefault();break;case 32:this.disable_search&&a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:a.preventDefault(),this.keydown_arrow()}},a.prototype.keyup_checker=function(a){var b,c;switch(b=null!=(c=a.which)?c:a.keyCode,this.search_field_scale(),b){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:a.preventDefault(),this.results_showing&&this.result_select(a);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()}},a.prototype.clipboard_event_checker=function(a){var b=this;if(!this.is_disabled)return setTimeout(function(){return b.results_search()},50)},a.prototype.container_width=function(){return null!=this.options.width?this.options.width:""+this.form_field.offsetWidth+"px"},a.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},a.prototype.search_results_touchstart=function(a){return this.touch_started=!0,this.search_results_mouseover(a)},a.prototype.search_results_touchmove=function(a){return this.touch_started=!1,this.search_results_mouseout(a)},a.prototype.search_results_touchend=function(a){return this.touch_started?this.search_results_mouseup(a):void 0},a.prototype.outerHTML=function(a){var b;return a.outerHTML?a.outerHTML:(b=document.createElement("div"),b.appendChild(a),b.innerHTML)},a.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>'},a.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>'},a.prototype.get_no_results_html=function(a){return'<li class="no-results">\n '+this.results_none_found+" <span>"+a+"</span>\n</li>"},a.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)?!1:!0},a.default_multiple_text="Select Some Options",a.default_single_text="Select an Option",a.default_no_result_text="No results match",a}(),this.Chosen=function(a){function d(){return c=d.__super__.constructor.apply(this,arguments)}var e;return f(d,a),d.prototype.setup=function(){return this.current_selectedIndex=this.form_field.selectedIndex},d.prototype.set_default_values=function(){return d.__super__.set_default_values.call(this),this.no_results_temp=new Template(this.get_no_results_html("#{terms}"))},d.prototype.set_up_html=function(){var a,b;return a=["chosen-container"],a.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&a.push(this.form_field.className),this.is_rtl&&a.push("chosen-rtl"),b={"class":a.join(" "),title:this.form_field.title},this.form_field.id.length&&(b.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=new Element("div",b),this.container.setStyle({width:this.container_width()}),this.is_multiple?this.container.update(this.get_multi_html()):this.container.update(this.get_single_html()),this.form_field.hide().insert({after:this.container}),this.dropdown=this.container.down("div.chosen-drop"),this.search_field=this.container.down("input"),this.search_results=this.container.down("ul.chosen-results"),this.search_field_scale(),this.search_no_results=this.container.down("li.no-results"),this.is_multiple?(this.search_choices=this.container.down("ul.chosen-choices"),this.search_container=this.container.down("li.search-field")):(this.search_container=this.container.down("div.chosen-search"),this.selected_item=this.container.down(".chosen-single")),this.results_build(),this.set_tab_index(),this.set_label_behavior()},d.prototype.on_ready=function(){return this.form_field.fire("chosen:ready",{chosen:this})},d.prototype.register_observers=function(){var a=this;return this.container.observe("touchstart",function(b){return a.container_mousedown(b)}),this.container.observe("touchend",function(b){return a.container_mouseup(b)}),this.container.observe("mousedown",function(b){return a.container_mousedown(b)}),this.container.observe("mouseup",function(b){return a.container_mouseup(b)}),this.container.observe("mouseenter",function(b){return a.mouse_enter(b)}),this.container.observe("mouseleave",function(b){return a.mouse_leave(b)}),this.search_results.observe("mouseup",function(b){return a.search_results_mouseup(b)}),this.search_results.observe("mouseover",function(b){return a.search_results_mouseover(b)}),this.search_results.observe("mouseout",function(b){return a.search_results_mouseout(b)}),this.search_results.observe("mousewheel",function(b){return a.search_results_mousewheel(b)}),this.search_results.observe("DOMMouseScroll",function(b){return a.search_results_mousewheel(b)}),this.search_results.observe("touchstart",function(b){return a.search_results_touchstart(b)}),this.search_results.observe("touchmove",function(b){return a.search_results_touchmove(b)}),this.search_results.observe("touchend",function(b){return a.search_results_touchend(b)}),this.form_field.observe("chosen:updated",function(b){return a.results_update_field(b)}),this.form_field.observe("chosen:activate",function(b){return a.activate_field(b)}),this.form_field.observe("chosen:open",function(b){return a.container_mousedown(b)}),this.form_field.observe("chosen:close",function(b){return a.close_field(b)}),this.search_field.observe("blur",function(b){return a.input_blur(b)}),this.search_field.observe("keyup",function(b){return a.keyup_checker(b)}),this.search_field.observe("keydown",function(b){return a.keydown_checker(b)}),this.search_field.observe("focus",function(b){return a.input_focus(b)}),this.search_field.observe("cut",function(b){return a.clipboard_event_checker(b)}),this.search_field.observe("paste",function(b){return a.clipboard_event_checker(b)}),this.is_multiple?this.search_choices.observe("click",function(b){return a.choices_click(b)}):this.container.observe("click",function(a){return a.preventDefault()})},d.prototype.destroy=function(){var a,b,c,d;for(this.container.ownerDocument.stopObserving("click",this.click_test_action),d=["chosen:updated","chosen:activate","chosen:open","chosen:close"],b=0,c=d.length;c>b;b++)a=d[b],this.form_field.stopObserving(a);return this.container.stopObserving(),this.search_results.stopObserving(),this.search_field.stopObserving(),null!=this.form_field_label&&this.form_field_label.stopObserving(),this.is_multiple?(this.search_choices.stopObserving(),this.container.select(".search-choice-close").each(function(a){return a.stopObserving()})):this.selected_item.stopObserving(),this.search_field.tabIndex&&(this.form_field.tabIndex=this.search_field.tabIndex),this.container.remove(),this.form_field.show()},d.prototype.search_field_disabled=function(){var a;return this.is_disabled=this.form_field.disabled||(null!=(a=this.form_field.up("fieldset"))?a.disabled:void 0)||!1,this.is_disabled?this.container.addClassName("chosen-disabled"):this.container.removeClassName("chosen-disabled"),this.search_field.disabled=this.is_disabled,this.is_multiple||this.selected_item.stopObserving("focus",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.observe("focus",this.activate_field)},d.prototype.container_mousedown=function(a){var b;if(!this.is_disabled)return!a||"mousedown"!==(b=a.type)&&"touchstart"!==b||this.results_showing||a.preventDefault(),null!=a&&a.target.hasClassName("search-choice-close")?void 0:(this.active_field?this.is_multiple||!a||a.target!==this.selected_item&&!a.target.up("a.chosen-single")||this.results_toggle():(this.is_multiple&&this.search_field.clear(),this.container.ownerDocument.observe("click",this.click_test_action),this.results_show()),this.activate_field())},d.prototype.container_mouseup=function(a){return"ABBR"!==a.target.nodeName||this.is_disabled?void 0:this.results_reset(a)},d.prototype.search_results_mousewheel=function(a){var b;return b=a.deltaY||-a.wheelDelta||a.detail,null!=b?(a.preventDefault(),"DOMMouseScroll"===a.type&&(b=40*b),this.search_results.scrollTop=b+this.search_results.scrollTop):void 0},d.prototype.blur_test=function(a){return!this.active_field&&this.container.hasClassName("chosen-container-active")?this.close_field():void 0},d.prototype.close_field=function(){return this.container.ownerDocument.stopObserving("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClassName("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},d.prototype.activate_field=function(){return this.is_disabled?void 0:(this.container.addClassName("chosen-container-active"),this.active_field=!0,this.search_field.value=this.get_search_field_value(),this.search_field.focus())},d.prototype.test_active_click=function(a){return a.target.up(".chosen-container")===this.container?this.active_field=!0:this.close_field()},d.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=b.select_to_array(this.form_field),this.is_multiple?this.search_choices.select("li.search-choice").invoke("remove"):this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field.readOnly=!0,this.container.addClassName("chosen-container-single-nosearch")):(this.search_field.readOnly=!1,this.container.removeClassName("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},d.prototype.result_do_highlight=function(a){var b,c,d,e,f;return this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClassName("highlighted"),d=parseInt(this.search_results.getStyle("maxHeight"),10),f=this.search_results.scrollTop,e=d+f,c=this.result_highlight.positionedOffset().top,b=c+this.result_highlight.getHeight(),b>=e?this.search_results.scrollTop=b-d>0?b-d:0:f>c?this.search_results.scrollTop=c:void 0},d.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClassName("highlighted"),this.result_highlight=null},d.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field.fire("chosen:maxselected",{chosen:this}),!1):(this.container.addClassName("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.value=this.get_search_field_value(),this.winnow_results(),this.form_field.fire("chosen:showing_dropdown",{chosen:this}))},d.prototype.update_results_content=function(a){return this.search_results.update(a)},d.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClassName("chosen-with-drop"),this.form_field.fire("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},d.prototype.set_tab_index=function(a){var b;return this.form_field.tabIndex?(b=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field.tabIndex=b):void 0},d.prototype.set_label_behavior=function(){return this.form_field_label=this.form_field.up("label"),null==this.form_field_label&&(this.form_field_label=$$("label[for='"+this.form_field.id+"']").first()),null!=this.form_field_label?this.form_field_label.observe("click",this.label_click_handler):void 0},d.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.value=this.default_text,this.search_field.addClassName("default")):(this.search_field.value="",this.search_field.removeClassName("default"))},d.prototype.search_results_mouseup=function(a){var b;return b=a.target.hasClassName("active-result")?a.target:a.target.up(".active-result"),b?(this.result_highlight=b,this.result_select(a),this.search_field.focus()):void 0},d.prototype.search_results_mouseover=function(a){var b;return b=a.target.hasClassName("active-result")?a.target:a.target.up(".active-result"),b?this.result_do_highlight(b):void 0},d.prototype.search_results_mouseout=function(a){return a.target.hasClassName("active-result")||a.target.up(".active-result")?this.result_clear_highlight():void 0},d.prototype.choice_build=function(a){var b,c,d=this;return b=new Element("li",{"class":"search-choice"}).update("<span>"+this.choice_label(a)+"</span>"),a.disabled?b.addClassName("search-choice-disabled"):(c=new Element("a",{href:"#","class":"search-choice-close",rel:a.array_index}),c.observe("click",function(a){return d.choice_destroy_link_click(a)}),b.insert(c)),this.search_container.insert({before:b})},d.prototype.choice_destroy_link_click=function(a){return a.preventDefault(),a.stopPropagation(),this.is_disabled?void 0:this.choice_destroy(a.target)},d.prototype.choice_destroy=function(a){return this.result_deselect(a.readAttribute("rel"))?(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(),a.up("li").remove(),this.search_field_scale()):void 0},d.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.trigger_form_field_change(),this.active_field?this.results_hide():void 0},d.prototype.results_reset_cleanup=function(){var a;return this.current_selectedIndex=this.form_field.selectedIndex,a=this.selected_item.down("abbr"),a?a.remove():void 0},d.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.fire("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?b.removeClassName("active-result"):this.reset_single_select_options(),b.addClassName("result-selected"),c=this.results_data[b.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(this.choice_label(c)),(!this.is_multiple||this.hide_results_on_select&&!a.metaKey&&!a.ctrlKey)&&(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change(),this.current_selectedIndex=this.form_field.selectedIndex,a.preventDefault(),this.search_field_scale())):void 0},d.prototype.single_set_selected_text=function(a){return null==a&&(a=this.default_text),a===this.default_text?this.selected_item.addClassName("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClassName("chosen-default")),this.selected_item.down("span").update(a)},d.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.trigger_form_field_change(),this.search_field_scale(),!0)},d.prototype.single_deselect_control_build=function(){return this.allow_single_deselect?(this.selected_item.down("abbr")||this.selected_item.down("span").insert({after:'<abbr class="search-choice-close"></abbr>'}),this.selected_item.addClassName("chosen-single-with-deselect")):void 0},d.prototype.get_search_field_value=function(){return this.search_field.value},d.prototype.get_search_text=function(){return this.escape_html(this.get_search_field_value().strip())},d.prototype.escape_html=function(a){return a.escapeHTML()},d.prototype.winnow_results_set_highlight=function(){var a;return this.is_multiple||(a=this.search_results.down(".result-selected.active-result")),null==a&&(a=this.search_results.down(".active-result")),null!=a?this.result_do_highlight(a):void 0},d.prototype.no_results=function(a){return this.search_results.insert(this.no_results_temp.evaluate({terms:a})),this.form_field.fire("chosen:no_results",{chosen:this})},d.prototype.no_results_clear=function(){var a,b;for(a=null,b=[];a=this.search_results.down(".no-results");)b.push(a.remove());return b},d.prototype.keydown_arrow=function(){var a;return this.results_showing&&this.result_highlight?(a=this.result_highlight.next(".active-result"))?this.result_do_highlight(a):void 0:this.results_show()},d.prototype.keyup_arrow=function(){var a,b,c;return this.results_showing||this.is_multiple?this.result_highlight?(c=this.result_highlight.previousSiblings(),a=this.search_results.select("li.active-result"),b=c.intersect(a),b.length?this.result_do_highlight(b.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},d.prototype.keydown_backstroke=function(){var a;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.down("a")),this.clear_backstroke()):(a=this.search_container.siblings().last(),a&&a.hasClassName("search-choice")&&!a.hasClassName("search-choice-disabled")?(this.pending_backstroke=a,this.pending_backstroke&&this.pending_backstroke.addClassName("search-choice-focus"),this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClassName("search-choice-focus")):void 0)},d.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClassName("search-choice-focus"),this.pending_backstroke=null},d.prototype.search_field_scale=function(){var a,b,c,d,e,f,g,h;if(this.is_multiple){for(d={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},e=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"],g=0,h=e.length;h>g;g++)c=e[g],d[c]=this.search_field.getStyle(c);return b=new Element("div").update(this.escape_html(this.get_search_field_value())),b.setStyle(d),document.body.appendChild(b),f=b.measure("width")+25,b.remove(),a=this.container.getWidth(),f=Math.min(a-10,f),this.search_field.setStyle({width:f+"px"})}},d.prototype.trigger_form_field_change=function(){return e(this.form_field,"input"),e(this.form_field,"change")},e=function(a,b){var c;if(a.dispatchEvent){try{c=new Event(b,{bubbles:!0,cancelable:!0})}catch(d){c=document.createEvent("HTMLEvents"),c.initEvent(b,!0,!0)}return a.dispatchEvent(c)}return a.fireEvent("on"+b,document.createEventObject())},d}(a)}).call(this);
 
 
assets/inc/chosen/docsupport/chosen.png DELETED
Binary file
assets/inc/chosen/docsupport/init.js DELETED
@@ -1,11 +0,0 @@
1
- var config = {
2
- '.chosen-select' : {},
3
- '.chosen-select-deselect' : { allow_single_deselect: true },
4
- '.chosen-select-no-single' : { disable_search_threshold: 10 },
5
- '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
6
- '.chosen-select-rtl' : { rtl: true },
7
- '.chosen-select-width' : { width: '95%' }
8
- }
9
- for (var selector in config) {
10
- $(selector).chosen(config[selector]);
11
- }
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/docsupport/init.proto.js DELETED
@@ -1,16 +0,0 @@
1
- document.observe('dom:loaded', function(evt) {
2
- var config = {
3
- '.chosen-select' : {},
4
- '.chosen-select-deselect' : { allow_single_deselect: true },
5
- '.chosen-select-no-single' : { disable_search_threshold: 10 },
6
- '.chosen-select-no-results': { no_results_text: 'Oops, nothing found!' },
7
- '.chosen-select-rtl' : { rtl: true },
8
- '.chosen-select-width' : { width: '95%' }
9
- }
10
-
11
- for (var selector in config) {
12
- $$(selector).each(function(element) {
13
- new Chosen(element, config[selector]);
14
- });
15
- }
16
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/docsupport/oss-credit.png DELETED
Binary file
assets/inc/chosen/docsupport/prism.css DELETED
@@ -1,108 +0,0 @@
1
- /**
2
- * okaidia theme for JavaScript, CSS and HTML
3
- * Loosely based on Monokai textmate theme by http://www.monokai.nl/
4
- * @author ocodia
5
- */
6
-
7
- code[class*="language-"],
8
- pre[class*="language-"] {
9
- color: #f8f8f2;
10
- text-shadow: 0 1px rgba(0,0,0,0.3);
11
- font-family: Consolas, Monaco, 'Andale Mono', monospace;
12
- direction: ltr;
13
- text-align: left;
14
- white-space: pre;
15
- word-spacing: normal;
16
-
17
- -moz-tab-size: 4;
18
- -o-tab-size: 4;
19
- tab-size: 4;
20
-
21
- -webkit-hyphens: none;
22
- -moz-hyphens: none;
23
- -ms-hyphens: none;
24
- hyphens: none;
25
- }
26
-
27
- /* Code blocks */
28
- pre[class*="language-"] {
29
- padding: 1em;
30
- margin: .5em 0;
31
- overflow: auto;
32
- border-radius: 0.3em;
33
- }
34
-
35
- :not(pre) > code[class*="language-"],
36
- pre[class*="language-"] {
37
- background: #272822;
38
- }
39
-
40
- /* Inline code */
41
- :not(pre) > code[class*="language-"] {
42
- padding: .1em;
43
- border-radius: .3em;
44
- }
45
-
46
- .token.comment,
47
- .token.prolog,
48
- .token.doctype,
49
- .token.cdata {
50
- color: slategray;
51
- }
52
-
53
- .token.punctuation {
54
- color: #f8f8f2;
55
- }
56
-
57
- .namespace {
58
- opacity: .7;
59
- }
60
-
61
- .token.property,
62
- .token.tag {
63
- color: #f92672;
64
- }
65
-
66
- .token.boolean,
67
- .token.number{
68
- color: #ae81ff;
69
- }
70
-
71
- .token.selector,
72
- .token.attr-name,
73
- .token.string {
74
- color: #a6e22e;
75
- }
76
-
77
-
78
- .token.operator,
79
- .token.entity,
80
- .token.url,
81
- .language-css .token.string,
82
- .style .token.string {
83
- color: #f8f8f2;
84
- }
85
-
86
- .token.atrule,
87
- .token.attr-value
88
- {
89
- color: #e6db74;
90
- }
91
-
92
-
93
- .token.keyword{
94
- color: #66d9ef;
95
- }
96
-
97
- .token.regex,
98
- .token.important {
99
- color: #fd971f;
100
- }
101
-
102
- .token.important {
103
- font-weight: bold;
104
- }
105
-
106
- .token.entity {
107
- cursor: help;
108
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/docsupport/prism.js DELETED
@@ -1,9 +0,0 @@
1
- /**
2
- * Prism: Lightweight, robust, elegant syntax highlighting
3
- * MIT license http://www.opensource.org/licenses/mit-license.php/
4
- * @author Lea Verou http://lea.verou.me
5
- */(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code');for(var i=0,s;s=r[i++];)t.highlightElement(s,e===!0,n)},highlightElement:function(r,i,s){var o,u,a=r;while(a&&!e.test(a.className))a=a.parentNode;if(a){o=(a.className.match(e)||[,""])[1];u=t.languages[o]}if(!u)return;r.className=r.className.replace(e,"").replace(/\s+/g," ")+" language-"+o;a=r.parentNode;/pre/i.test(a.nodeName)&&(a.className=a.className.replace(e,"").replace(/\s+/g," ")+" language-"+o);var f=r.textContent;if(!f)return;f=f.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ");var l={element:r,language:o,grammar:u,code:f};t.hooks.run("before-highlight",l);if(i&&self.Worker){var c=new Worker(t.filename);c.onmessage=function(e){l.highlightedCode=n.stringify(JSON.parse(e.data),o);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(l.element);t.hooks.run("after-highlight",l)};c.postMessage(JSON.stringify({language:l.language,code:l.code}))}else{l.highlightedCode=t.highlight(l.code,l.grammar,l.language);t.hooks.run("before-insert",l);l.element.innerHTML=l.highlightedCode;s&&s.call(r);t.hooks.run("after-highlight",l)}},highlight:function(e,r,i){return n.stringify(t.tokenize(e,r),i)},tokenize:function(e,n,r){var i=t.Token,s=[e],o=n.rest;if(o){for(var u in o)n[u]=o[u];delete n.rest}e:for(var u in n){if(!n.hasOwnProperty(u)||!n[u])continue;var a=n[u],f=a.inside,l=!!a.lookbehind,c=0;a=a.pattern||a;for(var h=0;h<s.length;h++){var p=s[h];if(s.length>e.length)break e;if(p instanceof i)continue;a.lastIndex=0;var d=a.exec(p);if(d){l&&(c=d[1].length);var v=d.index-1+c,d=d[0].slice(c),m=d.length,g=v+m,y=p.slice(0,v+1),b=p.slice(g+1),w=[h,1];y&&w.push(y);var E=new i(u,f?t.tokenize(d,f):d);w.push(E);b&&w.push(b);Array.prototype.splice.apply(s,w)}}}return s},hooks:{all:{},add:function(e,n){var r=t.hooks.all;r[e]=r[e]||[];r[e].push(n)},run:function(e,n){var r=t.hooks.all[e];if(!r||!r.length)return;for(var i=0,s;s=r[i++];)s(n)}}},n=t.Token=function(e,t){this.type=e;this.content=t};n.stringify=function(e,r,i){if(typeof e=="string")return e;if(Object.prototype.toString.call(e)=="[object Array]")return e.map(function(t){return n.stringify(t,r,e)}).join("");var s={type:e.type,content:n.stringify(e.content,r,i),tag:"span",classes:["token",e.type],attributes:{},language:r,parent:i};s.type=="comment"&&(s.attributes.spellcheck="true");t.hooks.run("wrap",s);var o="";for(var u in s.attributes)o+=u+'="'+(s.attributes[u]||"")+'"';return"<"+s.tag+' class="'+s.classes.join(" ")+'" '+o+">"+s.content+"</"+s.tag+">"};if(!self.document){self.addEventListener("message",function(e){var n=JSON.parse(e.data),r=n.language,i=n.code;self.postMessage(JSON.stringify(t.tokenize(i,t.languages[r])));self.close()},!1);return}var r=document.getElementsByTagName("script");r=r[r.length-1];if(r){t.filename=r.src;document.addEventListener&&!r.hasAttribute("data-manual")&&document.addEventListener("DOMContentLoaded",t.highlightAll)}})();;
6
- Prism.languages.markup={comment:/&lt;!--[\w\W]*?-->/g,prolog:/&lt;\?.+?\?>/,doctype:/&lt;!DOCTYPE.+?>/,cdata:/&lt;!\[CDATA\[[\w\W]*?]]>/i,tag:{pattern:/&lt;\/?[\w:-]+\s*(?:\s+[\w:-]+(?:=(?:("|')(\\?[\w\W])*?\1|\w+))?\s*)*\/?>/gi,inside:{tag:{pattern:/^&lt;\/?[\w:-]+/i,inside:{punctuation:/^&lt;\/?/,namespace:/^[\w-]+?:/}},"attr-value":{pattern:/=(?:('|")[\w\W]*?(\1)|[^\s>]+)/gi,inside:{punctuation:/=|>|"/g}},punctuation:/\/?>/g,"attr-name":{pattern:/[\w:-]+/g,inside:{namespace:/^[\w-]+?:/}}}},entity:/&amp;#?[\da-z]{1,8};/gi};Prism.hooks.add("wrap",function(e){e.type==="entity"&&(e.attributes.title=e.content.replace(/&amp;/,"&"))});;
7
- Prism.languages.css={comment:/\/\*[\w\W]*?\*\//g,atrule:{pattern:/@[\w-]+?.*?(;|(?=\s*{))/gi,inside:{punctuation:/[;:]/g}},url:/url\((["']?).*?\1\)/gi,selector:/[^\{\}\s][^\{\};]*(?=\s*\{)/g,property:/(\b|\B)[\w-]+(?=\s*:)/ig,string:/("|')(\\?.)*?\1/g,important:/\B!important\b/gi,ignore:/&(lt|gt|amp);/gi,punctuation:/[\{\};:]/g};Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{style:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/style(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)style[\w\W]*?(>|&gt;)|(&lt;|<)\/style(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.css}}});;
8
- Prism.languages.clike={comment:{pattern:/(^|[^\\])(\/\*[\w\W]*?\*\/|(^|[^:])\/\/.*?(\r?\n|$))/g,lookbehind:!0},string:/("|')(\\?.)*?\1/g,"class-name":{pattern:/((?:(?:class|interface|extends|implements|trait|instanceof|new)\s+)|(?:catch\s+\())[a-z0-9_\.\\]+/ig,lookbehind:!0,inside:{punctuation:/(\.|\\)/}},keyword:/\b(if|else|while|do|for|return|in|instanceof|function|new|try|catch|finally|null|break|continue)\b/g,"boolean":/\b(true|false)\b/g,"function":{pattern:/[a-z0-9_]+\(/ig,inside:{punctuation:/\(/}}, number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?)\b/g,operator:/[-+]{1,2}|!|&lt;=?|>=?|={1,3}|(&amp;){1,2}|\|?\||\?|\*|\/|\~|\^|\%/g,ignore:/&(lt|gt|amp);/gi,punctuation:/[{}[\];(),.:]/g};;
9
- Prism.languages.javascript=Prism.languages.extend("clike",{keyword:/\b(var|let|if|else|while|do|for|return|in|instanceof|function|new|with|typeof|try|catch|finally|null|break|continue)\b/g,number:/\b-?(0x[\dA-Fa-f]+|\d*\.?\d+([Ee]-?\d+)?|NaN|-?Infinity)\b/g});Prism.languages.insertBefore("javascript","keyword",{regex:{pattern:/(^|[^/])\/(?!\/)(\[.+?]|\\.|[^/\r\n])+\/[gim]{0,3}(?=\s*($|[\r\n,.;})]))/g,lookbehind:!0}});Prism.languages.markup&&Prism.languages.insertBefore("markup","tag",{script:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)[\w\W]*?(&lt;|<)\/script(>|&gt;)/ig,inside:{tag:{pattern:/(&lt;|<)script[\w\W]*?(>|&gt;)|(&lt;|<)\/script(>|&gt;)/ig,inside:Prism.languages.markup.tag.inside},rest:Prism.languages.javascript}}});;
 
 
 
 
 
 
 
 
 
assets/inc/chosen/docsupport/style.css DELETED
@@ -1,219 +0,0 @@
1
- /* Reset */
2
- html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video { margin: 0; padding: 0; border: 0; font-size: 100%; font: inherit; vertical-align: baseline; }
3
-
4
- article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section { display: block; }
5
-
6
- blockquote, q { quotes: none; }
7
- blockquote:before, blockquote:after, q:before, q:after { content: ""; content: none; }
8
- ins { background-color: #ff9; color: #000; text-decoration: none; }
9
- mark { background-color: #ff9; color: #000; font-style: italic; font-weight: bold; }
10
- del { text-decoration: line-through; }
11
- abbr[title], dfn[title] { border-bottom: 1px dotted; cursor: help; }
12
- table { border-collapse: collapse; border-spacing: 0; }
13
- hr { display: block; height: 1px; border: 0; border-top: 1px solid #ccc; margin: 1em 0; padding: 0; }
14
- input, select { vertical-align: middle; }
15
-
16
- body { font:13px/1.231 sans-serif; *font-size:small; } /* Hack retained to preserve specificity */
17
- select, input, textarea, button { font:99% sans-serif; }
18
- pre, code, kbd, samp { font-family: monospace, sans-serif; }
19
-
20
-
21
- body { background: #EEE; color: #444; line-height: 1.4em; }
22
-
23
- header h1 { color: black; font-size: 2em; line-height: 1.1em; display: inline-block; height: 27px; margin: 20px 0 25px; }
24
- header h1 small { font-size: 0.6em; }
25
-
26
- div#content { background: white; border: 1px solid #ccc; border-width: 0 1px 1px; margin: 0 auto; padding: 40px 50px 40px; width: 738px; }
27
-
28
- footer { color: #999; padding-top: 40px; font-size: 0.8em; text-align: center; }
29
-
30
- body { font-family: sans-serif; font-size: 1em; }
31
-
32
- p { margin: 0 0 .7em; max-width: 700px; }
33
- table+p { margin-top: 1em; }
34
-
35
- h2 { border-bottom: 1px solid #ccc; font-size: 1.2em; margin: 3em 0 1em 0; font-weight: bold;}
36
- h3 { font-weight: bold; }
37
-
38
- h2.intro { border-bottom: none; font-size: 1em; font-weight: normal; margin-top:0; }
39
-
40
- ul li { list-style: disc; margin-left: 1em; margin-bottom: 1.25em; }
41
- ol li { margin-left: 1.25em; }
42
- ol ul, ul ul { margin: .25em 0 0; }
43
- ol ul li, ul ul li { list-style-type: circle; margin: 0 0 .25em 1em; }
44
-
45
- li > p { margin-top: .25em; }
46
-
47
- div.side-by-side { width: 100%; margin-bottom: 1em; }
48
- div.side-by-side > div { float: left; width: 49%; }
49
- div.side-by-side > div > em { margin-bottom: 10px; display: block; }
50
-
51
- .faqs em { display: block; }
52
-
53
- .clearfix:after {
54
- content: "\0020";
55
- display: block;
56
- height: 0;
57
- clear: both;
58
- overflow: hidden;
59
- visibility: hidden;
60
- }
61
-
62
- a { color: #F36C00; outline: none; text-decoration: none; }
63
- a:hover { text-decoration: underline; }
64
-
65
- ul.credits li { margin-bottom: .25em; }
66
-
67
- strong { font-weight: bold; }
68
- i { font-style: italic; }
69
-
70
- .button {
71
- background: #fafafa;
72
- background: -webkit-linear-gradient(top, #ffffff, #eeeeee);
73
- background: -moz-linear-gradient(top, #ffffff, #eeeeee);
74
- background: -o-linear-gradient(top, #ffffff, #eeeeee);
75
- background: linear-gradient(to bottom, #ffffff, #eeeeee);
76
- border: 1px solid #bbbbbb;
77
- border-radius: 4px;
78
- box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.2);
79
- color: #555555;
80
- cursor: pointer;
81
- display: inline-block;
82
- font-family: "Helvetica Neue", Arial, Verdana, "Nimbus Sans L", sans-serif;
83
- font-size: 13px;
84
- font-weight: 500;
85
- height: 31px;
86
- line-height: 28px;
87
- outline: none;
88
- padding: 0 13px;
89
- text-shadow: 0 1px 0 white;
90
- text-decoration: none;
91
- vertical-align: middle;
92
- white-space: nowrap;
93
- -webkit-font-smoothing: antialiased;
94
- -webkit-box-sizing: border-box;
95
- -moz-box-sizing: border-box;
96
- box-sizing: border-box;
97
- }
98
-
99
- .button-blue {
100
- background: #1385e5;
101
- background: -webkit-linear-gradient(top, #53b2fc, #1385e5);
102
- background: -moz-linear-gradient(top, #53b2fc, #1385e5);
103
- background: -o-linear-gradient(top, #53b2fc, #1385e5);
104
- background: linear-gradient(to bottom, #53b2fc, #1385e5);
105
- border-color: #075fa9;
106
- color: white;
107
- font-weight: bold;
108
- text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.4);
109
- }
110
-
111
-
112
- /* Tweak navbar brand link to be super sleek
113
- -------------------------------------------------- */
114
- .oss-bar {
115
- top: 0;
116
- right: 20px;
117
- position: fixed;
118
- z-index: 1030;
119
- }
120
- .oss-bar ul {
121
- float: right;
122
- margin: 0;
123
- list-style: none;
124
- }
125
- .oss-bar ul li {
126
- list-style: none;
127
- float: left;
128
- line-height: 0;
129
- margin: 0;
130
- }
131
- .oss-bar ul li a {
132
- -moz-box-sizing: border-box;
133
- -webkit-box-sizing: border-box;
134
- -ms-box-sizing: border-box;
135
- box-sizing: border-box;
136
- border: 0;
137
- margin-top: -10px;
138
- display: block;
139
- height: 58px;
140
- background: #F36C00 url(oss-credit.png) no-repeat 20px 22px;
141
- padding: 22px 20px 12px 20px;
142
- text-indent: 120%; /* stupid padding */
143
- white-space: nowrap;
144
- overflow: hidden;
145
- -webkit-transition: all 0.10s ease-in-out;
146
- -moz-transition: all 0.10s ease-in-out;
147
- transition: all 0.15s ease-in-out;
148
- }
149
- .oss-bar ul li a:hover {
150
- margin-top: 0px;
151
- }
152
- .oss-bar a.harvest {
153
- width: 196px;
154
- background-color: #F36C00;
155
- background-position: -142px 22px;
156
- padding-right: 22px; /* optical illusion */
157
- }
158
- .oss-bar a.fork {
159
- width: 162px;
160
- background-color: #333333;
161
- }
162
-
163
- .docs-table th, .docs-table td {
164
- border: 1px solid #000;
165
- padding: 4px 6px;
166
- white-space: nowrap;
167
- }
168
-
169
- .docs-table td:last-child {
170
- white-space: normal;
171
- }
172
-
173
- .docs-table th {
174
- font-weight: bold;
175
- text-align: left;
176
- }
177
-
178
- #content pre[class*=language-] {
179
- font-size: 14px;
180
- margin-bottom: 20px;
181
- }
182
-
183
- #content pre[class*=language-] code {
184
- font-size: 14px;
185
- padding: 0;
186
- }
187
-
188
- #content code[class*=language-] {
189
- font-size: 12px;
190
- padding: 2px 4px;
191
- }
192
-
193
- .anchor {
194
- color: inherit;
195
- position: relative;
196
- }
197
-
198
- .anchor:hover {
199
- background: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNiIgaGVpZ2h0PSI3Ij48ZyBmaWxsPSIjNDE0MDQyIj48cGF0aCBkPSJNOS44IDdoLS45bC0uOS0uMWMtLjctLjMtMS40LS43LTEuOC0xLjMtLjItLjEtLjMtLjMtLjMtLjVsLS4zLS40Yy0uMS0uNC0uMi0uOC0uMi0xLjIgMC0uNC4xLS44LjItMS4yaDEuN2MtLjMuNC0uNC44LS40IDEuMiAwIC40LjEuOC4zIDEuMS4xLjIuMi4zLjQuNC4xLjEuMi4yLjQuMy4zLjIuNy4zIDEgLjNoMy40YzEuMiAwIDIuMi0uOSAyLjItMi4xcy0xLTIuMS0yLjItMi4xaC0xLjRjLS4zLS42LS43LTEtMS4yLTEuNGgyLjZjMiAwIDMuNiAxLjYgMy42IDMuNXMtMS42IDMuNS0zLjYgMy41aC0yLjZ6TTguNCAyYy0uMS0uMS0uMi0uMy0uNC0uMy0uMy0uMi0uNy0uMy0xLS4zaC0zLjRjLTEuMiAwLTIuMi45LTIuMiAyLjEgMCAxLjIgMSAyLjEgMi4yIDIuMWgxLjRjLjMuNS43IDEgMS4yIDEuNGgtMi42Yy0yIDAtMy42LTEuNi0zLjYtMy41czEuNi0zLjUgMy42LTMuNWgzLjUwMDAwMDAwMDAwMDAwMDRsLjkuMWMuNy4yIDEuNC43IDEuOCAxLjMuMS4xLjIuMy4zLjUuMS4xLjIuMy4yLjUuMS40LjIuOC4yIDEuMiAwIC40LS4xLjgtLjIgMS4yaC0xLjZjLjMtLjUuNC0uOS40LTEuM3MtLjEtLjgtLjMtMS4xYy0uMS0uMi0uMi0uMy0uNC0uNHoiLz48L2c+PC9zdmc+) 0 50% no-repeat;
200
- background-size: 21px 9px;
201
- margin-left: -27px;
202
- padding-left: 27px;
203
- text-decoration: none;
204
- }
205
-
206
- .select,
207
- .chosen-select,
208
- .chosen-select-no-single,
209
- .chosen-select-no-results,
210
- .chosen-select-deselect,
211
- .chosen-select-rtl,
212
- .chosen-select-width {
213
- width: 350px;
214
- }
215
-
216
- .jquery-version-refer {
217
- margin-top: 40px;
218
- font-style: italic;
219
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/index.html DELETED
@@ -1,1473 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Chosen: A jQuery Plugin by Harvest to Tame Unwieldy Select Boxes</title>
6
- <link rel="stylesheet" href="docsupport/style.css">
7
- <link rel="stylesheet" href="docsupport/prism.css">
8
- <link rel="stylesheet" href="chosen.css">
9
-
10
- <meta http-equiv="Content-Security-Policy" content="default-src &apos;self&apos;; script-src &apos;self&apos; https://ajax.googleapis.com; style-src &apos;self&apos;; img-src &apos;self&apos; data:">
11
-
12
- </head>
13
- <body>
14
- <form>
15
- <div id="container">
16
- <div id="content">
17
- <header>
18
- <h1>Chosen <small>(<span id="latest-version">v1.7.0</span>)</small></h1>
19
- </header>
20
- <p>Chosen is a jQuery plugin that makes long, unwieldy select boxes much more user-friendly.</p>
21
-
22
- <p>
23
- <a class="button button-blue" href="https://github.com/harvesthq/chosen/releases">Downloads</a>
24
- <a class="button" href="https://github.com/harvesthq/chosen">Project Source</a>
25
- <a class="button" href="https://github.com/harvesthq/chosen/blob/master/contributing.md">Contribute</a>
26
- </p>
27
-
28
- <h2><a name="standard-select" class="anchor" href="#standard-select">Standard Select</a></h2>
29
- <div class="side-by-side clearfix">
30
- <div>
31
- <em>Turns This</em>
32
- <select data-placeholder="Choose a Country..." class="select" tabindex="1">
33
- <option value=""></option>
34
- <option value="United States">United States</option>
35
- <option value="United Kingdom">United Kingdom</option>
36
- <option value="Afghanistan">Afghanistan</option>
37
- <option value="Aland Islands">Aland Islands</option>
38
- <option value="Albania">Albania</option>
39
- <option value="Algeria">Algeria</option>
40
- <option value="American Samoa">American Samoa</option>
41
- <option value="Andorra">Andorra</option>
42
- <option value="Angola">Angola</option>
43
- <option value="Anguilla">Anguilla</option>
44
- <option value="Antarctica">Antarctica</option>
45
- <option value="Antigua and Barbuda">Antigua and Barbuda</option>
46
- <option value="Argentina">Argentina</option>
47
- <option value="Armenia">Armenia</option>
48
- <option value="Aruba">Aruba</option>
49
- <option value="Australia">Australia</option>
50
- <option value="Austria">Austria</option>
51
- <option value="Azerbaijan">Azerbaijan</option>
52
- <option value="Bahamas">Bahamas</option>
53
- <option value="Bahrain">Bahrain</option>
54
- <option value="Bangladesh">Bangladesh</option>
55
- <option value="Barbados">Barbados</option>
56
- <option value="Belarus">Belarus</option>
57
- <option value="Belgium">Belgium</option>
58
- <option value="Belize">Belize</option>
59
- <option value="Benin">Benin</option>
60
- <option value="Bermuda">Bermuda</option>
61
- <option value="Bhutan">Bhutan</option>
62
- <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
63
- <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
64
- <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
65
- <option value="Botswana">Botswana</option>
66
- <option value="Bouvet Island">Bouvet Island</option>
67
- <option value="Brazil">Brazil</option>
68
- <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
69
- <option value="Brunei Darussalam">Brunei Darussalam</option>
70
- <option value="Bulgaria">Bulgaria</option>
71
- <option value="Burkina Faso">Burkina Faso</option>
72
- <option value="Burundi">Burundi</option>
73
- <option value="Cambodia">Cambodia</option>
74
- <option value="Cameroon">Cameroon</option>
75
- <option value="Canada">Canada</option>
76
- <option value="Cape Verde">Cape Verde</option>
77
- <option value="Cayman Islands">Cayman Islands</option>
78
- <option value="Central African Republic">Central African Republic</option>
79
- <option value="Chad">Chad</option>
80
- <option value="Chile">Chile</option>
81
- <option value="China">China</option>
82
- <option value="Christmas Island">Christmas Island</option>
83
- <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
84
- <option value="Colombia">Colombia</option>
85
- <option value="Comoros">Comoros</option>
86
- <option value="Congo">Congo</option>
87
- <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
88
- <option value="Cook Islands">Cook Islands</option>
89
- <option value="Costa Rica">Costa Rica</option>
90
- <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
91
- <option value="Croatia">Croatia</option>
92
- <option value="Cuba">Cuba</option>
93
- <option value="Curacao">Curacao</option>
94
- <option value="Cyprus">Cyprus</option>
95
- <option value="Czech Republic">Czech Republic</option>
96
- <option value="Denmark">Denmark</option>
97
- <option value="Djibouti">Djibouti</option>
98
- <option value="Dominica">Dominica</option>
99
- <option value="Dominican Republic">Dominican Republic</option>
100
- <option value="Ecuador">Ecuador</option>
101
- <option value="Egypt">Egypt</option>
102
- <option value="El Salvador">El Salvador</option>
103
- <option value="Equatorial Guinea">Equatorial Guinea</option>
104
- <option value="Eritrea">Eritrea</option>
105
- <option value="Estonia">Estonia</option>
106
- <option value="Ethiopia">Ethiopia</option>
107
- <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
108
- <option value="Faroe Islands">Faroe Islands</option>
109
- <option value="Fiji">Fiji</option>
110
- <option value="Finland">Finland</option>
111
- <option value="France">France</option>
112
- <option value="French Guiana">French Guiana</option>
113
- <option value="French Polynesia">French Polynesia</option>
114
- <option value="French Southern Territories">French Southern Territories</option>
115
- <option value="Gabon">Gabon</option>
116
- <option value="Gambia">Gambia</option>
117
- <option value="Georgia">Georgia</option>
118
- <option value="Germany">Germany</option>
119
- <option value="Ghana">Ghana</option>
120
- <option value="Gibraltar">Gibraltar</option>
121
- <option value="Greece">Greece</option>
122
- <option value="Greenland">Greenland</option>
123
- <option value="Grenada">Grenada</option>
124
- <option value="Guadeloupe">Guadeloupe</option>
125
- <option value="Guam">Guam</option>
126
- <option value="Guatemala">Guatemala</option>
127
- <option value="Guernsey">Guernsey</option>
128
- <option value="Guinea">Guinea</option>
129
- <option value="Guinea-bissau">Guinea-bissau</option>
130
- <option value="Guyana">Guyana</option>
131
- <option value="Haiti">Haiti</option>
132
- <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
133
- <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
134
- <option value="Honduras">Honduras</option>
135
- <option value="Hong Kong">Hong Kong</option>
136
- <option value="Hungary">Hungary</option>
137
- <option value="Iceland">Iceland</option>
138
- <option value="India">India</option>
139
- <option value="Indonesia">Indonesia</option>
140
- <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
141
- <option value="Iraq">Iraq</option>
142
- <option value="Ireland">Ireland</option>
143
- <option value="Isle of Man">Isle of Man</option>
144
- <option value="Israel">Israel</option>
145
- <option value="Italy">Italy</option>
146
- <option value="Jamaica">Jamaica</option>
147
- <option value="Japan">Japan</option>
148
- <option value="Jersey">Jersey</option>
149
- <option value="Jordan">Jordan</option>
150
- <option value="Kazakhstan">Kazakhstan</option>
151
- <option value="Kenya">Kenya</option>
152
- <option value="Kiribati">Kiribati</option>
153
- <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
154
- <option value="Korea, Republic of">Korea, Republic of</option>
155
- <option value="Kuwait">Kuwait</option>
156
- <option value="Kyrgyzstan">Kyrgyzstan</option>
157
- <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
158
- <option value="Latvia">Latvia</option>
159
- <option value="Lebanon">Lebanon</option>
160
- <option value="Lesotho">Lesotho</option>
161
- <option value="Liberia">Liberia</option>
162
- <option value="Libya">Libya</option>
163
- <option value="Liechtenstein">Liechtenstein</option>
164
- <option value="Lithuania">Lithuania</option>
165
- <option value="Luxembourg">Luxembourg</option>
166
- <option value="Macao">Macao</option>
167
- <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
168
- <option value="Madagascar">Madagascar</option>
169
- <option value="Malawi">Malawi</option>
170
- <option value="Malaysia">Malaysia</option>
171
- <option value="Maldives">Maldives</option>
172
- <option value="Mali">Mali</option>
173
- <option value="Malta">Malta</option>
174
- <option value="Marshall Islands">Marshall Islands</option>
175
- <option value="Martinique">Martinique</option>
176
- <option value="Mauritania">Mauritania</option>
177
- <option value="Mauritius">Mauritius</option>
178
- <option value="Mayotte">Mayotte</option>
179
- <option value="Mexico">Mexico</option>
180
- <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
181
- <option value="Moldova, Republic of">Moldova, Republic of</option>
182
- <option value="Monaco">Monaco</option>
183
- <option value="Mongolia">Mongolia</option>
184
- <option value="Montenegro">Montenegro</option>
185
- <option value="Montserrat">Montserrat</option>
186
- <option value="Morocco">Morocco</option>
187
- <option value="Mozambique">Mozambique</option>
188
- <option value="Myanmar">Myanmar</option>
189
- <option value="Namibia">Namibia</option>
190
- <option value="Nauru">Nauru</option>
191
- <option value="Nepal">Nepal</option>
192
- <option value="Netherlands">Netherlands</option>
193
- <option value="New Caledonia">New Caledonia</option>
194
- <option value="New Zealand">New Zealand</option>
195
- <option value="Nicaragua">Nicaragua</option>
196
- <option value="Niger">Niger</option>
197
- <option value="Nigeria">Nigeria</option>
198
- <option value="Niue">Niue</option>
199
- <option value="Norfolk Island">Norfolk Island</option>
200
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
201
- <option value="Norway">Norway</option>
202
- <option value="Oman">Oman</option>
203
- <option value="Pakistan">Pakistan</option>
204
- <option value="Palau">Palau</option>
205
- <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
206
- <option value="Panama">Panama</option>
207
- <option value="Papua New Guinea">Papua New Guinea</option>
208
- <option value="Paraguay">Paraguay</option>
209
- <option value="Peru">Peru</option>
210
- <option value="Philippines">Philippines</option>
211
- <option value="Pitcairn">Pitcairn</option>
212
- <option value="Poland">Poland</option>
213
- <option value="Portugal">Portugal</option>
214
- <option value="Puerto Rico">Puerto Rico</option>
215
- <option value="Qatar">Qatar</option>
216
- <option value="Reunion">Reunion</option>
217
- <option value="Romania">Romania</option>
218
- <option value="Russian Federation">Russian Federation</option>
219
- <option value="Rwanda">Rwanda</option>
220
- <option value="Saint Barthelemy">Saint Barthelemy</option>
221
- <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
222
- <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
223
- <option value="Saint Lucia">Saint Lucia</option>
224
- <option value="Saint Martin (French part)">Saint Martin (French part)</option>
225
- <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
226
- <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
227
- <option value="Samoa">Samoa</option>
228
- <option value="San Marino">San Marino</option>
229
- <option value="Sao Tome and Principe">Sao Tome and Principe</option>
230
- <option value="Saudi Arabia">Saudi Arabia</option>
231
- <option value="Senegal">Senegal</option>
232
- <option value="Serbia">Serbia</option>
233
- <option value="Seychelles">Seychelles</option>
234
- <option value="Sierra Leone">Sierra Leone</option>
235
- <option value="Singapore">Singapore</option>
236
- <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
237
- <option value="Slovakia">Slovakia</option>
238
- <option value="Slovenia">Slovenia</option>
239
- <option value="Solomon Islands">Solomon Islands</option>
240
- <option value="Somalia">Somalia</option>
241
- <option value="South Africa">South Africa</option>
242
- <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
243
- <option value="South Sudan">South Sudan</option>
244
- <option value="Spain">Spain</option>
245
- <option value="Sri Lanka">Sri Lanka</option>
246
- <option value="Sudan">Sudan</option>
247
- <option value="Suriname">Suriname</option>
248
- <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
249
- <option value="Swaziland">Swaziland</option>
250
- <option value="Sweden">Sweden</option>
251
- <option value="Switzerland">Switzerland</option>
252
- <option value="Syrian Arab Republic">Syrian Arab Republic</option>
253
- <option value="Taiwan, Province of China">Taiwan, Province of China</option>
254
- <option value="Tajikistan">Tajikistan</option>
255
- <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
256
- <option value="Thailand">Thailand</option>
257
- <option value="Timor-leste">Timor-leste</option>
258
- <option value="Togo">Togo</option>
259
- <option value="Tokelau">Tokelau</option>
260
- <option value="Tonga">Tonga</option>
261
- <option value="Trinidad and Tobago">Trinidad and Tobago</option>
262
- <option value="Tunisia">Tunisia</option>
263
- <option value="Turkey">Turkey</option>
264
- <option value="Turkmenistan">Turkmenistan</option>
265
- <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
266
- <option value="Tuvalu">Tuvalu</option>
267
- <option value="Uganda">Uganda</option>
268
- <option value="Ukraine">Ukraine</option>
269
- <option value="United Arab Emirates">United Arab Emirates</option>
270
- <option value="United Kingdom">United Kingdom</option>
271
- <option value="United States">United States</option>
272
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
273
- <option value="Uruguay">Uruguay</option>
274
- <option value="Uzbekistan">Uzbekistan</option>
275
- <option value="Vanuatu">Vanuatu</option>
276
- <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
277
- <option value="Viet Nam">Viet Nam</option>
278
- <option value="Virgin Islands, British">Virgin Islands, British</option>
279
- <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
280
- <option value="Wallis and Futuna">Wallis and Futuna</option>
281
- <option value="Western Sahara">Western Sahara</option>
282
- <option value="Yemen">Yemen</option>
283
- <option value="Zambia">Zambia</option>
284
- <option value="Zimbabwe">Zimbabwe</option>
285
- </select>
286
- </div>
287
- <div>
288
- <em>Into This</em>
289
- <select data-placeholder="Choose a Country..." class="chosen-select" tabindex="2">
290
- <option value=""></option>
291
- <option value="United States">United States</option>
292
- <option value="United Kingdom">United Kingdom</option>
293
- <option value="Afghanistan">Afghanistan</option>
294
- <option value="Aland Islands">Aland Islands</option>
295
- <option value="Albania">Albania</option>
296
- <option value="Algeria">Algeria</option>
297
- <option value="American Samoa">American Samoa</option>
298
- <option value="Andorra">Andorra</option>
299
- <option value="Angola">Angola</option>
300
- <option value="Anguilla">Anguilla</option>
301
- <option value="Antarctica">Antarctica</option>
302
- <option value="Antigua and Barbuda">Antigua and Barbuda</option>
303
- <option value="Argentina">Argentina</option>
304
- <option value="Armenia">Armenia</option>
305
- <option value="Aruba">Aruba</option>
306
- <option value="Australia">Australia</option>
307
- <option value="Austria">Austria</option>
308
- <option value="Azerbaijan">Azerbaijan</option>
309
- <option value="Bahamas">Bahamas</option>
310
- <option value="Bahrain">Bahrain</option>
311
- <option value="Bangladesh">Bangladesh</option>
312
- <option value="Barbados">Barbados</option>
313
- <option value="Belarus">Belarus</option>
314
- <option value="Belgium">Belgium</option>
315
- <option value="Belize">Belize</option>
316
- <option value="Benin">Benin</option>
317
- <option value="Bermuda">Bermuda</option>
318
- <option value="Bhutan">Bhutan</option>
319
- <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
320
- <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
321
- <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
322
- <option value="Botswana">Botswana</option>
323
- <option value="Bouvet Island">Bouvet Island</option>
324
- <option value="Brazil">Brazil</option>
325
- <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
326
- <option value="Brunei Darussalam">Brunei Darussalam</option>
327
- <option value="Bulgaria">Bulgaria</option>
328
- <option value="Burkina Faso">Burkina Faso</option>
329
- <option value="Burundi">Burundi</option>
330
- <option value="Cambodia">Cambodia</option>
331
- <option value="Cameroon">Cameroon</option>
332
- <option value="Canada">Canada</option>
333
- <option value="Cape Verde">Cape Verde</option>
334
- <option value="Cayman Islands">Cayman Islands</option>
335
- <option value="Central African Republic">Central African Republic</option>
336
- <option value="Chad">Chad</option>
337
- <option value="Chile">Chile</option>
338
- <option value="China">China</option>
339
- <option value="Christmas Island">Christmas Island</option>
340
- <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
341
- <option value="Colombia">Colombia</option>
342
- <option value="Comoros">Comoros</option>
343
- <option value="Congo">Congo</option>
344
- <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
345
- <option value="Cook Islands">Cook Islands</option>
346
- <option value="Costa Rica">Costa Rica</option>
347
- <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
348
- <option value="Croatia">Croatia</option>
349
- <option value="Cuba">Cuba</option>
350
- <option value="Curacao">Curacao</option>
351
- <option value="Cyprus">Cyprus</option>
352
- <option value="Czech Republic">Czech Republic</option>
353
- <option value="Denmark">Denmark</option>
354
- <option value="Djibouti">Djibouti</option>
355
- <option value="Dominica">Dominica</option>
356
- <option value="Dominican Republic">Dominican Republic</option>
357
- <option value="Ecuador">Ecuador</option>
358
- <option value="Egypt">Egypt</option>
359
- <option value="El Salvador">El Salvador</option>
360
- <option value="Equatorial Guinea">Equatorial Guinea</option>
361
- <option value="Eritrea">Eritrea</option>
362
- <option value="Estonia">Estonia</option>
363
- <option value="Ethiopia">Ethiopia</option>
364
- <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
365
- <option value="Faroe Islands">Faroe Islands</option>
366
- <option value="Fiji">Fiji</option>
367
- <option value="Finland">Finland</option>
368
- <option value="France">France</option>
369
- <option value="French Guiana">French Guiana</option>
370
- <option value="French Polynesia">French Polynesia</option>
371
- <option value="French Southern Territories">French Southern Territories</option>
372
- <option value="Gabon">Gabon</option>
373
- <option value="Gambia">Gambia</option>
374
- <option value="Georgia">Georgia</option>
375
- <option value="Germany">Germany</option>
376
- <option value="Ghana">Ghana</option>
377
- <option value="Gibraltar">Gibraltar</option>
378
- <option value="Greece">Greece</option>
379
- <option value="Greenland">Greenland</option>
380
- <option value="Grenada">Grenada</option>
381
- <option value="Guadeloupe">Guadeloupe</option>
382
- <option value="Guam">Guam</option>
383
- <option value="Guatemala">Guatemala</option>
384
- <option value="Guernsey">Guernsey</option>
385
- <option value="Guinea">Guinea</option>
386
- <option value="Guinea-bissau">Guinea-bissau</option>
387
- <option value="Guyana">Guyana</option>
388
- <option value="Haiti">Haiti</option>
389
- <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
390
- <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
391
- <option value="Honduras">Honduras</option>
392
- <option value="Hong Kong">Hong Kong</option>
393
- <option value="Hungary">Hungary</option>
394
- <option value="Iceland">Iceland</option>
395
- <option value="India">India</option>
396
- <option value="Indonesia">Indonesia</option>
397
- <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
398
- <option value="Iraq">Iraq</option>
399
- <option value="Ireland">Ireland</option>
400
- <option value="Isle of Man">Isle of Man</option>
401
- <option value="Israel">Israel</option>
402
- <option value="Italy">Italy</option>
403
- <option value="Jamaica">Jamaica</option>
404
- <option value="Japan">Japan</option>
405
- <option value="Jersey">Jersey</option>
406
- <option value="Jordan">Jordan</option>
407
- <option value="Kazakhstan">Kazakhstan</option>
408
- <option value="Kenya">Kenya</option>
409
- <option value="Kiribati">Kiribati</option>
410
- <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
411
- <option value="Korea, Republic of">Korea, Republic of</option>
412
- <option value="Kuwait">Kuwait</option>
413
- <option value="Kyrgyzstan">Kyrgyzstan</option>
414
- <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
415
- <option value="Latvia">Latvia</option>
416
- <option value="Lebanon">Lebanon</option>
417
- <option value="Lesotho">Lesotho</option>
418
- <option value="Liberia">Liberia</option>
419
- <option value="Libya">Libya</option>
420
- <option value="Liechtenstein">Liechtenstein</option>
421
- <option value="Lithuania">Lithuania</option>
422
- <option value="Luxembourg">Luxembourg</option>
423
- <option value="Macao">Macao</option>
424
- <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
425
- <option value="Madagascar">Madagascar</option>
426
- <option value="Malawi">Malawi</option>
427
- <option value="Malaysia">Malaysia</option>
428
- <option value="Maldives">Maldives</option>
429
- <option value="Mali">Mali</option>
430
- <option value="Malta">Malta</option>
431
- <option value="Marshall Islands">Marshall Islands</option>
432
- <option value="Martinique">Martinique</option>
433
- <option value="Mauritania">Mauritania</option>
434
- <option value="Mauritius">Mauritius</option>
435
- <option value="Mayotte">Mayotte</option>
436
- <option value="Mexico">Mexico</option>
437
- <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
438
- <option value="Moldova, Republic of">Moldova, Republic of</option>
439
- <option value="Monaco">Monaco</option>
440
- <option value="Mongolia">Mongolia</option>
441
- <option value="Montenegro">Montenegro</option>
442
- <option value="Montserrat">Montserrat</option>
443
- <option value="Morocco">Morocco</option>
444
- <option value="Mozambique">Mozambique</option>
445
- <option value="Myanmar">Myanmar</option>
446
- <option value="Namibia">Namibia</option>
447
- <option value="Nauru">Nauru</option>
448
- <option value="Nepal">Nepal</option>
449
- <option value="Netherlands">Netherlands</option>
450
- <option value="New Caledonia">New Caledonia</option>
451
- <option value="New Zealand">New Zealand</option>
452
- <option value="Nicaragua">Nicaragua</option>
453
- <option value="Niger">Niger</option>
454
- <option value="Nigeria">Nigeria</option>
455
- <option value="Niue">Niue</option>
456
- <option value="Norfolk Island">Norfolk Island</option>
457
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
458
- <option value="Norway">Norway</option>
459
- <option value="Oman">Oman</option>
460
- <option value="Pakistan">Pakistan</option>
461
- <option value="Palau">Palau</option>
462
- <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
463
- <option value="Panama">Panama</option>
464
- <option value="Papua New Guinea">Papua New Guinea</option>
465
- <option value="Paraguay">Paraguay</option>
466
- <option value="Peru">Peru</option>
467
- <option value="Philippines">Philippines</option>
468
- <option value="Pitcairn">Pitcairn</option>
469
- <option value="Poland">Poland</option>
470
- <option value="Portugal">Portugal</option>
471
- <option value="Puerto Rico">Puerto Rico</option>
472
- <option value="Qatar">Qatar</option>
473
- <option value="Reunion">Reunion</option>
474
- <option value="Romania">Romania</option>
475
- <option value="Russian Federation">Russian Federation</option>
476
- <option value="Rwanda">Rwanda</option>
477
- <option value="Saint Barthelemy">Saint Barthelemy</option>
478
- <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
479
- <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
480
- <option value="Saint Lucia">Saint Lucia</option>
481
- <option value="Saint Martin (French part)">Saint Martin (French part)</option>
482
- <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
483
- <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
484
- <option value="Samoa">Samoa</option>
485
- <option value="San Marino">San Marino</option>
486
- <option value="Sao Tome and Principe">Sao Tome and Principe</option>
487
- <option value="Saudi Arabia">Saudi Arabia</option>
488
- <option value="Senegal">Senegal</option>
489
- <option value="Serbia">Serbia</option>
490
- <option value="Seychelles">Seychelles</option>
491
- <option value="Sierra Leone">Sierra Leone</option>
492
- <option value="Singapore">Singapore</option>
493
- <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
494
- <option value="Slovakia">Slovakia</option>
495
- <option value="Slovenia">Slovenia</option>
496
- <option value="Solomon Islands">Solomon Islands</option>
497
- <option value="Somalia">Somalia</option>
498
- <option value="South Africa">South Africa</option>
499
- <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
500
- <option value="South Sudan">South Sudan</option>
501
- <option value="Spain">Spain</option>
502
- <option value="Sri Lanka">Sri Lanka</option>
503
- <option value="Sudan">Sudan</option>
504
- <option value="Suriname">Suriname</option>
505
- <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
506
- <option value="Swaziland">Swaziland</option>
507
- <option value="Sweden">Sweden</option>
508
- <option value="Switzerland">Switzerland</option>
509
- <option value="Syrian Arab Republic">Syrian Arab Republic</option>
510
- <option value="Taiwan, Province of China">Taiwan, Province of China</option>
511
- <option value="Tajikistan">Tajikistan</option>
512
- <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
513
- <option value="Thailand">Thailand</option>
514
- <option value="Timor-leste">Timor-leste</option>
515
- <option value="Togo">Togo</option>
516
- <option value="Tokelau">Tokelau</option>
517
- <option value="Tonga">Tonga</option>
518
- <option value="Trinidad and Tobago">Trinidad and Tobago</option>
519
- <option value="Tunisia">Tunisia</option>
520
- <option value="Turkey">Turkey</option>
521
- <option value="Turkmenistan">Turkmenistan</option>
522
- <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
523
- <option value="Tuvalu">Tuvalu</option>
524
- <option value="Uganda">Uganda</option>
525
- <option value="Ukraine">Ukraine</option>
526
- <option value="United Arab Emirates">United Arab Emirates</option>
527
- <option value="United Kingdom">United Kingdom</option>
528
- <option value="United States">United States</option>
529
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
530
- <option value="Uruguay">Uruguay</option>
531
- <option value="Uzbekistan">Uzbekistan</option>
532
- <option value="Vanuatu">Vanuatu</option>
533
- <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
534
- <option value="Viet Nam">Viet Nam</option>
535
- <option value="Virgin Islands, British">Virgin Islands, British</option>
536
- <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
537
- <option value="Wallis and Futuna">Wallis and Futuna</option>
538
- <option value="Western Sahara">Western Sahara</option>
539
- <option value="Yemen">Yemen</option>
540
- <option value="Zambia">Zambia</option>
541
- <option value="Zimbabwe">Zimbabwe</option>
542
- </select>
543
- </div>
544
- </div>
545
-
546
- <h2><a name="multiple-select" class="anchor" href="#multiple-select">Multiple Select</a></h2>
547
- <div class="side-by-side clearfix">
548
- <div>
549
- <em>Turns This</em>
550
- <select data-placeholder="Choose a Country..." class="select" multiple tabindex="3">
551
- <option value=""></option>
552
- <option value="United States">United States</option>
553
- <option value="United Kingdom">United Kingdom</option>
554
- <option value="Afghanistan">Afghanistan</option>
555
- <option value="Aland Islands">Aland Islands</option>
556
- <option value="Albania">Albania</option>
557
- <option value="Algeria">Algeria</option>
558
- <option value="American Samoa">American Samoa</option>
559
- <option value="Andorra">Andorra</option>
560
- <option value="Angola">Angola</option>
561
- <option value="Anguilla">Anguilla</option>
562
- <option value="Antarctica">Antarctica</option>
563
- <option value="Antigua and Barbuda">Antigua and Barbuda</option>
564
- <option value="Argentina">Argentina</option>
565
- <option value="Armenia">Armenia</option>
566
- <option value="Aruba">Aruba</option>
567
- <option value="Australia">Australia</option>
568
- <option value="Austria">Austria</option>
569
- <option value="Azerbaijan">Azerbaijan</option>
570
- <option value="Bahamas">Bahamas</option>
571
- <option value="Bahrain">Bahrain</option>
572
- <option value="Bangladesh">Bangladesh</option>
573
- <option value="Barbados">Barbados</option>
574
- <option value="Belarus">Belarus</option>
575
- <option value="Belgium">Belgium</option>
576
- <option value="Belize">Belize</option>
577
- <option value="Benin">Benin</option>
578
- <option value="Bermuda">Bermuda</option>
579
- <option value="Bhutan">Bhutan</option>
580
- <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
581
- <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
582
- <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
583
- <option value="Botswana">Botswana</option>
584
- <option value="Bouvet Island">Bouvet Island</option>
585
- <option value="Brazil">Brazil</option>
586
- <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
587
- <option value="Brunei Darussalam">Brunei Darussalam</option>
588
- <option value="Bulgaria">Bulgaria</option>
589
- <option value="Burkina Faso">Burkina Faso</option>
590
- <option value="Burundi">Burundi</option>
591
- <option value="Cambodia">Cambodia</option>
592
- <option value="Cameroon">Cameroon</option>
593
- <option value="Canada">Canada</option>
594
- <option value="Cape Verde">Cape Verde</option>
595
- <option value="Cayman Islands">Cayman Islands</option>
596
- <option value="Central African Republic">Central African Republic</option>
597
- <option value="Chad">Chad</option>
598
- <option value="Chile">Chile</option>
599
- <option value="China">China</option>
600
- <option value="Christmas Island">Christmas Island</option>
601
- <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
602
- <option value="Colombia">Colombia</option>
603
- <option value="Comoros">Comoros</option>
604
- <option value="Congo">Congo</option>
605
- <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
606
- <option value="Cook Islands">Cook Islands</option>
607
- <option value="Costa Rica">Costa Rica</option>
608
- <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
609
- <option value="Croatia">Croatia</option>
610
- <option value="Cuba">Cuba</option>
611
- <option value="Curacao">Curacao</option>
612
- <option value="Cyprus">Cyprus</option>
613
- <option value="Czech Republic">Czech Republic</option>
614
- <option value="Denmark">Denmark</option>
615
- <option value="Djibouti">Djibouti</option>
616
- <option value="Dominica">Dominica</option>
617
- <option value="Dominican Republic">Dominican Republic</option>
618
- <option value="Ecuador">Ecuador</option>
619
- <option value="Egypt">Egypt</option>
620
- <option value="El Salvador">El Salvador</option>
621
- <option value="Equatorial Guinea">Equatorial Guinea</option>
622
- <option value="Eritrea">Eritrea</option>
623
- <option value="Estonia">Estonia</option>
624
- <option value="Ethiopia">Ethiopia</option>
625
- <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
626
- <option value="Faroe Islands">Faroe Islands</option>
627
- <option value="Fiji">Fiji</option>
628
- <option value="Finland">Finland</option>
629
- <option value="France">France</option>
630
- <option value="French Guiana">French Guiana</option>
631
- <option value="French Polynesia">French Polynesia</option>
632
- <option value="French Southern Territories">French Southern Territories</option>
633
- <option value="Gabon">Gabon</option>
634
- <option value="Gambia">Gambia</option>
635
- <option value="Georgia">Georgia</option>
636
- <option value="Germany">Germany</option>
637
- <option value="Ghana">Ghana</option>
638
- <option value="Gibraltar">Gibraltar</option>
639
- <option value="Greece">Greece</option>
640
- <option value="Greenland">Greenland</option>
641
- <option value="Grenada">Grenada</option>
642
- <option value="Guadeloupe">Guadeloupe</option>
643
- <option value="Guam">Guam</option>
644
- <option value="Guatemala">Guatemala</option>
645
- <option value="Guernsey">Guernsey</option>
646
- <option value="Guinea">Guinea</option>
647
- <option value="Guinea-bissau">Guinea-bissau</option>
648
- <option value="Guyana">Guyana</option>
649
- <option value="Haiti">Haiti</option>
650
- <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
651
- <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
652
- <option value="Honduras">Honduras</option>
653
- <option value="Hong Kong">Hong Kong</option>
654
- <option value="Hungary">Hungary</option>
655
- <option value="Iceland">Iceland</option>
656
- <option value="India">India</option>
657
- <option value="Indonesia">Indonesia</option>
658
- <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
659
- <option value="Iraq">Iraq</option>
660
- <option value="Ireland">Ireland</option>
661
- <option value="Isle of Man">Isle of Man</option>
662
- <option value="Israel">Israel</option>
663
- <option value="Italy">Italy</option>
664
- <option value="Jamaica">Jamaica</option>
665
- <option value="Japan">Japan</option>
666
- <option value="Jersey">Jersey</option>
667
- <option value="Jordan">Jordan</option>
668
- <option value="Kazakhstan">Kazakhstan</option>
669
- <option value="Kenya">Kenya</option>
670
- <option value="Kiribati">Kiribati</option>
671
- <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
672
- <option value="Korea, Republic of">Korea, Republic of</option>
673
- <option value="Kuwait">Kuwait</option>
674
- <option value="Kyrgyzstan">Kyrgyzstan</option>
675
- <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
676
- <option value="Latvia">Latvia</option>
677
- <option value="Lebanon">Lebanon</option>
678
- <option value="Lesotho">Lesotho</option>
679
- <option value="Liberia">Liberia</option>
680
- <option value="Libya">Libya</option>
681
- <option value="Liechtenstein">Liechtenstein</option>
682
- <option value="Lithuania">Lithuania</option>
683
- <option value="Luxembourg">Luxembourg</option>
684
- <option value="Macao">Macao</option>
685
- <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
686
- <option value="Madagascar">Madagascar</option>
687
- <option value="Malawi">Malawi</option>
688
- <option value="Malaysia">Malaysia</option>
689
- <option value="Maldives">Maldives</option>
690
- <option value="Mali">Mali</option>
691
- <option value="Malta">Malta</option>
692
- <option value="Marshall Islands">Marshall Islands</option>
693
- <option value="Martinique">Martinique</option>
694
- <option value="Mauritania">Mauritania</option>
695
- <option value="Mauritius">Mauritius</option>
696
- <option value="Mayotte">Mayotte</option>
697
- <option value="Mexico">Mexico</option>
698
- <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
699
- <option value="Moldova, Republic of">Moldova, Republic of</option>
700
- <option value="Monaco">Monaco</option>
701
- <option value="Mongolia">Mongolia</option>
702
- <option value="Montenegro">Montenegro</option>
703
- <option value="Montserrat">Montserrat</option>
704
- <option value="Morocco">Morocco</option>
705
- <option value="Mozambique">Mozambique</option>
706
- <option value="Myanmar">Myanmar</option>
707
- <option value="Namibia">Namibia</option>
708
- <option value="Nauru">Nauru</option>
709
- <option value="Nepal">Nepal</option>
710
- <option value="Netherlands">Netherlands</option>
711
- <option value="New Caledonia">New Caledonia</option>
712
- <option value="New Zealand">New Zealand</option>
713
- <option value="Nicaragua">Nicaragua</option>
714
- <option value="Niger">Niger</option>
715
- <option value="Nigeria">Nigeria</option>
716
- <option value="Niue">Niue</option>
717
- <option value="Norfolk Island">Norfolk Island</option>
718
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
719
- <option value="Norway">Norway</option>
720
- <option value="Oman">Oman</option>
721
- <option value="Pakistan">Pakistan</option>
722
- <option value="Palau">Palau</option>
723
- <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
724
- <option value="Panama">Panama</option>
725
- <option value="Papua New Guinea">Papua New Guinea</option>
726
- <option value="Paraguay">Paraguay</option>
727
- <option value="Peru">Peru</option>
728
- <option value="Philippines">Philippines</option>
729
- <option value="Pitcairn">Pitcairn</option>
730
- <option value="Poland">Poland</option>
731
- <option value="Portugal">Portugal</option>
732
- <option value="Puerto Rico">Puerto Rico</option>
733
- <option value="Qatar">Qatar</option>
734
- <option value="Reunion">Reunion</option>
735
- <option value="Romania">Romania</option>
736
- <option value="Russian Federation">Russian Federation</option>
737
- <option value="Rwanda">Rwanda</option>
738
- <option value="Saint Barthelemy">Saint Barthelemy</option>
739
- <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
740
- <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
741
- <option value="Saint Lucia">Saint Lucia</option>
742
- <option value="Saint Martin (French part)">Saint Martin (French part)</option>
743
- <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
744
- <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
745
- <option value="Samoa">Samoa</option>
746
- <option value="San Marino">San Marino</option>
747
- <option value="Sao Tome and Principe">Sao Tome and Principe</option>
748
- <option value="Saudi Arabia">Saudi Arabia</option>
749
- <option value="Senegal">Senegal</option>
750
- <option value="Serbia">Serbia</option>
751
- <option value="Seychelles">Seychelles</option>
752
- <option value="Sierra Leone">Sierra Leone</option>
753
- <option value="Singapore">Singapore</option>
754
- <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
755
- <option value="Slovakia">Slovakia</option>
756
- <option value="Slovenia">Slovenia</option>
757
- <option value="Solomon Islands">Solomon Islands</option>
758
- <option value="Somalia">Somalia</option>
759
- <option value="South Africa">South Africa</option>
760
- <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
761
- <option value="South Sudan">South Sudan</option>
762
- <option value="Spain">Spain</option>
763
- <option value="Sri Lanka">Sri Lanka</option>
764
- <option value="Sudan">Sudan</option>
765
- <option value="Suriname">Suriname</option>
766
- <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
767
- <option value="Swaziland">Swaziland</option>
768
- <option value="Sweden">Sweden</option>
769
- <option value="Switzerland">Switzerland</option>
770
- <option value="Syrian Arab Republic">Syrian Arab Republic</option>
771
- <option value="Taiwan, Province of China">Taiwan, Province of China</option>
772
- <option value="Tajikistan">Tajikistan</option>
773
- <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
774
- <option value="Thailand">Thailand</option>
775
- <option value="Timor-leste">Timor-leste</option>
776
- <option value="Togo">Togo</option>
777
- <option value="Tokelau">Tokelau</option>
778
- <option value="Tonga">Tonga</option>
779
- <option value="Trinidad and Tobago">Trinidad and Tobago</option>
780
- <option value="Tunisia">Tunisia</option>
781
- <option value="Turkey">Turkey</option>
782
- <option value="Turkmenistan">Turkmenistan</option>
783
- <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
784
- <option value="Tuvalu">Tuvalu</option>
785
- <option value="Uganda">Uganda</option>
786
- <option value="Ukraine">Ukraine</option>
787
- <option value="United Arab Emirates">United Arab Emirates</option>
788
- <option value="United Kingdom">United Kingdom</option>
789
- <option value="United States">United States</option>
790
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
791
- <option value="Uruguay">Uruguay</option>
792
- <option value="Uzbekistan">Uzbekistan</option>
793
- <option value="Vanuatu">Vanuatu</option>
794
- <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
795
- <option value="Viet Nam">Viet Nam</option>
796
- <option value="Virgin Islands, British">Virgin Islands, British</option>
797
- <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
798
- <option value="Wallis and Futuna">Wallis and Futuna</option>
799
- <option value="Western Sahara">Western Sahara</option>
800
- <option value="Yemen">Yemen</option>
801
- <option value="Zambia">Zambia</option>
802
- <option value="Zimbabwe">Zimbabwe</option>
803
- </select>
804
- </div>
805
- <div>
806
- <em>Into This</em>
807
- <select data-placeholder="Choose a Country..." class="chosen-select" multiple tabindex="4">
808
- <option value=""></option>
809
- <option value="United States">United States</option>
810
- <option value="United Kingdom">United Kingdom</option>
811
- <option value="Afghanistan">Afghanistan</option>
812
- <option value="Aland Islands">Aland Islands</option>
813
- <option value="Albania">Albania</option>
814
- <option value="Algeria">Algeria</option>
815
- <option value="American Samoa">American Samoa</option>
816
- <option value="Andorra">Andorra</option>
817
- <option value="Angola">Angola</option>
818
- <option value="Anguilla">Anguilla</option>
819
- <option value="Antarctica">Antarctica</option>
820
- <option value="Antigua and Barbuda">Antigua and Barbuda</option>
821
- <option value="Argentina">Argentina</option>
822
- <option value="Armenia">Armenia</option>
823
- <option value="Aruba">Aruba</option>
824
- <option value="Australia">Australia</option>
825
- <option value="Austria">Austria</option>
826
- <option value="Azerbaijan">Azerbaijan</option>
827
- <option value="Bahamas">Bahamas</option>
828
- <option value="Bahrain">Bahrain</option>
829
- <option value="Bangladesh">Bangladesh</option>
830
- <option value="Barbados">Barbados</option>
831
- <option value="Belarus">Belarus</option>
832
- <option value="Belgium">Belgium</option>
833
- <option value="Belize">Belize</option>
834
- <option value="Benin">Benin</option>
835
- <option value="Bermuda">Bermuda</option>
836
- <option value="Bhutan">Bhutan</option>
837
- <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
838
- <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
839
- <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
840
- <option value="Botswana">Botswana</option>
841
- <option value="Bouvet Island">Bouvet Island</option>
842
- <option value="Brazil">Brazil</option>
843
- <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
844
- <option value="Brunei Darussalam">Brunei Darussalam</option>
845
- <option value="Bulgaria">Bulgaria</option>
846
- <option value="Burkina Faso">Burkina Faso</option>
847
- <option value="Burundi">Burundi</option>
848
- <option value="Cambodia">Cambodia</option>
849
- <option value="Cameroon">Cameroon</option>
850
- <option value="Canada">Canada</option>
851
- <option value="Cape Verde">Cape Verde</option>
852
- <option value="Cayman Islands">Cayman Islands</option>
853
- <option value="Central African Republic">Central African Republic</option>
854
- <option value="Chad">Chad</option>
855
- <option value="Chile">Chile</option>
856
- <option value="China">China</option>
857
- <option value="Christmas Island">Christmas Island</option>
858
- <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
859
- <option value="Colombia">Colombia</option>
860
- <option value="Comoros">Comoros</option>
861
- <option value="Congo">Congo</option>
862
- <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
863
- <option value="Cook Islands">Cook Islands</option>
864
- <option value="Costa Rica">Costa Rica</option>
865
- <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
866
- <option value="Croatia">Croatia</option>
867
- <option value="Cuba">Cuba</option>
868
- <option value="Curacao">Curacao</option>
869
- <option value="Cyprus">Cyprus</option>
870
- <option value="Czech Republic">Czech Republic</option>
871
- <option value="Denmark">Denmark</option>
872
- <option value="Djibouti">Djibouti</option>
873
- <option value="Dominica">Dominica</option>
874
- <option value="Dominican Republic">Dominican Republic</option>
875
- <option value="Ecuador">Ecuador</option>
876
- <option value="Egypt">Egypt</option>
877
- <option value="El Salvador">El Salvador</option>
878
- <option value="Equatorial Guinea">Equatorial Guinea</option>
879
- <option value="Eritrea">Eritrea</option>
880
- <option value="Estonia">Estonia</option>
881
- <option value="Ethiopia">Ethiopia</option>
882
- <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
883
- <option value="Faroe Islands">Faroe Islands</option>
884
- <option value="Fiji">Fiji</option>
885
- <option value="Finland">Finland</option>
886
- <option value="France">France</option>
887
- <option value="French Guiana">French Guiana</option>
888
- <option value="French Polynesia">French Polynesia</option>
889
- <option value="French Southern Territories">French Southern Territories</option>
890
- <option value="Gabon">Gabon</option>
891
- <option value="Gambia">Gambia</option>
892
- <option value="Georgia">Georgia</option>
893
- <option value="Germany">Germany</option>
894
- <option value="Ghana">Ghana</option>
895
- <option value="Gibraltar">Gibraltar</option>
896
- <option value="Greece">Greece</option>
897
- <option value="Greenland">Greenland</option>
898
- <option value="Grenada">Grenada</option>
899
- <option value="Guadeloupe">Guadeloupe</option>
900
- <option value="Guam">Guam</option>
901
- <option value="Guatemala">Guatemala</option>
902
- <option value="Guernsey">Guernsey</option>
903
- <option value="Guinea">Guinea</option>
904
- <option value="Guinea-bissau">Guinea-bissau</option>
905
- <option value="Guyana">Guyana</option>
906
- <option value="Haiti">Haiti</option>
907
- <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
908
- <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
909
- <option value="Honduras">Honduras</option>
910
- <option value="Hong Kong">Hong Kong</option>
911
- <option value="Hungary">Hungary</option>
912
- <option value="Iceland">Iceland</option>
913
- <option value="India">India</option>
914
- <option value="Indonesia">Indonesia</option>
915
- <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
916
- <option value="Iraq">Iraq</option>
917
- <option value="Ireland">Ireland</option>
918
- <option value="Isle of Man">Isle of Man</option>
919
- <option value="Israel">Israel</option>
920
- <option value="Italy">Italy</option>
921
- <option value="Jamaica">Jamaica</option>
922
- <option value="Japan">Japan</option>
923
- <option value="Jersey">Jersey</option>
924
- <option value="Jordan">Jordan</option>
925
- <option value="Kazakhstan">Kazakhstan</option>
926
- <option value="Kenya">Kenya</option>
927
- <option value="Kiribati">Kiribati</option>
928
- <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
929
- <option value="Korea, Republic of">Korea, Republic of</option>
930
- <option value="Kuwait">Kuwait</option>
931
- <option value="Kyrgyzstan">Kyrgyzstan</option>
932
- <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
933
- <option value="Latvia">Latvia</option>
934
- <option value="Lebanon">Lebanon</option>
935
- <option value="Lesotho">Lesotho</option>
936
- <option value="Liberia">Liberia</option>
937
- <option value="Libya">Libya</option>
938
- <option value="Liechtenstein">Liechtenstein</option>
939
- <option value="Lithuania">Lithuania</option>
940
- <option value="Luxembourg">Luxembourg</option>
941
- <option value="Macao">Macao</option>
942
- <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
943
- <option value="Madagascar">Madagascar</option>
944
- <option value="Malawi">Malawi</option>
945
- <option value="Malaysia">Malaysia</option>
946
- <option value="Maldives">Maldives</option>
947
- <option value="Mali">Mali</option>
948
- <option value="Malta">Malta</option>
949
- <option value="Marshall Islands">Marshall Islands</option>
950
- <option value="Martinique">Martinique</option>
951
- <option value="Mauritania">Mauritania</option>
952
- <option value="Mauritius">Mauritius</option>
953
- <option value="Mayotte">Mayotte</option>
954
- <option value="Mexico">Mexico</option>
955
- <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
956
- <option value="Moldova, Republic of">Moldova, Republic of</option>
957
- <option value="Monaco">Monaco</option>
958
- <option value="Mongolia">Mongolia</option>
959
- <option value="Montenegro">Montenegro</option>
960
- <option value="Montserrat">Montserrat</option>
961
- <option value="Morocco">Morocco</option>
962
- <option value="Mozambique">Mozambique</option>
963
- <option value="Myanmar">Myanmar</option>
964
- <option value="Namibia">Namibia</option>
965
- <option value="Nauru">Nauru</option>
966
- <option value="Nepal">Nepal</option>
967
- <option value="Netherlands">Netherlands</option>
968
- <option value="New Caledonia">New Caledonia</option>
969
- <option value="New Zealand">New Zealand</option>
970
- <option value="Nicaragua">Nicaragua</option>
971
- <option value="Niger">Niger</option>
972
- <option value="Nigeria">Nigeria</option>
973
- <option value="Niue">Niue</option>
974
- <option value="Norfolk Island">Norfolk Island</option>
975
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
976
- <option value="Norway">Norway</option>
977
- <option value="Oman">Oman</option>
978
- <option value="Pakistan">Pakistan</option>
979
- <option value="Palau">Palau</option>
980
- <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
981
- <option value="Panama">Panama</option>
982
- <option value="Papua New Guinea">Papua New Guinea</option>
983
- <option value="Paraguay">Paraguay</option>
984
- <option value="Peru">Peru</option>
985
- <option value="Philippines">Philippines</option>
986
- <option value="Pitcairn">Pitcairn</option>
987
- <option value="Poland">Poland</option>
988
- <option value="Portugal">Portugal</option>
989
- <option value="Puerto Rico">Puerto Rico</option>
990
- <option value="Qatar">Qatar</option>
991
- <option value="Reunion">Reunion</option>
992
- <option value="Romania">Romania</option>
993
- <option value="Russian Federation">Russian Federation</option>
994
- <option value="Rwanda">Rwanda</option>
995
- <option value="Saint Barthelemy">Saint Barthelemy</option>
996
- <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
997
- <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
998
- <option value="Saint Lucia">Saint Lucia</option>
999
- <option value="Saint Martin (French part)">Saint Martin (French part)</option>
1000
- <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
1001
- <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
1002
- <option value="Samoa">Samoa</option>
1003
- <option value="San Marino">San Marino</option>
1004
- <option value="Sao Tome and Principe">Sao Tome and Principe</option>
1005
- <option value="Saudi Arabia">Saudi Arabia</option>
1006
- <option value="Senegal">Senegal</option>
1007
- <option value="Serbia">Serbia</option>
1008
- <option value="Seychelles">Seychelles</option>
1009
- <option value="Sierra Leone">Sierra Leone</option>
1010
- <option value="Singapore">Singapore</option>
1011
- <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
1012
- <option value="Slovakia">Slovakia</option>
1013
- <option value="Slovenia">Slovenia</option>
1014
- <option value="Solomon Islands">Solomon Islands</option>
1015
- <option value="Somalia">Somalia</option>
1016
- <option value="South Africa">South Africa</option>
1017
- <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
1018
- <option value="South Sudan">South Sudan</option>
1019
- <option value="Spain">Spain</option>
1020
- <option value="Sri Lanka">Sri Lanka</option>
1021
- <option value="Sudan">Sudan</option>
1022
- <option value="Suriname">Suriname</option>
1023
- <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
1024
- <option value="Swaziland">Swaziland</option>
1025
- <option value="Sweden">Sweden</option>
1026
- <option value="Switzerland">Switzerland</option>
1027
- <option value="Syrian Arab Republic">Syrian Arab Republic</option>
1028
- <option value="Taiwan, Province of China">Taiwan, Province of China</option>
1029
- <option value="Tajikistan">Tajikistan</option>
1030
- <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
1031
- <option value="Thailand">Thailand</option>
1032
- <option value="Timor-leste">Timor-leste</option>
1033
- <option value="Togo">Togo</option>
1034
- <option value="Tokelau">Tokelau</option>
1035
- <option value="Tonga">Tonga</option>
1036
- <option value="Trinidad and Tobago">Trinidad and Tobago</option>
1037
- <option value="Tunisia">Tunisia</option>
1038
- <option value="Turkey">Turkey</option>
1039
- <option value="Turkmenistan">Turkmenistan</option>
1040
- <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
1041
- <option value="Tuvalu">Tuvalu</option>
1042
- <option value="Uganda">Uganda</option>
1043
- <option value="Ukraine">Ukraine</option>
1044
- <option value="United Arab Emirates">United Arab Emirates</option>
1045
- <option value="United Kingdom">United Kingdom</option>
1046
- <option value="United States">United States</option>
1047
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
1048
- <option value="Uruguay">Uruguay</option>
1049
- <option value="Uzbekistan">Uzbekistan</option>
1050
- <option value="Vanuatu">Vanuatu</option>
1051
- <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
1052
- <option value="Viet Nam">Viet Nam</option>
1053
- <option value="Virgin Islands, British">Virgin Islands, British</option>
1054
- <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
1055
- <option value="Wallis and Futuna">Wallis and Futuna</option>
1056
- <option value="Western Sahara">Western Sahara</option>
1057
- <option value="Yemen">Yemen</option>
1058
- <option value="Zambia">Zambia</option>
1059
- <option value="Zimbabwe">Zimbabwe</option>
1060
- </select>
1061
- </div>
1062
- </div>
1063
-
1064
- <h2><a name="optgroup-support" class="anchor" href="#optgroup-support">&lt;optgroup&gt; Support</a></h2>
1065
- <div class="side-by-side clearfix">
1066
- <div>
1067
- <em>Single Select with Groups</em>
1068
- <select data-placeholder="Your Favorite Football Team" class="chosen-select" tabindex="5">
1069
- <option value=""></option>
1070
- <optgroup label="NFC EAST">
1071
- <option>Dallas Cowboys</option>
1072
- <option>New York Giants</option>
1073
- <option>Philadelphia Eagles</option>
1074
- <option>Washington Redskins</option>
1075
- </optgroup>
1076
- <optgroup label="NFC NORTH">
1077
- <option>Chicago Bears</option>
1078
- <option>Detroit Lions</option>
1079
- <option>Green Bay Packers</option>
1080
- <option>Minnesota Vikings</option>
1081
- </optgroup>
1082
- <optgroup label="NFC SOUTH">
1083
- <option>Atlanta Falcons</option>
1084
- <option>Carolina Panthers</option>
1085
- <option>New Orleans Saints</option>
1086
- <option>Tampa Bay Buccaneers</option>
1087
- </optgroup>
1088
- <optgroup label="NFC WEST">
1089
- <option>Arizona Cardinals</option>
1090
- <option>St. Louis Rams</option>
1091
- <option>San Francisco 49ers</option>
1092
- <option>Seattle Seahawks</option>
1093
- </optgroup>
1094
- <optgroup label="AFC EAST">
1095
- <option>Buffalo Bills</option>
1096
- <option>Miami Dolphins</option>
1097
- <option>New England Patriots</option>
1098
- <option>New York Jets</option>
1099
- </optgroup>
1100
- <optgroup label="AFC NORTH">
1101
- <option>Baltimore Ravens</option>
1102
- <option>Cincinnati Bengals</option>
1103
- <option>Cleveland Browns</option>
1104
- <option>Pittsburgh Steelers</option>
1105
- </optgroup>
1106
- <optgroup label="AFC SOUTH">
1107
- <option>Houston Texans</option>
1108
- <option>Indianapolis Colts</option>
1109
- <option>Jacksonville Jaguars</option>
1110
- <option>Tennessee Titans</option>
1111
- </optgroup>
1112
- <optgroup label="AFC WEST">
1113
- <option>Denver Broncos</option>
1114
- <option>Kansas City Chiefs</option>
1115
- <option>Oakland Raiders</option>
1116
- <option>San Diego Chargers</option>
1117
- </optgroup>
1118
- </select>
1119
- </div>
1120
- <div>
1121
- <em>Multiple Select with Groups</em>
1122
- <select data-placeholder="Your Favorite Football Team" class="chosen-select" multiple tabindex="6">
1123
- <option value=""></option>
1124
- <optgroup label="NFC EAST">
1125
- <option>Dallas Cowboys</option>
1126
- <option>New York Giants</option>
1127
- <option>Philadelphia Eagles</option>
1128
- <option>Washington Redskins</option>
1129
- </optgroup>
1130
- <optgroup label="NFC NORTH">
1131
- <option>Chicago Bears</option>
1132
- <option>Detroit Lions</option>
1133
- <option>Green Bay Packers</option>
1134
- <option>Minnesota Vikings</option>
1135
- </optgroup>
1136
- <optgroup label="NFC SOUTH">
1137
- <option>Atlanta Falcons</option>
1138
- <option>Carolina Panthers</option>
1139
- <option>New Orleans Saints</option>
1140
- <option>Tampa Bay Buccaneers</option>
1141
- </optgroup>
1142
- <optgroup label="NFC WEST">
1143
- <option>Arizona Cardinals</option>
1144
- <option>St. Louis Rams</option>
1145
- <option>San Francisco 49ers</option>
1146
- <option>Seattle Seahawks</option>
1147
- </optgroup>
1148
- <optgroup label="AFC EAST">
1149
- <option>Buffalo Bills</option>
1150
- <option>Miami Dolphins</option>
1151
- <option>New England Patriots</option>
1152
- <option>New York Jets</option>
1153
- </optgroup>
1154
- <optgroup label="AFC NORTH">
1155
- <option>Baltimore Ravens</option>
1156
- <option>Cincinnati Bengals</option>
1157
- <option>Cleveland Browns</option>
1158
- <option>Pittsburgh Steelers</option>
1159
- </optgroup>
1160
- <optgroup label="AFC SOUTH">
1161
- <option>Houston Texans</option>
1162
- <option>Indianapolis Colts</option>
1163
- <option>Jacksonville Jaguars</option>
1164
- <option>Tennessee Titans</option>
1165
- </optgroup>
1166
- <optgroup label="AFC WEST">
1167
- <option>Denver Broncos</option>
1168
- <option>Kansas City Chiefs</option>
1169
- <option>Oakland Raiders</option>
1170
- <option>San Diego Chargers</option>
1171
- </optgroup>
1172
- </select>
1173
- </div>
1174
- </div>
1175
-
1176
- <h2><a name="selected-and-disabled-support" class="anchor" href="#selected-and-disabled-support">Selected and Disabled Support</a></h2>
1177
- <div class="side-by-side clearfix">
1178
- <p>Chosen automatically highlights selected options and removes disabled options.</p>
1179
- <div>
1180
- <em>Single Select</em>
1181
- <select data-placeholder="Your Favorite Type of Bear" class="chosen-select" tabindex="7">
1182
- <option value=""></option>
1183
- <option>American Black Bear</option>
1184
- <option>Asiatic Black Bear</option>
1185
- <option>Brown Bear</option>
1186
- <option>Giant Panda</option>
1187
- <option selected>Sloth Bear</option>
1188
- <option disabled>Sun Bear</option>
1189
- <option>Polar Bear</option>
1190
- <option disabled>Spectacled Bear</option>
1191
- </select>
1192
- </div>
1193
- <div>
1194
- <em>Multiple Select</em>
1195
- <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="8">
1196
- <option value=""></option>
1197
- <option>American Black Bear</option>
1198
- <option>Asiatic Black Bear</option>
1199
- <option>Brown Bear</option>
1200
- <option>Giant Panda</option>
1201
- <option selected>Sloth Bear</option>
1202
- <option disabled>Sun Bear</option>
1203
- <option selected>Polar Bear</option>
1204
- <option disabled>Spectacled Bear</option>
1205
- </select>
1206
- </div>
1207
- </div>
1208
-
1209
- <h2><a name="hide-search-on-single-select" class="anchor" href="#hide-search-on-single-select">Hide Search on Single Select</a></h2>
1210
- <div class="side-by-side clearfix">
1211
- <p>The <code>disable_search_threshold</code> option can be specified to hide the search input on single selects if there are <i>n</i> or fewer options.</p>
1212
- <pre><code class="language-javascript">$(".chosen-select").chosen({disable_search_threshold: 10});</code></pre>
1213
- <p></p>
1214
- <div>
1215
- <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-no-single" tabindex="9">
1216
- <option value=""></option>
1217
- <option>American Black Bear</option>
1218
- <option>Asiatic Black Bear</option>
1219
- <option>Brown Bear</option>
1220
- <option>Giant Panda</option>
1221
- <option selected disabled>Sloth Bear</option>
1222
- <option disabled>Sun Bear</option>
1223
- <option selected disabled>Paddington Bear</option>
1224
- <option selected>Polar Bear</option>
1225
- <option disabled>Spectacled Bear</option>
1226
- </select>
1227
- </div>
1228
- </div>
1229
-
1230
- <h2><a name="default-text-support" class="anchor" href="#default-text-support">Default Text Support</a></h2>
1231
- <div class="side-by-side clearfix">
1232
- <p>Chosen automatically sets the default field text ("Choose a country...") by reading the select element's data-placeholder value. If no data-placeholder value is present, it will default to "Select an Option" or "Select Some Options" depending on whether the select is single or multiple. You can change these elements in the plugin js file as you see fit.</p>
1233
- <pre><code class="language-markup">&lt;select <strong>data-placeholder="Choose a country..."</strong> multiple class="chosen-select"&gt;</code></pre>
1234
- <p><strong>Note:</strong> on single selects, the first element is assumed to be selected by the browser. To take advantage of the default text support, you will need to include a blank option as the first element of your select list.</p>
1235
- </div>
1236
-
1237
- <h2><a name="no-results-text-support" class="anchor" href="#no-results-text-support">No Results Text Support</a></h2>
1238
- <div class="side-by-side clearfix">
1239
- <p>Setting the "No results" search text is as easy as passing an option when you create Chosen:</p>
1240
- <pre><code class="language-javascript"> $(".chosen-select").chosen({no_results_text: "Oops, nothing found!"}); </code></pre>
1241
- <p></p>
1242
- <div>
1243
- <em>Single Select</em>
1244
- <select data-placeholder="Type &apos;C&apos; to view" class="chosen-select-no-results" tabindex="10">
1245
- <option value=""></option>
1246
- <option>American Black Bear</option>
1247
- <option>Asiatic Black Bear</option>
1248
- <option>Brown Bear</option>
1249
- <option>Giant Panda</option>
1250
- <option>Sloth Bear</option>
1251
- <option>Sun Bear</option>
1252
- <option>Polar Bear</option>
1253
- <option>Spectacled Bear</option>
1254
- </select>
1255
- </div>
1256
- <div>
1257
- <em>Multiple Select</em>
1258
- <select data-placeholder="Type &apos;C&apos; to view" multiple class="chosen-select-no-results" tabindex="11">
1259
- <option value=""></option>
1260
- <option>American Black Bear</option>
1261
- <option>Asiatic Black Bear</option>
1262
- <option>Brown Bear</option>
1263
- <option>Giant Panda</option>
1264
- <option>Sloth Bear</option>
1265
- <option>Sun Bear</option>
1266
- <option>Polar Bear</option>
1267
- <option>Spectacled Bear</option>
1268
- </select>
1269
- </div>
1270
- </div>
1271
-
1272
- <h2><a name="limit-selected-options-in-multiselect" class="anchor" href="#limit-selected-options-in-multiselect">Limit Selected Options in Multiselect</a></h2>
1273
- <div class="side-by-side clearfix">
1274
- <p>You can easily limit how many options the user can select:</p>
1275
- <pre><code class="language-javascript">$(".chosen-select").chosen({max_selected_options: 5});</code></pre>
1276
- <p>If you try to select another option with limit reached <code class="language-javascript">chosen:maxselected</code> event is triggered:</p>
1277
- <pre><code class="language-javascript"> $(".chosen-select").bind("chosen:maxselected", function () { ... }); </code></pre>
1278
- </div>
1279
-
1280
- <h2><a name="allow-deselect-on-single-selects" class="anchor" href="#allow-deselect-on-single-selects">Allow Deselect on Single Selects</a></h2>
1281
- <div class="side-by-side clearfix">
1282
- <p>When a single select box isn't a required field, you can set <code class="language-javascript">allow_single_deselect: true</code> and Chosen will add a UI element for option deselection. This will only work if the first option has blank text.</p>
1283
- <div class="side-by-side clearfix">
1284
- <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-deselect" tabindex="12">
1285
- <option value=""></option>
1286
- <option>American Black Bear</option>
1287
- <option>Asiatic Black Bear</option>
1288
- <option>Brown Bear</option>
1289
- <option>Giant Panda</option>
1290
- <option selected>Sloth Bear</option>
1291
- <option>Sun Bear</option>
1292
- <option>Polar Bear</option>
1293
- <option>Spectacled Bear</option>
1294
- </select>
1295
- </div>
1296
- </div>
1297
-
1298
- <h2><a name="right-to-left-support" class="anchor" href="#right-to-left-support">Right-to-Left Support</a></h2>
1299
- <div class="side-by-side clearfix">
1300
- <p>You can set right-to-left text by setting <code class="language-javascript">rtl: true</code></p>
1301
- <pre><code class="language-javascript"> $(".chosen-select").chosen({rtl: true}); </code></pre>
1302
-
1303
- <div>
1304
- <em>Single Right-to-Left Select</em>
1305
- <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-rtl" tabindex="13">
1306
- <option value=""></option>
1307
- <option>American Black Bear</option>
1308
- <option>Asiatic Black Bear</option>
1309
- <option>Brown Bear</option>
1310
- <option>Giant Panda</option>
1311
- <option selected>Sloth Bear</option>
1312
- <option>Polar Bear</option>
1313
- </select>
1314
- </div>
1315
- <div>
1316
- <em>Multiple Right-to-Left Select</em>
1317
- <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-rtl" tabindex="14">
1318
- <option value=""></option>
1319
- <option>American Black Bear</option>
1320
- <option>Asiatic Black Bear</option>
1321
- <option>Brown Bear</option>
1322
- <option>Giant Panda</option>
1323
- <option selected>Sloth Bear</option>
1324
- <option selected>Polar Bear</option>
1325
- </select>
1326
- </div>
1327
- </div>
1328
-
1329
- <h2><a name="change-update-events" class="anchor" href="#change-update-events">Observing, Updating, and Destroying Chosen</a></h2>
1330
- <div class="side-by-side clearfix">
1331
- <ul>
1332
- <li>
1333
- <h3>Observing Form Field Changes</h3>
1334
- <p>When working with form fields, you often want to perform some behavior after a value has been selected or deselected. Whenever a user selects a field in Chosen, it triggers a "change" event on the original form field. That lets you do something like this:</p>
1335
- <pre><code class="language-javascript">$("#form_field").chosen().change( &hellip; );</code></pre>
1336
- </li>
1337
- <li>
1338
- <h3>Updating Chosen Dynamically</h3>
1339
- <p>If you need to update the options in your select field and want Chosen to pick up the changes, you'll need to trigger the "chosen:updated" event on the field. Chosen will re-build itself based on the updated content.</p>
1340
- <pre><code class="language-javascript">$("#form_field").trigger("chosen:updated");</code></pre>
1341
- </li>
1342
- <li>
1343
- <h3>Destroying Chosen</h3>
1344
- <p>To destroy Chosen and revert back to the native select:</p>
1345
- <pre><code class="language-javascript">$("#form_field").chosen("destroy");</code></pre>
1346
- </li>
1347
- </ul>
1348
- </div>
1349
-
1350
- <h2><a name="custom-width-support" class="anchor" href="#custom-width-support">Custom Width Support</a></h2>
1351
- <div class="side-by-side clearfix">
1352
- <p>Using a custom width with Chosen is as easy as passing an option when you create Chosen:</p>
1353
- <pre><code class="language-javascript"> $(".chosen-select").chosen({width: "95%"}); </code></pre>
1354
- <div>
1355
- <em>Single Select</em>
1356
- <select data-placeholder="Your Favorite Types of Bear" class="chosen-select-width" tabindex="15">
1357
- <option value=""></option>
1358
- <option selected>American Black Bear</option>
1359
- <option>Asiatic Black Bear</option>
1360
- <option>Brown Bear</option>
1361
- <option>Giant Panda</option>
1362
- <option>Sloth Bear</option>
1363
- <option>Sun Bear</option>
1364
- <option>Polar Bear</option>
1365
- <option>Spectacled Bear</option>
1366
- </select>
1367
- </div>
1368
- <div>
1369
- <em>Multiple Select</em>
1370
- <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-width" tabindex="16">
1371
- <option value=""></option>
1372
- <option>American Black Bear</option>
1373
- <option>Asiatic Black Bear</option>
1374
- <option>Brown Bear</option>
1375
- <option selected>Giant Panda</option>
1376
- <option>Sloth Bear</option>
1377
- <option>Sun Bear</option>
1378
- <option>Polar Bear</option>
1379
- <option>Spectacled Bear</option>
1380
- </select>
1381
- </div>
1382
- </div>
1383
-
1384
- <h2><a name="labels-work-too" class="anchor" href="#labels-work-too">Labels work, too</a></h2>
1385
- <div class="side-by-side clearfix">
1386
- <p>Use labels just like you would a standard select</p>
1387
- <p></p>
1388
- <div>
1389
- <em><label for="single-label-example">Click to Highlight Single Select</label></em>
1390
- <select data-placeholder="Your Favorite Types of Bear" class="chosen-select" tabindex="17" id="single-label-example">
1391
- <option value=""></option>
1392
- <option selected>American Black Bear</option>
1393
- <option>Asiatic Black Bear</option>
1394
- <option>Brown Bear</option>
1395
- <option>Giant Panda</option>
1396
- <option>Sloth Bear</option>
1397
- <option>Sun Bear</option>
1398
- <option>Polar Bear</option>
1399
- <option>Spectacled Bear</option>
1400
- </select>
1401
- </div>
1402
- <div>
1403
- <em><label for="multiple-label-example">Click to Highlight Multiple Select</label></em>
1404
- <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="18" id="multiple-label-example">
1405
- <option value=""></option>
1406
- <option>American Black Bear</option>
1407
- <option>Asiatic Black Bear</option>
1408
- <option>Brown Bear</option>
1409
- <option selected>Giant Panda</option>
1410
- <option>Sloth Bear</option>
1411
- <option>Sun Bear</option>
1412
- <option>Polar Bear</option>
1413
- <option>Spectacled Bear</option>
1414
- </select>
1415
- </div>
1416
- </div>
1417
-
1418
- <h2><a name="setup" class="anchor" href="#setup">Setup</a></h2>
1419
- <p>Using Chosen is easy as can be.</p>
1420
- <ol>
1421
- <li><a href="https://github.com/harvesthq/chosen/releases">Download</a> the plugin and copy the chosen files to your app.</li>
1422
- <li>Activate the plugin on the select boxes of your choice: <code class="language-javascript">$(".chosen-select").chosen()</code></li>
1423
- <li><a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=UkSPUDpe0U8#t=11s">Disco</a>.</li>
1424
- </ol>
1425
-
1426
- <h2><a name="faqs" class="anchor" href="#faqs">FAQs</a></h2>
1427
- <ul class="faqs">
1428
- <li>
1429
- <h3>Do you have all the available options documented somewhere?</h3>
1430
- <p>Yes! You can find them on <a href="options.html">the options page</a>.</p>
1431
- </li>
1432
- <li>
1433
- <h3>Something doesn't work. Can you fix it?</h3>
1434
- <p>Yes! Please report all issues using the <a href="http://github.com/harvesthq/chosen/issues">GitHub issue tracking tool</a>. Please include the plugin version (jQuery or Prototype), browser and OS. The more information provided, the easier it is to fix a problem.</p>
1435
- </li>
1436
- <li>
1437
- <h3>What browsers are supported?</h3>
1438
- <p>All modern desktop browsers are supported (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled. Chosen is disabled on iPhone, iPod Touch, and Android mobile devices (<a href="https://github.com/harvesthq/chosen/pull/1388">more information</a>).</p>
1439
- </li>
1440
- <li>
1441
- <h3>Didn't there used to be a Prototype version of Chosen?</h3>
1442
- <p><a href="index.proto.html">There still is!</a></p>
1443
- </li>
1444
- </ul>
1445
-
1446
- <h2><a name="credits" class="anchor" href="#credits">Credits</a></h2>
1447
-
1448
- <ul class="credits">
1449
- <li>Concept and development by <a href="http://patrickfiller.com">Patrick Filler</a> for <a href="https://getharvest.com">Harvest</a>.</li>
1450
- <li>Design and CSS by <a href="http://matthewlettini.com">Matthew Lettini</a>.</li>
1451
- <li>Repository maintained by <a href="https://github.com/pfiller">@pfiller</a>, <a href="https://github.com/kenearley">@kenearley</a>, <a href="https://github.com/stof">@stof</a>, <a href="https://github.com/koenpunt">@koenpunt</a>, and <a href="https://github.com/tjschuck">@tjschuck</a>.</li>
1452
- <li>Chosen includes <a href="https://github.com/harvesthq/chosen/contributors">contributions by many fine folks</a>.</li>
1453
- </ul>
1454
-
1455
- <footer>
1456
- &copy; 2011&ndash;2016 <a href="http://www.getharvest.com/">Harvest</a>. Chosen is licensed under the <a href="https://github.com/harvesthq/chosen/blob/master/LICENSE.md">MIT license</a>.
1457
- </footer>
1458
-
1459
- </div>
1460
- </div>
1461
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.js" type="text/javascript"></script>
1462
- <script src="chosen.jquery.js" type="text/javascript"></script>
1463
- <script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
1464
- <script src="docsupport/init.js" type="text/javascript" charset="utf-8"></script>
1465
- </form>
1466
- <div class="oss-bar">
1467
- <ul>
1468
- <li><a class="fork" href="https://github.com/harvesthq/chosen">Fork on Github</a></li>
1469
- <li><a class="harvest" href="http://www.getharvest.com/">Built by Harvest</a></li>
1470
- </ul>
1471
- </div>
1472
- </body>
1473
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/index.proto.html DELETED
@@ -1,1472 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Chosen: A Prototype Plugin by Harvest to Tame Unwieldy Select Boxes</title>
6
- <link rel="stylesheet" href="docsupport/style.css">
7
- <link rel="stylesheet" href="docsupport/prism.css">
8
- <link rel="stylesheet" href="chosen.css">
9
-
10
- <meta http-equiv="Content-Security-Policy" content="default-src &apos;self&apos;; script-src &apos;self&apos; https://ajax.googleapis.com; style-src &apos;self&apos;; img-src &apos;self&apos; data:">
11
-
12
- </head>
13
- <body>
14
- <div id="container">
15
- <div id="content">
16
- <header>
17
- <h1>Chosen - Prototype Version <small>(<span id="latest-version">v1.7.0</span>)</small></h1>
18
- </header>
19
- <p>Chosen is a Prototype plugin that makes long, unwieldy select boxes much more user-friendly.</p>
20
-
21
- <p>
22
- <a class="button button-blue" href="https://github.com/harvesthq/chosen/releases">Downloads</a>
23
- <a class="button" href="https://github.com/harvesthq/chosen">Project Source</a>
24
- <a class="button" href="https://github.com/harvesthq/chosen/blob/master/contributing.md">Contribute</a>
25
- </p>
26
-
27
- <p class="jquery-version-refer">Looking for the <a href="index.html">jQuery version?</a></p>
28
-
29
- <h2><a name="standard-select" class="anchor" href="#standard-select">Standard Select</a></h2>
30
- <div class="side-by-side clearfix">
31
- <div>
32
- <em>Turns This</em>
33
- <select data-placeholder="Choose a Country..." class="select" tabindex="1">
34
- <option value=""></option>
35
- <option value="United States">United States</option>
36
- <option value="United Kingdom">United Kingdom</option>
37
- <option value="Afghanistan">Afghanistan</option>
38
- <option value="Aland Islands">Aland Islands</option>
39
- <option value="Albania">Albania</option>
40
- <option value="Algeria">Algeria</option>
41
- <option value="American Samoa">American Samoa</option>
42
- <option value="Andorra">Andorra</option>
43
- <option value="Angola">Angola</option>
44
- <option value="Anguilla">Anguilla</option>
45
- <option value="Antarctica">Antarctica</option>
46
- <option value="Antigua and Barbuda">Antigua and Barbuda</option>
47
- <option value="Argentina">Argentina</option>
48
- <option value="Armenia">Armenia</option>
49
- <option value="Aruba">Aruba</option>
50
- <option value="Australia">Australia</option>
51
- <option value="Austria">Austria</option>
52
- <option value="Azerbaijan">Azerbaijan</option>
53
- <option value="Bahamas">Bahamas</option>
54
- <option value="Bahrain">Bahrain</option>
55
- <option value="Bangladesh">Bangladesh</option>
56
- <option value="Barbados">Barbados</option>
57
- <option value="Belarus">Belarus</option>
58
- <option value="Belgium">Belgium</option>
59
- <option value="Belize">Belize</option>
60
- <option value="Benin">Benin</option>
61
- <option value="Bermuda">Bermuda</option>
62
- <option value="Bhutan">Bhutan</option>
63
- <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
64
- <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
65
- <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
66
- <option value="Botswana">Botswana</option>
67
- <option value="Bouvet Island">Bouvet Island</option>
68
- <option value="Brazil">Brazil</option>
69
- <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
70
- <option value="Brunei Darussalam">Brunei Darussalam</option>
71
- <option value="Bulgaria">Bulgaria</option>
72
- <option value="Burkina Faso">Burkina Faso</option>
73
- <option value="Burundi">Burundi</option>
74
- <option value="Cambodia">Cambodia</option>
75
- <option value="Cameroon">Cameroon</option>
76
- <option value="Canada">Canada</option>
77
- <option value="Cape Verde">Cape Verde</option>
78
- <option value="Cayman Islands">Cayman Islands</option>
79
- <option value="Central African Republic">Central African Republic</option>
80
- <option value="Chad">Chad</option>
81
- <option value="Chile">Chile</option>
82
- <option value="China">China</option>
83
- <option value="Christmas Island">Christmas Island</option>
84
- <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
85
- <option value="Colombia">Colombia</option>
86
- <option value="Comoros">Comoros</option>
87
- <option value="Congo">Congo</option>
88
- <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
89
- <option value="Cook Islands">Cook Islands</option>
90
- <option value="Costa Rica">Costa Rica</option>
91
- <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
92
- <option value="Croatia">Croatia</option>
93
- <option value="Cuba">Cuba</option>
94
- <option value="Curacao">Curacao</option>
95
- <option value="Cyprus">Cyprus</option>
96
- <option value="Czech Republic">Czech Republic</option>
97
- <option value="Denmark">Denmark</option>
98
- <option value="Djibouti">Djibouti</option>
99
- <option value="Dominica">Dominica</option>
100
- <option value="Dominican Republic">Dominican Republic</option>
101
- <option value="Ecuador">Ecuador</option>
102
- <option value="Egypt">Egypt</option>
103
- <option value="El Salvador">El Salvador</option>
104
- <option value="Equatorial Guinea">Equatorial Guinea</option>
105
- <option value="Eritrea">Eritrea</option>
106
- <option value="Estonia">Estonia</option>
107
- <option value="Ethiopia">Ethiopia</option>
108
- <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
109
- <option value="Faroe Islands">Faroe Islands</option>
110
- <option value="Fiji">Fiji</option>
111
- <option value="Finland">Finland</option>
112
- <option value="France">France</option>
113
- <option value="French Guiana">French Guiana</option>
114
- <option value="French Polynesia">French Polynesia</option>
115
- <option value="French Southern Territories">French Southern Territories</option>
116
- <option value="Gabon">Gabon</option>
117
- <option value="Gambia">Gambia</option>
118
- <option value="Georgia">Georgia</option>
119
- <option value="Germany">Germany</option>
120
- <option value="Ghana">Ghana</option>
121
- <option value="Gibraltar">Gibraltar</option>
122
- <option value="Greece">Greece</option>
123
- <option value="Greenland">Greenland</option>
124
- <option value="Grenada">Grenada</option>
125
- <option value="Guadeloupe">Guadeloupe</option>
126
- <option value="Guam">Guam</option>
127
- <option value="Guatemala">Guatemala</option>
128
- <option value="Guernsey">Guernsey</option>
129
- <option value="Guinea">Guinea</option>
130
- <option value="Guinea-bissau">Guinea-bissau</option>
131
- <option value="Guyana">Guyana</option>
132
- <option value="Haiti">Haiti</option>
133
- <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
134
- <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
135
- <option value="Honduras">Honduras</option>
136
- <option value="Hong Kong">Hong Kong</option>
137
- <option value="Hungary">Hungary</option>
138
- <option value="Iceland">Iceland</option>
139
- <option value="India">India</option>
140
- <option value="Indonesia">Indonesia</option>
141
- <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
142
- <option value="Iraq">Iraq</option>
143
- <option value="Ireland">Ireland</option>
144
- <option value="Isle of Man">Isle of Man</option>
145
- <option value="Israel">Israel</option>
146
- <option value="Italy">Italy</option>
147
- <option value="Jamaica">Jamaica</option>
148
- <option value="Japan">Japan</option>
149
- <option value="Jersey">Jersey</option>
150
- <option value="Jordan">Jordan</option>
151
- <option value="Kazakhstan">Kazakhstan</option>
152
- <option value="Kenya">Kenya</option>
153
- <option value="Kiribati">Kiribati</option>
154
- <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
155
- <option value="Korea, Republic of">Korea, Republic of</option>
156
- <option value="Kuwait">Kuwait</option>
157
- <option value="Kyrgyzstan">Kyrgyzstan</option>
158
- <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
159
- <option value="Latvia">Latvia</option>
160
- <option value="Lebanon">Lebanon</option>
161
- <option value="Lesotho">Lesotho</option>
162
- <option value="Liberia">Liberia</option>
163
- <option value="Libya">Libya</option>
164
- <option value="Liechtenstein">Liechtenstein</option>
165
- <option value="Lithuania">Lithuania</option>
166
- <option value="Luxembourg">Luxembourg</option>
167
- <option value="Macao">Macao</option>
168
- <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
169
- <option value="Madagascar">Madagascar</option>
170
- <option value="Malawi">Malawi</option>
171
- <option value="Malaysia">Malaysia</option>
172
- <option value="Maldives">Maldives</option>
173
- <option value="Mali">Mali</option>
174
- <option value="Malta">Malta</option>
175
- <option value="Marshall Islands">Marshall Islands</option>
176
- <option value="Martinique">Martinique</option>
177
- <option value="Mauritania">Mauritania</option>
178
- <option value="Mauritius">Mauritius</option>
179
- <option value="Mayotte">Mayotte</option>
180
- <option value="Mexico">Mexico</option>
181
- <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
182
- <option value="Moldova, Republic of">Moldova, Republic of</option>
183
- <option value="Monaco">Monaco</option>
184
- <option value="Mongolia">Mongolia</option>
185
- <option value="Montenegro">Montenegro</option>
186
- <option value="Montserrat">Montserrat</option>
187
- <option value="Morocco">Morocco</option>
188
- <option value="Mozambique">Mozambique</option>
189
- <option value="Myanmar">Myanmar</option>
190
- <option value="Namibia">Namibia</option>
191
- <option value="Nauru">Nauru</option>
192
- <option value="Nepal">Nepal</option>
193
- <option value="Netherlands">Netherlands</option>
194
- <option value="New Caledonia">New Caledonia</option>
195
- <option value="New Zealand">New Zealand</option>
196
- <option value="Nicaragua">Nicaragua</option>
197
- <option value="Niger">Niger</option>
198
- <option value="Nigeria">Nigeria</option>
199
- <option value="Niue">Niue</option>
200
- <option value="Norfolk Island">Norfolk Island</option>
201
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
202
- <option value="Norway">Norway</option>
203
- <option value="Oman">Oman</option>
204
- <option value="Pakistan">Pakistan</option>
205
- <option value="Palau">Palau</option>
206
- <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
207
- <option value="Panama">Panama</option>
208
- <option value="Papua New Guinea">Papua New Guinea</option>
209
- <option value="Paraguay">Paraguay</option>
210
- <option value="Peru">Peru</option>
211
- <option value="Philippines">Philippines</option>
212
- <option value="Pitcairn">Pitcairn</option>
213
- <option value="Poland">Poland</option>
214
- <option value="Portugal">Portugal</option>
215
- <option value="Puerto Rico">Puerto Rico</option>
216
- <option value="Qatar">Qatar</option>
217
- <option value="Reunion">Reunion</option>
218
- <option value="Romania">Romania</option>
219
- <option value="Russian Federation">Russian Federation</option>
220
- <option value="Rwanda">Rwanda</option>
221
- <option value="Saint Barthelemy">Saint Barthelemy</option>
222
- <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
223
- <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
224
- <option value="Saint Lucia">Saint Lucia</option>
225
- <option value="Saint Martin (French part)">Saint Martin (French part)</option>
226
- <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
227
- <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
228
- <option value="Samoa">Samoa</option>
229
- <option value="San Marino">San Marino</option>
230
- <option value="Sao Tome and Principe">Sao Tome and Principe</option>
231
- <option value="Saudi Arabia">Saudi Arabia</option>
232
- <option value="Senegal">Senegal</option>
233
- <option value="Serbia">Serbia</option>
234
- <option value="Seychelles">Seychelles</option>
235
- <option value="Sierra Leone">Sierra Leone</option>
236
- <option value="Singapore">Singapore</option>
237
- <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
238
- <option value="Slovakia">Slovakia</option>
239
- <option value="Slovenia">Slovenia</option>
240
- <option value="Solomon Islands">Solomon Islands</option>
241
- <option value="Somalia">Somalia</option>
242
- <option value="South Africa">South Africa</option>
243
- <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
244
- <option value="South Sudan">South Sudan</option>
245
- <option value="Spain">Spain</option>
246
- <option value="Sri Lanka">Sri Lanka</option>
247
- <option value="Sudan">Sudan</option>
248
- <option value="Suriname">Suriname</option>
249
- <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
250
- <option value="Swaziland">Swaziland</option>
251
- <option value="Sweden">Sweden</option>
252
- <option value="Switzerland">Switzerland</option>
253
- <option value="Syrian Arab Republic">Syrian Arab Republic</option>
254
- <option value="Taiwan, Province of China">Taiwan, Province of China</option>
255
- <option value="Tajikistan">Tajikistan</option>
256
- <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
257
- <option value="Thailand">Thailand</option>
258
- <option value="Timor-leste">Timor-leste</option>
259
- <option value="Togo">Togo</option>
260
- <option value="Tokelau">Tokelau</option>
261
- <option value="Tonga">Tonga</option>
262
- <option value="Trinidad and Tobago">Trinidad and Tobago</option>
263
- <option value="Tunisia">Tunisia</option>
264
- <option value="Turkey">Turkey</option>
265
- <option value="Turkmenistan">Turkmenistan</option>
266
- <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
267
- <option value="Tuvalu">Tuvalu</option>
268
- <option value="Uganda">Uganda</option>
269
- <option value="Ukraine">Ukraine</option>
270
- <option value="United Arab Emirates">United Arab Emirates</option>
271
- <option value="United Kingdom">United Kingdom</option>
272
- <option value="United States">United States</option>
273
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
274
- <option value="Uruguay">Uruguay</option>
275
- <option value="Uzbekistan">Uzbekistan</option>
276
- <option value="Vanuatu">Vanuatu</option>
277
- <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
278
- <option value="Viet Nam">Viet Nam</option>
279
- <option value="Virgin Islands, British">Virgin Islands, British</option>
280
- <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
281
- <option value="Wallis and Futuna">Wallis and Futuna</option>
282
- <option value="Western Sahara">Western Sahara</option>
283
- <option value="Yemen">Yemen</option>
284
- <option value="Zambia">Zambia</option>
285
- <option value="Zimbabwe">Zimbabwe</option>
286
- </select>
287
- </div>
288
- <div>
289
- <em>Into This</em>
290
- <select data-placeholder="Choose a Country..." class="chosen-select" tabindex="2">
291
- <option value=""></option>
292
- <option value="United States">United States</option>
293
- <option value="United Kingdom">United Kingdom</option>
294
- <option value="Afghanistan">Afghanistan</option>
295
- <option value="Aland Islands">Aland Islands</option>
296
- <option value="Albania">Albania</option>
297
- <option value="Algeria">Algeria</option>
298
- <option value="American Samoa">American Samoa</option>
299
- <option value="Andorra">Andorra</option>
300
- <option value="Angola">Angola</option>
301
- <option value="Anguilla">Anguilla</option>
302
- <option value="Antarctica">Antarctica</option>
303
- <option value="Antigua and Barbuda">Antigua and Barbuda</option>
304
- <option value="Argentina">Argentina</option>
305
- <option value="Armenia">Armenia</option>
306
- <option value="Aruba">Aruba</option>
307
- <option value="Australia">Australia</option>
308
- <option value="Austria">Austria</option>
309
- <option value="Azerbaijan">Azerbaijan</option>
310
- <option value="Bahamas">Bahamas</option>
311
- <option value="Bahrain">Bahrain</option>
312
- <option value="Bangladesh">Bangladesh</option>
313
- <option value="Barbados">Barbados</option>
314
- <option value="Belarus">Belarus</option>
315
- <option value="Belgium">Belgium</option>
316
- <option value="Belize">Belize</option>
317
- <option value="Benin">Benin</option>
318
- <option value="Bermuda">Bermuda</option>
319
- <option value="Bhutan">Bhutan</option>
320
- <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
321
- <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
322
- <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
323
- <option value="Botswana">Botswana</option>
324
- <option value="Bouvet Island">Bouvet Island</option>
325
- <option value="Brazil">Brazil</option>
326
- <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
327
- <option value="Brunei Darussalam">Brunei Darussalam</option>
328
- <option value="Bulgaria">Bulgaria</option>
329
- <option value="Burkina Faso">Burkina Faso</option>
330
- <option value="Burundi">Burundi</option>
331
- <option value="Cambodia">Cambodia</option>
332
- <option value="Cameroon">Cameroon</option>
333
- <option value="Canada">Canada</option>
334
- <option value="Cape Verde">Cape Verde</option>
335
- <option value="Cayman Islands">Cayman Islands</option>
336
- <option value="Central African Republic">Central African Republic</option>
337
- <option value="Chad">Chad</option>
338
- <option value="Chile">Chile</option>
339
- <option value="China">China</option>
340
- <option value="Christmas Island">Christmas Island</option>
341
- <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
342
- <option value="Colombia">Colombia</option>
343
- <option value="Comoros">Comoros</option>
344
- <option value="Congo">Congo</option>
345
- <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
346
- <option value="Cook Islands">Cook Islands</option>
347
- <option value="Costa Rica">Costa Rica</option>
348
- <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
349
- <option value="Croatia">Croatia</option>
350
- <option value="Cuba">Cuba</option>
351
- <option value="Curacao">Curacao</option>
352
- <option value="Cyprus">Cyprus</option>
353
- <option value="Czech Republic">Czech Republic</option>
354
- <option value="Denmark">Denmark</option>
355
- <option value="Djibouti">Djibouti</option>
356
- <option value="Dominica">Dominica</option>
357
- <option value="Dominican Republic">Dominican Republic</option>
358
- <option value="Ecuador">Ecuador</option>
359
- <option value="Egypt">Egypt</option>
360
- <option value="El Salvador">El Salvador</option>
361
- <option value="Equatorial Guinea">Equatorial Guinea</option>
362
- <option value="Eritrea">Eritrea</option>
363
- <option value="Estonia">Estonia</option>
364
- <option value="Ethiopia">Ethiopia</option>
365
- <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
366
- <option value="Faroe Islands">Faroe Islands</option>
367
- <option value="Fiji">Fiji</option>
368
- <option value="Finland">Finland</option>
369
- <option value="France">France</option>
370
- <option value="French Guiana">French Guiana</option>
371
- <option value="French Polynesia">French Polynesia</option>
372
- <option value="French Southern Territories">French Southern Territories</option>
373
- <option value="Gabon">Gabon</option>
374
- <option value="Gambia">Gambia</option>
375
- <option value="Georgia">Georgia</option>
376
- <option value="Germany">Germany</option>
377
- <option value="Ghana">Ghana</option>
378
- <option value="Gibraltar">Gibraltar</option>
379
- <option value="Greece">Greece</option>
380
- <option value="Greenland">Greenland</option>
381
- <option value="Grenada">Grenada</option>
382
- <option value="Guadeloupe">Guadeloupe</option>
383
- <option value="Guam">Guam</option>
384
- <option value="Guatemala">Guatemala</option>
385
- <option value="Guernsey">Guernsey</option>
386
- <option value="Guinea">Guinea</option>
387
- <option value="Guinea-bissau">Guinea-bissau</option>
388
- <option value="Guyana">Guyana</option>
389
- <option value="Haiti">Haiti</option>
390
- <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
391
- <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
392
- <option value="Honduras">Honduras</option>
393
- <option value="Hong Kong">Hong Kong</option>
394
- <option value="Hungary">Hungary</option>
395
- <option value="Iceland">Iceland</option>
396
- <option value="India">India</option>
397
- <option value="Indonesia">Indonesia</option>
398
- <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
399
- <option value="Iraq">Iraq</option>
400
- <option value="Ireland">Ireland</option>
401
- <option value="Isle of Man">Isle of Man</option>
402
- <option value="Israel">Israel</option>
403
- <option value="Italy">Italy</option>
404
- <option value="Jamaica">Jamaica</option>
405
- <option value="Japan">Japan</option>
406
- <option value="Jersey">Jersey</option>
407
- <option value="Jordan">Jordan</option>
408
- <option value="Kazakhstan">Kazakhstan</option>
409
- <option value="Kenya">Kenya</option>
410
- <option value="Kiribati">Kiribati</option>
411
- <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
412
- <option value="Korea, Republic of">Korea, Republic of</option>
413
- <option value="Kuwait">Kuwait</option>
414
- <option value="Kyrgyzstan">Kyrgyzstan</option>
415
- <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
416
- <option value="Latvia">Latvia</option>
417
- <option value="Lebanon">Lebanon</option>
418
- <option value="Lesotho">Lesotho</option>
419
- <option value="Liberia">Liberia</option>
420
- <option value="Libya">Libya</option>
421
- <option value="Liechtenstein">Liechtenstein</option>
422
- <option value="Lithuania">Lithuania</option>
423
- <option value="Luxembourg">Luxembourg</option>
424
- <option value="Macao">Macao</option>
425
- <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
426
- <option value="Madagascar">Madagascar</option>
427
- <option value="Malawi">Malawi</option>
428
- <option value="Malaysia">Malaysia</option>
429
- <option value="Maldives">Maldives</option>
430
- <option value="Mali">Mali</option>
431
- <option value="Malta">Malta</option>
432
- <option value="Marshall Islands">Marshall Islands</option>
433
- <option value="Martinique">Martinique</option>
434
- <option value="Mauritania">Mauritania</option>
435
- <option value="Mauritius">Mauritius</option>
436
- <option value="Mayotte">Mayotte</option>
437
- <option value="Mexico">Mexico</option>
438
- <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
439
- <option value="Moldova, Republic of">Moldova, Republic of</option>
440
- <option value="Monaco">Monaco</option>
441
- <option value="Mongolia">Mongolia</option>
442
- <option value="Montenegro">Montenegro</option>
443
- <option value="Montserrat">Montserrat</option>
444
- <option value="Morocco">Morocco</option>
445
- <option value="Mozambique">Mozambique</option>
446
- <option value="Myanmar">Myanmar</option>
447
- <option value="Namibia">Namibia</option>
448
- <option value="Nauru">Nauru</option>
449
- <option value="Nepal">Nepal</option>
450
- <option value="Netherlands">Netherlands</option>
451
- <option value="New Caledonia">New Caledonia</option>
452
- <option value="New Zealand">New Zealand</option>
453
- <option value="Nicaragua">Nicaragua</option>
454
- <option value="Niger">Niger</option>
455
- <option value="Nigeria">Nigeria</option>
456
- <option value="Niue">Niue</option>
457
- <option value="Norfolk Island">Norfolk Island</option>
458
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
459
- <option value="Norway">Norway</option>
460
- <option value="Oman">Oman</option>
461
- <option value="Pakistan">Pakistan</option>
462
- <option value="Palau">Palau</option>
463
- <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
464
- <option value="Panama">Panama</option>
465
- <option value="Papua New Guinea">Papua New Guinea</option>
466
- <option value="Paraguay">Paraguay</option>
467
- <option value="Peru">Peru</option>
468
- <option value="Philippines">Philippines</option>
469
- <option value="Pitcairn">Pitcairn</option>
470
- <option value="Poland">Poland</option>
471
- <option value="Portugal">Portugal</option>
472
- <option value="Puerto Rico">Puerto Rico</option>
473
- <option value="Qatar">Qatar</option>
474
- <option value="Reunion">Reunion</option>
475
- <option value="Romania">Romania</option>
476
- <option value="Russian Federation">Russian Federation</option>
477
- <option value="Rwanda">Rwanda</option>
478
- <option value="Saint Barthelemy">Saint Barthelemy</option>
479
- <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
480
- <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
481
- <option value="Saint Lucia">Saint Lucia</option>
482
- <option value="Saint Martin (French part)">Saint Martin (French part)</option>
483
- <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
484
- <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
485
- <option value="Samoa">Samoa</option>
486
- <option value="San Marino">San Marino</option>
487
- <option value="Sao Tome and Principe">Sao Tome and Principe</option>
488
- <option value="Saudi Arabia">Saudi Arabia</option>
489
- <option value="Senegal">Senegal</option>
490
- <option value="Serbia">Serbia</option>
491
- <option value="Seychelles">Seychelles</option>
492
- <option value="Sierra Leone">Sierra Leone</option>
493
- <option value="Singapore">Singapore</option>
494
- <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
495
- <option value="Slovakia">Slovakia</option>
496
- <option value="Slovenia">Slovenia</option>
497
- <option value="Solomon Islands">Solomon Islands</option>
498
- <option value="Somalia">Somalia</option>
499
- <option value="South Africa">South Africa</option>
500
- <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
501
- <option value="South Sudan">South Sudan</option>
502
- <option value="Spain">Spain</option>
503
- <option value="Sri Lanka">Sri Lanka</option>
504
- <option value="Sudan">Sudan</option>
505
- <option value="Suriname">Suriname</option>
506
- <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
507
- <option value="Swaziland">Swaziland</option>
508
- <option value="Sweden">Sweden</option>
509
- <option value="Switzerland">Switzerland</option>
510
- <option value="Syrian Arab Republic">Syrian Arab Republic</option>
511
- <option value="Taiwan, Province of China">Taiwan, Province of China</option>
512
- <option value="Tajikistan">Tajikistan</option>
513
- <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
514
- <option value="Thailand">Thailand</option>
515
- <option value="Timor-leste">Timor-leste</option>
516
- <option value="Togo">Togo</option>
517
- <option value="Tokelau">Tokelau</option>
518
- <option value="Tonga">Tonga</option>
519
- <option value="Trinidad and Tobago">Trinidad and Tobago</option>
520
- <option value="Tunisia">Tunisia</option>
521
- <option value="Turkey">Turkey</option>
522
- <option value="Turkmenistan">Turkmenistan</option>
523
- <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
524
- <option value="Tuvalu">Tuvalu</option>
525
- <option value="Uganda">Uganda</option>
526
- <option value="Ukraine">Ukraine</option>
527
- <option value="United Arab Emirates">United Arab Emirates</option>
528
- <option value="United Kingdom">United Kingdom</option>
529
- <option value="United States">United States</option>
530
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
531
- <option value="Uruguay">Uruguay</option>
532
- <option value="Uzbekistan">Uzbekistan</option>
533
- <option value="Vanuatu">Vanuatu</option>
534
- <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
535
- <option value="Viet Nam">Viet Nam</option>
536
- <option value="Virgin Islands, British">Virgin Islands, British</option>
537
- <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
538
- <option value="Wallis and Futuna">Wallis and Futuna</option>
539
- <option value="Western Sahara">Western Sahara</option>
540
- <option value="Yemen">Yemen</option>
541
- <option value="Zambia">Zambia</option>
542
- <option value="Zimbabwe">Zimbabwe</option>
543
- </select>
544
- </div>
545
- </div>
546
-
547
- <h2><a name="multiple-select" class="anchor" href="#multiple-select">Multiple Select</a></h2>
548
- <div class="side-by-side clearfix">
549
- <div>
550
- <em>Turns This</em>
551
- <select data-placeholder="Choose a Country..." class="select" multiple tabindex="3">
552
- <option value=""></option>
553
- <option value="United States">United States</option>
554
- <option value="United Kingdom">United Kingdom</option>
555
- <option value="Afghanistan">Afghanistan</option>
556
- <option value="Aland Islands">Aland Islands</option>
557
- <option value="Albania">Albania</option>
558
- <option value="Algeria">Algeria</option>
559
- <option value="American Samoa">American Samoa</option>
560
- <option value="Andorra">Andorra</option>
561
- <option value="Angola">Angola</option>
562
- <option value="Anguilla">Anguilla</option>
563
- <option value="Antarctica">Antarctica</option>
564
- <option value="Antigua and Barbuda">Antigua and Barbuda</option>
565
- <option value="Argentina">Argentina</option>
566
- <option value="Armenia">Armenia</option>
567
- <option value="Aruba">Aruba</option>
568
- <option value="Australia">Australia</option>
569
- <option value="Austria">Austria</option>
570
- <option value="Azerbaijan">Azerbaijan</option>
571
- <option value="Bahamas">Bahamas</option>
572
- <option value="Bahrain">Bahrain</option>
573
- <option value="Bangladesh">Bangladesh</option>
574
- <option value="Barbados">Barbados</option>
575
- <option value="Belarus">Belarus</option>
576
- <option value="Belgium">Belgium</option>
577
- <option value="Belize">Belize</option>
578
- <option value="Benin">Benin</option>
579
- <option value="Bermuda">Bermuda</option>
580
- <option value="Bhutan">Bhutan</option>
581
- <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
582
- <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
583
- <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
584
- <option value="Botswana">Botswana</option>
585
- <option value="Bouvet Island">Bouvet Island</option>
586
- <option value="Brazil">Brazil</option>
587
- <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
588
- <option value="Brunei Darussalam">Brunei Darussalam</option>
589
- <option value="Bulgaria">Bulgaria</option>
590
- <option value="Burkina Faso">Burkina Faso</option>
591
- <option value="Burundi">Burundi</option>
592
- <option value="Cambodia">Cambodia</option>
593
- <option value="Cameroon">Cameroon</option>
594
- <option value="Canada">Canada</option>
595
- <option value="Cape Verde">Cape Verde</option>
596
- <option value="Cayman Islands">Cayman Islands</option>
597
- <option value="Central African Republic">Central African Republic</option>
598
- <option value="Chad">Chad</option>
599
- <option value="Chile">Chile</option>
600
- <option value="China">China</option>
601
- <option value="Christmas Island">Christmas Island</option>
602
- <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
603
- <option value="Colombia">Colombia</option>
604
- <option value="Comoros">Comoros</option>
605
- <option value="Congo">Congo</option>
606
- <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
607
- <option value="Cook Islands">Cook Islands</option>
608
- <option value="Costa Rica">Costa Rica</option>
609
- <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
610
- <option value="Croatia">Croatia</option>
611
- <option value="Cuba">Cuba</option>
612
- <option value="Curacao">Curacao</option>
613
- <option value="Cyprus">Cyprus</option>
614
- <option value="Czech Republic">Czech Republic</option>
615
- <option value="Denmark">Denmark</option>
616
- <option value="Djibouti">Djibouti</option>
617
- <option value="Dominica">Dominica</option>
618
- <option value="Dominican Republic">Dominican Republic</option>
619
- <option value="Ecuador">Ecuador</option>
620
- <option value="Egypt">Egypt</option>
621
- <option value="El Salvador">El Salvador</option>
622
- <option value="Equatorial Guinea">Equatorial Guinea</option>
623
- <option value="Eritrea">Eritrea</option>
624
- <option value="Estonia">Estonia</option>
625
- <option value="Ethiopia">Ethiopia</option>
626
- <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
627
- <option value="Faroe Islands">Faroe Islands</option>
628
- <option value="Fiji">Fiji</option>
629
- <option value="Finland">Finland</option>
630
- <option value="France">France</option>
631
- <option value="French Guiana">French Guiana</option>
632
- <option value="French Polynesia">French Polynesia</option>
633
- <option value="French Southern Territories">French Southern Territories</option>
634
- <option value="Gabon">Gabon</option>
635
- <option value="Gambia">Gambia</option>
636
- <option value="Georgia">Georgia</option>
637
- <option value="Germany">Germany</option>
638
- <option value="Ghana">Ghana</option>
639
- <option value="Gibraltar">Gibraltar</option>
640
- <option value="Greece">Greece</option>
641
- <option value="Greenland">Greenland</option>
642
- <option value="Grenada">Grenada</option>
643
- <option value="Guadeloupe">Guadeloupe</option>
644
- <option value="Guam">Guam</option>
645
- <option value="Guatemala">Guatemala</option>
646
- <option value="Guernsey">Guernsey</option>
647
- <option value="Guinea">Guinea</option>
648
- <option value="Guinea-bissau">Guinea-bissau</option>
649
- <option value="Guyana">Guyana</option>
650
- <option value="Haiti">Haiti</option>
651
- <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
652
- <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
653
- <option value="Honduras">Honduras</option>
654
- <option value="Hong Kong">Hong Kong</option>
655
- <option value="Hungary">Hungary</option>
656
- <option value="Iceland">Iceland</option>
657
- <option value="India">India</option>
658
- <option value="Indonesia">Indonesia</option>
659
- <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
660
- <option value="Iraq">Iraq</option>
661
- <option value="Ireland">Ireland</option>
662
- <option value="Isle of Man">Isle of Man</option>
663
- <option value="Israel">Israel</option>
664
- <option value="Italy">Italy</option>
665
- <option value="Jamaica">Jamaica</option>
666
- <option value="Japan">Japan</option>
667
- <option value="Jersey">Jersey</option>
668
- <option value="Jordan">Jordan</option>
669
- <option value="Kazakhstan">Kazakhstan</option>
670
- <option value="Kenya">Kenya</option>
671
- <option value="Kiribati">Kiribati</option>
672
- <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
673
- <option value="Korea, Republic of">Korea, Republic of</option>
674
- <option value="Kuwait">Kuwait</option>
675
- <option value="Kyrgyzstan">Kyrgyzstan</option>
676
- <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
677
- <option value="Latvia">Latvia</option>
678
- <option value="Lebanon">Lebanon</option>
679
- <option value="Lesotho">Lesotho</option>
680
- <option value="Liberia">Liberia</option>
681
- <option value="Libya">Libya</option>
682
- <option value="Liechtenstein">Liechtenstein</option>
683
- <option value="Lithuania">Lithuania</option>
684
- <option value="Luxembourg">Luxembourg</option>
685
- <option value="Macao">Macao</option>
686
- <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
687
- <option value="Madagascar">Madagascar</option>
688
- <option value="Malawi">Malawi</option>
689
- <option value="Malaysia">Malaysia</option>
690
- <option value="Maldives">Maldives</option>
691
- <option value="Mali">Mali</option>
692
- <option value="Malta">Malta</option>
693
- <option value="Marshall Islands">Marshall Islands</option>
694
- <option value="Martinique">Martinique</option>
695
- <option value="Mauritania">Mauritania</option>
696
- <option value="Mauritius">Mauritius</option>
697
- <option value="Mayotte">Mayotte</option>
698
- <option value="Mexico">Mexico</option>
699
- <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
700
- <option value="Moldova, Republic of">Moldova, Republic of</option>
701
- <option value="Monaco">Monaco</option>
702
- <option value="Mongolia">Mongolia</option>
703
- <option value="Montenegro">Montenegro</option>
704
- <option value="Montserrat">Montserrat</option>
705
- <option value="Morocco">Morocco</option>
706
- <option value="Mozambique">Mozambique</option>
707
- <option value="Myanmar">Myanmar</option>
708
- <option value="Namibia">Namibia</option>
709
- <option value="Nauru">Nauru</option>
710
- <option value="Nepal">Nepal</option>
711
- <option value="Netherlands">Netherlands</option>
712
- <option value="New Caledonia">New Caledonia</option>
713
- <option value="New Zealand">New Zealand</option>
714
- <option value="Nicaragua">Nicaragua</option>
715
- <option value="Niger">Niger</option>
716
- <option value="Nigeria">Nigeria</option>
717
- <option value="Niue">Niue</option>
718
- <option value="Norfolk Island">Norfolk Island</option>
719
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
720
- <option value="Norway">Norway</option>
721
- <option value="Oman">Oman</option>
722
- <option value="Pakistan">Pakistan</option>
723
- <option value="Palau">Palau</option>
724
- <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
725
- <option value="Panama">Panama</option>
726
- <option value="Papua New Guinea">Papua New Guinea</option>
727
- <option value="Paraguay">Paraguay</option>
728
- <option value="Peru">Peru</option>
729
- <option value="Philippines">Philippines</option>
730
- <option value="Pitcairn">Pitcairn</option>
731
- <option value="Poland">Poland</option>
732
- <option value="Portugal">Portugal</option>
733
- <option value="Puerto Rico">Puerto Rico</option>
734
- <option value="Qatar">Qatar</option>
735
- <option value="Reunion">Reunion</option>
736
- <option value="Romania">Romania</option>
737
- <option value="Russian Federation">Russian Federation</option>
738
- <option value="Rwanda">Rwanda</option>
739
- <option value="Saint Barthelemy">Saint Barthelemy</option>
740
- <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
741
- <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
742
- <option value="Saint Lucia">Saint Lucia</option>
743
- <option value="Saint Martin (French part)">Saint Martin (French part)</option>
744
- <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
745
- <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
746
- <option value="Samoa">Samoa</option>
747
- <option value="San Marino">San Marino</option>
748
- <option value="Sao Tome and Principe">Sao Tome and Principe</option>
749
- <option value="Saudi Arabia">Saudi Arabia</option>
750
- <option value="Senegal">Senegal</option>
751
- <option value="Serbia">Serbia</option>
752
- <option value="Seychelles">Seychelles</option>
753
- <option value="Sierra Leone">Sierra Leone</option>
754
- <option value="Singapore">Singapore</option>
755
- <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
756
- <option value="Slovakia">Slovakia</option>
757
- <option value="Slovenia">Slovenia</option>
758
- <option value="Solomon Islands">Solomon Islands</option>
759
- <option value="Somalia">Somalia</option>
760
- <option value="South Africa">South Africa</option>
761
- <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
762
- <option value="South Sudan">South Sudan</option>
763
- <option value="Spain">Spain</option>
764
- <option value="Sri Lanka">Sri Lanka</option>
765
- <option value="Sudan">Sudan</option>
766
- <option value="Suriname">Suriname</option>
767
- <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
768
- <option value="Swaziland">Swaziland</option>
769
- <option value="Sweden">Sweden</option>
770
- <option value="Switzerland">Switzerland</option>
771
- <option value="Syrian Arab Republic">Syrian Arab Republic</option>
772
- <option value="Taiwan, Province of China">Taiwan, Province of China</option>
773
- <option value="Tajikistan">Tajikistan</option>
774
- <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
775
- <option value="Thailand">Thailand</option>
776
- <option value="Timor-leste">Timor-leste</option>
777
- <option value="Togo">Togo</option>
778
- <option value="Tokelau">Tokelau</option>
779
- <option value="Tonga">Tonga</option>
780
- <option value="Trinidad and Tobago">Trinidad and Tobago</option>
781
- <option value="Tunisia">Tunisia</option>
782
- <option value="Turkey">Turkey</option>
783
- <option value="Turkmenistan">Turkmenistan</option>
784
- <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
785
- <option value="Tuvalu">Tuvalu</option>
786
- <option value="Uganda">Uganda</option>
787
- <option value="Ukraine">Ukraine</option>
788
- <option value="United Arab Emirates">United Arab Emirates</option>
789
- <option value="United Kingdom">United Kingdom</option>
790
- <option value="United States">United States</option>
791
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
792
- <option value="Uruguay">Uruguay</option>
793
- <option value="Uzbekistan">Uzbekistan</option>
794
- <option value="Vanuatu">Vanuatu</option>
795
- <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
796
- <option value="Viet Nam">Viet Nam</option>
797
- <option value="Virgin Islands, British">Virgin Islands, British</option>
798
- <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
799
- <option value="Wallis and Futuna">Wallis and Futuna</option>
800
- <option value="Western Sahara">Western Sahara</option>
801
- <option value="Yemen">Yemen</option>
802
- <option value="Zambia">Zambia</option>
803
- <option value="Zimbabwe">Zimbabwe</option>
804
- </select>
805
- </div>
806
- <div>
807
- <em>Into This</em>
808
- <select data-placeholder="Choose a Country..." class="chosen-select" multiple tabindex="4">
809
- <option value=""></option>
810
- <option value="United States">United States</option>
811
- <option value="United Kingdom">United Kingdom</option>
812
- <option value="Afghanistan">Afghanistan</option>
813
- <option value="Aland Islands">Aland Islands</option>
814
- <option value="Albania">Albania</option>
815
- <option value="Algeria">Algeria</option>
816
- <option value="American Samoa">American Samoa</option>
817
- <option value="Andorra">Andorra</option>
818
- <option value="Angola">Angola</option>
819
- <option value="Anguilla">Anguilla</option>
820
- <option value="Antarctica">Antarctica</option>
821
- <option value="Antigua and Barbuda">Antigua and Barbuda</option>
822
- <option value="Argentina">Argentina</option>
823
- <option value="Armenia">Armenia</option>
824
- <option value="Aruba">Aruba</option>
825
- <option value="Australia">Australia</option>
826
- <option value="Austria">Austria</option>
827
- <option value="Azerbaijan">Azerbaijan</option>
828
- <option value="Bahamas">Bahamas</option>
829
- <option value="Bahrain">Bahrain</option>
830
- <option value="Bangladesh">Bangladesh</option>
831
- <option value="Barbados">Barbados</option>
832
- <option value="Belarus">Belarus</option>
833
- <option value="Belgium">Belgium</option>
834
- <option value="Belize">Belize</option>
835
- <option value="Benin">Benin</option>
836
- <option value="Bermuda">Bermuda</option>
837
- <option value="Bhutan">Bhutan</option>
838
- <option value="Bolivia, Plurinational State of">Bolivia, Plurinational State of</option>
839
- <option value="Bonaire, Sint Eustatius and Saba">Bonaire, Sint Eustatius and Saba</option>
840
- <option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
841
- <option value="Botswana">Botswana</option>
842
- <option value="Bouvet Island">Bouvet Island</option>
843
- <option value="Brazil">Brazil</option>
844
- <option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
845
- <option value="Brunei Darussalam">Brunei Darussalam</option>
846
- <option value="Bulgaria">Bulgaria</option>
847
- <option value="Burkina Faso">Burkina Faso</option>
848
- <option value="Burundi">Burundi</option>
849
- <option value="Cambodia">Cambodia</option>
850
- <option value="Cameroon">Cameroon</option>
851
- <option value="Canada">Canada</option>
852
- <option value="Cape Verde">Cape Verde</option>
853
- <option value="Cayman Islands">Cayman Islands</option>
854
- <option value="Central African Republic">Central African Republic</option>
855
- <option value="Chad">Chad</option>
856
- <option value="Chile">Chile</option>
857
- <option value="China">China</option>
858
- <option value="Christmas Island">Christmas Island</option>
859
- <option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
860
- <option value="Colombia">Colombia</option>
861
- <option value="Comoros">Comoros</option>
862
- <option value="Congo">Congo</option>
863
- <option value="Congo, The Democratic Republic of The">Congo, The Democratic Republic of The</option>
864
- <option value="Cook Islands">Cook Islands</option>
865
- <option value="Costa Rica">Costa Rica</option>
866
- <option value="Cote D&apos;ivoire">Cote D'ivoire</option>
867
- <option value="Croatia">Croatia</option>
868
- <option value="Cuba">Cuba</option>
869
- <option value="Curacao">Curacao</option>
870
- <option value="Cyprus">Cyprus</option>
871
- <option value="Czech Republic">Czech Republic</option>
872
- <option value="Denmark">Denmark</option>
873
- <option value="Djibouti">Djibouti</option>
874
- <option value="Dominica">Dominica</option>
875
- <option value="Dominican Republic">Dominican Republic</option>
876
- <option value="Ecuador">Ecuador</option>
877
- <option value="Egypt">Egypt</option>
878
- <option value="El Salvador">El Salvador</option>
879
- <option value="Equatorial Guinea">Equatorial Guinea</option>
880
- <option value="Eritrea">Eritrea</option>
881
- <option value="Estonia">Estonia</option>
882
- <option value="Ethiopia">Ethiopia</option>
883
- <option value="Falkland Islands (Malvinas)">Falkland Islands (Malvinas)</option>
884
- <option value="Faroe Islands">Faroe Islands</option>
885
- <option value="Fiji">Fiji</option>
886
- <option value="Finland">Finland</option>
887
- <option value="France">France</option>
888
- <option value="French Guiana">French Guiana</option>
889
- <option value="French Polynesia">French Polynesia</option>
890
- <option value="French Southern Territories">French Southern Territories</option>
891
- <option value="Gabon">Gabon</option>
892
- <option value="Gambia">Gambia</option>
893
- <option value="Georgia">Georgia</option>
894
- <option value="Germany">Germany</option>
895
- <option value="Ghana">Ghana</option>
896
- <option value="Gibraltar">Gibraltar</option>
897
- <option value="Greece">Greece</option>
898
- <option value="Greenland">Greenland</option>
899
- <option value="Grenada">Grenada</option>
900
- <option value="Guadeloupe">Guadeloupe</option>
901
- <option value="Guam">Guam</option>
902
- <option value="Guatemala">Guatemala</option>
903
- <option value="Guernsey">Guernsey</option>
904
- <option value="Guinea">Guinea</option>
905
- <option value="Guinea-bissau">Guinea-bissau</option>
906
- <option value="Guyana">Guyana</option>
907
- <option value="Haiti">Haiti</option>
908
- <option value="Heard Island and Mcdonald Islands">Heard Island and Mcdonald Islands</option>
909
- <option value="Holy See (Vatican City State)">Holy See (Vatican City State)</option>
910
- <option value="Honduras">Honduras</option>
911
- <option value="Hong Kong">Hong Kong</option>
912
- <option value="Hungary">Hungary</option>
913
- <option value="Iceland">Iceland</option>
914
- <option value="India">India</option>
915
- <option value="Indonesia">Indonesia</option>
916
- <option value="Iran, Islamic Republic of">Iran, Islamic Republic of</option>
917
- <option value="Iraq">Iraq</option>
918
- <option value="Ireland">Ireland</option>
919
- <option value="Isle of Man">Isle of Man</option>
920
- <option value="Israel">Israel</option>
921
- <option value="Italy">Italy</option>
922
- <option value="Jamaica">Jamaica</option>
923
- <option value="Japan">Japan</option>
924
- <option value="Jersey">Jersey</option>
925
- <option value="Jordan">Jordan</option>
926
- <option value="Kazakhstan">Kazakhstan</option>
927
- <option value="Kenya">Kenya</option>
928
- <option value="Kiribati">Kiribati</option>
929
- <option value="Korea, Democratic People&apos;s Republic of">Korea, Democratic People's Republic of</option>
930
- <option value="Korea, Republic of">Korea, Republic of</option>
931
- <option value="Kuwait">Kuwait</option>
932
- <option value="Kyrgyzstan">Kyrgyzstan</option>
933
- <option value="Lao People&apos;s Democratic Republic">Lao People's Democratic Republic</option>
934
- <option value="Latvia">Latvia</option>
935
- <option value="Lebanon">Lebanon</option>
936
- <option value="Lesotho">Lesotho</option>
937
- <option value="Liberia">Liberia</option>
938
- <option value="Libya">Libya</option>
939
- <option value="Liechtenstein">Liechtenstein</option>
940
- <option value="Lithuania">Lithuania</option>
941
- <option value="Luxembourg">Luxembourg</option>
942
- <option value="Macao">Macao</option>
943
- <option value="Macedonia, The Former Yugoslav Republic of">Macedonia, The Former Yugoslav Republic of</option>
944
- <option value="Madagascar">Madagascar</option>
945
- <option value="Malawi">Malawi</option>
946
- <option value="Malaysia">Malaysia</option>
947
- <option value="Maldives">Maldives</option>
948
- <option value="Mali">Mali</option>
949
- <option value="Malta">Malta</option>
950
- <option value="Marshall Islands">Marshall Islands</option>
951
- <option value="Martinique">Martinique</option>
952
- <option value="Mauritania">Mauritania</option>
953
- <option value="Mauritius">Mauritius</option>
954
- <option value="Mayotte">Mayotte</option>
955
- <option value="Mexico">Mexico</option>
956
- <option value="Micronesia, Federated States of">Micronesia, Federated States of</option>
957
- <option value="Moldova, Republic of">Moldova, Republic of</option>
958
- <option value="Monaco">Monaco</option>
959
- <option value="Mongolia">Mongolia</option>
960
- <option value="Montenegro">Montenegro</option>
961
- <option value="Montserrat">Montserrat</option>
962
- <option value="Morocco">Morocco</option>
963
- <option value="Mozambique">Mozambique</option>
964
- <option value="Myanmar">Myanmar</option>
965
- <option value="Namibia">Namibia</option>
966
- <option value="Nauru">Nauru</option>
967
- <option value="Nepal">Nepal</option>
968
- <option value="Netherlands">Netherlands</option>
969
- <option value="New Caledonia">New Caledonia</option>
970
- <option value="New Zealand">New Zealand</option>
971
- <option value="Nicaragua">Nicaragua</option>
972
- <option value="Niger">Niger</option>
973
- <option value="Nigeria">Nigeria</option>
974
- <option value="Niue">Niue</option>
975
- <option value="Norfolk Island">Norfolk Island</option>
976
- <option value="Northern Mariana Islands">Northern Mariana Islands</option>
977
- <option value="Norway">Norway</option>
978
- <option value="Oman">Oman</option>
979
- <option value="Pakistan">Pakistan</option>
980
- <option value="Palau">Palau</option>
981
- <option value="Palestinian Territory, Occupied">Palestinian Territory, Occupied</option>
982
- <option value="Panama">Panama</option>
983
- <option value="Papua New Guinea">Papua New Guinea</option>
984
- <option value="Paraguay">Paraguay</option>
985
- <option value="Peru">Peru</option>
986
- <option value="Philippines">Philippines</option>
987
- <option value="Pitcairn">Pitcairn</option>
988
- <option value="Poland">Poland</option>
989
- <option value="Portugal">Portugal</option>
990
- <option value="Puerto Rico">Puerto Rico</option>
991
- <option value="Qatar">Qatar</option>
992
- <option value="Reunion">Reunion</option>
993
- <option value="Romania">Romania</option>
994
- <option value="Russian Federation">Russian Federation</option>
995
- <option value="Rwanda">Rwanda</option>
996
- <option value="Saint Barthelemy">Saint Barthelemy</option>
997
- <option value="Saint Helena, Ascension and Tristan da Cunha">Saint Helena, Ascension and Tristan da Cunha</option>
998
- <option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
999
- <option value="Saint Lucia">Saint Lucia</option>
1000
- <option value="Saint Martin (French part)">Saint Martin (French part)</option>
1001
- <option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
1002
- <option value="Saint Vincent and The Grenadines">Saint Vincent and The Grenadines</option>
1003
- <option value="Samoa">Samoa</option>
1004
- <option value="San Marino">San Marino</option>
1005
- <option value="Sao Tome and Principe">Sao Tome and Principe</option>
1006
- <option value="Saudi Arabia">Saudi Arabia</option>
1007
- <option value="Senegal">Senegal</option>
1008
- <option value="Serbia">Serbia</option>
1009
- <option value="Seychelles">Seychelles</option>
1010
- <option value="Sierra Leone">Sierra Leone</option>
1011
- <option value="Singapore">Singapore</option>
1012
- <option value="Sint Maarten (Dutch part)">Sint Maarten (Dutch part)</option>
1013
- <option value="Slovakia">Slovakia</option>
1014
- <option value="Slovenia">Slovenia</option>
1015
- <option value="Solomon Islands">Solomon Islands</option>
1016
- <option value="Somalia">Somalia</option>
1017
- <option value="South Africa">South Africa</option>
1018
- <option value="South Georgia and The South Sandwich Islands">South Georgia and The South Sandwich Islands</option>
1019
- <option value="South Sudan">South Sudan</option>
1020
- <option value="Spain">Spain</option>
1021
- <option value="Sri Lanka">Sri Lanka</option>
1022
- <option value="Sudan">Sudan</option>
1023
- <option value="Suriname">Suriname</option>
1024
- <option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
1025
- <option value="Swaziland">Swaziland</option>
1026
- <option value="Sweden">Sweden</option>
1027
- <option value="Switzerland">Switzerland</option>
1028
- <option value="Syrian Arab Republic">Syrian Arab Republic</option>
1029
- <option value="Taiwan, Province of China">Taiwan, Province of China</option>
1030
- <option value="Tajikistan">Tajikistan</option>
1031
- <option value="Tanzania, United Republic of">Tanzania, United Republic of</option>
1032
- <option value="Thailand">Thailand</option>
1033
- <option value="Timor-leste">Timor-leste</option>
1034
- <option value="Togo">Togo</option>
1035
- <option value="Tokelau">Tokelau</option>
1036
- <option value="Tonga">Tonga</option>
1037
- <option value="Trinidad and Tobago">Trinidad and Tobago</option>
1038
- <option value="Tunisia">Tunisia</option>
1039
- <option value="Turkey">Turkey</option>
1040
- <option value="Turkmenistan">Turkmenistan</option>
1041
- <option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
1042
- <option value="Tuvalu">Tuvalu</option>
1043
- <option value="Uganda">Uganda</option>
1044
- <option value="Ukraine">Ukraine</option>
1045
- <option value="United Arab Emirates">United Arab Emirates</option>
1046
- <option value="United Kingdom">United Kingdom</option>
1047
- <option value="United States">United States</option>
1048
- <option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
1049
- <option value="Uruguay">Uruguay</option>
1050
- <option value="Uzbekistan">Uzbekistan</option>
1051
- <option value="Vanuatu">Vanuatu</option>
1052
- <option value="Venezuela, Bolivarian Republic of">Venezuela, Bolivarian Republic of</option>
1053
- <option value="Viet Nam">Viet Nam</option>
1054
- <option value="Virgin Islands, British">Virgin Islands, British</option>
1055
- <option value="Virgin Islands, U.S.">Virgin Islands, U.S.</option>
1056
- <option value="Wallis and Futuna">Wallis and Futuna</option>
1057
- <option value="Western Sahara">Western Sahara</option>
1058
- <option value="Yemen">Yemen</option>
1059
- <option value="Zambia">Zambia</option>
1060
- <option value="Zimbabwe">Zimbabwe</option>
1061
- </select>
1062
- </div>
1063
- </div>
1064
-
1065
- <h2><a name="optgroup-support" class="anchor" href="#optgroup-support">&lt;optgroup&gt; Support</a></h2>
1066
- <div class="side-by-side clearfix">
1067
- <div>
1068
- <em>Single Select with Groups</em>
1069
- <select data-placeholder="Your Favorite Football Team" class="chosen-select" tabindex="5">
1070
- <option value=""></option>
1071
- <optgroup label="NFC EAST">
1072
- <option>Dallas Cowboys</option>
1073
- <option>New York Giants</option>
1074
- <option>Philadelphia Eagles</option>
1075
- <option>Washington Redskins</option>
1076
- </optgroup>
1077
- <optgroup label="NFC NORTH">
1078
- <option>Chicago Bears</option>
1079
- <option>Detroit Lions</option>
1080
- <option>Green Bay Packers</option>
1081
- <option>Minnesota Vikings</option>
1082
- </optgroup>
1083
- <optgroup label="NFC SOUTH">
1084
- <option>Atlanta Falcons</option>
1085
- <option>Carolina Panthers</option>
1086
- <option>New Orleans Saints</option>
1087
- <option>Tampa Bay Buccaneers</option>
1088
- </optgroup>
1089
- <optgroup label="NFC WEST">
1090
- <option>Arizona Cardinals</option>
1091
- <option>St. Louis Rams</option>
1092
- <option>San Francisco 49ers</option>
1093
- <option>Seattle Seahawks</option>
1094
- </optgroup>
1095
- <optgroup label="AFC EAST">
1096
- <option>Buffalo Bills</option>
1097
- <option>Miami Dolphins</option>
1098
- <option>New England Patriots</option>
1099
- <option>New York Jets</option>
1100
- </optgroup>
1101
- <optgroup label="AFC NORTH">
1102
- <option>Baltimore Ravens</option>
1103
- <option>Cincinnati Bengals</option>
1104
- <option>Cleveland Browns</option>
1105
- <option>Pittsburgh Steelers</option>
1106
- </optgroup>
1107
- <optgroup label="AFC SOUTH">
1108
- <option>Houston Texans</option>
1109
- <option>Indianapolis Colts</option>
1110
- <option>Jacksonville Jaguars</option>
1111
- <option>Tennessee Titans</option>
1112
- </optgroup>
1113
- <optgroup label="AFC WEST">
1114
- <option>Denver Broncos</option>
1115
- <option>Kansas City Chiefs</option>
1116
- <option>Oakland Raiders</option>
1117
- <option>San Diego Chargers</option>
1118
- </optgroup>
1119
- </select>
1120
- </div>
1121
- <div>
1122
- <em>Multiple Select with Groups</em>
1123
- <select data-placeholder="Your Favorite Football Team" class="chosen-select" multiple tabindex="6">
1124
- <option value=""></option>
1125
- <optgroup label="NFC EAST">
1126
- <option>Dallas Cowboys</option>
1127
- <option>New York Giants</option>
1128
- <option>Philadelphia Eagles</option>
1129
- <option>Washington Redskins</option>
1130
- </optgroup>
1131
- <optgroup label="NFC NORTH">
1132
- <option>Chicago Bears</option>
1133
- <option>Detroit Lions</option>
1134
- <option>Green Bay Packers</option>
1135
- <option>Minnesota Vikings</option>
1136
- </optgroup>
1137
- <optgroup label="NFC SOUTH">
1138
- <option>Atlanta Falcons</option>
1139
- <option>Carolina Panthers</option>
1140
- <option>New Orleans Saints</option>
1141
- <option>Tampa Bay Buccaneers</option>
1142
- </optgroup>
1143
- <optgroup label="NFC WEST">
1144
- <option>Arizona Cardinals</option>
1145
- <option>St. Louis Rams</option>
1146
- <option>San Francisco 49ers</option>
1147
- <option>Seattle Seahawks</option>
1148
- </optgroup>
1149
- <optgroup label="AFC EAST">
1150
- <option>Buffalo Bills</option>
1151
- <option>Miami Dolphins</option>
1152
- <option>New England Patriots</option>
1153
- <option>New York Jets</option>
1154
- </optgroup>
1155
- <optgroup label="AFC NORTH">
1156
- <option>Baltimore Ravens</option>
1157
- <option>Cincinnati Bengals</option>
1158
- <option>Cleveland Browns</option>
1159
- <option>Pittsburgh Steelers</option>
1160
- </optgroup>
1161
- <optgroup label="AFC SOUTH">
1162
- <option>Houston Texans</option>
1163
- <option>Indianapolis Colts</option>
1164
- <option>Jacksonville Jaguars</option>
1165
- <option>Tennessee Titans</option>
1166
- </optgroup>
1167
- <optgroup label="AFC WEST">
1168
- <option>Denver Broncos</option>
1169
- <option>Kansas City Chiefs</option>
1170
- <option>Oakland Raiders</option>
1171
- <option>San Diego Chargers</option>
1172
- </optgroup>
1173
- </select>
1174
- </div>
1175
- </div>
1176
-
1177
- <h2><a name="selected-and-disabled-support" class="anchor" href="#selected-and-disabled-support">Selected and Disabled Support</a></h2>
1178
- <div class="side-by-side clearfix">
1179
- <p>Chosen automatically highlights selected options and removes disabled options.</p>
1180
- <div>
1181
- <em>Single Select</em>
1182
- <select data-placeholder="Your Favorite Type of Bear" class="chosen-select" tabindex="7">
1183
- <option value=""></option>
1184
- <option>American Black Bear</option>
1185
- <option>Asiatic Black Bear</option>
1186
- <option>Brown Bear</option>
1187
- <option>Giant Panda</option>
1188
- <option selected>Sloth Bear</option>
1189
- <option disabled>Sun Bear</option>
1190
- <option>Polar Bear</option>
1191
- <option disabled>Spectacled Bear</option>
1192
- </select>
1193
- </div>
1194
- <div>
1195
- <em>Multiple Select</em>
1196
- <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="8">
1197
- <option value=""></option>
1198
- <option>American Black Bear</option>
1199
- <option>Asiatic Black Bear</option>
1200
- <option>Brown Bear</option>
1201
- <option>Giant Panda</option>
1202
- <option selected>Sloth Bear</option>
1203
- <option disabled>Sun Bear</option>
1204
- <option selected>Polar Bear</option>
1205
- <option disabled>Spectacled Bear</option>
1206
- </select>
1207
- </div>
1208
- </div>
1209
-
1210
- <h2><a name="hide-search-on-single-select" class="anchor" href="#hide-search-on-single-select">Hide Search on Single Select</a></h2>
1211
- <div class="side-by-side clearfix">
1212
- <p>The <code>disable_search_threshold</code> option can be specified to hide the search input on single selects if there are <i>n</i> or fewer options.</p>
1213
- <pre><code class="language-javascript"> new Chosen($("chosen_select_field"),{disable_search_threshold: 10}); </code></pre>
1214
- <p></p>
1215
- <div>
1216
- <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-no-single" tabindex="9">
1217
- <option value=""></option>
1218
- <option>American Black Bear</option>
1219
- <option>Asiatic Black Bear</option>
1220
- <option>Brown Bear</option>
1221
- <option>Giant Panda</option>
1222
- <option selected disabled>Sloth Bear</option>
1223
- <option disabled>Sun Bear</option>
1224
- <option selected>Paddington Bear</option>
1225
- <option selected>Polar Bear</option>
1226
- <option disabled>Spectacled Bear</option>
1227
- </select>
1228
- </div>
1229
- </div>
1230
-
1231
- <h2><a name="default-text-support" class="anchor" href="#default-text-support">Default Text Support</a></h2>
1232
- <div class="side-by-side clearfix">
1233
- <p>Chosen automatically sets the default field text ("Choose a country...") by reading the select element's data-placeholder value. If no data-placeholder value is present, it will default to "Select an Option" or "Select Some Options" depending on whether the select is single or multiple. You can change these elements in the plugin js file as you see fit.</p>
1234
- <pre><code class="language-markup">&lt;select <strong>data-placeholder="Choose a country..."</strong> multiple class="chosen-select"&gt;</code></pre>
1235
- <p><strong>Note:</strong> on single selects, the first element is assumed to be selected by the browser. To take advantage of the default text support, you will need to include a blank option as the first element of your select list.</p>
1236
- </div>
1237
-
1238
- <h2><a name="no-results-text-support" class="anchor" href="#no-results-text-support">No Results Text Support</a></h2>
1239
- <div class="side-by-side clearfix">
1240
- <p>Setting the "No results" search text is as easy as passing an option when you create Chosen:</p>
1241
- <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{no_results_text: "Oops, nothing found!"}); </code></pre>
1242
-
1243
- <div>
1244
- <em>Single Select</em>
1245
- <select data-placeholder="Type &apos;C&apos; to view" class="chosen-select-no-results" tabindex="10">
1246
- <option value=""></option>
1247
- <option>American Black Bear</option>
1248
- <option>Asiatic Black Bear</option>
1249
- <option>Brown Bear</option>
1250
- <option>Giant Panda</option>
1251
- <option>Sloth Bear</option>
1252
- <option>Sun Bear</option>
1253
- <option>Polar Bear</option>
1254
- <option>Spectacled Bear</option>
1255
- </select>
1256
- </div>
1257
- <div>
1258
- <em>Multiple Select</em>
1259
- <select data-placeholder="Type &apos;C&apos; to view" multiple class="chosen-select-no-results" tabindex="11">
1260
- <option value=""></option>
1261
- <option>American Black Bear</option>
1262
- <option>Asiatic Black Bear</option>
1263
- <option>Brown Bear</option>
1264
- <option>Giant Panda</option>
1265
- <option>Sloth Bear</option>
1266
- <option>Sun Bear</option>
1267
- <option>Polar Bear</option>
1268
- <option>Spectacled Bear</option>
1269
- </select>
1270
- </div>
1271
- </div>
1272
-
1273
- <h2><a name="limit-selected-options-in-multiselect" class="anchor" href="#limit-selected-options-in-multiselect">Limit Selected Options in Multiselect</a></h2>
1274
- <div class="side-by-side clearfix">
1275
- <p>You can easily limit how many options the user can select:</p>
1276
- <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{max_selected_options: 5}); </code></pre>
1277
- <p>If you try to select another option with limit reached <code>chosen:maxselected</code> event is triggered:</p>
1278
- <pre><code class="language-javascript">$("chosen_select_field").observe("chosen:maxselected", function(evt) { ... }); </code></pre>
1279
- </div>
1280
-
1281
- <h2><a name="allow-deselect-on-single-selects" class="anchor" href="#allow-deselect-on-single-selects">Allow Deselect on Single Selects</a></h2>
1282
- <div class="side-by-side clearfix">
1283
- <p>When a single select box isn't a required field, you can set <code class="language-javascript">allow_single_deselect: true</code> and Chosen will add a UI element for option deselection. This will only work if the first option has blank text.</p>
1284
- <div class="side-by-side clearfix">
1285
- <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-deselect" tabindex="12">
1286
- <option value=""></option>
1287
- <option>American Black Bear</option>
1288
- <option>Asiatic Black Bear</option>
1289
- <option>Brown Bear</option>
1290
- <option>Giant Panda</option>
1291
- <option selected>Sloth Bear</option>
1292
- <option>Sun Bear</option>
1293
- <option>Polar Bear</option>
1294
- <option>Spectacled Bear</option>
1295
- </select>
1296
- </div>
1297
- </div>
1298
-
1299
- <h2><a name="right-to-left-support" class="anchor" href="#right-to-left-support">Right-to-Left Support</a></h2>
1300
- <div class="side-by-side clearfix">
1301
- <p>You can set right-to-left text by setting <code class="language-javascript">rtl: true</code></p>
1302
- <pre><code class="language-javascript"> $(".chosen-select").chosen({rtl: true}); </code></pre>
1303
- <div>
1304
- <em>Single Right-to-Left Select</em>
1305
- <select data-placeholder="Your Favorite Type of Bear" class="chosen-select-rtl" tabindex="13">
1306
- <option value=""></option>
1307
- <option>American Black Bear</option>
1308
- <option>Asiatic Black Bear</option>
1309
- <option>Brown Bear</option>
1310
- <option>Giant Panda</option>
1311
- <option selected>Sloth Bear</option>
1312
- <option>Polar Bear</option>
1313
- </select>
1314
- </div>
1315
- <div>
1316
- <em>Multiple Right-to-Left Select</em>
1317
- <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-rtl" tabindex="14">
1318
- <option value=""></option>
1319
- <option>American Black Bear</option>
1320
- <option>Asiatic Black Bear</option>
1321
- <option>Brown Bear</option>
1322
- <option>Giant Panda</option>
1323
- <option selected>Sloth Bear</option>
1324
- <option selected>Polar Bear</option>
1325
- </select>
1326
- </div>
1327
- </div>
1328
-
1329
- <h2><a name="change-update-events" class="anchor" href="#change-update-events">Observing, Updating, and Destroying Chosen</a></h2>
1330
- <div class="side-by-side clearfix">
1331
- <ul>
1332
- <li>
1333
- <h3>Observing Form Field Changes</h3>
1334
- <p>When working with form fields, you often want to perform some behavior after a value has been selected or deselected. Whenever a user selects a field in Chosen, it triggers a "change" event on the original form field. That lets you do something like this:</p>
1335
- <pre><code class="language-javascript">$("#form_field").chosen().change( &hellip; );</code></pre>
1336
- <p><strong>Note:</strong> Prototype doesn't offer support for triggering standard browser events. <a href="https://github.com/kangax/protolicious/blob/5b56fdafcd7d7662c9d648534225039b2e78e371/event.simulate.js">Event.simulate</a> is required to trigger the change event when using the Prototype version.</p>
1337
- </li>
1338
- <li>
1339
- <h3>Updating Chosen Dynamically</h3>
1340
- <p>If you need to update the options in your select field and want Chosen to pick up the changes, you'll need to trigger the "chosen:updated" event on the field. Chosen will re-build itself based on the updated content.</p>
1341
- <pre><code class="language-javascript">Event.fire($("form_field"), "chosen:updated");</code></pre>
1342
- </li>
1343
- <li>
1344
- <h3>Destroying Chosen</h3>
1345
- <p>To destroy Chosen and revert back to the native select, call <code class="language-javascript">destroy</code> on the Chosen instance:</p>
1346
- <pre><code class="language-javascript">chosen = new Chosen($("form_field"));
1347
-
1348
- // ...later
1349
- chosen.destroy();</code></pre>
1350
- </li>
1351
- </ul>
1352
- </div>
1353
-
1354
- <h2><a name="custom-width-support" class="anchor" href="#custom-width-support">Custom Width Support</a></h2>
1355
- <div class="side-by-side clearfix">
1356
- <p>Using a custom width with Chosen is as easy as passing an option when you create Chosen:</p>
1357
- <pre><code class="language-javascript">new Chosen($("chosen_select_field"),{width: "95%"}); </code></pre>
1358
- <div>
1359
- <em>Single Select</em>
1360
- <select data-placeholder="Your Favorite Types of Bear" class="chosen-select-width" tabindex="15">
1361
- <option value=""></option>
1362
- <option selected>American Black Bear</option>
1363
- <option>Asiatic Black Bear</option>
1364
- <option>Brown Bear</option>
1365
- <option>Giant Panda</option>
1366
- <option>Sloth Bear</option>
1367
- <option>Sun Bear</option>
1368
- <option>Polar Bear</option>
1369
- <option>Spectacled Bear</option>
1370
- </select>
1371
- </div>
1372
- <div>
1373
- <em>Multiple Select</em>
1374
- <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select-width" tabindex="16">
1375
- <option value=""></option>
1376
- <option>American Black Bear</option>
1377
- <option>Asiatic Black Bear</option>
1378
- <option>Brown Bear</option>
1379
- <option selected>Giant Panda</option>
1380
- <option>Sloth Bear</option>
1381
- <option>Sun Bear</option>
1382
- <option>Polar Bear</option>
1383
- <option>Spectacled Bear</option>
1384
- </select>
1385
- </div>
1386
- </div>
1387
-
1388
- <h2><a name="labels-work-too" class="anchor" href="#labels-work-too">Labels work, too</a></h2>
1389
- <div class="side-by-side clearfix">
1390
- <p>Use labels just like you would a standard select</p>
1391
- <p></p>
1392
- <div>
1393
- <em><label for="single-label-example">Click to Highlight Single Select</label></em>
1394
- <select data-placeholder="Your Favorite Types of Bear" class="chosen-select" tabindex="17" id="single-label-example">
1395
- <option value=""></option>
1396
- <option selected>American Black Bear</option>
1397
- <option>Asiatic Black Bear</option>
1398
- <option>Brown Bear</option>
1399
- <option>Giant Panda</option>
1400
- <option>Sloth Bear</option>
1401
- <option>Sun Bear</option>
1402
- <option>Polar Bear</option>
1403
- <option>Spectacled Bear</option>
1404
- </select>
1405
- </div>
1406
- <div>
1407
- <em><label for="multiple-label-example">Click to Highlight Multiple Select</label></em>
1408
- <select data-placeholder="Your Favorite Types of Bear" multiple class="chosen-select" tabindex="18" id="multiple-label-example">
1409
- <option value=""></option>
1410
- <option>American Black Bear</option>
1411
- <option>Asiatic Black Bear</option>
1412
- <option>Brown Bear</option>
1413
- <option selected>Giant Panda</option>
1414
- <option>Sloth Bear</option>
1415
- <option>Sun Bear</option>
1416
- <option>Polar Bear</option>
1417
- <option>Spectacled Bear</option>
1418
- </select>
1419
- </div>
1420
- </div>
1421
-
1422
- <h2><a name="setup" class="anchor" href="#setup">Setup</a></h2>
1423
- <p>Using Chosen is easy as can be.</p>
1424
- <ol>
1425
- <li><a href="https://github.com/harvesthq/chosen/releases">Download</a> the plugin and copy the chosen files to your app.</li>
1426
- <li>Activate the plugin by creating a new instance of Chosen: New Chosen(<em>some_form_field</em>,<em>some_options</em>);</li>
1427
- <li><a href="http://www.youtube.com/watch?feature=player_detailpage&amp;v=UkSPUDpe0U8#t=11s">Disco</a>.</li>
1428
- </ol>
1429
-
1430
- <h2><a name="faqs" class="anchor" href="#faqs">FAQs</a></h2>
1431
- <ul class="faqs">
1432
- <li>
1433
- <h3>Do you have all the available options documented somewhere?</h3>
1434
- <p>Yes! You can find them on <a href="options.html">the options page</a>.</p>
1435
- </li>
1436
- <li>
1437
- <h3>Something doesn't work. Can you fix it?</h3>
1438
- <p>Yes! Please report all issues using the <a href="http://github.com/harvesthq/chosen/issues">GitHub issue tracking tool</a>. Please include the plugin version (jQuery or Prototype), browser and OS. The more information provided, the easier it is to fix a problem.</p>
1439
- </li>
1440
- <li>
1441
- <h3>What browsers are supported?</h3>
1442
- <p>All modern desktop browsers are supported (Firefox, Chrome, Safari and IE9). Legacy support for IE8 is also enabled. Chosen is disabled on iPhone, iPod Touch, and Android mobile devices (<a href="https://github.com/harvesthq/chosen/pull/1388">more information</a>).</p>
1443
- </li>
1444
- </ul>
1445
-
1446
- <h2><a name="credits" class="anchor" href="#credits">Credits</a></h2>
1447
-
1448
- <ul class="credits">
1449
- <li>Concept and development by <a href="http://patrickfiller.com">Patrick Filler</a> for <a href="https://getharvest.com">Harvest</a>.</li>
1450
- <li>Design and CSS by <a href="http://matthewlettini.com">Matthew Lettini</a>.</li>
1451
- <li>Repository maintained by <a href="https://github.com/pfiller">@pfiller</a>, <a href="https://github.com/kenearley">@kenearley</a>, <a href="https://github.com/stof">@stof</a>, <a href="https://github.com/koenpunt">@koenpunt</a>, and <a href="https://github.com/tjschuck">@tjschuck</a>.</li>
1452
- <li>Chosen includes <a href="https://github.com/harvesthq/chosen/contributors">contributions by many fine folks</a>.</li>
1453
- </ul>
1454
-
1455
- <footer>
1456
- &copy; 2011&ndash;2016 <a href="http://www.getharvest.com/">Harvest</a>. Chosen is licensed under the <a href="https://github.com/harvesthq/chosen/blob/master/LICENSE.md">MIT license</a>.
1457
- </footer>
1458
-
1459
- </div>
1460
- </div>
1461
- <script src="https://ajax.googleapis.com/ajax/libs/prototype/1.7.0.0/prototype.js" type="text/javascript"></script>
1462
- <script src="chosen.proto.js" type="text/javascript"></script>
1463
- <script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
1464
- <script src="docsupport/init.proto.js" type="text/javascript" charset="utf-8"></script>
1465
- <div class="oss-bar">
1466
- <ul>
1467
- <li><a class="fork" href="https://github.com/harvesthq/chosen">Fork on Github</a></li>
1468
- <li><a class="harvest" href="http://www.getharvest.com/">Built by Harvest</a></li>
1469
- </ul>
1470
- </div>
1471
- </body>
1472
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/chosen/options.html DELETED
@@ -1,306 +0,0 @@
1
- <!doctype html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="utf-8">
5
- <title>Chosen: A jQuery Plugin by Harvest to Tame Unwieldy Select Boxes</title>
6
- <link rel="stylesheet" href="docsupport/style.css">
7
- <link rel="stylesheet" href="docsupport/prism.css">
8
- <link rel="stylesheet" href="chosen.css">
9
- <style type="text/css" media="all">
10
- /* fix rtl for demo */
11
- .chosen-rtl .chosen-drop { left: -9000px; }
12
- </style>
13
- </head>
14
- <body>
15
- <div id="container">
16
- <div id="content">
17
- <header>
18
- <h1>Chosen <small>(<span id="latest-version">v1.7.0</span>)</small></h1>
19
- </header>
20
- <p>Chosen has a number of options and attributes that allow you to have full control of your select boxes.</p>
21
-
22
- <h2><a name="options" class="anchor" href="#options">Options</a></h2>
23
- <p>The following options are available to pass into Chosen on instantiation.</p>
24
-
25
- <h3>Example:</h3>
26
- <pre>
27
- <code class="language-javascript">$(".my_select_box").chosen({
28
- disable_search_threshold: 10,
29
- no_results_text: "Oops, nothing found!",
30
- width: "95%"
31
- });</code>
32
- </pre>
33
-
34
- <table class="docs-table">
35
- <tr>
36
- <th>Option</th><th>Default</th><th>Description</th>
37
- </tr>
38
- <tr>
39
- <td>allow_single_deselect</td>
40
- <td>false</td>
41
- <td>When set to <code class="language-javascript">true</code> on a single select, Chosen adds a UI element which selects the first element (if it is blank).</td>
42
- </tr>
43
- <tr>
44
- <td>disable_search</td>
45
- <td>false</td>
46
- <td>When set to <code class="language-javascript">true</code>, Chosen will not display the search field (single selects only).</td>
47
- </tr>
48
- <tr>
49
- <td>disable_search_threshold</td>
50
- <td>0</td>
51
- <td>Hide the search input on single selects if there are <i>n</i> or fewer options.</td>
52
- </tr>
53
- <tr>
54
- <td>enable_split_word_search</td>
55
- <td>true</td>
56
- <td>By default, searching will match on any word within an option tag. Set this option to <code class="language-javascript">false</code> if you want to only match on the entire text of an option tag.</td>
57
- </tr>
58
- <tr>
59
- <td>inherit_select_classes</td>
60
- <td>false</td>
61
- <td>When set to <code class="language-javascript">true</code>, Chosen will grab any classes on the original select field and add them to Chosen’s container div.</td>
62
- </tr>
63
- <tr>
64
- <td>max_selected_options</td>
65
- <td>Infinity</td>
66
- <td>Limits how many options the user can select. When the limit is reached, the <code class="language-javascript">chosen:maxselected</code> event is triggered.</td>
67
- </tr>
68
- <tr>
69
- <td>no_results_text</td>
70
- <td>"No results match"</td>
71
- <td>The text to be displayed when no matching results are found. The current search is shown at the end of the text (<i>e.g.</i>,
72
- No results match "Bad Search").</td>
73
- </tr>
74
- <tr>
75
- <td>placeholder_text_multiple</td>
76
- <td>"Select Some Options"</td>
77
- <td>The text to be displayed as a placeholder when no options are selected for a multiple select.</td>
78
- </tr>
79
- <tr>
80
- <td>placeholder_text_single</td>
81
- <td>"Select an Option"</td>
82
- <td>The text to be displayed as a placeholder when no options are selected for a single select.</td>
83
- </tr>
84
- <tr>
85
- <td>search_contains</td>
86
- <td>false</td>
87
- <td>By default, Chosen’s search matches starting at the beginning of a word. Setting this option to <code class="language-javascript">true</code> allows matches starting from anywhere within a word. This is especially useful for options that include a lot of special characters or phrases in ()s and []s.</td>
88
- </tr>
89
- <tr>
90
- <td>single_backstroke_delete</td>
91
- <td>true</td>
92
- <td>By default, pressing delete/backspace on multiple selects will remove a selected choice. When <code class="language-javascript">false</code>, pressing delete/backspace will highlight the last choice, and a second press deselects it.</td>
93
- </tr>
94
- <tr>
95
- <td>width</td>
96
- <td>Original select width.</td>
97
- <td>The width of the Chosen select box. By default, Chosen attempts to match the width of the select box you are replacing. If your select is hidden when Chosen is instantiated, you must specify a width or the select will show up with a width of 0.</td>
98
- </tr>
99
- <tr>
100
- <td>display_disabled_options</td>
101
- <td>true</td>
102
- <td>By default, Chosen includes disabled options in search results with a special styling. Setting this option to false will hide disabled results and exclude them from searches.</td>
103
- </tr>
104
- <tr>
105
- <td>display_selected_options</td>
106
- <td>true</td>
107
- <td>
108
- <p>By default, Chosen includes selected options in search results with a special styling. Setting this option to false will hide selected results and exclude them from searches.</p>
109
- <p><strong>Note:</strong> this is for multiple selects only. In single selects, the selected result will always be displayed.</p>
110
- </td>
111
- </tr>
112
- <tr>
113
- <td>include_group_label_in_selected</td>
114
- <td>false</td>
115
- <td>
116
- <p>By default, Chosen only shows the text of a selected option. Setting this option to <code class="language-javascript">true</code> will show the text and group (if any) of the selected option.</p>
117
- </td>
118
- </tr>
119
- <tr>
120
- <td>max_shown_results</td>
121
- <td>Infinity</td>
122
- <td>
123
- <p>Only show the first (n) matching options in the results. This can be used to increase performance for selects with very many options.</p>
124
- </td>
125
- </tr>
126
- <tr>
127
- <td>case_sensitive_search</td>
128
- <td>false</td>
129
- <td>
130
- <p>By default Chosen's search is case-insensitive. Setting this option to <code class="language-javascript">true</code> makes the search case-sensitive.</p>
131
- </td>
132
- </tr>
133
- <tr>
134
- <td>hide_results_on_select</td>
135
- <td>true</td>
136
- <td>
137
- <p>By default Chosen's results are hidden after a option is selected. Setting this option to <code class="language-javascript">false</code> will keep the results open after selection. This only applies to multiple selects.</p>
138
- </td>
139
- </tr>
140
- <tr>
141
- <td>rtl</td>
142
- <td>false</td>
143
- <td>
144
- <p>Chosen supports right-to-left text in select boxes. Set this option to <code class="language-javascript">true</code> to support right-to-left text options.</p>
145
- <p><strong>Note:</strong> <a href="#classes">the <code class="language-javascript">chosen-rtl</code> class</a> on the select has precedence over this option. However, the classname approach is deprecated and will be removed in future versions of Chosen.</p>
146
- </td>
147
- </tr>
148
- </table>
149
-
150
- <h2><a name="attributes" class="anchor" href="#attributes">Attributes</a></h2>
151
- <p>Certain attributes placed on the select tag or its options can be used to configure Chosen.</p>
152
-
153
- <h3>Example:</h3>
154
-
155
- <pre>
156
- <code class="language-markup">&lt;select class="my_select_box" data-placeholder="Select Your Options"&gt;
157
- &lt;option value="1"&gt;Option 1&lt;/option&gt;
158
- &lt;option value="2" selected&gt;Option 2&lt;/option&gt;
159
- &lt;option value="3" disabled&gt;Option 3&lt;/option&gt;
160
- &lt;/select&gt;</code>
161
- </pre>
162
-
163
- <table class="docs-table">
164
- <tr>
165
- <th>Attribute</th><th>Description</th>
166
- </tr>
167
- <tr>
168
- <td>data-placeholder</td>
169
- <td>
170
- <p>The text to be displayed as a placeholder when no options are selected for a select. Defaults to "Select an Option" for single selects or "Select Some Options" for multiple selects.</p>
171
- <p><strong>Note:</strong>This attribute overrides anything set in the <code class="language-javascript">placeholder_text_multiple</code> or <code class="language-javascript">placeholder_text_single</code> options.</p>
172
- </td>
173
- </tr>
174
- <tr>
175
- <td>multiple</td>
176
- <td>The attribute <code class="language-html">multiple</code> on your select box dictates whether Chosen will render a multiple or single select.</td>
177
- </tr>
178
- <tr>
179
- <td>selected, disabled</td>
180
- <td>Chosen automatically highlights selected options and disables disabled options.</td>
181
- </tr>
182
- </table>
183
-
184
- <h2><a name="classes" class="anchor" href="#classes">Classes</a></h2>
185
- <p>Classes placed on the select tag can be used to configure Chosen.</p>
186
-
187
- <h3>Example:</h3>
188
-
189
- <pre>
190
- <code class="language-markup">&lt;select class="my_select_box chosen-rtl"&gt;
191
- &lt;option value="1"&gt;Option 1&lt;/option&gt;
192
- &lt;option value="2"&gt;Option 2&lt;/option&gt;
193
- &lt;option value="3"&gt;Option 3&lt;/option&gt;
194
- &lt;/select&gt;</code>
195
- </pre>
196
-
197
- <table class="docs-table">
198
- <tr>
199
- <th>Classname</th>
200
- <th>Description</th>
201
- </tr>
202
- <tr>
203
- <td>chosen-rtl</td>
204
- <td>
205
- <p>Chosen supports right-to-left text in select boxes. Add the class <code class="language-html">chosen-rtl</code> to your select tag to support right-to-left text options.</p>
206
- <p><strong>Note:</strong> The <code class="language-html">chosen-rtl</code> class will pass through to the Chosen select even when the <code class="language-javascript">inherit_select_classes</code> option is set to <code class="language-javascript">false</code>.</p>
207
- <p><strong>Note:</strong> This is deprecated in favor of using the <code class="language-javascript">rtl: true</code> option (see the <a href="#options">Options section</a>).
208
- </p></td>
209
- </tr>
210
- </table>
211
-
212
- <h2><a name="triggered-events" class="anchor" href="#triggered-events">Triggered Events</a></h2>
213
- <p>Chosen triggers a number of standard and custom events on the original select field.</p>
214
-
215
- <h3>Example:</h3>
216
-
217
- <pre>
218
- <code class="language-javascript">$('.my_select_box').on('change', function(evt, params) {
219
- do_something(evt, params);
220
- });</code>
221
- </pre>
222
-
223
- <table class="docs-table">
224
- <tr>
225
- <th>Event</th><th>Description</th>
226
- </tr>
227
- <tr>
228
- <td>change</td>
229
- <td>
230
- <p>Chosen triggers the standard DOM event whenever a selection is made (it also sends a <code class="language-javascript">selected</code> or <code class="language-javascript">deselected</code> parameter that tells you which option was changed).</p>
231
- <p><strong>Note:</strong> The selected and deselected parameters are not available for Prototype.</p>
232
- </td>
233
- </tr>
234
- <tr>
235
- <td>chosen:ready</td>
236
- <td>Triggered after Chosen has been fully instantiated.</td>
237
- </tr>
238
- <tr>
239
- <td>chosen:maxselected</td>
240
- <td>Triggered if <code class="language-javascript">max_selected_options</code> is set and that total is broken.</td>
241
- </tr>
242
- <tr>
243
- <td>chosen:showing_dropdown</td>
244
- <td>Triggered when Chosen’s dropdown is opened.</td>
245
- </tr>
246
- <tr>
247
- <td>chosen:hiding_dropdown</td>
248
- <td>Triggered when Chosen’s dropdown is closed.</td>
249
- </tr>
250
- <tr>
251
- <td>chosen:no_results</td>
252
- <td>Triggered when a search returns no matching results.</td>
253
- </tr>
254
- </table>
255
-
256
- <p>
257
- <strong>Note:</strong> all custom Chosen events (those that begin with <code class="language-javascript">chosen:</code>) also include the <code class="language-javascript">chosen</code> object as a parameter.
258
- </p>
259
-
260
- <h2><a name="triggerable-events" class="anchor" href="#triggerable-events">Triggerable Events</a></h2>
261
- <p>You can trigger several events on the original select field to invoke a behavior in Chosen.</p>
262
-
263
- <h3>Example:</h3>
264
-
265
- <pre>
266
- <code class="language-javascript">// tell Chosen that a select has changed
267
- $('.my_select_box').trigger('chosen:updated');</code>
268
- </pre>
269
-
270
- <table class="docs-table">
271
- <tr>
272
- <th>Event</th><th>Description</th>
273
- </tr>
274
- <tr>
275
- <td>chosen:updated</td>
276
- <td>This event should be triggered whenever Chosen’s underlying select element changes (such as a change in selected options).</td>
277
- </tr>
278
- <tr>
279
- <td>chosen:activate</td>
280
- <td>This is the equivalant of focusing a standard HTML select field. When activated, Chosen will capure keypress events as if you had clicked the field directly.</td>
281
- </tr>
282
- <tr>
283
- <td>chosen:open</td>
284
- <td>This event activates Chosen and also displays the search results.</td>
285
- </tr>
286
- <tr>
287
- <td>chosen:close</td>
288
- <td>This event deactivates Chosen and hides the search results.</td>
289
- </tr>
290
- </table>
291
-
292
- <footer>
293
- &copy; 2011&ndash;2016 <a href="http://www.getharvest.com/">Harvest</a>. Chosen is licensed under the <a href="https://github.com/harvesthq/chosen/blob/master/LICENSE.md">MIT license</a>.
294
- </footer>
295
-
296
- </div>
297
- </div>
298
- <div class="oss-bar">
299
- <ul>
300
- <li><a class="fork" href="https://github.com/harvesthq/chosen">Fork on Github</a></li>
301
- <li><a class="harvest" href="http://www.getharvest.com/">Built by Harvest</a></li>
302
- </ul>
303
- </div>
304
- <script src="docsupport/prism.js" type="text/javascript" charset="utf-8"></script>
305
- </body>
306
- </html>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/inc/class-ACFFA-Loader-4.php CHANGED
@@ -21,9 +21,11 @@ class ACFFA_Loader_4
21
  public $cdn_filepath = '/css/font-awesome.min.css';
22
  public $override_version = false;
23
  public $current_version = false;
 
24
 
25
  public function init()
26
  {
 
27
  $this->api_endpoint = apply_filters( 'ACFFA_api_endpoint', $this->api_endpoint );
28
  $this->cdn_baseurl = apply_filters( 'ACFFA_cdn_baseurl', $this->cdn_baseurl );
29
  $this->cdn_filepath = apply_filters( 'ACFFA_cdn_filepath', $this->cdn_filepath );
@@ -70,12 +72,28 @@ class ACFFA_Loader_4
70
  $results = array();
71
  $s = null;
72
 
 
 
 
 
 
73
  if ( $options['s'] !== '' ) {
74
  $s = strval( $options['s'] );
75
  $s = wp_unslash( $s );
76
  }
77
 
78
- $fa_icons = apply_filters( 'ACFFA_get_icons', array() );
 
 
 
 
 
 
 
 
 
 
 
79
 
80
  if ( $fa_icons ) {
81
  foreach( $fa_icons['list'] as $k => $v ) {
@@ -174,6 +192,8 @@ class ACFFA_Loader_4
174
  update_option( 'ACFFA_icon_data', $fa_icons, false );
175
  }
176
  }
 
 
177
  }
178
  }
179
 
21
  public $cdn_filepath = '/css/font-awesome.min.css';
22
  public $override_version = false;
23
  public $current_version = false;
24
+ private $version;
25
 
26
  public function init()
27
  {
28
+ $this->version = 'v' . ACFFA_MAJOR_VERSION;
29
  $this->api_endpoint = apply_filters( 'ACFFA_api_endpoint', $this->api_endpoint );
30
  $this->cdn_baseurl = apply_filters( 'ACFFA_cdn_baseurl', $this->cdn_baseurl );
31
  $this->cdn_filepath = apply_filters( 'ACFFA_cdn_filepath', $this->cdn_filepath );
72
  $results = array();
73
  $s = null;
74
 
75
+ if ( 'default_value' != $options['field_key'] ) {
76
+ $field = acf_get_field( $options['field_key'] );
77
+ if ( ! $field ) return false;
78
+ }
79
+
80
  if ( $options['s'] !== '' ) {
81
  $s = strval( $options['s'] );
82
  $s = wp_unslash( $s );
83
  }
84
 
85
+ if ( isset( $field['icon_sets'] ) // Make sure we have an icon set
86
+ && in_array( 'custom', $field['icon_sets'] ) // Make sure that icon set is 'custom'
87
+ && isset( $field['custom_icon_set'] ) // Make sure a custom set has been chosen
88
+ && stristr( $field['custom_icon_set'], 'ACFFA_custom_icon_list_' . $this->version ) // Make sure that chosen custom set matches this version of FontAwesome
89
+ && $custom_icon_set = get_option( $field['custom_icon_set'] ) // Make sure we can retrieve the icon set from the DB/cache
90
+ ) {
91
+ $fa_icons = array(
92
+ 'list' => $custom_icon_set
93
+ );
94
+ } else {
95
+ $fa_icons = apply_filters( 'ACFFA_get_icons', array() );
96
+ }
97
 
98
  if ( $fa_icons ) {
99
  foreach( $fa_icons['list'] as $k => $v ) {
192
  update_option( 'ACFFA_icon_data', $fa_icons, false );
193
  }
194
  }
195
+ } else {
196
+ update_option( 'ACFFA_cdn_error', true );
197
  }
198
  }
199
 
assets/inc/class-ACFFA-Loader-5.php CHANGED
@@ -29,9 +29,11 @@ class ACFFA_Loader_5
29
  private $current_version = false;
30
  private $pro_icons_enabled = false;
31
  private $active_icon_set = false;
 
32
 
33
  public function init()
34
  {
 
35
  $acffa_settings = get_option( 'acffa_settings' );
36
  $this->pro_icons_enabled = isset( $acffa_settings['acffa_pro_cdn'] ) ? true : false;
37
 
@@ -89,21 +91,41 @@ class ACFFA_Loader_5
89
  'post_id' => 0,
90
  's' => '',
91
  'field_key' => '',
92
- 'paged' => 1
93
  ));
94
 
95
  $results = array();
96
  $s = null;
97
 
 
 
 
 
 
98
  if ( $options['s'] !== '' ) {
99
  $s = strval( $options['s'] );
100
  $s = wp_unslash( $s );
101
  }
102
 
103
- $fa_icons = apply_filters( 'ACFFA_get_icons', array() );
 
 
 
 
 
 
 
 
 
 
 
104
 
105
  if ( $fa_icons ) {
106
  foreach ( $fa_icons['list'] as $prefix => $icons ) {
 
 
 
 
107
  $prefix_icons = array();
108
  foreach( $icons as $k => $v ) {
109
 
@@ -190,7 +212,7 @@ class ACFFA_Loader_5
190
  $fa_icons = get_option( 'ACFFA_icon_data' );
191
 
192
  if ( empty( $fa_icons ) || ! isset( $fa_icons[ $this->current_version ] ) || ! $this->active_icon_set || ( $this->pro_icons_enabled && 'pro' !== $this->active_icon_set ) || ( ! $this->pro_icons_enabled && 'free' !== $this->active_icon_set ) ) {
193
- $remote_get = wp_remote_get( $this->manifest_url );
194
 
195
  if ( ! is_wp_error( $remote_get ) && isset( $remote_get['response']['code'] ) && '200' == $remote_get['response']['code'] ) {
196
  $response = wp_remote_retrieve_body( $remote_get );
@@ -209,13 +231,13 @@ class ACFFA_Loader_5
209
 
210
  $active_set = ( $this->pro_icons_enabled ) ? 'pro' : 'free';
211
 
212
- update_option( 'ACFFA_icon_data', $fa_icons, true );
213
- update_option( 'ACFFA_active_icon_set', $active_set, true );
214
  }
215
  }
216
  }
217
  } else {
218
- // There was an error getting the icons, maybe CDN not enabled for Pro? Or CDN down?
219
  }
220
  }
221
 
29
  private $current_version = false;
30
  private $pro_icons_enabled = false;
31
  private $active_icon_set = false;
32
+ private $version;
33
 
34
  public function init()
35
  {
36
+ $this->version = 'v' . ACFFA_MAJOR_VERSION;
37
  $acffa_settings = get_option( 'acffa_settings' );
38
  $this->pro_icons_enabled = isset( $acffa_settings['acffa_pro_cdn'] ) ? true : false;
39
 
91
  'post_id' => 0,
92
  's' => '',
93
  'field_key' => '',
94
+ 'paged' => 0
95
  ));
96
 
97
  $results = array();
98
  $s = null;
99
 
100
+ if ( 'default_value' != $options['field_key'] ) {
101
+ $field = acf_get_field( $options['field_key'] );
102
+ if ( ! $field ) return false;
103
+ }
104
+
105
  if ( $options['s'] !== '' ) {
106
  $s = strval( $options['s'] );
107
  $s = wp_unslash( $s );
108
  }
109
 
110
+ if ( isset( $field['icon_sets'] ) // Make sure we have an icon set
111
+ && in_array( 'custom', $field['icon_sets'] ) // Make sure that icon set is 'custom'
112
+ && isset( $field['custom_icon_set'] ) // Make sure a custom set has been chosen
113
+ && stristr( $field['custom_icon_set'], 'ACFFA_custom_icon_list_' . $this->version ) // Make sure that chosen custom set matches this version of FontAwesome
114
+ && $custom_icon_set = get_option( $field['custom_icon_set'] ) // Make sure we can retrieve the icon set from the DB/cache
115
+ ) {
116
+ $fa_icons = array(
117
+ 'list' => $custom_icon_set
118
+ );
119
+ } else {
120
+ $fa_icons = apply_filters( 'ACFFA_get_icons', array() );
121
+ }
122
 
123
  if ( $fa_icons ) {
124
  foreach ( $fa_icons['list'] as $prefix => $icons ) {
125
+ if ( ! empty( $field['icon_sets'] ) && ! in_array( 'custom', $field['icon_sets'] ) && ! in_array( $prefix, $field['icon_sets'] ) ) {
126
+ continue;
127
+ }
128
+
129
  $prefix_icons = array();
130
  foreach( $icons as $k => $v ) {
131
 
212
  $fa_icons = get_option( 'ACFFA_icon_data' );
213
 
214
  if ( empty( $fa_icons ) || ! isset( $fa_icons[ $this->current_version ] ) || ! $this->active_icon_set || ( $this->pro_icons_enabled && 'pro' !== $this->active_icon_set ) || ( ! $this->pro_icons_enabled && 'free' !== $this->active_icon_set ) ) {
215
+ $remote_get = wp_remote_get( $this->manifest_url );
216
 
217
  if ( ! is_wp_error( $remote_get ) && isset( $remote_get['response']['code'] ) && '200' == $remote_get['response']['code'] ) {
218
  $response = wp_remote_retrieve_body( $remote_get );
231
 
232
  $active_set = ( $this->pro_icons_enabled ) ? 'pro' : 'free';
233
 
234
+ update_option( 'ACFFA_icon_data', $fa_icons, false );
235
+ update_option( 'ACFFA_active_icon_set', $active_set, false );
236
  }
237
  }
238
  }
239
  } else {
240
+ update_option( 'ACFFA_cdn_error', true );
241
  }
242
  }
243
 
assets/inc/multi-select/LICENSE.txt ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Copyright (c) 2015 Louis CUNY
2
+
3
+
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
10
+
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
23
+
24
+
25
+
assets/inc/multi-select/jquery.multi-select.js ADDED
@@ -0,0 +1,544 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*
2
+ * MultiSelect v0.9.12
3
+ * Copyright (c) 2012 Louis Cuny
4
+ *
5
+ * This program is free software. It comes without any warranty, to
6
+ * the extent permitted by applicable law. You can redistribute it
7
+ * and/or modify it under the terms of the Do What The Fuck You Want
8
+ * To Public License, Version 2, as published by Sam Hocevar. See
9
+ * http://sam.zoy.org/wtfpl/COPYING for more details.
10
+ */
11
+
12
+ !function ($) {
13
+
14
+ "use strict";
15
+
16
+
17
+ /* MULTISELECT CLASS DEFINITION
18
+ * ====================== */
19
+
20
+ var MultiSelect = function (element, options) {
21
+ this.options = options;
22
+ this.$element = $(element);
23
+ this.$container = $('<div/>', { 'class': "ms-container" });
24
+ this.$selectableContainer = $('<div/>', { 'class': 'ms-selectable' });
25
+ this.$selectionContainer = $('<div/>', { 'class': 'ms-selection' });
26
+ this.$selectableUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
27
+ this.$selectionUl = $('<ul/>', { 'class': "ms-list", 'tabindex' : '-1' });
28
+ this.scrollTo = 0;
29
+ this.elemsSelector = 'li:visible:not(.ms-optgroup-label,.ms-optgroup-container,.'+options.disabledClass+')';
30
+ };
31
+
32
+ MultiSelect.prototype = {
33
+ constructor: MultiSelect,
34
+
35
+ init: function(){
36
+ var that = this,
37
+ ms = this.$element;
38
+
39
+ if (ms.next('.ms-container').length === 0){
40
+ ms.css({ position: 'absolute', left: '-9999px' });
41
+ ms.attr('id', ms.attr('id') ? ms.attr('id') : Math.ceil(Math.random()*1000)+'multiselect');
42
+ this.$container.attr('id', 'ms-'+ms.attr('id'));
43
+ this.$container.addClass(that.options.cssClass);
44
+ ms.find('option').each(function(){
45
+ that.generateLisFromOption(this);
46
+ });
47
+
48
+ this.$selectionUl.find('.ms-optgroup-label').hide();
49
+
50
+ if (that.options.selectableHeader){
51
+ that.$selectableContainer.append(that.options.selectableHeader);
52
+ }
53
+ that.$selectableContainer.append(that.$selectableUl);
54
+ if (that.options.selectableFooter){
55
+ that.$selectableContainer.append(that.options.selectableFooter);
56
+ }
57
+
58
+ if (that.options.selectionHeader){
59
+ that.$selectionContainer.append(that.options.selectionHeader);
60
+ }
61
+ that.$selectionContainer.append(that.$selectionUl);
62
+ if (that.options.selectionFooter){
63
+ that.$selectionContainer.append(that.options.selectionFooter);
64
+ }
65
+
66
+ that.$container.append(that.$selectableContainer);
67
+ that.$container.append(that.$selectionContainer);
68
+ ms.after(that.$container);
69
+
70
+ that.activeMouse(that.$selectableUl);
71
+ that.activeKeyboard(that.$selectableUl);
72
+
73
+ var action = that.options.dblClick ? 'dblclick' : 'click';
74
+
75
+ that.$selectableUl.on(action, '.ms-elem-selectable', function(){
76
+ that.select($(this).data('ms-value'));
77
+ });
78
+ that.$selectionUl.on(action, '.ms-elem-selection', function(){
79
+ that.deselect($(this).data('ms-value'));
80
+ });
81
+
82
+ that.activeMouse(that.$selectionUl);
83
+ that.activeKeyboard(that.$selectionUl);
84
+
85
+ ms.on('focus', function(){
86
+ that.$selectableUl.focus();
87
+ });
88
+ }
89
+
90
+ var selectedValues = ms.find('option:selected').map(function(){ return $(this).val(); }).get();
91
+ that.select(selectedValues, 'init');
92
+
93
+ if (typeof that.options.afterInit === 'function') {
94
+ that.options.afterInit.call(this, this.$container);
95
+ }
96
+ },
97
+
98
+ 'generateLisFromOption' : function(option, index, $container){
99
+ var that = this,
100
+ ms = that.$element,
101
+ attributes = "",
102
+ $option = $(option);
103
+
104
+ for (var cpt = 0; cpt < option.attributes.length; cpt++){
105
+ var attr = option.attributes[cpt];
106
+
107
+ if(attr.name !== 'value' && attr.name !== 'disabled'){
108
+ attributes += attr.name+'="'+attr.value+'" ';
109
+ }
110
+ }
111
+ var selectableLi = $('<li '+attributes+'><span>'+that.escapeHTML($option.text())+'</span></li>'),
112
+ selectedLi = selectableLi.clone(),
113
+ value = $option.val(),
114
+ elementId = that.sanitize(value);
115
+
116
+ selectableLi
117
+ .data('ms-value', value)
118
+ .addClass('ms-elem-selectable')
119
+ .attr('id', elementId+'-selectable');
120
+
121
+ selectedLi
122
+ .data('ms-value', value)
123
+ .addClass('ms-elem-selection')
124
+ .attr('id', elementId+'-selection')
125
+ .hide();
126
+
127
+ if ($option.prop('disabled') || ms.prop('disabled')){
128
+ selectedLi.addClass(that.options.disabledClass);
129
+ selectableLi.addClass(that.options.disabledClass);
130
+ }
131
+
132
+ var $optgroup = $option.parent('optgroup');
133
+
134
+ if ($optgroup.length > 0){
135
+ var optgroupLabel = $optgroup.attr('label'),
136
+ optgroupId = that.sanitize(optgroupLabel),
137
+ $selectableOptgroup = that.$selectableUl.find('#optgroup-selectable-'+optgroupId),
138
+ $selectionOptgroup = that.$selectionUl.find('#optgroup-selection-'+optgroupId);
139
+
140
+ if ($selectableOptgroup.length === 0){
141
+ var optgroupContainerTpl = '<li class="ms-optgroup-container"></li>',
142
+ optgroupTpl = '<ul class="ms-optgroup"><li class="ms-optgroup-label"><span>'+optgroupLabel+'</span></li></ul>';
143
+
144
+ $selectableOptgroup = $(optgroupContainerTpl);
145
+ $selectionOptgroup = $(optgroupContainerTpl);
146
+ $selectableOptgroup.attr('id', 'optgroup-selectable-'+optgroupId);
147
+ $selectionOptgroup.attr('id', 'optgroup-selection-'+optgroupId);
148
+ $selectableOptgroup.append($(optgroupTpl));
149
+ $selectionOptgroup.append($(optgroupTpl));
150
+ if (that.options.selectableOptgroup){
151
+ $selectableOptgroup.find('.ms-optgroup-label').on('click', function(){
152
+ var values = $optgroup.children(':not(:selected, :disabled)').map(function(){ return $(this).val();}).get();
153
+ that.select(values);
154
+ });
155
+ $selectionOptgroup.find('.ms-optgroup-label').on('click', function(){
156
+ var values = $optgroup.children(':selected:not(:disabled)').map(function(){ return $(this).val();}).get();
157
+ that.deselect(values);
158
+ });
159
+ }
160
+ that.$selectableUl.append($selectableOptgroup);
161
+ that.$selectionUl.append($selectionOptgroup);
162
+ }
163
+ index = index === undefined ? $selectableOptgroup.find('ul').children().length : index + 1;
164
+ selectableLi.insertAt(index, $selectableOptgroup.children());
165
+ selectedLi.insertAt(index, $selectionOptgroup.children());
166
+ } else {
167
+ index = index === undefined ? that.$selectableUl.children().length : index;
168
+
169
+ selectableLi.insertAt(index, that.$selectableUl);
170
+ selectedLi.insertAt(index, that.$selectionUl);
171
+ }
172
+ },
173
+
174
+ 'addOption' : function(options){
175
+ var that = this;
176
+
177
+ if (options.value !== undefined && options.value !== null){
178
+ options = [options];
179
+ }
180
+ $.each(options, function(index, option){
181
+ if (option.value !== undefined && option.value !== null &&
182
+ that.$element.find("option[value='"+option.value+"']").length === 0){
183
+ var $option = $('<option value="'+option.value+'">'+option.text+'</option>'),
184
+ $container = option.nested === undefined ? that.$element : $("optgroup[label='"+option.nested+"']"),
185
+ index = parseInt((typeof option.index === 'undefined' ? $container.children().length : option.index));
186
+
187
+ if (option.optionClass) {
188
+ $option.addClass(option.optionClass);
189
+ }
190
+
191
+ if (option.disabled) {
192
+ $option.prop('disabled', true);
193
+ }
194
+
195
+ $option.insertAt(index, $container);
196
+ that.generateLisFromOption($option.get(0), index, option.nested);
197
+ }
198
+ });
199
+ },
200
+
201
+ 'escapeHTML' : function(text){
202
+ return $("<div>").text(text).html();
203
+ },
204
+
205
+ 'activeKeyboard' : function($list){
206
+ var that = this;
207
+
208
+ $list.on('focus', function(){
209
+ $(this).addClass('ms-focus');
210
+ })
211
+ .on('blur', function(){
212
+ $(this).removeClass('ms-focus');
213
+ })
214
+ .on('keydown', function(e){
215
+ switch (e.which) {
216
+ case 40:
217
+ case 38:
218
+ e.preventDefault();
219
+ e.stopPropagation();
220
+ that.moveHighlight($(this), (e.which === 38) ? -1 : 1);
221
+ return;
222
+ case 37:
223
+ case 39:
224
+ e.preventDefault();
225
+ e.stopPropagation();
226
+ that.switchList($list);
227
+ return;
228
+ case 9:
229
+ if(that.$element.is('[tabindex]')){
230
+ e.preventDefault();
231
+ var tabindex = parseInt(that.$element.attr('tabindex'), 10);
232
+ tabindex = (e.shiftKey) ? tabindex-1 : tabindex+1;
233
+ $('[tabindex="'+(tabindex)+'"]').focus();
234
+ return;
235
+ }else{
236
+ if(e.shiftKey){
237
+ that.$element.trigger('focus');
238
+ }
239
+ }
240
+ }
241
+ if($.inArray(e.which, that.options.keySelect) > -1){
242
+ e.preventDefault();
243
+ e.stopPropagation();
244
+ that.selectHighlighted($list);
245
+ return;
246
+ }
247
+ });
248
+ },
249
+
250
+ 'moveHighlight': function($list, direction){
251
+ var $elems = $list.find(this.elemsSelector),
252
+ $currElem = $elems.filter('.ms-hover'),
253
+ $nextElem = null,
254
+ elemHeight = $elems.first().outerHeight(),
255
+ containerHeight = $list.height(),
256
+ containerSelector = '#'+this.$container.prop('id');
257
+
258
+ $elems.removeClass('ms-hover');
259
+ if (direction === 1){ // DOWN
260
+
261
+ $nextElem = $currElem.nextAll(this.elemsSelector).first();
262
+ if ($nextElem.length === 0){
263
+ var $optgroupUl = $currElem.parent();
264
+
265
+ if ($optgroupUl.hasClass('ms-optgroup')){
266
+ var $optgroupLi = $optgroupUl.parent(),
267
+ $nextOptgroupLi = $optgroupLi.next(':visible');
268
+
269
+ if ($nextOptgroupLi.length > 0){
270
+ $nextElem = $nextOptgroupLi.find(this.elemsSelector).first();
271
+ } else {
272
+ $nextElem = $elems.first();
273
+ }
274
+ } else {
275
+ $nextElem = $elems.first();
276
+ }
277
+ }
278
+ } else if (direction === -1){ // UP
279
+
280
+ $nextElem = $currElem.prevAll(this.elemsSelector).first();
281
+ if ($nextElem.length === 0){
282
+ var $optgroupUl = $currElem.parent();
283
+
284
+ if ($optgroupUl.hasClass('ms-optgroup')){
285
+ var $optgroupLi = $optgroupUl.parent(),
286
+ $prevOptgroupLi = $optgroupLi.prev(':visible');
287
+
288
+ if ($prevOptgroupLi.length > 0){
289
+ $nextElem = $prevOptgroupLi.find(this.elemsSelector).last();
290
+ } else {
291
+ $nextElem = $elems.last();
292
+ }
293
+ } else {
294
+ $nextElem = $elems.last();
295
+ }
296
+ }
297
+ }
298
+ if ($nextElem.length > 0){
299
+ $nextElem.addClass('ms-hover');
300
+ var scrollTo = $list.scrollTop() + $nextElem.position().top -
301
+ containerHeight / 2 + elemHeight / 2;
302
+
303
+ $list.scrollTop(scrollTo);
304
+ }
305
+ },
306
+
307
+ 'selectHighlighted' : function($list){
308
+ var $elems = $list.find(this.elemsSelector),
309
+ $highlightedElem = $elems.filter('.ms-hover').first();
310
+
311
+ if ($highlightedElem.length > 0){
312
+ if ($list.parent().hasClass('ms-selectable')){
313
+ this.select($highlightedElem.data('ms-value'));
314
+ } else {
315
+ this.deselect($highlightedElem.data('ms-value'));
316
+ }
317
+ $elems.removeClass('ms-hover');
318
+ }
319
+ },
320
+
321
+ 'switchList' : function($list){
322
+ $list.blur();
323
+ this.$container.find(this.elemsSelector).removeClass('ms-hover');
324
+ if ($list.parent().hasClass('ms-selectable')){
325
+ this.$selectionUl.focus();
326
+ } else {
327
+ this.$selectableUl.focus();
328
+ }
329
+ },
330
+
331
+ 'activeMouse' : function($list){
332
+ var that = this;
333
+
334
+ this.$container.on('mouseenter', that.elemsSelector, function(){
335
+ $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
336
+ $(this).addClass('ms-hover');
337
+ });
338
+
339
+ this.$container.on('mouseleave', that.elemsSelector, function () {
340
+ $(this).parents('.ms-container').find(that.elemsSelector).removeClass('ms-hover');
341
+ });
342
+ },
343
+
344
+ 'refresh' : function() {
345
+ this.destroy();
346
+ this.$element.multiSelect(this.options);
347
+ },
348
+
349
+ 'destroy' : function(){
350
+ $("#ms-"+this.$element.attr("id")).remove();
351
+ this.$element.off('focus');
352
+ this.$element.css('position', '').css('left', '');
353
+ this.$element.removeData('multiselect');
354
+ },
355
+
356
+ 'select' : function(value, method){
357
+ if (typeof value === 'string'){ value = [value]; }
358
+
359
+ var that = this,
360
+ ms = this.$element,
361
+ msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
362
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable').filter(':not(.'+that.options.disabledClass+')'),
363
+ selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection').filter(':not(.'+that.options.disabledClass+')'),
364
+ options = ms.find('option:not(:disabled)').filter(function(){ return($.inArray(this.value, value) > -1); });
365
+
366
+ if (method === 'init'){
367
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
368
+ selections = this.$selectionUl.find('#' + msIds.join('-selection, #') + '-selection');
369
+ }
370
+
371
+ if (selectables.length > 0){
372
+ selectables.addClass('ms-selected').hide();
373
+ selections.addClass('ms-selected').show();
374
+
375
+ options.prop('selected', true);
376
+
377
+ that.$container.find(that.elemsSelector).removeClass('ms-hover');
378
+
379
+ var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
380
+ if (selectableOptgroups.length > 0){
381
+ selectableOptgroups.each(function(){
382
+ var selectablesLi = $(this).find('.ms-elem-selectable');
383
+ if (selectablesLi.length === selectablesLi.filter('.ms-selected').length){
384
+ $(this).find('.ms-optgroup-label').hide();
385
+ }
386
+ });
387
+
388
+ var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
389
+ selectionOptgroups.each(function(){
390
+ var selectionsLi = $(this).find('.ms-elem-selection');
391
+ if (selectionsLi.filter('.ms-selected').length > 0){
392
+ $(this).find('.ms-optgroup-label').show();
393
+ }
394
+ });
395
+ } else {
396
+ if (that.options.keepOrder && method !== 'init'){
397
+ var selectionLiLast = that.$selectionUl.find('.ms-selected');
398
+ if((selectionLiLast.length > 1) && (selectionLiLast.last().get(0) != selections.get(0))) {
399
+ selections.insertAfter(selectionLiLast.last());
400
+ }
401
+ }
402
+ }
403
+ if (method !== 'init'){
404
+ ms.trigger('change');
405
+ if (typeof that.options.afterSelect === 'function') {
406
+ that.options.afterSelect.call(this, value);
407
+ }
408
+ }
409
+ }
410
+ },
411
+
412
+ 'deselect' : function(value){
413
+ if (typeof value === 'string'){ value = [value]; }
414
+
415
+ var that = this,
416
+ ms = this.$element,
417
+ msIds = $.map(value, function(val){ return(that.sanitize(val)); }),
418
+ selectables = this.$selectableUl.find('#' + msIds.join('-selectable, #')+'-selectable'),
419
+ selections = this.$selectionUl.find('#' + msIds.join('-selection, #')+'-selection').filter('.ms-selected').filter(':not(.'+that.options.disabledClass+')'),
420
+ options = ms.find('option').filter(function(){ return($.inArray(this.value, value) > -1); });
421
+
422
+ if (selections.length > 0){
423
+ selectables.removeClass('ms-selected').show();
424
+ selections.removeClass('ms-selected').hide();
425
+ options.prop('selected', false);
426
+
427
+ that.$container.find(that.elemsSelector).removeClass('ms-hover');
428
+
429
+ var selectableOptgroups = that.$selectableUl.children('.ms-optgroup-container');
430
+ if (selectableOptgroups.length > 0){
431
+ selectableOptgroups.each(function(){
432
+ var selectablesLi = $(this).find('.ms-elem-selectable');
433
+ if (selectablesLi.filter(':not(.ms-selected)').length > 0){
434
+ $(this).find('.ms-optgroup-label').show();
435
+ }
436
+ });
437
+
438
+ var selectionOptgroups = that.$selectionUl.children('.ms-optgroup-container');
439
+ selectionOptgroups.each(function(){
440
+ var selectionsLi = $(this).find('.ms-elem-selection');
441
+ if (selectionsLi.filter('.ms-selected').length === 0){
442
+ $(this).find('.ms-optgroup-label').hide();
443
+ }
444
+ });
445
+ }
446
+ ms.trigger('change');
447
+ if (typeof that.options.afterDeselect === 'function') {
448
+ that.options.afterDeselect.call(this, value);
449
+ }
450
+ }
451
+ },
452
+
453
+ 'select_all' : function(){
454
+ var ms = this.$element,
455
+ values = ms.val();
456
+
457
+ ms.find('option:not(":disabled")').prop('selected', true);
458
+ this.$selectableUl.find('.ms-elem-selectable').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').hide();
459
+ this.$selectionUl.find('.ms-optgroup-label').show();
460
+ this.$selectableUl.find('.ms-optgroup-label').hide();
461
+ this.$selectionUl.find('.ms-elem-selection').filter(':not(.'+this.options.disabledClass+')').addClass('ms-selected').show();
462
+ this.$selectionUl.focus();
463
+ ms.trigger('change');
464
+ if (typeof this.options.afterSelect === 'function') {
465
+ var selectedValues = $.grep(ms.val(), function(item){
466
+ return $.inArray(item, values) < 0;
467
+ });
468
+ this.options.afterSelect.call(this, selectedValues);
469
+ }
470
+ },
471
+
472
+ 'deselect_all' : function(){
473
+ var ms = this.$element,
474
+ values = ms.val();
475
+
476
+ ms.find('option').prop('selected', false);
477
+ this.$selectableUl.find('.ms-elem-selectable').removeClass('ms-selected').show();
478
+ this.$selectionUl.find('.ms-optgroup-label').hide();
479
+ this.$selectableUl.find('.ms-optgroup-label').show();
480
+ this.$selectionUl.find('.ms-elem-selection').removeClass('ms-selected').hide();
481
+ this.$selectableUl.focus();
482
+ ms.trigger('change');
483
+ if (typeof this.options.afterDeselect === 'function') {
484
+ this.options.afterDeselect.call(this, values);
485
+ }
486
+ },
487
+
488
+ sanitize: function(value){
489
+ var hash = 0, i, character;
490
+ if (value.length == 0) return hash;
491
+ var ls = 0;
492
+ for (i = 0, ls = value.length; i < ls; i++) {
493
+ character = value.charCodeAt(i);
494
+ hash = ((hash<<5)-hash)+character;
495
+ hash |= 0; // Convert to 32bit integer
496
+ }
497
+ return hash;
498
+ }
499
+ };
500
+
501
+ /* MULTISELECT PLUGIN DEFINITION
502
+ * ======================= */
503
+
504
+ $.fn.multiSelect = function () {
505
+ var option = arguments[0],
506
+ args = arguments;
507
+
508
+ return this.each(function () {
509
+ var $this = $(this),
510
+ data = $this.data('multiselect'),
511
+ options = $.extend({}, $.fn.multiSelect.defaults, $this.data(), typeof option === 'object' && option);
512
+
513
+ if (!data){ $this.data('multiselect', (data = new MultiSelect(this, options))); }
514
+
515
+ if (typeof option === 'string'){
516
+ data[option](args[1]);
517
+ } else {
518
+ data.init();
519
+ }
520
+ });
521
+ };
522
+
523
+ $.fn.multiSelect.defaults = {
524
+ keySelect: [32],
525
+ selectableOptgroup: false,
526
+ disabledClass : 'disabled',
527
+ dblClick : false,
528
+ keepOrder: false,
529
+ cssClass: ''
530
+ };
531
+
532
+ $.fn.multiSelect.Constructor = MultiSelect;
533
+
534
+ $.fn.insertAt = function(index, $parent) {
535
+ return this.each(function() {
536
+ if (index === 0) {
537
+ $parent.prepend(this);
538
+ } else {
539
+ $parent.children().eq(index - 1).after(this);
540
+ }
541
+ });
542
+ };
543
+
544
+ }(window.jQuery);
assets/inc/multi-select/multi-select.css ADDED
@@ -0,0 +1,114 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .ms-container{
2
+ background: transparent url('switch.png') no-repeat 50% 50%;
3
+ width: 370px;
4
+ }
5
+
6
+ .ms-container:after{
7
+ content: ".";
8
+ display: block;
9
+ height: 0;
10
+ line-height: 0;
11
+ font-size: 0;
12
+ clear: both;
13
+ min-height: 0;
14
+ visibility: hidden;
15
+ }
16
+
17
+ .ms-container .ms-selectable, .ms-container .ms-selection{
18
+ color: #555555;
19
+ float: left;
20
+ width: 45%;
21
+ }
22
+ .ms-container .ms-selection{
23
+ float: right;
24
+ }
25
+
26
+ .ms-container .ms-list{
27
+ background: #fff;
28
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
29
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
30
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075);
31
+ -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
32
+ -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
33
+ -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
34
+ -o-transition: border linear 0.2s, box-shadow linear 0.2s;
35
+ transition: border linear 0.2s, box-shadow linear 0.2s;
36
+ border: 1px solid #ccc;
37
+ -webkit-border-radius: 3px;
38
+ -moz-border-radius: 3px;
39
+ border-radius: 3px;
40
+ position: relative;
41
+ height: 200px;
42
+ padding: 0;
43
+ overflow-y: auto;
44
+ }
45
+
46
+ .ms-container .ms-list.ms-focus{
47
+ border-color: rgba(82, 168, 236, 0.8);
48
+ -webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
49
+ -moz-box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
50
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 8px rgba(82, 168, 236, 0.6);
51
+ outline: 0;
52
+ outline: thin dotted \9;
53
+ }
54
+
55
+ .ms-container ul{
56
+ margin: 0;
57
+ list-style-type: none;
58
+ padding: 0;
59
+ }
60
+
61
+ .ms-container .ms-optgroup-container{
62
+ width: 100%;
63
+ }
64
+
65
+ .ms-container .ms-optgroup-label{
66
+ margin: 0;
67
+ padding: 5px 0px 0px 5px;
68
+ cursor: pointer;
69
+ color: #999;
70
+ }
71
+
72
+ .ms-container .ms-selectable li.ms-elem-selectable,
73
+ .ms-container .ms-selection li.ms-elem-selection{
74
+ border-bottom: 1px #eee solid;
75
+ padding: 2px 10px;
76
+ color: #555;
77
+ font-size: 14px;
78
+ }
79
+
80
+ .ms-container .ms-selectable li.ms-hover,
81
+ .ms-container .ms-selection li.ms-hover{
82
+ cursor: pointer;
83
+ color: #fff;
84
+ text-decoration: none;
85
+ background-color: #08c;
86
+ }
87
+
88
+ .ms-container .ms-selectable li.disabled,
89
+ .ms-container .ms-selection li.disabled{
90
+ background-color: #eee;
91
+ color: #aaa;
92
+ cursor: text;
93
+ }
94
+
95
+ .icon-builder-complete-changes-notice {
96
+ display: none;
97
+ }
98
+
99
+ .existing-custom-icon-sets .delete-icon-set {
100
+ color: red;
101
+ }
102
+
103
+ .existing-custom-icon-sets .icon-list {
104
+ display: none;
105
+ }
106
+ .existing-custom-icon-sets .icon-set .actions {
107
+ font-size: 12px;
108
+ }
109
+ .existing-custom-icon-sets .icon-list ul {
110
+ margin-left: 15px;
111
+ }
112
+ .existing-custom-icon-sets .icon-list .icon {
113
+ font-family: "Font Awesome 5 Brands", "Font Awesome 5 Free", FontAwesome, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
114
+ }
assets/inc/multi-select/switch.png ADDED
Binary file
assets/inc/quicksearch/README.markdown ADDED
@@ -0,0 +1,161 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ THIS PROJECT IS VERY MUCH DEAD AND NOT MAINTAINED. IT'S BEEN 6+ YEARS SINCE THE LAST UPDATES. DON'T EXPECT THIS TO WORK.
2
+
3
+ # jQuery quicksearch plug-in
4
+
5
+ A [jQuery][jquery_site] based plug-in for filtering large data sets with user input
6
+
7
+ ## Examples
8
+
9
+ * <http://www.lomalogue.com/jquery/quicksearch/>
10
+ * <http://www.lomalogue.com/jquery/quicksearch/super_table.html>
11
+
12
+ ## Usage
13
+
14
+ Note that the usage has changed in the latest version of quicksearch, the code is *not* backwards compatible,
15
+ the form and input are not build by the script any more.
16
+
17
+ $(input_selector).quicksearch(elements_to_search, options);
18
+
19
+ #### Example on table rows
20
+
21
+ /* Example form */
22
+ <form>
23
+ <input type="text" id="search">
24
+ </form>
25
+
26
+ /* Example table */
27
+ <table>
28
+ <tbody>
29
+ <tr>
30
+ <td>Test cell</td>
31
+ <td>Another test cell</td>
32
+ </tr>
33
+ </tbody>
34
+ </table>
35
+
36
+ <script type="text/javascript" src="jquery.js"></script>
37
+ <script type="text/javascript" src="jquery.quicksearch.js"></script>
38
+ <script type="text/javascript">
39
+ $('input#search').quicksearch('table tbody tr');
40
+ </script>
41
+
42
+ #### Example on the `<th>` elements on a table row
43
+
44
+ $('input#search').quicksearch('table tbody tr', {
45
+ selector: 'th'
46
+ });
47
+
48
+ #### Example of how to use with JS
49
+
50
+ var qs = $('input#id_search_list').quicksearch('ul#list_example li');
51
+ $('ul#list_example').append('<li>Loaded with Ajax</li>');
52
+ qs.cache();
53
+
54
+ #### Example of how to use with Ajax
55
+
56
+ var qs = $('input#search').quicksearch('table tbody tr');
57
+ $.ajax({
58
+ 'type': 'GET',
59
+ 'url': 'index.html',
60
+ 'success': function (data) {
61
+ $('table tbody tr').append(data);
62
+ qs.cache();
63
+ }
64
+ });
65
+
66
+ ## Options
67
+
68
+ * #### delay
69
+ Delay of trigger in milliseconds
70
+ * #### selector
71
+ A query selector on sibling elements to test
72
+ * #### stripeRows
73
+ An array of class names to go on each row
74
+ * #### loader
75
+ A query selector to find a loading element
76
+ * #### noResults
77
+ A query selector to show if there's no results for the search
78
+ * #### bind
79
+ Event that the trigger is tied to
80
+ * #### onBefore
81
+ Function to call before trigger is called
82
+ * #### onAfter
83
+ Function to call after trigger is called
84
+ * #### show
85
+ Function that will add styles to matched elements
86
+ * #### hide
87
+ Function that will add styles to unmatched elements
88
+ * #### prepareQuery
89
+ Function that transforms text from input_selector into query used by 'testQuery' function
90
+ * #### testQuery
91
+ Function that tells if a given item should be hidden
92
+ It takes 3 arguments:
93
+ - query prepared by 'prepareQuery'
94
+ - stripped text from 'selector'
95
+ - element to be potentially hidden
96
+
97
+
98
+ For example:
99
+
100
+ $('input#search').quicksearch('table tbody tr', {
101
+ 'delay': 100,
102
+ 'selector': 'th',
103
+ 'stripeRows': ['odd', 'even'],
104
+ 'loader': 'span.loading',
105
+ 'noResults': 'tr#noresults',
106
+ 'bind': 'keyup keydown',
107
+ 'onBefore': function () {
108
+ console.log('on before');
109
+ },
110
+ 'onAfter': function () {
111
+ console.log('on after');
112
+ },
113
+ 'show': function () {
114
+ $(this).addClass('show');
115
+ },
116
+ 'hide': function () {
117
+ $(this).removeClass('show');
118
+ }
119
+ 'prepareQuery': function (val) {
120
+ return new RegExp(val, "i");
121
+ },
122
+ 'testQuery': function (query, txt, _row) {
123
+ return query.test(txt);
124
+ }
125
+ });
126
+
127
+ ## Help make quicksearch better!
128
+
129
+ If you have a bug fix, the best way to help would be to:
130
+
131
+ * Fork the project by clicking "Fork this project" at the top of this page
132
+ * Clone your version of quicksearch from your Github account to your computer
133
+ * Fix and commit the bugs, then push your version to your Github account
134
+ * Click "pull request" at the top of my Github page
135
+
136
+ I can't promise to answer every question about quicksearch,
137
+ but please do [report bugs here][issues] or [send me a message on Github][mail_me].
138
+
139
+ You can [watch quicksearch][github_watch] for updates or [follow me on Github][github_follow]
140
+ and [on Twitter][twitter_follow].
141
+
142
+ ## License
143
+
144
+ Under the same licenses as the jQuery library itself: <http://docs.jquery.com/License>
145
+
146
+ ## Credits
147
+
148
+ jQuery quicksearch is made by [Rik Lomas][rik_site] at [Lomalogue][lomalogue_site]
149
+
150
+ Thanks to [Seth F.][thelizardreborn] for fixes and [Krzysiek Goj][goj] for the testQuery and prepareQuery option updates
151
+
152
+ [jquery_site]: http://www.jquery.com
153
+ [rik_site]: http://www.riklomas.co.uk
154
+ [lomalogue_site]: http://www.lomalogue.com
155
+ [issues]: http://github.com/riklomas/quicksearch/issues
156
+ [mail_me]: http://github.com/inbox/new/riklomas
157
+ [github_watch]: http://github.com/riklomas/quicksearch/toggle_watch
158
+ [github_follow]: http://github.com/users/follow?target=riklomas
159
+ [twitter_follow]: http://twitter.com/riklomas
160
+ [thelizardreborn]: http://github.com/thelizardreborn
161
+ [goj]: http://github.com/goj
assets/inc/quicksearch/jquery.quicksearch.js ADDED
@@ -0,0 +1,181 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($, window, document, undefined) {
2
+ $.fn.quicksearch = function (target, opt) {
3
+
4
+ var timeout, cache, rowcache, jq_results, val = '', e = this, options = $.extend({
5
+ delay: 100,
6
+ selector: null,
7
+ stripeRows: null,
8
+ loader: null,
9
+ noResults: '',
10
+ matchedResultsCount: 0,
11
+ bind: 'keyup',
12
+ onBefore: function () {
13
+ return;
14
+ },
15
+ onAfter: function () {
16
+ return;
17
+ },
18
+ show: function () {
19
+ this.style.display = "";
20
+ },
21
+ hide: function () {
22
+ this.style.display = "none";
23
+ },
24
+ prepareQuery: function (val) {
25
+ return val.toLowerCase().split(' ');
26
+ },
27
+ testQuery: function (query, txt, _row) {
28
+ for (var i = 0; i < query.length; i += 1) {
29
+ if (txt.indexOf(query[i]) === -1) {
30
+ return false;
31
+ }
32
+ }
33
+ return true;
34
+ }
35
+ }, opt);
36
+
37
+ this.go = function () {
38
+
39
+ var i = 0,
40
+ numMatchedRows = 0,
41
+ noresults = true,
42
+ query = options.prepareQuery(val),
43
+ val_empty = (val.replace(' ', '').length === 0);
44
+
45
+ for (var i = 0, len = rowcache.length; i < len; i++) {
46
+ if (val_empty || options.testQuery(query, cache[i], rowcache[i])) {
47
+ options.show.apply(rowcache[i]);
48
+ noresults = false;
49
+ numMatchedRows++;
50
+ } else {
51
+ options.hide.apply(rowcache[i]);
52
+ }
53
+ }
54
+
55
+ if (noresults) {
56
+ this.results(false);
57
+ } else {
58
+ this.results(true);
59
+ this.stripe();
60
+ }
61
+
62
+ this.matchedResultsCount = numMatchedRows;
63
+ this.loader(false);
64
+ options.onAfter();
65
+
66
+ return this;
67
+ };
68
+
69
+ /*
70
+ * External API so that users can perform search programatically.
71
+ * */
72
+ this.search = function (submittedVal) {
73
+ val = submittedVal;
74
+ e.trigger();
75
+ };
76
+
77
+ /*
78
+ * External API to get the number of matched results as seen in
79
+ * https://github.com/ruiz107/quicksearch/commit/f78dc440b42d95ce9caed1d087174dd4359982d6
80
+ * */
81
+ this.currentMatchedResults = function() {
82
+ return this.matchedResultsCount;
83
+ };
84
+
85
+ this.stripe = function () {
86
+
87
+ if (typeof options.stripeRows === "object" && options.stripeRows !== null)
88
+ {
89
+ var joined = options.stripeRows.join(' ');
90
+ var stripeRows_length = options.stripeRows.length;
91
+
92
+ jq_results.not(':hidden').each(function (i) {
93
+ $(this).removeClass(joined).addClass(options.stripeRows[i % stripeRows_length]);
94
+ });
95
+ }
96
+
97
+ return this;
98
+ };
99
+
100
+ this.strip_html = function (input) {
101
+ var output = input.replace(new RegExp('<[^<]+\>', 'g'), "");
102
+ output = $.trim(output.toLowerCase());
103
+ return output;
104
+ };
105
+
106
+ this.results = function (bool) {
107
+ if (typeof options.noResults === "string" && options.noResults !== "") {
108
+ if (bool) {
109
+ $(options.noResults).hide();
110
+ } else {
111
+ $(options.noResults).show();
112
+ }
113
+ }
114
+ return this;
115
+ };
116
+
117
+ this.loader = function (bool) {
118
+ if (typeof options.loader === "string" && options.loader !== "") {
119
+ (bool) ? $(options.loader).show() : $(options.loader).hide();
120
+ }
121
+ return this;
122
+ };
123
+
124
+ this.cache = function () {
125
+
126
+ jq_results = $(target);
127
+
128
+ if (typeof options.noResults === "string" && options.noResults !== "") {
129
+ jq_results = jq_results.not(options.noResults);
130
+ }
131
+
132
+ var t = (typeof options.selector === "string") ? jq_results.find(options.selector) : $(target).not(options.noResults);
133
+ cache = t.map(function () {
134
+ return e.strip_html(this.innerHTML);
135
+ });
136
+
137
+ rowcache = jq_results.map(function () {
138
+ return this;
139
+ });
140
+
141
+ /*
142
+ * Modified fix for sync-ing "val".
143
+ * Original fix https://github.com/michaellwest/quicksearch/commit/4ace4008d079298a01f97f885ba8fa956a9703d1
144
+ * */
145
+ val = val || this.val() || "";
146
+
147
+ return this.go();
148
+ };
149
+
150
+ this.trigger = function () {
151
+ this.loader(true);
152
+ options.onBefore();
153
+
154
+ window.clearTimeout(timeout);
155
+ timeout = window.setTimeout(function () {
156
+ e.go();
157
+ }, options.delay);
158
+
159
+ return this;
160
+ };
161
+
162
+ this.cache();
163
+ this.results(true);
164
+ this.stripe();
165
+ this.loader(false);
166
+
167
+ return this.each(function () {
168
+
169
+ /*
170
+ * Changed from .bind to .on.
171
+ * */
172
+ $(this).on(options.bind, function () {
173
+
174
+ val = $(this).val();
175
+ e.trigger();
176
+ });
177
+ });
178
+
179
+ };
180
+
181
+ }(jQuery, this, document));
assets/inc/spyc/COPYING CHANGED
File without changes
assets/inc/spyc/spyc.php CHANGED
File without changes
assets/js/input-v4.js DELETED
@@ -1,131 +0,0 @@
1
- (function($){
2
-
3
- function update_preview( $select_element, parent ) {
4
- var value = $select_element.val(),
5
- class_prefix = ( ACFFA.major_version >= 5 ) ? '' : 'fa ';
6
-
7
- if ( ! parent ) {
8
- var parent = $select_element.closest('.field');
9
- }
10
-
11
- $( '.icon_preview', parent ).html( '<i class="' + class_prefix + value + '" aria-hidden="true"></i>' );
12
-
13
- $( '.field_option_font-awesome .fa_live_preview', parent ).html( '<i class="' + class_prefix + value + '" aria-hidden="true"></i>' );
14
- }
15
-
16
- function initialize_chosen( $select, allow_deselect ) {
17
- $select.addClass('chosen_initialized').chosen({
18
- width : '100%',
19
- no_results_text : ACFFA.no_results,
20
- rtl : ACFFA.is_rtl,
21
- allow_single_deselect : allow_deselect,
22
- inherit_select_classes : true
23
- });
24
- }
25
-
26
- $( document ).on( 'acf/setup_fields', function( e, postbox ) {
27
- $( postbox ).find('.field[data-field_type="font-awesome"]').each( function() {
28
-
29
- var $select = $( '.chosen-fontawesome:not(.chosen_initialized):visible', this );
30
-
31
- if ( $select.length ) {
32
- update_preview( $select, false );
33
-
34
- if ( ACFFA.chosen ) {
35
- initialize_chosen( $select, $select.data('allow_null') );
36
- }
37
- }
38
- });
39
-
40
- });
41
-
42
- $( document ).on( 'click', '.acf-tab-button', function( e ) {
43
- e.preventDefault();
44
-
45
- var $wrap = $( this ).closest('.acf-tab-wrap').parent();
46
- var key = $( this ).attr('data-key');
47
-
48
- $wrap.children('.field_type-tab').each( function() {
49
- var $tab = $( this );
50
-
51
- if ( key == $tab.attr('data-field_key') ) {
52
- $( this ).nextUntil('.field_type-tab').each( function() {
53
- var $select = $( '.chosen-fontawesome:not(.chosen_initialized):visible', this );
54
- if ( $select.length ) {
55
- $.each( $select, function( index, select_element ) {
56
- update_preview( $( select_element ), false );
57
-
58
- if ( ACFFA.chosen ) {
59
- initialize_chosen( $( select_element ), $( select_element ).data('allow_null') );
60
- }
61
- });
62
- }
63
- });
64
- }
65
- });
66
- });
67
-
68
- $( document ).on( 'change', '.field_type select', function() {
69
- if ( 'font-awesome' == $( this ).val() ) {
70
- if ( ACFFA.chosen ) {
71
- var font_awesome_form = $( this ).closest( '.field_form' );
72
- var ajaxLoadWait = setInterval( function() {
73
- if ( $( '.chosen-fontawesome', font_awesome_form ).length ) {
74
- clearInterval( ajaxLoadWait );
75
-
76
- var $select = $( '.chosen-fontawesome:not(.chosen_initialized):visible', font_awesome_form );
77
-
78
- if ( $select.length ) {
79
- initialize_chosen( $select, true );
80
- }
81
- }
82
- }, 100 );
83
- }
84
- }
85
- });
86
-
87
- $( document ).on( 'acf/field_form-open', function( event, field ) {
88
- var $select = $( '.chosen-fontawesome:not(.chosen_initialized)', field );
89
-
90
- if ( $select.length ) {
91
- $.each( $select, function( index, select_element ) {
92
- var parent = $( select_element ).closest('.field');
93
- update_preview( $( select_element ), parent );
94
-
95
- if ( ACFFA.chosen ) {
96
- initialize_chosen( $( select_element ), true );
97
- }
98
- });
99
- }
100
- });
101
-
102
- $( document ).on( 'acf/field_form-close', function( event, field ) {
103
- if ( ACFFA.chosen ) {
104
- var $select = $( '.chosen-fontawesome.chosen_initialized', field );
105
-
106
- if ( $select.length ) {
107
- $select.removeClass('chosen_initialized').chosen('destroy');
108
- }
109
-
110
- $duplicate_field = $( field ).next('.field');
111
-
112
- if ( $duplicate_field.length && $duplicate_field.hasClass('form_open') ) {
113
- if ( $duplicate_field.hasClass('field_type-font-awesome') || $duplicate_field.hasClass('field_type-repeater') || $duplicate_field.hasClass('field_type-flexible_content') ) {
114
- var $duplicate_selects = $( '.chosen-fontawesome.chosen_initialized', $duplicate_field );
115
-
116
- if ( $duplicate_selects.length ) {
117
- $.each( $duplicate_selects, function( index, select_element ) {
118
- $( select_element ).removeClass('chosen_initialized').css('display','block').chosen('destroy').next('.chosen-container').remove();
119
- });
120
- }
121
-
122
- }
123
- }
124
- }
125
- });
126
-
127
- $( document ).on( 'change', '.chosen-fontawesome', function( evt, params ) {
128
- update_preview( $( this ), false );
129
- });
130
-
131
- })(jQuery);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/js/input-v5.js CHANGED
@@ -9,9 +9,9 @@
9
  function select2_init_args( element, parent ) {
10
  return {
11
  key : $( parent ).data('key'),
12
- allow_null : $( element ).data('allow_null'),
13
  ajax : 1,
14
- ajax_action : 'acf/fields/font-awesome/query'
15
  }
16
  }
17
 
@@ -21,7 +21,7 @@
21
 
22
  update_preview( $select.val(), parent );
23
 
24
- acf.select2.init( $select, select2_init_args( fa_field, parent ), $( fa_field ) );
25
  }
26
 
27
  acf.add_action( 'select2_init', function( $input, args, settings, $field ) {
@@ -32,7 +32,6 @@
32
 
33
  // Add our classes to FontAwesome select2 fields
34
  acf.add_filter( 'select2_args', function( args, $select, settings, $field ) {
35
-
36
  if ( $select.hasClass('select2-fontawesome') ) {
37
  args.dropdownCssClass = 'fa-select2-drop fa' + ACFFA.major_version;
38
  args.containerCssClass = 'fa-select2 fa' + ACFFA.major_version;
@@ -47,9 +46,28 @@
47
 
48
  $field_objects.each( function( index, field_object ) {
49
  update_preview( $( 'select.fontawesome-create', field_object ).val(), field_object );
 
 
 
 
 
 
 
50
  });
51
  });
52
 
 
 
 
 
 
 
 
 
 
 
 
 
53
  // Handle new menu items with FontAwesome fields assigned to them
54
  $( document ).on( 'menu-item-added', function( event, $menuMarkup ) {
55
  var $fa_fields = $( 'select.fontawesome-edit:not(.select2_initalized)', $menuMarkup );
@@ -73,10 +91,12 @@
73
  });
74
 
75
  // Update FontAwesome field previews when value changes
76
- acf.add_action( 'change', function( $input ) {
 
77
 
78
  if ( $input.hasClass('fontawesome-create') ) {
79
  update_preview( $input.val(), $input.closest('.acf-field-object') );
 
80
  }
81
 
82
  if ( $input.hasClass('fontawesome-edit') ) {
9
  function select2_init_args( element, parent ) {
10
  return {
11
  key : $( parent ).data('key'),
12
+ allowNull : $( element ).data('allow_null'),
13
  ajax : 1,
14
+ ajaxAction : 'acf/fields/font-awesome/query'
15
  }
16
  }
17
 
21
 
22
  update_preview( $select.val(), parent );
23
 
24
+ acf.select2.init( $select, select2_init_args( fa_field, parent ), parent );
25
  }
26
 
27
  acf.add_action( 'select2_init', function( $input, args, settings, $field ) {
32
 
33
  // Add our classes to FontAwesome select2 fields
34
  acf.add_filter( 'select2_args', function( args, $select, settings, $field ) {
 
35
  if ( $select.hasClass('select2-fontawesome') ) {
36
  args.dropdownCssClass = 'fa-select2-drop fa' + ACFFA.major_version;
37
  args.containerCssClass = 'fa-select2 fa' + ACFFA.major_version;
46
 
47
  $field_objects.each( function( index, field_object ) {
48
  update_preview( $( 'select.fontawesome-create', field_object ).val(), field_object );
49
+
50
+ if ( $( '.acf-field[data-name="icon_sets"] input[type="checkbox"][value="custom"]:checked', field_object ).length ) {
51
+ $( '.acf-field-setting-custom_icon_set', field_object ).show();
52
+ } else {
53
+ $( '.acf-field-setting-custom_icon_set', field_object ).hide();
54
+ }
55
+
56
  });
57
  });
58
 
59
+ // Uncheck standard icon set choices if 'custom icon set' is checked, and show the custom icon set select box
60
+ $( document ).on( 'change', '.acf-field[data-name="icon_sets"] input[type="checkbox"]', function() {
61
+ var parent = $( this ).closest('.acf-field-object-font-awesome');
62
+ if ( $( this ).is('[value="custom"]') && $( this ).is(':checked') ) {
63
+ $( 'input[type="checkbox"]:not([value="custom"])', parent ).prop('checked', false);
64
+ $( '.acf-field-setting-custom_icon_set', parent ).show();
65
+ } else {
66
+ $( 'input[type="checkbox"][value="custom"]', parent ).prop('checked', false);
67
+ $( '.acf-field-setting-custom_icon_set', parent ).hide();
68
+ }
69
+ });
70
+
71
  // Handle new menu items with FontAwesome fields assigned to them
72
  $( document ).on( 'menu-item-added', function( event, $menuMarkup ) {
73
  var $fa_fields = $( 'select.fontawesome-edit:not(.select2_initalized)', $menuMarkup );
91
  });
92
 
93
  // Update FontAwesome field previews when value changes
94
+ $( document ).on( 'select2:select', 'select.select2-fontawesome', function() {
95
+ var $input = $( this );
96
 
97
  if ( $input.hasClass('fontawesome-create') ) {
98
  update_preview( $input.val(), $input.closest('.acf-field-object') );
99
+ $('.acf-field-setting-default_label input').val( $( 'option:selected', $input ).html() );
100
  }
101
 
102
  if ( $input.hasClass('fontawesome-edit') ) {
assets/js/settings.js ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ (function($){
2
+ var old_major_version = false,
3
+ selected_major_version = false;
4
+ function evaluate_pro_visibility() {
5
+ selected_major_version = $('#acffa_major_version').val();
6
+
7
+ if ( 5 == selected_major_version ) {
8
+ $('.acffa_row.pro_icons').show();
9
+ } else {
10
+ $('.acffa_row.pro_icons').hide();
11
+ $('#pro_icons').prop( 'checked', false );
12
+ }
13
+ }
14
+
15
+ $(document).ready( function() {
16
+ old_major_version = $('#acffa_major_version').val();
17
+ evaluate_pro_visibility();
18
+ });
19
+
20
+ $('#acffa_major_version').on( 'change', function() {
21
+ evaluate_pro_visibility();
22
+
23
+ var $iconSetBuilder = $('.custom-icon-set');
24
+
25
+ if ( old_major_version !== selected_major_version ) {
26
+ $iconSetBuilder.hide();
27
+ $('.icon-builder-complete-changes-notice').show();
28
+ } else {
29
+ $iconSetBuilder.show();
30
+ $('.icon-builder-complete-changes-notice').hide();
31
+ }
32
+ });
33
+
34
+ $('select#acffa_new_icon_set').multiSelect({
35
+ selectableHeader: '<input type="text" class="search-input" autocomplete="off" placeholder="' + ACFFA.search_string + '">',
36
+ selectionHeader: '<input type="text" class="search-input" autocomplete="off" placeholder="' + ACFFA.search_string + '">',
37
+ afterInit: function(ms){
38
+ var that = this,
39
+ $selectableSearch = that.$selectableUl.prev(),
40
+ $selectionSearch = that.$selectionUl.prev(),
41
+ selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)',
42
+ selectionSearchString = '#'+that.$container.attr('id')+' .ms-elem-selection.ms-selected';
43
+
44
+ that.qs1 = $selectableSearch.quicksearch( selectableSearchString )
45
+ .on('keydown', function(e){
46
+ if (e.which === 40){
47
+ that.$selectableUl.focus();
48
+ return false;
49
+ }
50
+ });
51
+
52
+ that.qs2 = $selectionSearch.quicksearch( selectionSearchString )
53
+ .on('keydown', function(e){
54
+ if (e.which == 40){
55
+ that.$selectionUl.focus();
56
+ return false;
57
+ }
58
+ });
59
+ },
60
+ afterSelect: function(){
61
+ this.qs1.cache();
62
+ this.qs2.cache();
63
+ },
64
+ afterDeselect: function(){
65
+ this.qs1.cache();
66
+ this.qs2.cache();
67
+ }
68
+ });
69
+
70
+ $( '.existing-custom-icon-sets .edit-icon-set' ).on( 'click', function( e ) {
71
+ e.preventDefault();
72
+
73
+ $('select#acffa_new_icon_set').multiSelect('deselect_all');
74
+
75
+ var parent = $( this ).closest('.icon-set'),
76
+ label = $( parent ).data('set-label'),
77
+ $iconList = $( 'li[data-icon]', parent ),
78
+ iconsToLoad = [];
79
+
80
+ $iconList.each( function( index, icon ) {
81
+ iconsToLoad.push( $( icon ).data('icon') );
82
+ });
83
+
84
+ $('#acffa_new_icon_set_label').val( label );
85
+ $('select#acffa_new_icon_set').multiSelect( 'select', iconsToLoad );
86
+ });
87
+
88
+ $( '.existing-custom-icon-sets .view-icon-list' ).on( 'click', function( e ) {
89
+ e.preventDefault();
90
+
91
+ var parent = $( this ).closest('.icon-set');
92
+ $( parent ).find('.icon-list').toggle();
93
+ });
94
+
95
+ $( '.existing-custom-icon-sets .delete-icon-set' ).on( 'click', function( e ) {
96
+ e.preventDefault();
97
+
98
+ var result = confirm( ACFFA.confirm_delete );
99
+ if ( result ) {
100
+ var nonce = $( this ).data('nonce'),
101
+ iconSetName = $( this ).data('icon-set-name');
102
+
103
+ $.post(
104
+ ajaxurl,
105
+ {
106
+ 'action' : 'ACFFA_delete_icon_set',
107
+ 'nonce' : nonce,
108
+ 'icon_set_name' : iconSetName
109
+ },
110
+ function( response_msg ) {
111
+ if ( 'success' == response_msg ) {
112
+ $('.icon-set[data-set-name="' + iconSetName + '"]').remove();
113
+ } else {
114
+ alert( ACFFA.delete_fail );
115
+ }
116
+ }
117
+ );
118
+ }
119
+ });
120
+ })(jQuery);
fields/acf-font-awesome-v4.php DELETED
@@ -1,342 +0,0 @@
1
- <?php
2
-
3
- // exit if accessed directly
4
- if ( ! defined( 'ABSPATH' ) ) {
5
- exit;
6
- }
7
-
8
-
9
- // check if class already exists
10
- if ( ! class_exists( 'acf_field_font_awesome' ) ) :
11
-
12
- class acf_field_font_awesome extends acf_field {
13
-
14
- private $icons = false;
15
-
16
- // vars
17
- var $settings, // will hold info such as dir / path
18
- $defaults; // will hold default field options
19
-
20
- public function __construct( $settings )
21
- {
22
- $this->name = 'font-awesome';
23
- $this->label = __( 'Font Awesome Icon', 'acf-font-awesome' );
24
- $this->category = 'Content';
25
- $this->settings = $settings;
26
-
27
- $this->defaults = array(
28
- 'enqueue_fa' => 0,
29
- 'allow_null' => 0,
30
- 'show_preview' => 1,
31
- 'save_format' => 'element',
32
- 'default_value' => '',
33
- 'fa_live_preview' => '',
34
- 'choices' => array()
35
- );
36
-
37
- parent::__construct();
38
-
39
-
40
- if ( apply_filters( 'ACFFA_always_enqueue_fa', false ) ) {
41
- add_action( 'wp_enqueue_scripts', array( $this, 'frontend_enqueue_scripts' ) );
42
- } else {
43
- add_filter('acf/load_field', array( $this, 'maybe_enqueue_font_awesome' ) );
44
- }
45
- }
46
-
47
- private function get_icons( $format = 'list' )
48
- {
49
- if ( ! $this->icons ) {
50
- $this->icons = apply_filters( 'ACFFA_get_icons', array() );
51
- }
52
-
53
- return $this->icons[ $format ];
54
- }
55
-
56
- private function get_fa_url()
57
- {
58
- return apply_filters( 'ACFFA_get_fa_url', '' );
59
- }
60
-
61
- public function create_options( $field )
62
- {
63
- $field = array_merge( $this->defaults, $field );
64
- $key = $field['name'];
65
- ?>
66
-
67
- <tr class="field_option field_option_<?php echo $this->name; ?>">
68
- <td class="label">
69
- <label><?php _e( 'Icon Preview', 'acf-font-awesome' ); ?></label>
70
- </td>
71
- <td>
72
- <div class="fa-field-wrapper">
73
- <div class="fa_live_preview"></div>
74
- </div>
75
- </td>
76
- </tr>
77
- <tr class="field_option field_option_<?php echo $this->name; ?>">
78
- <td class="label">
79
- <label><?php _e( 'Default Icon', 'acf-font-awesome' ); ?></label>
80
- </td>
81
- <td>
82
- <div class="fa-field-wrapper">
83
- <?php
84
- do_action('acf/create_field', array(
85
- 'type' => 'select',
86
- 'name' => 'fields[' . $key . '][default_value]',
87
- 'value' => $field['default_value'],
88
- 'class' => 'chosen-fontawesome fontawesome-create',
89
- 'choices' => $field['choices']
90
- ));
91
- ?>
92
- </div>
93
- </td>
94
- </tr>
95
- <tr class="field_option field_option_<?php echo $this->name; ?>">
96
- <td class="label">
97
- <label><?php _e( 'Return Value', 'acf-font-awesome' ); ?></label>
98
- <p class="description"><?php _e( 'Specify the returned value on front end', 'acf-font-awesome' ); ?></p>
99
- </td>
100
- <td>
101
- <?php
102
- do_action('acf/create_field', array(
103
- 'type' => 'radio',
104
- 'name' => 'fields['.$key.'][save_format]',
105
- 'value' => $field['save_format'],
106
- 'choices' => array(
107
- 'element' => __("Icon Element",'acf-font-awesome'),
108
- 'class' => __("Icon Class",'acf-font-awesome'),
109
- 'unicode' => __("Icon Unicode",'acf-font-awesome'),
110
- 'object' => __("Icon Object",'acf-font-awesome'),
111
- ),
112
- 'layout' => 'vertical',
113
- ));
114
- ?>
115
- </td>
116
- </tr>
117
-
118
- <tr class="field_option field_option_<?php echo $this->name; ?>">
119
- <td class="label">
120
- <label><?php _e( 'Allow Null?', 'acf-font-awesome' ); ?></label>
121
- </td>
122
- <td>
123
- <?php
124
- do_action('acf/create_field', array(
125
- 'type' => 'radio',
126
- 'name' => 'fields['.$key.'][allow_null]',
127
- 'value' => $field['allow_null'],
128
- 'choices' => array(
129
- 1 => __( 'Yes', 'acf-font-awesome' ),
130
- 0 => __( 'No', 'acf-font-awesome' ),
131
- ),
132
- 'layout' => 'horizontal',
133
- ));
134
- ?>
135
- </td>
136
- </tr>
137
-
138
- <tr class="field_option field_option_<?php echo $this->name; ?>">
139
- <td class="label">
140
- <label><?php _e( 'Show Icon Preview', 'acf-font-awesome' ); ?></label>
141
- <p class="description"><?php _e( 'Set to \'Yes\' to include a larger icon preview on any admin pages using this field.', 'acf-font-awesome' ); ?></p>
142
- </td>
143
- <td>
144
- <?php
145
- do_action('acf/create_field', array(
146
- 'type' => 'radio',
147
- 'name' => 'fields['.$key.'][show_preview]',
148
- 'value' => $field['show_preview'],
149
- 'choices' => array(
150
- 1 => __( 'Yes', 'acf-font-awesome' ),
151
- 0 => __( 'No', 'acf-font-awesome' ),
152
- ),
153
- 'layout' => 'horizontal',
154
- ));
155
- ?>
156
- </td>
157
- </tr>
158
-
159
- <?php if ( ! apply_filters( 'ACFFA_always_enqueue_fa', false ) ) : ?>
160
- <tr class="field_option field_option_<?php echo $this->name; ?>">
161
- <td class="label">
162
- <label><?php _e( 'Enqueue FontAwesome?', 'acf-font-awesome' ); ?></label>
163
- <p class="description"><?php _e( 'Set to \'Yes\' to enqueue FA in the footer on any pages using this field.', 'acf-font-awesome' ); ?></p>
164
- </td>
165
- <td>
166
- <?php
167
- do_action('acf/create_field', array(
168
- 'type' => 'radio',
169
- 'name' => 'fields['.$key.'][enqueue_fa]',
170
- 'value' => $field['enqueue_fa'],
171
- 'choices' => array(
172
- 1 => __( 'Yes', 'acf-font-awesome' ),
173
- 0 => __( 'No', 'acf-font-awesome' ),
174
- ),
175
- 'layout' => 'horizontal',
176
- ));
177
- ?>
178
- </td>
179
- </tr>
180
- <?php endif; ?>
181
- <?php
182
- }
183
-
184
- public function create_field( $field )
185
- {
186
- if ( $field['allow_null'] ) {
187
- $select_value = $field['value'];
188
- } else {
189
- $select_value = ( 'null' != $field['value'] ) ? $field['value'] : $field['default_value'];
190
- }
191
- ?>
192
- <?php if ( $field['show_preview'] ) : ?>
193
- <div class="icon_preview"></div>
194
- <?php endif; ?>
195
-
196
- <select id="<?php echo $field['id']; ?>" class="chosen-fontawesome fontawesome-edit fa<?php echo ACFFA_MAJOR_VERSION; ?>" name="<?php echo esc_attr($field['name']) ?>" data-ui="1" data-ajax="1" data-multiple="0" data-placeholder="- Select -" data-allow_null="<?php echo $field['allow_null']; ?>">
197
- <?php
198
- $icons = $this->get_icons('list');
199
-
200
- if ( $icons ) :
201
- if ( version_compare( ACFFA_MAJOR_VERSION, 5, '<' ) ) :
202
- foreach ( $icons as $value => $label ) :
203
- ?>
204
- <option value="<?php echo $value; ?>" <?php selected( $select_value, $value ); ?>><?php echo $label; ?></option>
205
- <?php
206
- endforeach;
207
- else :
208
- foreach ( $icons as $prefix => $children ) :
209
- $prefix_label = apply_filters( 'ACFFA_icon_prefix_label', 'Regular', $prefix );
210
- ?>
211
- <optgroup label="<?php echo $prefix_label; ?>"><?php echo $prefix_label; ?>
212
- <?php
213
- foreach ( $children as $value => $label ) :
214
- $label = explode( '; ', strip_tags( $label ) );
215
- ?>
216
- <option class="<?php echo $value; ?>" value="<?php echo $value; ?>" style=""<?php selected( $select_value, $value ); ?>><?php echo $label[1]; ?></option>
217
- <?php
218
- endforeach;
219
- ?>
220
- </optgroup>
221
- <?php
222
- endforeach;
223
- endif;
224
- endif;
225
- ?>
226
- </select>
227
- <?php
228
- }
229
-
230
- public function input_admin_enqueue_scripts()
231
- {
232
- $this->enqueue_admin_scripts( array( 'acf-input' ) );
233
- }
234
-
235
- public function field_group_admin_enqueue_scripts()
236
- {
237
- $this->enqueue_admin_scripts( array( 'acf-field-group' ) );
238
- }
239
-
240
- private function enqueue_admin_scripts( $dependencies = array() )
241
- {
242
- $url = $this->settings['url'];
243
- $version = $this->settings['version'];
244
-
245
- if ( apply_filters( 'ACFFA_load_chosen', true ) ) {
246
- wp_enqueue_script( 'chosen', "{$url}assets/inc/chosen/chosen.jquery.min.js", array('jquery'), '1.7.0' );
247
- wp_enqueue_style( 'chosen', "{$url}assets/inc/chosen/chosen.min.css", '', '1.7.0' );
248
- }
249
-
250
- wp_register_script( 'acf-input-font-awesome', "{$url}assets/js/input-v4.js", $dependencies, $version );
251
- wp_enqueue_script( 'acf-input-font-awesome' );
252
- wp_localize_script( 'acf-input-font-awesome', 'ACFFA', array(
253
- 'chosen' => apply_filters( 'ACFFA_load_chosen', true ),
254
- 'nonce' => wp_create_nonce( 'ACFFA_nonce' ),
255
- 'is_rtl' => is_rtl(),
256
- 'no_results' => __( 'Cannot find icon', 'acf-font-awesome' ) . ' : ',
257
- 'major_version' => ACFFA_MAJOR_VERSION
258
- ));
259
-
260
- wp_register_style( 'acf-input-font-awesome', "{$url}assets/css/input.css", $dependencies, $version );
261
- wp_enqueue_style( 'acf-input-font-awesome' );
262
-
263
- if ( apply_filters( 'ACFFA_admin_enqueue_fa', true ) ) {
264
- wp_register_style( 'acf-input-font-awesome_library', $this->get_fa_url(), $dependencies );
265
- wp_enqueue_style( 'acf-input-font-awesome_library' );
266
- }
267
- }
268
-
269
- public function maybe_enqueue_font_awesome( $field )
270
- {
271
- if ( 'font-awesome' == $field['type'] && $field['enqueue_fa'] ) {
272
- add_action( 'wp_footer', array( $this, 'frontend_enqueue_scripts' ) );
273
- }
274
-
275
- return $field;
276
- }
277
-
278
- public function frontend_enqueue_scripts()
279
- {
280
- wp_register_style( 'font-awesome', $this->get_fa_url() );
281
- wp_enqueue_style('font-awesome');
282
- }
283
-
284
- public function format_value_for_api( $value, $post_id, $field )
285
- {
286
- if ( 'null' == $value ) {
287
- return false;
288
- }
289
-
290
- if ( empty( $value ) ) {
291
- return $value;
292
- }
293
-
294
- if ( ! $this->icons ) {
295
- $this->get_icons();
296
- }
297
-
298
- if ( version_compare( ACFFA_MAJOR_VERSION, 5, '<' ) ) {
299
- $icon = isset( $this->icons['details'][ $value ] ) ? $this->icons['details'][ $value ] : false;
300
- } else {
301
- $prefix = substr( $value, 0, 3 );
302
- $icon = isset( $this->icons['details'][ $prefix ][ $value ] ) ? $this->icons['details'][ $prefix ][ $value ] : false;
303
- }
304
-
305
- if ( $icon ) {
306
- switch ( $field['save_format'] ) {
307
- case 'element':
308
- if ( version_compare( ACFFA_MAJOR_VERSION, 5, '<' ) ) {
309
- $value = '<i class="fa ' . $value . '" aria-hidden="true"></i>';
310
- } else {
311
- $value = '<i class="' . $value . '" aria-hidden="true"></i>';
312
- }
313
- break;
314
-
315
- case 'unicode':
316
- $value = $icon['unicode'];
317
- break;
318
-
319
- case 'object':
320
- $object_data = array(
321
- 'element' => '<i class="' . $value . '" aria-hidden="true"></i>',
322
- 'class' => $value,
323
- 'hex' => $icon['hex'],
324
- 'unicode' => $icon['unicode']
325
- );
326
-
327
- if ( version_compare( ACFFA_MAJOR_VERSION, 5, '>=' ) ) {
328
- $object_data['prefix'] = $prefix;
329
- }
330
-
331
- $value = ( object ) $object_data;
332
- break;
333
- }
334
- }
335
-
336
- return $value;
337
- }
338
- }
339
-
340
- new acf_field_font_awesome( $this->settings );
341
-
342
- endif;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
fields/acf-font-awesome-v5.php CHANGED
@@ -9,10 +9,12 @@ if ( ! class_exists( 'acf_field_font_awesome' ) ) :
9
 
10
  class acf_field_font_awesome extends acf_field
11
  {
12
- private $icons = false;
 
13
 
14
  public function __construct( $settings )
15
- {
 
16
  $this->name = 'font-awesome';
17
  $this->label = __( 'Font Awesome Icon', 'acf-font-awesome');
18
  $this->category = 'content';
@@ -24,6 +26,7 @@ if ( ! class_exists( 'acf_field_font_awesome' ) ) :
24
  'show_preview' => 1,
25
  'save_format' => 'element',
26
  'default_value' => '',
 
27
  'fa_live_preview' => '',
28
  'choices' => array()
29
  );
@@ -53,6 +56,49 @@ if ( ! class_exists( 'acf_field_font_awesome' ) ) :
53
 
54
  public function render_field_settings( $field )
55
  {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
56
  acf_render_field_setting( $field, array(
57
  'label' => __( 'Icon Preview', 'acf-font-awesome' ),
58
  'instructions' => '',
@@ -61,13 +107,23 @@ if ( ! class_exists( 'acf_field_font_awesome' ) ) :
61
  'class' => 'live-preview'
62
  ));
63
 
 
 
 
 
 
 
 
 
 
64
  acf_render_field_setting( $field, array(
65
  'label' => __( 'Default Icon', 'acf-font-awesome' ),
66
  'instructions' => '',
67
  'type' => 'select',
68
  'name' => 'default_value',
69
  'class' => 'select2-fontawesome fontawesome-create',
70
- 'choices' => $field['choices'],
 
71
  'placeholder' => 'Choose a default icon (optional)',
72
  'ui' => 1,
73
  'allow_null' => 1,
@@ -125,56 +181,45 @@ if ( ! class_exists( 'acf_field_font_awesome' ) ) :
125
  }
126
 
127
  public function render_field( $field )
128
- {
 
 
129
  if ( $field['allow_null'] ) {
130
  $select_value = $field['value'];
131
  } else {
132
  $select_value = ( 'null' != $field['value'] ) ? $field['value'] : $field['default_value'];
133
  }
134
 
135
- $select2_class = version_compare( ACFFA_MAJOR_VERSION, 5, '>=' ) ? 'fa5' : 'fa4';
136
- ?>
137
- <input type="hidden" id="<?php echo $field['id']; ?>-input" name="<?php echo $field['name']; ?>" value="<?php echo $select_value; ?>">
138
-
139
- <?php if ( $field['show_preview'] ) : ?>
140
- <div class="icon_preview"></div>
141
- <?php endif; ?>
142
-
143
- <select id="<?php echo $field['id']; ?>" class="<?php echo $select2_class; ?> select2-fontawesome fontawesome-edit" name="<?php echo esc_attr($field['name']) ?>" data-ui="1" data-ajax="1" data-multiple="0" data-placeholder="- Select -" data-allow_null="<?php echo $field['allow_null']; ?>">
144
- <?php
145
- $icons = $this->get_icons('list');
146
-
147
- if ( version_compare( ACFFA_MAJOR_VERSION, 5, '<' ) ) :
148
- if ( $select_value && isset( $icons[ $select_value ] ) ) :
149
- ?>
150
- <option value="<?php echo $select_value; ?>" selected="selected"><?php echo $icons[ $select_value ]; ?></option>
151
- <?php
152
- elseif ( ( ! $select_value || ! isset( $icons[ $select_value ] ) ) && ! $field['allow_null'] ) :
153
- $default_value = reset( $icons );
154
- $default_key = key( $icons );
155
- ?>
156
- <option value="<?php echo $default_key; ?>" selected="selected"><?php echo $default_value; ?></option>
157
- <?php
158
- endif;
159
- else :
160
- $prefix = substr( $select_value, 0, 3 );
161
- if ( $select_value && isset( $icons[ $prefix ][ $select_value ] ) ) :
162
- ?>
163
- <option value="<?php echo $select_value; ?>" selected="selected"><?php echo htmlentities( $icons[ $prefix ][ $select_value ] ); ?></option>
164
- <?php
165
- elseif ( ( ! $select_value || ! isset( $icons[ $prefix ][ $select_value ] ) ) && ! $field['allow_null'] ) :
166
- $default_style_value = reset( $icons );
167
- $default_style_key = key( $icons );
168
- $default_value = reset( $default_style_value );
169
- $default_key = key( $default_style_value );
170
- ?>
171
- <option value="<?php echo $default_key; ?>" selected="selected"><?php echo $default_value; ?></option>
172
- <?php
173
- endif;
174
- endif;
175
- ?>
176
- </select>
177
- <?php
178
  }
179
 
180
  public function input_admin_enqueue_scripts()
9
 
10
  class acf_field_font_awesome extends acf_field
11
  {
12
+ private $icons = false;
13
+ private $version;
14
 
15
  public function __construct( $settings )
16
+ {
17
+ $this->version = 'v' . ACFFA_MAJOR_VERSION;
18
  $this->name = 'font-awesome';
19
  $this->label = __( 'Font Awesome Icon', 'acf-font-awesome');
20
  $this->category = 'content';
26
  'show_preview' => 1,
27
  'save_format' => 'element',
28
  'default_value' => '',
29
+ 'default_label' => '',
30
  'fa_live_preview' => '',
31
  'choices' => array()
32
  );
56
 
57
  public function render_field_settings( $field )
58
  {
59
+ $icon_sets_args = array(
60
+ 'label' => __( 'Icon Sets', 'acf-font-awesome' ),
61
+ 'instructions' => __( 'Specify which icon set(s) to load', 'acf-font-awesome' ),
62
+ 'type' => 'checkbox',
63
+ 'name' => 'icon_sets',
64
+ 'value' => ! empty( $field['icon_sets'] ) ? $field['icon_sets'][0] : 'far'
65
+ );
66
+
67
+ if ( version_compare( ACFFA_MAJOR_VERSION, 5, '>=' ) ) {
68
+ $icon_sets_args['choices'] = array(
69
+ 'fas' => __( 'Solid', 'acf-font-awesome' ),
70
+ 'far' => __( 'Regular', 'acf-font-awesome' ),
71
+ 'fal' => __( 'Light (FontAwesome Pro License Required)', 'acf-font-awesome' ),
72
+ 'fab' => __( 'Brands', 'acf-font-awesome' ),
73
+ 'custom' => __( 'Custom Icon Set', 'acf-font-awesome' )
74
+ );
75
+ } else {
76
+ $icon_sets_args['choices'] = array(
77
+ 'all' => __( 'All Icons', 'acf-font-awesome' ),
78
+ 'custom' => __( 'Custom Icon Set', 'acf-font-awesome' )
79
+ );
80
+ }
81
+ acf_render_field_setting( $field, $icon_sets_args );
82
+
83
+ $custom_icon_set_choices = get_option( 'ACFFA_custom_icon_sets_list' );
84
+ if ( isset( $custom_icon_set_choices[ $this->version ] ) && ! empty( $custom_icon_set_choices[ $this->version ] ) ) {
85
+ $custom_icon_set_choices = $custom_icon_set_choices[ $this->version ];
86
+ } else {
87
+ $custom_icon_set_choices = array( __( 'No custom icon set(s) found', 'acf-font-awesome' ) );
88
+ }
89
+
90
+ acf_render_field_setting( $field, array(
91
+ 'label' => __( 'Custom Icon Set', 'acf-font-awesome' ),
92
+ 'instructions' => sprintf( __( 'Create custom icon sets in the <a href="%s">FontAwesome Settings page</a>.', 'acf-font-awesome' ), admin_url( '/edit.php?post_type=acf-field-group&page=fontawesome-settings' ) ),
93
+ 'type' => 'select',
94
+ 'name' => 'custom_icon_set',
95
+ 'class' => 'custom-icon-set',
96
+ 'choices' => $custom_icon_set_choices,
97
+ 'value' => isset( $field['custom_icon_set'] ) ? $field['custom_icon_set'] : false,
98
+ 'placeholder' => 'Choose an icon set',
99
+ 'allow_null' => 1
100
+ ));
101
+
102
  acf_render_field_setting( $field, array(
103
  'label' => __( 'Icon Preview', 'acf-font-awesome' ),
104
  'instructions' => '',
107
  'class' => 'live-preview'
108
  ));
109
 
110
+ acf_render_field_setting( $field, array(
111
+ 'label' => __( 'Default Label', 'acf-font-awesome' ),
112
+ 'instructions' => 'Used internally to store the select label for the default icon. For performance reasons.',
113
+ 'type' => 'text',
114
+ 'name' => 'default_label',
115
+ 'value' => ! empty ( $field['default_label'] ) ? $field['default_label'] : $field['default_value'],
116
+ 'class' => 'default_value'
117
+ ));
118
+
119
  acf_render_field_setting( $field, array(
120
  'label' => __( 'Default Icon', 'acf-font-awesome' ),
121
  'instructions' => '',
122
  'type' => 'select',
123
  'name' => 'default_value',
124
  'class' => 'select2-fontawesome fontawesome-create',
125
+ 'choices' => ! empty( $field['default_label'] ) ? array( $field['default_value'] => html_entity_decode( $field['default_label'] ) ) : array( $field['default_value'] => $field['default_value'] ),
126
+ 'value' => $field['default_value'],
127
  'placeholder' => 'Choose a default icon (optional)',
128
  'ui' => 1,
129
  'allow_null' => 1,
181
  }
182
 
183
  public function render_field( $field )
184
+ {
185
+ $select2_class = version_compare( ACFFA_MAJOR_VERSION, 5, '>=' ) ? 'fa5' : 'fa4';
186
+
187
  if ( $field['allow_null'] ) {
188
  $select_value = $field['value'];
189
  } else {
190
  $select_value = ( 'null' != $field['value'] ) ? $field['value'] : $field['default_value'];
191
  }
192
 
193
+ $field['type'] = 'select';
194
+ $field['ui'] = 1;
195
+ $field['ajax'] = 1;
196
+ $field['choices'] = array();
197
+ $field['multiple'] = false;
198
+ $field['class'] = $select2_class . ' select2-fontawesome fontawesome-edit';
199
+
200
+ $icons = $this->get_icons('list');
201
+ if ( version_compare( ACFFA_MAJOR_VERSION, 5, '<' ) ) :
202
+ if ( $select_value && isset( $icons[ $select_value ] ) ) :
203
+ $field['choices'][ $select_value ] = $icons[ $select_value ];
204
+ elseif ( ( ! $select_value || ! isset( $icons[ $select_value ] ) ) && ! $field['allow_null'] ) :
205
+ $default_value = reset( $icons );
206
+ $default_key = key( $icons );
207
+ $field['choices'][ $default_key ] = $default_value;
208
+ endif;
209
+ else :
210
+ $prefix = substr( $select_value, 0, 3 );
211
+ if ( $select_value && isset( $icons[ $prefix ][ $select_value ] ) ) :
212
+ $field['choices'][ $select_value ] = htmlentities( $icons[ $prefix ][ $select_value ] );
213
+ elseif ( ( ! $select_value || ! isset( $icons[ $prefix ][ $select_value ] ) ) && ! $field['allow_null'] ) :
214
+ $default_style_value = reset( $icons );
215
+ $default_style_key = key( $icons );
216
+ $default_value = reset( $default_style_value );
217
+ $default_key = key( $default_style_value );
218
+ $field['choices'][ $default_key ] = $default_value;
219
+ endif;
220
+ endif;
221
+
222
+ acf_render_field( $field );
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  }
224
 
225
  public function input_admin_enqueue_scripts()
lang/acf-font-awesome.pot CHANGED
@@ -15,9 +15,8 @@ msgstr ""
15
  "X-Poedit-KeywordsList: ;__;_e\n"
16
  "X-Poedit-SearchPath-0: .\n"
17
  "X-Poedit-SearchPathExcluded-0: assets/css\n"
18
- "X-Poedit-SearchPathExcluded-1: assets/inc/chosen\n"
19
- "X-Poedit-SearchPathExcluded-2: assets/js\n"
20
- "X-Poedit-SearchPathExcluded-3: lang\n"
21
 
22
  #: fields/acf-font-awesome-v4.php:23 fields/acf-font-awesome-v5.php:17
23
  msgid "Font Awesome Icon"
15
  "X-Poedit-KeywordsList: ;__;_e\n"
16
  "X-Poedit-SearchPath-0: .\n"
17
  "X-Poedit-SearchPathExcluded-0: assets/css\n"
18
+ "X-Poedit-SearchPathExcluded-1: assets/js\n"
19
+ "X-Poedit-SearchPathExcluded-2: lang\n"
 
20
 
21
  #: fields/acf-font-awesome-v4.php:23 fields/acf-font-awesome-v5.php:17
22
  msgid "Font Awesome Icon"
readme.txt CHANGED
@@ -14,18 +14,19 @@ Adds a new 'Font Awesome Icon' field to the popular Advanced Custom Fields plugi
14
  Add a [Font Awesome](http://fontawesome.io/) icon field type to Advanced Custom Fields.
15
 
16
  * Optionally set a default icon
 
 
17
  * Returns Icon Element, Icon Class, Icon Unicode, or an Object including the element, class, and unicode value
18
- * Optionally enqueues Font Awesome in footer where needed (when a font awesome field is being used on the page)
19
  * Integrates with [jsDelivr](https://www.jsdelivr.com/) to automatically load the latest version of [Font Awesome](http://fontawesome.io/)
20
- * Includes filters to override the which version of FontAwesome is loaded (See Optional Configuration)
21
 
22
  Note: It is recommended to let this plugin enqueue the latest version of Font Awesome on your front-end; or include the latest version by some other means; so that available icons in the admin area will be displayed properly on your sites front-end.
23
 
24
  = Compatibility =
25
 
26
  This ACF field type is compatible with:
27
- * ACF 5
28
- * ACF 4
29
 
30
  == Installation ==
31
 
@@ -38,9 +39,7 @@ This ACF field type is compatible with:
38
  === Filters ===
39
 
40
  * **ACFFA_always_enqueue_fa**: Return true to always enqueue FontAwesome on the frontend, even if no ACF FontAwesome fields are in use on the page. This will enqueue FontAwesome in the header instead of the footer.
41
- * **ACFFA_override_version**: Use to override the default FontAwesome icon version (latest). Return any valid version number from [jsDelivr](https://www.jsdelivr.com/projects/fontawesome)
42
  * **ACFFA_admin_enqueue_fa**: Return false to stop enqueueing FontAwesome in the admin area. Useful if you already have FontAwesome enqueued by some other means.
43
- * **ACFFA_load_chosen**: Return false to stop loading the [Chosen JS](https://harvesthq.github.io/chosen/) library in the admin area. Used in v4 of ACF only.
44
  * **ACFFA_get_icons**: Filter the array of icons and icon details loaded from the database
45
  * **ACFFA_get_fa_url**: Filter the URL used for enqueuing FontAwesome in the frontend and admin areas of the site.
46
 
@@ -51,6 +50,12 @@ This ACF field type is compatible with:
51
 
52
  == Changelog ==
53
 
 
 
 
 
 
 
54
  = 3.0.0-beta2 =
55
  * Adding support for FontAwesome Pro icons
56
 
@@ -168,6 +173,12 @@ This ACF field type is compatible with:
168
 
169
  == Upgrade Notice ==
170
 
 
 
 
 
 
 
171
  = 3.0.0-beta2 =
172
  * Adding support for FontAwesome Pro icons
173
 
14
  Add a [Font Awesome](http://fontawesome.io/) icon field type to Advanced Custom Fields.
15
 
16
  * Optionally set a default icon
17
+ * Specify which FontAwesome icon sets to use (Solid, Regular, Light, Brands) (Applies to FontAwesome v5)
18
+ * Create your own custom filtered list of FontAwesome icons to use with your fields. Use different custom icon sets with different fields
19
  * Returns Icon Element, Icon Class, Icon Unicode, or an Object including the element, class, and unicode value
20
+ * Optionally enqueues Font Awesome in footer where needed (when a FontAwesome field is being used on the page)
21
  * Integrates with [jsDelivr](https://www.jsdelivr.com/) to automatically load the latest version of [Font Awesome](http://fontawesome.io/)
 
22
 
23
  Note: It is recommended to let this plugin enqueue the latest version of Font Awesome on your front-end; or include the latest version by some other means; so that available icons in the admin area will be displayed properly on your sites front-end.
24
 
25
  = Compatibility =
26
 
27
  This ACF field type is compatible with:
28
+ * ACF 5.7+
29
+ * FontAwesome 4.x and 5.x fonts
30
 
31
  == Installation ==
32
 
39
  === Filters ===
40
 
41
  * **ACFFA_always_enqueue_fa**: Return true to always enqueue FontAwesome on the frontend, even if no ACF FontAwesome fields are in use on the page. This will enqueue FontAwesome in the header instead of the footer.
 
42
  * **ACFFA_admin_enqueue_fa**: Return false to stop enqueueing FontAwesome in the admin area. Useful if you already have FontAwesome enqueued by some other means.
 
43
  * **ACFFA_get_icons**: Filter the array of icons and icon details loaded from the database
44
  * **ACFFA_get_fa_url**: Filter the URL used for enqueuing FontAwesome in the frontend and admin areas of the site.
45
 
50
 
51
  == Changelog ==
52
 
53
+ = 3.0.0-beta3 =
54
+ * Added new 'custom icon set' builder which allows FontAwesome ACF fields to be created with a limited set of icons individually selected from the full list of FontAwesome icons
55
+ * Added field options to FontAwesome v5 fields to limit which of the icon sets ( Brands, Regular, Lite, Solid ) you want to allow in the field
56
+ * Removing support for ACF v4 now that v5 is out with a free version
57
+ * Performance improvements
58
+
59
  = 3.0.0-beta2 =
60
  * Adding support for FontAwesome Pro icons
61
 
173
 
174
  == Upgrade Notice ==
175
 
176
+ = 3.0.0-beta3 =
177
+ * Added new 'custom icon set' builder which allows FontAwesome ACF fields to be created with a limited set of icons individually selected from the full list of FontAwesome icons
178
+ * Added field options to FontAwesome v5 fields to limit which of the icon sets ( Brands, Regular, Lite, Solid ) you want to allow in the field
179
+ * Removing support for ACF v4 now that v5 is out with a free version
180
+ * Performance improvements
181
+
182
  = 3.0.0-beta2 =
183
  * Adding support for FontAwesome Pro icons
184