Category Posts Widget - Version 4.9.6

Version Description

  • November 16th 2020 =
  • Item Title heading level buttons
  • Excerpt-more link placeholder
  • Native WordPress filter CSS classes
  • Rework thumb handling
Download this release

Release Info

Developer Kometschuh
Plugin Icon 128x128 Category Posts Widget
Version 4.9.6
Comparing to
See all releases

Code changes from version 4.9.5 to 4.9.6

cat-posts.php CHANGED
@@ -12,7 +12,7 @@ Plugin Name: Category Posts Widget
12
  Plugin URI: https://wordpress.org/plugins/category-posts/
13
  Description: Adds a widget that shows the most recent posts from a single category.
14
  Author: TipTopPress
15
- Version: 4.9.5
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
@@ -25,7 +25,7 @@ if ( ! defined( 'ABSPATH' ) ) {
25
  exit;
26
  }
27
 
28
- const VERSION = '4.9.5';
29
  const DOC_URL = 'http://tiptoppress.com/category-posts-widget/documentation-4-9/';
30
  const PRO_URL = 'http://tiptoppress.com/term-and-category-based-posts-widget/';
31
  const SUPPORT_URL = 'https://wordpress.org/support/plugin/category-posts/';
@@ -67,14 +67,16 @@ function wp_admin_bar_customize_menu() {
67
  return;
68
  }
69
 
70
- $wp_admin_bar->add_menu( array(
71
- 'id' => 'customize',
72
- 'title' => __( 'Customize' ),
73
- 'href' => $customize_url,
74
- 'meta' => array(
75
- 'class' => 'hide-if-no-customize',
76
- ),
77
- ) );
 
 
78
  add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
79
  }
80
 
@@ -98,17 +100,17 @@ function wp_head() {
98
  }
99
 
100
  if ( ! empty( $styles ) ) {
101
- ?>
102
  <style>
103
- <?php
104
- foreach ( $styles as $rules ) {
105
- foreach ( $rules as $rule ) {
106
- echo "$rule\n"; // Xss ok. raw css output, can not be html escaped.
 
107
  }
108
- }
109
- ?>
110
  </style>
111
- <?php
112
  }
113
  }
114
 
@@ -204,7 +206,7 @@ function embed_front_end_scripts() {
204
  */
205
  function admin_scripts( $hook ) {
206
 
207
- if ( 'widgets.php' === $hook || 'post.php' === $hook ) { // enqueue only for widget admin and customizer. (add if post.php: fix make widget SiteOrigin Page Builder plugin, GH issue #181)
208
 
209
  /*
210
  * Add script to control admin UX.
@@ -228,11 +230,15 @@ function admin_scripts( $hook ) {
228
 
229
  wp_localize_script( 'category-posts-widget-admin-js', 'tiptoppress', $js_data );
230
  wp_enqueue_media();
231
- wp_localize_script( 'category-posts-widget-admin-js', 'cwp_default_thumb_selection', array(
232
- 'frame_title' => __( 'Select a default thumbnail', 'category-posts' ),
233
- 'button_title' => __( 'Select', 'category-posts' ),
234
- 'none' => __( 'None', 'category-posts' ),
235
- ) );
 
 
 
 
236
  }
237
  }
238
 
@@ -262,8 +268,8 @@ function admin_styles() {
262
 
263
  add_action( 'admin_print_styles-widgets.php', __NAMESPACE__ . '\admin_styles' );
264
 
265
- // fix make widget SiteOrigin Page Builder plugin, GH issue #181
266
- add_action('siteorigin_panel_enqueue_admin_scripts', __NAMESPACE__ . '\admin_styles' );
267
 
268
  /**
269
  * Get the tags which might be used in the template.
@@ -273,7 +279,7 @@ add_action('siteorigin_panel_enqueue_admin_scripts', __NAMESPACE__ . '\admin_sty
273
  * @return array Array of strings of the tags.
274
  */
275
  function get_template_tags() {
276
- return array( 'author', 'title', 'date', 'thumb', 'excerpt', 'commentnum', 'post_tag', 'category' );
277
  }
278
 
279
  /**
@@ -426,6 +432,128 @@ function register_widget() {
426
 
427
  add_action( 'widgets_init', __NAMESPACE__ . '\register_widget' );
428
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
429
  /*
430
  * shortcode section.
431
  */
@@ -557,21 +685,22 @@ function default_settings() {
557
  'hideNoThumb' => false,
558
  'footer_link_text' => '',
559
  'footer_link' => '',
 
560
  'thumb_w' => get_option( 'thumbnail_size_w', 150 ),
561
  'thumb_fluid_width' => 100,
562
  'thumb_h' => get_option( 'thumbnail_size_h', 150 ),
563
- 'use_css_cropping' => true,
564
  'thumb_hover' => 'none',
565
  'hide_post_titles' => false,
566
- 'excerpt_lines' => 0,
567
  'excerpt_length' => 0,
568
- 'excerpt_more_text' => __( '...', 'category-posts' ),
569
  'excerpt_filters' => false,
570
  'comment_num' => false,
571
  'date_link' => false,
572
  'date_format' => '',
573
  'disable_css' => false,
574
  'disable_font_styles' => false,
 
575
  'show_post_format' => 'none',
576
  'no_cat_childs' => false,
577
  'everything_is_link' => false,
@@ -668,11 +797,14 @@ function customize_register( $wp_customize ) {
668
  $posts = get_posts( $args );
669
 
670
  if ( count( $posts ) > 0 ) {
671
- $wp_customize->add_panel( __NAMESPACE__, array(
672
- 'title' => __( 'Category Posts Shortcode', 'category-posts' ),
673
- 'priority' => 300,
674
- 'capability' => 'edit_theme_options',
675
- ) );
 
 
 
676
 
677
  foreach ( $posts as $p ) {
678
  $widget = new Widget();
@@ -708,12 +840,15 @@ function customize_register( $wp_customize ) {
708
  $section_title = __( '[shortcode]', 'category-posts' );
709
  }
710
 
711
- $wp_customize->add_section( __NAMESPACE__ . '-' . $p->id . '-' . $k, array(
712
- 'title' => $section_title,
713
- 'priority' => 10,
714
- 'capability' => 'edit_theme_options',
715
- 'panel' => __NAMESPACE__,
716
- ) );
 
 
 
717
 
718
  ob_start();
719
 
@@ -726,16 +861,20 @@ function customize_register( $wp_customize ) {
726
 
727
  $widget->form( $m );
728
  $form = ob_get_clean();
729
- $form = preg_replace_callback('/<(input|select|textarea)\s+.*name=("|\').*\[\w*\]\[([^\]]*)\][^>]*>/',
 
730
  function ( $matches ) use ( $p, $wp_customize, $m, $k ) {
731
  $setting = '_virtual-' . WIDGET_BASE_ID . '[' . $p->ID . '][' . $k . '][' . $matches[3] . ']';
732
  if ( ! isset( $m[ $matches[3] ] ) ) {
733
  $m[ $matches[3] ] = null;
734
  }
735
- $wp_customize->add_setting( $setting, array(
736
- 'default' => $m[ $matches[3] ], // set default to current value.
737
- 'type' => 'option',
738
- ) );
 
 
 
739
 
740
  return str_replace( '<' . $matches[1], '<' . $matches[1] . ' data-customize-setting-link="' . $setting . '"', $matches[0] );
741
  },
@@ -893,7 +1032,7 @@ function mce_external_languages( $locales ) {
893
  if ( is_array( $meta ) && isset( $meta['editor'] ) ) {
894
  ;
895
  } else {
896
- $locales['cat-posts'] = plugin_dir_path( __FILE__ ) . 'tinymce_translations.php';
897
  }
898
  }
899
 
@@ -941,7 +1080,7 @@ function show_user_profile( $user ) {
941
  if ( isset( $meta['editor'] ) ) {
942
  $editor = true;
943
  }
944
- ?>
945
  <h3 id="<?php echo __NAMESPACE__; ?>"><?php esc_html_e( 'Category Posts Widget behaviour settings', 'category-posts' ); ?></h3>
946
 
947
  <table class="form-table">
@@ -960,7 +1099,7 @@ function show_user_profile( $user ) {
960
  </td>
961
  </tr>
962
  </table>
963
- <?php
964
  }
965
 
966
  add_action( 'personal_options_update', __NAMESPACE__ . '\personal_options_update' );
12
  Plugin URI: https://wordpress.org/plugins/category-posts/
13
  Description: Adds a widget that shows the most recent posts from a single category.
14
  Author: TipTopPress
15
+ Version: 4.9.6
16
  Author URI: http://tiptoppress.com
17
  Text Domain: category-posts
18
  Domain Path: /languages
25
  exit;
26
  }
27
 
28
+ const VERSION = '4.9.6';
29
  const DOC_URL = 'http://tiptoppress.com/category-posts-widget/documentation-4-9/';
30
  const PRO_URL = 'http://tiptoppress.com/term-and-category-based-posts-widget/';
31
  const SUPPORT_URL = 'https://wordpress.org/support/plugin/category-posts/';
67
  return;
68
  }
69
 
70
+ $wp_admin_bar->add_menu(
71
+ array(
72
+ 'id' => 'customize',
73
+ 'title' => __( 'Customize' ),
74
+ 'href' => $customize_url,
75
+ 'meta' => array(
76
+ 'class' => 'hide-if-no-customize',
77
+ ),
78
+ )
79
+ );
80
  add_action( 'wp_before_admin_bar_render', 'wp_customize_support_script' );
81
  }
82
 
100
  }
101
 
102
  if ( ! empty( $styles ) ) {
103
+ ?>
104
  <style>
105
+ <?php
106
+ foreach ( $styles as $rules ) {
107
+ foreach ( $rules as $rule ) {
108
+ echo "$rule\n"; // Xss ok. raw css output, can not be html escaped.
109
+ }
110
  }
111
+ ?>
 
112
  </style>
113
+ <?php
114
  }
115
  }
116
 
206
  */
207
  function admin_scripts( $hook ) {
208
 
209
+ if ( 'widgets.php' === $hook || 'post.php' === $hook ) { // enqueue only for widget admin and customizer. (add if post.php: fix make widget SiteOrigin Page Builder plugin, GH issue #181).
210
 
211
  /*
212
  * Add script to control admin UX.
230
 
231
  wp_localize_script( 'category-posts-widget-admin-js', 'tiptoppress', $js_data );
232
  wp_enqueue_media();
233
+ wp_localize_script(
234
+ 'category-posts-widget-admin-js',
235
+ 'cwp_default_thumb_selection',
236
+ array(
237
+ 'frame_title' => __( 'Select a default thumbnail', 'category-posts' ),
238
+ 'button_title' => __( 'Select', 'category-posts' ),
239
+ 'none' => __( 'None', 'category-posts' ),
240
+ )
241
+ );
242
  }
243
  }
244
 
268
 
269
  add_action( 'admin_print_styles-widgets.php', __NAMESPACE__ . '\admin_styles' );
270
 
271
+ // fix make widget SiteOrigin Page Builder plugin, GH issue #181.
272
+ add_action( 'siteorigin_panel_enqueue_admin_scripts', __NAMESPACE__ . '\admin_styles' );
273
 
274
  /**
275
  * Get the tags which might be used in the template.
279
  * @return array Array of strings of the tags.
280
  */
281
  function get_template_tags() {
282
+ return array( 'author', 'title', 'date', 'thumb', 'excerpt', 'commentnum', 'post_tag', 'category', 'more-link' );
283
  }
284
 
285
  /**
432
 
433
  add_action( 'widgets_init', __NAMESPACE__ . '\register_widget' );
434
 
435
+ /**
436
+ * Output js code to set the image height if float text around image.
437
+ *
438
+ * @param int $number The widget number used to identify the specific list.
439
+ * @param array $widgetsettings The "instance" parameters of the widget.
440
+ *
441
+ * @since 4.9
442
+ **/
443
+ function equal_cover_content_height( $number, $widgetsettings ) {
444
+
445
+ if ( isset( $widgetsettings['template'] ) && preg_match( '/%thumb%|%excerpt%/', $widgetsettings['template'] ) ) :
446
+ ?>
447
+ <script type="text/javascript">
448
+ if (typeof jQuery !== 'undefined') {
449
+ jQuery( document ).ready(function () {
450
+ var cat_posts_namespace = window.cat_posts_namespace || {};
451
+ cat_posts_namespace.layout_wrap_text = cat_posts_namespace.layout_wrap_text || {};
452
+ cat_posts_namespace.layout_img_size = cat_posts_namespace.layout_img_size || {};
453
+
454
+ cat_posts_namespace.layout_wrap_text = {
455
+ <?php /* Handle item */ echo "\r\n"; ?>
456
+ preWrap : function (widget) {
457
+ // var _widget = jQuery(widget);
458
+ jQuery(widget).find('.cat-post-item').each(function(){
459
+ var _that = jQuery(this);
460
+ _that.find('p.cpwp-excerpt-text').addClass('cpwp-wrap-text');
461
+ _that.find('p.cpwp-excerpt-text').closest('div').wrap('<div class="cpwp-wrap-text-stage"></div>');;
462
+ });
463
+ return;
464
+ },
465
+ <?php /* Handle add class */ echo "\r\n"; ?>
466
+ add : function(_this){
467
+ var _that = jQuery(_this);
468
+ if (_that.find('p.cpwp-excerpt-text').height() < _that.find('.cat-post-thumbnail').height()) { <?php /* don't move class to do the CSS hack, line's height is smaller as thumb */ echo "\r\n"; ?>
469
+ _that.find('p.cpwp-excerpt-text').closest('.cpwp-wrap-text-stage').removeClass( "cpwp-wrap-text" );
470
+ _that.find('p.cpwp-excerpt-text').addClass( "cpwp-wrap-text" ); <?php /* don't do the CSS hack, just set the class */ echo "\r\n"; ?>
471
+ }else{ <?php /* add the CSS hack, it's needed, text is wrapping, line's height is higher as thumb */ echo "\r\n"; ?>
472
+ _that.find('p.cpwp-excerpt-text').removeClass( "cpwp-wrap-text" );
473
+ _that.find('p.cpwp-excerpt-text').closest('.cpwp-wrap-text-stage').addClass( "cpwp-wrap-text" ); <?php /* text is wrapping, do the CSS hack */ echo "\r\n"; ?>
474
+ }
475
+ return;
476
+ },
477
+ <?php /* Wait for image is loaded */ echo "\r\n"; ?>
478
+ handleLazyLoading : function(_this) {
479
+ var width = jQuery(_this).find('img').width();
480
+ <?php /* image is loaded */ echo "\r\n"; ?>
481
+ if( 0 !== width ){
482
+ cat_posts_namespace.layout_wrap_text.add(_this);
483
+ } else {
484
+ jQuery(_this).find('img').one("load", function(){
485
+ cat_posts_namespace.layout_wrap_text.add(_this);
486
+ });
487
+ }
488
+ return;
489
+ },
490
+ <?php /* Handle post items */ echo "\r\n"; ?>
491
+ setClass : function (widget) {
492
+ // var _widget = jQuery(widget);
493
+ jQuery(widget).find('.cat-post-item').each(function(){
494
+ cat_posts_namespace.layout_wrap_text.handleLazyLoading(this);
495
+ });
496
+ return;
497
+ }
498
+ }
499
+ cat_posts_namespace.layout_img_size = {
500
+ <?php /* Handle replace */ echo "\r\n"; ?>
501
+ replace : function(_this){
502
+ var _that = jQuery(_this),
503
+ resp_w = _that.width(),
504
+ resp_h = _that.height(),
505
+ orig_w = _that.data('cat-posts-width'),
506
+ orig_h = _that.data('cat-posts-height');
507
+ <?php /* replace height */ echo "\r\n"; ?>
508
+ if( resp_w < orig_w ){
509
+ _that.height( resp_w * orig_h / orig_w );
510
+ } else {
511
+ _that.height( '' );
512
+ }
513
+ return;
514
+ },
515
+ <?php /* Wait for image is loaded */ echo "\r\n"; ?>
516
+ handleLazyLoading : function(_this) {
517
+ var width = jQuery(_this).width();
518
+ <?php /* image is loaded */ echo "\r\n"; ?>
519
+ if( 0 !== width ){
520
+ cat_posts_namespace.layout_img_size.replace(_this);
521
+ } else {
522
+ jQuery(_this).one("load", function(){
523
+ cat_posts_namespace.layout_img_size.replace(_this);
524
+ });
525
+ }
526
+ return;
527
+ },
528
+ setHeight : function (widget) {
529
+ jQuery(widget).find('.cat-post-item img').each(function(){
530
+ cat_posts_namespace.layout_img_size.handleLazyLoading(this);
531
+ });
532
+ return;
533
+ }
534
+ }
535
+
536
+ var widget = jQuery('#<?php echo esc_attr( $number ); ?>');
537
+
538
+ <?php /* do once on document ready */ echo "\r\n"; ?>
539
+ cat_posts_namespace.layout_wrap_text.preWrap(widget);
540
+
541
+ <?php /* do on page load or on resize the browser window */ echo "\r\n"; ?>
542
+ jQuery(window).on('load resize', function() {
543
+ cat_posts_namespace.layout_wrap_text.setClass(widget);
544
+ <?php /* No ratio calculation if one or more dimensions is set to 0 */ echo "\r\n"; ?>
545
+ <?php if ( isset( $widgetsettings['thumb_w'] ) && 0 !== intval( $widgetsettings['thumb_w'] ) &&
546
+ isset( $widgetsettings['thumb_h'] ) && 0 !== intval( $widgetsettings['thumb_h'] ) ) : echo "\r\n"; ?>
547
+ cat_posts_namespace.layout_img_size.setHeight(widget);
548
+ <?php endif; echo "\r\n"; ?>
549
+ });
550
+ });
551
+ }
552
+ </script>
553
+ <?php
554
+ endif;
555
+ }
556
+
557
  /*
558
  * shortcode section.
559
  */
685
  'hideNoThumb' => false,
686
  'footer_link_text' => '',
687
  'footer_link' => '',
688
+ 'item_title_level' => 'Inline',
689
  'thumb_w' => get_option( 'thumbnail_size_w', 150 ),
690
  'thumb_fluid_width' => 100,
691
  'thumb_h' => get_option( 'thumbnail_size_h', 150 ),
 
692
  'thumb_hover' => 'none',
693
  'hide_post_titles' => false,
694
+ 'excerpt_lines' => 4,
695
  'excerpt_length' => 0,
696
+ 'excerpt_more_text' => __( '', 'category-posts' ),
697
  'excerpt_filters' => false,
698
  'comment_num' => false,
699
  'date_link' => false,
700
  'date_format' => '',
701
  'disable_css' => false,
702
  'disable_font_styles' => false,
703
+ 'disable_theme_styles' => false,
704
  'show_post_format' => 'none',
705
  'no_cat_childs' => false,
706
  'everything_is_link' => false,
797
  $posts = get_posts( $args );
798
 
799
  if ( count( $posts ) > 0 ) {
800
+ $wp_customize->add_panel(
801
+ __NAMESPACE__,
802
+ array(
803
+ 'title' => __( 'Category Posts Shortcode', 'category-posts' ),
804
+ 'priority' => 300,
805
+ 'capability' => 'edit_theme_options',
806
+ )
807
+ );
808
 
809
  foreach ( $posts as $p ) {
810
  $widget = new Widget();
840
  $section_title = __( '[shortcode]', 'category-posts' );
841
  }
842
 
843
+ $wp_customize->add_section(
844
+ __NAMESPACE__ . '-' . $p->id . '-' . $k,
845
+ array(
846
+ 'title' => $section_title,
847
+ 'priority' => 10,
848
+ 'capability' => 'edit_theme_options',
849
+ 'panel' => __NAMESPACE__,
850
+ )
851
+ );
852
 
853
  ob_start();
854
 
861
 
862
  $widget->form( $m );
863
  $form = ob_get_clean();
864
+ $form = preg_replace_callback(
865
+ '/<(input|select|textarea)\s+.*name=("|\').*\[\w*\]\[([^\]]*)\][^>]*>/',
866
  function ( $matches ) use ( $p, $wp_customize, $m, $k ) {
867
  $setting = '_virtual-' . WIDGET_BASE_ID . '[' . $p->ID . '][' . $k . '][' . $matches[3] . ']';
868
  if ( ! isset( $m[ $matches[3] ] ) ) {
869
  $m[ $matches[3] ] = null;
870
  }
871
+ $wp_customize->add_setting(
872
+ $setting,
873
+ array(
874
+ 'default' => $m[ $matches[3] ], // set default to current value.
875
+ 'type' => 'option',
876
+ )
877
+ );
878
 
879
  return str_replace( '<' . $matches[1], '<' . $matches[1] . ' data-customize-setting-link="' . $setting . '"', $matches[0] );
880
  },
1032
  if ( is_array( $meta ) && isset( $meta['editor'] ) ) {
1033
  ;
1034
  } else {
1035
+ $locales['cat-posts'] = plugin_dir_path( __FILE__ ) . 'tinymce-translations.php';
1036
  }
1037
  }
1038
 
1080
  if ( isset( $meta['editor'] ) ) {
1081
  $editor = true;
1082
  }
1083
+ ?>
1084
  <h3 id="<?php echo __NAMESPACE__; ?>"><?php esc_html_e( 'Category Posts Widget behaviour settings', 'category-posts' ); ?></h3>
1085
 
1086
  <table class="form-table">
1099
  </td>
1100
  </tr>
1101
  </table>
1102
+ <?php
1103
  }
1104
 
1105
  add_action( 'personal_options_update', __NAMESPACE__ . '\personal_options_update' );
class-shortcode-control.php CHANGED
@@ -1,62 +1,62 @@
1
- <?php
2
- /**
3
- * Costumizer Shortcode control class implementation.
4
- *
5
- * @package categoryposts.
6
- *
7
- * @since 4.9
8
- */
9
-
10
- namespace categoryPosts;
11
-
12
- // Don't call the file directly.
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- /**
18
- * Costumizer Shortcode control.
19
- *
20
- * @since 4.9
21
- */
22
- class ShortCode_Control extends \WP_Customize_Control {
23
-
24
- /**
25
- * The form that should be displayed in the control.
26
- *
27
- * @var string
28
- *
29
- * @since 4.7
30
- */
31
- public $form;
32
-
33
- /**
34
- * The suffix of the title to be displayed in the control (unescaped).
35
- *
36
- * @var string
37
- *
38
- * @since 4.7
39
- */
40
- public $title_postfix;
41
-
42
- /**
43
- * Render the control.
44
- *
45
- * @since 4.6
46
- */
47
- public function render_content() {
48
- $widget_title = 'Category Posts Shortcode' . $this->title_postfix;
49
- ?>
50
- <div class="widget-top">
51
- <div class="widget-title"><h3><?php echo esc_html( $widget_title ); ?><span class="in-widget-title"></span></h3></div>
52
- </div>
53
- <div class="widget-inside" style="display: block;">
54
- <div class="form">
55
- <div class="widget-content">
56
- <?php echo $this->form; // Xss off. ?>
57
- </div>
58
- </div>
59
- </div>
60
- <?php
61
- }
62
- }
1
+ <?php
2
+ /**
3
+ * Costumizer Shortcode control class implementation.
4
+ *
5
+ * @package categoryposts.
6
+ *
7
+ * @since 4.9
8
+ */
9
+
10
+ namespace categoryPosts;
11
+
12
+ // Don't call the file directly.
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Costumizer Shortcode control.
19
+ *
20
+ * @since 4.9
21
+ */
22
+ class ShortCode_Control extends \WP_Customize_Control {
23
+
24
+ /**
25
+ * The form that should be displayed in the control.
26
+ *
27
+ * @var string
28
+ *
29
+ * @since 4.7
30
+ */
31
+ public $form;
32
+
33
+ /**
34
+ * The suffix of the title to be displayed in the control (unescaped).
35
+ *
36
+ * @var string
37
+ *
38
+ * @since 4.7
39
+ */
40
+ public $title_postfix;
41
+
42
+ /**
43
+ * Render the control.
44
+ *
45
+ * @since 4.6
46
+ */
47
+ public function render_content() {
48
+ $widget_title = 'Category Posts Shortcode' . $this->title_postfix;
49
+ ?>
50
+ <div class="widget-top">
51
+ <div class="widget-title"><h3><?php echo esc_html( $widget_title ); ?><span class="in-widget-title"></span></h3></div>
52
+ </div>
53
+ <div class="widget-inside" style="display: block;">
54
+ <div class="form">
55
+ <div class="widget-content">
56
+ <?php echo $this->form; // Xss off. ?>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ <?php
61
+ }
62
+ }
class-virtual-widget.php CHANGED
@@ -1,412 +1,414 @@
1
- <?php
2
- /**
3
- * Implementation of virtual widget.
4
- *
5
- * @package categoryposts.
6
- *
7
- * @since 4.7
8
- */
9
-
10
- namespace categoryPosts;
11
-
12
- // Don't call the file directly.
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- /**
18
- * Class that represent a virtual widget. Each widget being created will have relevant
19
- * CSS output in the header, but still requires a call for getHTML method or renderHTML
20
- * to get or output the HTML
21
- *
22
- * @since 4.7
23
- */
24
- class Virtual_Widget {
25
-
26
- /**
27
- * A container for all the "active" objects
28
- *
29
- * @var Array
30
- *
31
- * @since 4.7
32
- */
33
- private static $collection = array();
34
-
35
- /**
36
- * The identifier use as the id of the root html element when the HTML is generated.
37
- *
38
- * @var string
39
- *
40
- * @since 4.7
41
- */
42
- private $id;
43
-
44
- /**
45
- * The class name to be use us the class attribute on the root html element.
46
- *
47
- * @var string
48
- *
49
- * @since 4.7
50
- */
51
- private $class;
52
-
53
- /**
54
- * Construct the virtual widget. This should happen before wp_head action with priority
55
- * 10 is executed if any CSS output should be generated.
56
- *
57
- * @param string $id The identifier use as the id of the root html element when the HTML
58
- * is generated.
59
- *
60
- * @param string $class The class name to be use us the class attribute on the root html element.
61
- *
62
- * @param array $args The setting to be applied to the widget.
63
- *
64
- * @since 4.7
65
- */
66
- public function __construct( $id, $class, $args ) {
67
- $this->id = $id;
68
- $this->class = $class;
69
- self::$collection[ $id ] = upgrade_settings( $args );
70
- }
71
-
72
- /**
73
- * Do what ever cleanup needed when the object is destroyed.
74
- *
75
- * @since 4.7
76
- */
77
- public function __destruct() {
78
- unset( self::$collection[ $this->id ] );
79
- }
80
-
81
- /**
82
- * Return the HTML of the widget as is generated based on the settings passed at construction time
83
- *
84
- * @return string
85
- *
86
- * @since 4.7
87
- */
88
- public function getHTML() {
89
-
90
- $widget = new Widget();
91
- $widget->number = $this->id; // needed to make a unique id for the widget html element.
92
- ob_start();
93
- $args = self::$collection[ $this->id ];
94
- $args['is_shortcode'] = true; // indicate that we are doing shortcode processing to outputting funtions.
95
- $widget->widget(array(
96
- 'before_widget' => '',
97
- 'after_widget' => '',
98
- 'before_title' => '',
99
- 'after_title' => '',
100
- ), $args);
101
- $ret = ob_get_clean();
102
- $ret = '<div id="' . esc_attr( $this->id ) . '" class="' . esc_attr( $this->class ) . '">' . $ret . '</div>';
103
- return $ret;
104
- }
105
-
106
- /**
107
- * Get an array of HTML pre item, for item starting from a specific position.
108
- *
109
- * @since 4.9
110
- *
111
- * @param int $start The start element (0 based).
112
- * @param int $number The maximal number of elements to return. A value of 0
113
- * Indicates to use the widget settings for that.
114
- * @param string $context The ID of the post in which the items will be displayed.
115
- * A empty string or any value which is not of an ID
116
- * of actual post will be treated as if there is no context.
117
- *
118
- * @return string[] Array of HTML per element with the $start element first
119
- * $start+1 next etc. An empty array is returned if there
120
- * are no applicable items.
121
- */
122
- public function get_elements_HTML( $start, $number, $context ) {
123
- $ret = array();
124
-
125
- $widget = new Widget();
126
- $widget->number = $this->id; // needed to make a unique id for the widget html element.
127
-
128
- $ret = $widget->get_elements_HTML( self::$collection[ $this->id ], $context, $start, $number );
129
- return $ret;
130
- }
131
-
132
- /**
133
- * Output the widget HTML
134
- *
135
- * Just a wrapper that output getHTML
136
- *
137
- * @return void
138
- *
139
- * @since 4.7
140
- */
141
- public function renderHTML() {
142
- echo $this->getHTML(); // Xss off. Raw HTML is generated elsewhre.
143
- }
144
-
145
- /**
146
- * Calculate the CSS rules required for the widget as is generated based on the settings passed at construction time
147
- *
148
- * @param bool $is_shortcode Indicated if rules are generated for a shortcode.
149
- * @param array $rules "returned" Collection of CSS rules.
150
- *
151
- * @since 4.7
152
- */
153
- public function getCSSRules( $is_shortcode, &$rules ) {
154
- $ret = array();
155
- $settings = self::$collection[ $this->id ];
156
- $widget_id = $this->id;
157
- if ( ! $is_shortcode ) {
158
- $widget_id .= '-internal';
159
- }
160
- $disable_css = isset( $settings['disable_css'] ) && $settings['disable_css'];
161
-
162
- if ( ! $disable_css ) { // checks if css disable is not set.
163
-
164
- $styles = array( // styles that should be applied to all widgets.
165
- 'normalize' => 'ul {padding: 0;}',
166
- 'thumb_clenup' => '.cat-post-item img {max-width: initial; max-height: initial; margin: initial;}',
167
- 'author_clenup' => '.cat-post-author {margin-bottom: 0;}',
168
- 'thumb' => '.cat-post-thumbnail {margin: 5px 10px 5px 0;}',
169
- 'item_clenup' => '.cat-post-item:before {content: ""; clear: both;}',
170
- );
171
-
172
- if ( ! ( isset( $settings['disable_font_styles'] ) && $settings['disable_font_styles'] ) ) { // checks if disable font styles is not set.
173
- // add general styles which apply to font styling.
174
- $styles['title_font'] = '.cat-post-title {font-size: 15px;}';
175
- $styles['current_title_font'] = '.cat-post-current .cat-post-title {font-weight: bold; text-transform: uppercase;}';
176
- $styles['date_font'] = '.cat-post-date {font-size: 14px; line-height: 18px; font-style: italic; margin-bottom: 5px;}';
177
- $styles['comment_num_font'] = '.cat-post-comment-num {font-size: 14px; line-height: 18px;}';
178
- }
179
-
180
- /*
181
- * The twenty seventeen theme have a border between the LI elements of a widget,
182
- * so remove our border if we detect its use to avoid conflicting styling.
183
- */
184
- if ( ! $is_shortcode && function_exists( 'twentyseventeen_setup' ) ) {
185
- $styles['item_style'] = '.cat-post-item {list-style: none; list-style-type: none; margin: 0; padding: 3px 0;}';
186
- } else {
187
- $styles['item_style'] = '.cat-post-item {border-bottom: 1px solid #ccc; list-style: none; list-style-type: none; margin: 3px 0; padding: 3px 0;}';
188
- $styles['last_item_style'] = '.cat-post-item:last-child {border-bottom: none;}';
189
- }
190
-
191
- // everything link related styling
192
- // if we are dealing with "everything is a link" option, we need to add the clear:both to the a element, not the div.
193
- if ( isset( $settings['everything_is_link'] ) && $settings['everything_is_link'] ) {
194
- $styles['after_item'] = '.cat-post-item a:after {content: ""; display: table; clear: both;}';
195
- } else {
196
- $styles['after_item'] = '.cat-post-item:after {content: ""; display: table; clear: both;}';
197
- }
198
-
199
-
200
- if ( isset( $settings['template'] ) && preg_match( '/%excerpt%/', $settings['template'] ) ) {
201
- if ( isset( $settings['excerpt_lines'] ) && $settings['excerpt_lines'] != 0 ) {
202
- $styles['excerpt_lines'] = '.cat-post-item p {overflow: hidden;text-overflow: ellipsis;white-space: initial;'.
203
- 'display: -webkit-box;-webkit-line-clamp: '.$settings['excerpt_lines'].';-webkit-box-orient: vertical;}';
204
- }
205
- }
206
-
207
- // add post format css if needed.
208
- if ( isset( $settings['template'] ) && preg_match( '/%thumb%/', $settings['template'] ) ) {
209
- if ( ! isset( $settings['show_post_format'] ) || ( ( 'none' !== $settings['show_post_format'] ) && ( 'nocss' !== $settings['show_post_format'] ) ) ) {
210
- static $fonts_added = false;
211
- if ( ! $fonts_added ) {
212
- $fonturl = esc_url( plugins_url( 'icons/font', __FILE__ ) );
213
- $ret['post_format_font'] = "@font-face {\n" .
214
- "font-family: 'cat_post';\n" .
215
- "src: url('$fonturl/cat_post.eot?58348147');\n" .
216
- "src: url('$fonturl/cat_post.eot?58348147#iefix') format('embedded-opentype'),\n" .
217
- " url('$fonturl/cat_post.woff2?58348147') format('woff2'),\n" .
218
- " url('$fonturl/cat_post.woff?58348147') format('woff'),\n" .
219
- " url('$fonturl/cat_post.ttf?58348147') format('truetype');\n" .
220
- " font-weight: normal;\n" .
221
- " font-style: normal;\n" .
222
- "}\n";
223
- }
224
- $fonts_added = true;
225
-
226
- $placement = '';
227
- switch ( $settings['show_post_format'] ) {
228
- case 'topleft':
229
- $placement = 'top:10%; left:10%;';
230
- break;
231
- case 'bottomleft':
232
- $placement = 'bottom:10%; left:10%;';
233
- break;
234
- case 'ceter':
235
- $placement = 'top:calc(50% - 34px); left:calc(50% - 34px);';
236
- break;
237
- case 'topright':
238
- $placement = 'top:10%; right:10%;';
239
- break;
240
- case 'bottomright':
241
- $placement = 'bottom:10%; right:10%;';
242
- break;
243
- }
244
- $styles['post_format_thumb'] = '.cat-post-thumbnail span {position:relative}';
245
- $styles['post_format_icon_styling'] = '.cat-post-format:after {font-family: "cat_post"; position:absolute; color:#FFFFFF; font-size:64px; line-height: 1; ' . $placement . '}';
246
-
247
- $styles['post_format_icon_aside'] = ".cat-post-format-aside:after { content: '\\f0f6'; }";
248
- $styles['post_format_icon_chat'] = ".cat-post-format-chat:after { content: '\\e802'; }";
249
- $styles['post_format_icon_gallery'] = ".cat-post-format-gallery:after { content: '\\e805'; }";
250
- $styles['post_format_icon_link'] = ".cat-post-format-link:after { content: '\\e809'; }";
251
- $styles['post_format_icon_image'] = ".cat-post-format-image:after { content: '\\e800'; }";
252
- $styles['post_format_icon_quote'] = ".cat-post-format-quote:after { content: '\\f10d'; }";
253
- $styles['post_format_icon_status'] = ".cat-post-format-status:after { content: '\\e80a'; }";
254
- $styles['post_format_icon_video'] = ".cat-post-format-video:after { content: '\\e801'; }";
255
- $styles['post_format_icon_audio'] = ".cat-post-format-audio:after { content: '\\e803'; }";
256
-
257
- }
258
- }
259
-
260
- foreach ( $styles as $key => $style ) {
261
- $ret[ $key ] = '#' . $widget_id . ' ' . $style;
262
- }
263
-
264
- if ( $is_shortcode ) {
265
- // Twenty Sixteen Theme adds underlines to links with box whadow wtf ...
266
- $ret['twentysixteen_thumb'] = '#' . $widget_id . ' .cat-post-thumbnail {box-shadow:none}'; // this for the thumb link.
267
- if ( ! ( isset( $settings['disable_font_styles'] ) && $settings['disable_font_styles'] ) ) { // checks if disable font styles is not set.
268
- $ret['twentysixteen_tag_link'] = '#' . $widget_id . ' .cat-post-tax-tag a {box-shadow:none}'; // this for the tag link.
269
- $ret['twentysixteen_tag_span'] = '#' . $widget_id . ' .cat-post-tax-tag span {box-shadow:none}'; // this for the tag link.
270
- }
271
- // Twenty Fifteen Theme adds border ...
272
- $ret['twentyfifteen_thumb'] = '#' . $widget_id . ' .cat-post-thumbnail {border:0}'; // this for the thumb link.
273
- if ( ! ( isset( $settings['disable_font_styles'] ) && $settings['disable_font_styles'] ) ) { // checks if disable font styles is not set.
274
- $ret['twentysixteen_tag_link'] = '#' . $widget_id . ' .cat-post-tax-tag a {border:0}'; // this for the tag link.
275
- $ret['twentysixteen_tag_span'] = '#' . $widget_id . ' .cat-post-tax-tag span {border:0}'; // this for the tag link.
276
- }
277
- }
278
-
279
- // probably all Themes have too much margin on their p element when used in the shortcode or widget.
280
- $ret['p_styling'] = '#' . $widget_id . ' p {margin:5px 0 0 0}'; // since on bottom it will make the spacing on cover
281
- // bigger (add to the padding) use only top for now.
282
- $ret['div_styling'] = '#' . $widget_id . ' li > div {margin:5px 0 0 0; clear:both;}'; // Add margin between the rows.
283
-
284
- // use WP dashicons in the template (e.g. for premade Template 'All and icons').
285
- $ret['dashicons'] = '#' . $widget_id . ' .dashicons {vertical-align:middle;}';
286
- }
287
-
288
- // Regardless if css is disabled we need some styling for the thumbnail
289
- // to make sure cropping is properly done, and they fit the allocated space.
290
- if ( isset( $settings['template'] ) && preg_match( '/%thumb%/', $settings['template'], $m, PREG_OFFSET_CAPTURE ) ) {
291
- $wrap = isset( $settings['text_do_not_wrap_thumb'] ) && $settings['text_do_not_wrap_thumb'];
292
- if ( isset( $settings['use_css_cropping'] ) && $settings['use_css_cropping'] ) {
293
- if ( isset( $settings['thumb_w'] ) && $settings['thumb_w'] != 0 ) {
294
- $ret['thumb_empty_w'] = '#' . $widget_id .' .cat-post-thumbnail .cat-post-crop img {width: '.$settings['thumb_w'].'px;}';
295
- }
296
- if ( isset( $settings['thumb_h'] ) && $settings['thumb_h'] != 0 ) {
297
- $ret['thumb_crop_h'] = '#' . $widget_id . ' .cat-post-thumbnail .cat-post-crop img {height: '.$settings['thumb_h'].'px;}';
298
- }
299
- $ret['thumb_crop'] = '#' . $widget_id . ' .cat-post-thumbnail .cat-post-crop img {object-fit: cover;max-width:100%;}';
300
-
301
- $ret['thumb_crop_not_supported'] = '#' . $widget_id .' .cat-post-thumbnail .cat-post-crop-not-supported img {width:100%;}';
302
-
303
- if ( ! $wrap ) {
304
- $ret['thumb_fluid_width'] = '#' . $widget_id . ' .cat-post-thumbnail {max-width:' . $settings['thumb_fluid_width'] . '%;}';
305
- } else {
306
- $ret['thumb_fluid_width'] = '#' . $widget_id . ' .cat-post-thumbnail {flex-basis:' . $settings['thumb_fluid_width'] . '%;}';
307
- }
308
- } else {
309
- $ret['thumb_overflow'] = '#' . $widget_id . ' .cat-post-thumbnail span {overflow: hidden; display:inline-block}';
310
- }
311
- $ret['thumb_styling'] = '#' . $widget_id . ' .cat-post-item img {margin: initial;}';
312
-
313
- // Thumbnail related positioning rules.
314
- if ( $wrap ) {
315
- $ret['thumb_flex'] = '#' . $widget_id . ' .cat-post-do-not-wrap-thumbnail {display:flex;}'; // Thumbnail container should flex.
316
- $ret['thumb_flex_length'] = '#' . $widget_id . ' .cat-post-do-not-wrap-thumbnail > div {-webkit-flex: 1; -ms-flex: 1; flex: 1;}'; // Thumbnail container should flex.
317
- }
318
- $ret['text_do_not_wrap_thumb'] = '#' . $widget_id . ' .cat-post-thumbnail {float:left;}';
319
- }
320
-
321
- // Some hover effect require css to work, add it even if CSS is disabled.
322
- if ( isset( $settings['thumb_hover'] ) ) {
323
- switch ( $settings['thumb_hover'] ) {
324
- case 'white':
325
- $ret['white_hover_background'] = '#' . $widget_id . ' .cat-post-white span {background-color: white;}';
326
- $ret['white_hover_thumb'] = '#' . $widget_id . ' .cat-post-white img {padding-bottom: 0 !important; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
327
- $ret['white_hover_transform'] = '#' . $widget_id . ' .cat-post-white:hover img {opacity: 0.8;}';
328
- break;
329
- case 'dark':
330
- $ret['dark_hover_thumb'] = '#' . $widget_id . ' .cat-post-dark img {padding-bottom: 0 !important; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
331
- $ret['dark_hover_transform'] = '#' . $widget_id . ' .cat-post-dark:hover img {-webkit-filter: brightness(75%); -moz-filter: brightness(75%); -ms-filter: brightness(75%); -o-filter: brightness(75%); filter: brightness(75%);}';
332
- break;
333
- case 'scale':
334
- $ret['scale_hover_thumb'] = '#' . $widget_id . ' .cat-post-scale img {margin: initial; padding-bottom: 0 !important; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
335
- $ret['scale_hover_transform'] = '#' . $widget_id . ' .cat-post-scale:hover img {-webkit-transform: scale(1.1, 1.1); -ms-transform: scale(1.1, 1.1); transform: scale(1.1, 1.1);}';
336
- break;
337
- case 'blur':
338
- $ret['blur_hover_thumb'] = '#' . $widget_id . ' .cat-post-blur img {padding-bottom: 0 !important; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
339
- $ret['blur_hover_transform'] = '#' . $widget_id . ' .cat-post-blur:hover img {-webkit-filter: blur(2px); -moz-filter: blur(2px); -o-filter: blur(2px); -ms-filter: blur(2px); filter: blur(2px);}';
340
- break;
341
- case 'icon':
342
- $fonturl = esc_url( plugins_url( 'icons/font', __FILE__ ) );
343
- $ret['icon_hover_font'] = "@font-face {\n" .
344
- "font-family: 'cat_post';\n" .
345
- "src: url('$fonturl/cat_post.eot?58348147');\n" .
346
- "src: url('$fonturl/cat_post.eot?58348147#iefix') format('embedded-opentype'),\n" .
347
- " url('$fonturl/cat_post.woff2?58348147') format('woff2'),\n" .
348
- " url('$fonturl/cat_post.woff?58348147') format('woff'),\n" .
349
- " url('$fonturl/cat_post.ttf?58348147') format('truetype');\n" .
350
- " font-weight: normal;\n" .
351
- " font-style: normal;\n" .
352
- "}\n";
353
-
354
- $ret['icon_hover_thumb'] = '#' . $widget_id . ' .cat-post-format-standard:after {opacity:0; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
355
- $ret['icon_hover_transform'] = '#' . $widget_id . ' .cat-post-thumbnail:hover .cat-post-format-standard:after {opacity:1;}';
356
- if ( isset( $settings['show_post_format'] ) && ( 'none' === $settings['show_post_format'] ) ) {
357
- $ret[] = '#' . $widget_id . ' .cat-post-thumbnail {position:relative}';
358
- $ret[] = '#' . $widget_id . ' .cat-post-icon .cat-post-format:after {font-family: "cat_post"; position:absolute; color:#FFFFFF; font-size:64px; line-height: 1; ' .
359
- 'top:calc(50% - 34px); left:calc(50% - 34px);}';
360
- }
361
- $ret[] = '#' . $widget_id . " .cat-post-format-standard:after {padding-left:12px; content: '\\e806'; }";
362
- break;
363
- }
364
-
365
- if ( $settings['enable_loadmore'] ) {
366
- // $this->id is ued over $widget_id because we need the id of the outer div, not the UL itself.
367
- $ret['loadmore'] = '#' . $this->id . ' .' . __NAMESPACE__ . '-loadmore {text-align:center;margin-top:10px}';
368
- }
369
- }
370
- $rules[] = $ret;
371
- }
372
-
373
- /**
374
- * Output the widget CSS
375
- *
376
- * Just a wrapper that output getCSSRules
377
- *
378
- * @param bool $is_shortcode Indicates if we are in the context os a shortcode.
379
- *
380
- * @since 4.7
381
- */
382
- public function outputCSS( $is_shortcode ) {
383
- $rules = array();
384
- getCSSRules( $is_shortcode, $rules );
385
- foreach ( $rules as $rule ) {
386
- echo "$rule\n"; // Xss off - raw css can not be html escaped.
387
- }
388
- }
389
-
390
- /**
391
- * Get the id the virtual widget was registered with
392
- *
393
- * @return string
394
- *
395
- * @since 4.7
396
- */
397
- public function id() {
398
- return $this->id;
399
- }
400
-
401
- /**
402
- * Get all the setting of the virtual widgets in an array
403
- *
404
- * @return array
405
- *
406
- * @since 4.7
407
- */
408
- public static function getAllSettings() {
409
- return self::$collection;
410
- }
411
-
412
- }
 
 
1
+ <?php
2
+ /**
3
+ * Implementation of virtual widget.
4
+ *
5
+ * @package categoryposts.
6
+ *
7
+ * @since 4.7
8
+ */
9
+
10
+ namespace categoryPosts;
11
+
12
+ // Don't call the file directly.
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Class that represent a virtual widget. Each widget being created will have relevant
19
+ * CSS output in the header, but still requires a call for getHTML method or renderHTML
20
+ * to get or output the HTML
21
+ *
22
+ * @since 4.7
23
+ */
24
+ class Virtual_Widget {
25
+
26
+ /**
27
+ * A container for all the "active" objects
28
+ *
29
+ * @var Array
30
+ *
31
+ * @since 4.7
32
+ */
33
+ private static $collection = array();
34
+
35
+ /**
36
+ * The identifier use as the id of the root html element when the HTML is generated.
37
+ *
38
+ * @var string
39
+ *
40
+ * @since 4.7
41
+ */
42
+ private $id;
43
+
44
+ /**
45
+ * The class name to be use us the class attribute on the root html element.
46
+ *
47
+ * @var string
48
+ *
49
+ * @since 4.7
50
+ */
51
+ private $class;
52
+
53
+ /**
54
+ * Construct the virtual widget. This should happen before wp_head action with priority
55
+ * 10 is executed if any CSS output should be generated.
56
+ *
57
+ * @param string $id The identifier use as the id of the root html element when the HTML
58
+ * is generated.
59
+ *
60
+ * @param string $class The class name to be use us the class attribute on the root html element.
61
+ *
62
+ * @param array $args The setting to be applied to the widget.
63
+ *
64
+ * @since 4.7
65
+ */
66
+ public function __construct( $id, $class, $args ) {
67
+ $this->id = $id;
68
+ $this->class = $class;
69
+ self::$collection[ $id ] = upgrade_settings( $args );
70
+ }
71
+
72
+ /**
73
+ * Do what ever cleanup needed when the object is destroyed.
74
+ *
75
+ * @since 4.7
76
+ */
77
+ public function __destruct() {
78
+ unset( self::$collection[ $this->id ] );
79
+ }
80
+
81
+ /**
82
+ * Return the HTML of the widget as is generated based on the settings passed at construction time
83
+ *
84
+ * @return string
85
+ *
86
+ * @since 4.7
87
+ */
88
+ public function getHTML() {
89
+
90
+ $widget = new Widget();
91
+ $widget->number = $this->id; // needed to make a unique id for the widget html element.
92
+ ob_start();
93
+ $args = self::$collection[ $this->id ];
94
+ $args['is_shortcode'] = true; // indicate that we are doing shortcode processing to outputting funtions.
95
+ $widget->widget(
96
+ array(
97
+ 'before_widget' => '',
98
+ 'after_widget' => '',
99
+ 'before_title' => '',
100
+ 'after_title' => '',
101
+ ),
102
+ $args
103
+ );
104
+ $ret = ob_get_clean();
105
+ $ret = '<div id="' . esc_attr( $this->id ) . '" class="' . esc_attr( $this->class ) . '">' . $ret . '</div>';
106
+ return $ret;
107
+ }
108
+
109
+ /**
110
+ * Get an array of HTML pre item, for item starting from a specific position.
111
+ *
112
+ * @since 4.9
113
+ *
114
+ * @param int $start The start element (0 based).
115
+ * @param int $number The maximal number of elements to return. A value of 0
116
+ * Indicates to use the widget settings for that.
117
+ * @param string $context The ID of the post in which the items will be displayed.
118
+ * A empty string or any value which is not of an ID
119
+ * of actual post will be treated as if there is no context.
120
+ *
121
+ * @return string[] Array of HTML per element with the $start element first
122
+ * $start+1 next etc. An empty array is returned if there
123
+ * are no applicable items.
124
+ */
125
+ public function get_elements_HTML( $start, $number, $context ) {
126
+ $ret = array();
127
+
128
+ $widget = new Widget();
129
+ $widget->number = $this->id; // needed to make a unique id for the widget html element.
130
+
131
+ $ret = $widget->get_elements_HTML( self::$collection[ $this->id ], $context, $start, $number );
132
+ return $ret;
133
+ }
134
+
135
+ /**
136
+ * Output the widget HTML
137
+ *
138
+ * Just a wrapper that output getHTML
139
+ *
140
+ * @return void
141
+ *
142
+ * @since 4.7
143
+ */
144
+ public function renderHTML() {
145
+ echo $this->getHTML(); // Xss off. Raw HTML is generated elsewhre.
146
+ }
147
+
148
+ /**
149
+ * Calculate the CSS rules required for the widget as is generated based on the settings passed at construction time
150
+ *
151
+ * @param bool $is_shortcode Indicated if rules are generated for a shortcode.
152
+ * @param array $rules "returned" Collection of CSS rules.
153
+ *
154
+ * @since 4.7
155
+ */
156
+ public function getCSSRules( $is_shortcode, &$rules ) {
157
+ $ret = array();
158
+ $settings = self::$collection[ $this->id ];
159
+ $everything_is_link = isset( $settings['everything_is_link'] ) && $settings['everything_is_link'];
160
+
161
+ $widget_id = $this->id;
162
+ if ( ! $is_shortcode ) {
163
+ $widget_id .= '-internal';
164
+ }
165
+ $disable_css = isset( $settings['disable_css'] ) && $settings['disable_css'];
166
+
167
+ if ( ! $disable_css ) { // checks if css disable is not set.
168
+
169
+ $styles = array( // styles that should be applied to all widgets.
170
+ 'normalize' => 'ul {padding: 0;}',
171
+ 'thumb_clenup' => '.cat-post-item img {max-width: initial; max-height: initial; margin: initial;}',
172
+ 'author_clenup' => '.cat-post-author {margin-bottom: 0;}',
173
+ 'thumb' => '.cat-post-thumbnail {margin: 5px 10px 5px 0;}',
174
+ 'item_clenup' => '.cat-post-item:before {content: ""; clear: both;}',
175
+ 'more_link' => '.cat-post-excerpt-more {display: inline-block;}',
176
+ );
177
+
178
+ if ( ! ( isset( $settings['disable_font_styles'] ) && $settings['disable_font_styles'] ) ) { // checks if disable font styles is not set.
179
+ // add general styles which apply to font styling.
180
+ $styles['current_title_font'] = '.cat-post-current .cat-post-title {font-weight: bold; text-transform: uppercase;}';
181
+ $styles['post-taxs'] = '[class*=cat-post-tax] {font-size: 0.85em;}';
182
+ $styles['post-tax-childs'] = '[class*=cat-post-tax] * {display:inline-block;}';
183
+ }
184
+
185
+ /*
186
+ * The twenty seventeen theme have a border between the LI elements of a widget,
187
+ * so remove our border if we detect its use to avoid conflicting styling.
188
+ */
189
+ if ( ! $is_shortcode && function_exists( 'twentyseventeen_setup' ) ) {
190
+ $styles['item_style'] = '.cat-post-item {list-style: none; list-style-type: none; margin: 0; padding: 3px 0 10px;}';
191
+ } else {
192
+ $styles['item_style'] = '.cat-post-item {border-bottom: 1px solid #ccc; list-style: none; list-style-type: none; margin: 3px 0 10px; padding: 3px 0;}';
193
+ $styles['last_item_style'] = '.cat-post-item:last-child {border-bottom: none;}';
194
+ }
195
+
196
+ // everything link related styling
197
+ // if we are dealing with "everything is a link" option, we need to add the clear:both to the a element, not the div.
198
+ if ( $everything_is_link ) {
199
+ $styles['after_item'] = '.cat-post-item a:after {content: ""; display: table; clear: both;}';
200
+ } else {
201
+ $styles['after_item'] = '.cat-post-item:after {content: ""; display: table; clear: both;}';
202
+ }
203
+
204
+ // wrap text around image.
205
+ if ( isset( $settings['template'] ) && preg_match( '/%excerpt%/', $settings['template'] ) ) {
206
+ $selector_wrap_text = 'p.cpwp-excerpt-text';
207
+ $no_wrap = isset( $settings['text_do_not_wrap_thumb'] ) && $settings['text_do_not_wrap_thumb'];
208
+ if ( ! $no_wrap ) {
209
+ // wrap thumb and line-clamp: set the CSS two parent knotes higher (first parent for float, second parent is a browser hack for that float works well).
210
+ $styles['wrap_thumb'] = '.cpwp-wrap-text p {display: inline;}';
211
+ $selector_wrap_text = '.cpwp-wrap-text';
212
+ }
213
+ $styles['excerpt_lines'] = '.cat-post-item ' . $selector_wrap_text . ' {overflow: hidden;text-overflow: ellipsis;white-space: initial;' .
214
+ 'display: -webkit-box;-webkit-line-clamp: ' . $settings['excerpt_lines'] . ';-webkit-box-orient: vertical;padding-bottom: 0 !important;}';
215
+ // float text instead wrap and don't hide the excerpt if there is no space
216
+ $styles['float_min_nowrap'] = 'p.cpwp-excerpt-text {min-width: 25px;}';
217
+ }
218
+
219
+ // add post format css if needed.
220
+ if ( isset( $settings['template'] ) && preg_match( '/%thumb%/', $settings['template'] ) ) {
221
+ if ( ! isset( $settings['show_post_format'] ) || ( ( 'none' !== $settings['show_post_format'] ) && ( 'nocss' !== $settings['show_post_format'] ) ) ) {
222
+ static $fonts_added = false;
223
+ if ( ! $fonts_added ) {
224
+ $fonturl = esc_url( plugins_url( 'icons/font', __FILE__ ) );
225
+ $ret['post_format_font'] = "@font-face {\n" .
226
+ "font-family: 'cat_post';\n" .
227
+ "src: url('$fonturl/cat_post.eot?58348147');\n" .
228
+ "src: url('$fonturl/cat_post.eot?58348147#iefix') format('embedded-opentype'),\n" .
229
+ " url('$fonturl/cat_post.woff2?58348147') format('woff2'),\n" .
230
+ " url('$fonturl/cat_post.woff?58348147') format('woff'),\n" .
231
+ " url('$fonturl/cat_post.ttf?58348147') format('truetype');\n" .
232
+ " font-weight: normal;\n" .
233
+ " font-style: normal;\n" .
234
+ "}\n";
235
+ }
236
+ $fonts_added = true;
237
+
238
+ $placement = '';
239
+ switch ( $settings['show_post_format'] ) {
240
+ case 'topleft':
241
+ $placement = 'top:10%; left:10%;';
242
+ break;
243
+ case 'bottomleft':
244
+ $placement = 'bottom:10%; left:10%;';
245
+ break;
246
+ case 'ceter':
247
+ $placement = 'top:calc(50% - 34px); left:calc(50% - 34px);';
248
+ break;
249
+ case 'topright':
250
+ $placement = 'top:10%; right:10%;';
251
+ break;
252
+ case 'bottomright':
253
+ $placement = 'bottom:10%; right:10%;';
254
+ break;
255
+ }
256
+ $styles['post_format_thumb'] = '.cat-post-thumbnail span {position:relative; display:inline-block;}';
257
+ $styles['post_format_icon_styling'] = '.cat-post-format:after {font-family: "cat_post"; position:absolute; color:#FFFFFF; font-size:64px; line-height: 1; ' . $placement . '}';
258
+
259
+ $styles['post_format_icon_aside'] = ".cat-post-format-aside:after { content: '\\f0f6'; }";
260
+ $styles['post_format_icon_chat'] = ".cat-post-format-chat:after { content: '\\e802'; }";
261
+ $styles['post_format_icon_gallery'] = ".cat-post-format-gallery:after { content: '\\e805'; }";
262
+ $styles['post_format_icon_link'] = ".cat-post-format-link:after { content: '\\e809'; }";
263
+ $styles['post_format_icon_image'] = ".cat-post-format-image:after { content: '\\e800'; }";
264
+ $styles['post_format_icon_quote'] = ".cat-post-format-quote:after { content: '\\f10d'; }";
265
+ $styles['post_format_icon_status'] = ".cat-post-format-status:after { content: '\\e80a'; }";
266
+ $styles['post_format_icon_video'] = ".cat-post-format-video:after { content: '\\e801'; }";
267
+ $styles['post_format_icon_audio'] = ".cat-post-format-audio:after { content: '\\e803'; }";
268
+
269
+ }
270
+ }
271
+
272
+ // everything link related styling
273
+ // if we are dealing with "everything is a link" option, we need to add the clear:both to the a element, not the div.
274
+ if ( $everything_is_link ) {
275
+ $styles['clear_previous_item'] = '.cat-post-item a:after {content: ""; clear: both;}';
276
+ } else {
277
+ $styles['clear_previous_item'] = '.cat-post-item:after {content: ""; display: table; clear: both;}';
278
+ }
279
+
280
+ foreach ( $styles as $key => $style ) {
281
+ $ret[ $key ] = '#' . $widget_id . ' ' . $style;
282
+ }
283
+
284
+ if ( $is_shortcode ) {
285
+ // Twenty Sixteen Theme adds underlines to links with box whadow wtf ...
286
+ $ret['twentysixteen_thumb'] = '#' . $widget_id . ' .cat-post-thumbnail {box-shadow:none}'; // this for the thumb link.
287
+ if ( ! ( isset( $settings['disable_font_styles'] ) && $settings['disable_font_styles'] ) ) { // checks if disable font styles is not set.
288
+ $ret['twentysixteen_tag_link'] = '#' . $widget_id . ' .cat-post-tax-tag a {box-shadow:none}'; // this for the tag link.
289
+ $ret['twentysixteen_tag_span'] = '#' . $widget_id . ' .cat-post-tax-tag span {box-shadow:none}'; // this for the tag link.
290
+ }
291
+ // Twenty Fifteen Theme adds border ...
292
+ $ret['twentyfifteen_thumb'] = '#' . $widget_id . ' .cat-post-thumbnail {border:0}'; // this for the thumb link.
293
+ if ( ! ( isset( $settings['disable_font_styles'] ) && $settings['disable_font_styles'] ) ) { // checks if disable font styles is not set.
294
+ $ret['twentysixteen_tag_link'] = '#' . $widget_id . ' .cat-post-tax-tag a {border:0}'; // this for the tag link.
295
+ $ret['twentysixteen_tag_span'] = '#' . $widget_id . ' .cat-post-tax-tag span {border:0}'; // this for the tag link.
296
+ }
297
+ }
298
+
299
+ // localized widget CSS rules for the thumbnail.
300
+ $ret['left'] = '#' . $widget_id . ' .cat-post-thumbnail {display:block; float:left; margin:5px 10px 5px 0;}';
301
+ $ret['crop'] = '#' . $widget_id . ' .cat-post-crop {overflow:hidden;display:block;}';
302
+
303
+ // probably all Themes have too much margin on their p element when used in the shortcode or widget.
304
+ $ret['p_styling'] = '#' . $widget_id . ' p {margin:5px 0 0 0}'; // since on bottom it will make the spacing on cover
305
+ // bigger (add to the padding) use only top for now.
306
+ $ret['div_styling'] = '#' . $widget_id . ' li > div {margin:5px 0 0 0; clear:both;}'; // Add margin between the rows.
307
+
308
+ // use WP dashicons in the template (e.g. for premade Template 'All and icons').
309
+ $ret['dashicons'] = '#' . $widget_id . ' .dashicons {vertical-align:middle;}';
310
+ }
311
+
312
+ // Regardless if css is disabled we need some styling for the thumbnail
313
+ // to make sure cropping is properly done, and they fit the allocated space.
314
+ if ( isset( $settings['template'] ) && preg_match( '/%thumb%/', $settings['template'], $m, PREG_OFFSET_CAPTURE ) ) {
315
+ if ( isset( $settings['thumb_h'] ) && 0 !== intval( $settings['thumb_h'] ) ) {
316
+ $ret['thumb_crop_h'] = '#' . $widget_id . ' .cat-post-thumbnail .cat-post-crop img {height: ' . $settings['thumb_h'] . 'px;}';
317
+ }
318
+ $ret['thumb_crop'] = '#' . $widget_id . ' .cat-post-thumbnail .cat-post-crop img {object-fit: cover; max-width: 100%; display: block;}';
319
+ $ret['thumb_crop_not_supported'] = '#' . $widget_id . ' .cat-post-thumbnail .cat-post-crop-not-supported img {width: 100%;}';
320
+ $ret['thumb_fluid_width'] = '#' . $widget_id . ' .cat-post-thumbnail {max-width:' . $settings['thumb_fluid_width'] . '%;}';
321
+ $ret['thumb_styling'] = '#' . $widget_id . ' .cat-post-item img {margin: initial;}';
322
+ }
323
+
324
+ // Some hover effect require css to work, add it even if CSS is disabled.
325
+ if ( isset( $settings['thumb_hover'] ) ) {
326
+ switch ( $settings['thumb_hover'] ) {
327
+ case 'white':
328
+ $ret['white_hover_background'] = '#' . $widget_id . ' .cat-post-white span {background-color: white;}';
329
+ $ret['white_hover_thumb'] = '#' . $widget_id . ' .cat-post-white img {padding-bottom: 0 !important; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
330
+ $ret['white_hover_transform'] = '#' . $widget_id . ' .cat-post-white:hover img {opacity: 0.8;}';
331
+ break;
332
+ case 'dark':
333
+ $ret['dark_hover_thumb'] = '#' . $widget_id . ' .cat-post-dark img {padding-bottom: 0 !important; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
334
+ $ret['dark_hover_transform'] = '#' . $widget_id . ' .cat-post-dark:hover img {-webkit-filter: brightness(75%); -moz-filter: brightness(75%); -ms-filter: brightness(75%); -o-filter: brightness(75%); filter: brightness(75%);}';
335
+ break;
336
+ case 'scale':
337
+ $ret['scale_hover_thumb'] = '#' . $widget_id . ' .cat-post-scale img {margin: initial; padding-bottom: 0 !important; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
338
+ $ret['scale_hover_transform'] = '#' . $widget_id . ' .cat-post-scale:hover img {-webkit-transform: scale(1.1, 1.1); -ms-transform: scale(1.1, 1.1); transform: scale(1.1, 1.1);}';
339
+ break;
340
+ case 'blur':
341
+ $ret['blur_hover_thumb'] = '#' . $widget_id . ' .cat-post-blur img {padding-bottom: 0 !important; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
342
+ $ret['blur_hover_transform'] = '#' . $widget_id . ' .cat-post-blur:hover img {-webkit-filter: blur(2px); -moz-filter: blur(2px); -o-filter: blur(2px); -ms-filter: blur(2px); filter: blur(2px);}';
343
+ break;
344
+ case 'icon':
345
+ $fonturl = esc_url( plugins_url( 'icons/font', __FILE__ ) );
346
+ $ret['icon_hover_font'] = "@font-face {\n" .
347
+ "font-family: 'cat_post';\n" .
348
+ "src: url('$fonturl/cat_post.eot?58348147');\n" .
349
+ "src: url('$fonturl/cat_post.eot?58348147#iefix') format('embedded-opentype'),\n" .
350
+ " url('$fonturl/cat_post.woff2?58348147') format('woff2'),\n" .
351
+ " url('$fonturl/cat_post.woff?58348147') format('woff'),\n" .
352
+ " url('$fonturl/cat_post.ttf?58348147') format('truetype');\n" .
353
+ " font-weight: normal;\n" .
354
+ " font-style: normal;\n" .
355
+ "}\n";
356
+
357
+ $ret['icon_hover_thumb'] = '#' . $widget_id . ' .cat-post-format-standard:after {opacity:0; -webkit-transition: all 0.3s ease; -moz-transition: all 0.3s ease; -ms-transition: all 0.3s ease; -o-transition: all 0.3s ease; transition: all 0.3s ease;}';
358
+ $ret['icon_hover_transform'] = '#' . $widget_id . ' .cat-post-thumbnail:hover .cat-post-format-standard:after {opacity:1;}';
359
+ if ( isset( $settings['show_post_format'] ) && ( 'none' === $settings['show_post_format'] ) ) {
360
+ $ret[] = '#' . $widget_id . ' .cat-post-thumbnail span {position:relative; display:inline-block;}';
361
+ $ret[] = '#' . $widget_id . ' .cat-post-icon .cat-post-format:after {font-family: "cat_post"; position:absolute; color:#FFFFFF; font-size:64px; line-height: 1; ' .
362
+ 'top:calc(50% - 34px); left:calc(50% - 34px);}';
363
+ }
364
+ $ret[] = '#' . $widget_id . " .cat-post-format-standard:after {padding-left:12px; content: '\\e806'; }";
365
+ break;
366
+ }
367
+ }
368
+ if ( $settings['enable_loadmore'] ) {
369
+ // $this->id is ued over $widget_id because we need the id of the outer div, not the UL itself.
370
+ $ret['loadmore'] = '#' . $this->id . ' .' . __NAMESPACE__ . '-loadmore {text-align:center;margin-top:10px}';
371
+ }
372
+ $rules[] = $ret;
373
+ }
374
+
375
+ /**
376
+ * Output the widget CSS
377
+ *
378
+ * Just a wrapper that output getCSSRules
379
+ *
380
+ * @param bool $is_shortcode Indicates if we are in the context os a shortcode.
381
+ *
382
+ * @since 4.7
383
+ */
384
+ public function outputCSS( $is_shortcode ) {
385
+ $rules = array();
386
+ getCSSRules( $is_shortcode, $rules );
387
+ foreach ( $rules as $rule ) {
388
+ echo "$rule\n"; // Xss off - raw css can not be html escaped.
389
+ }
390
+ }
391
+
392
+ /**
393
+ * Get the id the virtual widget was registered with
394
+ *
395
+ * @return string
396
+ *
397
+ * @since 4.7
398
+ */
399
+ public function id() {
400
+ return $this->id;
401
+ }
402
+
403
+ /**
404
+ * Get all the setting of the virtual widgets in an array
405
+ *
406
+ * @return array
407
+ *
408
+ * @since 4.7
409
+ */
410
+ public static function getAllSettings() {
411
+ return self::$collection;
412
+ }
413
+
414
+ }
class-virtual-widgets-repository.php CHANGED
@@ -1,89 +1,89 @@
1
- <?php
2
- /**
3
- * Implementation of virtual widget repository.
4
- *
5
- * @package categoryposts.
6
- *
7
- * @since 4.7
8
- */
9
-
10
- namespace categoryPosts;
11
-
12
- // Don't call the file directly.
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- /**
18
- * Class that implement a simple repository for the virtual widgets representing
19
- * actuall shortcode and widgets
20
- *
21
- * @since 4.7
22
- */
23
- class Virtual_Widgets_Repository {
24
-
25
- /**
26
- * Collection of objects representing shortcodes.
27
- *
28
- * @var array
29
- *
30
- * @since 4.7
31
- */
32
- private static $shortcodeCollection = array();
33
-
34
- /**
35
- * Collection of objects representing widgets.
36
- *
37
- * @var array
38
- *
39
- * @since 4.7
40
- */
41
- private static $widgetCollection = array();
42
-
43
- /**
44
- * Add a virtual widget representing a shortcode to the repository
45
- *
46
- * @param string $index A name to identify the specific shortcode.
47
- * @param Virtual_Widget $widget The virtual widget for it.
48
- *
49
- * @since 4.7
50
- */
51
- public function addShortcode( $index, $widget ) {
52
- self::$shortcodeCollection[ $index ] = $widget;
53
- }
54
-
55
- /**
56
- * Get all the virtual widgets representing actual shortcodes
57
- *
58
- * @return array
59
- *
60
- * @since 4.7
61
- */
62
- public function getShortcodes() {
63
- return self::$shortcodeCollection;
64
- }
65
-
66
- /**
67
- * Add a virtual widget representing awidget to the repository
68
- *
69
- * @param string $index A name to identify the specific widget.
70
- * @param Virtual_Widget $widget The virstual widget for it.
71
- *
72
- * @since 4.7
73
- */
74
- public function addWidget( $index, $widget ) {
75
- self::$widgetCollection[ $index ] = $widget;
76
- }
77
-
78
- /**
79
- * Get all the virtual widgets representing actual widgets
80
- *
81
- * @return array
82
- *
83
- * @since 4.7
84
- */
85
- public function getWidgets() {
86
- return self::$widgetCollection;
87
- }
88
-
89
- }
1
+ <?php
2
+ /**
3
+ * Implementation of virtual widget repository.
4
+ *
5
+ * @package categoryposts.
6
+ *
7
+ * @since 4.7
8
+ */
9
+
10
+ namespace categoryPosts;
11
+
12
+ // Don't call the file directly.
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Class that implement a simple repository for the virtual widgets representing
19
+ * actuall shortcode and widgets
20
+ *
21
+ * @since 4.7
22
+ */
23
+ class Virtual_Widgets_Repository {
24
+
25
+ /**
26
+ * Collection of objects representing shortcodes.
27
+ *
28
+ * @var array
29
+ *
30
+ * @since 4.7
31
+ */
32
+ private static $shortcodeCollection = array();
33
+
34
+ /**
35
+ * Collection of objects representing widgets.
36
+ *
37
+ * @var array
38
+ *
39
+ * @since 4.7
40
+ */
41
+ private static $widgetCollection = array();
42
+
43
+ /**
44
+ * Add a virtual widget representing a shortcode to the repository
45
+ *
46
+ * @param string $index A name to identify the specific shortcode.
47
+ * @param Virtual_Widget $widget The virtual widget for it.
48
+ *
49
+ * @since 4.7
50
+ */
51
+ public function addShortcode( $index, $widget ) {
52
+ self::$shortcodeCollection[ $index ] = $widget;
53
+ }
54
+
55
+ /**
56
+ * Get all the virtual widgets representing actual shortcodes
57
+ *
58
+ * @return array
59
+ *
60
+ * @since 4.7
61
+ */
62
+ public function getShortcodes() {
63
+ return self::$shortcodeCollection;
64
+ }
65
+
66
+ /**
67
+ * Add a virtual widget representing awidget to the repository
68
+ *
69
+ * @param string $index A name to identify the specific widget.
70
+ * @param Virtual_Widget $widget The virstual widget for it.
71
+ *
72
+ * @since 4.7
73
+ */
74
+ public function addWidget( $index, $widget ) {
75
+ self::$widgetCollection[ $index ] = $widget;
76
+ }
77
+
78
+ /**
79
+ * Get all the virtual widgets representing actual widgets
80
+ *
81
+ * @return array
82
+ *
83
+ * @since 4.7
84
+ */
85
+ public function getWidgets() {
86
+ return self::$widgetCollection;
87
+ }
88
+
89
+ }
class-widget.php CHANGED
@@ -38,7 +38,6 @@ class Widget extends \WP_Widget {
38
  * Used as a filter for the thumb wordpress API to add css based stretching and cropping
39
  * when the image is not at the requested dimensions
40
  *
41
- * @param string $html The original HTML generated by the core APIS.
42
  * @param int $post_id the ID of the post of which the thumb is a featured image.
43
  * @param int $post_thumbnail_id The id of the featured image attachment.
44
  * @param string|array $size The requested size identified by name or (width, height) array.
@@ -47,39 +46,50 @@ class Widget extends \WP_Widget {
47
  *
48
  * @since 4.1
49
  */
50
- public function post_thumbnail_html( $html, $post_id, $post_thumbnail_id, $size, $attr ) {
51
-
52
- $use_css_cropping = isset( $this->instance['use_css_cropping'] ) && $this->instance['use_css_cropping'];
53
- $thumb = isset( $this->instance['template'] ) && preg_match( '/%thumb%/', $this->instance['template'] );
54
-
55
- if ( ! ( $use_css_cropping && $thumb ) ) {
56
- return $html;
 
 
 
 
 
 
 
57
  }
58
- $meta = image_get_intermediate_size( $post_thumbnail_id, $size );
59
 
60
- if ( empty( $meta ) ) {
61
- $post_img = wp_get_attachment_metadata( $post_thumbnail_id, $size );
62
- $meta['file'] = basename( $post_img['file'] );
 
63
  }
64
 
65
- $origfile = get_attached_file( $post_thumbnail_id, true ); // the location of the full file.
66
- $file = dirname( $origfile ) . '/' . $meta['file']; // the location of the file displayed as thumb.
67
- if ( file_exists( $file ) ) {
68
- list( $width, $height ) = getimagesize( $file ); // get actual size of the thumb file.
 
 
 
 
69
 
70
- if ( isset( $this->instance['use_css_cropping'] ) && $this->instance['use_css_cropping'] ) {
71
- $show_post_format = isset( $this->instance['show_post_format'] ) && ( 'none' !== $this->instance['show_post_format'] );
72
- if ( $show_post_format || $this->instance['thumb_hover'] ) {
73
- $format = get_post_format() ? : 'standard';
74
- $post_format_class = 'cat-post-format cat-post-format-' . $format;
75
- }
76
- $html = '<span class="cat-post-crop ' . $post_format_class . '">' . $html . '</span>';
77
- } else {
78
- // use_css_cropping is not used.
79
- // wrap span.
80
- $html = '<span>' . $html . '</span>';
81
- }
82
  }
 
 
83
  return $html;
84
  }
85
 
@@ -102,22 +112,21 @@ class Widget extends \WP_Widget {
102
  $size = 'post-thumbnail';
103
  } elseif ( is_array( $size ) && ( 2 === count( $size ) ) ) { // good format at least.
104
  // normalize to ints first.
105
- $size[0] = (int) $size[0];
106
- $size[1] = (int) $size[1];
107
- if ( ( 0 === $size[0] ) && ( 0 === $size[1] ) ) { // Both values zero then revert to thumbnail.
108
- $size = array( get_option( 'thumbnail_size_w', 150 ), get_option( 'thumbnail_size_h', 150 ) );
109
- } elseif ( ( 0 === $size[0] ) && ( 0 !== $size[1] ) ) {
110
- // if thumb width 0 set to max/full widths for wp rendering
111
  $post_thumb = get_the_post_thumbnail( get_the_ID(), 'full' );
112
  preg_match( '/(?<=width=")[\d]*/', $post_thumb, $thumb_full_w );
113
  $size[0] = $thumb_full_w[0];
114
- } elseif ( ( 0 !== $size[0] ) && ( 0 === $size[1] ) ) {
115
- // if thumb height 0 get full thumb for ratio and calc height with ratio
116
  $post_thumb = get_the_post_thumbnail( get_the_ID(), 'full' );
117
  preg_match( '/(?<=width=")[\d]*/', $post_thumb, $thumb_full_w );
118
  preg_match( '/(?<=height=")[\d]*/', $post_thumb, $thumb_full_h );
119
  $ratio = $thumb_full_w[0] / $thumb_full_h[0];
120
- $size[1] = intval( $size[0] / $ratio );
121
  }
122
  } else {
123
  $size = array( get_option( 'thumbnail_size_w', 150 ), get_option( 'thumbnail_size_h', 150 ) ); // yet another form of junk.
@@ -129,12 +138,7 @@ class Widget extends \WP_Widget {
129
  }
130
 
131
  do_action( 'begin_fetch_post_thumbnail_html', get_the_ID(), $post_thumbnail_id, $size );
132
- $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, '' );
133
- if ( ! $html ) {
134
- $ret = '';
135
- } else {
136
- $ret = $this->post_thumbnail_html( $html, get_the_ID(), $post_thumbnail_id, $size, '' );
137
- }
138
  do_action( 'end_fetch_post_thumbnail_html', get_the_ID(), $post_thumbnail_id, $size );
139
 
140
  return $ret;
@@ -176,8 +180,10 @@ class Widget extends \WP_Widget {
176
  * @since 4.6
177
  */
178
  public function queryArgs( $instance ) {
 
 
 
179
 
180
- $valid_sort_orders = array( 'date', 'title', 'comment_count', 'rand' );
181
  if ( isset( $instance['sort_by'] ) && in_array( $instance['sort_by'], $valid_sort_orders, true ) ) {
182
  $sort_by = $instance['sort_by'];
183
  } else {
@@ -225,14 +231,17 @@ class Widget extends \WP_Widget {
225
  }
226
 
227
  if ( isset( $instance['hideNoThumb'] ) && $instance['hideNoThumb'] ) {
228
- $args = array_merge( $args, array(
229
- 'meta_query' => array(
230
- array(
231
- 'key' => '_thumbnail_id',
232
- 'compare' => 'EXISTS',
 
 
 
233
  ),
234
- ),
235
- ) );
236
  }
237
 
238
  switch ( $instance['date_range'] ) {
@@ -324,6 +333,39 @@ class Widget extends \WP_Widget {
324
  return $ret;
325
  }
326
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
327
  /**
328
  * Get the URL of the blog page or home page if no explicit blog page is defined.
329
  *
@@ -479,7 +521,10 @@ class Widget extends \WP_Widget {
479
  $date = get_the_time( $date_format );
480
  break;
481
  }
482
- $ret .= '<span class="cat-post-date"' . $attr . '>';
 
 
 
483
  if ( isset( $instance['date_link'] ) && $instance['date_link'] && ! $everything_is_link ) {
484
  $ret .= '<a href="' . \get_the_permalink() . '">';
485
  }
@@ -546,7 +591,9 @@ class Widget extends \WP_Widget {
546
  */
547
  public function itemCategories( $instance, $everything_is_link ) {
548
 
549
- $ret = '<span class="cat-post-tax-category">';
 
 
550
  $cat_ids = wp_get_post_categories( get_the_ID(), array( 'number' => 0 ) );
551
  foreach ( $cat_ids as $cat_id ) {
552
  if ( $everything_is_link ) {
@@ -569,7 +616,9 @@ class Widget extends \WP_Widget {
569
  */
570
  public function itemTags( $instance, $everything_is_link ) {
571
 
572
- $ret = '<span class="cat-post-tax-tag">';
 
 
573
  $tag_ids = wp_get_post_tags( get_the_ID(), array( 'number' => 0 ) );
574
  foreach ( $tag_ids as $tag_id ) {
575
  if ( $everything_is_link ) {
@@ -593,7 +642,7 @@ class Widget extends \WP_Widget {
593
  public function itemCommentNum( $instance, $everything_is_link ) {
594
  global $post;
595
 
596
- $ret = '<span class="cat-post-comment-num">';
597
 
598
  if ( $everything_is_link ) {
599
  $ret .= '(' . \get_comments_number() . ')';
@@ -621,7 +670,9 @@ class Widget extends \WP_Widget {
621
  */
622
  public function itemAuthor( $instance, $everything_is_link ) {
623
 
624
- $ret = '<span class="cat-post-author">';
 
 
625
 
626
  if ( $everything_is_link ) {
627
  $ret .= get_the_author();
@@ -678,10 +729,42 @@ class Widget extends \WP_Widget {
678
  $excerpt = shortcode_unautop( wpautop( convert_chars( convert_smilies( wptexturize( $excerpt ) ) ) ) );
679
  }
680
  }
 
681
  $ret = apply_filters( 'cpw_excerpt', $excerpt, $this );
682
  return $ret;
683
  }
684
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
685
  /**
686
  * Current post item title string
687
  *
@@ -701,6 +784,9 @@ class Widget extends \WP_Widget {
701
  $ret .= ' href="' . get_the_permalink() . '" rel="bookmark">' . get_the_title();
702
  $ret .= '</a>';
703
  }
 
 
 
704
  return $ret;
705
  }
706
 
@@ -719,7 +805,7 @@ class Widget extends \WP_Widget {
719
  global $post;
720
 
721
  $everything_is_link = isset( $instance['everything_is_link'] ) && $instance['everything_is_link'];
722
- $wrap = isset( $instance['text_do_not_wrap_thumb'] ) && $instance['text_do_not_wrap_thumb'];
723
 
724
  $template = '';
725
  if ( isset( $instance['template'] ) ) {
@@ -741,46 +827,40 @@ class Widget extends \WP_Widget {
741
  $ret .= '<a class="cat-post-everything-is-link" href="' . get_the_permalink() . '" title="">';
742
  }
743
 
744
- // Try to do smart formatting for floating thumb based on its location.
745
- if ( $wrap ) {
746
- if ( preg_match( '#(\%thumb\%)#', $template ) && ! preg_match( '#(\%thumb\%$)#', $template ) ) {
747
- $thumb_flex = explode( '%thumb%', $template );
748
- if ( 1 === count( $thumb_flex ) ) {
749
- $template = '<div class="cat-post-do-not-wrap-thumbnail">%thumb%<div>' . $thumb_flex[0] . '</div></div>';
750
- }
751
- if ( 2 === count( $thumb_flex ) ) {
752
- $template = $thumb_flex[0] . '<div class="cat-post-do-not-wrap-thumbnail">%thumb%<div>' . $thumb_flex[1] . '</div></div>';
753
- }
754
- }
755
- }
756
-
757
  // Post details (Template).
758
  $widget = $this;
759
- $template_res = preg_replace_callback( get_template_regex(), function ( $matches ) use ( $widget, $instance, $everything_is_link ) {
760
- switch ( $matches[0] ) {
761
- case '%title%':
762
- return $widget->itemTitle( $instance, $everything_is_link );
763
- case '%author%':
764
- return $widget->itemAuthor( $instance, $everything_is_link );
765
- case '%commentnum%':
766
- return $widget->itemCommentNum( $instance, $everything_is_link );
767
- case '%date%':
768
- return $widget->itemDate( $instance, $everything_is_link );
769
- case '%thumb%':
770
- return $widget->itemThumb( $instance, $everything_is_link );
771
- case '%post_tag%':
772
- return $widget->itemTags( $instance, $everything_is_link );
773
- case '%category%':
774
- return $widget->itemCategories( $instance, $everything_is_link );
775
- case '%excerpt%':
776
- return $widget->itemExcerpt( $instance, $everything_is_link );
777
- default:
778
- return $matches[0];
779
- }
780
- }, $template );
 
 
 
 
 
 
781
 
782
  // Replace empty line with closing and opening DIV.
783
  $template_res = trim( $template_res );
 
784
  $template_res = str_replace( "\n\r", '</div><div>', $template_res ); // in widget areas.
785
  $template_res = str_replace( "\n\n", '</div><div>', $template_res ); // as shortcode.
786
  $template_res = '<div>' . $template_res . '</div>';
@@ -796,7 +876,19 @@ class Widget extends \WP_Widget {
796
  }
797
 
798
  $ret .= '</li>';
799
- return $ret;
 
 
 
 
 
 
 
 
 
 
 
 
800
  }
801
 
802
  /**
@@ -927,6 +1019,28 @@ class Widget extends \WP_Widget {
927
  }
928
 
929
  wp_reset_postdata();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
930
  } elseif ( 'text' === $instance['no_match_handling'] ) {
931
  echo $before_widget; // Xss ok. This is how widget actually expected to behave.
932
  echo $this->titleHTML( $before_title, $after_title, $instance );
@@ -962,7 +1076,7 @@ class Widget extends \WP_Widget {
962
 
963
  $this->instance = $instance;
964
 
965
- if($start > 0) {
966
  $instance['offset'] = $start;
967
  }
968
  $number = (int) $number; // sanitize number with the side effect of non
@@ -1056,36 +1170,51 @@ class Widget extends \WP_Widget {
1056
  <label>
1057
  <?php esc_html_e( 'Category', 'category-posts' ); ?>:
1058
  <?php
1059
- wp_dropdown_categories( array(
1060
- 'show_option_all' => __( 'All categories', 'category-posts' ),
1061
- 'hide_empty' => 0,
1062
- 'name' => $this->get_field_name( 'cat' ),
1063
- 'selected' => $instance['cat'],
1064
- 'class' => 'categoryposts-data-panel-filter-cat',
1065
- ) );
 
 
1066
  ?>
1067
  </label>
1068
  </p>
1069
  <?php
1070
  echo $this->get_checkbox_block_html( $instance, 'no_cat_childs', esc_html__( 'Exclude child categories', 'category-posts' ), ! empty( $instance['cat'] ) );
1071
- echo $this->get_select_block_html( $instance, 'status', esc_html__( 'Status', 'category-posts' ), array(
1072
- 'default' => esc_html__( 'WordPress Default', 'category-posts' ),
1073
- 'publish' => esc_html__( 'Published', 'category-posts' ),
1074
- 'future' => esc_html__( 'Scheduled', 'category-posts' ),
1075
- 'private' => esc_html__( 'Private', 'category-posts' ),
1076
- 'publish,future' => esc_html__( 'Published or Scheduled', 'category-posts' ),
1077
- 'private,publish' => esc_html__( 'Published or Private', 'category-posts' ),
1078
- 'private,future' => esc_html__( 'Private or Scheduled', 'category-posts' ),
1079
- 'private,publish,future' => esc_html__( 'Published, Private or Scheduled', 'category-posts' ),
1080
- ), 'default', true );
 
 
 
 
 
 
1081
  echo $this->get_number_input_block_html( $instance, 'num', esc_html__( 'Number of posts to show', 'category-posts' ), 1, '', '', true );
1082
  echo $this->get_number_input_block_html( $instance, 'offset', esc_html__( 'Start with post', 'category-posts' ), 1, '', '', true );
1083
- echo $this->get_select_block_html( $instance, 'date_range', esc_html__( 'Date Range', 'category-posts' ), array(
1084
- 'off' => esc_html__( 'Off', 'category-posts' ),
1085
- 'days_ago' => esc_html__( 'Days ago', 'category-posts' ),
1086
- 'between_dates' => esc_html__( 'Between dates', 'category-posts' ),
1087
- ), 'off', true );
1088
- ?>
 
 
 
 
 
 
 
1089
  <div class="cpwp_ident categoryPosts-date-range" style="display:<?php echo 'off' === $instance['date_range'] ? 'none' : 'block'; ?>">
1090
  <?php
1091
  echo $this->get_number_input_block_html( $instance, 'days_ago', esc_html__( 'Up to', 'category-posts' ), 1, '', '', 'days_ago' === $instance['date_range'] );
@@ -1094,18 +1223,25 @@ class Widget extends \WP_Widget {
1094
  ?>
1095
  </div>
1096
  <?php
1097
- echo $this->get_select_block_html( $instance, 'sort_by', esc_html__( 'Sort by', 'category-posts' ), array(
1098
- 'date' => esc_html__( 'Date', 'category-posts' ),
1099
- 'title' => esc_html__( 'Title', 'category-posts' ),
1100
- 'comment_count' => esc_html__( 'Number of comments', 'category-posts' ),
1101
- 'rand' => esc_html__( 'Random', 'category-posts' ),
1102
- ), 'date', true );
 
 
 
 
 
 
 
1103
  echo $this->get_checkbox_block_html( $instance, 'asc_sort_order', esc_html__( 'Reverse sort order (ascending)', 'category-posts' ), true );
1104
  echo $this->get_checkbox_block_html( $instance, 'exclude_current_post', esc_html__( 'Exclude current post', 'category-posts' ), true );
1105
  echo $this->get_checkbox_block_html( $instance, 'hideNoThumb', esc_html__( 'Exclude posts which have no thumbnail', 'category-posts' ), true );
1106
  ?>
1107
  </div>
1108
- <?php
1109
  }
1110
 
1111
  /**
@@ -1154,6 +1290,10 @@ class Widget extends \WP_Widget {
1154
  $value = $default;
1155
  }
1156
 
 
 
 
 
1157
  $ret = '<label for="' . $this->get_field_id( $key ) . "\">\n" .
1158
  $label .
1159
  "</label>\n" .
@@ -1210,7 +1350,7 @@ class Widget extends \WP_Widget {
1210
  $value = $instance[ $key ];
1211
 
1212
  $ret = '<label for="' . $this->get_field_id( $key ) . "\">\n" .
1213
- $label . "\n" .
1214
  '<input placeholder="' . $placeholder . '" id="' . $this->get_field_id( $key ) . '" name="' . $this->get_field_name( $key ) . '" type="text" value="' . esc_attr( $value ) . '" autocomplete="off"/>' . "\n" .
1215
  "</label>\n";
1216
 
@@ -1227,8 +1367,8 @@ class Widget extends \WP_Widget {
1227
  * expected to be escaped.
1228
  * @param int $min The minimum value allowed to be input.
1229
  * @param int $max The maximum value allowed to be input.
1230
- * @param string $value The start value
1231
- * @param string $step The range of each step
1232
  * @param bool $visible Indicates if the element should be visible when rendered.
1233
  *
1234
  * @return string HTML a P element contaning the input, its label, class based on the key
@@ -1250,7 +1390,7 @@ class Widget extends \WP_Widget {
1250
  }
1251
 
1252
  $ret = '<label for="' . $this->get_field_id( $key ) . "\">\n" .
1253
- esc_html( $label ) . " <span>" . $value . "%</span>\n" .
1254
  '<input id="' . esc_attr( $this->get_field_id( $key ) ) . '" value="' . $value . '" name="' . esc_attr( $this->get_field_name( $key ) ) . '" class="' . esc_attr( $key ) . '" type="range"' . $minMaxStep . ' />' . "\n" .
1255
  "</label>\n";
1256
 
@@ -1361,17 +1501,17 @@ class Widget extends \WP_Widget {
1361
  */
1362
  private function get_button_thumb_size_html( $instance, $key, $label ) {
1363
 
1364
- $datas = "";
1365
 
1366
  switch ( $key ) {
1367
- case "thumb":
1368
- $datas = 'data-thumb-w="' . get_option( "thumbnail_size_w" ) . '" data-thumb-h="' . get_option( "thumbnail_size_h" ) . '"';
1369
  break;
1370
- case "medium":
1371
- $datas = 'data-thumb-w="' . get_option( "medium_size_w" ) . '" data-thumb-h="' . get_option( "medium_size_h" ) . '"';
1372
  break;
1373
- case "large":
1374
- $datas = 'data-thumb-w="' . get_option( "large_size_w" ) . '" data-thumb-h="' . get_option( "large_size_h" ) . '"';
1375
  break;
1376
  }
1377
  $ret = '<button type="button" ' . $datas . ' class="' . $key . ' button">' . esc_html( $label ) . "</button>\n";
@@ -1379,6 +1519,40 @@ class Widget extends \WP_Widget {
1379
  return $ret;
1380
  }
1381
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1382
  /**
1383
  * The widget configuration form back end.
1384
  *
@@ -1396,6 +1570,7 @@ class Widget extends \WP_Widget {
1396
 
1397
  $instance = upgrade_settings( $instance );
1398
 
 
1399
  $hide_post_titles = $instance['hide_post_titles'];
1400
  $excerpt_more_text = $instance['excerpt_more_text'];
1401
  $excerpt_filters = $instance['excerpt_filters'];
@@ -1408,14 +1583,13 @@ class Widget extends \WP_Widget {
1408
  $thumb_fluid_width = $instance['thumb_fluid_width'];
1409
  $thumb_h = $instance['thumb_h'];
1410
  $default_thunmbnail = $instance['default_thunmbnail'];
1411
- $use_css_cropping = $instance['use_css_cropping'];
1412
  $text_do_not_wrap_thumb = $instance['text_do_not_wrap_thumb'];
1413
  ?>
1414
 
1415
  <div class="category-widget-cont">
1416
  <?php if ( ! class_exists( '\\termcategoryPostsPro\\Widget' ) ) { ?>
1417
  <p><a target="_blank" href="http://tiptoppress.com/term-and-category-based-posts-widget/"><?php esc_html_e( 'Get the Pro version', 'category-posts' ); ?></a></p>
1418
- <?php
1419
  }
1420
  $this->formTitlePanel( $instance );
1421
  $this->formFilterPanel( $instance );
@@ -1433,24 +1607,26 @@ class Widget extends \WP_Widget {
1433
  <p><?php esc_html_e( 'Displayed parts', 'category-posts' ); ?></p>
1434
  <div class="cpwp_ident">
1435
  <?php
1436
- $label = esc_html__( 'Template', 'category-posts' ) .
1437
- ' <a href="#" class="dashicons toggle-template-help dashicons-editor-help imgedit-help-toggle"><span class="screen-reader-text">' .
1438
  esc_html__( 'Show template help', 'category-posts' ) . '</span></a>';
1439
- $class_placement = "";
1440
  if ( is_customize_preview() ) {
1441
- $class_placement = "customizer";
1442
  } else {
1443
- $class_placement = "admin-panel";
1444
  }
1445
  $label .= '<span class="cat-post-add_premade_templates ' . $class_placement . '">' .
1446
  '<button type="button" class="button cpwp-open-placholder-dropdown-menu"> + ' . esc_html__( 'Add Placeholder', 'category-posts' ) . '</button>' .
1447
  '<span class="cpwp-placeholder-dropdown-menu">' .
 
1448
  '<span data-value="NewLine">' . esc_html__( 'New line', 'category-posts' ) . '</span>' .
1449
  '<span data-value="EmptyLine">' . esc_html__( 'Empty line', 'category-posts' ) . '</span>' .
1450
  '<span data-value="title">' . esc_html__( '%title%', 'category-posts' ) . '</span>' .
1451
  '<span data-value="thumb">' . esc_html__( '%thumb%', 'category-posts' ) . '</span>' .
1452
  '<span data-value="date">' . esc_html__( '%date%', 'category-posts' ) . '</span>' .
1453
  '<span data-value="excerpt">' . esc_html__( '%excerpt%', 'category-posts' ) . '</span>' .
 
1454
  '<span data-value="author">' . esc_html__( '%author%', 'category-posts' ) . '</span>' .
1455
  '<span data-value="commentnum">' . esc_html__( '%commentnum%', 'category-posts' ) . '</span>' .
1456
  '<span data-value="post_tag">' . esc_html__( '%post_tag%', 'category-posts' ) . '</span>' .
@@ -1459,15 +1635,16 @@ class Widget extends \WP_Widget {
1459
  '</span>';
1460
  ?>
1461
  <?php
1462
- echo $this->get_textarea_html( $instance, 'template', $label , '', true, 8 );
1463
  preg_match_all( get_template_regex(), $template, $matches );
1464
  $tags = array();
1465
  if ( ! empty( $matches[0] ) ) {
1466
  $tags = array_flip( $matches[0] );
1467
  }
1468
  ?>
1469
- <div class="cat-post-template-help">
1470
- <p><?php esc_html_e( 'The following text will be replaced with the relevant information. In addition you can use any text and html (if you have the permisions) anywhere you want', 'category-posts' ); ?>
 
1471
  </p>
1472
  <table>
1473
  <tr>
@@ -1494,6 +1671,10 @@ class Widget extends \WP_Widget {
1494
  <th>%excerpt%</th>
1495
  <td><?php esc_html_e( 'Post excerpt', 'category-posts' ); ?></td>
1496
  </tr>
 
 
 
 
1497
  <tr>
1498
  <th>%author%</th>
1499
  <td><?php esc_html_e( 'Post author', 'category-posts' ); ?></td>
@@ -1515,10 +1696,10 @@ class Widget extends \WP_Widget {
1515
  <div class="cat-post-premade_templates">
1516
  <p><label><?php esc_html_e( 'Select premade Template', 'category-posts' ); ?></label></p>
1517
  <select>
1518
- <option value="title"><?php esc_html_e( 'Only the title', 'category-posts' ); ?></option>
1519
- <option value="title_excerpt"><?php esc_html_e( 'Title and Excerpt', 'category-posts' ); ?></option>
1520
- <option value="title_thumb"><?php esc_html_e( 'Title and Thumbnail', 'category-posts' ); ?></option>
1521
- <option value="title_thum_excerpt"><?php esc_html_e( 'Title, Thumbnail and Excerpt', 'category-posts' ); ?></option>
1522
  <option value="everything"><?php esc_html_e( 'All with icons', 'category-posts' ); ?></option>
1523
  </select>
1524
  <p><button type="button" class="button"><?php esc_html_e( 'Select this template', 'category-posts' ); ?></button></p>
@@ -1527,30 +1708,66 @@ class Widget extends \WP_Widget {
1527
  ?>
1528
  </div>
1529
  </div>
 
 
 
 
 
 
 
 
 
1530
  <?php // Excerpt settings. ?>
1531
  <div class="cpwp-sub-panel categoryposts-data-panel-excerpt" style="display:<?php echo ( isset( $tags['%excerpt%'] ) ) ? 'block' : 'none'; ?>">
1532
  <p><?php esc_html_e( 'Excerpt settings', 'category-posts' ); ?></p>
1533
  <div class="cpwp_ident">
1534
  <?php
1535
  echo $this->get_number_input_block_html( $instance, 'excerpt_lines', esc_html__( 'Lines (responsive):', 'category-posts' ), 0, '', '', true );
1536
- echo $this->get_number_input_block_html( $instance, 'excerpt_length', esc_html__( 'Length (words):', 'category-posts' ), 0, '', '', true );
1537
- echo $this->get_text_input_block_html( $instance, 'excerpt_more_text', esc_html__( '\'More ...\' text:', 'category-posts' ), esc_attr__( '...', 'category-posts' ), true );
 
 
1538
  ?>
1539
  </div>
1540
  </div>
1541
- <?php // Data settings ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1542
  <div class="cpwp-sub-panel categoryposts-data-panel-date" style="display:<?php echo ( isset( $tags['%date%'] ) ) ? 'block' : 'none'; ?>">
1543
  <p><?php esc_html_e( 'Date format settings', 'category-posts' ); ?></p>
1544
  <div class="cpwp_ident">
1545
  <?php
1546
- echo $this->get_select_block_html( $instance, 'preset_date_format', esc_html__( 'Date format', 'category-posts' ), array(
1547
- 'sitedateandtime' => esc_html__( 'Site date and time', 'category-posts' ),
1548
- 'sitedate' => esc_html__( 'Site date', 'category-posts' ),
1549
- 'sincepublished' => esc_html__( 'Time since published', 'category-posts' ),
1550
- 'localsitedateandtime' => esc_html__( 'Reader\'s local date and time', 'category-posts' ),
1551
- 'localsitedate' => esc_html__( 'Reader\'s local date', 'category-posts' ),
1552
- 'other' => esc_html__( 'PHP style format', 'category-posts' ),
1553
- ), 'sitedateandtime', true );
 
 
 
 
 
 
 
1554
  echo $this->get_text_input_block_html( $instance, 'date_format', esc_html__( 'PHP Style Date format', 'category-posts' ), 'j M Y', 'other' === $preset_date_format );
1555
  ?>
1556
  </div>
@@ -1558,13 +1775,22 @@ class Widget extends \WP_Widget {
1558
  <?php // Thumbnail settings. ?>
1559
  <div class="cpwp-sub-panel categoryposts-data-panel-thumb" style="display:<?php echo ( isset( $tags['%thumb%'] ) ) ? 'block' : 'none'; ?>">
1560
  <p><?php esc_html_e( 'Thumbnail settings', 'category-posts' ); ?></p>
1561
- <div class="cpwp_ident">
1562
- <p><?php esc_html_e( 'Thumbnail dimensions (pixel)', 'category-posts' ); ?></p>
 
 
 
 
1563
  <?php
1564
  echo $this->get_number_input_block_html( $instance, 'thumb_w', esc_html__( 'Width:', 'category-posts' ), 1, '', '', true );
1565
  echo $this->get_range_input_block_html( $instance, 'thumb_fluid_width', esc_html__( 'Max-width:', 'category-posts' ), 2, 100, 100, 2, true );
1566
  echo $this->get_number_input_block_html( $instance, 'thumb_h', esc_html__( 'Height:', 'category-posts' ), 1, '', '', true );
1567
  ?>
 
 
 
 
 
1568
  <div class="cat-post-thumb-change-size">
1569
  <p>
1570
  <label><?php esc_html_e( 'Change size', 'category-posts' ); ?>: </label>
@@ -1589,6 +1815,16 @@ class Widget extends \WP_Widget {
1589
  ?>
1590
  </span>
1591
  </p>
 
 
 
 
 
 
 
 
 
 
1592
  <p>
1593
  <label><?php esc_html_e( 'Available', 'category-posts' ); ?>: </label>
1594
  <span class="cpwp-right">
@@ -1602,8 +1838,7 @@ class Widget extends \WP_Widget {
1602
  </div>
1603
  <?php
1604
  echo $this->get_checkbox_block_html( $instance, 'text_do_not_wrap_thumb', esc_html__( 'Do not wrap thumbnail with overflowing text', 'category-posts' ), true );
1605
- echo $this->get_checkbox_block_html( $instance, 'use_css_cropping', esc_html__( 'CSS crop to requested size', 'category-posts' ), false );
1606
- echo $this->get_select_block_html( $instance, 'thumb_hover', esc_html__( 'Animation on mouse hover:', 'category-posts' ), array(
1607
  'none' => esc_html__( 'None', 'category-posts' ),
1608
  'dark' => esc_html__( 'Darker', 'category-posts' ),
1609
  'white' => esc_html__( 'Brighter', 'category-posts' ),
@@ -1611,15 +1846,22 @@ class Widget extends \WP_Widget {
1611
  'blur' => esc_html__( 'Blur', 'category-posts' ),
1612
  'icon' => esc_html__( 'Icon', 'category-posts' ),
1613
  ), 'none', true);
1614
- echo $this->get_select_block_html( $instance, 'show_post_format', esc_html__( 'Indicate post format and position', 'category-posts' ), array(
1615
- 'none' => esc_html__( 'None', 'category-posts' ),
1616
- 'topleft' => esc_html__( 'Top left', 'category-posts' ),
1617
- 'bottomleft' => esc_html__( 'Bottom left', 'category-posts' ),
1618
- 'ceter' => esc_html__( 'Center', 'category-posts' ),
1619
- 'topright' => esc_html__( 'Top right', 'category-posts' ),
1620
- 'bottomright' => esc_html__( 'Bottom right', 'category-posts' ),
1621
- 'nocss' => esc_html__( 'HTML without styling', 'category-posts' ),
1622
- ), 'none', true );
 
 
 
 
 
 
 
1623
  ?>
1624
  <p>
1625
  <label style="display:block">
@@ -1649,25 +1891,36 @@ class Widget extends \WP_Widget {
1649
  </div>
1650
  </div>
1651
  <h4 data-panel="general"><?php esc_html_e( 'General', 'category-posts' ); ?></h4>
1652
- <div>
1653
- <?php echo $this->get_checkbox_block_html( $instance, 'disable_css', esc_html__( 'Disable the built-in CSS', 'category-posts' ), true ); ?>
1654
- <?php echo $this->get_checkbox_block_html( $instance, 'disable_font_styles', esc_html__( 'Disable only font styles', 'category-posts' ), true ); ?>
 
 
 
 
 
1655
  <div class="cpwp_ident">
1656
  <?php
1657
- echo $this->get_select_block_html( $instance, 'no_match_handling', esc_html__( 'When there are no matches', 'category-posts' ), array(
1658
- 'nothing' => esc_html__( 'Display empty widget', 'category-posts' ),
1659
- 'hide' => esc_html__( 'Hide Widget', 'category-posts' ),
1660
- 'text' => esc_html__( 'Show text', 'category-posts' ),
1661
- ), 'nothing', true );
 
 
 
 
 
 
 
1662
  ?>
1663
  <div class="categoryPosts-no-match-text" style="display:<?php echo ( 'text' === $instance['no_match_handling'] ) ? 'block' : 'none'; ?>">
1664
  <?php echo $this->get_textarea_html( $instance, 'no_match_text', esc_html__( 'Text', 'category-posts' ), '', true, 4 ); ?>
1665
  </div>
1666
  </div>
1667
- <div>
1668
- <?php
1669
- echo $this->get_checkbox_block_html( $instance, 'enable_loadmore', esc_html__( 'Enable Load More', 'category-posts' ), true );
1670
- ?>
1671
  <div class="loadmore-settings" style="display:<?php echo ( $instance['enable_loadmore'] ) ? 'block' : 'none'; ?>">
1672
  <?php echo $this->get_text_input_block_html( $instance, 'loadmore_text', esc_html__( 'Button text', 'category-posts' ), '', true ); ?>
1673
  <?php echo $this->get_text_input_block_html( $instance, 'loading_text', esc_html__( 'Loading text', 'category-posts' ), '', true ); ?>
38
  * Used as a filter for the thumb wordpress API to add css based stretching and cropping
39
  * when the image is not at the requested dimensions
40
  *
 
41
  * @param int $post_id the ID of the post of which the thumb is a featured image.
42
  * @param int $post_thumbnail_id The id of the featured image attachment.
43
  * @param string|array $size The requested size identified by name or (width, height) array.
46
  *
47
  * @since 4.1
48
  */
49
+ public function post_thumbnail_html( $post_id, $post_thumbnail_id, $size, $attr ) {
50
+
51
+ // Don't use the thumbnail, if it is cropped
52
+ $thumbSize = array();
53
+ foreach ( get_intermediate_image_sizes() as $thumb ) {
54
+ if ( in_array( $thumb, array('thumbnail') ) ) {
55
+ $thumbSize['width'] = get_option( "{$thumb}_size_w" );
56
+ $thumbSize['height'] = get_option( "{$thumb}_size_h" );
57
+ $thumbSize['crop'] = (bool) get_option( "{$thumb}_crop" );
58
+ }
59
+ }
60
+ if ( $thumbSize['crop'] ) {
61
+ $thumbSize[0] = $size[0] <= $thumbSize['width'] ? ( $thumbSize['width'] + 1 ) : $size[0];
62
+ $thumbSize[1] = $size[1] <= $thumbSize['height'] ? ( $thumbSize['height'] + 1 ) : $size[1];
63
  }
 
64
 
65
+ // HTML generated by the core APIs.
66
+ $html = wp_get_attachment_image( $post_thumbnail_id, $thumbSize, false, array( "data-cat-posts-width" => $size[0], "data-cat-posts-height" => $size[1] ) );
67
+ if ( ! $html ) {
68
+ return '';
69
  }
70
 
71
+ // replace size.
72
+ $array = array();
73
+ preg_match( '/width="([^"]*)"/i', $html, $array );
74
+ $pattern = '/\s' . $array[1] . 'px/';
75
+ $html = preg_replace( $pattern, ' ' . $size[0] . 'px', $html );
76
+ // replace width.
77
+ $pattern = '/width="' . $array[1] . '"/';
78
+ $html = preg_replace( $pattern, 'width="' . $size[0] . '"', $html );
79
 
80
+ // replace height
81
+ $array = array();
82
+ preg_match( '/height="([^"]*)"/i', $html, $array );
83
+ $pattern = '/height="' . $array[1] . '"/';
84
+ $html = preg_replace( $pattern, 'height="' . $size[1] . '"', $html );
85
+
86
+ $show_post_format = isset( $this->instance['show_post_format'] ) && ( 'none' !== $this->instance['show_post_format'] );
87
+ if ( $show_post_format || $this->instance['thumb_hover'] ) {
88
+ $format = get_post_format() ? : 'standard';
89
+ $post_format_class = 'cat-post-format cat-post-format-' . $format;
 
 
90
  }
91
+ $html = '<span class="cat-post-crop ' . $post_format_class . '">' . $html . '</span>';
92
+
93
  return $html;
94
  }
95
 
112
  $size = 'post-thumbnail';
113
  } elseif ( is_array( $size ) && ( 2 === count( $size ) ) ) { // good format at least.
114
  // normalize to ints first.
115
+ list( $width, $height ) = array_map('intval', $size);
116
+ if ( ( 0 === $width ) && ( 0 === $height ) ) { // Both values zero then revert to ratio from the orig with large.
117
+ $size = array( get_option( 'large_size_w', 150 ), get_option( 'large_size_h', 150 ) );
118
+ } elseif ( ( 0 === $width ) && ( 0 !== $height ) ) {
119
+ // if thumb width 0 set to max/full widths for wp rendering.
 
120
  $post_thumb = get_the_post_thumbnail( get_the_ID(), 'full' );
121
  preg_match( '/(?<=width=")[\d]*/', $post_thumb, $thumb_full_w );
122
  $size[0] = $thumb_full_w[0];
123
+ } elseif ( ( 0 !== $width ) && ( 0 === $height ) ) {
124
+ // if thumb height 0 get full thumb for ratio and calc height with ratio.
125
  $post_thumb = get_the_post_thumbnail( get_the_ID(), 'full' );
126
  preg_match( '/(?<=width=")[\d]*/', $post_thumb, $thumb_full_w );
127
  preg_match( '/(?<=height=")[\d]*/', $post_thumb, $thumb_full_h );
128
  $ratio = $thumb_full_w[0] / $thumb_full_h[0];
129
+ $size[1] = intval( $width / $ratio );
130
  }
131
  } else {
132
  $size = array( get_option( 'thumbnail_size_w', 150 ), get_option( 'thumbnail_size_h', 150 ) ); // yet another form of junk.
138
  }
139
 
140
  do_action( 'begin_fetch_post_thumbnail_html', get_the_ID(), $post_thumbnail_id, $size );
141
+ $ret = $this->post_thumbnail_html( get_the_ID(), $post_thumbnail_id, $size, '' );
 
 
 
 
 
142
  do_action( 'end_fetch_post_thumbnail_html', get_the_ID(), $post_thumbnail_id, $size );
143
 
144
  return $ret;
180
  * @since 4.6
181
  */
182
  public function queryArgs( $instance ) {
183
+ $valid_sort_orders = array(
184
+ 'date', 'title', 'comment_count', 'rand'
185
+ );
186
 
 
187
  if ( isset( $instance['sort_by'] ) && in_array( $instance['sort_by'], $valid_sort_orders, true ) ) {
188
  $sort_by = $instance['sort_by'];
189
  } else {
231
  }
232
 
233
  if ( isset( $instance['hideNoThumb'] ) && $instance['hideNoThumb'] ) {
234
+ $args = array_merge(
235
+ $args,
236
+ array(
237
+ 'meta_query' => array(
238
+ array(
239
+ 'key' => '_thumbnail_id',
240
+ 'compare' => 'EXISTS',
241
+ ),
242
  ),
243
+ )
244
+ );
245
  }
246
 
247
  switch ( $instance['date_range'] ) {
333
  return $ret;
334
  }
335
 
336
+ /**
337
+ * Add a heading level
338
+ *
339
+ * @return string The title string
340
+ *
341
+ * @since 5.0
342
+ */
343
+ public function add_heading_level( $instance, $ret, $key ) {
344
+
345
+ switch( $instance[ $key ] ) {
346
+ case 'H1':
347
+ $ret = '<h1>' . $ret . '</h1>';
348
+ break;
349
+ case 'H2':
350
+ $ret = '<h2>' . $ret . '</h2>';
351
+ break;
352
+ case 'H3':
353
+ $ret = '<h3>' . $ret . '</h3>';
354
+ break;
355
+ case 'H4':
356
+ $ret = '<h4>' . $ret . '</h4>';
357
+ break;
358
+ case 'H5':
359
+ $ret = '<h5>' . $ret . '</h5>';
360
+ break;
361
+ case 'H6':
362
+ $ret = '<h6>' . $ret . '</h6>';
363
+ break;
364
+ }
365
+
366
+ return $ret;
367
+ }
368
+
369
  /**
370
  * Get the URL of the blog page or home page if no explicit blog page is defined.
371
  *
521
  $date = get_the_time( $date_format );
522
  break;
523
  }
524
+
525
+ $post_date_class = ( isset( $instance[ 'disable_theme_styles' ] ) && $instance[ 'disable_theme_styles' ] ) ? "" : " post-date";
526
+
527
+ $ret .= '<span class="cat-post-date' . $post_date_class . '"' . $attr . '>';
528
  if ( isset( $instance['date_link'] ) && $instance['date_link'] && ! $everything_is_link ) {
529
  $ret .= '<a href="' . \get_the_permalink() . '">';
530
  }
591
  */
592
  public function itemCategories( $instance, $everything_is_link ) {
593
 
594
+ $post_category_class = ( isset( $instance[ 'disable_theme_styles' ] ) && $instance[ 'disable_theme_styles' ] ) ? "" : " entry-categories post-categories";
595
+
596
+ $ret = '<span class="cat-post-tax-category' . $post_category_class . '">';
597
  $cat_ids = wp_get_post_categories( get_the_ID(), array( 'number' => 0 ) );
598
  foreach ( $cat_ids as $cat_id ) {
599
  if ( $everything_is_link ) {
616
  */
617
  public function itemTags( $instance, $everything_is_link ) {
618
 
619
+ $post_tag_class = ( isset( $instance[ 'disable_theme_styles' ] ) && $instance[ 'disable_theme_styles' ] ) ? "" : " widget_tag_cloud tagcloud post-tags";
620
+
621
+ $ret = '<span class="cat-post-tax-tag' . $post_tag_class . '">';
622
  $tag_ids = wp_get_post_tags( get_the_ID(), array( 'number' => 0 ) );
623
  foreach ( $tag_ids as $tag_id ) {
624
  if ( $everything_is_link ) {
642
  public function itemCommentNum( $instance, $everything_is_link ) {
643
  global $post;
644
 
645
+ $ret = '<span class="cat-post-comment-num comment-meta">';
646
 
647
  if ( $everything_is_link ) {
648
  $ret .= '(' . \get_comments_number() . ')';
670
  */
671
  public function itemAuthor( $instance, $everything_is_link ) {
672
 
673
+ $post_author_class = ( isset( $instance[ 'disable_theme_styles' ] ) && $instance[ 'disable_theme_styles' ] ) ? "" : " post-author";
674
+
675
+ $ret = '<span class="cat-post-author' . $post_author_class . '">';
676
 
677
  if ( $everything_is_link ) {
678
  $ret .= get_the_author();
729
  $excerpt = shortcode_unautop( wpautop( convert_chars( convert_smilies( wptexturize( $excerpt ) ) ) ) );
730
  }
731
  }
732
+ $excerpt = str_replace('<p>', '<p class="cpwp-excerpt-text">', $excerpt);
733
  $ret = apply_filters( 'cpw_excerpt', $excerpt, $this );
734
  return $ret;
735
  }
736
 
737
+ /**
738
+ * Current post item More Link string
739
+ *
740
+ * @param array $instance Array which contains the various settings.
741
+ * @param bool $everything_is_link Indicates whether the return string should avoid links.
742
+ *
743
+ * @since 5.0
744
+ */
745
+ public function itemMoreLink( $instance, $everything_is_link ) {
746
+ global $post;
747
+
748
+ $more_text = '[&hellip;]';
749
+
750
+ if ( isset( $instance['excerpt_more_text'] ) && '' !== $instance['excerpt_more_text'] ) {
751
+ $more_text = ltrim( $instance['excerpt_more_text'] );
752
+ }
753
+
754
+ $more_link_class = ( isset( $instance[ 'disable_theme_styles' ] ) && $instance[ 'disable_theme_styles' ] ) ? "" : " more-link";
755
+
756
+ if ( $everything_is_link ) {
757
+ $ret = ' <span class="cat-post-excerpt-more' . $more_link_class . '">' . $more_text . '</span>';
758
+ } else {
759
+ $ret = ' <a class="cat-post-excerpt-more' . $more_link_class . '" href="' . get_permalink() . '">' . $more_text . '</a>';
760
+ }
761
+
762
+ if ( isset( $instance['excerpt_more_text'] ) && '' === $instance['excerpt_more_text'] ) {
763
+ $ret = '' !== apply_filters( 'excerpt_more', '' ) ? apply_filters( 'excerpt_more', '' ) : $ret;
764
+ }
765
+ return $ret;
766
+ }
767
+
768
  /**
769
  * Current post item title string
770
  *
784
  $ret .= ' href="' . get_the_permalink() . '" rel="bookmark">' . get_the_title();
785
  $ret .= '</a>';
786
  }
787
+
788
+ $ret = $this->add_heading_level( $instance, $ret, 'item_title_level' );
789
+
790
  return $ret;
791
  }
792
 
805
  global $post;
806
 
807
  $everything_is_link = isset( $instance['everything_is_link'] ) && $instance['everything_is_link'];
808
+ $no_wrap = isset( $instance['text_do_not_wrap_thumb'] ) && $instance['text_do_not_wrap_thumb'];
809
 
810
  $template = '';
811
  if ( isset( $instance['template'] ) ) {
827
  $ret .= '<a class="cat-post-everything-is-link" href="' . get_the_permalink() . '" title="">';
828
  }
829
 
 
 
 
 
 
 
 
 
 
 
 
 
 
830
  // Post details (Template).
831
  $widget = $this;
832
+ $template_res = preg_replace_callback(
833
+ get_template_regex(),
834
+ function ( $matches ) use ( $widget, $instance, $everything_is_link ) {
835
+ switch ( $matches[0] ) {
836
+ case '%title%':
837
+ return $widget->itemTitle( $instance, $everything_is_link );
838
+ case '%author%':
839
+ return $widget->itemAuthor( $instance, $everything_is_link );
840
+ case '%commentnum%':
841
+ return $widget->itemCommentNum( $instance, $everything_is_link );
842
+ case '%date%':
843
+ return $widget->itemDate( $instance, $everything_is_link );
844
+ case '%thumb%':
845
+ return $widget->itemThumb( $instance, $everything_is_link );
846
+ case '%post_tag%':
847
+ return $widget->itemTags( $instance, $everything_is_link );
848
+ case '%category%':
849
+ return $widget->itemCategories( $instance, $everything_is_link );
850
+ case '%excerpt%':
851
+ return $widget->itemExcerpt( $instance, $everything_is_link );
852
+ case '%more-link%':
853
+ return $widget->itemMoreLink( $instance, $everything_is_link );
854
+ default:
855
+ return $matches[0];
856
+ }
857
+ },
858
+ $template
859
+ );
860
 
861
  // Replace empty line with closing and opening DIV.
862
  $template_res = trim( $template_res );
863
+
864
  $template_res = str_replace( "\n\r", '</div><div>', $template_res ); // in widget areas.
865
  $template_res = str_replace( "\n\n", '</div><div>', $template_res ); // as shortcode.
866
  $template_res = '<div>' . $template_res . '</div>';
876
  }
877
 
878
  $ret .= '</li>';
879
+ return $this->xss_strip_js( $ret );
880
+ }
881
+
882
+ /**
883
+ * Strip output from Javascript tags
884
+ *
885
+ * @param string $out Render output
886
+ * @return string Striped output
887
+ *
888
+ * @since 5.0
889
+ */
890
+ public function xss_strip_js( $out ) {
891
+ return preg_replace('/<script\b[^>]*>(.*?)<\/script>/is', "", $out);
892
  }
893
 
894
  /**
1019
  }
1020
 
1021
  wp_reset_postdata();
1022
+
1023
+ $number = $this->number;
1024
+ // a temporary hack to handle difference in the number in a true widget
1025
+ // and the number format expected at the rest of the places.
1026
+ if ( is_numeric( $number ) ) {
1027
+ $number = WIDGET_BASE_ID . '-' . $number;
1028
+ }
1029
+ if ( ! ( isset( $instance['is_shortcode'] ) && $instance['is_shortcode'] ) ) { // the internal id is needed only for widgets.
1030
+ $number .= '-internal';
1031
+ }
1032
+
1033
+ // enque relevant scripts and parameters to ensure correct image dimentions.
1034
+ if ( isset( $instance['template'] ) && preg_match( '/%thumb%|%excerpt%/', $instance['template'] ) ) {
1035
+ wp_enqueue_script( 'jquery' ); // just in case the theme or other plugins didn't enqueue it.
1036
+ add_action(
1037
+ 'wp_footer',
1038
+ function () use ( $number, $instance ) {
1039
+ __NAMESPACE__ . '\\' . equal_cover_content_height( $number, $instance );
1040
+ },
1041
+ 100
1042
+ );
1043
+ }
1044
  } elseif ( 'text' === $instance['no_match_handling'] ) {
1045
  echo $before_widget; // Xss ok. This is how widget actually expected to behave.
1046
  echo $this->titleHTML( $before_title, $after_title, $instance );
1076
 
1077
  $this->instance = $instance;
1078
 
1079
+ if ( $start > 0 ) {
1080
  $instance['offset'] = $start;
1081
  }
1082
  $number = (int) $number; // sanitize number with the side effect of non
1170
  <label>
1171
  <?php esc_html_e( 'Category', 'category-posts' ); ?>:
1172
  <?php
1173
+ wp_dropdown_categories(
1174
+ array(
1175
+ 'show_option_all' => __( 'All categories', 'category-posts' ),
1176
+ 'hide_empty' => 0,
1177
+ 'name' => $this->get_field_name( 'cat' ),
1178
+ 'selected' => $instance['cat'],
1179
+ 'class' => 'categoryposts-data-panel-filter-cat',
1180
+ )
1181
+ );
1182
  ?>
1183
  </label>
1184
  </p>
1185
  <?php
1186
  echo $this->get_checkbox_block_html( $instance, 'no_cat_childs', esc_html__( 'Exclude child categories', 'category-posts' ), ! empty( $instance['cat'] ) );
1187
+ echo $this->get_select_block_html(
1188
+ $instance,
1189
+ 'status',
1190
+ esc_html__( 'Status', 'category-posts' ), array(
1191
+ 'default' => esc_html__( 'WordPress Default', 'category-posts' ),
1192
+ 'publish' => esc_html__( 'Published', 'category-posts' ),
1193
+ 'future' => esc_html__( 'Scheduled', 'category-posts' ),
1194
+ 'private' => esc_html__( 'Private', 'category-posts' ),
1195
+ 'publish,future' => esc_html__( 'Published or Scheduled', 'category-posts' ),
1196
+ 'private,publish' => esc_html__( 'Published or Private', 'category-posts' ),
1197
+ 'private,future' => esc_html__( 'Private or Scheduled', 'category-posts' ),
1198
+ 'private,publish,future' => esc_html__( 'Published, Private or Scheduled', 'category-posts' ),
1199
+ ),
1200
+ 'default',
1201
+ true
1202
+ );
1203
  echo $this->get_number_input_block_html( $instance, 'num', esc_html__( 'Number of posts to show', 'category-posts' ), 1, '', '', true );
1204
  echo $this->get_number_input_block_html( $instance, 'offset', esc_html__( 'Start with post', 'category-posts' ), 1, '', '', true );
1205
+ echo $this->get_select_block_html(
1206
+ $instance,
1207
+ 'date_range',
1208
+ esc_html__( 'Date Range', 'category-posts' ),
1209
+ array(
1210
+ 'off' => esc_html__( 'Off', 'category-posts' ),
1211
+ 'days_ago' => esc_html__( 'Days ago', 'category-posts' ),
1212
+ 'between_dates' => esc_html__( 'Between dates', 'category-posts' ),
1213
+ ),
1214
+ 'off',
1215
+ true
1216
+ );
1217
+ ?>
1218
  <div class="cpwp_ident categoryPosts-date-range" style="display:<?php echo 'off' === $instance['date_range'] ? 'none' : 'block'; ?>">
1219
  <?php
1220
  echo $this->get_number_input_block_html( $instance, 'days_ago', esc_html__( 'Up to', 'category-posts' ), 1, '', '', 'days_ago' === $instance['date_range'] );
1223
  ?>
1224
  </div>
1225
  <?php
1226
+ echo $this->get_select_block_html(
1227
+ $instance,
1228
+ 'sort_by',
1229
+ esc_html__( 'Sort by', 'category-posts' ),
1230
+ array(
1231
+ 'date' => esc_html__( 'Date', 'category-posts' ),
1232
+ 'title' => esc_html__( 'Title', 'category-posts' ),
1233
+ 'comment_count' => esc_html__( 'Number of comments', 'category-posts' ),
1234
+ 'rand' => esc_html__( 'Random', 'category-posts' ),
1235
+ ),
1236
+ 'date',
1237
+ true
1238
+ );
1239
  echo $this->get_checkbox_block_html( $instance, 'asc_sort_order', esc_html__( 'Reverse sort order (ascending)', 'category-posts' ), true );
1240
  echo $this->get_checkbox_block_html( $instance, 'exclude_current_post', esc_html__( 'Exclude current post', 'category-posts' ), true );
1241
  echo $this->get_checkbox_block_html( $instance, 'hideNoThumb', esc_html__( 'Exclude posts which have no thumbnail', 'category-posts' ), true );
1242
  ?>
1243
  </div>
1244
+ <?php
1245
  }
1246
 
1247
  /**
1290
  $value = $default;
1291
  }
1292
 
1293
+ if ( '' !== $label ) {
1294
+ $label .= ':';
1295
+ }
1296
+
1297
  $ret = '<label for="' . $this->get_field_id( $key ) . "\">\n" .
1298
  $label .
1299
  "</label>\n" .
1350
  $value = $instance[ $key ];
1351
 
1352
  $ret = '<label for="' . $this->get_field_id( $key ) . "\">\n" .
1353
+ $label . ":\n" .
1354
  '<input placeholder="' . $placeholder . '" id="' . $this->get_field_id( $key ) . '" name="' . $this->get_field_name( $key ) . '" type="text" value="' . esc_attr( $value ) . '" autocomplete="off"/>' . "\n" .
1355
  "</label>\n";
1356
 
1367
  * expected to be escaped.
1368
  * @param int $min The minimum value allowed to be input.
1369
  * @param int $max The maximum value allowed to be input.
1370
+ * @param string $value The start value.
1371
+ * @param string $step The range of each step.
1372
  * @param bool $visible Indicates if the element should be visible when rendered.
1373
  *
1374
  * @return string HTML a P element contaning the input, its label, class based on the key
1390
  }
1391
 
1392
  $ret = '<label for="' . $this->get_field_id( $key ) . "\">\n" .
1393
+ esc_html( $label ) . ' <span>' . $value . "%</span>\n" .
1394
  '<input id="' . esc_attr( $this->get_field_id( $key ) ) . '" value="' . $value . '" name="' . esc_attr( $this->get_field_name( $key ) ) . '" class="' . esc_attr( $key ) . '" type="range"' . $minMaxStep . ' />' . "\n" .
1395
  "</label>\n";
1396
 
1501
  */
1502
  private function get_button_thumb_size_html( $instance, $key, $label ) {
1503
 
1504
+ $datas = '';
1505
 
1506
  switch ( $key ) {
1507
+ case 'thumb':
1508
+ $datas = 'data-thumb-w="' . get_option( 'thumbnail_size_w' ) . '" data-thumb-h="' . get_option( 'thumbnail_size_h' ) . '"';
1509
  break;
1510
+ case 'medium':
1511
+ $datas = 'data-thumb-w="' . get_option( 'medium_size_w' ) . '" data-thumb-h="' . get_option( 'medium_size_h' ) . '"';
1512
  break;
1513
+ case 'large':
1514
+ $datas = 'data-thumb-w="' . get_option( 'large_size_w' ) . '" data-thumb-h="' . get_option( 'large_size_h' ) . '"';
1515
  break;
1516
  }
1517
  $ret = '<button type="button" ' . $datas . ' class="' . $key . ' button">' . esc_html( $label ) . "</button>\n";
1519
  return $ret;
1520
  }
1521
 
1522
+ /**
1523
+ * Generate a form element containing native styled radio buttons
1524
+ *
1525
+ * @since 5.0
1526
+ * @param array $instance The instance.
1527
+ * @param string $key The key in the instance array.
1528
+ * @param string $label The label to display and associate with the checkbox.
1529
+ * should be escaped string.
1530
+ * @param bool $visible Indicates if the element should be visible when rendered.
1531
+ *
1532
+ * @return string HTML a element contaning the radio buttons, it's label, class based on the key
1533
+ * and style set to display:none if visibility is off.
1534
+ */
1535
+ private function get_radio_buttons_block_html( $instance, $key, $values, $label, $visible ) {
1536
+
1537
+ $ret = '<label for="' . esc_attr( $this->get_field_id( $key ) ) . "\">" . $label . ":</label>\n";
1538
+ $ret .= '<span class="cpwp-right">';
1539
+
1540
+ array_map ( function( $value ) use ( &$ret, $instance, $key ) {
1541
+ if ( $instance[ $key ] == $value ) {
1542
+ $checked = true;
1543
+ } else {
1544
+ $checked = false;
1545
+ }
1546
+
1547
+ $ret .= '<input class="' . $value . ' button" id="' . esc_attr( $this->get_field_id( $key . $value ) ) . '" name="' . esc_attr( $this->get_field_name( $key ) ) .
1548
+ '" value="' . $value . '" type="radio" ' . checked( $checked, true, false ) . '/>' . "\n";
1549
+ }, $values );
1550
+
1551
+ $ret .= "</span>\n";
1552
+
1553
+ return $this->get_wrap_block_html( $ret, $key, $visible );
1554
+ }
1555
+
1556
  /**
1557
  * The widget configuration form back end.
1558
  *
1570
 
1571
  $instance = upgrade_settings( $instance );
1572
 
1573
+ $item_title_level = $instance['item_title_level'];
1574
  $hide_post_titles = $instance['hide_post_titles'];
1575
  $excerpt_more_text = $instance['excerpt_more_text'];
1576
  $excerpt_filters = $instance['excerpt_filters'];
1583
  $thumb_fluid_width = $instance['thumb_fluid_width'];
1584
  $thumb_h = $instance['thumb_h'];
1585
  $default_thunmbnail = $instance['default_thunmbnail'];
 
1586
  $text_do_not_wrap_thumb = $instance['text_do_not_wrap_thumb'];
1587
  ?>
1588
 
1589
  <div class="category-widget-cont">
1590
  <?php if ( ! class_exists( '\\termcategoryPostsPro\\Widget' ) ) { ?>
1591
  <p><a target="_blank" href="http://tiptoppress.com/term-and-category-based-posts-widget/"><?php esc_html_e( 'Get the Pro version', 'category-posts' ); ?></a></p>
1592
+ <?php
1593
  }
1594
  $this->formTitlePanel( $instance );
1595
  $this->formFilterPanel( $instance );
1607
  <p><?php esc_html_e( 'Displayed parts', 'category-posts' ); ?></p>
1608
  <div class="cpwp_ident">
1609
  <?php
1610
+ $label = esc_html__( 'Template', 'category-posts' ) .
1611
+ ' <a href="#" class="dashicons toggle-template-help dashicons-editor-help"><span class="screen-reader-text">' .
1612
  esc_html__( 'Show template help', 'category-posts' ) . '</span></a>';
1613
+ $class_placement = '';
1614
  if ( is_customize_preview() ) {
1615
+ $class_placement = 'customizer';
1616
  } else {
1617
+ $class_placement = 'admin-panel';
1618
  }
1619
  $label .= '<span class="cat-post-add_premade_templates ' . $class_placement . '">' .
1620
  '<button type="button" class="button cpwp-open-placholder-dropdown-menu"> + ' . esc_html__( 'Add Placeholder', 'category-posts' ) . '</button>' .
1621
  '<span class="cpwp-placeholder-dropdown-menu">' .
1622
+ '<i class="cpwp-close-placeholder-dropdown-menu dashicons dashicons-no-alt"></i>' .
1623
  '<span data-value="NewLine">' . esc_html__( 'New line', 'category-posts' ) . '</span>' .
1624
  '<span data-value="EmptyLine">' . esc_html__( 'Empty line', 'category-posts' ) . '</span>' .
1625
  '<span data-value="title">' . esc_html__( '%title%', 'category-posts' ) . '</span>' .
1626
  '<span data-value="thumb">' . esc_html__( '%thumb%', 'category-posts' ) . '</span>' .
1627
  '<span data-value="date">' . esc_html__( '%date%', 'category-posts' ) . '</span>' .
1628
  '<span data-value="excerpt">' . esc_html__( '%excerpt%', 'category-posts' ) . '</span>' .
1629
+ '<span data-value="more-link">' . esc_html__( '%more-link%', 'category-posts' ) . '</span>' .
1630
  '<span data-value="author">' . esc_html__( '%author%', 'category-posts' ) . '</span>' .
1631
  '<span data-value="commentnum">' . esc_html__( '%commentnum%', 'category-posts' ) . '</span>' .
1632
  '<span data-value="post_tag">' . esc_html__( '%post_tag%', 'category-posts' ) . '</span>' .
1635
  '</span>';
1636
  ?>
1637
  <?php
1638
+ echo $this->get_textarea_html( $instance, 'template', $label, '', true, 8 );
1639
  preg_match_all( get_template_regex(), $template, $matches );
1640
  $tags = array();
1641
  if ( ! empty( $matches[0] ) ) {
1642
  $tags = array_flip( $matches[0] );
1643
  }
1644
  ?>
1645
+ <div class="cat-post-template-help" style="display:none;">
1646
+ <p><?php echo sprintf( __( 'The following placeholders will be replaced with the relevant information. In addition you can use text, HTML and <a target="_blank" href="%s">Dashicons</a>.', 'category-posts' ),
1647
+ 'https://developer.wordpress.org/resource/dashicons/'); ?>
1648
  </p>
1649
  <table>
1650
  <tr>
1671
  <th>%excerpt%</th>
1672
  <td><?php esc_html_e( 'Post excerpt', 'category-posts' ); ?></td>
1673
  </tr>
1674
+ <tr>
1675
+ <th>%more-link%</th>
1676
+ <td><?php esc_html_e( 'Read more text', 'category-posts' ); ?></td>
1677
+ </tr>
1678
  <tr>
1679
  <th>%author%</th>
1680
  <td><?php esc_html_e( 'Post author', 'category-posts' ); ?></td>
1696
  <div class="cat-post-premade_templates">
1697
  <p><label><?php esc_html_e( 'Select premade Template', 'category-posts' ); ?></label></p>
1698
  <select>
1699
+ <option value="title"><?php esc_html_e( 'Title', 'category-posts' ); ?></option>
1700
+ <option value="title_excerpt"><?php esc_html_e( 'Title, Excerpt, More Link', 'category-posts' ); ?></option>
1701
+ <option value="title_thumb"><?php esc_html_e( 'Title, Thumbnail', 'category-posts' ); ?></option>
1702
+ <option value="title_thum_excerpt"><?php esc_html_e( 'Title, Thumbnail, Excerpt, More Link', 'category-posts' ); ?></option>
1703
  <option value="everything"><?php esc_html_e( 'All with icons', 'category-posts' ); ?></option>
1704
  </select>
1705
  <p><button type="button" class="button"><?php esc_html_e( 'Select this template', 'category-posts' ); ?></button></p>
1708
  ?>
1709
  </div>
1710
  </div>
1711
+ <?php // Title settings. ?>
1712
+ <div class="cpwp-sub-panel categoryposts-data-panel-title" style="display:<?php echo ( isset( $tags['%title%'] ) ) ? 'block' : 'none'; ?>">
1713
+ <p><?php esc_html_e( 'Title settings', 'category-posts' ); ?></p>
1714
+ <div class="cpwp_ident">
1715
+ <?php
1716
+ echo $this->get_radio_buttons_block_html( $instance, 'item_title_level', array( 'Inline', 'H1', 'H2', 'H3', 'H4', 'H5', 'H6' ), esc_html__( 'Heading Level', 'category-posts' ), true );
1717
+ ?>
1718
+ </div>
1719
+ </div>
1720
  <?php // Excerpt settings. ?>
1721
  <div class="cpwp-sub-panel categoryposts-data-panel-excerpt" style="display:<?php echo ( isset( $tags['%excerpt%'] ) ) ? 'block' : 'none'; ?>">
1722
  <p><?php esc_html_e( 'Excerpt settings', 'category-posts' ); ?></p>
1723
  <div class="cpwp_ident">
1724
  <?php
1725
  echo $this->get_number_input_block_html( $instance, 'excerpt_lines', esc_html__( 'Lines (responsive):', 'category-posts' ), 0, '', '', true );
1726
+ // Remove the UI since free 5.0
1727
+ // echo $this->get_number_input_block_html( $instance, 'excerpt_length', esc_html__( 'Length (words):', 'category-posts' ), 0, '', '', true );
1728
+ // Remove the UI since free 5.0
1729
+ // echo $this->get_text_input_block_html( $instance, 'excerpt_more_text', esc_html__( '\'More ...\' text:', 'category-posts' ), esc_attr__( '...', 'category-posts' ), true );
1730
  ?>
1731
  </div>
1732
  </div>
1733
+ <?php // More link settings. ?>
1734
+ <div class="cpwp-sub-panel categoryposts-data-panel-more-link" style="display:<?php echo ( isset( $tags['%more-link%'] ) ) ? 'block' : 'none'; ?>">
1735
+ <p><?php esc_html_e( 'More Link settings', 'category-posts' ); ?></p>
1736
+ <div class="cpwp_ident">
1737
+ <?php
1738
+ echo $this->get_text_input_block_html( $instance, 'excerpt_more_text',
1739
+ esc_html__( '\'Read more\' text', 'category-posts' ) .
1740
+ ' <a href="#" class="dashicons toggle-more-link-help dashicons-editor-help">' .
1741
+ '<span class="screen-reader-text">' . esc_html__( 'Show More Link help', 'category-posts' ) . '</span>' .
1742
+ '</a>', esc_attr__( '[&hellip;]', 'category-posts' ), true );
1743
+ ?>
1744
+ <div class="cat-post-more-link-help" style="display:none;">
1745
+ <p><?php echo sprintf( __( 'Text in the \'more\' link. Can be text, HTML and <a target="_blank" href="%s">Dashicons</a>.', 'category-posts' ),
1746
+ 'https://developer.wordpress.org/resource/dashicons/'); ?>
1747
+ </p>
1748
+ </div>
1749
+ </div>
1750
+ </div>
1751
+ <?php // Data settings. ?>
1752
  <div class="cpwp-sub-panel categoryposts-data-panel-date" style="display:<?php echo ( isset( $tags['%date%'] ) ) ? 'block' : 'none'; ?>">
1753
  <p><?php esc_html_e( 'Date format settings', 'category-posts' ); ?></p>
1754
  <div class="cpwp_ident">
1755
  <?php
1756
+ echo $this->get_select_block_html(
1757
+ $instance,
1758
+ 'preset_date_format',
1759
+ esc_html__( 'Date format', 'category-posts' ),
1760
+ array(
1761
+ 'sitedateandtime' => esc_html__( 'Site date and time', 'category-posts' ),
1762
+ 'sitedate' => esc_html__( 'Site date', 'category-posts' ),
1763
+ 'sincepublished' => esc_html__( 'Time since published', 'category-posts' ),
1764
+ 'localsitedateandtime' => esc_html__( 'Reader\'s local date and time', 'category-posts' ),
1765
+ 'localsitedate' => esc_html__( 'Reader\'s local date', 'category-posts' ),
1766
+ 'other' => esc_html__( 'PHP style format', 'category-posts' ),
1767
+ ),
1768
+ 'sitedateandtime',
1769
+ true
1770
+ );
1771
  echo $this->get_text_input_block_html( $instance, 'date_format', esc_html__( 'PHP Style Date format', 'category-posts' ), 'j M Y', 'other' === $preset_date_format );
1772
  ?>
1773
  </div>
1775
  <?php // Thumbnail settings. ?>
1776
  <div class="cpwp-sub-panel categoryposts-data-panel-thumb" style="display:<?php echo ( isset( $tags['%thumb%'] ) ) ? 'block' : 'none'; ?>">
1777
  <p><?php esc_html_e( 'Thumbnail settings', 'category-posts' ); ?></p>
1778
+ <div class="cpwp_ident">
1779
+ <p><?php esc_html_e( 'Dimensions (pixel)', 'category-posts' ); ?>
1780
+ <a href="#" class="dashicons toggle-image-dimensions-help dashicons-editor-help">
1781
+ <span class="screen-reader-text"><?php esc_html__( 'Show image dimension help', 'category-posts' ); ?></span>
1782
+ </a>
1783
+ </p>
1784
  <?php
1785
  echo $this->get_number_input_block_html( $instance, 'thumb_w', esc_html__( 'Width:', 'category-posts' ), 1, '', '', true );
1786
  echo $this->get_range_input_block_html( $instance, 'thumb_fluid_width', esc_html__( 'Max-width:', 'category-posts' ), 2, 100, 100, 2, true );
1787
  echo $this->get_number_input_block_html( $instance, 'thumb_h', esc_html__( 'Height:', 'category-posts' ), 1, '', '', true );
1788
  ?>
1789
+ <div class="cat-post-image-dimensions-help" style="display:none;">
1790
+ <p><?php esc_html_e( 'Set one or more dimensions to 0 to have no ratio calculation.', 'category-posts' ); ?></p>
1791
+ <p><?php esc_html_e( 'Set both to 0 will use the original image ratio.', 'category-posts' ); ?></p>
1792
+ <p><?php esc_html_e( 'Max-width limits in terms of the total Post Details width.', 'category-posts' ); ?></p>
1793
+ </div>
1794
  <div class="cat-post-thumb-change-size">
1795
  <p>
1796
  <label><?php esc_html_e( 'Change size', 'category-posts' ); ?>: </label>
1815
  ?>
1816
  </span>
1817
  </p>
1818
+ <p>
1819
+ <label><?php esc_html_e( 'Image ratio', 'category-posts' ); ?>: </label>
1820
+ <span class="cpwp-right">
1821
+ <?php
1822
+ echo $this->get_button_thumb_size_html( $instance, 'width', esc_html__( 'Width', 'category-posts' ) );
1823
+ echo $this->get_button_thumb_size_html( $instance, 'height', esc_html__( 'Height', 'category-posts' ) );
1824
+ echo $this->get_button_thumb_size_html( $instance, 'both', esc_html__( 'Both', 'category-posts' ) );
1825
+ ?>
1826
+ </span>
1827
+ </p>
1828
  <p>
1829
  <label><?php esc_html_e( 'Available', 'category-posts' ); ?>: </label>
1830
  <span class="cpwp-right">
1838
  </div>
1839
  <?php
1840
  echo $this->get_checkbox_block_html( $instance, 'text_do_not_wrap_thumb', esc_html__( 'Do not wrap thumbnail with overflowing text', 'category-posts' ), true );
1841
+ echo $this->get_select_block_html( $instance, 'thumb_hover', esc_html__( 'Animation on mouse hover', 'category-posts' ), array(
 
1842
  'none' => esc_html__( 'None', 'category-posts' ),
1843
  'dark' => esc_html__( 'Darker', 'category-posts' ),
1844
  'white' => esc_html__( 'Brighter', 'category-posts' ),
1846
  'blur' => esc_html__( 'Blur', 'category-posts' ),
1847
  'icon' => esc_html__( 'Icon', 'category-posts' ),
1848
  ), 'none', true);
1849
+ echo $this->get_select_block_html(
1850
+ $instance,
1851
+ 'show_post_format',
1852
+ esc_html__( 'Indicate post format and position', 'category-posts' ),
1853
+ array(
1854
+ 'none' => esc_html__( 'None', 'category-posts' ),
1855
+ 'topleft' => esc_html__( 'Top left', 'category-posts' ),
1856
+ 'bottomleft' => esc_html__( 'Bottom left', 'category-posts' ),
1857
+ 'ceter' => esc_html__( 'Center', 'category-posts' ),
1858
+ 'topright' => esc_html__( 'Top right', 'category-posts' ),
1859
+ 'bottomright' => esc_html__( 'Bottom right', 'category-posts' ),
1860
+ 'nocss' => esc_html__( 'HTML without styling', 'category-posts' ),
1861
+ ),
1862
+ 'none',
1863
+ true
1864
+ );
1865
  ?>
1866
  <p>
1867
  <label style="display:block">
1891
  </div>
1892
  </div>
1893
  <h4 data-panel="general"><?php esc_html_e( 'General', 'category-posts' ); ?></h4>
1894
+ <div class="cpwp-sub-panel">
1895
+ <p><?php esc_html_e( 'Inherited CSS', 'categorypostspro' ); ?></p>
1896
+ <div class="cpwp_ident">
1897
+ <?php echo $this->get_checkbox_block_html( $instance, 'disable_css', esc_html__( 'Disable the built-in CSS', 'category-posts' ), true ); ?>
1898
+ <?php echo $this->get_checkbox_block_html( $instance, 'disable_font_styles', esc_html__( 'Disable only font styles', 'category-posts' ), ! ( isset( $instance['disable_css'] ) && $instance['disable_css'] ) ); ?>
1899
+ <?php echo $this->get_checkbox_block_html( $instance, 'disable_theme_styles', esc_html__( 'Disable Theme\'s styles', 'category-posts' ), true ); ?>
1900
+ </div>
1901
+ <p><?php esc_html_e( 'Interim text', 'categorypostspro' ); ?></p>
1902
  <div class="cpwp_ident">
1903
  <?php
1904
+ echo $this->get_select_block_html(
1905
+ $instance,
1906
+ 'no_match_handling',
1907
+ esc_html__( 'When there are no matches', 'category-posts' ),
1908
+ array(
1909
+ 'nothing' => esc_html__( 'Display empty widget', 'category-posts' ),
1910
+ 'hide' => esc_html__( 'Hide Widget', 'category-posts' ),
1911
+ 'text' => esc_html__( 'Show text', 'category-posts' ),
1912
+ ),
1913
+ 'nothing',
1914
+ true
1915
+ );
1916
  ?>
1917
  <div class="categoryPosts-no-match-text" style="display:<?php echo ( 'text' === $instance['no_match_handling'] ) ? 'block' : 'none'; ?>">
1918
  <?php echo $this->get_textarea_html( $instance, 'no_match_text', esc_html__( 'Text', 'category-posts' ), '', true, 4 ); ?>
1919
  </div>
1920
  </div>
1921
+ <p><?php esc_html_e( 'Ajax API', 'categorypostspro' ); ?></p>
1922
+ <div class="cpwp_ident">
1923
+ <?php echo $this->get_checkbox_block_html( $instance, 'enable_loadmore', esc_html__( 'Enable Load More', 'category-posts' ), true ); ?>
 
1924
  <div class="loadmore-settings" style="display:<?php echo ( $instance['enable_loadmore'] ) ? 'block' : 'none'; ?>">
1925
  <?php echo $this->get_text_input_block_html( $instance, 'loadmore_text', esc_html__( 'Button text', 'category-posts' ), '', true ); ?>
1926
  <?php echo $this->get_text_input_block_html( $instance, 'loading_text', esc_html__( 'Loading text', 'category-posts' ), '', true ); ?>
gulpfile.js CHANGED
@@ -1,16 +1,16 @@
1
- var gulp = require('gulp');
2
- var uglify = require('gulp-uglify');
3
- var rename = require("gulp-rename");
4
-
5
- gulp.task( 'default', [ 'scripts' ] )
6
-
7
- // Gulp task to minify JavaScript files
8
- gulp.task('scripts', function() {
9
- return gulp.src(['./js/**/*.js', '!./js/**/*.min.js'])
10
- // Minify the file
11
- .pipe(uglify())
12
- .pipe(rename({suffix: '.min'}))
13
- .pipe(gulp.dest(function(file) {
14
- return file.base;
15
- }));
16
- });
1
+ var gulp = require('gulp');
2
+ var uglify = require('gulp-uglify');
3
+ var rename = require("gulp-rename");
4
+
5
+ gulp.task( 'default', [ 'scripts' ] )
6
+
7
+ // Gulp task to minify JavaScript files
8
+ gulp.task('scripts', function() {
9
+ return gulp.src(['./js/**/*.js', '!./js/**/*.min.js'])
10
+ // Minify the file
11
+ .pipe(uglify())
12
+ .pipe(rename({suffix: '.min'}))
13
+ .pipe(gulp.dest(function(file) {
14
+ return file.base;
15
+ }));
16
+ });
icons/LICENSE.txt CHANGED
@@ -1,39 +1,39 @@
1
- Font license info
2
-
3
-
4
- ## Font Awesome
5
-
6
- Copyright (C) 2016 by Dave Gandy
7
-
8
- Author: Dave Gandy
9
- License: SIL ()
10
- Homepage: http://fortawesome.github.com/Font-Awesome/
11
-
12
-
13
- ## Typicons
14
-
15
- (c) Stephen Hutchings 2012
16
-
17
- Author: Stephen Hutchings
18
- License: SIL (http://scripts.sil.org/OFL)
19
- Homepage: http://typicons.com/
20
-
21
-
22
- ## Entypo
23
-
24
- Copyright (C) 2012 by Daniel Bruce
25
-
26
- Author: Daniel Bruce
27
- License: SIL (http://scripts.sil.org/OFL)
28
- Homepage: http://www.entypo.com
29
-
30
-
31
- ## Web Symbols
32
-
33
- Copyright (c) 2011 by Just Be Nice studio. All rights reserved.
34
-
35
- Author: Just Be Nice studio
36
- License: SIL (http://scripts.sil.org/OFL)
37
- Homepage: http://www.justbenicestudio.com/
38
-
39
-
1
+ Font license info
2
+
3
+
4
+ ## Font Awesome
5
+
6
+ Copyright (C) 2016 by Dave Gandy
7
+
8
+ Author: Dave Gandy
9
+ License: SIL ()
10
+ Homepage: http://fortawesome.github.com/Font-Awesome/
11
+
12
+
13
+ ## Typicons
14
+
15
+ (c) Stephen Hutchings 2012
16
+
17
+ Author: Stephen Hutchings
18
+ License: SIL (http://scripts.sil.org/OFL)
19
+ Homepage: http://typicons.com/
20
+
21
+
22
+ ## Entypo
23
+
24
+ Copyright (C) 2012 by Daniel Bruce
25
+
26
+ Author: Daniel Bruce
27
+ License: SIL (http://scripts.sil.org/OFL)
28
+ Homepage: http://www.entypo.com
29
+
30
+
31
+ ## Web Symbols
32
+
33
+ Copyright (c) 2011 by Just Be Nice studio. All rights reserved.
34
+
35
+ Author: Just Be Nice studio
36
+ License: SIL (http://scripts.sil.org/OFL)
37
+ Homepage: http://www.justbenicestudio.com/
38
+
39
+
icons/README.txt CHANGED
@@ -1,75 +1,75 @@
1
- This webfont is generated by http://fontello.com open source project.
2
-
3
-
4
- ================================================================================
5
- Please, note, that you should obey original font licenses, used to make this
6
- webfont pack. Details available in LICENSE.txt file.
7
-
8
- - Usually, it's enough to publish content of LICENSE.txt file somewhere on your
9
- site in "About" section.
10
-
11
- - If your project is open-source, usually, it will be ok to make LICENSE.txt
12
- file publicly available in your repository.
13
-
14
- - Fonts, used in Fontello, don't require a clickable link on your site.
15
- But any kind of additional authors crediting is welcome.
16
- ================================================================================
17
-
18
-
19
- Comments on archive content
20
- ---------------------------
21
-
22
- - /font/* - fonts in different formats
23
-
24
- - /css/* - different kinds of css, for all situations. Should be ok with
25
- twitter bootstrap. Also, you can skip <i> style and assign icon classes
26
- directly to text elements, if you don't mind about IE7.
27
-
28
- - demo.html - demo file, to show your webfont content
29
-
30
- - LICENSE.txt - license info about source fonts, used to build your one.
31
-
32
- - config.json - keeps your settings. You can import it back into fontello
33
- anytime, to continue your work
34
-
35
-
36
- Why so many CSS files ?
37
- -----------------------
38
-
39
- Because we like to fit all your needs :)
40
-
41
- - basic file, <your_font_name>.css - is usually enough, it contains @font-face
42
- and character code definitions
43
-
44
- - *-ie7.css - if you need IE7 support, but still don't wish to put char codes
45
- directly into html
46
-
47
- - *-codes.css and *-ie7-codes.css - if you like to use your own @font-face
48
- rules, but still wish to benefit from css generation. That can be very
49
- convenient for automated asset build systems. When you need to update font -
50
- no need to manually edit files, just override old version with archive
51
- content. See fontello source code for examples.
52
-
53
- - *-embedded.css - basic css file, but with embedded WOFF font, to avoid
54
- CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain.
55
- We strongly recommend to resolve this issue by `Access-Control-Allow-Origin`
56
- server headers. But if you ok with dirty hack - this file is for you. Note,
57
- that data url moved to separate @font-face to avoid problems with <IE9, when
58
- string is too long.
59
-
60
- - animate.css - use it to get ideas about spinner rotation animation.
61
-
62
-
63
- Attention for server setup
64
- --------------------------
65
-
66
- You MUST setup server to reply with proper `mime-types` for font files -
67
- otherwise some browsers will fail to show fonts.
68
-
69
- Usually, `apache` already has necessary settings, but `nginx` and other
70
- webservers should be tuned. Here is list of mime types for our file extensions:
71
-
72
- - `application/vnd.ms-fontobject` - eot
73
- - `application/x-font-woff` - woff
74
- - `application/x-font-ttf` - ttf
75
- - `image/svg+xml` - svg
1
+ This webfont is generated by http://fontello.com open source project.
2
+
3
+
4
+ ================================================================================
5
+ Please, note, that you should obey original font licenses, used to make this
6
+ webfont pack. Details available in LICENSE.txt file.
7
+
8
+ - Usually, it's enough to publish content of LICENSE.txt file somewhere on your
9
+ site in "About" section.
10
+
11
+ - If your project is open-source, usually, it will be ok to make LICENSE.txt
12
+ file publicly available in your repository.
13
+
14
+ - Fonts, used in Fontello, don't require a clickable link on your site.
15
+ But any kind of additional authors crediting is welcome.
16
+ ================================================================================
17
+
18
+
19
+ Comments on archive content
20
+ ---------------------------
21
+
22
+ - /font/* - fonts in different formats
23
+
24
+ - /css/* - different kinds of css, for all situations. Should be ok with
25
+ twitter bootstrap. Also, you can skip <i> style and assign icon classes
26
+ directly to text elements, if you don't mind about IE7.
27
+
28
+ - demo.html - demo file, to show your webfont content
29
+
30
+ - LICENSE.txt - license info about source fonts, used to build your one.
31
+
32
+ - config.json - keeps your settings. You can import it back into fontello
33
+ anytime, to continue your work
34
+
35
+
36
+ Why so many CSS files ?
37
+ -----------------------
38
+
39
+ Because we like to fit all your needs :)
40
+
41
+ - basic file, <your_font_name>.css - is usually enough, it contains @font-face
42
+ and character code definitions
43
+
44
+ - *-ie7.css - if you need IE7 support, but still don't wish to put char codes
45
+ directly into html
46
+
47
+ - *-codes.css and *-ie7-codes.css - if you like to use your own @font-face
48
+ rules, but still wish to benefit from css generation. That can be very
49
+ convenient for automated asset build systems. When you need to update font -
50
+ no need to manually edit files, just override old version with archive
51
+ content. See fontello source code for examples.
52
+
53
+ - *-embedded.css - basic css file, but with embedded WOFF font, to avoid
54
+ CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain.
55
+ We strongly recommend to resolve this issue by `Access-Control-Allow-Origin`
56
+ server headers. But if you ok with dirty hack - this file is for you. Note,
57
+ that data url moved to separate @font-face to avoid problems with <IE9, when
58
+ string is too long.
59
+
60
+ - animate.css - use it to get ideas about spinner rotation animation.
61
+
62
+
63
+ Attention for server setup
64
+ --------------------------
65
+
66
+ You MUST setup server to reply with proper `mime-types` for font files -
67
+ otherwise some browsers will fail to show fonts.
68
+
69
+ Usually, `apache` already has necessary settings, but `nginx` and other
70
+ webservers should be tuned. Here is list of mime types for our file extensions:
71
+
72
+ - `application/vnd.ms-fontobject` - eot
73
+ - `application/x-font-woff` - woff
74
+ - `application/x-font-ttf` - ttf
75
+ - `image/svg+xml` - svg
icons/config.json CHANGED
@@ -1,76 +1,76 @@
1
- {
2
- "name": "cat_post",
3
- "css_prefix_text": "cat-post-icon-",
4
- "css_use_suffix": false,
5
- "hinting": true,
6
- "units_per_em": 1000,
7
- "ascent": 850,
8
- "glyphs": [
9
- {
10
- "uid": "381da2c2f7fd51f8de877c044d7f439d",
11
- "css": "image",
12
- "code": 59392,
13
- "src": "fontawesome"
14
- },
15
- {
16
- "uid": "872d9516df93eb6b776cc4d94bd97dac",
17
- "css": "video",
18
- "code": 59393,
19
- "src": "fontawesome"
20
- },
21
- {
22
- "uid": "dcedf50ab1ede3283d7a6c70e2fe32f3",
23
- "css": "chat",
24
- "code": 59394,
25
- "src": "fontawesome"
26
- },
27
- {
28
- "uid": "ab95e1351ebaec5850101097cbf7097f",
29
- "css": "quote",
30
- "code": 61709,
31
- "src": "fontawesome"
32
- },
33
- {
34
- "uid": "9ea0a737ccc45d6c510dcbae56058849",
35
- "css": "audio",
36
- "code": 59395,
37
- "src": "fontawesome"
38
- },
39
- {
40
- "uid": "3def559c3c39b8500882e02892b7daa8",
41
- "css": "gallery",
42
- "code": 59397,
43
- "src": "entypo"
44
- },
45
- {
46
- "uid": "7p5gflyid3o4gtesy94a6erq94e4pz7u",
47
- "css": "standard",
48
- "code": 59398,
49
- "src": "typicons"
50
- },
51
- {
52
- "uid": "0ddd3e8201ccc7d41f7b7c9d27eca6c1",
53
- "css": "link",
54
- "code": 59401,
55
- "src": "fontawesome"
56
- },
57
- {
58
- "uid": "5408be43f7c42bccee419c6be53fdef5",
59
- "css": "aside",
60
- "code": 61686,
61
- "src": "fontawesome"
62
- },
63
- {
64
- "uid": "p57wgnf4glngbchbucdi029iptu8oxb8",
65
- "css": "pin",
66
- "code": 59399,
67
- "src": "typicons"
68
- },
69
- {
70
- "uid": "21f6a88daf13c62e5a70f5ef6ad9e23f",
71
- "css": "status",
72
- "code": 59402,
73
- "src": "websymbols"
74
- }
75
- ]
76
  }
1
+ {
2
+ "name": "cat_post",
3
+ "css_prefix_text": "cat-post-icon-",
4
+ "css_use_suffix": false,
5
+ "hinting": true,
6
+ "units_per_em": 1000,
7
+ "ascent": 850,
8
+ "glyphs": [
9
+ {
10
+ "uid": "381da2c2f7fd51f8de877c044d7f439d",
11
+ "css": "image",
12
+ "code": 59392,
13
+ "src": "fontawesome"
14
+ },
15
+ {
16
+ "uid": "872d9516df93eb6b776cc4d94bd97dac",
17
+ "css": "video",
18
+ "code": 59393,
19
+ "src": "fontawesome"
20
+ },
21
+ {
22
+ "uid": "dcedf50ab1ede3283d7a6c70e2fe32f3",
23
+ "css": "chat",
24
+ "code": 59394,
25
+ "src": "fontawesome"
26
+ },
27
+ {
28
+ "uid": "ab95e1351ebaec5850101097cbf7097f",
29
+ "css": "quote",
30
+ "code": 61709,
31
+ "src": "fontawesome"
32
+ },
33
+ {
34
+ "uid": "9ea0a737ccc45d6c510dcbae56058849",
35
+ "css": "audio",
36
+ "code": 59395,
37
+ "src": "fontawesome"
38
+ },
39
+ {
40
+ "uid": "3def559c3c39b8500882e02892b7daa8",
41
+ "css": "gallery",
42
+ "code": 59397,
43
+ "src": "entypo"
44
+ },
45
+ {
46
+ "uid": "7p5gflyid3o4gtesy94a6erq94e4pz7u",
47
+ "css": "standard",
48
+ "code": 59398,
49
+ "src": "typicons"
50
+ },
51
+ {
52
+ "uid": "0ddd3e8201ccc7d41f7b7c9d27eca6c1",
53
+ "css": "link",
54
+ "code": 59401,
55
+ "src": "fontawesome"
56
+ },
57
+ {
58
+ "uid": "5408be43f7c42bccee419c6be53fdef5",
59
+ "css": "aside",
60
+ "code": 61686,
61
+ "src": "fontawesome"
62
+ },
63
+ {
64
+ "uid": "p57wgnf4glngbchbucdi029iptu8oxb8",
65
+ "css": "pin",
66
+ "code": 59399,
67
+ "src": "typicons"
68
+ },
69
+ {
70
+ "uid": "21f6a88daf13c62e5a70f5ef6ad9e23f",
71
+ "css": "status",
72
+ "code": 59402,
73
+ "src": "websymbols"
74
+ }
75
+ ]
76
  }
icons/css/animation.css CHANGED
@@ -1,85 +1,85 @@
1
- /*
2
- Animation example, for spinners
3
- */
4
- .animate-spin {
5
- -moz-animation: spin 2s infinite linear;
6
- -o-animation: spin 2s infinite linear;
7
- -webkit-animation: spin 2s infinite linear;
8
- animation: spin 2s infinite linear;
9
- display: inline-block;
10
- }
11
- @-moz-keyframes spin {
12
- 0% {
13
- -moz-transform: rotate(0deg);
14
- -o-transform: rotate(0deg);
15
- -webkit-transform: rotate(0deg);
16
- transform: rotate(0deg);
17
- }
18
-
19
- 100% {
20
- -moz-transform: rotate(359deg);
21
- -o-transform: rotate(359deg);
22
- -webkit-transform: rotate(359deg);
23
- transform: rotate(359deg);
24
- }
25
- }
26
- @-webkit-keyframes spin {
27
- 0% {
28
- -moz-transform: rotate(0deg);
29
- -o-transform: rotate(0deg);
30
- -webkit-transform: rotate(0deg);
31
- transform: rotate(0deg);
32
- }
33
-
34
- 100% {
35
- -moz-transform: rotate(359deg);
36
- -o-transform: rotate(359deg);
37
- -webkit-transform: rotate(359deg);
38
- transform: rotate(359deg);
39
- }
40
- }
41
- @-o-keyframes spin {
42
- 0% {
43
- -moz-transform: rotate(0deg);
44
- -o-transform: rotate(0deg);
45
- -webkit-transform: rotate(0deg);
46
- transform: rotate(0deg);
47
- }
48
-
49
- 100% {
50
- -moz-transform: rotate(359deg);
51
- -o-transform: rotate(359deg);
52
- -webkit-transform: rotate(359deg);
53
- transform: rotate(359deg);
54
- }
55
- }
56
- @-ms-keyframes spin {
57
- 0% {
58
- -moz-transform: rotate(0deg);
59
- -o-transform: rotate(0deg);
60
- -webkit-transform: rotate(0deg);
61
- transform: rotate(0deg);
62
- }
63
-
64
- 100% {
65
- -moz-transform: rotate(359deg);
66
- -o-transform: rotate(359deg);
67
- -webkit-transform: rotate(359deg);
68
- transform: rotate(359deg);
69
- }
70
- }
71
- @keyframes spin {
72
- 0% {
73
- -moz-transform: rotate(0deg);
74
- -o-transform: rotate(0deg);
75
- -webkit-transform: rotate(0deg);
76
- transform: rotate(0deg);
77
- }
78
-
79
- 100% {
80
- -moz-transform: rotate(359deg);
81
- -o-transform: rotate(359deg);
82
- -webkit-transform: rotate(359deg);
83
- transform: rotate(359deg);
84
- }
85
- }
1
+ /*
2
+ Animation example, for spinners
3
+ */
4
+ .animate-spin {
5
+ -moz-animation: spin 2s infinite linear;
6
+ -o-animation: spin 2s infinite linear;
7
+ -webkit-animation: spin 2s infinite linear;
8
+ animation: spin 2s infinite linear;
9
+ display: inline-block;
10
+ }
11
+ @-moz-keyframes spin {
12
+ 0% {
13
+ -moz-transform: rotate(0deg);
14
+ -o-transform: rotate(0deg);
15
+ -webkit-transform: rotate(0deg);
16
+ transform: rotate(0deg);
17
+ }
18
+
19
+ 100% {
20
+ -moz-transform: rotate(359deg);
21
+ -o-transform: rotate(359deg);
22
+ -webkit-transform: rotate(359deg);
23
+ transform: rotate(359deg);
24
+ }
25
+ }
26
+ @-webkit-keyframes spin {
27
+ 0% {
28
+ -moz-transform: rotate(0deg);
29
+ -o-transform: rotate(0deg);
30
+ -webkit-transform: rotate(0deg);
31
+ transform: rotate(0deg);
32
+ }
33
+
34
+ 100% {
35
+ -moz-transform: rotate(359deg);
36
+ -o-transform: rotate(359deg);
37
+ -webkit-transform: rotate(359deg);
38
+ transform: rotate(359deg);
39
+ }
40
+ }
41
+ @-o-keyframes spin {
42
+ 0% {
43
+ -moz-transform: rotate(0deg);
44
+ -o-transform: rotate(0deg);
45
+ -webkit-transform: rotate(0deg);
46
+ transform: rotate(0deg);
47
+ }
48
+
49
+ 100% {
50
+ -moz-transform: rotate(359deg);
51
+ -o-transform: rotate(359deg);
52
+ -webkit-transform: rotate(359deg);
53
+ transform: rotate(359deg);
54
+ }
55
+ }
56
+ @-ms-keyframes spin {
57
+ 0% {
58
+ -moz-transform: rotate(0deg);
59
+ -o-transform: rotate(0deg);
60
+ -webkit-transform: rotate(0deg);
61
+ transform: rotate(0deg);
62
+ }
63
+
64
+ 100% {
65
+ -moz-transform: rotate(359deg);
66
+ -o-transform: rotate(359deg);
67
+ -webkit-transform: rotate(359deg);
68
+ transform: rotate(359deg);
69
+ }
70
+ }
71
+ @keyframes spin {
72
+ 0% {
73
+ -moz-transform: rotate(0deg);
74
+ -o-transform: rotate(0deg);
75
+ -webkit-transform: rotate(0deg);
76
+ transform: rotate(0deg);
77
+ }
78
+
79
+ 100% {
80
+ -moz-transform: rotate(359deg);
81
+ -o-transform: rotate(359deg);
82
+ -webkit-transform: rotate(359deg);
83
+ transform: rotate(359deg);
84
+ }
85
+ }
icons/css/cat_post-codes.css CHANGED
@@ -1,12 +1,12 @@
1
-
2
- .cat-post-icon-image:before { content: '\e800'; } /* '' */
3
- .cat-post-icon-video:before { content: '\e801'; } /* '' */
4
- .cat-post-icon-chat:before { content: '\e802'; } /* '' */
5
- .cat-post-icon-audio:before { content: '\e803'; } /* '' */
6
- .cat-post-icon-gallery:before { content: '\e805'; } /* '' */
7
- .cat-post-icon-standard:before { content: '\e806'; } /* '' */
8
- .cat-post-icon-pin:before { content: '\e807'; } /* '' */
9
- .cat-post-icon-link:before { content: '\e809'; } /* '' */
10
- .cat-post-icon-status:before { content: '\e80a'; } /* '' */
11
- .cat-post-icon-aside:before { content: '\f0f6'; } /* '' */
12
  .cat-post-icon-quote:before { content: '\f10d'; } /* '' */
1
+
2
+ .cat-post-icon-image:before { content: '\e800'; } /* '' */
3
+ .cat-post-icon-video:before { content: '\e801'; } /* '' */
4
+ .cat-post-icon-chat:before { content: '\e802'; } /* '' */
5
+ .cat-post-icon-audio:before { content: '\e803'; } /* '' */
6
+ .cat-post-icon-gallery:before { content: '\e805'; } /* '' */
7
+ .cat-post-icon-standard:before { content: '\e806'; } /* '' */
8
+ .cat-post-icon-pin:before { content: '\e807'; } /* '' */
9
+ .cat-post-icon-link:before { content: '\e809'; } /* '' */
10
+ .cat-post-icon-status:before { content: '\e80a'; } /* '' */
11
+ .cat-post-icon-aside:before { content: '\f0f6'; } /* '' */
12
  .cat-post-icon-quote:before { content: '\f10d'; } /* '' */
icons/css/cat_post-embedded.css CHANGED
@@ -1,65 +1,65 @@
1
- @font-face {
2
- font-family: 'cat_post';
3
- src: url('../font/cat_post.eot?33448716');
4
- src: url('../font/cat_post.eot?33448716#iefix') format('embedded-opentype'),
5
- url('../font/cat_post.svg?33448716#cat_post') format('svg');
6
- font-weight: normal;
7
- font-style: normal;
8
- }
9
- @font-face {
10
- font-family: 'cat_post';
11
- src: url('data:application/octet-stream;base64,d09GRgABAAAAABN4AA8AAAAAH7AAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABWAAAADsAAABUIIslek9TLzIAAAGUAAAAQwAAAFY+IVJfY21hcAAAAdgAAACYAAACHJuys/9jdnQgAAACcAAAABMAAAAgBtX/AmZwZ20AAAKEAAAFkAAAC3CKkZBZZ2FzcAAACBQAAAAIAAAACAAAABBnbHlmAAAIHAAACDwAAAuu5L+0gWhlYWQAABBYAAAAMgAAADYQoHFKaGhlYQAAEIwAAAAgAAAAJAfoBAxobXR4AAAQrAAAACkAAAAwLSv/9GxvY2EAABDYAAAAGgAAABoTlREMbWF4cAAAEPQAAAAgAAAAIAFBDF5uYW1lAAARFAAAAYIAAALNv5IHH3Bvc3QAABKYAAAAZAAAAIFCu3YvcHJlcAAAEvwAAAB6AAAAhuVBK7x4nGNgZGBg4GIwYLBjYHJx8wlh4MtJLMljkGJgYYAAkDwymzEnMz2RgQPGA8qxgGkOIGaDiAIAJjsFSAB4nGNgZD7MOIGBlYGBqYppDwMDQw+EZnzAYMjIBBRlYGVmwAoC0lxTGBxeMHzkZQ76n8UQxRzEMB0ozAiSAwAAIgwHAHic7ZG7DcMwDESfbNmOf00KI0NkngyUKgNkSJZ249Y5mkqmCIUn4g4CBfCABqjFXWRILxJeT7np9GuG0888pCcuVGSrrbNh3bf5OMCwxvqv+lXS6ysLNx1XlWZl/djSaUqvuaPsln9N5/0uavSNBp6BFbQ/rOCZWcFzsybwPK0N8N4FeO8D7R4bAqXAugee8zYHjB8gIineeJxjYEADEhDIHPQ/E4QBEmYD2wB4nK1WaXfTRhQdeUmchCwlCy1qYcTEabBGJmzBgAlBsmMgXZytlaCLFDvpvvGJ3+Bf82Tac+g3flrvGy8kkLTncJqTo3fnzdXM22USWpLYC+uRlJsvxdTWJo3sPAnphk3LUXwoO3shZYrJ3wVREK2W2rcdh0RE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A9Ky2wciyzCQQCA0VYIRsjIVlCK7AIZbADJFB4sAEVMC0AS7gAyFJYsQEBjlmwAbkIAAgAY3CxAAVCsgABACqxAAVCswoCAQgqsQAFQrMOAAEIKrEABkK6AsAAAQAJKrEAB0K6AEAAAQAJKrEDAESxJAGIUViwQIhYsQNkRLEmAYhRWLoIgAABBECIY1RYsQMARFlZWVmzDAIBDCq4Af+FsASNsQIARAAA') format('truetype');
13
- }
14
- /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
15
- /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
16
- /*
17
- @media screen and (-webkit-min-device-pixel-ratio:0) {
18
- @font-face {
19
- font-family: 'cat_post';
20
- src: url('../font/cat_post.svg?33448716#cat_post') format('svg');
21
- }
22
- }
23
- */
24
-
25
- [class^="cat-post-icon-"]:before, [class*=" cat-post-icon-"]:before {
26
- font-family: "cat_post";
27
- font-style: normal;
28
- font-weight: normal;
29
- speak: none;
30
-
31
- display: inline-block;
32
- text-decoration: inherit;
33
- width: 1em;
34
- margin-right: .2em;
35
- text-align: center;
36
- /* opacity: .8; */
37
-
38
- /* For safety - reset parent styles, that can break glyph codes*/
39
- font-variant: normal;
40
- text-transform: none;
41
-
42
- /* fix buttons height, for twitter bootstrap */
43
- line-height: 1em;
44
-
45
- /* Animation center compensation - margins should be symmetric */
46
- /* remove if not needed */
47
- margin-left: .2em;
48
-
49
- /* you can be more comfortable with increased icons size */
50
- /* font-size: 120%; */
51
-
52
- /* Uncomment for 3D effect */
53
- /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
54
- }
55
- .cat-post-icon-image:before { content: '\e800'; } /* '' */
56
- .cat-post-icon-video:before { content: '\e801'; } /* '' */
57
- .cat-post-icon-chat:before { content: '\e802'; } /* '' */
58
- .cat-post-icon-audio:before { content: '\e803'; } /* '' */
59
- .cat-post-icon-gallery:before { content: '\e805'; } /* '' */
60
- .cat-post-icon-standard:before { content: '\e806'; } /* '' */
61
- .cat-post-icon-pin:before { content: '\e807'; } /* '' */
62
- .cat-post-icon-link:before { content: '\e809'; } /* '' */
63
- .cat-post-icon-status:before { content: '\e80a'; } /* '' */
64
- .cat-post-icon-aside:before { content: '\f0f6'; } /* '' */
65
  .cat-post-icon-quote:before { content: '\f10d'; } /* '' */
1
+ @font-face {
2
+ font-family: 'cat_post';
3
+ src: url('../font/cat_post.eot?33448716');
4
+ src: url('../font/cat_post.eot?33448716#iefix') format('embedded-opentype'),
5
+ url('../font/cat_post.svg?33448716#cat_post') format('svg');
6
+ font-weight: normal;
7
+ font-style: normal;
8
+ }
9
+ @font-face {
10
+ font-family: 'cat_post';
11
+ src: url('data:application/octet-stream;base64,d09GRgABAAAAABN4AA8AAAAAH7AAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABWAAAADsAAABUIIslek9TLzIAAAGUAAAAQwAAAFY+IVJfY21hcAAAAdgAAACYAAACHJuys/9jdnQgAAACcAAAABMAAAAgBtX/AmZwZ20AAAKEAAAFkAAAC3CKkZBZZ2FzcAAACBQAAAAIAAAACAAAABBnbHlmAAAIHAAACDwAAAuu5L+0gWhlYWQAABBYAAAAMgAAADYQoHFKaGhlYQAAEIwAAAAgAAAAJAfoBAxobXR4AAAQrAAAACkAAAAwLSv/9GxvY2EAABDYAAAAGgAAABoTlREMbWF4cAAAEPQAAAAgAAAAIAFBDF5uYW1lAAARFAAAAYIAAALNv5IHH3Bvc3QAABKYAAAAZAAAAIFCu3YvcHJlcAAAEvwAAAB6AAAAhuVBK7x4nGNgZGBg4GIwYLBjYHJx8wlh4MtJLMljkGJgYYAAkDwymzEnMz2RgQPGA8qxgGkOIGaDiAIAJjsFSAB4nGNgZD7MOIGBlYGBqYppDwMDQw+EZnzAYMjIBBRlYGVmwAoC0lxTGBxeMHzkZQ76n8UQxRzEMB0ozAiSAwAAIgwHAHic7ZG7DcMwDESfbNmOf00KI0NkngyUKgNkSJZ249Y5mkqmCIUn4g4CBfCABqjFXWRILx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E0NjMDMxAWHhf9EhceASAWAfQWNg9K0gUHrwbG6BceAf5TjwoIAYkICgoI/ncICgGbCAoKCP53CAoKCAGJCAoKCP53CAoKCAJ+EDQY/X4XHgEgFgN8Fx4BFhAm0hEGrwf8sAI8IBXp/KYB4wcKCgckCAoKCFkKCCQICgoIJAgKjwoIJAgKCggkCAoAAAAAAv////kDoQMLACEAQwA2QDM0EgICAQFHBwEDAgACAwBtBAEAAG4FAQECAgFUBQEBAQJYBgECAQJMNTU3NTU1NzMIBRwrARUUBisBIiY3ETQ+AjsBMhYHFRQGJyMiBh0BFBY7ATIWBRUUBisBIiY3ETQ+AjsBMhYHFRQGJyMiBh0BFBY7ATIWAa1ALNYsQAEuTGo6Iw8WARQQIztUIBV9LT4B9UAs1ixAAS5MajojDxYBFBAjO1QgFX0tPgE61i0+Pi0BiTpqTC4WDkgOFgFUOxIWID4t1i0+Pi0BiTpqTC4WDkgOFgFUOxIWID4AAAAAAQAAAAEAAFdFIJRfDzz1AAsD6AAAAADWdxbVAAAAANZ3FtX/+P9pBJsDUgAAAAgAAgAAAAAAAAABAAADUv9qAAAEm//4//oEmwABAAAAAAAAAAAAAAAAAAAADAPoAAAEL///BC///wPoAAADWf//A+j/+ANCAAADQgAAA6AAAASbAAADWQAAA6D//wAAAAAAegGoAjgClAL2AywDagREBKwFYAXXAAAAAQAAAAwAsAALAAAAAAACACwAPABzAAAAigtwAAAAAAAAABIA3gABAAAAAAAAADUAAAABAAAAAAABAAgANQABAAAAAAACAAcAPQABAAAAAAADAAgARAABAAAAAAAEAAgATAABAAAAAAAFAAsAVAABAAAAAAAGAAgAXwABAAAAAAAKACsAZwABAAAAAAALABMAkgADAAEECQAAAGoApQADAAEECQABABABDwADAAEECQACAA4BHwADAAEECQADABABLQADAAEECQAEABABPQADAAEECQAFABYBTQADAAEECQAGABABYwADAAEECQAKAFYBcwADAAEECQALACYByUNvcHlyaWdodCAoQykgMjAxOCBieSBvcmlnaW5hbCBhdXRob3JzIEAgZm9ud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EMrLbBbLLIAAUMrLbBcLLIBAEMrLbBdLLIBAUMrLbBeLLIAAD8rLbBfLLIAAT8rLbBgLLIBAD8rLbBhLLIBAT8rLbBiLLA3Ky6xKwEUKy2wYyywNyuwOystsGQssDcrsDwrLbBlLLAAFrA3K7A9Ky2wZiywOCsusSsBFCstsGcssDgrsDsrLbBoLLA4K7A8Ky2waSywOCuwPSstsGossDkrLrErARQrLbBrLLA5K7A7Ky2wbCywOSuwPCstsG0ssDkrsD0rLbBuLLA6Ky6xKwEUKy2wbyywOiuwOystsHAssDorsDwrLbBxLLA6K7A9Ky2wciyzCQQCA0VYIRsjIVlCK7AIZbADJFB4sAEVMC0AS7gAyFJYsQEBjlmwAbkIAAgAY3CxAAVCsgABACqxAAVCswoCAQgqsQAFQrMOAAEIKrEABkK6AsAAAQAJKrEAB0K6AEAAAQAJKrEDAESxJAGIUViwQIhYsQNkRLEmAYhRWLoIgAABBECIY1RYsQMARFlZWVmzDAIBDCq4Af+FsASNsQIARAAA') format('truetype');
13
+ }
14
+ /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
15
+ /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
16
+ /*
17
+ @media screen and (-webkit-min-device-pixel-ratio:0) {
18
+ @font-face {
19
+ font-family: 'cat_post';
20
+ src: url('../font/cat_post.svg?33448716#cat_post') format('svg');
21
+ }
22
+ }
23
+ */
24
+
25
+ [class^="cat-post-icon-"]:before, [class*=" cat-post-icon-"]:before {
26
+ font-family: "cat_post";
27
+ font-style: normal;
28
+ font-weight: normal;
29
+ speak: none;
30
+
31
+ display: inline-block;
32
+ text-decoration: inherit;
33
+ width: 1em;
34
+ margin-right: .2em;
35
+ text-align: center;
36
+ /* opacity: .8; */
37
+
38
+ /* For safety - reset parent styles, that can break glyph codes*/
39
+ font-variant: normal;
40
+ text-transform: none;
41
+
42
+ /* fix buttons height, for twitter bootstrap */
43
+ line-height: 1em;
44
+
45
+ /* Animation center compensation - margins should be symmetric */
46
+ /* remove if not needed */
47
+ margin-left: .2em;
48
+
49
+ /* you can be more comfortable with increased icons size */
50
+ /* font-size: 120%; */
51
+
52
+ /* Uncomment for 3D effect */
53
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
54
+ }
55
+ .cat-post-icon-image:before { content: '\e800'; } /* '' */
56
+ .cat-post-icon-video:before { content: '\e801'; } /* '' */
57
+ .cat-post-icon-chat:before { content: '\e802'; } /* '' */
58
+ .cat-post-icon-audio:before { content: '\e803'; } /* '' */
59
+ .cat-post-icon-gallery:before { content: '\e805'; } /* '' */
60
+ .cat-post-icon-standard:before { content: '\e806'; } /* '' */
61
+ .cat-post-icon-pin:before { content: '\e807'; } /* '' */
62
+ .cat-post-icon-link:before { content: '\e809'; } /* '' */
63
+ .cat-post-icon-status:before { content: '\e80a'; } /* '' */
64
+ .cat-post-icon-aside:before { content: '\f0f6'; } /* '' */
65
  .cat-post-icon-quote:before { content: '\f10d'; } /* '' */
icons/css/cat_post-ie7-codes.css CHANGED
@@ -1,12 +1,12 @@
1
-
2
- .cat-post-icon-image { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
3
- .cat-post-icon-video { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
4
- .cat-post-icon-chat { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
5
- .cat-post-icon-audio { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
6
- .cat-post-icon-gallery { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
7
- .cat-post-icon-standard { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
8
- .cat-post-icon-pin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
9
- .cat-post-icon-link { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
10
- .cat-post-icon-status { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
11
- .cat-post-icon-aside { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0f6;&nbsp;'); }
12
  .cat-post-icon-quote { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf10d;&nbsp;'); }
1
+
2
+ .cat-post-icon-image { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
3
+ .cat-post-icon-video { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
4
+ .cat-post-icon-chat { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
5
+ .cat-post-icon-audio { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
6
+ .cat-post-icon-gallery { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
7
+ .cat-post-icon-standard { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
8
+ .cat-post-icon-pin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
9
+ .cat-post-icon-link { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
10
+ .cat-post-icon-status { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
11
+ .cat-post-icon-aside { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0f6;&nbsp;'); }
12
  .cat-post-icon-quote { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf10d;&nbsp;'); }
icons/css/cat_post-ie7.css CHANGED
@@ -1,23 +1,23 @@
1
- [class^="cat-post-icon-"], [class*=" cat-post-icon-"] {
2
- font-family: 'cat_post';
3
- font-style: normal;
4
- font-weight: normal;
5
-
6
- /* fix buttons height */
7
- line-height: 1em;
8
-
9
- /* you can be more comfortable with increased icons size */
10
- /* font-size: 120%; */
11
- }
12
-
13
- .cat-post-icon-image { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
14
- .cat-post-icon-video { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
15
- .cat-post-icon-chat { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
16
- .cat-post-icon-audio { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
17
- .cat-post-icon-gallery { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
18
- .cat-post-icon-standard { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
19
- .cat-post-icon-pin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
20
- .cat-post-icon-link { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
21
- .cat-post-icon-status { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
22
- .cat-post-icon-aside { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0f6;&nbsp;'); }
23
  .cat-post-icon-quote { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf10d;&nbsp;'); }
1
+ [class^="cat-post-icon-"], [class*=" cat-post-icon-"] {
2
+ font-family: 'cat_post';
3
+ font-style: normal;
4
+ font-weight: normal;
5
+
6
+ /* fix buttons height */
7
+ line-height: 1em;
8
+
9
+ /* you can be more comfortable with increased icons size */
10
+ /* font-size: 120%; */
11
+ }
12
+
13
+ .cat-post-icon-image { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe800;&nbsp;'); }
14
+ .cat-post-icon-video { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe801;&nbsp;'); }
15
+ .cat-post-icon-chat { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe802;&nbsp;'); }
16
+ .cat-post-icon-audio { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe803;&nbsp;'); }
17
+ .cat-post-icon-gallery { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe805;&nbsp;'); }
18
+ .cat-post-icon-standard { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe806;&nbsp;'); }
19
+ .cat-post-icon-pin { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe807;&nbsp;'); }
20
+ .cat-post-icon-link { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe809;&nbsp;'); }
21
+ .cat-post-icon-status { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xe80a;&nbsp;'); }
22
+ .cat-post-icon-aside { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0f6;&nbsp;'); }
23
  .cat-post-icon-quote { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf10d;&nbsp;'); }
icons/css/cat_post.css CHANGED
@@ -1,68 +1,68 @@
1
- @font-face {
2
- font-family: 'cat_post';
3
- src: url('../font/cat_post.eot?21642608');
4
- src: url('../font/cat_post.eot?21642608#iefix') format('embedded-opentype'),
5
- url('../font/cat_post.woff2?21642608') format('woff2'),
6
- url('../font/cat_post.woff?21642608') format('woff'),
7
- url('../font/cat_post.ttf?21642608') format('truetype'),
8
- url('../font/cat_post.svg?21642608#cat_post') format('svg');
9
- font-weight: normal;
10
- font-style: normal;
11
- }
12
- /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
13
- /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
14
- /*
15
- @media screen and (-webkit-min-device-pixel-ratio:0) {
16
- @font-face {
17
- font-family: 'cat_post';
18
- src: url('../font/cat_post.svg?21642608#cat_post') format('svg');
19
- }
20
- }
21
- */
22
-
23
- [class^="cat-post-icon-"]:before, [class*=" cat-post-icon-"]:before {
24
- font-family: "cat_post";
25
- font-style: normal;
26
- font-weight: normal;
27
- speak: none;
28
-
29
- display: inline-block;
30
- text-decoration: inherit;
31
- width: 1em;
32
- margin-right: .2em;
33
- text-align: center;
34
- /* opacity: .8; */
35
-
36
- /* For safety - reset parent styles, that can break glyph codes*/
37
- font-variant: normal;
38
- text-transform: none;
39
-
40
- /* fix buttons height, for twitter bootstrap */
41
- line-height: 1em;
42
-
43
- /* Animation center compensation - margins should be symmetric */
44
- /* remove if not needed */
45
- margin-left: .2em;
46
-
47
- /* you can be more comfortable with increased icons size */
48
- /* font-size: 120%; */
49
-
50
- /* Font smoothing. That was taken from TWBS */
51
- -webkit-font-smoothing: antialiased;
52
- -moz-osx-font-smoothing: grayscale;
53
-
54
- /* Uncomment for 3D effect */
55
- /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
56
- }
57
-
58
- .cat-post-icon-image:before { content: '\e800'; } /* '' */
59
- .cat-post-icon-video:before { content: '\e801'; } /* '' */
60
- .cat-post-icon-chat:before { content: '\e802'; } /* '' */
61
- .cat-post-icon-audio:before { content: '\e803'; } /* '' */
62
- .cat-post-icon-gallery:before { content: '\e805'; } /* '' */
63
- .cat-post-icon-standard:before { content: '\e806'; } /* '' */
64
- .cat-post-icon-pin:before { content: '\e807'; } /* '' */
65
- .cat-post-icon-link:before { content: '\e809'; } /* '' */
66
- .cat-post-icon-status:before { content: '\e80a'; } /* '' */
67
- .cat-post-icon-aside:before { content: '\f0f6'; } /* '' */
68
  .cat-post-icon-quote:before { content: '\f10d'; } /* '' */
1
+ @font-face {
2
+ font-family: 'cat_post';
3
+ src: url('../font/cat_post.eot?21642608');
4
+ src: url('../font/cat_post.eot?21642608#iefix') format('embedded-opentype'),
5
+ url('../font/cat_post.woff2?21642608') format('woff2'),
6
+ url('../font/cat_post.woff?21642608') format('woff'),
7
+ url('../font/cat_post.ttf?21642608') format('truetype'),
8
+ url('../font/cat_post.svg?21642608#cat_post') format('svg');
9
+ font-weight: normal;
10
+ font-style: normal;
11
+ }
12
+ /* Chrome hack: SVG is rendered more smooth in Windozze. 100% magic, uncomment if you need it. */
13
+ /* Note, that will break hinting! In other OS-es font will be not as sharp as it could be */
14
+ /*
15
+ @media screen and (-webkit-min-device-pixel-ratio:0) {
16
+ @font-face {
17
+ font-family: 'cat_post';
18
+ src: url('../font/cat_post.svg?21642608#cat_post') format('svg');
19
+ }
20
+ }
21
+ */
22
+
23
+ [class^="cat-post-icon-"]:before, [class*=" cat-post-icon-"]:before {
24
+ font-family: "cat_post";
25
+ font-style: normal;
26
+ font-weight: normal;
27
+ speak: none;
28
+
29
+ display: inline-block;
30
+ text-decoration: inherit;
31
+ width: 1em;
32
+ margin-right: .2em;
33
+ text-align: center;
34
+ /* opacity: .8; */
35
+
36
+ /* For safety - reset parent styles, that can break glyph codes*/
37
+ font-variant: normal;
38
+ text-transform: none;
39
+
40
+ /* fix buttons height, for twitter bootstrap */
41
+ line-height: 1em;
42
+
43
+ /* Animation center compensation - margins should be symmetric */
44
+ /* remove if not needed */
45
+ margin-left: .2em;
46
+
47
+ /* you can be more comfortable with increased icons size */
48
+ /* font-size: 120%; */
49
+
50
+ /* Font smoothing. That was taken from TWBS */
51
+ -webkit-font-smoothing: antialiased;
52
+ -moz-osx-font-smoothing: grayscale;
53
+
54
+ /* Uncomment for 3D effect */
55
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
56
+ }
57
+
58
+ .cat-post-icon-image:before { content: '\e800'; } /* '' */
59
+ .cat-post-icon-video:before { content: '\e801'; } /* '' */
60
+ .cat-post-icon-chat:before { content: '\e802'; } /* '' */
61
+ .cat-post-icon-audio:before { content: '\e803'; } /* '' */
62
+ .cat-post-icon-gallery:before { content: '\e805'; } /* '' */
63
+ .cat-post-icon-standard:before { content: '\e806'; } /* '' */
64
+ .cat-post-icon-pin:before { content: '\e807'; } /* '' */
65
+ .cat-post-icon-link:before { content: '\e809'; } /* '' */
66
+ .cat-post-icon-status:before { content: '\e80a'; } /* '' */
67
+ .cat-post-icon-aside:before { content: '\f0f6'; } /* '' */
68
  .cat-post-icon-quote:before { content: '\f10d'; } /* '' */
icons/demo.html CHANGED
@@ -1,323 +1,323 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head><!--[if lt IE 9]><script language="javascript" type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
4
- <meta charset="UTF-8"><style>/*
5
- * Bootstrap v2.2.1
6
- *
7
- * Copyright 2012 Twitter, Inc
8
- * Licensed under the Apache License v2.0
9
- * http://www.apache.org/licenses/LICENSE-2.0
10
- *
11
- * Designed and built with all the love in the world @twitter by @mdo and @fat.
12
- */
13
- .clearfix {
14
- *zoom: 1;
15
- }
16
- .clearfix:before,
17
- .clearfix:after {
18
- display: table;
19
- content: "";
20
- line-height: 0;
21
- }
22
- .clearfix:after {
23
- clear: both;
24
- }
25
- html {
26
- font-size: 100%;
27
- -webkit-text-size-adjust: 100%;
28
- -ms-text-size-adjust: 100%;
29
- }
30
- a:focus {
31
- outline: thin dotted #333;
32
- outline: 5px auto -webkit-focus-ring-color;
33
- outline-offset: -2px;
34
- }
35
- a:hover,
36
- a:active {
37
- outline: 0;
38
- }
39
- button,
40
- input,
41
- select,
42
- textarea {
43
- margin: 0;
44
- font-size: 100%;
45
- vertical-align: middle;
46
- }
47
- button,
48
- input {
49
- *overflow: visible;
50
- line-height: normal;
51
- }
52
- button::-moz-focus-inner,
53
- input::-moz-focus-inner {
54
- padding: 0;
55
- border: 0;
56
- }
57
- body {
58
- margin: 0;
59
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
60
- font-size: 14px;
61
- line-height: 20px;
62
- color: #333;
63
- background-color: #fff;
64
- }
65
- a {
66
- color: #08c;
67
- text-decoration: none;
68
- }
69
- a:hover {
70
- color: #005580;
71
- text-decoration: underline;
72
- }
73
- .row {
74
- margin-left: -20px;
75
- *zoom: 1;
76
- }
77
- .row:before,
78
- .row:after {
79
- display: table;
80
- content: "";
81
- line-height: 0;
82
- }
83
- .row:after {
84
- clear: both;
85
- }
86
- [class*="span"] {
87
- float: left;
88
- min-height: 1px;
89
- margin-left: 20px;
90
- }
91
- .container,
92
- .navbar-static-top .container,
93
- .navbar-fixed-top .container,
94
- .navbar-fixed-bottom .container {
95
- width: 940px;
96
- }
97
- .span12 {
98
- width: 940px;
99
- }
100
- .span11 {
101
- width: 860px;
102
- }
103
- .span10 {
104
- width: 780px;
105
- }
106
- .span9 {
107
- width: 700px;
108
- }
109
- .span8 {
110
- width: 620px;
111
- }
112
- .span7 {
113
- width: 540px;
114
- }
115
- .span6 {
116
- width: 460px;
117
- }
118
- .span5 {
119
- width: 380px;
120
- }
121
- .span4 {
122
- width: 300px;
123
- }
124
- .span3 {
125
- width: 220px;
126
- }
127
- .span2 {
128
- width: 140px;
129
- }
130
- .span1 {
131
- width: 60px;
132
- }
133
- [class*="span"].pull-right,
134
- .row-fluid [class*="span"].pull-right {
135
- float: right;
136
- }
137
- .container {
138
- margin-right: auto;
139
- margin-left: auto;
140
- *zoom: 1;
141
- }
142
- .container:before,
143
- .container:after {
144
- display: table;
145
- content: "";
146
- line-height: 0;
147
- }
148
- .container:after {
149
- clear: both;
150
- }
151
- p {
152
- margin: 0 0 10px;
153
- }
154
- .lead {
155
- margin-bottom: 20px;
156
- font-size: 21px;
157
- font-weight: 200;
158
- line-height: 30px;
159
- }
160
- small {
161
- font-size: 85%;
162
- }
163
- h1 {
164
- margin: 10px 0;
165
- font-family: inherit;
166
- font-weight: bold;
167
- line-height: 20px;
168
- color: inherit;
169
- text-rendering: optimizelegibility;
170
- }
171
- h1 small {
172
- font-weight: normal;
173
- line-height: 1;
174
- color: #999;
175
- }
176
- h1 {
177
- line-height: 40px;
178
- }
179
- h1 {
180
- font-size: 38.5px;
181
- }
182
- h1 small {
183
- font-size: 24.5px;
184
- }
185
- body {
186
- margin-top: 90px;
187
- }
188
- .header {
189
- position: fixed;
190
- top: 0;
191
- left: 50%;
192
- margin-left: -480px;
193
- background-color: #fff;
194
- border-bottom: 1px solid #ddd;
195
- padding-top: 10px;
196
- z-index: 10;
197
- }
198
- .footer {
199
- color: #ddd;
200
- font-size: 12px;
201
- text-align: center;
202
- margin-top: 20px;
203
- }
204
- .footer a {
205
- color: #ccc;
206
- text-decoration: underline;
207
- }
208
- .the-icons {
209
- font-size: 14px;
210
- line-height: 24px;
211
- }
212
- .switch {
213
- position: absolute;
214
- right: 0;
215
- bottom: 10px;
216
- color: #666;
217
- }
218
- .switch input {
219
- margin-right: 0.3em;
220
- }
221
- .codesOn .i-name {
222
- display: none;
223
- }
224
- .codesOn .i-code {
225
- display: inline;
226
- }
227
- .i-code {
228
- display: none;
229
- }
230
- @font-face {
231
- font-family: 'cat_post';
232
- src: url('./font/cat_post.eot?58348147');
233
- src: url('./font/cat_post.eot?58348147#iefix') format('embedded-opentype'),
234
- url('./font/cat_post.woff?58348147') format('woff'),
235
- url('./font/cat_post.ttf?58348147') format('truetype'),
236
- url('./font/cat_post.svg?58348147#cat_post') format('svg');
237
- font-weight: normal;
238
- font-style: normal;
239
- }
240
-
241
-
242
- .demo-icon
243
- {
244
- font-family: "cat_post";
245
- font-style: normal;
246
- font-weight: normal;
247
- speak: none;
248
-
249
- display: inline-block;
250
- text-decoration: inherit;
251
- width: 1em;
252
- margin-right: .2em;
253
- text-align: center;
254
- /* opacity: .8; */
255
-
256
- /* For safety - reset parent styles, that can break glyph codes*/
257
- font-variant: normal;
258
- text-transform: none;
259
-
260
- /* fix buttons height, for twitter bootstrap */
261
- line-height: 1em;
262
-
263
- /* Animation center compensation - margins should be symmetric */
264
- /* remove if not needed */
265
- margin-left: .2em;
266
-
267
- /* You can be more comfortable with increased icons size */
268
- /* font-size: 120%; */
269
-
270
- /* Font smoothing. That was taken from TWBS */
271
- -webkit-font-smoothing: antialiased;
272
- -moz-osx-font-smoothing: grayscale;
273
-
274
- /* Uncomment for 3D effect */
275
- /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
276
- }
277
- </style>
278
- <link rel="stylesheet" href="css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/cat_post-ie7.css"><![endif]-->
279
- <script>
280
- function toggleCodes(on) {
281
- var obj = document.getElementById('icons');
282
-
283
- if (on) {
284
- obj.className += ' codesOn';
285
- } else {
286
- obj.className = obj.className.replace(' codesOn', '');
287
- }
288
- }
289
-
290
- </script>
291
- </head>
292
- <body>
293
- <div class="container header">
294
- <h1>
295
- cat_post
296
- <small>font demo</small>
297
- </h1>
298
- <label class="switch">
299
- <input type="checkbox" onclick="toggleCodes(this.checked)">show codes
300
- </label>
301
- </div>
302
- <div id="icons" class="container">
303
- <div class="row">
304
- <div title="Code: 0xe800" class="the-icons span3"><i class="demo-icon cat-post-icon-image">&#xe800;</i> <span class="i-name">cat-post-icon-image</span><span class="i-code">0xe800</span></div>
305
- <div title="Code: 0xe801" class="the-icons span3"><i class="demo-icon cat-post-icon-video">&#xe801;</i> <span class="i-name">cat-post-icon-video</span><span class="i-code">0xe801</span></div>
306
- <div title="Code: 0xe802" class="the-icons span3"><i class="demo-icon cat-post-icon-chat">&#xe802;</i> <span class="i-name">cat-post-icon-chat</span><span class="i-code">0xe802</span></div>
307
- <div title="Code: 0xe803" class="the-icons span3"><i class="demo-icon cat-post-icon-audio">&#xe803;</i> <span class="i-name">cat-post-icon-audio</span><span class="i-code">0xe803</span></div>
308
- </div>
309
- <div class="row">
310
- <div title="Code: 0xe805" class="the-icons span3"><i class="demo-icon cat-post-icon-gallery">&#xe805;</i> <span class="i-name">cat-post-icon-gallery</span><span class="i-code">0xe805</span></div>
311
- <div title="Code: 0xe806" class="the-icons span3"><i class="demo-icon cat-post-icon-standard">&#xe806;</i> <span class="i-name">cat-post-icon-standard</span><span class="i-code">0xe806</span></div>
312
- <div title="Code: 0xe807" class="the-icons span3"><i class="demo-icon cat-post-icon-pin">&#xe807;</i> <span class="i-name">cat-post-icon-pin</span><span class="i-code">0xe807</span></div>
313
- <div title="Code: 0xe809" class="the-icons span3"><i class="demo-icon cat-post-icon-link">&#xe809;</i> <span class="i-name">cat-post-icon-link</span><span class="i-code">0xe809</span></div>
314
- </div>
315
- <div class="row">
316
- <div title="Code: 0xe80a" class="the-icons span3"><i class="demo-icon cat-post-icon-status">&#xe80a;</i> <span class="i-name">cat-post-icon-status</span><span class="i-code">0xe80a</span></div>
317
- <div title="Code: 0xf0f6" class="the-icons span3"><i class="demo-icon cat-post-icon-aside">&#xf0f6;</i> <span class="i-name">cat-post-icon-aside</span><span class="i-code">0xf0f6</span></div>
318
- <div title="Code: 0xf10d" class="the-icons span3"><i class="demo-icon cat-post-icon-quote">&#xf10d;</i> <span class="i-name">cat-post-icon-quote</span><span class="i-code">0xf10d</span></div>
319
- </div>
320
- </div>
321
- <div class="container footer">Generated by <a href="http://fontello.com">fontello.com</a></div>
322
- </body>
323
  </html>
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head><!--[if lt IE 9]><script language="javascript" type="text/javascript" src="//html5shim.googlecode.com/svn/trunk/html5.js"></script><![endif]-->
4
+ <meta charset="UTF-8"><style>/*
5
+ * Bootstrap v2.2.1
6
+ *
7
+ * Copyright 2012 Twitter, Inc
8
+ * Licensed under the Apache License v2.0
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Designed and built with all the love in the world @twitter by @mdo and @fat.
12
+ */
13
+ .clearfix {
14
+ *zoom: 1;
15
+ }
16
+ .clearfix:before,
17
+ .clearfix:after {
18
+ display: table;
19
+ content: "";
20
+ line-height: 0;
21
+ }
22
+ .clearfix:after {
23
+ clear: both;
24
+ }
25
+ html {
26
+ font-size: 100%;
27
+ -webkit-text-size-adjust: 100%;
28
+ -ms-text-size-adjust: 100%;
29
+ }
30
+ a:focus {
31
+ outline: thin dotted #333;
32
+ outline: 5px auto -webkit-focus-ring-color;
33
+ outline-offset: -2px;
34
+ }
35
+ a:hover,
36
+ a:active {
37
+ outline: 0;
38
+ }
39
+ button,
40
+ input,
41
+ select,
42
+ textarea {
43
+ margin: 0;
44
+ font-size: 100%;
45
+ vertical-align: middle;
46
+ }
47
+ button,
48
+ input {
49
+ *overflow: visible;
50
+ line-height: normal;
51
+ }
52
+ button::-moz-focus-inner,
53
+ input::-moz-focus-inner {
54
+ padding: 0;
55
+ border: 0;
56
+ }
57
+ body {
58
+ margin: 0;
59
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
60
+ font-size: 14px;
61
+ line-height: 20px;
62
+ color: #333;
63
+ background-color: #fff;
64
+ }
65
+ a {
66
+ color: #08c;
67
+ text-decoration: none;
68
+ }
69
+ a:hover {
70
+ color: #005580;
71
+ text-decoration: underline;
72
+ }
73
+ .row {
74
+ margin-left: -20px;
75
+ *zoom: 1;
76
+ }
77
+ .row:before,
78
+ .row:after {
79
+ display: table;
80
+ content: "";
81
+ line-height: 0;
82
+ }
83
+ .row:after {
84
+ clear: both;
85
+ }
86
+ [class*="span"] {
87
+ float: left;
88
+ min-height: 1px;
89
+ margin-left: 20px;
90
+ }
91
+ .container,
92
+ .navbar-static-top .container,
93
+ .navbar-fixed-top .container,
94
+ .navbar-fixed-bottom .container {
95
+ width: 940px;
96
+ }
97
+ .span12 {
98
+ width: 940px;
99
+ }
100
+ .span11 {
101
+ width: 860px;
102
+ }
103
+ .span10 {
104
+ width: 780px;
105
+ }
106
+ .span9 {
107
+ width: 700px;
108
+ }
109
+ .span8 {
110
+ width: 620px;
111
+ }
112
+ .span7 {
113
+ width: 540px;
114
+ }
115
+ .span6 {
116
+ width: 460px;
117
+ }
118
+ .span5 {
119
+ width: 380px;
120
+ }
121
+ .span4 {
122
+ width: 300px;
123
+ }
124
+ .span3 {
125
+ width: 220px;
126
+ }
127
+ .span2 {
128
+ width: 140px;
129
+ }
130
+ .span1 {
131
+ width: 60px;
132
+ }
133
+ [class*="span"].pull-right,
134
+ .row-fluid [class*="span"].pull-right {
135
+ float: right;
136
+ }
137
+ .container {
138
+ margin-right: auto;
139
+ margin-left: auto;
140
+ *zoom: 1;
141
+ }
142
+ .container:before,
143
+ .container:after {
144
+ display: table;
145
+ content: "";
146
+ line-height: 0;
147
+ }
148
+ .container:after {
149
+ clear: both;
150
+ }
151
+ p {
152
+ margin: 0 0 10px;
153
+ }
154
+ .lead {
155
+ margin-bottom: 20px;
156
+ font-size: 21px;
157
+ font-weight: 200;
158
+ line-height: 30px;
159
+ }
160
+ small {
161
+ font-size: 85%;
162
+ }
163
+ h1 {
164
+ margin: 10px 0;
165
+ font-family: inherit;
166
+ font-weight: bold;
167
+ line-height: 20px;
168
+ color: inherit;
169
+ text-rendering: optimizelegibility;
170
+ }
171
+ h1 small {
172
+ font-weight: normal;
173
+ line-height: 1;
174
+ color: #999;
175
+ }
176
+ h1 {
177
+ line-height: 40px;
178
+ }
179
+ h1 {
180
+ font-size: 38.5px;
181
+ }
182
+ h1 small {
183
+ font-size: 24.5px;
184
+ }
185
+ body {
186
+ margin-top: 90px;
187
+ }
188
+ .header {
189
+ position: fixed;
190
+ top: 0;
191
+ left: 50%;
192
+ margin-left: -480px;
193
+ background-color: #fff;
194
+ border-bottom: 1px solid #ddd;
195
+ padding-top: 10px;
196
+ z-index: 10;
197
+ }
198
+ .footer {
199
+ color: #ddd;
200
+ font-size: 12px;
201
+ text-align: center;
202
+ margin-top: 20px;
203
+ }
204
+ .footer a {
205
+ color: #ccc;
206
+ text-decoration: underline;
207
+ }
208
+ .the-icons {
209
+ font-size: 14px;
210
+ line-height: 24px;
211
+ }
212
+ .switch {
213
+ position: absolute;
214
+ right: 0;
215
+ bottom: 10px;
216
+ color: #666;
217
+ }
218
+ .switch input {
219
+ margin-right: 0.3em;
220
+ }
221
+ .codesOn .i-name {
222
+ display: none;
223
+ }
224
+ .codesOn .i-code {
225
+ display: inline;
226
+ }
227
+ .i-code {
228
+ display: none;
229
+ }
230
+ @font-face {
231
+ font-family: 'cat_post';
232
+ src: url('./font/cat_post.eot?58348147');
233
+ src: url('./font/cat_post.eot?58348147#iefix') format('embedded-opentype'),
234
+ url('./font/cat_post.woff?58348147') format('woff'),
235
+ url('./font/cat_post.ttf?58348147') format('truetype'),
236
+ url('./font/cat_post.svg?58348147#cat_post') format('svg');
237
+ font-weight: normal;
238
+ font-style: normal;
239
+ }
240
+
241
+
242
+ .demo-icon
243
+ {
244
+ font-family: "cat_post";
245
+ font-style: normal;
246
+ font-weight: normal;
247
+ speak: none;
248
+
249
+ display: inline-block;
250
+ text-decoration: inherit;
251
+ width: 1em;
252
+ margin-right: .2em;
253
+ text-align: center;
254
+ /* opacity: .8; */
255
+
256
+ /* For safety - reset parent styles, that can break glyph codes*/
257
+ font-variant: normal;
258
+ text-transform: none;
259
+
260
+ /* fix buttons height, for twitter bootstrap */
261
+ line-height: 1em;
262
+
263
+ /* Animation center compensation - margins should be symmetric */
264
+ /* remove if not needed */
265
+ margin-left: .2em;
266
+
267
+ /* You can be more comfortable with increased icons size */
268
+ /* font-size: 120%; */
269
+
270
+ /* Font smoothing. That was taken from TWBS */
271
+ -webkit-font-smoothing: antialiased;
272
+ -moz-osx-font-smoothing: grayscale;
273
+
274
+ /* Uncomment for 3D effect */
275
+ /* text-shadow: 1px 1px 1px rgba(127, 127, 127, 0.3); */
276
+ }
277
+ </style>
278
+ <link rel="stylesheet" href="css/animation.css"><!--[if IE 7]><link rel="stylesheet" href="css/cat_post-ie7.css"><![endif]-->
279
+ <script>
280
+ function toggleCodes(on) {
281
+ var obj = document.getElementById('icons');
282
+
283
+ if (on) {
284
+ obj.className += ' codesOn';
285
+ } else {
286
+ obj.className = obj.className.replace(' codesOn', '');
287
+ }
288
+ }
289
+
290
+ </script>
291
+ </head>
292
+ <body>
293
+ <div class="container header">
294
+ <h1>
295
+ cat_post
296
+ <small>font demo</small>
297
+ </h1>
298
+ <label class="switch">
299
+ <input type="checkbox" onclick="toggleCodes(this.checked)">show codes
300
+ </label>
301
+ </div>
302
+ <div id="icons" class="container">
303
+ <div class="row">
304
+ <div title="Code: 0xe800" class="the-icons span3"><i class="demo-icon cat-post-icon-image">&#xe800;</i> <span class="i-name">cat-post-icon-image</span><span class="i-code">0xe800</span></div>
305
+ <div title="Code: 0xe801" class="the-icons span3"><i class="demo-icon cat-post-icon-video">&#xe801;</i> <span class="i-name">cat-post-icon-video</span><span class="i-code">0xe801</span></div>
306
+ <div title="Code: 0xe802" class="the-icons span3"><i class="demo-icon cat-post-icon-chat">&#xe802;</i> <span class="i-name">cat-post-icon-chat</span><span class="i-code">0xe802</span></div>
307
+ <div title="Code: 0xe803" class="the-icons span3"><i class="demo-icon cat-post-icon-audio">&#xe803;</i> <span class="i-name">cat-post-icon-audio</span><span class="i-code">0xe803</span></div>
308
+ </div>
309
+ <div class="row">
310
+ <div title="Code: 0xe805" class="the-icons span3"><i class="demo-icon cat-post-icon-gallery">&#xe805;</i> <span class="i-name">cat-post-icon-gallery</span><span class="i-code">0xe805</span></div>
311
+ <div title="Code: 0xe806" class="the-icons span3"><i class="demo-icon cat-post-icon-standard">&#xe806;</i> <span class="i-name">cat-post-icon-standard</span><span class="i-code">0xe806</span></div>
312
+ <div title="Code: 0xe807" class="the-icons span3"><i class="demo-icon cat-post-icon-pin">&#xe807;</i> <span class="i-name">cat-post-icon-pin</span><span class="i-code">0xe807</span></div>
313
+ <div title="Code: 0xe809" class="the-icons span3"><i class="demo-icon cat-post-icon-link">&#xe809;</i> <span class="i-name">cat-post-icon-link</span><span class="i-code">0xe809</span></div>
314
+ </div>
315
+ <div class="row">
316
+ <div title="Code: 0xe80a" class="the-icons span3"><i class="demo-icon cat-post-icon-status">&#xe80a;</i> <span class="i-name">cat-post-icon-status</span><span class="i-code">0xe80a</span></div>
317
+ <div title="Code: 0xf0f6" class="the-icons span3"><i class="demo-icon cat-post-icon-aside">&#xf0f6;</i> <span class="i-name">cat-post-icon-aside</span><span class="i-code">0xf0f6</span></div>
318
+ <div title="Code: 0xf10d" class="the-icons span3"><i class="demo-icon cat-post-icon-quote">&#xf10d;</i> <span class="i-name">cat-post-icon-quote</span><span class="i-code">0xf10d</span></div>
319
+ </div>
320
+ </div>
321
+ <div class="container footer">Generated by <a href="http://fontello.com">fontello.com</a></div>
322
+ </body>
323
  </html>
icons/font/cat_post.eot CHANGED
File without changes
icons/font/cat_post.svg CHANGED
@@ -1,32 +1,32 @@
1
- <?xml version="1.0" standalone="no"?>
2
- <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg xmlns="http://www.w3.org/2000/svg">
4
- <metadata>Copyright (C) 2018 by original authors @ fontello.com</metadata>
5
- <defs>
6
- <font id="cat_post" horiz-adv-x="1000" >
7
- <font-face font-family="cat_post" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
- <missing-glyph horiz-adv-x="1000" />
9
- <glyph glyph-name="image" unicode="&#xe800;" d="M357 529q0-45-31-76t-76-32-76 32-31 76 31 76 76 31 76-31 31-76z m572-215v-250h-786v107l178 179 90-89 285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-7 6-13t12-5h893q7 0 13 5t5 13v678q0 8-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
10
-
11
- <glyph glyph-name="video" unicode="&#xe801;" d="M214-43v72q0 14-10 25t-25 10h-72q-14 0-25-10t-11-25v-72q0-14 11-25t25-11h72q14 0 25 11t10 25z m0 214v72q0 14-10 25t-25 11h-72q-14 0-25-11t-11-25v-72q0-14 11-25t25-10h72q14 0 25 10t10 25z m0 215v71q0 15-10 25t-25 11h-72q-14 0-25-11t-11-25v-71q0-15 11-25t25-11h72q14 0 25 11t10 25z m572-429v286q0 14-11 25t-25 11h-429q-14 0-25-11t-10-25v-286q0-14 10-25t25-11h429q15 0 25 11t11 25z m-572 643v71q0 15-10 26t-25 10h-72q-14 0-25-10t-11-26v-71q0-14 11-25t25-11h72q14 0 25 11t10 25z m786-643v72q0 14-11 25t-25 10h-71q-15 0-25-10t-11-25v-72q0-14 11-25t25-11h71q15 0 25 11t11 25z m-214 429v285q0 15-11 26t-25 10h-429q-14 0-25-10t-10-26v-285q0-15 10-25t25-11h429q15 0 25 11t11 25z m214-215v72q0 14-11 25t-25 11h-71q-15 0-25-11t-11-25v-72q0-14 11-25t25-10h71q15 0 25 10t11 25z m0 215v71q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-71q0-15 11-25t25-11h71q15 0 25 11t11 25z m0 214v71q0 15-11 26t-25 10h-71q-15 0-25-10t-11-26v-71q0-14 11-25t25-11h71q15 0 25 11t11 25z m71 89v-750q0-37-26-63t-63-26h-893q-36 0-63 26t-26 63v750q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
12
-
13
- <glyph glyph-name="chat" unicode="&#xe802;" d="M786 421q0-77-53-143t-143-104-197-38q-48 0-98 9-70-49-155-72-21-5-48-9h-2q-6 0-12 5t-6 12q-1 1-1 3t1 4 1 3l1 3t2 3 2 3 3 3 2 2q3 3 13 14t15 16 12 17 14 21 11 25q-69 40-108 98t-40 125q0 78 53 144t143 104 197 38 197-38 143-104 53-144z m214-142q0-67-40-126t-108-98q5-14 11-25t14-21 13-16 14-17 13-14q0 0 2-2t3-3 2-3 2-3l1-3t1-3 1-4-1-3q-2-8-7-13t-12-4q-28 4-48 9-86 23-156 72-50-9-98-9-151 0-263 74 32-3 49-3 90 0 172 25t148 72q69 52 107 119t37 141q0 43-13 85 72-39 114-99t42-128z" horiz-adv-x="1000" />
14
-
15
- <glyph glyph-name="audio" unicode="&#xe803;" d="M857 725v-625q0-28-19-50t-48-33-58-18-53-6-54 6-58 18-48 33-19 50 19 50 48 33 58 18 54 6q58 0 107-22v300l-429-132v-396q0-28-19-50t-48-33-58-18-53-6-54 6-58 18-48 33-19 50 19 50 48 34 58 17 54 6q58 0 107-21v539q0 17 10 32t28 20l464 142q7 3 16 3 22 0 38-16t15-38z" horiz-adv-x="857.1" />
16
-
17
- <glyph glyph-name="gallery" unicode="&#xe805;" d="M856 518l-100 0-124 150-214-150-180 0q-52 0-90-39t-38-91l0-160-108 296q-10 38 22 52l680 248q36 10 50-24z m106-90q16 0 27-12t11-28l0-472q0-16-11-28t-27-12l-724 0q-16 0-27 12t-11 28l0 472q0 16 11 28t27 12l724 0z m-56-452l0 162-72 160-166-60-130-132-138 170-92-214 0-86 598 0z" horiz-adv-x="1000" />
18
-
19
- <glyph glyph-name="standard" unicode="&#xe806;" d="M416 650q0 21 16 36t37 16 36-15l329-324-329-323q-15-15-36-15t-37 15-16 37l0 130q-132-4-234-46t-182-163l0 53q0 180 119 313t297 153l0 133z" horiz-adv-x="834" />
20
-
21
- <glyph glyph-name="pin" unicode="&#xe807;" d="M573 37q0-23-15-38t-37-15q-21 0-37 16l-169 169-315-236 236 315-168 169q-24 23-12 56 14 32 48 32 157 0 270 57 90 45 151 171 9 24 36 32t50-13l208-209q21-23 14-50t-32-36q-127-63-172-152-56-110-56-268z" horiz-adv-x="834" />
22
-
23
- <glyph glyph-name="link" unicode="&#xe809;" d="M813 171q0 23-16 38l-116 116q-16 16-38 16-24 0-40-18 1-1 10-10t12-12 9-11 7-14 2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7-11 9-12 12-10 10q-19-17-19-40 0-23 16-38l115-116q15-15 38-15 22 0 38 15l82 81q16 16 16 37z m-393 394q0 22-15 38l-115 115q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37 0-22 16-38l116-116q15-15 38-15 23 0 40 17-2 2-11 11t-12 12-8 10-7 14-2 16q0 22 15 38t38 15q9 0 16-2t14-7 11-8 12-12 10-11q18 17 18 41z m500-394q0-66-48-113l-82-81q-46-47-113-47-68 0-114 48l-115 115q-46 47-46 114 0 68 49 116l-49 49q-48-49-116-49-67 0-114 47l-116 116q-47 47-47 114t47 113l82 82q47 46 114 46 67 0 114-47l115-116q46-46 46-113 0-69-49-117l49-49q48 49 116 49 67 0 114-47l116-116q47-47 47-114z" horiz-adv-x="928.6" />
24
-
25
- <glyph glyph-name="status" unicode="&#xe80a;" d="M1179 385q0-126-79-233t-215-170-296-62q-122 0-234 39l2-3-357-107q44 59 71 126t31 106l4 38q-106 120-106 266 0 126 79 233t215 169 295 62 296-62 215-169 79-233z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z" horiz-adv-x="1179" />
26
-
27
- <glyph glyph-name="aside" unicode="&#xf0f6;" d="M819 638q16-16 27-42t11-50v-642q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38v892q0 23 16 38t38 16h500q22 0 49-11t42-27z m-248 136v-210h210q-5 17-12 23l-175 175q-6 7-23 12z m215-853v572h-232q-23 0-38 16t-16 37v233h-429v-858h715z m-572 483q0 7 5 12t13 5h393q8 0 13-5t5-12v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36z m411-125q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36q0 8 5 13t13 5h393z m0-143q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36q0 8 5 13t13 5h393z" horiz-adv-x="857.1" />
28
-
29
- <glyph glyph-name="quote" unicode="&#xf10d;" d="M429 314v-214q0-45-32-76t-76-31h-214q-44 0-76 31t-31 76v393q0 58 23 111t61 91 91 61 111 23h35q15 0 26-11t10-25v-72q0-14-10-25t-26-10h-35q-59 0-101-42t-42-101v-18q0-22 16-38t37-16h125q45 0 76-31t32-76z m500 0v-214q0-45-32-76t-76-31h-214q-44 0-76 31t-31 76v393q0 58 23 111t61 91 91 61 111 23h35q15 0 26-11t10-25v-72q0-14-10-25t-26-10h-35q-59 0-101-42t-42-101v-18q0-22 16-38t37-16h125q45 0 76-31t32-76z" horiz-adv-x="928.6" />
30
- </font>
31
- </defs>
32
  </svg>
1
+ <?xml version="1.0" standalone="no"?>
2
+ <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
+ <svg xmlns="http://www.w3.org/2000/svg">
4
+ <metadata>Copyright (C) 2018 by original authors @ fontello.com</metadata>
5
+ <defs>
6
+ <font id="cat_post" horiz-adv-x="1000" >
7
+ <font-face font-family="cat_post" font-weight="400" font-stretch="normal" units-per-em="1000" ascent="850" descent="-150" />
8
+ <missing-glyph horiz-adv-x="1000" />
9
+ <glyph glyph-name="image" unicode="&#xe800;" d="M357 529q0-45-31-76t-76-32-76 32-31 76 31 76 76 31 76-31 31-76z m572-215v-250h-786v107l178 179 90-89 285 285z m53 393h-893q-7 0-12-5t-6-13v-678q0-7 6-13t12-5h893q7 0 13 5t5 13v678q0 8-5 13t-13 5z m89-18v-678q0-37-26-63t-63-27h-893q-36 0-63 27t-26 63v678q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
10
+
11
+ <glyph glyph-name="video" unicode="&#xe801;" d="M214-43v72q0 14-10 25t-25 10h-72q-14 0-25-10t-11-25v-72q0-14 11-25t25-11h72q14 0 25 11t10 25z m0 214v72q0 14-10 25t-25 11h-72q-14 0-25-11t-11-25v-72q0-14 11-25t25-10h72q14 0 25 10t10 25z m0 215v71q0 15-10 25t-25 11h-72q-14 0-25-11t-11-25v-71q0-15 11-25t25-11h72q14 0 25 11t10 25z m572-429v286q0 14-11 25t-25 11h-429q-14 0-25-11t-10-25v-286q0-14 10-25t25-11h429q15 0 25 11t11 25z m-572 643v71q0 15-10 26t-25 10h-72q-14 0-25-10t-11-26v-71q0-14 11-25t25-11h72q14 0 25 11t10 25z m786-643v72q0 14-11 25t-25 10h-71q-15 0-25-10t-11-25v-72q0-14 11-25t25-11h71q15 0 25 11t11 25z m-214 429v285q0 15-11 26t-25 10h-429q-14 0-25-10t-10-26v-285q0-15 10-25t25-11h429q15 0 25 11t11 25z m214-215v72q0 14-11 25t-25 11h-71q-15 0-25-11t-11-25v-72q0-14 11-25t25-10h71q15 0 25 10t11 25z m0 215v71q0 15-11 25t-25 11h-71q-15 0-25-11t-11-25v-71q0-15 11-25t25-11h71q15 0 25 11t11 25z m0 214v71q0 15-11 26t-25 10h-71q-15 0-25-10t-11-26v-71q0-14 11-25t25-11h71q15 0 25 11t11 25z m71 89v-750q0-37-26-63t-63-26h-893q-36 0-63 26t-26 63v750q0 37 26 63t63 27h893q37 0 63-27t26-63z" horiz-adv-x="1071.4" />
12
+
13
+ <glyph glyph-name="chat" unicode="&#xe802;" d="M786 421q0-77-53-143t-143-104-197-38q-48 0-98 9-70-49-155-72-21-5-48-9h-2q-6 0-12 5t-6 12q-1 1-1 3t1 4 1 3l1 3t2 3 2 3 3 3 2 2q3 3 13 14t15 16 12 17 14 21 11 25q-69 40-108 98t-40 125q0 78 53 144t143 104 197 38 197-38 143-104 53-144z m214-142q0-67-40-126t-108-98q5-14 11-25t14-21 13-16 14-17 13-14q0 0 2-2t3-3 2-3 2-3l1-3t1-3 1-4-1-3q-2-8-7-13t-12-4q-28 4-48 9-86 23-156 72-50-9-98-9-151 0-263 74 32-3 49-3 90 0 172 25t148 72q69 52 107 119t37 141q0 43-13 85 72-39 114-99t42-128z" horiz-adv-x="1000" />
14
+
15
+ <glyph glyph-name="audio" unicode="&#xe803;" d="M857 725v-625q0-28-19-50t-48-33-58-18-53-6-54 6-58 18-48 33-19 50 19 50 48 33 58 18 54 6q58 0 107-22v300l-429-132v-396q0-28-19-50t-48-33-58-18-53-6-54 6-58 18-48 33-19 50 19 50 48 34 58 17 54 6q58 0 107-21v539q0 17 10 32t28 20l464 142q7 3 16 3 22 0 38-16t15-38z" horiz-adv-x="857.1" />
16
+
17
+ <glyph glyph-name="gallery" unicode="&#xe805;" d="M856 518l-100 0-124 150-214-150-180 0q-52 0-90-39t-38-91l0-160-108 296q-10 38 22 52l680 248q36 10 50-24z m106-90q16 0 27-12t11-28l0-472q0-16-11-28t-27-12l-724 0q-16 0-27 12t-11 28l0 472q0 16 11 28t27 12l724 0z m-56-452l0 162-72 160-166-60-130-132-138 170-92-214 0-86 598 0z" horiz-adv-x="1000" />
18
+
19
+ <glyph glyph-name="standard" unicode="&#xe806;" d="M416 650q0 21 16 36t37 16 36-15l329-324-329-323q-15-15-36-15t-37 15-16 37l0 130q-132-4-234-46t-182-163l0 53q0 180 119 313t297 153l0 133z" horiz-adv-x="834" />
20
+
21
+ <glyph glyph-name="pin" unicode="&#xe807;" d="M573 37q0-23-15-38t-37-15q-21 0-37 16l-169 169-315-236 236 315-168 169q-24 23-12 56 14 32 48 32 157 0 270 57 90 45 151 171 9 24 36 32t50-13l208-209q21-23 14-50t-32-36q-127-63-172-152-56-110-56-268z" horiz-adv-x="834" />
22
+
23
+ <glyph glyph-name="link" unicode="&#xe809;" d="M813 171q0 23-16 38l-116 116q-16 16-38 16-24 0-40-18 1-1 10-10t12-12 9-11 7-14 2-15q0-23-16-38t-38-16q-8 0-15 2t-14 7-11 9-12 12-10 10q-19-17-19-40 0-23 16-38l115-116q15-15 38-15 22 0 38 15l82 81q16 16 16 37z m-393 394q0 22-15 38l-115 115q-16 16-38 16-22 0-38-15l-82-82q-16-15-16-37 0-22 16-38l116-116q15-15 38-15 23 0 40 17-2 2-11 11t-12 12-8 10-7 14-2 16q0 22 15 38t38 15q9 0 16-2t14-7 11-8 12-12 10-11q18 17 18 41z m500-394q0-66-48-113l-82-81q-46-47-113-47-68 0-114 48l-115 115q-46 47-46 114 0 68 49 116l-49 49q-48-49-116-49-67 0-114 47l-116 116q-47 47-47 114t47 113l82 82q47 46 114 46 67 0 114-47l115-116q46-46 46-113 0-69-49-117l49-49q48 49 116 49 67 0 114-47l116-116q47-47 47-114z" horiz-adv-x="928.6" />
24
+
25
+ <glyph glyph-name="status" unicode="&#xe80a;" d="M1179 385q0-126-79-233t-215-170-296-62q-122 0-234 39l2-3-357-107q44 59 71 126t31 106l4 38q-106 120-106 266 0 126 79 233t215 169 295 62 296-62 215-169 79-233z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z m-250 0q0 29-21 50t-51 21q-29 0-50-21t-21-50q0-30 21-51t50-21q30 0 51 21t21 51z" horiz-adv-x="1179" />
26
+
27
+ <glyph glyph-name="aside" unicode="&#xf0f6;" d="M819 638q16-16 27-42t11-50v-642q0-23-15-38t-38-16h-750q-23 0-38 16t-16 38v892q0 23 16 38t38 16h500q22 0 49-11t42-27z m-248 136v-210h210q-5 17-12 23l-175 175q-6 7-23 12z m215-853v572h-232q-23 0-38 16t-16 37v233h-429v-858h715z m-572 483q0 7 5 12t13 5h393q8 0 13-5t5-12v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36z m411-125q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36q0 8 5 13t13 5h393z m0-143q8 0 13-5t5-13v-36q0-8-5-13t-13-5h-393q-8 0-13 5t-5 13v36q0 8 5 13t13 5h393z" horiz-adv-x="857.1" />
28
+
29
+ <glyph glyph-name="quote" unicode="&#xf10d;" d="M429 314v-214q0-45-32-76t-76-31h-214q-44 0-76 31t-31 76v393q0 58 23 111t61 91 91 61 111 23h35q15 0 26-11t10-25v-72q0-14-10-25t-26-10h-35q-59 0-101-42t-42-101v-18q0-22 16-38t37-16h125q45 0 76-31t32-76z m500 0v-214q0-45-32-76t-76-31h-214q-44 0-76 31t-31 76v393q0 58 23 111t61 91 91 61 111 23h35q15 0 26-11t10-25v-72q0-14-10-25t-26-10h-35q-59 0-101-42t-42-101v-18q0-22 16-38t37-16h125q45 0 76-31t32-76z" horiz-adv-x="928.6" />
30
+ </font>
31
+ </defs>
32
  </svg>
icons/font/cat_post.ttf CHANGED
File without changes
icons/font/cat_post.woff CHANGED
File without changes
icons/font/cat_post.woff2 CHANGED
File without changes
js/admin/category-posts-widget.js CHANGED
@@ -7,497 +7,523 @@
7
  * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
  */
9
 
10
- // namespace
11
-
12
- var cwp_namespace = {
13
-
14
- php_settings_var : 'categoryPosts',
15
- widget_class : '.category-widget-cont',
16
- template_panel_prefix : '.categoryposts-data-panel-',
17
- open_panels : {}, // holds an array of open panels per wiget id
18
- template_change_timer : null, // Used for debouncing change events generate when template changes.
19
-
20
- // generic click handler on the panel title
21
- clickHandler: function(element) {
22
- // open the div "below" the h4 title
23
- jQuery(element).toggleClass('open')
24
- .next().stop().slideToggle();
25
- // mark the change of state in the open panels array
26
- var panel = jQuery(element).data('panel');
27
- var id = jQuery(element).parent().parent().parent().parent().parent().attr('id');
28
- var o = {};
29
- if (this.open_panels.hasOwnProperty(id))
30
- o = this.open_panels[id];
31
- if (o.hasOwnProperty(panel))
32
- delete o[panel];
33
- else
34
- o[panel] = true;
35
- this.open_panels[id] = o;
36
- },
37
-
38
- // Show hide foote link URL
39
- toggleCatSelection: function(item) {
40
- var cat = jQuery(item).find("option:selected").attr('value');
41
- var panel = item.parentElement.parentElement.parentElement.parentElement;
42
- if(cat == '0') {
43
- jQuery(panel).find( '.categoryPosts-title_link' ).hide();
44
- jQuery(panel).find( '.categoryPosts-title_link_url' ).show();
45
- jQuery(panel).find( '.categoryPosts-no_cat_childs' ).hide();
46
- }
47
- else {
48
- jQuery(panel).find('.categoryPosts-title_link' ).show();
49
- jQuery(panel).find('.categoryPosts-title_link_url' ).hide();
50
- jQuery(panel).find( '.categoryPosts-no_cat_childs' ).show();
51
- }
52
- },
53
-
54
- // Show hide disable font styles
55
- toggleDisableFontStyles: function(item) {
56
- var value = jQuery(item).find("input").attr('checked');
57
- var panel = item.parentElement.parentElement;
58
- if(value == 'checked') {
59
- jQuery(panel).find('.categoryposts-data-panel-general-disable-font-styles').hide();
60
- }
61
- else {
62
- jQuery(panel).find('.categoryposts-data-panel-general-disable-font-styles').show();
63
- }
64
- },
65
-
66
- // Show hide other date format
67
- toggleDateFormat: function(item) {
68
- var value = jQuery(item).val();
69
- var panel = item.parentElement.parentElement;
70
- if( value != 'other') {
71
- jQuery(panel).find('.categoryPosts-date_format').hide();
72
- } else {
73
- jQuery(panel).find('.categoryPosts-date_format').show();
74
- }
75
- },
76
-
77
- // Show hide other date range settings
78
- toggleDateRange: function(item) {
79
- var value = jQuery(item).val();
80
- var panel = item.parentElement.parentElement;
81
- jQuery(panel).find('.categoryPosts-date-range p').hide();
82
- jQuery(panel).find('.categoryPosts-date-range').show();
83
- switch ( value ) {
84
- case 'off':
85
- jQuery(panel).find('.categoryPosts-date-range').hide();
86
- break;
87
- case 'days_ago':
88
- jQuery(panel).find('.categoryPosts-days_ago').show();
89
- break;
90
- case 'between_dates':
91
- jQuery(panel).find('.categoryPosts-start_date').show();
92
- jQuery(panel).find('.categoryPosts-end_date').show();
93
- break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
94
  }
95
- },
96
-
97
- // Show/hide no match related settings
98
- toggleNoMatch: function(item) {
99
- var value = jQuery(item).val();
100
- var panel = item.parentElement.parentElement;
101
- if ( 'text' == value ) {
102
- jQuery(panel).find('.categoryPosts-no-match-text').show();
103
- } else {
104
- jQuery(panel).find('.categoryPosts-no-match-text').hide();
105
- }
106
- },
107
-
108
- // Show template help
109
- toggleTemplateHelp: function(item,event) {
110
- event.preventDefault();
111
- var panel = item.parentElement.parentElement.parentElement.parentElement;
112
- jQuery(panel).find('.cat-post-template-help').toggle('slow');
113
- },
114
-
115
- toggleAssignedCategoriesTop: function(item) {
116
- var value = jQuery(item).find("input").attr('checked');
117
- var panel = item.parentElement.parentElement;
118
- if(value == 'checked') {
119
- jQuery(panel).find('.categoryposts-details-panel-assigned-cat-top').show();
120
  }
121
- else {
122
- jQuery(panel).find('.categoryposts-details-panel-assigned-cat-top').hide();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
123
  }
124
- },
125
 
126
- toggleHideTitle: function(item) {
127
- var value = jQuery(item).attr('checked');
128
- var panel = item.parentElement.parentElement.parentElement;
129
- if (value != 'checked') {
130
- jQuery(panel).find('.categoryposts-data-panel-title-settings').show();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
131
  } else {
132
- jQuery(panel).find('.categoryposts-data-panel-title-settings').hide();
 
133
  }
134
- },
135
-
136
- toggleLoadMore: function(item) {
137
- var value = jQuery(item).attr('checked');
138
- var panel = item.parentElement.parentElement.parentElement;
139
- if (value != 'checked') {
140
- jQuery(panel).find('.loadmore-settings').hide();
141
  } else {
142
- jQuery(panel).find('.loadmore-settings').show();
 
143
  }
144
- },
145
-
146
- selectPremadeTemplate: function(item) {
147
- var panel = item.parentElement.parentElement.parentElement;
148
- var div = item.parentElement.parentElement;
149
- var select = jQuery(div).find('select');
150
- var template = '%title%';
151
- value = select.val();
152
- switch (value) {
153
- case 'title':
154
- template = '%title%';
155
- break;
156
- case 'title_excerpt':
157
- template = '%title%\n\n%excerpt%';
158
- break;
159
- case 'title_thumb':
160
- template = '%title%\n\n%thumb%';
161
- break;
162
- case 'title_thum_excerpt':
163
- template = '%title%\n\n%thumb%\n%excerpt%';
164
- break;
165
- case 'everything':
166
- template = '%title%\n\n';
167
- template += '%date%\n\n';
168
- template += '%thumb%\n';
169
- template += '<span class="dashicons dashicons-admin-comments"></span> %commentnum% ';
170
- template += '<span class="dashicons dashicons-admin-users"></span> %author%\n';
171
- template += '%excerpt%';
172
- template += 'Categories: %category% ';
173
- template += '<span class="dashicons dashicons-tag"></span> %post_tag%';
174
- }
175
- var textarea = jQuery(panel).find('textarea');
176
- textarea.val(template);
177
- textarea.trigger('input', 'change');
178
- },
179
-
180
- // Close all open panels if open
181
- autoCloseOpenPanels: function(_this) {
182
- if( tiptoppress[ this.php_settings_var ].accordion ) {
183
- if(!jQuery(_this).hasClass('open')) {
184
- var jCloseElement = jQuery(_this).parent().find('.open');
185
- this.clickHandler(jCloseElement);
186
- }
187
- }
188
- },
189
-
190
- defaultThumbnailSelection: function (elem, title, button_title) {
191
-
192
- var frame = wp.media({
193
- title : title,
194
- multiple : false,
195
- library : { type : 'image' },
196
- button : { text : button_title },
197
- });
198
-
199
- // Handle results from media manager.
200
- frame.on('close',function( ) {
201
- var attachments = frame.state().get('selection').toJSON();
202
- if (attachments.length == 1) {
203
- var attachment = attachments[0];
204
- var img_html = '<img src="' + attachment.url + '" ';
205
- img_html += 'width="60" ';
206
- img_html += 'height="60" ';
207
- img_html += '/>';
208
- jQuery(elem).parent().prev().find('.default_thumb_img').html(img_html);
209
- jQuery(elem).parent().find('.cwp_default_thumb_remove').show();
210
- jQuery(elem).parent().prev().find('.default_thumb_id').val(attachment.id).change();
211
- }
212
- });
213
-
214
- frame.open();
215
- return false;
216
- },
217
-
218
- removeDefaultThumbnailSelection : function (elem) {
219
- jQuery(elem).parent().prev().find('.default_thumb_img').html(cwp_default_thumb_selection.none);
220
- jQuery(elem).hide();
221
- jQuery(elem).parent().prev().find('.default_thumb_id').val(0).change();
222
-
223
- return false;
224
- },
225
-
226
- templateChange : function (elem) {
227
-
228
- function adjustUiToTemplate() {
229
- var template = jQuery(elem).val();
230
- var tags = tiptoppress[ this.php_settings_var ].template_tags;
231
- var widget_cont = jQuery(elem.parentElement.parentElement.parentElement.parentElement);
232
- for (var key in tags) {
233
- if ( -1 !== template.indexOf( tags[key] ) ) {
234
- widget_cont.find(this.template_panel_prefix + tags[key] ).show();
235
- } else {
236
- widget_cont.find(this.template_panel_prefix + tags[key] ).hide();
237
- }
238
- }
239
- }
240
-
241
- if (null != this.template_change_timer) {
242
- clearTimeout( this.template_change_timer );
243
- }
244
- this.template_change_timer = setTimeout(adjustUiToTemplate.bind(this), 250);
245
-
246
- },
247
-
248
- thumbnailSizeChange : function (elem) {
249
-
250
- var _that = jQuery(elem),
251
- thumb_h,
252
- thumb_w,
253
- _input_thumb_h = _that.closest('.categoryposts-data-panel-thumb').find('.thumb_h'),
254
- _input_thumb_w = _that.closest('.categoryposts-data-panel-thumb').find('.thumb_w');
255
-
256
- if (_that.hasClass('smaller')) {
257
- thumb_w = _input_thumb_w.val() / 1.015;
258
- thumb_h = _input_thumb_h.val() / 1.015;
259
- } else if (_that.hasClass('quarter')) {
260
- thumb_w = _input_thumb_w.val() / 4;
261
- thumb_h = _input_thumb_h.val() / 4;
262
- } else if (_that.hasClass('half')){
263
- thumb_h = _input_thumb_h.val() / 2;
264
- thumb_w = _input_thumb_w.val() / 2;
265
- } else if (_that.hasClass('double')){
266
- thumb_h = _input_thumb_h.val() * 2;
267
- thumb_w = _input_thumb_w.val() * 2;
268
- } else if (_that.hasClass('bigger')) {
269
- thumb_w = _input_thumb_w.val() * 1.02;
270
- thumb_h = _input_thumb_h.val() * 1.02;
271
- } else if (_that.hasClass('square')) {
272
- if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val()) ) {
273
- thumb_h = _input_thumb_w.val();
274
- thumb_w = _input_thumb_w.val();
275
- } else{
276
- thumb_h = _input_thumb_h.val();
277
- thumb_w = _input_thumb_h.val();
278
- }
279
- } else if (_that.hasClass('standard')) {
280
- if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val()) ) {
281
- thumb_h = _input_thumb_w.val() / 4 * 3
282
- thumb_w = _input_thumb_w.val();
283
- } else {
284
- thumb_h = _input_thumb_w.val() * 4 / 3;
285
- thumb_w = _input_thumb_w.val();
286
- }
287
- } else if (_that.hasClass('wide')) {
288
- if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val()) ) {
289
- thumb_h = _input_thumb_w.val() / 16 * 9;
290
- thumb_w = _input_thumb_w.val();
291
- } else {
292
- thumb_h = _input_thumb_w.val() * 16 / 9;
293
- thumb_w = _input_thumb_w.val();
294
- }
295
- } else if (_that.hasClass('switch')){
296
- thumb_h = _input_thumb_w.val();
297
- thumb_w = _input_thumb_h.val();
298
- } else {
299
- thumb_w = _that.data("thumb-w");
300
- thumb_h = _that.data("thumb-h");
301
- }
302
- _input_thumb_w.val(Math.floor(thumb_w));
303
- _input_thumb_h.val(Math.floor(thumb_h));
304
- _input_thumb_w.trigger('input', 'change');
305
- _input_thumb_h.trigger('input', 'change');
306
-
307
- return false;
308
- },
309
-
310
- thumbnailFluidWidthChange : function (elem) {
311
-
312
- var _that = jQuery(elem),
313
- _input_thumb_h = _that.closest('.categoryposts-data-panel-thumb').find('.thumb_h');
314
-
315
- _that.closest( 'label' ).find( 'span' ).html( _that.val() + '%' );
316
-
317
- _input_thumb_h.val(0);
318
- _input_thumb_h.trigger('input', 'change');
319
-
320
- return false;
321
- },
322
-
323
- openAddPlaceholder : function (elem) {
324
-
325
- var _that = jQuery(elem);
326
-
327
- _that.closest( '.cat-post-add_premade_templates' ).find( '.cpwp-placeholder-dropdown-menu' ).toggle();
328
-
329
- _that.closest( '.cat-post-add_premade_templates' ).find( '.cpwp-placeholder-dropdown-menu span' ).off('click').on('click', function() {
330
- var text = jQuery( this ).data( 'value' );
331
- switch( text ){
332
- case 'NewLine':
333
- text = '\n';
334
- break;
335
- case 'EmptyLine':
336
- text = '\n\n';
337
- break;
338
- default:
339
- text = '%' + text + '%';
340
- break;
341
- }
342
- var _div = this.parentElement.parentElement.parentElement;
343
- var textarea = jQuery( _div ).find( 'textarea' );
344
- var textareaPos = textarea[0].selectionStart;
345
- var textareaTxt = textarea.val();
346
- textarea.val( textareaTxt.substring(0, textareaPos) + text + textareaTxt.substring(textareaPos) );
347
-
348
- textarea[0].selectionStart = textareaPos + text.length;
349
- textarea[0].selectionEnd = textareaPos + text.length;
350
- textarea.focus();
351
- textarea.trigger('input', 'change');
352
-
353
- //_that.closest( '.cat-post-add_premade_templates' ).find( '.cpwp-placeholder-dropdown-menu' ).hide();
354
- });
355
-
356
- _that.closest( '.cat-post-add_premade_templates' ).find( '.cpwp-placeholder-dropdown-menu' ).on('mouseenter', function(){
357
- jQuery(this).addClass('cpw-doNotClose');
358
- });
359
- _that.closest( '.cat-post-add_premade_templates' ).find( '.cpwp-placeholder-dropdown-menu' ).on('mouseleave', function(){
360
- jQuery(this).removeClass('cpw-doNotClose');
361
- });
362
-
363
- return false;
364
- },
365
-
366
- selectPlaceholderHelper : function (elem) {
367
-
368
- var textarea = jQuery(elem);
369
- var textareaPos = textarea[0].selectionStart;
370
- var textareaTxt = textarea.val();
371
-
372
- var nStartSel = textareaTxt.substring(0, textareaPos).lastIndexOf( '%' );
373
- var nEndSel = textareaPos + textareaTxt.substring(textareaPos).indexOf( '%' ) + 1;
374
-
375
- var strSelTxt = textareaTxt.substring(nStartSel, nEndSel);
376
- if( strSelTxt.indexOf( '\n' ) >= 0 || strSelTxt.indexOf( ' ' ) >= 0 || strSelTxt.length <=2 ) {
377
- return false;
378
- }
379
-
380
- textarea[0].selectionStart = nStartSel;
381
- textarea[0].selectionEnd = nEndSel;
382
- return false;
383
- },
384
- }
385
-
386
- jQuery(document).ready( function () {
387
-
388
- var class_namespace = '.category-widget-cont';
389
-
390
- jQuery('.category-widget-cont h4').click(function () { // for widgets page
391
- cwp_namespace.autoCloseOpenPanels(this);
392
- // toggle panel open/close
393
- cwp_namespace.clickHandler(this);
394
- });
395
-
396
- // needed to reassign click handlers after widget refresh
397
- jQuery(document).on('widget-added widget-updated panelsopen', function(root,element){ // for customize and after save on widgets page (add panelsopen: fix make widget SiteOrigin Page Builder plugin, GH issue #181)
398
-
399
- jQuery('.category-widget-cont h4').off('click').on('click', function () {
400
- cwp_namespace.autoCloseOpenPanels(this);
401
- // toggle panel open/close
402
- cwp_namespace.clickHandler(this);
403
- });
404
- jQuery('.cwp_default_thumb_select').off('click').on('click', function () { // select default thumb
405
- cwp_namespace.defaultThumbnailSelection(this, cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title);
406
- });
407
-
408
- jQuery('.cwp_default_thumb_remove').off('click').on('click', function () { // remove default thumb
409
- cwp_namespace.removeDefaultThumbnailSelection(this);
410
- });
411
-
412
- // refresh panels to state before the refresh
413
- var id = jQuery(element).attr('id');
414
- if (cwp_namespace.open_panels.hasOwnProperty(id)) {
415
- var o = cwp_namespace.open_panels[id];
416
- for (var panel in o) {
417
- jQuery(element).find('[data-panel='+panel+']').toggleClass('open')
418
- .next().stop().show();
419
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
420
  }
 
 
 
 
421
 
422
- setChangeHandlers();
423
- });
424
 
425
- function setChangeHandlers() {
426
- jQuery('.cwp_default_thumb_select').off('click').on('click', function () { // select default thumb
427
- cwp_namespace.defaultThumbnailSelection(this, cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title);
428
- });
429
 
430
- jQuery(document).on('change', class_namespace+' .categoryposts-data-panel-filter-cat', function () { // change category filter
431
- cwp_namespace.toggleCatSelection(this);
432
- });
433
 
434
- jQuery('.cwp_default_thumb_remove').off('click').on('click', function () { // remove default thumb
435
- cwp_namespace.removeDefaultThumbnailSelection(this);
436
- });
437
 
438
- jQuery(class_namespace+'-assigned_categories').off('click').on('click', function () {
439
- cwp_namespace.toggleAssignedCategoriesTop(this);
440
- });
441
 
442
- jQuery(document).on('click', class_namespace+' .categoryPosts-hide_title input', function () {
443
- cwp_namespace.toggleHideTitle(this);
444
- });
445
 
446
- jQuery(document).on('click', class_namespace+' .categoryPosts-enable_loadmore input', function () {
447
- cwp_namespace.toggleLoadMore(this);
448
- });
449
 
450
- jQuery(document).on('change', class_namespace+' .categoryPosts-preset_date_format select', function () { // change date format
451
- cwp_namespace.toggleDateFormat(this);
452
- });
453
 
454
- jQuery(document).on('change', class_namespace+' .categoryPosts-date_range select', function () { // change date range
455
- cwp_namespace.toggleDateRange(this);
456
- });
457
 
458
- jQuery(document).on('change', class_namespace+' .categoryPosts-no_match_handling select', function () { // change date range
459
- cwp_namespace.toggleNoMatch(this);
460
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
 
462
- jQuery(class_namespace+' a.toggle-template-help').off('click').on('click', function (event) { // show template help
463
- cwp_namespace.toggleTemplateHelp(this, event);
464
- });
 
 
465
 
466
- jQuery(document).on('click', class_namespace+' .cat-post-premade_templates button', function () { // select a pre made template
467
- cwp_namespace.selectPremadeTemplate(this);
468
- });
469
 
470
- jQuery(document).on('change', class_namespace+' .cat-post-premade_templates select', function (event) { // prevent refresh ontemplate selection
471
- event.preventDefault();
472
- event.stopPropagation();
473
- });
474
 
475
- jQuery(document).on('input', class_namespace+' .categoryPosts-template textarea', function () { // prevent refresh ontemplate selection
476
- cwp_namespace.templateChange(this);
477
- });
 
 
478
 
479
- jQuery(class_namespace+' .cat-post-thumb-change-size button').off('click').on('click', function () { // find a thumbnail size
480
- cwp_namespace.thumbnailSizeChange(this);
481
- });
482
 
483
- jQuery(document).on('change', class_namespace+' .thumb_fluid_width', function () { // select a thumbnail fluid size
484
- cwp_namespace.thumbnailFluidWidthChange(this);
485
- });
 
 
 
 
 
486
 
487
- jQuery(class_namespace+' .cpwp-open-placholder-dropdown-menu').off('click').on('click', function () { // open drop down and add placeholder
488
- cwp_namespace.openAddPlaceholder(this);
489
- });
490
 
491
- jQuery(document).on('onfocusout, blur', class_namespace+' .cpwp-open-placholder-dropdown-menu,'+class_namespace+' .categoryPosts-template textarea', function () { // close drop down placeholder, if not used
492
- jQuery(this).closest( class_namespace+' .categoryPosts-template' ).parent().find( '.cpwp-placeholder-dropdown-menu' ).not('.cpw-doNotClose').hide();
493
- });
 
 
 
 
 
 
494
 
495
- jQuery(document).on('mousedown', class_namespace+' .categoryPosts-template textarea', function () { // help to select the placeholder
496
- var _that = this;
497
- setTimeout(function(){ cwp_namespace.selectPlaceholderHelper(_that); }, 0);
498
- ;
499
- });
500
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
501
 
502
- setChangeHandlers();
503
- });
7
  * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
  */
9
 
10
+ // namespace
11
+
12
+ var cwp_namespace = {
13
+
14
+ php_settings_var: 'categoryPosts',
15
+ widget_class: '.category-widget-cont',
16
+ template_panel_prefix: '.categoryposts-data-panel-',
17
+ open_panels: {}, // holds an array of open panels per wiget id
18
+ template_change_timer: null, // Used for debouncing change events generate when template changes.
19
+
20
+ // generic click handler on the panel title
21
+ clickHandler: function(element) {
22
+ // open the div "below" the h4 title
23
+ jQuery(element).toggleClass('open')
24
+ .next().stop().slideToggle();
25
+ // mark the change of state in the open panels array
26
+ var panel = jQuery(element).data('panel');
27
+ var id = jQuery(element).parent().parent().parent().parent().parent().attr('id');
28
+ var o = {};
29
+ if (this.open_panels.hasOwnProperty(id))
30
+ o = this.open_panels[id];
31
+ if (o.hasOwnProperty(panel))
32
+ delete o[panel];
33
+ else
34
+ o[panel] = true;
35
+ this.open_panels[id] = o;
36
+ },
37
+
38
+ // Show hide foote link URL
39
+ toggleCatSelection: function(item) {
40
+ var cat = jQuery(item).find("option:selected").attr('value');
41
+ var panel = item.parentElement.parentElement.parentElement.parentElement;
42
+ if (cat == '0') {
43
+ jQuery(panel).find('.categoryPosts-title_link').hide();
44
+ jQuery(panel).find('.categoryPosts-title_link_url').show();
45
+ jQuery(panel).find('.categoryPosts-no_cat_childs').hide();
46
+ } else {
47
+ jQuery(panel).find('.categoryPosts-title_link').show();
48
+ jQuery(panel).find('.categoryPosts-title_link_url').hide();
49
+ jQuery(panel).find('.categoryPosts-no_cat_childs').show();
50
+ }
51
+ },
52
+
53
+ // Show hide font styles on disable CSS setting change
54
+ toggleDisableFontStyles: function(item) {
55
+ var panel = item.parentElement.parentElement.parentElement;
56
+ if (item.checked) {
57
+ jQuery(panel).find('.categoryPosts-disable_font_styles').hide();
58
+ } else {
59
+ jQuery(panel).find('.categoryPosts-disable_font_styles').show();
60
+ }
61
+ },
62
+
63
+ // Show hide other date format
64
+ toggleDateFormat: function(item) {
65
+ var value = jQuery(item).val();
66
+ var panel = item.parentElement.parentElement;
67
+ if (value != 'other') {
68
+ jQuery(panel).find('.categoryPosts-date_format').hide();
69
+ } else {
70
+ jQuery(panel).find('.categoryPosts-date_format').show();
71
+ }
72
+ },
73
+
74
+ // Show hide other date range settings
75
+ toggleDateRange: function(item) {
76
+ var value = jQuery(item).val();
77
+ var panel = item.parentElement.parentElement;
78
+ jQuery(panel).find('.categoryPosts-date-range p').hide();
79
+ jQuery(panel).find('.categoryPosts-date-range').show();
80
+ switch (value) {
81
+ case 'off':
82
+ jQuery(panel).find('.categoryPosts-date-range').hide();
83
+ break;
84
+ case 'days_ago':
85
+ jQuery(panel).find('.categoryPosts-days_ago').show();
86
+ break;
87
+ case 'between_dates':
88
+ jQuery(panel).find('.categoryPosts-start_date').show();
89
+ jQuery(panel).find('.categoryPosts-end_date').show();
90
+ break;
91
+ }
92
+ },
93
+
94
+ // Show/hide no match related settings
95
+ toggleNoMatch: function(item) {
96
+ var value = jQuery(item).val();
97
+ var panel = item.parentElement.parentElement;
98
+ if ('text' == value) {
99
+ jQuery(panel).find('.categoryPosts-no-match-text').show();
100
+ } else {
101
+ jQuery(panel).find('.categoryPosts-no-match-text').hide();
102
+ }
103
+ },
104
+
105
+ // Show template help
106
+ toggleTemplateHelp: function(item, event) {
107
+ event.preventDefault();
108
+ var panel = item.parentElement.parentElement.parentElement.parentElement;
109
+ jQuery(panel).find('.cat-post-template-help').toggle('slow');
110
+ },
111
+
112
+ // Show image dimensions help
113
+ toggleImageDimensionsHelp: function(item, event) {
114
+ event.preventDefault();
115
+ var panel = item.parentElement.parentElement.parentElement.parentElement;
116
+ jQuery(panel).find('.cat-post-image-dimensions-help').toggle('slow');
117
+ },
118
+
119
+ // Show More Link help
120
+ toggleMoreLinkHelp: function(item, event) {
121
+ event.preventDefault();
122
+ var panel = item.parentElement.parentElement.parentElement.parentElement;
123
+ jQuery(panel).find('.cat-post-more-link-help').toggle('slow');
124
+ },
125
+
126
+ toggleHideTitle: function(item) {
127
+ var panel = item.parentElement.parentElement.parentElement;
128
+ if (item.checked) {
129
+ jQuery(panel).find('.categoryposts-data-panel-title-settings').hide();
130
+ } else {
131
+ jQuery(panel).find('.categoryposts-data-panel-title-settings').show();
132
+ }
133
+ },
134
+
135
+ toggleLoadMore: function(item) {
136
+ var panel = item.parentElement.parentElement.parentElement;
137
+ if (item.checked) {
138
+ jQuery(panel).find('.loadmore-settings').show();
139
+ } else {
140
+ jQuery(panel).find('.loadmore-settings').hide();
141
+ }
142
+ },
143
+
144
+ selectPremadeTemplate: function(item) {
145
+ var panel = item.parentElement.parentElement.parentElement;
146
+ var div = item.parentElement.parentElement;
147
+ var select = jQuery(div).find('select');
148
+ var template = '%title%';
149
+ value = select.val();
150
+ switch (value) {
151
+ case 'title':
152
+ template = '%title%';
153
+ break;
154
+ case 'title_excerpt':
155
+ template = '%title%\n\n%excerpt%\n\n%more-link%';
156
+ break;
157
+ case 'title_thumb':
158
+ template = '%title%\n\n%thumb%';
159
+ break;
160
+ case 'title_thum_excerpt':
161
+ template = '%title%\n\n%thumb%\n%excerpt%%more-link%';
162
+ break;
163
+ case 'everything':
164
+ template = '%title%\n\n';
165
+ template += '%date%\n\n';
166
+ template += '%thumb%\n';
167
+ template += '<span class="dashicons dashicons-admin-comments"></span> %commentnum% ';
168
+ template += '<span class="dashicons dashicons-admin-users"></span> %author%\n';
169
+ template += '%excerpt%';
170
+ template += '%more-link%\n\n';
171
+ template += 'Categories: %category% ';
172
+ template += '<span class="dashicons dashicons-tag"></span> %post_tag%';
173
+ }
174
+ var textarea = jQuery(panel).find('textarea');
175
+ textarea.val(template);
176
+ textarea.trigger('input', 'change');
177
+ },
178
+
179
+ // Close all open panels if open
180
+ autoCloseOpenPanels: function(_this) {
181
+ if (tiptoppress[this.php_settings_var].accordion) {
182
+ if (!jQuery(_this).hasClass('open')) {
183
+ var jCloseElement = jQuery(_this).parent().find('.open');
184
+ this.clickHandler(jCloseElement);
185
  }
186
+ }
187
+ },
188
+
189
+ defaultThumbnailSelection: function(elem, title, button_title) {
190
+
191
+ var frame = wp.media({
192
+ title: title,
193
+ multiple: false,
194
+ library: { type: 'image' },
195
+ button: { text: button_title },
196
+ });
197
+
198
+ // Handle results from media manager.
199
+ frame.on('close', function() {
200
+ var attachments = frame.state().get('selection').toJSON();
201
+ if (attachments.length == 1) {
202
+ var attachment = attachments[0];
203
+ var img_html = '<img src="' + attachment.url + '" ';
204
+ img_html += 'width="60" ';
205
+ img_html += 'height="60" ';
206
+ img_html += '/>';
207
+ jQuery(elem).parent().prev().find('.default_thumb_img').html(img_html);
208
+ jQuery(elem).parent().find('.cwp_default_thumb_remove').show();
209
+ jQuery(elem).parent().prev().find('.default_thumb_id').val(attachment.id).change();
 
210
  }
211
+ });
212
+
213
+ frame.open();
214
+ return false;
215
+ },
216
+
217
+ removeDefaultThumbnailSelection: function(elem) {
218
+ jQuery(elem).parent().prev().find('.default_thumb_img').html(cwp_default_thumb_selection.none);
219
+ jQuery(elem).hide();
220
+ jQuery(elem).parent().prev().find('.default_thumb_id').val(0).change();
221
+
222
+ return false;
223
+ },
224
+
225
+ templateChange: function(elem) {
226
+
227
+ function adjustUiToTemplate() {
228
+ var template = jQuery(elem).val();
229
+ var tags = tiptoppress[this.php_settings_var].template_tags;
230
+ var widget_cont = jQuery(elem.parentElement.parentElement.parentElement.parentElement);
231
+ for (var key in tags) {
232
+ if (-1 !== template.indexOf(tags[key])) {
233
+ widget_cont.find(this.template_panel_prefix + tags[key]).show();
234
+ } else {
235
+ widget_cont.find(this.template_panel_prefix + tags[key]).hide();
236
+ }
237
  }
238
+ }
239
 
240
+ if (null != this.template_change_timer) {
241
+ clearTimeout(this.template_change_timer);
242
+ }
243
+ this.template_change_timer = setTimeout(adjustUiToTemplate.bind(this), 250);
244
+
245
+ },
246
+
247
+ thumbnailSizeChange: function(elem) {
248
+
249
+ var _that = jQuery(elem),
250
+ thumb_h,
251
+ thumb_w,
252
+ _input_thumb_h = _that.closest('.categoryposts-data-panel-thumb').find('.thumb_h'),
253
+ _input_thumb_w = _that.closest('.categoryposts-data-panel-thumb').find('.thumb_w');
254
+
255
+ if (_that.hasClass('smaller')) {
256
+ thumb_w = _input_thumb_w.val() / 1.015;
257
+ thumb_h = _input_thumb_h.val() / 1.015;
258
+ } else if (_that.hasClass('quarter')) {
259
+ thumb_w = _input_thumb_w.val() / 4;
260
+ thumb_h = _input_thumb_h.val() / 4;
261
+ } else if (_that.hasClass('half')) {
262
+ thumb_h = _input_thumb_h.val() / 2;
263
+ thumb_w = _input_thumb_w.val() / 2;
264
+ } else if (_that.hasClass('double')) {
265
+ thumb_h = _input_thumb_h.val() * 2;
266
+ thumb_w = _input_thumb_w.val() * 2;
267
+ } else if (_that.hasClass('bigger')) {
268
+ thumb_w = _input_thumb_w.val() * 1.02;
269
+ thumb_h = _input_thumb_h.val() * 1.02;
270
+ } else if (_that.hasClass('square')) {
271
+ if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val())) {
272
+ thumb_h = _input_thumb_w.val();
273
+ thumb_w = _input_thumb_w.val();
274
  } else {
275
+ thumb_h = _input_thumb_h.val();
276
+ thumb_w = _input_thumb_h.val();
277
  }
278
+ } else if (_that.hasClass('standard')) {
279
+ if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val())) {
280
+ thumb_h = _input_thumb_w.val() / 4 * 3
281
+ thumb_w = _input_thumb_w.val();
 
 
 
282
  } else {
283
+ thumb_h = _input_thumb_w.val() * 4 / 3;
284
+ thumb_w = _input_thumb_w.val();
285
  }
286
+ } else if (_that.hasClass('wide')) {
287
+ if (parseInt(_input_thumb_w.val()) >= parseInt(_input_thumb_h.val())) {
288
+ thumb_h = _input_thumb_w.val() / 16 * 9;
289
+ thumb_w = _input_thumb_w.val();
290
+ } else {
291
+ thumb_h = _input_thumb_w.val() * 16 / 9;
292
+ thumb_w = _input_thumb_w.val();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
293
  }
294
+ } else if (_that.hasClass('switch')) {
295
+ thumb_h = _input_thumb_w.val();
296
+ thumb_w = _input_thumb_h.val();
297
+ } else if (_that.hasClass('width')) {
298
+ _input_thumb_w.val() == 0 ? thumb_w = 300 : thumb_w = _input_thumb_w.val();
299
+ thumb_h = 0;
300
+ } else if (_that.hasClass('height')) {
301
+ _input_thumb_h.val() == 0 ? thumb_h = 300 : thumb_h = _input_thumb_h.val();
302
+ thumb_w = 0;
303
+ } else if (_that.hasClass('both')) {
304
+ thumb_h = 0;
305
+ thumb_w = 0;
306
+ } else {
307
+ thumb_w = _that.data("thumb-w");
308
+ thumb_h = _that.data("thumb-h");
309
  }
310
+ _input_thumb_w.val(Math.floor(thumb_w));
311
+ _input_thumb_h.val(Math.floor(thumb_h));
312
+ _input_thumb_w.trigger('input', 'change');
313
+ _input_thumb_h.trigger('input', 'change');
314
 
315
+ return false;
316
+ },
317
 
318
+ thumbnailFluidWidthChange: function(elem) {
 
 
 
319
 
320
+ var _that = jQuery(elem),
321
+ _input_thumb_h = _that.closest('.categoryposts-data-panel-thumb').find('.thumb_h');
 
322
 
323
+ _that.closest('label').find('span').html(_that.val() + '%');
 
 
324
 
325
+ _input_thumb_h.trigger('input', 'change');
 
 
326
 
327
+ return false;
328
+ },
 
329
 
330
+ openAddPlaceholder: function(elem) {
 
 
331
 
332
+ var _that = jQuery(elem);
 
 
333
 
334
+ _that.closest('.cat-post-add_premade_templates').find('.cpwp-placeholder-dropdown-menu').toggle();
 
 
335
 
336
+ _that.closest('.cat-post-add_premade_templates').find('.cpwp-placeholder-dropdown-menu span').off('click').on('click', function() {
337
+ var text = jQuery(this).data('value');
338
+ switch (text) {
339
+ case 'NewLine':
340
+ text = '\n';
341
+ break;
342
+ case 'EmptyLine':
343
+ text = '\n\n';
344
+ break;
345
+ default:
346
+ text = '%' + text + '%';
347
+ break;
348
+ }
349
+ var _div = this.parentElement.parentElement.parentElement;
350
+ var textarea = jQuery(_div).find('textarea');
351
+ var textareaPos = textarea[0].selectionStart;
352
+ var textareaTxt = textarea.val();
353
+ textarea.val(textareaTxt.substring(0, textareaPos) + text + textareaTxt.substring(textareaPos));
354
+
355
+ textarea[0].selectionStart = textareaPos + text.length;
356
+ textarea[0].selectionEnd = textareaPos + text.length;
357
+ textarea.focus();
358
+ textarea.trigger('input', 'change');
359
+
360
+ //_that.closest( '.cat-post-add_premade_templates' ).find( '.cpwp-placeholder-dropdown-menu' ).hide();
361
+ });
362
+
363
+ _that.closest('.cat-post-add_premade_templates').find('.cpwp-placeholder-dropdown-menu').on('mouseenter', function() {
364
+ jQuery(this).addClass('cpw-doNotClose');
365
+ });
366
+ _that.closest('.cat-post-add_premade_templates').find('.cpwp-placeholder-dropdown-menu').on('mouseleave', function() {
367
+ jQuery(this).removeClass('cpw-doNotClose');
368
+ });
369
+
370
+ _that.closest('.cat-post-add_premade_templates').find('.cpwp-close-placeholder-dropdown-menu').off('click').on('click', function() {
371
+ _that.closest('.cat-post-add_premade_templates').find('.cpwp-placeholder-dropdown-menu').toggle();
372
+ });
373
+
374
+ return false;
375
+ },
376
+
377
+ selectPlaceholderHelper: function(elem) {
378
+
379
+ var textarea = jQuery(elem);
380
+ var textareaPos = textarea[0].selectionStart;
381
+ var textareaTxt = textarea.val();
382
+
383
+ var nStartSel = textareaTxt.substring(0, textareaPos).lastIndexOf('%');
384
+ var nEndSel = textareaPos + textareaTxt.substring(textareaPos).indexOf('%') + 1;
385
+
386
+ var strSelTxt = textareaTxt.substring(nStartSel, nEndSel);
387
+ if (strSelTxt.indexOf('\n') >= 0 || strSelTxt.indexOf(' ') >= 0 || strSelTxt.length <= 2) {
388
+ return false;
389
+ }
390
 
391
+ textarea[0].selectionStart = nStartSel;
392
+ textarea[0].selectionEnd = nEndSel;
393
+ return false;
394
+ },
395
+ }
396
 
397
+ jQuery(document).ready(function() {
 
 
398
 
399
+ var class_namespace = '.category-widget-cont';
 
 
 
400
 
401
+ jQuery('.category-widget-cont h4').click(function() { // for widgets page
402
+ cwp_namespace.autoCloseOpenPanels(this);
403
+ // toggle panel open/close
404
+ cwp_namespace.clickHandler(this);
405
+ });
406
 
407
+ // needed to reassign click handlers after widget refresh
408
+ jQuery(document).on('widget-added widget-updated panelsopen', function(root, element) { // for customize and after save on widgets page (add panelsopen: fix make widget SiteOrigin Page Builder plugin, GH issue #181)
 
409
 
410
+ jQuery('.category-widget-cont h4').off('click').on('click', function() {
411
+ cwp_namespace.autoCloseOpenPanels(this);
412
+ // toggle panel open/close
413
+ cwp_namespace.clickHandler(this);
414
+ });
415
+ jQuery('.cwp_default_thumb_select').off('click').on('click', function() { // select default thumb
416
+ cwp_namespace.defaultThumbnailSelection(this, cwp_default_thumb_selection.frame_title, cwp_default_thumb_selection.button_title);
417
+ });
418
 
419
+ jQuery('.cwp_default_thumb_remove').off('click').on('click', function() { // remove default thumb
420
+ cwp_namespace.removeDefaultThumbnailSelection(this);
421
+ });
422
 
423
+ // refresh panels to state before the refresh
424
+ var id = jQuery(element).attr('id');
425
+ if (cwp_namespace.open_panels.hasOwnProperty(id)) {
426
+ var o = cwp_namespace.open_panels[id];
427
+ for (var panel in o) {
428
+ jQuery(element).find('[data-panel=' + panel + ']').toggleClass('open')
429
+ .next().stop().show();
430
+ }
431
+ }
432
 
433
+ setChangeHandlers();
434
+ });
435
+
436
+ function setChangeHandlers() {
437
+ // Title tab
438
+ jQuery(document).on('click', class_namespace + ' .categoryPosts-hide_title input[type=checkbox]', function() {
439
+ cwp_namespace.toggleHideTitle(this);
440
+ });
441
+
442
+ // Filter tab
443
+ jQuery(document).on('change', class_namespace + ' .categoryposts-data-panel-filter-cat', function() { // change category filter
444
+ cwp_namespace.toggleCatSelection(this);
445
+ });
446
+
447
+ jQuery(document).on('change', class_namespace + ' .categoryPosts-date_range select', function() { // change date range
448
+ cwp_namespace.toggleDateRange(this);
449
+ });
450
+
451
+ // Post details tab
452
+ jQuery('.cwp_default_thumb_select').off('click').on('click', function() { // select default thumb
453
+ cwp_namespace.defaultThumbnailSelection(this, cwp_default_thumb_selection.frame_title, cwp_default_thumb_selection.button_title);
454
+ });
455
+
456
+ jQuery(document).on('click', class_namespace + ' .cat-post-premade_templates button', function() { // select a pre made template
457
+ cwp_namespace.selectPremadeTemplate(this);
458
+ });
459
+
460
+ jQuery(document).on('change', class_namespace + ' .cat-post-premade_templates select', function(event) { // prevent refresh ontemplate selection
461
+ event.preventDefault();
462
+ event.stopPropagation();
463
+ });
464
+
465
+ jQuery(document).on('input', class_namespace + ' .categoryPosts-template textarea', function() { // prevent refresh ontemplate selection
466
+ cwp_namespace.templateChange(this);
467
+ });
468
+
469
+ jQuery(document).on('change', class_namespace + ' .categoryPosts-preset_date_format select', function() { // change date format
470
+ cwp_namespace.toggleDateFormat(this);
471
+ });
472
+
473
+ jQuery(class_namespace + ' .cat-post-thumb-change-size button').off('click').on('click', function() { // find a thumbnail size
474
+ cwp_namespace.thumbnailSizeChange(this);
475
+ });
476
+
477
+ jQuery(document).on('input', class_namespace + ' .thumb_fluid_width', function() { // select a thumbnail fluid size
478
+ cwp_namespace.thumbnailFluidWidthChange(this);
479
+ });
480
+
481
+ jQuery('.cwp_default_thumb_remove').off('click').on('click', function() { // remove default thumb
482
+ cwp_namespace.removeDefaultThumbnailSelection(this);
483
+ });
484
+
485
+ jQuery(class_namespace + ' a.toggle-template-help').off('click').on('click', function(event) { // show template help
486
+ cwp_namespace.toggleTemplateHelp(this, event);
487
+ });
488
+
489
+ jQuery(class_namespace + ' a.toggle-image-dimensions-help').off('click').on('click', function(event) { // show image dimensions help
490
+ cwp_namespace.toggleImageDimensionsHelp(this, event);
491
+ });
492
+
493
+ jQuery(class_namespace + ' a.toggle-more-link-help').off('click').on('click', function(event) { // show image dimensions help
494
+ cwp_namespace.toggleMoreLinkHelp(this, event);
495
+ });
496
+
497
+ jQuery(class_namespace + ' .cpwp-open-placholder-dropdown-menu').off('click').on('click', function() { // open drop down and add placeholder
498
+ cwp_namespace.openAddPlaceholder(this);
499
+ });
500
+
501
+ jQuery(document).on('onfocusout, blur', class_namespace + ' .cpwp-open-placholder-dropdown-menu,' + class_namespace + ' .categoryPosts-template textarea', function() { // close drop down placeholder, if not used
502
+ jQuery(this).closest(class_namespace + ' .categoryPosts-template').parent().find('.cpwp-placeholder-dropdown-menu').not('.cpw-doNotClose').hide();
503
+ });
504
+
505
+ jQuery(document).on('click', class_namespace + ' .categoryPosts-template textarea', function() { // close drop down placeholder, if textarea is clicked
506
+ jQuery(this).closest(class_namespace + ' .categoryPosts-template').parent().find('.cpwp-placeholder-dropdown-menu').not('.cpw-doNotClose').hide();
507
+ });
508
+
509
+ jQuery(document).on('mousedown', class_namespace + ' .categoryPosts-template textarea', function() { // help to select the placeholder
510
+ var _that = this;
511
+ setTimeout(function() { cwp_namespace.selectPlaceholderHelper(_that); }, 0);;
512
+ });
513
+
514
+ // General tab
515
+ jQuery(document).on('click', class_namespace + ' .categoryPosts-disable_css input[type=checkbox]', function() { // toggle UI font styles on disable CSS setting change.
516
+ cwp_namespace.toggleDisableFontStyles(this);
517
+ });
518
+
519
+ jQuery(document).on('change', class_namespace + ' .categoryPosts-no_match_handling select', function() { // change date range
520
+ cwp_namespace.toggleNoMatch(this);
521
+ });
522
+
523
+ jQuery(document).on('click', class_namespace + ' .categoryPosts-enable_loadmore input[type=checkbox]', function() {
524
+ cwp_namespace.toggleLoadMore(this);
525
+ });
526
+ }
527
 
528
+ setChangeHandlers();
529
+ });
js/admin/category-posts-widget.min.js CHANGED
@@ -1 +1 @@
1
- var cwp_namespace={php_settings_var:"categoryPosts",widget_class:".category-widget-cont",template_panel_prefix:".categoryposts-data-panel-",open_panels:{},template_change_timer:null,clickHandler:function(element){jQuery(element).toggleClass("open").next().stop().slideToggle();var panel=jQuery(element).data("panel"),id=jQuery(element).parent().parent().parent().parent().parent().attr("id"),o={};this.open_panels.hasOwnProperty(id)&&(o=this.open_panels[id]),o.hasOwnProperty(panel)?delete o[panel]:o[panel]=!0,this.open_panels[id]=o},toggleCatSelection:function(item){var cat=jQuery(item).find("option:selected").attr("value"),panel=item.parentElement.parentElement.parentElement.parentElement;"0"==cat?(jQuery(panel).find(".categoryPosts-title_link").hide(),jQuery(panel).find(".categoryPosts-title_link_url").show(),jQuery(panel).find(".categoryPosts-no_cat_childs").hide()):(jQuery(panel).find(".categoryPosts-title_link").show(),jQuery(panel).find(".categoryPosts-title_link_url").hide(),jQuery(panel).find(".categoryPosts-no_cat_childs").show())},toggleDisableFontStyles:function(item){var value=jQuery(item).find("input").attr("checked"),panel=item.parentElement.parentElement;"checked"==value?jQuery(panel).find(".categoryposts-data-panel-general-disable-font-styles").hide():jQuery(panel).find(".categoryposts-data-panel-general-disable-font-styles").show()},toggleDateFormat:function(item){var value=jQuery(item).val(),panel=item.parentElement.parentElement;"other"!=value?jQuery(panel).find(".categoryPosts-date_format").hide():jQuery(panel).find(".categoryPosts-date_format").show()},toggleDateRange:function(item){var value=jQuery(item).val(),panel=item.parentElement.parentElement;switch(jQuery(panel).find(".categoryPosts-date-range p").hide(),jQuery(panel).find(".categoryPosts-date-range").show(),value){case"off":jQuery(panel).find(".categoryPosts-date-range").hide();break;case"days_ago":jQuery(panel).find(".categoryPosts-days_ago").show();break;case"between_dates":jQuery(panel).find(".categoryPosts-start_date").show(),jQuery(panel).find(".categoryPosts-end_date").show()}},toggleNoMatch:function(item){var value=jQuery(item).val(),panel=item.parentElement.parentElement;"text"==value?jQuery(panel).find(".categoryPosts-no-match-text").show():jQuery(panel).find(".categoryPosts-no-match-text").hide()},toggleTemplateHelp:function(item,event){event.preventDefault();var panel=item.parentElement.parentElement.parentElement.parentElement;jQuery(panel).find(".cat-post-template-help").toggle("slow")},toggleAssignedCategoriesTop:function(item){var value=jQuery(item).find("input").attr("checked"),panel=item.parentElement.parentElement;"checked"==value?jQuery(panel).find(".categoryposts-details-panel-assigned-cat-top").show():jQuery(panel).find(".categoryposts-details-panel-assigned-cat-top").hide()},toggleHideTitle:function(item){var value=jQuery(item).attr("checked"),panel=item.parentElement.parentElement.parentElement;"checked"!=value?jQuery(panel).find(".categoryposts-data-panel-title-settings").show():jQuery(panel).find(".categoryposts-data-panel-title-settings").hide()},toggleLoadMore:function(item){var value=jQuery(item).attr("checked"),panel=item.parentElement.parentElement.parentElement;"checked"!=value?jQuery(panel).find(".loadmore-settings").hide():jQuery(panel).find(".loadmore-settings").show()},selectPremadeTemplate:function(item){var panel=item.parentElement.parentElement.parentElement,div=item.parentElement.parentElement,select=jQuery(div).find("select"),template="%title%";switch(value=select.val(),value){case"title":template="%title%";break;case"title_excerpt":template="%title%\n\n%excerpt%";break;case"title_thumb":template="%title%\n\n%thumb%";break;case"title_thum_excerpt":template="%title%\n\n%thumb%\n%excerpt%";break;case"everything":template="%title%\n\n",template+="%date%\n\n",template+="%thumb%\n",template+='<span class="dashicons dashicons-admin-comments"></span> %commentnum% ',template+='<span class="dashicons dashicons-admin-users"></span> %author%\n',template+="%excerpt%",template+="Categories: %category% ",template+='<span class="dashicons dashicons-tag"></span> %post_tag%'}var textarea=jQuery(panel).find("textarea");textarea.val(template),textarea.trigger("input","change")},autoCloseOpenPanels:function(_this){if(tiptoppress[this.php_settings_var].accordion&&!jQuery(_this).hasClass("open")){var jCloseElement=jQuery(_this).parent().find(".open");this.clickHandler(jCloseElement)}},defaultThumbnailSelection:function(elem,title,button_title){var frame=wp.media({title:title,multiple:!1,library:{type:"image"},button:{text:button_title}});return frame.on("close",(function(){var attachments=frame.state().get("selection").toJSON();if(1==attachments.length){var attachment=attachments[0],img_html='<img src="'+attachment.url+'" ';img_html+='width="60" ',img_html+='height="60" ',img_html+="/>",jQuery(elem).parent().prev().find(".default_thumb_img").html(img_html),jQuery(elem).parent().find(".cwp_default_thumb_remove").show(),jQuery(elem).parent().prev().find(".default_thumb_id").val(attachment.id).change()}})),frame.open(),!1},removeDefaultThumbnailSelection:function(elem){return jQuery(elem).parent().prev().find(".default_thumb_img").html(cwp_default_thumb_selection.none),jQuery(elem).hide(),jQuery(elem).parent().prev().find(".default_thumb_id").val(0).change(),!1},templateChange:function(elem){function adjustUiToTemplate(){var template=jQuery(elem).val(),tags=tiptoppress[this.php_settings_var].template_tags,widget_cont=jQuery(elem.parentElement.parentElement.parentElement.parentElement);for(var key in tags)-1!==template.indexOf(tags[key])?widget_cont.find(this.template_panel_prefix+tags[key]).show():widget_cont.find(this.template_panel_prefix+tags[key]).hide()}null!=this.template_change_timer&&clearTimeout(this.template_change_timer),this.template_change_timer=setTimeout(adjustUiToTemplate.bind(this),250)},thumbnailSizeChange:function(elem){var _that=jQuery(elem),thumb_h,thumb_w,_input_thumb_h=_that.closest(".categoryposts-data-panel-thumb").find(".thumb_h"),_input_thumb_w=_that.closest(".categoryposts-data-panel-thumb").find(".thumb_w");return _that.hasClass("smaller")?(thumb_w=_input_thumb_w.val()/1.015,thumb_h=_input_thumb_h.val()/1.015):_that.hasClass("quarter")?(thumb_w=_input_thumb_w.val()/4,thumb_h=_input_thumb_h.val()/4):_that.hasClass("half")?(thumb_h=_input_thumb_h.val()/2,thumb_w=_input_thumb_w.val()/2):_that.hasClass("double")?(thumb_h=2*_input_thumb_h.val(),thumb_w=2*_input_thumb_w.val()):_that.hasClass("bigger")?(thumb_w=1.02*_input_thumb_w.val(),thumb_h=1.02*_input_thumb_h.val()):_that.hasClass("square")?parseInt(_input_thumb_w.val())>=parseInt(_input_thumb_h.val())?(thumb_h=_input_thumb_w.val(),thumb_w=_input_thumb_w.val()):(thumb_h=_input_thumb_h.val(),thumb_w=_input_thumb_h.val()):_that.hasClass("standard")?parseInt(_input_thumb_w.val())>=parseInt(_input_thumb_h.val())?(thumb_h=_input_thumb_w.val()/4*3,thumb_w=_input_thumb_w.val()):(thumb_h=4*_input_thumb_w.val()/3,thumb_w=_input_thumb_w.val()):_that.hasClass("wide")?parseInt(_input_thumb_w.val())>=parseInt(_input_thumb_h.val())?(thumb_h=_input_thumb_w.val()/16*9,thumb_w=_input_thumb_w.val()):(thumb_h=16*_input_thumb_w.val()/9,thumb_w=_input_thumb_w.val()):_that.hasClass("switch")?(thumb_h=_input_thumb_w.val(),thumb_w=_input_thumb_h.val()):(thumb_w=_that.data("thumb-w"),thumb_h=_that.data("thumb-h")),_input_thumb_w.val(Math.floor(thumb_w)),_input_thumb_h.val(Math.floor(thumb_h)),_input_thumb_w.trigger("input","change"),_input_thumb_h.trigger("input","change"),!1},thumbnailFluidWidthChange:function(elem){var _that=jQuery(elem),_input_thumb_h=_that.closest(".categoryposts-data-panel-thumb").find(".thumb_h");return _that.closest("label").find("span").html(_that.val()+"%"),_input_thumb_h.val(0),_input_thumb_h.trigger("input","change"),!1},openAddPlaceholder:function(elem){var _that=jQuery(elem);return _that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").toggle(),_that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu span").off("click").on("click",(function(){var text=jQuery(this).data("value");switch(text){case"NewLine":text="\n";break;case"EmptyLine":text="\n\n";break;default:text="%"+text+"%"}var _div=this.parentElement.parentElement.parentElement,textarea=jQuery(_div).find("textarea"),textareaPos=textarea[0].selectionStart,textareaTxt=textarea.val();textarea.val(textareaTxt.substring(0,textareaPos)+text+textareaTxt.substring(textareaPos)),textarea[0].selectionStart=textareaPos+text.length,textarea[0].selectionEnd=textareaPos+text.length,textarea.focus(),textarea.trigger("input","change")})),_that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").on("mouseenter",(function(){jQuery(this).addClass("cpw-doNotClose")})),_that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").on("mouseleave",(function(){jQuery(this).removeClass("cpw-doNotClose")})),!1},selectPlaceholderHelper:function(elem){var textarea=jQuery(elem),textareaPos=textarea[0].selectionStart,textareaTxt=textarea.val(),nStartSel=textareaTxt.substring(0,textareaPos).lastIndexOf("%"),nEndSel=textareaPos+textareaTxt.substring(textareaPos).indexOf("%")+1,strSelTxt=textareaTxt.substring(nStartSel,nEndSel);return!(strSelTxt.indexOf("\n")>=0||strSelTxt.indexOf(" ")>=0||strSelTxt.length<=2)&&(textarea[0].selectionStart=nStartSel,textarea[0].selectionEnd=nEndSel,!1)}};jQuery(document).ready((function(){var class_namespace=".category-widget-cont";function setChangeHandlers(){jQuery(".cwp_default_thumb_select").off("click").on("click",(function(){cwp_namespace.defaultThumbnailSelection(this,cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title)})),jQuery(document).on("change",class_namespace+" .categoryposts-data-panel-filter-cat",(function(){cwp_namespace.toggleCatSelection(this)})),jQuery(".cwp_default_thumb_remove").off("click").on("click",(function(){cwp_namespace.removeDefaultThumbnailSelection(this)})),jQuery(class_namespace+"-assigned_categories").off("click").on("click",(function(){cwp_namespace.toggleAssignedCategoriesTop(this)})),jQuery(document).on("click",class_namespace+" .categoryPosts-hide_title input",(function(){cwp_namespace.toggleHideTitle(this)})),jQuery(document).on("click",class_namespace+" .categoryPosts-enable_loadmore input",(function(){cwp_namespace.toggleLoadMore(this)})),jQuery(document).on("change",class_namespace+" .categoryPosts-preset_date_format select",(function(){cwp_namespace.toggleDateFormat(this)})),jQuery(document).on("change",class_namespace+" .categoryPosts-date_range select",(function(){cwp_namespace.toggleDateRange(this)})),jQuery(document).on("change",class_namespace+" .categoryPosts-no_match_handling select",(function(){cwp_namespace.toggleNoMatch(this)})),jQuery(class_namespace+" a.toggle-template-help").off("click").on("click",(function(event){cwp_namespace.toggleTemplateHelp(this,event)})),jQuery(document).on("click",class_namespace+" .cat-post-premade_templates button",(function(){cwp_namespace.selectPremadeTemplate(this)})),jQuery(document).on("change",class_namespace+" .cat-post-premade_templates select",(function(event){event.preventDefault(),event.stopPropagation()})),jQuery(document).on("input",class_namespace+" .categoryPosts-template textarea",(function(){cwp_namespace.templateChange(this)})),jQuery(class_namespace+" .cat-post-thumb-change-size button").off("click").on("click",(function(){cwp_namespace.thumbnailSizeChange(this)})),jQuery(document).on("change",class_namespace+" .thumb_fluid_width",(function(){cwp_namespace.thumbnailFluidWidthChange(this)})),jQuery(class_namespace+" .cpwp-open-placholder-dropdown-menu").off("click").on("click",(function(){cwp_namespace.openAddPlaceholder(this)})),jQuery(document).on("onfocusout, blur",class_namespace+" .cpwp-open-placholder-dropdown-menu,"+class_namespace+" .categoryPosts-template textarea",(function(){jQuery(this).closest(class_namespace+" .categoryPosts-template").parent().find(".cpwp-placeholder-dropdown-menu").not(".cpw-doNotClose").hide()})),jQuery(document).on("mousedown",class_namespace+" .categoryPosts-template textarea",(function(){var _that=this;setTimeout((function(){cwp_namespace.selectPlaceholderHelper(_that)}),0)}))}jQuery(".category-widget-cont h4").click((function(){cwp_namespace.autoCloseOpenPanels(this),cwp_namespace.clickHandler(this)})),jQuery(document).on("widget-added widget-updated panelsopen",(function(root,element){jQuery(".category-widget-cont h4").off("click").on("click",(function(){cwp_namespace.autoCloseOpenPanels(this),cwp_namespace.clickHandler(this)})),jQuery(".cwp_default_thumb_select").off("click").on("click",(function(){cwp_namespace.defaultThumbnailSelection(this,cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title)})),jQuery(".cwp_default_thumb_remove").off("click").on("click",(function(){cwp_namespace.removeDefaultThumbnailSelection(this)}));var id=jQuery(element).attr("id");if(cwp_namespace.open_panels.hasOwnProperty(id)){var o=cwp_namespace.open_panels[id];for(var panel in o)jQuery(element).find("[data-panel="+panel+"]").toggleClass("open").next().stop().show()}setChangeHandlers()})),setChangeHandlers()}));
1
+ var cwp_namespace={php_settings_var:"categoryPosts",widget_class:".category-widget-cont",template_panel_prefix:".categoryposts-data-panel-",open_panels:{},template_change_timer:null,clickHandler:function(element){jQuery(element).toggleClass("open").next().stop().slideToggle();var panel=jQuery(element).data("panel"),id=jQuery(element).parent().parent().parent().parent().parent().attr("id"),o={};this.open_panels.hasOwnProperty(id)&&(o=this.open_panels[id]),o.hasOwnProperty(panel)?delete o[panel]:o[panel]=!0,this.open_panels[id]=o},toggleCatSelection:function(item){var cat=jQuery(item).find("option:selected").attr("value"),panel=item.parentElement.parentElement.parentElement.parentElement;"0"==cat?(jQuery(panel).find(".categoryPosts-title_link").hide(),jQuery(panel).find(".categoryPosts-title_link_url").show(),jQuery(panel).find(".categoryPosts-no_cat_childs").hide()):(jQuery(panel).find(".categoryPosts-title_link").show(),jQuery(panel).find(".categoryPosts-title_link_url").hide(),jQuery(panel).find(".categoryPosts-no_cat_childs").show())},toggleDisableFontStyles:function(item){var panel=item.parentElement.parentElement.parentElement;item.checked?jQuery(panel).find(".categoryPosts-disable_font_styles").hide():jQuery(panel).find(".categoryPosts-disable_font_styles").show()},toggleDateFormat:function(item){var value=jQuery(item).val(),panel=item.parentElement.parentElement;"other"!=value?jQuery(panel).find(".categoryPosts-date_format").hide():jQuery(panel).find(".categoryPosts-date_format").show()},toggleDateRange:function(item){var value=jQuery(item).val(),panel=item.parentElement.parentElement;switch(jQuery(panel).find(".categoryPosts-date-range p").hide(),jQuery(panel).find(".categoryPosts-date-range").show(),value){case"off":jQuery(panel).find(".categoryPosts-date-range").hide();break;case"days_ago":jQuery(panel).find(".categoryPosts-days_ago").show();break;case"between_dates":jQuery(panel).find(".categoryPosts-start_date").show(),jQuery(panel).find(".categoryPosts-end_date").show()}},toggleNoMatch:function(item){var value=jQuery(item).val(),panel=item.parentElement.parentElement;"text"==value?jQuery(panel).find(".categoryPosts-no-match-text").show():jQuery(panel).find(".categoryPosts-no-match-text").hide()},toggleTemplateHelp:function(item,event){event.preventDefault();var panel=item.parentElement.parentElement.parentElement.parentElement;jQuery(panel).find(".cat-post-template-help").toggle("slow")},toggleImageDimensionsHelp:function(item,event){event.preventDefault();var panel=item.parentElement.parentElement.parentElement.parentElement;jQuery(panel).find(".cat-post-image-dimensions-help").toggle("slow")},toggleMoreLinkHelp:function(item,event){event.preventDefault();var panel=item.parentElement.parentElement.parentElement.parentElement;jQuery(panel).find(".cat-post-more-link-help").toggle("slow")},toggleHideTitle:function(item){var panel=item.parentElement.parentElement.parentElement;item.checked?jQuery(panel).find(".categoryposts-data-panel-title-settings").hide():jQuery(panel).find(".categoryposts-data-panel-title-settings").show()},toggleLoadMore:function(item){var panel=item.parentElement.parentElement.parentElement;item.checked?jQuery(panel).find(".loadmore-settings").show():jQuery(panel).find(".loadmore-settings").hide()},selectPremadeTemplate:function(item){var panel=item.parentElement.parentElement.parentElement,div=item.parentElement.parentElement,select=jQuery(div).find("select"),template="%title%";switch(value=select.val(),value){case"title":template="%title%";break;case"title_excerpt":template="%title%\n\n%excerpt%\n\n%more-link%";break;case"title_thumb":template="%title%\n\n%thumb%";break;case"title_thum_excerpt":template="%title%\n\n%thumb%\n%excerpt%%more-link%";break;case"everything":template="%title%\n\n",template+="%date%\n\n",template+="%thumb%\n",template+='<span class="dashicons dashicons-admin-comments"></span> %commentnum% ',template+='<span class="dashicons dashicons-admin-users"></span> %author%\n',template+="%excerpt%",template+="%more-link%\n\n",template+="Categories: %category% ",template+='<span class="dashicons dashicons-tag"></span> %post_tag%'}var textarea=jQuery(panel).find("textarea");textarea.val(template),textarea.trigger("input","change")},autoCloseOpenPanels:function(_this){if(tiptoppress[this.php_settings_var].accordion&&!jQuery(_this).hasClass("open")){var jCloseElement=jQuery(_this).parent().find(".open");this.clickHandler(jCloseElement)}},defaultThumbnailSelection:function(elem,title,button_title){var frame=wp.media({title:title,multiple:!1,library:{type:"image"},button:{text:button_title}});return frame.on("close",(function(){var attachments=frame.state().get("selection").toJSON();if(1==attachments.length){var attachment=attachments[0],img_html='<img src="'+attachment.url+'" ';img_html+='width="60" ',img_html+='height="60" ',img_html+="/>",jQuery(elem).parent().prev().find(".default_thumb_img").html(img_html),jQuery(elem).parent().find(".cwp_default_thumb_remove").show(),jQuery(elem).parent().prev().find(".default_thumb_id").val(attachment.id).change()}})),frame.open(),!1},removeDefaultThumbnailSelection:function(elem){return jQuery(elem).parent().prev().find(".default_thumb_img").html(cwp_default_thumb_selection.none),jQuery(elem).hide(),jQuery(elem).parent().prev().find(".default_thumb_id").val(0).change(),!1},templateChange:function(elem){function adjustUiToTemplate(){var template=jQuery(elem).val(),tags=tiptoppress[this.php_settings_var].template_tags,widget_cont=jQuery(elem.parentElement.parentElement.parentElement.parentElement);for(var key in tags)-1!==template.indexOf(tags[key])?widget_cont.find(this.template_panel_prefix+tags[key]).show():widget_cont.find(this.template_panel_prefix+tags[key]).hide()}null!=this.template_change_timer&&clearTimeout(this.template_change_timer),this.template_change_timer=setTimeout(adjustUiToTemplate.bind(this),250)},thumbnailSizeChange:function(elem){var _that=jQuery(elem),thumb_h,thumb_w,_input_thumb_h=_that.closest(".categoryposts-data-panel-thumb").find(".thumb_h"),_input_thumb_w=_that.closest(".categoryposts-data-panel-thumb").find(".thumb_w");return _that.hasClass("smaller")?(thumb_w=_input_thumb_w.val()/1.015,thumb_h=_input_thumb_h.val()/1.015):_that.hasClass("quarter")?(thumb_w=_input_thumb_w.val()/4,thumb_h=_input_thumb_h.val()/4):_that.hasClass("half")?(thumb_h=_input_thumb_h.val()/2,thumb_w=_input_thumb_w.val()/2):_that.hasClass("double")?(thumb_h=2*_input_thumb_h.val(),thumb_w=2*_input_thumb_w.val()):_that.hasClass("bigger")?(thumb_w=1.02*_input_thumb_w.val(),thumb_h=1.02*_input_thumb_h.val()):_that.hasClass("square")?parseInt(_input_thumb_w.val())>=parseInt(_input_thumb_h.val())?(thumb_h=_input_thumb_w.val(),thumb_w=_input_thumb_w.val()):(thumb_h=_input_thumb_h.val(),thumb_w=_input_thumb_h.val()):_that.hasClass("standard")?parseInt(_input_thumb_w.val())>=parseInt(_input_thumb_h.val())?(thumb_h=_input_thumb_w.val()/4*3,thumb_w=_input_thumb_w.val()):(thumb_h=4*_input_thumb_w.val()/3,thumb_w=_input_thumb_w.val()):_that.hasClass("wide")?parseInt(_input_thumb_w.val())>=parseInt(_input_thumb_h.val())?(thumb_h=_input_thumb_w.val()/16*9,thumb_w=_input_thumb_w.val()):(thumb_h=16*_input_thumb_w.val()/9,thumb_w=_input_thumb_w.val()):_that.hasClass("switch")?(thumb_h=_input_thumb_w.val(),thumb_w=_input_thumb_h.val()):_that.hasClass("width")?(thumb_w=0==_input_thumb_w.val()?300:_input_thumb_w.val(),thumb_h=0):_that.hasClass("height")?(thumb_h=0==_input_thumb_h.val()?300:_input_thumb_h.val(),thumb_w=0):_that.hasClass("both")?(thumb_h=0,thumb_w=0):(thumb_w=_that.data("thumb-w"),thumb_h=_that.data("thumb-h")),_input_thumb_w.val(Math.floor(thumb_w)),_input_thumb_h.val(Math.floor(thumb_h)),_input_thumb_w.trigger("input","change"),_input_thumb_h.trigger("input","change"),!1},thumbnailFluidWidthChange:function(elem){var _that=jQuery(elem),_input_thumb_h=_that.closest(".categoryposts-data-panel-thumb").find(".thumb_h");return _that.closest("label").find("span").html(_that.val()+"%"),_input_thumb_h.trigger("input","change"),!1},openAddPlaceholder:function(elem){var _that=jQuery(elem);return _that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").toggle(),_that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu span").off("click").on("click",(function(){var text=jQuery(this).data("value");switch(text){case"NewLine":text="\n";break;case"EmptyLine":text="\n\n";break;default:text="%"+text+"%"}var _div=this.parentElement.parentElement.parentElement,textarea=jQuery(_div).find("textarea"),textareaPos=textarea[0].selectionStart,textareaTxt=textarea.val();textarea.val(textareaTxt.substring(0,textareaPos)+text+textareaTxt.substring(textareaPos)),textarea[0].selectionStart=textareaPos+text.length,textarea[0].selectionEnd=textareaPos+text.length,textarea.focus(),textarea.trigger("input","change")})),_that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").on("mouseenter",(function(){jQuery(this).addClass("cpw-doNotClose")})),_that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").on("mouseleave",(function(){jQuery(this).removeClass("cpw-doNotClose")})),_that.closest(".cat-post-add_premade_templates").find(".cpwp-close-placeholder-dropdown-menu").off("click").on("click",(function(){_that.closest(".cat-post-add_premade_templates").find(".cpwp-placeholder-dropdown-menu").toggle()})),!1},selectPlaceholderHelper:function(elem){var textarea=jQuery(elem),textareaPos=textarea[0].selectionStart,textareaTxt=textarea.val(),nStartSel=textareaTxt.substring(0,textareaPos).lastIndexOf("%"),nEndSel=textareaPos+textareaTxt.substring(textareaPos).indexOf("%")+1,strSelTxt=textareaTxt.substring(nStartSel,nEndSel);return!(strSelTxt.indexOf("\n")>=0||strSelTxt.indexOf(" ")>=0||strSelTxt.length<=2)&&(textarea[0].selectionStart=nStartSel,textarea[0].selectionEnd=nEndSel,!1)}};jQuery(document).ready((function(){var class_namespace=".category-widget-cont";function setChangeHandlers(){jQuery(document).on("click",class_namespace+" .categoryPosts-hide_title input[type=checkbox]",(function(){cwp_namespace.toggleHideTitle(this)})),jQuery(document).on("change",class_namespace+" .categoryposts-data-panel-filter-cat",(function(){cwp_namespace.toggleCatSelection(this)})),jQuery(document).on("change",class_namespace+" .categoryPosts-date_range select",(function(){cwp_namespace.toggleDateRange(this)})),jQuery(".cwp_default_thumb_select").off("click").on("click",(function(){cwp_namespace.defaultThumbnailSelection(this,cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title)})),jQuery(document).on("click",class_namespace+" .cat-post-premade_templates button",(function(){cwp_namespace.selectPremadeTemplate(this)})),jQuery(document).on("change",class_namespace+" .cat-post-premade_templates select",(function(event){event.preventDefault(),event.stopPropagation()})),jQuery(document).on("input",class_namespace+" .categoryPosts-template textarea",(function(){cwp_namespace.templateChange(this)})),jQuery(document).on("change",class_namespace+" .categoryPosts-preset_date_format select",(function(){cwp_namespace.toggleDateFormat(this)})),jQuery(class_namespace+" .cat-post-thumb-change-size button").off("click").on("click",(function(){cwp_namespace.thumbnailSizeChange(this)})),jQuery(document).on("input",class_namespace+" .thumb_fluid_width",(function(){cwp_namespace.thumbnailFluidWidthChange(this)})),jQuery(".cwp_default_thumb_remove").off("click").on("click",(function(){cwp_namespace.removeDefaultThumbnailSelection(this)})),jQuery(class_namespace+" a.toggle-template-help").off("click").on("click",(function(event){cwp_namespace.toggleTemplateHelp(this,event)})),jQuery(class_namespace+" a.toggle-image-dimensions-help").off("click").on("click",(function(event){cwp_namespace.toggleImageDimensionsHelp(this,event)})),jQuery(class_namespace+" a.toggle-more-link-help").off("click").on("click",(function(event){cwp_namespace.toggleMoreLinkHelp(this,event)})),jQuery(class_namespace+" .cpwp-open-placholder-dropdown-menu").off("click").on("click",(function(){cwp_namespace.openAddPlaceholder(this)})),jQuery(document).on("onfocusout, blur",class_namespace+" .cpwp-open-placholder-dropdown-menu,"+class_namespace+" .categoryPosts-template textarea",(function(){jQuery(this).closest(class_namespace+" .categoryPosts-template").parent().find(".cpwp-placeholder-dropdown-menu").not(".cpw-doNotClose").hide()})),jQuery(document).on("click",class_namespace+" .categoryPosts-template textarea",(function(){jQuery(this).closest(class_namespace+" .categoryPosts-template").parent().find(".cpwp-placeholder-dropdown-menu").not(".cpw-doNotClose").hide()})),jQuery(document).on("mousedown",class_namespace+" .categoryPosts-template textarea",(function(){var _that=this;setTimeout((function(){cwp_namespace.selectPlaceholderHelper(_that)}),0)})),jQuery(document).on("click",class_namespace+" .categoryPosts-disable_css input[type=checkbox]",(function(){cwp_namespace.toggleDisableFontStyles(this)})),jQuery(document).on("change",class_namespace+" .categoryPosts-no_match_handling select",(function(){cwp_namespace.toggleNoMatch(this)})),jQuery(document).on("click",class_namespace+" .categoryPosts-enable_loadmore input[type=checkbox]",(function(){cwp_namespace.toggleLoadMore(this)}))}jQuery(".category-widget-cont h4").click((function(){cwp_namespace.autoCloseOpenPanels(this),cwp_namespace.clickHandler(this)})),jQuery(document).on("widget-added widget-updated panelsopen",(function(root,element){jQuery(".category-widget-cont h4").off("click").on("click",(function(){cwp_namespace.autoCloseOpenPanels(this),cwp_namespace.clickHandler(this)})),jQuery(".cwp_default_thumb_select").off("click").on("click",(function(){cwp_namespace.defaultThumbnailSelection(this,cwp_default_thumb_selection.frame_title,cwp_default_thumb_selection.button_title)})),jQuery(".cwp_default_thumb_remove").off("click").on("click",(function(){cwp_namespace.removeDefaultThumbnailSelection(this)}));var id=jQuery(element).attr("id");if(cwp_namespace.open_panels.hasOwnProperty(id)){var o=cwp_namespace.open_panels[id];for(var panel in o)jQuery(element).find("[data-panel="+panel+"]").toggleClass("open").next().stop().show()}setChangeHandlers()})),setChangeHandlers()}));
js/admin/tinymce.js CHANGED
@@ -1,63 +1,63 @@
1
- (function($) {
2
- var namespace = 'categoryPosts';
3
- var textdomain = 'category-posts';
4
-
5
- tinymce.create("tinymce.plugins."+namespace, {
6
-
7
- //url argument holds the absolute url of our plugin directory
8
- init : function(ed, url) {
9
-
10
- //add new button
11
- ed.addButton(namespace, {
12
- title : ed.getLang(textdomain+'.tooltip'),
13
- cmd : "categoryPosts_shortcode",
14
- text : "+[CP]",
15
- });
16
-
17
- //button functionality.
18
- ed.addCommand("categoryPosts_shortcode", function() {
19
- ed.windowManager.open(
20
- // Properties of the window.
21
- {
22
- title: ed.getLang(textdomain+'.title'),
23
- body: [
24
- {
25
- type: 'textbox',
26
- name: 'title',
27
- label: ed.getLang(textdomain+'.name'),
28
- },
29
- {
30
- type:'container',
31
- html:'<a style="color:blue;textdecoration:underline;cursor:pointer" href="'+ed.getLang(textdomain+'.profiile_url')+'">'+ed.getLang(textdomain+'.hide_message')+'</a>',
32
- }
33
- ],
34
- onsubmit: function( e ) {
35
- var shortcode = '[catposts';
36
- if ( e.data.title != "" ) {
37
- shortcode += ' name="' + e.data.title + '"';
38
- }
39
- shortcode += ']';
40
- ed.selection.setContent(shortcode);
41
- }
42
- }
43
-
44
- );
45
- });
46
-
47
- },
48
-
49
- createControl : function(n, cm) {
50
- return null;
51
- },
52
-
53
- getInfo : function() {
54
- return {
55
- longname : "Insert category post shortcode",
56
- author : "TipTopPress",
57
- version : "4.7"
58
- };
59
- }
60
- });
61
-
62
- tinymce.PluginManager.add("categoryPosts", tinymce.plugins.categoryPosts);
63
  })(jQuery);
1
+ (function($) {
2
+ var namespace = 'categoryPosts';
3
+ var textdomain = 'category-posts';
4
+
5
+ tinymce.create("tinymce.plugins."+namespace, {
6
+
7
+ //url argument holds the absolute url of our plugin directory
8
+ init : function(ed, url) {
9
+
10
+ //add new button
11
+ ed.addButton(namespace, {
12
+ title : ed.getLang(textdomain+'.tooltip'),
13
+ cmd : "categoryPosts_shortcode",
14
+ text : "+[CP]",
15
+ });
16
+
17
+ //button functionality.
18
+ ed.addCommand("categoryPosts_shortcode", function() {
19
+ ed.windowManager.open(
20
+ // Properties of the window.
21
+ {
22
+ title: ed.getLang(textdomain+'.title'),
23
+ body: [
24
+ {
25
+ type: 'textbox',
26
+ name: 'title',
27
+ label: ed.getLang(textdomain+'.name'),
28
+ },
29
+ {
30
+ type:'container',
31
+ html:'<a style="color:blue;textdecoration:underline;cursor:pointer" href="'+ed.getLang(textdomain+'.profiile_url')+'">'+ed.getLang(textdomain+'.hide_message')+'</a>',
32
+ }
33
+ ],
34
+ onsubmit: function( e ) {
35
+ var shortcode = '[catposts';
36
+ if ( e.data.title != "" ) {
37
+ shortcode += ' name="' + e.data.title + '"';
38
+ }
39
+ shortcode += ']';
40
+ ed.selection.setContent(shortcode);
41
+ }
42
+ }
43
+
44
+ );
45
+ });
46
+
47
+ },
48
+
49
+ createControl : function(n, cm) {
50
+ return null;
51
+ },
52
+
53
+ getInfo : function() {
54
+ return {
55
+ longname : "Insert category post shortcode",
56
+ author : "TipTopPress",
57
+ version : "4.7"
58
+ };
59
+ }
60
+ });
61
+
62
+ tinymce.PluginManager.add("categoryPosts", tinymce.plugins.categoryPosts);
63
  })(jQuery);
js/frontend/category-posts-frontend.js CHANGED
@@ -1,23 +1,23 @@
1
- /**
2
- * Category Posts Widget
3
- * https://github.com/tiptoppress/category-posts-widget
4
- *
5
- * Adds a widget that shows the most recent posts from a single category.
6
- *
7
- * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
- */
9
-
10
- if (typeof jQuery !== 'undefined') {
11
- jQuery( document ).ready(function () {
12
- if ('objectFit' in document.documentElement.style === false) {
13
- jQuery('.cat-post-item span').removeClass('cat-post-crop');
14
- jQuery('.cat-post-item span').addClass('cat-post-crop-not-supported');
15
- }
16
- if (document.documentMode || /Edge/.test(navigator.userAgent)) {
17
- jQuery('.cat-post-item span img').height('+=1');
18
- window.setTimeout(function(){
19
- jQuery('.cat-post-item span img').height('-=1');
20
- },0);
21
- }
22
- });
23
- }
1
+ /**
2
+ * Category Posts Widget
3
+ * https://github.com/tiptoppress/category-posts-widget
4
+ *
5
+ * Adds a widget that shows the most recent posts from a single category.
6
+ *
7
+ * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ if (typeof jQuery !== 'undefined') {
11
+ jQuery( document ).ready(function () {
12
+ if ('objectFit' in document.documentElement.style === false) {
13
+ jQuery('.cat-post-item span').removeClass('cat-post-crop');
14
+ jQuery('.cat-post-item span').addClass('cat-post-crop-not-supported');
15
+ }
16
+ if (document.documentMode || /Edge/.test(navigator.userAgent)) {
17
+ jQuery('.cat-post-item span img').height('+=1');
18
+ window.setTimeout(function(){
19
+ jQuery('.cat-post-item span img').height('-=1');
20
+ },0);
21
+ }
22
+ });
23
+ }
js/frontend/date.js CHANGED
@@ -1,49 +1,49 @@
1
- /**
2
- * Category Posts Widget
3
- * https://github.com/tiptoppress/category-posts-widget
4
- *
5
- * JS for the localized date functionality.
6
- *
7
- * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
- */
9
-
10
- if (typeof jQuery !== 'undefined') {
11
-
12
- jQuery( document ).ready(function () {
13
- var $elements = jQuery('.cat-post-item .cat-post-date[data-publishtime]');
14
- if ( 0 !== $elements) {
15
- /**
16
- * Adjust the dates for the items indicated in the $elements
17
- * array.
18
- *
19
- * @param array $elements array of dom elements.
20
- */
21
- var adjustlocalizeddate = function ( $elements ) {
22
- $elements.each(function ( ) {
23
- var $this = jQuery( this );
24
- var time = $this.data( 'publishtime' ) * 1000; // new Date() requires time in ms.
25
- var format = $this.data( 'format' );
26
- var orig_date = new Date( time );
27
- switch ( format ) {
28
- case 'date' :
29
- $this.text( orig_date.toLocaleDateString() );
30
- break;
31
- case 'time' :
32
- $this.text( orig_date.toLocaleDateString() + ' '
33
- + orig_date.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}) // Eliminate seconds.
34
- );
35
- break;
36
- }
37
- });
38
- }
39
-
40
- adjustlocalizeddate( $elements );
41
-
42
- // Wait for catposts.load_more event that load more triggers when for
43
- // mewly added item, and localize the date if needed.
44
- jQuery( 'ul' ).on('catposts.load_more', '.cat-post-item', function () {
45
- adjustlocalizeddate( jQuery( this ).find( '.cat-post-date[data-publishtime]' ) );
46
- });
47
- }
48
- });
49
- }
1
+ /**
2
+ * Category Posts Widget
3
+ * https://github.com/tiptoppress/category-posts-widget
4
+ *
5
+ * JS for the localized date functionality.
6
+ *
7
+ * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ if (typeof jQuery !== 'undefined') {
11
+
12
+ jQuery( document ).ready(function () {
13
+ var $elements = jQuery('.cat-post-item .cat-post-date[data-publishtime]');
14
+ if ( 0 !== $elements) {
15
+ /**
16
+ * Adjust the dates for the items indicated in the $elements
17
+ * array.
18
+ *
19
+ * @param array $elements array of dom elements.
20
+ */
21
+ var adjustlocalizeddate = function ( $elements ) {
22
+ $elements.each(function ( ) {
23
+ var $this = jQuery( this );
24
+ var time = $this.data( 'publishtime' ) * 1000; // new Date() requires time in ms.
25
+ var format = $this.data( 'format' );
26
+ var orig_date = new Date( time );
27
+ switch ( format ) {
28
+ case 'date' :
29
+ $this.text( orig_date.toLocaleDateString() );
30
+ break;
31
+ case 'time' :
32
+ $this.text( orig_date.toLocaleDateString() + ' '
33
+ + orig_date.toLocaleTimeString([], {hour: '2-digit', minute:'2-digit'}) // Eliminate seconds.
34
+ );
35
+ break;
36
+ }
37
+ });
38
+ }
39
+
40
+ adjustlocalizeddate( $elements );
41
+
42
+ // Wait for catposts.load_more event that load more triggers when for
43
+ // mewly added item, and localize the date if needed.
44
+ jQuery( 'ul' ).on('catposts.load_more', '.cat-post-item', function () {
45
+ adjustlocalizeddate( jQuery( this ).find( '.cat-post-date[data-publishtime]' ) );
46
+ });
47
+ }
48
+ });
49
+ }
js/frontend/loadmore.js CHANGED
@@ -1,50 +1,50 @@
1
- /**
2
- * Category Posts Widget
3
- * https://github.com/tiptoppress/category-posts-widget
4
- *
5
- * JS for the "load more" functionality.
6
- *
7
- * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
- */
9
-
10
- if (typeof jQuery !== 'undefined') {
11
-
12
- var php_settings_var = 'categoryPosts'; // should be identical to namespace.
13
-
14
- jQuery( document ).ready(function () {
15
-
16
- // Handle the click of load more.
17
- jQuery(document).on('click', '.' + php_settings_var + '-loadmore button', function() {
18
- var $this = jQuery(this);
19
- var id = $this.data( 'id' );
20
- var number = $this.data( 'number' );
21
- var start = $this.data( 'start' );
22
- var context = $this.data( 'context' );
23
- var url = tiptoppress[php_settings_var].json_root_url;
24
- var $ul = jQuery(this.parentElement.parentElement).find('ul'); // The UL of the widget.
25
- var orig_text = $this.text();
26
- var loading_text = $this.data( 'loading' );
27
-
28
- // Change the button text to indicate loading.
29
- $this.text( loading_text );
30
- // Get the data from the server
31
- jQuery.getJSON(url + '/' + id + '/' + start + '/' + number + '/' + context + '/', function ( data ) {
32
- // appened the returned data to the UL in the returned order.
33
- jQuery.each(data, function (key, li) {
34
- $ul.append(li);
35
- // apend returns the $ul, therefor we need to actualy find
36
- // the newly added item.
37
- $ul.children().last().trigger('catposts.load_more');
38
- });
39
- if (data.length != number) {
40
- $this.hide();
41
- } else {
42
- $this.data( 'start', start+number );
43
- }
44
- }).always( function () {
45
- // Revert to original text.
46
- $this.text( orig_text );
47
- });
48
- });
49
- });
50
- }
1
+ /**
2
+ * Category Posts Widget
3
+ * https://github.com/tiptoppress/category-posts-widget
4
+ *
5
+ * JS for the "load more" functionality.
6
+ *
7
+ * Released under the GPLv2 license or later - http://www.gnu.org/licenses/gpl-2.0.html
8
+ */
9
+
10
+ if (typeof jQuery !== 'undefined') {
11
+
12
+ var php_settings_var = 'categoryPosts'; // should be identical to namespace.
13
+
14
+ jQuery( document ).ready(function () {
15
+
16
+ // Handle the click of load more.
17
+ jQuery(document).on('click', '.' + php_settings_var + '-loadmore button', function() {
18
+ var $this = jQuery(this);
19
+ var id = $this.data( 'id' );
20
+ var number = $this.data( 'number' );
21
+ var start = $this.data( 'start' );
22
+ var context = $this.data( 'context' );
23
+ var url = tiptoppress[php_settings_var].json_root_url;
24
+ var $ul = jQuery(this.parentElement.parentElement).find('ul'); // The UL of the widget.
25
+ var orig_text = $this.text();
26
+ var loading_text = $this.data( 'loading' );
27
+
28
+ // Change the button text to indicate loading.
29
+ $this.text( loading_text );
30
+ // Get the data from the server
31
+ jQuery.getJSON(url + '/' + id + '/' + start + '/' + number + '/' + context + '/', function ( data ) {
32
+ // appened the returned data to the UL in the returned order.
33
+ jQuery.each(data, function (key, li) {
34
+ $ul.append(li);
35
+ // apend returns the $ul, therefor we need to actualy find
36
+ // the newly added item.
37
+ $ul.children().last().trigger('catposts.load_more');
38
+ });
39
+ if (data.length != number) {
40
+ $this.hide();
41
+ } else {
42
+ $this.data( 'start', start+number );
43
+ }
44
+ }).always( function () {
45
+ // Revert to original text.
46
+ $this.text( orig_text );
47
+ });
48
+ });
49
+ });
50
+ }
js/select2-4.0.3/css/select2.css DELETED
@@ -1,484 +0,0 @@
1
- .select2-container {
2
- box-sizing: border-box;
3
- display: inline-block;
4
- margin: 0;
5
- position: relative;
6
- vertical-align: middle; }
7
- .select2-container .select2-selection--single {
8
- box-sizing: border-box;
9
- cursor: pointer;
10
- display: block;
11
- height: 28px;
12
- user-select: none;
13
- -webkit-user-select: none; }
14
- .select2-container .select2-selection--single .select2-selection__rendered {
15
- display: block;
16
- padding-left: 8px;
17
- padding-right: 20px;
18
- overflow: hidden;
19
- text-overflow: ellipsis;
20
- white-space: nowrap; }
21
- .select2-container .select2-selection--single .select2-selection__clear {
22
- position: relative; }
23
- .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
24
- padding-right: 8px;
25
- padding-left: 20px; }
26
- .select2-container .select2-selection--multiple {
27
- box-sizing: border-box;
28
- cursor: pointer;
29
- display: block;
30
- min-height: 32px;
31
- user-select: none;
32
- -webkit-user-select: none; }
33
- .select2-container .select2-selection--multiple .select2-selection__rendered {
34
- display: inline-block;
35
- overflow: hidden;
36
- padding-left: 8px;
37
- text-overflow: ellipsis;
38
- white-space: nowrap; }
39
- .select2-container .select2-search--inline {
40
- float: left; }
41
- .select2-container .select2-search--inline .select2-search__field {
42
- box-sizing: border-box;
43
- border: none;
44
- font-size: 100%;
45
- margin-top: 5px;
46
- padding: 0; }
47
- .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
48
- -webkit-appearance: none; }
49
-
50
- .select2-dropdown {
51
- background-color: white;
52
- border: 1px solid #aaa;
53
- border-radius: 4px;
54
- box-sizing: border-box;
55
- display: block;
56
- position: absolute;
57
- left: -100000px;
58
- width: 100%;
59
- z-index: 1051; }
60
-
61
- .select2-results {
62
- display: block; }
63
-
64
- .select2-results__options {
65
- list-style: none;
66
- margin: 0;
67
- padding: 0; }
68
-
69
- .select2-results__option {
70
- padding: 6px;
71
- user-select: none;
72
- -webkit-user-select: none; }
73
- .select2-results__option[aria-selected] {
74
- cursor: pointer; }
75
-
76
- .select2-container--open .select2-dropdown {
77
- left: 0; }
78
-
79
- .select2-container--open .select2-dropdown--above {
80
- border-bottom: none;
81
- border-bottom-left-radius: 0;
82
- border-bottom-right-radius: 0; }
83
-
84
- .select2-container--open .select2-dropdown--below {
85
- border-top: none;
86
- border-top-left-radius: 0;
87
- border-top-right-radius: 0; }
88
-
89
- .select2-search--dropdown {
90
- display: block;
91
- padding: 4px; }
92
- .select2-search--dropdown .select2-search__field {
93
- padding: 4px;
94
- width: 100%;
95
- box-sizing: border-box; }
96
- .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
97
- -webkit-appearance: none; }
98
- .select2-search--dropdown.select2-search--hide {
99
- display: none; }
100
-
101
- .select2-close-mask {
102
- border: 0;
103
- margin: 0;
104
- padding: 0;
105
- display: block;
106
- position: fixed;
107
- left: 0;
108
- top: 0;
109
- min-height: 100%;
110
- min-width: 100%;
111
- height: auto;
112
- width: auto;
113
- opacity: 0;
114
- z-index: 99;
115
- background-color: #fff;
116
- filter: alpha(opacity=0); }
117
-
118
- .select2-hidden-accessible {
119
- border: 0 !important;
120
- clip: rect(0 0 0 0) !important;
121
- height: 1px !important;
122
- margin: -1px !important;
123
- overflow: hidden !important;
124
- padding: 0 !important;
125
- position: absolute !important;
126
- width: 1px !important; }
127
-
128
- .select2-container--default .select2-selection--single {
129
- background-color: #fff;
130
- border: 1px solid #aaa;
131
- border-radius: 4px; }
132
- .select2-container--default .select2-selection--single .select2-selection__rendered {
133
- color: #444;
134
- line-height: 28px; }
135
- .select2-container--default .select2-selection--single .select2-selection__clear {
136
- cursor: pointer;
137
- float: right;
138
- font-weight: bold; }
139
- .select2-container--default .select2-selection--single .select2-selection__placeholder {
140
- color: #999; }
141
- .select2-container--default .select2-selection--single .select2-selection__arrow {
142
- height: 26px;
143
- position: absolute;
144
- top: 1px;
145
- right: 1px;
146
- width: 20px; }
147
- .select2-container--default .select2-selection--single .select2-selection__arrow b {
148
- border-color: #888 transparent transparent transparent;
149
- border-style: solid;
150
- border-width: 5px 4px 0 4px;
151
- height: 0;
152
- left: 50%;
153
- margin-left: -4px;
154
- margin-top: -2px;
155
- position: absolute;
156
- top: 50%;
157
- width: 0; }
158
-
159
- .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
160
- float: left; }
161
-
162
- .select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
163
- left: 1px;
164
- right: auto; }
165
-
166
- .select2-container--default.select2-container--disabled .select2-selection--single {
167
- background-color: #eee;
168
- cursor: default; }
169
- .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
170
- display: none; }
171
-
172
- .select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
173
- border-color: transparent transparent #888 transparent;
174
- border-width: 0 4px 5px 4px; }
175
-
176
- .select2-container--default .select2-selection--multiple {
177
- background-color: white;
178
- border: 1px solid #aaa;
179
- border-radius: 4px;
180
- cursor: text; }
181
- .select2-container--default .select2-selection--multiple .select2-selection__rendered {
182
- box-sizing: border-box;
183
- list-style: none;
184
- margin: 0;
185
- padding: 0 5px;
186
- width: 100%; }
187
- .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
188
- list-style: none; }
189
- .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
190
- color: #999;
191
- margin-top: 5px;
192
- float: left; }
193
- .select2-container--default .select2-selection--multiple .select2-selection__clear {
194
- cursor: pointer;
195
- float: right;
196
- font-weight: bold;
197
- margin-top: 5px;
198
- margin-right: 10px; }
199
- .select2-container--default .select2-selection--multiple .select2-selection__choice {
200
- background-color: #e4e4e4;
201
- border: 1px solid #aaa;
202
- border-radius: 4px;
203
- cursor: default;
204
- float: left;
205
- margin-right: 5px;
206
- margin-top: 5px;
207
- padding: 0 5px; }
208
- .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
209
- color: #999;
210
- cursor: pointer;
211
- display: inline-block;
212
- font-weight: bold;
213
- margin-right: 2px; }
214
- .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
215
- color: #333; }
216
-
217
- .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
218
- float: right; }
219
-
220
- .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
221
- margin-left: 5px;
222
- margin-right: auto; }
223
-
224
- .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
225
- margin-left: 2px;
226
- margin-right: auto; }
227
-
228
- .select2-container--default.select2-container--focus .select2-selection--multiple {
229
- border: solid black 1px;
230
- outline: 0; }
231
-
232
- .select2-container--default.select2-container--disabled .select2-selection--multiple {
233
- background-color: #eee;
234
- cursor: default; }
235
-
236
- .select2-container--default.select2-container--disabled .select2-selection__choice__remove {
237
- display: none; }
238
-
239
- .select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
240
- border-top-left-radius: 0;
241
- border-top-right-radius: 0; }
242
-
243
- .select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
244
- border-bottom-left-radius: 0;
245
- border-bottom-right-radius: 0; }
246
-
247
- .select2-container--default .select2-search--dropdown .select2-search__field {
248
- border: 1px solid #aaa; }
249
-
250
- .select2-container--default .select2-search--inline .select2-search__field {
251
- background: transparent;
252
- border: none;
253
- outline: 0;
254
- box-shadow: none;
255
- -webkit-appearance: textfield; }
256
-
257
- .select2-container--default .select2-results > .select2-results__options {
258
- max-height: 200px;
259
- overflow-y: auto; }
260
-
261
- .select2-container--default .select2-results__option[role=group] {
262
- padding: 0; }
263
-
264
- .select2-container--default .select2-results__option[aria-disabled=true] {
265
- color: #999; }
266
-
267
- .select2-container--default .select2-results__option[aria-selected=true] {
268
- background-color: #ddd; }
269
-
270
- .select2-container--default .select2-results__option .select2-results__option {
271
- padding-left: 1em; }
272
- .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
273
- padding-left: 0; }
274
- .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
275
- margin-left: -1em;
276
- padding-left: 2em; }
277
- .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
278
- margin-left: -2em;
279
- padding-left: 3em; }
280
- .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
281
- margin-left: -3em;
282
- padding-left: 4em; }
283
- .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
284
- margin-left: -4em;
285
- padding-left: 5em; }
286
- .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
287
- margin-left: -5em;
288
- padding-left: 6em; }
289
-
290
- .select2-container--default .select2-results__option--highlighted[aria-selected] {
291
- background-color: #5897fb;
292
- color: white; }
293
-
294
- .select2-container--default .select2-results__group {
295
- cursor: default;
296
- display: block;
297
- padding: 6px; }
298
-
299
- .select2-container--classic .select2-selection--single {
300
- background-color: #f7f7f7;
301
- border: 1px solid #aaa;
302
- border-radius: 4px;
303
- outline: 0;
304
- background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
305
- background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
306
- background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
307
- background-repeat: repeat-x;
308
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
309
- .select2-container--classic .select2-selection--single:focus {
310
- border: 1px solid #5897fb; }
311
- .select2-container--classic .select2-selection--single .select2-selection__rendered {
312
- color: #444;
313
- line-height: 28px; }
314
- .select2-container--classic .select2-selection--single .select2-selection__clear {
315
- cursor: pointer;
316
- float: right;
317
- font-weight: bold;
318
- margin-right: 10px; }
319
- .select2-container--classic .select2-selection--single .select2-selection__placeholder {
320
- color: #999; }
321
- .select2-container--classic .select2-selection--single .select2-selection__arrow {
322
- background-color: #ddd;
323
- border: none;
324
- border-left: 1px solid #aaa;
325
- border-top-right-radius: 4px;
326
- border-bottom-right-radius: 4px;
327
- height: 26px;
328
- position: absolute;
329
- top: 1px;
330
- right: 1px;
331
- width: 20px;
332
- background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
333
- background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
334
- background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
335
- background-repeat: repeat-x;
336
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
337
- .select2-container--classic .select2-selection--single .select2-selection__arrow b {
338
- border-color: #888 transparent transparent transparent;
339
- border-style: solid;
340
- border-width: 5px 4px 0 4px;
341
- height: 0;
342
- left: 50%;
343
- margin-left: -4px;
344
- margin-top: -2px;
345
- position: absolute;
346
- top: 50%;
347
- width: 0; }
348
-
349
- .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
350
- float: left; }
351
-
352
- .select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
353
- border: none;
354
- border-right: 1px solid #aaa;
355
- border-radius: 0;
356
- border-top-left-radius: 4px;
357
- border-bottom-left-radius: 4px;
358
- left: 1px;
359
- right: auto; }
360
-
361
- .select2-container--classic.select2-container--open .select2-selection--single {
362
- border: 1px solid #5897fb; }
363
- .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
364
- background: transparent;
365
- border: none; }
366
- .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
367
- border-color: transparent transparent #888 transparent;
368
- border-width: 0 4px 5px 4px; }
369
-
370
- .select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
371
- border-top: none;
372
- border-top-left-radius: 0;
373
- border-top-right-radius: 0;
374
- background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
375
- background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
376
- background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
377
- background-repeat: repeat-x;
378
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
379
-
380
- .select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
381
- border-bottom: none;
382
- border-bottom-left-radius: 0;
383
- border-bottom-right-radius: 0;
384
- background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
385
- background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
386
- background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
387
- background-repeat: repeat-x;
388
- filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
389
-
390
- .select2-container--classic .select2-selection--multiple {
391
- background-color: white;
392
- border: 1px solid #aaa;
393
- border-radius: 4px;
394
- cursor: text;
395
- outline: 0; }
396
- .select2-container--classic .select2-selection--multiple:focus {
397
- border: 1px solid #5897fb; }
398
- .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
399
- list-style: none;
400
- margin: 0;
401
- padding: 0 5px; }
402
- .select2-container--classic .select2-selection--multiple .select2-selection__clear {
403
- display: none; }
404
- .select2-container--classic .select2-selection--multiple .select2-selection__choice {
405
- background-color: #e4e4e4;
406
- border: 1px solid #aaa;
407
- border-radius: 4px;
408
- cursor: default;
409
- float: left;
410
- margin-right: 5px;
411
- margin-top: 5px;
412
- padding: 0 5px; }
413
- .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
414
- color: #888;
415
- cursor: pointer;
416
- display: inline-block;
417
- font-weight: bold;
418
- margin-right: 2px; }
419
- .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
420
- color: #555; }
421
-
422
- .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
423
- float: right; }
424
-
425
- .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
426
- margin-left: 5px;
427
- margin-right: auto; }
428
-
429
- .select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
430
- margin-left: 2px;
431
- margin-right: auto; }
432
-
433
- .select2-container--classic.select2-container--open .select2-selection--multiple {
434
- border: 1px solid #5897fb; }
435
-
436
- .select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
437
- border-top: none;
438
- border-top-left-radius: 0;
439
- border-top-right-radius: 0; }
440
-
441
- .select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
442
- border-bottom: none;
443
- border-bottom-left-radius: 0;
444
- border-bottom-right-radius: 0; }
445
-
446
- .select2-container--classic .select2-search--dropdown .select2-search__field {
447
- border: 1px solid #aaa;
448
- outline: 0; }
449
-
450
- .select2-container--classic .select2-search--inline .select2-search__field {
451
- outline: 0;
452
- box-shadow: none; }
453
-
454
- .select2-container--classic .select2-dropdown {
455
- background-color: white;
456
- border: 1px solid transparent; }
457
-
458
- .select2-container--classic .select2-dropdown--above {
459
- border-bottom: none; }
460
-
461
- .select2-container--classic .select2-dropdown--below {
462
- border-top: none; }
463
-
464
- .select2-container--classic .select2-results > .select2-results__options {
465
- max-height: 200px;
466
- overflow-y: auto; }
467
-
468
- .select2-container--classic .select2-results__option[role=group] {
469
- padding: 0; }
470
-
471
- .select2-container--classic .select2-results__option[aria-disabled=true] {
472
- color: grey; }
473
-
474
- .select2-container--classic .select2-results__option--highlighted[aria-selected] {
475
- background-color: #3875d7;
476
- color: white; }
477
-
478
- .select2-container--classic .select2-results__group {
479
- cursor: default;
480
- display: block;
481
- padding: 6px; }
482
-
483
- .select2-container--classic.select2-container--open .select2-dropdown {
484
- border-color: #5897fb; }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/select2-4.0.3/css/select2.min.css DELETED
@@ -1 +0,0 @@
1
- .select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
 
js/select2-4.0.3/js/select2.full.js DELETED
@@ -1,6436 +0,0 @@
1
- /*!
2
- * Select2 4.0.3
3
- * https://select2.github.io
4
- *
5
- * Released under the MIT license
6
- * https://github.com/select2/select2/blob/master/LICENSE.md
7
- */
8
- (function (factory) {
9
- if (typeof define === 'function' && define.amd) {
10
- // AMD. Register as an anonymous module.
11
- define(['jquery'], factory);
12
- } else if (typeof exports === 'object') {
13
- // Node/CommonJS
14
- factory(require('jquery'));
15
- } else {
16
- // Browser globals
17
- factory(jQuery);
18
- }
19
- }(function (jQuery) {
20
- // This is needed so we can catch the AMD loader configuration and use it
21
- // The inner file should be wrapped (by `banner.start.js`) in a function that
22
- // returns the AMD loader references.
23
- var S2 =
24
- (function () {
25
- // Restore the Select2 AMD loader so it can be used
26
- // Needed mostly in the language files, where the loader is not inserted
27
- if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
28
- var S2 = jQuery.fn.select2.amd;
29
- }
30
- var S2;(function () { if (!S2 || !S2.requirejs) {
31
- if (!S2) { S2 = {}; } else { require = S2; }
32
- /**
33
- * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
34
- * Available via the MIT or new BSD license.
35
- * see: http://github.com/jrburke/almond for details
36
- */
37
- //Going sloppy to avoid 'use strict' string cost, but strict practices should
38
- //be followed.
39
- /*jslint sloppy: true */
40
- /*global setTimeout: false */
41
-
42
- var requirejs, require, define;
43
- (function (undef) {
44
- var main, req, makeMap, handlers,
45
- defined = {},
46
- waiting = {},
47
- config = {},
48
- defining = {},
49
- hasOwn = Object.prototype.hasOwnProperty,
50
- aps = [].slice,
51
- jsSuffixRegExp = /\.js$/;
52
-
53
- function hasProp(obj, prop) {
54
- return hasOwn.call(obj, prop);
55
- }
56
-
57
- /**
58
- * Given a relative module name, like ./something, normalize it to
59
- * a real name that can be mapped to a path.
60
- * @param {String} name the relative name
61
- * @param {String} baseName a real name that the name arg is relative
62
- * to.
63
- * @returns {String} normalized name
64
- */
65
- function normalize(name, baseName) {
66
- var nameParts, nameSegment, mapValue, foundMap, lastIndex,
67
- foundI, foundStarMap, starI, i, j, part,
68
- baseParts = baseName && baseName.split("/"),
69
- map = config.map,
70
- starMap = (map && map['*']) || {};
71
-
72
- //Adjust any relative paths.
73
- if (name && name.charAt(0) === ".") {
74
- //If have a base name, try to normalize against it,
75
- //otherwise, assume it is a top-level require that will
76
- //be relative to baseUrl in the end.
77
- if (baseName) {
78
- name = name.split('/');
79
- lastIndex = name.length - 1;
80
-
81
- // Node .js allowance:
82
- if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
83
- name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
84
- }
85
-
86
- //Lop off the last part of baseParts, so that . matches the
87
- //"directory" and not name of the baseName's module. For instance,
88
- //baseName of "one/two/three", maps to "one/two/three.js", but we
89
- //want the directory, "one/two" for this normalization.
90
- name = baseParts.slice(0, baseParts.length - 1).concat(name);
91
-
92
- //start trimDots
93
- for (i = 0; i < name.length; i += 1) {
94
- part = name[i];
95
- if (part === ".") {
96
- name.splice(i, 1);
97
- i -= 1;
98
- } else if (part === "..") {
99
- if (i === 1 && (name[2] === '..' || name[0] === '..')) {
100
- //End of the line. Keep at least one non-dot
101
- //path segment at the front so it can be mapped
102
- //correctly to disk. Otherwise, there is likely
103
- //no path mapping for a path starting with '..'.
104
- //This can still fail, but catches the most reasonable
105
- //uses of ..
106
- break;
107
- } else if (i > 0) {
108
- name.splice(i - 1, 2);
109
- i -= 2;
110
- }
111
- }
112
- }
113
- //end trimDots
114
-
115
- name = name.join("/");
116
- } else if (name.indexOf('./') === 0) {
117
- // No baseName, so this is ID is resolved relative
118
- // to baseUrl, pull off the leading dot.
119
- name = name.substring(2);
120
- }
121
- }
122
-
123
- //Apply map config if available.
124
- if ((baseParts || starMap) && map) {
125
- nameParts = name.split('/');
126
-
127
- for (i = nameParts.length; i > 0; i -= 1) {
128
- nameSegment = nameParts.slice(0, i).join("/");
129
-
130
- if (baseParts) {
131
- //Find the longest baseName segment match in the config.
132
- //So, do joins on the biggest to smallest lengths of baseParts.
133
- for (j = baseParts.length; j > 0; j -= 1) {
134
- mapValue = map[baseParts.slice(0, j).join('/')];
135
-
136
- //baseName segment has config, find if it has one for
137
- //this name.
138
- if (mapValue) {
139
- mapValue = mapValue[nameSegment];
140
- if (mapValue) {
141
- //Match, update name to the new value.
142
- foundMap = mapValue;
143
- foundI = i;
144
- break;
145
- }
146
- }
147
- }
148
- }
149
-
150
- if (foundMap) {
151
- break;
152
- }
153
-
154
- //Check for a star map match, but just hold on to it,
155
- //if there is a shorter segment match later in a matching
156
- //config, then favor over this star map.
157
- if (!foundStarMap && starMap && starMap[nameSegment]) {
158
- foundStarMap = starMap[nameSegment];
159
- starI = i;
160
- }
161
- }
162
-
163
- if (!foundMap && foundStarMap) {
164
- foundMap = foundStarMap;
165
- foundI = starI;
166
- }
167
-
168
- if (foundMap) {
169
- nameParts.splice(0, foundI, foundMap);
170
- name = nameParts.join('/');
171
- }
172
- }
173
-
174
- return name;
175
- }
176
-
177
- function makeRequire(relName, forceSync) {
178
- return function () {
179
- //A version of a require function that passes a moduleName
180
- //value for items that may need to
181
- //look up paths relative to the moduleName
182
- var args = aps.call(arguments, 0);
183
-
184
- //If first arg is not require('string'), and there is only
185
- //one arg, it is the array form without a callback. Insert
186
- //a null so that the following concat is correct.
187
- if (typeof args[0] !== 'string' && args.length === 1) {
188
- args.push(null);
189
- }
190
- return req.apply(undef, args.concat([relName, forceSync]));
191
- };
192
- }
193
-
194
- function makeNormalize(relName) {
195
- return function (name) {
196
- return normalize(name, relName);
197
- };
198
- }
199
-
200
- function makeLoad(depName) {
201
- return function (value) {
202
- defined[depName] = value;
203
- };
204
- }
205
-
206
- function callDep(name) {
207
- if (hasProp(waiting, name)) {
208
- var args = waiting[name];
209
- delete waiting[name];
210
- defining[name] = true;
211
- main.apply(undef, args);
212
- }
213
-
214
- if (!hasProp(defined, name) && !hasProp(defining, name)) {
215
- throw new Error('No ' + name);
216
- }
217
- return defined[name];
218
- }
219
-
220
- //Turns a plugin!resource to [plugin, resource]
221
- //with the plugin being undefined if the name
222
- //did not have a plugin prefix.
223
- function splitPrefix(name) {
224
- var prefix,
225
- index = name ? name.indexOf('!') : -1;
226
- if (index > -1) {
227
- prefix = name.substring(0, index);
228
- name = name.substring(index + 1, name.length);
229
- }
230
- return [prefix, name];
231
- }
232
-
233
- /**
234
- * Makes a name map, normalizing the name, and using a plugin
235
- * for normalization if necessary. Grabs a ref to plugin
236
- * too, as an optimization.
237
- */
238
- makeMap = function (name, relName) {
239
- var plugin,
240
- parts = splitPrefix(name),
241
- prefix = parts[0];
242
-
243
- name = parts[1];
244
-
245
- if (prefix) {
246
- prefix = normalize(prefix, relName);
247
- plugin = callDep(prefix);
248
- }
249
-
250
- //Normalize according
251
- if (prefix) {
252
- if (plugin && plugin.normalize) {
253
- name = plugin.normalize(name, makeNormalize(relName));
254
- } else {
255
- name = normalize(name, relName);
256
- }
257
- } else {
258
- name = normalize(name, relName);
259
- parts = splitPrefix(name);
260
- prefix = parts[0];
261
- name = parts[1];
262
- if (prefix) {
263
- plugin = callDep(prefix);
264
- }
265
- }
266
-
267
- //Using ridiculous property names for space reasons
268
- return {
269
- f: prefix ? prefix + '!' + name : name, //fullName
270
- n: name,
271
- pr: prefix,
272
- p: plugin
273
- };
274
- };
275
-
276
- function makeConfig(name) {
277
- return function () {
278
- return (config && config.config && config.config[name]) || {};
279
- };
280
- }
281
-
282
- handlers = {
283
- require: function (name) {
284
- return makeRequire(name);
285
- },
286
- exports: function (name) {
287
- var e = defined[name];
288
- if (typeof e !== 'undefined') {
289
- return e;
290
- } else {
291
- return (defined[name] = {});
292
- }
293
- },
294
- module: function (name) {
295
- return {
296
- id: name,
297
- uri: '',
298
- exports: defined[name],
299
- config: makeConfig(name)
300
- };
301
- }
302
- };
303
-
304
- main = function (name, deps, callback, relName) {
305
- var cjsModule, depName, ret, map, i,
306
- args = [],
307
- callbackType = typeof callback,
308
- usingExports;
309
-
310
- //Use name if no relName
311
- relName = relName || name;
312
-
313
- //Call the callback to define the module, if necessary.
314
- if (callbackType === 'undefined' || callbackType === 'function') {
315
- //Pull out the defined dependencies and pass the ordered
316
- //values to the callback.
317
- //Default to [require, exports, module] if no deps
318
- deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
319
- for (i = 0; i < deps.length; i += 1) {
320
- map = makeMap(deps[i], relName);
321
- depName = map.f;
322
-
323
- //Fast path CommonJS standard dependencies.
324
- if (depName === "require") {
325
- args[i] = handlers.require(name);
326
- } else if (depName === "exports") {
327
- //CommonJS module spec 1.1
328
- args[i] = handlers.exports(name);
329
- usingExports = true;
330
- } else if (depName === "module") {
331
- //CommonJS module spec 1.1
332
- cjsModule = args[i] = handlers.module(name);
333
- } else if (hasProp(defined, depName) ||
334
- hasProp(waiting, depName) ||
335
- hasProp(defining, depName)) {
336
- args[i] = callDep(depName);
337
- } else if (map.p) {
338
- map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
339
- args[i] = defined[depName];
340
- } else {
341
- throw new Error(name + ' missing ' + depName);
342
- }
343
- }
344
-
345
- ret = callback ? callback.apply(defined[name], args) : undefined;
346
-
347
- if (name) {
348
- //If setting exports via "module" is in play,
349
- //favor that over return value and exports. After that,
350
- //favor a non-undefined return value over exports use.
351
- if (cjsModule && cjsModule.exports !== undef &&
352
- cjsModule.exports !== defined[name]) {
353
- defined[name] = cjsModule.exports;
354
- } else if (ret !== undef || !usingExports) {
355
- //Use the return value from the function.
356
- defined[name] = ret;
357
- }
358
- }
359
- } else if (name) {
360
- //May just be an object definition for the module. Only
361
- //worry about defining if have a module name.
362
- defined[name] = callback;
363
- }
364
- };
365
-
366
- requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
367
- if (typeof deps === "string") {
368
- if (handlers[deps]) {
369
- //callback in this case is really relName
370
- return handlers[deps](callback);
371
- }
372
- //Just return the module wanted. In this scenario, the
373
- //deps arg is the module name, and second arg (if passed)
374
- //is just the relName.
375
- //Normalize module name, if it contains . or ..
376
- return callDep(makeMap(deps, callback).f);
377
- } else if (!deps.splice) {
378
- //deps is a config object, not an array.
379
- config = deps;
380
- if (config.deps) {
381
- req(config.deps, config.callback);
382
- }
383
- if (!callback) {
384
- return;
385
- }
386
-
387
- if (callback.splice) {
388
- //callback is an array, which means it is a dependency list.
389
- //Adjust args if there are dependencies
390
- deps = callback;
391
- callback = relName;
392
- relName = null;
393
- } else {
394
- deps = undef;
395
- }
396
- }
397
-
398
- //Support require(['a'])
399
- callback = callback || function () {};
400
-
401
- //If relName is a function, it is an errback handler,
402
- //so remove it.
403
- if (typeof relName === 'function') {
404
- relName = forceSync;
405
- forceSync = alt;
406
- }
407
-
408
- //Simulate async callback;
409
- if (forceSync) {
410
- main(undef, deps, callback, relName);
411
- } else {
412
- //Using a non-zero value because of concern for what old browsers
413
- //do, and latest browsers "upgrade" to 4 if lower value is used:
414
- //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
415
- //If want a value immediately, use require('id') instead -- something
416
- //that works in almond on the global level, but not guaranteed and
417
- //unlikely to work in other AMD implementations.
418
- setTimeout(function () {
419
- main(undef, deps, callback, relName);
420
- }, 4);
421
- }
422
-
423
- return req;
424
- };
425
-
426
- /**
427
- * Just drops the config on the floor, but returns req in case
428
- * the config return value is used.
429
- */
430
- req.config = function (cfg) {
431
- return req(cfg);
432
- };
433
-
434
- /**
435
- * Expose module registry for debugging and tooling
436
- */
437
- requirejs._defined = defined;
438
-
439
- define = function (name, deps, callback) {
440
- if (typeof name !== 'string') {
441
- throw new Error('See almond README: incorrect module build, no module name');
442
- }
443
-
444
- //This module may not have dependencies
445
- if (!deps.splice) {
446
- //deps is not an array, so probably means
447
- //an object literal or factory function for
448
- //the value. Adjust args.
449
- callback = deps;
450
- deps = [];
451
- }
452
-
453
- if (!hasProp(defined, name) && !hasProp(waiting, name)) {
454
- waiting[name] = [name, deps, callback];
455
- }
456
- };
457
-
458
- define.amd = {
459
- jQuery: true
460
- };
461
- }());
462
-
463
- S2.requirejs = requirejs;S2.require = require;S2.define = define;
464
- }
465
- }());
466
- S2.define("almond", function(){});
467
-
468
- /* global jQuery:false, $:false */
469
- S2.define('jquery',[],function () {
470
- var _$ = jQuery || $;
471
-
472
- if (_$ == null && console && console.error) {
473
- console.error(
474
- 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
475
- 'found. Make sure that you are including jQuery before Select2 on your ' +
476
- 'web page.'
477
- );
478
- }
479
-
480
- return _$;
481
- });
482
-
483
- S2.define('select2/utils',[
484
- 'jquery'
485
- ], function ($) {
486
- var Utils = {};
487
-
488
- Utils.Extend = function (ChildClass, SuperClass) {
489
- var __hasProp = {}.hasOwnProperty;
490
-
491
- function BaseConstructor () {
492
- this.constructor = ChildClass;
493
- }
494
-
495
- for (var key in SuperClass) {
496
- if (__hasProp.call(SuperClass, key)) {
497
- ChildClass[key] = SuperClass[key];
498
- }
499
- }
500
-
501
- BaseConstructor.prototype = SuperClass.prototype;
502
- ChildClass.prototype = new BaseConstructor();
503
- ChildClass.__super__ = SuperClass.prototype;
504
-
505
- return ChildClass;
506
- };
507
-
508
- function getMethods (theClass) {
509
- var proto = theClass.prototype;
510
-
511
- var methods = [];
512
-
513
- for (var methodName in proto) {
514
- var m = proto[methodName];
515
-
516
- if (typeof m !== 'function') {
517
- continue;
518
- }
519
-
520
- if (methodName === 'constructor') {
521
- continue;
522
- }
523
-
524
- methods.push(methodName);
525
- }
526
-
527
- return methods;
528
- }
529
-
530
- Utils.Decorate = function (SuperClass, DecoratorClass) {
531
- var decoratedMethods = getMethods(DecoratorClass);
532
- var superMethods = getMethods(SuperClass);
533
-
534
- function DecoratedClass () {
535
- var unshift = Array.prototype.unshift;
536
-
537
- var argCount = DecoratorClass.prototype.constructor.length;
538
-
539
- var calledConstructor = SuperClass.prototype.constructor;
540
-
541
- if (argCount > 0) {
542
- unshift.call(arguments, SuperClass.prototype.constructor);
543
-
544
- calledConstructor = DecoratorClass.prototype.constructor;
545
- }
546
-
547
- calledConstructor.apply(this, arguments);
548
- }
549
-
550
- DecoratorClass.displayName = SuperClass.displayName;
551
-
552
- function ctr () {
553
- this.constructor = DecoratedClass;
554
- }
555
-
556
- DecoratedClass.prototype = new ctr();
557
-
558
- for (var m = 0; m < superMethods.length; m++) {
559
- var superMethod = superMethods[m];
560
-
561
- DecoratedClass.prototype[superMethod] =
562
- SuperClass.prototype[superMethod];
563
- }
564
-
565
- var calledMethod = function (methodName) {
566
- // Stub out the original method if it's not decorating an actual method
567
- var originalMethod = function () {};
568
-
569
- if (methodName in DecoratedClass.prototype) {
570
- originalMethod = DecoratedClass.prototype[methodName];
571
- }
572
-
573
- var decoratedMethod = DecoratorClass.prototype[methodName];
574
-
575
- return function () {
576
- var unshift = Array.prototype.unshift;
577
-
578
- unshift.call(arguments, originalMethod);
579
-
580
- return decoratedMethod.apply(this, arguments);
581
- };
582
- };
583
-
584
- for (var d = 0; d < decoratedMethods.length; d++) {
585
- var decoratedMethod = decoratedMethods[d];
586
-
587
- DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
588
- }
589
-
590
- return DecoratedClass;
591
- };
592
-
593
- var Observable = function () {
594
- this.listeners = {};
595
- };
596
-
597
- Observable.prototype.on = function (event, callback) {
598
- this.listeners = this.listeners || {};
599
-
600
- if (event in this.listeners) {
601
- this.listeners[event].push(callback);
602
- } else {
603
- this.listeners[event] = [callback];
604
- }
605
- };
606
-
607
- Observable.prototype.trigger = function (event) {
608
- var slice = Array.prototype.slice;
609
- var params = slice.call(arguments, 1);
610
-
611
- this.listeners = this.listeners || {};
612
-
613
- // Params should always come in as an array
614
- if (params == null) {
615
- params = [];
616
- }
617
-
618
- // If there are no arguments to the event, use a temporary object
619
- if (params.length === 0) {
620
- params.push({});
621
- }
622
-
623
- // Set the `_type` of the first object to the event
624
- params[0]._type = event;
625
-
626
- if (event in this.listeners) {
627
- this.invoke(this.listeners[event], slice.call(arguments, 1));
628
- }
629
-
630
- if ('*' in this.listeners) {
631
- this.invoke(this.listeners['*'], arguments);
632
- }
633
- };
634
-
635
- Observable.prototype.invoke = function (listeners, params) {
636
- for (var i = 0, len = listeners.length; i < len; i++) {
637
- listeners[i].apply(this, params);
638
- }
639
- };
640
-
641
- Utils.Observable = Observable;
642
-
643
- Utils.generateChars = function (length) {
644
- var chars = '';
645
-
646
- for (var i = 0; i < length; i++) {
647
- var randomChar = Math.floor(Math.random() * 36);
648
- chars += randomChar.toString(36);
649
- }
650
-
651
- return chars;
652
- };
653
-
654
- Utils.bind = function (func, context) {
655
- return function () {
656
- func.apply(context, arguments);
657
- };
658
- };
659
-
660
- Utils._convertData = function (data) {
661
- for (var originalKey in data) {
662
- var keys = originalKey.split('-');
663
-
664
- var dataLevel = data;
665
-
666
- if (keys.length === 1) {
667
- continue;
668
- }
669
-
670
- for (var k = 0; k < keys.length; k++) {
671
- var key = keys[k];
672
-
673
- // Lowercase the first letter
674
- // By default, dash-separated becomes camelCase
675
- key = key.substring(0, 1).toLowerCase() + key.substring(1);
676
-
677
- if (!(key in dataLevel)) {
678
- dataLevel[key] = {};
679
- }
680
-
681
- if (k == keys.length - 1) {
682
- dataLevel[key] = data[originalKey];
683
- }
684
-
685
- dataLevel = dataLevel[key];
686
- }
687
-
688
- delete data[originalKey];
689
- }
690
-
691
- return data;
692
- };
693
-
694
- Utils.hasScroll = function (index, el) {
695
- // Adapted from the function created by @ShadowScripter
696
- // and adapted by @BillBarry on the Stack Exchange Code Review website.
697
- // The original code can be found at
698
- // http://codereview.stackexchange.com/q/13338
699
- // and was designed to be used with the Sizzle selector engine.
700
-
701
- var $el = $(el);
702
- var overflowX = el.style.overflowX;
703
- var overflowY = el.style.overflowY;
704
-
705
- //Check both x and y declarations
706
- if (overflowX === overflowY &&
707
- (overflowY === 'hidden' || overflowY === 'visible')) {
708
- return false;
709
- }
710
-
711
- if (overflowX === 'scroll' || overflowY === 'scroll') {
712
- return true;
713
- }
714
-
715
- return ($el.innerHeight() < el.scrollHeight ||
716
- $el.innerWidth() < el.scrollWidth);
717
- };
718
-
719
- Utils.escapeMarkup = function (markup) {
720
- var replaceMap = {
721
- '\\': '&#92;',
722
- '&': '&amp;',
723
- '<': '&lt;',
724
- '>': '&gt;',
725
- '"': '&quot;',
726
- '\'': '&#39;',
727
- '/': '&#47;'
728
- };
729
-
730
- // Do not try to escape the markup if it's not a string
731
- if (typeof markup !== 'string') {
732
- return markup;
733
- }
734
-
735
- return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
736
- return replaceMap[match];
737
- });
738
- };
739
-
740
- // Append an array of jQuery nodes to a given element.
741
- Utils.appendMany = function ($element, $nodes) {
742
- // jQuery 1.7.x does not support $.fn.append() with an array
743
- // Fall back to a jQuery object collection using $.fn.add()
744
- if ($.fn.jquery.substr(0, 3) === '1.7') {
745
- var $jqNodes = $();
746
-
747
- $.map($nodes, function (node) {
748
- $jqNodes = $jqNodes.add(node);
749
- });
750
-
751
- $nodes = $jqNodes;
752
- }
753
-
754
- $element.append($nodes);
755
- };
756
-
757
- return Utils;
758
- });
759
-
760
- S2.define('select2/results',[
761
- 'jquery',
762
- './utils'
763
- ], function ($, Utils) {
764
- function Results ($element, options, dataAdapter) {
765
- this.$element = $element;
766
- this.data = dataAdapter;
767
- this.options = options;
768
-
769
- Results.__super__.constructor.call(this);
770
- }
771
-
772
- Utils.Extend(Results, Utils.Observable);
773
-
774
- Results.prototype.render = function () {
775
- var $results = $(
776
- '<ul class="select2-results__options" role="tree"></ul>'
777
- );
778
-
779
- if (this.options.get('multiple')) {
780
- $results.attr('aria-multiselectable', 'true');
781
- }
782
-
783
- this.$results = $results;
784
-
785
- return $results;
786
- };
787
-
788
- Results.prototype.clear = function () {
789
- this.$results.empty();
790
- };
791
-
792
- Results.prototype.displayMessage = function (params) {
793
- var escapeMarkup = this.options.get('escapeMarkup');
794
-
795
- this.clear();
796
- this.hideLoading();
797
-
798
- var $message = $(
799
- '<li role="treeitem" aria-live="assertive"' +
800
- ' class="select2-results__option"></li>'
801
- );
802
-
803
- var message = this.options.get('translations').get(params.message);
804
-
805
- $message.append(
806
- escapeMarkup(
807
- message(params.args)
808
- )
809
- );
810
-
811
- $message[0].className += ' select2-results__message';
812
-
813
- this.$results.append($message);
814
- };
815
-
816
- Results.prototype.hideMessages = function () {
817
- this.$results.find('.select2-results__message').remove();
818
- };
819
-
820
- Results.prototype.append = function (data) {
821
- this.hideLoading();
822
-
823
- var $options = [];
824
-
825
- if (data.results == null || data.results.length === 0) {
826
- if (this.$results.children().length === 0) {
827
- this.trigger('results:message', {
828
- message: 'noResults'
829
- });
830
- }
831
-
832
- return;
833
- }
834
-
835
- data.results = this.sort(data.results);
836
-
837
- for (var d = 0; d < data.results.length; d++) {
838
- var item = data.results[d];
839
-
840
- var $option = this.option(item);
841
-
842
- $options.push($option);
843
- }
844
-
845
- this.$results.append($options);
846
- };
847
-
848
- Results.prototype.position = function ($results, $dropdown) {
849
- var $resultsContainer = $dropdown.find('.select2-results');
850
- $resultsContainer.append($results);
851
- };
852
-
853
- Results.prototype.sort = function (data) {
854
- var sorter = this.options.get('sorter');
855
-
856
- return sorter(data);
857
- };
858
-
859
- Results.prototype.highlightFirstItem = function () {
860
- var $options = this.$results
861
- .find('.select2-results__option[aria-selected]');
862
-
863
- var $selected = $options.filter('[aria-selected=true]');
864
-
865
- // Check if there are any selected options
866
- if ($selected.length > 0) {
867
- // If there are selected options, highlight the first
868
- $selected.first().trigger('mouseenter');
869
- } else {
870
- // If there are no selected options, highlight the first option
871
- // in the dropdown
872
- $options.first().trigger('mouseenter');
873
- }
874
-
875
- this.ensureHighlightVisible();
876
- };
877
-
878
- Results.prototype.setClasses = function () {
879
- var self = this;
880
-
881
- this.data.current(function (selected) {
882
- var selectedIds = $.map(selected, function (s) {
883
- return s.id.toString();
884
- });
885
-
886
- var $options = self.$results
887
- .find('.select2-results__option[aria-selected]');
888
-
889
- $options.each(function () {
890
- var $option = $(this);
891
-
892
- var item = $.data(this, 'data');
893
-
894
- // id needs to be converted to a string when comparing
895
- var id = '' + item.id;
896
-
897
- if ((item.element != null && item.element.selected) ||
898
- (item.element == null && $.inArray(id, selectedIds) > -1)) {
899
- $option.attr('aria-selected', 'true');
900
- } else {
901
- $option.attr('aria-selected', 'false');
902
- }
903
- });
904
-
905
- });
906
- };
907
-
908
- Results.prototype.showLoading = function (params) {
909
- this.hideLoading();
910
-
911
- var loadingMore = this.options.get('translations').get('searching');
912
-
913
- var loading = {
914
- disabled: true,
915
- loading: true,
916
- text: loadingMore(params)
917
- };
918
- var $loading = this.option(loading);
919
- $loading.className += ' loading-results';
920
-
921
- this.$results.prepend($loading);
922
- };
923
-
924
- Results.prototype.hideLoading = function () {
925
- this.$results.find('.loading-results').remove();
926
- };
927
-
928
- Results.prototype.option = function (data) {
929
- var option = document.createElement('li');
930
- option.className = 'select2-results__option';
931
-
932
- var attrs = {
933
- 'role': 'treeitem',
934
- 'aria-selected': 'false'
935
- };
936
-
937
- if (data.disabled) {
938
- delete attrs['aria-selected'];
939
- attrs['aria-disabled'] = 'true';
940
- }
941
-
942
- if (data.id == null) {
943
- delete attrs['aria-selected'];
944
- }
945
-
946
- if (data._resultId != null) {
947
- option.id = data._resultId;
948
- }
949
-
950
- if (data.title) {
951
- option.title = data.title;
952
- }
953
-
954
- if (data.children) {
955
- attrs.role = 'group';
956
- attrs['aria-label'] = data.text;
957
- delete attrs['aria-selected'];
958
- }
959
-
960
- for (var attr in attrs) {
961
- var val = attrs[attr];
962
-
963
- option.setAttribute(attr, val);
964
- }
965
-
966
- if (data.children) {
967
- var $option = $(option);
968
-
969
- var label = document.createElement('strong');
970
- label.className = 'select2-results__group';
971
-
972
- var $label = $(label);
973
- this.template(data, label);
974
-
975
- var $children = [];
976
-
977
- for (var c = 0; c < data.children.length; c++) {
978
- var child = data.children[c];
979
-
980
- var $child = this.option(child);
981
-
982
- $children.push($child);
983
- }
984
-
985
- var $childrenContainer = $('<ul></ul>', {
986
- 'class': 'select2-results__options select2-results__options--nested'
987
- });
988
-
989
- $childrenContainer.append($children);
990
-
991
- $option.append(label);
992
- $option.append($childrenContainer);
993
- } else {
994
- this.template(data, option);
995
- }
996
-
997
- $.data(option, 'data', data);
998
-
999
- return option;
1000
- };
1001
-
1002
- Results.prototype.bind = function (container, $container) {
1003
- var self = this;
1004
-
1005
- var id = container.id + '-results';
1006
-
1007
- this.$results.attr('id', id);
1008
-
1009
- container.on('results:all', function (params) {
1010
- self.clear();
1011
- self.append(params.data);
1012
-
1013
- if (container.isOpen()) {
1014
- self.setClasses();
1015
- self.highlightFirstItem();
1016
- }
1017
- });
1018
-
1019
- container.on('results:append', function (params) {
1020
- self.append(params.data);
1021
-
1022
- if (container.isOpen()) {
1023
- self.setClasses();
1024
- }
1025
- });
1026
-
1027
- container.on('query', function (params) {
1028
- self.hideMessages();
1029
- self.showLoading(params);
1030
- });
1031
-
1032
- container.on('select', function () {
1033
- if (!container.isOpen()) {
1034
- return;
1035
- }
1036
-
1037
- self.setClasses();
1038
- self.highlightFirstItem();
1039
- });
1040
-
1041
- container.on('unselect', function () {
1042
- if (!container.isOpen()) {
1043
- return;
1044
- }
1045
-
1046
- self.setClasses();
1047
- self.highlightFirstItem();
1048
- });
1049
-
1050
- container.on('open', function () {
1051
- // When the dropdown is open, aria-expended="true"
1052
- self.$results.attr('aria-expanded', 'true');
1053
- self.$results.attr('aria-hidden', 'false');
1054
-
1055
- self.setClasses();
1056
- self.ensureHighlightVisible();
1057
- });
1058
-
1059
- container.on('close', function () {
1060
- // When the dropdown is closed, aria-expended="false"
1061
- self.$results.attr('aria-expanded', 'false');
1062
- self.$results.attr('aria-hidden', 'true');
1063
- self.$results.removeAttr('aria-activedescendant');
1064
- });
1065
-
1066
- container.on('results:toggle', function () {
1067
- var $highlighted = self.getHighlightedResults();
1068
-
1069
- if ($highlighted.length === 0) {
1070
- return;
1071
- }
1072
-
1073
- $highlighted.trigger('mouseup');
1074
- });
1075
-
1076
- container.on('results:select', function () {
1077
- var $highlighted = self.getHighlightedResults();
1078
-
1079
- if ($highlighted.length === 0) {
1080
- return;
1081
- }
1082
-
1083
- var data = $highlighted.data('data');
1084
-
1085
- if ($highlighted.attr('aria-selected') == 'true') {
1086
- self.trigger('close', {});
1087
- } else {
1088
- self.trigger('select', {
1089
- data: data
1090
- });
1091
- }
1092
- });
1093
-
1094
- container.on('results:previous', function () {
1095
- var $highlighted = self.getHighlightedResults();
1096
-
1097
- var $options = self.$results.find('[aria-selected]');
1098
-
1099
- var currentIndex = $options.index($highlighted);
1100
-
1101
- // If we are already at te top, don't move further
1102
- if (currentIndex === 0) {
1103
- return;
1104
- }
1105
-
1106
- var nextIndex = currentIndex - 1;
1107
-
1108
- // If none are highlighted, highlight the first
1109
- if ($highlighted.length === 0) {
1110
- nextIndex = 0;
1111
- }
1112
-
1113
- var $next = $options.eq(nextIndex);
1114
-
1115
- $next.trigger('mouseenter');
1116
-
1117
- var currentOffset = self.$results.offset().top;
1118
- var nextTop = $next.offset().top;
1119
- var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
1120
-
1121
- if (nextIndex === 0) {
1122
- self.$results.scrollTop(0);
1123
- } else if (nextTop - currentOffset < 0) {
1124
- self.$results.scrollTop(nextOffset);
1125
- }
1126
- });
1127
-
1128
- container.on('results:next', function () {
1129
- var $highlighted = self.getHighlightedResults();
1130
-
1131
- var $options = self.$results.find('[aria-selected]');
1132
-
1133
- var currentIndex = $options.index($highlighted);
1134
-
1135
- var nextIndex = currentIndex + 1;
1136
-
1137
- // If we are at the last option, stay there
1138
- if (nextIndex >= $options.length) {
1139
- return;
1140
- }
1141
-
1142
- var $next = $options.eq(nextIndex);
1143
-
1144
- $next.trigger('mouseenter');
1145
-
1146
- var currentOffset = self.$results.offset().top +
1147
- self.$results.outerHeight(false);
1148
- var nextBottom = $next.offset().top + $next.outerHeight(false);
1149
- var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
1150
-
1151
- if (nextIndex === 0) {
1152
- self.$results.scrollTop(0);
1153
- } else if (nextBottom > currentOffset) {
1154
- self.$results.scrollTop(nextOffset);
1155
- }
1156
- });
1157
-
1158
- container.on('results:focus', function (params) {
1159
- params.element.addClass('select2-results__option--highlighted');
1160
- });
1161
-
1162
- container.on('results:message', function (params) {
1163
- self.displayMessage(params);
1164
- });
1165
-
1166
- if ($.fn.mousewheel) {
1167
- this.$results.on('mousewheel', function (e) {
1168
- var top = self.$results.scrollTop();
1169
-
1170
- var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
1171
-
1172
- var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1173
- var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
1174
-
1175
- if (isAtTop) {
1176
- self.$results.scrollTop(0);
1177
-
1178
- e.preventDefault();
1179
- e.stopPropagation();
1180
- } else if (isAtBottom) {
1181
- self.$results.scrollTop(
1182
- self.$results.get(0).scrollHeight - self.$results.height()
1183
- );
1184
-
1185
- e.preventDefault();
1186
- e.stopPropagation();
1187
- }
1188
- });
1189
- }
1190
-
1191
- this.$results.on('mouseup', '.select2-results__option[aria-selected]',
1192
- function (evt) {
1193
- var $this = $(this);
1194
-
1195
- var data = $this.data('data');
1196
-
1197
- if ($this.attr('aria-selected') === 'true') {
1198
- if (self.options.get('multiple')) {
1199
- self.trigger('unselect', {
1200
- originalEvent: evt,
1201
- data: data
1202
- });
1203
- } else {
1204
- self.trigger('close', {});
1205
- }
1206
-
1207
- return;
1208
- }
1209
-
1210
- self.trigger('select', {
1211
- originalEvent: evt,
1212
- data: data
1213
- });
1214
- });
1215
-
1216
- this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
1217
- function (evt) {
1218
- var data = $(this).data('data');
1219
-
1220
- self.getHighlightedResults()
1221
- .removeClass('select2-results__option--highlighted');
1222
-
1223
- self.trigger('results:focus', {
1224
- data: data,
1225
- element: $(this)
1226
- });
1227
- });
1228
- };
1229
-
1230
- Results.prototype.getHighlightedResults = function () {
1231
- var $highlighted = this.$results
1232
- .find('.select2-results__option--highlighted');
1233
-
1234
- return $highlighted;
1235
- };
1236
-
1237
- Results.prototype.destroy = function () {
1238
- this.$results.remove();
1239
- };
1240
-
1241
- Results.prototype.ensureHighlightVisible = function () {
1242
- var $highlighted = this.getHighlightedResults();
1243
-
1244
- if ($highlighted.length === 0) {
1245
- return;
1246
- }
1247
-
1248
- var $options = this.$results.find('[aria-selected]');
1249
-
1250
- var currentIndex = $options.index($highlighted);
1251
-
1252
- var currentOffset = this.$results.offset().top;
1253
- var nextTop = $highlighted.offset().top;
1254
- var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
1255
-
1256
- var offsetDelta = nextTop - currentOffset;
1257
- nextOffset -= $highlighted.outerHeight(false) * 2;
1258
-
1259
- if (currentIndex <= 2) {
1260
- this.$results.scrollTop(0);
1261
- } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
1262
- this.$results.scrollTop(nextOffset);
1263
- }
1264
- };
1265
-
1266
- Results.prototype.template = function (result, container) {
1267
- var template = this.options.get('templateResult');
1268
- var escapeMarkup = this.options.get('escapeMarkup');
1269
-
1270
- var content = template(result, container);
1271
-
1272
- if (content == null) {
1273
- container.style.display = 'none';
1274
- } else if (typeof content === 'string') {
1275
- container.innerHTML = escapeMarkup(content);
1276
- } else {
1277
- $(container).append(content);
1278
- }
1279
- };
1280
-
1281
- return Results;
1282
- });
1283
-
1284
- S2.define('select2/keys',[
1285
-
1286
- ], function () {
1287
- var KEYS = {
1288
- BACKSPACE: 8,
1289
- TAB: 9,
1290
- ENTER: 13,
1291
- SHIFT: 16,
1292
- CTRL: 17,
1293
- ALT: 18,
1294
- ESC: 27,
1295
- SPACE: 32,
1296
- PAGE_UP: 33,
1297
- PAGE_DOWN: 34,
1298
- END: 35,
1299
- HOME: 36,
1300
- LEFT: 37,
1301
- UP: 38,
1302
- RIGHT: 39,
1303
- DOWN: 40,
1304
- DELETE: 46
1305
- };
1306
-
1307
- return KEYS;
1308
- });
1309
-
1310
- S2.define('select2/selection/base',[
1311
- 'jquery',
1312
- '../utils',
1313
- '../keys'
1314
- ], function ($, Utils, KEYS) {
1315
- function BaseSelection ($element, options) {
1316
- this.$element = $element;
1317
- this.options = options;
1318
-
1319
- BaseSelection.__super__.constructor.call(this);
1320
- }
1321
-
1322
- Utils.Extend(BaseSelection, Utils.Observable);
1323
-
1324
- BaseSelection.prototype.render = function () {
1325
- var $selection = $(
1326
- '<span class="select2-selection" role="combobox" ' +
1327
- ' aria-haspopup="true" aria-expanded="false">' +
1328
- '</span>'
1329
- );
1330
-
1331
- this._tabindex = 0;
1332
-
1333
- if (this.$element.data('old-tabindex') != null) {
1334
- this._tabindex = this.$element.data('old-tabindex');
1335
- } else if (this.$element.attr('tabindex') != null) {
1336
- this._tabindex = this.$element.attr('tabindex');
1337
- }
1338
-
1339
- $selection.attr('title', this.$element.attr('title'));
1340
- $selection.attr('tabindex', this._tabindex);
1341
-
1342
- this.$selection = $selection;
1343
-
1344
- return $selection;
1345
- };
1346
-
1347
- BaseSelection.prototype.bind = function (container, $container) {
1348
- var self = this;
1349
-
1350
- var id = container.id + '-container';
1351
- var resultsId = container.id + '-results';
1352
-
1353
- this.container = container;
1354
-
1355
- this.$selection.on('focus', function (evt) {
1356
- self.trigger('focus', evt);
1357
- });
1358
-
1359
- this.$selection.on('blur', function (evt) {
1360
- self._handleBlur(evt);
1361
- });
1362
-
1363
- this.$selection.on('keydown', function (evt) {
1364
- self.trigger('keypress', evt);
1365
-
1366
- if (evt.which === KEYS.SPACE) {
1367
- evt.preventDefault();
1368
- }
1369
- });
1370
-
1371
- container.on('results:focus', function (params) {
1372
- self.$selection.attr('aria-activedescendant', params.data._resultId);
1373
- });
1374
-
1375
- container.on('selection:update', function (params) {
1376
- self.update(params.data);
1377
- });
1378
-
1379
- container.on('open', function () {
1380
- // When the dropdown is open, aria-expanded="true"
1381
- self.$selection.attr('aria-expanded', 'true');
1382
- self.$selection.attr('aria-owns', resultsId);
1383
-
1384
- self._attachCloseHandler(container);
1385
- });
1386
-
1387
- container.on('close', function () {
1388
- // When the dropdown is closed, aria-expanded="false"
1389
- self.$selection.attr('aria-expanded', 'false');
1390
- self.$selection.removeAttr('aria-activedescendant');
1391
- self.$selection.removeAttr('aria-owns');
1392
-
1393
- self.$selection.focus();
1394
-
1395
- self._detachCloseHandler(container);
1396
- });
1397
-
1398
- container.on('enable', function () {
1399
- self.$selection.attr('tabindex', self._tabindex);
1400
- });
1401
-
1402
- container.on('disable', function () {
1403
- self.$selection.attr('tabindex', '-1');
1404
- });
1405
- };
1406
-
1407
- BaseSelection.prototype._handleBlur = function (evt) {
1408
- var self = this;
1409
-
1410
- // This needs to be delayed as the active element is the body when the tab
1411
- // key is pressed, possibly along with others.
1412
- window.setTimeout(function () {
1413
- // Don't trigger `blur` if the focus is still in the selection
1414
- if (
1415
- (document.activeElement == self.$selection[0]) ||
1416
- ($.contains(self.$selection[0], document.activeElement))
1417
- ) {
1418
- return;
1419
- }
1420
-
1421
- self.trigger('blur', evt);
1422
- }, 1);
1423
- };
1424
-
1425
- BaseSelection.prototype._attachCloseHandler = function (container) {
1426
- var self = this;
1427
-
1428
- $(document.body).on('mousedown.select2.' + container.id, function (e) {
1429
- var $target = $(e.target);
1430
-
1431
- var $select = $target.closest('.select2');
1432
-
1433
- var $all = $('.select2.select2-container--open');
1434
-
1435
- $all.each(function () {
1436
- var $this = $(this);
1437
-
1438
- if (this == $select[0]) {
1439
- return;
1440
- }
1441
-
1442
- var $element = $this.data('element');
1443
-
1444
- $element.select2('close');
1445
- });
1446
- });
1447
- };
1448
-
1449
- BaseSelection.prototype._detachCloseHandler = function (container) {
1450
- $(document.body).off('mousedown.select2.' + container.id);
1451
- };
1452
-
1453
- BaseSelection.prototype.position = function ($selection, $container) {
1454
- var $selectionContainer = $container.find('.selection');
1455
- $selectionContainer.append($selection);
1456
- };
1457
-
1458
- BaseSelection.prototype.destroy = function () {
1459
- this._detachCloseHandler(this.container);
1460
- };
1461
-
1462
- BaseSelection.prototype.update = function (data) {
1463
- throw new Error('The `update` method must be defined in child classes.');
1464
- };
1465
-
1466
- return BaseSelection;
1467
- });
1468
-
1469
- S2.define('select2/selection/single',[
1470
- 'jquery',
1471
- './base',
1472
- '../utils',
1473
- '../keys'
1474
- ], function ($, BaseSelection, Utils, KEYS) {
1475
- function SingleSelection () {
1476
- SingleSelection.__super__.constructor.apply(this, arguments);
1477
- }
1478
-
1479
- Utils.Extend(SingleSelection, BaseSelection);
1480
-
1481
- SingleSelection.prototype.render = function () {
1482
- var $selection = SingleSelection.__super__.render.call(this);
1483
-
1484
- $selection.addClass('select2-selection--single');
1485
-
1486
- $selection.html(
1487
- '<span class="select2-selection__rendered"></span>' +
1488
- '<span class="select2-selection__arrow" role="presentation">' +
1489
- '<b role="presentation"></b>' +
1490
- '</span>'
1491
- );
1492
-
1493
- return $selection;
1494
- };
1495
-
1496
- SingleSelection.prototype.bind = function (container, $container) {
1497
- var self = this;
1498
-
1499
- SingleSelection.__super__.bind.apply(this, arguments);
1500
-
1501
- var id = container.id + '-container';
1502
-
1503
- this.$selection.find('.select2-selection__rendered').attr('id', id);
1504
- this.$selection.attr('aria-labelledby', id);
1505
-
1506
- this.$selection.on('mousedown', function (evt) {
1507
- // Only respond to left clicks
1508
- if (evt.which !== 1) {
1509
- return;
1510
- }
1511
-
1512
- self.trigger('toggle', {
1513
- originalEvent: evt
1514
- });
1515
- });
1516
-
1517
- this.$selection.on('focus', function (evt) {
1518
- // User focuses on the container
1519
- });
1520
-
1521
- this.$selection.on('blur', function (evt) {
1522
- // User exits the container
1523
- });
1524
-
1525
- container.on('focus', function (evt) {
1526
- if (!container.isOpen()) {
1527
- self.$selection.focus();
1528
- }
1529
- });
1530
-
1531
- container.on('selection:update', function (params) {
1532
- self.update(params.data);
1533
- });
1534
- };
1535
-
1536
- SingleSelection.prototype.clear = function () {
1537
- this.$selection.find('.select2-selection__rendered').empty();
1538
- };
1539
-
1540
- SingleSelection.prototype.display = function (data, container) {
1541
- var template = this.options.get('templateSelection');
1542
- var escapeMarkup = this.options.get('escapeMarkup');
1543
-
1544
- return escapeMarkup(template(data, container));
1545
- };
1546
-
1547
- SingleSelection.prototype.selectionContainer = function () {
1548
- return $('<span></span>');
1549
- };
1550
-
1551
- SingleSelection.prototype.update = function (data) {
1552
- if (data.length === 0) {
1553
- this.clear();
1554
- return;
1555
- }
1556
-
1557
- var selection = data[0];
1558
-
1559
- var $rendered = this.$selection.find('.select2-selection__rendered');
1560
- var formatted = this.display(selection, $rendered);
1561
-
1562
- $rendered.empty().append(formatted);
1563
- $rendered.prop('title', selection.title || selection.text);
1564
- };
1565
-
1566
- return SingleSelection;
1567
- });
1568
-
1569
- S2.define('select2/selection/multiple',[
1570
- 'jquery',
1571
- './base',
1572
- '../utils'
1573
- ], function ($, BaseSelection, Utils) {
1574
- function MultipleSelection ($element, options) {
1575
- MultipleSelection.__super__.constructor.apply(this, arguments);
1576
- }
1577
-
1578
- Utils.Extend(MultipleSelection, BaseSelection);
1579
-
1580
- MultipleSelection.prototype.render = function () {
1581
- var $selection = MultipleSelection.__super__.render.call(this);
1582
-
1583
- $selection.addClass('select2-selection--multiple');
1584
-
1585
- $selection.html(
1586
- '<ul class="select2-selection__rendered"></ul>'
1587
- );
1588
-
1589
- return $selection;
1590
- };
1591
-
1592
- MultipleSelection.prototype.bind = function (container, $container) {
1593
- var self = this;
1594
-
1595
- MultipleSelection.__super__.bind.apply(this, arguments);
1596
-
1597
- this.$selection.on('click', function (evt) {
1598
- self.trigger('toggle', {
1599
- originalEvent: evt
1600
- });
1601
- });
1602
-
1603
- this.$selection.on(
1604
- 'click',
1605
- '.select2-selection__choice__remove',
1606
- function (evt) {
1607
- // Ignore the event if it is disabled
1608
- if (self.options.get('disabled')) {
1609
- return;
1610
- }
1611
-
1612
- var $remove = $(this);
1613
- var $selection = $remove.parent();
1614
-
1615
- var data = $selection.data('data');
1616
-
1617
- self.trigger('unselect', {
1618
- originalEvent: evt,
1619
- data: data
1620
- });
1621
- }
1622
- );
1623
- };
1624
-
1625
- MultipleSelection.prototype.clear = function () {
1626
- this.$selection.find('.select2-selection__rendered').empty();
1627
- };
1628
-
1629
- MultipleSelection.prototype.display = function (data, container) {
1630
- var template = this.options.get('templateSelection');
1631
- var escapeMarkup = this.options.get('escapeMarkup');
1632
-
1633
- return escapeMarkup(template(data, container));
1634
- };
1635
-
1636
- MultipleSelection.prototype.selectionContainer = function () {
1637
- var $container = $(
1638
- '<li class="select2-selection__choice">' +
1639
- '<span class="select2-selection__choice__remove" role="presentation">' +
1640
- '&times;' +
1641
- '</span>' +
1642
- '</li>'
1643
- );
1644
-
1645
- return $container;
1646
- };
1647
-
1648
- MultipleSelection.prototype.update = function (data) {
1649
- this.clear();
1650
-
1651
- if (data.length === 0) {
1652
- return;
1653
- }
1654
-
1655
- var $selections = [];
1656
-
1657
- for (var d = 0; d < data.length; d++) {
1658
- var selection = data[d];
1659
-
1660
- var $selection = this.selectionContainer();
1661
- var formatted = this.display(selection, $selection);
1662
-
1663
- $selection.append(formatted);
1664
- $selection.prop('title', selection.title || selection.text);
1665
-
1666
- $selection.data('data', selection);
1667
-
1668
- $selections.push($selection);
1669
- }
1670
-
1671
- var $rendered = this.$selection.find('.select2-selection__rendered');
1672
-
1673
- Utils.appendMany($rendered, $selections);
1674
- };
1675
-
1676
- return MultipleSelection;
1677
- });
1678
-
1679
- S2.define('select2/selection/placeholder',[
1680
- '../utils'
1681
- ], function (Utils) {
1682
- function Placeholder (decorated, $element, options) {
1683
- this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
1684
-
1685
- decorated.call(this, $element, options);
1686
- }
1687
-
1688
- Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
1689
- if (typeof placeholder === 'string') {
1690
- placeholder = {
1691
- id: '',
1692
- text: placeholder
1693
- };
1694
- }
1695
-
1696
- return placeholder;
1697
- };
1698
-
1699
- Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
1700
- var $placeholder = this.selectionContainer();
1701
-
1702
- $placeholder.html(this.display(placeholder));
1703
- $placeholder.addClass('select2-selection__placeholder')
1704
- .removeClass('select2-selection__choice');
1705
-
1706
- return $placeholder;
1707
- };
1708
-
1709
- Placeholder.prototype.update = function (decorated, data) {
1710
- var singlePlaceholder = (
1711
- data.length == 1 && data[0].id != this.placeholder.id
1712
- );
1713
- var multipleSelections = data.length > 1;
1714
-
1715
- if (multipleSelections || singlePlaceholder) {
1716
- return decorated.call(this, data);
1717
- }
1718
-
1719
- this.clear();
1720
-
1721
- var $placeholder = this.createPlaceholder(this.placeholder);
1722
-
1723
- this.$selection.find('.select2-selection__rendered').append($placeholder);
1724
- };
1725
-
1726
- return Placeholder;
1727
- });
1728
-
1729
- S2.define('select2/selection/allowClear',[
1730
- 'jquery',
1731
- '../keys'
1732
- ], function ($, KEYS) {
1733
- function AllowClear () { }
1734
-
1735
- AllowClear.prototype.bind = function (decorated, container, $container) {
1736
- var self = this;
1737
-
1738
- decorated.call(this, container, $container);
1739
-
1740
- if (this.placeholder == null) {
1741
- if (this.options.get('debug') && window.console && console.error) {
1742
- console.error(
1743
- 'Select2: The `allowClear` option should be used in combination ' +
1744
- 'with the `placeholder` option.'
1745
- );
1746
- }
1747
- }
1748
-
1749
- this.$selection.on('mousedown', '.select2-selection__clear',
1750
- function (evt) {
1751
- self._handleClear(evt);
1752
- });
1753
-
1754
- container.on('keypress', function (evt) {
1755
- self._handleKeyboardClear(evt, container);
1756
- });
1757
- };
1758
-
1759
- AllowClear.prototype._handleClear = function (_, evt) {
1760
- // Ignore the event if it is disabled
1761
- if (this.options.get('disabled')) {
1762
- return;
1763
- }
1764
-
1765
- var $clear = this.$selection.find('.select2-selection__clear');
1766
-
1767
- // Ignore the event if nothing has been selected
1768
- if ($clear.length === 0) {
1769
- return;
1770
- }
1771
-
1772
- evt.stopPropagation();
1773
-
1774
- var data = $clear.data('data');
1775
-
1776
- for (var d = 0; d < data.length; d++) {
1777
- var unselectData = {
1778
- data: data[d]
1779
- };
1780
-
1781
- // Trigger the `unselect` event, so people can prevent it from being
1782
- // cleared.
1783
- this.trigger('unselect', unselectData);
1784
-
1785
- // If the event was prevented, don't clear it out.
1786
- if (unselectData.prevented) {
1787
- return;
1788
- }
1789
- }
1790
-
1791
- this.$element.val(this.placeholder.id).trigger('change');
1792
-
1793
- this.trigger('toggle', {});
1794
- };
1795
-
1796
- AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
1797
- if (container.isOpen()) {
1798
- return;
1799
- }
1800
-
1801
- if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
1802
- this._handleClear(evt);
1803
- }
1804
- };
1805
-
1806
- AllowClear.prototype.update = function (decorated, data) {
1807
- decorated.call(this, data);
1808
-
1809
- if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
1810
- data.length === 0) {
1811
- return;
1812
- }
1813
-
1814
- var $remove = $(
1815
- '<span class="select2-selection__clear">' +
1816
- '&times;' +
1817
- '</span>'
1818
- );
1819
- $remove.data('data', data);
1820
-
1821
- this.$selection.find('.select2-selection__rendered').prepend($remove);
1822
- };
1823
-
1824
- return AllowClear;
1825
- });
1826
-
1827
- S2.define('select2/selection/search',[
1828
- 'jquery',
1829
- '../utils',
1830
- '../keys'
1831
- ], function ($, Utils, KEYS) {
1832
- function Search (decorated, $element, options) {
1833
- decorated.call(this, $element, options);
1834
- }
1835
-
1836
- Search.prototype.render = function (decorated) {
1837
- var $search = $(
1838
- '<li class="select2-search select2-search--inline">' +
1839
- '<input class="select2-search__field" type="search" tabindex="-1"' +
1840
- ' autocomplete="off" autocorrect="off" autocapitalize="off"' +
1841
- ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
1842
- '</li>'
1843
- );
1844
-
1845
- this.$searchContainer = $search;
1846
- this.$search = $search.find('input');
1847
-
1848
- var $rendered = decorated.call(this);
1849
-
1850
- this._transferTabIndex();
1851
-
1852
- return $rendered;
1853
- };
1854
-
1855
- Search.prototype.bind = function (decorated, container, $container) {
1856
- var self = this;
1857
-
1858
- decorated.call(this, container, $container);
1859
-
1860
- container.on('open', function () {
1861
- self.$search.trigger('focus');
1862
- });
1863
-
1864
- container.on('close', function () {
1865
- self.$search.val('');
1866
- self.$search.removeAttr('aria-activedescendant');
1867
- self.$search.trigger('focus');
1868
- });
1869
-
1870
- container.on('enable', function () {
1871
- self.$search.prop('disabled', false);
1872
-
1873
- self._transferTabIndex();
1874
- });
1875
-
1876
- container.on('disable', function () {
1877
- self.$search.prop('disabled', true);
1878
- });
1879
-
1880
- container.on('focus', function (evt) {
1881
- self.$search.trigger('focus');
1882
- });
1883
-
1884
- container.on('results:focus', function (params) {
1885
- self.$search.attr('aria-activedescendant', params.id);
1886
- });
1887
-
1888
- this.$selection.on('focusin', '.select2-search--inline', function (evt) {
1889
- self.trigger('focus', evt);
1890
- });
1891
-
1892
- this.$selection.on('focusout', '.select2-search--inline', function (evt) {
1893
- self._handleBlur(evt);
1894
- });
1895
-
1896
- this.$selection.on('keydown', '.select2-search--inline', function (evt) {
1897
- evt.stopPropagation();
1898
-
1899
- self.trigger('keypress', evt);
1900
-
1901
- self._keyUpPrevented = evt.isDefaultPrevented();
1902
-
1903
- var key = evt.which;
1904
-
1905
- if (key === KEYS.BACKSPACE && self.$search.val() === '') {
1906
- var $previousChoice = self.$searchContainer
1907
- .prev('.select2-selection__choice');
1908
-
1909
- if ($previousChoice.length > 0) {
1910
- var item = $previousChoice.data('data');
1911
-
1912
- self.searchRemoveChoice(item);
1913
-
1914
- evt.preventDefault();
1915
- }
1916
- }
1917
- });
1918
-
1919
- // Try to detect the IE version should the `documentMode` property that
1920
- // is stored on the document. This is only implemented in IE and is
1921
- // slightly cleaner than doing a user agent check.
1922
- // This property is not available in Edge, but Edge also doesn't have
1923
- // this bug.
1924
- var msie = document.documentMode;
1925
- var disableInputEvents = msie && msie <= 11;
1926
-
1927
- // Workaround for browsers which do not support the `input` event
1928
- // This will prevent double-triggering of events for browsers which support
1929
- // both the `keyup` and `input` events.
1930
- this.$selection.on(
1931
- 'input.searchcheck',
1932
- '.select2-search--inline',
1933
- function (evt) {
1934
- // IE will trigger the `input` event when a placeholder is used on a
1935
- // search box. To get around this issue, we are forced to ignore all
1936
- // `input` events in IE and keep using `keyup`.
1937
- if (disableInputEvents) {
1938
- self.$selection.off('input.search input.searchcheck');
1939
- return;
1940
- }
1941
-
1942
- // Unbind the duplicated `keyup` event
1943
- self.$selection.off('keyup.search');
1944
- }
1945
- );
1946
-
1947
- this.$selection.on(
1948
- 'keyup.search input.search',
1949
- '.select2-search--inline',
1950
- function (evt) {
1951
- // IE will trigger the `input` event when a placeholder is used on a
1952
- // search box. To get around this issue, we are forced to ignore all
1953
- // `input` events in IE and keep using `keyup`.
1954
- if (disableInputEvents && evt.type === 'input') {
1955
- self.$selection.off('input.search input.searchcheck');
1956
- return;
1957
- }
1958
-
1959
- var key = evt.which;
1960
-
1961
- // We can freely ignore events from modifier keys
1962
- if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
1963
- return;
1964
- }
1965
-
1966
- // Tabbing will be handled during the `keydown` phase
1967
- if (key == KEYS.TAB) {
1968
- return;
1969
- }
1970
-
1971
- self.handleSearch(evt);
1972
- }
1973
- );
1974
- };
1975
-
1976
- /**
1977
- * This method will transfer the tabindex attribute from the rendered
1978
- * selection to the search box. This allows for the search box to be used as
1979
- * the primary focus instead of the selection container.
1980
- *
1981
- * @private
1982
- */
1983
- Search.prototype._transferTabIndex = function (decorated) {
1984
- this.$search.attr('tabindex', this.$selection.attr('tabindex'));
1985
- this.$selection.attr('tabindex', '-1');
1986
- };
1987
-
1988
- Search.prototype.createPlaceholder = function (decorated, placeholder) {
1989
- this.$search.attr('placeholder', placeholder.text);
1990
- };
1991
-
1992
- Search.prototype.update = function (decorated, data) {
1993
- var searchHadFocus = this.$search[0] == document.activeElement;
1994
-
1995
- this.$search.attr('placeholder', '');
1996
-
1997
- decorated.call(this, data);
1998
-
1999
- this.$selection.find('.select2-selection__rendered')
2000
- .append(this.$searchContainer);
2001
-
2002
- this.resizeSearch();
2003
- if (searchHadFocus) {
2004
- this.$search.focus();
2005
- }
2006
- };
2007
-
2008
- Search.prototype.handleSearch = function () {
2009
- this.resizeSearch();
2010
-
2011
- if (!this._keyUpPrevented) {
2012
- var input = this.$search.val();
2013
-
2014
- this.trigger('query', {
2015
- term: input
2016
- });
2017
- }
2018
-
2019
- this._keyUpPrevented = false;
2020
- };
2021
-
2022
- Search.prototype.searchRemoveChoice = function (decorated, item) {
2023
- this.trigger('unselect', {
2024
- data: item
2025
- });
2026
-
2027
- this.$search.val(item.text);
2028
- this.handleSearch();
2029
- };
2030
-
2031
- Search.prototype.resizeSearch = function () {
2032
- this.$search.css('width', '25px');
2033
-
2034
- var width = '';
2035
-
2036
- if (this.$search.attr('placeholder') !== '') {
2037
- width = this.$selection.find('.select2-selection__rendered').innerWidth();
2038
- } else {
2039
- var minimumWidth = this.$search.val().length + 1;
2040
-
2041
- width = (minimumWidth * 0.75) + 'em';
2042
- }
2043
-
2044
- this.$search.css('width', width);
2045
- };
2046
-
2047
- return Search;
2048
- });
2049
-
2050
- S2.define('select2/selection/eventRelay',[
2051
- 'jquery'
2052
- ], function ($) {
2053
- function EventRelay () { }
2054
-
2055
- EventRelay.prototype.bind = function (decorated, container, $container) {
2056
- var self = this;
2057
- var relayEvents = [
2058
- 'open', 'opening',
2059
- 'close', 'closing',
2060
- 'select', 'selecting',
2061
- 'unselect', 'unselecting'
2062
- ];
2063
-
2064
- var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
2065
-
2066
- decorated.call(this, container, $container);
2067
-
2068
- container.on('*', function (name, params) {
2069
- // Ignore events that should not be relayed
2070
- if ($.inArray(name, relayEvents) === -1) {
2071
- return;
2072
- }
2073
-
2074
- // The parameters should always be an object
2075
- params = params || {};
2076
-
2077
- // Generate the jQuery event for the Select2 event
2078
- var evt = $.Event('select2:' + name, {
2079
- params: params
2080
- });
2081
-
2082
- self.$element.trigger(evt);
2083
-
2084
- // Only handle preventable events if it was one
2085
- if ($.inArray(name, preventableEvents) === -1) {
2086
- return;
2087
- }
2088
-
2089
- params.prevented = evt.isDefaultPrevented();
2090
- });
2091
- };
2092
-
2093
- return EventRelay;
2094
- });
2095
-
2096
- S2.define('select2/translation',[
2097
- 'jquery',
2098
- 'require'
2099
- ], function ($, require) {
2100
- function Translation (dict) {
2101
- this.dict = dict || {};
2102
- }
2103
-
2104
- Translation.prototype.all = function () {
2105
- return this.dict;
2106
- };
2107
-
2108
- Translation.prototype.get = function (key) {
2109
- return this.dict[key];
2110
- };
2111
-
2112
- Translation.prototype.extend = function (translation) {
2113
- this.dict = $.extend({}, translation.all(), this.dict);
2114
- };
2115
-
2116
- // Static functions
2117
-
2118
- Translation._cache = {};
2119
-
2120
- Translation.loadPath = function (path) {
2121
- if (!(path in Translation._cache)) {
2122
- var translations = require(path);
2123
-
2124
- Translation._cache[path] = translations;
2125
- }
2126
-
2127
- return new Translation(Translation._cache[path]);
2128
- };
2129
-
2130
- return Translation;
2131
- });
2132
-
2133
- S2.define('select2/diacritics',[
2134
-
2135
- ], function () {
2136
- var diacritics = {
2137
- '\u24B6': 'A',
2138
- '\uFF21': 'A',
2139
- '\u00C0': 'A',
2140
- '\u00C1': 'A',
2141
- '\u00C2': 'A',
2142
- '\u1EA6': 'A',
2143
- '\u1EA4': 'A',
2144
- '\u1EAA': 'A',
2145
- '\u1EA8': 'A',
2146
- '\u00C3': 'A',
2147
- '\u0100': 'A',
2148
- '\u0102': 'A',
2149
- '\u1EB0': 'A',
2150
- '\u1EAE': 'A',
2151
- '\u1EB4': 'A',
2152
- '\u1EB2': 'A',
2153
- '\u0226': 'A',
2154
- '\u01E0': 'A',
2155
- '\u00C4': 'A',
2156
- '\u01DE': 'A',
2157
- '\u1EA2': 'A',
2158
- '\u00C5': 'A',
2159
- '\u01FA': 'A',
2160
- '\u01CD': 'A',
2161
- '\u0200': 'A',
2162
- '\u0202': 'A',
2163
- '\u1EA0': 'A',
2164
- '\u1EAC': 'A',
2165
- '\u1EB6': 'A',
2166
- '\u1E00': 'A',
2167
- '\u0104': 'A',
2168
- '\u023A': 'A',
2169
- '\u2C6F': 'A',
2170
- '\uA732': 'AA',
2171
- '\u00C6': 'AE',
2172
- '\u01FC': 'AE',
2173
- '\u01E2': 'AE',
2174
- '\uA734': 'AO',
2175
- '\uA736': 'AU',
2176
- '\uA738': 'AV',
2177
- '\uA73A': 'AV',
2178
- '\uA73C': 'AY',
2179
- '\u24B7': 'B',
2180
- '\uFF22': 'B',
2181
- '\u1E02': 'B',
2182
- '\u1E04': 'B',
2183
- '\u1E06': 'B',
2184
- '\u0243': 'B',
2185
- '\u0182': 'B',
2186
- '\u0181': 'B',
2187
- '\u24B8': 'C',
2188
- '\uFF23': 'C',
2189
- '\u0106': 'C',
2190
- '\u0108': 'C',
2191
- '\u010A': 'C',
2192
- '\u010C': 'C',
2193
- '\u00C7': 'C',
2194
- '\u1E08': 'C',
2195
- '\u0187': 'C',
2196
- '\u023B': 'C',
2197
- '\uA73E': 'C',
2198
- '\u24B9': 'D',
2199
- '\uFF24': 'D',
2200
- '\u1E0A': 'D',
2201
- '\u010E': 'D',
2202
- '\u1E0C': 'D',
2203
- '\u1E10': 'D',
2204
- '\u1E12': 'D',
2205
- '\u1E0E': 'D',
2206
- '\u0110': 'D',
2207
- '\u018B': 'D',
2208
- '\u018A': 'D',
2209
- '\u0189': 'D',
2210
- '\uA779': 'D',
2211
- '\u01F1': 'DZ',
2212
- '\u01C4': 'DZ',
2213
- '\u01F2': 'Dz',
2214
- '\u01C5': 'Dz',
2215
- '\u24BA': 'E',
2216
- '\uFF25': 'E',
2217
- '\u00C8': 'E',
2218
- '\u00C9': 'E',
2219
- '\u00CA': 'E',
2220
- '\u1EC0': 'E',
2221
- '\u1EBE': 'E',
2222
- '\u1EC4': 'E',
2223
- '\u1EC2': 'E',
2224
- '\u1EBC': 'E',
2225
- '\u0112': 'E',
2226
- '\u1E14': 'E',
2227
- '\u1E16': 'E',
2228
- '\u0114': 'E',
2229
- '\u0116': 'E',
2230
- '\u00CB': 'E',
2231
- '\u1EBA': 'E',
2232
- '\u011A': 'E',
2233
- '\u0204': 'E',
2234
- '\u0206': 'E',
2235
- '\u1EB8': 'E',
2236
- '\u1EC6': 'E',
2237
- '\u0228': 'E',
2238
- '\u1E1C': 'E',
2239
- '\u0118': 'E',
2240
- '\u1E18': 'E',
2241
- '\u1E1A': 'E',
2242
- '\u0190': 'E',
2243
- '\u018E': 'E',
2244
- '\u24BB': 'F',
2245
- '\uFF26': 'F',
2246
- '\u1E1E': 'F',
2247
- '\u0191': 'F',
2248
- '\uA77B': 'F',
2249
- '\u24BC': 'G',
2250
- '\uFF27': 'G',
2251
- '\u01F4': 'G',
2252
- '\u011C': 'G',
2253
- '\u1E20': 'G',
2254
- '\u011E': 'G',
2255
- '\u0120': 'G',
2256
- '\u01E6': 'G',
2257
- '\u0122': 'G',
2258
- '\u01E4': 'G',
2259
- '\u0193': 'G',
2260
- '\uA7A0': 'G',
2261
- '\uA77D': 'G',
2262
- '\uA77E': 'G',
2263
- '\u24BD': 'H',
2264
- '\uFF28': 'H',
2265
- '\u0124': 'H',
2266
- '\u1E22': 'H',
2267
- '\u1E26': 'H',
2268
- '\u021E': 'H',
2269
- '\u1E24': 'H',
2270
- '\u1E28': 'H',
2271
- '\u1E2A': 'H',
2272
- '\u0126': 'H',
2273
- '\u2C67': 'H',
2274
- '\u2C75': 'H',
2275
- '\uA78D': 'H',
2276
- '\u24BE': 'I',
2277
- '\uFF29': 'I',
2278
- '\u00CC': 'I',
2279
- '\u00CD': 'I',
2280
- '\u00CE': 'I',
2281
- '\u0128': 'I',
2282
- '\u012A': 'I',
2283
- '\u012C': 'I',
2284
- '\u0130': 'I',
2285
- '\u00CF': 'I',
2286
- '\u1E2E': 'I',
2287
- '\u1EC8': 'I',
2288
- '\u01CF': 'I',
2289
- '\u0208': 'I',
2290
- '\u020A': 'I',
2291
- '\u1ECA': 'I',
2292
- '\u012E': 'I',
2293
- '\u1E2C': 'I',
2294
- '\u0197': 'I',
2295
- '\u24BF': 'J',
2296
- '\uFF2A': 'J',
2297
- '\u0134': 'J',
2298
- '\u0248': 'J',
2299
- '\u24C0': 'K',
2300
- '\uFF2B': 'K',
2301
- '\u1E30': 'K',
2302
- '\u01E8': 'K',
2303
- '\u1E32': 'K',
2304
- '\u0136': 'K',
2305
- '\u1E34': 'K',
2306
- '\u0198': 'K',
2307
- '\u2C69': 'K',
2308
- '\uA740': 'K',
2309
- '\uA742': 'K',
2310
- '\uA744': 'K',
2311
- '\uA7A2': 'K',
2312
- '\u24C1': 'L',
2313
- '\uFF2C': 'L',
2314
- '\u013F': 'L',
2315
- '\u0139': 'L',
2316
- '\u013D': 'L',
2317
- '\u1E36': 'L',
2318
- '\u1E38': 'L',
2319
- '\u013B': 'L',
2320
- '\u1E3C': 'L',
2321
- '\u1E3A': 'L',
2322
- '\u0141': 'L',
2323
- '\u023D': 'L',
2324
- '\u2C62': 'L',
2325
- '\u2C60': 'L',
2326
- '\uA748': 'L',
2327
- '\uA746': 'L',
2328
- '\uA780': 'L',
2329
- '\u01C7': 'LJ',
2330
- '\u01C8': 'Lj',
2331
- '\u24C2': 'M',
2332
- '\uFF2D': 'M',
2333
- '\u1E3E': 'M',
2334
- '\u1E40': 'M',
2335
- '\u1E42': 'M',
2336
- '\u2C6E': 'M',
2337
- '\u019C': 'M',
2338
- '\u24C3': 'N',
2339
- '\uFF2E': 'N',
2340
- '\u01F8': 'N',
2341
- '\u0143': 'N',
2342
- '\u00D1': 'N',
2343
- '\u1E44': 'N',
2344
- '\u0147': 'N',
2345
- '\u1E46': 'N',
2346
- '\u0145': 'N',
2347
- '\u1E4A': 'N',
2348
- '\u1E48': 'N',
2349
- '\u0220': 'N',
2350
- '\u019D': 'N',
2351
- '\uA790': 'N',
2352
- '\uA7A4': 'N',
2353
- '\u01CA': 'NJ',
2354
- '\u01CB': 'Nj',
2355
- '\u24C4': 'O',
2356
- '\uFF2F': 'O',
2357
- '\u00D2': 'O',
2358
- '\u00D3': 'O',
2359
- '\u00D4': 'O',
2360
- '\u1ED2': 'O',
2361
- '\u1ED0': 'O',
2362
- '\u1ED6': 'O',
2363
- '\u1ED4': 'O',
2364
- '\u00D5': 'O',
2365
- '\u1E4C': 'O',
2366
- '\u022C': 'O',
2367
- '\u1E4E': 'O',
2368
- '\u014C': 'O',
2369
- '\u1E50': 'O',
2370
- '\u1E52': 'O',
2371
- '\u014E': 'O',
2372
- '\u022E': 'O',
2373
- '\u0230': 'O',
2374
- '\u00D6': 'O',
2375
- '\u022A': 'O',
2376
- '\u1ECE': 'O',
2377
- '\u0150': 'O',
2378
- '\u01D1': 'O',
2379
- '\u020C': 'O',
2380
- '\u020E': 'O',
2381
- '\u01A0': 'O',
2382
- '\u1EDC': 'O',
2383
- '\u1EDA': 'O',
2384
- '\u1EE0': 'O',
2385
- '\u1EDE': 'O',
2386
- '\u1EE2': 'O',
2387
- '\u1ECC': 'O',
2388
- '\u1ED8': 'O',
2389
- '\u01EA': 'O',
2390
- '\u01EC': 'O',
2391
- '\u00D8': 'O',
2392
- '\u01FE': 'O',
2393
- '\u0186': 'O',
2394
- '\u019F': 'O',
2395
- '\uA74A': 'O',
2396
- '\uA74C': 'O',
2397
- '\u01A2': 'OI',
2398
- '\uA74E': 'OO',
2399
- '\u0222': 'OU',
2400
- '\u24C5': 'P',
2401
- '\uFF30': 'P',
2402
- '\u1E54': 'P',
2403
- '\u1E56': 'P',
2404
- '\u01A4': 'P',
2405
- '\u2C63': 'P',
2406
- '\uA750': 'P',
2407
- '\uA752': 'P',
2408
- '\uA754': 'P',
2409
- '\u24C6': 'Q',
2410
- '\uFF31': 'Q',
2411
- '\uA756': 'Q',
2412
- '\uA758': 'Q',
2413
- '\u024A': 'Q',
2414
- '\u24C7': 'R',
2415
- '\uFF32': 'R',
2416
- '\u0154': 'R',
2417
- '\u1E58': 'R',
2418
- '\u0158': 'R',
2419
- '\u0210': 'R',
2420
- '\u0212': 'R',
2421
- '\u1E5A': 'R',
2422
- '\u1E5C': 'R',
2423
- '\u0156': 'R',
2424
- '\u1E5E': 'R',
2425
- '\u024C': 'R',
2426
- '\u2C64': 'R',
2427
- '\uA75A': 'R',
2428
- '\uA7A6': 'R',
2429
- '\uA782': 'R',
2430
- '\u24C8': 'S',
2431
- '\uFF33': 'S',
2432
- '\u1E9E': 'S',
2433
- '\u015A': 'S',
2434
- '\u1E64': 'S',
2435
- '\u015C': 'S',
2436
- '\u1E60': 'S',
2437
- '\u0160': 'S',
2438
- '\u1E66': 'S',
2439
- '\u1E62': 'S',
2440
- '\u1E68': 'S',
2441
- '\u0218': 'S',
2442
- '\u015E': 'S',
2443
- '\u2C7E': 'S',
2444
- '\uA7A8': 'S',
2445
- '\uA784': 'S',
2446
- '\u24C9': 'T',
2447
- '\uFF34': 'T',
2448
- '\u1E6A': 'T',
2449
- '\u0164': 'T',
2450
- '\u1E6C': 'T',
2451
- '\u021A': 'T',
2452
- '\u0162': 'T',
2453
- '\u1E70': 'T',
2454
- '\u1E6E': 'T',
2455
- '\u0166': 'T',
2456
- '\u01AC': 'T',
2457
- '\u01AE': 'T',
2458
- '\u023E': 'T',
2459
- '\uA786': 'T',
2460
- '\uA728': 'TZ',
2461
- '\u24CA': 'U',
2462
- '\uFF35': 'U',
2463
- '\u00D9': 'U',
2464
- '\u00DA': 'U',
2465
- '\u00DB': 'U',
2466
- '\u0168': 'U',
2467
- '\u1E78': 'U',
2468
- '\u016A': 'U',
2469
- '\u1E7A': 'U',
2470
- '\u016C': 'U',
2471
- '\u00DC': 'U',
2472
- '\u01DB': 'U',
2473
- '\u01D7': 'U',
2474
- '\u01D5': 'U',
2475
- '\u01D9': 'U',
2476
- '\u1EE6': 'U',
2477
- '\u016E': 'U',
2478
- '\u0170': 'U',
2479
- '\u01D3': 'U',
2480
- '\u0214': 'U',
2481
- '\u0216': 'U',
2482
- '\u01AF': 'U',
2483
- '\u1EEA': 'U',
2484
- '\u1EE8': 'U',
2485
- '\u1EEE': 'U',
2486
- '\u1EEC': 'U',
2487
- '\u1EF0': 'U',
2488
- '\u1EE4': 'U',
2489
- '\u1E72': 'U',
2490
- '\u0172': 'U',
2491
- '\u1E76': 'U',
2492
- '\u1E74': 'U',
2493
- '\u0244': 'U',
2494
- '\u24CB': 'V',
2495
- '\uFF36': 'V',
2496
- '\u1E7C': 'V',
2497
- '\u1E7E': 'V',
2498
- '\u01B2': 'V',
2499
- '\uA75E': 'V',
2500
- '\u0245': 'V',
2501
- '\uA760': 'VY',
2502
- '\u24CC': 'W',
2503
- '\uFF37': 'W',
2504
- '\u1E80': 'W',
2505
- '\u1E82': 'W',
2506
- '\u0174': 'W',
2507
- '\u1E86': 'W',
2508
- '\u1E84': 'W',
2509
- '\u1E88': 'W',
2510
- '\u2C72': 'W',
2511
- '\u24CD': 'X',
2512
- '\uFF38': 'X',
2513
- '\u1E8A': 'X',
2514
- '\u1E8C': 'X',
2515
- '\u24CE': 'Y',
2516
- '\uFF39': 'Y',
2517
- '\u1EF2': 'Y',
2518
- '\u00DD': 'Y',
2519
- '\u0176': 'Y',
2520
- '\u1EF8': 'Y',
2521
- '\u0232': 'Y',
2522
- '\u1E8E': 'Y',
2523
- '\u0178': 'Y',
2524
- '\u1EF6': 'Y',
2525
- '\u1EF4': 'Y',
2526
- '\u01B3': 'Y',
2527
- '\u024E': 'Y',
2528
- '\u1EFE': 'Y',
2529
- '\u24CF': 'Z',
2530
- '\uFF3A': 'Z',
2531
- '\u0179': 'Z',
2532
- '\u1E90': 'Z',
2533
- '\u017B': 'Z',
2534
- '\u017D': 'Z',
2535
- '\u1E92': 'Z',
2536
- '\u1E94': 'Z',
2537
- '\u01B5': 'Z',
2538
- '\u0224': 'Z',
2539
- '\u2C7F': 'Z',
2540
- '\u2C6B': 'Z',
2541
- '\uA762': 'Z',
2542
- '\u24D0': 'a',
2543
- '\uFF41': 'a',
2544
- '\u1E9A': 'a',
2545
- '\u00E0': 'a',
2546
- '\u00E1': 'a',
2547
- '\u00E2': 'a',
2548
- '\u1EA7': 'a',
2549
- '\u1EA5': 'a',
2550
- '\u1EAB': 'a',
2551
- '\u1EA9': 'a',
2552
- '\u00E3': 'a',
2553
- '\u0101': 'a',
2554
- '\u0103': 'a',
2555
- '\u1EB1': 'a',
2556
- '\u1EAF': 'a',
2557
- '\u1EB5': 'a',
2558
- '\u1EB3': 'a',
2559
- '\u0227': 'a',
2560
- '\u01E1': 'a',
2561
- '\u00E4': 'a',
2562
- '\u01DF': 'a',
2563
- '\u1EA3': 'a',
2564
- '\u00E5': 'a',
2565
- '\u01FB': 'a',
2566
- '\u01CE': 'a',
2567
- '\u0201': 'a',
2568
- '\u0203': 'a',
2569
- '\u1EA1': 'a',
2570
- '\u1EAD': 'a',
2571
- '\u1EB7': 'a',
2572
- '\u1E01': 'a',
2573
- '\u0105': 'a',
2574
- '\u2C65': 'a',
2575
- '\u0250': 'a',
2576
- '\uA733': 'aa',
2577
- '\u00E6': 'ae',
2578
- '\u01FD': 'ae',
2579
- '\u01E3': 'ae',
2580
- '\uA735': 'ao',
2581
- '\uA737': 'au',
2582
- '\uA739': 'av',
2583
- '\uA73B': 'av',
2584
- '\uA73D': 'ay',
2585
- '\u24D1': 'b',
2586
- '\uFF42': 'b',
2587
- '\u1E03': 'b',
2588
- '\u1E05': 'b',
2589
- '\u1E07': 'b',
2590
- '\u0180': 'b',
2591
- '\u0183': 'b',
2592
- '\u0253': 'b',
2593
- '\u24D2': 'c',
2594
- '\uFF43': 'c',
2595
- '\u0107': 'c',
2596
- '\u0109': 'c',
2597
- '\u010B': 'c',
2598
- '\u010D': 'c',
2599
- '\u00E7': 'c',
2600
- '\u1E09': 'c',
2601
- '\u0188': 'c',
2602
- '\u023C': 'c',
2603
- '\uA73F': 'c',
2604
- '\u2184': 'c',
2605
- '\u24D3': 'd',
2606
- '\uFF44': 'd',
2607
- '\u1E0B': 'd',
2608
- '\u010F': 'd',
2609
- '\u1E0D': 'd',
2610
- '\u1E11': 'd',
2611
- '\u1E13': 'd',
2612
- '\u1E0F': 'd',
2613
- '\u0111': 'd',
2614
- '\u018C': 'd',
2615
- '\u0256': 'd',
2616
- '\u0257': 'd',
2617
- '\uA77A': 'd',
2618
- '\u01F3': 'dz',
2619
- '\u01C6': 'dz',
2620
- '\u24D4': 'e',
2621
- '\uFF45': 'e',
2622
- '\u00E8': 'e',
2623
- '\u00E9': 'e',
2624
- '\u00EA': 'e',
2625
- '\u1EC1': 'e',
2626
- '\u1EBF': 'e',
2627
- '\u1EC5': 'e',
2628
- '\u1EC3': 'e',
2629
- '\u1EBD': 'e',
2630
- '\u0113': 'e',
2631
- '\u1E15': 'e',
2632
- '\u1E17': 'e',
2633
- '\u0115': 'e',
2634
- '\u0117': 'e',
2635
- '\u00EB': 'e',
2636
- '\u1EBB': 'e',
2637
- '\u011B': 'e',
2638
- '\u0205': 'e',
2639
- '\u0207': 'e',
2640
- '\u1EB9': 'e',
2641
- '\u1EC7': 'e',
2642
- '\u0229': 'e',
2643
- '\u1E1D': 'e',
2644
- '\u0119': 'e',
2645
- '\u1E19': 'e',
2646
- '\u1E1B': 'e',
2647
- '\u0247': 'e',
2648
- '\u025B': 'e',
2649
- '\u01DD': 'e',
2650
- '\u24D5': 'f',
2651
- '\uFF46': 'f',
2652
- '\u1E1F': 'f',
2653
- '\u0192': 'f',
2654
- '\uA77C': 'f',
2655
- '\u24D6': 'g',
2656
- '\uFF47': 'g',
2657
- '\u01F5': 'g',
2658
- '\u011D': 'g',
2659
- '\u1E21': 'g',
2660
- '\u011F': 'g',
2661
- '\u0121': 'g',
2662
- '\u01E7': 'g',
2663
- '\u0123': 'g',
2664
- '\u01E5': 'g',
2665
- '\u0260': 'g',
2666
- '\uA7A1': 'g',
2667
- '\u1D79': 'g',
2668
- '\uA77F': 'g',
2669
- '\u24D7': 'h',
2670
- '\uFF48': 'h',
2671
- '\u0125': 'h',
2672
- '\u1E23': 'h',
2673
- '\u1E27': 'h',
2674
- '\u021F': 'h',
2675
- '\u1E25': 'h',
2676
- '\u1E29': 'h',
2677
- '\u1E2B': 'h',
2678
- '\u1E96': 'h',
2679
- '\u0127': 'h',
2680
- '\u2C68': 'h',
2681
- '\u2C76': 'h',
2682
- '\u0265': 'h',
2683
- '\u0195': 'hv',
2684
- '\u24D8': 'i',
2685
- '\uFF49': 'i',
2686
- '\u00EC': 'i',
2687
- '\u00ED': 'i',
2688
- '\u00EE': 'i',
2689
- '\u0129': 'i',
2690
- '\u012B': 'i',
2691
- '\u012D': 'i',
2692
- '\u00EF': 'i',
2693
- '\u1E2F': 'i',
2694
- '\u1EC9': 'i',
2695
- '\u01D0': 'i',
2696
- '\u0209': 'i',
2697
- '\u020B': 'i',
2698
- '\u1ECB': 'i',
2699
- '\u012F': 'i',
2700
- '\u1E2D': 'i',
2701
- '\u0268': 'i',
2702
- '\u0131': 'i',
2703
- '\u24D9': 'j',
2704
- '\uFF4A': 'j',
2705
- '\u0135': 'j',
2706
- '\u01F0': 'j',
2707
- '\u0249': 'j',
2708
- '\u24DA': 'k',
2709
- '\uFF4B': 'k',
2710
- '\u1E31': 'k',
2711
- '\u01E9': 'k',
2712
- '\u1E33': 'k',
2713
- '\u0137': 'k',
2714
- '\u1E35': 'k',
2715
- '\u0199': 'k',
2716
- '\u2C6A': 'k',
2717
- '\uA741': 'k',
2718
- '\uA743': 'k',
2719
- '\uA745': 'k',
2720
- '\uA7A3': 'k',
2721
- '\u24DB': 'l',
2722
- '\uFF4C': 'l',
2723
- '\u0140': 'l',
2724
- '\u013A': 'l',
2725
- '\u013E': 'l',
2726
- '\u1E37': 'l',
2727
- '\u1E39': 'l',
2728
- '\u013C': 'l',
2729
- '\u1E3D': 'l',
2730
- '\u1E3B': 'l',
2731
- '\u017F': 'l',
2732
- '\u0142': 'l',
2733
- '\u019A': 'l',
2734
- '\u026B': 'l',
2735
- '\u2C61': 'l',
2736
- '\uA749': 'l',
2737
- '\uA781': 'l',
2738
- '\uA747': 'l',
2739
- '\u01C9': 'lj',
2740
- '\u24DC': 'm',
2741
- '\uFF4D': 'm',
2742
- '\u1E3F': 'm',
2743
- '\u1E41': 'm',
2744
- '\u1E43': 'm',
2745
- '\u0271': 'm',
2746
- '\u026F': 'm',
2747
- '\u24DD': 'n',
2748
- '\uFF4E': 'n',
2749
- '\u01F9': 'n',
2750
- '\u0144': 'n',
2751
- '\u00F1': 'n',
2752
- '\u1E45': 'n',
2753
- '\u0148': 'n',
2754
- '\u1E47': 'n',
2755
- '\u0146': 'n',
2756
- '\u1E4B': 'n',
2757
- '\u1E49': 'n',
2758
- '\u019E': 'n',
2759
- '\u0272': 'n',
2760
- '\u0149': 'n',
2761
- '\uA791': 'n',
2762
- '\uA7A5': 'n',
2763
- '\u01CC': 'nj',
2764
- '\u24DE': 'o',
2765
- '\uFF4F': 'o',
2766
- '\u00F2': 'o',
2767
- '\u00F3': 'o',
2768
- '\u00F4': 'o',
2769
- '\u1ED3': 'o',
2770
- '\u1ED1': 'o',
2771
- '\u1ED7': 'o',
2772
- '\u1ED5': 'o',
2773
- '\u00F5': 'o',
2774
- '\u1E4D': 'o',
2775
- '\u022D': 'o',
2776
- '\u1E4F': 'o',
2777
- '\u014D': 'o',
2778
- '\u1E51': 'o',
2779
- '\u1E53': 'o',
2780
- '\u014F': 'o',
2781
- '\u022F': 'o',
2782
- '\u0231': 'o',
2783
- '\u00F6': 'o',
2784
- '\u022B': 'o',
2785
- '\u1ECF': 'o',
2786
- '\u0151': 'o',
2787
- '\u01D2': 'o',
2788
- '\u020D': 'o',
2789
- '\u020F': 'o',
2790
- '\u01A1': 'o',
2791
- '\u1EDD': 'o',
2792
- '\u1EDB': 'o',
2793
- '\u1EE1': 'o',
2794
- '\u1EDF': 'o',
2795
- '\u1EE3': 'o',
2796
- '\u1ECD': 'o',
2797
- '\u1ED9': 'o',
2798
- '\u01EB': 'o',
2799
- '\u01ED': 'o',
2800
- '\u00F8': 'o',
2801
- '\u01FF': 'o',
2802
- '\u0254': 'o',
2803
- '\uA74B': 'o',
2804
- '\uA74D': 'o',
2805
- '\u0275': 'o',
2806
- '\u01A3': 'oi',
2807
- '\u0223': 'ou',
2808
- '\uA74F': 'oo',
2809
- '\u24DF': 'p',
2810
- '\uFF50': 'p',
2811
- '\u1E55': 'p',
2812
- '\u1E57': 'p',
2813
- '\u01A5': 'p',
2814
- '\u1D7D': 'p',
2815
- '\uA751': 'p',
2816
- '\uA753': 'p',
2817
- '\uA755': 'p',
2818
- '\u24E0': 'q',
2819
- '\uFF51': 'q',
2820
- '\u024B': 'q',
2821
- '\uA757': 'q',
2822
- '\uA759': 'q',
2823
- '\u24E1': 'r',
2824
- '\uFF52': 'r',
2825
- '\u0155': 'r',
2826
- '\u1E59': 'r',
2827
- '\u0159': 'r',
2828
- '\u0211': 'r',
2829
- '\u0213': 'r',
2830
- '\u1E5B': 'r',
2831
- '\u1E5D': 'r',
2832
- '\u0157': 'r',
2833
- '\u1E5F': 'r',
2834
- '\u024D': 'r',
2835
- '\u027D': 'r',
2836
- '\uA75B': 'r',
2837
- '\uA7A7': 'r',
2838
- '\uA783': 'r',
2839
- '\u24E2': 's',
2840
- '\uFF53': 's',
2841
- '\u00DF': 's',
2842
- '\u015B': 's',
2843
- '\u1E65': 's',
2844
- '\u015D': 's',
2845
- '\u1E61': 's',
2846
- '\u0161': 's',
2847
- '\u1E67': 's',
2848
- '\u1E63': 's',
2849
- '\u1E69': 's',
2850
- '\u0219': 's',
2851
- '\u015F': 's',
2852
- '\u023F': 's',
2853
- '\uA7A9': 's',
2854
- '\uA785': 's',
2855
- '\u1E9B': 's',
2856
- '\u24E3': 't',
2857
- '\uFF54': 't',
2858
- '\u1E6B': 't',
2859
- '\u1E97': 't',
2860
- '\u0165': 't',
2861
- '\u1E6D': 't',
2862
- '\u021B': 't',
2863
- '\u0163': 't',
2864
- '\u1E71': 't',
2865
- '\u1E6F': 't',
2866
- '\u0167': 't',
2867
- '\u01AD': 't',
2868
- '\u0288': 't',
2869
- '\u2C66': 't',
2870
- '\uA787': 't',
2871
- '\uA729': 'tz',
2872
- '\u24E4': 'u',
2873
- '\uFF55': 'u',
2874
- '\u00F9': 'u',
2875
- '\u00FA': 'u',
2876
- '\u00FB': 'u',
2877
- '\u0169': 'u',
2878
- '\u1E79': 'u',
2879
- '\u016B': 'u',
2880
- '\u1E7B': 'u',
2881
- '\u016D': 'u',
2882
- '\u00FC': 'u',
2883
- '\u01DC': 'u',
2884
- '\u01D8': 'u',
2885
- '\u01D6': 'u',
2886
- '\u01DA': 'u',
2887
- '\u1EE7': 'u',
2888
- '\u016F': 'u',
2889
- '\u0171': 'u',
2890
- '\u01D4': 'u',
2891
- '\u0215': 'u',
2892
- '\u0217': 'u',
2893
- '\u01B0': 'u',
2894
- '\u1EEB': 'u',
2895
- '\u1EE9': 'u',
2896
- '\u1EEF': 'u',
2897
- '\u1EED': 'u',
2898
- '\u1EF1': 'u',
2899
- '\u1EE5': 'u',
2900
- '\u1E73': 'u',
2901
- '\u0173': 'u',
2902
- '\u1E77': 'u',
2903
- '\u1E75': 'u',
2904
- '\u0289': 'u',
2905
- '\u24E5': 'v',
2906
- '\uFF56': 'v',
2907
- '\u1E7D': 'v',
2908
- '\u1E7F': 'v',
2909
- '\u028B': 'v',
2910
- '\uA75F': 'v',
2911
- '\u028C': 'v',
2912
- '\uA761': 'vy',
2913
- '\u24E6': 'w',
2914
- '\uFF57': 'w',
2915
- '\u1E81': 'w',
2916
- '\u1E83': 'w',
2917
- '\u0175': 'w',
2918
- '\u1E87': 'w',
2919
- '\u1E85': 'w',
2920
- '\u1E98': 'w',
2921
- '\u1E89': 'w',
2922
- '\u2C73': 'w',
2923
- '\u24E7': 'x',
2924
- '\uFF58': 'x',
2925
- '\u1E8B': 'x',
2926
- '\u1E8D': 'x',
2927
- '\u24E8': 'y',
2928
- '\uFF59': 'y',
2929
- '\u1EF3': 'y',
2930
- '\u00FD': 'y',
2931
- '\u0177': 'y',
2932
- '\u1EF9': 'y',
2933
- '\u0233': 'y',
2934
- '\u1E8F': 'y',
2935
- '\u00FF': 'y',
2936
- '\u1EF7': 'y',
2937
- '\u1E99': 'y',
2938
- '\u1EF5': 'y',
2939
- '\u01B4': 'y',
2940
- '\u024F': 'y',
2941
- '\u1EFF': 'y',
2942
- '\u24E9': 'z',
2943
- '\uFF5A': 'z',
2944
- '\u017A': 'z',
2945
- '\u1E91': 'z',
2946
- '\u017C': 'z',
2947
- '\u017E': 'z',
2948
- '\u1E93': 'z',
2949
- '\u1E95': 'z',
2950
- '\u01B6': 'z',
2951
- '\u0225': 'z',
2952
- '\u0240': 'z',
2953
- '\u2C6C': 'z',
2954
- '\uA763': 'z',
2955
- '\u0386': '\u0391',
2956
- '\u0388': '\u0395',
2957
- '\u0389': '\u0397',
2958
- '\u038A': '\u0399',
2959
- '\u03AA': '\u0399',
2960
- '\u038C': '\u039F',
2961
- '\u038E': '\u03A5',
2962
- '\u03AB': '\u03A5',
2963
- '\u038F': '\u03A9',
2964
- '\u03AC': '\u03B1',
2965
- '\u03AD': '\u03B5',
2966
- '\u03AE': '\u03B7',
2967
- '\u03AF': '\u03B9',
2968
- '\u03CA': '\u03B9',
2969
- '\u0390': '\u03B9',
2970
- '\u03CC': '\u03BF',
2971
- '\u03CD': '\u03C5',
2972
- '\u03CB': '\u03C5',
2973
- '\u03B0': '\u03C5',
2974
- '\u03C9': '\u03C9',
2975
- '\u03C2': '\u03C3'
2976
- };
2977
-
2978
- return diacritics;
2979
- });
2980
-
2981
- S2.define('select2/data/base',[
2982
- '../utils'
2983
- ], function (Utils) {
2984
- function BaseAdapter ($element, options) {
2985
- BaseAdapter.__super__.constructor.call(this);
2986
- }
2987
-
2988
- Utils.Extend(BaseAdapter, Utils.Observable);
2989
-
2990
- BaseAdapter.prototype.current = function (callback) {
2991
- throw new Error('The `current` method must be defined in child classes.');
2992
- };
2993
-
2994
- BaseAdapter.prototype.query = function (params, callback) {
2995
- throw new Error('The `query` method must be defined in child classes.');
2996
- };
2997
-
2998
- BaseAdapter.prototype.bind = function (container, $container) {
2999
- // Can be implemented in subclasses
3000
- };
3001
-
3002
- BaseAdapter.prototype.destroy = function () {
3003
- // Can be implemented in subclasses
3004
- };
3005
-
3006
- BaseAdapter.prototype.generateResultId = function (container, data) {
3007
- var id = container.id + '-result-';
3008
-
3009
- id += Utils.generateChars(4);
3010
-
3011
- if (data.id != null) {
3012
- id += '-' + data.id.toString();
3013
- } else {
3014
- id += '-' + Utils.generateChars(4);
3015
- }
3016
- return id;
3017
- };
3018
-
3019
- return BaseAdapter;
3020
- });
3021
-
3022
- S2.define('select2/data/select',[
3023
- './base',
3024
- '../utils',
3025
- 'jquery'
3026
- ], function (BaseAdapter, Utils, $) {
3027
- function SelectAdapter ($element, options) {
3028
- this.$element = $element;
3029
- this.options = options;
3030
-
3031
- SelectAdapter.__super__.constructor.call(this);
3032
- }
3033
-
3034
- Utils.Extend(SelectAdapter, BaseAdapter);
3035
-
3036
- SelectAdapter.prototype.current = function (callback) {
3037
- var data = [];
3038
- var self = this;
3039
-
3040
- this.$element.find(':selected').each(function () {
3041
- var $option = $(this);
3042
-
3043
- var option = self.item($option);
3044
-
3045
- data.push(option);
3046
- });
3047
-
3048
- callback(data);
3049
- };
3050
-
3051
- SelectAdapter.prototype.select = function (data) {
3052
- var self = this;
3053
-
3054
- data.selected = true;
3055
-
3056
- // If data.element is a DOM node, use it instead
3057
- if ($(data.element).is('option')) {
3058
- data.element.selected = true;
3059
-
3060
- this.$element.trigger('change');
3061
-
3062
- return;
3063
- }
3064
-
3065
- if (this.$element.prop('multiple')) {
3066
- this.current(function (currentData) {
3067
- var val = [];
3068
-
3069
- data = [data];
3070
- data.push.apply(data, currentData);
3071
-
3072
- for (var d = 0; d < data.length; d++) {
3073
- var id = data[d].id;
3074
-
3075
- if ($.inArray(id, val) === -1) {
3076
- val.push(id);
3077
- }
3078
- }
3079
-
3080
- self.$element.val(val);
3081
- self.$element.trigger('change');
3082
- });
3083
- } else {
3084
- var val = data.id;
3085
-
3086
- this.$element.val(val);
3087
- this.$element.trigger('change');
3088
- }
3089
- };
3090
-
3091
- SelectAdapter.prototype.unselect = function (data) {
3092
- var self = this;
3093
-
3094
- if (!this.$element.prop('multiple')) {
3095
- return;
3096
- }
3097
-
3098
- data.selected = false;
3099
-
3100
- if ($(data.element).is('option')) {
3101
- data.element.selected = false;
3102
-
3103
- this.$element.trigger('change');
3104
-
3105
- return;
3106
- }
3107
-
3108
- this.current(function (currentData) {
3109
- var val = [];
3110
-
3111
- for (var d = 0; d < currentData.length; d++) {
3112
- var id = currentData[d].id;
3113
-
3114
- if (id !== data.id && $.inArray(id, val) === -1) {
3115
- val.push(id);
3116
- }
3117
- }
3118
-
3119
- self.$element.val(val);
3120
-
3121
- self.$element.trigger('change');
3122
- });
3123
- };
3124
-
3125
- SelectAdapter.prototype.bind = function (container, $container) {
3126
- var self = this;
3127
-
3128
- this.container = container;
3129
-
3130
- container.on('select', function (params) {
3131
- self.select(params.data);
3132
- });
3133
-
3134
- container.on('unselect', function (params) {
3135
- self.unselect(params.data);
3136
- });
3137
- };
3138
-
3139
- SelectAdapter.prototype.destroy = function () {
3140
- // Remove anything added to child elements
3141
- this.$element.find('*').each(function () {
3142
- // Remove any custom data set by Select2
3143
- $.removeData(this, 'data');
3144
- });
3145
- };
3146
-
3147
- SelectAdapter.prototype.query = function (params, callback) {
3148
- var data = [];
3149
- var self = this;
3150
-
3151
- var $options = this.$element.children();
3152
-
3153
- $options.each(function () {
3154
- var $option = $(this);
3155
-
3156
- if (!$option.is('option') && !$option.is('optgroup')) {
3157
- return;
3158
- }
3159
-
3160
- var option = self.item($option);
3161
-
3162
- var matches = self.matches(params, option);
3163
-
3164
- if (matches !== null) {
3165
- data.push(matches);
3166
- }
3167
- });
3168
-
3169
- callback({
3170
- results: data
3171
- });
3172
- };
3173
-
3174
- SelectAdapter.prototype.addOptions = function ($options) {
3175
- Utils.appendMany(this.$element, $options);
3176
- };
3177
-
3178
- SelectAdapter.prototype.option = function (data) {
3179
- var option;
3180
-
3181
- if (data.children) {
3182
- option = document.createElement('optgroup');
3183
- option.label = data.text;
3184
- } else {
3185
- option = document.createElement('option');
3186
-
3187
- if (option.textContent !== undefined) {
3188
- option.textContent = data.text;
3189
- } else {
3190
- option.innerText = data.text;
3191
- }
3192
- }
3193
-
3194
- if (data.id) {
3195
- option.value = data.id;
3196
- }
3197
-
3198
- if (data.disabled) {
3199
- option.disabled = true;
3200
- }
3201
-
3202
- if (data.selected) {
3203
- option.selected = true;
3204
- }
3205
-
3206
- if (data.title) {
3207
- option.title = data.title;
3208
- }
3209
-
3210
- var $option = $(option);
3211
-
3212
- var normalizedData = this._normalizeItem(data);
3213
- normalizedData.element = option;
3214
-
3215
- // Override the option's data with the combined data
3216
- $.data(option, 'data', normalizedData);
3217
-
3218
- return $option;
3219
- };
3220
-
3221
- SelectAdapter.prototype.item = function ($option) {
3222
- var data = {};
3223
-
3224
- data = $.data($option[0], 'data');
3225
-
3226
- if (data != null) {
3227
- return data;
3228
- }
3229
-
3230
- if ($option.is('option')) {
3231
- data = {
3232
- id: $option.val(),
3233
- text: $option.text(),
3234
- disabled: $option.prop('disabled'),
3235
- selected: $option.prop('selected'),
3236
- title: $option.prop('title')
3237
- };
3238
- } else if ($option.is('optgroup')) {
3239
- data = {
3240
- text: $option.prop('label'),
3241
- children: [],
3242
- title: $option.prop('title')
3243
- };
3244
-
3245
- var $children = $option.children('option');
3246
- var children = [];
3247
-
3248
- for (var c = 0; c < $children.length; c++) {
3249
- var $child = $($children[c]);
3250
-
3251
- var child = this.item($child);
3252
-
3253
- children.push(child);
3254
- }
3255
-
3256
- data.children = children;
3257
- }
3258
-
3259
- data = this._normalizeItem(data);
3260
- data.element = $option[0];
3261
-
3262
- $.data($option[0], 'data', data);
3263
-
3264
- return data;
3265
- };
3266
-
3267
- SelectAdapter.prototype._normalizeItem = function (item) {
3268
- if (!$.isPlainObject(item)) {
3269
- item = {
3270
- id: item,
3271
- text: item
3272
- };
3273
- }
3274
-
3275
- item = $.extend({}, {
3276
- text: ''
3277
- }, item);
3278
-
3279
- var defaults = {
3280
- selected: false,
3281
- disabled: false
3282
- };
3283
-
3284
- if (item.id != null) {
3285
- item.id = item.id.toString();
3286
- }
3287
-
3288
- if (item.text != null) {
3289
- item.text = item.text.toString();
3290
- }
3291
-
3292
- if (item._resultId == null && item.id && this.container != null) {
3293
- item._resultId = this.generateResultId(this.container, item);
3294
- }
3295
-
3296
- return $.extend({}, defaults, item);
3297
- };
3298
-
3299
- SelectAdapter.prototype.matches = function (params, data) {
3300
- var matcher = this.options.get('matcher');
3301
-
3302
- return matcher(params, data);
3303
- };
3304
-
3305
- return SelectAdapter;
3306
- });
3307
-
3308
- S2.define('select2/data/array',[
3309
- './select',
3310
- '../utils',
3311
- 'jquery'
3312
- ], function (SelectAdapter, Utils, $) {
3313
- function ArrayAdapter ($element, options) {
3314
- var data = options.get('data') || [];
3315
-
3316
- ArrayAdapter.__super__.constructor.call(this, $element, options);
3317
-
3318
- this.addOptions(this.convertToOptions(data));
3319
- }
3320
-
3321
- Utils.Extend(ArrayAdapter, SelectAdapter);
3322
-
3323
- ArrayAdapter.prototype.select = function (data) {
3324
- var $option = this.$element.find('option').filter(function (i, elm) {
3325
- return elm.value == data.id.toString();
3326
- });
3327
-
3328
- if ($option.length === 0) {
3329
- $option = this.option(data);
3330
-
3331
- this.addOptions($option);
3332
- }
3333
-
3334
- ArrayAdapter.__super__.select.call(this, data);
3335
- };
3336
-
3337
- ArrayAdapter.prototype.convertToOptions = function (data) {
3338
- var self = this;
3339
-
3340
- var $existing = this.$element.find('option');
3341
- var existingIds = $existing.map(function () {
3342
- return self.item($(this)).id;
3343
- }).get();
3344
-
3345
- var $options = [];
3346
-
3347
- // Filter out all items except for the one passed in the argument
3348
- function onlyItem (item) {
3349
- return function () {
3350
- return $(this).val() == item.id;
3351
- };
3352
- }
3353
-
3354
- for (var d = 0; d < data.length; d++) {
3355
- var item = this._normalizeItem(data[d]);
3356
-
3357
- // Skip items which were pre-loaded, only merge the data
3358
- if ($.inArray(item.id, existingIds) >= 0) {
3359
- var $existingOption = $existing.filter(onlyItem(item));
3360
-
3361
- var existingData = this.item($existingOption);
3362
- var newData = $.extend(true, {}, item, existingData);
3363
-
3364
- var $newOption = this.option(newData);
3365
-
3366
- $existingOption.replaceWith($newOption);
3367
-
3368
- continue;
3369
- }
3370
-
3371
- var $option = this.option(item);
3372
-
3373
- if (item.children) {
3374
- var $children = this.convertToOptions(item.children);
3375
-
3376
- Utils.appendMany($option, $children);
3377
- }
3378
-
3379
- $options.push($option);
3380
- }
3381
-
3382
- return $options;
3383
- };
3384
-
3385
- return ArrayAdapter;
3386
- });
3387
-
3388
- S2.define('select2/data/ajax',[
3389
- './array',
3390
- '../utils',
3391
- 'jquery'
3392
- ], function (ArrayAdapter, Utils, $) {
3393
- function AjaxAdapter ($element, options) {
3394
- this.ajaxOptions = this._applyDefaults(options.get('ajax'));
3395
-
3396
- if (this.ajaxOptions.processResults != null) {
3397
- this.processResults = this.ajaxOptions.processResults;
3398
- }
3399
-
3400
- AjaxAdapter.__super__.constructor.call(this, $element, options);
3401
- }
3402
-
3403
- Utils.Extend(AjaxAdapter, ArrayAdapter);
3404
-
3405
- AjaxAdapter.prototype._applyDefaults = function (options) {
3406
- var defaults = {
3407
- data: function (params) {
3408
- return $.extend({}, params, {
3409
- q: params.term
3410
- });
3411
- },
3412
- transport: function (params, success, failure) {
3413
- var $request = $.ajax(params);
3414
-
3415
- $request.then(success);
3416
- $request.fail(failure);
3417
-
3418
- return $request;
3419
- }
3420
- };
3421
-
3422
- return $.extend({}, defaults, options, true);
3423
- };
3424
-
3425
- AjaxAdapter.prototype.processResults = function (results) {
3426
- return results;
3427
- };
3428
-
3429
- AjaxAdapter.prototype.query = function (params, callback) {
3430
- var matches = [];
3431
- var self = this;
3432
-
3433
- if (this._request != null) {
3434
- // JSONP requests cannot always be aborted
3435
- if ($.isFunction(this._request.abort)) {
3436
- this._request.abort();
3437
- }
3438
-
3439
- this._request = null;
3440
- }
3441
-
3442
- var options = $.extend({
3443
- type: 'GET'
3444
- }, this.ajaxOptions);
3445
-
3446
- if (typeof options.url === 'function') {
3447
- options.url = options.url.call(this.$element, params);
3448
- }
3449
-
3450
- if (typeof options.data === 'function') {
3451
- options.data = options.data.call(this.$element, params);
3452
- }
3453
-
3454
- function request () {
3455
- var $request = options.transport(options, function (data) {
3456
- var results = self.processResults(data, params);
3457
-
3458
- if (self.options.get('debug') && window.console && console.error) {
3459
- // Check to make sure that the response included a `results` key.
3460
- if (!results || !results.results || !$.isArray(results.results)) {
3461
- console.error(
3462
- 'Select2: The AJAX results did not return an array in the ' +
3463
- '`results` key of the response.'
3464
- );
3465
- }
3466
- }
3467
-
3468
- callback(results);
3469
- }, function () {
3470
- // Attempt to detect if a request was aborted
3471
- // Only works if the transport exposes a status property
3472
- if ($request.status && $request.status === '0') {
3473
- return;
3474
- }
3475
-
3476
- self.trigger('results:message', {
3477
- message: 'errorLoading'
3478
- });
3479
- });
3480
-
3481
- self._request = $request;
3482
- }
3483
-
3484
- if (this.ajaxOptions.delay && params.term != null) {
3485
- if (this._queryTimeout) {
3486
- window.clearTimeout(this._queryTimeout);
3487
- }
3488
-
3489
- this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
3490
- } else {
3491
- request();
3492
- }
3493
- };
3494
-
3495
- return AjaxAdapter;
3496
- });
3497
-
3498
- S2.define('select2/data/tags',[
3499
- 'jquery'
3500
- ], function ($) {
3501
- function Tags (decorated, $element, options) {
3502
- var tags = options.get('tags');
3503
-
3504
- var createTag = options.get('createTag');
3505
-
3506
- if (createTag !== undefined) {
3507
- this.createTag = createTag;
3508
- }
3509
-
3510
- var insertTag = options.get('insertTag');
3511
-
3512
- if (insertTag !== undefined) {
3513
- this.insertTag = insertTag;
3514
- }
3515
-
3516
- decorated.call(this, $element, options);
3517
-
3518
- if ($.isArray(tags)) {
3519
- for (var t = 0; t < tags.length; t++) {
3520
- var tag = tags[t];
3521
- var item = this._normalizeItem(tag);
3522
-
3523
- var $option = this.option(item);
3524
-
3525
- this.$element.append($option);
3526
- }
3527
- }
3528
- }
3529
-
3530
- Tags.prototype.query = function (decorated, params, callback) {
3531
- var self = this;
3532
-
3533
- this._removeOldTags();
3534
-
3535
- if (params.term == null || params.page != null) {
3536
- decorated.call(this, params, callback);
3537
- return;
3538
- }
3539
-
3540
- function wrapper (obj, child) {
3541
- var data = obj.results;
3542
-
3543
- for (var i = 0; i < data.length; i++) {
3544
- var option = data[i];
3545
-
3546
- var checkChildren = (
3547
- option.children != null &&
3548
- !wrapper({
3549
- results: option.children
3550
- }, true)
3551
- );
3552
-
3553
- var checkText = option.text === params.term;
3554
-
3555
- if (checkText || checkChildren) {
3556
- if (child) {
3557
- return false;
3558
- }
3559
-
3560
- obj.data = data;
3561
- callback(obj);
3562
-
3563
- return;
3564
- }
3565
- }
3566
-
3567
- if (child) {
3568
- return true;
3569
- }
3570
-
3571
- var tag = self.createTag(params);
3572
-
3573
- if (tag != null) {
3574
- var $option = self.option(tag);
3575
- $option.attr('data-select2-tag', true);
3576
-
3577
- self.addOptions([$option]);
3578
-
3579
- self.insertTag(data, tag);
3580
- }
3581
-
3582
- obj.results = data;
3583
-
3584
- callback(obj);
3585
- }
3586
-
3587
- decorated.call(this, params, wrapper);
3588
- };
3589
-
3590
- Tags.prototype.createTag = function (decorated, params) {
3591
- var term = $.trim(params.term);
3592
-
3593
- if (term === '') {
3594
- return null;
3595
- }
3596
-
3597
- return {
3598
- id: term,
3599
- text: term
3600
- };
3601
- };
3602
-
3603
- Tags.prototype.insertTag = function (_, data, tag) {
3604
- data.unshift(tag);
3605
- };
3606
-
3607
- Tags.prototype._removeOldTags = function (_) {
3608
- var tag = this._lastTag;
3609
-
3610
- var $options = this.$element.find('option[data-select2-tag]');
3611
-
3612
- $options.each(function () {
3613
- if (this.selected) {
3614
- return;
3615
- }
3616
-
3617
- $(this).remove();
3618
- });
3619
- };
3620
-
3621
- return Tags;
3622
- });
3623
-
3624
- S2.define('select2/data/tokenizer',[
3625
- 'jquery'
3626
- ], function ($) {
3627
- function Tokenizer (decorated, $element, options) {
3628
- var tokenizer = options.get('tokenizer');
3629
-
3630
- if (tokenizer !== undefined) {
3631
- this.tokenizer = tokenizer;
3632
- }
3633
-
3634
- decorated.call(this, $element, options);
3635
- }
3636
-
3637
- Tokenizer.prototype.bind = function (decorated, container, $container) {
3638
- decorated.call(this, container, $container);
3639
-
3640
- this.$search = container.dropdown.$search || container.selection.$search ||
3641
- $container.find('.select2-search__field');
3642
- };
3643
-
3644
- Tokenizer.prototype.query = function (decorated, params, callback) {
3645
- var self = this;
3646
-
3647
- function createAndSelect (data) {
3648
- // Normalize the data object so we can use it for checks
3649
- var item = self._normalizeItem(data);
3650
-
3651
- // Check if the data object already exists as a tag
3652
- // Select it if it doesn't
3653
- var $existingOptions = self.$element.find('option').filter(function () {
3654
- return $(this).val() === item.id;
3655
- });
3656
-
3657
- // If an existing option wasn't found for it, create the option
3658
- if (!$existingOptions.length) {
3659
- var $option = self.option(item);
3660
- $option.attr('data-select2-tag', true);
3661
-
3662
- self._removeOldTags();
3663
- self.addOptions([$option]);
3664
- }
3665
-
3666
- // Select the item, now that we know there is an option for it
3667
- select(item);
3668
- }
3669
-
3670
- function select (data) {
3671
- self.trigger('select', {
3672
- data: data
3673
- });
3674
- }
3675
-
3676
- params.term = params.term || '';
3677
-
3678
- var tokenData = this.tokenizer(params, this.options, createAndSelect);
3679
-
3680
- if (tokenData.term !== params.term) {
3681
- // Replace the search term if we have the search box
3682
- if (this.$search.length) {
3683
- this.$search.val(tokenData.term);
3684
- this.$search.focus();
3685
- }
3686
-
3687
- params.term = tokenData.term;
3688
- }
3689
-
3690
- decorated.call(this, params, callback);
3691
- };
3692
-
3693
- Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
3694
- var separators = options.get('tokenSeparators') || [];
3695
- var term = params.term;
3696
- var i = 0;
3697
-
3698
- var createTag = this.createTag || function (params) {
3699
- return {
3700
- id: params.term,
3701
- text: params.term
3702
- };
3703
- };
3704
-
3705
- while (i < term.length) {
3706
- var termChar = term[i];
3707
-
3708
- if ($.inArray(termChar, separators) === -1) {
3709
- i++;
3710
-
3711
- continue;
3712
- }
3713
-
3714
- var part = term.substr(0, i);
3715
- var partParams = $.extend({}, params, {
3716
- term: part
3717
- });
3718
-
3719
- var data = createTag(partParams);
3720
-
3721
- if (data == null) {
3722
- i++;
3723
- continue;
3724
- }
3725
-
3726
- callback(data);
3727
-
3728
- // Reset the term to not include the tokenized portion
3729
- term = term.substr(i + 1) || '';
3730
- i = 0;
3731
- }
3732
-
3733
- return {
3734
- term: term
3735
- };
3736
- };
3737
-
3738
- return Tokenizer;
3739
- });
3740
-
3741
- S2.define('select2/data/minimumInputLength',[
3742
-
3743
- ], function () {
3744
- function MinimumInputLength (decorated, $e, options) {
3745
- this.minimumInputLength = options.get('minimumInputLength');
3746
-
3747
- decorated.call(this, $e, options);
3748
- }
3749
-
3750
- MinimumInputLength.prototype.query = function (decorated, params, callback) {
3751
- params.term = params.term || '';
3752
-
3753
- if (params.term.length < this.minimumInputLength) {
3754
- this.trigger('results:message', {
3755
- message: 'inputTooShort',
3756
- args: {
3757
- minimum: this.minimumInputLength,
3758
- input: params.term,
3759
- params: params
3760
- }
3761
- });
3762
-
3763
- return;
3764
- }
3765
-
3766
- decorated.call(this, params, callback);
3767
- };
3768
-
3769
- return MinimumInputLength;
3770
- });
3771
-
3772
- S2.define('select2/data/maximumInputLength',[
3773
-
3774
- ], function () {
3775
- function MaximumInputLength (decorated, $e, options) {
3776
- this.maximumInputLength = options.get('maximumInputLength');
3777
-
3778
- decorated.call(this, $e, options);
3779
- }
3780
-
3781
- MaximumInputLength.prototype.query = function (decorated, params, callback) {
3782
- params.term = params.term || '';
3783
-
3784
- if (this.maximumInputLength > 0 &&
3785
- params.term.length > this.maximumInputLength) {
3786
- this.trigger('results:message', {
3787
- message: 'inputTooLong',
3788
- args: {
3789
- maximum: this.maximumInputLength,
3790
- input: params.term,
3791
- params: params
3792
- }
3793
- });
3794
-
3795
- return;
3796
- }
3797
-
3798
- decorated.call(this, params, callback);
3799
- };
3800
-
3801
- return MaximumInputLength;
3802
- });
3803
-
3804
- S2.define('select2/data/maximumSelectionLength',[
3805
-
3806
- ], function (){
3807
- function MaximumSelectionLength (decorated, $e, options) {
3808
- this.maximumSelectionLength = options.get('maximumSelectionLength');
3809
-
3810
- decorated.call(this, $e, options);
3811
- }
3812
-
3813
- MaximumSelectionLength.prototype.query =
3814
- function (decorated, params, callback) {
3815
- var self = this;
3816
-
3817
- this.current(function (currentData) {
3818
- var count = currentData != null ? currentData.length : 0;
3819
- if (self.maximumSelectionLength > 0 &&
3820
- count >= self.maximumSelectionLength) {
3821
- self.trigger('results:message', {
3822
- message: 'maximumSelected',
3823
- args: {
3824
- maximum: self.maximumSelectionLength
3825
- }
3826
- });
3827
- return;
3828
- }
3829
- decorated.call(self, params, callback);
3830
- });
3831
- };
3832
-
3833
- return MaximumSelectionLength;
3834
- });
3835
-
3836
- S2.define('select2/dropdown',[
3837
- 'jquery',
3838
- './utils'
3839
- ], function ($, Utils) {
3840
- function Dropdown ($element, options) {
3841
- this.$element = $element;
3842
- this.options = options;
3843
-
3844
- Dropdown.__super__.constructor.call(this);
3845
- }
3846
-
3847
- Utils.Extend(Dropdown, Utils.Observable);
3848
-
3849
- Dropdown.prototype.render = function () {
3850
- var $dropdown = $(
3851
- '<span class="select2-dropdown">' +
3852
- '<span class="select2-results"></span>' +
3853
- '</span>'
3854
- );
3855
-
3856
- $dropdown.attr('dir', this.options.get('dir'));
3857
-
3858
- this.$dropdown = $dropdown;
3859
-
3860
- return $dropdown;
3861
- };
3862
-
3863
- Dropdown.prototype.bind = function () {
3864
- // Should be implemented in subclasses
3865
- };
3866
-
3867
- Dropdown.prototype.position = function ($dropdown, $container) {
3868
- // Should be implmented in subclasses
3869
- };
3870
-
3871
- Dropdown.prototype.destroy = function () {
3872
- // Remove the dropdown from the DOM
3873
- this.$dropdown.remove();
3874
- };
3875
-
3876
- return Dropdown;
3877
- });
3878
-
3879
- S2.define('select2/dropdown/search',[
3880
- 'jquery',
3881
- '../utils'
3882
- ], function ($, Utils) {
3883
- function Search () { }
3884
-
3885
- Search.prototype.render = function (decorated) {
3886
- var $rendered = decorated.call(this);
3887
-
3888
- var $search = $(
3889
- '<span class="select2-search select2-search--dropdown">' +
3890
- '<input class="select2-search__field" type="search" tabindex="-1"' +
3891
- ' autocomplete="off" autocorrect="off" autocapitalize="off"' +
3892
- ' spellcheck="false" role="textbox" />' +
3893
- '</span>'
3894
- );
3895
-
3896
- this.$searchContainer = $search;
3897
- this.$search = $search.find('input');
3898
-
3899
- $rendered.prepend($search);
3900
-
3901
- return $rendered;
3902
- };
3903
-
3904
- Search.prototype.bind = function (decorated, container, $container) {
3905
- var self = this;
3906
-
3907
- decorated.call(this, container, $container);
3908
-
3909
- this.$search.on('keydown', function (evt) {
3910
- self.trigger('keypress', evt);
3911
-
3912
- self._keyUpPrevented = evt.isDefaultPrevented();
3913
- });
3914
-
3915
- // Workaround for browsers which do not support the `input` event
3916
- // This will prevent double-triggering of events for browsers which support
3917
- // both the `keyup` and `input` events.
3918
- this.$search.on('input', function (evt) {
3919
- // Unbind the duplicated `keyup` event
3920
- $(this).off('keyup');
3921
- });
3922
-
3923
- this.$search.on('keyup input', function (evt) {
3924
- self.handleSearch(evt);
3925
- });
3926
-
3927
- container.on('open', function () {
3928
- self.$search.attr('tabindex', 0);
3929
-
3930
- self.$search.focus();
3931
-
3932
- window.setTimeout(function () {
3933
- self.$search.focus();
3934
- }, 0);
3935
- });
3936
-
3937
- container.on('close', function () {
3938
- self.$search.attr('tabindex', -1);
3939
-
3940
- self.$search.val('');
3941
- });
3942
-
3943
- container.on('focus', function () {
3944
- if (container.isOpen()) {
3945
- self.$search.focus();
3946
- }
3947
- });
3948
-
3949
- container.on('results:all', function (params) {
3950
- if (params.query.term == null || params.query.term === '') {
3951
- var showSearch = self.showSearch(params);
3952
-
3953
- if (showSearch) {
3954
- self.$searchContainer.removeClass('select2-search--hide');
3955
- } else {
3956
- self.$searchContainer.addClass('select2-search--hide');
3957
- }
3958
- }
3959
- });
3960
- };
3961
-
3962
- Search.prototype.handleSearch = function (evt) {
3963
- if (!this._keyUpPrevented) {
3964
- var input = this.$search.val();
3965
-
3966
- this.trigger('query', {
3967
- term: input
3968
- });
3969
- }
3970
-
3971
- this._keyUpPrevented = false;
3972
- };
3973
-
3974
- Search.prototype.showSearch = function (_, params) {
3975
- return true;
3976
- };
3977
-
3978
- return Search;
3979
- });
3980
-
3981
- S2.define('select2/dropdown/hidePlaceholder',[
3982
-
3983
- ], function () {
3984
- function HidePlaceholder (decorated, $element, options, dataAdapter) {
3985
- this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
3986
-
3987
- decorated.call(this, $element, options, dataAdapter);
3988
- }
3989
-
3990
- HidePlaceholder.prototype.append = function (decorated, data) {
3991
- data.results = this.removePlaceholder(data.results);
3992
-
3993
- decorated.call(this, data);
3994
- };
3995
-
3996
- HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
3997
- if (typeof placeholder === 'string') {
3998
- placeholder = {
3999
- id: '',
4000
- text: placeholder
4001
- };
4002
- }
4003
-
4004
- return placeholder;
4005
- };
4006
-
4007
- HidePlaceholder.prototype.removePlaceholder = function (_, data) {
4008
- var modifiedData = data.slice(0);
4009
-
4010
- for (var d = data.length - 1; d >= 0; d--) {
4011
- var item = data[d];
4012
-
4013
- if (this.placeholder.id === item.id) {
4014
- modifiedData.splice(d, 1);
4015
- }
4016
- }
4017
-
4018
- return modifiedData;
4019
- };
4020
-
4021
- return HidePlaceholder;
4022
- });
4023
-
4024
- S2.define('select2/dropdown/infiniteScroll',[
4025
- 'jquery'
4026
- ], function ($) {
4027
- function InfiniteScroll (decorated, $element, options, dataAdapter) {
4028
- this.lastParams = {};
4029
-
4030
- decorated.call(this, $element, options, dataAdapter);
4031
-
4032
- this.$loadingMore = this.createLoadingMore();
4033
- this.loading = false;
4034
- }
4035
-
4036
- InfiniteScroll.prototype.append = function (decorated, data) {
4037
- this.$loadingMore.remove();
4038
- this.loading = false;
4039
-
4040
- decorated.call(this, data);
4041
-
4042
- if (this.showLoadingMore(data)) {
4043
- this.$results.append(this.$loadingMore);
4044
- }
4045
- };
4046
-
4047
- InfiniteScroll.prototype.bind = function (decorated, container, $container) {
4048
- var self = this;
4049
-
4050
- decorated.call(this, container, $container);
4051
-
4052
- container.on('query', function (params) {
4053
- self.lastParams = params;
4054
- self.loading = true;
4055
- });
4056
-
4057
- container.on('query:append', function (params) {
4058
- self.lastParams = params;
4059
- self.loading = true;
4060
- });
4061
-
4062
- this.$results.on('scroll', function () {
4063
- var isLoadMoreVisible = $.contains(
4064
- document.documentElement,
4065
- self.$loadingMore[0]
4066
- );
4067
-
4068
- if (self.loading || !isLoadMoreVisible) {
4069
- return;
4070
- }
4071
-
4072
- var currentOffset = self.$results.offset().top +
4073
- self.$results.outerHeight(false);
4074
- var loadingMoreOffset = self.$loadingMore.offset().top +
4075
- self.$loadingMore.outerHeight(false);
4076
-
4077
- if (currentOffset + 50 >= loadingMoreOffset) {
4078
- self.loadMore();
4079
- }
4080
- });
4081
- };
4082
-
4083
- InfiniteScroll.prototype.loadMore = function () {
4084
- this.loading = true;
4085
-
4086
- var params = $.extend({}, {page: 1}, this.lastParams);
4087
-
4088
- params.page++;
4089
-
4090
- this.trigger('query:append', params);
4091
- };
4092
-
4093
- InfiniteScroll.prototype.showLoadingMore = function (_, data) {
4094
- return data.pagination && data.pagination.more;
4095
- };
4096
-
4097
- InfiniteScroll.prototype.createLoadingMore = function () {
4098
- var $option = $(
4099
- '<li ' +
4100
- 'class="select2-results__option select2-results__option--load-more"' +
4101
- 'role="treeitem" aria-disabled="true"></li>'
4102
- );
4103
-
4104
- var message = this.options.get('translations').get('loadingMore');
4105
-
4106
- $option.html(message(this.lastParams));
4107
-
4108
- return $option;
4109
- };
4110
-
4111
- return InfiniteScroll;
4112
- });
4113
-
4114
- S2.define('select2/dropdown/attachBody',[
4115
- 'jquery',
4116
- '../utils'
4117
- ], function ($, Utils) {
4118
- function AttachBody (decorated, $element, options) {
4119
- this.$dropdownParent = options.get('dropdownParent') || $(document.body);
4120
-
4121
- decorated.call(this, $element, options);
4122
- }
4123
-
4124
- AttachBody.prototype.bind = function (decorated, container, $container) {
4125
- var self = this;
4126
-
4127
- var setupResultsEvents = false;
4128
-
4129
- decorated.call(this, container, $container);
4130
-
4131
- container.on('open', function () {
4132
- self._showDropdown();
4133
- self._attachPositioningHandler(container);
4134
-
4135
- if (!setupResultsEvents) {
4136
- setupResultsEvents = true;
4137
-
4138
- container.on('results:all', function () {
4139
- self._positionDropdown();
4140
- self._resizeDropdown();
4141
- });
4142
-
4143
- container.on('results:append', function () {
4144
- self._positionDropdown();
4145
- self._resizeDropdown();
4146
- });
4147
- }
4148
- });
4149
-
4150
- container.on('close', function () {
4151
- self._hideDropdown();
4152
- self._detachPositioningHandler(container);
4153
- });
4154
-
4155
- this.$dropdownContainer.on('mousedown', function (evt) {
4156
- evt.stopPropagation();
4157
- });
4158
- };
4159
-
4160
- AttachBody.prototype.destroy = function (decorated) {
4161
- decorated.call(this);
4162
-
4163
- this.$dropdownContainer.remove();
4164
- };
4165
-
4166
- AttachBody.prototype.position = function (decorated, $dropdown, $container) {
4167
- // Clone all of the container classes
4168
- $dropdown.attr('class', $container.attr('class'));
4169
-
4170
- $dropdown.removeClass('select2');
4171
- $dropdown.addClass('select2-container--open');
4172
-
4173
- $dropdown.css({
4174
- position: 'absolute',
4175
- top: -999999
4176
- });
4177
-
4178
- this.$container = $container;
4179
- };
4180
-
4181
- AttachBody.prototype.render = function (decorated) {
4182
- var $container = $('<span></span>');
4183
-
4184
- var $dropdown = decorated.call(this);
4185
- $container.append($dropdown);
4186
-
4187
- this.$dropdownContainer = $container;
4188
-
4189
- return $container;
4190
- };
4191
-
4192
- AttachBody.prototype._hideDropdown = function (decorated) {
4193
- this.$dropdownContainer.detach();
4194
- };
4195
-
4196
- AttachBody.prototype._attachPositioningHandler =
4197
- function (decorated, container) {
4198
- var self = this;
4199
-
4200
- var scrollEvent = 'scroll.select2.' + container.id;
4201
- var resizeEvent = 'resize.select2.' + container.id;
4202
- var orientationEvent = 'orientationchange.select2.' + container.id;
4203
-
4204
- var $watchers = this.$container.parents().filter(Utils.hasScroll);
4205
- $watchers.each(function () {
4206
- $(this).data('select2-scroll-position', {
4207
- x: $(this).scrollLeft(),
4208
- y: $(this).scrollTop()
4209
- });
4210
- });
4211
-
4212
- $watchers.on(scrollEvent, function (ev) {
4213
- var position = $(this).data('select2-scroll-position');
4214
- $(this).scrollTop(position.y);
4215
- });
4216
-
4217
- $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
4218
- function (e) {
4219
- self._positionDropdown();
4220
- self._resizeDropdown();
4221
- });
4222
- };
4223
-
4224
- AttachBody.prototype._detachPositioningHandler =
4225
- function (decorated, container) {
4226
- var scrollEvent = 'scroll.select2.' + container.id;
4227
- var resizeEvent = 'resize.select2.' + container.id;
4228
- var orientationEvent = 'orientationchange.select2.' + container.id;
4229
-
4230
- var $watchers = this.$container.parents().filter(Utils.hasScroll);
4231
- $watchers.off(scrollEvent);
4232
-
4233
- $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
4234
- };
4235
-
4236
- AttachBody.prototype._positionDropdown = function () {
4237
- var $window = $(window);
4238
-
4239
- var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
4240
- var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
4241
-
4242
- var newDirection = null;
4243
-
4244
- var offset = this.$container.offset();
4245
-
4246
- offset.bottom = offset.top + this.$container.outerHeight(false);
4247
-
4248
- var container = {
4249
- height: this.$container.outerHeight(false)
4250
- };
4251
-
4252
- container.top = offset.top;
4253
- container.bottom = offset.top + container.height;
4254
-
4255
- var dropdown = {
4256
- height: this.$dropdown.outerHeight(false)
4257
- };
4258
-
4259
- var viewport = {
4260
- top: $window.scrollTop(),
4261
- bottom: $window.scrollTop() + $window.height()
4262
- };
4263
-
4264
- var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
4265
- var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
4266
-
4267
- var css = {
4268
- left: offset.left,
4269
- top: container.bottom
4270
- };
4271
-
4272
- // Determine what the parent element is to use for calciulating the offset
4273
- var $offsetParent = this.$dropdownParent;
4274
-
4275
- // For statically positoned elements, we need to get the element
4276
- // that is determining the offset
4277
- if ($offsetParent.css('position') === 'static') {
4278
- $offsetParent = $offsetParent.offsetParent();
4279
- }
4280
-
4281
- var parentOffset = $offsetParent.offset();
4282
-
4283
- css.top -= parentOffset.top;
4284
- css.left -= parentOffset.left;
4285
-
4286
- if (!isCurrentlyAbove && !isCurrentlyBelow) {
4287
- newDirection = 'below';
4288
- }
4289
-
4290
- if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
4291
- newDirection = 'above';
4292
- } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
4293
- newDirection = 'below';
4294
- }
4295
-
4296
- if (newDirection == 'above' ||
4297
- (isCurrentlyAbove && newDirection !== 'below')) {
4298
- css.top = container.top - parentOffset.top - dropdown.height;
4299
- }
4300
-
4301
- if (newDirection != null) {
4302
- this.$dropdown
4303
- .removeClass('select2-dropdown--below select2-dropdown--above')
4304
- .addClass('select2-dropdown--' + newDirection);
4305
- this.$container
4306
- .removeClass('select2-container--below select2-container--above')
4307
- .addClass('select2-container--' + newDirection);
4308
- }
4309
-
4310
- this.$dropdownContainer.css(css);
4311
- };
4312
-
4313
- AttachBody.prototype._resizeDropdown = function () {
4314
- var css = {
4315
- width: this.$container.outerWidth(false) + 'px'
4316
- };
4317
-
4318
- if (this.options.get('dropdownAutoWidth')) {
4319
- css.minWidth = css.width;
4320
- css.position = 'relative';
4321
- css.width = 'auto';
4322
- }
4323
-
4324
- this.$dropdown.css(css);
4325
- };
4326
-
4327
- AttachBody.prototype._showDropdown = function (decorated) {
4328
- this.$dropdownContainer.appendTo(this.$dropdownParent);
4329
-
4330
- this._positionDropdown();
4331
- this._resizeDropdown();
4332
- };
4333
-
4334
- return AttachBody;
4335
- });
4336
-
4337
- S2.define('select2/dropdown/minimumResultsForSearch',[
4338
-
4339
- ], function () {
4340
- function countResults (data) {
4341
- var count = 0;
4342
-
4343
- for (var d = 0; d < data.length; d++) {
4344
- var item = data[d];
4345
-
4346
- if (item.children) {
4347
- count += countResults(item.children);
4348
- } else {
4349
- count++;
4350
- }
4351
- }
4352
-
4353
- return count;
4354
- }
4355
-
4356
- function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
4357
- this.minimumResultsForSearch = options.get('minimumResultsForSearch');
4358
-
4359
- if (this.minimumResultsForSearch < 0) {
4360
- this.minimumResultsForSearch = Infinity;
4361
- }
4362
-
4363
- decorated.call(this, $element, options, dataAdapter);
4364
- }
4365
-
4366
- MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
4367
- if (countResults(params.data.results) < this.minimumResultsForSearch) {
4368
- return false;
4369
- }
4370
-
4371
- return decorated.call(this, params);
4372
- };
4373
-
4374
- return MinimumResultsForSearch;
4375
- });
4376
-
4377
- S2.define('select2/dropdown/selectOnClose',[
4378
-
4379
- ], function () {
4380
- function SelectOnClose () { }
4381
-
4382
- SelectOnClose.prototype.bind = function (decorated, container, $container) {
4383
- var self = this;
4384
-
4385
- decorated.call(this, container, $container);
4386
-
4387
- container.on('close', function (params) {
4388
- self._handleSelectOnClose(params);
4389
- });
4390
- };
4391
-
4392
- SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
4393
- if (params && params.originalSelect2Event != null) {
4394
- var event = params.originalSelect2Event;
4395
-
4396
- // Don't select an item if the close event was triggered from a select or
4397
- // unselect event
4398
- if (event._type === 'select' || event._type === 'unselect') {
4399
- return;
4400
- }
4401
- }
4402
-
4403
- var $highlightedResults = this.getHighlightedResults();
4404
-
4405
- // Only select highlighted results
4406
- if ($highlightedResults.length < 1) {
4407
- return;
4408
- }
4409
-
4410
- var data = $highlightedResults.data('data');
4411
-
4412
- // Don't re-select already selected resulte
4413
- if (
4414
- (data.element != null && data.element.selected) ||
4415
- (data.element == null && data.selected)
4416
- ) {
4417
- return;
4418
- }
4419
-
4420
- this.trigger('select', {
4421
- data: data
4422
- });
4423
- };
4424
-
4425
- return SelectOnClose;
4426
- });
4427
-
4428
- S2.define('select2/dropdown/closeOnSelect',[
4429
-
4430
- ], function () {
4431
- function CloseOnSelect () { }
4432
-
4433
- CloseOnSelect.prototype.bind = function (decorated, container, $container) {
4434
- var self = this;
4435
-
4436
- decorated.call(this, container, $container);
4437
-
4438
- container.on('select', function (evt) {
4439
- self._selectTriggered(evt);
4440
- });
4441
-
4442
- container.on('unselect', function (evt) {
4443
- self._selectTriggered(evt);
4444
- });
4445
- };
4446
-
4447
- CloseOnSelect.prototype._selectTriggered = function (_, evt) {
4448
- var originalEvent = evt.originalEvent;
4449
-
4450
- // Don't close if the control key is being held
4451
- if (originalEvent && originalEvent.ctrlKey) {
4452
- return;
4453
- }
4454
-
4455
- this.trigger('close', {
4456
- originalEvent: originalEvent,
4457
- originalSelect2Event: evt
4458
- });
4459
- };
4460
-
4461
- return CloseOnSelect;
4462
- });
4463
-
4464
- S2.define('select2/i18n/en',[],function () {
4465
- // English
4466
- return {
4467
- errorLoading: function () {
4468
- return 'The results could not be loaded.';
4469
- },
4470
- inputTooLong: function (args) {
4471
- var overChars = args.input.length - args.maximum;
4472
-
4473
- var message = 'Please delete ' + overChars + ' character';
4474
-
4475
- if (overChars != 1) {
4476
- message += 's';
4477
- }
4478
-
4479
- return message;
4480
- },
4481
- inputTooShort: function (args) {
4482
- var remainingChars = args.minimum - args.input.length;
4483
-
4484
- var message = 'Please enter ' + remainingChars + ' or more characters';
4485
-
4486
- return message;
4487
- },
4488
- loadingMore: function () {
4489
- return 'Loading more results…';
4490
- },
4491
- maximumSelected: function (args) {
4492
- var message = 'You can only select ' + args.maximum + ' item';
4493
-
4494
- if (args.maximum != 1) {
4495
- message += 's';
4496
- }
4497
-
4498
- return message;
4499
- },
4500
- noResults: function () {
4501
- return 'No results found';
4502
- },
4503
- searching: function () {
4504
- return 'Searching…';
4505
- }
4506
- };
4507
- });
4508
-
4509
- S2.define('select2/defaults',[
4510
- 'jquery',
4511
- 'require',
4512
-
4513
- './results',
4514
-
4515
- './selection/single',
4516
- './selection/multiple',
4517
- './selection/placeholder',
4518
- './selection/allowClear',
4519
- './selection/search',
4520
- './selection/eventRelay',
4521
-
4522
- './utils',
4523
- './translation',
4524
- './diacritics',
4525
-
4526
- './data/select',
4527
- './data/array',
4528
- './data/ajax',
4529
- './data/tags',
4530
- './data/tokenizer',
4531
- './data/minimumInputLength',
4532
- './data/maximumInputLength',
4533
- './data/maximumSelectionLength',
4534
-
4535
- './dropdown',
4536
- './dropdown/search',
4537
- './dropdown/hidePlaceholder',
4538
- './dropdown/infiniteScroll',
4539
- './dropdown/attachBody',
4540
- './dropdown/minimumResultsForSearch',
4541
- './dropdown/selectOnClose',
4542
- './dropdown/closeOnSelect',
4543
-
4544
- './i18n/en'
4545
- ], function ($, require,
4546
-
4547
- ResultsList,
4548
-
4549
- SingleSelection, MultipleSelection, Placeholder, AllowClear,
4550
- SelectionSearch, EventRelay,
4551
-
4552
- Utils, Translation, DIACRITICS,
4553
-
4554
- SelectData, ArrayData, AjaxData, Tags, Tokenizer,
4555
- MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
4556
-
4557
- Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
4558
- AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
4559
-
4560
- EnglishTranslation) {
4561
- function Defaults () {
4562
- this.reset();
4563
- }
4564
-
4565
- Defaults.prototype.apply = function (options) {
4566
- options = $.extend(true, {}, this.defaults, options);
4567
-
4568
- if (options.dataAdapter == null) {
4569
- if (options.ajax != null) {
4570
- options.dataAdapter = AjaxData;
4571
- } else if (options.data != null) {
4572
- options.dataAdapter = ArrayData;
4573
- } else {
4574
- options.dataAdapter = SelectData;
4575
- }
4576
-
4577
- if (options.minimumInputLength > 0) {
4578
- options.dataAdapter = Utils.Decorate(
4579
- options.dataAdapter,
4580
- MinimumInputLength
4581
- );
4582
- }
4583
-
4584
- if (options.maximumInputLength > 0) {
4585
- options.dataAdapter = Utils.Decorate(
4586
- options.dataAdapter,
4587
- MaximumInputLength
4588
- );
4589
- }
4590
-
4591
- if (options.maximumSelectionLength > 0) {
4592
- options.dataAdapter = Utils.Decorate(
4593
- options.dataAdapter,
4594
- MaximumSelectionLength
4595
- );
4596
- }
4597
-
4598
- if (options.tags) {
4599
- options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
4600
- }
4601
-
4602
- if (options.tokenSeparators != null || options.tokenizer != null) {
4603
- options.dataAdapter = Utils.Decorate(
4604
- options.dataAdapter,
4605
- Tokenizer
4606
- );
4607
- }
4608
-
4609
- if (options.query != null) {
4610
- var Query = require(options.amdBase + 'compat/query');
4611
-
4612
- options.dataAdapter = Utils.Decorate(
4613
- options.dataAdapter,
4614
- Query
4615
- );
4616
- }
4617
-
4618
- if (options.initSelection != null) {
4619
- var InitSelection = require(options.amdBase + 'compat/initSelection');
4620
-
4621
- options.dataAdapter = Utils.Decorate(
4622
- options.dataAdapter,
4623
- InitSelection
4624
- );
4625
- }
4626
- }
4627
-
4628
- if (options.resultsAdapter == null) {
4629
- options.resultsAdapter = ResultsList;
4630
-
4631
- if (options.ajax != null) {
4632
- options.resultsAdapter = Utils.Decorate(
4633
- options.resultsAdapter,
4634
- InfiniteScroll
4635
- );
4636
- }
4637
-
4638
- if (options.placeholder != null) {
4639
- options.resultsAdapter = Utils.Decorate(
4640
- options.resultsAdapter,
4641
- HidePlaceholder
4642
- );
4643
- }
4644
-
4645
- if (options.selectOnClose) {
4646
- options.resultsAdapter = Utils.Decorate(
4647
- options.resultsAdapter,
4648
- SelectOnClose
4649
- );
4650
- }
4651
- }
4652
-
4653
- if (options.dropdownAdapter == null) {
4654
- if (options.multiple) {
4655
- options.dropdownAdapter = Dropdown;
4656
- } else {
4657
- var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
4658
-
4659
- options.dropdownAdapter = SearchableDropdown;
4660
- }
4661
-
4662
- if (options.minimumResultsForSearch !== 0) {
4663
- options.dropdownAdapter = Utils.Decorate(
4664
- options.dropdownAdapter,
4665
- MinimumResultsForSearch
4666
- );
4667
- }
4668
-
4669
- if (options.closeOnSelect) {
4670
- options.dropdownAdapter = Utils.Decorate(
4671
- options.dropdownAdapter,
4672
- CloseOnSelect
4673
- );
4674
- }
4675
-
4676
- if (
4677
- options.dropdownCssClass != null ||
4678
- options.dropdownCss != null ||
4679
- options.adaptDropdownCssClass != null
4680
- ) {
4681
- var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
4682
-
4683
- options.dropdownAdapter = Utils.Decorate(
4684
- options.dropdownAdapter,
4685
- DropdownCSS
4686
- );
4687
- }
4688
-
4689
- options.dropdownAdapter = Utils.Decorate(
4690
- options.dropdownAdapter,
4691
- AttachBody
4692
- );
4693
- }
4694
-
4695
- if (options.selectionAdapter == null) {
4696
- if (options.multiple) {
4697
- options.selectionAdapter = MultipleSelection;
4698
- } else {
4699
- options.selectionAdapter = SingleSelection;
4700
- }
4701
-
4702
- // Add the placeholder mixin if a placeholder was specified
4703
- if (options.placeholder != null) {
4704
- options.selectionAdapter = Utils.Decorate(
4705
- options.selectionAdapter,
4706
- Placeholder
4707
- );
4708
- }
4709
-
4710
- if (options.allowClear) {
4711
- options.selectionAdapter = Utils.Decorate(
4712
- options.selectionAdapter,
4713
- AllowClear
4714
- );
4715
- }
4716
-
4717
- if (options.multiple) {
4718
- options.selectionAdapter = Utils.Decorate(
4719
- options.selectionAdapter,
4720
- SelectionSearch
4721
- );
4722
- }
4723
-
4724
- if (
4725
- options.containerCssClass != null ||
4726
- options.containerCss != null ||
4727
- options.adaptContainerCssClass != null
4728
- ) {
4729
- var ContainerCSS = require(options.amdBase + 'compat/containerCss');
4730
-
4731
- options.selectionAdapter = Utils.Decorate(
4732
- options.selectionAdapter,
4733
- ContainerCSS
4734
- );
4735
- }
4736
-
4737
- options.selectionAdapter = Utils.Decorate(
4738
- options.selectionAdapter,
4739
- EventRelay
4740
- );
4741
- }
4742
-
4743
- if (typeof options.language === 'string') {
4744
- // Check if the language is specified with a region
4745
- if (options.language.indexOf('-') > 0) {
4746
- // Extract the region information if it is included
4747
- var languageParts = options.language.split('-');
4748
- var baseLanguage = languageParts[0];
4749
-
4750
- options.language = [options.language, baseLanguage];
4751
- } else {
4752
- options.language = [options.language];
4753
- }
4754
- }
4755
-
4756
- if ($.isArray(options.language)) {
4757
- var languages = new Translation();
4758
- options.language.push('en');
4759
-
4760
- var languageNames = options.language;
4761
-
4762
- for (var l = 0; l < languageNames.length; l++) {
4763
- var name = languageNames[l];
4764
- var language = {};
4765
-
4766
- try {
4767
- // Try to load it with the original name
4768
- language = Translation.loadPath(name);
4769
- } catch (e) {
4770
- try {
4771
- // If we couldn't load it, check if it wasn't the full path
4772
- name = this.defaults.amdLanguageBase + name;
4773
- language = Translation.loadPath(name);
4774
- } catch (ex) {
4775
- // The translation could not be loaded at all. Sometimes this is
4776
- // because of a configuration problem, other times this can be
4777
- // because of how Select2 helps load all possible translation files.
4778
- if (options.debug && window.console && console.warn) {
4779
- console.warn(
4780
- 'Select2: The language file for "' + name + '" could not be ' +
4781
- 'automatically loaded. A fallback will be used instead.'
4782
- );
4783
- }
4784
-
4785
- continue;
4786
- }
4787
- }
4788
-
4789
- languages.extend(language);
4790
- }
4791
-
4792
- options.translations = languages;
4793
- } else {
4794
- var baseTranslation = Translation.loadPath(
4795
- this.defaults.amdLanguageBase + 'en'
4796
- );
4797
- var customTranslation = new Translation(options.language);
4798
-
4799
- customTranslation.extend(baseTranslation);
4800
-
4801
- options.translations = customTranslation;
4802
- }
4803
-
4804
- return options;
4805
- };
4806
-
4807
- Defaults.prototype.reset = function () {
4808
- function stripDiacritics (text) {
4809
- // Used 'uni range + named function' from http://jsperf.com/diacritics/18
4810
- function match(a) {
4811
- return DIACRITICS[a] || a;
4812
- }
4813
-
4814
- return text.replace(/[^\u0000-\u007E]/g, match);
4815
- }
4816
-
4817
- function matcher (params, data) {
4818
- // Always return the object if there is nothing to compare
4819
- if ($.trim(params.term) === '') {
4820
- return data;
4821
- }
4822
-
4823
- // Do a recursive check for options with children
4824
- if (data.children && data.children.length > 0) {
4825
- // Clone the data object if there are children
4826
- // This is required as we modify the object to remove any non-matches
4827
- var match = $.extend(true, {}, data);
4828
-
4829
- // Check each child of the option
4830
- for (var c = data.children.length - 1; c >= 0; c--) {
4831
- var child = data.children[c];
4832
-
4833
- var matches = matcher(params, child);
4834
-
4835
- // If there wasn't a match, remove the object in the array
4836
- if (matches == null) {
4837
- match.children.splice(c, 1);
4838
- }
4839
- }
4840
-
4841
- // If any children matched, return the new object
4842
- if (match.children.length > 0) {
4843
- return match;
4844
- }
4845
-
4846
- // If there were no matching children, check just the plain object
4847
- return matcher(params, match);
4848
- }
4849
-
4850
- var original = stripDiacritics(data.text).toUpperCase();
4851
- var term = stripDiacritics(params.term).toUpperCase();
4852
-
4853
- // Check if the text contains the term
4854
- if (original.indexOf(term) > -1) {
4855
- return data;
4856
- }
4857
-
4858
- // If it doesn't contain the term, don't return anything
4859
- return null;
4860
- }
4861
-
4862
- this.defaults = {
4863
- amdBase: './',
4864
- amdLanguageBase: './i18n/',
4865
- closeOnSelect: true,
4866
- debug: false,
4867
- dropdownAutoWidth: false,
4868
- escapeMarkup: Utils.escapeMarkup,
4869
- language: EnglishTranslation,
4870
- matcher: matcher,
4871
- minimumInputLength: 0,
4872
- maximumInputLength: 0,
4873
- maximumSelectionLength: 0,
4874
- minimumResultsForSearch: 0,
4875
- selectOnClose: false,
4876
- sorter: function (data) {
4877
- return data;
4878
- },
4879
- templateResult: function (result) {
4880
- return result.text;
4881
- },
4882
- templateSelection: function (selection) {
4883
- return selection.text;
4884
- },
4885
- theme: 'default',
4886
- width: 'resolve'
4887
- };
4888
- };
4889
-
4890
- Defaults.prototype.set = function (key, value) {
4891
- var camelKey = $.camelCase(key);
4892
-
4893
- var data = {};
4894
- data[camelKey] = value;
4895
-
4896
- var convertedData = Utils._convertData(data);
4897
-
4898
- $.extend(this.defaults, convertedData);
4899
- };
4900
-
4901
- var defaults = new Defaults();
4902
-
4903
- return defaults;
4904
- });
4905
-
4906
- S2.define('select2/options',[
4907
- 'require',
4908
- 'jquery',
4909
- './defaults',
4910
- './utils'
4911
- ], function (require, $, Defaults, Utils) {
4912
- function Options (options, $element) {
4913
- this.options = options;
4914
-
4915
- if ($element != null) {
4916
- this.fromElement($element);
4917
- }
4918
-
4919
- this.options = Defaults.apply(this.options);
4920
-
4921
- if ($element && $element.is('input')) {
4922
- var InputCompat = require(this.get('amdBase') + 'compat/inputData');
4923
-
4924
- this.options.dataAdapter = Utils.Decorate(
4925
- this.options.dataAdapter,
4926
- InputCompat
4927
- );
4928
- }
4929
- }
4930
-
4931
- Options.prototype.fromElement = function ($e) {
4932
- var excludedData = ['select2'];
4933
-
4934
- if (this.options.multiple == null) {
4935
- this.options.multiple = $e.prop('multiple');
4936
- }
4937
-
4938
- if (this.options.disabled == null) {
4939
- this.options.disabled = $e.prop('disabled');
4940
- }
4941
-
4942
- if (this.options.language == null) {
4943
- if ($e.prop('lang')) {
4944
- this.options.language = $e.prop('lang').toLowerCase();
4945
- } else if ($e.closest('[lang]').prop('lang')) {
4946
- this.options.language = $e.closest('[lang]').prop('lang');
4947
- }
4948
- }
4949
-
4950
- if (this.options.dir == null) {
4951
- if ($e.prop('dir')) {
4952
- this.options.dir = $e.prop('dir');
4953
- } else if ($e.closest('[dir]').prop('dir')) {
4954
- this.options.dir = $e.closest('[dir]').prop('dir');
4955
- } else {
4956
- this.options.dir = 'ltr';
4957
- }
4958
- }
4959
-
4960
- $e.prop('disabled', this.options.disabled);
4961
- $e.prop('multiple', this.options.multiple);
4962
-
4963
- if ($e.data('select2Tags')) {
4964
- if (this.options.debug && window.console && console.warn) {
4965
- console.warn(
4966
- 'Select2: The `data-select2-tags` attribute has been changed to ' +
4967
- 'use the `data-data` and `data-tags="true"` attributes and will be ' +
4968
- 'removed in future versions of Select2.'
4969
- );
4970
- }
4971
-
4972
- $e.data('data', $e.data('select2Tags'));
4973
- $e.data('tags', true);
4974
- }
4975
-
4976
- if ($e.data('ajaxUrl')) {
4977
- if (this.options.debug && window.console && console.warn) {
4978
- console.warn(
4979
- 'Select2: The `data-ajax-url` attribute has been changed to ' +
4980
- '`data-ajax--url` and support for the old attribute will be removed' +
4981
- ' in future versions of Select2.'
4982
- );
4983
- }
4984
-
4985
- $e.attr('ajax--url', $e.data('ajaxUrl'));
4986
- $e.data('ajax--url', $e.data('ajaxUrl'));
4987
- }
4988
-
4989
- var dataset = {};
4990
-
4991
- // Prefer the element's `dataset` attribute if it exists
4992
- // jQuery 1.x does not correctly handle data attributes with multiple dashes
4993
- if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
4994
- dataset = $.extend(true, {}, $e[0].dataset, $e.data());
4995
- } else {
4996
- dataset = $e.data();
4997
- }
4998
-
4999
- var data = $.extend(true, {}, dataset);
5000
-
5001
- data = Utils._convertData(data);
5002
-
5003
- for (var key in data) {
5004
- if ($.inArray(key, excludedData) > -1) {
5005
- continue;
5006
- }
5007
-
5008
- if ($.isPlainObject(this.options[key])) {
5009
- $.extend(this.options[key], data[key]);
5010
- } else {
5011
- this.options[key] = data[key];
5012
- }
5013
- }
5014
-
5015
- return this;
5016
- };
5017
-
5018
- Options.prototype.get = function (key) {
5019
- return this.options[key];
5020
- };
5021
-
5022
- Options.prototype.set = function (key, val) {
5023
- this.options[key] = val;
5024
- };
5025
-
5026
- return Options;
5027
- });
5028
-
5029
- S2.define('select2/core',[
5030
- 'jquery',
5031
- './options',
5032
- './utils',
5033
- './keys'
5034
- ], function ($, Options, Utils, KEYS) {
5035
- var Select2 = function ($element, options) {
5036
- if ($element.data('select2') != null) {
5037
- $element.data('select2').destroy();
5038
- }
5039
-
5040
- this.$element = $element;
5041
-
5042
- this.id = this._generateId($element);
5043
-
5044
- options = options || {};
5045
-
5046
- this.options = new Options(options, $element);
5047
-
5048
- Select2.__super__.constructor.call(this);
5049
-
5050
- // Set up the tabindex
5051
-
5052
- var tabindex = $element.attr('tabindex') || 0;
5053
- $element.data('old-tabindex', tabindex);
5054
- $element.attr('tabindex', '-1');
5055
-
5056
- // Set up containers and adapters
5057
-
5058
- var DataAdapter = this.options.get('dataAdapter');
5059
- this.dataAdapter = new DataAdapter($element, this.options);
5060
-
5061
- var $container = this.render();
5062
-
5063
- this._placeContainer($container);
5064
-
5065
- var SelectionAdapter = this.options.get('selectionAdapter');
5066
- this.selection = new SelectionAdapter($element, this.options);
5067
- this.$selection = this.selection.render();
5068
-
5069
- this.selection.position(this.$selection, $container);
5070
-
5071
- var DropdownAdapter = this.options.get('dropdownAdapter');
5072
- this.dropdown = new DropdownAdapter($element, this.options);
5073
- this.$dropdown = this.dropdown.render();
5074
-
5075
- this.dropdown.position(this.$dropdown, $container);
5076
-
5077
- var ResultsAdapter = this.options.get('resultsAdapter');
5078
- this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
5079
- this.$results = this.results.render();
5080
-
5081
- this.results.position(this.$results, this.$dropdown);
5082
-
5083
- // Bind events
5084
-
5085
- var self = this;
5086
-
5087
- // Bind the container to all of the adapters
5088
- this._bindAdapters();
5089
-
5090
- // Register any DOM event handlers
5091
- this._registerDomEvents();
5092
-
5093
- // Register any internal event handlers
5094
- this._registerDataEvents();
5095
- this._registerSelectionEvents();
5096
- this._registerDropdownEvents();
5097
- this._registerResultsEvents();
5098
- this._registerEvents();
5099
-
5100
- // Set the initial state
5101
- this.dataAdapter.current(function (initialData) {
5102
- self.trigger('selection:update', {
5103
- data: initialData
5104
- });
5105
- });
5106
-
5107
- // Hide the original select
5108
- $element.addClass('select2-hidden-accessible');
5109
- $element.attr('aria-hidden', 'true');
5110
-
5111
- // Synchronize any monitored attributes
5112
- this._syncAttributes();
5113
-
5114
- $element.data('select2', this);
5115
- };
5116
-
5117
- Utils.Extend(Select2, Utils.Observable);
5118
-
5119
- Select2.prototype._generateId = function ($element) {
5120
- var id = '';
5121
-
5122
- if ($element.attr('id') != null) {
5123
- id = $element.attr('id');
5124
- } else if ($element.attr('name') != null) {
5125
- id = $element.attr('name') + '-' + Utils.generateChars(2);
5126
- } else {
5127
- id = Utils.generateChars(4);
5128
- }
5129
-
5130
- id = id.replace(/(:|\.|\[|\]|,)/g, '');
5131
- id = 'select2-' + id;
5132
-
5133
- return id;
5134
- };
5135
-
5136
- Select2.prototype._placeContainer = function ($container) {
5137
- $container.insertAfter(this.$element);
5138
-
5139
- var width = this._resolveWidth(this.$element, this.options.get('width'));
5140
-
5141
- if (width != null) {
5142
- $container.css('width', width);
5143
- }
5144
- };
5145
-
5146
- Select2.prototype._resolveWidth = function ($element, method) {
5147
- var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
5148
-
5149
- if (method == 'resolve') {
5150
- var styleWidth = this._resolveWidth($element, 'style');
5151
-
5152
- if (styleWidth != null) {
5153
- return styleWidth;
5154
- }
5155
-
5156
- return this._resolveWidth($element, 'element');
5157
- }
5158
-
5159
- if (method == 'element') {
5160
- var elementWidth = $element.outerWidth(false);
5161
-
5162
- if (elementWidth <= 0) {
5163
- return 'auto';
5164
- }
5165
-
5166
- return elementWidth + 'px';
5167
- }
5168
-
5169
- if (method == 'style') {
5170
- var style = $element.attr('style');
5171
-
5172
- if (typeof(style) !== 'string') {
5173
- return null;
5174
- }
5175
-
5176
- var attrs = style.split(';');
5177
-
5178
- for (var i = 0, l = attrs.length; i < l; i = i + 1) {
5179
- var attr = attrs[i].replace(/\s/g, '');
5180
- var matches = attr.match(WIDTH);
5181
-
5182
- if (matches !== null && matches.length >= 1) {
5183
- return matches[1];
5184
- }
5185
- }
5186
-
5187
- return null;
5188
- }
5189
-
5190
- return method;
5191
- };
5192
-
5193
- Select2.prototype._bindAdapters = function () {
5194
- this.dataAdapter.bind(this, this.$container);
5195
- this.selection.bind(this, this.$container);
5196
-
5197
- this.dropdown.bind(this, this.$container);
5198
- this.results.bind(this, this.$container);
5199
- };
5200
-
5201
- Select2.prototype._registerDomEvents = function () {
5202
- var self = this;
5203
-
5204
- this.$element.on('change.select2', function () {
5205
- self.dataAdapter.current(function (data) {
5206
- self.trigger('selection:update', {
5207
- data: data
5208
- });
5209
- });
5210
- });
5211
-
5212
- this.$element.on('focus.select2', function (evt) {
5213
- self.trigger('focus', evt);
5214
- });
5215
-
5216
- this._syncA = Utils.bind(this._syncAttributes, this);
5217
- this._syncS = Utils.bind(this._syncSubtree, this);
5218
-
5219
- if (this.$element[0].attachEvent) {
5220
- this.$element[0].attachEvent('onpropertychange', this._syncA);
5221
- }
5222
-
5223
- var observer = window.MutationObserver ||
5224
- window.WebKitMutationObserver ||
5225
- window.MozMutationObserver
5226
- ;
5227
-
5228
- if (observer != null) {
5229
- this._observer = new observer(function (mutations) {
5230
- $.each(mutations, self._syncA);
5231
- $.each(mutations, self._syncS);
5232
- });
5233
- this._observer.observe(this.$element[0], {
5234
- attributes: true,
5235
- childList: true,
5236
- subtree: false
5237
- });
5238
- } else if (this.$element[0].addEventListener) {
5239
- this.$element[0].addEventListener(
5240
- 'DOMAttrModified',
5241
- self._syncA,
5242
- false
5243
- );
5244
- this.$element[0].addEventListener(
5245
- 'DOMNodeInserted',
5246
- self._syncS,
5247
- false
5248
- );
5249
- this.$element[0].addEventListener(
5250
- 'DOMNodeRemoved',
5251
- self._syncS,
5252
- false
5253
- );
5254
- }
5255
- };
5256
-
5257
- Select2.prototype._registerDataEvents = function () {
5258
- var self = this;
5259
-
5260
- this.dataAdapter.on('*', function (name, params) {
5261
- self.trigger(name, params);
5262
- });
5263
- };
5264
-
5265
- Select2.prototype._registerSelectionEvents = function () {
5266
- var self = this;
5267
- var nonRelayEvents = ['toggle', 'focus'];
5268
-
5269
- this.selection.on('toggle', function () {
5270
- self.toggleDropdown();
5271
- });
5272
-
5273
- this.selection.on('focus', function (params) {
5274
- self.focus(params);
5275
- });
5276
-
5277
- this.selection.on('*', function (name, params) {
5278
- if ($.inArray(name, nonRelayEvents) !== -1) {
5279
- return;
5280
- }
5281
-
5282
- self.trigger(name, params);
5283
- });
5284
- };
5285
-
5286
- Select2.prototype._registerDropdownEvents = function () {
5287
- var self = this;
5288
-
5289
- this.dropdown.on('*', function (name, params) {
5290
- self.trigger(name, params);
5291
- });
5292
- };
5293
-
5294
- Select2.prototype._registerResultsEvents = function () {
5295
- var self = this;
5296
-
5297
- this.results.on('*', function (name, params) {
5298
- self.trigger(name, params);
5299
- });
5300
- };
5301
-
5302
- Select2.prototype._registerEvents = function () {
5303
- var self = this;
5304
-
5305
- this.on('open', function () {
5306
- self.$container.addClass('select2-container--open');
5307
- });
5308
-
5309
- this.on('close', function () {
5310
- self.$container.removeClass('select2-container--open');
5311
- });
5312
-
5313
- this.on('enable', function () {
5314
- self.$container.removeClass('select2-container--disabled');
5315
- });
5316
-
5317
- this.on('disable', function () {
5318
- self.$container.addClass('select2-container--disabled');
5319
- });
5320
-
5321
- this.on('blur', function () {
5322
- self.$container.removeClass('select2-container--focus');
5323
- });
5324
-
5325
- this.on('query', function (params) {
5326
- if (!self.isOpen()) {
5327
- self.trigger('open', {});
5328
- }
5329
-
5330
- this.dataAdapter.query(params, function (data) {
5331
- self.trigger('results:all', {
5332
- data: data,
5333
- query: params
5334
- });
5335
- });
5336
- });
5337
-
5338
- this.on('query:append', function (params) {
5339
- this.dataAdapter.query(params, function (data) {
5340
- self.trigger('results:append', {
5341
- data: data,
5342
- query: params
5343
- });
5344
- });
5345
- });
5346
-
5347
- this.on('keypress', function (evt) {
5348
- var key = evt.which;
5349
-
5350
- if (self.isOpen()) {
5351
- if (key === KEYS.ESC || key === KEYS.TAB ||
5352
- (key === KEYS.UP && evt.altKey)) {
5353
- self.close();
5354
-
5355
- evt.preventDefault();
5356
- } else if (key === KEYS.ENTER) {
5357
- self.trigger('results:select', {});
5358
-
5359
- evt.preventDefault();
5360
- } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
5361
- self.trigger('results:toggle', {});
5362
-
5363
- evt.preventDefault();
5364
- } else if (key === KEYS.UP) {
5365
- self.trigger('results:previous', {});
5366
-
5367
- evt.preventDefault();
5368
- } else if (key === KEYS.DOWN) {
5369
- self.trigger('results:next', {});
5370
-
5371
- evt.preventDefault();
5372
- }
5373
- } else {
5374
- if (key === KEYS.ENTER || key === KEYS.SPACE ||
5375
- (key === KEYS.DOWN && evt.altKey)) {
5376
- self.open();
5377
-
5378
- evt.preventDefault();
5379
- }
5380
- }
5381
- });
5382
- };
5383
-
5384
- Select2.prototype._syncAttributes = function () {
5385
- this.options.set('disabled', this.$element.prop('disabled'));
5386
-
5387
- if (this.options.get('disabled')) {
5388
- if (this.isOpen()) {
5389
- this.close();
5390
- }
5391
-
5392
- this.trigger('disable', {});
5393
- } else {
5394
- this.trigger('enable', {});
5395
- }
5396
- };
5397
-
5398
- Select2.prototype._syncSubtree = function (evt, mutations) {
5399
- var changed = false;
5400
- var self = this;
5401
-
5402
- // Ignore any mutation events raised for elements that aren't options or
5403
- // optgroups. This handles the case when the select element is destroyed
5404
- if (
5405
- evt && evt.target && (
5406
- evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
5407
- )
5408
- ) {
5409
- return;
5410
- }
5411
-
5412
- if (!mutations) {
5413
- // If mutation events aren't supported, then we can only assume that the
5414
- // change affected the selections
5415
- changed = true;
5416
- } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
5417
- for (var n = 0; n < mutations.addedNodes.length; n++) {
5418
- var node = mutations.addedNodes[n];
5419
-
5420
- if (node.selected) {
5421
- changed = true;
5422
- }
5423
- }
5424
- } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
5425
- changed = true;
5426
- }
5427
-
5428
- // Only re-pull the data if we think there is a change
5429
- if (changed) {
5430
- this.dataAdapter.current(function (currentData) {
5431
- self.trigger('selection:update', {
5432
- data: currentData
5433
- });
5434
- });
5435
- }
5436
- };
5437
-
5438
- /**
5439
- * Override the trigger method to automatically trigger pre-events when
5440
- * there are events that can be prevented.
5441
- */
5442
- Select2.prototype.trigger = function (name, args) {
5443
- var actualTrigger = Select2.__super__.trigger;
5444
- var preTriggerMap = {
5445
- 'open': 'opening',
5446
- 'close': 'closing',
5447
- 'select': 'selecting',
5448
- 'unselect': 'unselecting'
5449
- };
5450
-
5451
- if (args === undefined) {
5452
- args = {};
5453
- }
5454
-
5455
- if (name in preTriggerMap) {
5456
- var preTriggerName = preTriggerMap[name];
5457
- var preTriggerArgs = {
5458
- prevented: false,
5459
- name: name,
5460
- args: args
5461
- };
5462
-
5463
- actualTrigger.call(this, preTriggerName, preTriggerArgs);
5464
-
5465
- if (preTriggerArgs.prevented) {
5466
- args.prevented = true;
5467
-
5468
- return;
5469
- }
5470
- }
5471
-
5472
- actualTrigger.call(this, name, args);
5473
- };
5474
-
5475
- Select2.prototype.toggleDropdown = function () {
5476
- if (this.options.get('disabled')) {
5477
- return;
5478
- }
5479
-
5480
- if (this.isOpen()) {
5481
- this.close();
5482
- } else {
5483
- this.open();
5484
- }
5485
- };
5486
-
5487
- Select2.prototype.open = function () {
5488
- if (this.isOpen()) {
5489
- return;
5490
- }
5491
-
5492
- this.trigger('query', {});
5493
- };
5494
-
5495
- Select2.prototype.close = function () {
5496
- if (!this.isOpen()) {
5497
- return;
5498
- }
5499
-
5500
- this.trigger('close', {});
5501
- };
5502
-
5503
- Select2.prototype.isOpen = function () {
5504
- return this.$container.hasClass('select2-container--open');
5505
- };
5506
-
5507
- Select2.prototype.hasFocus = function () {
5508
- return this.$container.hasClass('select2-container--focus');
5509
- };
5510
-
5511
- Select2.prototype.focus = function (data) {
5512
- // No need to re-trigger focus events if we are already focused
5513
- if (this.hasFocus()) {
5514
- return;
5515
- }
5516
-
5517
- this.$container.addClass('select2-container--focus');
5518
- this.trigger('focus', {});
5519
- };
5520
-
5521
- Select2.prototype.enable = function (args) {
5522
- if (this.options.get('debug') && window.console && console.warn) {
5523
- console.warn(
5524
- 'Select2: The `select2("enable")` method has been deprecated and will' +
5525
- ' be removed in later Select2 versions. Use $element.prop("disabled")' +
5526
- ' instead.'
5527
- );
5528
- }
5529
-
5530
- if (args == null || args.length === 0) {
5531
- args = [true];
5532
- }
5533
-
5534
- var disabled = !args[0];
5535
-
5536
- this.$element.prop('disabled', disabled);
5537
- };
5538
-
5539
- Select2.prototype.data = function () {
5540
- if (this.options.get('debug') &&
5541
- arguments.length > 0 && window.console && console.warn) {
5542
- console.warn(
5543
- 'Select2: Data can no longer be set using `select2("data")`. You ' +
5544
- 'should consider setting the value instead using `$element.val()`.'
5545
- );
5546
- }
5547
-
5548
- var data = [];
5549
-
5550
- this.dataAdapter.current(function (currentData) {
5551
- data = currentData;
5552
- });
5553
-
5554
- return data;
5555
- };
5556
-
5557
- Select2.prototype.val = function (args) {
5558
- if (this.options.get('debug') && window.console && console.warn) {
5559
- console.warn(
5560
- 'Select2: The `select2("val")` method has been deprecated and will be' +
5561
- ' removed in later Select2 versions. Use $element.val() instead.'
5562
- );
5563
- }
5564
-
5565
- if (args == null || args.length === 0) {
5566
- return this.$element.val();
5567
- }
5568
-
5569
- var newVal = args[0];
5570
-
5571
- if ($.isArray(newVal)) {
5572
- newVal = $.map(newVal, function (obj) {
5573
- return obj.toString();
5574
- });
5575
- }
5576
-
5577
- this.$element.val(newVal).trigger('change');
5578
- };
5579
-
5580
- Select2.prototype.destroy = function () {
5581
- this.$container.remove();
5582
-
5583
- if (this.$element[0].detachEvent) {
5584
- this.$element[0].detachEvent('onpropertychange', this._syncA);
5585
- }
5586
-
5587
- if (this._observer != null) {
5588
- this._observer.disconnect();
5589
- this._observer = null;
5590
- } else if (this.$element[0].removeEventListener) {
5591
- this.$element[0]
5592
- .removeEventListener('DOMAttrModified', this._syncA, false);
5593
- this.$element[0]
5594
- .removeEventListener('DOMNodeInserted', this._syncS, false);
5595
- this.$element[0]
5596
- .removeEventListener('DOMNodeRemoved', this._syncS, false);
5597
- }
5598
-
5599
- this._syncA = null;
5600
- this._syncS = null;
5601
-
5602
- this.$element.off('.select2');
5603
- this.$element.attr('tabindex', this.$element.data('old-tabindex'));
5604
-
5605
- this.$element.removeClass('select2-hidden-accessible');
5606
- this.$element.attr('aria-hidden', 'false');
5607
- this.$element.removeData('select2');
5608
-
5609
- this.dataAdapter.destroy();
5610
- this.selection.destroy();
5611
- this.dropdown.destroy();
5612
- this.results.destroy();
5613
-
5614
- this.dataAdapter = null;
5615
- this.selection = null;
5616
- this.dropdown = null;
5617
- this.results = null;
5618
- };
5619
-
5620
- Select2.prototype.render = function () {
5621
- var $container = $(
5622
- '<span class="select2 select2-container">' +
5623
- '<span class="selection"></span>' +
5624
- '<span class="dropdown-wrapper" aria-hidden="true"></span>' +
5625
- '</span>'
5626
- );
5627
-
5628
- $container.attr('dir', this.options.get('dir'));
5629
-
5630
- this.$container = $container;
5631
-
5632
- this.$container.addClass('select2-container--' + this.options.get('theme'));
5633
-
5634
- $container.data('element', this.$element);
5635
-
5636
- return $container;
5637
- };
5638
-
5639
- return Select2;
5640
- });
5641
-
5642
- S2.define('select2/compat/utils',[
5643
- 'jquery'
5644
- ], function ($) {
5645
- function syncCssClasses ($dest, $src, adapter) {
5646
- var classes, replacements = [], adapted;
5647
-
5648
- classes = $.trim($dest.attr('class'));
5649
-
5650
- if (classes) {
5651
- classes = '' + classes; // for IE which returns object
5652
-
5653
- $(classes.split(/\s+/)).each(function () {
5654
- // Save all Select2 classes
5655
- if (this.indexOf('select2-') === 0) {
5656
- replacements.push(this);
5657
- }
5658
- });
5659
- }
5660
-
5661
- classes = $.trim($src.attr('class'));
5662
-
5663
- if (classes) {
5664
- classes = '' + classes; // for IE which returns object
5665
-
5666
- $(classes.split(/\s+/)).each(function () {
5667
- // Only adapt non-Select2 classes
5668
- if (this.indexOf('select2-') !== 0) {
5669
- adapted = adapter(this);
5670
-
5671
- if (adapted != null) {
5672
- replacements.push(adapted);
5673
- }
5674
- }
5675
- });
5676
- }
5677
-
5678
- $dest.attr('class', replacements.join(' '));
5679
- }
5680
-
5681
- return {
5682
- syncCssClasses: syncCssClasses
5683
- };
5684
- });
5685
-
5686
- S2.define('select2/compat/containerCss',[
5687
- 'jquery',
5688
- './utils'
5689
- ], function ($, CompatUtils) {
5690
- // No-op CSS adapter that discards all classes by default
5691
- function _containerAdapter (clazz) {
5692
- return null;
5693
- }
5694
-
5695
- function ContainerCSS () { }
5696
-
5697
- ContainerCSS.prototype.render = function (decorated) {
5698
- var $container = decorated.call(this);
5699
-
5700
- var containerCssClass = this.options.get('containerCssClass') || '';
5701
-
5702
- if ($.isFunction(containerCssClass)) {
5703
- containerCssClass = containerCssClass(this.$element);
5704
- }
5705
-
5706
- var containerCssAdapter = this.options.get('adaptContainerCssClass');
5707
- containerCssAdapter = containerCssAdapter || _containerAdapter;
5708
-
5709
- if (containerCssClass.indexOf(':all:') !== -1) {
5710
- containerCssClass = containerCssClass.replace(':all:', '');
5711
-
5712
- var _cssAdapter = containerCssAdapter;
5713
-
5714
- containerCssAdapter = function (clazz) {
5715
- var adapted = _cssAdapter(clazz);
5716
-
5717
- if (adapted != null) {
5718
- // Append the old one along with the adapted one
5719
- return adapted + ' ' + clazz;
5720
- }
5721
-
5722
- return clazz;
5723
- };
5724
- }
5725
-
5726
- var containerCss = this.options.get('containerCss') || {};
5727
-
5728
- if ($.isFunction(containerCss)) {
5729
- containerCss = containerCss(this.$element);
5730
- }
5731
-
5732
- CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter);
5733
-
5734
- $container.css(containerCss);
5735
- $container.addClass(containerCssClass);
5736
-
5737
- return $container;
5738
- };
5739
-
5740
- return ContainerCSS;
5741
- });
5742
-
5743
- S2.define('select2/compat/dropdownCss',[
5744
- 'jquery',
5745
- './utils'
5746
- ], function ($, CompatUtils) {
5747
- // No-op CSS adapter that discards all classes by default
5748
- function _dropdownAdapter (clazz) {
5749
- return null;
5750
- }
5751
-
5752
- function DropdownCSS () { }
5753
-
5754
- DropdownCSS.prototype.render = function (decorated) {
5755
- var $dropdown = decorated.call(this);
5756
-
5757
- var dropdownCssClass = this.options.get('dropdownCssClass') || '';
5758
-
5759
- if ($.isFunction(dropdownCssClass)) {
5760
- dropdownCssClass = dropdownCssClass(this.$element);
5761
- }
5762
-
5763
- var dropdownCssAdapter = this.options.get('adaptDropdownCssClass');
5764
- dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;
5765
-
5766
- if (dropdownCssClass.indexOf(':all:') !== -1) {
5767
- dropdownCssClass = dropdownCssClass.replace(':all:', '');
5768
-
5769
- var _cssAdapter = dropdownCssAdapter;
5770
-
5771
- dropdownCssAdapter = function (clazz) {
5772
- var adapted = _cssAdapter(clazz);
5773
-
5774
- if (adapted != null) {
5775
- // Append the old one along with the adapted one
5776
- return adapted + ' ' + clazz;
5777
- }
5778
-
5779
- return clazz;
5780
- };
5781
- }
5782
-
5783
- var dropdownCss = this.options.get('dropdownCss') || {};
5784
-
5785
- if ($.isFunction(dropdownCss)) {
5786
- dropdownCss = dropdownCss(this.$element);
5787
- }
5788
-
5789
- CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter);
5790
-
5791
- $dropdown.css(dropdownCss);
5792
- $dropdown.addClass(dropdownCssClass);
5793
-
5794
- return $dropdown;
5795
- };
5796
-
5797
- return DropdownCSS;
5798
- });
5799
-
5800
- S2.define('select2/compat/initSelection',[
5801
- 'jquery'
5802
- ], function ($) {
5803
- function InitSelection (decorated, $element, options) {
5804
- if (options.get('debug') && window.console && console.warn) {
5805
- console.warn(
5806
- 'Select2: The `initSelection` option has been deprecated in favor' +
5807
- ' of a custom data adapter that overrides the `current` method. ' +
5808
- 'This method is now called multiple times instead of a single ' +
5809
- 'time when the instance is initialized. Support will be removed ' +
5810
- 'for the `initSelection` option in future versions of Select2'
5811
- );
5812
- }
5813
-
5814
- this.initSelection = options.get('initSelection');
5815
- this._isInitialized = false;
5816
-
5817
- decorated.call(this, $element, options);
5818
- }
5819
-
5820
- InitSelection.prototype.current = function (decorated, callback) {
5821
- var self = this;
5822
-
5823
- if (this._isInitialized) {
5824
- decorated.call(this, callback);
5825
-
5826
- return;
5827
- }
5828
-
5829
- this.initSelection.call(null, this.$element, function (data) {
5830
- self._isInitialized = true;
5831
-
5832
- if (!$.isArray(data)) {
5833
- data = [data];
5834
- }
5835
-
5836
- callback(data);
5837
- });
5838
- };
5839
-
5840
- return InitSelection;
5841
- });
5842
-
5843
- S2.define('select2/compat/inputData',[
5844
- 'jquery'
5845
- ], function ($) {
5846
- function InputData (decorated, $element, options) {
5847
- this._currentData = [];
5848
- this._valueSeparator = options.get('valueSeparator') || ',';
5849
-
5850
- if ($element.prop('type') === 'hidden') {
5851
- if (options.get('debug') && console && console.warn) {
5852
- console.warn(
5853
- 'Select2: Using a hidden input with Select2 is no longer ' +
5854
- 'supported and may stop working in the future. It is recommended ' +
5855
- 'to use a `<select>` element instead.'
5856
- );
5857
- }
5858
- }
5859
-
5860
- decorated.call(this, $element, options);
5861
- }
5862
-
5863
- InputData.prototype.current = function (_, callback) {
5864
- function getSelected (data, selectedIds) {
5865
- var selected = [];
5866
-
5867
- if (data.selected || $.inArray(data.id, selectedIds) !== -1) {
5868
- data.selected = true;
5869
- selected.push(data);
5870
- } else {
5871
- data.selected = false;
5872
- }
5873
-
5874
- if (data.children) {
5875
- selected.push.apply(selected, getSelected(data.children, selectedIds));
5876
- }
5877
-
5878
- return selected;
5879
- }
5880
-
5881
- var selected = [];
5882
-
5883
- for (var d = 0; d < this._currentData.length; d++) {
5884
- var data = this._currentData[d];
5885
-
5886
- selected.push.apply(
5887
- selected,
5888
- getSelected(
5889
- data,
5890
- this.$element.val().split(
5891
- this._valueSeparator
5892
- )
5893
- )
5894
- );
5895
- }
5896
-
5897
- callback(selected);
5898
- };
5899
-
5900
- InputData.prototype.select = function (_, data) {
5901
- if (!this.options.get('multiple')) {
5902
- this.current(function (allData) {
5903
- $.map(allData, function (data) {
5904
- data.selected = false;
5905
- });
5906
- });
5907
-
5908
- this.$element.val(data.id);
5909
- this.$element.trigger('change');
5910
- } else {
5911
- var value = this.$element.val();
5912
- value += this._valueSeparator + data.id;
5913
-
5914
- this.$element.val(value);
5915
- this.$element.trigger('change');
5916
- }
5917
- };
5918
-
5919
- InputData.prototype.unselect = function (_, data) {
5920
- var self = this;
5921
-
5922
- data.selected = false;
5923
-
5924
- this.current(function (allData) {
5925
- var values = [];
5926
-
5927
- for (var d = 0; d < allData.length; d++) {
5928
- var item = allData[d];
5929
-
5930
- if (data.id == item.id) {
5931
- continue;
5932
- }
5933
-
5934
- values.push(item.id);
5935
- }
5936
-
5937
- self.$element.val(values.join(self._valueSeparator));
5938
- self.$element.trigger('change');
5939
- });
5940
- };
5941
-
5942
- InputData.prototype.query = function (_, params, callback) {
5943
- var results = [];
5944
-
5945
- for (var d = 0; d < this._currentData.length; d++) {
5946
- var data = this._currentData[d];
5947
-
5948
- var matches = this.matches(params, data);
5949
-
5950
- if (matches !== null) {
5951
- results.push(matches);
5952
- }
5953
- }
5954
-
5955
- callback({
5956
- results: results
5957
- });
5958
- };
5959
-
5960
- InputData.prototype.addOptions = function (_, $options) {
5961
- var options = $.map($options, function ($option) {
5962
- return $.data($option[0], 'data');
5963
- });
5964
-
5965
- this._currentData.push.apply(this._currentData, options);
5966
- };
5967
-
5968
- return InputData;
5969
- });
5970
-
5971
- S2.define('select2/compat/matcher',[
5972
- 'jquery'
5973
- ], function ($) {
5974
- function oldMatcher (matcher) {
5975
- function wrappedMatcher (params, data) {
5976
- var match = $.extend(true, {}, data);
5977
-
5978
- if (params.term == null || $.trim(params.term) === '') {
5979
- return match;
5980
- }
5981
-
5982
- if (data.children) {
5983
- for (var c = data.children.length - 1; c >= 0; c--) {
5984
- var child = data.children[c];
5985
-
5986
- // Check if the child object matches
5987
- // The old matcher returned a boolean true or false
5988
- var doesMatch = matcher(params.term, child.text, child);
5989
-
5990
- // If the child didn't match, pop it off
5991
- if (!doesMatch) {
5992
- match.children.splice(c, 1);
5993
- }
5994
- }
5995
-
5996
- if (match.children.length > 0) {
5997
- return match;
5998
- }
5999
- }
6000
-
6001
- if (matcher(params.term, data.text, data)) {
6002
- return match;
6003
- }
6004
-
6005
- return null;
6006
- }
6007
-
6008
- return wrappedMatcher;
6009
- }
6010
-
6011
- return oldMatcher;
6012
- });
6013
-
6014
- S2.define('select2/compat/query',[
6015
-
6016
- ], function () {
6017
- function Query (decorated, $element, options) {
6018
- if (options.get('debug') && window.console && console.warn) {
6019
- console.warn(
6020
- 'Select2: The `query` option has been deprecated in favor of a ' +
6021
- 'custom data adapter that overrides the `query` method. Support ' +
6022
- 'will be removed for the `query` option in future versions of ' +
6023
- 'Select2.'
6024
- );
6025
- }
6026
-
6027
- decorated.call(this, $element, options);
6028
- }
6029
-
6030
- Query.prototype.query = function (_, params, callback) {
6031
- params.callback = callback;
6032
-
6033
- var query = this.options.get('query');
6034
-
6035
- query.call(null, params);
6036
- };
6037
-
6038
- return Query;
6039
- });
6040
-
6041
- S2.define('select2/dropdown/attachContainer',[
6042
-
6043
- ], function () {
6044
- function AttachContainer (decorated, $element, options) {
6045
- decorated.call(this, $element, options);
6046
- }
6047
-
6048
- AttachContainer.prototype.position =
6049
- function (decorated, $dropdown, $container) {
6050
- var $dropdownContainer = $container.find('.dropdown-wrapper');
6051
- $dropdownContainer.append($dropdown);
6052
-
6053
- $dropdown.addClass('select2-dropdown--below');
6054
- $container.addClass('select2-container--below');
6055
- };
6056
-
6057
- return AttachContainer;
6058
- });
6059
-
6060
- S2.define('select2/dropdown/stopPropagation',[
6061
-
6062
- ], function () {
6063
- function StopPropagation () { }
6064
-
6065
- StopPropagation.prototype.bind = function (decorated, container, $container) {
6066
- decorated.call(this, container, $container);
6067
-
6068
- var stoppedEvents = [
6069
- 'blur',
6070
- 'change',
6071
- 'click',
6072
- 'dblclick',
6073
- 'focus',
6074
- 'focusin',
6075
- 'focusout',
6076
- 'input',
6077
- 'keydown',
6078
- 'keyup',
6079
- 'keypress',
6080
- 'mousedown',
6081
- 'mouseenter',
6082
- 'mouseleave',
6083
- 'mousemove',
6084
- 'mouseover',
6085
- 'mouseup',
6086
- 'search',
6087
- 'touchend',
6088
- 'touchstart'
6089
- ];
6090
-
6091
- this.$dropdown.on(stoppedEvents.join(' '), function (evt) {
6092
- evt.stopPropagation();
6093
- });
6094
- };
6095
-
6096
- return StopPropagation;
6097
- });
6098
-
6099
- S2.define('select2/selection/stopPropagation',[
6100
-
6101
- ], function () {
6102
- function StopPropagation () { }
6103
-
6104
- StopPropagation.prototype.bind = function (decorated, container, $container) {
6105
- decorated.call(this, container, $container);
6106
-
6107
- var stoppedEvents = [
6108
- 'blur',
6109
- 'change',
6110
- 'click',
6111
- 'dblclick',
6112
- 'focus',
6113
- 'focusin',
6114
- 'focusout',
6115
- 'input',
6116
- 'keydown',
6117
- 'keyup',
6118
- 'keypress',
6119
- 'mousedown',
6120
- 'mouseenter',
6121
- 'mouseleave',
6122
- 'mousemove',
6123
- 'mouseover',
6124
- 'mouseup',
6125
- 'search',
6126
- 'touchend',
6127
- 'touchstart'
6128
- ];
6129
-
6130
- this.$selection.on(stoppedEvents.join(' '), function (evt) {
6131
- evt.stopPropagation();
6132
- });
6133
- };
6134
-
6135
- return StopPropagation;
6136
- });
6137
-
6138
- /*!
6139
- * jQuery Mousewheel 3.1.13
6140
- *
6141
- * Copyright jQuery Foundation and other contributors
6142
- * Released under the MIT license
6143
- * http://jquery.org/license
6144
- */
6145
-
6146
- (function (factory) {
6147
- if ( typeof S2.define === 'function' && S2.define.amd ) {
6148
- // AMD. Register as an anonymous module.
6149
- S2.define('jquery-mousewheel',['jquery'], factory);
6150
- } else if (typeof exports === 'object') {
6151
- // Node/CommonJS style for Browserify
6152
- module.exports = factory;
6153
- } else {
6154
- // Browser globals
6155
- factory(jQuery);
6156
- }
6157
- }(function ($) {
6158
-
6159
- var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
6160
- toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
6161
- ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
6162
- slice = Array.prototype.slice,
6163
- nullLowestDeltaTimeout, lowestDelta;
6164
-
6165
- if ( $.event.fixHooks ) {
6166
- for ( var i = toFix.length; i; ) {
6167
- $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
6168
- }
6169
- }
6170
-
6171
- var special = $.event.special.mousewheel = {
6172
- version: '3.1.12',
6173
-
6174
- setup: function() {
6175
- if ( this.addEventListener ) {
6176
- for ( var i = toBind.length; i; ) {
6177
- this.addEventListener( toBind[--i], handler, false );
6178
- }
6179
- } else {
6180
- this.onmousewheel = handler;
6181
- }
6182
- // Store the line height and page height for this particular element
6183
- $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
6184
- $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
6185
- },
6186
-
6187
- teardown: function() {
6188
- if ( this.removeEventListener ) {
6189
- for ( var i = toBind.length; i; ) {
6190
- this.removeEventListener( toBind[--i], handler, false );
6191
- }
6192
- } else {
6193
- this.onmousewheel = null;
6194
- }
6195
- // Clean up the data we added to the element
6196
- $.removeData(this, 'mousewheel-line-height');
6197
- $.removeData(this, 'mousewheel-page-height');
6198
- },
6199
-
6200
- getLineHeight: function(elem) {
6201
- var $elem = $(elem),
6202
- $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
6203
- if (!$parent.length) {
6204
- $parent = $('body');
6205
- }
6206
- return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
6207
- },
6208
-
6209
- getPageHeight: function(elem) {
6210
- return $(elem).height();
6211
- },
6212
-
6213
- settings: {
6214
- adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
6215
- normalizeOffset: true // calls getBoundingClientRect for each event
6216
- }
6217
- };
6218
-
6219
- $.fn.extend({
6220
- mousewheel: function(fn) {
6221
- return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
6222
- },
6223
-
6224
- unmousewheel: function(fn) {
6225
- return this.unbind('mousewheel', fn);
6226
- }
6227
- });
6228
-
6229
-
6230
- function handler(event) {
6231
- var orgEvent = event || window.event,
6232
- args = slice.call(arguments, 1),
6233
- delta = 0,
6234
- deltaX = 0,
6235
- deltaY = 0,
6236
- absDelta = 0,
6237
- offsetX = 0,
6238
- offsetY = 0;
6239
- event = $.event.fix(orgEvent);
6240
- event.type = 'mousewheel';
6241
-
6242
- // Old school scrollwheel delta
6243
- if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
6244
- if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
6245
- if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
6246
- if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
6247
-
6248
- // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
6249
- if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
6250
- deltaX = deltaY * -1;
6251
- deltaY = 0;
6252
- }
6253
-
6254
- // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
6255
- delta = deltaY === 0 ? deltaX : deltaY;
6256
-
6257
- // New school wheel delta (wheel event)
6258
- if ( 'deltaY' in orgEvent ) {
6259
- deltaY = orgEvent.deltaY * -1;
6260
- delta = deltaY;
6261
- }
6262
- if ( 'deltaX' in orgEvent ) {
6263
- deltaX = orgEvent.deltaX;
6264
- if ( deltaY === 0 ) { delta = deltaX * -1; }
6265
- }
6266
-
6267
- // No change actually happened, no reason to go any further
6268
- if ( deltaY === 0 && deltaX === 0 ) { return; }
6269
-
6270
- // Need to convert lines and pages to pixels if we aren't already in pixels
6271
- // There are three delta modes:
6272
- // * deltaMode 0 is by pixels, nothing to do
6273
- // * deltaMode 1 is by lines
6274
- // * deltaMode 2 is by pages
6275
- if ( orgEvent.deltaMode === 1 ) {
6276
- var lineHeight = $.data(this, 'mousewheel-line-height');
6277
- delta *= lineHeight;
6278
- deltaY *= lineHeight;
6279
- deltaX *= lineHeight;
6280
- } else if ( orgEvent.deltaMode === 2 ) {
6281
- var pageHeight = $.data(this, 'mousewheel-page-height');
6282
- delta *= pageHeight;
6283
- deltaY *= pageHeight;
6284
- deltaX *= pageHeight;
6285
- }
6286
-
6287
- // Store lowest absolute delta to normalize the delta values
6288
- absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
6289
-
6290
- if ( !lowestDelta || absDelta < lowestDelta ) {
6291
- lowestDelta = absDelta;
6292
-
6293
- // Adjust older deltas if necessary
6294
- if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
6295
- lowestDelta /= 40;
6296
- }
6297
- }
6298
-
6299
- // Adjust older deltas if necessary
6300
- if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
6301
- // Divide all the things by 40!
6302
- delta /= 40;
6303
- deltaX /= 40;
6304
- deltaY /= 40;
6305
- }
6306
-
6307
- // Get a whole, normalized value for the deltas
6308
- delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
6309
- deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
6310
- deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
6311
-
6312
- // Normalise offsetX and offsetY properties
6313
- if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
6314
- var boundingRect = this.getBoundingClientRect();
6315
- offsetX = event.clientX - boundingRect.left;
6316
- offsetY = event.clientY - boundingRect.top;
6317
- }
6318
-
6319
- // Add information to the event object
6320
- event.deltaX = deltaX;
6321
- event.deltaY = deltaY;
6322
- event.deltaFactor = lowestDelta;
6323
- event.offsetX = offsetX;
6324
- event.offsetY = offsetY;
6325
- // Go ahead and set deltaMode to 0 since we converted to pixels
6326
- // Although this is a little odd since we overwrite the deltaX/Y
6327
- // properties with normalized deltas.
6328
- event.deltaMode = 0;
6329
-
6330
- // Add event and delta to the front of the arguments
6331
- args.unshift(event, delta, deltaX, deltaY);
6332
-
6333
- // Clearout lowestDelta after sometime to better
6334
- // handle multiple device types that give different
6335
- // a different lowestDelta
6336
- // Ex: trackpad = 3 and mouse wheel = 120
6337
- if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
6338
- nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
6339
-
6340
- return ($.event.dispatch || $.event.handle).apply(this, args);
6341
- }
6342
-
6343
- function nullLowestDelta() {
6344
- lowestDelta = null;
6345
- }
6346
-
6347
- function shouldAdjustOldDeltas(orgEvent, absDelta) {
6348
- // If this is an older event and the delta is divisable by 120,
6349
- // then we are assuming that the browser is treating this as an
6350
- // older mouse wheel event and that we should divide the deltas
6351
- // by 40 to try and get a more usable deltaFactor.
6352
- // Side note, this actually impacts the reported scroll distance
6353
- // in older browsers and can cause scrolling to be slower than native.
6354
- // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
6355
- return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
6356
- }
6357
-
6358
- }));
6359
-
6360
- S2.define('jquery.select2',[
6361
- 'jquery',
6362
- 'jquery-mousewheel',
6363
-
6364
- './select2/core',
6365
- './select2/defaults'
6366
- ], function ($, _, Select2, Defaults) {
6367
- if ($.fn.select2 == null) {
6368
- // All methods that should return the element
6369
- var thisMethods = ['open', 'close', 'destroy'];
6370
-
6371
- $.fn.select2 = function (options) {
6372
- options = options || {};
6373
-
6374
- if (typeof options === 'object') {
6375
- this.each(function () {
6376
- var instanceOptions = $.extend(true, {}, options);
6377
-
6378
- var instance = new Select2($(this), instanceOptions);
6379
- });
6380
-
6381
- return this;
6382
- } else if (typeof options === 'string') {
6383
- var ret;
6384
- var args = Array.prototype.slice.call(arguments, 1);
6385
-
6386
- this.each(function () {
6387
- var instance = $(this).data('select2');
6388
-
6389
- if (instance == null && window.console && console.error) {
6390
- console.error(
6391
- 'The select2(\'' + options + '\') method was called on an ' +
6392
- 'element that is not using Select2.'
6393
- );
6394
- }
6395
-
6396
- ret = instance[options].apply(instance, args);
6397
- });
6398
-
6399
- // Check if we should be returning `this`
6400
- if ($.inArray(options, thisMethods) > -1) {
6401
- return this;
6402
- }
6403
-
6404
- return ret;
6405
- } else {
6406
- throw new Error('Invalid arguments for Select2: ' + options);
6407
- }
6408
- };
6409
- }
6410
-
6411
- if ($.fn.select2.defaults == null) {
6412
- $.fn.select2.defaults = Defaults;
6413
- }
6414
-
6415
- return Select2;
6416
- });
6417
-
6418
- // Return the AMD loader configuration so it can be used outside of this file
6419
- return {
6420
- define: S2.define,
6421
- require: S2.require
6422
- };
6423
- }());
6424
-
6425
- // Autoload the jQuery bindings
6426
- // We know that all of the modules exist above this, so we're safe
6427
- var select2 = S2.require('jquery.select2');
6428
-
6429
- // Hold the AMD module references on the jQuery function that was just loaded
6430
- // This allows Select2 to use the internal loader outside of this file, such
6431
- // as in the language files.
6432
- jQuery.fn.select2.amd = S2;
6433
-
6434
- // Return the Select2 instance for anyone who is importing it.
6435
- return select2;
6436
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/select2-4.0.3/js/select2.full.min.js DELETED
@@ -1,3 +0,0 @@
1
- /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K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ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
2
- if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b),d=g.$element.find("option").filter(function(){return a(this).val()===c.id});if(!d.length){var e=g.option(c);e.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([e])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null;
3
- },e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&(f=d(this),null!=f&&g.push(f))})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;return this._isInitialized?void b.call(this,c):void this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `<select>` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f<this._currentData.length;f++){var g=this._currentData[f];e.push.apply(e,d(g,this.$element.val().split(this._valueSeparator)))}c(e)},b.prototype.select=function(b,c){if(this.options.get("multiple")){var d=this.$element.val();d+=this._valueSeparator+c.id,this.$element.val(d),this.$element.trigger("change")}else this.current(function(b){a.map(b,function(a){a.selected=!1})}),this.$element.val(c.id),this.$element.trigger("change")},b.prototype.unselect=function(a,b){var c=this;b.selected=!1,this.current(function(a){for(var d=[],e=0;e<a.length;e++){var f=a[e];b.id!=f.id&&d.push(f.id)}c.$element.val(d.join(c._valueSeparator)),c.$element.trigger("change")})},b.prototype.query=function(a,b,c){for(var d=[],e=0;e<this._currentData.length;e++){var f=this._currentData[e],g=this.matches(b,f);null!==g&&d.push(g)}c({results:d})},b.prototype.addOptions=function(b,c){var d=a.map(c,function(b){return a.data(b[0],"data")});this._currentData.push.apply(this._currentData,d)},b}),b.define("select2/compat/matcher",["jquery"],function(a){function b(b){function c(c,d){var e=a.extend(!0,{},d);if(null==c.term||""===a.trim(c.term))return e;if(d.children){for(var f=d.children.length-1;f>=0;f--){var g=d.children[f],h=b(c.term,g.text,g);h||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c;var d=this.options.get("query");d.call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){var d=c.find(".dropdown-wrapper");d.append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
 
 
 
js/select2-4.0.3/js/select2.js DELETED
@@ -1,5725 +0,0 @@
1
- /*!
2
- * Select2 4.0.3
3
- * https://select2.github.io
4
- *
5
- * Released under the MIT license
6
- * https://github.com/select2/select2/blob/master/LICENSE.md
7
- */
8
- (function (factory) {
9
- if (typeof define === 'function' && define.amd) {
10
- // AMD. Register as an anonymous module.
11
- define(['jquery'], factory);
12
- } else if (typeof exports === 'object') {
13
- // Node/CommonJS
14
- factory(require('jquery'));
15
- } else {
16
- // Browser globals
17
- factory(jQuery);
18
- }
19
- }(function (jQuery) {
20
- // This is needed so we can catch the AMD loader configuration and use it
21
- // The inner file should be wrapped (by `banner.start.js`) in a function that
22
- // returns the AMD loader references.
23
- var S2 =
24
- (function () {
25
- // Restore the Select2 AMD loader so it can be used
26
- // Needed mostly in the language files, where the loader is not inserted
27
- if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
28
- var S2 = jQuery.fn.select2.amd;
29
- }
30
- var S2;(function () { if (!S2 || !S2.requirejs) {
31
- if (!S2) { S2 = {}; } else { require = S2; }
32
- /**
33
- * @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
34
- * Available via the MIT or new BSD license.
35
- * see: http://github.com/jrburke/almond for details
36
- */
37
- //Going sloppy to avoid 'use strict' string cost, but strict practices should
38
- //be followed.
39
- /*jslint sloppy: true */
40
- /*global setTimeout: false */
41
-
42
- var requirejs, require, define;
43
- (function (undef) {
44
- var main, req, makeMap, handlers,
45
- defined = {},
46
- waiting = {},
47
- config = {},
48
- defining = {},
49
- hasOwn = Object.prototype.hasOwnProperty,
50
- aps = [].slice,
51
- jsSuffixRegExp = /\.js$/;
52
-
53
- function hasProp(obj, prop) {
54
- return hasOwn.call(obj, prop);
55
- }
56
-
57
- /**
58
- * Given a relative module name, like ./something, normalize it to
59
- * a real name that can be mapped to a path.
60
- * @param {String} name the relative name
61
- * @param {String} baseName a real name that the name arg is relative
62
- * to.
63
- * @returns {String} normalized name
64
- */
65
- function normalize(name, baseName) {
66
- var nameParts, nameSegment, mapValue, foundMap, lastIndex,
67
- foundI, foundStarMap, starI, i, j, part,
68
- baseParts = baseName && baseName.split("/"),
69
- map = config.map,
70
- starMap = (map && map['*']) || {};
71
-
72
- //Adjust any relative paths.
73
- if (name && name.charAt(0) === ".") {
74
- //If have a base name, try to normalize against it,
75
- //otherwise, assume it is a top-level require that will
76
- //be relative to baseUrl in the end.
77
- if (baseName) {
78
- name = name.split('/');
79
- lastIndex = name.length - 1;
80
-
81
- // Node .js allowance:
82
- if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
83
- name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
84
- }
85
-
86
- //Lop off the last part of baseParts, so that . matches the
87
- //"directory" and not name of the baseName's module. For instance,
88
- //baseName of "one/two/three", maps to "one/two/three.js", but we
89
- //want the directory, "one/two" for this normalization.
90
- name = baseParts.slice(0, baseParts.length - 1).concat(name);
91
-
92
- //start trimDots
93
- for (i = 0; i < name.length; i += 1) {
94
- part = name[i];
95
- if (part === ".") {
96
- name.splice(i, 1);
97
- i -= 1;
98
- } else if (part === "..") {
99
- if (i === 1 && (name[2] === '..' || name[0] === '..')) {
100
- //End of the line. Keep at least one non-dot
101
- //path segment at the front so it can be mapped
102
- //correctly to disk. Otherwise, there is likely
103
- //no path mapping for a path starting with '..'.
104
- //This can still fail, but catches the most reasonable
105
- //uses of ..
106
- break;
107
- } else if (i > 0) {
108
- name.splice(i - 1, 2);
109
- i -= 2;
110
- }
111
- }
112
- }
113
- //end trimDots
114
-
115
- name = name.join("/");
116
- } else if (name.indexOf('./') === 0) {
117
- // No baseName, so this is ID is resolved relative
118
- // to baseUrl, pull off the leading dot.
119
- name = name.substring(2);
120
- }
121
- }
122
-
123
- //Apply map config if available.
124
- if ((baseParts || starMap) && map) {
125
- nameParts = name.split('/');
126
-
127
- for (i = nameParts.length; i > 0; i -= 1) {
128
- nameSegment = nameParts.slice(0, i).join("/");
129
-
130
- if (baseParts) {
131
- //Find the longest baseName segment match in the config.
132
- //So, do joins on the biggest to smallest lengths of baseParts.
133
- for (j = baseParts.length; j > 0; j -= 1) {
134
- mapValue = map[baseParts.slice(0, j).join('/')];
135
-
136
- //baseName segment has config, find if it has one for
137
- //this name.
138
- if (mapValue) {
139
- mapValue = mapValue[nameSegment];
140
- if (mapValue) {
141
- //Match, update name to the new value.
142
- foundMap = mapValue;
143
- foundI = i;
144
- break;
145
- }
146
- }
147
- }
148
- }
149
-
150
- if (foundMap) {
151
- break;
152
- }
153
-
154
- //Check for a star map match, but just hold on to it,
155
- //if there is a shorter segment match later in a matching
156
- //config, then favor over this star map.
157
- if (!foundStarMap && starMap && starMap[nameSegment]) {
158
- foundStarMap = starMap[nameSegment];
159
- starI = i;
160
- }
161
- }
162
-
163
- if (!foundMap && foundStarMap) {
164
- foundMap = foundStarMap;
165
- foundI = starI;
166
- }
167
-
168
- if (foundMap) {
169
- nameParts.splice(0, foundI, foundMap);
170
- name = nameParts.join('/');
171
- }
172
- }
173
-
174
- return name;
175
- }
176
-
177
- function makeRequire(relName, forceSync) {
178
- return function () {
179
- //A version of a require function that passes a moduleName
180
- //value for items that may need to
181
- //look up paths relative to the moduleName
182
- var args = aps.call(arguments, 0);
183
-
184
- //If first arg is not require('string'), and there is only
185
- //one arg, it is the array form without a callback. Insert
186
- //a null so that the following concat is correct.
187
- if (typeof args[0] !== 'string' && args.length === 1) {
188
- args.push(null);
189
- }
190
- return req.apply(undef, args.concat([relName, forceSync]));
191
- };
192
- }
193
-
194
- function makeNormalize(relName) {
195
- return function (name) {
196
- return normalize(name, relName);
197
- };
198
- }
199
-
200
- function makeLoad(depName) {
201
- return function (value) {
202
- defined[depName] = value;
203
- };
204
- }
205
-
206
- function callDep(name) {
207
- if (hasProp(waiting, name)) {
208
- var args = waiting[name];
209
- delete waiting[name];
210
- defining[name] = true;
211
- main.apply(undef, args);
212
- }
213
-
214
- if (!hasProp(defined, name) && !hasProp(defining, name)) {
215
- throw new Error('No ' + name);
216
- }
217
- return defined[name];
218
- }
219
-
220
- //Turns a plugin!resource to [plugin, resource]
221
- //with the plugin being undefined if the name
222
- //did not have a plugin prefix.
223
- function splitPrefix(name) {
224
- var prefix,
225
- index = name ? name.indexOf('!') : -1;
226
- if (index > -1) {
227
- prefix = name.substring(0, index);
228
- name = name.substring(index + 1, name.length);
229
- }
230
- return [prefix, name];
231
- }
232
-
233
- /**
234
- * Makes a name map, normalizing the name, and using a plugin
235
- * for normalization if necessary. Grabs a ref to plugin
236
- * too, as an optimization.
237
- */
238
- makeMap = function (name, relName) {
239
- var plugin,
240
- parts = splitPrefix(name),
241
- prefix = parts[0];
242
-
243
- name = parts[1];
244
-
245
- if (prefix) {
246
- prefix = normalize(prefix, relName);
247
- plugin = callDep(prefix);
248
- }
249
-
250
- //Normalize according
251
- if (prefix) {
252
- if (plugin && plugin.normalize) {
253
- name = plugin.normalize(name, makeNormalize(relName));
254
- } else {
255
- name = normalize(name, relName);
256
- }
257
- } else {
258
- name = normalize(name, relName);
259
- parts = splitPrefix(name);
260
- prefix = parts[0];
261
- name = parts[1];
262
- if (prefix) {
263
- plugin = callDep(prefix);
264
- }
265
- }
266
-
267
- //Using ridiculous property names for space reasons
268
- return {
269
- f: prefix ? prefix + '!' + name : name, //fullName
270
- n: name,
271
- pr: prefix,
272
- p: plugin
273
- };
274
- };
275
-
276
- function makeConfig(name) {
277
- return function () {
278
- return (config && config.config && config.config[name]) || {};
279
- };
280
- }
281
-
282
- handlers = {
283
- require: function (name) {
284
- return makeRequire(name);
285
- },
286
- exports: function (name) {
287
- var e = defined[name];
288
- if (typeof e !== 'undefined') {
289
- return e;
290
- } else {
291
- return (defined[name] = {});
292
- }
293
- },
294
- module: function (name) {
295
- return {
296
- id: name,
297
- uri: '',
298
- exports: defined[name],
299
- config: makeConfig(name)
300
- };
301
- }
302
- };
303
-
304
- main = function (name, deps, callback, relName) {
305
- var cjsModule, depName, ret, map, i,
306
- args = [],
307
- callbackType = typeof callback,
308
- usingExports;
309
-
310
- //Use name if no relName
311
- relName = relName || name;
312
-
313
- //Call the callback to define the module, if necessary.
314
- if (callbackType === 'undefined' || callbackType === 'function') {
315
- //Pull out the defined dependencies and pass the ordered
316
- //values to the callback.
317
- //Default to [require, exports, module] if no deps
318
- deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
319
- for (i = 0; i < deps.length; i += 1) {
320
- map = makeMap(deps[i], relName);
321
- depName = map.f;
322
-
323
- //Fast path CommonJS standard dependencies.
324
- if (depName === "require") {
325
- args[i] = handlers.require(name);
326
- } else if (depName === "exports") {
327
- //CommonJS module spec 1.1
328
- args[i] = handlers.exports(name);
329
- usingExports = true;
330
- } else if (depName === "module") {
331
- //CommonJS module spec 1.1
332
- cjsModule = args[i] = handlers.module(name);
333
- } else if (hasProp(defined, depName) ||
334
- hasProp(waiting, depName) ||
335
- hasProp(defining, depName)) {
336
- args[i] = callDep(depName);
337
- } else if (map.p) {
338
- map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
339
- args[i] = defined[depName];
340
- } else {
341
- throw new Error(name + ' missing ' + depName);
342
- }
343
- }
344
-
345
- ret = callback ? callback.apply(defined[name], args) : undefined;
346
-
347
- if (name) {
348
- //If setting exports via "module" is in play,
349
- //favor that over return value and exports. After that,
350
- //favor a non-undefined return value over exports use.
351
- if (cjsModule && cjsModule.exports !== undef &&
352
- cjsModule.exports !== defined[name]) {
353
- defined[name] = cjsModule.exports;
354
- } else if (ret !== undef || !usingExports) {
355
- //Use the return value from the function.
356
- defined[name] = ret;
357
- }
358
- }
359
- } else if (name) {
360
- //May just be an object definition for the module. Only
361
- //worry about defining if have a module name.
362
- defined[name] = callback;
363
- }
364
- };
365
-
366
- requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
367
- if (typeof deps === "string") {
368
- if (handlers[deps]) {
369
- //callback in this case is really relName
370
- return handlers[deps](callback);
371
- }
372
- //Just return the module wanted. In this scenario, the
373
- //deps arg is the module name, and second arg (if passed)
374
- //is just the relName.
375
- //Normalize module name, if it contains . or ..
376
- return callDep(makeMap(deps, callback).f);
377
- } else if (!deps.splice) {
378
- //deps is a config object, not an array.
379
- config = deps;
380
- if (config.deps) {
381
- req(config.deps, config.callback);
382
- }
383
- if (!callback) {
384
- return;
385
- }
386
-
387
- if (callback.splice) {
388
- //callback is an array, which means it is a dependency list.
389
- //Adjust args if there are dependencies
390
- deps = callback;
391
- callback = relName;
392
- relName = null;
393
- } else {
394
- deps = undef;
395
- }
396
- }
397
-
398
- //Support require(['a'])
399
- callback = callback || function () {};
400
-
401
- //If relName is a function, it is an errback handler,
402
- //so remove it.
403
- if (typeof relName === 'function') {
404
- relName = forceSync;
405
- forceSync = alt;
406
- }
407
-
408
- //Simulate async callback;
409
- if (forceSync) {
410
- main(undef, deps, callback, relName);
411
- } else {
412
- //Using a non-zero value because of concern for what old browsers
413
- //do, and latest browsers "upgrade" to 4 if lower value is used:
414
- //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
415
- //If want a value immediately, use require('id') instead -- something
416
- //that works in almond on the global level, but not guaranteed and
417
- //unlikely to work in other AMD implementations.
418
- setTimeout(function () {
419
- main(undef, deps, callback, relName);
420
- }, 4);
421
- }
422
-
423
- return req;
424
- };
425
-
426
- /**
427
- * Just drops the config on the floor, but returns req in case
428
- * the config return value is used.
429
- */
430
- req.config = function (cfg) {
431
- return req(cfg);
432
- };
433
-
434
- /**
435
- * Expose module registry for debugging and tooling
436
- */
437
- requirejs._defined = defined;
438
-
439
- define = function (name, deps, callback) {
440
- if (typeof name !== 'string') {
441
- throw new Error('See almond README: incorrect module build, no module name');
442
- }
443
-
444
- //This module may not have dependencies
445
- if (!deps.splice) {
446
- //deps is not an array, so probably means
447
- //an object literal or factory function for
448
- //the value. Adjust args.
449
- callback = deps;
450
- deps = [];
451
- }
452
-
453
- if (!hasProp(defined, name) && !hasProp(waiting, name)) {
454
- waiting[name] = [name, deps, callback];
455
- }
456
- };
457
-
458
- define.amd = {
459
- jQuery: true
460
- };
461
- }());
462
-
463
- S2.requirejs = requirejs;S2.require = require;S2.define = define;
464
- }
465
- }());
466
- S2.define("almond", function(){});
467
-
468
- /* global jQuery:false, $:false */
469
- S2.define('jquery',[],function () {
470
- var _$ = jQuery || $;
471
-
472
- if (_$ == null && console && console.error) {
473
- console.error(
474
- 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
475
- 'found. Make sure that you are including jQuery before Select2 on your ' +
476
- 'web page.'
477
- );
478
- }
479
-
480
- return _$;
481
- });
482
-
483
- S2.define('select2/utils',[
484
- 'jquery'
485
- ], function ($) {
486
- var Utils = {};
487
-
488
- Utils.Extend = function (ChildClass, SuperClass) {
489
- var __hasProp = {}.hasOwnProperty;
490
-
491
- function BaseConstructor () {
492
- this.constructor = ChildClass;
493
- }
494
-
495
- for (var key in SuperClass) {
496
- if (__hasProp.call(SuperClass, key)) {
497
- ChildClass[key] = SuperClass[key];
498
- }
499
- }
500
-
501
- BaseConstructor.prototype = SuperClass.prototype;
502
- ChildClass.prototype = new BaseConstructor();
503
- ChildClass.__super__ = SuperClass.prototype;
504
-
505
- return ChildClass;
506
- };
507
-
508
- function getMethods (theClass) {
509
- var proto = theClass.prototype;
510
-
511
- var methods = [];
512
-
513
- for (var methodName in proto) {
514
- var m = proto[methodName];
515
-
516
- if (typeof m !== 'function') {
517
- continue;
518
- }
519
-
520
- if (methodName === 'constructor') {
521
- continue;
522
- }
523
-
524
- methods.push(methodName);
525
- }
526
-
527
- return methods;
528
- }
529
-
530
- Utils.Decorate = function (SuperClass, DecoratorClass) {
531
- var decoratedMethods = getMethods(DecoratorClass);
532
- var superMethods = getMethods(SuperClass);
533
-
534
- function DecoratedClass () {
535
- var unshift = Array.prototype.unshift;
536
-
537
- var argCount = DecoratorClass.prototype.constructor.length;
538
-
539
- var calledConstructor = SuperClass.prototype.constructor;
540
-
541
- if (argCount > 0) {
542
- unshift.call(arguments, SuperClass.prototype.constructor);
543
-
544
- calledConstructor = DecoratorClass.prototype.constructor;
545
- }
546
-
547
- calledConstructor.apply(this, arguments);
548
- }
549
-
550
- DecoratorClass.displayName = SuperClass.displayName;
551
-
552
- function ctr () {
553
- this.constructor = DecoratedClass;
554
- }
555
-
556
- DecoratedClass.prototype = new ctr();
557
-
558
- for (var m = 0; m < superMethods.length; m++) {
559
- var superMethod = superMethods[m];
560
-
561
- DecoratedClass.prototype[superMethod] =
562
- SuperClass.prototype[superMethod];
563
- }
564
-
565
- var calledMethod = function (methodName) {
566
- // Stub out the original method if it's not decorating an actual method
567
- var originalMethod = function () {};
568
-
569
- if (methodName in DecoratedClass.prototype) {
570
- originalMethod = DecoratedClass.prototype[methodName];
571
- }
572
-
573
- var decoratedMethod = DecoratorClass.prototype[methodName];
574
-
575
- return function () {
576
- var unshift = Array.prototype.unshift;
577
-
578
- unshift.call(arguments, originalMethod);
579
-
580
- return decoratedMethod.apply(this, arguments);
581
- };
582
- };
583
-
584
- for (var d = 0; d < decoratedMethods.length; d++) {
585
- var decoratedMethod = decoratedMethods[d];
586
-
587
- DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
588
- }
589
-
590
- return DecoratedClass;
591
- };
592
-
593
- var Observable = function () {
594
- this.listeners = {};
595
- };
596
-
597
- Observable.prototype.on = function (event, callback) {
598
- this.listeners = this.listeners || {};
599
-
600
- if (event in this.listeners) {
601
- this.listeners[event].push(callback);
602
- } else {
603
- this.listeners[event] = [callback];
604
- }
605
- };
606
-
607
- Observable.prototype.trigger = function (event) {
608
- var slice = Array.prototype.slice;
609
- var params = slice.call(arguments, 1);
610
-
611
- this.listeners = this.listeners || {};
612
-
613
- // Params should always come in as an array
614
- if (params == null) {
615
- params = [];
616
- }
617
-
618
- // If there are no arguments to the event, use a temporary object
619
- if (params.length === 0) {
620
- params.push({});
621
- }
622
-
623
- // Set the `_type` of the first object to the event
624
- params[0]._type = event;
625
-
626
- if (event in this.listeners) {
627
- this.invoke(this.listeners[event], slice.call(arguments, 1));
628
- }
629
-
630
- if ('*' in this.listeners) {
631
- this.invoke(this.listeners['*'], arguments);
632
- }
633
- };
634
-
635
- Observable.prototype.invoke = function (listeners, params) {
636
- for (var i = 0, len = listeners.length; i < len; i++) {
637
- listeners[i].apply(this, params);
638
- }
639
- };
640
-
641
- Utils.Observable = Observable;
642
-
643
- Utils.generateChars = function (length) {
644
- var chars = '';
645
-
646
- for (var i = 0; i < length; i++) {
647
- var randomChar = Math.floor(Math.random() * 36);
648
- chars += randomChar.toString(36);
649
- }
650
-
651
- return chars;
652
- };
653
-
654
- Utils.bind = function (func, context) {
655
- return function () {
656
- func.apply(context, arguments);
657
- };
658
- };
659
-
660
- Utils._convertData = function (data) {
661
- for (var originalKey in data) {
662
- var keys = originalKey.split('-');
663
-
664
- var dataLevel = data;
665
-
666
- if (keys.length === 1) {
667
- continue;
668
- }
669
-
670
- for (var k = 0; k < keys.length; k++) {
671
- var key = keys[k];
672
-
673
- // Lowercase the first letter
674
- // By default, dash-separated becomes camelCase
675
- key = key.substring(0, 1).toLowerCase() + key.substring(1);
676
-
677
- if (!(key in dataLevel)) {
678
- dataLevel[key] = {};
679
- }
680
-
681
- if (k == keys.length - 1) {
682
- dataLevel[key] = data[originalKey];
683
- }
684
-
685
- dataLevel = dataLevel[key];
686
- }
687
-
688
- delete data[originalKey];
689
- }
690
-
691
- return data;
692
- };
693
-
694
- Utils.hasScroll = function (index, el) {
695
- // Adapted from the function created by @ShadowScripter
696
- // and adapted by @BillBarry on the Stack Exchange Code Review website.
697
- // The original code can be found at
698
- // http://codereview.stackexchange.com/q/13338
699
- // and was designed to be used with the Sizzle selector engine.
700
-
701
- var $el = $(el);
702
- var overflowX = el.style.overflowX;
703
- var overflowY = el.style.overflowY;
704
-
705
- //Check both x and y declarations
706
- if (overflowX === overflowY &&
707
- (overflowY === 'hidden' || overflowY === 'visible')) {
708
- return false;
709
- }
710
-
711
- if (overflowX === 'scroll' || overflowY === 'scroll') {
712
- return true;
713
- }
714
-
715
- return ($el.innerHeight() < el.scrollHeight ||
716
- $el.innerWidth() < el.scrollWidth);
717
- };
718
-
719
- Utils.escapeMarkup = function (markup) {
720
- var replaceMap = {
721
- '\\': '&#92;',
722
- '&': '&amp;',
723
- '<': '&lt;',
724
- '>': '&gt;',
725
- '"': '&quot;',
726
- '\'': '&#39;',
727
- '/': '&#47;'
728
- };
729
-
730
- // Do not try to escape the markup if it's not a string
731
- if (typeof markup !== 'string') {
732
- return markup;
733
- }
734
-
735
- return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
736
- return replaceMap[match];
737
- });
738
- };
739
-
740
- // Append an array of jQuery nodes to a given element.
741
- Utils.appendMany = function ($element, $nodes) {
742
- // jQuery 1.7.x does not support $.fn.append() with an array
743
- // Fall back to a jQuery object collection using $.fn.add()
744
- if ($.fn.jquery.substr(0, 3) === '1.7') {
745
- var $jqNodes = $();
746
-
747
- $.map($nodes, function (node) {
748
- $jqNodes = $jqNodes.add(node);
749
- });
750
-
751
- $nodes = $jqNodes;
752
- }
753
-
754
- $element.append($nodes);
755
- };
756
-
757
- return Utils;
758
- });
759
-
760
- S2.define('select2/results',[
761
- 'jquery',
762
- './utils'
763
- ], function ($, Utils) {
764
- function Results ($element, options, dataAdapter) {
765
- this.$element = $element;
766
- this.data = dataAdapter;
767
- this.options = options;
768
-
769
- Results.__super__.constructor.call(this);
770
- }
771
-
772
- Utils.Extend(Results, Utils.Observable);
773
-
774
- Results.prototype.render = function () {
775
- var $results = $(
776
- '<ul class="select2-results__options" role="tree"></ul>'
777
- );
778
-
779
- if (this.options.get('multiple')) {
780
- $results.attr('aria-multiselectable', 'true');
781
- }
782
-
783
- this.$results = $results;
784
-
785
- return $results;
786
- };
787
-
788
- Results.prototype.clear = function () {
789
- this.$results.empty();
790
- };
791
-
792
- Results.prototype.displayMessage = function (params) {
793
- var escapeMarkup = this.options.get('escapeMarkup');
794
-
795
- this.clear();
796
- this.hideLoading();
797
-
798
- var $message = $(
799
- '<li role="treeitem" aria-live="assertive"' +
800
- ' class="select2-results__option"></li>'
801
- );
802
-
803
- var message = this.options.get('translations').get(params.message);
804
-
805
- $message.append(
806
- escapeMarkup(
807
- message(params.args)
808
- )
809
- );
810
-
811
- $message[0].className += ' select2-results__message';
812
-
813
- this.$results.append($message);
814
- };
815
-
816
- Results.prototype.hideMessages = function () {
817
- this.$results.find('.select2-results__message').remove();
818
- };
819
-
820
- Results.prototype.append = function (data) {
821
- this.hideLoading();
822
-
823
- var $options = [];
824
-
825
- if (data.results == null || data.results.length === 0) {
826
- if (this.$results.children().length === 0) {
827
- this.trigger('results:message', {
828
- message: 'noResults'
829
- });
830
- }
831
-
832
- return;
833
- }
834
-
835
- data.results = this.sort(data.results);
836
-
837
- for (var d = 0; d < data.results.length; d++) {
838
- var item = data.results[d];
839
-
840
- var $option = this.option(item);
841
-
842
- $options.push($option);
843
- }
844
-
845
- this.$results.append($options);
846
- };
847
-
848
- Results.prototype.position = function ($results, $dropdown) {
849
- var $resultsContainer = $dropdown.find('.select2-results');
850
- $resultsContainer.append($results);
851
- };
852
-
853
- Results.prototype.sort = function (data) {
854
- var sorter = this.options.get('sorter');
855
-
856
- return sorter(data);
857
- };
858
-
859
- Results.prototype.highlightFirstItem = function () {
860
- var $options = this.$results
861
- .find('.select2-results__option[aria-selected]');
862
-
863
- var $selected = $options.filter('[aria-selected=true]');
864
-
865
- // Check if there are any selected options
866
- if ($selected.length > 0) {
867
- // If there are selected options, highlight the first
868
- $selected.first().trigger('mouseenter');
869
- } else {
870
- // If there are no selected options, highlight the first option
871
- // in the dropdown
872
- $options.first().trigger('mouseenter');
873
- }
874
-
875
- this.ensureHighlightVisible();
876
- };
877
-
878
- Results.prototype.setClasses = function () {
879
- var self = this;
880
-
881
- this.data.current(function (selected) {
882
- var selectedIds = $.map(selected, function (s) {
883
- return s.id.toString();
884
- });
885
-
886
- var $options = self.$results
887
- .find('.select2-results__option[aria-selected]');
888
-
889
- $options.each(function () {
890
- var $option = $(this);
891
-
892
- var item = $.data(this, 'data');
893
-
894
- // id needs to be converted to a string when comparing
895
- var id = '' + item.id;
896
-
897
- if ((item.element != null && item.element.selected) ||
898
- (item.element == null && $.inArray(id, selectedIds) > -1)) {
899
- $option.attr('aria-selected', 'true');
900
- } else {
901
- $option.attr('aria-selected', 'false');
902
- }
903
- });
904
-
905
- });
906
- };
907
-
908
- Results.prototype.showLoading = function (params) {
909
- this.hideLoading();
910
-
911
- var loadingMore = this.options.get('translations').get('searching');
912
-
913
- var loading = {
914
- disabled: true,
915
- loading: true,
916
- text: loadingMore(params)
917
- };
918
- var $loading = this.option(loading);
919
- $loading.className += ' loading-results';
920
-
921
- this.$results.prepend($loading);
922
- };
923
-
924
- Results.prototype.hideLoading = function () {
925
- this.$results.find('.loading-results').remove();
926
- };
927
-
928
- Results.prototype.option = function (data) {
929
- var option = document.createElement('li');
930
- option.className = 'select2-results__option';
931
-
932
- var attrs = {
933
- 'role': 'treeitem',
934
- 'aria-selected': 'false'
935
- };
936
-
937
- if (data.disabled) {
938
- delete attrs['aria-selected'];
939
- attrs['aria-disabled'] = 'true';
940
- }
941
-
942
- if (data.id == null) {
943
- delete attrs['aria-selected'];
944
- }
945
-
946
- if (data._resultId != null) {
947
- option.id = data._resultId;
948
- }
949
-
950
- if (data.title) {
951
- option.title = data.title;
952
- }
953
-
954
- if (data.children) {
955
- attrs.role = 'group';
956
- attrs['aria-label'] = data.text;
957
- delete attrs['aria-selected'];
958
- }
959
-
960
- for (var attr in attrs) {
961
- var val = attrs[attr];
962
-
963
- option.setAttribute(attr, val);
964
- }
965
-
966
- if (data.children) {
967
- var $option = $(option);
968
-
969
- var label = document.createElement('strong');
970
- label.className = 'select2-results__group';
971
-
972
- var $label = $(label);
973
- this.template(data, label);
974
-
975
- var $children = [];
976
-
977
- for (var c = 0; c < data.children.length; c++) {
978
- var child = data.children[c];
979
-
980
- var $child = this.option(child);
981
-
982
- $children.push($child);
983
- }
984
-
985
- var $childrenContainer = $('<ul></ul>', {
986
- 'class': 'select2-results__options select2-results__options--nested'
987
- });
988
-
989
- $childrenContainer.append($children);
990
-
991
- $option.append(label);
992
- $option.append($childrenContainer);
993
- } else {
994
- this.template(data, option);
995
- }
996
-
997
- $.data(option, 'data', data);
998
-
999
- return option;
1000
- };
1001
-
1002
- Results.prototype.bind = function (container, $container) {
1003
- var self = this;
1004
-
1005
- var id = container.id + '-results';
1006
-
1007
- this.$results.attr('id', id);
1008
-
1009
- container.on('results:all', function (params) {
1010
- self.clear();
1011
- self.append(params.data);
1012
-
1013
- if (container.isOpen()) {
1014
- self.setClasses();
1015
- self.highlightFirstItem();
1016
- }
1017
- });
1018
-
1019
- container.on('results:append', function (params) {
1020
- self.append(params.data);
1021
-
1022
- if (container.isOpen()) {
1023
- self.setClasses();
1024
- }
1025
- });
1026
-
1027
- container.on('query', function (params) {
1028
- self.hideMessages();
1029
- self.showLoading(params);
1030
- });
1031
-
1032
- container.on('select', function () {
1033
- if (!container.isOpen()) {
1034
- return;
1035
- }
1036
-
1037
- self.setClasses();
1038
- self.highlightFirstItem();
1039
- });
1040
-
1041
- container.on('unselect', function () {
1042
- if (!container.isOpen()) {
1043
- return;
1044
- }
1045
-
1046
- self.setClasses();
1047
- self.highlightFirstItem();
1048
- });
1049
-
1050
- container.on('open', function () {
1051
- // When the dropdown is open, aria-expended="true"
1052
- self.$results.attr('aria-expanded', 'true');
1053
- self.$results.attr('aria-hidden', 'false');
1054
-
1055
- self.setClasses();
1056
- self.ensureHighlightVisible();
1057
- });
1058
-
1059
- container.on('close', function () {
1060
- // When the dropdown is closed, aria-expended="false"
1061
- self.$results.attr('aria-expanded', 'false');
1062
- self.$results.attr('aria-hidden', 'true');
1063
- self.$results.removeAttr('aria-activedescendant');
1064
- });
1065
-
1066
- container.on('results:toggle', function () {
1067
- var $highlighted = self.getHighlightedResults();
1068
-
1069
- if ($highlighted.length === 0) {
1070
- return;
1071
- }
1072
-
1073
- $highlighted.trigger('mouseup');
1074
- });
1075
-
1076
- container.on('results:select', function () {
1077
- var $highlighted = self.getHighlightedResults();
1078
-
1079
- if ($highlighted.length === 0) {
1080
- return;
1081
- }
1082
-
1083
- var data = $highlighted.data('data');
1084
-
1085
- if ($highlighted.attr('aria-selected') == 'true') {
1086
- self.trigger('close', {});
1087
- } else {
1088
- self.trigger('select', {
1089
- data: data
1090
- });
1091
- }
1092
- });
1093
-
1094
- container.on('results:previous', function () {
1095
- var $highlighted = self.getHighlightedResults();
1096
-
1097
- var $options = self.$results.find('[aria-selected]');
1098
-
1099
- var currentIndex = $options.index($highlighted);
1100
-
1101
- // If we are already at te top, don't move further
1102
- if (currentIndex === 0) {
1103
- return;
1104
- }
1105
-
1106
- var nextIndex = currentIndex - 1;
1107
-
1108
- // If none are highlighted, highlight the first
1109
- if ($highlighted.length === 0) {
1110
- nextIndex = 0;
1111
- }
1112
-
1113
- var $next = $options.eq(nextIndex);
1114
-
1115
- $next.trigger('mouseenter');
1116
-
1117
- var currentOffset = self.$results.offset().top;
1118
- var nextTop = $next.offset().top;
1119
- var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
1120
-
1121
- if (nextIndex === 0) {
1122
- self.$results.scrollTop(0);
1123
- } else if (nextTop - currentOffset < 0) {
1124
- self.$results.scrollTop(nextOffset);
1125
- }
1126
- });
1127
-
1128
- container.on('results:next', function () {
1129
- var $highlighted = self.getHighlightedResults();
1130
-
1131
- var $options = self.$results.find('[aria-selected]');
1132
-
1133
- var currentIndex = $options.index($highlighted);
1134
-
1135
- var nextIndex = currentIndex + 1;
1136
-
1137
- // If we are at the last option, stay there
1138
- if (nextIndex >= $options.length) {
1139
- return;
1140
- }
1141
-
1142
- var $next = $options.eq(nextIndex);
1143
-
1144
- $next.trigger('mouseenter');
1145
-
1146
- var currentOffset = self.$results.offset().top +
1147
- self.$results.outerHeight(false);
1148
- var nextBottom = $next.offset().top + $next.outerHeight(false);
1149
- var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
1150
-
1151
- if (nextIndex === 0) {
1152
- self.$results.scrollTop(0);
1153
- } else if (nextBottom > currentOffset) {
1154
- self.$results.scrollTop(nextOffset);
1155
- }
1156
- });
1157
-
1158
- container.on('results:focus', function (params) {
1159
- params.element.addClass('select2-results__option--highlighted');
1160
- });
1161
-
1162
- container.on('results:message', function (params) {
1163
- self.displayMessage(params);
1164
- });
1165
-
1166
- if ($.fn.mousewheel) {
1167
- this.$results.on('mousewheel', function (e) {
1168
- var top = self.$results.scrollTop();
1169
-
1170
- var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
1171
-
1172
- var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1173
- var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
1174
-
1175
- if (isAtTop) {
1176
- self.$results.scrollTop(0);
1177
-
1178
- e.preventDefault();
1179
- e.stopPropagation();
1180
- } else if (isAtBottom) {
1181
- self.$results.scrollTop(
1182
- self.$results.get(0).scrollHeight - self.$results.height()
1183
- );
1184
-
1185
- e.preventDefault();
1186
- e.stopPropagation();
1187
- }
1188
- });
1189
- }
1190
-
1191
- this.$results.on('mouseup', '.select2-results__option[aria-selected]',
1192
- function (evt) {
1193
- var $this = $(this);
1194
-
1195
- var data = $this.data('data');
1196
-
1197
- if ($this.attr('aria-selected') === 'true') {
1198
- if (self.options.get('multiple')) {
1199
- self.trigger('unselect', {
1200
- originalEvent: evt,
1201
- data: data
1202
- });
1203
- } else {
1204
- self.trigger('close', {});
1205
- }
1206
-
1207
- return;
1208
- }
1209
-
1210
- self.trigger('select', {
1211
- originalEvent: evt,
1212
- data: data
1213
- });
1214
- });
1215
-
1216
- this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
1217
- function (evt) {
1218
- var data = $(this).data('data');
1219
-
1220
- self.getHighlightedResults()
1221
- .removeClass('select2-results__option--highlighted');
1222
-
1223
- self.trigger('results:focus', {
1224
- data: data,
1225
- element: $(this)
1226
- });
1227
- });
1228
- };
1229
-
1230
- Results.prototype.getHighlightedResults = function () {
1231
- var $highlighted = this.$results
1232
- .find('.select2-results__option--highlighted');
1233
-
1234
- return $highlighted;
1235
- };
1236
-
1237
- Results.prototype.destroy = function () {
1238
- this.$results.remove();
1239
- };
1240
-
1241
- Results.prototype.ensureHighlightVisible = function () {
1242
- var $highlighted = this.getHighlightedResults();
1243
-
1244
- if ($highlighted.length === 0) {
1245
- return;
1246
- }
1247
-
1248
- var $options = this.$results.find('[aria-selected]');
1249
-
1250
- var currentIndex = $options.index($highlighted);
1251
-
1252
- var currentOffset = this.$results.offset().top;
1253
- var nextTop = $highlighted.offset().top;
1254
- var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
1255
-
1256
- var offsetDelta = nextTop - currentOffset;
1257
- nextOffset -= $highlighted.outerHeight(false) * 2;
1258
-
1259
- if (currentIndex <= 2) {
1260
- this.$results.scrollTop(0);
1261
- } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
1262
- this.$results.scrollTop(nextOffset);
1263
- }
1264
- };
1265
-
1266
- Results.prototype.template = function (result, container) {
1267
- var template = this.options.get('templateResult');
1268
- var escapeMarkup = this.options.get('escapeMarkup');
1269
-
1270
- var content = template(result, container);
1271
-
1272
- if (content == null) {
1273
- container.style.display = 'none';
1274
- } else if (typeof content === 'string') {
1275
- container.innerHTML = escapeMarkup(content);
1276
- } else {
1277
- $(container).append(content);
1278
- }
1279
- };
1280
-
1281
- return Results;
1282
- });
1283
-
1284
- S2.define('select2/keys',[
1285
-
1286
- ], function () {
1287
- var KEYS = {
1288
- BACKSPACE: 8,
1289
- TAB: 9,
1290
- ENTER: 13,
1291
- SHIFT: 16,
1292
- CTRL: 17,
1293
- ALT: 18,
1294
- ESC: 27,
1295
- SPACE: 32,
1296
- PAGE_UP: 33,
1297
- PAGE_DOWN: 34,
1298
- END: 35,
1299
- HOME: 36,
1300
- LEFT: 37,
1301
- UP: 38,
1302
- RIGHT: 39,
1303
- DOWN: 40,
1304
- DELETE: 46
1305
- };
1306
-
1307
- return KEYS;
1308
- });
1309
-
1310
- S2.define('select2/selection/base',[
1311
- 'jquery',
1312
- '../utils',
1313
- '../keys'
1314
- ], function ($, Utils, KEYS) {
1315
- function BaseSelection ($element, options) {
1316
- this.$element = $element;
1317
- this.options = options;
1318
-
1319
- BaseSelection.__super__.constructor.call(this);
1320
- }
1321
-
1322
- Utils.Extend(BaseSelection, Utils.Observable);
1323
-
1324
- BaseSelection.prototype.render = function () {
1325
- var $selection = $(
1326
- '<span class="select2-selection" role="combobox" ' +
1327
- ' aria-haspopup="true" aria-expanded="false">' +
1328
- '</span>'
1329
- );
1330
-
1331
- this._tabindex = 0;
1332
-
1333
- if (this.$element.data('old-tabindex') != null) {
1334
- this._tabindex = this.$element.data('old-tabindex');
1335
- } else if (this.$element.attr('tabindex') != null) {
1336
- this._tabindex = this.$element.attr('tabindex');
1337
- }
1338
-
1339
- $selection.attr('title', this.$element.attr('title'));
1340
- $selection.attr('tabindex', this._tabindex);
1341
-
1342
- this.$selection = $selection;
1343
-
1344
- return $selection;
1345
- };
1346
-
1347
- BaseSelection.prototype.bind = function (container, $container) {
1348
- var self = this;
1349
-
1350
- var id = container.id + '-container';
1351
- var resultsId = container.id + '-results';
1352
-
1353
- this.container = container;
1354
-
1355
- this.$selection.on('focus', function (evt) {
1356
- self.trigger('focus', evt);
1357
- });
1358
-
1359
- this.$selection.on('blur', function (evt) {
1360
- self._handleBlur(evt);
1361
- });
1362
-
1363
- this.$selection.on('keydown', function (evt) {
1364
- self.trigger('keypress', evt);
1365
-
1366
- if (evt.which === KEYS.SPACE) {
1367
- evt.preventDefault();
1368
- }
1369
- });
1370
-
1371
- container.on('results:focus', function (params) {
1372
- self.$selection.attr('aria-activedescendant', params.data._resultId);
1373
- });
1374
-
1375
- container.on('selection:update', function (params) {
1376
- self.update(params.data);
1377
- });
1378
-
1379
- container.on('open', function () {
1380
- // When the dropdown is open, aria-expanded="true"
1381
- self.$selection.attr('aria-expanded', 'true');
1382
- self.$selection.attr('aria-owns', resultsId);
1383
-
1384
- self._attachCloseHandler(container);
1385
- });
1386
-
1387
- container.on('close', function () {
1388
- // When the dropdown is closed, aria-expanded="false"
1389
- self.$selection.attr('aria-expanded', 'false');
1390
- self.$selection.removeAttr('aria-activedescendant');
1391
- self.$selection.removeAttr('aria-owns');
1392
-
1393
- self.$selection.focus();
1394
-
1395
- self._detachCloseHandler(container);
1396
- });
1397
-
1398
- container.on('enable', function () {
1399
- self.$selection.attr('tabindex', self._tabindex);
1400
- });
1401
-
1402
- container.on('disable', function () {
1403
- self.$selection.attr('tabindex', '-1');
1404
- });
1405
- };
1406
-
1407
- BaseSelection.prototype._handleBlur = function (evt) {
1408
- var self = this;
1409
-
1410
- // This needs to be delayed as the active element is the body when the tab
1411
- // key is pressed, possibly along with others.
1412
- window.setTimeout(function () {
1413
- // Don't trigger `blur` if the focus is still in the selection
1414
- if (
1415
- (document.activeElement == self.$selection[0]) ||
1416
- ($.contains(self.$selection[0], document.activeElement))
1417
- ) {
1418
- return;
1419
- }
1420
-
1421
- self.trigger('blur', evt);
1422
- }, 1);
1423
- };
1424
-
1425
- BaseSelection.prototype._attachCloseHandler = function (container) {
1426
- var self = this;
1427
-
1428
- $(document.body).on('mousedown.select2.' + container.id, function (e) {
1429
- var $target = $(e.target);
1430
-
1431
- var $select = $target.closest('.select2');
1432
-
1433
- var $all = $('.select2.select2-container--open');
1434
-
1435
- $all.each(function () {
1436
- var $this = $(this);
1437
-
1438
- if (this == $select[0]) {
1439
- return;
1440
- }
1441
-
1442
- var $element = $this.data('element');
1443
-
1444
- $element.select2('close');
1445
- });
1446
- });
1447
- };
1448
-
1449
- BaseSelection.prototype._detachCloseHandler = function (container) {
1450
- $(document.body).off('mousedown.select2.' + container.id);
1451
- };
1452
-
1453
- BaseSelection.prototype.position = function ($selection, $container) {
1454
- var $selectionContainer = $container.find('.selection');
1455
- $selectionContainer.append($selection);
1456
- };
1457
-
1458
- BaseSelection.prototype.destroy = function () {
1459
- this._detachCloseHandler(this.container);
1460
- };
1461
-
1462
- BaseSelection.prototype.update = function (data) {
1463
- throw new Error('The `update` method must be defined in child classes.');
1464
- };
1465
-
1466
- return BaseSelection;
1467
- });
1468
-
1469
- S2.define('select2/selection/single',[
1470
- 'jquery',
1471
- './base',
1472
- '../utils',
1473
- '../keys'
1474
- ], function ($, BaseSelection, Utils, KEYS) {
1475
- function SingleSelection () {
1476
- SingleSelection.__super__.constructor.apply(this, arguments);
1477
- }
1478
-
1479
- Utils.Extend(SingleSelection, BaseSelection);
1480
-
1481
- SingleSelection.prototype.render = function () {
1482
- var $selection = SingleSelection.__super__.render.call(this);
1483
-
1484
- $selection.addClass('select2-selection--single');
1485
-
1486
- $selection.html(
1487
- '<span class="select2-selection__rendered"></span>' +
1488
- '<span class="select2-selection__arrow" role="presentation">' +
1489
- '<b role="presentation"></b>' +
1490
- '</span>'
1491
- );
1492
-
1493
- return $selection;
1494
- };
1495
-
1496
- SingleSelection.prototype.bind = function (container, $container) {
1497
- var self = this;
1498
-
1499
- SingleSelection.__super__.bind.apply(this, arguments);
1500
-
1501
- var id = container.id + '-container';
1502
-
1503
- this.$selection.find('.select2-selection__rendered').attr('id', id);
1504
- this.$selection.attr('aria-labelledby', id);
1505
-
1506
- this.$selection.on('mousedown', function (evt) {
1507
- // Only respond to left clicks
1508
- if (evt.which !== 1) {
1509
- return;
1510
- }
1511
-
1512
- self.trigger('toggle', {
1513
- originalEvent: evt
1514
- });
1515
- });
1516
-
1517
- this.$selection.on('focus', function (evt) {
1518
- // User focuses on the container
1519
- });
1520
-
1521
- this.$selection.on('blur', function (evt) {
1522
- // User exits the container
1523
- });
1524
-
1525
- container.on('focus', function (evt) {
1526
- if (!container.isOpen()) {
1527
- self.$selection.focus();
1528
- }
1529
- });
1530
-
1531
- container.on('selection:update', function (params) {
1532
- self.update(params.data);
1533
- });
1534
- };
1535
-
1536
- SingleSelection.prototype.clear = function () {
1537
- this.$selection.find('.select2-selection__rendered').empty();
1538
- };
1539
-
1540
- SingleSelection.prototype.display = function (data, container) {
1541
- var template = this.options.get('templateSelection');
1542
- var escapeMarkup = this.options.get('escapeMarkup');
1543
-
1544
- return escapeMarkup(template(data, container));
1545
- };
1546
-
1547
- SingleSelection.prototype.selectionContainer = function () {
1548
- return $('<span></span>');
1549
- };
1550
-
1551
- SingleSelection.prototype.update = function (data) {
1552
- if (data.length === 0) {
1553
- this.clear();
1554
- return;
1555
- }
1556
-
1557
- var selection = data[0];
1558
-
1559
- var $rendered = this.$selection.find('.select2-selection__rendered');
1560
- var formatted = this.display(selection, $rendered);
1561
-
1562
- $rendered.empty().append(formatted);
1563
- $rendered.prop('title', selection.title || selection.text);
1564
- };
1565
-
1566
- return SingleSelection;
1567
- });
1568
-
1569
- S2.define('select2/selection/multiple',[
1570
- 'jquery',
1571
- './base',
1572
- '../utils'
1573
- ], function ($, BaseSelection, Utils) {
1574
- function MultipleSelection ($element, options) {
1575
- MultipleSelection.__super__.constructor.apply(this, arguments);
1576
- }
1577
-
1578
- Utils.Extend(MultipleSelection, BaseSelection);
1579
-
1580
- MultipleSelection.prototype.render = function () {
1581
- var $selection = MultipleSelection.__super__.render.call(this);
1582
-
1583
- $selection.addClass('select2-selection--multiple');
1584
-
1585
- $selection.html(
1586
- '<ul class="select2-selection__rendered"></ul>'
1587
- );
1588
-
1589
- return $selection;
1590
- };
1591
-
1592
- MultipleSelection.prototype.bind = function (container, $container) {
1593
- var self = this;
1594
-
1595
- MultipleSelection.__super__.bind.apply(this, arguments);
1596
-
1597
- this.$selection.on('click', function (evt) {
1598
- self.trigger('toggle', {
1599
- originalEvent: evt
1600
- });
1601
- });
1602
-
1603
- this.$selection.on(
1604
- 'click',
1605
- '.select2-selection__choice__remove',
1606
- function (evt) {
1607
- // Ignore the event if it is disabled
1608
- if (self.options.get('disabled')) {
1609
- return;
1610
- }
1611
-
1612
- var $remove = $(this);
1613
- var $selection = $remove.parent();
1614
-
1615
- var data = $selection.data('data');
1616
-
1617
- self.trigger('unselect', {
1618
- originalEvent: evt,
1619
- data: data
1620
- });
1621
- }
1622
- );
1623
- };
1624
-
1625
- MultipleSelection.prototype.clear = function () {
1626
- this.$selection.find('.select2-selection__rendered').empty();
1627
- };
1628
-
1629
- MultipleSelection.prototype.display = function (data, container) {
1630
- var template = this.options.get('templateSelection');
1631
- var escapeMarkup = this.options.get('escapeMarkup');
1632
-
1633
- return escapeMarkup(template(data, container));
1634
- };
1635
-
1636
- MultipleSelection.prototype.selectionContainer = function () {
1637
- var $container = $(
1638
- '<li class="select2-selection__choice">' +
1639
- '<span class="select2-selection__choice__remove" role="presentation">' +
1640
- '&times;' +
1641
- '</span>' +
1642
- '</li>'
1643
- );
1644
-
1645
- return $container;
1646
- };
1647
-
1648
- MultipleSelection.prototype.update = function (data) {
1649
- this.clear();
1650
-
1651
- if (data.length === 0) {
1652
- return;
1653
- }
1654
-
1655
- var $selections = [];
1656
-
1657
- for (var d = 0; d < data.length; d++) {
1658
- var selection = data[d];
1659
-
1660
- var $selection = this.selectionContainer();
1661
- var formatted = this.display(selection, $selection);
1662
-
1663
- $selection.append(formatted);
1664
- $selection.prop('title', selection.title || selection.text);
1665
-
1666
- $selection.data('data', selection);
1667
-
1668
- $selections.push($selection);
1669
- }
1670
-
1671
- var $rendered = this.$selection.find('.select2-selection__rendered');
1672
-
1673
- Utils.appendMany($rendered, $selections);
1674
- };
1675
-
1676
- return MultipleSelection;
1677
- });
1678
-
1679
- S2.define('select2/selection/placeholder',[
1680
- '../utils'
1681
- ], function (Utils) {
1682
- function Placeholder (decorated, $element, options) {
1683
- this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
1684
-
1685
- decorated.call(this, $element, options);
1686
- }
1687
-
1688
- Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
1689
- if (typeof placeholder === 'string') {
1690
- placeholder = {
1691
- id: '',
1692
- text: placeholder
1693
- };
1694
- }
1695
-
1696
- return placeholder;
1697
- };
1698
-
1699
- Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
1700
- var $placeholder = this.selectionContainer();
1701
-
1702
- $placeholder.html(this.display(placeholder));
1703
- $placeholder.addClass('select2-selection__placeholder')
1704
- .removeClass('select2-selection__choice');
1705
-
1706
- return $placeholder;
1707
- };
1708
-
1709
- Placeholder.prototype.update = function (decorated, data) {
1710
- var singlePlaceholder = (
1711
- data.length == 1 && data[0].id != this.placeholder.id
1712
- );
1713
- var multipleSelections = data.length > 1;
1714
-
1715
- if (multipleSelections || singlePlaceholder) {
1716
- return decorated.call(this, data);
1717
- }
1718
-
1719
- this.clear();
1720
-
1721
- var $placeholder = this.createPlaceholder(this.placeholder);
1722
-
1723
- this.$selection.find('.select2-selection__rendered').append($placeholder);
1724
- };
1725
-
1726
- return Placeholder;
1727
- });
1728
-
1729
- S2.define('select2/selection/allowClear',[
1730
- 'jquery',
1731
- '../keys'
1732
- ], function ($, KEYS) {
1733
- function AllowClear () { }
1734
-
1735
- AllowClear.prototype.bind = function (decorated, container, $container) {
1736
- var self = this;
1737
-
1738
- decorated.call(this, container, $container);
1739
-
1740
- if (this.placeholder == null) {
1741
- if (this.options.get('debug') && window.console && console.error) {
1742
- console.error(
1743
- 'Select2: The `allowClear` option should be used in combination ' +
1744
- 'with the `placeholder` option.'
1745
- );
1746
- }
1747
- }
1748
-
1749
- this.$selection.on('mousedown', '.select2-selection__clear',
1750
- function (evt) {
1751
- self._handleClear(evt);
1752
- });
1753
-
1754
- container.on('keypress', function (evt) {
1755
- self._handleKeyboardClear(evt, container);
1756
- });
1757
- };
1758
-
1759
- AllowClear.prototype._handleClear = function (_, evt) {
1760
- // Ignore the event if it is disabled
1761
- if (this.options.get('disabled')) {
1762
- return;
1763
- }
1764
-
1765
- var $clear = this.$selection.find('.select2-selection__clear');
1766
-
1767
- // Ignore the event if nothing has been selected
1768
- if ($clear.length === 0) {
1769
- return;
1770
- }
1771
-
1772
- evt.stopPropagation();
1773
-
1774
- var data = $clear.data('data');
1775
-
1776
- for (var d = 0; d < data.length; d++) {
1777
- var unselectData = {
1778
- data: data[d]
1779
- };
1780
-
1781
- // Trigger the `unselect` event, so people can prevent it from being
1782
- // cleared.
1783
- this.trigger('unselect', unselectData);
1784
-
1785
- // If the event was prevented, don't clear it out.
1786
- if (unselectData.prevented) {
1787
- return;
1788
- }
1789
- }
1790
-
1791
- this.$element.val(this.placeholder.id).trigger('change');
1792
-
1793
- this.trigger('toggle', {});
1794
- };
1795
-
1796
- AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
1797
- if (container.isOpen()) {
1798
- return;
1799
- }
1800
-
1801
- if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
1802
- this._handleClear(evt);
1803
- }
1804
- };
1805
-
1806
- AllowClear.prototype.update = function (decorated, data) {
1807
- decorated.call(this, data);
1808
-
1809
- if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
1810
- data.length === 0) {
1811
- return;
1812
- }
1813
-
1814
- var $remove = $(
1815
- '<span class="select2-selection__clear">' +
1816
- '&times;' +
1817
- '</span>'
1818
- );
1819
- $remove.data('data', data);
1820
-
1821
- this.$selection.find('.select2-selection__rendered').prepend($remove);
1822
- };
1823
-
1824
- return AllowClear;
1825
- });
1826
-
1827
- S2.define('select2/selection/search',[
1828
- 'jquery',
1829
- '../utils',
1830
- '../keys'
1831
- ], function ($, Utils, KEYS) {
1832
- function Search (decorated, $element, options) {
1833
- decorated.call(this, $element, options);
1834
- }
1835
-
1836
- Search.prototype.render = function (decorated) {
1837
- var $search = $(
1838
- '<li class="select2-search select2-search--inline">' +
1839
- '<input class="select2-search__field" type="search" tabindex="-1"' +
1840
- ' autocomplete="off" autocorrect="off" autocapitalize="off"' +
1841
- ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
1842
- '</li>'
1843
- );
1844
-
1845
- this.$searchContainer = $search;
1846
- this.$search = $search.find('input');
1847
-
1848
- var $rendered = decorated.call(this);
1849
-
1850
- this._transferTabIndex();
1851
-
1852
- return $rendered;
1853
- };
1854
-
1855
- Search.prototype.bind = function (decorated, container, $container) {
1856
- var self = this;
1857
-
1858
- decorated.call(this, container, $container);
1859
-
1860
- container.on('open', function () {
1861
- self.$search.trigger('focus');
1862
- });
1863
-
1864
- container.on('close', function () {
1865
- self.$search.val('');
1866
- self.$search.removeAttr('aria-activedescendant');
1867
- self.$search.trigger('focus');
1868
- });
1869
-
1870
- container.on('enable', function () {
1871
- self.$search.prop('disabled', false);
1872
-
1873
- self._transferTabIndex();
1874
- });
1875
-
1876
- container.on('disable', function () {
1877
- self.$search.prop('disabled', true);
1878
- });
1879
-
1880
- container.on('focus', function (evt) {
1881
- self.$search.trigger('focus');
1882
- });
1883
-
1884
- container.on('results:focus', function (params) {
1885
- self.$search.attr('aria-activedescendant', params.id);
1886
- });
1887
-
1888
- this.$selection.on('focusin', '.select2-search--inline', function (evt) {
1889
- self.trigger('focus', evt);
1890
- });
1891
-
1892
- this.$selection.on('focusout', '.select2-search--inline', function (evt) {
1893
- self._handleBlur(evt);
1894
- });
1895
-
1896
- this.$selection.on('keydown', '.select2-search--inline', function (evt) {
1897
- evt.stopPropagation();
1898
-
1899
- self.trigger('keypress', evt);
1900
-
1901
- self._keyUpPrevented = evt.isDefaultPrevented();
1902
-
1903
- var key = evt.which;
1904
-
1905
- if (key === KEYS.BACKSPACE && self.$search.val() === '') {
1906
- var $previousChoice = self.$searchContainer
1907
- .prev('.select2-selection__choice');
1908
-
1909
- if ($previousChoice.length > 0) {
1910
- var item = $previousChoice.data('data');
1911
-
1912
- self.searchRemoveChoice(item);
1913
-
1914
- evt.preventDefault();
1915
- }
1916
- }
1917
- });
1918
-
1919
- // Try to detect the IE version should the `documentMode` property that
1920
- // is stored on the document. This is only implemented in IE and is
1921
- // slightly cleaner than doing a user agent check.
1922
- // This property is not available in Edge, but Edge also doesn't have
1923
- // this bug.
1924
- var msie = document.documentMode;
1925
- var disableInputEvents = msie && msie <= 11;
1926
-
1927
- // Workaround for browsers which do not support the `input` event
1928
- // This will prevent double-triggering of events for browsers which support
1929
- // both the `keyup` and `input` events.
1930
- this.$selection.on(
1931
- 'input.searchcheck',
1932
- '.select2-search--inline',
1933
- function (evt) {
1934
- // IE will trigger the `input` event when a placeholder is used on a
1935
- // search box. To get around this issue, we are forced to ignore all
1936
- // `input` events in IE and keep using `keyup`.
1937
- if (disableInputEvents) {
1938
- self.$selection.off('input.search input.searchcheck');
1939
- return;
1940
- }
1941
-
1942
- // Unbind the duplicated `keyup` event
1943
- self.$selection.off('keyup.search');
1944
- }
1945
- );
1946
-
1947
- this.$selection.on(
1948
- 'keyup.search input.search',
1949
- '.select2-search--inline',
1950
- function (evt) {
1951
- // IE will trigger the `input` event when a placeholder is used on a
1952
- // search box. To get around this issue, we are forced to ignore all
1953
- // `input` events in IE and keep using `keyup`.
1954
- if (disableInputEvents && evt.type === 'input') {
1955
- self.$selection.off('input.search input.searchcheck');
1956
- return;
1957
- }
1958
-
1959
- var key = evt.which;
1960
-
1961
- // We can freely ignore events from modifier keys
1962
- if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
1963
- return;
1964
- }
1965
-
1966
- // Tabbing will be handled during the `keydown` phase
1967
- if (key == KEYS.TAB) {
1968
- return;
1969
- }
1970
-
1971
- self.handleSearch(evt);
1972
- }
1973
- );
1974
- };
1975
-
1976
- /**
1977
- * This method will transfer the tabindex attribute from the rendered
1978
- * selection to the search box. This allows for the search box to be used as
1979
- * the primary focus instead of the selection container.
1980
- *
1981
- * @private
1982
- */
1983
- Search.prototype._transferTabIndex = function (decorated) {
1984
- this.$search.attr('tabindex', this.$selection.attr('tabindex'));
1985
- this.$selection.attr('tabindex', '-1');
1986
- };
1987
-
1988
- Search.prototype.createPlaceholder = function (decorated, placeholder) {
1989
- this.$search.attr('placeholder', placeholder.text);
1990
- };
1991
-
1992
- Search.prototype.update = function (decorated, data) {
1993
- var searchHadFocus = this.$search[0] == document.activeElement;
1994
-
1995
- this.$search.attr('placeholder', '');
1996
-
1997
- decorated.call(this, data);
1998
-
1999
- this.$selection.find('.select2-selection__rendered')
2000
- .append(this.$searchContainer);
2001
-
2002
- this.resizeSearch();
2003
- if (searchHadFocus) {
2004
- this.$search.focus();
2005
- }
2006
- };
2007
-
2008
- Search.prototype.handleSearch = function () {
2009
- this.resizeSearch();
2010
-
2011
- if (!this._keyUpPrevented) {
2012
- var input = this.$search.val();
2013
-
2014
- this.trigger('query', {
2015
- term: input
2016
- });
2017
- }
2018
-
2019
- this._keyUpPrevented = false;
2020
- };
2021
-
2022
- Search.prototype.searchRemoveChoice = function (decorated, item) {
2023
- this.trigger('unselect', {
2024
- data: item
2025
- });
2026
-
2027
- this.$search.val(item.text);
2028
- this.handleSearch();
2029
- };
2030
-
2031
- Search.prototype.resizeSearch = function () {
2032
- this.$search.css('width', '25px');
2033
-
2034
- var width = '';
2035
-
2036
- if (this.$search.attr('placeholder') !== '') {
2037
- width = this.$selection.find('.select2-selection__rendered').innerWidth();
2038
- } else {
2039
- var minimumWidth = this.$search.val().length + 1;
2040
-
2041
- width = (minimumWidth * 0.75) + 'em';
2042
- }
2043
-
2044
- this.$search.css('width', width);
2045
- };
2046
-
2047
- return Search;
2048
- });
2049
-
2050
- S2.define('select2/selection/eventRelay',[
2051
- 'jquery'
2052
- ], function ($) {
2053
- function EventRelay () { }
2054
-
2055
- EventRelay.prototype.bind = function (decorated, container, $container) {
2056
- var self = this;
2057
- var relayEvents = [
2058
- 'open', 'opening',
2059
- 'close', 'closing',
2060
- 'select', 'selecting',
2061
- 'unselect', 'unselecting'
2062
- ];
2063
-
2064
- var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
2065
-
2066
- decorated.call(this, container, $container);
2067
-
2068
- container.on('*', function (name, params) {
2069
- // Ignore events that should not be relayed
2070
- if ($.inArray(name, relayEvents) === -1) {
2071
- return;
2072
- }
2073
-
2074
- // The parameters should always be an object
2075
- params = params || {};
2076
-
2077
- // Generate the jQuery event for the Select2 event
2078
- var evt = $.Event('select2:' + name, {
2079
- params: params
2080
- });
2081
-
2082
- self.$element.trigger(evt);
2083
-
2084
- // Only handle preventable events if it was one
2085
- if ($.inArray(name, preventableEvents) === -1) {
2086
- return;
2087
- }
2088
-
2089
- params.prevented = evt.isDefaultPrevented();
2090
- });
2091
- };
2092
-
2093
- return EventRelay;
2094
- });
2095
-
2096
- S2.define('select2/translation',[
2097
- 'jquery',
2098
- 'require'
2099
- ], function ($, require) {
2100
- function Translation (dict) {
2101
- this.dict = dict || {};
2102
- }
2103
-
2104
- Translation.prototype.all = function () {
2105
- return this.dict;
2106
- };
2107
-
2108
- Translation.prototype.get = function (key) {
2109
- return this.dict[key];
2110
- };
2111
-
2112
- Translation.prototype.extend = function (translation) {
2113
- this.dict = $.extend({}, translation.all(), this.dict);
2114
- };
2115
-
2116
- // Static functions
2117
-
2118
- Translation._cache = {};
2119
-
2120
- Translation.loadPath = function (path) {
2121
- if (!(path in Translation._cache)) {
2122
- var translations = require(path);
2123
-
2124
- Translation._cache[path] = translations;
2125
- }
2126
-
2127
- return new Translation(Translation._cache[path]);
2128
- };
2129
-
2130
- return Translation;
2131
- });
2132
-
2133
- S2.define('select2/diacritics',[
2134
-
2135
- ], function () {
2136
- var diacritics = {
2137
- '\u24B6': 'A',
2138
- '\uFF21': 'A',
2139
- '\u00C0': 'A',
2140
- '\u00C1': 'A',
2141
- '\u00C2': 'A',
2142
- '\u1EA6': 'A',
2143
- '\u1EA4': 'A',
2144
- '\u1EAA': 'A',
2145
- '\u1EA8': 'A',
2146
- '\u00C3': 'A',
2147
- '\u0100': 'A',
2148
- '\u0102': 'A',
2149
- '\u1EB0': 'A',
2150
- '\u1EAE': 'A',
2151
- '\u1EB4': 'A',
2152
- '\u1EB2': 'A',
2153
- '\u0226': 'A',
2154
- '\u01E0': 'A',
2155
- '\u00C4': 'A',
2156
- '\u01DE': 'A',
2157
- '\u1EA2': 'A',
2158
- '\u00C5': 'A',
2159
- '\u01FA': 'A',
2160
- '\u01CD': 'A',
2161
- '\u0200': 'A',
2162
- '\u0202': 'A',
2163
- '\u1EA0': 'A',
2164
- '\u1EAC': 'A',
2165
- '\u1EB6': 'A',
2166
- '\u1E00': 'A',
2167
- '\u0104': 'A',
2168
- '\u023A': 'A',
2169
- '\u2C6F': 'A',
2170
- '\uA732': 'AA',
2171
- '\u00C6': 'AE',
2172
- '\u01FC': 'AE',
2173
- '\u01E2': 'AE',
2174
- '\uA734': 'AO',
2175
- '\uA736': 'AU',
2176
- '\uA738': 'AV',
2177
- '\uA73A': 'AV',
2178
- '\uA73C': 'AY',
2179
- '\u24B7': 'B',
2180
- '\uFF22': 'B',
2181
- '\u1E02': 'B',
2182
- '\u1E04': 'B',
2183
- '\u1E06': 'B',
2184
- '\u0243': 'B',
2185
- '\u0182': 'B',
2186
- '\u0181': 'B',
2187
- '\u24B8': 'C',
2188
- '\uFF23': 'C',
2189
- '\u0106': 'C',
2190
- '\u0108': 'C',
2191
- '\u010A': 'C',
2192
- '\u010C': 'C',
2193
- '\u00C7': 'C',
2194
- '\u1E08': 'C',
2195
- '\u0187': 'C',
2196
- '\u023B': 'C',
2197
- '\uA73E': 'C',
2198
- '\u24B9': 'D',
2199
- '\uFF24': 'D',
2200
- '\u1E0A': 'D',
2201
- '\u010E': 'D',
2202
- '\u1E0C': 'D',
2203
- '\u1E10': 'D',
2204
- '\u1E12': 'D',
2205
- '\u1E0E': 'D',
2206
- '\u0110': 'D',
2207
- '\u018B': 'D',
2208
- '\u018A': 'D',
2209
- '\u0189': 'D',
2210
- '\uA779': 'D',
2211
- '\u01F1': 'DZ',
2212
- '\u01C4': 'DZ',
2213
- '\u01F2': 'Dz',
2214
- '\u01C5': 'Dz',
2215
- '\u24BA': 'E',
2216
- '\uFF25': 'E',
2217
- '\u00C8': 'E',
2218
- '\u00C9': 'E',
2219
- '\u00CA': 'E',
2220
- '\u1EC0': 'E',
2221
- '\u1EBE': 'E',
2222
- '\u1EC4': 'E',
2223
- '\u1EC2': 'E',
2224
- '\u1EBC': 'E',
2225
- '\u0112': 'E',
2226
- '\u1E14': 'E',
2227
- '\u1E16': 'E',
2228
- '\u0114': 'E',
2229
- '\u0116': 'E',
2230
- '\u00CB': 'E',
2231
- '\u1EBA': 'E',
2232
- '\u011A': 'E',
2233
- '\u0204': 'E',
2234
- '\u0206': 'E',
2235
- '\u1EB8': 'E',
2236
- '\u1EC6': 'E',
2237
- '\u0228': 'E',
2238
- '\u1E1C': 'E',
2239
- '\u0118': 'E',
2240
- '\u1E18': 'E',
2241
- '\u1E1A': 'E',
2242
- '\u0190': 'E',
2243
- '\u018E': 'E',
2244
- '\u24BB': 'F',
2245
- '\uFF26': 'F',
2246
- '\u1E1E': 'F',
2247
- '\u0191': 'F',
2248
- '\uA77B': 'F',
2249
- '\u24BC': 'G',
2250
- '\uFF27': 'G',
2251
- '\u01F4': 'G',
2252
- '\u011C': 'G',
2253
- '\u1E20': 'G',
2254
- '\u011E': 'G',
2255
- '\u0120': 'G',
2256
- '\u01E6': 'G',
2257
- '\u0122': 'G',
2258
- '\u01E4': 'G',
2259
- '\u0193': 'G',
2260
- '\uA7A0': 'G',
2261
- '\uA77D': 'G',
2262
- '\uA77E': 'G',
2263
- '\u24BD': 'H',
2264
- '\uFF28': 'H',
2265
- '\u0124': 'H',
2266
- '\u1E22': 'H',
2267
- '\u1E26': 'H',
2268
- '\u021E': 'H',
2269
- '\u1E24': 'H',
2270
- '\u1E28': 'H',
2271
- '\u1E2A': 'H',
2272
- '\u0126': 'H',
2273
- '\u2C67': 'H',
2274
- '\u2C75': 'H',
2275
- '\uA78D': 'H',
2276
- '\u24BE': 'I',
2277
- '\uFF29': 'I',
2278
- '\u00CC': 'I',
2279
- '\u00CD': 'I',
2280
- '\u00CE': 'I',
2281
- '\u0128': 'I',
2282
- '\u012A': 'I',
2283
- '\u012C': 'I',
2284
- '\u0130': 'I',
2285
- '\u00CF': 'I',
2286
- '\u1E2E': 'I',
2287
- '\u1EC8': 'I',
2288
- '\u01CF': 'I',
2289
- '\u0208': 'I',
2290
- '\u020A': 'I',
2291
- '\u1ECA': 'I',
2292
- '\u012E': 'I',
2293
- '\u1E2C': 'I',
2294
- '\u0197': 'I',
2295
- '\u24BF': 'J',
2296
- '\uFF2A': 'J',
2297
- '\u0134': 'J',
2298
- '\u0248': 'J',
2299
- '\u24C0': 'K',
2300
- '\uFF2B': 'K',
2301
- '\u1E30': 'K',
2302
- '\u01E8': 'K',
2303
- '\u1E32': 'K',
2304
- '\u0136': 'K',
2305
- '\u1E34': 'K',
2306
- '\u0198': 'K',
2307
- '\u2C69': 'K',
2308
- '\uA740': 'K',
2309
- '\uA742': 'K',
2310
- '\uA744': 'K',
2311
- '\uA7A2': 'K',
2312
- '\u24C1': 'L',
2313
- '\uFF2C': 'L',
2314
- '\u013F': 'L',
2315
- '\u0139': 'L',
2316
- '\u013D': 'L',
2317
- '\u1E36': 'L',
2318
- '\u1E38': 'L',
2319
- '\u013B': 'L',
2320
- '\u1E3C': 'L',
2321
- '\u1E3A': 'L',
2322
- '\u0141': 'L',
2323
- '\u023D': 'L',
2324
- '\u2C62': 'L',
2325
- '\u2C60': 'L',
2326
- '\uA748': 'L',
2327
- '\uA746': 'L',
2328
- '\uA780': 'L',
2329
- '\u01C7': 'LJ',
2330
- '\u01C8': 'Lj',
2331
- '\u24C2': 'M',
2332
- '\uFF2D': 'M',
2333
- '\u1E3E': 'M',
2334
- '\u1E40': 'M',
2335
- '\u1E42': 'M',
2336
- '\u2C6E': 'M',
2337
- '\u019C': 'M',
2338
- '\u24C3': 'N',
2339
- '\uFF2E': 'N',
2340
- '\u01F8': 'N',
2341
- '\u0143': 'N',
2342
- '\u00D1': 'N',
2343
- '\u1E44': 'N',
2344
- '\u0147': 'N',
2345
- '\u1E46': 'N',
2346
- '\u0145': 'N',
2347
- '\u1E4A': 'N',
2348
- '\u1E48': 'N',
2349
- '\u0220': 'N',
2350
- '\u019D': 'N',
2351
- '\uA790': 'N',
2352
- '\uA7A4': 'N',
2353
- '\u01CA': 'NJ',
2354
- '\u01CB': 'Nj',
2355
- '\u24C4': 'O',
2356
- '\uFF2F': 'O',
2357
- '\u00D2': 'O',
2358
- '\u00D3': 'O',
2359
- '\u00D4': 'O',
2360
- '\u1ED2': 'O',
2361
- '\u1ED0': 'O',
2362
- '\u1ED6': 'O',
2363
- '\u1ED4': 'O',
2364
- '\u00D5': 'O',
2365
- '\u1E4C': 'O',
2366
- '\u022C': 'O',
2367
- '\u1E4E': 'O',
2368
- '\u014C': 'O',
2369
- '\u1E50': 'O',
2370
- '\u1E52': 'O',
2371
- '\u014E': 'O',
2372
- '\u022E': 'O',
2373
- '\u0230': 'O',
2374
- '\u00D6': 'O',
2375
- '\u022A': 'O',
2376
- '\u1ECE': 'O',
2377
- '\u0150': 'O',
2378
- '\u01D1': 'O',
2379
- '\u020C': 'O',
2380
- '\u020E': 'O',
2381
- '\u01A0': 'O',
2382
- '\u1EDC': 'O',
2383
- '\u1EDA': 'O',
2384
- '\u1EE0': 'O',
2385
- '\u1EDE': 'O',
2386
- '\u1EE2': 'O',
2387
- '\u1ECC': 'O',
2388
- '\u1ED8': 'O',
2389
- '\u01EA': 'O',
2390
- '\u01EC': 'O',
2391
- '\u00D8': 'O',
2392
- '\u01FE': 'O',
2393
- '\u0186': 'O',
2394
- '\u019F': 'O',
2395
- '\uA74A': 'O',
2396
- '\uA74C': 'O',
2397
- '\u01A2': 'OI',
2398
- '\uA74E': 'OO',
2399
- '\u0222': 'OU',
2400
- '\u24C5': 'P',
2401
- '\uFF30': 'P',
2402
- '\u1E54': 'P',
2403
- '\u1E56': 'P',
2404
- '\u01A4': 'P',
2405
- '\u2C63': 'P',
2406
- '\uA750': 'P',
2407
- '\uA752': 'P',
2408
- '\uA754': 'P',
2409
- '\u24C6': 'Q',
2410
- '\uFF31': 'Q',
2411
- '\uA756': 'Q',
2412
- '\uA758': 'Q',
2413
- '\u024A': 'Q',
2414
- '\u24C7': 'R',
2415
- '\uFF32': 'R',
2416
- '\u0154': 'R',
2417
- '\u1E58': 'R',
2418
- '\u0158': 'R',
2419
- '\u0210': 'R',
2420
- '\u0212': 'R',
2421
- '\u1E5A': 'R',
2422
- '\u1E5C': 'R',
2423
- '\u0156': 'R',
2424
- '\u1E5E': 'R',
2425
- '\u024C': 'R',
2426
- '\u2C64': 'R',
2427
- '\uA75A': 'R',
2428
- '\uA7A6': 'R',
2429
- '\uA782': 'R',
2430
- '\u24C8': 'S',
2431
- '\uFF33': 'S',
2432
- '\u1E9E': 'S',
2433
- '\u015A': 'S',
2434
- '\u1E64': 'S',
2435
- '\u015C': 'S',
2436
- '\u1E60': 'S',
2437
- '\u0160': 'S',
2438
- '\u1E66': 'S',
2439
- '\u1E62': 'S',
2440
- '\u1E68': 'S',
2441
- '\u0218': 'S',
2442
- '\u015E': 'S',
2443
- '\u2C7E': 'S',
2444
- '\uA7A8': 'S',
2445
- '\uA784': 'S',
2446
- '\u24C9': 'T',
2447
- '\uFF34': 'T',
2448
- '\u1E6A': 'T',
2449
- '\u0164': 'T',
2450
- '\u1E6C': 'T',
2451
- '\u021A': 'T',
2452
- '\u0162': 'T',
2453
- '\u1E70': 'T',
2454
- '\u1E6E': 'T',
2455
- '\u0166': 'T',
2456
- '\u01AC': 'T',
2457
- '\u01AE': 'T',
2458
- '\u023E': 'T',
2459
- '\uA786': 'T',
2460
- '\uA728': 'TZ',
2461
- '\u24CA': 'U',
2462
- '\uFF35': 'U',
2463
- '\u00D9': 'U',
2464
- '\u00DA': 'U',
2465
- '\u00DB': 'U',
2466
- '\u0168': 'U',
2467
- '\u1E78': 'U',
2468
- '\u016A': 'U',
2469
- '\u1E7A': 'U',
2470
- '\u016C': 'U',
2471
- '\u00DC': 'U',
2472
- '\u01DB': 'U',
2473
- '\u01D7': 'U',
2474
- '\u01D5': 'U',
2475
- '\u01D9': 'U',
2476
- '\u1EE6': 'U',
2477
- '\u016E': 'U',
2478
- '\u0170': 'U',
2479
- '\u01D3': 'U',
2480
- '\u0214': 'U',
2481
- '\u0216': 'U',
2482
- '\u01AF': 'U',
2483
- '\u1EEA': 'U',
2484
- '\u1EE8': 'U',
2485
- '\u1EEE': 'U',
2486
- '\u1EEC': 'U',
2487
- '\u1EF0': 'U',
2488
- '\u1EE4': 'U',
2489
- '\u1E72': 'U',
2490
- '\u0172': 'U',
2491
- '\u1E76': 'U',
2492
- '\u1E74': 'U',
2493
- '\u0244': 'U',
2494
- '\u24CB': 'V',
2495
- '\uFF36': 'V',
2496
- '\u1E7C': 'V',
2497
- '\u1E7E': 'V',
2498
- '\u01B2': 'V',
2499
- '\uA75E': 'V',
2500
- '\u0245': 'V',
2501
- '\uA760': 'VY',
2502
- '\u24CC': 'W',
2503
- '\uFF37': 'W',
2504
- '\u1E80': 'W',
2505
- '\u1E82': 'W',
2506
- '\u0174': 'W',
2507
- '\u1E86': 'W',
2508
- '\u1E84': 'W',
2509
- '\u1E88': 'W',
2510
- '\u2C72': 'W',
2511
- '\u24CD': 'X',
2512
- '\uFF38': 'X',
2513
- '\u1E8A': 'X',
2514
- '\u1E8C': 'X',
2515
- '\u24CE': 'Y',
2516
- '\uFF39': 'Y',
2517
- '\u1EF2': 'Y',
2518
- '\u00DD': 'Y',
2519
- '\u0176': 'Y',
2520
- '\u1EF8': 'Y',
2521
- '\u0232': 'Y',
2522
- '\u1E8E': 'Y',
2523
- '\u0178': 'Y',
2524
- '\u1EF6': 'Y',
2525
- '\u1EF4': 'Y',
2526
- '\u01B3': 'Y',
2527
- '\u024E': 'Y',
2528
- '\u1EFE': 'Y',
2529
- '\u24CF': 'Z',
2530
- '\uFF3A': 'Z',
2531
- '\u0179': 'Z',
2532
- '\u1E90': 'Z',
2533
- '\u017B': 'Z',
2534
- '\u017D': 'Z',
2535
- '\u1E92': 'Z',
2536
- '\u1E94': 'Z',
2537
- '\u01B5': 'Z',
2538
- '\u0224': 'Z',
2539
- '\u2C7F': 'Z',
2540
- '\u2C6B': 'Z',
2541
- '\uA762': 'Z',
2542
- '\u24D0': 'a',
2543
- '\uFF41': 'a',
2544
- '\u1E9A': 'a',
2545
- '\u00E0': 'a',
2546
- '\u00E1': 'a',
2547
- '\u00E2': 'a',
2548
- '\u1EA7': 'a',
2549
- '\u1EA5': 'a',
2550
- '\u1EAB': 'a',
2551
- '\u1EA9': 'a',
2552
- '\u00E3': 'a',
2553
- '\u0101': 'a',
2554
- '\u0103': 'a',
2555
- '\u1EB1': 'a',
2556
- '\u1EAF': 'a',
2557
- '\u1EB5': 'a',
2558
- '\u1EB3': 'a',
2559
- '\u0227': 'a',
2560
- '\u01E1': 'a',
2561
- '\u00E4': 'a',
2562
- '\u01DF': 'a',
2563
- '\u1EA3': 'a',
2564
- '\u00E5': 'a',
2565
- '\u01FB': 'a',
2566
- '\u01CE': 'a',
2567
- '\u0201': 'a',
2568
- '\u0203': 'a',
2569
- '\u1EA1': 'a',
2570
- '\u1EAD': 'a',
2571
- '\u1EB7': 'a',
2572
- '\u1E01': 'a',
2573
- '\u0105': 'a',
2574
- '\u2C65': 'a',
2575
- '\u0250': 'a',
2576
- '\uA733': 'aa',
2577
- '\u00E6': 'ae',
2578
- '\u01FD': 'ae',
2579
- '\u01E3': 'ae',
2580
- '\uA735': 'ao',
2581
- '\uA737': 'au',
2582
- '\uA739': 'av',
2583
- '\uA73B': 'av',
2584
- '\uA73D': 'ay',
2585
- '\u24D1': 'b',
2586
- '\uFF42': 'b',
2587
- '\u1E03': 'b',
2588
- '\u1E05': 'b',
2589
- '\u1E07': 'b',
2590
- '\u0180': 'b',
2591
- '\u0183': 'b',
2592
- '\u0253': 'b',
2593
- '\u24D2': 'c',
2594
- '\uFF43': 'c',
2595
- '\u0107': 'c',
2596
- '\u0109': 'c',
2597
- '\u010B': 'c',
2598
- '\u010D': 'c',
2599
- '\u00E7': 'c',
2600
- '\u1E09': 'c',
2601
- '\u0188': 'c',
2602
- '\u023C': 'c',
2603
- '\uA73F': 'c',
2604
- '\u2184': 'c',
2605
- '\u24D3': 'd',
2606
- '\uFF44': 'd',
2607
- '\u1E0B': 'd',
2608
- '\u010F': 'd',
2609
- '\u1E0D': 'd',
2610
- '\u1E11': 'd',
2611
- '\u1E13': 'd',
2612
- '\u1E0F': 'd',
2613
- '\u0111': 'd',
2614
- '\u018C': 'd',
2615
- '\u0256': 'd',
2616
- '\u0257': 'd',
2617
- '\uA77A': 'd',
2618
- '\u01F3': 'dz',
2619
- '\u01C6': 'dz',
2620
- '\u24D4': 'e',
2621
- '\uFF45': 'e',
2622
- '\u00E8': 'e',
2623
- '\u00E9': 'e',
2624
- '\u00EA': 'e',
2625
- '\u1EC1': 'e',
2626
- '\u1EBF': 'e',
2627
- '\u1EC5': 'e',
2628
- '\u1EC3': 'e',
2629
- '\u1EBD': 'e',
2630
- '\u0113': 'e',
2631
- '\u1E15': 'e',
2632
- '\u1E17': 'e',
2633
- '\u0115': 'e',
2634
- '\u0117': 'e',
2635
- '\u00EB': 'e',
2636
- '\u1EBB': 'e',
2637
- '\u011B': 'e',
2638
- '\u0205': 'e',
2639
- '\u0207': 'e',
2640
- '\u1EB9': 'e',
2641
- '\u1EC7': 'e',
2642
- '\u0229': 'e',
2643
- '\u1E1D': 'e',
2644
- '\u0119': 'e',
2645
- '\u1E19': 'e',
2646
- '\u1E1B': 'e',
2647
- '\u0247': 'e',
2648
- '\u025B': 'e',
2649
- '\u01DD': 'e',
2650
- '\u24D5': 'f',
2651
- '\uFF46': 'f',
2652
- '\u1E1F': 'f',
2653
- '\u0192': 'f',
2654
- '\uA77C': 'f',
2655
- '\u24D6': 'g',
2656
- '\uFF47': 'g',
2657
- '\u01F5': 'g',
2658
- '\u011D': 'g',
2659
- '\u1E21': 'g',
2660
- '\u011F': 'g',
2661
- '\u0121': 'g',
2662
- '\u01E7': 'g',
2663
- '\u0123': 'g',
2664
- '\u01E5': 'g',
2665
- '\u0260': 'g',
2666
- '\uA7A1': 'g',
2667
- '\u1D79': 'g',
2668
- '\uA77F': 'g',
2669
- '\u24D7': 'h',
2670
- '\uFF48': 'h',
2671
- '\u0125': 'h',
2672
- '\u1E23': 'h',
2673
- '\u1E27': 'h',
2674
- '\u021F': 'h',
2675
- '\u1E25': 'h',
2676
- '\u1E29': 'h',
2677
- '\u1E2B': 'h',
2678
- '\u1E96': 'h',
2679
- '\u0127': 'h',
2680
- '\u2C68': 'h',
2681
- '\u2C76': 'h',
2682
- '\u0265': 'h',
2683
- '\u0195': 'hv',
2684
- '\u24D8': 'i',
2685
- '\uFF49': 'i',
2686
- '\u00EC': 'i',
2687
- '\u00ED': 'i',
2688
- '\u00EE': 'i',
2689
- '\u0129': 'i',
2690
- '\u012B': 'i',
2691
- '\u012D': 'i',
2692
- '\u00EF': 'i',
2693
- '\u1E2F': 'i',
2694
- '\u1EC9': 'i',
2695
- '\u01D0': 'i',
2696
- '\u0209': 'i',
2697
- '\u020B': 'i',
2698
- '\u1ECB': 'i',
2699
- '\u012F': 'i',
2700
- '\u1E2D': 'i',
2701
- '\u0268': 'i',
2702
- '\u0131': 'i',
2703
- '\u24D9': 'j',
2704
- '\uFF4A': 'j',
2705
- '\u0135': 'j',
2706
- '\u01F0': 'j',
2707
- '\u0249': 'j',
2708
- '\u24DA': 'k',
2709
- '\uFF4B': 'k',
2710
- '\u1E31': 'k',
2711
- '\u01E9': 'k',
2712
- '\u1E33': 'k',
2713
- '\u0137': 'k',
2714
- '\u1E35': 'k',
2715
- '\u0199': 'k',
2716
- '\u2C6A': 'k',
2717
- '\uA741': 'k',
2718
- '\uA743': 'k',
2719
- '\uA745': 'k',
2720
- '\uA7A3': 'k',
2721
- '\u24DB': 'l',
2722
- '\uFF4C': 'l',
2723
- '\u0140': 'l',
2724
- '\u013A': 'l',
2725
- '\u013E': 'l',
2726
- '\u1E37': 'l',
2727
- '\u1E39': 'l',
2728
- '\u013C': 'l',
2729
- '\u1E3D': 'l',
2730
- '\u1E3B': 'l',
2731
- '\u017F': 'l',
2732
- '\u0142': 'l',
2733
- '\u019A': 'l',
2734
- '\u026B': 'l',
2735
- '\u2C61': 'l',
2736
- '\uA749': 'l',
2737
- '\uA781': 'l',
2738
- '\uA747': 'l',
2739
- '\u01C9': 'lj',
2740
- '\u24DC': 'm',
2741
- '\uFF4D': 'm',
2742
- '\u1E3F': 'm',
2743
- '\u1E41': 'm',
2744
- '\u1E43': 'm',
2745
- '\u0271': 'm',
2746
- '\u026F': 'm',
2747
- '\u24DD': 'n',
2748
- '\uFF4E': 'n',
2749
- '\u01F9': 'n',
2750
- '\u0144': 'n',
2751
- '\u00F1': 'n',
2752
- '\u1E45': 'n',
2753
- '\u0148': 'n',
2754
- '\u1E47': 'n',
2755
- '\u0146': 'n',
2756
- '\u1E4B': 'n',
2757
- '\u1E49': 'n',
2758
- '\u019E': 'n',
2759
- '\u0272': 'n',
2760
- '\u0149': 'n',
2761
- '\uA791': 'n',
2762
- '\uA7A5': 'n',
2763
- '\u01CC': 'nj',
2764
- '\u24DE': 'o',
2765
- '\uFF4F': 'o',
2766
- '\u00F2': 'o',
2767
- '\u00F3': 'o',
2768
- '\u00F4': 'o',
2769
- '\u1ED3': 'o',
2770
- '\u1ED1': 'o',
2771
- '\u1ED7': 'o',
2772
- '\u1ED5': 'o',
2773
- '\u00F5': 'o',
2774
- '\u1E4D': 'o',
2775
- '\u022D': 'o',
2776
- '\u1E4F': 'o',
2777
- '\u014D': 'o',
2778
- '\u1E51': 'o',
2779
- '\u1E53': 'o',
2780
- '\u014F': 'o',
2781
- '\u022F': 'o',
2782
- '\u0231': 'o',
2783
- '\u00F6': 'o',
2784
- '\u022B': 'o',
2785
- '\u1ECF': 'o',
2786
- '\u0151': 'o',
2787
- '\u01D2': 'o',
2788
- '\u020D': 'o',
2789
- '\u020F': 'o',
2790
- '\u01A1': 'o',
2791
- '\u1EDD': 'o',
2792
- '\u1EDB': 'o',
2793
- '\u1EE1': 'o',
2794
- '\u1EDF': 'o',
2795
- '\u1EE3': 'o',
2796
- '\u1ECD': 'o',
2797
- '\u1ED9': 'o',
2798
- '\u01EB': 'o',
2799
- '\u01ED': 'o',
2800
- '\u00F8': 'o',
2801
- '\u01FF': 'o',
2802
- '\u0254': 'o',
2803
- '\uA74B': 'o',
2804
- '\uA74D': 'o',
2805
- '\u0275': 'o',
2806
- '\u01A3': 'oi',
2807
- '\u0223': 'ou',
2808
- '\uA74F': 'oo',
2809
- '\u24DF': 'p',
2810
- '\uFF50': 'p',
2811
- '\u1E55': 'p',
2812
- '\u1E57': 'p',
2813
- '\u01A5': 'p',
2814
- '\u1D7D': 'p',
2815
- '\uA751': 'p',
2816
- '\uA753': 'p',
2817
- '\uA755': 'p',
2818
- '\u24E0': 'q',
2819
- '\uFF51': 'q',
2820
- '\u024B': 'q',
2821
- '\uA757': 'q',
2822
- '\uA759': 'q',
2823
- '\u24E1': 'r',
2824
- '\uFF52': 'r',
2825
- '\u0155': 'r',
2826
- '\u1E59': 'r',
2827
- '\u0159': 'r',
2828
- '\u0211': 'r',
2829
- '\u0213': 'r',
2830
- '\u1E5B': 'r',
2831
- '\u1E5D': 'r',
2832
- '\u0157': 'r',
2833
- '\u1E5F': 'r',
2834
- '\u024D': 'r',
2835
- '\u027D': 'r',
2836
- '\uA75B': 'r',
2837
- '\uA7A7': 'r',
2838
- '\uA783': 'r',
2839
- '\u24E2': 's',
2840
- '\uFF53': 's',
2841
- '\u00DF': 's',
2842
- '\u015B': 's',
2843
- '\u1E65': 's',
2844
- '\u015D': 's',
2845
- '\u1E61': 's',
2846
- '\u0161': 's',
2847
- '\u1E67': 's',
2848
- '\u1E63': 's',
2849
- '\u1E69': 's',
2850
- '\u0219': 's',
2851
- '\u015F': 's',
2852
- '\u023F': 's',
2853
- '\uA7A9': 's',
2854
- '\uA785': 's',
2855
- '\u1E9B': 's',
2856
- '\u24E3': 't',
2857
- '\uFF54': 't',
2858
- '\u1E6B': 't',
2859
- '\u1E97': 't',
2860
- '\u0165': 't',
2861
- '\u1E6D': 't',
2862
- '\u021B': 't',
2863
- '\u0163': 't',
2864
- '\u1E71': 't',
2865
- '\u1E6F': 't',
2866
- '\u0167': 't',
2867
- '\u01AD': 't',
2868
- '\u0288': 't',
2869
- '\u2C66': 't',
2870
- '\uA787': 't',
2871
- '\uA729': 'tz',
2872
- '\u24E4': 'u',
2873
- '\uFF55': 'u',
2874
- '\u00F9': 'u',
2875
- '\u00FA': 'u',
2876
- '\u00FB': 'u',
2877
- '\u0169': 'u',
2878
- '\u1E79': 'u',
2879
- '\u016B': 'u',
2880
- '\u1E7B': 'u',
2881
- '\u016D': 'u',
2882
- '\u00FC': 'u',
2883
- '\u01DC': 'u',
2884
- '\u01D8': 'u',
2885
- '\u01D6': 'u',
2886
- '\u01DA': 'u',
2887
- '\u1EE7': 'u',
2888
- '\u016F': 'u',
2889
- '\u0171': 'u',
2890
- '\u01D4': 'u',
2891
- '\u0215': 'u',
2892
- '\u0217': 'u',
2893
- '\u01B0': 'u',
2894
- '\u1EEB': 'u',
2895
- '\u1EE9': 'u',
2896
- '\u1EEF': 'u',
2897
- '\u1EED': 'u',
2898
- '\u1EF1': 'u',
2899
- '\u1EE5': 'u',
2900
- '\u1E73': 'u',
2901
- '\u0173': 'u',
2902
- '\u1E77': 'u',
2903
- '\u1E75': 'u',
2904
- '\u0289': 'u',
2905
- '\u24E5': 'v',
2906
- '\uFF56': 'v',
2907
- '\u1E7D': 'v',
2908
- '\u1E7F': 'v',
2909
- '\u028B': 'v',
2910
- '\uA75F': 'v',
2911
- '\u028C': 'v',
2912
- '\uA761': 'vy',
2913
- '\u24E6': 'w',
2914
- '\uFF57': 'w',
2915
- '\u1E81': 'w',
2916
- '\u1E83': 'w',
2917
- '\u0175': 'w',
2918
- '\u1E87': 'w',
2919
- '\u1E85': 'w',
2920
- '\u1E98': 'w',
2921
- '\u1E89': 'w',
2922
- '\u2C73': 'w',
2923
- '\u24E7': 'x',
2924
- '\uFF58': 'x',
2925
- '\u1E8B': 'x',
2926
- '\u1E8D': 'x',
2927
- '\u24E8': 'y',
2928
- '\uFF59': 'y',
2929
- '\u1EF3': 'y',
2930
- '\u00FD': 'y',
2931
- '\u0177': 'y',
2932
- '\u1EF9': 'y',
2933
- '\u0233': 'y',
2934
- '\u1E8F': 'y',
2935
- '\u00FF': 'y',
2936
- '\u1EF7': 'y',
2937
- '\u1E99': 'y',
2938
- '\u1EF5': 'y',
2939
- '\u01B4': 'y',
2940
- '\u024F': 'y',
2941
- '\u1EFF': 'y',
2942
- '\u24E9': 'z',
2943
- '\uFF5A': 'z',
2944
- '\u017A': 'z',
2945
- '\u1E91': 'z',
2946
- '\u017C': 'z',
2947
- '\u017E': 'z',
2948
- '\u1E93': 'z',
2949
- '\u1E95': 'z',
2950
- '\u01B6': 'z',
2951
- '\u0225': 'z',
2952
- '\u0240': 'z',
2953
- '\u2C6C': 'z',
2954
- '\uA763': 'z',
2955
- '\u0386': '\u0391',
2956
- '\u0388': '\u0395',
2957
- '\u0389': '\u0397',
2958
- '\u038A': '\u0399',
2959
- '\u03AA': '\u0399',
2960
- '\u038C': '\u039F',
2961
- '\u038E': '\u03A5',
2962
- '\u03AB': '\u03A5',
2963
- '\u038F': '\u03A9',
2964
- '\u03AC': '\u03B1',
2965
- '\u03AD': '\u03B5',
2966
- '\u03AE': '\u03B7',
2967
- '\u03AF': '\u03B9',
2968
- '\u03CA': '\u03B9',
2969
- '\u0390': '\u03B9',
2970
- '\u03CC': '\u03BF',
2971
- '\u03CD': '\u03C5',
2972
- '\u03CB': '\u03C5',
2973
- '\u03B0': '\u03C5',
2974
- '\u03C9': '\u03C9',
2975
- '\u03C2': '\u03C3'
2976
- };
2977
-
2978
- return diacritics;
2979
- });
2980
-
2981
- S2.define('select2/data/base',[
2982
- '../utils'
2983
- ], function (Utils) {
2984
- function BaseAdapter ($element, options) {
2985
- BaseAdapter.__super__.constructor.call(this);
2986
- }
2987
-
2988
- Utils.Extend(BaseAdapter, Utils.Observable);
2989
-
2990
- BaseAdapter.prototype.current = function (callback) {
2991
- throw new Error('The `current` method must be defined in child classes.');
2992
- };
2993
-
2994
- BaseAdapter.prototype.query = function (params, callback) {
2995
- throw new Error('The `query` method must be defined in child classes.');
2996
- };
2997
-
2998
- BaseAdapter.prototype.bind = function (container, $container) {
2999
- // Can be implemented in subclasses
3000
- };
3001
-
3002
- BaseAdapter.prototype.destroy = function () {
3003
- // Can be implemented in subclasses
3004
- };
3005
-
3006
- BaseAdapter.prototype.generateResultId = function (container, data) {
3007
- var id = container.id + '-result-';
3008
-
3009
- id += Utils.generateChars(4);
3010
-
3011
- if (data.id != null) {
3012
- id += '-' + data.id.toString();
3013
- } else {
3014
- id += '-' + Utils.generateChars(4);
3015
- }
3016
- return id;
3017
- };
3018
-
3019
- return BaseAdapter;
3020
- });
3021
-
3022
- S2.define('select2/data/select',[
3023
- './base',
3024
- '../utils',
3025
- 'jquery'
3026
- ], function (BaseAdapter, Utils, $) {
3027
- function SelectAdapter ($element, options) {
3028
- this.$element = $element;
3029
- this.options = options;
3030
-
3031
- SelectAdapter.__super__.constructor.call(this);
3032
- }
3033
-
3034
- Utils.Extend(SelectAdapter, BaseAdapter);
3035
-
3036
- SelectAdapter.prototype.current = function (callback) {
3037
- var data = [];
3038
- var self = this;
3039
-
3040
- this.$element.find(':selected').each(function () {
3041
- var $option = $(this);
3042
-
3043
- var option = self.item($option);
3044
-
3045
- data.push(option);
3046
- });
3047
-
3048
- callback(data);
3049
- };
3050
-
3051
- SelectAdapter.prototype.select = function (data) {
3052
- var self = this;
3053
-
3054
- data.selected = true;
3055
-
3056
- // If data.element is a DOM node, use it instead
3057
- if ($(data.element).is('option')) {
3058
- data.element.selected = true;
3059
-
3060
- this.$element.trigger('change');
3061
-
3062
- return;
3063
- }
3064
-
3065
- if (this.$element.prop('multiple')) {
3066
- this.current(function (currentData) {
3067
- var val = [];
3068
-
3069
- data = [data];
3070
- data.push.apply(data, currentData);
3071
-
3072
- for (var d = 0; d < data.length; d++) {
3073
- var id = data[d].id;
3074
-
3075
- if ($.inArray(id, val) === -1) {
3076
- val.push(id);
3077
- }
3078
- }
3079
-
3080
- self.$element.val(val);
3081
- self.$element.trigger('change');
3082
- });
3083
- } else {
3084
- var val = data.id;
3085
-
3086
- this.$element.val(val);
3087
- this.$element.trigger('change');
3088
- }
3089
- };
3090
-
3091
- SelectAdapter.prototype.unselect = function (data) {
3092
- var self = this;
3093
-
3094
- if (!this.$element.prop('multiple')) {
3095
- return;
3096
- }
3097
-
3098
- data.selected = false;
3099
-
3100
- if ($(data.element).is('option')) {
3101
- data.element.selected = false;
3102
-
3103
- this.$element.trigger('change');
3104
-
3105
- return;
3106
- }
3107
-
3108
- this.current(function (currentData) {
3109
- var val = [];
3110
-
3111
- for (var d = 0; d < currentData.length; d++) {
3112
- var id = currentData[d].id;
3113
-
3114
- if (id !== data.id && $.inArray(id, val) === -1) {
3115
- val.push(id);
3116
- }
3117
- }
3118
-
3119
- self.$element.val(val);
3120
-
3121
- self.$element.trigger('change');
3122
- });
3123
- };
3124
-
3125
- SelectAdapter.prototype.bind = function (container, $container) {
3126
- var self = this;
3127
-
3128
- this.container = container;
3129
-
3130
- container.on('select', function (params) {
3131
- self.select(params.data);
3132
- });
3133
-
3134
- container.on('unselect', function (params) {
3135
- self.unselect(params.data);
3136
- });
3137
- };
3138
-
3139
- SelectAdapter.prototype.destroy = function () {
3140
- // Remove anything added to child elements
3141
- this.$element.find('*').each(function () {
3142
- // Remove any custom data set by Select2
3143
- $.removeData(this, 'data');
3144
- });
3145
- };
3146
-
3147
- SelectAdapter.prototype.query = function (params, callback) {
3148
- var data = [];
3149
- var self = this;
3150
-
3151
- var $options = this.$element.children();
3152
-
3153
- $options.each(function () {
3154
- var $option = $(this);
3155
-
3156
- if (!$option.is('option') && !$option.is('optgroup')) {
3157
- return;
3158
- }
3159
-
3160
- var option = self.item($option);
3161
-
3162
- var matches = self.matches(params, option);
3163
-
3164
- if (matches !== null) {
3165
- data.push(matches);
3166
- }
3167
- });
3168
-
3169
- callback({
3170
- results: data
3171
- });
3172
- };
3173
-
3174
- SelectAdapter.prototype.addOptions = function ($options) {
3175
- Utils.appendMany(this.$element, $options);
3176
- };
3177
-
3178
- SelectAdapter.prototype.option = function (data) {
3179
- var option;
3180
-
3181
- if (data.children) {
3182
- option = document.createElement('optgroup');
3183
- option.label = data.text;
3184
- } else {
3185
- option = document.createElement('option');
3186
-
3187
- if (option.textContent !== undefined) {
3188
- option.textContent = data.text;
3189
- } else {
3190
- option.innerText = data.text;
3191
- }
3192
- }
3193
-
3194
- if (data.id) {
3195
- option.value = data.id;
3196
- }
3197
-
3198
- if (data.disabled) {
3199
- option.disabled = true;
3200
- }
3201
-
3202
- if (data.selected) {
3203
- option.selected = true;
3204
- }
3205
-
3206
- if (data.title) {
3207
- option.title = data.title;
3208
- }
3209
-
3210
- var $option = $(option);
3211
-
3212
- var normalizedData = this._normalizeItem(data);
3213
- normalizedData.element = option;
3214
-
3215
- // Override the option's data with the combined data
3216
- $.data(option, 'data', normalizedData);
3217
-
3218
- return $option;
3219
- };
3220
-
3221
- SelectAdapter.prototype.item = function ($option) {
3222
- var data = {};
3223
-
3224
- data = $.data($option[0], 'data');
3225
-
3226
- if (data != null) {
3227
- return data;
3228
- }
3229
-
3230
- if ($option.is('option')) {
3231
- data = {
3232
- id: $option.val(),
3233
- text: $option.text(),
3234
- disabled: $option.prop('disabled'),
3235
- selected: $option.prop('selected'),
3236
- title: $option.prop('title')
3237
- };
3238
- } else if ($option.is('optgroup')) {
3239
- data = {
3240
- text: $option.prop('label'),
3241
- children: [],
3242
- title: $option.prop('title')
3243
- };
3244
-
3245
- var $children = $option.children('option');
3246
- var children = [];
3247
-
3248
- for (var c = 0; c < $children.length; c++) {
3249
- var $child = $($children[c]);
3250
-
3251
- var child = this.item($child);
3252
-
3253
- children.push(child);
3254
- }
3255
-
3256
- data.children = children;
3257
- }
3258
-
3259
- data = this._normalizeItem(data);
3260
- data.element = $option[0];
3261
-
3262
- $.data($option[0], 'data', data);
3263
-
3264
- return data;
3265
- };
3266
-
3267
- SelectAdapter.prototype._normalizeItem = function (item) {
3268
- if (!$.isPlainObject(item)) {
3269
- item = {
3270
- id: item,
3271
- text: item
3272
- };
3273
- }
3274
-
3275
- item = $.extend({}, {
3276
- text: ''
3277
- }, item);
3278
-
3279
- var defaults = {
3280
- selected: false,
3281
- disabled: false
3282
- };
3283
-
3284
- if (item.id != null) {
3285
- item.id = item.id.toString();
3286
- }
3287
-
3288
- if (item.text != null) {
3289
- item.text = item.text.toString();
3290
- }
3291
-
3292
- if (item._resultId == null && item.id && this.container != null) {
3293
- item._resultId = this.generateResultId(this.container, item);
3294
- }
3295
-
3296
- return $.extend({}, defaults, item);
3297
- };
3298
-
3299
- SelectAdapter.prototype.matches = function (params, data) {
3300
- var matcher = this.options.get('matcher');
3301
-
3302
- return matcher(params, data);
3303
- };
3304
-
3305
- return SelectAdapter;
3306
- });
3307
-
3308
- S2.define('select2/data/array',[
3309
- './select',
3310
- '../utils',
3311
- 'jquery'
3312
- ], function (SelectAdapter, Utils, $) {
3313
- function ArrayAdapter ($element, options) {
3314
- var data = options.get('data') || [];
3315
-
3316
- ArrayAdapter.__super__.constructor.call(this, $element, options);
3317
-
3318
- this.addOptions(this.convertToOptions(data));
3319
- }
3320
-
3321
- Utils.Extend(ArrayAdapter, SelectAdapter);
3322
-
3323
- ArrayAdapter.prototype.select = function (data) {
3324
- var $option = this.$element.find('option').filter(function (i, elm) {
3325
- return elm.value == data.id.toString();
3326
- });
3327
-
3328
- if ($option.length === 0) {
3329
- $option = this.option(data);
3330
-
3331
- this.addOptions($option);
3332
- }
3333
-
3334
- ArrayAdapter.__super__.select.call(this, data);
3335
- };
3336
-
3337
- ArrayAdapter.prototype.convertToOptions = function (data) {
3338
- var self = this;
3339
-
3340
- var $existing = this.$element.find('option');
3341
- var existingIds = $existing.map(function () {
3342
- return self.item($(this)).id;
3343
- }).get();
3344
-
3345
- var $options = [];
3346
-
3347
- // Filter out all items except for the one passed in the argument
3348
- function onlyItem (item) {
3349
- return function () {
3350
- return $(this).val() == item.id;
3351
- };
3352
- }
3353
-
3354
- for (var d = 0; d < data.length; d++) {
3355
- var item = this._normalizeItem(data[d]);
3356
-
3357
- // Skip items which were pre-loaded, only merge the data
3358
- if ($.inArray(item.id, existingIds) >= 0) {
3359
- var $existingOption = $existing.filter(onlyItem(item));
3360
-
3361
- var existingData = this.item($existingOption);
3362
- var newData = $.extend(true, {}, item, existingData);
3363
-
3364
- var $newOption = this.option(newData);
3365
-
3366
- $existingOption.replaceWith($newOption);
3367
-
3368
- continue;
3369
- }
3370
-
3371
- var $option = this.option(item);
3372
-
3373
- if (item.children) {
3374
- var $children = this.convertToOptions(item.children);
3375
-
3376
- Utils.appendMany($option, $children);
3377
- }
3378
-
3379
- $options.push($option);
3380
- }
3381
-
3382
- return $options;
3383
- };
3384
-
3385
- return ArrayAdapter;
3386
- });
3387
-
3388
- S2.define('select2/data/ajax',[
3389
- './array',
3390
- '../utils',
3391
- 'jquery'
3392
- ], function (ArrayAdapter, Utils, $) {
3393
- function AjaxAdapter ($element, options) {
3394
- this.ajaxOptions = this._applyDefaults(options.get('ajax'));
3395
-
3396
- if (this.ajaxOptions.processResults != null) {
3397
- this.processResults = this.ajaxOptions.processResults;
3398
- }
3399
-
3400
- AjaxAdapter.__super__.constructor.call(this, $element, options);
3401
- }
3402
-
3403
- Utils.Extend(AjaxAdapter, ArrayAdapter);
3404
-
3405
- AjaxAdapter.prototype._applyDefaults = function (options) {
3406
- var defaults = {
3407
- data: function (params) {
3408
- return $.extend({}, params, {
3409
- q: params.term
3410
- });
3411
- },
3412
- transport: function (params, success, failure) {
3413
- var $request = $.ajax(params);
3414
-
3415
- $request.then(success);
3416
- $request.fail(failure);
3417
-
3418
- return $request;
3419
- }
3420
- };
3421
-
3422
- return $.extend({}, defaults, options, true);
3423
- };
3424
-
3425
- AjaxAdapter.prototype.processResults = function (results) {
3426
- return results;
3427
- };
3428
-
3429
- AjaxAdapter.prototype.query = function (params, callback) {
3430
- var matches = [];
3431
- var self = this;
3432
-
3433
- if (this._request != null) {
3434
- // JSONP requests cannot always be aborted
3435
- if ($.isFunction(this._request.abort)) {
3436
- this._request.abort();
3437
- }
3438
-
3439
- this._request = null;
3440
- }
3441
-
3442
- var options = $.extend({
3443
- type: 'GET'
3444
- }, this.ajaxOptions);
3445
-
3446
- if (typeof options.url === 'function') {
3447
- options.url = options.url.call(this.$element, params);
3448
- }
3449
-
3450
- if (typeof options.data === 'function') {
3451
- options.data = options.data.call(this.$element, params);
3452
- }
3453
-
3454
- function request () {
3455
- var $request = options.transport(options, function (data) {
3456
- var results = self.processResults(data, params);
3457
-
3458
- if (self.options.get('debug') && window.console && console.error) {
3459
- // Check to make sure that the response included a `results` key.
3460
- if (!results || !results.results || !$.isArray(results.results)) {
3461
- console.error(
3462
- 'Select2: The AJAX results did not return an array in the ' +
3463
- '`results` key of the response.'
3464
- );
3465
- }
3466
- }
3467
-
3468
- callback(results);
3469
- }, function () {
3470
- // Attempt to detect if a request was aborted
3471
- // Only works if the transport exposes a status property
3472
- if ($request.status && $request.status === '0') {
3473
- return;
3474
- }
3475
-
3476
- self.trigger('results:message', {
3477
- message: 'errorLoading'
3478
- });
3479
- });
3480
-
3481
- self._request = $request;
3482
- }
3483
-
3484
- if (this.ajaxOptions.delay && params.term != null) {
3485
- if (this._queryTimeout) {
3486
- window.clearTimeout(this._queryTimeout);
3487
- }
3488
-
3489
- this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
3490
- } else {
3491
- request();
3492
- }
3493
- };
3494
-
3495
- return AjaxAdapter;
3496
- });
3497
-
3498
- S2.define('select2/data/tags',[
3499
- 'jquery'
3500
- ], function ($) {
3501
- function Tags (decorated, $element, options) {
3502
- var tags = options.get('tags');
3503
-
3504
- var createTag = options.get('createTag');
3505
-
3506
- if (createTag !== undefined) {
3507
- this.createTag = createTag;
3508
- }
3509
-
3510
- var insertTag = options.get('insertTag');
3511
-
3512
- if (insertTag !== undefined) {
3513
- this.insertTag = insertTag;
3514
- }
3515
-
3516
- decorated.call(this, $element, options);
3517
-
3518
- if ($.isArray(tags)) {
3519
- for (var t = 0; t < tags.length; t++) {
3520
- var tag = tags[t];
3521
- var item = this._normalizeItem(tag);
3522
-
3523
- var $option = this.option(item);
3524
-
3525
- this.$element.append($option);
3526
- }
3527
- }
3528
- }
3529
-
3530
- Tags.prototype.query = function (decorated, params, callback) {
3531
- var self = this;
3532
-
3533
- this._removeOldTags();
3534
-
3535
- if (params.term == null || params.page != null) {
3536
- decorated.call(this, params, callback);
3537
- return;
3538
- }
3539
-
3540
- function wrapper (obj, child) {
3541
- var data = obj.results;
3542
-
3543
- for (var i = 0; i < data.length; i++) {
3544
- var option = data[i];
3545
-
3546
- var checkChildren = (
3547
- option.children != null &&
3548
- !wrapper({
3549
- results: option.children
3550
- }, true)
3551
- );
3552
-
3553
- var checkText = option.text === params.term;
3554
-
3555
- if (checkText || checkChildren) {
3556
- if (child) {
3557
- return false;
3558
- }
3559
-
3560
- obj.data = data;
3561
- callback(obj);
3562
-
3563
- return;
3564
- }
3565
- }
3566
-
3567
- if (child) {
3568
- return true;
3569
- }
3570
-
3571
- var tag = self.createTag(params);
3572
-
3573
- if (tag != null) {
3574
- var $option = self.option(tag);
3575
- $option.attr('data-select2-tag', true);
3576
-
3577
- self.addOptions([$option]);
3578
-
3579
- self.insertTag(data, tag);
3580
- }
3581
-
3582
- obj.results = data;
3583
-
3584
- callback(obj);
3585
- }
3586
-
3587
- decorated.call(this, params, wrapper);
3588
- };
3589
-
3590
- Tags.prototype.createTag = function (decorated, params) {
3591
- var term = $.trim(params.term);
3592
-
3593
- if (term === '') {
3594
- return null;
3595
- }
3596
-
3597
- return {
3598
- id: term,
3599
- text: term
3600
- };
3601
- };
3602
-
3603
- Tags.prototype.insertTag = function (_, data, tag) {
3604
- data.unshift(tag);
3605
- };
3606
-
3607
- Tags.prototype._removeOldTags = function (_) {
3608
- var tag = this._lastTag;
3609
-
3610
- var $options = this.$element.find('option[data-select2-tag]');
3611
-
3612
- $options.each(function () {
3613
- if (this.selected) {
3614
- return;
3615
- }
3616
-
3617
- $(this).remove();
3618
- });
3619
- };
3620
-
3621
- return Tags;
3622
- });
3623
-
3624
- S2.define('select2/data/tokenizer',[
3625
- 'jquery'
3626
- ], function ($) {
3627
- function Tokenizer (decorated, $element, options) {
3628
- var tokenizer = options.get('tokenizer');
3629
-
3630
- if (tokenizer !== undefined) {
3631
- this.tokenizer = tokenizer;
3632
- }
3633
-
3634
- decorated.call(this, $element, options);
3635
- }
3636
-
3637
- Tokenizer.prototype.bind = function (decorated, container, $container) {
3638
- decorated.call(this, container, $container);
3639
-
3640
- this.$search = container.dropdown.$search || container.selection.$search ||
3641
- $container.find('.select2-search__field');
3642
- };
3643
-
3644
- Tokenizer.prototype.query = function (decorated, params, callback) {
3645
- var self = this;
3646
-
3647
- function createAndSelect (data) {
3648
- // Normalize the data object so we can use it for checks
3649
- var item = self._normalizeItem(data);
3650
-
3651
- // Check if the data object already exists as a tag
3652
- // Select it if it doesn't
3653
- var $existingOptions = self.$element.find('option').filter(function () {
3654
- return $(this).val() === item.id;
3655
- });
3656
-
3657
- // If an existing option wasn't found for it, create the option
3658
- if (!$existingOptions.length) {
3659
- var $option = self.option(item);
3660
- $option.attr('data-select2-tag', true);
3661
-
3662
- self._removeOldTags();
3663
- self.addOptions([$option]);
3664
- }
3665
-
3666
- // Select the item, now that we know there is an option for it
3667
- select(item);
3668
- }
3669
-
3670
- function select (data) {
3671
- self.trigger('select', {
3672
- data: data
3673
- });
3674
- }
3675
-
3676
- params.term = params.term || '';
3677
-
3678
- var tokenData = this.tokenizer(params, this.options, createAndSelect);
3679
-
3680
- if (tokenData.term !== params.term) {
3681
- // Replace the search term if we have the search box
3682
- if (this.$search.length) {
3683
- this.$search.val(tokenData.term);
3684
- this.$search.focus();
3685
- }
3686
-
3687
- params.term = tokenData.term;
3688
- }
3689
-
3690
- decorated.call(this, params, callback);
3691
- };
3692
-
3693
- Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
3694
- var separators = options.get('tokenSeparators') || [];
3695
- var term = params.term;
3696
- var i = 0;
3697
-
3698
- var createTag = this.createTag || function (params) {
3699
- return {
3700
- id: params.term,
3701
- text: params.term
3702
- };
3703
- };
3704
-
3705
- while (i < term.length) {
3706
- var termChar = term[i];
3707
-
3708
- if ($.inArray(termChar, separators) === -1) {
3709
- i++;
3710
-
3711
- continue;
3712
- }
3713
-
3714
- var part = term.substr(0, i);
3715
- var partParams = $.extend({}, params, {
3716
- term: part
3717
- });
3718
-
3719
- var data = createTag(partParams);
3720
-
3721
- if (data == null) {
3722
- i++;
3723
- continue;
3724
- }
3725
-
3726
- callback(data);
3727
-
3728
- // Reset the term to not include the tokenized portion
3729
- term = term.substr(i + 1) || '';
3730
- i = 0;
3731
- }
3732
-
3733
- return {
3734
- term: term
3735
- };
3736
- };
3737
-
3738
- return Tokenizer;
3739
- });
3740
-
3741
- S2.define('select2/data/minimumInputLength',[
3742
-
3743
- ], function () {
3744
- function MinimumInputLength (decorated, $e, options) {
3745
- this.minimumInputLength = options.get('minimumInputLength');
3746
-
3747
- decorated.call(this, $e, options);
3748
- }
3749
-
3750
- MinimumInputLength.prototype.query = function (decorated, params, callback) {
3751
- params.term = params.term || '';
3752
-
3753
- if (params.term.length < this.minimumInputLength) {
3754
- this.trigger('results:message', {
3755
- message: 'inputTooShort',
3756
- args: {
3757
- minimum: this.minimumInputLength,
3758
- input: params.term,
3759
- params: params
3760
- }
3761
- });
3762
-
3763
- return;
3764
- }
3765
-
3766
- decorated.call(this, params, callback);
3767
- };
3768
-
3769
- return MinimumInputLength;
3770
- });
3771
-
3772
- S2.define('select2/data/maximumInputLength',[
3773
-
3774
- ], function () {
3775
- function MaximumInputLength (decorated, $e, options) {
3776
- this.maximumInputLength = options.get('maximumInputLength');
3777
-
3778
- decorated.call(this, $e, options);
3779
- }
3780
-
3781
- MaximumInputLength.prototype.query = function (decorated, params, callback) {
3782
- params.term = params.term || '';
3783
-
3784
- if (this.maximumInputLength > 0 &&
3785
- params.term.length > this.maximumInputLength) {
3786
- this.trigger('results:message', {
3787
- message: 'inputTooLong',
3788
- args: {
3789
- maximum: this.maximumInputLength,
3790
- input: params.term,
3791
- params: params
3792
- }
3793
- });
3794
-
3795
- return;
3796
- }
3797
-
3798
- decorated.call(this, params, callback);
3799
- };
3800
-
3801
- return MaximumInputLength;
3802
- });
3803
-
3804
- S2.define('select2/data/maximumSelectionLength',[
3805
-
3806
- ], function (){
3807
- function MaximumSelectionLength (decorated, $e, options) {
3808
- this.maximumSelectionLength = options.get('maximumSelectionLength');
3809
-
3810
- decorated.call(this, $e, options);
3811
- }
3812
-
3813
- MaximumSelectionLength.prototype.query =
3814
- function (decorated, params, callback) {
3815
- var self = this;
3816
-
3817
- this.current(function (currentData) {
3818
- var count = currentData != null ? currentData.length : 0;
3819
- if (self.maximumSelectionLength > 0 &&
3820
- count >= self.maximumSelectionLength) {
3821
- self.trigger('results:message', {
3822
- message: 'maximumSelected',
3823
- args: {
3824
- maximum: self.maximumSelectionLength
3825
- }
3826
- });
3827
- return;
3828
- }
3829
- decorated.call(self, params, callback);
3830
- });
3831
- };
3832
-
3833
- return MaximumSelectionLength;
3834
- });
3835
-
3836
- S2.define('select2/dropdown',[
3837
- 'jquery',
3838
- './utils'
3839
- ], function ($, Utils) {
3840
- function Dropdown ($element, options) {
3841
- this.$element = $element;
3842
- this.options = options;
3843
-
3844
- Dropdown.__super__.constructor.call(this);
3845
- }
3846
-
3847
- Utils.Extend(Dropdown, Utils.Observable);
3848
-
3849
- Dropdown.prototype.render = function () {
3850
- var $dropdown = $(
3851
- '<span class="select2-dropdown">' +
3852
- '<span class="select2-results"></span>' +
3853
- '</span>'
3854
- );
3855
-
3856
- $dropdown.attr('dir', this.options.get('dir'));
3857
-
3858
- this.$dropdown = $dropdown;
3859
-
3860
- return $dropdown;
3861
- };
3862
-
3863
- Dropdown.prototype.bind = function () {
3864
- // Should be implemented in subclasses
3865
- };
3866
-
3867
- Dropdown.prototype.position = function ($dropdown, $container) {
3868
- // Should be implmented in subclasses
3869
- };
3870
-
3871
- Dropdown.prototype.destroy = function () {
3872
- // Remove the dropdown from the DOM
3873
- this.$dropdown.remove();
3874
- };
3875
-
3876
- return Dropdown;
3877
- });
3878
-
3879
- S2.define('select2/dropdown/search',[
3880
- 'jquery',
3881
- '../utils'
3882
- ], function ($, Utils) {
3883
- function Search () { }
3884
-
3885
- Search.prototype.render = function (decorated) {
3886
- var $rendered = decorated.call(this);
3887
-
3888
- var $search = $(
3889
- '<span class="select2-search select2-search--dropdown">' +
3890
- '<input class="select2-search__field" type="search" tabindex="-1"' +
3891
- ' autocomplete="off" autocorrect="off" autocapitalize="off"' +
3892
- ' spellcheck="false" role="textbox" />' +
3893
- '</span>'
3894
- );
3895
-
3896
- this.$searchContainer = $search;
3897
- this.$search = $search.find('input');
3898
-
3899
- $rendered.prepend($search);
3900
-
3901
- return $rendered;
3902
- };
3903
-
3904
- Search.prototype.bind = function (decorated, container, $container) {
3905
- var self = this;
3906
-
3907
- decorated.call(this, container, $container);
3908
-
3909
- this.$search.on('keydown', function (evt) {
3910
- self.trigger('keypress', evt);
3911
-
3912
- self._keyUpPrevented = evt.isDefaultPrevented();
3913
- });
3914
-
3915
- // Workaround for browsers which do not support the `input` event
3916
- // This will prevent double-triggering of events for browsers which support
3917
- // both the `keyup` and `input` events.
3918
- this.$search.on('input', function (evt) {
3919
- // Unbind the duplicated `keyup` event
3920
- $(this).off('keyup');
3921
- });
3922
-
3923
- this.$search.on('keyup input', function (evt) {
3924
- self.handleSearch(evt);
3925
- });
3926
-
3927
- container.on('open', function () {
3928
- self.$search.attr('tabindex', 0);
3929
-
3930
- self.$search.focus();
3931
-
3932
- window.setTimeout(function () {
3933
- self.$search.focus();
3934
- }, 0);
3935
- });
3936
-
3937
- container.on('close', function () {
3938
- self.$search.attr('tabindex', -1);
3939
-
3940
- self.$search.val('');
3941
- });
3942
-
3943
- container.on('focus', function () {
3944
- if (container.isOpen()) {
3945
- self.$search.focus();
3946
- }
3947
- });
3948
-
3949
- container.on('results:all', function (params) {
3950
- if (params.query.term == null || params.query.term === '') {
3951
- var showSearch = self.showSearch(params);
3952
-
3953
- if (showSearch) {
3954
- self.$searchContainer.removeClass('select2-search--hide');
3955
- } else {
3956
- self.$searchContainer.addClass('select2-search--hide');
3957
- }
3958
- }
3959
- });
3960
- };
3961
-
3962
- Search.prototype.handleSearch = function (evt) {
3963
- if (!this._keyUpPrevented) {
3964
- var input = this.$search.val();
3965
-
3966
- this.trigger('query', {
3967
- term: input
3968
- });
3969
- }
3970
-
3971
- this._keyUpPrevented = false;
3972
- };
3973
-
3974
- Search.prototype.showSearch = function (_, params) {
3975
- return true;
3976
- };
3977
-
3978
- return Search;
3979
- });
3980
-
3981
- S2.define('select2/dropdown/hidePlaceholder',[
3982
-
3983
- ], function () {
3984
- function HidePlaceholder (decorated, $element, options, dataAdapter) {
3985
- this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
3986
-
3987
- decorated.call(this, $element, options, dataAdapter);
3988
- }
3989
-
3990
- HidePlaceholder.prototype.append = function (decorated, data) {
3991
- data.results = this.removePlaceholder(data.results);
3992
-
3993
- decorated.call(this, data);
3994
- };
3995
-
3996
- HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
3997
- if (typeof placeholder === 'string') {
3998
- placeholder = {
3999
- id: '',
4000
- text: placeholder
4001
- };
4002
- }
4003
-
4004
- return placeholder;
4005
- };
4006
-
4007
- HidePlaceholder.prototype.removePlaceholder = function (_, data) {
4008
- var modifiedData = data.slice(0);
4009
-
4010
- for (var d = data.length - 1; d >= 0; d--) {
4011
- var item = data[d];
4012
-
4013
- if (this.placeholder.id === item.id) {
4014
- modifiedData.splice(d, 1);
4015
- }
4016
- }
4017
-
4018
- return modifiedData;
4019
- };
4020
-
4021
- return HidePlaceholder;
4022
- });
4023
-
4024
- S2.define('select2/dropdown/infiniteScroll',[
4025
- 'jquery'
4026
- ], function ($) {
4027
- function InfiniteScroll (decorated, $element, options, dataAdapter) {
4028
- this.lastParams = {};
4029
-
4030
- decorated.call(this, $element, options, dataAdapter);
4031
-
4032
- this.$loadingMore = this.createLoadingMore();
4033
- this.loading = false;
4034
- }
4035
-
4036
- InfiniteScroll.prototype.append = function (decorated, data) {
4037
- this.$loadingMore.remove();
4038
- this.loading = false;
4039
-
4040
- decorated.call(this, data);
4041
-
4042
- if (this.showLoadingMore(data)) {
4043
- this.$results.append(this.$loadingMore);
4044
- }
4045
- };
4046
-
4047
- InfiniteScroll.prototype.bind = function (decorated, container, $container) {
4048
- var self = this;
4049
-
4050
- decorated.call(this, container, $container);
4051
-
4052
- container.on('query', function (params) {
4053
- self.lastParams = params;
4054
- self.loading = true;
4055
- });
4056
-
4057
- container.on('query:append', function (params) {
4058
- self.lastParams = params;
4059
- self.loading = true;
4060
- });
4061
-
4062
- this.$results.on('scroll', function () {
4063
- var isLoadMoreVisible = $.contains(
4064
- document.documentElement,
4065
- self.$loadingMore[0]
4066
- );
4067
-
4068
- if (self.loading || !isLoadMoreVisible) {
4069
- return;
4070
- }
4071
-
4072
- var currentOffset = self.$results.offset().top +
4073
- self.$results.outerHeight(false);
4074
- var loadingMoreOffset = self.$loadingMore.offset().top +
4075
- self.$loadingMore.outerHeight(false);
4076
-
4077
- if (currentOffset + 50 >= loadingMoreOffset) {
4078
- self.loadMore();
4079
- }
4080
- });
4081
- };
4082
-
4083
- InfiniteScroll.prototype.loadMore = function () {
4084
- this.loading = true;
4085
-
4086
- var params = $.extend({}, {page: 1}, this.lastParams);
4087
-
4088
- params.page++;
4089
-
4090
- this.trigger('query:append', params);
4091
- };
4092
-
4093
- InfiniteScroll.prototype.showLoadingMore = function (_, data) {
4094
- return data.pagination && data.pagination.more;
4095
- };
4096
-
4097
- InfiniteScroll.prototype.createLoadingMore = function () {
4098
- var $option = $(
4099
- '<li ' +
4100
- 'class="select2-results__option select2-results__option--load-more"' +
4101
- 'role="treeitem" aria-disabled="true"></li>'
4102
- );
4103
-
4104
- var message = this.options.get('translations').get('loadingMore');
4105
-
4106
- $option.html(message(this.lastParams));
4107
-
4108
- return $option;
4109
- };
4110
-
4111
- return InfiniteScroll;
4112
- });
4113
-
4114
- S2.define('select2/dropdown/attachBody',[
4115
- 'jquery',
4116
- '../utils'
4117
- ], function ($, Utils) {
4118
- function AttachBody (decorated, $element, options) {
4119
- this.$dropdownParent = options.get('dropdownParent') || $(document.body);
4120
-
4121
- decorated.call(this, $element, options);
4122
- }
4123
-
4124
- AttachBody.prototype.bind = function (decorated, container, $container) {
4125
- var self = this;
4126
-
4127
- var setupResultsEvents = false;
4128
-
4129
- decorated.call(this, container, $container);
4130
-
4131
- container.on('open', function () {
4132
- self._showDropdown();
4133
- self._attachPositioningHandler(container);
4134
-
4135
- if (!setupResultsEvents) {
4136
- setupResultsEvents = true;
4137
-
4138
- container.on('results:all', function () {
4139
- self._positionDropdown();
4140
- self._resizeDropdown();
4141
- });
4142
-
4143
- container.on('results:append', function () {
4144
- self._positionDropdown();
4145
- self._resizeDropdown();
4146
- });
4147
- }
4148
- });
4149
-
4150
- container.on('close', function () {
4151
- self._hideDropdown();
4152
- self._detachPositioningHandler(container);
4153
- });
4154
-
4155
- this.$dropdownContainer.on('mousedown', function (evt) {
4156
- evt.stopPropagation();
4157
- });
4158
- };
4159
-
4160
- AttachBody.prototype.destroy = function (decorated) {
4161
- decorated.call(this);
4162
-
4163
- this.$dropdownContainer.remove();
4164
- };
4165
-
4166
- AttachBody.prototype.position = function (decorated, $dropdown, $container) {
4167
- // Clone all of the container classes
4168
- $dropdown.attr('class', $container.attr('class'));
4169
-
4170
- $dropdown.removeClass('select2');
4171
- $dropdown.addClass('select2-container--open');
4172
-
4173
- $dropdown.css({
4174
- position: 'absolute',
4175
- top: -999999
4176
- });
4177
-
4178
- this.$container = $container;
4179
- };
4180
-
4181
- AttachBody.prototype.render = function (decorated) {
4182
- var $container = $('<span></span>');
4183
-
4184
- var $dropdown = decorated.call(this);
4185
- $container.append($dropdown);
4186
-
4187
- this.$dropdownContainer = $container;
4188
-
4189
- return $container;
4190
- };
4191
-
4192
- AttachBody.prototype._hideDropdown = function (decorated) {
4193
- this.$dropdownContainer.detach();
4194
- };
4195
-
4196
- AttachBody.prototype._attachPositioningHandler =
4197
- function (decorated, container) {
4198
- var self = this;
4199
-
4200
- var scrollEvent = 'scroll.select2.' + container.id;
4201
- var resizeEvent = 'resize.select2.' + container.id;
4202
- var orientationEvent = 'orientationchange.select2.' + container.id;
4203
-
4204
- var $watchers = this.$container.parents().filter(Utils.hasScroll);
4205
- $watchers.each(function () {
4206
- $(this).data('select2-scroll-position', {
4207
- x: $(this).scrollLeft(),
4208
- y: $(this).scrollTop()
4209
- });
4210
- });
4211
-
4212
- $watchers.on(scrollEvent, function (ev) {
4213
- var position = $(this).data('select2-scroll-position');
4214
- $(this).scrollTop(position.y);
4215
- });
4216
-
4217
- $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
4218
- function (e) {
4219
- self._positionDropdown();
4220
- self._resizeDropdown();
4221
- });
4222
- };
4223
-
4224
- AttachBody.prototype._detachPositioningHandler =
4225
- function (decorated, container) {
4226
- var scrollEvent = 'scroll.select2.' + container.id;
4227
- var resizeEvent = 'resize.select2.' + container.id;
4228
- var orientationEvent = 'orientationchange.select2.' + container.id;
4229
-
4230
- var $watchers = this.$container.parents().filter(Utils.hasScroll);
4231
- $watchers.off(scrollEvent);
4232
-
4233
- $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
4234
- };
4235
-
4236
- AttachBody.prototype._positionDropdown = function () {
4237
- var $window = $(window);
4238
-
4239
- var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
4240
- var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
4241
-
4242
- var newDirection = null;
4243
-
4244
- var offset = this.$container.offset();
4245
-
4246
- offset.bottom = offset.top + this.$container.outerHeight(false);
4247
-
4248
- var container = {
4249
- height: this.$container.outerHeight(false)
4250
- };
4251
-
4252
- container.top = offset.top;
4253
- container.bottom = offset.top + container.height;
4254
-
4255
- var dropdown = {
4256
- height: this.$dropdown.outerHeight(false)
4257
- };
4258
-
4259
- var viewport = {
4260
- top: $window.scrollTop(),
4261
- bottom: $window.scrollTop() + $window.height()
4262
- };
4263
-
4264
- var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
4265
- var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
4266
-
4267
- var css = {
4268
- left: offset.left,
4269
- top: container.bottom
4270
- };
4271
-
4272
- // Determine what the parent element is to use for calciulating the offset
4273
- var $offsetParent = this.$dropdownParent;
4274
-
4275
- // For statically positoned elements, we need to get the element
4276
- // that is determining the offset
4277
- if ($offsetParent.css('position') === 'static') {
4278
- $offsetParent = $offsetParent.offsetParent();
4279
- }
4280
-
4281
- var parentOffset = $offsetParent.offset();
4282
-
4283
- css.top -= parentOffset.top;
4284
- css.left -= parentOffset.left;
4285
-
4286
- if (!isCurrentlyAbove && !isCurrentlyBelow) {
4287
- newDirection = 'below';
4288
- }
4289
-
4290
- if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
4291
- newDirection = 'above';
4292
- } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
4293
- newDirection = 'below';
4294
- }
4295
-
4296
- if (newDirection == 'above' ||
4297
- (isCurrentlyAbove && newDirection !== 'below')) {
4298
- css.top = container.top - parentOffset.top - dropdown.height;
4299
- }
4300
-
4301
- if (newDirection != null) {
4302
- this.$dropdown
4303
- .removeClass('select2-dropdown--below select2-dropdown--above')
4304
- .addClass('select2-dropdown--' + newDirection);
4305
- this.$container
4306
- .removeClass('select2-container--below select2-container--above')
4307
- .addClass('select2-container--' + newDirection);
4308
- }
4309
-
4310
- this.$dropdownContainer.css(css);
4311
- };
4312
-
4313
- AttachBody.prototype._resizeDropdown = function () {
4314
- var css = {
4315
- width: this.$container.outerWidth(false) + 'px'
4316
- };
4317
-
4318
- if (this.options.get('dropdownAutoWidth')) {
4319
- css.minWidth = css.width;
4320
- css.position = 'relative';
4321
- css.width = 'auto';
4322
- }
4323
-
4324
- this.$dropdown.css(css);
4325
- };
4326
-
4327
- AttachBody.prototype._showDropdown = function (decorated) {
4328
- this.$dropdownContainer.appendTo(this.$dropdownParent);
4329
-
4330
- this._positionDropdown();
4331
- this._resizeDropdown();
4332
- };
4333
-
4334
- return AttachBody;
4335
- });
4336
-
4337
- S2.define('select2/dropdown/minimumResultsForSearch',[
4338
-
4339
- ], function () {
4340
- function countResults (data) {
4341
- var count = 0;
4342
-
4343
- for (var d = 0; d < data.length; d++) {
4344
- var item = data[d];
4345
-
4346
- if (item.children) {
4347
- count += countResults(item.children);
4348
- } else {
4349
- count++;
4350
- }
4351
- }
4352
-
4353
- return count;
4354
- }
4355
-
4356
- function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
4357
- this.minimumResultsForSearch = options.get('minimumResultsForSearch');
4358
-
4359
- if (this.minimumResultsForSearch < 0) {
4360
- this.minimumResultsForSearch = Infinity;
4361
- }
4362
-
4363
- decorated.call(this, $element, options, dataAdapter);
4364
- }
4365
-
4366
- MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
4367
- if (countResults(params.data.results) < this.minimumResultsForSearch) {
4368
- return false;
4369
- }
4370
-
4371
- return decorated.call(this, params);
4372
- };
4373
-
4374
- return MinimumResultsForSearch;
4375
- });
4376
-
4377
- S2.define('select2/dropdown/selectOnClose',[
4378
-
4379
- ], function () {
4380
- function SelectOnClose () { }
4381
-
4382
- SelectOnClose.prototype.bind = function (decorated, container, $container) {
4383
- var self = this;
4384
-
4385
- decorated.call(this, container, $container);
4386
-
4387
- container.on('close', function (params) {
4388
- self._handleSelectOnClose(params);
4389
- });
4390
- };
4391
-
4392
- SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
4393
- if (params && params.originalSelect2Event != null) {
4394
- var event = params.originalSelect2Event;
4395
-
4396
- // Don't select an item if the close event was triggered from a select or
4397
- // unselect event
4398
- if (event._type === 'select' || event._type === 'unselect') {
4399
- return;
4400
- }
4401
- }
4402
-
4403
- var $highlightedResults = this.getHighlightedResults();
4404
-
4405
- // Only select highlighted results
4406
- if ($highlightedResults.length < 1) {
4407
- return;
4408
- }
4409
-
4410
- var data = $highlightedResults.data('data');
4411
-
4412
- // Don't re-select already selected resulte
4413
- if (
4414
- (data.element != null && data.element.selected) ||
4415
- (data.element == null && data.selected)
4416
- ) {
4417
- return;
4418
- }
4419
-
4420
- this.trigger('select', {
4421
- data: data
4422
- });
4423
- };
4424
-
4425
- return SelectOnClose;
4426
- });
4427
-
4428
- S2.define('select2/dropdown/closeOnSelect',[
4429
-
4430
- ], function () {
4431
- function CloseOnSelect () { }
4432
-
4433
- CloseOnSelect.prototype.bind = function (decorated, container, $container) {
4434
- var self = this;
4435
-
4436
- decorated.call(this, container, $container);
4437
-
4438
- container.on('select', function (evt) {
4439
- self._selectTriggered(evt);
4440
- });
4441
-
4442
- container.on('unselect', function (evt) {
4443
- self._selectTriggered(evt);
4444
- });
4445
- };
4446
-
4447
- CloseOnSelect.prototype._selectTriggered = function (_, evt) {
4448
- var originalEvent = evt.originalEvent;
4449
-
4450
- // Don't close if the control key is being held
4451
- if (originalEvent && originalEvent.ctrlKey) {
4452
- return;
4453
- }
4454
-
4455
- this.trigger('close', {
4456
- originalEvent: originalEvent,
4457
- originalSelect2Event: evt
4458
- });
4459
- };
4460
-
4461
- return CloseOnSelect;
4462
- });
4463
-
4464
- S2.define('select2/i18n/en',[],function () {
4465
- // English
4466
- return {
4467
- errorLoading: function () {
4468
- return 'The results could not be loaded.';
4469
- },
4470
- inputTooLong: function (args) {
4471
- var overChars = args.input.length - args.maximum;
4472
-
4473
- var message = 'Please delete ' + overChars + ' character';
4474
-
4475
- if (overChars != 1) {
4476
- message += 's';
4477
- }
4478
-
4479
- return message;
4480
- },
4481
- inputTooShort: function (args) {
4482
- var remainingChars = args.minimum - args.input.length;
4483
-
4484
- var message = 'Please enter ' + remainingChars + ' or more characters';
4485
-
4486
- return message;
4487
- },
4488
- loadingMore: function () {
4489
- return 'Loading more results…';
4490
- },
4491
- maximumSelected: function (args) {
4492
- var message = 'You can only select ' + args.maximum + ' item';
4493
-
4494
- if (args.maximum != 1) {
4495
- message += 's';
4496
- }
4497
-
4498
- return message;
4499
- },
4500
- noResults: function () {
4501
- return 'No results found';
4502
- },
4503
- searching: function () {
4504
- return 'Searching…';
4505
- }
4506
- };
4507
- });
4508
-
4509
- S2.define('select2/defaults',[
4510
- 'jquery',
4511
- 'require',
4512
-
4513
- './results',
4514
-
4515
- './selection/single',
4516
- './selection/multiple',
4517
- './selection/placeholder',
4518
- './selection/allowClear',
4519
- './selection/search',
4520
- './selection/eventRelay',
4521
-
4522
- './utils',
4523
- './translation',
4524
- './diacritics',
4525
-
4526
- './data/select',
4527
- './data/array',
4528
- './data/ajax',
4529
- './data/tags',
4530
- './data/tokenizer',
4531
- './data/minimumInputLength',
4532
- './data/maximumInputLength',
4533
- './data/maximumSelectionLength',
4534
-
4535
- './dropdown',
4536
- './dropdown/search',
4537
- './dropdown/hidePlaceholder',
4538
- './dropdown/infiniteScroll',
4539
- './dropdown/attachBody',
4540
- './dropdown/minimumResultsForSearch',
4541
- './dropdown/selectOnClose',
4542
- './dropdown/closeOnSelect',
4543
-
4544
- './i18n/en'
4545
- ], function ($, require,
4546
-
4547
- ResultsList,
4548
-
4549
- SingleSelection, MultipleSelection, Placeholder, AllowClear,
4550
- SelectionSearch, EventRelay,
4551
-
4552
- Utils, Translation, DIACRITICS,
4553
-
4554
- SelectData, ArrayData, AjaxData, Tags, Tokenizer,
4555
- MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
4556
-
4557
- Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
4558
- AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
4559
-
4560
- EnglishTranslation) {
4561
- function Defaults () {
4562
- this.reset();
4563
- }
4564
-
4565
- Defaults.prototype.apply = function (options) {
4566
- options = $.extend(true, {}, this.defaults, options);
4567
-
4568
- if (options.dataAdapter == null) {
4569
- if (options.ajax != null) {
4570
- options.dataAdapter = AjaxData;
4571
- } else if (options.data != null) {
4572
- options.dataAdapter = ArrayData;
4573
- } else {
4574
- options.dataAdapter = SelectData;
4575
- }
4576
-
4577
- if (options.minimumInputLength > 0) {
4578
- options.dataAdapter = Utils.Decorate(
4579
- options.dataAdapter,
4580
- MinimumInputLength
4581
- );
4582
- }
4583
-
4584
- if (options.maximumInputLength > 0) {
4585
- options.dataAdapter = Utils.Decorate(
4586
- options.dataAdapter,
4587
- MaximumInputLength
4588
- );
4589
- }
4590
-
4591
- if (options.maximumSelectionLength > 0) {
4592
- options.dataAdapter = Utils.Decorate(
4593
- options.dataAdapter,
4594
- MaximumSelectionLength
4595
- );
4596
- }
4597
-
4598
- if (options.tags) {
4599
- options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
4600
- }
4601
-
4602
- if (options.tokenSeparators != null || options.tokenizer != null) {
4603
- options.dataAdapter = Utils.Decorate(
4604
- options.dataAdapter,
4605
- Tokenizer
4606
- );
4607
- }
4608
-
4609
- if (options.query != null) {
4610
- var Query = require(options.amdBase + 'compat/query');
4611
-
4612
- options.dataAdapter = Utils.Decorate(
4613
- options.dataAdapter,
4614
- Query
4615
- );
4616
- }
4617
-
4618
- if (options.initSelection != null) {
4619
- var InitSelection = require(options.amdBase + 'compat/initSelection');
4620
-
4621
- options.dataAdapter = Utils.Decorate(
4622
- options.dataAdapter,
4623
- InitSelection
4624
- );
4625
- }
4626
- }
4627
-
4628
- if (options.resultsAdapter == null) {
4629
- options.resultsAdapter = ResultsList;
4630
-
4631
- if (options.ajax != null) {
4632
- options.resultsAdapter = Utils.Decorate(
4633
- options.resultsAdapter,
4634
- InfiniteScroll
4635
- );
4636
- }
4637
-
4638
- if (options.placeholder != null) {
4639
- options.resultsAdapter = Utils.Decorate(
4640
- options.resultsAdapter,
4641
- HidePlaceholder
4642
- );
4643
- }
4644
-
4645
- if (options.selectOnClose) {
4646
- options.resultsAdapter = Utils.Decorate(
4647
- options.resultsAdapter,
4648
- SelectOnClose
4649
- );
4650
- }
4651
- }
4652
-
4653
- if (options.dropdownAdapter == null) {
4654
- if (options.multiple) {
4655
- options.dropdownAdapter = Dropdown;
4656
- } else {
4657
- var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
4658
-
4659
- options.dropdownAdapter = SearchableDropdown;
4660
- }
4661
-
4662
- if (options.minimumResultsForSearch !== 0) {
4663
- options.dropdownAdapter = Utils.Decorate(
4664
- options.dropdownAdapter,
4665
- MinimumResultsForSearch
4666
- );
4667
- }
4668
-
4669
- if (options.closeOnSelect) {
4670
- options.dropdownAdapter = Utils.Decorate(
4671
- options.dropdownAdapter,
4672
- CloseOnSelect
4673
- );
4674
- }
4675
-
4676
- if (
4677
- options.dropdownCssClass != null ||
4678
- options.dropdownCss != null ||
4679
- options.adaptDropdownCssClass != null
4680
- ) {
4681
- var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
4682
-
4683
- options.dropdownAdapter = Utils.Decorate(
4684
- options.dropdownAdapter,
4685
- DropdownCSS
4686
- );
4687
- }
4688
-
4689
- options.dropdownAdapter = Utils.Decorate(
4690
- options.dropdownAdapter,
4691
- AttachBody
4692
- );
4693
- }
4694
-
4695
- if (options.selectionAdapter == null) {
4696
- if (options.multiple) {
4697
- options.selectionAdapter = MultipleSelection;
4698
- } else {
4699
- options.selectionAdapter = SingleSelection;
4700
- }
4701
-
4702
- // Add the placeholder mixin if a placeholder was specified
4703
- if (options.placeholder != null) {
4704
- options.selectionAdapter = Utils.Decorate(
4705
- options.selectionAdapter,
4706
- Placeholder
4707
- );
4708
- }
4709
-
4710
- if (options.allowClear) {
4711
- options.selectionAdapter = Utils.Decorate(
4712
- options.selectionAdapter,
4713
- AllowClear
4714
- );
4715
- }
4716
-
4717
- if (options.multiple) {
4718
- options.selectionAdapter = Utils.Decorate(
4719
- options.selectionAdapter,
4720
- SelectionSearch
4721
- );
4722
- }
4723
-
4724
- if (
4725
- options.containerCssClass != null ||
4726
- options.containerCss != null ||
4727
- options.adaptContainerCssClass != null
4728
- ) {
4729
- var ContainerCSS = require(options.amdBase + 'compat/containerCss');
4730
-
4731
- options.selectionAdapter = Utils.Decorate(
4732
- options.selectionAdapter,
4733
- ContainerCSS
4734
- );
4735
- }
4736
-
4737
- options.selectionAdapter = Utils.Decorate(
4738
- options.selectionAdapter,
4739
- EventRelay
4740
- );
4741
- }
4742
-
4743
- if (typeof options.language === 'string') {
4744
- // Check if the language is specified with a region
4745
- if (options.language.indexOf('-') > 0) {
4746
- // Extract the region information if it is included
4747
- var languageParts = options.language.split('-');
4748
- var baseLanguage = languageParts[0];
4749
-
4750
- options.language = [options.language, baseLanguage];
4751
- } else {
4752
- options.language = [options.language];
4753
- }
4754
- }
4755
-
4756
- if ($.isArray(options.language)) {
4757
- var languages = new Translation();
4758
- options.language.push('en');
4759
-
4760
- var languageNames = options.language;
4761
-
4762
- for (var l = 0; l < languageNames.length; l++) {
4763
- var name = languageNames[l];
4764
- var language = {};
4765
-
4766
- try {
4767
- // Try to load it with the original name
4768
- language = Translation.loadPath(name);
4769
- } catch (e) {
4770
- try {
4771
- // If we couldn't load it, check if it wasn't the full path
4772
- name = this.defaults.amdLanguageBase + name;
4773
- language = Translation.loadPath(name);
4774
- } catch (ex) {
4775
- // The translation could not be loaded at all. Sometimes this is
4776
- // because of a configuration problem, other times this can be
4777
- // because of how Select2 helps load all possible translation files.
4778
- if (options.debug && window.console && console.warn) {
4779
- console.warn(
4780
- 'Select2: The language file for "' + name + '" could not be ' +
4781
- 'automatically loaded. A fallback will be used instead.'
4782
- );
4783
- }
4784
-
4785
- continue;
4786
- }
4787
- }
4788
-
4789
- languages.extend(language);
4790
- }
4791
-
4792
- options.translations = languages;
4793
- } else {
4794
- var baseTranslation = Translation.loadPath(
4795
- this.defaults.amdLanguageBase + 'en'
4796
- );
4797
- var customTranslation = new Translation(options.language);
4798
-
4799
- customTranslation.extend(baseTranslation);
4800
-
4801
- options.translations = customTranslation;
4802
- }
4803
-
4804
- return options;
4805
- };
4806
-
4807
- Defaults.prototype.reset = function () {
4808
- function stripDiacritics (text) {
4809
- // Used 'uni range + named function' from http://jsperf.com/diacritics/18
4810
- function match(a) {
4811
- return DIACRITICS[a] || a;
4812
- }
4813
-
4814
- return text.replace(/[^\u0000-\u007E]/g, match);
4815
- }
4816
-
4817
- function matcher (params, data) {
4818
- // Always return the object if there is nothing to compare
4819
- if ($.trim(params.term) === '') {
4820
- return data;
4821
- }
4822
-
4823
- // Do a recursive check for options with children
4824
- if (data.children && data.children.length > 0) {
4825
- // Clone the data object if there are children
4826
- // This is required as we modify the object to remove any non-matches
4827
- var match = $.extend(true, {}, data);
4828
-
4829
- // Check each child of the option
4830
- for (var c = data.children.length - 1; c >= 0; c--) {
4831
- var child = data.children[c];
4832
-
4833
- var matches = matcher(params, child);
4834
-
4835
- // If there wasn't a match, remove the object in the array
4836
- if (matches == null) {
4837
- match.children.splice(c, 1);
4838
- }
4839
- }
4840
-
4841
- // If any children matched, return the new object
4842
- if (match.children.length > 0) {
4843
- return match;
4844
- }
4845
-
4846
- // If there were no matching children, check just the plain object
4847
- return matcher(params, match);
4848
- }
4849
-
4850
- var original = stripDiacritics(data.text).toUpperCase();
4851
- var term = stripDiacritics(params.term).toUpperCase();
4852
-
4853
- // Check if the text contains the term
4854
- if (original.indexOf(term) > -1) {
4855
- return data;
4856
- }
4857
-
4858
- // If it doesn't contain the term, don't return anything
4859
- return null;
4860
- }
4861
-
4862
- this.defaults = {
4863
- amdBase: './',
4864
- amdLanguageBase: './i18n/',
4865
- closeOnSelect: true,
4866
- debug: false,
4867
- dropdownAutoWidth: false,
4868
- escapeMarkup: Utils.escapeMarkup,
4869
- language: EnglishTranslation,
4870
- matcher: matcher,
4871
- minimumInputLength: 0,
4872
- maximumInputLength: 0,
4873
- maximumSelectionLength: 0,
4874
- minimumResultsForSearch: 0,
4875
- selectOnClose: false,
4876
- sorter: function (data) {
4877
- return data;
4878
- },
4879
- templateResult: function (result) {
4880
- return result.text;
4881
- },
4882
- templateSelection: function (selection) {
4883
- return selection.text;
4884
- },
4885
- theme: 'default',
4886
- width: 'resolve'
4887
- };
4888
- };
4889
-
4890
- Defaults.prototype.set = function (key, value) {
4891
- var camelKey = $.camelCase(key);
4892
-
4893
- var data = {};
4894
- data[camelKey] = value;
4895
-
4896
- var convertedData = Utils._convertData(data);
4897
-
4898
- $.extend(this.defaults, convertedData);
4899
- };
4900
-
4901
- var defaults = new Defaults();
4902
-
4903
- return defaults;
4904
- });
4905
-
4906
- S2.define('select2/options',[
4907
- 'require',
4908
- 'jquery',
4909
- './defaults',
4910
- './utils'
4911
- ], function (require, $, Defaults, Utils) {
4912
- function Options (options, $element) {
4913
- this.options = options;
4914
-
4915
- if ($element != null) {
4916
- this.fromElement($element);
4917
- }
4918
-
4919
- this.options = Defaults.apply(this.options);
4920
-
4921
- if ($element && $element.is('input')) {
4922
- var InputCompat = require(this.get('amdBase') + 'compat/inputData');
4923
-
4924
- this.options.dataAdapter = Utils.Decorate(
4925
- this.options.dataAdapter,
4926
- InputCompat
4927
- );
4928
- }
4929
- }
4930
-
4931
- Options.prototype.fromElement = function ($e) {
4932
- var excludedData = ['select2'];
4933
-
4934
- if (this.options.multiple == null) {
4935
- this.options.multiple = $e.prop('multiple');
4936
- }
4937
-
4938
- if (this.options.disabled == null) {
4939
- this.options.disabled = $e.prop('disabled');
4940
- }
4941
-
4942
- if (this.options.language == null) {
4943
- if ($e.prop('lang')) {
4944
- this.options.language = $e.prop('lang').toLowerCase();
4945
- } else if ($e.closest('[lang]').prop('lang')) {
4946
- this.options.language = $e.closest('[lang]').prop('lang');
4947
- }
4948
- }
4949
-
4950
- if (this.options.dir == null) {
4951
- if ($e.prop('dir')) {
4952
- this.options.dir = $e.prop('dir');
4953
- } else if ($e.closest('[dir]').prop('dir')) {
4954
- this.options.dir = $e.closest('[dir]').prop('dir');
4955
- } else {
4956
- this.options.dir = 'ltr';
4957
- }
4958
- }
4959
-
4960
- $e.prop('disabled', this.options.disabled);
4961
- $e.prop('multiple', this.options.multiple);
4962
-
4963
- if ($e.data('select2Tags')) {
4964
- if (this.options.debug && window.console && console.warn) {
4965
- console.warn(
4966
- 'Select2: The `data-select2-tags` attribute has been changed to ' +
4967
- 'use the `data-data` and `data-tags="true"` attributes and will be ' +
4968
- 'removed in future versions of Select2.'
4969
- );
4970
- }
4971
-
4972
- $e.data('data', $e.data('select2Tags'));
4973
- $e.data('tags', true);
4974
- }
4975
-
4976
- if ($e.data('ajaxUrl')) {
4977
- if (this.options.debug && window.console && console.warn) {
4978
- console.warn(
4979
- 'Select2: The `data-ajax-url` attribute has been changed to ' +
4980
- '`data-ajax--url` and support for the old attribute will be removed' +
4981
- ' in future versions of Select2.'
4982
- );
4983
- }
4984
-
4985
- $e.attr('ajax--url', $e.data('ajaxUrl'));
4986
- $e.data('ajax--url', $e.data('ajaxUrl'));
4987
- }
4988
-
4989
- var dataset = {};
4990
-
4991
- // Prefer the element's `dataset` attribute if it exists
4992
- // jQuery 1.x does not correctly handle data attributes with multiple dashes
4993
- if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
4994
- dataset = $.extend(true, {}, $e[0].dataset, $e.data());
4995
- } else {
4996
- dataset = $e.data();
4997
- }
4998
-
4999
- var data = $.extend(true, {}, dataset);
5000
-
5001
- data = Utils._convertData(data);
5002
-
5003
- for (var key in data) {
5004
- if ($.inArray(key, excludedData) > -1) {
5005
- continue;
5006
- }
5007
-
5008
- if ($.isPlainObject(this.options[key])) {
5009
- $.extend(this.options[key], data[key]);
5010
- } else {
5011
- this.options[key] = data[key];
5012
- }
5013
- }
5014
-
5015
- return this;
5016
- };
5017
-
5018
- Options.prototype.get = function (key) {
5019
- return this.options[key];
5020
- };
5021
-
5022
- Options.prototype.set = function (key, val) {
5023
- this.options[key] = val;
5024
- };
5025
-
5026
- return Options;
5027
- });
5028
-
5029
- S2.define('select2/core',[
5030
- 'jquery',
5031
- './options',
5032
- './utils',
5033
- './keys'
5034
- ], function ($, Options, Utils, KEYS) {
5035
- var Select2 = function ($element, options) {
5036
- if ($element.data('select2') != null) {
5037
- $element.data('select2').destroy();
5038
- }
5039
-
5040
- this.$element = $element;
5041
-
5042
- this.id = this._generateId($element);
5043
-
5044
- options = options || {};
5045
-
5046
- this.options = new Options(options, $element);
5047
-
5048
- Select2.__super__.constructor.call(this);
5049
-
5050
- // Set up the tabindex
5051
-
5052
- var tabindex = $element.attr('tabindex') || 0;
5053
- $element.data('old-tabindex', tabindex);
5054
- $element.attr('tabindex', '-1');
5055
-
5056
- // Set up containers and adapters
5057
-
5058
- var DataAdapter = this.options.get('dataAdapter');
5059
- this.dataAdapter = new DataAdapter($element, this.options);
5060
-
5061
- var $container = this.render();
5062
-
5063
- this._placeContainer($container);
5064
-
5065
- var SelectionAdapter = this.options.get('selectionAdapter');
5066
- this.selection = new SelectionAdapter($element, this.options);
5067
- this.$selection = this.selection.render();
5068
-
5069
- this.selection.position(this.$selection, $container);
5070
-
5071
- var DropdownAdapter = this.options.get('dropdownAdapter');
5072
- this.dropdown = new DropdownAdapter($element, this.options);
5073
- this.$dropdown = this.dropdown.render();
5074
-
5075
- this.dropdown.position(this.$dropdown, $container);
5076
-
5077
- var ResultsAdapter = this.options.get('resultsAdapter');
5078
- this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
5079
- this.$results = this.results.render();
5080
-
5081
- this.results.position(this.$results, this.$dropdown);
5082
-
5083
- // Bind events
5084
-
5085
- var self = this;
5086
-
5087
- // Bind the container to all of the adapters
5088
- this._bindAdapters();
5089
-
5090
- // Register any DOM event handlers
5091
- this._registerDomEvents();
5092
-
5093
- // Register any internal event handlers
5094
- this._registerDataEvents();
5095
- this._registerSelectionEvents();
5096
- this._registerDropdownEvents();
5097
- this._registerResultsEvents();
5098
- this._registerEvents();
5099
-
5100
- // Set the initial state
5101
- this.dataAdapter.current(function (initialData) {
5102
- self.trigger('selection:update', {
5103
- data: initialData
5104
- });
5105
- });
5106
-
5107
- // Hide the original select
5108
- $element.addClass('select2-hidden-accessible');
5109
- $element.attr('aria-hidden', 'true');
5110
-
5111
- // Synchronize any monitored attributes
5112
- this._syncAttributes();
5113
-
5114
- $element.data('select2', this);
5115
- };
5116
-
5117
- Utils.Extend(Select2, Utils.Observable);
5118
-
5119
- Select2.prototype._generateId = function ($element) {
5120
- var id = '';
5121
-
5122
- if ($element.attr('id') != null) {
5123
- id = $element.attr('id');
5124
- } else if ($element.attr('name') != null) {
5125
- id = $element.attr('name') + '-' + Utils.generateChars(2);
5126
- } else {
5127
- id = Utils.generateChars(4);
5128
- }
5129
-
5130
- id = id.replace(/(:|\.|\[|\]|,)/g, '');
5131
- id = 'select2-' + id;
5132
-
5133
- return id;
5134
- };
5135
-
5136
- Select2.prototype._placeContainer = function ($container) {
5137
- $container.insertAfter(this.$element);
5138
-
5139
- var width = this._resolveWidth(this.$element, this.options.get('width'));
5140
-
5141
- if (width != null) {
5142
- $container.css('width', width);
5143
- }
5144
- };
5145
-
5146
- Select2.prototype._resolveWidth = function ($element, method) {
5147
- var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
5148
-
5149
- if (method == 'resolve') {
5150
- var styleWidth = this._resolveWidth($element, 'style');
5151
-
5152
- if (styleWidth != null) {
5153
- return styleWidth;
5154
- }
5155
-
5156
- return this._resolveWidth($element, 'element');
5157
- }
5158
-
5159
- if (method == 'element') {
5160
- var elementWidth = $element.outerWidth(false);
5161
-
5162
- if (elementWidth <= 0) {
5163
- return 'auto';
5164
- }
5165
-
5166
- return elementWidth + 'px';
5167
- }
5168
-
5169
- if (method == 'style') {
5170
- var style = $element.attr('style');
5171
-
5172
- if (typeof(style) !== 'string') {
5173
- return null;
5174
- }
5175
-
5176
- var attrs = style.split(';');
5177
-
5178
- for (var i = 0, l = attrs.length; i < l; i = i + 1) {
5179
- var attr = attrs[i].replace(/\s/g, '');
5180
- var matches = attr.match(WIDTH);
5181
-
5182
- if (matches !== null && matches.length >= 1) {
5183
- return matches[1];
5184
- }
5185
- }
5186
-
5187
- return null;
5188
- }
5189
-
5190
- return method;
5191
- };
5192
-
5193
- Select2.prototype._bindAdapters = function () {
5194
- this.dataAdapter.bind(this, this.$container);
5195
- this.selection.bind(this, this.$container);
5196
-
5197
- this.dropdown.bind(this, this.$container);
5198
- this.results.bind(this, this.$container);
5199
- };
5200
-
5201
- Select2.prototype._registerDomEvents = function () {
5202
- var self = this;
5203
-
5204
- this.$element.on('change.select2', function () {
5205
- self.dataAdapter.current(function (data) {
5206
- self.trigger('selection:update', {
5207
- data: data
5208
- });
5209
- });
5210
- });
5211
-
5212
- this.$element.on('focus.select2', function (evt) {
5213
- self.trigger('focus', evt);
5214
- });
5215
-
5216
- this._syncA = Utils.bind(this._syncAttributes, this);
5217
- this._syncS = Utils.bind(this._syncSubtree, this);
5218
-
5219
- if (this.$element[0].attachEvent) {
5220
- this.$element[0].attachEvent('onpropertychange', this._syncA);
5221
- }
5222
-
5223
- var observer = window.MutationObserver ||
5224
- window.WebKitMutationObserver ||
5225
- window.MozMutationObserver
5226
- ;
5227
-
5228
- if (observer != null) {
5229
- this._observer = new observer(function (mutations) {
5230
- $.each(mutations, self._syncA);
5231
- $.each(mutations, self._syncS);
5232
- });
5233
- this._observer.observe(this.$element[0], {
5234
- attributes: true,
5235
- childList: true,
5236
- subtree: false
5237
- });
5238
- } else if (this.$element[0].addEventListener) {
5239
- this.$element[0].addEventListener(
5240
- 'DOMAttrModified',
5241
- self._syncA,
5242
- false
5243
- );
5244
- this.$element[0].addEventListener(
5245
- 'DOMNodeInserted',
5246
- self._syncS,
5247
- false
5248
- );
5249
- this.$element[0].addEventListener(
5250
- 'DOMNodeRemoved',
5251
- self._syncS,
5252
- false
5253
- );
5254
- }
5255
- };
5256
-
5257
- Select2.prototype._registerDataEvents = function () {
5258
- var self = this;
5259
-
5260
- this.dataAdapter.on('*', function (name, params) {
5261
- self.trigger(name, params);
5262
- });
5263
- };
5264
-
5265
- Select2.prototype._registerSelectionEvents = function () {
5266
- var self = this;
5267
- var nonRelayEvents = ['toggle', 'focus'];
5268
-
5269
- this.selection.on('toggle', function () {
5270
- self.toggleDropdown();
5271
- });
5272
-
5273
- this.selection.on('focus', function (params) {
5274
- self.focus(params);
5275
- });
5276
-
5277
- this.selection.on('*', function (name, params) {
5278
- if ($.inArray(name, nonRelayEvents) !== -1) {
5279
- return;
5280
- }
5281
-
5282
- self.trigger(name, params);
5283
- });
5284
- };
5285
-
5286
- Select2.prototype._registerDropdownEvents = function () {
5287
- var self = this;
5288
-
5289
- this.dropdown.on('*', function (name, params) {
5290
- self.trigger(name, params);
5291
- });
5292
- };
5293
-
5294
- Select2.prototype._registerResultsEvents = function () {
5295
- var self = this;
5296
-
5297
- this.results.on('*', function (name, params) {
5298
- self.trigger(name, params);
5299
- });
5300
- };
5301
-
5302
- Select2.prototype._registerEvents = function () {
5303
- var self = this;
5304
-
5305
- this.on('open', function () {
5306
- self.$container.addClass('select2-container--open');
5307
- });
5308
-
5309
- this.on('close', function () {
5310
- self.$container.removeClass('select2-container--open');
5311
- });
5312
-
5313
- this.on('enable', function () {
5314
- self.$container.removeClass('select2-container--disabled');
5315
- });
5316
-
5317
- this.on('disable', function () {
5318
- self.$container.addClass('select2-container--disabled');
5319
- });
5320
-
5321
- this.on('blur', function () {
5322
- self.$container.removeClass('select2-container--focus');
5323
- });
5324
-
5325
- this.on('query', function (params) {
5326
- if (!self.isOpen()) {
5327
- self.trigger('open', {});
5328
- }
5329
-
5330
- this.dataAdapter.query(params, function (data) {
5331
- self.trigger('results:all', {
5332
- data: data,
5333
- query: params
5334
- });
5335
- });
5336
- });
5337
-
5338
- this.on('query:append', function (params) {
5339
- this.dataAdapter.query(params, function (data) {
5340
- self.trigger('results:append', {
5341
- data: data,
5342
- query: params
5343
- });
5344
- });
5345
- });
5346
-
5347
- this.on('keypress', function (evt) {
5348
- var key = evt.which;
5349
-
5350
- if (self.isOpen()) {
5351
- if (key === KEYS.ESC || key === KEYS.TAB ||
5352
- (key === KEYS.UP && evt.altKey)) {
5353
- self.close();
5354
-
5355
- evt.preventDefault();
5356
- } else if (key === KEYS.ENTER) {
5357
- self.trigger('results:select', {});
5358
-
5359
- evt.preventDefault();
5360
- } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
5361
- self.trigger('results:toggle', {});
5362
-
5363
- evt.preventDefault();
5364
- } else if (key === KEYS.UP) {
5365
- self.trigger('results:previous', {});
5366
-
5367
- evt.preventDefault();
5368
- } else if (key === KEYS.DOWN) {
5369
- self.trigger('results:next', {});
5370
-
5371
- evt.preventDefault();
5372
- }
5373
- } else {
5374
- if (key === KEYS.ENTER || key === KEYS.SPACE ||
5375
- (key === KEYS.DOWN && evt.altKey)) {
5376
- self.open();
5377
-
5378
- evt.preventDefault();
5379
- }
5380
- }
5381
- });
5382
- };
5383
-
5384
- Select2.prototype._syncAttributes = function () {
5385
- this.options.set('disabled', this.$element.prop('disabled'));
5386
-
5387
- if (this.options.get('disabled')) {
5388
- if (this.isOpen()) {
5389
- this.close();
5390
- }
5391
-
5392
- this.trigger('disable', {});
5393
- } else {
5394
- this.trigger('enable', {});
5395
- }
5396
- };
5397
-
5398
- Select2.prototype._syncSubtree = function (evt, mutations) {
5399
- var changed = false;
5400
- var self = this;
5401
-
5402
- // Ignore any mutation events raised for elements that aren't options or
5403
- // optgroups. This handles the case when the select element is destroyed
5404
- if (
5405
- evt && evt.target && (
5406
- evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
5407
- )
5408
- ) {
5409
- return;
5410
- }
5411
-
5412
- if (!mutations) {
5413
- // If mutation events aren't supported, then we can only assume that the
5414
- // change affected the selections
5415
- changed = true;
5416
- } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
5417
- for (var n = 0; n < mutations.addedNodes.length; n++) {
5418
- var node = mutations.addedNodes[n];
5419
-
5420
- if (node.selected) {
5421
- changed = true;
5422
- }
5423
- }
5424
- } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
5425
- changed = true;
5426
- }
5427
-
5428
- // Only re-pull the data if we think there is a change
5429
- if (changed) {
5430
- this.dataAdapter.current(function (currentData) {
5431
- self.trigger('selection:update', {
5432
- data: currentData
5433
- });
5434
- });
5435
- }
5436
- };
5437
-
5438
- /**
5439
- * Override the trigger method to automatically trigger pre-events when
5440
- * there are events that can be prevented.
5441
- */
5442
- Select2.prototype.trigger = function (name, args) {
5443
- var actualTrigger = Select2.__super__.trigger;
5444
- var preTriggerMap = {
5445
- 'open': 'opening',
5446
- 'close': 'closing',
5447
- 'select': 'selecting',
5448
- 'unselect': 'unselecting'
5449
- };
5450
-
5451
- if (args === undefined) {
5452
- args = {};
5453
- }
5454
-
5455
- if (name in preTriggerMap) {
5456
- var preTriggerName = preTriggerMap[name];
5457
- var preTriggerArgs = {
5458
- prevented: false,
5459
- name: name,
5460
- args: args
5461
- };
5462
-
5463
- actualTrigger.call(this, preTriggerName, preTriggerArgs);
5464
-
5465
- if (preTriggerArgs.prevented) {
5466
- args.prevented = true;
5467
-
5468
- return;
5469
- }
5470
- }
5471
-
5472
- actualTrigger.call(this, name, args);
5473
- };
5474
-
5475
- Select2.prototype.toggleDropdown = function () {
5476
- if (this.options.get('disabled')) {
5477
- return;
5478
- }
5479
-
5480
- if (this.isOpen()) {
5481
- this.close();
5482
- } else {
5483
- this.open();
5484
- }
5485
- };
5486
-
5487
- Select2.prototype.open = function () {
5488
- if (this.isOpen()) {
5489
- return;
5490
- }
5491
-
5492
- this.trigger('query', {});
5493
- };
5494
-
5495
- Select2.prototype.close = function () {
5496
- if (!this.isOpen()) {
5497
- return;
5498
- }
5499
-
5500
- this.trigger('close', {});
5501
- };
5502
-
5503
- Select2.prototype.isOpen = function () {
5504
- return this.$container.hasClass('select2-container--open');
5505
- };
5506
-
5507
- Select2.prototype.hasFocus = function () {
5508
- return this.$container.hasClass('select2-container--focus');
5509
- };
5510
-
5511
- Select2.prototype.focus = function (data) {
5512
- // No need to re-trigger focus events if we are already focused
5513
- if (this.hasFocus()) {
5514
- return;
5515
- }
5516
-
5517
- this.$container.addClass('select2-container--focus');
5518
- this.trigger('focus', {});
5519
- };
5520
-
5521
- Select2.prototype.enable = function (args) {
5522
- if (this.options.get('debug') && window.console && console.warn) {
5523
- console.warn(
5524
- 'Select2: The `select2("enable")` method has been deprecated and will' +
5525
- ' be removed in later Select2 versions. Use $element.prop("disabled")' +
5526
- ' instead.'
5527
- );
5528
- }
5529
-
5530
- if (args == null || args.length === 0) {
5531
- args = [true];
5532
- }
5533
-
5534
- var disabled = !args[0];
5535
-
5536
- this.$element.prop('disabled', disabled);
5537
- };
5538
-
5539
- Select2.prototype.data = function () {
5540
- if (this.options.get('debug') &&
5541
- arguments.length > 0 && window.console && console.warn) {
5542
- console.warn(
5543
- 'Select2: Data can no longer be set using `select2("data")`. You ' +
5544
- 'should consider setting the value instead using `$element.val()`.'
5545
- );
5546
- }
5547
-
5548
- var data = [];
5549
-
5550
- this.dataAdapter.current(function (currentData) {
5551
- data = currentData;
5552
- });
5553
-
5554
- return data;
5555
- };
5556
-
5557
- Select2.prototype.val = function (args) {
5558
- if (this.options.get('debug') && window.console && console.warn) {
5559
- console.warn(
5560
- 'Select2: The `select2("val")` method has been deprecated and will be' +
5561
- ' removed in later Select2 versions. Use $element.val() instead.'
5562
- );
5563
- }
5564
-
5565
- if (args == null || args.length === 0) {
5566
- return this.$element.val();
5567
- }
5568
-
5569
- var newVal = args[0];
5570
-
5571
- if ($.isArray(newVal)) {
5572
- newVal = $.map(newVal, function (obj) {
5573
- return obj.toString();
5574
- });
5575
- }
5576
-
5577
- this.$element.val(newVal).trigger('change');
5578
- };
5579
-
5580
- Select2.prototype.destroy = function () {
5581
- this.$container.remove();
5582
-
5583
- if (this.$element[0].detachEvent) {
5584
- this.$element[0].detachEvent('onpropertychange', this._syncA);
5585
- }
5586
-
5587
- if (this._observer != null) {
5588
- this._observer.disconnect();
5589
- this._observer = null;
5590
- } else if (this.$element[0].removeEventListener) {
5591
- this.$element[0]
5592
- .removeEventListener('DOMAttrModified', this._syncA, false);
5593
- this.$element[0]
5594
- .removeEventListener('DOMNodeInserted', this._syncS, false);
5595
- this.$element[0]
5596
- .removeEventListener('DOMNodeRemoved', this._syncS, false);
5597
- }
5598
-
5599
- this._syncA = null;
5600
- this._syncS = null;
5601
-
5602
- this.$element.off('.select2');
5603
- this.$element.attr('tabindex', this.$element.data('old-tabindex'));
5604
-
5605
- this.$element.removeClass('select2-hidden-accessible');
5606
- this.$element.attr('aria-hidden', 'false');
5607
- this.$element.removeData('select2');
5608
-
5609
- this.dataAdapter.destroy();
5610
- this.selection.destroy();
5611
- this.dropdown.destroy();
5612
- this.results.destroy();
5613
-
5614
- this.dataAdapter = null;
5615
- this.selection = null;
5616
- this.dropdown = null;
5617
- this.results = null;
5618
- };
5619
-
5620
- Select2.prototype.render = function () {
5621
- var $container = $(
5622
- '<span class="select2 select2-container">' +
5623
- '<span class="selection"></span>' +
5624
- '<span class="dropdown-wrapper" aria-hidden="true"></span>' +
5625
- '</span>'
5626
- );
5627
-
5628
- $container.attr('dir', this.options.get('dir'));
5629
-
5630
- this.$container = $container;
5631
-
5632
- this.$container.addClass('select2-container--' + this.options.get('theme'));
5633
-
5634
- $container.data('element', this.$element);
5635
-
5636
- return $container;
5637
- };
5638
-
5639
- return Select2;
5640
- });
5641
-
5642
- S2.define('jquery-mousewheel',[
5643
- 'jquery'
5644
- ], function ($) {
5645
- // Used to shim jQuery.mousewheel for non-full builds.
5646
- return $;
5647
- });
5648
-
5649
- S2.define('jquery.select2',[
5650
- 'jquery',
5651
- 'jquery-mousewheel',
5652
-
5653
- './select2/core',
5654
- './select2/defaults'
5655
- ], function ($, _, Select2, Defaults) {
5656
- if ($.fn.select2 == null) {
5657
- // All methods that should return the element
5658
- var thisMethods = ['open', 'close', 'destroy'];
5659
-
5660
- $.fn.select2 = function (options) {
5661
- options = options || {};
5662
-
5663
- if (typeof options === 'object') {
5664
- this.each(function () {
5665
- var instanceOptions = $.extend(true, {}, options);
5666
-
5667
- var instance = new Select2($(this), instanceOptions);
5668
- });
5669
-
5670
- return this;
5671
- } else if (typeof options === 'string') {
5672
- var ret;
5673
- var args = Array.prototype.slice.call(arguments, 1);
5674
-
5675
- this.each(function () {
5676
- var instance = $(this).data('select2');
5677
-
5678
- if (instance == null && window.console && console.error) {
5679
- console.error(
5680
- 'The select2(\'' + options + '\') method was called on an ' +
5681
- 'element that is not using Select2.'
5682
- );
5683
- }
5684
-
5685
- ret = instance[options].apply(instance, args);
5686
- });
5687
-
5688
- // Check if we should be returning `this`
5689
- if ($.inArray(options, thisMethods) > -1) {
5690
- return this;
5691
- }
5692
-
5693
- return ret;
5694
- } else {
5695
- throw new Error('Invalid arguments for Select2: ' + options);
5696
- }
5697
- };
5698
- }
5699
-
5700
- if ($.fn.select2.defaults == null) {
5701
- $.fn.select2.defaults = Defaults;
5702
- }
5703
-
5704
- return Select2;
5705
- });
5706
-
5707
- // Return the AMD loader configuration so it can be used outside of this file
5708
- return {
5709
- define: S2.define,
5710
- require: S2.require
5711
- };
5712
- }());
5713
-
5714
- // Autoload the jQuery bindings
5715
- // We know that all of the modules exist above this, so we're safe
5716
- var select2 = S2.require('jquery.select2');
5717
-
5718
- // Hold the AMD module references on the jQuery function that was just loaded
5719
- // This allows Select2 to use the internal loader outside of this file, such
5720
- // as in the language files.
5721
- jQuery.fn.select2.amd = S2;
5722
-
5723
- // Return the Select2 instance for anyone who is importing it.
5724
- return select2;
5725
- }));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
js/select2-4.0.3/js/select2.min.js DELETED
@@ -1,3 +0,0 @@
1
- /*! Select2 4.0.3 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice,c=b.call(arguments,1);this.listeners=this.listeners||{},null==c&&(c=[]),0===c.length&&c.push({}),c[0]._type=a,a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");
2
- if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){function e(b){var c=g._normalizeItem(b),d=g.$element.find("option").filter(function(){return a(this).val()===c.id});if(!d.length){var e=g.option(c);e.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([e])}f(c)}function f(a){g.trigger("select",{data:a})}var g=this;c.term=c.term||"";var h=this.tokenizer(c,this.options,e);h.term!==c.term&&(this.$search.length&&(this.$search.val(h.term),this.$search.focus()),c.term=h.term),b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(a){d._handleSelectOnClose(a)})},a.prototype._handleSelectOnClose=function(a,b){if(b&&null!=b.originalSelect2Event){var c=b.originalSelect2Event;if("select"===c._type||"unselect"===c._type)return}var d=this.getHighlightedResults();if(!(d.length<1)){var e=d.data("data");null!=e.element&&e.element.selected||null==e.element&&e.selected||this.trigger("select",{data:e})}},a}),b.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("select",function(a){d._selectTriggered(a)}),b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){var c=b.originalEvent;c&&c.ctrlKey||this.trigger("close",{originalEvent:c,originalSelect2Event:b})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),(null==a||0===a.length)&&(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null;
3
- },e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
 
 
 
loadmore.php CHANGED
@@ -1,90 +1,95 @@
1
- <?php
2
- /**
3
- * Server side implementation of load more handling.
4
- *
5
- * @package categoryposts.
6
- *
7
- * @since 4.9
8
- */
9
-
10
- namespace categoryPosts;
11
-
12
- // Don't call the file directly.
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- /**
18
- * Embed the front end JS for load more.
19
- *
20
- * @since 4.9
21
- */
22
- function embed_loadmore_scripts() {
23
- echo '<script>{';
24
- $suffix = 'min.js';
25
- if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
26
- $suffix = 'js';
27
- }
28
- echo 'var tiptoppress = Array();';
29
- echo 'tiptoppress["' . esc_js( __NAMESPACE__ ) . '"] = { json_root_url : "' . esc_js( rest_url( __NAMESPACE__ . '/loadmore' ) ) . '"};';
30
- include __DIR__ . '/js/frontend/loadmore.' . $suffix;
31
- echo '}</script>';
32
- }
33
-
34
- /**
35
- * Generate the JSON response which includes additional element as a response
36
- * to a "load more" request.
37
- *
38
- * @param \WP_REST_Request $request The rest request with widget aand start point info.
39
- */
40
- function get_next_elements( \WP_REST_Request $request ) {
41
- $id = (string) $request['id'];
42
- $start = (int) $request['start'];
43
- $number = (int) $request['number'];
44
- $context = (string) $request['context'];
45
-
46
- $ret = array();
47
-
48
- $id_components = explode( '-', $id );
49
- if ( 2 <= count( $id_components ) ) {
50
- switch ( $id_components[0] ) {
51
- case 'shortcode':
52
- if ( 3 === count( $id_components ) ) {
53
- $pid = $id_components[1]; // The ID of the relevant post.
54
- $name = $id_components[2]; // The shortcode "name".
55
- $settings = shortcode_settings( $pid, $name );
56
- if ( ! empty( $settings ) ) {
57
- $virtual_widget = new Virtual_Widget( '', '', $settings );
58
- $ret = $virtual_widget->get_elements_HTML( $start, $number, $context );
59
- }
60
- }
61
- break;
62
- case 'widget':
63
- if ( 2 === count( $id_components ) ) {
64
- $id = $id_components[1]; // The ID of the widget.
65
- $class = __NAMESPACE__ . '\Widget';
66
- $widgetclass = new $class();
67
- $allsettings = $widgetclass->get_settings();
68
- if ( isset( $allsettings[ $id ] ) ) {
69
- $virtual_widget = new Virtual_Widget( '', '', $allsettings[ $id ] );
70
- $ret = $virtual_widget->get_elements_HTML( $start, $number, $context );
71
- }
72
- }
73
- break;
74
- }
75
- }
76
-
77
- return new \WP_REST_Response( $ret );
78
- }
79
-
80
- /**
81
- * This function is where we register our routes for our example endpoint.
82
- */
83
- function register_route() {
84
- register_rest_route( __NAMESPACE__, '/loadmore/(?P<id>[\w-]+)/(?P<start>[\d]+)/(?P<number>[\d]+)/(?P<context>[\w]+)', array(
85
- 'methods' => 'GET',
86
- 'callback' => __NAMESPACE__ . '\get_next_elements',
87
- ) );
88
- }
89
-
90
- add_action( 'rest_api_init', __NAMESPACE__ . '\register_route' );
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Server side implementation of load more handling.
4
+ *
5
+ * @package categoryposts.
6
+ *
7
+ * @since 4.9
8
+ */
9
+
10
+ namespace categoryPosts;
11
+
12
+ // Don't call the file directly.
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Embed the front end JS for load more.
19
+ *
20
+ * @since 4.9
21
+ */
22
+ function embed_loadmore_scripts() {
23
+ echo '<script>{';
24
+ $suffix = 'min.js';
25
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
26
+ $suffix = 'js';
27
+ }
28
+ echo 'var tiptoppress = Array();';
29
+ echo 'tiptoppress["' . esc_js( __NAMESPACE__ ) . '"] = { json_root_url : "' . esc_js( rest_url( __NAMESPACE__ . '/loadmore' ) ) . '"};';
30
+ include __DIR__ . '/js/frontend/loadmore.' . $suffix;
31
+ echo '}</script>';
32
+ }
33
+
34
+ /**
35
+ * Generate the JSON response which includes additional element as a response
36
+ * to a "load more" request.
37
+ *
38
+ * @param \WP_REST_Request $request The rest request with widget aand start point info.
39
+ */
40
+ function get_next_elements( \WP_REST_Request $request ) {
41
+ $id = (string) $request['id'];
42
+ $start = (int) $request['start'];
43
+ $number = (int) $request['number'];
44
+ $context = (string) $request['context'];
45
+
46
+ $ret = array();
47
+
48
+ $id_components = explode( '-', $id );
49
+ if ( 2 <= count( $id_components ) ) {
50
+ switch ( $id_components[0] ) {
51
+ case 'shortcode':
52
+ if ( 3 === count( $id_components ) ) {
53
+ $pid = $id_components[1]; // The ID of the relevant post.
54
+ $name = $id_components[2]; // The shortcode "name".
55
+ $settings = shortcode_settings( $pid, $name );
56
+ if ( ! empty( $settings ) ) {
57
+ $virtual_widget = new Virtual_Widget( '', '', $settings );
58
+ $ret = $virtual_widget->get_elements_HTML( $start, $number, $context );
59
+ }
60
+ }
61
+ break;
62
+ case 'widget':
63
+ if ( 2 === count( $id_components ) ) {
64
+ $id = $id_components[1]; // The ID of the widget.
65
+ $class = __NAMESPACE__ . '\Widget';
66
+ $widgetclass = new $class();
67
+ $allsettings = $widgetclass->get_settings();
68
+ if ( isset( $allsettings[ $id ] ) ) {
69
+ $virtual_widget = new Virtual_Widget( '', '', $allsettings[ $id ] );
70
+ $ret = $virtual_widget->get_elements_HTML( $start, $number, $context );
71
+ }
72
+ }
73
+ break;
74
+ }
75
+ }
76
+
77
+ return new \WP_REST_Response( $ret );
78
+ }
79
+
80
+ /**
81
+ * This function is where we register our routes for our example endpoint.
82
+ */
83
+ function register_route() {
84
+ register_rest_route(
85
+ __NAMESPACE__,
86
+ '/loadmore/(?P<id>[\w-]+)/(?P<start>[\d]+)/(?P<number>[\d]+)/(?P<context>[\w]+)',
87
+ array(
88
+ 'methods' => 'GET',
89
+ 'callback' => __NAMESPACE__ . '\get_next_elements',
90
+ 'permission_callback' => '__return_true',
91
+ )
92
+ );
93
+ }
94
+
95
+ add_action( 'rest_api_init', __NAMESPACE__ . '\register_route' );
localizeddate.php CHANGED
@@ -1,30 +1,30 @@
1
- <?php
2
- /**
3
- * Server side implementation of localized dates handling.
4
- *
5
- * @package categoryposts.
6
- *
7
- * @since 4.9
8
- */
9
-
10
- namespace categoryPosts;
11
-
12
- // Don't call the file directly.
13
- if ( ! defined( 'ABSPATH' ) ) {
14
- exit;
15
- }
16
-
17
- /**
18
- * Embed the front end JS for load more.
19
- *
20
- * @since 4.9
21
- */
22
- function embed_date_scripts() {
23
- echo '<script>{';
24
- $suffix = 'min.js';
25
- if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
26
- $suffix = 'js';
27
- }
28
- include __DIR__ . '/js/frontend/date.' . $suffix;
29
- echo '}</script>';
30
- }
1
+ <?php
2
+ /**
3
+ * Server side implementation of localized dates handling.
4
+ *
5
+ * @package categoryposts.
6
+ *
7
+ * @since 4.9
8
+ */
9
+
10
+ namespace categoryPosts;
11
+
12
+ // Don't call the file directly.
13
+ if ( ! defined( 'ABSPATH' ) ) {
14
+ exit;
15
+ }
16
+
17
+ /**
18
+ * Embed the front end JS for load more.
19
+ *
20
+ * @since 4.9
21
+ */
22
+ function embed_date_scripts() {
23
+ echo '<script>{';
24
+ $suffix = 'min.js';
25
+ if ( defined( 'WP_DEBUG' ) && WP_DEBUG === true ) {
26
+ $suffix = 'js';
27
+ }
28
+ include __DIR__ . '/js/frontend/date.' . $suffix;
29
+ echo '}</script>';
30
+ }
phpcs.xml CHANGED
@@ -1,33 +1,33 @@
1
- <?xml version="1.0"?>
2
- <ruleset name="CategoryPostsWidget Plugin">
3
- <description>A custom set of rules to check for a WPized WordPress project</description>
4
-
5
- <rule ref="WordPress">
6
- <exclude name="WordPress.Files.FileName.InvalidClassFileName" />
7
- <exclude name="WordPress.NamingConventions" />
8
- <exclude name="WordPress.VIP.RestrictedFunctions" />
9
- <exclude name="WordPress.VIP.SlowDBQuery.slow_db_query_meta_query" />
10
- <exclude name="WordPress.WP.CapitalPDangit" />
11
- <exclude name="WordPress.WP.I18n.Missing.Translators.Comment" />
12
- <exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
13
- </rule>
14
-
15
- <rule ref="WordPress.WP.DeprecatedClasses">
16
- <properties>
17
- <property name="minimum_supported_version" value="4.4"/>
18
- </properties>
19
- </rule>
20
-
21
- <rule ref="WordPress.WP.DeprecatedFunctions">
22
- <properties>
23
- <property name="minimum_supported_version" value="4.4"/>
24
- </properties>
25
- </rule>
26
-
27
- <rule ref="WordPress.WP.DeprecatedParameters">
28
- <properties>
29
- <property name="minimum_supported_version" value="4.4"/>
30
- </properties>
31
- </rule>
32
-
33
- </ruleset>
1
+ <?xml version="1.0"?>
2
+ <ruleset name="CategoryPostsWidget Plugin">
3
+ <description>A custom set of rules to check for a WPized WordPress project</description>
4
+
5
+ <rule ref="WordPress">
6
+ <exclude name="WordPress.Files.FileName.InvalidClassFileName" />
7
+ <exclude name="WordPress.NamingConventions" />
8
+ <exclude name="WordPress.VIP.RestrictedFunctions" />
9
+ <exclude name="WordPress.VIP.SlowDBQuery.slow_db_query_meta_query" />
10
+ <exclude name="WordPress.WP.CapitalPDangit" />
11
+ <exclude name="WordPress.WP.I18n.Missing.Translators.Comment" />
12
+ <exclude name="Generic.Formatting.MultipleStatementAlignment.NotSameWarning" />
13
+ </rule>
14
+
15
+ <rule ref="WordPress.WP.DeprecatedClasses">
16
+ <properties>
17
+ <property name="minimum_supported_version" value="4.4"/>
18
+ </properties>
19
+ </rule>
20
+
21
+ <rule ref="WordPress.WP.DeprecatedFunctions">
22
+ <properties>
23
+ <property name="minimum_supported_version" value="4.4"/>
24
+ </properties>
25
+ </rule>
26
+
27
+ <rule ref="WordPress.WP.DeprecatedParameters">
28
+ <properties>
29
+ <property name="minimum_supported_version" value="4.4"/>
30
+ </properties>
31
+ </rule>
32
+
33
+ </ruleset>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mark-k, kometschuh, mkrdip
3
  Donate link: https://wordpress.org/support/plugin/category-posts/reviews/
4
  Tags: category, categories, posts, widget, posts widget, recent posts, category recent posts, shortcode, sidebar, excerpt, multiple widgets
5
  Requires at least: 2.8
6
- Tested up to: 5.4
7
- Stable tag: 4.9.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -17,16 +17,17 @@ Category Posts Widget is a light widget designed to do one thing and do it well:
17
  A premium version of that free widget available at [tiptoppress.com](http://tiptoppress.com/) created for big Wordpress sites.
18
 
19
  = Premium features =
20
- * Image-Slider
21
- * Post List "Alterations"
22
- * Full background post images
23
- * Masonry (responsive layouts), Grid and Column full page layouts
24
- * More complex ways to filter (ANY, NOT, AND, not include children)
 
 
 
25
  * Custom Post Types, Events, Products support
26
- * Add-ons
27
  * All free features
28
  * E-Mail support
29
- * Free trial on localhost
30
  * More examples on the [demo pages](http://demo.tiptoppress.com/)
31
 
32
  = Features =
@@ -126,6 +127,12 @@ The FireFox browser has a coverage of 5%, which we find little. For this 5%, we
126
  == Changelog ==
127
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget)
128
 
 
 
 
 
 
 
129
  = 4.9.5 - May 12th 2020 =
130
  * Fixed Widget_Title filter missing parameters
131
 
3
  Donate link: https://wordpress.org/support/plugin/category-posts/reviews/
4
  Tags: category, categories, posts, widget, posts widget, recent posts, category recent posts, shortcode, sidebar, excerpt, multiple widgets
5
  Requires at least: 2.8
6
+ Tested up to: 5.5
7
+ Stable tag: 4.9.6
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
17
  A premium version of that free widget available at [tiptoppress.com](http://tiptoppress.com/) created for big Wordpress sites.
18
 
19
  = Premium features =
20
+ * Auto-sizing Grid layout
21
+ * Custom field support in the Template
22
+ * Shortcode support in the Template
23
+ * Image-Slider (or News-Ticker)
24
+ * Asymmetrical list layouts
25
+ * Full background images
26
+ * Masonry responsive grid layout
27
+ * More complex filter (ANY, NOT, AND, ...)
28
  * Custom Post Types, Events, Products support
 
29
  * All free features
30
  * E-Mail support
 
31
  * More examples on the [demo pages](http://demo.tiptoppress.com/)
32
 
33
  = Features =
127
  == Changelog ==
128
  [Read more on our blog ...](http://tiptoppress.com/category/category-posts-widget)
129
 
130
+ = 4.9.6 - November 16th 2020 =
131
+ * Item Title heading level buttons
132
+ * Excerpt-more link placeholder
133
+ * Native WordPress filter CSS classes
134
+ * Rework thumb handling
135
+
136
  = 4.9.5 - May 12th 2020 =
137
  * Fixed Widget_Title filter missing parameters
138
 
styles/admin/category-posts-widget.css CHANGED
@@ -1,190 +1,280 @@
1
-
2
-
3
- .cpwp_ident {
4
- color: #6A6A6A;
5
- background: #efefef;
6
- padding: 5px;
7
- }
8
- .cpwp_ident ~ .cpwp_ident {
9
- margin-top: 10px;
10
- }
11
- .cpwp_ident:last-child {
12
- display: block;
13
- }
14
- /* .cpwp_ident div:last-child {
15
- display: block;
16
- } */
17
- .cpwp_ident > .cpwp_ident {
18
- border-left:5px solid #B3B3B3;
19
- padding: 0 10px;
20
- }
21
- .cpwp_ident p {
22
- margin: 5px 0;
23
- clear: both;
24
- }
25
- .cpwp_ident > label {
26
- line-height: 2.75;
27
- display: inline-block;
28
- }
29
- .cpwp_ident_top {
30
- margin-top:-1em;
31
- padding-top:1em;
32
- }
33
- .cpwp-sub-panel > p {
34
- font-weight: lighter;
35
- padding-bottom: 10px;
36
- margin-bottom: 0px;
37
- text-align: center;
38
- }
39
- .cpwp-sub-panel > .cpwp_ident {
40
- background: #efefef;
41
- color: #6A6A6A;
42
- padding: 5px;
43
- }
44
- .category-widget-cont label.checkbox {
45
- margin-left: -25px;
46
- left: 25px;
47
- position: relative;
48
- }
49
- .category-widget-cont [data-panel] + div label {
50
- vertical-align: sub;
51
- }
52
- .category-widget-cont [data-panel="filter"] + div select,
53
- .category-widget-cont input[type="number"],
54
- .category-widget-cont input[type="text"],
55
- .category-widget-cont input[type="range"] {
56
- text-align:center;
57
- float: right;
58
- clear: both;
59
- margin-top: 2px;
60
- margin-bottom: 2px;
61
- width: 110px;
62
- }
63
- .category-widget-cont input[type="range"] {
64
- padding-left: 0;
65
- padding-right: 0;
66
- }
67
- .category-widget-cont .cpwp-right {
68
- float: right;
69
- }
70
- .category-widget-cont input[type="number"] {
71
- width:5em;
72
- }
73
- .category-widget-cont textarea {
74
- width:100%;
75
- margin-top: 5px;
76
- }
77
-
78
- .category-widget-cont .dashicons-editor-help {
79
- vertical-align: sub;
80
- }
81
-
82
- .category-widget-cont h4 {
83
- padding: 12px 15px;
84
- cursor: pointer;
85
- margin: 5px 0;
86
- border: 1px solid #E5E5E5;
87
- background: #f9f9f9;
88
- }
89
- .category-widget-cont h4:first-child {
90
- margin-top: 10px;
91
- }
92
- .category-widget-cont h4:last-of-type {
93
- margin-bottom: 10px;
94
- }
95
- .category-widget-cont h4:after {
96
- float:right;
97
- font-family: "dashicons";
98
- content: '\f140';
99
- -ms-transform: translate(-1px,1px);
100
- -webkit-transform: translate(-1px,1px);
101
- -moz-transform: translate(-1px,1px);
102
- transform: translate(-1px,1px);
103
- -ms-transition: all 600ms;
104
- -webkit-transition: all 600ms;
105
- -moz-transition: all 600ms;
106
- transition: all 600ms;
107
- }
108
- .category-widget-cont h4.open:after {
109
- -ms-transition: all 600ms;
110
- -webkit-transition: all 600ms;
111
- -moz-transition: all 600ms;
112
- transition: all 600ms;
113
- -ms-transform: rotate(180deg);
114
- -webkit-transform: rotate(180deg);
115
- -moz-transform: rotate(180deg);
116
- transform: rotate(180deg);
117
- }
118
- .category-widget-cont > div {
119
- display:none;
120
- }
121
- .category-widget-cont > div.open {
122
- display:block;
123
- }
124
- .category-widget-cont th,
125
- .category-widget-cont tr {
126
- vertical-align: baseline;
127
- text-align:start;
128
- }
129
-
130
- .categoryposts-template-help th {
131
- text-align:start;
132
- font-weight:bold;
133
- }
134
-
135
- .categoryposts-template-help td {
136
- padding:2px;
137
- }
138
-
139
- .cat-post-template-help {display:none;}
140
-
141
- .category-widget-cont .open-template-help {
142
- border:0;
143
- padding:0;
144
- cursor: pointer;
145
- }
146
-
147
- .cat-post-thumb-change-size button.button {
148
- line-height: normal;
149
- height: auto;
150
- padding: 2px 7px;
151
- vertical-align: sub;
152
- }
153
- /* placeholder dropdown */
154
- .categoryPosts-template {
155
- float: left;
156
- }
157
- .cat-post-add_premade_templates {
158
- position: relative;
159
- }
160
- .cat-post-add_premade_templates > button {
161
- float: right;
162
- }
163
- .cat-post-add_premade_templates > .cpwp-placeholder-dropdown-menu {
164
- display: none;
165
- }
166
- .cat-post-add_premade_templates > .cpwp-placeholder-dropdown-menu {
167
- position: absolute;
168
- right: 0;
169
- top: 0;
170
- z-index: 1000;
171
- background-color: #fff;
172
- padding: 15px 0;
173
- border-radius: .25rem;
174
- border: 1px solid rgba(0,0,0,.15);
175
- white-space: nowrap;
176
- }
177
- .cat-post-add_premade_templates.customizer > .cpwp-placeholder-dropdown-menu {
178
- transform: translate3d(56px, -277px, 0px);
179
- }
180
- .cat-post-add_premade_templates.admin-panel > .cpwp-placeholder-dropdown-menu {
181
- transform: translate3d(322px, -4px, 0px);
182
- }
183
- .cpwp-placeholder-dropdown-menu > span {
184
- display: block;
185
- padding: 4px 24px;
186
- }
187
- .cpwp-placeholder-dropdown-menu > span:hover {
188
- background-color: #f8f9fa;
189
- cursor: pointer;
190
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .cpwp_ident {
2
+ color: #6A6A6A;
3
+ background: #f1f1f1;
4
+ }
5
+
6
+ .cpwp_ident:last-child {
7
+ display: block;
8
+ }
9
+
10
+ .cpwp_ident>.cpwp_ident {
11
+ border-left: 5px solid #B3B3B3;
12
+ padding: 0 10px;
13
+ }
14
+
15
+ .cpwp_ident>p,
16
+ .cpwp_ident>div {
17
+ display: flow-root;
18
+ }
19
+
20
+ .cpwp_ident>label {
21
+ line-height: 2.75;
22
+ display: inline-block;
23
+ }
24
+
25
+ .cpwp_ident_top {
26
+ margin-top: -1em;
27
+ padding-top: 1em;
28
+ }
29
+
30
+ .cpwp-sub-panel>p {
31
+ font-weight: lighter;
32
+ padding-bottom: 10px;
33
+ margin-bottom: 0px;
34
+ text-align: center;
35
+ }
36
+
37
+ .cpwp-sub-panel>.cpwp_ident {
38
+ background: #efefef;
39
+ color: #6A6A6A;
40
+ padding: 5px;
41
+ }
42
+
43
+ .category-widget-cont label.checkbox {
44
+ margin-left: -25px;
45
+ left: 25px;
46
+ position: relative;
47
+ }
48
+
49
+ .category-widget-cont [data-panel]+div label {
50
+ display: contents;
51
+ line-height: 2.25;
52
+ }
53
+
54
+ .category-widget-cont [data-panel]+div .cat-post-thumb-change-size label {
55
+ white-space: nowrap;
56
+ }
57
+
58
+ .category-widget-cont [data-panel]+div label.checkbox {
59
+ line-height: 1.75;
60
+ }
61
+
62
+ .category-widget-cont [data-panel="filter"]+div select,
63
+ .category-widget-cont input[type="number"],
64
+ .category-widget-cont input[type="range"] {
65
+ text-align: center;
66
+ float: right;
67
+ clear: both;
68
+ width: 110px;
69
+ }
70
+
71
+ .category-widget-cont input[type="text"] {
72
+ text-align: center;
73
+ float: right;
74
+ clear: both;
75
+ width: 100%;
76
+ }
77
+
78
+ .category-widget-cont input[type=radio] {
79
+ width: 26px;
80
+ }
81
+
82
+ .category-widget-cont input[type=radio].Inline {
83
+ width: 40px;
84
+ }
85
+
86
+ .category-widget-cont input[type="radio"]:before {
87
+ content: attr(value);
88
+ float: left;
89
+ line-height: 1.7;
90
+ height: calc(100% - 4px);
91
+ margin: 2px;
92
+ width: calc(100% - 4px);
93
+ }
94
+
95
+ .category-widget-cont input[type=radio]:checked::before {
96
+ color: white;
97
+ border-radius: 5%;
98
+ }
99
+
100
+ .category-widget-cont [data-panel="title"]+div p {
101
+ display: flow-root;
102
+ }
103
+
104
+ .category-widget-cont select {
105
+ width: 100%;
106
+ }
107
+
108
+ .category-widget-cont input[type="range"] {
109
+ height: 30px;
110
+ }
111
+
112
+ .category-widget-cont .cpwp-right {
113
+ float: right;
114
+ }
115
+
116
+ .category-widget-cont input[type="number"] {
117
+ width: 5em;
118
+ }
119
+
120
+
121
+ /* .category-widget-cont>p {
122
+ display: flow-root;
123
+ } */
124
+
125
+ .category-widget-cont textarea {
126
+ width: 100%;
127
+ margin-top: 5px;
128
+ }
129
+
130
+ .category-widget-cont .dashicons-editor-help {
131
+ vertical-align: sub;
132
+ }
133
+
134
+ .category-widget-cont h4 {
135
+ padding: 12px 15px;
136
+ cursor: pointer;
137
+ margin: 5px 0;
138
+ border: 1px solid #ccd0d4;
139
+ }
140
+
141
+ .category-widget-cont h4~div:before,
142
+ .category-widget-cont h4~div:after {
143
+ content: "";
144
+ padding: 1px;
145
+ display: block;
146
+ }
147
+
148
+ .category-widget-cont h4:first-child {
149
+ margin-top: 10px;
150
+ }
151
+
152
+ .category-widget-cont h4:last-of-type {
153
+ margin-bottom: 10px;
154
+ }
155
+
156
+ .category-widget-cont h4:after {
157
+ float: right;
158
+ font-family: "dashicons";
159
+ content: '\f140';
160
+ -ms-transform: translate(-1px, 1px);
161
+ -webkit-transform: translate(-1px, 1px);
162
+ -moz-transform: translate(-1px, 1px);
163
+ transform: translate(-1px, 1px);
164
+ -ms-transition: all 600ms;
165
+ -webkit-transition: all 600ms;
166
+ -moz-transition: all 600ms;
167
+ transition: all 600ms;
168
+ }
169
+
170
+ .category-widget-cont h4.open:after {
171
+ -ms-transition: all 600ms;
172
+ -webkit-transition: all 600ms;
173
+ -moz-transition: all 600ms;
174
+ transition: all 600ms;
175
+ -ms-transform: rotate(180deg);
176
+ -webkit-transform: rotate(180deg);
177
+ -moz-transform: rotate(180deg);
178
+ transform: rotate(180deg);
179
+ }
180
+
181
+ .category-widget-cont>div {
182
+ display: none;
183
+ padding-left: 4px;
184
+ padding-right: 4px;
185
+ }
186
+
187
+ .category-widget-cont>div.open {
188
+ display: block;
189
+ }
190
+
191
+ .category-widget-cont th,
192
+ .category-widget-cont tr {
193
+ vertical-align: baseline;
194
+ text-align: start;
195
+ }
196
+
197
+ .categoryposts-template-help th {
198
+ text-align: start;
199
+ font-weight: bold;
200
+ }
201
+
202
+ .categoryposts-template-help td {
203
+ padding: 2px;
204
+ }
205
+
206
+ .cat-post-template-help {
207
+ display: none;
208
+ overflow-x: auto;
209
+ }
210
+
211
+ .category-widget-cont .open-template-help {
212
+ border: 0;
213
+ padding: 0;
214
+ cursor: pointer;
215
+ }
216
+
217
+ .cat-post-thumb-change-size button.button {
218
+ line-height: normal;
219
+ height: auto;
220
+ padding: 2px 7px;
221
+ vertical-align: sub;
222
+ }
223
+
224
+
225
+ /* placeholder dropdown */
226
+
227
+ .cat-post-add_premade_templates {
228
+ position: relative;
229
+ }
230
+
231
+ .cat-post-add_premade_templates>button {
232
+ float: right;
233
+ }
234
+
235
+ .cat-post-add_premade_templates>.cpwp-placeholder-dropdown-menu {
236
+ display: none;
237
+ }
238
+
239
+ .cat-post-add_premade_templates>.cpwp-placeholder-dropdown-menu {
240
+ position: absolute;
241
+ right: 0;
242
+ top: 0;
243
+ z-index: 1000;
244
+ background-color: #fff;
245
+ padding: 15px 0;
246
+ border-radius: .25rem;
247
+ border: 1px solid rgba(0, 0, 0, .15);
248
+ white-space: nowrap;
249
+ }
250
+
251
+ .cat-post-add_premade_templates.customizer>.cpwp-placeholder-dropdown-menu {
252
+ transform: translate3d(56px, -277px, 0px);
253
+ }
254
+
255
+ .cat-post-add_premade_templates.admin-panel>.cpwp-placeholder-dropdown-menu {
256
+ transform: translate3d(322px, -4px, 0px);
257
+ }
258
+
259
+ .cpwp-placeholder-dropdown-menu>span {
260
+ display: block;
261
+ padding: 4px 24px;
262
+ }
263
+
264
+ .cpwp-placeholder-dropdown-menu>span:hover {
265
+ background-color: #f8f9fa;
266
+ cursor: pointer;
267
+ }
268
+
269
+ .cpwp-placeholder-dropdown-menu .cpwp-close-placeholder-dropdown-menu {
270
+ font-size: 16px;
271
+ position: absolute;
272
+ top: 0;
273
+ right: 0;
274
+ width: auto;
275
+ height: auto;
276
+ }
277
+
278
+ .cpwp-placeholder-dropdown-menu .cpwp-close-placeholder-dropdown-menu:hover {
279
+ background-color: #f8f9fa;
280
+ }
tinymce-translations.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Register translations.
4
+ *
5
+ * @package categoryposts.
6
+ *
7
+ * @since 4.7
8
+ */
9
+
10
+ namespace categoryPosts;
11
+
12
+ if ( ! defined( 'ABSPATH' ) ) {
13
+ exit;
14
+ }
15
+
16
+ if ( ! class_exists( '_WP_Editors' ) ) {
17
+ require( ABSPATH . WPINC . '/class-wp-editor.php' );
18
+ }
19
+
20
+ /**
21
+ * Register translations for the tinymce shortcode creation button and dialog.
22
+ *
23
+ * @since 4.7
24
+ */
25
+ function tinymce_translation() {
26
+ $strings = array(
27
+ 'name' => __( 'Name', 'category-posts' ),
28
+ 'tooltip' => __( 'Insert Category Posts shortcode', 'category-posts' ),
29
+ 'title' => __( 'Category Posts Insert Shortcode', 'category-posts' ),
30
+ 'hide_message' => __( 'Hide the button', 'category-posts' ),
31
+ 'profiile_url' => get_edit_user_link() . '#' . __NAMESPACE__,
32
+ );
33
+
34
+ $locale = \_WP_Editors::$mce_locale;
35
+ $translated = 'tinyMCE.addI18n("' . $locale . '.category-posts", ' . wp_json_encode( $strings ) . ");\n";
36
+
37
+ return $translated;
38
+ }
39
+
40
+ $strings = tinymce_translation();
tinymce_translations.php DELETED
@@ -1,32 +0,0 @@
1
- <?php
2
-
3
- namespace categoryPosts;
4
-
5
- if ( ! defined( 'ABSPATH' ) )
6
- exit;
7
-
8
- if ( ! class_exists( '_WP_Editors' ) )
9
- require( ABSPATH . WPINC . '/class-wp-editor.php' );
10
-
11
- /**
12
- * register translations for the tinymce shortcode creation button and dialog
13
- *
14
- * @since 4.7
15
- */
16
- function tinymce_translation() {
17
- $strings = array(
18
- 'name' => __('Name', 'category-posts'),
19
- 'tooltip' => __('Insert Category Posts shortcode', 'category-posts'),
20
- 'title' => __('Category Posts Insert Shortcode', 'category-posts'),
21
- 'hide_message' => __('Hide the button', 'category-posts'),
22
- 'profiile_url' => get_edit_user_link().'#'.__NAMESPACE__,
23
- );
24
-
25
- $locale = \_WP_Editors::$mce_locale;
26
- $translated = 'tinyMCE.addI18n("' . $locale . '.category-posts", ' . json_encode( $strings ) . ");\n";
27
-
28
- return $translated;
29
- }
30
-
31
- $strings = tinymce_translation();
32
-