Slideshow Gallery - Version 1.6.11

Version Description

  • ADD: Variable buttons when saving multiple slides for Alt, Caption, etc.
  • ADD: Polylang multilingual integration
  • ADD: WPGlobus multilingual integration
  • IMPROVE: Make Select2 select drop downs accessible by screen readers
  • IMPROVE: Make Colorbox translatable
  • FIX: Expired slides are showing up in the ordering screen
  • FIX: Apostrophe in gallery title/name won't save
Download this release

Release Info

Developer contrid
Plugin Icon 128x128 Slideshow Gallery
Version 1.6.11
Comparing to
See all releases

Code changes from version 1.6.10 to 1.6.11

css/admin.css CHANGED
@@ -16,8 +16,17 @@
16
  content: "\f073";
17
  }
18
 
 
 
 
 
 
 
 
 
19
  #adminmenu .toplevel_page_slideshow-slides div.wp-menu-image:before,
20
- .mce-i-gallery:before {
 
21
  font-family: 'FontAwesome' !important;
22
  content: "\f03e";
23
  -webkit-font-smoothing: antialiased;
@@ -300,6 +309,10 @@ span.gallery_slides_convert_grid a{
300
  margin-bottom:5px;
301
  }
302
 
 
 
 
 
303
  .gallery_slides_grid .gallery_slide_title {
304
  float:left;
305
  height:20px;
16
  content: "\f073";
17
  }
18
 
19
+ .slideshow-update-nag-wrapper {
20
+ position: relative;
21
+ }
22
+
23
+ .slideshow-update-nag {
24
+ vertical-align: middle;
25
+ }
26
+
27
  #adminmenu .toplevel_page_slideshow-slides div.wp-menu-image:before,
28
+ .mce-i-gallery:before,
29
+ .slideshow-update-nag:before {
30
  font-family: 'FontAwesome' !important;
31
  content: "\f03e";
32
  -webkit-font-smoothing: antialiased;
309
  margin-bottom:5px;
310
  }
311
 
312
+ .gallery_slides_grid #slidelist li.gallerylineitem .gallery_slide_image img {
313
+ width: 100%;
314
+ }
315
+
316
  .gallery_slides_grid .gallery_slide_title {
317
  float:left;
318
  height:20px;
css/jquery-ui.css CHANGED
@@ -1354,7 +1354,7 @@ body .ui-tooltip { border-width:2px; }
1354
 
1355
 
1356
  /*** Input field styling from Bootstrap **/
1357
- .newsletters input, .newsletters textarea {
1358
  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
1359
  -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
1360
  -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
@@ -1364,25 +1364,25 @@ body .ui-tooltip { border-width:2px; }
1364
  -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
1365
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
1366
  }
1367
- .newsletters input:focus, .newsletters textarea:focus {
1368
  outline: 0;
1369
  border-color: rgba(82, 168, 236, 0.8);
1370
  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
1371
  -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
1372
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
1373
  }
1374
- .newsletters input[type=file]:focus, .newsletters input[type=checkbox]:focus, .newsletters select:focus {
1375
  -webkit-box-shadow: none;
1376
  -moz-box-shadow: none;
1377
  box-shadow: none;
1378
  outline: 1px dotted #666;
1379
  }
1380
 
1381
- .newsletters input[type="text"],
1382
- .newsletters input[type="password"],
1383
- .newsletters .ui-autocomplete-input,
1384
- .newsletters textarea,
1385
- .newsletters .uneditable-input {
1386
  display: inline-block;
1387
  padding: 4px;
1388
  /*font-size: 13px;*/
1354
 
1355
 
1356
  /*** Input field styling from Bootstrap **/
1357
+ .slideshow input, .slideshow textarea {
1358
  -webkit-transition: border linear 0.2s, box-shadow linear 0.2s;
1359
  -moz-transition: border linear 0.2s, box-shadow linear 0.2s;
1360
  -ms-transition: border linear 0.2s, box-shadow linear 0.2s;
1364
  -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
1365
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
1366
  }
1367
+ .slideshow input:focus, .slideshow textarea:focus {
1368
  outline: 0;
1369
  border-color: rgba(82, 168, 236, 0.8);
1370
  -webkit-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
1371
  -moz-box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
1372
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(82, 168, 236, 0.6);
1373
  }
1374
+ .slideshow input[type=file]:focus, .slideshow input[type=checkbox]:focus, .slideshow select:focus {
1375
  -webkit-box-shadow: none;
1376
  -moz-box-shadow: none;
1377
  box-shadow: none;
1378
  outline: 1px dotted #666;
1379
  }
1380
 
1381
+ .slideshow input[type="text"],
1382
+ .slideshow input[type="password"],
1383
+ .slideshow .ui-autocomplete-input,
1384
+ .slideshow textarea,
1385
+ .slideshow .uneditable-input {
1386
  display: inline-block;
1387
  padding: 4px;
1388
  /*font-size: 13px;*/
css/select2.css CHANGED
@@ -1 +1,484 @@
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[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;}.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;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;}.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__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{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;}.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:#f6f6f6;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:-o-linear-gradient(top, #ffffff 50%, #eeeeee 100%);background-image:linear-gradient(to bottom, #ffffff 50%, #eeeeee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', 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, #eeeeee 50%, #cccccc 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#cccccc', 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, #ffffff 0%, #eeeeee 50%);background-image:-o-linear-gradient(top, #ffffff 0%, #eeeeee 50%);background-image:linear-gradient(to bottom, #ffffff 0%, #eeeeee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#eeeeee', 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, #eeeeee 50%, #ffffff 100%);background-image:-o-linear-gradient(top, #eeeeee 50%, #ffffff 100%);background-image:linear-gradient(to bottom, #eeeeee 50%, #ffffff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff', 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;}.select2-container--classic .select2-dropdown{background-color:white;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:white;}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px;}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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[data-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[data-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[data-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[data-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; }
includes/checkinit.php CHANGED
@@ -36,6 +36,13 @@ if (!class_exists('GalleryCheckinit')) {
36
  $this -> add_action('after_plugin_row_' . $this -> plugin_name . '/slideshow-gallery.php', 'after_plugin_row', 10, 2);
37
  $this -> add_action('install_plugins_pre_plugin-information', 'display_changelog', 10, 1);
38
 
 
 
 
 
 
 
 
39
  $this -> add_filter('default_hidden_columns', 'default_hidden_columns', 10, 2);
40
  $this -> add_filter('set-screen-option', 'set_screen_option', 10, 3);
41
  $this -> add_filter('removable_query_args', 'removable_query_args', 10, 1);
36
  $this -> add_action('after_plugin_row_' . $this -> plugin_name . '/slideshow-gallery.php', 'after_plugin_row', 10, 2);
37
  $this -> add_action('install_plugins_pre_plugin-information', 'display_changelog', 10, 1);
38
 
39
+ /*if ($this -> ci_serial_valid()) {
40
+ $this -> add_action('install_plugins_pre_plugin-information', 'display_changelog', 10, 1);
41
+ $this -> add_action('plugin_row_meta', 'plugin_row_meta', 10, 2);
42
+ $this -> add_filter('transient_update_plugins', 'check_update', 10, 1);
43
+ $this -> add_filter('site_transient_update_plugins', 'check_update', 10, 1);
44
+ }*/
45
+
46
  $this -> add_filter('default_hidden_columns', 'default_hidden_columns', 10, 2);
47
  $this -> add_filter('set-screen-option', 'set_screen_option', 10, 3);
48
  $this -> add_filter('removable_query_args', 'removable_query_args', 10, 1);
js/select2.js CHANGED
@@ -1 +1,5874 @@
1
- /*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(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 v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k<a.length;k++)if("."===(m=a[k]))a.splice(k,1),k-=1;else if(".."===m){if(0===k||1===k&&".."===a[2]||".."===a[k-1])continue;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[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=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[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 a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o<c.length;o+=1)if(n=p(c[o],t),"require"===(k=n.f))w[o]=q.require(a);else if("exports"===k)w[o]=q.exports(a),v=!0;else if("module"===k)h=w[o]=q.module(a);else if(e(r,k)||e(s,k)||e(u,k))w[o]=j(k);else{if(!n.p)throw new Error(a+" missing "+k);n.p.load(n.n,g(f,!0),i(k),{}),w[o]=r[k]}m=d?d.apply(r[a],w):void 0,a&&(h&&h.exports!==b&&h.exports!==r[a]?r[a]=h.exports:m===b&&v||(r[a]=m))}else a&&(r[a]=d)},a=c=o=function(a,c,d,e,f){if("string"==typeof a)return q[a]?q[a](c):j(p(a,l(c)).f);if(!a.splice){if(t=a,t.deps&&o(t.deps,t.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?n(b,a,c,d):setTimeout(function(){n(b,a,c,d)},4),o},o.config=function(a){return o(a)},a._defined=r,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(r,a)||e(s,a)||(s[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){"function"==typeof b[d]&&("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(){return Array.prototype.unshift.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;c<d;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;c<a;c++){b+=Math.floor(36*Math.random()).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||(d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth))},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.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},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="listbox" tabindex="-1"></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="alert" 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){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option[data-selected]"),b=a.filter("[data-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()});b.$results.find(".select2-results__option[data-selected]").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("data-selected","true"):b.attr("data-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:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-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";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k<b.children.length;k++){var l=b.children[k],m=this.option(l);j.push(m)}var n=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}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("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-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):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-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").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),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[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-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),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&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(){return{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}}),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" 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,a.id+"-results");this.options.get("minimumResultsForSearch");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"),window.setTimeout(function(){d.$selection.focus()},1),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");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&(b.data("element").select2("close"),setTimeout(function(){b.find("*:focus").blur(),c.focus()},1))})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").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).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),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");return this.options.get("escapeMarkup")(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" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></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})}}),this.$selection.on("keydown",function(a){!b.isOpen()&&a.which>=48&&a.which<=90&&b.open()}),b.on("focus",function(){e.focusOnSearch()})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">&times;</span></li>')},d.prototype.focusOnSearch=function(){var a=this;void 0!==a.$search&&setTimeout(function(){a._keyUpPrevented=!0,a.$search.focus()},1)},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).trim();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;if(b.length>1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},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="text" 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,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),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.data._resultId)}),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){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===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()}}else a.which===c.ENTER&&(b.open(),a.preventDefault())});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"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{a=.75*(this.$search.val().length+1)+"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(){return{"Ⓐ":"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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),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="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},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");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")){if(a.selected=!1,c(a.element).is("option"))return a.element.selected=!1,void this.$element.trigger("change");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;this.$element.children().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),void 0!==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(null!=(b=c.data(a[0],"data")))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&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(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),e.container.focusOnActiveElement()},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);if((i.text||"").toUpperCase()===(b.term||"").toUpperCase()||j)return!f&&(a.data=g,void c(a))}if(f)return!0;var k=e.createTag(b);if(null!=k){var l=e.option(k);l.attr("data-select2-tag",!0),e.addOptions([l]),e.insertTag(g,k)}a.results=g,c(a)}var e=this;if(this._removeOldTags(),null==b.term||null!=b.page)return void a.call(this,b,c);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){this._lastTag;this.$element.find("option[data-select2-tag]").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);if(!g.$element.find("option").filter(function(){return a(this).val()===c.id}).length){var d=g.option(c);d.attr("data-select2-tag",!0),g._removeOldTags(),g.addOptions([d])}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){if(b.term=b.term||"",b.term.length<this.minimumInputLength)return void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}});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){if(b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});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;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});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="text" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";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.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),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){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},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){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&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="option" 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;this.$container.parents().filter(b.hasScroll).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)&&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){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},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()}return 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(a){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(a){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 O=k.loadPath(this.defaults.amdLanguageBase+"en"),P=new k(l.language);P.extend(O),l.translations=P}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--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-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)},new D}),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 e<=0?"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;h<i;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 b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen()){c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault());var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),c===d.DOWN||c===d.UP?b.focusOnActiveElement():(e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3))}else b.hasFocus()&&(c!==d.ENTER&&c!==d.SPACE&&c!==d.DOWN||(b.open(),a.preventDefault()))})},e.prototype.focusOnActiveElement=function(){this.isOpen()&&!c.isTouchscreen()&&this.$results.find("li.select2-results__option--highlighted").focus()},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},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-")&&null!=(f=d(this))&&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;if(this._isInitialized)return void b.call(this,c);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];b(c.term,g.text,g)||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,this.options.get("query").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){c.find(".dropdown-wrapper").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||n<f)&&(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.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=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&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ /*!
2
+ * SelectWoo 1.0.6
3
+ * https://github.com/woocommerce/selectWoo
4
+ *
5
+ * Released under the MIT license
6
+ * https://github.com/woocommerce/selectWoo/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 module === 'object' && module.exports) {
13
+ // Node/CommonJS
14
+ module.exports = function (root, jQuery) {
15
+ if (jQuery === undefined) {
16
+ // require('jQuery') returns a factory that requires window to
17
+ // build a jQuery instance, we normalize how we use modules
18
+ // that require this pattern but the window provided is a noop
19
+ // if it's defined (how jquery works)
20
+ if (typeof window !== 'undefined') {
21
+ jQuery = require('jquery');
22
+ }
23
+ else {
24
+ jQuery = require('jquery')(root);
25
+ }
26
+ }
27
+ factory(jQuery);
28
+ return jQuery;
29
+ };
30
+ } else {
31
+ // Browser globals
32
+ factory(jQuery);
33
+ }
34
+ } (function (jQuery) {
35
+ // This is needed so we can catch the AMD loader configuration and use it
36
+ // The inner file should be wrapped (by `banner.start.js`) in a function that
37
+ // returns the AMD loader references.
38
+ var S2 =(function () {
39
+ // Restore the Select2 AMD loader so it can be used
40
+ // Needed mostly in the language files, where the loader is not inserted
41
+ if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
42
+ var S2 = jQuery.fn.select2.amd;
43
+ }
44
+ var S2;(function () { if (!S2 || !S2.requirejs) {
45
+ if (!S2) { S2 = {}; } else { require = S2; }
46
+ /**
47
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
48
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
49
+ */
50
+ //Going sloppy to avoid 'use strict' string cost, but strict practices should
51
+ //be followed.
52
+ /*global setTimeout: false */
53
+
54
+ var requirejs, require, define;
55
+ (function (undef) {
56
+ var main, req, makeMap, handlers,
57
+ defined = {},
58
+ waiting = {},
59
+ config = {},
60
+ defining = {},
61
+ hasOwn = Object.prototype.hasOwnProperty,
62
+ aps = [].slice,
63
+ jsSuffixRegExp = /\.js$/;
64
+
65
+ function hasProp(obj, prop) {
66
+ return hasOwn.call(obj, prop);
67
+ }
68
+
69
+ /**
70
+ * Given a relative module name, like ./something, normalize it to
71
+ * a real name that can be mapped to a path.
72
+ * @param {String} name the relative name
73
+ * @param {String} baseName a real name that the name arg is relative
74
+ * to.
75
+ * @returns {String} normalized name
76
+ */
77
+ function normalize(name, baseName) {
78
+ var nameParts, nameSegment, mapValue, foundMap, lastIndex,
79
+ foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
80
+ baseParts = baseName && baseName.split("/"),
81
+ map = config.map,
82
+ starMap = (map && map['*']) || {};
83
+
84
+ //Adjust any relative paths.
85
+ if (name) {
86
+ name = name.split('/');
87
+ lastIndex = name.length - 1;
88
+
89
+ // If wanting node ID compatibility, strip .js from end
90
+ // of IDs. Have to do this here, and not in nameToUrl
91
+ // because node allows either .js or non .js to map
92
+ // to same file.
93
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
94
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
95
+ }
96
+
97
+ // Starts with a '.' so need the baseName
98
+ if (name[0].charAt(0) === '.' && baseParts) {
99
+ //Convert baseName to array, and lop off the last part,
100
+ //so that . matches that 'directory' and not name of the baseName's
101
+ //module. For instance, baseName of 'one/two/three', maps to
102
+ //'one/two/three.js', but we want the directory, 'one/two' for
103
+ //this normalization.
104
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
105
+ name = normalizedBaseParts.concat(name);
106
+ }
107
+
108
+ //start trimDots
109
+ for (i = 0; i < name.length; i++) {
110
+ part = name[i];
111
+ if (part === '.') {
112
+ name.splice(i, 1);
113
+ i -= 1;
114
+ } else if (part === '..') {
115
+ // If at the start, or previous value is still ..,
116
+ // keep them so that when converted to a path it may
117
+ // still work when converted to a path, even though
118
+ // as an ID it is less than ideal. In larger point
119
+ // releases, may be better to just kick out an error.
120
+ if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
121
+ continue;
122
+ } else if (i > 0) {
123
+ name.splice(i - 1, 2);
124
+ i -= 2;
125
+ }
126
+ }
127
+ }
128
+ //end trimDots
129
+
130
+ name = name.join('/');
131
+ }
132
+
133
+ //Apply map config if available.
134
+ if ((baseParts || starMap) && map) {
135
+ nameParts = name.split('/');
136
+
137
+ for (i = nameParts.length; i > 0; i -= 1) {
138
+ nameSegment = nameParts.slice(0, i).join("/");
139
+
140
+ if (baseParts) {
141
+ //Find the longest baseName segment match in the config.
142
+ //So, do joins on the biggest to smallest lengths of baseParts.
143
+ for (j = baseParts.length; j > 0; j -= 1) {
144
+ mapValue = map[baseParts.slice(0, j).join('/')];
145
+
146
+ //baseName segment has config, find if it has one for
147
+ //this name.
148
+ if (mapValue) {
149
+ mapValue = mapValue[nameSegment];
150
+ if (mapValue) {
151
+ //Match, update name to the new value.
152
+ foundMap = mapValue;
153
+ foundI = i;
154
+ break;
155
+ }
156
+ }
157
+ }
158
+ }
159
+
160
+ if (foundMap) {
161
+ break;
162
+ }
163
+
164
+ //Check for a star map match, but just hold on to it,
165
+ //if there is a shorter segment match later in a matching
166
+ //config, then favor over this star map.
167
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
168
+ foundStarMap = starMap[nameSegment];
169
+ starI = i;
170
+ }
171
+ }
172
+
173
+ if (!foundMap && foundStarMap) {
174
+ foundMap = foundStarMap;
175
+ foundI = starI;
176
+ }
177
+
178
+ if (foundMap) {
179
+ nameParts.splice(0, foundI, foundMap);
180
+ name = nameParts.join('/');
181
+ }
182
+ }
183
+
184
+ return name;
185
+ }
186
+
187
+ function makeRequire(relName, forceSync) {
188
+ return function () {
189
+ //A version of a require function that passes a moduleName
190
+ //value for items that may need to
191
+ //look up paths relative to the moduleName
192
+ var args = aps.call(arguments, 0);
193
+
194
+ //If first arg is not require('string'), and there is only
195
+ //one arg, it is the array form without a callback. Insert
196
+ //a null so that the following concat is correct.
197
+ if (typeof args[0] !== 'string' && args.length === 1) {
198
+ args.push(null);
199
+ }
200
+ return req.apply(undef, args.concat([relName, forceSync]));
201
+ };
202
+ }
203
+
204
+ function makeNormalize(relName) {
205
+ return function (name) {
206
+ return normalize(name, relName);
207
+ };
208
+ }
209
+
210
+ function makeLoad(depName) {
211
+ return function (value) {
212
+ defined[depName] = value;
213
+ };
214
+ }
215
+
216
+ function callDep(name) {
217
+ if (hasProp(waiting, name)) {
218
+ var args = waiting[name];
219
+ delete waiting[name];
220
+ defining[name] = true;
221
+ main.apply(undef, args);
222
+ }
223
+
224
+ if (!hasProp(defined, name) && !hasProp(defining, name)) {
225
+ throw new Error('No ' + name);
226
+ }
227
+ return defined[name];
228
+ }
229
+
230
+ //Turns a plugin!resource to [plugin, resource]
231
+ //with the plugin being undefined if the name
232
+ //did not have a plugin prefix.
233
+ function splitPrefix(name) {
234
+ var prefix,
235
+ index = name ? name.indexOf('!') : -1;
236
+ if (index > -1) {
237
+ prefix = name.substring(0, index);
238
+ name = name.substring(index + 1, name.length);
239
+ }
240
+ return [prefix, name];
241
+ }
242
+
243
+ //Creates a parts array for a relName where first part is plugin ID,
244
+ //second part is resource ID. Assumes relName has already been normalized.
245
+ function makeRelParts(relName) {
246
+ return relName ? splitPrefix(relName) : [];
247
+ }
248
+
249
+ /**
250
+ * Makes a name map, normalizing the name, and using a plugin
251
+ * for normalization if necessary. Grabs a ref to plugin
252
+ * too, as an optimization.
253
+ */
254
+ makeMap = function (name, relParts) {
255
+ var plugin,
256
+ parts = splitPrefix(name),
257
+ prefix = parts[0],
258
+ relResourceName = relParts[1];
259
+
260
+ name = parts[1];
261
+
262
+ if (prefix) {
263
+ prefix = normalize(prefix, relResourceName);
264
+ plugin = callDep(prefix);
265
+ }
266
+
267
+ //Normalize according
268
+ if (prefix) {
269
+ if (plugin && plugin.normalize) {
270
+ name = plugin.normalize(name, makeNormalize(relResourceName));
271
+ } else {
272
+ name = normalize(name, relResourceName);
273
+ }
274
+ } else {
275
+ name = normalize(name, relResourceName);
276
+ parts = splitPrefix(name);
277
+ prefix = parts[0];
278
+ name = parts[1];
279
+ if (prefix) {
280
+ plugin = callDep(prefix);
281
+ }
282
+ }
283
+
284
+ //Using ridiculous property names for space reasons
285
+ return {
286
+ f: prefix ? prefix + '!' + name : name, //fullName
287
+ n: name,
288
+ pr: prefix,
289
+ p: plugin
290
+ };
291
+ };
292
+
293
+ function makeConfig(name) {
294
+ return function () {
295
+ return (config && config.config && config.config[name]) || {};
296
+ };
297
+ }
298
+
299
+ handlers = {
300
+ require: function (name) {
301
+ return makeRequire(name);
302
+ },
303
+ exports: function (name) {
304
+ var e = defined[name];
305
+ if (typeof e !== 'undefined') {
306
+ return e;
307
+ } else {
308
+ return (defined[name] = {});
309
+ }
310
+ },
311
+ module: function (name) {
312
+ return {
313
+ id: name,
314
+ uri: '',
315
+ exports: defined[name],
316
+ config: makeConfig(name)
317
+ };
318
+ }
319
+ };
320
+
321
+ main = function (name, deps, callback, relName) {
322
+ var cjsModule, depName, ret, map, i, relParts,
323
+ args = [],
324
+ callbackType = typeof callback,
325
+ usingExports;
326
+
327
+ //Use name if no relName
328
+ relName = relName || name;
329
+ relParts = makeRelParts(relName);
330
+
331
+ //Call the callback to define the module, if necessary.
332
+ if (callbackType === 'undefined' || callbackType === 'function') {
333
+ //Pull out the defined dependencies and pass the ordered
334
+ //values to the callback.
335
+ //Default to [require, exports, module] if no deps
336
+ deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
337
+ for (i = 0; i < deps.length; i += 1) {
338
+ map = makeMap(deps[i], relParts);
339
+ depName = map.f;
340
+
341
+ //Fast path CommonJS standard dependencies.
342
+ if (depName === "require") {
343
+ args[i] = handlers.require(name);
344
+ } else if (depName === "exports") {
345
+ //CommonJS module spec 1.1
346
+ args[i] = handlers.exports(name);
347
+ usingExports = true;
348
+ } else if (depName === "module") {
349
+ //CommonJS module spec 1.1
350
+ cjsModule = args[i] = handlers.module(name);
351
+ } else if (hasProp(defined, depName) ||
352
+ hasProp(waiting, depName) ||
353
+ hasProp(defining, depName)) {
354
+ args[i] = callDep(depName);
355
+ } else if (map.p) {
356
+ map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
357
+ args[i] = defined[depName];
358
+ } else {
359
+ throw new Error(name + ' missing ' + depName);
360
+ }
361
+ }
362
+
363
+ ret = callback ? callback.apply(defined[name], args) : undefined;
364
+
365
+ if (name) {
366
+ //If setting exports via "module" is in play,
367
+ //favor that over return value and exports. After that,
368
+ //favor a non-undefined return value over exports use.
369
+ if (cjsModule && cjsModule.exports !== undef &&
370
+ cjsModule.exports !== defined[name]) {
371
+ defined[name] = cjsModule.exports;
372
+ } else if (ret !== undef || !usingExports) {
373
+ //Use the return value from the function.
374
+ defined[name] = ret;
375
+ }
376
+ }
377
+ } else if (name) {
378
+ //May just be an object definition for the module. Only
379
+ //worry about defining if have a module name.
380
+ defined[name] = callback;
381
+ }
382
+ };
383
+
384
+ requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
385
+ if (typeof deps === "string") {
386
+ if (handlers[deps]) {
387
+ //callback in this case is really relName
388
+ return handlers[deps](callback);
389
+ }
390
+ //Just return the module wanted. In this scenario, the
391
+ //deps arg is the module name, and second arg (if passed)
392
+ //is just the relName.
393
+ //Normalize module name, if it contains . or ..
394
+ return callDep(makeMap(deps, makeRelParts(callback)).f);
395
+ } else if (!deps.splice) {
396
+ //deps is a config object, not an array.
397
+ config = deps;
398
+ if (config.deps) {
399
+ req(config.deps, config.callback);
400
+ }
401
+ if (!callback) {
402
+ return;
403
+ }
404
+
405
+ if (callback.splice) {
406
+ //callback is an array, which means it is a dependency list.
407
+ //Adjust args if there are dependencies
408
+ deps = callback;
409
+ callback = relName;
410
+ relName = null;
411
+ } else {
412
+ deps = undef;
413
+ }
414
+ }
415
+
416
+ //Support require(['a'])
417
+ callback = callback || function () {};
418
+
419
+ //If relName is a function, it is an errback handler,
420
+ //so remove it.
421
+ if (typeof relName === 'function') {
422
+ relName = forceSync;
423
+ forceSync = alt;
424
+ }
425
+
426
+ //Simulate async callback;
427
+ if (forceSync) {
428
+ main(undef, deps, callback, relName);
429
+ } else {
430
+ //Using a non-zero value because of concern for what old browsers
431
+ //do, and latest browsers "upgrade" to 4 if lower value is used:
432
+ //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
433
+ //If want a value immediately, use require('id') instead -- something
434
+ //that works in almond on the global level, but not guaranteed and
435
+ //unlikely to work in other AMD implementations.
436
+ setTimeout(function () {
437
+ main(undef, deps, callback, relName);
438
+ }, 4);
439
+ }
440
+
441
+ return req;
442
+ };
443
+
444
+ /**
445
+ * Just drops the config on the floor, but returns req in case
446
+ * the config return value is used.
447
+ */
448
+ req.config = function (cfg) {
449
+ return req(cfg);
450
+ };
451
+
452
+ /**
453
+ * Expose module registry for debugging and tooling
454
+ */
455
+ requirejs._defined = defined;
456
+
457
+ define = function (name, deps, callback) {
458
+ if (typeof name !== 'string') {
459
+ throw new Error('See almond README: incorrect module build, no module name');
460
+ }
461
+
462
+ //This module may not have dependencies
463
+ if (!deps.splice) {
464
+ //deps is not an array, so probably means
465
+ //an object literal or factory function for
466
+ //the value. Adjust args.
467
+ callback = deps;
468
+ deps = [];
469
+ }
470
+
471
+ if (!hasProp(defined, name) && !hasProp(waiting, name)) {
472
+ waiting[name] = [name, deps, callback];
473
+ }
474
+ };
475
+
476
+ define.amd = {
477
+ jQuery: true
478
+ };
479
+ }());
480
+
481
+ S2.requirejs = requirejs;S2.require = require;S2.define = define;
482
+ }
483
+ }());
484
+ S2.define("almond", function(){});
485
+
486
+ /* global jQuery:false, $:false */
487
+ S2.define('jquery',[],function () {
488
+ var _$ = jQuery || $;
489
+
490
+ if (_$ == null && console && console.error) {
491
+ console.error(
492
+ 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
493
+ 'found. Make sure that you are including jQuery before Select2 on your ' +
494
+ 'web page.'
495
+ );
496
+ }
497
+
498
+ return _$;
499
+ });
500
+
501
+ S2.define('select2/utils',[
502
+ 'jquery'
503
+ ], function ($) {
504
+ var Utils = {};
505
+
506
+ Utils.Extend = function (ChildClass, SuperClass) {
507
+ var __hasProp = {}.hasOwnProperty;
508
+
509
+ function BaseConstructor () {
510
+ this.constructor = ChildClass;
511
+ }
512
+
513
+ for (var key in SuperClass) {
514
+ if (__hasProp.call(SuperClass, key)) {
515
+ ChildClass[key] = SuperClass[key];
516
+ }
517
+ }
518
+
519
+ BaseConstructor.prototype = SuperClass.prototype;
520
+ ChildClass.prototype = new BaseConstructor();
521
+ ChildClass.__super__ = SuperClass.prototype;
522
+
523
+ return ChildClass;
524
+ };
525
+
526
+ function getMethods (theClass) {
527
+ var proto = theClass.prototype;
528
+
529
+ var methods = [];
530
+
531
+ for (var methodName in proto) {
532
+ var m = proto[methodName];
533
+
534
+ if (typeof m !== 'function') {
535
+ continue;
536
+ }
537
+
538
+ if (methodName === 'constructor') {
539
+ continue;
540
+ }
541
+
542
+ methods.push(methodName);
543
+ }
544
+
545
+ return methods;
546
+ }
547
+
548
+ Utils.Decorate = function (SuperClass, DecoratorClass) {
549
+ var decoratedMethods = getMethods(DecoratorClass);
550
+ var superMethods = getMethods(SuperClass);
551
+
552
+ function DecoratedClass () {
553
+ var unshift = Array.prototype.unshift;
554
+
555
+ var argCount = DecoratorClass.prototype.constructor.length;
556
+
557
+ var calledConstructor = SuperClass.prototype.constructor;
558
+
559
+ if (argCount > 0) {
560
+ unshift.call(arguments, SuperClass.prototype.constructor);
561
+
562
+ calledConstructor = DecoratorClass.prototype.constructor;
563
+ }
564
+
565
+ calledConstructor.apply(this, arguments);
566
+ }
567
+
568
+ DecoratorClass.displayName = SuperClass.displayName;
569
+
570
+ function ctr () {
571
+ this.constructor = DecoratedClass;
572
+ }
573
+
574
+ DecoratedClass.prototype = new ctr();
575
+
576
+ for (var m = 0; m < superMethods.length; m++) {
577
+ var superMethod = superMethods[m];
578
+
579
+ DecoratedClass.prototype[superMethod] =
580
+ SuperClass.prototype[superMethod];
581
+ }
582
+
583
+ var calledMethod = function (methodName) {
584
+ // Stub out the original method if it's not decorating an actual method
585
+ var originalMethod = function () {};
586
+
587
+ if (methodName in DecoratedClass.prototype) {
588
+ originalMethod = DecoratedClass.prototype[methodName];
589
+ }
590
+
591
+ var decoratedMethod = DecoratorClass.prototype[methodName];
592
+
593
+ return function () {
594
+ var unshift = Array.prototype.unshift;
595
+
596
+ unshift.call(arguments, originalMethod);
597
+
598
+ return decoratedMethod.apply(this, arguments);
599
+ };
600
+ };
601
+
602
+ for (var d = 0; d < decoratedMethods.length; d++) {
603
+ var decoratedMethod = decoratedMethods[d];
604
+
605
+ DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
606
+ }
607
+
608
+ return DecoratedClass;
609
+ };
610
+
611
+ var Observable = function () {
612
+ this.listeners = {};
613
+ };
614
+
615
+ Observable.prototype.on = function (event, callback) {
616
+ this.listeners = this.listeners || {};
617
+
618
+ if (event in this.listeners) {
619
+ this.listeners[event].push(callback);
620
+ } else {
621
+ this.listeners[event] = [callback];
622
+ }
623
+ };
624
+
625
+ Observable.prototype.trigger = function (event) {
626
+ var slice = Array.prototype.slice;
627
+ var params = slice.call(arguments, 1);
628
+
629
+ this.listeners = this.listeners || {};
630
+
631
+ // Params should always come in as an array
632
+ if (params == null) {
633
+ params = [];
634
+ }
635
+
636
+ // If there are no arguments to the event, use a temporary object
637
+ if (params.length === 0) {
638
+ params.push({});
639
+ }
640
+
641
+ // Set the `_type` of the first object to the event
642
+ params[0]._type = event;
643
+
644
+ if (event in this.listeners) {
645
+ this.invoke(this.listeners[event], slice.call(arguments, 1));
646
+ }
647
+
648
+ if ('*' in this.listeners) {
649
+ this.invoke(this.listeners['*'], arguments);
650
+ }
651
+ };
652
+
653
+ Observable.prototype.invoke = function (listeners, params) {
654
+ for (var i = 0, len = listeners.length; i < len; i++) {
655
+ listeners[i].apply(this, params);
656
+ }
657
+ };
658
+
659
+ Utils.Observable = Observable;
660
+
661
+ Utils.generateChars = function (length) {
662
+ var chars = '';
663
+
664
+ for (var i = 0; i < length; i++) {
665
+ var randomChar = Math.floor(Math.random() * 36);
666
+ chars += randomChar.toString(36);
667
+ }
668
+
669
+ return chars;
670
+ };
671
+
672
+ Utils.bind = function (func, context) {
673
+ return function () {
674
+ func.apply(context, arguments);
675
+ };
676
+ };
677
+
678
+ Utils._convertData = function (data) {
679
+ for (var originalKey in data) {
680
+ var keys = originalKey.split('-');
681
+
682
+ var dataLevel = data;
683
+
684
+ if (keys.length === 1) {
685
+ continue;
686
+ }
687
+
688
+ for (var k = 0; k < keys.length; k++) {
689
+ var key = keys[k];
690
+
691
+ // Lowercase the first letter
692
+ // By default, dash-separated becomes camelCase
693
+ key = key.substring(0, 1).toLowerCase() + key.substring(1);
694
+
695
+ if (!(key in dataLevel)) {
696
+ dataLevel[key] = {};
697
+ }
698
+
699
+ if (k == keys.length - 1) {
700
+ dataLevel[key] = data[originalKey];
701
+ }
702
+
703
+ dataLevel = dataLevel[key];
704
+ }
705
+
706
+ delete data[originalKey];
707
+ }
708
+
709
+ return data;
710
+ };
711
+
712
+ Utils.hasScroll = function (index, el) {
713
+ // Adapted from the function created by @ShadowScripter
714
+ // and adapted by @BillBarry on the Stack Exchange Code Review website.
715
+ // The original code can be found at
716
+ // http://codereview.stackexchange.com/q/13338
717
+ // and was designed to be used with the Sizzle selector engine.
718
+
719
+ var $el = $(el);
720
+ var overflowX = el.style.overflowX;
721
+ var overflowY = el.style.overflowY;
722
+
723
+ //Check both x and y declarations
724
+ if (overflowX === overflowY &&
725
+ (overflowY === 'hidden' || overflowY === 'visible')) {
726
+ return false;
727
+ }
728
+
729
+ if (overflowX === 'scroll' || overflowY === 'scroll') {
730
+ return true;
731
+ }
732
+
733
+ return ($el.innerHeight() < el.scrollHeight ||
734
+ $el.innerWidth() < el.scrollWidth);
735
+ };
736
+
737
+ Utils.escapeMarkup = function (markup) {
738
+ var replaceMap = {
739
+ '\\': '&#92;',
740
+ '&': '&amp;',
741
+ '<': '&lt;',
742
+ '>': '&gt;',
743
+ '"': '&quot;',
744
+ '\'': '&#39;',
745
+ '/': '&#47;'
746
+ };
747
+
748
+ // Do not try to escape the markup if it's not a string
749
+ if (typeof markup !== 'string') {
750
+ return markup;
751
+ }
752
+
753
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
754
+ return replaceMap[match];
755
+ });
756
+ };
757
+
758
+ // Append an array of jQuery nodes to a given element.
759
+ Utils.appendMany = function ($element, $nodes) {
760
+ // jQuery 1.7.x does not support $.fn.append() with an array
761
+ // Fall back to a jQuery object collection using $.fn.add()
762
+ if ($.fn.jquery.substr(0, 3) === '1.7') {
763
+ var $jqNodes = $();
764
+
765
+ $.map($nodes, function (node) {
766
+ $jqNodes = $jqNodes.add(node);
767
+ });
768
+
769
+ $nodes = $jqNodes;
770
+ }
771
+
772
+ $element.append($nodes);
773
+ };
774
+
775
+ // Determine whether the browser is on a touchscreen device.
776
+ Utils.isTouchscreen = function() {
777
+ if ('undefined' === typeof Utils._isTouchscreenCache) {
778
+ Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement;
779
+ }
780
+ return Utils._isTouchscreenCache;
781
+ }
782
+
783
+ return Utils;
784
+ });
785
+
786
+ S2.define('select2/results',[
787
+ 'jquery',
788
+ './utils'
789
+ ], function ($, Utils) {
790
+ function Results ($element, options, dataAdapter) {
791
+ this.$element = $element;
792
+ this.data = dataAdapter;
793
+ this.options = options;
794
+
795
+ Results.__super__.constructor.call(this);
796
+ }
797
+
798
+ Utils.Extend(Results, Utils.Observable);
799
+
800
+ Results.prototype.render = function () {
801
+ var $results = $(
802
+ '<ul class="select2-results__options" role="listbox" tabindex="-1"></ul>'
803
+ );
804
+
805
+ if (this.options.get('multiple')) {
806
+ $results.attr('aria-multiselectable', 'true');
807
+ }
808
+
809
+ this.$results = $results;
810
+
811
+ return $results;
812
+ };
813
+
814
+ Results.prototype.clear = function () {
815
+ this.$results.empty();
816
+ };
817
+
818
+ Results.prototype.displayMessage = function (params) {
819
+ var escapeMarkup = this.options.get('escapeMarkup');
820
+
821
+ this.clear();
822
+ this.hideLoading();
823
+
824
+ var $message = $(
825
+ '<li role="alert" aria-live="assertive"' +
826
+ ' class="select2-results__option"></li>'
827
+ );
828
+
829
+ var message = this.options.get('translations').get(params.message);
830
+
831
+ $message.append(
832
+ escapeMarkup(
833
+ message(params.args)
834
+ )
835
+ );
836
+
837
+ $message[0].className += ' select2-results__message';
838
+
839
+ this.$results.append($message);
840
+ };
841
+
842
+ Results.prototype.hideMessages = function () {
843
+ this.$results.find('.select2-results__message').remove();
844
+ };
845
+
846
+ Results.prototype.append = function (data) {
847
+ this.hideLoading();
848
+
849
+ var $options = [];
850
+
851
+ if (data.results == null || data.results.length === 0) {
852
+ if (this.$results.children().length === 0) {
853
+ this.trigger('results:message', {
854
+ message: 'noResults'
855
+ });
856
+ }
857
+
858
+ return;
859
+ }
860
+
861
+ data.results = this.sort(data.results);
862
+
863
+ for (var d = 0; d < data.results.length; d++) {
864
+ var item = data.results[d];
865
+
866
+ var $option = this.option(item);
867
+
868
+ $options.push($option);
869
+ }
870
+
871
+ this.$results.append($options);
872
+ };
873
+
874
+ Results.prototype.position = function ($results, $dropdown) {
875
+ var $resultsContainer = $dropdown.find('.select2-results');
876
+ $resultsContainer.append($results);
877
+ };
878
+
879
+ Results.prototype.sort = function (data) {
880
+ var sorter = this.options.get('sorter');
881
+
882
+ return sorter(data);
883
+ };
884
+
885
+ Results.prototype.highlightFirstItem = function () {
886
+ var $options = this.$results
887
+ .find('.select2-results__option[data-selected]');
888
+
889
+ var $selected = $options.filter('[data-selected=true]');
890
+
891
+ // Check if there are any selected options
892
+ if ($selected.length > 0) {
893
+ // If there are selected options, highlight the first
894
+ $selected.first().trigger('mouseenter');
895
+ } else {
896
+ // If there are no selected options, highlight the first option
897
+ // in the dropdown
898
+ $options.first().trigger('mouseenter');
899
+ }
900
+
901
+ this.ensureHighlightVisible();
902
+ };
903
+
904
+ Results.prototype.setClasses = function () {
905
+ var self = this;
906
+
907
+ this.data.current(function (selected) {
908
+ var selectedIds = $.map(selected, function (s) {
909
+ return s.id.toString();
910
+ });
911
+
912
+ var $options = self.$results
913
+ .find('.select2-results__option[data-selected]');
914
+
915
+ $options.each(function () {
916
+ var $option = $(this);
917
+
918
+ var item = $.data(this, 'data');
919
+
920
+ // id needs to be converted to a string when comparing
921
+ var id = '' + item.id;
922
+
923
+ if ((item.element != null && item.element.selected) ||
924
+ (item.element == null && $.inArray(id, selectedIds) > -1)) {
925
+ $option.attr('data-selected', 'true');
926
+ } else {
927
+ $option.attr('data-selected', 'false');
928
+ }
929
+ });
930
+
931
+ });
932
+ };
933
+
934
+ Results.prototype.showLoading = function (params) {
935
+ this.hideLoading();
936
+
937
+ var loadingMore = this.options.get('translations').get('searching');
938
+
939
+ var loading = {
940
+ disabled: true,
941
+ loading: true,
942
+ text: loadingMore(params)
943
+ };
944
+ var $loading = this.option(loading);
945
+ $loading.className += ' loading-results';
946
+
947
+ this.$results.prepend($loading);
948
+ };
949
+
950
+ Results.prototype.hideLoading = function () {
951
+ this.$results.find('.loading-results').remove();
952
+ };
953
+
954
+ Results.prototype.option = function (data) {
955
+ var option = document.createElement('li');
956
+ option.className = 'select2-results__option';
957
+
958
+ var attrs = {
959
+ 'role': 'option',
960
+ 'data-selected': 'false',
961
+ 'tabindex': -1
962
+ };
963
+
964
+ if (data.disabled) {
965
+ delete attrs['data-selected'];
966
+ attrs['aria-disabled'] = 'true';
967
+ }
968
+
969
+ if (data.id == null) {
970
+ delete attrs['data-selected'];
971
+ }
972
+
973
+ if (data._resultId != null) {
974
+ option.id = data._resultId;
975
+ }
976
+
977
+ if (data.title) {
978
+ option.title = data.title;
979
+ }
980
+
981
+ if (data.children) {
982
+ attrs['aria-label'] = data.text;
983
+ delete attrs['data-selected'];
984
+ }
985
+
986
+ for (var attr in attrs) {
987
+ var val = attrs[attr];
988
+
989
+ option.setAttribute(attr, val);
990
+ }
991
+
992
+ if (data.children) {
993
+ var $option = $(option);
994
+
995
+ var label = document.createElement('strong');
996
+ label.className = 'select2-results__group';
997
+
998
+ var $label = $(label);
999
+ this.template(data, label);
1000
+ $label.attr('role', 'presentation');
1001
+
1002
+ var $children = [];
1003
+
1004
+ for (var c = 0; c < data.children.length; c++) {
1005
+ var child = data.children[c];
1006
+
1007
+ var $child = this.option(child);
1008
+
1009
+ $children.push($child);
1010
+ }
1011
+
1012
+ var $childrenContainer = $('<ul></ul>', {
1013
+ 'class': 'select2-results__options select2-results__options--nested',
1014
+ 'role': 'listbox'
1015
+ });
1016
+ $childrenContainer.append($children);
1017
+ $option.attr('role', 'list');
1018
+
1019
+ $option.append(label);
1020
+ $option.append($childrenContainer);
1021
+ } else {
1022
+ this.template(data, option);
1023
+ }
1024
+
1025
+ $.data(option, 'data', data);
1026
+
1027
+ return option;
1028
+ };
1029
+
1030
+ Results.prototype.bind = function (container, $container) {
1031
+ var self = this;
1032
+
1033
+ var id = container.id + '-results';
1034
+
1035
+ this.$results.attr('id', id);
1036
+
1037
+ container.on('results:all', function (params) {
1038
+ self.clear();
1039
+ self.append(params.data);
1040
+
1041
+ if (container.isOpen()) {
1042
+ self.setClasses();
1043
+ self.highlightFirstItem();
1044
+ }
1045
+ });
1046
+
1047
+ container.on('results:append', function (params) {
1048
+ self.append(params.data);
1049
+
1050
+ if (container.isOpen()) {
1051
+ self.setClasses();
1052
+ }
1053
+ });
1054
+
1055
+ container.on('query', function (params) {
1056
+ self.hideMessages();
1057
+ self.showLoading(params);
1058
+ });
1059
+
1060
+ container.on('select', function () {
1061
+ if (!container.isOpen()) {
1062
+ return;
1063
+ }
1064
+
1065
+ self.setClasses();
1066
+ self.highlightFirstItem();
1067
+ });
1068
+
1069
+ container.on('unselect', function () {
1070
+ if (!container.isOpen()) {
1071
+ return;
1072
+ }
1073
+
1074
+ self.setClasses();
1075
+ self.highlightFirstItem();
1076
+ });
1077
+
1078
+ container.on('open', function () {
1079
+ // When the dropdown is open, aria-expended="true"
1080
+ self.$results.attr('aria-expanded', 'true');
1081
+ self.$results.attr('aria-hidden', 'false');
1082
+
1083
+ self.setClasses();
1084
+ self.ensureHighlightVisible();
1085
+ });
1086
+
1087
+ container.on('close', function () {
1088
+ // When the dropdown is closed, aria-expended="false"
1089
+ self.$results.attr('aria-expanded', 'false');
1090
+ self.$results.attr('aria-hidden', 'true');
1091
+ self.$results.removeAttr('aria-activedescendant');
1092
+ });
1093
+
1094
+ container.on('results:toggle', function () {
1095
+ var $highlighted = self.getHighlightedResults();
1096
+
1097
+ if ($highlighted.length === 0) {
1098
+ return;
1099
+ }
1100
+
1101
+ $highlighted.trigger('mouseup');
1102
+ });
1103
+
1104
+ container.on('results:select', function () {
1105
+ var $highlighted = self.getHighlightedResults();
1106
+
1107
+ if ($highlighted.length === 0) {
1108
+ return;
1109
+ }
1110
+
1111
+ var data = $highlighted.data('data');
1112
+
1113
+ if ($highlighted.attr('data-selected') == 'true') {
1114
+ self.trigger('close', {});
1115
+ } else {
1116
+ self.trigger('select', {
1117
+ data: data
1118
+ });
1119
+ }
1120
+ });
1121
+
1122
+ container.on('results:previous', function () {
1123
+ var $highlighted = self.getHighlightedResults();
1124
+
1125
+ var $options = self.$results.find('[data-selected]');
1126
+
1127
+ var currentIndex = $options.index($highlighted);
1128
+
1129
+ // If we are already at te top, don't move further
1130
+ if (currentIndex === 0) {
1131
+ return;
1132
+ }
1133
+
1134
+ var nextIndex = currentIndex - 1;
1135
+
1136
+ // If none are highlighted, highlight the first
1137
+ if ($highlighted.length === 0) {
1138
+ nextIndex = 0;
1139
+ }
1140
+
1141
+ var $next = $options.eq(nextIndex);
1142
+
1143
+ $next.trigger('mouseenter');
1144
+
1145
+ var currentOffset = self.$results.offset().top;
1146
+ var nextTop = $next.offset().top;
1147
+ var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
1148
+
1149
+ if (nextIndex === 0) {
1150
+ self.$results.scrollTop(0);
1151
+ } else if (nextTop - currentOffset < 0) {
1152
+ self.$results.scrollTop(nextOffset);
1153
+ }
1154
+ });
1155
+
1156
+ container.on('results:next', function () {
1157
+ var $highlighted = self.getHighlightedResults();
1158
+
1159
+ var $options = self.$results.find('[data-selected]');
1160
+
1161
+ var currentIndex = $options.index($highlighted);
1162
+
1163
+ var nextIndex = currentIndex + 1;
1164
+
1165
+ // If we are at the last option, stay there
1166
+ if (nextIndex >= $options.length) {
1167
+ return;
1168
+ }
1169
+
1170
+ var $next = $options.eq(nextIndex);
1171
+
1172
+ $next.trigger('mouseenter');
1173
+
1174
+ var currentOffset = self.$results.offset().top +
1175
+ self.$results.outerHeight(false);
1176
+ var nextBottom = $next.offset().top + $next.outerHeight(false);
1177
+ var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
1178
+
1179
+ if (nextIndex === 0) {
1180
+ self.$results.scrollTop(0);
1181
+ } else if (nextBottom > currentOffset) {
1182
+ self.$results.scrollTop(nextOffset);
1183
+ }
1184
+ });
1185
+
1186
+ container.on('results:focus', function (params) {
1187
+ params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true');
1188
+ self.$results.attr('aria-activedescendant', params.element.attr('id'));
1189
+ });
1190
+
1191
+ container.on('results:message', function (params) {
1192
+ self.displayMessage(params);
1193
+ });
1194
+
1195
+ if ($.fn.mousewheel) {
1196
+ this.$results.on('mousewheel', function (e) {
1197
+ var top = self.$results.scrollTop();
1198
+
1199
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
1200
+
1201
+ var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
1202
+ var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
1203
+
1204
+ if (isAtTop) {
1205
+ self.$results.scrollTop(0);
1206
+
1207
+ e.preventDefault();
1208
+ e.stopPropagation();
1209
+ } else if (isAtBottom) {
1210
+ self.$results.scrollTop(
1211
+ self.$results.get(0).scrollHeight - self.$results.height()
1212
+ );
1213
+
1214
+ e.preventDefault();
1215
+ e.stopPropagation();
1216
+ }
1217
+ });
1218
+ }
1219
+
1220
+ this.$results.on('mouseup', '.select2-results__option[data-selected]',
1221
+ function (evt) {
1222
+ var $this = $(this);
1223
+
1224
+ var data = $this.data('data');
1225
+
1226
+ if ($this.attr('data-selected') === 'true') {
1227
+ if (self.options.get('multiple')) {
1228
+ self.trigger('unselect', {
1229
+ originalEvent: evt,
1230
+ data: data
1231
+ });
1232
+ } else {
1233
+ self.trigger('close', {});
1234
+ }
1235
+
1236
+ return;
1237
+ }
1238
+
1239
+ self.trigger('select', {
1240
+ originalEvent: evt,
1241
+ data: data
1242
+ });
1243
+ });
1244
+
1245
+ this.$results.on('mouseenter', '.select2-results__option[data-selected]',
1246
+ function (evt) {
1247
+ var data = $(this).data('data');
1248
+
1249
+ self.getHighlightedResults()
1250
+ .removeClass('select2-results__option--highlighted')
1251
+ .attr('aria-selected', 'false');
1252
+
1253
+ self.trigger('results:focus', {
1254
+ data: data,
1255
+ element: $(this)
1256
+ });
1257
+ });
1258
+ };
1259
+
1260
+ Results.prototype.getHighlightedResults = function () {
1261
+ var $highlighted = this.$results
1262
+ .find('.select2-results__option--highlighted');
1263
+
1264
+ return $highlighted;
1265
+ };
1266
+
1267
+ Results.prototype.destroy = function () {
1268
+ this.$results.remove();
1269
+ };
1270
+
1271
+ Results.prototype.ensureHighlightVisible = function () {
1272
+ var $highlighted = this.getHighlightedResults();
1273
+
1274
+ if ($highlighted.length === 0) {
1275
+ return;
1276
+ }
1277
+
1278
+ var $options = this.$results.find('[data-selected]');
1279
+
1280
+ var currentIndex = $options.index($highlighted);
1281
+
1282
+ var currentOffset = this.$results.offset().top;
1283
+ var nextTop = $highlighted.offset().top;
1284
+ var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
1285
+
1286
+ var offsetDelta = nextTop - currentOffset;
1287
+ nextOffset -= $highlighted.outerHeight(false) * 2;
1288
+
1289
+ if (currentIndex <= 2) {
1290
+ this.$results.scrollTop(0);
1291
+ } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
1292
+ this.$results.scrollTop(nextOffset);
1293
+ }
1294
+ };
1295
+
1296
+ Results.prototype.template = function (result, container) {
1297
+ var template = this.options.get('templateResult');
1298
+ var escapeMarkup = this.options.get('escapeMarkup');
1299
+
1300
+ var content = template(result, container);
1301
+
1302
+ if (content == null) {
1303
+ container.style.display = 'none';
1304
+ } else if (typeof content === 'string') {
1305
+ container.innerHTML = escapeMarkup(content);
1306
+ } else {
1307
+ $(container).append(content);
1308
+ }
1309
+ };
1310
+
1311
+ return Results;
1312
+ });
1313
+
1314
+ S2.define('select2/keys',[
1315
+
1316
+ ], function () {
1317
+ var KEYS = {
1318
+ BACKSPACE: 8,
1319
+ TAB: 9,
1320
+ ENTER: 13,
1321
+ SHIFT: 16,
1322
+ CTRL: 17,
1323
+ ALT: 18,
1324
+ ESC: 27,
1325
+ SPACE: 32,
1326
+ PAGE_UP: 33,
1327
+ PAGE_DOWN: 34,
1328
+ END: 35,
1329
+ HOME: 36,
1330
+ LEFT: 37,
1331
+ UP: 38,
1332
+ RIGHT: 39,
1333
+ DOWN: 40,
1334
+ DELETE: 46
1335
+ };
1336
+
1337
+ return KEYS;
1338
+ });
1339
+
1340
+ S2.define('select2/selection/base',[
1341
+ 'jquery',
1342
+ '../utils',
1343
+ '../keys'
1344
+ ], function ($, Utils, KEYS) {
1345
+ function BaseSelection ($element, options) {
1346
+ this.$element = $element;
1347
+ this.options = options;
1348
+
1349
+ BaseSelection.__super__.constructor.call(this);
1350
+ }
1351
+
1352
+ Utils.Extend(BaseSelection, Utils.Observable);
1353
+
1354
+ BaseSelection.prototype.render = function () {
1355
+ var $selection = $(
1356
+ '<span class="select2-selection" ' +
1357
+ ' aria-haspopup="true" aria-expanded="false">' +
1358
+ '</span>'
1359
+ );
1360
+
1361
+ this._tabindex = 0;
1362
+
1363
+ if (this.$element.data('old-tabindex') != null) {
1364
+ this._tabindex = this.$element.data('old-tabindex');
1365
+ } else if (this.$element.attr('tabindex') != null) {
1366
+ this._tabindex = this.$element.attr('tabindex');
1367
+ }
1368
+
1369
+ $selection.attr('title', this.$element.attr('title'));
1370
+ $selection.attr('tabindex', this._tabindex);
1371
+
1372
+ this.$selection = $selection;
1373
+
1374
+ return $selection;
1375
+ };
1376
+
1377
+ BaseSelection.prototype.bind = function (container, $container) {
1378
+ var self = this;
1379
+
1380
+ var id = container.id + '-container';
1381
+ var resultsId = container.id + '-results';
1382
+ var searchHidden = this.options.get('minimumResultsForSearch') === Infinity;
1383
+
1384
+ this.container = container;
1385
+
1386
+ this.$selection.on('focus', function (evt) {
1387
+ self.trigger('focus', evt);
1388
+ });
1389
+
1390
+ this.$selection.on('blur', function (evt) {
1391
+ self._handleBlur(evt);
1392
+ });
1393
+
1394
+ this.$selection.on('keydown', function (evt) {
1395
+ self.trigger('keypress', evt);
1396
+
1397
+ if (evt.which === KEYS.SPACE) {
1398
+ evt.preventDefault();
1399
+ }
1400
+ });
1401
+
1402
+ container.on('results:focus', function (params) {
1403
+ self.$selection.attr('aria-activedescendant', params.data._resultId);
1404
+ });
1405
+
1406
+ container.on('selection:update', function (params) {
1407
+ self.update(params.data);
1408
+ });
1409
+
1410
+ container.on('open', function () {
1411
+ // When the dropdown is open, aria-expanded="true"
1412
+ self.$selection.attr('aria-expanded', 'true');
1413
+ self.$selection.attr('aria-owns', resultsId);
1414
+
1415
+ self._attachCloseHandler(container);
1416
+ });
1417
+
1418
+ container.on('close', function () {
1419
+ // When the dropdown is closed, aria-expanded="false"
1420
+ self.$selection.attr('aria-expanded', 'false');
1421
+ self.$selection.removeAttr('aria-activedescendant');
1422
+ self.$selection.removeAttr('aria-owns');
1423
+
1424
+ // This needs to be delayed as the active element is the body when the
1425
+ // key is pressed.
1426
+ window.setTimeout(function () {
1427
+ self.$selection.focus();
1428
+ }, 1);
1429
+
1430
+ self._detachCloseHandler(container);
1431
+ });
1432
+
1433
+ container.on('enable', function () {
1434
+ self.$selection.attr('tabindex', self._tabindex);
1435
+ });
1436
+
1437
+ container.on('disable', function () {
1438
+ self.$selection.attr('tabindex', '-1');
1439
+ });
1440
+ };
1441
+
1442
+ BaseSelection.prototype._handleBlur = function (evt) {
1443
+ var self = this;
1444
+
1445
+ // This needs to be delayed as the active element is the body when the tab
1446
+ // key is pressed, possibly along with others.
1447
+ window.setTimeout(function () {
1448
+ // Don't trigger `blur` if the focus is still in the selection
1449
+ if (
1450
+ (document.activeElement == self.$selection[0]) ||
1451
+ ($.contains(self.$selection[0], document.activeElement))
1452
+ ) {
1453
+ return;
1454
+ }
1455
+
1456
+ self.trigger('blur', evt);
1457
+ }, 1);
1458
+ };
1459
+
1460
+ BaseSelection.prototype._attachCloseHandler = function (container) {
1461
+ var self = this;
1462
+
1463
+ $(document.body).on('mousedown.select2.' + container.id, function (e) {
1464
+ var $target = $(e.target);
1465
+
1466
+ var $select = $target.closest('.select2');
1467
+
1468
+ var $all = $('.select2.select2-container--open');
1469
+
1470
+ $all.each(function () {
1471
+ var $this = $(this);
1472
+
1473
+ if (this == $select[0]) {
1474
+ return;
1475
+ }
1476
+
1477
+ var $element = $this.data('element');
1478
+ $element.select2('close');
1479
+
1480
+ // Remove any focus when dropdown is closed by clicking outside the select area.
1481
+ // Timeout of 1 required for close to finish wrapping up.
1482
+ setTimeout(function(){
1483
+ $this.find('*:focus').blur();
1484
+ $target.focus();
1485
+ }, 1);
1486
+ });
1487
+ });
1488
+ };
1489
+
1490
+ BaseSelection.prototype._detachCloseHandler = function (container) {
1491
+ $(document.body).off('mousedown.select2.' + container.id);
1492
+ };
1493
+
1494
+ BaseSelection.prototype.position = function ($selection, $container) {
1495
+ var $selectionContainer = $container.find('.selection');
1496
+ $selectionContainer.append($selection);
1497
+ };
1498
+
1499
+ BaseSelection.prototype.destroy = function () {
1500
+ this._detachCloseHandler(this.container);
1501
+ };
1502
+
1503
+ BaseSelection.prototype.update = function (data) {
1504
+ throw new Error('The `update` method must be defined in child classes.');
1505
+ };
1506
+
1507
+ return BaseSelection;
1508
+ });
1509
+
1510
+ S2.define('select2/selection/single',[
1511
+ 'jquery',
1512
+ './base',
1513
+ '../utils',
1514
+ '../keys'
1515
+ ], function ($, BaseSelection, Utils, KEYS) {
1516
+ function SingleSelection () {
1517
+ SingleSelection.__super__.constructor.apply(this, arguments);
1518
+ }
1519
+
1520
+ Utils.Extend(SingleSelection, BaseSelection);
1521
+
1522
+ SingleSelection.prototype.render = function () {
1523
+ var $selection = SingleSelection.__super__.render.call(this);
1524
+
1525
+ $selection.addClass('select2-selection--single');
1526
+
1527
+ $selection.html(
1528
+ '<span class="select2-selection__rendered"></span>' +
1529
+ '<span class="select2-selection__arrow" role="presentation">' +
1530
+ '<b role="presentation"></b>' +
1531
+ '</span>'
1532
+ );
1533
+
1534
+ return $selection;
1535
+ };
1536
+
1537
+ SingleSelection.prototype.bind = function (container, $container) {
1538
+ var self = this;
1539
+
1540
+ SingleSelection.__super__.bind.apply(this, arguments);
1541
+
1542
+ var id = container.id + '-container';
1543
+
1544
+ this.$selection.find('.select2-selection__rendered')
1545
+ .attr('id', id)
1546
+ .attr('role', 'textbox')
1547
+ .attr('aria-readonly', 'true');
1548
+ this.$selection.attr('aria-labelledby', id);
1549
+
1550
+ // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove.
1551
+ this.$selection.attr('role', 'combobox');
1552
+
1553
+ this.$selection.on('mousedown', function (evt) {
1554
+ // Only respond to left clicks
1555
+ if (evt.which !== 1) {
1556
+ return;
1557
+ }
1558
+
1559
+ self.trigger('toggle', {
1560
+ originalEvent: evt
1561
+ });
1562
+ });
1563
+
1564
+ this.$selection.on('focus', function (evt) {
1565
+ // User focuses on the container
1566
+ });
1567
+
1568
+ this.$selection.on('keydown', function (evt) {
1569
+ // If user starts typing an alphanumeric key on the keyboard, open if not opened.
1570
+ if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
1571
+ container.open();
1572
+ }
1573
+ });
1574
+
1575
+ this.$selection.on('blur', function (evt) {
1576
+ // User exits the container
1577
+ });
1578
+
1579
+ container.on('focus', function (evt) {
1580
+ if (!container.isOpen()) {
1581
+ self.$selection.focus();
1582
+ }
1583
+ });
1584
+
1585
+ container.on('selection:update', function (params) {
1586
+ self.update(params.data);
1587
+ });
1588
+ };
1589
+
1590
+ SingleSelection.prototype.clear = function () {
1591
+ this.$selection.find('.select2-selection__rendered').empty();
1592
+ };
1593
+
1594
+ SingleSelection.prototype.display = function (data, container) {
1595
+ var template = this.options.get('templateSelection');
1596
+ var escapeMarkup = this.options.get('escapeMarkup');
1597
+
1598
+ return escapeMarkup(template(data, container));
1599
+ };
1600
+
1601
+ SingleSelection.prototype.selectionContainer = function () {
1602
+ return $('<span></span>');
1603
+ };
1604
+
1605
+ SingleSelection.prototype.update = function (data) {
1606
+ if (data.length === 0) {
1607
+ this.clear();
1608
+ return;
1609
+ }
1610
+
1611
+ var selection = data[0];
1612
+
1613
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1614
+ var formatted = this.display(selection, $rendered);
1615
+
1616
+ $rendered.empty().append(formatted);
1617
+ $rendered.prop('title', selection.title || selection.text);
1618
+ };
1619
+
1620
+ return SingleSelection;
1621
+ });
1622
+
1623
+ S2.define('select2/selection/multiple',[
1624
+ 'jquery',
1625
+ './base',
1626
+ '../utils'
1627
+ ], function ($, BaseSelection, Utils) {
1628
+ function MultipleSelection ($element, options) {
1629
+ MultipleSelection.__super__.constructor.apply(this, arguments);
1630
+ }
1631
+
1632
+ Utils.Extend(MultipleSelection, BaseSelection);
1633
+
1634
+ MultipleSelection.prototype.render = function () {
1635
+ var $selection = MultipleSelection.__super__.render.call(this);
1636
+
1637
+ $selection.addClass('select2-selection--multiple');
1638
+
1639
+ $selection.html(
1640
+ '<ul class="select2-selection__rendered" aria-live="polite" aria-relevant="additions removals" aria-atomic="true"></ul>'
1641
+ );
1642
+
1643
+ return $selection;
1644
+ };
1645
+
1646
+ MultipleSelection.prototype.bind = function (container, $container) {
1647
+ var self = this;
1648
+
1649
+ MultipleSelection.__super__.bind.apply(this, arguments);
1650
+
1651
+ this.$selection.on('click', function (evt) {
1652
+ self.trigger('toggle', {
1653
+ originalEvent: evt
1654
+ });
1655
+ });
1656
+
1657
+ this.$selection.on(
1658
+ 'click',
1659
+ '.select2-selection__choice__remove',
1660
+ function (evt) {
1661
+ // Ignore the event if it is disabled
1662
+ if (self.options.get('disabled')) {
1663
+ return;
1664
+ }
1665
+
1666
+ var $remove = $(this);
1667
+ var $selection = $remove.parent();
1668
+
1669
+ var data = $selection.data('data');
1670
+
1671
+ self.trigger('unselect', {
1672
+ originalEvent: evt,
1673
+ data: data
1674
+ });
1675
+ }
1676
+ );
1677
+
1678
+ this.$selection.on('keydown', function (evt) {
1679
+ // If user starts typing an alphanumeric key on the keyboard, open if not opened.
1680
+ if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
1681
+ container.open();
1682
+ }
1683
+ });
1684
+
1685
+ // Focus on the search field when the container is focused instead of the main container.
1686
+ container.on( 'focus', function(){
1687
+ self.focusOnSearch();
1688
+ });
1689
+ };
1690
+
1691
+ MultipleSelection.prototype.clear = function () {
1692
+ this.$selection.find('.select2-selection__rendered').empty();
1693
+ };
1694
+
1695
+ MultipleSelection.prototype.display = function (data, container) {
1696
+ var template = this.options.get('templateSelection');
1697
+ var escapeMarkup = this.options.get('escapeMarkup');
1698
+
1699
+ return escapeMarkup(template(data, container));
1700
+ };
1701
+
1702
+ MultipleSelection.prototype.selectionContainer = function () {
1703
+ var $container = $(
1704
+ '<li class="select2-selection__choice">' +
1705
+ '<span class="select2-selection__choice__remove" role="presentation" aria-hidden="true">' +
1706
+ '&times;' +
1707
+ '</span>' +
1708
+ '</li>'
1709
+ );
1710
+
1711
+ return $container;
1712
+ };
1713
+
1714
+ /**
1715
+ * Focus on the search field instead of the main multiselect container.
1716
+ */
1717
+ MultipleSelection.prototype.focusOnSearch = function() {
1718
+ var self = this;
1719
+
1720
+ if ('undefined' !== typeof self.$search) {
1721
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
1722
+ setTimeout(function(){
1723
+ // Prevent the dropdown opening again when focused from this.
1724
+ // This gets reset automatically when focus is triggered.
1725
+ self._keyUpPrevented = true;
1726
+
1727
+ self.$search.focus();
1728
+ }, 1);
1729
+ }
1730
+ }
1731
+
1732
+ MultipleSelection.prototype.update = function (data) {
1733
+ this.clear();
1734
+
1735
+ if (data.length === 0) {
1736
+ return;
1737
+ }
1738
+
1739
+ var $selections = [];
1740
+
1741
+ for (var d = 0; d < data.length; d++) {
1742
+ var selection = data[d];
1743
+
1744
+ var $selection = this.selectionContainer();
1745
+ var formatted = this.display(selection, $selection);
1746
+ if ('string' === typeof formatted) {
1747
+ formatted = formatted.trim();
1748
+ }
1749
+
1750
+ $selection.append(formatted);
1751
+ $selection.prop('title', selection.title || selection.text);
1752
+
1753
+ $selection.data('data', selection);
1754
+
1755
+ $selections.push($selection);
1756
+ }
1757
+
1758
+ var $rendered = this.$selection.find('.select2-selection__rendered');
1759
+
1760
+ Utils.appendMany($rendered, $selections);
1761
+ };
1762
+
1763
+ return MultipleSelection;
1764
+ });
1765
+
1766
+ S2.define('select2/selection/placeholder',[
1767
+ '../utils'
1768
+ ], function (Utils) {
1769
+ function Placeholder (decorated, $element, options) {
1770
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
1771
+
1772
+ decorated.call(this, $element, options);
1773
+ }
1774
+
1775
+ Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
1776
+ if (typeof placeholder === 'string') {
1777
+ placeholder = {
1778
+ id: '',
1779
+ text: placeholder
1780
+ };
1781
+ }
1782
+
1783
+ return placeholder;
1784
+ };
1785
+
1786
+ Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
1787
+ var $placeholder = this.selectionContainer();
1788
+
1789
+ $placeholder.html(this.display(placeholder));
1790
+ $placeholder.addClass('select2-selection__placeholder')
1791
+ .removeClass('select2-selection__choice');
1792
+
1793
+ return $placeholder;
1794
+ };
1795
+
1796
+ Placeholder.prototype.update = function (decorated, data) {
1797
+ var singlePlaceholder = (
1798
+ data.length == 1 && data[0].id != this.placeholder.id
1799
+ );
1800
+ var multipleSelections = data.length > 1;
1801
+
1802
+ if (multipleSelections || singlePlaceholder) {
1803
+ return decorated.call(this, data);
1804
+ }
1805
+
1806
+ this.clear();
1807
+
1808
+ var $placeholder = this.createPlaceholder(this.placeholder);
1809
+
1810
+ this.$selection.find('.select2-selection__rendered').append($placeholder);
1811
+ };
1812
+
1813
+ return Placeholder;
1814
+ });
1815
+
1816
+ S2.define('select2/selection/allowClear',[
1817
+ 'jquery',
1818
+ '../keys'
1819
+ ], function ($, KEYS) {
1820
+ function AllowClear () { }
1821
+
1822
+ AllowClear.prototype.bind = function (decorated, container, $container) {
1823
+ var self = this;
1824
+
1825
+ decorated.call(this, container, $container);
1826
+
1827
+ if (this.placeholder == null) {
1828
+ if (this.options.get('debug') && window.console && console.error) {
1829
+ console.error(
1830
+ 'Select2: The `allowClear` option should be used in combination ' +
1831
+ 'with the `placeholder` option.'
1832
+ );
1833
+ }
1834
+ }
1835
+
1836
+ this.$selection.on('mousedown', '.select2-selection__clear',
1837
+ function (evt) {
1838
+ self._handleClear(evt);
1839
+ });
1840
+
1841
+ container.on('keypress', function (evt) {
1842
+ self._handleKeyboardClear(evt, container);
1843
+ });
1844
+ };
1845
+
1846
+ AllowClear.prototype._handleClear = function (_, evt) {
1847
+ // Ignore the event if it is disabled
1848
+ if (this.options.get('disabled')) {
1849
+ return;
1850
+ }
1851
+
1852
+ var $clear = this.$selection.find('.select2-selection__clear');
1853
+
1854
+ // Ignore the event if nothing has been selected
1855
+ if ($clear.length === 0) {
1856
+ return;
1857
+ }
1858
+
1859
+ evt.stopPropagation();
1860
+
1861
+ var data = $clear.data('data');
1862
+
1863
+ for (var d = 0; d < data.length; d++) {
1864
+ var unselectData = {
1865
+ data: data[d]
1866
+ };
1867
+
1868
+ // Trigger the `unselect` event, so people can prevent it from being
1869
+ // cleared.
1870
+ this.trigger('unselect', unselectData);
1871
+
1872
+ // If the event was prevented, don't clear it out.
1873
+ if (unselectData.prevented) {
1874
+ return;
1875
+ }
1876
+ }
1877
+
1878
+ this.$element.val(this.placeholder.id).trigger('change');
1879
+
1880
+ this.trigger('toggle', {});
1881
+ };
1882
+
1883
+ AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
1884
+ if (container.isOpen()) {
1885
+ return;
1886
+ }
1887
+
1888
+ if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
1889
+ this._handleClear(evt);
1890
+ }
1891
+ };
1892
+
1893
+ AllowClear.prototype.update = function (decorated, data) {
1894
+ decorated.call(this, data);
1895
+
1896
+ if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
1897
+ data.length === 0) {
1898
+ return;
1899
+ }
1900
+
1901
+ var $remove = $(
1902
+ '<span class="select2-selection__clear">' +
1903
+ '&times;' +
1904
+ '</span>'
1905
+ );
1906
+ $remove.data('data', data);
1907
+
1908
+ this.$selection.find('.select2-selection__rendered').prepend($remove);
1909
+ };
1910
+
1911
+ return AllowClear;
1912
+ });
1913
+
1914
+ S2.define('select2/selection/search',[
1915
+ 'jquery',
1916
+ '../utils',
1917
+ '../keys'
1918
+ ], function ($, Utils, KEYS) {
1919
+ function Search (decorated, $element, options) {
1920
+ decorated.call(this, $element, options);
1921
+ }
1922
+
1923
+ Search.prototype.render = function (decorated) {
1924
+ var $search = $(
1925
+ '<li class="select2-search select2-search--inline">' +
1926
+ '<input class="select2-search__field" type="text" tabindex="-1"' +
1927
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
1928
+ ' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
1929
+ '</li>'
1930
+ );
1931
+
1932
+ this.$searchContainer = $search;
1933
+ this.$search = $search.find('input');
1934
+
1935
+ var $rendered = decorated.call(this);
1936
+
1937
+ this._transferTabIndex();
1938
+
1939
+ return $rendered;
1940
+ };
1941
+
1942
+ Search.prototype.bind = function (decorated, container, $container) {
1943
+ var self = this;
1944
+ var resultsId = container.id + '-results';
1945
+
1946
+ decorated.call(this, container, $container);
1947
+
1948
+ container.on('open', function () {
1949
+ self.$search.attr('aria-owns', resultsId);
1950
+ self.$search.trigger('focus');
1951
+ });
1952
+
1953
+ container.on('close', function () {
1954
+ self.$search.val('');
1955
+ self.$search.removeAttr('aria-activedescendant');
1956
+ self.$search.removeAttr('aria-owns');
1957
+ self.$search.trigger('focus');
1958
+ });
1959
+
1960
+ container.on('enable', function () {
1961
+ self.$search.prop('disabled', false);
1962
+
1963
+ self._transferTabIndex();
1964
+ });
1965
+
1966
+ container.on('disable', function () {
1967
+ self.$search.prop('disabled', true);
1968
+ });
1969
+
1970
+ container.on('focus', function (evt) {
1971
+ self.$search.trigger('focus');
1972
+ });
1973
+
1974
+ container.on('results:focus', function (params) {
1975
+ self.$search.attr('aria-activedescendant', params.data._resultId);
1976
+ });
1977
+
1978
+ this.$selection.on('focusin', '.select2-search--inline', function (evt) {
1979
+ self.trigger('focus', evt);
1980
+ });
1981
+
1982
+ this.$selection.on('focusout', '.select2-search--inline', function (evt) {
1983
+ self._handleBlur(evt);
1984
+ });
1985
+
1986
+ this.$selection.on('keydown', '.select2-search--inline', function (evt) {
1987
+ evt.stopPropagation();
1988
+
1989
+ self.trigger('keypress', evt);
1990
+
1991
+ self._keyUpPrevented = evt.isDefaultPrevented();
1992
+
1993
+ var key = evt.which;
1994
+
1995
+ if (key === KEYS.BACKSPACE && self.$search.val() === '') {
1996
+ var $previousChoice = self.$searchContainer
1997
+ .prev('.select2-selection__choice');
1998
+
1999
+ if ($previousChoice.length > 0) {
2000
+ var item = $previousChoice.data('data');
2001
+
2002
+ self.searchRemoveChoice(item);
2003
+
2004
+ evt.preventDefault();
2005
+ }
2006
+ } else if (evt.which === KEYS.ENTER) {
2007
+ container.open();
2008
+ evt.preventDefault();
2009
+ }
2010
+ });
2011
+
2012
+ // Try to detect the IE version should the `documentMode` property that
2013
+ // is stored on the document. This is only implemented in IE and is
2014
+ // slightly cleaner than doing a user agent check.
2015
+ // This property is not available in Edge, but Edge also doesn't have
2016
+ // this bug.
2017
+ var msie = document.documentMode;
2018
+ var disableInputEvents = msie && msie <= 11;
2019
+
2020
+ // Workaround for browsers which do not support the `input` event
2021
+ // This will prevent double-triggering of events for browsers which support
2022
+ // both the `keyup` and `input` events.
2023
+ this.$selection.on(
2024
+ 'input.searchcheck',
2025
+ '.select2-search--inline',
2026
+ function (evt) {
2027
+ // IE will trigger the `input` event when a placeholder is used on a
2028
+ // search box. To get around this issue, we are forced to ignore all
2029
+ // `input` events in IE and keep using `keyup`.
2030
+ if (disableInputEvents) {
2031
+ self.$selection.off('input.search input.searchcheck');
2032
+ return;
2033
+ }
2034
+
2035
+ // Unbind the duplicated `keyup` event
2036
+ self.$selection.off('keyup.search');
2037
+ }
2038
+ );
2039
+
2040
+ this.$selection.on(
2041
+ 'keyup.search input.search',
2042
+ '.select2-search--inline',
2043
+ function (evt) {
2044
+ // IE will trigger the `input` event when a placeholder is used on a
2045
+ // search box. To get around this issue, we are forced to ignore all
2046
+ // `input` events in IE and keep using `keyup`.
2047
+ if (disableInputEvents && evt.type === 'input') {
2048
+ self.$selection.off('input.search input.searchcheck');
2049
+ return;
2050
+ }
2051
+
2052
+ var key = evt.which;
2053
+
2054
+ // We can freely ignore events from modifier keys
2055
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
2056
+ return;
2057
+ }
2058
+
2059
+ // Tabbing will be handled during the `keydown` phase
2060
+ if (key == KEYS.TAB) {
2061
+ return;
2062
+ }
2063
+
2064
+ self.handleSearch(evt);
2065
+ }
2066
+ );
2067
+ };
2068
+
2069
+ /**
2070
+ * This method will transfer the tabindex attribute from the rendered
2071
+ * selection to the search box. This allows for the search box to be used as
2072
+ * the primary focus instead of the selection container.
2073
+ *
2074
+ * @private
2075
+ */
2076
+ Search.prototype._transferTabIndex = function (decorated) {
2077
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
2078
+ this.$selection.attr('tabindex', '-1');
2079
+ };
2080
+
2081
+ Search.prototype.createPlaceholder = function (decorated, placeholder) {
2082
+ this.$search.attr('placeholder', placeholder.text);
2083
+ };
2084
+
2085
+ Search.prototype.update = function (decorated, data) {
2086
+ var searchHadFocus = this.$search[0] == document.activeElement;
2087
+
2088
+ this.$search.attr('placeholder', '');
2089
+
2090
+ decorated.call(this, data);
2091
+
2092
+ this.$selection.find('.select2-selection__rendered')
2093
+ .append(this.$searchContainer);
2094
+
2095
+ this.resizeSearch();
2096
+ if (searchHadFocus) {
2097
+ this.$search.focus();
2098
+ }
2099
+ };
2100
+
2101
+ Search.prototype.handleSearch = function () {
2102
+ this.resizeSearch();
2103
+
2104
+ if (!this._keyUpPrevented) {
2105
+ var input = this.$search.val();
2106
+
2107
+ this.trigger('query', {
2108
+ term: input
2109
+ });
2110
+ }
2111
+
2112
+ this._keyUpPrevented = false;
2113
+ };
2114
+
2115
+ Search.prototype.searchRemoveChoice = function (decorated, item) {
2116
+ this.trigger('unselect', {
2117
+ data: item
2118
+ });
2119
+
2120
+ this.$search.val(item.text);
2121
+ this.handleSearch();
2122
+ };
2123
+
2124
+ Search.prototype.resizeSearch = function () {
2125
+ this.$search.css('width', '25px');
2126
+
2127
+ var width = '';
2128
+
2129
+ if (this.$search.attr('placeholder') !== '') {
2130
+ width = this.$selection.find('.select2-selection__rendered').innerWidth();
2131
+ } else {
2132
+ var minimumWidth = this.$search.val().length + 1;
2133
+
2134
+ width = (minimumWidth * 0.75) + 'em';
2135
+ }
2136
+
2137
+ this.$search.css('width', width);
2138
+ };
2139
+
2140
+ return Search;
2141
+ });
2142
+
2143
+ S2.define('select2/selection/eventRelay',[
2144
+ 'jquery'
2145
+ ], function ($) {
2146
+ function EventRelay () { }
2147
+
2148
+ EventRelay.prototype.bind = function (decorated, container, $container) {
2149
+ var self = this;
2150
+ var relayEvents = [
2151
+ 'open', 'opening',
2152
+ 'close', 'closing',
2153
+ 'select', 'selecting',
2154
+ 'unselect', 'unselecting'
2155
+ ];
2156
+
2157
+ var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
2158
+
2159
+ decorated.call(this, container, $container);
2160
+
2161
+ container.on('*', function (name, params) {
2162
+ // Ignore events that should not be relayed
2163
+ if ($.inArray(name, relayEvents) === -1) {
2164
+ return;
2165
+ }
2166
+
2167
+ // The parameters should always be an object
2168
+ params = params || {};
2169
+
2170
+ // Generate the jQuery event for the Select2 event
2171
+ var evt = $.Event('select2:' + name, {
2172
+ params: params
2173
+ });
2174
+
2175
+ self.$element.trigger(evt);
2176
+
2177
+ // Only handle preventable events if it was one
2178
+ if ($.inArray(name, preventableEvents) === -1) {
2179
+ return;
2180
+ }
2181
+
2182
+ params.prevented = evt.isDefaultPrevented();
2183
+ });
2184
+ };
2185
+
2186
+ return EventRelay;
2187
+ });
2188
+
2189
+ S2.define('select2/translation',[
2190
+ 'jquery',
2191
+ 'require'
2192
+ ], function ($, require) {
2193
+ function Translation (dict) {
2194
+ this.dict = dict || {};
2195
+ }
2196
+
2197
+ Translation.prototype.all = function () {
2198
+ return this.dict;
2199
+ };
2200
+
2201
+ Translation.prototype.get = function (key) {
2202
+ return this.dict[key];
2203
+ };
2204
+
2205
+ Translation.prototype.extend = function (translation) {
2206
+ this.dict = $.extend({}, translation.all(), this.dict);
2207
+ };
2208
+
2209
+ // Static functions
2210
+
2211
+ Translation._cache = {};
2212
+
2213
+ Translation.loadPath = function (path) {
2214
+ if (!(path in Translation._cache)) {
2215
+ var translations = require(path);
2216
+
2217
+ Translation._cache[path] = translations;
2218
+ }
2219
+
2220
+ return new Translation(Translation._cache[path]);
2221
+ };
2222
+
2223
+ return Translation;
2224
+ });
2225
+
2226
+ S2.define('select2/diacritics',[
2227
+
2228
+ ], function () {
2229
+ var diacritics = {
2230
+ '\u24B6': 'A',
2231
+ '\uFF21': 'A',
2232
+ '\u00C0': 'A',
2233
+ '\u00C1': 'A',
2234
+ '\u00C2': 'A',
2235
+ '\u1EA6': 'A',
2236
+ '\u1EA4': 'A',
2237
+ '\u1EAA': 'A',
2238
+ '\u1EA8': 'A',
2239
+ '\u00C3': 'A',
2240
+ '\u0100': 'A',
2241
+ '\u0102': 'A',
2242
+ '\u1EB0': 'A',
2243
+ '\u1EAE': 'A',
2244
+ '\u1EB4': 'A',
2245
+ '\u1EB2': 'A',
2246
+ '\u0226': 'A',
2247
+ '\u01E0': 'A',
2248
+ '\u00C4': 'A',
2249
+ '\u01DE': 'A',
2250
+ '\u1EA2': 'A',
2251
+ '\u00C5': 'A',
2252
+ '\u01FA': 'A',
2253
+ '\u01CD': 'A',
2254
+ '\u0200': 'A',
2255
+ '\u0202': 'A',
2256
+ '\u1EA0': 'A',
2257
+ '\u1EAC': 'A',
2258
+ '\u1EB6': 'A',
2259
+ '\u1E00': 'A',
2260
+ '\u0104': 'A',
2261
+ '\u023A': 'A',
2262
+ '\u2C6F': 'A',
2263
+ '\uA732': 'AA',
2264
+ '\u00C6': 'AE',
2265
+ '\u01FC': 'AE',
2266
+ '\u01E2': 'AE',
2267
+ '\uA734': 'AO',
2268
+ '\uA736': 'AU',
2269
+ '\uA738': 'AV',
2270
+ '\uA73A': 'AV',
2271
+ '\uA73C': 'AY',
2272
+ '\u24B7': 'B',
2273
+ '\uFF22': 'B',
2274
+ '\u1E02': 'B',
2275
+ '\u1E04': 'B',
2276
+ '\u1E06': 'B',
2277
+ '\u0243': 'B',
2278
+ '\u0182': 'B',
2279
+ '\u0181': 'B',
2280
+ '\u24B8': 'C',
2281
+ '\uFF23': 'C',
2282
+ '\u0106': 'C',
2283
+ '\u0108': 'C',
2284
+ '\u010A': 'C',
2285
+ '\u010C': 'C',
2286
+ '\u00C7': 'C',
2287
+ '\u1E08': 'C',
2288
+ '\u0187': 'C',
2289
+ '\u023B': 'C',
2290
+ '\uA73E': 'C',
2291
+ '\u24B9': 'D',
2292
+ '\uFF24': 'D',
2293
+ '\u1E0A': 'D',
2294
+ '\u010E': 'D',
2295
+ '\u1E0C': 'D',
2296
+ '\u1E10': 'D',
2297
+ '\u1E12': 'D',
2298
+ '\u1E0E': 'D',
2299
+ '\u0110': 'D',
2300
+ '\u018B': 'D',
2301
+ '\u018A': 'D',
2302
+ '\u0189': 'D',
2303
+ '\uA779': 'D',
2304
+ '\u01F1': 'DZ',
2305
+ '\u01C4': 'DZ',
2306
+ '\u01F2': 'Dz',
2307
+ '\u01C5': 'Dz',
2308
+ '\u24BA': 'E',
2309
+ '\uFF25': 'E',
2310
+ '\u00C8': 'E',
2311
+ '\u00C9': 'E',
2312
+ '\u00CA': 'E',
2313
+ '\u1EC0': 'E',
2314
+ '\u1EBE': 'E',
2315
+ '\u1EC4': 'E',
2316
+ '\u1EC2': 'E',
2317
+ '\u1EBC': 'E',
2318
+ '\u0112': 'E',
2319
+ '\u1E14': 'E',
2320
+ '\u1E16': 'E',
2321
+ '\u0114': 'E',
2322
+ '\u0116': 'E',
2323
+ '\u00CB': 'E',
2324
+ '\u1EBA': 'E',
2325
+ '\u011A': 'E',
2326
+ '\u0204': 'E',
2327
+ '\u0206': 'E',
2328
+ '\u1EB8': 'E',
2329
+ '\u1EC6': 'E',
2330
+ '\u0228': 'E',
2331
+ '\u1E1C': 'E',
2332
+ '\u0118': 'E',
2333
+ '\u1E18': 'E',
2334
+ '\u1E1A': 'E',
2335
+ '\u0190': 'E',
2336
+ '\u018E': 'E',
2337
+ '\u24BB': 'F',
2338
+ '\uFF26': 'F',
2339
+ '\u1E1E': 'F',
2340
+ '\u0191': 'F',
2341
+ '\uA77B': 'F',
2342
+ '\u24BC': 'G',
2343
+ '\uFF27': 'G',
2344
+ '\u01F4': 'G',
2345
+ '\u011C': 'G',
2346
+ '\u1E20': 'G',
2347
+ '\u011E': 'G',
2348
+ '\u0120': 'G',
2349
+ '\u01E6': 'G',
2350
+ '\u0122': 'G',
2351
+ '\u01E4': 'G',
2352
+ '\u0193': 'G',
2353
+ '\uA7A0': 'G',
2354
+ '\uA77D': 'G',
2355
+ '\uA77E': 'G',
2356
+ '\u24BD': 'H',
2357
+ '\uFF28': 'H',
2358
+ '\u0124': 'H',
2359
+ '\u1E22': 'H',
2360
+ '\u1E26': 'H',
2361
+ '\u021E': 'H',
2362
+ '\u1E24': 'H',
2363
+ '\u1E28': 'H',
2364
+ '\u1E2A': 'H',
2365
+ '\u0126': 'H',
2366
+ '\u2C67': 'H',
2367
+ '\u2C75': 'H',
2368
+ '\uA78D': 'H',
2369
+ '\u24BE': 'I',
2370
+ '\uFF29': 'I',
2371
+ '\u00CC': 'I',
2372
+ '\u00CD': 'I',
2373
+ '\u00CE': 'I',
2374
+ '\u0128': 'I',
2375
+ '\u012A': 'I',
2376
+ '\u012C': 'I',
2377
+ '\u0130': 'I',
2378
+ '\u00CF': 'I',
2379
+ '\u1E2E': 'I',
2380
+ '\u1EC8': 'I',
2381
+ '\u01CF': 'I',
2382
+ '\u0208': 'I',
2383
+ '\u020A': 'I',
2384
+ '\u1ECA': 'I',
2385
+ '\u012E': 'I',
2386
+ '\u1E2C': 'I',
2387
+ '\u0197': 'I',
2388
+ '\u24BF': 'J',
2389
+ '\uFF2A': 'J',
2390
+ '\u0134': 'J',
2391
+ '\u0248': 'J',
2392
+ '\u24C0': 'K',
2393
+ '\uFF2B': 'K',
2394
+ '\u1E30': 'K',
2395
+ '\u01E8': 'K',
2396
+ '\u1E32': 'K',
2397
+ '\u0136': 'K',
2398
+ '\u1E34': 'K',
2399
+ '\u0198': 'K',
2400
+ '\u2C69': 'K',
2401
+ '\uA740': 'K',
2402
+ '\uA742': 'K',
2403
+ '\uA744': 'K',
2404
+ '\uA7A2': 'K',
2405
+ '\u24C1': 'L',
2406
+ '\uFF2C': 'L',
2407
+ '\u013F': 'L',
2408
+ '\u0139': 'L',
2409
+ '\u013D': 'L',
2410
+ '\u1E36': 'L',
2411
+ '\u1E38': 'L',
2412
+ '\u013B': 'L',
2413
+ '\u1E3C': 'L',
2414
+ '\u1E3A': 'L',
2415
+ '\u0141': 'L',
2416
+ '\u023D': 'L',
2417
+ '\u2C62': 'L',
2418
+ '\u2C60': 'L',
2419
+ '\uA748': 'L',
2420
+ '\uA746': 'L',
2421
+ '\uA780': 'L',
2422
+ '\u01C7': 'LJ',
2423
+ '\u01C8': 'Lj',
2424
+ '\u24C2': 'M',
2425
+ '\uFF2D': 'M',
2426
+ '\u1E3E': 'M',
2427
+ '\u1E40': 'M',
2428
+ '\u1E42': 'M',
2429
+ '\u2C6E': 'M',
2430
+ '\u019C': 'M',
2431
+ '\u24C3': 'N',
2432
+ '\uFF2E': 'N',
2433
+ '\u01F8': 'N',
2434
+ '\u0143': 'N',
2435
+ '\u00D1': 'N',
2436
+ '\u1E44': 'N',
2437
+ '\u0147': 'N',
2438
+ '\u1E46': 'N',
2439
+ '\u0145': 'N',
2440
+ '\u1E4A': 'N',
2441
+ '\u1E48': 'N',
2442
+ '\u0220': 'N',
2443
+ '\u019D': 'N',
2444
+ '\uA790': 'N',
2445
+ '\uA7A4': 'N',
2446
+ '\u01CA': 'NJ',
2447
+ '\u01CB': 'Nj',
2448
+ '\u24C4': 'O',
2449
+ '\uFF2F': 'O',
2450
+ '\u00D2': 'O',
2451
+ '\u00D3': 'O',
2452
+ '\u00D4': 'O',
2453
+ '\u1ED2': 'O',
2454
+ '\u1ED0': 'O',
2455
+ '\u1ED6': 'O',
2456
+ '\u1ED4': 'O',
2457
+ '\u00D5': 'O',
2458
+ '\u1E4C': 'O',
2459
+ '\u022C': 'O',
2460
+ '\u1E4E': 'O',
2461
+ '\u014C': 'O',
2462
+ '\u1E50': 'O',
2463
+ '\u1E52': 'O',
2464
+ '\u014E': 'O',
2465
+ '\u022E': 'O',
2466
+ '\u0230': 'O',
2467
+ '\u00D6': 'O',
2468
+ '\u022A': 'O',
2469
+ '\u1ECE': 'O',
2470
+ '\u0150': 'O',
2471
+ '\u01D1': 'O',
2472
+ '\u020C': 'O',
2473
+ '\u020E': 'O',
2474
+ '\u01A0': 'O',
2475
+ '\u1EDC': 'O',
2476
+ '\u1EDA': 'O',
2477
+ '\u1EE0': 'O',
2478
+ '\u1EDE': 'O',
2479
+ '\u1EE2': 'O',
2480
+ '\u1ECC': 'O',
2481
+ '\u1ED8': 'O',
2482
+ '\u01EA': 'O',
2483
+ '\u01EC': 'O',
2484
+ '\u00D8': 'O',
2485
+ '\u01FE': 'O',
2486
+ '\u0186': 'O',
2487
+ '\u019F': 'O',
2488
+ '\uA74A': 'O',
2489
+ '\uA74C': 'O',
2490
+ '\u01A2': 'OI',
2491
+ '\uA74E': 'OO',
2492
+ '\u0222': 'OU',
2493
+ '\u24C5': 'P',
2494
+ '\uFF30': 'P',
2495
+ '\u1E54': 'P',
2496
+ '\u1E56': 'P',
2497
+ '\u01A4': 'P',
2498
+ '\u2C63': 'P',
2499
+ '\uA750': 'P',
2500
+ '\uA752': 'P',
2501
+ '\uA754': 'P',
2502
+ '\u24C6': 'Q',
2503
+ '\uFF31': 'Q',
2504
+ '\uA756': 'Q',
2505
+ '\uA758': 'Q',
2506
+ '\u024A': 'Q',
2507
+ '\u24C7': 'R',
2508
+ '\uFF32': 'R',
2509
+ '\u0154': 'R',
2510
+ '\u1E58': 'R',
2511
+ '\u0158': 'R',
2512
+ '\u0210': 'R',
2513
+ '\u0212': 'R',
2514
+ '\u1E5A': 'R',
2515
+ '\u1E5C': 'R',
2516
+ '\u0156': 'R',
2517
+ '\u1E5E': 'R',
2518
+ '\u024C': 'R',
2519
+ '\u2C64': 'R',
2520
+ '\uA75A': 'R',
2521
+ '\uA7A6': 'R',
2522
+ '\uA782': 'R',
2523
+ '\u24C8': 'S',
2524
+ '\uFF33': 'S',
2525
+ '\u1E9E': 'S',
2526
+ '\u015A': 'S',
2527
+ '\u1E64': 'S',
2528
+ '\u015C': 'S',
2529
+ '\u1E60': 'S',
2530
+ '\u0160': 'S',
2531
+ '\u1E66': 'S',
2532
+ '\u1E62': 'S',
2533
+ '\u1E68': 'S',
2534
+ '\u0218': 'S',
2535
+ '\u015E': 'S',
2536
+ '\u2C7E': 'S',
2537
+ '\uA7A8': 'S',
2538
+ '\uA784': 'S',
2539
+ '\u24C9': 'T',
2540
+ '\uFF34': 'T',
2541
+ '\u1E6A': 'T',
2542
+ '\u0164': 'T',
2543
+ '\u1E6C': 'T',
2544
+ '\u021A': 'T',
2545
+ '\u0162': 'T',
2546
+ '\u1E70': 'T',
2547
+ '\u1E6E': 'T',
2548
+ '\u0166': 'T',
2549
+ '\u01AC': 'T',
2550
+ '\u01AE': 'T',
2551
+ '\u023E': 'T',
2552
+ '\uA786': 'T',
2553
+ '\uA728': 'TZ',
2554
+ '\u24CA': 'U',
2555
+ '\uFF35': 'U',
2556
+ '\u00D9': 'U',
2557
+ '\u00DA': 'U',
2558
+ '\u00DB': 'U',
2559
+ '\u0168': 'U',
2560
+ '\u1E78': 'U',
2561
+ '\u016A': 'U',
2562
+ '\u1E7A': 'U',
2563
+ '\u016C': 'U',
2564
+ '\u00DC': 'U',
2565
+ '\u01DB': 'U',
2566
+ '\u01D7': 'U',
2567
+ '\u01D5': 'U',
2568
+ '\u01D9': 'U',
2569
+ '\u1EE6': 'U',
2570
+ '\u016E': 'U',
2571
+ '\u0170': 'U',
2572
+ '\u01D3': 'U',
2573
+ '\u0214': 'U',
2574
+ '\u0216': 'U',
2575
+ '\u01AF': 'U',
2576
+ '\u1EEA': 'U',
2577
+ '\u1EE8': 'U',
2578
+ '\u1EEE': 'U',
2579
+ '\u1EEC': 'U',
2580
+ '\u1EF0': 'U',
2581
+ '\u1EE4': 'U',
2582
+ '\u1E72': 'U',
2583
+ '\u0172': 'U',
2584
+ '\u1E76': 'U',
2585
+ '\u1E74': 'U',
2586
+ '\u0244': 'U',
2587
+ '\u24CB': 'V',
2588
+ '\uFF36': 'V',
2589
+ '\u1E7C': 'V',
2590
+ '\u1E7E': 'V',
2591
+ '\u01B2': 'V',
2592
+ '\uA75E': 'V',
2593
+ '\u0245': 'V',
2594
+ '\uA760': 'VY',
2595
+ '\u24CC': 'W',
2596
+ '\uFF37': 'W',
2597
+ '\u1E80': 'W',
2598
+ '\u1E82': 'W',
2599
+ '\u0174': 'W',
2600
+ '\u1E86': 'W',
2601
+ '\u1E84': 'W',
2602
+ '\u1E88': 'W',
2603
+ '\u2C72': 'W',
2604
+ '\u24CD': 'X',
2605
+ '\uFF38': 'X',
2606
+ '\u1E8A': 'X',
2607
+ '\u1E8C': 'X',
2608
+ '\u24CE': 'Y',
2609
+ '\uFF39': 'Y',
2610
+ '\u1EF2': 'Y',
2611
+ '\u00DD': 'Y',
2612
+ '\u0176': 'Y',
2613
+ '\u1EF8': 'Y',
2614
+ '\u0232': 'Y',
2615
+ '\u1E8E': 'Y',
2616
+ '\u0178': 'Y',
2617
+ '\u1EF6': 'Y',
2618
+ '\u1EF4': 'Y',
2619
+ '\u01B3': 'Y',
2620
+ '\u024E': 'Y',
2621
+ '\u1EFE': 'Y',
2622
+ '\u24CF': 'Z',
2623
+ '\uFF3A': 'Z',
2624
+ '\u0179': 'Z',
2625
+ '\u1E90': 'Z',
2626
+ '\u017B': 'Z',
2627
+ '\u017D': 'Z',
2628
+ '\u1E92': 'Z',
2629
+ '\u1E94': 'Z',
2630
+ '\u01B5': 'Z',
2631
+ '\u0224': 'Z',
2632
+ '\u2C7F': 'Z',
2633
+ '\u2C6B': 'Z',
2634
+ '\uA762': 'Z',
2635
+ '\u24D0': 'a',
2636
+ '\uFF41': 'a',
2637
+ '\u1E9A': 'a',
2638
+ '\u00E0': 'a',
2639
+ '\u00E1': 'a',
2640
+ '\u00E2': 'a',
2641
+ '\u1EA7': 'a',
2642
+ '\u1EA5': 'a',
2643
+ '\u1EAB': 'a',
2644
+ '\u1EA9': 'a',
2645
+ '\u00E3': 'a',
2646
+ '\u0101': 'a',
2647
+ '\u0103': 'a',
2648
+ '\u1EB1': 'a',
2649
+ '\u1EAF': 'a',
2650
+ '\u1EB5': 'a',
2651
+ '\u1EB3': 'a',
2652
+ '\u0227': 'a',
2653
+ '\u01E1': 'a',
2654
+ '\u00E4': 'a',
2655
+ '\u01DF': 'a',
2656
+ '\u1EA3': 'a',
2657
+ '\u00E5': 'a',
2658
+ '\u01FB': 'a',
2659
+ '\u01CE': 'a',
2660
+ '\u0201': 'a',
2661
+ '\u0203': 'a',
2662
+ '\u1EA1': 'a',
2663
+ '\u1EAD': 'a',
2664
+ '\u1EB7': 'a',
2665
+ '\u1E01': 'a',
2666
+ '\u0105': 'a',
2667
+ '\u2C65': 'a',
2668
+ '\u0250': 'a',
2669
+ '\uA733': 'aa',
2670
+ '\u00E6': 'ae',
2671
+ '\u01FD': 'ae',
2672
+ '\u01E3': 'ae',
2673
+ '\uA735': 'ao',
2674
+ '\uA737': 'au',
2675
+ '\uA739': 'av',
2676
+ '\uA73B': 'av',
2677
+ '\uA73D': 'ay',
2678
+ '\u24D1': 'b',
2679
+ '\uFF42': 'b',
2680
+ '\u1E03': 'b',
2681
+ '\u1E05': 'b',
2682
+ '\u1E07': 'b',
2683
+ '\u0180': 'b',
2684
+ '\u0183': 'b',
2685
+ '\u0253': 'b',
2686
+ '\u24D2': 'c',
2687
+ '\uFF43': 'c',
2688
+ '\u0107': 'c',
2689
+ '\u0109': 'c',
2690
+ '\u010B': 'c',
2691
+ '\u010D': 'c',
2692
+ '\u00E7': 'c',
2693
+ '\u1E09': 'c',
2694
+ '\u0188': 'c',
2695
+ '\u023C': 'c',
2696
+ '\uA73F': 'c',
2697
+ '\u2184': 'c',
2698
+ '\u24D3': 'd',
2699
+ '\uFF44': 'd',
2700
+ '\u1E0B': 'd',
2701
+ '\u010F': 'd',
2702
+ '\u1E0D': 'd',
2703
+ '\u1E11': 'd',
2704
+ '\u1E13': 'd',
2705
+ '\u1E0F': 'd',
2706
+ '\u0111': 'd',
2707
+ '\u018C': 'd',
2708
+ '\u0256': 'd',
2709
+ '\u0257': 'd',
2710
+ '\uA77A': 'd',
2711
+ '\u01F3': 'dz',
2712
+ '\u01C6': 'dz',
2713
+ '\u24D4': 'e',
2714
+ '\uFF45': 'e',
2715
+ '\u00E8': 'e',
2716
+ '\u00E9': 'e',
2717
+ '\u00EA': 'e',
2718
+ '\u1EC1': 'e',
2719
+ '\u1EBF': 'e',
2720
+ '\u1EC5': 'e',
2721
+ '\u1EC3': 'e',
2722
+ '\u1EBD': 'e',
2723
+ '\u0113': 'e',
2724
+ '\u1E15': 'e',
2725
+ '\u1E17': 'e',
2726
+ '\u0115': 'e',
2727
+ '\u0117': 'e',
2728
+ '\u00EB': 'e',
2729
+ '\u1EBB': 'e',
2730
+ '\u011B': 'e',
2731
+ '\u0205': 'e',
2732
+ '\u0207': 'e',
2733
+ '\u1EB9': 'e',
2734
+ '\u1EC7': 'e',
2735
+ '\u0229': 'e',
2736
+ '\u1E1D': 'e',
2737
+ '\u0119': 'e',
2738
+ '\u1E19': 'e',
2739
+ '\u1E1B': 'e',
2740
+ '\u0247': 'e',
2741
+ '\u025B': 'e',
2742
+ '\u01DD': 'e',
2743
+ '\u24D5': 'f',
2744
+ '\uFF46': 'f',
2745
+ '\u1E1F': 'f',
2746
+ '\u0192': 'f',
2747
+ '\uA77C': 'f',
2748
+ '\u24D6': 'g',
2749
+ '\uFF47': 'g',
2750
+ '\u01F5': 'g',
2751
+ '\u011D': 'g',
2752
+ '\u1E21': 'g',
2753
+ '\u011F': 'g',
2754
+ '\u0121': 'g',
2755
+ '\u01E7': 'g',
2756
+ '\u0123': 'g',
2757
+ '\u01E5': 'g',
2758
+ '\u0260': 'g',
2759
+ '\uA7A1': 'g',
2760
+ '\u1D79': 'g',
2761
+ '\uA77F': 'g',
2762
+ '\u24D7': 'h',
2763
+ '\uFF48': 'h',
2764
+ '\u0125': 'h',
2765
+ '\u1E23': 'h',
2766
+ '\u1E27': 'h',
2767
+ '\u021F': 'h',
2768
+ '\u1E25': 'h',
2769
+ '\u1E29': 'h',
2770
+ '\u1E2B': 'h',
2771
+ '\u1E96': 'h',
2772
+ '\u0127': 'h',
2773
+ '\u2C68': 'h',
2774
+ '\u2C76': 'h',
2775
+ '\u0265': 'h',
2776
+ '\u0195': 'hv',
2777
+ '\u24D8': 'i',
2778
+ '\uFF49': 'i',
2779
+ '\u00EC': 'i',
2780
+ '\u00ED': 'i',
2781
+ '\u00EE': 'i',
2782
+ '\u0129': 'i',
2783
+ '\u012B': 'i',
2784
+ '\u012D': 'i',
2785
+ '\u00EF': 'i',
2786
+ '\u1E2F': 'i',
2787
+ '\u1EC9': 'i',
2788
+ '\u01D0': 'i',
2789
+ '\u0209': 'i',
2790
+ '\u020B': 'i',
2791
+ '\u1ECB': 'i',
2792
+ '\u012F': 'i',
2793
+ '\u1E2D': 'i',
2794
+ '\u0268': 'i',
2795
+ '\u0131': 'i',
2796
+ '\u24D9': 'j',
2797
+ '\uFF4A': 'j',
2798
+ '\u0135': 'j',
2799
+ '\u01F0': 'j',
2800
+ '\u0249': 'j',
2801
+ '\u24DA': 'k',
2802
+ '\uFF4B': 'k',
2803
+ '\u1E31': 'k',
2804
+ '\u01E9': 'k',
2805
+ '\u1E33': 'k',
2806
+ '\u0137': 'k',
2807
+ '\u1E35': 'k',
2808
+ '\u0199': 'k',
2809
+ '\u2C6A': 'k',
2810
+ '\uA741': 'k',
2811
+ '\uA743': 'k',
2812
+ '\uA745': 'k',
2813
+ '\uA7A3': 'k',
2814
+ '\u24DB': 'l',
2815
+ '\uFF4C': 'l',
2816
+ '\u0140': 'l',
2817
+ '\u013A': 'l',
2818
+ '\u013E': 'l',
2819
+ '\u1E37': 'l',
2820
+ '\u1E39': 'l',
2821
+ '\u013C': 'l',
2822
+ '\u1E3D': 'l',
2823
+ '\u1E3B': 'l',
2824
+ '\u017F': 'l',
2825
+ '\u0142': 'l',
2826
+ '\u019A': 'l',
2827
+ '\u026B': 'l',
2828
+ '\u2C61': 'l',
2829
+ '\uA749': 'l',
2830
+ '\uA781': 'l',
2831
+ '\uA747': 'l',
2832
+ '\u01C9': 'lj',
2833
+ '\u24DC': 'm',
2834
+ '\uFF4D': 'm',
2835
+ '\u1E3F': 'm',
2836
+ '\u1E41': 'm',
2837
+ '\u1E43': 'm',
2838
+ '\u0271': 'm',
2839
+ '\u026F': 'm',
2840
+ '\u24DD': 'n',
2841
+ '\uFF4E': 'n',
2842
+ '\u01F9': 'n',
2843
+ '\u0144': 'n',
2844
+ '\u00F1': 'n',
2845
+ '\u1E45': 'n',
2846
+ '\u0148': 'n',
2847
+ '\u1E47': 'n',
2848
+ '\u0146': 'n',
2849
+ '\u1E4B': 'n',
2850
+ '\u1E49': 'n',
2851
+ '\u019E': 'n',
2852
+ '\u0272': 'n',
2853
+ '\u0149': 'n',
2854
+ '\uA791': 'n',
2855
+ '\uA7A5': 'n',
2856
+ '\u01CC': 'nj',
2857
+ '\u24DE': 'o',
2858
+ '\uFF4F': 'o',
2859
+ '\u00F2': 'o',
2860
+ '\u00F3': 'o',
2861
+ '\u00F4': 'o',
2862
+ '\u1ED3': 'o',
2863
+ '\u1ED1': 'o',
2864
+ '\u1ED7': 'o',
2865
+ '\u1ED5': 'o',
2866
+ '\u00F5': 'o',
2867
+ '\u1E4D': 'o',
2868
+ '\u022D': 'o',
2869
+ '\u1E4F': 'o',
2870
+ '\u014D': 'o',
2871
+ '\u1E51': 'o',
2872
+ '\u1E53': 'o',
2873
+ '\u014F': 'o',
2874
+ '\u022F': 'o',
2875
+ '\u0231': 'o',
2876
+ '\u00F6': 'o',
2877
+ '\u022B': 'o',
2878
+ '\u1ECF': 'o',
2879
+ '\u0151': 'o',
2880
+ '\u01D2': 'o',
2881
+ '\u020D': 'o',
2882
+ '\u020F': 'o',
2883
+ '\u01A1': 'o',
2884
+ '\u1EDD': 'o',
2885
+ '\u1EDB': 'o',
2886
+ '\u1EE1': 'o',
2887
+ '\u1EDF': 'o',
2888
+ '\u1EE3': 'o',
2889
+ '\u1ECD': 'o',
2890
+ '\u1ED9': 'o',
2891
+ '\u01EB': 'o',
2892
+ '\u01ED': 'o',
2893
+ '\u00F8': 'o',
2894
+ '\u01FF': 'o',
2895
+ '\u0254': 'o',
2896
+ '\uA74B': 'o',
2897
+ '\uA74D': 'o',
2898
+ '\u0275': 'o',
2899
+ '\u01A3': 'oi',
2900
+ '\u0223': 'ou',
2901
+ '\uA74F': 'oo',
2902
+ '\u24DF': 'p',
2903
+ '\uFF50': 'p',
2904
+ '\u1E55': 'p',
2905
+ '\u1E57': 'p',
2906
+ '\u01A5': 'p',
2907
+ '\u1D7D': 'p',
2908
+ '\uA751': 'p',
2909
+ '\uA753': 'p',
2910
+ '\uA755': 'p',
2911
+ '\u24E0': 'q',
2912
+ '\uFF51': 'q',
2913
+ '\u024B': 'q',
2914
+ '\uA757': 'q',
2915
+ '\uA759': 'q',
2916
+ '\u24E1': 'r',
2917
+ '\uFF52': 'r',
2918
+ '\u0155': 'r',
2919
+ '\u1E59': 'r',
2920
+ '\u0159': 'r',
2921
+ '\u0211': 'r',
2922
+ '\u0213': 'r',
2923
+ '\u1E5B': 'r',
2924
+ '\u1E5D': 'r',
2925
+ '\u0157': 'r',
2926
+ '\u1E5F': 'r',
2927
+ '\u024D': 'r',
2928
+ '\u027D': 'r',
2929
+ '\uA75B': 'r',
2930
+ '\uA7A7': 'r',
2931
+ '\uA783': 'r',
2932
+ '\u24E2': 's',
2933
+ '\uFF53': 's',
2934
+ '\u00DF': 's',
2935
+ '\u015B': 's',
2936
+ '\u1E65': 's',
2937
+ '\u015D': 's',
2938
+ '\u1E61': 's',
2939
+ '\u0161': 's',
2940
+ '\u1E67': 's',
2941
+ '\u1E63': 's',
2942
+ '\u1E69': 's',
2943
+ '\u0219': 's',
2944
+ '\u015F': 's',
2945
+ '\u023F': 's',
2946
+ '\uA7A9': 's',
2947
+ '\uA785': 's',
2948
+ '\u1E9B': 's',
2949
+ '\u24E3': 't',
2950
+ '\uFF54': 't',
2951
+ '\u1E6B': 't',
2952
+ '\u1E97': 't',
2953
+ '\u0165': 't',
2954
+ '\u1E6D': 't',
2955
+ '\u021B': 't',
2956
+ '\u0163': 't',
2957
+ '\u1E71': 't',
2958
+ '\u1E6F': 't',
2959
+ '\u0167': 't',
2960
+ '\u01AD': 't',
2961
+ '\u0288': 't',
2962
+ '\u2C66': 't',
2963
+ '\uA787': 't',
2964
+ '\uA729': 'tz',
2965
+ '\u24E4': 'u',
2966
+ '\uFF55': 'u',
2967
+ '\u00F9': 'u',
2968
+ '\u00FA': 'u',
2969
+ '\u00FB': 'u',
2970
+ '\u0169': 'u',
2971
+ '\u1E79': 'u',
2972
+ '\u016B': 'u',
2973
+ '\u1E7B': 'u',
2974
+ '\u016D': 'u',
2975
+ '\u00FC': 'u',
2976
+ '\u01DC': 'u',
2977
+ '\u01D8': 'u',
2978
+ '\u01D6': 'u',
2979
+ '\u01DA': 'u',
2980
+ '\u1EE7': 'u',
2981
+ '\u016F': 'u',
2982
+ '\u0171': 'u',
2983
+ '\u01D4': 'u',
2984
+ '\u0215': 'u',
2985
+ '\u0217': 'u',
2986
+ '\u01B0': 'u',
2987
+ '\u1EEB': 'u',
2988
+ '\u1EE9': 'u',
2989
+ '\u1EEF': 'u',
2990
+ '\u1EED': 'u',
2991
+ '\u1EF1': 'u',
2992
+ '\u1EE5': 'u',
2993
+ '\u1E73': 'u',
2994
+ '\u0173': 'u',
2995
+ '\u1E77': 'u',
2996
+ '\u1E75': 'u',
2997
+ '\u0289': 'u',
2998
+ '\u24E5': 'v',
2999
+ '\uFF56': 'v',
3000
+ '\u1E7D': 'v',
3001
+ '\u1E7F': 'v',
3002
+ '\u028B': 'v',
3003
+ '\uA75F': 'v',
3004
+ '\u028C': 'v',
3005
+ '\uA761': 'vy',
3006
+ '\u24E6': 'w',
3007
+ '\uFF57': 'w',
3008
+ '\u1E81': 'w',
3009
+ '\u1E83': 'w',
3010
+ '\u0175': 'w',
3011
+ '\u1E87': 'w',
3012
+ '\u1E85': 'w',
3013
+ '\u1E98': 'w',
3014
+ '\u1E89': 'w',
3015
+ '\u2C73': 'w',
3016
+ '\u24E7': 'x',
3017
+ '\uFF58': 'x',
3018
+ '\u1E8B': 'x',
3019
+ '\u1E8D': 'x',
3020
+ '\u24E8': 'y',
3021
+ '\uFF59': 'y',
3022
+ '\u1EF3': 'y',
3023
+ '\u00FD': 'y',
3024
+ '\u0177': 'y',
3025
+ '\u1EF9': 'y',
3026
+ '\u0233': 'y',
3027
+ '\u1E8F': 'y',
3028
+ '\u00FF': 'y',
3029
+ '\u1EF7': 'y',
3030
+ '\u1E99': 'y',
3031
+ '\u1EF5': 'y',
3032
+ '\u01B4': 'y',
3033
+ '\u024F': 'y',
3034
+ '\u1EFF': 'y',
3035
+ '\u24E9': 'z',
3036
+ '\uFF5A': 'z',
3037
+ '\u017A': 'z',
3038
+ '\u1E91': 'z',
3039
+ '\u017C': 'z',
3040
+ '\u017E': 'z',
3041
+ '\u1E93': 'z',
3042
+ '\u1E95': 'z',
3043
+ '\u01B6': 'z',
3044
+ '\u0225': 'z',
3045
+ '\u0240': 'z',
3046
+ '\u2C6C': 'z',
3047
+ '\uA763': 'z',
3048
+ '\u0386': '\u0391',
3049
+ '\u0388': '\u0395',
3050
+ '\u0389': '\u0397',
3051
+ '\u038A': '\u0399',
3052
+ '\u03AA': '\u0399',
3053
+ '\u038C': '\u039F',
3054
+ '\u038E': '\u03A5',
3055
+ '\u03AB': '\u03A5',
3056
+ '\u038F': '\u03A9',
3057
+ '\u03AC': '\u03B1',
3058
+ '\u03AD': '\u03B5',
3059
+ '\u03AE': '\u03B7',
3060
+ '\u03AF': '\u03B9',
3061
+ '\u03CA': '\u03B9',
3062
+ '\u0390': '\u03B9',
3063
+ '\u03CC': '\u03BF',
3064
+ '\u03CD': '\u03C5',
3065
+ '\u03CB': '\u03C5',
3066
+ '\u03B0': '\u03C5',
3067
+ '\u03C9': '\u03C9',
3068
+ '\u03C2': '\u03C3'
3069
+ };
3070
+
3071
+ return diacritics;
3072
+ });
3073
+
3074
+ S2.define('select2/data/base',[
3075
+ '../utils'
3076
+ ], function (Utils) {
3077
+ function BaseAdapter ($element, options) {
3078
+ BaseAdapter.__super__.constructor.call(this);
3079
+ }
3080
+
3081
+ Utils.Extend(BaseAdapter, Utils.Observable);
3082
+
3083
+ BaseAdapter.prototype.current = function (callback) {
3084
+ throw new Error('The `current` method must be defined in child classes.');
3085
+ };
3086
+
3087
+ BaseAdapter.prototype.query = function (params, callback) {
3088
+ throw new Error('The `query` method must be defined in child classes.');
3089
+ };
3090
+
3091
+ BaseAdapter.prototype.bind = function (container, $container) {
3092
+ // Can be implemented in subclasses
3093
+ };
3094
+
3095
+ BaseAdapter.prototype.destroy = function () {
3096
+ // Can be implemented in subclasses
3097
+ };
3098
+
3099
+ BaseAdapter.prototype.generateResultId = function (container, data) {
3100
+ var id = '';
3101
+
3102
+ if (container != null) {
3103
+ id += container.id
3104
+ } else {
3105
+ id += Utils.generateChars(4);
3106
+ }
3107
+
3108
+ id += '-result-';
3109
+ id += Utils.generateChars(4);
3110
+
3111
+ if (data.id != null) {
3112
+ id += '-' + data.id.toString();
3113
+ } else {
3114
+ id += '-' + Utils.generateChars(4);
3115
+ }
3116
+ return id;
3117
+ };
3118
+
3119
+ return BaseAdapter;
3120
+ });
3121
+
3122
+ S2.define('select2/data/select',[
3123
+ './base',
3124
+ '../utils',
3125
+ 'jquery'
3126
+ ], function (BaseAdapter, Utils, $) {
3127
+ function SelectAdapter ($element, options) {
3128
+ this.$element = $element;
3129
+ this.options = options;
3130
+
3131
+ SelectAdapter.__super__.constructor.call(this);
3132
+ }
3133
+
3134
+ Utils.Extend(SelectAdapter, BaseAdapter);
3135
+
3136
+ SelectAdapter.prototype.current = function (callback) {
3137
+ var data = [];
3138
+ var self = this;
3139
+
3140
+ this.$element.find(':selected').each(function () {
3141
+ var $option = $(this);
3142
+
3143
+ var option = self.item($option);
3144
+
3145
+ data.push(option);
3146
+ });
3147
+
3148
+ callback(data);
3149
+ };
3150
+
3151
+ SelectAdapter.prototype.select = function (data) {
3152
+ var self = this;
3153
+
3154
+ data.selected = true;
3155
+
3156
+ // If data.element is a DOM node, use it instead
3157
+ if ($(data.element).is('option')) {
3158
+ data.element.selected = true;
3159
+
3160
+ this.$element.trigger('change');
3161
+
3162
+ return;
3163
+ }
3164
+
3165
+ if (this.$element.prop('multiple')) {
3166
+ this.current(function (currentData) {
3167
+ var val = [];
3168
+
3169
+ data = [data];
3170
+ data.push.apply(data, currentData);
3171
+
3172
+ for (var d = 0; d < data.length; d++) {
3173
+ var id = data[d].id;
3174
+
3175
+ if ($.inArray(id, val) === -1) {
3176
+ val.push(id);
3177
+ }
3178
+ }
3179
+
3180
+ self.$element.val(val);
3181
+ self.$element.trigger('change');
3182
+ });
3183
+ } else {
3184
+ var val = data.id;
3185
+
3186
+ this.$element.val(val);
3187
+ this.$element.trigger('change');
3188
+ }
3189
+ };
3190
+
3191
+ SelectAdapter.prototype.unselect = function (data) {
3192
+ var self = this;
3193
+
3194
+ if (!this.$element.prop('multiple')) {
3195
+ return;
3196
+ }
3197
+
3198
+ data.selected = false;
3199
+
3200
+ if ($(data.element).is('option')) {
3201
+ data.element.selected = false;
3202
+
3203
+ this.$element.trigger('change');
3204
+
3205
+ return;
3206
+ }
3207
+
3208
+ this.current(function (currentData) {
3209
+ var val = [];
3210
+
3211
+ for (var d = 0; d < currentData.length; d++) {
3212
+ var id = currentData[d].id;
3213
+
3214
+ if (id !== data.id && $.inArray(id, val) === -1) {
3215
+ val.push(id);
3216
+ }
3217
+ }
3218
+
3219
+ self.$element.val(val);
3220
+
3221
+ self.$element.trigger('change');
3222
+ });
3223
+ };
3224
+
3225
+ SelectAdapter.prototype.bind = function (container, $container) {
3226
+ var self = this;
3227
+
3228
+ this.container = container;
3229
+
3230
+ container.on('select', function (params) {
3231
+ self.select(params.data);
3232
+ });
3233
+
3234
+ container.on('unselect', function (params) {
3235
+ self.unselect(params.data);
3236
+ });
3237
+ };
3238
+
3239
+ SelectAdapter.prototype.destroy = function () {
3240
+ // Remove anything added to child elements
3241
+ this.$element.find('*').each(function () {
3242
+ // Remove any custom data set by Select2
3243
+ $.removeData(this, 'data');
3244
+ });
3245
+ };
3246
+
3247
+ SelectAdapter.prototype.query = function (params, callback) {
3248
+ var data = [];
3249
+ var self = this;
3250
+
3251
+ var $options = this.$element.children();
3252
+
3253
+ $options.each(function () {
3254
+ var $option = $(this);
3255
+
3256
+ if (!$option.is('option') && !$option.is('optgroup')) {
3257
+ return;
3258
+ }
3259
+
3260
+ var option = self.item($option);
3261
+
3262
+ var matches = self.matches(params, option);
3263
+
3264
+ if (matches !== null) {
3265
+ data.push(matches);
3266
+ }
3267
+ });
3268
+
3269
+ callback({
3270
+ results: data
3271
+ });
3272
+ };
3273
+
3274
+ SelectAdapter.prototype.addOptions = function ($options) {
3275
+ Utils.appendMany(this.$element, $options);
3276
+ };
3277
+
3278
+ SelectAdapter.prototype.option = function (data) {
3279
+ var option;
3280
+
3281
+ if (data.children) {
3282
+ option = document.createElement('optgroup');
3283
+ option.label = data.text;
3284
+ } else {
3285
+ option = document.createElement('option');
3286
+
3287
+ if (option.textContent !== undefined) {
3288
+ option.textContent = data.text;
3289
+ } else {
3290
+ option.innerText = data.text;
3291
+ }
3292
+ }
3293
+
3294
+ if (data.id !== undefined) {
3295
+ option.value = data.id;
3296
+ }
3297
+
3298
+ if (data.disabled) {
3299
+ option.disabled = true;
3300
+ }
3301
+
3302
+ if (data.selected) {
3303
+ option.selected = true;
3304
+ }
3305
+
3306
+ if (data.title) {
3307
+ option.title = data.title;
3308
+ }
3309
+
3310
+ var $option = $(option);
3311
+
3312
+ var normalizedData = this._normalizeItem(data);
3313
+ normalizedData.element = option;
3314
+
3315
+ // Override the option's data with the combined data
3316
+ $.data(option, 'data', normalizedData);
3317
+
3318
+ return $option;
3319
+ };
3320
+
3321
+ SelectAdapter.prototype.item = function ($option) {
3322
+ var data = {};
3323
+
3324
+ data = $.data($option[0], 'data');
3325
+
3326
+ if (data != null) {
3327
+ return data;
3328
+ }
3329
+
3330
+ if ($option.is('option')) {
3331
+ data = {
3332
+ id: $option.val(),
3333
+ text: $option.text(),
3334
+ disabled: $option.prop('disabled'),
3335
+ selected: $option.prop('selected'),
3336
+ title: $option.prop('title')
3337
+ };
3338
+ } else if ($option.is('optgroup')) {
3339
+ data = {
3340
+ text: $option.prop('label'),
3341
+ children: [],
3342
+ title: $option.prop('title')
3343
+ };
3344
+
3345
+ var $children = $option.children('option');
3346
+ var children = [];
3347
+
3348
+ for (var c = 0; c < $children.length; c++) {
3349
+ var $child = $($children[c]);
3350
+
3351
+ var child = this.item($child);
3352
+
3353
+ children.push(child);
3354
+ }
3355
+
3356
+ data.children = children;
3357
+ }
3358
+
3359
+ data = this._normalizeItem(data);
3360
+ data.element = $option[0];
3361
+
3362
+ $.data($option[0], 'data', data);
3363
+
3364
+ return data;
3365
+ };
3366
+
3367
+ SelectAdapter.prototype._normalizeItem = function (item) {
3368
+ if (!$.isPlainObject(item)) {
3369
+ item = {
3370
+ id: item,
3371
+ text: item
3372
+ };
3373
+ }
3374
+
3375
+ item = $.extend({}, {
3376
+ text: ''
3377
+ }, item);
3378
+
3379
+ var defaults = {
3380
+ selected: false,
3381
+ disabled: false
3382
+ };
3383
+
3384
+ if (item.id != null) {
3385
+ item.id = item.id.toString();
3386
+ }
3387
+
3388
+ if (item.text != null) {
3389
+ item.text = item.text.toString();
3390
+ }
3391
+
3392
+ if (item._resultId == null && item.id) {
3393
+ item._resultId = this.generateResultId(this.container, item);
3394
+ }
3395
+
3396
+ return $.extend({}, defaults, item);
3397
+ };
3398
+
3399
+ SelectAdapter.prototype.matches = function (params, data) {
3400
+ var matcher = this.options.get('matcher');
3401
+
3402
+ return matcher(params, data);
3403
+ };
3404
+
3405
+ return SelectAdapter;
3406
+ });
3407
+
3408
+ S2.define('select2/data/array',[
3409
+ './select',
3410
+ '../utils',
3411
+ 'jquery'
3412
+ ], function (SelectAdapter, Utils, $) {
3413
+ function ArrayAdapter ($element, options) {
3414
+ var data = options.get('data') || [];
3415
+
3416
+ ArrayAdapter.__super__.constructor.call(this, $element, options);
3417
+
3418
+ this.addOptions(this.convertToOptions(data));
3419
+ }
3420
+
3421
+ Utils.Extend(ArrayAdapter, SelectAdapter);
3422
+
3423
+ ArrayAdapter.prototype.select = function (data) {
3424
+ var $option = this.$element.find('option').filter(function (i, elm) {
3425
+ return elm.value == data.id.toString();
3426
+ });
3427
+
3428
+ if ($option.length === 0) {
3429
+ $option = this.option(data);
3430
+
3431
+ this.addOptions($option);
3432
+ }
3433
+
3434
+ ArrayAdapter.__super__.select.call(this, data);
3435
+ };
3436
+
3437
+ ArrayAdapter.prototype.convertToOptions = function (data) {
3438
+ var self = this;
3439
+
3440
+ var $existing = this.$element.find('option');
3441
+ var existingIds = $existing.map(function () {
3442
+ return self.item($(this)).id;
3443
+ }).get();
3444
+
3445
+ var $options = [];
3446
+
3447
+ // Filter out all items except for the one passed in the argument
3448
+ function onlyItem (item) {
3449
+ return function () {
3450
+ return $(this).val() == item.id;
3451
+ };
3452
+ }
3453
+
3454
+ for (var d = 0; d < data.length; d++) {
3455
+ var item = this._normalizeItem(data[d]);
3456
+
3457
+ // Skip items which were pre-loaded, only merge the data
3458
+ if ($.inArray(item.id, existingIds) >= 0) {
3459
+ var $existingOption = $existing.filter(onlyItem(item));
3460
+
3461
+ var existingData = this.item($existingOption);
3462
+ var newData = $.extend(true, {}, item, existingData);
3463
+
3464
+ var $newOption = this.option(newData);
3465
+
3466
+ $existingOption.replaceWith($newOption);
3467
+
3468
+ continue;
3469
+ }
3470
+
3471
+ var $option = this.option(item);
3472
+
3473
+ if (item.children) {
3474
+ var $children = this.convertToOptions(item.children);
3475
+
3476
+ Utils.appendMany($option, $children);
3477
+ }
3478
+
3479
+ $options.push($option);
3480
+ }
3481
+
3482
+ return $options;
3483
+ };
3484
+
3485
+ return ArrayAdapter;
3486
+ });
3487
+
3488
+ S2.define('select2/data/ajax',[
3489
+ './array',
3490
+ '../utils',
3491
+ 'jquery'
3492
+ ], function (ArrayAdapter, Utils, $) {
3493
+ function AjaxAdapter ($element, options) {
3494
+ this.ajaxOptions = this._applyDefaults(options.get('ajax'));
3495
+
3496
+ if (this.ajaxOptions.processResults != null) {
3497
+ this.processResults = this.ajaxOptions.processResults;
3498
+ }
3499
+
3500
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
3501
+ }
3502
+
3503
+ Utils.Extend(AjaxAdapter, ArrayAdapter);
3504
+
3505
+ AjaxAdapter.prototype._applyDefaults = function (options) {
3506
+ var defaults = {
3507
+ data: function (params) {
3508
+ return $.extend({}, params, {
3509
+ q: params.term
3510
+ });
3511
+ },
3512
+ transport: function (params, success, failure) {
3513
+ var $request = $.ajax(params);
3514
+
3515
+ $request.then(success);
3516
+ $request.fail(failure);
3517
+
3518
+ return $request;
3519
+ }
3520
+ };
3521
+
3522
+ return $.extend({}, defaults, options, true);
3523
+ };
3524
+
3525
+ AjaxAdapter.prototype.processResults = function (results) {
3526
+ return results;
3527
+ };
3528
+
3529
+ AjaxAdapter.prototype.query = function (params, callback) {
3530
+ var matches = [];
3531
+ var self = this;
3532
+
3533
+ if (this._request != null) {
3534
+ // JSONP requests cannot always be aborted
3535
+ if ($.isFunction(this._request.abort)) {
3536
+ this._request.abort();
3537
+ }
3538
+
3539
+ this._request = null;
3540
+ }
3541
+
3542
+ var options = $.extend({
3543
+ type: 'GET'
3544
+ }, this.ajaxOptions);
3545
+
3546
+ if (typeof options.url === 'function') {
3547
+ options.url = options.url.call(this.$element, params);
3548
+ }
3549
+
3550
+ if (typeof options.data === 'function') {
3551
+ options.data = options.data.call(this.$element, params);
3552
+ }
3553
+
3554
+ function request () {
3555
+ var $request = options.transport(options, function (data) {
3556
+ var results = self.processResults(data, params);
3557
+
3558
+ if (self.options.get('debug') && window.console && console.error) {
3559
+ // Check to make sure that the response included a `results` key.
3560
+ if (!results || !results.results || !$.isArray(results.results)) {
3561
+ console.error(
3562
+ 'Select2: The AJAX results did not return an array in the ' +
3563
+ '`results` key of the response.'
3564
+ );
3565
+ }
3566
+ }
3567
+
3568
+ callback(results);
3569
+ self.container.focusOnActiveElement();
3570
+ }, function () {
3571
+ // Attempt to detect if a request was aborted
3572
+ // Only works if the transport exposes a status property
3573
+ if ($request.status && $request.status === '0') {
3574
+ return;
3575
+ }
3576
+
3577
+ self.trigger('results:message', {
3578
+ message: 'errorLoading'
3579
+ });
3580
+ });
3581
+
3582
+ self._request = $request;
3583
+ }
3584
+
3585
+ if (this.ajaxOptions.delay && params.term != null) {
3586
+ if (this._queryTimeout) {
3587
+ window.clearTimeout(this._queryTimeout);
3588
+ }
3589
+
3590
+ this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
3591
+ } else {
3592
+ request();
3593
+ }
3594
+ };
3595
+
3596
+ return AjaxAdapter;
3597
+ });
3598
+
3599
+ S2.define('select2/data/tags',[
3600
+ 'jquery'
3601
+ ], function ($) {
3602
+ function Tags (decorated, $element, options) {
3603
+ var tags = options.get('tags');
3604
+
3605
+ var createTag = options.get('createTag');
3606
+
3607
+ if (createTag !== undefined) {
3608
+ this.createTag = createTag;
3609
+ }
3610
+
3611
+ var insertTag = options.get('insertTag');
3612
+
3613
+ if (insertTag !== undefined) {
3614
+ this.insertTag = insertTag;
3615
+ }
3616
+
3617
+ decorated.call(this, $element, options);
3618
+
3619
+ if ($.isArray(tags)) {
3620
+ for (var t = 0; t < tags.length; t++) {
3621
+ var tag = tags[t];
3622
+ var item = this._normalizeItem(tag);
3623
+
3624
+ var $option = this.option(item);
3625
+
3626
+ this.$element.append($option);
3627
+ }
3628
+ }
3629
+ }
3630
+
3631
+ Tags.prototype.query = function (decorated, params, callback) {
3632
+ var self = this;
3633
+
3634
+ this._removeOldTags();
3635
+
3636
+ if (params.term == null || params.page != null) {
3637
+ decorated.call(this, params, callback);
3638
+ return;
3639
+ }
3640
+
3641
+ function wrapper (obj, child) {
3642
+ var data = obj.results;
3643
+
3644
+ for (var i = 0; i < data.length; i++) {
3645
+ var option = data[i];
3646
+
3647
+ var checkChildren = (
3648
+ option.children != null &&
3649
+ !wrapper({
3650
+ results: option.children
3651
+ }, true)
3652
+ );
3653
+
3654
+ var optionText = (option.text || '').toUpperCase();
3655
+ var paramsTerm = (params.term || '').toUpperCase();
3656
+
3657
+ var checkText = optionText === paramsTerm;
3658
+
3659
+ if (checkText || checkChildren) {
3660
+ if (child) {
3661
+ return false;
3662
+ }
3663
+
3664
+ obj.data = data;
3665
+ callback(obj);
3666
+
3667
+ return;
3668
+ }
3669
+ }
3670
+
3671
+ if (child) {
3672
+ return true;
3673
+ }
3674
+
3675
+ var tag = self.createTag(params);
3676
+
3677
+ if (tag != null) {
3678
+ var $option = self.option(tag);
3679
+ $option.attr('data-select2-tag', true);
3680
+
3681
+ self.addOptions([$option]);
3682
+
3683
+ self.insertTag(data, tag);
3684
+ }
3685
+
3686
+ obj.results = data;
3687
+
3688
+ callback(obj);
3689
+ }
3690
+
3691
+ decorated.call(this, params, wrapper);
3692
+ };
3693
+
3694
+ Tags.prototype.createTag = function (decorated, params) {
3695
+ var term = $.trim(params.term);
3696
+
3697
+ if (term === '') {
3698
+ return null;
3699
+ }
3700
+
3701
+ return {
3702
+ id: term,
3703
+ text: term
3704
+ };
3705
+ };
3706
+
3707
+ Tags.prototype.insertTag = function (_, data, tag) {
3708
+ data.unshift(tag);
3709
+ };
3710
+
3711
+ Tags.prototype._removeOldTags = function (_) {
3712
+ var tag = this._lastTag;
3713
+
3714
+ var $options = this.$element.find('option[data-select2-tag]');
3715
+
3716
+ $options.each(function () {
3717
+ if (this.selected) {
3718
+ return;
3719
+ }
3720
+
3721
+ $(this).remove();
3722
+ });
3723
+ };
3724
+
3725
+ return Tags;
3726
+ });
3727
+
3728
+ S2.define('select2/data/tokenizer',[
3729
+ 'jquery'
3730
+ ], function ($) {
3731
+ function Tokenizer (decorated, $element, options) {
3732
+ var tokenizer = options.get('tokenizer');
3733
+
3734
+ if (tokenizer !== undefined) {
3735
+ this.tokenizer = tokenizer;
3736
+ }
3737
+
3738
+ decorated.call(this, $element, options);
3739
+ }
3740
+
3741
+ Tokenizer.prototype.bind = function (decorated, container, $container) {
3742
+ decorated.call(this, container, $container);
3743
+
3744
+ this.$search = container.dropdown.$search || container.selection.$search ||
3745
+ $container.find('.select2-search__field');
3746
+ };
3747
+
3748
+ Tokenizer.prototype.query = function (decorated, params, callback) {
3749
+ var self = this;
3750
+
3751
+ function createAndSelect (data) {
3752
+ // Normalize the data object so we can use it for checks
3753
+ var item = self._normalizeItem(data);
3754
+
3755
+ // Check if the data object already exists as a tag
3756
+ // Select it if it doesn't
3757
+ var $existingOptions = self.$element.find('option').filter(function () {
3758
+ return $(this).val() === item.id;
3759
+ });
3760
+
3761
+ // If an existing option wasn't found for it, create the option
3762
+ if (!$existingOptions.length) {
3763
+ var $option = self.option(item);
3764
+ $option.attr('data-select2-tag', true);
3765
+
3766
+ self._removeOldTags();
3767
+ self.addOptions([$option]);
3768
+ }
3769
+
3770
+ // Select the item, now that we know there is an option for it
3771
+ select(item);
3772
+ }
3773
+
3774
+ function select (data) {
3775
+ self.trigger('select', {
3776
+ data: data
3777
+ });
3778
+ }
3779
+
3780
+ params.term = params.term || '';
3781
+
3782
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
3783
+
3784
+ if (tokenData.term !== params.term) {
3785
+ // Replace the search term if we have the search box
3786
+ if (this.$search.length) {
3787
+ this.$search.val(tokenData.term);
3788
+ this.$search.focus();
3789
+ }
3790
+
3791
+ params.term = tokenData.term;
3792
+ }
3793
+
3794
+ decorated.call(this, params, callback);
3795
+ };
3796
+
3797
+ Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
3798
+ var separators = options.get('tokenSeparators') || [];
3799
+ var term = params.term;
3800
+ var i = 0;
3801
+
3802
+ var createTag = this.createTag || function (params) {
3803
+ return {
3804
+ id: params.term,
3805
+ text: params.term
3806
+ };
3807
+ };
3808
+
3809
+ while (i < term.length) {
3810
+ var termChar = term[i];
3811
+
3812
+ if ($.inArray(termChar, separators) === -1) {
3813
+ i++;
3814
+
3815
+ continue;
3816
+ }
3817
+
3818
+ var part = term.substr(0, i);
3819
+ var partParams = $.extend({}, params, {
3820
+ term: part
3821
+ });
3822
+
3823
+ var data = createTag(partParams);
3824
+
3825
+ if (data == null) {
3826
+ i++;
3827
+ continue;
3828
+ }
3829
+
3830
+ callback(data);
3831
+
3832
+ // Reset the term to not include the tokenized portion
3833
+ term = term.substr(i + 1) || '';
3834
+ i = 0;
3835
+ }
3836
+
3837
+ return {
3838
+ term: term
3839
+ };
3840
+ };
3841
+
3842
+ return Tokenizer;
3843
+ });
3844
+
3845
+ S2.define('select2/data/minimumInputLength',[
3846
+
3847
+ ], function () {
3848
+ function MinimumInputLength (decorated, $e, options) {
3849
+ this.minimumInputLength = options.get('minimumInputLength');
3850
+
3851
+ decorated.call(this, $e, options);
3852
+ }
3853
+
3854
+ MinimumInputLength.prototype.query = function (decorated, params, callback) {
3855
+ params.term = params.term || '';
3856
+
3857
+ if (params.term.length < this.minimumInputLength) {
3858
+ this.trigger('results:message', {
3859
+ message: 'inputTooShort',
3860
+ args: {
3861
+ minimum: this.minimumInputLength,
3862
+ input: params.term,
3863
+ params: params
3864
+ }
3865
+ });
3866
+
3867
+ return;
3868
+ }
3869
+
3870
+ decorated.call(this, params, callback);
3871
+ };
3872
+
3873
+ return MinimumInputLength;
3874
+ });
3875
+
3876
+ S2.define('select2/data/maximumInputLength',[
3877
+
3878
+ ], function () {
3879
+ function MaximumInputLength (decorated, $e, options) {
3880
+ this.maximumInputLength = options.get('maximumInputLength');
3881
+
3882
+ decorated.call(this, $e, options);
3883
+ }
3884
+
3885
+ MaximumInputLength.prototype.query = function (decorated, params, callback) {
3886
+ params.term = params.term || '';
3887
+
3888
+ if (this.maximumInputLength > 0 &&
3889
+ params.term.length > this.maximumInputLength) {
3890
+ this.trigger('results:message', {
3891
+ message: 'inputTooLong',
3892
+ args: {
3893
+ maximum: this.maximumInputLength,
3894
+ input: params.term,
3895
+ params: params
3896
+ }
3897
+ });
3898
+
3899
+ return;
3900
+ }
3901
+
3902
+ decorated.call(this, params, callback);
3903
+ };
3904
+
3905
+ return MaximumInputLength;
3906
+ });
3907
+
3908
+ S2.define('select2/data/maximumSelectionLength',[
3909
+
3910
+ ], function (){
3911
+ function MaximumSelectionLength (decorated, $e, options) {
3912
+ this.maximumSelectionLength = options.get('maximumSelectionLength');
3913
+
3914
+ decorated.call(this, $e, options);
3915
+ }
3916
+
3917
+ MaximumSelectionLength.prototype.query =
3918
+ function (decorated, params, callback) {
3919
+ var self = this;
3920
+
3921
+ this.current(function (currentData) {
3922
+ var count = currentData != null ? currentData.length : 0;
3923
+ if (self.maximumSelectionLength > 0 &&
3924
+ count >= self.maximumSelectionLength) {
3925
+ self.trigger('results:message', {
3926
+ message: 'maximumSelected',
3927
+ args: {
3928
+ maximum: self.maximumSelectionLength
3929
+ }
3930
+ });
3931
+ return;
3932
+ }
3933
+ decorated.call(self, params, callback);
3934
+ });
3935
+ };
3936
+
3937
+ return MaximumSelectionLength;
3938
+ });
3939
+
3940
+ S2.define('select2/dropdown',[
3941
+ 'jquery',
3942
+ './utils'
3943
+ ], function ($, Utils) {
3944
+ function Dropdown ($element, options) {
3945
+ this.$element = $element;
3946
+ this.options = options;
3947
+
3948
+ Dropdown.__super__.constructor.call(this);
3949
+ }
3950
+
3951
+ Utils.Extend(Dropdown, Utils.Observable);
3952
+
3953
+ Dropdown.prototype.render = function () {
3954
+ var $dropdown = $(
3955
+ '<span class="select2-dropdown">' +
3956
+ '<span class="select2-results"></span>' +
3957
+ '</span>'
3958
+ );
3959
+
3960
+ $dropdown.attr('dir', this.options.get('dir'));
3961
+
3962
+ this.$dropdown = $dropdown;
3963
+
3964
+ return $dropdown;
3965
+ };
3966
+
3967
+ Dropdown.prototype.bind = function () {
3968
+ // Should be implemented in subclasses
3969
+ };
3970
+
3971
+ Dropdown.prototype.position = function ($dropdown, $container) {
3972
+ // Should be implmented in subclasses
3973
+ };
3974
+
3975
+ Dropdown.prototype.destroy = function () {
3976
+ // Remove the dropdown from the DOM
3977
+ this.$dropdown.remove();
3978
+ };
3979
+
3980
+ return Dropdown;
3981
+ });
3982
+
3983
+ S2.define('select2/dropdown/search',[
3984
+ 'jquery',
3985
+ '../utils'
3986
+ ], function ($, Utils) {
3987
+ function Search () { }
3988
+
3989
+ Search.prototype.render = function (decorated) {
3990
+ var $rendered = decorated.call(this);
3991
+
3992
+ var $search = $(
3993
+ '<span class="select2-search select2-search--dropdown">' +
3994
+ '<input class="select2-search__field" type="text" tabindex="-1"' +
3995
+ ' autocomplete="off" autocorrect="off" autocapitalize="none"' +
3996
+ ' spellcheck="false" role="combobox" aria-autocomplete="list" aria-expanded="true" />' +
3997
+ '</span>'
3998
+ );
3999
+
4000
+ this.$searchContainer = $search;
4001
+ this.$search = $search.find('input');
4002
+
4003
+ $rendered.prepend($search);
4004
+
4005
+ return $rendered;
4006
+ };
4007
+
4008
+ Search.prototype.bind = function (decorated, container, $container) {
4009
+ var self = this;
4010
+ var resultsId = container.id + '-results';
4011
+
4012
+ decorated.call(this, container, $container);
4013
+
4014
+ this.$search.on('keydown', function (evt) {
4015
+ self.trigger('keypress', evt);
4016
+
4017
+ self._keyUpPrevented = evt.isDefaultPrevented();
4018
+ });
4019
+
4020
+ // Workaround for browsers which do not support the `input` event
4021
+ // This will prevent double-triggering of events for browsers which support
4022
+ // both the `keyup` and `input` events.
4023
+ this.$search.on('input', function (evt) {
4024
+ // Unbind the duplicated `keyup` event
4025
+ $(this).off('keyup');
4026
+ });
4027
+
4028
+ this.$search.on('keyup input', function (evt) {
4029
+ self.handleSearch(evt);
4030
+ });
4031
+
4032
+ container.on('open', function () {
4033
+ self.$search.attr('tabindex', 0);
4034
+ self.$search.attr('aria-owns', resultsId);
4035
+ self.$search.focus();
4036
+
4037
+ window.setTimeout(function () {
4038
+ self.$search.focus();
4039
+ }, 0);
4040
+ });
4041
+
4042
+ container.on('close', function () {
4043
+ self.$search.attr('tabindex', -1);
4044
+ self.$search.removeAttr('aria-activedescendant');
4045
+ self.$search.removeAttr('aria-owns');
4046
+ self.$search.val('');
4047
+ });
4048
+
4049
+ container.on('focus', function () {
4050
+ if (!container.isOpen()) {
4051
+ self.$search.focus();
4052
+ }
4053
+ });
4054
+
4055
+ container.on('results:all', function (params) {
4056
+ if (params.query.term == null || params.query.term === '') {
4057
+ var showSearch = self.showSearch(params);
4058
+
4059
+ if (showSearch) {
4060
+ self.$searchContainer.removeClass('select2-search--hide');
4061
+ } else {
4062
+ self.$searchContainer.addClass('select2-search--hide');
4063
+ }
4064
+ }
4065
+ });
4066
+
4067
+ container.on('results:focus', function (params) {
4068
+ self.$search.attr('aria-activedescendant', params.data._resultId);
4069
+ });
4070
+ };
4071
+
4072
+ Search.prototype.handleSearch = function (evt) {
4073
+ if (!this._keyUpPrevented) {
4074
+ var input = this.$search.val();
4075
+
4076
+ this.trigger('query', {
4077
+ term: input
4078
+ });
4079
+ }
4080
+
4081
+ this._keyUpPrevented = false;
4082
+ };
4083
+
4084
+ Search.prototype.showSearch = function (_, params) {
4085
+ return true;
4086
+ };
4087
+
4088
+ return Search;
4089
+ });
4090
+
4091
+ S2.define('select2/dropdown/hidePlaceholder',[
4092
+
4093
+ ], function () {
4094
+ function HidePlaceholder (decorated, $element, options, dataAdapter) {
4095
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
4096
+
4097
+ decorated.call(this, $element, options, dataAdapter);
4098
+ }
4099
+
4100
+ HidePlaceholder.prototype.append = function (decorated, data) {
4101
+ data.results = this.removePlaceholder(data.results);
4102
+
4103
+ decorated.call(this, data);
4104
+ };
4105
+
4106
+ HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
4107
+ if (typeof placeholder === 'string') {
4108
+ placeholder = {
4109
+ id: '',
4110
+ text: placeholder
4111
+ };
4112
+ }
4113
+
4114
+ return placeholder;
4115
+ };
4116
+
4117
+ HidePlaceholder.prototype.removePlaceholder = function (_, data) {
4118
+ var modifiedData = data.slice(0);
4119
+
4120
+ for (var d = data.length - 1; d >= 0; d--) {
4121
+ var item = data[d];
4122
+
4123
+ if (this.placeholder.id === item.id) {
4124
+ modifiedData.splice(d, 1);
4125
+ }
4126
+ }
4127
+
4128
+ return modifiedData;
4129
+ };
4130
+
4131
+ return HidePlaceholder;
4132
+ });
4133
+
4134
+ S2.define('select2/dropdown/infiniteScroll',[
4135
+ 'jquery'
4136
+ ], function ($) {
4137
+ function InfiniteScroll (decorated, $element, options, dataAdapter) {
4138
+ this.lastParams = {};
4139
+
4140
+ decorated.call(this, $element, options, dataAdapter);
4141
+
4142
+ this.$loadingMore = this.createLoadingMore();
4143
+ this.loading = false;
4144
+ }
4145
+
4146
+ InfiniteScroll.prototype.append = function (decorated, data) {
4147
+ this.$loadingMore.remove();
4148
+ this.loading = false;
4149
+
4150
+ decorated.call(this, data);
4151
+
4152
+ if (this.showLoadingMore(data)) {
4153
+ this.$results.append(this.$loadingMore);
4154
+ }
4155
+ };
4156
+
4157
+ InfiniteScroll.prototype.bind = function (decorated, container, $container) {
4158
+ var self = this;
4159
+
4160
+ decorated.call(this, container, $container);
4161
+
4162
+ container.on('query', function (params) {
4163
+ self.lastParams = params;
4164
+ self.loading = true;
4165
+ });
4166
+
4167
+ container.on('query:append', function (params) {
4168
+ self.lastParams = params;
4169
+ self.loading = true;
4170
+ });
4171
+
4172
+ this.$results.on('scroll', function () {
4173
+ var isLoadMoreVisible = $.contains(
4174
+ document.documentElement,
4175
+ self.$loadingMore[0]
4176
+ );
4177
+
4178
+ if (self.loading || !isLoadMoreVisible) {
4179
+ return;
4180
+ }
4181
+
4182
+ var currentOffset = self.$results.offset().top +
4183
+ self.$results.outerHeight(false);
4184
+ var loadingMoreOffset = self.$loadingMore.offset().top +
4185
+ self.$loadingMore.outerHeight(false);
4186
+
4187
+ if (currentOffset + 50 >= loadingMoreOffset) {
4188
+ self.loadMore();
4189
+ }
4190
+ });
4191
+ };
4192
+
4193
+ InfiniteScroll.prototype.loadMore = function () {
4194
+ this.loading = true;
4195
+
4196
+ var params = $.extend({}, {page: 1}, this.lastParams);
4197
+
4198
+ params.page++;
4199
+
4200
+ this.trigger('query:append', params);
4201
+ };
4202
+
4203
+ InfiniteScroll.prototype.showLoadingMore = function (_, data) {
4204
+ return data.pagination && data.pagination.more;
4205
+ };
4206
+
4207
+ InfiniteScroll.prototype.createLoadingMore = function () {
4208
+ var $option = $(
4209
+ '<li ' +
4210
+ 'class="select2-results__option select2-results__option--load-more"' +
4211
+ 'role="option" aria-disabled="true"></li>'
4212
+ );
4213
+
4214
+ var message = this.options.get('translations').get('loadingMore');
4215
+
4216
+ $option.html(message(this.lastParams));
4217
+
4218
+ return $option;
4219
+ };
4220
+
4221
+ return InfiniteScroll;
4222
+ });
4223
+
4224
+ S2.define('select2/dropdown/attachBody',[
4225
+ 'jquery',
4226
+ '../utils'
4227
+ ], function ($, Utils) {
4228
+ function AttachBody (decorated, $element, options) {
4229
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
4230
+
4231
+ decorated.call(this, $element, options);
4232
+ }
4233
+
4234
+ AttachBody.prototype.bind = function (decorated, container, $container) {
4235
+ var self = this;
4236
+
4237
+ var setupResultsEvents = false;
4238
+
4239
+ decorated.call(this, container, $container);
4240
+
4241
+ container.on('open', function () {
4242
+ self._showDropdown();
4243
+ self._attachPositioningHandler(container);
4244
+
4245
+ if (!setupResultsEvents) {
4246
+ setupResultsEvents = true;
4247
+
4248
+ container.on('results:all', function () {
4249
+ self._positionDropdown();
4250
+ self._resizeDropdown();
4251
+ });
4252
+
4253
+ container.on('results:append', function () {
4254
+ self._positionDropdown();
4255
+ self._resizeDropdown();
4256
+ });
4257
+ }
4258
+ });
4259
+
4260
+ container.on('close', function () {
4261
+ self._hideDropdown();
4262
+ self._detachPositioningHandler(container);
4263
+ });
4264
+
4265
+ this.$dropdownContainer.on('mousedown', function (evt) {
4266
+ evt.stopPropagation();
4267
+ });
4268
+ };
4269
+
4270
+ AttachBody.prototype.destroy = function (decorated) {
4271
+ decorated.call(this);
4272
+
4273
+ this.$dropdownContainer.remove();
4274
+ };
4275
+
4276
+ AttachBody.prototype.position = function (decorated, $dropdown, $container) {
4277
+ // Clone all of the container classes
4278
+ $dropdown.attr('class', $container.attr('class'));
4279
+
4280
+ $dropdown.removeClass('select2');
4281
+ $dropdown.addClass('select2-container--open');
4282
+
4283
+ $dropdown.css({
4284
+ position: 'absolute',
4285
+ top: -999999
4286
+ });
4287
+
4288
+ this.$container = $container;
4289
+ };
4290
+
4291
+ AttachBody.prototype.render = function (decorated) {
4292
+ var $container = $('<span></span>');
4293
+
4294
+ var $dropdown = decorated.call(this);
4295
+ $container.append($dropdown);
4296
+
4297
+ this.$dropdownContainer = $container;
4298
+
4299
+ return $container;
4300
+ };
4301
+
4302
+ AttachBody.prototype._hideDropdown = function (decorated) {
4303
+ this.$dropdownContainer.detach();
4304
+ };
4305
+
4306
+ AttachBody.prototype._attachPositioningHandler =
4307
+ function (decorated, container) {
4308
+ var self = this;
4309
+
4310
+ var scrollEvent = 'scroll.select2.' + container.id;
4311
+ var resizeEvent = 'resize.select2.' + container.id;
4312
+ var orientationEvent = 'orientationchange.select2.' + container.id;
4313
+
4314
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
4315
+ $watchers.each(function () {
4316
+ $(this).data('select2-scroll-position', {
4317
+ x: $(this).scrollLeft(),
4318
+ y: $(this).scrollTop()
4319
+ });
4320
+ });
4321
+
4322
+ $watchers.on(scrollEvent, function (ev) {
4323
+ var position = $(this).data('select2-scroll-position');
4324
+ $(this).scrollTop(position.y);
4325
+ });
4326
+
4327
+ $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
4328
+ function (e) {
4329
+ self._positionDropdown();
4330
+ self._resizeDropdown();
4331
+ });
4332
+ };
4333
+
4334
+ AttachBody.prototype._detachPositioningHandler =
4335
+ function (decorated, container) {
4336
+ var scrollEvent = 'scroll.select2.' + container.id;
4337
+ var resizeEvent = 'resize.select2.' + container.id;
4338
+ var orientationEvent = 'orientationchange.select2.' + container.id;
4339
+
4340
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
4341
+ $watchers.off(scrollEvent);
4342
+
4343
+ $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
4344
+ };
4345
+
4346
+ AttachBody.prototype._positionDropdown = function () {
4347
+ var $window = $(window);
4348
+
4349
+ var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
4350
+ var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
4351
+
4352
+ var newDirection = null;
4353
+
4354
+ var offset = this.$container.offset();
4355
+
4356
+ offset.bottom = offset.top + this.$container.outerHeight(false);
4357
+
4358
+ var container = {
4359
+ height: this.$container.outerHeight(false)
4360
+ };
4361
+
4362
+ container.top = offset.top;
4363
+ container.bottom = offset.top + container.height;
4364
+
4365
+ var dropdown = {
4366
+ height: this.$dropdown.outerHeight(false)
4367
+ };
4368
+
4369
+ var viewport = {
4370
+ top: $window.scrollTop(),
4371
+ bottom: $window.scrollTop() + $window.height()
4372
+ };
4373
+
4374
+ var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
4375
+ var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
4376
+
4377
+ var css = {
4378
+ left: offset.left,
4379
+ top: container.bottom
4380
+ };
4381
+
4382
+ // Determine what the parent element is to use for calciulating the offset
4383
+ var $offsetParent = this.$dropdownParent;
4384
+
4385
+ // For statically positoned elements, we need to get the element
4386
+ // that is determining the offset
4387
+ if ($offsetParent.css('position') === 'static') {
4388
+ $offsetParent = $offsetParent.offsetParent();
4389
+ }
4390
+
4391
+ var parentOffset = $offsetParent.offset();
4392
+
4393
+ css.top -= parentOffset.top;
4394
+ css.left -= parentOffset.left;
4395
+
4396
+ if (!isCurrentlyAbove && !isCurrentlyBelow) {
4397
+ newDirection = 'below';
4398
+ }
4399
+
4400
+ if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
4401
+ newDirection = 'above';
4402
+ } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
4403
+ newDirection = 'below';
4404
+ }
4405
+
4406
+ if (newDirection == 'above' ||
4407
+ (isCurrentlyAbove && newDirection !== 'below')) {
4408
+ css.top = container.top - parentOffset.top - dropdown.height;
4409
+ }
4410
+
4411
+ if (newDirection != null) {
4412
+ this.$dropdown
4413
+ .removeClass('select2-dropdown--below select2-dropdown--above')
4414
+ .addClass('select2-dropdown--' + newDirection);
4415
+ this.$container
4416
+ .removeClass('select2-container--below select2-container--above')
4417
+ .addClass('select2-container--' + newDirection);
4418
+ }
4419
+
4420
+ this.$dropdownContainer.css(css);
4421
+ };
4422
+
4423
+ AttachBody.prototype._resizeDropdown = function () {
4424
+ var css = {
4425
+ width: this.$container.outerWidth(false) + 'px'
4426
+ };
4427
+
4428
+ if (this.options.get('dropdownAutoWidth')) {
4429
+ css.minWidth = css.width;
4430
+ css.position = 'relative';
4431
+ css.width = 'auto';
4432
+ }
4433
+
4434
+ this.$dropdown.css(css);
4435
+ };
4436
+
4437
+ AttachBody.prototype._showDropdown = function (decorated) {
4438
+ this.$dropdownContainer.appendTo(this.$dropdownParent);
4439
+
4440
+ this._positionDropdown();
4441
+ this._resizeDropdown();
4442
+ };
4443
+
4444
+ return AttachBody;
4445
+ });
4446
+
4447
+ S2.define('select2/dropdown/minimumResultsForSearch',[
4448
+
4449
+ ], function () {
4450
+ function countResults (data) {
4451
+ var count = 0;
4452
+
4453
+ for (var d = 0; d < data.length; d++) {
4454
+ var item = data[d];
4455
+
4456
+ if (item.children) {
4457
+ count += countResults(item.children);
4458
+ } else {
4459
+ count++;
4460
+ }
4461
+ }
4462
+
4463
+ return count;
4464
+ }
4465
+
4466
+ function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
4467
+ this.minimumResultsForSearch = options.get('minimumResultsForSearch');
4468
+
4469
+ if (this.minimumResultsForSearch < 0) {
4470
+ this.minimumResultsForSearch = Infinity;
4471
+ }
4472
+
4473
+ decorated.call(this, $element, options, dataAdapter);
4474
+ }
4475
+
4476
+ MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
4477
+ if (countResults(params.data.results) < this.minimumResultsForSearch) {
4478
+ return false;
4479
+ }
4480
+
4481
+ return decorated.call(this, params);
4482
+ };
4483
+
4484
+ return MinimumResultsForSearch;
4485
+ });
4486
+
4487
+ S2.define('select2/dropdown/selectOnClose',[
4488
+
4489
+ ], function () {
4490
+ function SelectOnClose () { }
4491
+
4492
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
4493
+ var self = this;
4494
+
4495
+ decorated.call(this, container, $container);
4496
+
4497
+ container.on('close', function (params) {
4498
+ self._handleSelectOnClose(params);
4499
+ });
4500
+ };
4501
+
4502
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
4503
+ if (params && params.originalSelect2Event != null) {
4504
+ var event = params.originalSelect2Event;
4505
+
4506
+ // Don't select an item if the close event was triggered from a select or
4507
+ // unselect event
4508
+ if (event._type === 'select' || event._type === 'unselect') {
4509
+ return;
4510
+ }
4511
+ }
4512
+
4513
+ var $highlightedResults = this.getHighlightedResults();
4514
+
4515
+ // Only select highlighted results
4516
+ if ($highlightedResults.length < 1) {
4517
+ return;
4518
+ }
4519
+
4520
+ var data = $highlightedResults.data('data');
4521
+
4522
+ // Don't re-select already selected resulte
4523
+ if (
4524
+ (data.element != null && data.element.selected) ||
4525
+ (data.element == null && data.selected)
4526
+ ) {
4527
+ return;
4528
+ }
4529
+
4530
+ this.trigger('select', {
4531
+ data: data
4532
+ });
4533
+ };
4534
+
4535
+ return SelectOnClose;
4536
+ });
4537
+
4538
+ S2.define('select2/dropdown/closeOnSelect',[
4539
+
4540
+ ], function () {
4541
+ function CloseOnSelect () { }
4542
+
4543
+ CloseOnSelect.prototype.bind = function (decorated, container, $container) {
4544
+ var self = this;
4545
+
4546
+ decorated.call(this, container, $container);
4547
+
4548
+ container.on('select', function (evt) {
4549
+ self._selectTriggered(evt);
4550
+ });
4551
+
4552
+ container.on('unselect', function (evt) {
4553
+ self._selectTriggered(evt);
4554
+ });
4555
+ };
4556
+
4557
+ CloseOnSelect.prototype._selectTriggered = function (_, evt) {
4558
+ var originalEvent = evt.originalEvent;
4559
+
4560
+ // Don't close if the control key is being held
4561
+ if (originalEvent && originalEvent.ctrlKey) {
4562
+ return;
4563
+ }
4564
+
4565
+ this.trigger('close', {
4566
+ originalEvent: originalEvent,
4567
+ originalSelect2Event: evt
4568
+ });
4569
+ };
4570
+
4571
+ return CloseOnSelect;
4572
+ });
4573
+
4574
+ S2.define('select2/i18n/en',[],function () {
4575
+ // English
4576
+ return {
4577
+ errorLoading: function () {
4578
+ return 'The results could not be loaded.';
4579
+ },
4580
+ inputTooLong: function (args) {
4581
+ var overChars = args.input.length - args.maximum;
4582
+
4583
+ var message = 'Please delete ' + overChars + ' character';
4584
+
4585
+ if (overChars != 1) {
4586
+ message += 's';
4587
+ }
4588
+
4589
+ return message;
4590
+ },
4591
+ inputTooShort: function (args) {
4592
+ var remainingChars = args.minimum - args.input.length;
4593
+
4594
+ var message = 'Please enter ' + remainingChars + ' or more characters';
4595
+
4596
+ return message;
4597
+ },
4598
+ loadingMore: function () {
4599
+ return 'Loading more results…';
4600
+ },
4601
+ maximumSelected: function (args) {
4602
+ var message = 'You can only select ' + args.maximum + ' item';
4603
+
4604
+ if (args.maximum != 1) {
4605
+ message += 's';
4606
+ }
4607
+
4608
+ return message;
4609
+ },
4610
+ noResults: function () {
4611
+ return 'No results found';
4612
+ },
4613
+ searching: function () {
4614
+ return 'Searching…';
4615
+ }
4616
+ };
4617
+ });
4618
+
4619
+ S2.define('select2/defaults',[
4620
+ 'jquery',
4621
+ 'require',
4622
+
4623
+ './results',
4624
+
4625
+ './selection/single',
4626
+ './selection/multiple',
4627
+ './selection/placeholder',
4628
+ './selection/allowClear',
4629
+ './selection/search',
4630
+ './selection/eventRelay',
4631
+
4632
+ './utils',
4633
+ './translation',
4634
+ './diacritics',
4635
+
4636
+ './data/select',
4637
+ './data/array',
4638
+ './data/ajax',
4639
+ './data/tags',
4640
+ './data/tokenizer',
4641
+ './data/minimumInputLength',
4642
+ './data/maximumInputLength',
4643
+ './data/maximumSelectionLength',
4644
+
4645
+ './dropdown',
4646
+ './dropdown/search',
4647
+ './dropdown/hidePlaceholder',
4648
+ './dropdown/infiniteScroll',
4649
+ './dropdown/attachBody',
4650
+ './dropdown/minimumResultsForSearch',
4651
+ './dropdown/selectOnClose',
4652
+ './dropdown/closeOnSelect',
4653
+
4654
+ './i18n/en'
4655
+ ], function ($, require,
4656
+
4657
+ ResultsList,
4658
+
4659
+ SingleSelection, MultipleSelection, Placeholder, AllowClear,
4660
+ SelectionSearch, EventRelay,
4661
+
4662
+ Utils, Translation, DIACRITICS,
4663
+
4664
+ SelectData, ArrayData, AjaxData, Tags, Tokenizer,
4665
+ MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
4666
+
4667
+ Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
4668
+ AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
4669
+
4670
+ EnglishTranslation) {
4671
+ function Defaults () {
4672
+ this.reset();
4673
+ }
4674
+
4675
+ Defaults.prototype.apply = function (options) {
4676
+ options = $.extend(true, {}, this.defaults, options);
4677
+
4678
+ if (options.dataAdapter == null) {
4679
+ if (options.ajax != null) {
4680
+ options.dataAdapter = AjaxData;
4681
+ } else if (options.data != null) {
4682
+ options.dataAdapter = ArrayData;
4683
+ } else {
4684
+ options.dataAdapter = SelectData;
4685
+ }
4686
+
4687
+ if (options.minimumInputLength > 0) {
4688
+ options.dataAdapter = Utils.Decorate(
4689
+ options.dataAdapter,
4690
+ MinimumInputLength
4691
+ );
4692
+ }
4693
+
4694
+ if (options.maximumInputLength > 0) {
4695
+ options.dataAdapter = Utils.Decorate(
4696
+ options.dataAdapter,
4697
+ MaximumInputLength
4698
+ );
4699
+ }
4700
+
4701
+ if (options.maximumSelectionLength > 0) {
4702
+ options.dataAdapter = Utils.Decorate(
4703
+ options.dataAdapter,
4704
+ MaximumSelectionLength
4705
+ );
4706
+ }
4707
+
4708
+ if (options.tags) {
4709
+ options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
4710
+ }
4711
+
4712
+ if (options.tokenSeparators != null || options.tokenizer != null) {
4713
+ options.dataAdapter = Utils.Decorate(
4714
+ options.dataAdapter,
4715
+ Tokenizer
4716
+ );
4717
+ }
4718
+
4719
+ if (options.query != null) {
4720
+ var Query = require(options.amdBase + 'compat/query');
4721
+
4722
+ options.dataAdapter = Utils.Decorate(
4723
+ options.dataAdapter,
4724
+ Query
4725
+ );
4726
+ }
4727
+
4728
+ if (options.initSelection != null) {
4729
+ var InitSelection = require(options.amdBase + 'compat/initSelection');
4730
+
4731
+ options.dataAdapter = Utils.Decorate(
4732
+ options.dataAdapter,
4733
+ InitSelection
4734
+ );
4735
+ }
4736
+ }
4737
+
4738
+ if (options.resultsAdapter == null) {
4739
+ options.resultsAdapter = ResultsList;
4740
+
4741
+ if (options.ajax != null) {
4742
+ options.resultsAdapter = Utils.Decorate(
4743
+ options.resultsAdapter,
4744
+ InfiniteScroll
4745
+ );
4746
+ }
4747
+
4748
+ if (options.placeholder != null) {
4749
+ options.resultsAdapter = Utils.Decorate(
4750
+ options.resultsAdapter,
4751
+ HidePlaceholder
4752
+ );
4753
+ }
4754
+
4755
+ if (options.selectOnClose) {
4756
+ options.resultsAdapter = Utils.Decorate(
4757
+ options.resultsAdapter,
4758
+ SelectOnClose
4759
+ );
4760
+ }
4761
+ }
4762
+
4763
+ if (options.dropdownAdapter == null) {
4764
+ if (options.multiple) {
4765
+ options.dropdownAdapter = Dropdown;
4766
+ } else {
4767
+ var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
4768
+
4769
+ options.dropdownAdapter = SearchableDropdown;
4770
+ }
4771
+
4772
+ if (options.minimumResultsForSearch !== 0) {
4773
+ options.dropdownAdapter = Utils.Decorate(
4774
+ options.dropdownAdapter,
4775
+ MinimumResultsForSearch
4776
+ );
4777
+ }
4778
+
4779
+ if (options.closeOnSelect) {
4780
+ options.dropdownAdapter = Utils.Decorate(
4781
+ options.dropdownAdapter,
4782
+ CloseOnSelect
4783
+ );
4784
+ }
4785
+
4786
+ if (
4787
+ options.dropdownCssClass != null ||
4788
+ options.dropdownCss != null ||
4789
+ options.adaptDropdownCssClass != null
4790
+ ) {
4791
+ var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
4792
+
4793
+ options.dropdownAdapter = Utils.Decorate(
4794
+ options.dropdownAdapter,
4795
+ DropdownCSS
4796
+ );
4797
+ }
4798
+
4799
+ options.dropdownAdapter = Utils.Decorate(
4800
+ options.dropdownAdapter,
4801
+ AttachBody
4802
+ );
4803
+ }
4804
+
4805
+ if (options.selectionAdapter == null) {
4806
+ if (options.multiple) {
4807
+ options.selectionAdapter = MultipleSelection;
4808
+ } else {
4809
+ options.selectionAdapter = SingleSelection;
4810
+ }
4811
+
4812
+ // Add the placeholder mixin if a placeholder was specified
4813
+ if (options.placeholder != null) {
4814
+ options.selectionAdapter = Utils.Decorate(
4815
+ options.selectionAdapter,
4816
+ Placeholder
4817
+ );
4818
+ }
4819
+
4820
+ if (options.allowClear) {
4821
+ options.selectionAdapter = Utils.Decorate(
4822
+ options.selectionAdapter,
4823
+ AllowClear
4824
+ );
4825
+ }
4826
+
4827
+ if (options.multiple) {
4828
+ options.selectionAdapter = Utils.Decorate(
4829
+ options.selectionAdapter,
4830
+ SelectionSearch
4831
+ );
4832
+ }
4833
+
4834
+ if (
4835
+ options.containerCssClass != null ||
4836
+ options.containerCss != null ||
4837
+ options.adaptContainerCssClass != null
4838
+ ) {
4839
+ var ContainerCSS = require(options.amdBase + 'compat/containerCss');
4840
+
4841
+ options.selectionAdapter = Utils.Decorate(
4842
+ options.selectionAdapter,
4843
+ ContainerCSS
4844
+ );
4845
+ }
4846
+
4847
+ options.selectionAdapter = Utils.Decorate(
4848
+ options.selectionAdapter,
4849
+ EventRelay
4850
+ );
4851
+ }
4852
+
4853
+ if (typeof options.language === 'string') {
4854
+ // Check if the language is specified with a region
4855
+ if (options.language.indexOf('-') > 0) {
4856
+ // Extract the region information if it is included
4857
+ var languageParts = options.language.split('-');
4858
+ var baseLanguage = languageParts[0];
4859
+
4860
+ options.language = [options.language, baseLanguage];
4861
+ } else {
4862
+ options.language = [options.language];
4863
+ }
4864
+ }
4865
+
4866
+ if ($.isArray(options.language)) {
4867
+ var languages = new Translation();
4868
+ options.language.push('en');
4869
+
4870
+ var languageNames = options.language;
4871
+
4872
+ for (var l = 0; l < languageNames.length; l++) {
4873
+ var name = languageNames[l];
4874
+ var language = {};
4875
+
4876
+ try {
4877
+ // Try to load it with the original name
4878
+ language = Translation.loadPath(name);
4879
+ } catch (e) {
4880
+ try {
4881
+ // If we couldn't load it, check if it wasn't the full path
4882
+ name = this.defaults.amdLanguageBase + name;
4883
+ language = Translation.loadPath(name);
4884
+ } catch (ex) {
4885
+ // The translation could not be loaded at all. Sometimes this is
4886
+ // because of a configuration problem, other times this can be
4887
+ // because of how Select2 helps load all possible translation files.
4888
+ if (options.debug && window.console && console.warn) {
4889
+ console.warn(
4890
+ 'Select2: The language file for "' + name + '" could not be ' +
4891
+ 'automatically loaded. A fallback will be used instead.'
4892
+ );
4893
+ }
4894
+
4895
+ continue;
4896
+ }
4897
+ }
4898
+
4899
+ languages.extend(language);
4900
+ }
4901
+
4902
+ options.translations = languages;
4903
+ } else {
4904
+ var baseTranslation = Translation.loadPath(
4905
+ this.defaults.amdLanguageBase + 'en'
4906
+ );
4907
+ var customTranslation = new Translation(options.language);
4908
+
4909
+ customTranslation.extend(baseTranslation);
4910
+
4911
+ options.translations = customTranslation;
4912
+ }
4913
+
4914
+ return options;
4915
+ };
4916
+
4917
+ Defaults.prototype.reset = function () {
4918
+ function stripDiacritics (text) {
4919
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
4920
+ function match(a) {
4921
+ return DIACRITICS[a] || a;
4922
+ }
4923
+
4924
+ return text.replace(/[^\u0000-\u007E]/g, match);
4925
+ }
4926
+
4927
+ function matcher (params, data) {
4928
+ // Always return the object if there is nothing to compare
4929
+ if ($.trim(params.term) === '') {
4930
+ return data;
4931
+ }
4932
+
4933
+ // Do a recursive check for options with children
4934
+ if (data.children && data.children.length > 0) {
4935
+ // Clone the data object if there are children
4936
+ // This is required as we modify the object to remove any non-matches
4937
+ var match = $.extend(true, {}, data);
4938
+
4939
+ // Check each child of the option
4940
+ for (var c = data.children.length - 1; c >= 0; c--) {
4941
+ var child = data.children[c];
4942
+
4943
+ var matches = matcher(params, child);
4944
+
4945
+ // If there wasn't a match, remove the object in the array
4946
+ if (matches == null) {
4947
+ match.children.splice(c, 1);
4948
+ }
4949
+ }
4950
+
4951
+ // If any children matched, return the new object
4952
+ if (match.children.length > 0) {
4953
+ return match;
4954
+ }
4955
+
4956
+ // If there were no matching children, check just the plain object
4957
+ return matcher(params, match);
4958
+ }
4959
+
4960
+ var original = stripDiacritics(data.text).toUpperCase();
4961
+ var term = stripDiacritics(params.term).toUpperCase();
4962
+
4963
+ // Check if the text contains the term
4964
+ if (original.indexOf(term) > -1) {
4965
+ return data;
4966
+ }
4967
+
4968
+ // If it doesn't contain the term, don't return anything
4969
+ return null;
4970
+ }
4971
+
4972
+ this.defaults = {
4973
+ amdBase: './',
4974
+ amdLanguageBase: './i18n/',
4975
+ closeOnSelect: true,
4976
+ debug: false,
4977
+ dropdownAutoWidth: false,
4978
+ escapeMarkup: Utils.escapeMarkup,
4979
+ language: EnglishTranslation,
4980
+ matcher: matcher,
4981
+ minimumInputLength: 0,
4982
+ maximumInputLength: 0,
4983
+ maximumSelectionLength: 0,
4984
+ minimumResultsForSearch: 0,
4985
+ selectOnClose: false,
4986
+ sorter: function (data) {
4987
+ return data;
4988
+ },
4989
+ templateResult: function (result) {
4990
+ return result.text;
4991
+ },
4992
+ templateSelection: function (selection) {
4993
+ return selection.text;
4994
+ },
4995
+ theme: 'default',
4996
+ width: 'resolve'
4997
+ };
4998
+ };
4999
+
5000
+ Defaults.prototype.set = function (key, value) {
5001
+ var camelKey = $.camelCase(key);
5002
+
5003
+ var data = {};
5004
+ data[camelKey] = value;
5005
+
5006
+ var convertedData = Utils._convertData(data);
5007
+
5008
+ $.extend(this.defaults, convertedData);
5009
+ };
5010
+
5011
+ var defaults = new Defaults();
5012
+
5013
+ return defaults;
5014
+ });
5015
+
5016
+ S2.define('select2/options',[
5017
+ 'require',
5018
+ 'jquery',
5019
+ './defaults',
5020
+ './utils'
5021
+ ], function (require, $, Defaults, Utils) {
5022
+ function Options (options, $element) {
5023
+ this.options = options;
5024
+
5025
+ if ($element != null) {
5026
+ this.fromElement($element);
5027
+ }
5028
+
5029
+ this.options = Defaults.apply(this.options);
5030
+
5031
+ if ($element && $element.is('input')) {
5032
+ var InputCompat = require(this.get('amdBase') + 'compat/inputData');
5033
+
5034
+ this.options.dataAdapter = Utils.Decorate(
5035
+ this.options.dataAdapter,
5036
+ InputCompat
5037
+ );
5038
+ }
5039
+ }
5040
+
5041
+ Options.prototype.fromElement = function ($e) {
5042
+ var excludedData = ['select2'];
5043
+
5044
+ if (this.options.multiple == null) {
5045
+ this.options.multiple = $e.prop('multiple');
5046
+ }
5047
+
5048
+ if (this.options.disabled == null) {
5049
+ this.options.disabled = $e.prop('disabled');
5050
+ }
5051
+
5052
+ if (this.options.language == null) {
5053
+ if ($e.prop('lang')) {
5054
+ this.options.language = $e.prop('lang').toLowerCase();
5055
+ } else if ($e.closest('[lang]').prop('lang')) {
5056
+ this.options.language = $e.closest('[lang]').prop('lang');
5057
+ }
5058
+ }
5059
+
5060
+ if (this.options.dir == null) {
5061
+ if ($e.prop('dir')) {
5062
+ this.options.dir = $e.prop('dir');
5063
+ } else if ($e.closest('[dir]').prop('dir')) {
5064
+ this.options.dir = $e.closest('[dir]').prop('dir');
5065
+ } else {
5066
+ this.options.dir = 'ltr';
5067
+ }
5068
+ }
5069
+
5070
+ $e.prop('disabled', this.options.disabled);
5071
+ $e.prop('multiple', this.options.multiple);
5072
+
5073
+ if ($e.data('select2Tags')) {
5074
+ if (this.options.debug && window.console && console.warn) {
5075
+ console.warn(
5076
+ 'Select2: The `data-select2-tags` attribute has been changed to ' +
5077
+ 'use the `data-data` and `data-tags="true"` attributes and will be ' +
5078
+ 'removed in future versions of Select2.'
5079
+ );
5080
+ }
5081
+
5082
+ $e.data('data', $e.data('select2Tags'));
5083
+ $e.data('tags', true);
5084
+ }
5085
+
5086
+ if ($e.data('ajaxUrl')) {
5087
+ if (this.options.debug && window.console && console.warn) {
5088
+ console.warn(
5089
+ 'Select2: The `data-ajax-url` attribute has been changed to ' +
5090
+ '`data-ajax--url` and support for the old attribute will be removed' +
5091
+ ' in future versions of Select2.'
5092
+ );
5093
+ }
5094
+
5095
+ $e.attr('ajax--url', $e.data('ajaxUrl'));
5096
+ $e.data('ajax--url', $e.data('ajaxUrl'));
5097
+ }
5098
+
5099
+ var dataset = {};
5100
+
5101
+ // Prefer the element's `dataset` attribute if it exists
5102
+ // jQuery 1.x does not correctly handle data attributes with multiple dashes
5103
+ if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
5104
+ dataset = $.extend(true, {}, $e[0].dataset, $e.data());
5105
+ } else {
5106
+ dataset = $e.data();
5107
+ }
5108
+
5109
+ var data = $.extend(true, {}, dataset);
5110
+
5111
+ data = Utils._convertData(data);
5112
+
5113
+ for (var key in data) {
5114
+ if ($.inArray(key, excludedData) > -1) {
5115
+ continue;
5116
+ }
5117
+
5118
+ if ($.isPlainObject(this.options[key])) {
5119
+ $.extend(this.options[key], data[key]);
5120
+ } else {
5121
+ this.options[key] = data[key];
5122
+ }
5123
+ }
5124
+
5125
+ return this;
5126
+ };
5127
+
5128
+ Options.prototype.get = function (key) {
5129
+ return this.options[key];
5130
+ };
5131
+
5132
+ Options.prototype.set = function (key, val) {
5133
+ this.options[key] = val;
5134
+ };
5135
+
5136
+ return Options;
5137
+ });
5138
+
5139
+ S2.define('select2/core',[
5140
+ 'jquery',
5141
+ './options',
5142
+ './utils',
5143
+ './keys'
5144
+ ], function ($, Options, Utils, KEYS) {
5145
+ var Select2 = function ($element, options) {
5146
+ if ($element.data('select2') != null) {
5147
+ $element.data('select2').destroy();
5148
+ }
5149
+
5150
+ this.$element = $element;
5151
+
5152
+ this.id = this._generateId($element);
5153
+
5154
+ options = options || {};
5155
+
5156
+ this.options = new Options(options, $element);
5157
+
5158
+ Select2.__super__.constructor.call(this);
5159
+
5160
+ // Set up the tabindex
5161
+
5162
+ var tabindex = $element.attr('tabindex') || 0;
5163
+ $element.data('old-tabindex', tabindex);
5164
+ $element.attr('tabindex', '-1');
5165
+
5166
+ // Set up containers and adapters
5167
+
5168
+ var DataAdapter = this.options.get('dataAdapter');
5169
+ this.dataAdapter = new DataAdapter($element, this.options);
5170
+
5171
+ var $container = this.render();
5172
+
5173
+ this._placeContainer($container);
5174
+
5175
+ var SelectionAdapter = this.options.get('selectionAdapter');
5176
+ this.selection = new SelectionAdapter($element, this.options);
5177
+ this.$selection = this.selection.render();
5178
+
5179
+ this.selection.position(this.$selection, $container);
5180
+
5181
+ var DropdownAdapter = this.options.get('dropdownAdapter');
5182
+ this.dropdown = new DropdownAdapter($element, this.options);
5183
+ this.$dropdown = this.dropdown.render();
5184
+
5185
+ this.dropdown.position(this.$dropdown, $container);
5186
+
5187
+ var ResultsAdapter = this.options.get('resultsAdapter');
5188
+ this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
5189
+ this.$results = this.results.render();
5190
+
5191
+ this.results.position(this.$results, this.$dropdown);
5192
+
5193
+ // Bind events
5194
+
5195
+ var self = this;
5196
+
5197
+ // Bind the container to all of the adapters
5198
+ this._bindAdapters();
5199
+
5200
+ // Register any DOM event handlers
5201
+ this._registerDomEvents();
5202
+
5203
+ // Register any internal event handlers
5204
+ this._registerDataEvents();
5205
+ this._registerSelectionEvents();
5206
+ this._registerDropdownEvents();
5207
+ this._registerResultsEvents();
5208
+ this._registerEvents();
5209
+
5210
+ // Set the initial state
5211
+ this.dataAdapter.current(function (initialData) {
5212
+ self.trigger('selection:update', {
5213
+ data: initialData
5214
+ });
5215
+ });
5216
+
5217
+ // Hide the original select
5218
+ $element.addClass('select2-hidden-accessible');
5219
+ $element.attr('aria-hidden', 'true');
5220
+
5221
+ // Synchronize any monitored attributes
5222
+ this._syncAttributes();
5223
+
5224
+ $element.data('select2', this);
5225
+ };
5226
+
5227
+ Utils.Extend(Select2, Utils.Observable);
5228
+
5229
+ Select2.prototype._generateId = function ($element) {
5230
+ var id = '';
5231
+
5232
+ if ($element.attr('id') != null) {
5233
+ id = $element.attr('id');
5234
+ } else if ($element.attr('name') != null) {
5235
+ id = $element.attr('name') + '-' + Utils.generateChars(2);
5236
+ } else {
5237
+ id = Utils.generateChars(4);
5238
+ }
5239
+
5240
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
5241
+ id = 'select2-' + id;
5242
+
5243
+ return id;
5244
+ };
5245
+
5246
+ Select2.prototype._placeContainer = function ($container) {
5247
+ $container.insertAfter(this.$element);
5248
+
5249
+ var width = this._resolveWidth(this.$element, this.options.get('width'));
5250
+
5251
+ if (width != null) {
5252
+ $container.css('width', width);
5253
+ }
5254
+ };
5255
+
5256
+ Select2.prototype._resolveWidth = function ($element, method) {
5257
+ var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
5258
+
5259
+ if (method == 'resolve') {
5260
+ var styleWidth = this._resolveWidth($element, 'style');
5261
+
5262
+ if (styleWidth != null) {
5263
+ return styleWidth;
5264
+ }
5265
+
5266
+ return this._resolveWidth($element, 'element');
5267
+ }
5268
+
5269
+ if (method == 'element') {
5270
+ var elementWidth = $element.outerWidth(false);
5271
+
5272
+ if (elementWidth <= 0) {
5273
+ return 'auto';
5274
+ }
5275
+
5276
+ return elementWidth + 'px';
5277
+ }
5278
+
5279
+ if (method == 'style') {
5280
+ var style = $element.attr('style');
5281
+
5282
+ if (typeof(style) !== 'string') {
5283
+ return null;
5284
+ }
5285
+
5286
+ var attrs = style.split(';');
5287
+
5288
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
5289
+ var attr = attrs[i].replace(/\s/g, '');
5290
+ var matches = attr.match(WIDTH);
5291
+
5292
+ if (matches !== null && matches.length >= 1) {
5293
+ return matches[1];
5294
+ }
5295
+ }
5296
+
5297
+ return null;
5298
+ }
5299
+
5300
+ return method;
5301
+ };
5302
+
5303
+ Select2.prototype._bindAdapters = function () {
5304
+ this.dataAdapter.bind(this, this.$container);
5305
+ this.selection.bind(this, this.$container);
5306
+
5307
+ this.dropdown.bind(this, this.$container);
5308
+ this.results.bind(this, this.$container);
5309
+ };
5310
+
5311
+ Select2.prototype._registerDomEvents = function () {
5312
+ var self = this;
5313
+
5314
+ this.$element.on('change.select2', function () {
5315
+ self.dataAdapter.current(function (data) {
5316
+ self.trigger('selection:update', {
5317
+ data: data
5318
+ });
5319
+ });
5320
+ });
5321
+
5322
+ this.$element.on('focus.select2', function (evt) {
5323
+ self.trigger('focus', evt);
5324
+ });
5325
+
5326
+ this._syncA = Utils.bind(this._syncAttributes, this);
5327
+ this._syncS = Utils.bind(this._syncSubtree, this);
5328
+
5329
+ if (this.$element[0].attachEvent) {
5330
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
5331
+ }
5332
+
5333
+ var observer = window.MutationObserver ||
5334
+ window.WebKitMutationObserver ||
5335
+ window.MozMutationObserver
5336
+ ;
5337
+
5338
+ if (observer != null) {
5339
+ this._observer = new observer(function (mutations) {
5340
+ $.each(mutations, self._syncA);
5341
+ $.each(mutations, self._syncS);
5342
+ });
5343
+ this._observer.observe(this.$element[0], {
5344
+ attributes: true,
5345
+ childList: true,
5346
+ subtree: false
5347
+ });
5348
+ } else if (this.$element[0].addEventListener) {
5349
+ this.$element[0].addEventListener(
5350
+ 'DOMAttrModified',
5351
+ self._syncA,
5352
+ false
5353
+ );
5354
+ this.$element[0].addEventListener(
5355
+ 'DOMNodeInserted',
5356
+ self._syncS,
5357
+ false
5358
+ );
5359
+ this.$element[0].addEventListener(
5360
+ 'DOMNodeRemoved',
5361
+ self._syncS,
5362
+ false
5363
+ );
5364
+ }
5365
+ };
5366
+
5367
+ Select2.prototype._registerDataEvents = function () {
5368
+ var self = this;
5369
+
5370
+ this.dataAdapter.on('*', function (name, params) {
5371
+ self.trigger(name, params);
5372
+ });
5373
+ };
5374
+
5375
+ Select2.prototype._registerSelectionEvents = function () {
5376
+ var self = this;
5377
+ var nonRelayEvents = ['toggle', 'focus'];
5378
+
5379
+ this.selection.on('toggle', function () {
5380
+ self.toggleDropdown();
5381
+ });
5382
+
5383
+ this.selection.on('focus', function (params) {
5384
+ self.focus(params);
5385
+ });
5386
+
5387
+ this.selection.on('*', function (name, params) {
5388
+ if ($.inArray(name, nonRelayEvents) !== -1) {
5389
+ return;
5390
+ }
5391
+
5392
+ self.trigger(name, params);
5393
+ });
5394
+ };
5395
+
5396
+ Select2.prototype._registerDropdownEvents = function () {
5397
+ var self = this;
5398
+
5399
+ this.dropdown.on('*', function (name, params) {
5400
+ self.trigger(name, params);
5401
+ });
5402
+ };
5403
+
5404
+ Select2.prototype._registerResultsEvents = function () {
5405
+ var self = this;
5406
+
5407
+ this.results.on('*', function (name, params) {
5408
+ self.trigger(name, params);
5409
+ });
5410
+ };
5411
+
5412
+ Select2.prototype._registerEvents = function () {
5413
+ var self = this;
5414
+
5415
+ this.on('open', function () {
5416
+ self.$container.addClass('select2-container--open');
5417
+ });
5418
+
5419
+ this.on('close', function () {
5420
+ self.$container.removeClass('select2-container--open');
5421
+ });
5422
+
5423
+ this.on('enable', function () {
5424
+ self.$container.removeClass('select2-container--disabled');
5425
+ });
5426
+
5427
+ this.on('disable', function () {
5428
+ self.$container.addClass('select2-container--disabled');
5429
+ });
5430
+
5431
+ this.on('blur', function () {
5432
+ self.$container.removeClass('select2-container--focus');
5433
+ });
5434
+
5435
+ this.on('query', function (params) {
5436
+ if (!self.isOpen()) {
5437
+ self.trigger('open', {});
5438
+ }
5439
+
5440
+ this.dataAdapter.query(params, function (data) {
5441
+ self.trigger('results:all', {
5442
+ data: data,
5443
+ query: params
5444
+ });
5445
+ });
5446
+ });
5447
+
5448
+ this.on('query:append', function (params) {
5449
+ this.dataAdapter.query(params, function (data) {
5450
+ self.trigger('results:append', {
5451
+ data: data,
5452
+ query: params
5453
+ });
5454
+ });
5455
+ });
5456
+
5457
+ this.on('open', function(){
5458
+ // Focus on the active element when opening dropdown.
5459
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
5460
+ setTimeout(function(){
5461
+ self.focusOnActiveElement();
5462
+ }, 1);
5463
+ });
5464
+
5465
+ $(document).on('keydown', function (evt) {
5466
+ var key = evt.which;
5467
+ if (self.isOpen()) {
5468
+ if (key === KEYS.ESC || (key === KEYS.UP && evt.altKey)) {
5469
+ self.close();
5470
+
5471
+ evt.preventDefault();
5472
+ } else if (key === KEYS.ENTER || key === KEYS.TAB) {
5473
+ self.trigger('results:select', {});
5474
+
5475
+ evt.preventDefault();
5476
+ } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
5477
+ self.trigger('results:toggle', {});
5478
+
5479
+ evt.preventDefault();
5480
+ } else if (key === KEYS.UP) {
5481
+ self.trigger('results:previous', {});
5482
+
5483
+ evt.preventDefault();
5484
+ } else if (key === KEYS.DOWN) {
5485
+ self.trigger('results:next', {});
5486
+
5487
+ evt.preventDefault();
5488
+ }
5489
+
5490
+ var $searchField = self.$dropdown.find('.select2-search__field');
5491
+ if (! $searchField.length) {
5492
+ $searchField = self.$container.find('.select2-search__field');
5493
+ }
5494
+
5495
+ // Move the focus to the selected element on keyboard navigation.
5496
+ // Required for screen readers to work properly.
5497
+ if (key === KEYS.DOWN || key === KEYS.UP) {
5498
+ self.focusOnActiveElement();
5499
+ } else {
5500
+ // Focus on the search if user starts typing.
5501
+ $searchField.focus();
5502
+ // Focus back to active selection when finished typing.
5503
+ // Small delay so typed character can be read by screen reader.
5504
+ setTimeout(function(){
5505
+ self.focusOnActiveElement();
5506
+ }, 1000);
5507
+ }
5508
+ } else if (self.hasFocus()) {
5509
+ if (key === KEYS.ENTER || key === KEYS.SPACE ||
5510
+ key === KEYS.DOWN) {
5511
+ self.open();
5512
+ evt.preventDefault();
5513
+ }
5514
+ }
5515
+ });
5516
+ };
5517
+
5518
+ Select2.prototype.focusOnActiveElement = function () {
5519
+ // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
5520
+ if (this.isOpen() && ! Utils.isTouchscreen()) {
5521
+ this.$results.find('li.select2-results__option--highlighted').focus();
5522
+ }
5523
+ };
5524
+
5525
+ Select2.prototype._syncAttributes = function () {
5526
+ this.options.set('disabled', this.$element.prop('disabled'));
5527
+
5528
+ if (this.options.get('disabled')) {
5529
+ if (this.isOpen()) {
5530
+ this.close();
5531
+ }
5532
+
5533
+ this.trigger('disable', {});
5534
+ } else {
5535
+ this.trigger('enable', {});
5536
+ }
5537
+ };
5538
+
5539
+ Select2.prototype._syncSubtree = function (evt, mutations) {
5540
+ var changed = false;
5541
+ var self = this;
5542
+
5543
+ // Ignore any mutation events raised for elements that aren't options or
5544
+ // optgroups. This handles the case when the select element is destroyed
5545
+ if (
5546
+ evt && evt.target && (
5547
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
5548
+ )
5549
+ ) {
5550
+ return;
5551
+ }
5552
+
5553
+ if (!mutations) {
5554
+ // If mutation events aren't supported, then we can only assume that the
5555
+ // change affected the selections
5556
+ changed = true;
5557
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
5558
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
5559
+ var node = mutations.addedNodes[n];
5560
+
5561
+ if (node.selected) {
5562
+ changed = true;
5563
+ }
5564
+ }
5565
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
5566
+ changed = true;
5567
+ }
5568
+
5569
+ // Only re-pull the data if we think there is a change
5570
+ if (changed) {
5571
+ this.dataAdapter.current(function (currentData) {
5572
+ self.trigger('selection:update', {
5573
+ data: currentData
5574
+ });
5575
+ });
5576
+ }
5577
+ };
5578
+
5579
+ /**
5580
+ * Override the trigger method to automatically trigger pre-events when
5581
+ * there are events that can be prevented.
5582
+ */
5583
+ Select2.prototype.trigger = function (name, args) {
5584
+ var actualTrigger = Select2.__super__.trigger;
5585
+ var preTriggerMap = {
5586
+ 'open': 'opening',
5587
+ 'close': 'closing',
5588
+ 'select': 'selecting',
5589
+ 'unselect': 'unselecting'
5590
+ };
5591
+
5592
+ if (args === undefined) {
5593
+ args = {};
5594
+ }
5595
+
5596
+ if (name in preTriggerMap) {
5597
+ var preTriggerName = preTriggerMap[name];
5598
+ var preTriggerArgs = {
5599
+ prevented: false,
5600
+ name: name,
5601
+ args: args
5602
+ };
5603
+
5604
+ actualTrigger.call(this, preTriggerName, preTriggerArgs);
5605
+
5606
+ if (preTriggerArgs.prevented) {
5607
+ args.prevented = true;
5608
+
5609
+ return;
5610
+ }
5611
+ }
5612
+
5613
+ actualTrigger.call(this, name, args);
5614
+ };
5615
+
5616
+ Select2.prototype.toggleDropdown = function () {
5617
+ if (this.options.get('disabled')) {
5618
+ return;
5619
+ }
5620
+
5621
+ if (this.isOpen()) {
5622
+ this.close();
5623
+ } else {
5624
+ this.open();
5625
+ }
5626
+ };
5627
+
5628
+ Select2.prototype.open = function () {
5629
+ if (this.isOpen()) {
5630
+ return;
5631
+ }
5632
+
5633
+ this.trigger('query', {});
5634
+ };
5635
+
5636
+ Select2.prototype.close = function () {
5637
+ if (!this.isOpen()) {
5638
+ return;
5639
+ }
5640
+
5641
+ this.trigger('close', {});
5642
+ };
5643
+
5644
+ Select2.prototype.isOpen = function () {
5645
+ return this.$container.hasClass('select2-container--open');
5646
+ };
5647
+
5648
+ Select2.prototype.hasFocus = function () {
5649
+ return this.$container.hasClass('select2-container--focus');
5650
+ };
5651
+
5652
+ Select2.prototype.focus = function (data) {
5653
+ // No need to re-trigger focus events if we are already focused
5654
+ if (this.hasFocus()) {
5655
+ return;
5656
+ }
5657
+
5658
+ this.$container.addClass('select2-container--focus');
5659
+ this.trigger('focus', {});
5660
+ };
5661
+
5662
+ Select2.prototype.enable = function (args) {
5663
+ if (this.options.get('debug') && window.console && console.warn) {
5664
+ console.warn(
5665
+ 'Select2: The `select2("enable")` method has been deprecated and will' +
5666
+ ' be removed in later Select2 versions. Use $element.prop("disabled")' +
5667
+ ' instead.'
5668
+ );
5669
+ }
5670
+
5671
+ if (args == null || args.length === 0) {
5672
+ args = [true];
5673
+ }
5674
+
5675
+ var disabled = !args[0];
5676
+
5677
+ this.$element.prop('disabled', disabled);
5678
+ };
5679
+
5680
+ Select2.prototype.data = function () {
5681
+ if (this.options.get('debug') &&
5682
+ arguments.length > 0 && window.console && console.warn) {
5683
+ console.warn(
5684
+ 'Select2: Data can no longer be set using `select2("data")`. You ' +
5685
+ 'should consider setting the value instead using `$element.val()`.'
5686
+ );
5687
+ }
5688
+
5689
+ var data = [];
5690
+
5691
+ this.dataAdapter.current(function (currentData) {
5692
+ data = currentData;
5693
+ });
5694
+
5695
+ return data;
5696
+ };
5697
+
5698
+ Select2.prototype.val = function (args) {
5699
+ if (this.options.get('debug') && window.console && console.warn) {
5700
+ console.warn(
5701
+ 'Select2: The `select2("val")` method has been deprecated and will be' +
5702
+ ' removed in later Select2 versions. Use $element.val() instead.'
5703
+ );
5704
+ }
5705
+
5706
+ if (args == null || args.length === 0) {
5707
+ return this.$element.val();
5708
+ }
5709
+
5710
+ var newVal = args[0];
5711
+
5712
+ if ($.isArray(newVal)) {
5713
+ newVal = $.map(newVal, function (obj) {
5714
+ return obj.toString();
5715
+ });
5716
+ }
5717
+
5718
+ this.$element.val(newVal).trigger('change');
5719
+ };
5720
+
5721
+ Select2.prototype.destroy = function () {
5722
+ this.$container.remove();
5723
+
5724
+ if (this.$element[0].detachEvent) {
5725
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
5726
+ }
5727
+
5728
+ if (this._observer != null) {
5729
+ this._observer.disconnect();
5730
+ this._observer = null;
5731
+ } else if (this.$element[0].removeEventListener) {
5732
+ this.$element[0]
5733
+ .removeEventListener('DOMAttrModified', this._syncA, false);
5734
+ this.$element[0]
5735
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
5736
+ this.$element[0]
5737
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
5738
+ }
5739
+
5740
+ this._syncA = null;
5741
+ this._syncS = null;
5742
+
5743
+ this.$element.off('.select2');
5744
+ this.$element.attr('tabindex', this.$element.data('old-tabindex'));
5745
+
5746
+ this.$element.removeClass('select2-hidden-accessible');
5747
+ this.$element.attr('aria-hidden', 'false');
5748
+ this.$element.removeData('select2');
5749
+
5750
+ this.dataAdapter.destroy();
5751
+ this.selection.destroy();
5752
+ this.dropdown.destroy();
5753
+ this.results.destroy();
5754
+
5755
+ this.dataAdapter = null;
5756
+ this.selection = null;
5757
+ this.dropdown = null;
5758
+ this.results = null;
5759
+ };
5760
+
5761
+ Select2.prototype.render = function () {
5762
+ var $container = $(
5763
+ '<span class="select2 select2-container">' +
5764
+ '<span class="selection"></span>' +
5765
+ '<span class="dropdown-wrapper" aria-hidden="true"></span>' +
5766
+ '</span>'
5767
+ );
5768
+
5769
+ $container.attr('dir', this.options.get('dir'));
5770
+
5771
+ this.$container = $container;
5772
+
5773
+ this.$container.addClass('select2-container--' + this.options.get('theme'));
5774
+
5775
+ $container.data('element', this.$element);
5776
+
5777
+ return $container;
5778
+ };
5779
+
5780
+ return Select2;
5781
+ });
5782
+
5783
+ S2.define('jquery-mousewheel',[
5784
+ 'jquery'
5785
+ ], function ($) {
5786
+ // Used to shim jQuery.mousewheel for non-full builds.
5787
+ return $;
5788
+ });
5789
+
5790
+ S2.define('jquery.select2',[
5791
+ 'jquery',
5792
+ 'jquery-mousewheel',
5793
+
5794
+ './select2/core',
5795
+ './select2/defaults'
5796
+ ], function ($, _, Select2, Defaults) {
5797
+ if ($.fn.selectWoo == null) {
5798
+ // All methods that should return the element
5799
+ var thisMethods = ['open', 'close', 'destroy'];
5800
+
5801
+ $.fn.selectWoo = function (options) {
5802
+ options = options || {};
5803
+
5804
+ if (typeof options === 'object') {
5805
+ this.each(function () {
5806
+ var instanceOptions = $.extend(true, {}, options);
5807
+
5808
+ var instance = new Select2($(this), instanceOptions);
5809
+ });
5810
+
5811
+ return this;
5812
+ } else if (typeof options === 'string') {
5813
+ var ret;
5814
+ var args = Array.prototype.slice.call(arguments, 1);
5815
+
5816
+ this.each(function () {
5817
+ var instance = $(this).data('select2');
5818
+
5819
+ if (instance == null && window.console && console.error) {
5820
+ console.error(
5821
+ 'The select2(\'' + options + '\') method was called on an ' +
5822
+ 'element that is not using Select2.'
5823
+ );
5824
+ }
5825
+
5826
+ ret = instance[options].apply(instance, args);
5827
+ });
5828
+
5829
+ // Check if we should be returning `this`
5830
+ if ($.inArray(options, thisMethods) > -1) {
5831
+ return this;
5832
+ }
5833
+
5834
+ return ret;
5835
+ } else {
5836
+ throw new Error('Invalid arguments for Select2: ' + options);
5837
+ }
5838
+ };
5839
+ }
5840
+
5841
+ if ($.fn.select2 != null && $.fn.select2.defaults != null) {
5842
+ $.fn.selectWoo.defaults = $.fn.select2.defaults;
5843
+ }
5844
+
5845
+ if ($.fn.selectWoo.defaults == null) {
5846
+ $.fn.selectWoo.defaults = Defaults;
5847
+ }
5848
+
5849
+ // Also register selectWoo under select2 if select2 is not already present.
5850
+ $.fn.select2 = $.fn.select2 || $.fn.selectWoo;
5851
+
5852
+ return Select2;
5853
+ });
5854
+
5855
+ // Return the AMD loader configuration so it can be used outside of this file
5856
+ return {
5857
+ define: S2.define,
5858
+ require: S2.require
5859
+ };
5860
+ }());
5861
+
5862
+ // Autoload the jQuery bindings
5863
+ // We know that all of the modules exist above this, so we're safe
5864
+ var select2 = S2.require('jquery.select2');
5865
+
5866
+ // Hold the AMD module references on the jQuery function that was just loaded
5867
+ // This allows Select2 to use the internal loader outside of this file, such
5868
+ // as in the language files.
5869
+ jQuery.fn.select2.amd = S2;
5870
+ jQuery.fn.selectWoo.amd = S2;
5871
+
5872
+ // Return the Select2 instance for anyone who is importing it.
5873
+ return select2;
5874
+ }));
models/slide.php CHANGED
@@ -82,6 +82,18 @@ class GallerySlide extends GalleryDbHelper {
82
  return true;
83
  }
84
 
 
 
 
 
 
 
 
 
 
 
 
 
85
  function defaults() {
86
  $defaults = array(
87
  'galleries' => false,
82
  return true;
83
  }
84
 
85
+ function is_expired($slide_id = null) {
86
+ if (!empty($slide_id)) {
87
+ if ($slide = $this -> Slide() -> find(array('id' => $slide_id))) {
88
+ if (!empty($slide -> expiry) && strtotime($slide -> expiry) < time()) {
89
+ return true;
90
+ }
91
+ }
92
+ }
93
+
94
+ return false;
95
+ }
96
+
97
  function defaults() {
98
  $defaults = array(
99
  'galleries' => false,
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: contrid
3
  Donate link: https://tribulant.com/
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 3.1
6
- Tested up to: 5.1.1
7
- Stable tag: 1.6.10
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
@@ -175,6 +175,15 @@ There is an "Images Tester" utility under Slideshow > Settings on the right-hand
175
 
176
  == Changelog ==
177
 
 
 
 
 
 
 
 
 
 
178
  = 1.6.10 =
179
  * ADD: WordPress 5+ compatibility
180
 
3
  Donate link: https://tribulant.com/
4
  Tags: wordpress plugins, wordpress slideshow gallery, slides, slideshow, image gallery, images, gallery, featured content, content gallery, javascript, javascript slideshow, slideshow gallery
5
  Requires at least: 3.1
6
+ Tested up to: 5.2.1
7
+ Stable tag: 1.6.11
8
 
9
  Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website
10
 
175
 
176
  == Changelog ==
177
 
178
+ = 1.6.11 =
179
+ * ADD: Variable buttons when saving multiple slides for Alt, Caption, etc.
180
+ * ADD: Polylang multilingual integration
181
+ * ADD: WPGlobus multilingual integration
182
+ * IMPROVE: Make Select2 select drop downs accessible by screen readers
183
+ * IMPROVE: Make Colorbox translatable
184
+ * FIX: Expired slides are showing up in the ordering screen
185
+ * FIX: Apostrophe in gallery title/name won't save
186
+
187
  = 1.6.10 =
188
  * ADD: WordPress 5+ compatibility
189
 
select2.css ADDED
@@ -0,0 +1,484 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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[data-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[data-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[data-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[data-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; }
slideshow-gallery-plugin.php CHANGED
@@ -4,7 +4,7 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
4
 
5
  class GalleryPlugin extends GalleryCheckinit {
6
 
7
- var $version = '1.6.10';
8
  var $plugin_name;
9
  var $plugin_base;
10
  var $pre = 'Gallery';
@@ -17,6 +17,7 @@ class GalleryPlugin extends GalleryCheckinit {
17
  'slides' => 'slideshow-slides',
18
  'galleries' => 'slideshow-galleries',
19
  'settings' => 'slideshow-settings',
 
20
  );
21
 
22
  var $helpers = array('Db', 'Html', 'Form', 'Metabox');
@@ -128,10 +129,10 @@ class GalleryPlugin extends GalleryCheckinit {
128
  /**
129
  * This function outputs the changelog on the 'Plugins' page when the "View Details" link is clicked.
130
  */
131
- function display_changelog() {
132
- if (!empty($_GET['plugin']) && $_GET['plugin'] == $this -> plugin_name) {
133
  $update = $this -> vendor('update');
134
- if ($changelog = $update -> get_changelog()) {
135
  $this -> render('changelog', array('changelog' => $changelog), true, 'admin');
136
  }
137
 
@@ -316,10 +317,10 @@ class GalleryPlugin extends GalleryCheckinit {
316
  $version = "1.5.3";
317
  }
318
 
319
- if (version_compare($cur_version, "1.6.10") < 0) {
320
  $this -> initialize_options();
321
 
322
- $version = "1.6.10";
323
  }
324
 
325
  //the current version is older.
@@ -662,6 +663,13 @@ class GalleryPlugin extends GalleryCheckinit {
662
 
663
  return true;
664
  }
 
 
 
 
 
 
 
665
 
666
  function plugin_base() {
667
  return rtrim(dirname(__FILE__), '/');
@@ -989,6 +997,14 @@ class GalleryPlugin extends GalleryCheckinit {
989
  case 'qtranslate-x' :
990
  $url = qtranxf_convertURL($url, $language);
991
  break;
 
 
 
 
 
 
 
 
992
  case 'wpml' :
993
  if (function_exists('icl_get_languages')) {
994
  $languages = icl_get_languages();
@@ -1019,6 +1035,16 @@ class GalleryPlugin extends GalleryCheckinit {
1019
  global $q_config;
1020
  $default = $q_config['default_language'];
1021
  break;
 
 
 
 
 
 
 
 
 
 
1022
  case 'wpml' :
1023
  global $sitepress;
1024
  $default = $sitepress -> get_default_language();
@@ -1045,6 +1071,17 @@ class GalleryPlugin extends GalleryCheckinit {
1045
  global $q_config;
1046
  $name = $q_config['language_name'][$language];
1047
  break;
 
 
 
 
 
 
 
 
 
 
 
1048
  case 'wpml' :
1049
  if (function_exists('icl_get_languages')) {
1050
  $languages = icl_get_languages();
@@ -1081,6 +1118,12 @@ class GalleryPlugin extends GalleryCheckinit {
1081
 
1082
  $slideshow_languageplugin = "wpml";
1083
  return true;
 
 
 
 
 
 
1084
  }
1085
  } else {
1086
  return true;
@@ -1088,6 +1131,51 @@ class GalleryPlugin extends GalleryCheckinit {
1088
 
1089
  return false;
1090
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1091
 
1092
  function language_current() {
1093
  global $slideshow_languageplugin, $slideshow_languagecurrent;
@@ -1108,6 +1196,20 @@ class GalleryPlugin extends GalleryCheckinit {
1108
  $current = qtranxf_getLanguage();
1109
  }
1110
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1111
  case 'wpml' :
1112
  $current = ICL_LANGUAGE_CODE;
1113
  break;
@@ -1131,6 +1233,16 @@ class GalleryPlugin extends GalleryCheckinit {
1131
  global $q_config;
1132
  $flag = '<img src="' . content_url() . '/' . $q_config['flag_location'] . '/' . $q_config['flag'][$language] . '" alt="' . $language . '" />';
1133
  break;
 
 
 
 
 
 
 
 
 
 
1134
  case 'wpml' :
1135
  if (function_exists('icl_get_languages')) {
1136
  $languages = icl_get_languages();
@@ -1160,6 +1272,21 @@ class GalleryPlugin extends GalleryCheckinit {
1160
  case 'qtranslate-x' :
1161
  $enabled = qtranxf_isEnabled($language);
1162
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1163
  case 'wpml' :
1164
  if (function_exists('icl_get_languages')) {
1165
  $languages = icl_get_languages();
@@ -1302,6 +1429,21 @@ class GalleryPlugin extends GalleryCheckinit {
1302
  $languages = qtranxf_getSortedLanguages();
1303
  }
1304
  break;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1305
  case 'wpml' :
1306
  if (function_exists('icl_get_languages')) {
1307
  $icl_languages = icl_get_languages();
@@ -1329,6 +1471,12 @@ class GalleryPlugin extends GalleryCheckinit {
1329
  case 'qtranslate-x' :
1330
  $path = 'qtranslate-x' . DS . 'qtranslate.php';
1331
  break;
 
 
 
 
 
 
1332
  case 'wpml' :
1333
  $path = 'sitepress-multilingual-cms' . DS . 'sitepress.php';
1334
  break;
4
 
5
  class GalleryPlugin extends GalleryCheckinit {
6
 
7
+ var $version = '1.6.11';
8
  var $plugin_name;
9
  var $plugin_base;
10
  var $pre = 'Gallery';
17
  'slides' => 'slideshow-slides',
18
  'galleries' => 'slideshow-galleries',
19
  'settings' => 'slideshow-settings',
20
+ 'settings_updates' => 'slideshow-settings-updates',
21
  );
22
 
23
  var $helpers = array('Db', 'Html', 'Form', 'Metabox');
129
  /**
130
  * This function outputs the changelog on the 'Plugins' page when the "View Details" link is clicked.
131
  */
132
+ function display_changelog() {
133
+ if (!empty($_GET['plugin']) && $_GET['plugin'] == $this -> plugin_name) {
134
  $update = $this -> vendor('update');
135
+ if ($changelog = $update -> get_changelog()) {
136
  $this -> render('changelog', array('changelog' => $changelog), true, 'admin');
137
  }
138
 
317
  $version = "1.5.3";
318
  }
319
 
320
+ if (version_compare($cur_version, "1.6.11") < 0) {
321
  $this -> initialize_options();
322
 
323
+ $version = "1.6.11";
324
  }
325
 
326
  //the current version is older.
663
 
664
  return true;
665
  }
666
+
667
+ function plugin_update_link() {
668
+ //https://slideshow.tribulant.co/wp-admin/update.php?action=upgrade-plugin&plugin=slideshow-gallery%2Fslideshow-gallery.php&_wpnonce=6533f071ab
669
+ $link = wp_nonce_url(admin_url('update.php?action=upgrade-plugin&plugin=' . $this -> plugin_base()));
670
+
671
+ return $link;
672
+ }
673
 
674
  function plugin_base() {
675
  return rtrim(dirname(__FILE__), '/');
997
  case 'qtranslate-x' :
998
  $url = qtranxf_convertURL($url, $language);
999
  break;
1000
+ case 'polylang' :
1001
+ $url = add_query_arg(array('lang' => $language), $url);
1002
+ break;
1003
+ case 'wpglobus' :
1004
+ if (class_exists('WPGlobus_Utils')) {
1005
+ $url = WPGlobus_Utils::localize_url($url, $language);
1006
+ }
1007
+ break;
1008
  case 'wpml' :
1009
  if (function_exists('icl_get_languages')) {
1010
  $languages = icl_get_languages();
1035
  global $q_config;
1036
  $default = $q_config['default_language'];
1037
  break;
1038
+ case 'polylang' :
1039
+ if (function_exists('pll_default_language')) {
1040
+ $default = pll_default_language();
1041
+ }
1042
+ break;
1043
+ case 'wpglobus' :
1044
+ if (class_exists('WPGlobus')) {
1045
+ $default = WPGlobus::Config() -> default_language;
1046
+ }
1047
+ break;
1048
  case 'wpml' :
1049
  global $sitepress;
1050
  $default = $sitepress -> get_default_language();
1071
  global $q_config;
1072
  $name = $q_config['language_name'][$language];
1073
  break;
1074
+ case 'polylang' :
1075
+ global $polylang;
1076
+ if ($pll_language = $polylang -> model -> get_language($language)) {
1077
+ $name = $pll_language -> name;
1078
+ }
1079
+ break;
1080
+ case 'wpglobus' :
1081
+ if (class_exists('WPGlobus')) {
1082
+ $name = WPGlobus::Config() -> language_name[$language];
1083
+ }
1084
+ break;
1085
  case 'wpml' :
1086
  if (function_exists('icl_get_languages')) {
1087
  $languages = icl_get_languages();
1118
 
1119
  $slideshow_languageplugin = "wpml";
1120
  return true;
1121
+ } elseif ($this -> is_plugin_active('polylang')) {
1122
+ $slideshow_languageplugin = "polylang";
1123
+ $result = true;
1124
+ } elseif ($this -> is_plugin_active('wpglobus')) {
1125
+ $slideshow_languageplugin = "wpglobus";
1126
+ $result = true;
1127
  }
1128
  } else {
1129
  return true;
1131
 
1132
  return false;
1133
  }
1134
+
1135
+ function language_set($language = null) {
1136
+ global $slideshow_languageplugin, $slideshow_languagecurrent;
1137
+ $this -> language_do();
1138
+
1139
+ do_action('slideshow_language_set_before', $language, $slideshow_languageplugin);
1140
+
1141
+ if (!empty($language) && !empty($slideshow_languageplugin)) {
1142
+ $slideshow_languagecurrent = $language;
1143
+
1144
+ switch ($slideshow_languageplugin) {
1145
+ case 'qtranslate' :
1146
+ case 'qtranslate-x' :
1147
+ if (function_exists('qtranxf_set_language_cookie')) {
1148
+ qtranxf_set_language_cookie($language);
1149
+ }
1150
+ break;
1151
+ case 'polylang' :
1152
+ global $polylang;
1153
+ if ($pll_language = $polylang -> model -> get_language($language)) {
1154
+ $polylang -> curlang = $pll_language;
1155
+ }
1156
+ break;
1157
+ case 'wpglobus' :
1158
+ if (class_exists('WPGlobus')) {
1159
+ WPGlobus::Config() -> set_language($language);
1160
+ }
1161
+ break;
1162
+ case 'wpml' :
1163
+ global $sitepress;
1164
+ if (method_exists($sitepress, 'switch_lang')) {
1165
+ $sitepress -> switch_lang($language, true);
1166
+ }
1167
+ break;
1168
+ }
1169
+
1170
+ do_action('slideshow_language_set_success', $language, $slideshow_languageplugin);
1171
+
1172
+ return true;
1173
+ }
1174
+
1175
+ do_action('slideshow_language_set_failed', $language, $slideshow_languageplugin);
1176
+
1177
+ return false;
1178
+ }
1179
 
1180
  function language_current() {
1181
  global $slideshow_languageplugin, $slideshow_languagecurrent;
1196
  $current = qtranxf_getLanguage();
1197
  }
1198
  break;
1199
+ case 'polylang' :
1200
+ if (function_exists('pll_current_language') && function_exists('pll_default_language')) {
1201
+ $current = pll_current_language();
1202
+
1203
+ if (empty($current)) {
1204
+ $current = pll_default_language();
1205
+ }
1206
+ }
1207
+ break;
1208
+ case 'wpglobus' :
1209
+ if (class_exists('WPGlobus')) {
1210
+ $current = WPGlobus::Config() -> language;
1211
+ }
1212
+ break;
1213
  case 'wpml' :
1214
  $current = ICL_LANGUAGE_CODE;
1215
  break;
1233
  global $q_config;
1234
  $flag = '<img src="' . content_url() . '/' . $q_config['flag_location'] . '/' . $q_config['flag'][$language] . '" alt="' . $language . '" />';
1235
  break;
1236
+ case 'polylang' :
1237
+ global $polylang;
1238
+ $pll_language = $polylang -> model -> get_language($language);
1239
+ $flag = $pll_language -> flag;
1240
+ break;
1241
+ case 'wpglobus' :
1242
+ if (class_exists('WPGlobus')) {
1243
+ $flag = '<img src="' . WPGlobus::Config() -> flags_url . WPGlobus::Config() -> flag[$language] . '" alt="' . $language . '" />';
1244
+ }
1245
+ break;
1246
  case 'wpml' :
1247
  if (function_exists('icl_get_languages')) {
1248
  $languages = icl_get_languages();
1272
  case 'qtranslate-x' :
1273
  $enabled = qtranxf_isEnabled($language);
1274
  break;
1275
+ case 'polylang' :
1276
+ global $polylang;
1277
+ if ($pll_language = $polylang -> model -> get_language($language)) {
1278
+ if (empty($pll_language -> active) || $pll_language -> active == true) {
1279
+ $enabled = true;
1280
+ }
1281
+ }
1282
+ break;
1283
+ case 'wpglobus' :
1284
+ if (class_exists('WPGlobus_Utils')) {
1285
+ if (WPGlobus_Utils::is_enabled($language)) {
1286
+ $enabled = true;
1287
+ }
1288
+ }
1289
+ break;
1290
  case 'wpml' :
1291
  if (function_exists('icl_get_languages')) {
1292
  $languages = icl_get_languages();
1429
  $languages = qtranxf_getSortedLanguages();
1430
  }
1431
  break;
1432
+ case 'polylang' :
1433
+ global $polylang;
1434
+ if (!empty($polylang -> model) && method_exists($polylang -> model, 'get_languages_list')) {
1435
+ if ($pll_languages = $polylang -> model -> get_languages_list()) {
1436
+ foreach ($pll_languages as $lang) {
1437
+ $languages[] = $lang -> slug;
1438
+ }
1439
+ }
1440
+ }
1441
+ break;
1442
+ case 'wpglobus' :
1443
+ if (class_exists('WPGlobus')) {
1444
+ $languages = WPGlobus::Config() -> enabled_languages;
1445
+ }
1446
+ break;
1447
  case 'wpml' :
1448
  if (function_exists('icl_get_languages')) {
1449
  $icl_languages = icl_get_languages();
1471
  case 'qtranslate-x' :
1472
  $path = 'qtranslate-x' . DS . 'qtranslate.php';
1473
  break;
1474
+ case 'polylang' :
1475
+ $path = 'polylang' . DS . 'polylang.php';
1476
+ break;
1477
+ case 'wpglobus' :
1478
+ $path = 'wpglobus' . DS . 'wpglobus.php';
1479
+ break;
1480
  case 'wpml' :
1481
  $path = 'sitepress-multilingual-cms' . DS . 'sitepress.php';
1482
  break;
slideshow-gallery.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: https://tribulant.com/plugins/view/13/wordpress-slideshow-gallery
6
  Author: Tribulant Software
7
  Author URI: https://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. See the <a href="https://tribulant.com/docs/wordpress-slideshow-gallery/1758/wordpress-slideshow-gallery-plugin/" target="_blank">online documentation</a> for instructions on using and embedding slideshow galleries.
9
- Version: 1.6.10
10
  License: GNU General Public License v2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
  Tags: slideshow gallery, slideshow, gallery, slider, jquery, bfithumb, galleries, photos, images
@@ -187,10 +187,12 @@ if (!class_exists('SlideshowGallery')) {
187
  function admin_menu() {
188
  $update_icon = ($this -> has_update()) ? ' <span class="update-plugins count-1"><span class="update-count">1</span></span>' : '';
189
  $this -> check_roles();
 
190
  add_menu_page(__('Slideshow', 'slideshow-gallery'), __('Slideshow', 'slideshow-gallery') . $update_icon, 'slideshow_slides', $this -> sections -> slides, array($this, 'admin_slides'), false, "26.113");
191
  $this -> menus['slideshow-slides'] = add_submenu_page($this -> sections -> slides, __('Manage Slides', 'slideshow-gallery'), __('Manage Slides', 'slideshow-gallery'), 'slideshow_slides', $this -> sections -> slides, array($this, 'admin_slides'));
192
  $this -> menus['slideshow-galleries'] = add_submenu_page($this -> sections -> slides, __('Manage Galleries', 'slideshow-gallery'), __('Manage Galleries', 'slideshow-gallery'), 'slideshow_galleries', $this -> sections -> galleries, array($this, 'admin_galleries'));
193
  $this -> menus['slideshow-settings'] = add_submenu_page($this -> sections -> slides, __('Settings', 'slideshow-gallery'), __('Settings', 'slideshow-gallery'), 'slideshow_settings', $this -> sections -> settings, array($this, 'admin_settings'));
 
194
 
195
  if (!$this -> ci_serial_valid()) {
196
  $this -> menus['slideshow-submitserial'] = add_submenu_page($this -> sections -> slides, __('Submit Serial Key', 'slideshow-gallery'), __('Submit Serial Key', 'slideshow-gallery'), 'slideshow_submitserial', $this -> sections -> submitserial, array($this, 'admin_submitserial'));
@@ -379,6 +381,20 @@ if (!class_exists('SlideshowGallery')) {
379
  <?php
380
  }
381
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
382
  }
383
 
384
  }
@@ -793,6 +809,8 @@ if (!class_exists('SlideshowGallery')) {
793
  $slides = $_POST['Slide']['slides'];
794
  $galleries = $_POST['Slide']['galleries'];
795
 
 
 
796
  foreach ($slides as $attachment_id => $slide) {
797
  $slide_data = array(
798
  'Slide' => array(
@@ -808,8 +826,11 @@ if (!class_exists('SlideshowGallery')) {
808
  );
809
 
810
  if (!$this -> Slide() -> save($slide_data)) {
811
- $errors = array_merge($errors, $this -> Slide() -> errors);
 
812
  }
 
 
813
  }
814
 
815
  if (empty($errors)) {
@@ -1068,6 +1089,18 @@ if (!class_exists('SlideshowGallery')) {
1068
  }
1069
  }
1070
 
 
 
 
 
 
 
 
 
 
 
 
 
1071
  function activation_hook() {
1072
  $this -> add_option('activation_redirect', true);
1073
  }
@@ -1090,6 +1123,12 @@ if (!class_exists('SlideshowGallery')) {
1090
  }
1091
  }
1092
  break;
 
 
 
 
 
 
1093
  }
1094
  }
1095
 
6
  Author: Tribulant Software
7
  Author URI: https://tribulant.com
8
  Description: Feature content in a JavaScript powered slideshow gallery showcase on your WordPress website. The slideshow is flexible and all aspects can easily be configured. Embedding or hardcoding the slideshow gallery is a breeze. See the <a href="https://tribulant.com/docs/wordpress-slideshow-gallery/1758/wordpress-slideshow-gallery-plugin/" target="_blank">online documentation</a> for instructions on using and embedding slideshow galleries.
9
+ Version: 1.6.11
10
  License: GNU General Public License v2 or later
11
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
12
  Tags: slideshow gallery, slideshow, gallery, slider, jquery, bfithumb, galleries, photos, images
187
  function admin_menu() {
188
  $update_icon = ($this -> has_update()) ? ' <span class="update-plugins count-1"><span class="update-count">1</span></span>' : '';
189
  $this -> check_roles();
190
+
191
  add_menu_page(__('Slideshow', 'slideshow-gallery'), __('Slideshow', 'slideshow-gallery') . $update_icon, 'slideshow_slides', $this -> sections -> slides, array($this, 'admin_slides'), false, "26.113");
192
  $this -> menus['slideshow-slides'] = add_submenu_page($this -> sections -> slides, __('Manage Slides', 'slideshow-gallery'), __('Manage Slides', 'slideshow-gallery'), 'slideshow_slides', $this -> sections -> slides, array($this, 'admin_slides'));
193
  $this -> menus['slideshow-galleries'] = add_submenu_page($this -> sections -> slides, __('Manage Galleries', 'slideshow-gallery'), __('Manage Galleries', 'slideshow-gallery'), 'slideshow_galleries', $this -> sections -> galleries, array($this, 'admin_galleries'));
194
  $this -> menus['slideshow-settings'] = add_submenu_page($this -> sections -> slides, __('Settings', 'slideshow-gallery'), __('Settings', 'slideshow-gallery'), 'slideshow_settings', $this -> sections -> settings, array($this, 'admin_settings'));
195
+ $this -> menus['slideshow-settings-updates'] = add_submenu_page($this -> sections -> slides, __('Updates', 'slideshow-gallery'), __('Updates', 'slideshow-gallery') . $update_icon, 'slideshow_settings_updates', $this -> sections -> settings_updates, array($this, 'admin_settings_updates'));
196
 
197
  if (!$this -> ci_serial_valid()) {
198
  $this -> menus['slideshow-submitserial'] = add_submenu_page($this -> sections -> slides, __('Submit Serial Key', 'slideshow-gallery'), __('Submit Serial Key', 'slideshow-gallery'), 'slideshow_submitserial', $this -> sections -> submitserial, array($this, 'admin_submitserial'));
381
  <?php
382
  }
383
  }
384
+
385
+ // Is an Update Available?
386
+ if (!empty($_GET['page']) && in_array($_GET['page'], (array) $this -> sections)) {
387
+ if (apply_filters('slideshow_updates', true)) {
388
+ if (current_user_can('edit_plugins') && $this -> has_update() && (empty($_GET['page']) || (!empty($_GET['page']) && $_GET['page'] != $this -> sections -> settings_updates))) {
389
+ $hideupdate = $this -> get_option('hideupdate');
390
+ if (empty($hideupdate) || (!empty($hideupdate) && version_compare($this -> version, $hideupdate, '>'))) {
391
+ $update = $this -> vendor('update');
392
+ $update_info = $update -> get_version_info();
393
+ $this -> render('update', array('update_info' => $update_info), true, 'admin');
394
+ }
395
+ }
396
+ }
397
+ }
398
  }
399
 
400
  }
809
  $slides = $_POST['Slide']['slides'];
810
  $galleries = $_POST['Slide']['galleries'];
811
 
812
+ $s = 0;
813
+
814
  foreach ($slides as $attachment_id => $slide) {
815
  $slide_data = array(
816
  'Slide' => array(
826
  );
827
 
828
  if (!$this -> Slide() -> save($slide_data)) {
829
+ //$errors = array_merge($errors, $this -> Slide() -> errors);
830
+ $errors[$s] = $this -> Slide() -> errors;
831
  }
832
+
833
+ $s++;
834
  }
835
 
836
  if (empty($errors)) {
1089
  }
1090
  }
1091
 
1092
+ function admin_settings_updates() {
1093
+ $method = esc_html($_GET['method']);
1094
+ switch ($method) {
1095
+ case 'check' :
1096
+ delete_transient('slideshow_update_info');
1097
+ $this -> redirect($this -> referer);
1098
+ break;
1099
+ }
1100
+
1101
+ $this -> render('settings-updates', false, true, 'admin');
1102
+ }
1103
+
1104
  function activation_hook() {
1105
  $this -> add_option('activation_redirect', true);
1106
  }
1123
  }
1124
  }
1125
  break;
1126
+ case 'hideupdate' :
1127
+ if (!empty($_GET['version'])) {
1128
+ $this -> update_option('hideupdate', esc_html($_GET['version']));
1129
+ $this -> redirect($this -> referer);
1130
+ }
1131
+ break;
1132
  }
1133
  }
1134
 
vendors/class.update.php CHANGED
@@ -7,8 +7,7 @@ if (!class_exists('Galleryupdate')) {
7
 
8
  }
9
 
10
- function get_changelog(){
11
-
12
  $options = array('method' => 'POST', 'timeout' => 20);
13
  $options['headers'] = array(
14
  'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'),
7
 
8
  }
9
 
10
+ function get_changelog() {
 
11
  $options = array('method' => 'POST', 'timeout' => 20);
12
  $options['headers'] = array(
13
  'Content-Type' => 'application/x-www-form-urlencoded; charset=' . get_option('blog_charset'),
views/admin/about.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Newsletters About Dashboard v4.5
4
  */
5
 
6
  /**
1
  <?php
2
  /**
3
+ * Slideshow About Dashboard v4.5
4
  */
5
 
6
  /**
views/admin/changelog.php ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div id="tribulant_header_full">
2
+ <div id="tribulant_header">
3
+ <a id="tribulant_logo" href="https://tribulant.com" target="_blank">
4
+ Tribulant Plugin
5
+ </a>
6
+ </div>
7
+ </div>
8
+ <div id="tribulant_content_full">
9
+ <div id="tribulant_content">
10
+ <h1>WordPress Slideshow Gallery plugin - Changelog</h1>
11
+ <?php if (!empty($changelog)) : ?>
12
+ <?php echo stripslashes($changelog); ?>
13
+ <?php else : ?>
14
+ <?php echo __('No changelog is available for this release yet, please check back later.', 'slideshow-gallery'); ?>
15
+ <?php endif; ?>
16
+ </div>
17
+ </div>
18
+ <div id="tribulant_footer_full">
19
+ <div id="tribulant_footer">
20
+ <a href="https://tribulant.com" target="_blank">Tribulant - All rights reserved</a>
21
+ </div>
22
+ </div>
23
+
24
+ <style type="text/css">
25
+ *, html, body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, label, fieldset, input, p, blockquote, th, td{margin:0;padding:0}
26
+ table{border-collapse:collapse;border-spacing:0}
27
+ fieldset, img{border:0}
28
+ address, caption, cite, code, dfn, em, strong, th, var{font-style:normal;font-weight:normal}
29
+ ol, ul, li{list-style:none}
30
+ caption, th{text-align:left}
31
+ h1, h2, h3, h4, h5, h6{font-size:100%;font-weight:normal}
32
+ strong{font-weight:bold}
33
+ em{font-style:italic}
34
+ a img{border:none}
35
+ div { position:relative; }
36
+ body { color:#666; font-size:14px; line-height:21px; font-family:Arial, sans-serif; }
37
+ h3 { color:#213123; }
38
+ #tribulant_header_full, #tribulant_footer_full, #tribulant_content_full { width:100%; clear:both; }
39
+ #tribulant_header_full { background:url('https://tribulant.com/blog/wp-content/themes/fusion/style/images/bg-header.png') repeat; }
40
+ #tribulant_header, #tribulant_footer, #tribulant_content { padding:30px 32px; }
41
+ #tribulant_logo { background:url('https://tribulant.com/blog/wp-content/themes/fusion/style/images/logo.png') no-repeat; text-indent:-9999px; width:251px; height:59px; display:block; }
42
+ #tribulant_content_full { padding-top:20px; position:relative;}
43
+ #tribulant_content { position:relative; }
44
+ h1 { font-size:26px; padding-bottom:18px; line-height:26px; width:100%; clear:both;}
45
+ h2 { font-size:21px; padding-bottom:18px; line-height:26px; width:100%; clear:both;}
46
+ h3 { font-size:16px; padding-bottom:8px; color:#888; line-height:21px; width:100%; padding-right:10px; display:inline-block; z-index:9999; }
47
+ #tribulant_content_full ul { width:100%; padding-bottom:15px; padding-right:10px; display:inline-block; z-index:9999; }
48
+ #tribulant_content_full ul li { padding-left:5px; width:100%; line-height:26px; list-style-position:inside; list-style-type:disc; z-index:9999; }
49
+ #tribulant_sidebar { width:175px; position:absolute; left:0; margin-left:440px; top:50px; z-index:1;}
50
+ #tribulant_sidebar a { display:block; width:165px; color:#1780CD; line-height:32px; border-bottom:1px dotted #CCC; text-decoration:none; overflow:hidden; }
51
+ #tribulant_sidebar a:hover { text-decoration:underline; }
52
+ #tribulant_footer { text-align:center; font-size:12px; }
53
+ #tribulant_footer a { color:#888; text-decoration:none; height:42px; line-height:42px; }
54
+ </style>
views/admin/lite-upgrade.php CHANGED
@@ -50,7 +50,7 @@ $plugin_link = "https://tribulant.com/plugins/view/13/wordpress-slideshow-galler
50
 
51
  <div class="changelog slideshow-changelog">
52
  <h3>About Tribulant Software</h3>
53
- <p><a href="https://tribulant.com" target="_blank"><img src="<?php echo $this -> url(); ?>/images/logo.png" alt="tribulant" /></a></p>
54
  <p>At Tribulant Software, we strive to provide the best WordPress plugins on the market.<br/>
55
  We are a full-time business developing, promoting and supporting WordPress plugins to the community.</p>
56
  <p>
50
 
51
  <div class="changelog slideshow-changelog">
52
  <h3>About Tribulant Software</h3>
53
+ <p><a href="https://tribulant.com" target="_blank"><img style="width:300px;" src="<?php echo $this -> url(); ?>/images/logo.png" alt="tribulant" /></a></p>
54
  <p>At Tribulant Software, we strive to provide the best WordPress plugins on the market.<br/>
55
  We are a full-time business developing, promoting and supporting WordPress plugins to the community.</p>
56
  <p>
views/admin/metaboxes/settings-general.php CHANGED
@@ -51,7 +51,7 @@ $thumbhideonmobile = $this -> get_option ('thumbhideonmobile');
51
 
52
  <select name="effect" id="effect">
53
  <?php foreach ($effects as $eff) : ?>
54
- <option <?php echo (!$this -> ci_serial_valid() && $eff != "slide") ? 'disabled="disabled"' : ''; ?> <?php echo (!empty($effect) && $effect == $eff) ? 'selected="selected"' : ''; ?> value="<?php echo esc_attr(stripslashes($eff)); ?>"><?php echo ucfirst($eff); ?></option>
55
  <?php endforeach; ?>
56
  </select>
57
  <span class="howto"><?php _e('Choose the type of effect/transition you want for slides', 'slideshow-gallery'); ?></span>
@@ -97,37 +97,37 @@ $thumbhideonmobile = $this -> get_option ('thumbhideonmobile');
97
  <td>
98
  <select name="easing" id="easing">
99
  <option value="swing">swing</option>
100
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="linear">linear</option>
101
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInQuad">easeInQuad</option>
102
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutQuad">easeOutQuad</option>
103
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutQuad">easeInOutQuad</option>
104
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInCubic">easeInCubic</option>
105
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutCubic">easeOutCubic</option>
106
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutCubic">easeInOutCubic</option>
107
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInQuart">easeInQuart</option>
108
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutQuart">easeOutQuart</option>
109
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutQuart">easeInOutQuart</option>
110
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInQuint">easeInQuint</option>
111
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutQuint">easeOutQuint</option>
112
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutQuint">easeInOutQuint</option>
113
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInSine">easeInSine</option>
114
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutSine">easeOutSine</option>
115
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutSine">easeInOutSine</option>
116
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInExpo">easeInExpo</option>
117
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutExpo">easeOutExpo</option>
118
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutExpo">easeInOutExpo</option>
119
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInCirc">easeInCirc</option>
120
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutCirc">easeOutCirc</option>
121
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutCirc">easeInOutCirc</option>
122
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInElastic">easeInElastic</option>
123
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutElastic">easeOutElastic</option>
124
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutElastic">easeInOutElastic</option>
125
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInBack">easeInBack</option>
126
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutBack">easeOutBack</option>
127
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutBack">easeInOutBack</option>
128
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInBounce">easeInBounce</option>
129
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutBounce">easeOutBounce</option>
130
- <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutBounce">easeInOutBounce</option>
131
  </select>
132
 
133
  <script type="text/javascript">
@@ -339,7 +339,7 @@ $thumbhideonmobile = $this -> get_option ('thumbhideonmobile');
339
  <tr>
340
  <th><label for="infodelay"><?php _e('Information Delay', 'slideshow-gallery'); ?></label></th>
341
  <td>
342
- <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> class="widefat" style="width:65px;" type="text" name="infodelay" value="<?php echo esc_attr(stripslashes($infodelay)); ?>" id="infodelay" /> <?php _e('seconds', 'slideshow-gallery'); ?></label>
343
  <span class="howto"><?php _e('Delay the information bar in seconds or leave empty/zero for immediate display.', 'slideshow-gallery'); ?></span>
344
  </td>
345
  </tr>
@@ -398,7 +398,7 @@ $thumbhideonmobile = $this -> get_option ('thumbhideonmobile');
398
  <th><label for="infohideonmobile"><?php _e('Hide On Mobiles', 'slideshow-gallery'); ?></label>
399
  <?php echo $this -> Html -> help(__('With a responsive layout turned on, the slideshow will respond in width on mobile devices and the information bar tends to overlap the entire slide since it increases in height as it reduces in width. You can tick/check this setting to hide the information bar on mobile devices so that the slides remain fully visible.', 'slideshow-gallery')); ?></th>
400
  <td>
401
- <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> <?php echo (!empty($infohideonmobile) && $this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="checkbox" name="infohideonmobile" value="1" id="infohideonmobile" /> <?php _e('Yes, hide the information bar on mobiles', 'slideshow-gallery'); ?></label>
402
  <span class="howto"><?php _e('Tick/check this to hide the information bar on mobiles', 'slideshow-gallery'); ?></span>
403
  </td>
404
  </tr>
@@ -504,7 +504,7 @@ $thumbhideonmobile = $this -> get_option ('thumbhideonmobile');
504
  <th><label for="thumbhideonmobile"><?php _e('Hide On Mobile', 'slideshow-gallery'); ?></label>
505
  <?php echo $this -> Html -> help(__('With a responsive layout turned on, the slideshow will respond in width on mobile devices. You can tick/check this setting to hide the thumbnail bar.', 'slideshow-gallery')); ?></th>
506
  <td>
507
- <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> <?php echo (!empty($thumbhideonmobile) && $this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="checkbox" name="thumbhideonmobile" value="1" id="thumbhideonmobile" /> <?php _e('Yes, hide the thumbnail bar on mobiles', 'slideshow-gallery'); ?></label>
508
  <span class="howto"><?php _e('Tick/check this to hide the thumbnail bar on mobiles', 'slideshow-gallery'); ?></span>
509
  </td>
510
  </tr>
51
 
52
  <select name="effect" id="effect">
53
  <?php foreach ($effects as $eff) : ?>
54
+ <option <?php echo (!$this -> ci_serial_valid() && $eff != "slide") ? 'disabled="disabled"' : ''; ?> <?php echo (!empty($effect) && $effect == $eff) ? 'selected="selected"' : ''; ?> value="<?php echo esc_attr(stripslashes($eff)); ?>"><?php echo ucfirst($eff); ?> <?php if (!$this -> ci_serial_valid() && $eff != "slide") { echo __('(Pro Version Only)', 'slideshow-gallery'); } ?></option>
55
  <?php endforeach; ?>
56
  </select>
57
  <span class="howto"><?php _e('Choose the type of effect/transition you want for slides', 'slideshow-gallery'); ?></span>
97
  <td>
98
  <select name="easing" id="easing">
99
  <option value="swing">swing</option>
100
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="linear">linear <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
101
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInQuad">easeInQuad <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
102
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutQuad">easeOutQuad <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
103
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutQuad">easeInOutQuad <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
104
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInCubic">easeInCubic <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
105
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutCubic">easeOutCubic <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
106
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutCubic">easeInOutCubic <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
107
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInQuart">easeInQuart <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
108
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutQuart">easeOutQuart <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
109
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutQuart">easeInOutQuart <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
110
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInQuint">easeInQuint <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
111
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutQuint">easeOutQuint <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
112
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutQuint">easeInOutQuint <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
113
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInSine">easeInSine <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
114
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutSine">easeOutSine <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
115
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutSine">easeInOutSine <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
116
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInExpo">easeInExpo <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
117
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutExpo">easeOutExpo <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
118
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutExpo">easeInOutExpo <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
119
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInCirc">easeInCirc <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
120
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutCirc">easeOutCirc <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
121
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutCirc">easeInOutCirc <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
122
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInElastic">easeInElastic <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
123
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutElastic">easeOutElastic <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
124
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutElastic">easeInOutElastic <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
125
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInBack">easeInBack <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
126
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutBack">easeOutBack <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
127
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutBack">easeInOutBack <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
128
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInBounce">easeInBounce <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
129
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeOutBounce">easeOutBounce <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
130
+ <option <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> value="easeInOutBounce">easeInOutBounce <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></option>
131
  </select>
132
 
133
  <script type="text/javascript">
339
  <tr>
340
  <th><label for="infodelay"><?php _e('Information Delay', 'slideshow-gallery'); ?></label></th>
341
  <td>
342
+ <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> class="widefat" style="width:65px;" type="text" name="infodelay" value="<?php echo esc_attr(stripslashes($infodelay)); ?>" id="infodelay" /> <?php _e('seconds', 'slideshow-gallery'); ?> <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></label>
343
  <span class="howto"><?php _e('Delay the information bar in seconds or leave empty/zero for immediate display.', 'slideshow-gallery'); ?></span>
344
  </td>
345
  </tr>
398
  <th><label for="infohideonmobile"><?php _e('Hide On Mobiles', 'slideshow-gallery'); ?></label>
399
  <?php echo $this -> Html -> help(__('With a responsive layout turned on, the slideshow will respond in width on mobile devices and the information bar tends to overlap the entire slide since it increases in height as it reduces in width. You can tick/check this setting to hide the information bar on mobile devices so that the slides remain fully visible.', 'slideshow-gallery')); ?></th>
400
  <td>
401
+ <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> <?php echo (!empty($infohideonmobile) && $this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="checkbox" name="infohideonmobile" value="1" id="infohideonmobile" /> <?php _e('Yes, hide the information bar on mobiles', 'slideshow-gallery'); ?> <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></label>
402
  <span class="howto"><?php _e('Tick/check this to hide the information bar on mobiles', 'slideshow-gallery'); ?></span>
403
  </td>
404
  </tr>
504
  <th><label for="thumbhideonmobile"><?php _e('Hide On Mobile', 'slideshow-gallery'); ?></label>
505
  <?php echo $this -> Html -> help(__('With a responsive layout turned on, the slideshow will respond in width on mobile devices. You can tick/check this setting to hide the thumbnail bar.', 'slideshow-gallery')); ?></th>
506
  <td>
507
+ <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> <?php echo (!empty($thumbhideonmobile) && $this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="checkbox" name="thumbhideonmobile" value="1" id="thumbhideonmobile" /> <?php _e('Yes, hide the thumbnail bar on mobiles', 'slideshow-gallery'); ?> <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></label>
508
  <span class="howto"><?php _e('Tick/check this to hide the thumbnail bar on mobiles', 'slideshow-gallery'); ?></span>
509
  </td>
510
  </tr>
views/admin/metaboxes/settings-linksimages.php CHANGED
@@ -10,7 +10,7 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
10
  <th><label for="imagesthickbox_N"><?php _e('Open Images in Overlay', 'slideshow-gallery'); ?></label>
11
  <?php echo $this -> Html -> help(__('Turn this on to display the link of a slide in an enlargement overlay. It only works if the link on the slide is a link to a jpg, png, gif or bmp image though. For normal links to pages, the overlay will not be used at all.', 'slideshow-gallery')); ?></th>
12
  <td>
13
- <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> <?php echo ($this -> get_option('imagesthickbox') == "Y" && $this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="radio" name="imagesthickbox" value="Y" id="imagesthickbox_Y" /> <?php _e('Yes', 'slideshow-gallery'); ?></label>
14
  <label><input <?php echo ($this -> get_option('imagesthickbox') == "N" || !$this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="radio" name="imagesthickbox" value="N" id="imagesthickbox_N" /> <?php _e('No', 'slideshow-gallery'); ?></label>
15
  <span class="howto"><?php _e('turning this on (Yes) will open image URLs (.jpg, .png, .gif, .bmp) in a Thickbox image overlay', 'slideshow-gallery'); ?></span>
16
  </td>
10
  <th><label for="imagesthickbox_N"><?php _e('Open Images in Overlay', 'slideshow-gallery'); ?></label>
11
  <?php echo $this -> Html -> help(__('Turn this on to display the link of a slide in an enlargement overlay. It only works if the link on the slide is a link to a jpg, png, gif or bmp image though. For normal links to pages, the overlay will not be used at all.', 'slideshow-gallery')); ?></th>
12
  <td>
13
+ <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> <?php echo ($this -> get_option('imagesthickbox') == "Y" && $this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="radio" name="imagesthickbox" value="Y" id="imagesthickbox_Y" /> <?php _e('Yes', 'slideshow-gallery'); ?> <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></label>
14
  <label><input <?php echo ($this -> get_option('imagesthickbox') == "N" || !$this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="radio" name="imagesthickbox" value="N" id="imagesthickbox_N" /> <?php _e('No', 'slideshow-gallery'); ?></label>
15
  <span class="howto"><?php _e('turning this on (Yes) will open image URLs (.jpg, .png, .gif, .bmp) in a Thickbox image overlay', 'slideshow-gallery'); ?></span>
16
  </td>
views/admin/metaboxes/settings-postspages.php CHANGED
@@ -20,7 +20,7 @@ $excerpt_length = $this -> get_option('excerpt_length');
20
  <tr>
21
  <th><label for="excerptsettings"><?php _e('Override Excerpt Settings', 'slideshow-gallery'); ?></label></th>
22
  <td>
23
- <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> <?php echo (!empty($excerptsettings)) ? 'checked="checked"' : ''; ?> onclick="if (jQuery(this).is(':checked')) { jQuery('#excerptsettings_div').show(); } else { jQuery('#excerptsettings_div').hide(); }" type="checkbox" name="excerptsettings" value="1" id="excerptsettings" /> <?php _e('Yes, override the post/page excerpt settings', 'slideshow-gallery'); ?></label>
24
  </td>
25
  </tr>
26
  </tbody>
20
  <tr>
21
  <th><label for="excerptsettings"><?php _e('Override Excerpt Settings', 'slideshow-gallery'); ?></label></th>
22
  <td>
23
+ <label><input <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> <?php echo (!empty($excerptsettings)) ? 'checked="checked"' : ''; ?> onclick="if (jQuery(this).is(':checked')) { jQuery('#excerptsettings_div').show(); } else { jQuery('#excerptsettings_div').hide(); }" type="checkbox" name="excerptsettings" value="1" id="excerptsettings" /> <?php _e('Yes, override the post/page excerpt settings', 'slideshow-gallery'); ?> <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></label>
24
  </td>
25
  </tr>
26
  </tbody>
views/admin/metaboxes/settings-styles.php CHANGED
@@ -30,7 +30,7 @@ $resizeimagescrop = $this -> get_option('resizeimagescrop');
30
  <th><label for="layout_responsive"><?php _e('Layout', 'slideshow-gallery'); ?></label>
31
  <?php echo $this -> Html -> help(__('Choose responsive if you have a responsive theme and you want the slideshow to resize width/height in a responsive manner on different devices.<br/><br/><strong>Override per slideshow:</strong> Using parameter <code>layout</code> with value <code>responsive</code> or <code>specific</code> eg. <code>[tribulant_slideshow layout="specific"]</code>.', 'slideshow-gallery')); ?></th>
32
  <td>
33
- <label><input onclick="jQuery('#layout_specific_div').hide(); jQuery('#layout_responsive_div').show();" <?php echo ($styles['layout'] == "responsive") ? 'checked="checked"' : ''; ?> <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> type="radio" name="styles[layout]" value="responsive" id="layout_responsive" /> <?php _e('Responsive', 'slideshow-gallery'); ?></label>
34
  <label><input onclick="jQuery('#layout_specific_div').show(); jQuery('#layout_responsive_div').hide();" <?php echo (empty($styles['layout']) || $styles['layout'] == "specific" || !$this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="radio" name="styles[layout]" value="specific" id="layout_specific" /> <?php _e('Fixed', 'slideshow-gallery'); ?></label>
35
  <span class="howto"><?php _e('Choose whether you want a responsive or fixed/specific layout for the slideshow.', 'slideshow-gallery'); ?></span>
36
  </td>
@@ -148,7 +148,7 @@ $resizeimagescrop = $this -> get_option('resizeimagescrop');
148
  <div class="wp-picker-container">
149
  <a tabindex="0" id="stylesbackgroundbutton" class="wp-color-result" style="background-color:<?php echo $styles['background']; ?>;" title="Select Color"></a>
150
  <span class="wp-picker-input-wrap">
151
- <input type="text" name="styles[background]" id="stylesbackground" value="<?php echo $styles['background']; ?>" class="color-picker" style="display: none;" />
152
  </span>
153
  </div>
154
  </fieldset>
@@ -164,7 +164,7 @@ $resizeimagescrop = $this -> get_option('resizeimagescrop');
164
  <div class="wp-picker-container">
165
  <a tabindex="0" id="stylesinfobackgroundbutton" class="wp-color-result" style="background-color:<?php echo $styles['infobackground']; ?>;" title="Select Color"></a>
166
  <span class="wp-picker-input-wrap">
167
- <input type="text" name="styles[infobackground]" id="stylesinfobackground" value="<?php echo $styles['infobackground']; ?>" class="color-picker" style="display: none;" />
168
  </span>
169
  </div>
170
  </fieldset>
@@ -180,7 +180,7 @@ $resizeimagescrop = $this -> get_option('resizeimagescrop');
180
  <div class="wp-picker-container">
181
  <a tabindex="0" id="stylesinfocolorbutton" class="wp-color-result" style="background-color:<?php echo $styles['infocolor']; ?>;" title="Select Color"></a>
182
  <span class="wp-picker-input-wrap">
183
- <input type="text" name="styles[infocolor]" id="stylesinfocolor" value="<?php echo $styles['infocolor']; ?>" class="color-picker" style="display: none;" />
184
  </span>
185
  </div>
186
  </fieldset>
@@ -197,7 +197,7 @@ $resizeimagescrop = $this -> get_option('resizeimagescrop');
197
  <div class="wp-picker-container">
198
  <a tabindex="0" id="stylesthumbactivebutton" class="wp-color-result" style="background-color:<?php echo $styles['thumbactive']; ?>;" title="Select Color"></a>
199
  <span class="wp-picker-input-wrap">
200
- <input type="text" name="styles[thumbactive]" id="stylesthumbactive" value="<?php echo $styles['thumbactive']; ?>" class="color-picker" style="display: none;" />
201
  </span>
202
  </div>
203
  </fieldset>
30
  <th><label for="layout_responsive"><?php _e('Layout', 'slideshow-gallery'); ?></label>
31
  <?php echo $this -> Html -> help(__('Choose responsive if you have a responsive theme and you want the slideshow to resize width/height in a responsive manner on different devices.<br/><br/><strong>Override per slideshow:</strong> Using parameter <code>layout</code> with value <code>responsive</code> or <code>specific</code> eg. <code>[tribulant_slideshow layout="specific"]</code>.', 'slideshow-gallery')); ?></th>
32
  <td>
33
+ <label><input onclick="jQuery('#layout_specific_div').hide(); jQuery('#layout_responsive_div').show();" <?php echo ($styles['layout'] == "responsive") ? 'checked="checked"' : ''; ?> <?php echo (!$this -> ci_serial_valid()) ? 'disabled="disabled"' : ''; ?> type="radio" name="styles[layout]" value="responsive" id="layout_responsive" /> <?php _e('Responsive', 'slideshow-gallery'); ?> <?php if (!$this -> ci_serial_valid()) { echo sprintf(__('(%s)', 'slideshow-gallery'), '<a href="' . admin_url('admin.php?page=' . $this -> sections -> lite_upgrade) . '">' . __('Pro Version Only', 'slideshow-gallery') . '</a>'); } ?></label>
34
  <label><input onclick="jQuery('#layout_specific_div').show(); jQuery('#layout_responsive_div').hide();" <?php echo (empty($styles['layout']) || $styles['layout'] == "specific" || !$this -> ci_serial_valid()) ? 'checked="checked"' : ''; ?> type="radio" name="styles[layout]" value="specific" id="layout_specific" /> <?php _e('Fixed', 'slideshow-gallery'); ?></label>
35
  <span class="howto"><?php _e('Choose whether you want a responsive or fixed/specific layout for the slideshow.', 'slideshow-gallery'); ?></span>
36
  </td>
148
  <div class="wp-picker-container">
149
  <a tabindex="0" id="stylesbackgroundbutton" class="wp-color-result" style="background-color:<?php echo $styles['background']; ?>;" title="Select Color"></a>
150
  <span class="wp-picker-input-wrap">
151
+ <input type="text" name="styles[background]" id="stylesbackground" value="<?php echo $styles['background']; ?>" class="color-picker" style="" />
152
  </span>
153
  </div>
154
  </fieldset>
164
  <div class="wp-picker-container">
165
  <a tabindex="0" id="stylesinfobackgroundbutton" class="wp-color-result" style="background-color:<?php echo $styles['infobackground']; ?>;" title="Select Color"></a>
166
  <span class="wp-picker-input-wrap">
167
+ <input type="text" name="styles[infobackground]" id="stylesinfobackground" value="<?php echo $styles['infobackground']; ?>" class="color-picker" style="" />
168
  </span>
169
  </div>
170
  </fieldset>
180
  <div class="wp-picker-container">
181
  <a tabindex="0" id="stylesinfocolorbutton" class="wp-color-result" style="background-color:<?php echo $styles['infocolor']; ?>;" title="Select Color"></a>
182
  <span class="wp-picker-input-wrap">
183
+ <input type="text" name="styles[infocolor]" id="stylesinfocolor" value="<?php echo $styles['infocolor']; ?>" class="color-picker" style="" />
184
  </span>
185
  </div>
186
  </fieldset>
197
  <div class="wp-picker-container">
198
  <a tabindex="0" id="stylesthumbactivebutton" class="wp-color-result" style="background-color:<?php echo $styles['thumbactive']; ?>;" title="Select Color"></a>
199
  <span class="wp-picker-input-wrap">
200
+ <input type="text" name="styles[thumbactive]" id="stylesthumbactive" value="<?php echo $styles['thumbactive']; ?>" class="color-picker" style="" />
201
  </span>
202
  </div>
203
  </fieldset>
views/admin/settings-updates.php ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap slideshow <?php echo $this -> pre; ?>">
2
+ <h2><?php _e('Check for Updates', 'slideshow-gallery'); ?></h2>
3
+
4
+ <?php
5
+
6
+ $update = $this -> vendor('update');
7
+ $update_info = $update -> get_version_info();
8
+
9
+ if (version_compare($this -> version, $update_info['version']) < 0) {
10
+ $this -> render('update', array('update_info' => $update_info), true, 'admin'); ?>
11
+
12
+ <p><a href="https://tribulant.com" target="_blank"><img src="<?php echo $this -> render_url('images/logo.png', 'admin', false); ?>" alt="tribulant" /></a></p>
13
+
14
+ <?php $changelog = $update -> get_changelog(); ?>
15
+ <div style="margin:10px 0; padding: 10px 20px; border:1px solid #ccc; border-radius:4px; moz-border-radius:4px; webkit-border-radius:4px;">
16
+ <?php echo $changelog; ?>
17
+ </div>
18
+
19
+ <?php
20
+ } else {
21
+ ?>
22
+
23
+ <div class="updated"><p><i class="fa fa-check"></i> <?php _e('Your version of the Slideshow Gallery plugin is up to date.', 'slideshow-gallery'); ?></p></div>
24
+
25
+ <?php if ($raw_response = get_transient('slideshow_update_info')) : ?>
26
+ <?php if (!empty($raw_response['headers']['date'])) : ?>
27
+ <p><?php echo sprintf(__('Last checked on <b>%s</b>', 'slideshow-gallery'), get_date_from_gmt(date("Y-m-d H:i:s", strtotime($raw_response['headers']['date'])), get_option('date_format') . ' ' . get_option('time_format'))); ?></p>
28
+ <p><a href="?page=<?php echo $this -> sections -> settings_updates; ?>&amp;method=check" class="button-primary"><i class="fa fa-history fa-fw"></i> <?php _e('Check Again', 'slideshow-gallery'); ?></a>
29
+ <?php echo $Html -> help(__('The plugin checks for new versions every 24 hours. If you want to check right now, click the "Check Again" button in order to do so.', 'slideshow-gallery')); ?></p>
30
+ <?php endif; ?>
31
+ <?php endif; ?>
32
+
33
+ <?php
34
+ }
35
+
36
+ ?>
37
+ </div>
views/admin/slides/order-gallery.php CHANGED
@@ -21,10 +21,12 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
21
  <br class="clear" />
22
  <ul id="slidelist">
23
  <?php foreach ($slides as $slide) : ?>
24
- <li class="gallerylineitem" id="item_<?php echo $slide -> id; ?>">
25
- <span class="gallery_slide_image" style="display:none;"><img src="<?php echo $this -> Html -> otf_image_src($slide, 89, 89, 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></span>
26
- <span class="gallery_slide_title"><?php echo __($slide -> title); ?></span>
27
- </li>
 
 
28
  <?php endforeach; ?>
29
  </ul>
30
  </div>
21
  <br class="clear" />
22
  <ul id="slidelist">
23
  <?php foreach ($slides as $slide) : ?>
24
+ <?php if (!$this -> Slide() -> is_expired($slide -> id)) : ?>
25
+ <li class="gallerylineitem" id="item_<?php echo $slide -> id; ?>">
26
+ <span class="gallery_slide_image" style="display:none;"><img src="<?php echo $this -> Html -> otf_image_src($slide, 89, 89, 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></span>
27
+ <span class="gallery_slide_title"><?php echo __($slide -> title); ?></span>
28
+ </li>
29
+ <?php endif; ?>
30
  <?php endforeach; ?>
31
  </ul>
32
  </div>
views/admin/slides/order.php CHANGED
@@ -22,10 +22,12 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
22
  <br class="clear" />
23
  <ul id="slidelist">
24
  <?php foreach ($slides as $slide) : ?>
25
- <li class="gallerylineitem" id="item_<?php echo $slide -> id; ?>">
26
- <span class="gallery_slide_image" style="display:none;"><img src="<?php echo $this -> Html -> otf_image_src($slide, 89, 89, 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></span>
27
- <span class="gallery_slide_title"><?php echo __($slide -> title); ?></span>
28
- </li>
 
 
29
  <?php endforeach; ?>
30
  </ul>
31
  </div>
22
  <br class="clear" />
23
  <ul id="slidelist">
24
  <?php foreach ($slides as $slide) : ?>
25
+ <?php if (!$this -> Slide() -> is_expired($slide -> id)) : ?>
26
+ <li class="gallerylineitem" id="item_<?php echo $slide -> id; ?>">
27
+ <span class="gallery_slide_image" style="display:none;"><img src="<?php echo $this -> Html -> otf_image_src($slide, 89, 89, 100); ?>" alt="<?php echo $this -> Html -> sanitize(__($slide -> title)); ?>" /></span>
28
+ <span class="gallery_slide_title"><?php echo __($slide -> title); ?></span>
29
+ </li>
30
+ <?php endif; ?>
31
  <?php endforeach; ?>
32
  </ul>
33
  </div>
views/admin/slides/save-multiple.php CHANGED
@@ -7,16 +7,6 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
7
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
8
  <h1><?php _e('Save Multiple Slides', 'slideshow-gallery'); ?></h1>
9
 
10
- <?php if (!empty($errors)) : ?>
11
- <div class="slideshow_error">
12
- <ul>
13
- <?php foreach ($errors as $error) : ?>
14
- <li><?php echo $error; ?></li>
15
- <?php endforeach; ?>
16
- </ul>
17
- </div>
18
- <?php endif; ?>
19
-
20
  <form action="" method="post">
21
  <?php wp_nonce_field($this -> sections -> slides . '_save-multiple'); ?>
22
 
@@ -31,17 +21,30 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
31
  <span class="howto"><?php _e('Upload/choose images from the media gallery. Ctrl/Shift + Click to choose multiple.', 'slideshow-gallery'); ?></span>
32
 
33
  <div id="Slide_mediaslides" style="display:<?php echo (!empty($_POST['Slide']['slides'])) ? 'block' : 'none'; ?>;">
 
34
  <!-- Slides go here -->
35
  <table class="form-table" id="Slide_mediaslides_table">
36
  <tbody>
37
  <?php if (!empty($_POST['Slide']['slides'])) : ?>
 
38
  <?php foreach ($_POST['Slide']['slides'] as $attachment_id => $slide) : ?>
39
  <tr id="Slide_mediaupload_row_<?php echo $slide['attachment_id']; ?>">
40
  <th style="width:100px; vertical-align:top;">
41
  <a href="" class="colorbox" onclick="jQuery.colorbox({href:'<?php echo esc_attr($slide['url']); ?>'}); return false;"><img style="width:100px;" class="img-rounded" src="<?php echo esc_attr($slide['url']); ?>" />
42
  </th>
43
  <td>
44
- <label><?php _e('Title:', 'slideshow-gallery'); ?> <input class="widefat" type="text" value="<?php echo esc_attr(stripslashes($slide['title'])); ?>" name="Slide[slides][<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>][title]" /></label>
 
 
 
 
 
 
 
 
 
 
 
45
  <label><?php _e('Description:', 'slideshow-gallery'); ?> <textarea class="widefat" rows="3" cols="100%" name="Slide[slides][<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>][description]"><?php echo esc_attr(stripslashes($slide['description'])); ?></textarea></label>
46
  <input class="widefat" readonly="readonly" type="text" value="<?php echo esc_attr(stripslashes($slide['url'])); ?>" name="Slide[slides][<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>][url]" />
47
  <input type="hidden" value="<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>" name="Slide[slides][<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>][attachment_id]" />
@@ -52,6 +55,7 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
52
  </button>
53
  </td>
54
  </tr>
 
55
  <?php endforeach; ?>
56
  <?php endif; ?>
57
  </tbody>
@@ -85,10 +89,27 @@ if (!defined('ABSPATH')) exit; // Exit if accessed directly
85
  </div>
86
 
87
  <script type="text/javascript">
88
- jQuery(document).ready(function() {
 
 
89
  var file_frame;
90
 
91
- jQuery('#Slide_mediaupload').on('click', function( event ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
92
  event.preventDefault();
93
 
94
  // If the media frame already exists, reopen it.
@@ -99,15 +120,15 @@ jQuery(document).ready(function() {
99
 
100
  // Create the media frame.
101
  file_frame = wp.media.frames.file_frame = wp.media({
102
- title: '<?php _e('Upload Slides', 'slideshow-gallery'); ?>',
103
  button: {
104
- text: '<?php _e('Select Images as Slides', 'slideshow-gallery'); ?>',
105
  },
106
  multiple: true // Set to true to allow multiple files to be selected
107
  });
108
 
109
  // When an image is selected, run a callback.
110
- file_frame.on( 'select', function() {
111
 
112
  var selection = file_frame.state().get('selection');
113
 
@@ -121,23 +142,49 @@ jQuery(document).ready(function() {
121
  }
122
 
123
  var attachment_html = '<tr id="Slide_mediaupload_row_' + attachment.id + '">';
124
- attachment_html += '<th style="width:100px; vertical-align:top;"><a href="" class="colorbox" onclick="jQuery.colorbox({href:\'' + attachment.url + '\'}); return false;"><img style="width:100px;" class="img-rounded" src="' + thumbnail_url + '" /></th>';
125
  attachment_html += '<td>';
126
- attachment_html += '<label><?php _e('Title:', 'slideshow-gallery'); ?> <input class="widefat" type="text" value="' + attachment.title + '" name="Slide[slides][' + attachment.id + '][title]" /></label>';
127
- attachment_html += '<label><?php _e('Description:', 'slideshow-gallery'); ?> <textarea class="widefat" rows="3" cols="100%" name="Slide[slides][' + attachment.id + '][description]"></textarea></label>';
128
- attachment_html += '<input class="widefat" readonly="readonly" type="text" value="' + attachment.url + '" name="Slide[slides][' + attachment.id + '][url]" />';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
129
  attachment_html += '<input type="hidden" value="' + attachment.id + '" name="Slide[slides][' + attachment.id + '][attachment_id]" />';
130
  attachment_html += '</td>';
131
- attachment_html += '<td style="vertical-align:bottom;"><button onclick="if (confirm(\'<?php echo __('Are you sure you want to remove this slide?', 'slideshow-gallery'); ?>\')) { jQuery(\'#Slide_mediaupload_row_' + attachment.id + '\').remove(); } return false;" class="button button-secondary button-small" type="button" name="remove" value="1" id="remove' + attachment.id + '"><i class="fa fa-trash fa-fw"></i> <?php echo __('Remove', 'slideshow-gallery'); ?></button></td>';
132
  attachment_html += '</tr>';
133
 
134
- jQuery('#Slide_mediaslides').show();
135
- jQuery('#Slide_mediaslides_table tbody').append(attachment_html);
136
  });
137
  });
138
 
139
  // Finally, open the modal
140
  file_frame.open();
 
 
 
 
 
 
 
 
 
 
 
141
  });
142
- });
 
143
  </script>
7
  <div class="wrap <?php echo $this -> pre; ?> slideshow">
8
  <h1><?php _e('Save Multiple Slides', 'slideshow-gallery'); ?></h1>
9
 
 
 
 
 
 
 
 
 
 
 
10
  <form action="" method="post">
11
  <?php wp_nonce_field($this -> sections -> slides . '_save-multiple'); ?>
12
 
21
  <span class="howto"><?php _e('Upload/choose images from the media gallery. Ctrl/Shift + Click to choose multiple.', 'slideshow-gallery'); ?></span>
22
 
23
  <div id="Slide_mediaslides" style="display:<?php echo (!empty($_POST['Slide']['slides'])) ? 'block' : 'none'; ?>;">
24
+
25
  <!-- Slides go here -->
26
  <table class="form-table" id="Slide_mediaslides_table">
27
  <tbody>
28
  <?php if (!empty($_POST['Slide']['slides'])) : ?>
29
+ <?php $s = 0; ?>
30
  <?php foreach ($_POST['Slide']['slides'] as $attachment_id => $slide) : ?>
31
  <tr id="Slide_mediaupload_row_<?php echo $slide['attachment_id']; ?>">
32
  <th style="width:100px; vertical-align:top;">
33
  <a href="" class="colorbox" onclick="jQuery.colorbox({href:'<?php echo esc_attr($slide['url']); ?>'}); return false;"><img style="width:100px;" class="img-rounded" src="<?php echo esc_attr($slide['url']); ?>" />
34
  </th>
35
  <td>
36
+ <?php if (!empty($errors[$s])) : ?>
37
+ <!-- Error Messages -->
38
+ <div class="slideshow_error">
39
+ <ul>
40
+ <?php foreach ($errors[$s] as $error) : ?>
41
+ <li><?php echo $error; ?></li>
42
+ <?php endforeach; ?>
43
+ </ul>
44
+ </div>
45
+ <?php endif; ?>
46
+
47
+ <label><?php _e('Title:', 'slideshow-gallery'); ?> <input class="widefat" type="text" value="<?php echo esc_attr(stripslashes($slide['title'])); ?>" name="Slide[slides][<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>][title]" /></label>
48
  <label><?php _e('Description:', 'slideshow-gallery'); ?> <textarea class="widefat" rows="3" cols="100%" name="Slide[slides][<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>][description]"><?php echo esc_attr(stripslashes($slide['description'])); ?></textarea></label>
49
  <input class="widefat" readonly="readonly" type="text" value="<?php echo esc_attr(stripslashes($slide['url'])); ?>" name="Slide[slides][<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>][url]" />
50
  <input type="hidden" value="<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>" name="Slide[slides][<?php echo esc_attr(stripslashes($slide['attachment_id'])); ?>][attachment_id]" />
55
  </button>
56
  </td>
57
  </tr>
58
+ <?php $s++; ?>
59
  <?php endforeach; ?>
60
  <?php endif; ?>
61
  </tbody>
89
  </div>
90
 
91
  <script type="text/javascript">
92
+ /* Slideshow Gallery Save Multiple Script */
93
+
94
+ (function($) {
95
  var file_frame;
96
 
97
+ $.fn.banners_appendvalue = function() {
98
+ var $appendvaluebutton = this,
99
+ $sliderow = $appendvaluebutton.closest('tr'),
100
+ $value = $appendvaluebutton.data('value'),
101
+ $appendto = $appendvaluebutton.data('appendto'),
102
+ $element = $sliderow.find($appendto),
103
+ $elementval = $element.val();
104
+
105
+ $element.val($elementval + $value).focus();
106
+ return;
107
+ }
108
+
109
+ //$('#Slide_mediaupload').on('click', function(event){
110
+ $.fn.banners_mediaupload = function(event) {
111
+ var $mediauploadbutton = this;
112
+
113
  event.preventDefault();
114
 
115
  // If the media frame already exists, reopen it.
120
 
121
  // Create the media frame.
122
  file_frame = wp.media.frames.file_frame = wp.media({
123
+ title: '<?php echo esc_js(__('Upload Slides', 'slideshow-gallery')); ?>',
124
  button: {
125
+ text: '<?php echo esc_js(__('Select Images as Slides', 'slideshow-gallery')); ?>',
126
  },
127
  multiple: true // Set to true to allow multiple files to be selected
128
  });
129
 
130
  // When an image is selected, run a callback.
131
+ file_frame.on('select', function() {
132
 
133
  var selection = file_frame.state().get('selection');
134
 
142
  }
143
 
144
  var attachment_html = '<tr id="Slide_mediaupload_row_' + attachment.id + '">';
145
+ attachment_html += '<th style="width:100px; vertical-align:top;"><a href="" class="colorbox" onclick="$.colorbox({href:\'' + attachment.url + '\'}); return false;"><img style="width:100px;" class="img-rounded" src="' + thumbnail_url + '" /></th>';
146
  attachment_html += '<td>';
147
+ attachment_html += '<label><?php echo esc_js(__('Title:', 'slideshow-gallery')); ?> <input class="widefat slidetitle" type="text" value="' + attachment.title + '" name="Slide[slides][' + attachment.id + '][title]" /></label>';
148
+
149
+ attachment_html += '<label><?php _e('Variables:', 'slideshow-gallery'); ?></label> ';
150
+ attachment_html += '<button class="button button-small appendvalue" onclick="$(this).banners_appendvalue();" type="button" name="" value="" data-value="' + attachment.alt + '" data-appendto="input.slidetitle" id=""><?php _e('Alt', 'slideshow-gallery'); ?></button>';
151
+ attachment_html += '<button class="button button-small appendvalue" onclick="$(this).banners_appendvalue();" type="button" name="" value="" data-value="' + attachment.caption + '" data-appendto="input.slidetitle" id=""><?php _e('Caption', 'slideshow-gallery'); ?></button>';
152
+ attachment_html += '<button class="button button-small appendvalue" onclick="$(this).banners_appendvalue();" type="button" name="" value="" data-value="' + attachment.description + '" data-appendto="input.slidetitle" id=""><?php _e('Description', 'slideshow-gallery'); ?></button>';
153
+ attachment_html += '<button class="button button-small appendvalue" onclick="$(this).banners_appendvalue();" type="button" name="" value="" data-value="' + attachment.title + '" data-appendto="input.slidetitle" id=""><?php _e('Title', 'slideshow-gallery'); ?></button>';
154
+
155
+ attachment_html += '<br/><br/><label><?php echo esc_js(__('Description:', 'slideshow-gallery')); ?> <textarea class="widefat slidedescription" rows="3" cols="100%" name="Slide[slides][' + attachment.id + '][description]">' + attachment.description + '</textarea></label>';
156
+
157
+ attachment_html += '<label><?php _e('Variables:', 'slideshow-gallery'); ?></label> ';
158
+ attachment_html += '<button class="button button-small appendvalue" onclick="$(this).banners_appendvalue();" type="button" name="" value="" data-value="' + attachment.alt + '" data-appendto="textarea.slidedescription" id="">Alt</button>';
159
+ attachment_html += '<button class="button button-small appendvalue" onclick="$(this).banners_appendvalue();" type="button" name="" value="" data-value="' + attachment.caption + '" data-appendto="textarea.slidedescription" id="">Caption</button>';
160
+ attachment_html += '<button class="button button-small appendvalue" onclick="$(this).banners_appendvalue();" type="button" name="" value="" data-value="' + attachment.description + '" data-appendto="textarea.slidedescription" id="">Description</button>';
161
+ attachment_html += '<button class="button button-small appendvalue" onclick="$(this).banners_appendvalue();" type="button" name="" value="" data-value="' + attachment.title + '" data-appendto="textarea.slidedescription" id="">Title</button>';
162
+
163
+ attachment_html += '<input class="widefat slideurl" readonly="readonly" type="text" value="' + attachment.url + '" name="Slide[slides][' + attachment.id + '][url]" />';
164
  attachment_html += '<input type="hidden" value="' + attachment.id + '" name="Slide[slides][' + attachment.id + '][attachment_id]" />';
165
  attachment_html += '</td>';
166
+ attachment_html += '<td style="vertical-align:bottom;"><button onclick="if (confirm(\'<?php echo esc_js(__('Are you sure you want to remove this slide?', 'slideshow-gallery')); ?>\')) { $(\'#Slide_mediaupload_row_' + attachment.id + '\').remove(); } return false;" class="button button-secondary button-small" type="button" name="remove" value="1" id="remove' + attachment.id + '"><i class="fa fa-trash fa-fw"></i> <?php echo esc_js(__('Remove', 'slideshow-gallery')); ?></button></td>';
167
  attachment_html += '</tr>';
168
 
169
+ $('#Slide_mediaslides').show();
170
+ $('#Slide_mediaslides_table tbody').append(attachment_html);
171
  });
172
  });
173
 
174
  // Finally, open the modal
175
  file_frame.open();
176
+ return $mediauploadbutton;
177
+ }
178
+
179
+ $(document).ready(function() {
180
+ $('#Slide_mediaupload').on('click', function(event) {
181
+ $(this).banners_mediaupload(event);
182
+ });
183
+
184
+ $('button.appendvalue').on('click', function(event) {
185
+ $(this).banners_appendvalue();
186
+ });
187
  });
188
+
189
+ })(jQuery);
190
  </script>
views/admin/submitserial.php CHANGED
@@ -43,11 +43,11 @@ $version_info = $update -> get_version_info();
43
  <p><?php _e('Your current serial is valid and working.', 'slideshow-gallery'); ?></p>
44
 
45
  <?php if (!empty($version_info['dtype']) && $version_info['dtype'] == "single") : ?>
46
- <h2><?php _e('Upgrade to Unlimited', 'wp-mailinglist'); ?></h2>
47
- <p><?php _e('You can upgrade one or more single domain licenses to an unlimited domains license.', 'wp-mailinglist'); ?>
48
- <br/><?php _e('You only pay the difference.', 'wp-mailinglist'); ?></p>
49
  <p>
50
- <a class="button" href="https://tribulant.com/items/upgrade/<?php echo $version_info['item_id']; ?>" target="_blank"><i class="fa fa-level-up fa-fw"></i> <?php _e('Upgrade Now', 'wp-mailinglist'); ?></a>
51
  </p>
52
  <?php endif; ?>
53
 
43
  <p><?php _e('Your current serial is valid and working.', 'slideshow-gallery'); ?></p>
44
 
45
  <?php if (!empty($version_info['dtype']) && $version_info['dtype'] == "single") : ?>
46
+ <h2><?php _e('Upgrade to Unlimited', 'slideshow-gallery'); ?></h2>
47
+ <p><?php _e('You can upgrade one or more single domain licenses to an unlimited domains license.', 'slideshow-gallery'); ?>
48
+ <br/><?php _e('You only pay the difference.', 'slideshow-gallery'); ?></p>
49
  <p>
50
+ <a class="button" href="https://tribulant.com/items/upgrade/<?php echo $version_info['item_id']; ?>" target="_blank"><i class="fa fa-level-up fa-fw"></i> <?php _e('Upgrade Now', 'slideshow-gallery'); ?></a>
51
  </p>
52
  <?php endif; ?>
53
 
views/admin/update.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!-- Top Update Notice -->
2
+
3
+ <?php delete_transient('slideshow_update_info'); ?>
4
+
5
+ <?php $upgrade_url = wp_nonce_url('update.php?action=upgrade-plugin&amp;plugin=' . urlencode($this -> plugin_file), 'upgrade-plugin_' . $this -> plugin_file); ?>
6
+ <?php if ($this -> ci_serial_valid()) : ?>
7
+ <?php if (!empty($update_info) && $update_info['is_valid_key'] == "1") : ?>
8
+ <div class="update-nag slideshow-update-nag-wrapper">
9
+ <span class="slideshow-update-nag"></span> <?php echo sprintf(__('%s plugin %s is available.', 'slideshow-gallery'), 'Slideshow Gallery', $update_info['version']); ?><br/>
10
+ <?php _e('You can update automatically or download to install manually.', 'slideshow-gallery'); ?>
11
+ <br/><br/>
12
+ <a href="<?php echo $upgrade_url; ?>" title="" class="button-primary"><i class="fa fa-magic"></i> <?php _e('Update Automatically', 'slideshow-gallery'); ?></a>
13
+ <a target="_blank" href="<?php echo $update_info['url']; ?>" title="" class="button-secondary"><i class="fa fa-download"></i> <?php _e('Download', 'slideshow-gallery'); ?></a>
14
+ <a style="color:black; text-decoration:none;" href="<?php echo admin_url('admin.php'); ?>?page=<?php echo $this -> sections -> settings_updates; ?>&amp;method=check" class="button button-secondary"><i class="fa fa-history fa-fw"></i> <?php _e('Check Again', 'slideshow-gallery'); ?></a>
15
+ <?php if (empty($_GET['page']) || (!empty($_GET['page']) && $_GET['page'] != $this -> sections -> settings_updates)) : ?>
16
+ <a class="button" href="<?php echo admin_url('admin.php?page=' . $this -> sections -> settings_updates); ?>"><i class="fa fa-list-ul"></i> <?php _e('Changelog', 'slideshow-gallery'); ?></a>
17
+ <a href="?slideshow_method=hideupdate&version=<?php echo $update_info['version']; ?>" class="" style="position: absolute; top: 0; right: 0; margin: 10px 10px 0 0;"><i class="fa fa-times"></i></a>
18
+ <?php endif; ?>
19
+ </div>
20
+ <?php else : ?>
21
+ <div class="update-nag slideshow-update-nag-wrapper">
22
+ <span class="slideshow-update-nag"></span> <?php echo sprintf(__('%s plugin %s is available.', 'slideshow-gallery'), 'Slideshow Gallery', $update_info['version']); ?><br/>
23
+ <?php _e('Unfortunately your download has expired, please renew to gain access.', 'slideshow-gallery'); ?>
24
+ <br/><br/>
25
+ <a style="color:white; text-decoration:none;" href="<?php echo $update_info['url']; ?>" target="_blank" title="" class="button button-primary"><?php _e('Renew Now', 'slideshow-gallery'); ?></a>
26
+ <a style="color:black; text-decoration:none;" href="<?php echo admin_url('admin.php'); ?>?page=<?php echo $this -> sections -> settings_updates; ?>&amp;method=check" class="button button-secondary"><i class="fa fa-history fa-fw"></i> <?php _e('Check Again', 'slideshow-gallery'); ?></a>
27
+ <?php if (empty($_GET['page']) || (!empty($_GET['page']) && $_GET['page'] != $this -> sections -> settings_updates)) : ?>
28
+ <a class="button" href="<?php echo admin_url('admin.php?page=' . $this -> sections -> settings_updates); ?>"><i class="fa fa-list-ul"></i> <?php _e('Changelog', 'slideshow-gallery'); ?></a>
29
+ <a href="?slideshow_method=hideupdate&version=<?php echo $update_info['version']; ?>" class="" style="position: absolute; top: 0; right: 0; margin: 10px 10px 0 0;"><i class="fa fa-times"></i></a>
30
+ <?php endif; ?>
31
+ </div>
32
+ <?php endif; ?>
33
+ <?php else : ?>
34
+ <div class="update-nag slideshow-update-nag-wrapper">
35
+ <span class="slideshow-update-nag"></span> <?php echo sprintf(__('%s plugin %s is available.', 'slideshow-gallery'), 'Slideshow Gallery', $update_info['version']); ?><br/>
36
+ <?php _e('You can update automatically or download to install manually.', 'slideshow-gallery'); ?>
37
+ <br/><br/>
38
+ <a href="<?php echo $upgrade_url; ?>" title="" class="button-primary"><i class="fa fa-magic"></i> <?php _e('Update Automatically', 'slideshow-gallery'); ?></a>
39
+ <a target="_blank" href="https://wordpress.org/plugins/slideshow-gallery/" title="" class="button-secondary"><i class="fa fa-download"></i> <?php _e('Download', 'slideshow-gallery'); ?></a>
40
+ <a style="color:black; text-decoration:none;" href="<?php echo admin_url('admin.php'); ?>?page=<?php echo $this -> sections -> settings_updates; ?>&amp;method=check" class="button button-secondary"><i class="fa fa-history fa-fw"></i> <?php _e('Check Again', 'slideshow-gallery'); ?></a>
41
+ <?php if (empty($_GET['page']) || (!empty($_GET['page']) && $_GET['page'] != $this -> sections -> settings_updates)) : ?>
42
+ <a class="button" href="<?php echo admin_url('admin.php?page=' . $this -> sections -> settings_updates); ?>"><i class="fa fa-list-ul"></i> <?php _e('Changelog', 'slideshow-gallery'); ?></a>
43
+ <a href="?slideshow_method=hideupdate&version=<?php echo $update_info['version']; ?>" class="" style="position: absolute; top: 0; right: 0; margin: 10px 10px 0 0;"><i class="fa fa-times"></i></a>
44
+ <?php endif; ?>
45
+ </div>
46
+ <?php endif; ?>