Meta Box - Version 4.15.6

Version Description

Download this release

Release Info

Developer rilwis
Plugin Icon 128x128 Meta Box
Version 4.15.6
Comparing to
See all releases

Code changes from version 4.14.10 to 4.15.6

Files changed (140) hide show
  1. css/autocomplete.css +1 -1
  2. css/button-group.css +13 -13
  3. css/color.css +1 -1
  4. css/divider.css +1 -1
  5. css/heading.css +1 -1
  6. css/input-list.css +3 -3
  7. css/map.css +44 -0
  8. css/oembed.css +1 -1
  9. css/osm.css +49 -0
  10. css/select.css +1 -1
  11. css/select2/select2.css +4 -3
  12. css/slider.css +1 -1
  13. css/style-rtl.css +5 -5
  14. css/text-list.css +7 -7
  15. css/upload.css +0 -4
  16. inc/about/about.php +3 -3
  17. inc/about/js/about.js +13 -9
  18. inc/about/sections/support.php +11 -1
  19. inc/about/sections/tabs.php +1 -1
  20. inc/clone.php +4 -4
  21. inc/field.php +58 -48
  22. inc/fields/autocomplete.php +13 -6
  23. inc/fields/background.php +90 -75
  24. inc/fields/button-group.php +16 -14
  25. inc/fields/button.php +12 -6
  26. inc/fields/checkbox-list.php +1 -1
  27. inc/fields/choice.php +17 -73
  28. inc/fields/color.php +21 -12
  29. inc/fields/datetime.php +39 -24
  30. inc/fields/file-input.php +9 -5
  31. inc/fields/file-upload.php +12 -6
  32. inc/fields/file.php +40 -24
  33. inc/fields/image-advanced.php +12 -6
  34. inc/fields/image-select.php +1 -1
  35. inc/fields/image.php +15 -7
  36. inc/fields/input-list.php +25 -23
  37. inc/fields/input.php +28 -19
  38. inc/fields/key-value.php +8 -5
  39. inc/fields/map.php +66 -40
  40. inc/fields/media.php +44 -31
  41. inc/fields/number.php +16 -10
  42. inc/fields/object-choice.php +44 -28
  43. inc/fields/oembed.php +46 -10
  44. inc/fields/osm.php +175 -0
  45. inc/fields/post.php +56 -46
  46. inc/fields/radio.php +1 -1
  47. inc/fields/range.php +7 -4
  48. inc/fields/select-advanced.php +21 -12
  49. inc/fields/select-tree.php +7 -9
  50. inc/fields/select.php +21 -17
  51. inc/fields/sidebar.php +21 -33
  52. inc/fields/single-image.php +19 -7
  53. inc/fields/slider.php +24 -14
  54. inc/fields/switch.php +8 -5
  55. inc/fields/taxonomy-advanced.php +17 -8
  56. inc/fields/taxonomy.php +76 -40
  57. inc/fields/text-list.php +3 -0
  58. inc/fields/text.php +17 -11
  59. inc/fields/textarea.php +24 -18
  60. inc/fields/time.php +1 -1
  61. inc/fields/user.php +42 -42
  62. inc/fields/video.php +23 -15
  63. inc/fields/wysiwyg.php +15 -9
  64. inc/functions.php +119 -16
  65. inc/loader.php +1 -1
  66. inc/meta-box.php +47 -22
  67. inc/sanitizer.php +16 -4
  68. inc/storages/base.php +13 -0
  69. inc/validation.php +7 -3
  70. inc/walkers/base.php +13 -16
  71. inc/walkers/input-list.php +3 -5
  72. inc/walkers/select-tree.php +18 -26
  73. inc/walkers/select.php +3 -5
  74. js/autosave.js +1 -1
  75. js/input-list.js +5 -5
  76. js/map.js +65 -32
  77. js/media.js +2 -2
  78. js/oembed.js +2 -1
  79. js/osm-frontend.js +50 -0
  80. js/osm.js +266 -0
  81. js/script.js +0 -4
  82. js/select2/i18n/af.js +3 -0
  83. js/select2/i18n/ar.js +2 -2
  84. js/select2/i18n/az.js +1 -1
  85. js/select2/i18n/bg.js +1 -1
  86. js/select2/i18n/bs.js +3 -0
  87. js/select2/i18n/ca.js +1 -1
  88. js/select2/i18n/cs.js +2 -2
  89. js/select2/i18n/da.js +2 -2
  90. js/select2/i18n/de.js +2 -2
  91. js/select2/i18n/dsb.js +3 -0
  92. js/select2/i18n/el.js +3 -0
  93. js/select2/i18n/en.js +1 -1
  94. js/select2/i18n/es.js +2 -2
  95. js/select2/i18n/et.js +1 -1
  96. js/select2/i18n/eu.js +1 -1
  97. js/select2/i18n/fa.js +1 -1
  98. js/select2/i18n/fi.js +2 -2
  99. js/select2/i18n/fr.js +2 -2
  100. js/select2/i18n/gl.js +2 -2
  101. js/select2/i18n/he.js +1 -1
  102. js/select2/i18n/hi.js +1 -1
  103. js/select2/i18n/hr.js +1 -1
  104. js/select2/i18n/hsb.js +3 -0
  105. js/select2/i18n/hu.js +2 -2
  106. js/select2/i18n/hy.js +3 -0
  107. js/select2/i18n/id.js +1 -1
  108. js/select2/i18n/is.js +1 -1
  109. js/select2/i18n/it.js +1 -1
  110. js/select2/i18n/ja.js +1 -1
  111. js/select2/i18n/km.js +3 -0
  112. js/select2/i18n/ko.js +1 -1
  113. js/select2/i18n/lt.js +2 -2
  114. js/select2/i18n/lv.js +1 -1
  115. js/select2/i18n/mk.js +1 -1
  116. js/select2/i18n/ms.js +1 -1
  117. js/select2/i18n/nb.js +2 -2
  118. js/select2/i18n/nl.js +1 -1
  119. js/select2/i18n/pl.js +1 -1
  120. js/select2/i18n/ps.js +3 -0
  121. js/select2/i18n/pt-BR.js +1 -1
  122. js/select2/i18n/pt.js +2 -2
  123. js/select2/i18n/ro.js +2 -2
  124. js/select2/i18n/ru.js +1 -1
  125. js/select2/i18n/sk.js +2 -2
  126. js/select2/i18n/sl.js +3 -0
  127. js/select2/i18n/sr-Cyrl.js +1 -1
  128. js/select2/i18n/sr.js +1 -1
  129. js/select2/i18n/sv.js +1 -1
  130. js/select2/i18n/th.js +2 -2
  131. js/select2/i18n/tr.js +2 -2
  132. js/select2/i18n/uk.js +1 -1
  133. js/select2/i18n/vi.js +2 -2
  134. js/select2/i18n/zh-CN.js +1 -1
  135. js/select2/i18n/zh-TW.js +1 -1
  136. js/select2/select2.min.js +1 -2
  137. js/validate.js +7 -2
  138. js/wysiwyg.js +1 -1
  139. meta-box.php +1 -1
  140. readme.txt +96 -64
css/autocomplete.css CHANGED
@@ -11,4 +11,4 @@
11
  width: 10%;
12
  float: right;
13
  cursor: pointer;
14
- }
11
  width: 10%;
12
  float: right;
13
  cursor: pointer;
14
+ }
css/button-group.css CHANGED
@@ -21,48 +21,48 @@
21
  }
22
  /* Layout not inline
23
  -------------------------------------------------*/
24
- .rwmb-button-input-list:not(.inline) li label {
25
  border-top-width: 0;
26
  }
27
- .rwmb-button-input-list:not(.inline) li:first-child label {
28
  border-top-width: 1px;
29
  }
30
- .rwmb-button-input-list:not(.inline) li label.selected {
31
  border-bottom: 1px solid #fff;
32
  }
33
- .rwmb-button-input-list:not(.inline) li:last-child label.selected {
34
  border-bottom-color: #0073aa;
35
  }
36
- .rwmb-button-input-list:not(.inline) > li:first-child:not(:last-child) label {
37
  border-top-left-radius: 3px;
38
  border-top-right-radius: 3px;
39
  }
40
- .rwmb-button-input-list:not(.inline) > li:last-child:not(:first-child) label {
41
  border-bottom-right-radius: 3px;
42
  border-bottom-left-radius: 3px;
43
  }
44
  /* Layout inline
45
  ---------------------------------------------*/
46
- .rwmb-button-input-list.inline li {
47
  display: inline-block;
48
  }
49
- .rwmb-button-input-list.inline li label {
50
  border-left-width: 0;
51
  }
52
- .rwmb-button-input-list.inline li:first-child label {
53
  border-left-width: 1px;
54
  }
55
- .rwmb-button-input-list.inline li label.selected {
56
  border-right-color: rgb(255, 255, 255);
57
  }
58
- .rwmb-button-input-list.inline li:last-child label.selected {
59
  border-right-color: #0073aa;
60
  }
61
- .rwmb-button-input-list.inline > li:first-child:not(:last-child) label {
62
  border-top-left-radius: 3px;
63
  border-bottom-left-radius: 3px;
64
  }
65
- .rwmb-button-input-list.inline > li:last-child:not(:first-child) label {
66
  border-top-right-radius: 3px;
67
  border-bottom-right-radius: 3px;
68
  }
21
  }
22
  /* Layout not inline
23
  -------------------------------------------------*/
24
+ .rwmb-button-input-list:not(.rwmb-inline) li label {
25
  border-top-width: 0;
26
  }
27
+ .rwmb-button-input-list:not(.rwmb-inline) li:first-child label {
28
  border-top-width: 1px;
29
  }
30
+ .rwmb-button-input-list:not(.rwmb-inline) li label.selected {
31
  border-bottom: 1px solid #fff;
32
  }
33
+ .rwmb-button-input-list:not(.rwmb-inline) li:last-child label.selected {
34
  border-bottom-color: #0073aa;
35
  }
36
+ .rwmb-button-input-list:not(.rwmb-inline) > li:first-child:not(:last-child) label {
37
  border-top-left-radius: 3px;
38
  border-top-right-radius: 3px;
39
  }
40
+ .rwmb-button-input-list:not(.rwmb-inline) > li:last-child:not(:first-child) label {
41
  border-bottom-right-radius: 3px;
42
  border-bottom-left-radius: 3px;
43
  }
44
  /* Layout inline
45
  ---------------------------------------------*/
46
+ .rwmb-button-input-list.rwmb-inline li {
47
  display: inline-block;
48
  }
49
+ .rwmb-button-input-list.rwmb-inline li label {
50
  border-left-width: 0;
51
  }
52
+ .rwmb-button-input-list.rwmb-inline li:first-child label {
53
  border-left-width: 1px;
54
  }
55
+ .rwmb-button-input-list.rwmb-inline li label.selected {
56
  border-right-color: rgb(255, 255, 255);
57
  }
58
+ .rwmb-button-input-list.rwmb-inline li:last-child label.selected {
59
  border-right-color: #0073aa;
60
  }
61
+ .rwmb-button-input-list.rwmb-inline > li:first-child:not(:last-child) label {
62
  border-top-left-radius: 3px;
63
  border-bottom-left-radius: 3px;
64
  }
65
+ .rwmb-button-input-list.rwmb-inline > li:last-child:not(:first-child) label {
66
  border-top-right-radius: 3px;
67
  border-bottom-right-radius: 3px;
68
  }
css/color.css CHANGED
@@ -3,6 +3,6 @@
3
  }
4
  .rwmb-color-wrapper .wp-picker-holder {
5
  position: absolute;
6
- z-index: 9;
7
  min-width: 255px;
8
  }
3
  }
4
  .rwmb-color-wrapper .wp-picker-holder {
5
  position: absolute;
6
+ z-index: 99;
7
  min-width: 255px;
8
  }
css/divider.css CHANGED
@@ -4,4 +4,4 @@
4
  .rwmb-divider-wrapper hr {
5
  border: none;
6
  border-top: 1px solid #e6e6e6;
7
- }
4
  .rwmb-divider-wrapper hr {
5
  border: none;
6
  border-top: 1px solid #e6e6e6;
7
+ }
css/heading.css CHANGED
@@ -9,4 +9,4 @@
9
  text-transform: uppercase;
10
  padding: .75rem 0 .375rem;
11
  margin: 0 0 6px;
12
- }
9
  text-transform: uppercase;
10
  padding: .75rem 0 .375rem;
11
  margin: 0 0 6px;
12
+ }
css/input-list.css CHANGED
@@ -9,12 +9,12 @@
9
  list-style: none;
10
  margin-bottom: 0;
11
  }
12
- .rwmb-input-list.inline {
13
  line-height: inherit;
14
  }
15
- .rwmb-input-list.inline li {
16
  display: inline-block;
17
  }
18
- .rwmb-input-list.inline li:not(:last-child) {
19
  margin-right: 20px;
20
  }
9
  list-style: none;
10
  margin-bottom: 0;
11
  }
12
+ .rwmb-input-list.rwmb-inline {
13
  line-height: inherit;
14
  }
15
+ .rwmb-input-list.rwmb-inline li {
16
  display: inline-block;
17
  }
18
+ .rwmb-input-list.rwmb-inline li:not(:last-child) {
19
  margin-right: 20px;
20
  }
css/map.css CHANGED
@@ -3,3 +3,47 @@
3
  height: 400px;
4
  margin-bottom: 10px;
5
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  height: 400px;
4
  margin-bottom: 10px;
5
  }
6
+
7
+ /* Autocomplete style, copy from WordPress's common.css and forms.css */
8
+
9
+ input.ui-autocomplete-input.open {
10
+ border-bottom-color: transparent;
11
+ }
12
+
13
+ .ui-autocomplete {
14
+ padding: 0;
15
+ margin: 0;
16
+ list-style: none;
17
+ position: absolute;
18
+ z-index: 10000;
19
+ border: 1px solid #5b9dd9;
20
+ box-shadow: 0 1px 2px rgba( 30, 140, 190, 0.8 );
21
+ background-color: #fff;
22
+ }
23
+
24
+ .ui-autocomplete li {
25
+ margin-bottom: 0;
26
+ padding: 4px 10px;
27
+ white-space: nowrap;
28
+ text-align: left;
29
+ cursor: pointer;
30
+ }
31
+
32
+ /* Colors for the wplink toolbar autocomplete. */
33
+ .ui-autocomplete .ui-state-focus {
34
+ background-color: #ddd;
35
+ }
36
+
37
+ .ui-helper-hidden-accessible {
38
+ border: 0;
39
+ clip: rect(1px, 1px, 1px, 1px);
40
+ -webkit-clip-path: inset(50%);
41
+ clip-path: inset(50%);
42
+ height: 1px;
43
+ margin: -1px;
44
+ overflow: hidden;
45
+ padding: 0;
46
+ position: absolute;
47
+ width: 1px;
48
+ word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
49
+ }
css/oembed.css CHANGED
@@ -8,4 +8,4 @@
8
  }
9
  .rwmb-embed-media iframe {
10
  max-width: 100%;
11
- }
8
  }
9
  .rwmb-embed-media iframe {
10
  max-width: 100%;
11
+ }
css/osm.css ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .rwmb-osm-canvas {
2
+ width: 100%;
3
+ height: 400px;
4
+ margin-bottom: 10px;
5
+ }
6
+
7
+ /* Autocomplete style, copy from WordPress's common.css and forms.css */
8
+
9
+ input.ui-autocomplete-input.open {
10
+ border-bottom-color: transparent;
11
+ }
12
+
13
+ .ui-autocomplete {
14
+ padding: 0;
15
+ margin: 0;
16
+ list-style: none;
17
+ position: absolute;
18
+ z-index: 10000;
19
+ border: 1px solid #5b9dd9;
20
+ box-shadow: 0 1px 2px rgba( 30, 140, 190, 0.8 );
21
+ background-color: #fff;
22
+ }
23
+
24
+ .ui-autocomplete li {
25
+ margin-bottom: 0;
26
+ padding: 4px 10px;
27
+ white-space: nowrap;
28
+ text-align: left;
29
+ cursor: pointer;
30
+ }
31
+
32
+ /* Colors for the wplink toolbar autocomplete. */
33
+ .ui-autocomplete .ui-state-focus {
34
+ background-color: #ddd;
35
+ }
36
+
37
+ .ui-helper-hidden-accessible {
38
+ border: 0;
39
+ clip: rect(1px, 1px, 1px, 1px);
40
+ -webkit-clip-path: inset(50%);
41
+ clip-path: inset(50%);
42
+ height: 1px;
43
+ margin: -1px;
44
+ overflow: hidden;
45
+ padding: 0;
46
+ position: absolute;
47
+ width: 1px;
48
+ word-wrap: normal !important; /* many screen reader and browser combinations announce broken words as they would appear visually */
49
+ }
css/select.css CHANGED
@@ -3,7 +3,7 @@
3
  padding: 0;
4
  }
5
  .rwmb-select option {
6
- padding: 4px 8px;
7
  }
8
  .rwmb-select-all-none {
9
  display: block;
3
  padding: 0;
4
  }
5
  .rwmb-select option {
6
+ padding: 4px 8px;
7
  }
8
  .rwmb-select-all-none {
9
  display: block;
css/select2/select2.css CHANGED
@@ -3,8 +3,7 @@
3
  display: inline-block;
4
  margin: 0;
5
  position: relative;
6
- vertical-align: middle;
7
- }
8
  .select2-container .select2-selection--single {
9
  box-sizing: border-box;
10
  cursor: pointer;
@@ -32,7 +31,7 @@
32
  user-select: none;
33
  -webkit-user-select: none; }
34
  .select2-container .select2-selection--multiple .select2-selection__rendered {
35
- /*display: inline-block;*/
36
  overflow: hidden;
37
  padding-left: 8px;
38
  text-overflow: ellipsis;
@@ -185,6 +184,8 @@
185
  margin: 0;
186
  padding: 0 5px;
187
  width: 100%; }
 
 
188
  .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
189
  color: #999;
190
  margin-top: 5px;
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;
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;
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;
css/slider.css CHANGED
@@ -10,4 +10,4 @@
10
  /* Fix slider handle being visible through jQuery panel */
11
  .ui-slider .ui-slider-handle {
12
  z-index: 1;
13
- }
10
  /* Fix slider handle being visible through jQuery panel */
11
  .ui-slider .ui-slider-handle {
12
  z-index: 1;
13
+ }
css/style-rtl.css CHANGED
@@ -1,11 +1,11 @@
1
  .rwmb-label, .rwmb-input{
2
- float: right;
3
  }
4
  label.error{
5
- padding-left: auto;
6
- padding-right: 3px;
7
  }
8
  .rwmb-button.remove-clone {
9
- right: auto;
10
- left: 0;
11
  }
1
  .rwmb-label, .rwmb-input{
2
+ float: right;
3
  }
4
  label.error{
5
+ padding-left: auto;
6
+ padding-right: 3px;
7
  }
8
  .rwmb-button.remove-clone {
9
+ right: auto;
10
+ left: 0;
11
  }
css/text-list.css CHANGED
@@ -1,19 +1,19 @@
1
  .rwmb-text_list-non-cloneable > .rwmb-input,
2
  .rwmb-text_list-clone {
3
- display: flex;
4
- flex-wrap: wrap;
5
  }
6
  .rwmb-text_list-non-cloneable > .rwmb-input > label,
7
  .rwmb-text_list-clone > label {
8
- margin: 0 10px 10px 0;
9
  }
10
  .rwmb-text_list-non-cloneable > .rwmb-input > label:last-child,
11
  .rwmb-text_list-clone > label:last-child {
12
- margin-right: 0;
13
  }
14
 
15
  .rwmb-text-list-label {
16
- font-weight: 600;
17
- display: block;
18
- margin-bottom: 5px;
19
  }
1
  .rwmb-text_list-non-cloneable > .rwmb-input,
2
  .rwmb-text_list-clone {
3
+ display: flex;
4
+ flex-wrap: wrap;
5
  }
6
  .rwmb-text_list-non-cloneable > .rwmb-input > label,
7
  .rwmb-text_list-clone > label {
8
+ margin: 0 10px 10px 0;
9
  }
10
  .rwmb-text_list-non-cloneable > .rwmb-input > label:last-child,
11
  .rwmb-text_list-clone > label:last-child {
12
+ margin-right: 0;
13
  }
14
 
15
  .rwmb-text-list-label {
16
+ font-weight: 600;
17
+ display: block;
18
+ margin-bottom: 5px;
19
  }
css/upload.css CHANGED
@@ -5,10 +5,6 @@
5
  height: 200px;
6
  border: 4px dashed #ddd;
7
  }
8
- /* Fix blank space in the footer */
9
- .rwmb-upload-area .moxie-shim {
10
- display: none;
11
- }
12
  .rwmb-upload-inside {
13
  text-align: center;
14
  position: absolute;
5
  height: 200px;
6
  border: 4px dashed #ddd;
7
  }
 
 
 
 
8
  .rwmb-upload-inside {
9
  text-align: center;
10
  position: absolute;
inc/about/about.php CHANGED
@@ -137,8 +137,8 @@ class RWMB_About {
137
  * Enqueue CSS and JS.
138
  */
139
  public function enqueue() {
140
- wp_enqueue_style( 'meta-box-about', RWMB_URL . 'inc/about/css/about.css' );
141
- wp_enqueue_script( 'meta-box-about', RWMB_URL . 'inc/about/js/about.js', array( 'jquery' ), '', true );
142
  }
143
 
144
  /**
@@ -165,7 +165,7 @@ class RWMB_About {
165
  * or just the current site. Multisite only. Default is false.
166
  */
167
  public function redirect( $plugin, $network_wide ) {
168
- if ( ! $network_wide && 'meta-box/meta-box.php' === $plugin && ! $this->is_bundled() ) {
169
  wp_safe_redirect( $this->get_menu_link() );
170
  die;
171
  }
137
  * Enqueue CSS and JS.
138
  */
139
  public function enqueue() {
140
+ wp_enqueue_style( 'meta-box-about', RWMB_URL . 'inc/about/css/about.css', array(), RWMB_VER );
141
+ wp_enqueue_script( 'meta-box-about', RWMB_URL . 'inc/about/js/about.js', array( 'jquery' ), RWMB_VER, true );
142
  }
143
 
144
  /**
165
  * or just the current site. Multisite only. Default is false.
166
  */
167
  public function redirect( $plugin, $network_wide ) {
168
+ if ( 'cli' !== php_sapi_name() && ! $network_wide && 'meta-box/meta-box.php' === $plugin && ! $this->is_bundled() ) {
169
  wp_safe_redirect( $this->get_menu_link() );
170
  die;
171
  }
inc/about/js/about.js CHANGED
@@ -3,18 +3,22 @@
3
 
4
  function tabs() {
5
  var $container = $( '.nav-tab-wrapper' ),
6
- $tabs = $container.find( '.nav-tab' ),
7
- $panes = $( '.gt-tab-pane' );
8
 
9
- $container.on( 'click', '.nav-tab', function ( e ) {
10
- e.preventDefault();
 
 
 
11
 
12
- $tabs.removeClass( 'nav-tab-active' );
13
- $( this ).addClass( 'nav-tab-active' );
14
 
15
- $panes.removeClass( 'gt-is-active' );
16
- $panes.filter( $( this ).attr( 'href' ) ).addClass( 'gt-is-active' );
17
- } );
 
18
  }
19
 
20
  // Auto activate tabs when DOM ready.
3
 
4
  function tabs() {
5
  var $container = $( '.nav-tab-wrapper' ),
6
+ $tabs = $container.find( '.nav-tab' ),
7
+ $panes = $( '.gt-tab-pane' );
8
 
9
+ $container.on(
10
+ 'click',
11
+ '.nav-tab',
12
+ function ( e ) {
13
+ e.preventDefault();
14
 
15
+ $tabs.removeClass( 'nav-tab-active' );
16
+ $( this ).addClass( 'nav-tab-active' );
17
 
18
+ $panes.removeClass( 'gt-is-active' );
19
+ $panes.filter( $( this ).attr( 'href' ) ).addClass( 'gt-is-active' );
20
+ }
21
+ );
22
  }
23
 
24
  // Auto activate tabs when DOM ready.
inc/about/sections/support.php CHANGED
@@ -7,7 +7,17 @@
7
 
8
  ?>
9
  <div id="support" class="gt-tab-pane">
10
- <p class="about-description">Still need help with Meta Box? We offer excellent support for you. But don't forget to check our <a href="https://docs.metabox.io?utm_source=WordPress&utm_medium=link&utm_campaign=plugin">documentation</a> first.</p>
 
 
 
 
 
 
 
 
 
 
11
  <div class="feature-section two-col">
12
  <div class="col">
13
  <h3><?php esc_html_e( 'Free Support', 'meta-box' ); ?></h3>
7
 
8
  ?>
9
  <div id="support" class="gt-tab-pane">
10
+ <p class="about-description">
11
+ <?php
12
+ $allowed_html = array(
13
+ 'a' => array(
14
+ 'href' => array(),
15
+ ),
16
+ );
17
+ // Translators: %s - link to documentation.
18
+ echo wp_kses( sprintf( __( 'Still need help with Meta Box? We offer excellent support for you. But don\'t forget to check our <a href="%s">documentation</a> first.', 'meta-box' ), 'https://docs.metabox.io?utm_source=WordPress&utm_medium=link&utm_campaign=plugin' ), $allowed_html );
19
+ ?>
20
+ </p>
21
  <div class="feature-section two-col">
22
  <div class="col">
23
  <h3><?php esc_html_e( 'Free Support', 'meta-box' ); ?></h3>
inc/about/sections/tabs.php CHANGED
@@ -8,7 +8,7 @@
8
  ?>
9
  <h2 class="nav-tab-wrapper">
10
  <a href="#getting-started" class="nav-tab nav-tab-active"><?php esc_html_e( 'Getting Started', 'meta-box' ); ?></a>
11
- <?php do_action( 'rwmb_about_tabs' ); ?>
12
  <a href="#extensions" class="nav-tab"><?php esc_html_e( 'Extensions', 'meta-box' ); ?></a>
13
  <a href="#support" class="nav-tab"><?php esc_html_e( 'Support', 'meta-box' ); ?></a>
14
  </h2>
8
  ?>
9
  <h2 class="nav-tab-wrapper">
10
  <a href="#getting-started" class="nav-tab nav-tab-active"><?php esc_html_e( 'Getting Started', 'meta-box' ); ?></a>
11
+ <?php do_action( 'rwmb_about_tabs' ); ?>
12
  <a href="#extensions" class="nav-tab"><?php esc_html_e( 'Extensions', 'meta-box' ); ?></a>
13
  <a href="#support" class="nav-tab"><?php esc_html_e( 'Support', 'meta-box' ); ?></a>
14
  </h2>
inc/clone.php CHANGED
@@ -49,14 +49,14 @@ class RWMB_Clone {
49
  $class = "rwmb-clone rwmb-{$field['type']}-clone";
50
  $sort_icon = '';
51
  if ( $field['sort_clone'] ) {
52
- $class .= ' rwmb-sort-clone';
53
  $sort_icon = "<a href='javascript:;' class='rwmb-clone-icon'></a>";
54
  }
55
  $input_html = "<div class='$class'>" . $sort_icon;
56
 
57
  // Call separated methods for displaying each type of field.
58
  $input_html .= RWMB_Field::call( $sub_field, 'html', $sub_meta );
59
- $input_html = RWMB_Field::filter( 'html', $input_html, $sub_field, $sub_meta );
60
 
61
  // Remove clone button.
62
  $input_html .= self::remove_clone_button( $sub_field );
@@ -88,8 +88,8 @@ class RWMB_Clone {
88
  }
89
 
90
  foreach ( $new as $key => $value ) {
91
- $old_value = isset( $old[ $key ] ) ? $old[ $key ] : null;
92
- $value = RWMB_Field::call( $field, 'value', $value, $old_value, $post_id );
93
  $new[ $key ] = RWMB_Field::filter( 'sanitize', $value, $field );
94
  }
95
 
49
  $class = "rwmb-clone rwmb-{$field['type']}-clone";
50
  $sort_icon = '';
51
  if ( $field['sort_clone'] ) {
52
+ $class .= ' rwmb-sort-clone';
53
  $sort_icon = "<a href='javascript:;' class='rwmb-clone-icon'></a>";
54
  }
55
  $input_html = "<div class='$class'>" . $sort_icon;
56
 
57
  // Call separated methods for displaying each type of field.
58
  $input_html .= RWMB_Field::call( $sub_field, 'html', $sub_meta );
59
+ $input_html = RWMB_Field::filter( 'html', $input_html, $sub_field, $sub_meta );
60
 
61
  // Remove clone button.
62
  $input_html .= self::remove_clone_button( $sub_field );
88
  }
89
 
90
  foreach ( $new as $key => $value ) {
91
+ $old_value = isset( $old[ $key ] ) ? $old[ $key ] : null;
92
+ $value = RWMB_Field::call( $field, 'value', $value, $old_value, $post_id );
93
  $new[ $key ] = RWMB_Field::filter( 'sanitize', $value, $field );
94
  }
95
 
inc/field.php CHANGED
@@ -184,10 +184,10 @@ abstract class RWMB_Field {
184
  return '';
185
  }
186
 
187
- if ( isset( $args['object_type'] ) ) {
188
- $storage = rwmb_get_storage( $args['object_type'] );
189
- } elseif ( isset( $field['storage'] ) ) {
190
  $storage = $field['storage'];
 
 
191
  } else {
192
  $storage = rwmb_get_storage( 'post' );
193
  }
@@ -290,10 +290,10 @@ abstract class RWMB_Field {
290
  * @param array $field The field parameters.
291
  */
292
  public static function save( $new, $old, $post_id, $field ) {
293
- if ( empty( $field['id'] ) ) {
294
  return;
295
  }
296
- $name = $field['id'];
297
  $storage = $field['storage'];
298
 
299
  // Remove post meta if it's empty.
@@ -351,8 +351,8 @@ abstract class RWMB_Field {
351
 
352
  // If field is multiple, value is saved as multiple entries in the database (WordPress behaviour).
353
  if ( $field['multiple'] ) {
354
- $old = (array) $old;
355
- $new = (array) $new;
356
  $new_values = array_diff( $new, $old );
357
  foreach ( $new_values as $new_value ) {
358
  $storage->add( $post_id, $name, $new_value, false );
@@ -376,38 +376,45 @@ abstract class RWMB_Field {
376
  * @return array
377
  */
378
  public static function normalize( $field ) {
379
- $field = wp_parse_args( $field, array(
380
- 'id' => '',
381
- 'name' => '',
382
- 'label_description' => '',
383
- 'multiple' => false,
384
- 'std' => '',
385
- 'desc' => '',
386
- 'format' => '',
387
- 'before' => '',
388
- 'after' => '',
389
- 'field_name' => isset( $field['id'] ) ? $field['id'] : '',
390
- 'placeholder' => '',
391
-
392
- 'clone' => false,
393
- 'max_clone' => 0,
394
- 'sort_clone' => false,
395
- 'add_button' => __( '+ Add more', 'meta-box' ),
396
- 'clone_default' => false,
397
- 'clone_as_multiple' => false,
398
-
399
- 'class' => '',
400
- 'disabled' => false,
401
- 'required' => false,
402
- 'autofocus' => false,
403
- 'attributes' => array(),
404
- ) );
 
 
 
 
405
 
406
  if ( $field['clone_default'] ) {
407
- $field['attributes'] = wp_parse_args( $field['attributes'], array(
408
- 'data-default' => $field['std'],
409
- 'data-clone-default' => 'true',
410
- ) );
 
 
 
411
  }
412
 
413
  return $field;
@@ -422,14 +429,17 @@ abstract class RWMB_Field {
422
  * @return array
423
  */
424
  public static function get_attributes( $field, $value = null ) {
425
- $attributes = wp_parse_args( $field['attributes'], array(
426
- 'disabled' => $field['disabled'],
427
- 'autofocus' => $field['autofocus'],
428
- 'required' => $field['required'],
429
- 'id' => $field['id'],
430
- 'class' => '',
431
- 'name' => $field['field_name'],
432
- ) );
 
 
 
433
 
434
  $attributes['class'] = trim( implode( ' ', array_merge( array( "rwmb-{$field['type']}" ), (array) $attributes['class'] ) ) );
435
 
@@ -487,7 +497,7 @@ abstract class RWMB_Field {
487
  }
488
 
489
  // Get raw meta value in the database, no escape.
490
- $value = self::call( $field, 'raw_meta', $post_id, $args );
491
 
492
  // Make sure meta value is an array for cloneable and multiple fields.
493
  if ( $field['clone'] || $field['multiple'] ) {
@@ -619,7 +629,7 @@ abstract class RWMB_Field {
619
  * @return string Field mapped type.
620
  */
621
  public static function map_types( $field ) {
622
- $type = isset( $field['type'] ) ? $field['type'] : 'input';
623
  $type_map = apply_filters(
624
  'rwmb_type_map',
625
  array(
@@ -639,7 +649,7 @@ abstract class RWMB_Field {
639
  * @return string Field class name.
640
  */
641
  public static function get_class_name( $field ) {
642
- $type = self::map_types( $field );
643
  $type = str_replace( array( '-', '_' ), ' ', $type );
644
  $class = 'RWMB_' . ucwords( $type ) . '_Field';
645
  $class = str_replace( ' ', '_', $class );
184
  return '';
185
  }
186
 
187
+ if ( isset( $field['storage'] ) ) {
 
 
188
  $storage = $field['storage'];
189
+ } elseif ( isset( $args['object_type'] ) ) {
190
+ $storage = rwmb_get_storage( $args['object_type'] );
191
  } else {
192
  $storage = rwmb_get_storage( 'post' );
193
  }
290
  * @param array $field The field parameters.
291
  */
292
  public static function save( $new, $old, $post_id, $field ) {
293
+ if ( empty( $field['id'] ) || ! $field['save_field'] ) {
294
  return;
295
  }
296
+ $name = $field['id'];
297
  $storage = $field['storage'];
298
 
299
  // Remove post meta if it's empty.
351
 
352
  // If field is multiple, value is saved as multiple entries in the database (WordPress behaviour).
353
  if ( $field['multiple'] ) {
354
+ $old = (array) $old;
355
+ $new = (array) $new;
356
  $new_values = array_diff( $new, $old );
357
  foreach ( $new_values as $new_value ) {
358
  $storage->add( $post_id, $name, $new_value, false );
376
  * @return array
377
  */
378
  public static function normalize( $field ) {
379
+ $field = wp_parse_args(
380
+ $field,
381
+ array(
382
+ 'id' => '',
383
+ 'name' => '',
384
+ 'label_description' => '',
385
+ 'multiple' => false,
386
+ 'std' => '',
387
+ 'desc' => '',
388
+ 'format' => '',
389
+ 'before' => '',
390
+ 'after' => '',
391
+ 'field_name' => isset( $field['id'] ) ? $field['id'] : '',
392
+ 'placeholder' => '',
393
+ 'save_field' => true,
394
+
395
+ 'clone' => false,
396
+ 'max_clone' => 0,
397
+ 'sort_clone' => false,
398
+ 'add_button' => __( '+ Add more', 'meta-box' ),
399
+ 'clone_default' => false,
400
+ 'clone_as_multiple' => false,
401
+
402
+ 'class' => '',
403
+ 'disabled' => false,
404
+ 'required' => false,
405
+ 'autofocus' => false,
406
+ 'attributes' => array(),
407
+ )
408
+ );
409
 
410
  if ( $field['clone_default'] ) {
411
+ $field['attributes'] = wp_parse_args(
412
+ $field['attributes'],
413
+ array(
414
+ 'data-default' => $field['std'],
415
+ 'data-clone-default' => 'true',
416
+ )
417
+ );
418
  }
419
 
420
  return $field;
429
  * @return array
430
  */
431
  public static function get_attributes( $field, $value = null ) {
432
+ $attributes = wp_parse_args(
433
+ $field['attributes'],
434
+ array(
435
+ 'disabled' => $field['disabled'],
436
+ 'autofocus' => $field['autofocus'],
437
+ 'required' => $field['required'],
438
+ 'id' => $field['id'],
439
+ 'class' => '',
440
+ 'name' => $field['field_name'],
441
+ )
442
+ );
443
 
444
  $attributes['class'] = trim( implode( ' ', array_merge( array( "rwmb-{$field['type']}" ), (array) $attributes['class'] ) ) );
445
 
497
  }
498
 
499
  // Get raw meta value in the database, no escape.
500
+ $value = self::call( $field, 'raw_meta', $post_id, $args );
501
 
502
  // Make sure meta value is an array for cloneable and multiple fields.
503
  if ( $field['clone'] || $field['multiple'] ) {
629
  * @return string Field mapped type.
630
  */
631
  public static function map_types( $field ) {
632
+ $type = isset( $field['type'] ) ? $field['type'] : 'input';
633
  $type_map = apply_filters(
634
  'rwmb_type_map',
635
  array(
649
  * @return string Field class name.
650
  */
651
  public static function get_class_name( $field ) {
652
+ $type = self::map_types( $field );
653
  $type = str_replace( array( '-', '_' ), ' ', $type );
654
  $class = 'RWMB_' . ucwords( $type ) . '_Field';
655
  $class = str_replace( ' ', '_', $class );
inc/fields/autocomplete.php CHANGED
@@ -16,9 +16,13 @@ class RWMB_Autocomplete_Field extends RWMB_Multiple_Values_Field {
16
  wp_enqueue_style( 'rwmb-autocomplete', RWMB_CSS_URL . 'autocomplete.css', '', RWMB_VER );
17
  wp_enqueue_script( 'rwmb-autocomplete', RWMB_JS_URL . 'autocomplete.js', array( 'jquery-ui-autocomplete' ), RWMB_VER, true );
18
 
19
- self::localize_script( 'rwmb-autocomplete', 'RWMB_Autocomplete', array(
20
- 'delete' => __( 'Delete', 'meta-box' ),
21
- ) );
 
 
 
 
22
  }
23
 
24
  /**
@@ -110,9 +114,12 @@ class RWMB_Autocomplete_Field extends RWMB_Multiple_Values_Field {
110
  */
111
  public static function normalize( $field ) {
112
  $field = parent::normalize( $field );
113
- $field = wp_parse_args( $field, array(
114
- 'size' => 30,
115
- ) );
 
 
 
116
  return $field;
117
  }
118
  }
16
  wp_enqueue_style( 'rwmb-autocomplete', RWMB_CSS_URL . 'autocomplete.css', '', RWMB_VER );
17
  wp_enqueue_script( 'rwmb-autocomplete', RWMB_JS_URL . 'autocomplete.js', array( 'jquery-ui-autocomplete' ), RWMB_VER, true );
18
 
19
+ self::localize_script(
20
+ 'rwmb-autocomplete',
21
+ 'RWMB_Autocomplete',
22
+ array(
23
+ 'delete' => __( 'Delete', 'meta-box' ),
24
+ )
25
+ );
26
  }
27
 
28
  /**
114
  */
115
  public static function normalize( $field ) {
116
  $field = parent::normalize( $field );
117
+ $field = wp_parse_args(
118
+ $field,
119
+ array(
120
+ 'size' => 30,
121
+ )
122
+ );
123
  return $field;
124
  }
125
  }
inc/fields/background.php CHANGED
@@ -28,102 +28,117 @@ class RWMB_Background_Field extends RWMB_Field {
28
  * @return string
29
  */
30
  public static function html( $meta, $field ) {
31
- $meta = wp_parse_args( $meta, array(
32
- 'color' => '',
33
- 'image' => '',
34
- 'repeat' => '',
35
- 'attachment' => '',
36
- 'position' => '',
37
- 'size' => '',
38
- ) );
 
 
 
39
 
40
  $output = '<div class="rwmb-background-row">';
41
 
42
  // Color.
43
- $color = RWMB_Color_Field::normalize( array(
44
- 'type' => 'color',
45
- 'id' => "{$field['id']}_color",
46
- 'field_name' => "{$field['field_name']}[color]",
47
- ) );
 
 
48
  $output .= RWMB_Color_Field::html( $meta['color'], $color );
49
 
50
  $output .= '</div><!-- .rwmb-background-row -->';
51
  $output .= '<div class="rwmb-background-row">';
52
 
53
  // Image.
54
- $image = RWMB_File_Input_Field::normalize( array(
55
- 'type' => 'file_input',
56
- 'id' => "{$field['id']}_image",
57
- 'field_name' => "{$field['field_name']}[image]",
58
- 'placeholder' => __( 'Background Image', 'meta-box' ),
59
- ) );
 
 
60
  $output .= RWMB_File_Input_Field::html( $meta['image'], $image );
61
 
62
  $output .= '</div><!-- .rwmb-background-row -->';
63
  $output .= '<div class="rwmb-background-row">';
64
 
65
  // Repeat.
66
- $repeat = RWMB_Select_Field::normalize( array(
67
- 'type' => 'select',
68
- 'id' => "{$field['id']}_repeat",
69
- 'field_name' => "{$field['field_name']}[repeat]",
70
- 'placeholder' => esc_html__( '-- Background Repeat --', 'meta-box' ),
71
- 'options' => array(
72
- 'no-repeat' => esc_html__( 'No Repeat', 'meta-box' ),
73
- 'repeat' => esc_html__( 'Repeat All', 'meta-box' ),
74
- 'repeat-x' => esc_html__( 'Repeat Horizontally', 'meta-box' ),
75
- 'repeat-y' => esc_html__( 'Repeat Vertically', 'meta-box' ),
76
- 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
77
- ),
78
- ) );
 
 
79
  $output .= RWMB_Select_Field::html( $meta['repeat'], $repeat );
80
 
81
  // Position.
82
- $position = RWMB_Select_Field::normalize( array(
83
- 'type' => 'select',
84
- 'id' => "{$field['id']}_position",
85
- 'field_name' => "{$field['field_name']}[position]",
86
- 'placeholder' => esc_html__( '-- Background Position --', 'meta-box' ),
87
- 'options' => array(
88
- 'top left' => esc_html__( 'Top Left', 'meta-box' ),
89
- 'top center' => esc_html__( 'Top Center', 'meta-box' ),
90
- 'top right' => esc_html__( 'Top Right', 'meta-box' ),
91
- 'center left' => esc_html__( 'Center Left', 'meta-box' ),
92
- 'center center' => esc_html__( 'Center Center', 'meta-box' ),
93
- 'center right' => esc_html__( 'Center Right', 'meta-box' ),
94
- 'bottom left' => esc_html__( 'Bottom Left', 'meta-box' ),
95
- 'bottom center' => esc_html__( 'Bottom Center', 'meta-box' ),
96
- 'bottom right' => esc_html__( 'Bottom Right', 'meta-box' ),
97
- ),
98
- ) );
99
- $output .= RWMB_Select_Field::html( $meta['position'], $position );
 
 
100
 
101
  // Attachment.
102
- $attachment = RWMB_Select_Field::normalize( array(
103
- 'type' => 'select',
104
- 'id' => "{$field['id']}_attachment",
105
- 'field_name' => "{$field['field_name']}[attachment]",
106
- 'placeholder' => esc_html__( '-- Background Attachment --', 'meta-box' ),
107
- 'options' => array(
108
- 'fixed' => esc_html__( 'Fixed', 'meta-box' ),
109
- 'scroll' => esc_html__( 'Scroll', 'meta-box' ),
110
- 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
111
- ),
112
- ) );
113
- $output .= RWMB_Select_Field::html( $meta['attachment'], $attachment );
 
 
114
 
115
  // Size.
116
- $size = RWMB_Select_Field::normalize( array(
117
- 'type' => 'select',
118
- 'id' => "{$field['id']}_size",
119
- 'field_name' => "{$field['field_name']}[size]",
120
- 'placeholder' => esc_html__( '-- Background Size --', 'meta-box' ),
121
- 'options' => array(
122
- 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
123
- 'cover' => esc_html__( 'Cover', 'meta-box' ),
124
- 'contain' => esc_html__( 'Contain', 'meta-box' ),
125
- ),
126
- ) );
 
 
127
  $output .= RWMB_Select_Field::html( $meta['size'], $size );
128
  $output .= '</div><!-- .rwmb-background-row -->';
129
 
@@ -144,8 +159,8 @@ class RWMB_Background_Field extends RWMB_Field {
144
  $output = '';
145
  $value = array_filter( $value );
146
  foreach ( $value as $key => $subvalue ) {
147
- $subvalue = 'image' === $key ? 'url( "' . esc_url( $subvalue ) . '")' : $subvalue;
148
- $output .= 'background-' . $key . ': ' . $subvalue . ';';
149
  }
150
  return $output;
151
  }
28
  * @return string
29
  */
30
  public static function html( $meta, $field ) {
31
+ $meta = wp_parse_args(
32
+ $meta,
33
+ array(
34
+ 'color' => '',
35
+ 'image' => '',
36
+ 'repeat' => '',
37
+ 'attachment' => '',
38
+ 'position' => '',
39
+ 'size' => '',
40
+ )
41
+ );
42
 
43
  $output = '<div class="rwmb-background-row">';
44
 
45
  // Color.
46
+ $color = RWMB_Color_Field::normalize(
47
+ array(
48
+ 'type' => 'color',
49
+ 'id' => "{$field['id']}_color",
50
+ 'field_name' => "{$field['field_name']}[color]",
51
+ )
52
+ );
53
  $output .= RWMB_Color_Field::html( $meta['color'], $color );
54
 
55
  $output .= '</div><!-- .rwmb-background-row -->';
56
  $output .= '<div class="rwmb-background-row">';
57
 
58
  // Image.
59
+ $image = RWMB_File_Input_Field::normalize(
60
+ array(
61
+ 'type' => 'file_input',
62
+ 'id' => "{$field['id']}_image",
63
+ 'field_name' => "{$field['field_name']}[image]",
64
+ 'placeholder' => __( 'Background Image', 'meta-box' ),
65
+ )
66
+ );
67
  $output .= RWMB_File_Input_Field::html( $meta['image'], $image );
68
 
69
  $output .= '</div><!-- .rwmb-background-row -->';
70
  $output .= '<div class="rwmb-background-row">';
71
 
72
  // Repeat.
73
+ $repeat = RWMB_Select_Field::normalize(
74
+ array(
75
+ 'type' => 'select',
76
+ 'id' => "{$field['id']}_repeat",
77
+ 'field_name' => "{$field['field_name']}[repeat]",
78
+ 'placeholder' => esc_html__( '-- Background Repeat --', 'meta-box' ),
79
+ 'options' => array(
80
+ 'no-repeat' => esc_html__( 'No Repeat', 'meta-box' ),
81
+ 'repeat' => esc_html__( 'Repeat All', 'meta-box' ),
82
+ 'repeat-x' => esc_html__( 'Repeat Horizontally', 'meta-box' ),
83
+ 'repeat-y' => esc_html__( 'Repeat Vertically', 'meta-box' ),
84
+ 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
85
+ ),
86
+ )
87
+ );
88
  $output .= RWMB_Select_Field::html( $meta['repeat'], $repeat );
89
 
90
  // Position.
91
+ $position = RWMB_Select_Field::normalize(
92
+ array(
93
+ 'type' => 'select',
94
+ 'id' => "{$field['id']}_position",
95
+ 'field_name' => "{$field['field_name']}[position]",
96
+ 'placeholder' => esc_html__( '-- Background Position --', 'meta-box' ),
97
+ 'options' => array(
98
+ 'top left' => esc_html__( 'Top Left', 'meta-box' ),
99
+ 'top center' => esc_html__( 'Top Center', 'meta-box' ),
100
+ 'top right' => esc_html__( 'Top Right', 'meta-box' ),
101
+ 'center left' => esc_html__( 'Center Left', 'meta-box' ),
102
+ 'center center' => esc_html__( 'Center Center', 'meta-box' ),
103
+ 'center right' => esc_html__( 'Center Right', 'meta-box' ),
104
+ 'bottom left' => esc_html__( 'Bottom Left', 'meta-box' ),
105
+ 'bottom center' => esc_html__( 'Bottom Center', 'meta-box' ),
106
+ 'bottom right' => esc_html__( 'Bottom Right', 'meta-box' ),
107
+ ),
108
+ )
109
+ );
110
+ $output .= RWMB_Select_Field::html( $meta['position'], $position );
111
 
112
  // Attachment.
113
+ $attachment = RWMB_Select_Field::normalize(
114
+ array(
115
+ 'type' => 'select',
116
+ 'id' => "{$field['id']}_attachment",
117
+ 'field_name' => "{$field['field_name']}[attachment]",
118
+ 'placeholder' => esc_html__( '-- Background Attachment --', 'meta-box' ),
119
+ 'options' => array(
120
+ 'fixed' => esc_html__( 'Fixed', 'meta-box' ),
121
+ 'scroll' => esc_html__( 'Scroll', 'meta-box' ),
122
+ 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
123
+ ),
124
+ )
125
+ );
126
+ $output .= RWMB_Select_Field::html( $meta['attachment'], $attachment );
127
 
128
  // Size.
129
+ $size = RWMB_Select_Field::normalize(
130
+ array(
131
+ 'type' => 'select',
132
+ 'id' => "{$field['id']}_size",
133
+ 'field_name' => "{$field['field_name']}[size]",
134
+ 'placeholder' => esc_html__( '-- Background Size --', 'meta-box' ),
135
+ 'options' => array(
136
+ 'inherit' => esc_html__( 'Inherit', 'meta-box' ),
137
+ 'cover' => esc_html__( 'Cover', 'meta-box' ),
138
+ 'contain' => esc_html__( 'Contain', 'meta-box' ),
139
+ ),
140
+ )
141
+ );
142
  $output .= RWMB_Select_Field::html( $meta['size'], $size );
143
  $output .= '</div><!-- .rwmb-background-row -->';
144
 
159
  $output = '';
160
  $value = array_filter( $value );
161
  foreach ( $value as $key => $subvalue ) {
162
+ $subvalue = 'image' === $key ? 'url(' . esc_url( $subvalue ) . ')' : $subvalue;
163
+ $output .= 'background-' . $key . ': ' . $subvalue . ';';
164
  }
165
  return $output;
166
  }
inc/fields/button-group.php CHANGED
@@ -18,22 +18,21 @@ class RWMB_Button_Group_Field extends RWMB_Choice_Field {
18
  }
19
 
20
  /**
21
- * Walk options.
22
- *
23
- * @param array $field Field parameters.
24
- * @param mixed $options Select options.
25
- * @param mixed $db_fields Database fields to use in the output.
26
- * @param mixed $meta Meta value.
27
  *
 
 
28
  * @return string
29
  */
30
- public static function walk( $field, $options, $db_fields, $meta ) {
31
- $walker = new RWMB_Walker_Input_List( $db_fields, $field, $meta );
 
32
 
33
- $output = sprintf( '<ul class="rwmb-button-input-list %s">',
34
- $field['inline'] ? 'inline' : ''
 
35
  );
36
- $output .= $walker->walk( $options, - 1 );
37
  $output .= '</ul>';
38
 
39
  return $output;
@@ -48,9 +47,12 @@ class RWMB_Button_Group_Field extends RWMB_Choice_Field {
48
  */
49
  public static function normalize( $field ) {
50
  $field = parent::normalize( $field );
51
- $field = wp_parse_args( $field, array(
52
- 'inline' => null,
53
- ) );
 
 
 
54
 
55
  $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
56
  $field = RWMB_Input_Field::normalize( $field );
18
  }
19
 
20
  /**
21
+ * Get field HTML.
 
 
 
 
 
22
  *
23
+ * @param mixed $meta Meta value.
24
+ * @param array $field Field parameters.
25
  * @return string
26
  */
27
+ public static function html( $meta, $field ) {
28
+ $options = self::transform_options( $field['options'] );
29
+ $walker = new RWMB_Walker_Input_List( $field, $meta );
30
 
31
+ $output = sprintf(
32
+ '<ul class="rwmb-button-input-list %s">',
33
+ $field['inline'] ? ' rwmb-inline' : ''
34
  );
35
+ $output .= $walker->walk( $options, -1 );
36
  $output .= '</ul>';
37
 
38
  return $output;
47
  */
48
  public static function normalize( $field ) {
49
  $field = parent::normalize( $field );
50
+ $field = wp_parse_args(
51
+ $field,
52
+ array(
53
+ 'inline' => null,
54
+ )
55
+ );
56
 
57
  $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
58
  $field = RWMB_Input_Field::normalize( $field );
inc/fields/button.php CHANGED
@@ -28,9 +28,12 @@ class RWMB_Button_Field extends RWMB_Field {
28
  * @return array
29
  */
30
  public static function normalize( $field ) {
31
- $field = wp_parse_args( $field, array(
32
- 'std' => __( 'Click me', 'meta-box' ),
33
- ) );
 
 
 
34
  $field = parent::normalize( $field );
35
  return $field;
36
  }
@@ -44,9 +47,12 @@ class RWMB_Button_Field extends RWMB_Field {
44
  */
45
  public static function get_attributes( $field, $value = null ) {
46
  $attributes = parent::get_attributes( $field, $value );
47
- $attributes = wp_parse_args( $attributes, array(
48
- 'type' => $field['type'],
49
- ) );
 
 
 
50
  $attributes['class'] .= ' button hide-if-no-js';
51
 
52
  return $attributes;
28
  * @return array
29
  */
30
  public static function normalize( $field ) {
31
+ $field = wp_parse_args(
32
+ $field,
33
+ array(
34
+ 'std' => __( 'Click me', 'meta-box' ),
35
+ )
36
+ );
37
  $field = parent::normalize( $field );
38
  return $field;
39
  }
47
  */
48
  public static function get_attributes( $field, $value = null ) {
49
  $attributes = parent::get_attributes( $field, $value );
50
+ $attributes = wp_parse_args(
51
+ $attributes,
52
+ array(
53
+ 'type' => $field['type'],
54
+ )
55
+ );
56
  $attributes['class'] .= ' button hide-if-no-js';
57
 
58
  return $attributes;
inc/fields/checkbox-list.php CHANGED
@@ -17,7 +17,7 @@ class RWMB_Checkbox_List_Field extends RWMB_Input_List_Field {
17
  */
18
  public static function normalize( $field ) {
19
  $field['multiple'] = true;
20
- $field = parent::normalize( $field );
21
 
22
  return $field;
23
  }
17
  */
18
  public static function normalize( $field ) {
19
  $field['multiple'] = true;
20
+ $field = parent::normalize( $field );
21
 
22
  return $field;
23
  }
inc/fields/choice.php CHANGED
@@ -9,19 +9,6 @@
9
  * Abstract class for any kind of choice field.
10
  */
11
  abstract class RWMB_Choice_Field extends RWMB_Field {
12
- /**
13
- * Walk options.
14
- *
15
- * @param array $field Field parameters.
16
- * @param mixed $options Select options.
17
- * @param mixed $db_fields Database fields to use in the output.
18
- * @param mixed $meta Meta value.
19
- * @return string
20
- */
21
- public static function walk( $field, $options, $db_fields, $meta ) {
22
- return '';
23
- }
24
-
25
  /**
26
  * Get field HTML.
27
  *
@@ -30,11 +17,7 @@ abstract class RWMB_Choice_Field extends RWMB_Field {
30
  * @return string
31
  */
32
  public static function html( $meta, $field ) {
33
- $meta = (array) $meta;
34
- $options = self::call( 'get_options', $field );
35
- $options = self::call( 'filter_options', $field, $options );
36
- $db_fields = self::call( 'get_db_fields', $field );
37
- return ! empty( $options ) ? self::call( 'walk', $field, $options, $db_fields, $meta ) : null;
38
  }
39
 
40
  /**
@@ -45,64 +28,37 @@ abstract class RWMB_Choice_Field extends RWMB_Field {
45
  */
46
  public static function normalize( $field ) {
47
  $field = parent::normalize( $field );
48
- $field = wp_parse_args( $field, array(
49
- 'flatten' => true,
50
- 'options' => array(),
51
- ) );
 
 
 
52
 
53
  return $field;
54
  }
55
 
56
  /**
57
- * Get field names of object to be used by walker.
58
- *
59
- * @return array
60
- */
61
- public static function get_db_fields() {
62
- return array(
63
- 'parent' => 'parent',
64
- 'id' => 'value',
65
- 'label' => 'label',
66
- );
67
- }
68
-
69
- /**
70
- * Get options for walker.
71
  *
72
- * @param array $field Field parameters.
73
  *
74
  * @return array
75
  */
76
- public static function get_options( $field ) {
77
- $options = array();
78
- foreach ( (array) $field['options'] as $value => $label ) {
 
79
  $option = is_array( $label ) ? $label : array(
80
  'label' => (string) $label,
81
  'value' => (string) $value,
82
  );
83
  if ( isset( $option['label'] ) && isset( $option['value'] ) ) {
84
- $options[ $option['value'] ] = (object) $option;
85
  }
86
  }
87
- return $options;
88
- }
89
-
90
- /**
91
- * Filter options for walker.
92
- *
93
- * @param array $field Field parameters.
94
- * @param array $options Array of choice options.
95
- *
96
- * @return array
97
- */
98
- public static function filter_options( $field, $options ) {
99
- $db_fields = self::call( 'get_db_fields', $field );
100
- $label = $db_fields['label'];
101
- foreach ( $options as &$option ) {
102
- $option = apply_filters( 'rwmb_option', $option, $field );
103
- $option->$label = apply_filters( 'rwmb_option_label', $option->$label, $option, $field );
104
- }
105
- return $options;
106
  }
107
 
108
  /**
@@ -116,19 +72,7 @@ abstract class RWMB_Choice_Field extends RWMB_Field {
116
  * @return string
117
  */
118
  public static function format_single_value( $field, $value, $args, $post_id ) {
119
- return self::call( 'get_option_label', $field, $value );
120
- }
121
-
122
- /**
123
- * Get option label.
124
- *
125
- * @param array $field Field parameters.
126
- * @param string $value Option value.
127
- *
128
- * @return string
129
- */
130
- public static function get_option_label( $field, $value ) {
131
- $options = self::call( 'get_options', $field );
132
  return isset( $options[ $value ] ) ? $options[ $value ]->label : '';
133
  }
134
  }
9
  * Abstract class for any kind of choice field.
10
  */
11
  abstract class RWMB_Choice_Field extends RWMB_Field {
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  /**
13
  * Get field HTML.
14
  *
17
  * @return string
18
  */
19
  public static function html( $meta, $field ) {
20
+ return '';
 
 
 
 
21
  }
22
 
23
  /**
28
  */
29
  public static function normalize( $field ) {
30
  $field = parent::normalize( $field );
31
+ $field = wp_parse_args(
32
+ $field,
33
+ array(
34
+ 'flatten' => true,
35
+ 'options' => array(),
36
+ )
37
+ );
38
 
39
  return $field;
40
  }
41
 
42
  /**
43
+ * Transform field options into the verbose format.
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  *
45
+ * @param array $options Field options.
46
  *
47
  * @return array
48
  */
49
+ public static function transform_options( $options ) {
50
+ $transformed = array();
51
+ $options = (array) $options;
52
+ foreach ( $options as $value => $label ) {
53
  $option = is_array( $label ) ? $label : array(
54
  'label' => (string) $label,
55
  'value' => (string) $value,
56
  );
57
  if ( isset( $option['label'] ) && isset( $option['value'] ) ) {
58
+ $transformed[ $option['value'] ] = (object) $option;
59
  }
60
  }
61
+ return $transformed;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
  /**
72
  * @return string
73
  */
74
  public static function format_single_value( $field, $value, $args, $post_id ) {
75
+ $options = self::transform_options( $field['options'] );
 
 
 
 
 
 
 
 
 
 
 
 
76
  return isset( $options[ $value ] ) ? $options[ $value ]->label : '';
77
  }
78
  }
inc/fields/color.php CHANGED
@@ -33,16 +33,22 @@ class RWMB_Color_Field extends RWMB_Text_Field {
33
  * @return array
34
  */
35
  public static function normalize( $field ) {
36
- $field = wp_parse_args( $field, array(
37
- 'alpha_channel' => false,
38
- 'js_options' => array(),
39
- ) );
 
 
 
40
 
41
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
42
- 'defaultColor' => false,
43
- 'hide' => true,
44
- 'palettes' => true,
45
- ) );
 
 
 
46
 
47
  $field = parent::normalize( $field );
48
 
@@ -59,9 +65,12 @@ class RWMB_Color_Field extends RWMB_Text_Field {
59
  */
60
  public static function get_attributes( $field, $value = null ) {
61
  $attributes = parent::get_attributes( $field, $value );
62
- $attributes = wp_parse_args( $attributes, array(
63
- 'data-options' => wp_json_encode( $field['js_options'] ),
64
- ) );
 
 
 
65
  $attributes['type'] = 'text';
66
 
67
  if ( $field['alpha_channel'] ) {
33
  * @return array
34
  */
35
  public static function normalize( $field ) {
36
+ $field = wp_parse_args(
37
+ $field,
38
+ array(
39
+ 'alpha_channel' => false,
40
+ 'js_options' => array(),
41
+ )
42
+ );
43
 
44
+ $field['js_options'] = wp_parse_args(
45
+ $field['js_options'],
46
+ array(
47
+ 'defaultColor' => false,
48
+ 'hide' => true,
49
+ 'palettes' => true,
50
+ )
51
+ );
52
 
53
  $field = parent::normalize( $field );
54
 
65
  */
66
  public static function get_attributes( $field, $value = null ) {
67
  $attributes = parent::get_attributes( $field, $value );
68
+ $attributes = wp_parse_args(
69
+ $attributes,
70
+ array(
71
+ 'data-options' => wp_json_encode( $field['js_options'] ),
72
+ )
73
+ );
74
  $attributes['type'] = 'text';
75
 
76
  if ( $field['alpha_channel'] ) {
inc/fields/datetime.php CHANGED
@@ -104,16 +104,19 @@ class RWMB_Datetime_Field extends RWMB_Text_Field {
104
  $output = '';
105
 
106
  if ( $field['timestamp'] ) {
107
- $name = $field['field_name'];
108
- $field = wp_parse_args( array(
109
- 'field_name' => $name . '[formatted]',
110
- ), $field );
 
 
 
111
  $output .= sprintf(
112
  '<input type="hidden" name="%s" class="rwmb-datetime-timestamp" value="%s">',
113
  esc_attr( $name . '[timestamp]' ),
114
  isset( $meta['timestamp'] ) ? intval( $meta['timestamp'] ) : ''
115
  );
116
- $meta = isset( $meta['formatted'] ) ? $meta['formatted'] : '';
117
  }
118
 
119
  $output .= parent::html( $meta, $field );
@@ -183,25 +186,34 @@ class RWMB_Datetime_Field extends RWMB_Text_Field {
183
  * @return array
184
  */
185
  public static function normalize( $field ) {
186
- $field = wp_parse_args( $field, array(
187
- 'timestamp' => false,
188
- 'inline' => false,
189
- 'js_options' => array(),
190
- ) );
 
 
 
191
 
192
  // Deprecate 'format', but keep it for backward compatible.
193
  // Use 'js_options' instead.
194
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
195
- 'timeFormat' => 'HH:mm',
196
- 'separator' => ' ',
197
- 'dateFormat' => empty( $field['format'] ) ? 'yy-mm-dd' : $field['format'],
198
- 'showButtonPanel' => true,
199
- ) );
 
 
 
200
 
201
  if ( $field['inline'] ) {
202
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
203
- 'altFieldTimeOnly' => false,
204
- ) );
 
 
 
205
  }
206
 
207
  $field = parent::normalize( $field );
@@ -218,10 +230,13 @@ class RWMB_Datetime_Field extends RWMB_Text_Field {
218
  * @return array
219
  */
220
  public static function get_attributes( $field, $value = null ) {
221
- $attributes = parent::get_attributes( $field, $value );
222
- $attributes = wp_parse_args( $attributes, array(
223
- 'data-options' => wp_json_encode( $field['js_options'] ),
224
- ) );
 
 
 
225
  $attributes['type'] = 'text';
226
 
227
  return $attributes;
@@ -252,7 +267,7 @@ class RWMB_Datetime_Field extends RWMB_Text_Field {
252
  * @return string
253
  */
254
  public static function format_single_value( $field, $value, $args, $post_id ) {
255
- if ( ! isset( $args['format'] ) ) {
256
  return $value;
257
  }
258
  if ( ! $field['timestamp'] ) {
104
  $output = '';
105
 
106
  if ( $field['timestamp'] ) {
107
+ $name = $field['field_name'];
108
+ $field = wp_parse_args(
109
+ array(
110
+ 'field_name' => $name . '[formatted]',
111
+ ),
112
+ $field
113
+ );
114
  $output .= sprintf(
115
  '<input type="hidden" name="%s" class="rwmb-datetime-timestamp" value="%s">',
116
  esc_attr( $name . '[timestamp]' ),
117
  isset( $meta['timestamp'] ) ? intval( $meta['timestamp'] ) : ''
118
  );
119
+ $meta = isset( $meta['formatted'] ) ? $meta['formatted'] : '';
120
  }
121
 
122
  $output .= parent::html( $meta, $field );
186
  * @return array
187
  */
188
  public static function normalize( $field ) {
189
+ $field = wp_parse_args(
190
+ $field,
191
+ array(
192
+ 'timestamp' => false,
193
+ 'inline' => false,
194
+ 'js_options' => array(),
195
+ )
196
+ );
197
 
198
  // Deprecate 'format', but keep it for backward compatible.
199
  // Use 'js_options' instead.
200
+ $field['js_options'] = wp_parse_args(
201
+ $field['js_options'],
202
+ array(
203
+ 'timeFormat' => 'HH:mm',
204
+ 'separator' => ' ',
205
+ 'dateFormat' => empty( $field['format'] ) ? 'yy-mm-dd' : $field['format'],
206
+ 'showButtonPanel' => true,
207
+ )
208
+ );
209
 
210
  if ( $field['inline'] ) {
211
+ $field['js_options'] = wp_parse_args(
212
+ $field['js_options'],
213
+ array(
214
+ 'altFieldTimeOnly' => false,
215
+ )
216
+ );
217
  }
218
 
219
  $field = parent::normalize( $field );
230
  * @return array
231
  */
232
  public static function get_attributes( $field, $value = null ) {
233
+ $attributes = parent::get_attributes( $field, $value );
234
+ $attributes = wp_parse_args(
235
+ $attributes,
236
+ array(
237
+ 'data-options' => wp_json_encode( $field['js_options'] ),
238
+ )
239
+ );
240
  $attributes['type'] = 'text';
241
 
242
  return $attributes;
267
  * @return string
268
  */
269
  public static function format_single_value( $field, $value, $args, $post_id ) {
270
+ if ( empty( $args['format'] ) ) {
271
  return $value;
272
  }
273
  if ( ! $field['timestamp'] ) {
inc/fields/file-input.php CHANGED
@@ -14,11 +14,15 @@ class RWMB_File_Input_Field extends RWMB_Input_Field {
14
  */
15
  public static function admin_enqueue_scripts() {
16
  wp_enqueue_media();
17
- wp_enqueue_style( 'rwmb-file-input', RWMB_CSS_URL . 'file-input.css' );
18
  wp_enqueue_script( 'rwmb-file-input', RWMB_JS_URL . 'file-input.js', array( 'jquery' ), RWMB_VER, true );
19
- self::localize_script('rwmb-file-input', 'rwmbFileInput', array(
20
- 'frameTitle' => esc_html__( 'Select File', 'meta-box' ),
21
- ) );
 
 
 
 
22
  }
23
 
24
  /**
@@ -50,7 +54,7 @@ class RWMB_File_Input_Field extends RWMB_Input_Field {
50
  * @return array
51
  */
52
  public static function get_attributes( $field, $value = null ) {
53
- $attributes = parent::get_attributes( $field, $value );
54
  $attributes['type'] = 'text';
55
 
56
  return $attributes;
14
  */
15
  public static function admin_enqueue_scripts() {
16
  wp_enqueue_media();
17
+ wp_enqueue_style( 'rwmb-file-input', RWMB_CSS_URL . 'file-input.css', array(), RWMB_VER );
18
  wp_enqueue_script( 'rwmb-file-input', RWMB_JS_URL . 'file-input.js', array( 'jquery' ), RWMB_VER, true );
19
+ self::localize_script(
20
+ 'rwmb-file-input',
21
+ 'rwmbFileInput',
22
+ array(
23
+ 'frameTitle' => esc_html__( 'Select File', 'meta-box' ),
24
+ )
25
+ );
26
  }
27
 
28
  /**
54
  * @return array
55
  */
56
  public static function get_attributes( $field, $value = null ) {
57
+ $attributes = parent::get_attributes( $field, $value );
58
  $attributes['type'] = 'text';
59
 
60
  return $attributes;
inc/fields/file-upload.php CHANGED
@@ -27,13 +27,19 @@ class RWMB_File_Upload_Field extends RWMB_Media_Field {
27
  */
28
  public static function normalize( $field ) {
29
  $field = parent::normalize( $field );
30
- $field = wp_parse_args( $field, array(
31
- 'max_file_size' => 0,
32
- ) );
 
 
 
33
 
34
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
35
- 'maxFileSize' => $field['max_file_size'],
36
- ) );
 
 
 
37
 
38
  return $field;
39
  }
27
  */
28
  public static function normalize( $field ) {
29
  $field = parent::normalize( $field );
30
+ $field = wp_parse_args(
31
+ $field,
32
+ array(
33
+ 'max_file_size' => 0,
34
+ )
35
+ );
36
 
37
+ $field['js_options'] = wp_parse_args(
38
+ $field['js_options'],
39
+ array(
40
+ 'maxFileSize' => $field['max_file_size'],
41
+ )
42
+ );
43
 
44
  return $field;
45
  }
inc/fields/file.php CHANGED
@@ -16,12 +16,16 @@ class RWMB_File_Field extends RWMB_Field {
16
  wp_enqueue_style( 'rwmb-file', RWMB_CSS_URL . 'file.css', array(), RWMB_VER );
17
  wp_enqueue_script( 'rwmb-file', RWMB_JS_URL . 'file.js', array( 'jquery-ui-sortable' ), RWMB_VER, true );
18
 
19
- self::localize_script( 'rwmb-file', 'rwmbFile', array(
20
- // Translators: %d is the number of files in singular form.
21
- 'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'meta-box' ),
22
- // Translators: %d is the number of files in plural form.
23
- 'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'meta-box' ),
24
- ) );
 
 
 
 
25
  }
26
 
27
  /**
@@ -137,12 +141,18 @@ class RWMB_File_Field extends RWMB_Field {
137
  </div>
138
  <input type="hidden" name="%s[%s]" value="%s">
139
  </li>',
140
- wp_get_attachment_url( $file ), $icon,
141
- wp_get_attachment_url( $file ), get_the_title( $file ),
 
 
142
  basename( $path ),
143
- get_edit_post_link( $file ), $i18n_edit,
144
- $file, $i18n_delete,
145
- $attributes['name'], $index, $file
 
 
 
 
146
  );
147
  }
148
 
@@ -256,12 +266,15 @@ class RWMB_File_Field extends RWMB_Field {
256
  */
257
  public static function normalize( $field ) {
258
  $field = parent::normalize( $field );
259
- $field = wp_parse_args( $field, array(
260
- 'std' => array(),
261
- 'force_delete' => false,
262
- 'max_file_uploads' => 0,
263
- 'mime_type' => '',
264
- ) );
 
 
 
265
  $field['multiple'] = true;
266
 
267
  $field['file_input_name'] = '_file_' . $field['id'];
@@ -328,13 +341,16 @@ class RWMB_File_Field extends RWMB_Field {
328
  return false;
329
  }
330
 
331
- return wp_parse_args( array(
332
- 'ID' => $file,
333
- 'name' => basename( $path ),
334
- 'path' => $path,
335
- 'url' => wp_get_attachment_url( $file ),
336
- 'title' => get_the_title( $file ),
337
- ), wp_get_attachment_metadata( $file ) );
 
 
 
338
  }
339
 
340
  /**
16
  wp_enqueue_style( 'rwmb-file', RWMB_CSS_URL . 'file.css', array(), RWMB_VER );
17
  wp_enqueue_script( 'rwmb-file', RWMB_JS_URL . 'file.js', array( 'jquery-ui-sortable' ), RWMB_VER, true );
18
 
19
+ self::localize_script(
20
+ 'rwmb-file',
21
+ 'rwmbFile',
22
+ array(
23
+ // Translators: %d is the number of files in singular form.
24
+ 'maxFileUploadsSingle' => __( 'You may only upload maximum %d file', 'meta-box' ),
25
+ // Translators: %d is the number of files in plural form.
26
+ 'maxFileUploadsPlural' => __( 'You may only upload maximum %d files', 'meta-box' ),
27
+ )
28
+ );
29
  }
30
 
31
  /**
141
  </div>
142
  <input type="hidden" name="%s[%s]" value="%s">
143
  </li>',
144
+ wp_get_attachment_url( $file ),
145
+ $icon,
146
+ wp_get_attachment_url( $file ),
147
+ get_the_title( $file ),
148
  basename( $path ),
149
+ get_edit_post_link( $file ),
150
+ $i18n_edit,
151
+ $file,
152
+ $i18n_delete,
153
+ $attributes['name'],
154
+ $index,
155
+ $file
156
  );
157
  }
158
 
266
  */
267
  public static function normalize( $field ) {
268
  $field = parent::normalize( $field );
269
+ $field = wp_parse_args(
270
+ $field,
271
+ array(
272
+ 'std' => array(),
273
+ 'force_delete' => false,
274
+ 'max_file_uploads' => 0,
275
+ 'mime_type' => '',
276
+ )
277
+ );
278
  $field['multiple'] = true;
279
 
280
  $field['file_input_name'] = '_file_' . $field['id'];
341
  return false;
342
  }
343
 
344
+ return wp_parse_args(
345
+ array(
346
+ 'ID' => $file,
347
+ 'name' => basename( $path ),
348
+ 'path' => $path,
349
+ 'url' => wp_get_attachment_url( $file ),
350
+ 'title' => get_the_title( $file ),
351
+ ),
352
+ wp_get_attachment_metadata( $file )
353
+ );
354
  }
355
 
356
  /**
inc/fields/image-advanced.php CHANGED
@@ -27,15 +27,21 @@ class RWMB_Image_Advanced_Field extends RWMB_Media_Field {
27
  */
28
  public static function normalize( $field ) {
29
  $field['mime_type'] = 'image';
30
- $field = wp_parse_args( $field, array(
31
- 'image_size' => 'thumbnail',
32
- ) );
 
 
 
33
 
34
  $field = parent::normalize( $field );
35
 
36
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
37
- 'imageSize' => $field['image_size'],
38
- ) );
 
 
 
39
 
40
  return $field;
41
  }
27
  */
28
  public static function normalize( $field ) {
29
  $field['mime_type'] = 'image';
30
+ $field = wp_parse_args(
31
+ $field,
32
+ array(
33
+ 'image_size' => 'thumbnail',
34
+ )
35
+ );
36
 
37
  $field = parent::normalize( $field );
38
 
39
+ $field['js_options'] = wp_parse_args(
40
+ $field['js_options'],
41
+ array(
42
+ 'imageSize' => $field['image_size'],
43
+ )
44
+ );
45
 
46
  return $field;
47
  }
inc/fields/image-select.php CHANGED
@@ -50,7 +50,7 @@ class RWMB_Image_Select_Field extends RWMB_Field {
50
  * @return array
51
  */
52
  public static function normalize( $field ) {
53
- $field = parent::normalize( $field );
54
  $field['field_name'] .= $field['multiple'] ? '[]' : '';
55
 
56
  return $field;
50
  * @return array
51
  */
52
  public static function normalize( $field ) {
53
+ $field = parent::normalize( $field );
54
  $field['field_name'] .= $field['multiple'] ? '[]' : '';
55
 
56
  return $field;
inc/fields/image.php CHANGED
@@ -47,7 +47,9 @@ class RWMB_Image_Field extends RWMB_File_Field {
47
  </div>
48
  </li>',
49
  esc_attr( $field['image_size'] ),
50
- $attributes['name'], $index, $file,
 
 
51
  wp_get_attachment_image( $file, $field['image_size'] ),
52
  get_edit_post_link( $file ),
53
  $file
@@ -64,9 +66,12 @@ class RWMB_Image_Field extends RWMB_File_Field {
64
  */
65
  public static function normalize( $field ) {
66
  $field = parent::normalize( $field );
67
- $field = wp_parse_args( $field, array(
68
- 'image_size' => 'thumbnail',
69
- ) );
 
 
 
70
 
71
  return $field;
72
  }
@@ -105,9 +110,12 @@ class RWMB_Image_Field extends RWMB_File_Field {
105
  return false;
106
  }
107
 
108
- $args = wp_parse_args( $args, array(
109
- 'size' => 'thumbnail',
110
- ) );
 
 
 
111
  $image = wp_get_attachment_image_src( $file, $args['size'] );
112
  $attachment = get_post( $file );
113
  $info = array(
47
  </div>
48
  </li>',
49
  esc_attr( $field['image_size'] ),
50
+ $attributes['name'],
51
+ $index,
52
+ $file,
53
  wp_get_attachment_image( $file, $field['image_size'] ),
54
  get_edit_post_link( $file ),
55
  $file
66
  */
67
  public static function normalize( $field ) {
68
  $field = parent::normalize( $field );
69
+ $field = wp_parse_args(
70
+ $field,
71
+ array(
72
+ 'image_size' => 'thumbnail',
73
+ )
74
+ );
75
 
76
  return $field;
77
  }
110
  return false;
111
  }
112
 
113
+ $args = wp_parse_args(
114
+ $args,
115
+ array(
116
+ 'size' => 'thumbnail',
117
+ )
118
+ );
119
  $image = wp_get_attachment_image_src( $file, $args['size'] );
120
  $attachment = get_post( $file );
121
  $info = array(
inc/fields/input-list.php CHANGED
@@ -18,23 +18,22 @@ class RWMB_Input_List_Field extends RWMB_Choice_Field {
18
  }
19
 
20
  /**
21
- * Walk options.
22
- *
23
- * @param array $field Field parameters.
24
- * @param mixed $options Select options.
25
- * @param mixed $db_fields Database fields to use in the output.
26
- * @param mixed $meta Meta value.
27
  *
 
 
28
  * @return string
29
  */
30
- public static function walk( $field, $options, $db_fields, $meta ) {
31
- $walker = new RWMB_Walker_Input_List( $db_fields, $field, $meta );
32
- $output = self::get_select_all_html( $field );
33
- $output .= sprintf( '<ul class="rwmb-input-list %s %s">',
34
- $field['collapse'] ? 'collapse' : '',
35
- $field['inline'] ? 'inline' : ''
 
 
36
  );
37
- $output .= $walker->walk( $options, $field['flatten'] ? - 1 : 0 );
38
  $output .= '</ul>';
39
 
40
  return $output;
@@ -50,14 +49,17 @@ class RWMB_Input_List_Field extends RWMB_Choice_Field {
50
  $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
51
  $field = RWMB_Input_Field::normalize( $field );
52
  $field = parent::normalize( $field );
53
- $field = wp_parse_args( $field, array(
54
- 'collapse' => true,
55
- 'inline' => null,
56
- 'select_all_none' => false,
57
- ) );
 
 
 
58
 
59
  $field['flatten'] = $field['multiple'] ? $field['flatten'] : true;
60
- $field['inline'] = ! $field['multiple'] && ! isset( $field['inline'] ) ? true : $field['inline'];
61
 
62
  return $field;
63
  }
@@ -71,10 +73,10 @@ class RWMB_Input_List_Field extends RWMB_Choice_Field {
71
  * @return array
72
  */
73
  public static function get_attributes( $field, $value = null ) {
74
- $attributes = RWMB_Input_Field::get_attributes( $field, $value );
75
- $attributes['id'] = false;
76
- $attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio';
77
- $attributes['value'] = $value;
78
 
79
  return $attributes;
80
  }
18
  }
19
 
20
  /**
21
+ * Get field HTML.
 
 
 
 
 
22
  *
23
+ * @param mixed $meta Meta value.
24
+ * @param array $field Field parameters.
25
  * @return string
26
  */
27
+ public static function html( $meta, $field ) {
28
+ $options = self::transform_options( $field['options'] );
29
+ $walker = new RWMB_Walker_Input_List( $field, $meta );
30
+ $output = self::get_select_all_html( $field );
31
+ $output .= sprintf(
32
+ '<ul class="rwmb-input-list%s%s">',
33
+ $field['collapse'] ? ' rwmb-collapse' : '',
34
+ $field['inline'] ? ' rwmb-inline' : ''
35
  );
36
+ $output .= $walker->walk( $options, $field['flatten'] ? -1 : 0 );
37
  $output .= '</ul>';
38
 
39
  return $output;
49
  $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
50
  $field = RWMB_Input_Field::normalize( $field );
51
  $field = parent::normalize( $field );
52
+ $field = wp_parse_args(
53
+ $field,
54
+ array(
55
+ 'collapse' => true,
56
+ 'inline' => null,
57
+ 'select_all_none' => false,
58
+ )
59
+ );
60
 
61
  $field['flatten'] = $field['multiple'] ? $field['flatten'] : true;
62
+ $field['inline'] = ! $field['multiple'] && ! isset( $field['inline'] ) ? true : $field['inline'];
63
 
64
  return $field;
65
  }
73
  * @return array
74
  */
75
  public static function get_attributes( $field, $value = null ) {
76
+ $attributes = RWMB_Input_Field::get_attributes( $field, $value );
77
+ $attributes['id'] = false;
78
+ $attributes['type'] = $field['multiple'] ? 'checkbox' : 'radio';
79
+ $attributes['value'] = $value;
80
 
81
  return $attributes;
82
  }
inc/fields/input.php CHANGED
@@ -29,17 +29,23 @@ abstract class RWMB_Input_Field extends RWMB_Field {
29
  */
30
  public static function normalize( $field ) {
31
  $field = parent::normalize( $field );
32
- $field = wp_parse_args( $field, array(
33
- 'autocomplete' => false,
34
- 'size' => 30,
35
- 'datalist' => false,
36
- 'readonly' => false,
37
- ) );
 
 
 
38
  if ( $field['datalist'] ) {
39
- $field['datalist'] = wp_parse_args( $field['datalist'], array(
40
- 'id' => $field['id'] . '_list',
41
- 'options' => array(),
42
- ) );
 
 
 
43
  }
44
  return $field;
45
  }
@@ -53,15 +59,18 @@ abstract class RWMB_Input_Field extends RWMB_Field {
53
  */
54
  public static function get_attributes( $field, $value = null ) {
55
  $attributes = parent::get_attributes( $field, $value );
56
- $attributes = wp_parse_args( $attributes, array(
57
- 'autocomplete' => $field['autocomplete'],
58
- 'list' => $field['datalist'] ? $field['datalist']['id'] : false,
59
- 'readonly' => $field['readonly'],
60
- 'value' => $value,
61
- 'placeholder' => $field['placeholder'],
62
- 'type' => $field['type'],
63
- 'size' => $field['size'],
64
- ) );
 
 
 
65
 
66
  return $attributes;
67
  }
29
  */
30
  public static function normalize( $field ) {
31
  $field = parent::normalize( $field );
32
+ $field = wp_parse_args(
33
+ $field,
34
+ array(
35
+ 'autocomplete' => false,
36
+ 'size' => 30,
37
+ 'datalist' => false,
38
+ 'readonly' => false,
39
+ )
40
+ );
41
  if ( $field['datalist'] ) {
42
+ $field['datalist'] = wp_parse_args(
43
+ $field['datalist'],
44
+ array(
45
+ 'id' => $field['id'] . '_list',
46
+ 'options' => array(),
47
+ )
48
+ );
49
  }
50
  return $field;
51
  }
59
  */
60
  public static function get_attributes( $field, $value = null ) {
61
  $attributes = parent::get_attributes( $field, $value );
62
+ $attributes = wp_parse_args(
63
+ $attributes,
64
+ array(
65
+ 'autocomplete' => $field['autocomplete'],
66
+ 'list' => $field['datalist'] ? $field['datalist']['id'] : false,
67
+ 'readonly' => $field['readonly'],
68
+ 'value' => $value,
69
+ 'placeholder' => $field['placeholder'],
70
+ 'type' => $field['type'],
71
+ 'size' => $field['size'],
72
+ )
73
+ );
74
 
75
  return $attributes;
76
  }
inc/fields/key-value.php CHANGED
@@ -28,7 +28,7 @@ class RWMB_Key_Value_Field extends RWMB_Text_Field {
28
  $val = isset( $meta[1] ) ? $meta[1] : '';
29
  $attributes = self::get_attributes( $field, $val );
30
  $attributes['placeholder'] = $field['placeholder']['value'];
31
- $html .= sprintf( '<input %s>', self::render_attributes( $attributes ) );
32
 
33
  return $html;
34
  }
@@ -128,10 +128,13 @@ class RWMB_Key_Value_Field extends RWMB_Text_Field {
128
  $field['clone'] = true;
129
  $field['multiple'] = true;
130
  $field['attributes']['type'] = 'text';
131
- $field['placeholder'] = wp_parse_args( (array) $field['placeholder'], array(
132
- 'key' => __( 'Key', 'meta-box' ),
133
- 'value' => __( 'Value', 'meta-box' ),
134
- ) );
 
 
 
135
  return $field;
136
  }
137
 
28
  $val = isset( $meta[1] ) ? $meta[1] : '';
29
  $attributes = self::get_attributes( $field, $val );
30
  $attributes['placeholder'] = $field['placeholder']['value'];
31
+ $html .= sprintf( '<input %s>', self::render_attributes( $attributes ) );
32
 
33
  return $html;
34
  }
128
  $field['clone'] = true;
129
  $field['multiple'] = true;
130
  $field['attributes']['type'] = 'text';
131
+ $field['placeholder'] = wp_parse_args(
132
+ (array) $field['placeholder'],
133
+ array(
134
+ 'key' => __( 'Key', 'meta-box' ),
135
+ 'value' => __( 'Value', 'meta-box' ),
136
+ )
137
+ );
138
  return $field;
139
  }
140
 
inc/fields/map.php CHANGED
@@ -13,7 +13,7 @@ class RWMB_Map_Field extends RWMB_Field {
13
  * Enqueue scripts and styles.
14
  */
15
  public static function admin_enqueue_scripts() {
16
- wp_enqueue_style( 'rwmb-map', RWMB_CSS_URL . 'map.css', array( 'common', 'forms' ), RWMB_VER );
17
 
18
  /**
19
  * Since June 2016, Google Maps requires a valid API key.
@@ -37,11 +37,24 @@ class RWMB_Map_Field extends RWMB_Field {
37
  * @link https://developers.google.com/maps/documentation/javascript/libraries
38
  */
39
  $google_maps_url = apply_filters( 'rwmb_google_maps_url', $google_maps_url );
40
- wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), '', true );
41
- wp_enqueue_script( 'rwmb-map', RWMB_JS_URL . 'map.js', array(
42
- 'jquery-ui-autocomplete',
43
- 'google-maps',
44
- ), RWMB_VER, true );
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  }
46
 
47
  /**
@@ -89,16 +102,19 @@ class RWMB_Map_Field extends RWMB_Field {
89
  */
90
  public static function normalize( $field ) {
91
  $field = parent::normalize( $field );
92
- $field = wp_parse_args( $field, array(
93
- 'std' => '',
94
- 'address_field' => '',
95
- 'language' => '',
96
- 'region' => '',
97
-
98
- // Default API key, required by Google Maps since June 2016.
99
- // Users should overwrite this key with their own key.
100
- 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ',
101
- ) );
 
 
 
102
 
103
  return $field;
104
  }
@@ -115,7 +131,7 @@ class RWMB_Map_Field extends RWMB_Field {
115
  * @return mixed Array(latitude, longitude, zoom)
116
  */
117
  public static function get_value( $field, $args = array(), $post_id = null ) {
118
- $value = parent::get_value( $field, $args, $post_id );
119
  list( $latitude, $longitude, $zoom ) = explode( ',', $value . ',,' );
120
  return compact( 'latitude', 'longitude', 'zoom' );
121
  }
@@ -132,9 +148,12 @@ class RWMB_Map_Field extends RWMB_Field {
132
  */
133
  public static function the_value( $field, $args = array(), $post_id = null ) {
134
  $value = parent::get_value( $field, $args, $post_id );
135
- $args = wp_parse_args( $args, array(
136
- 'api_key' => isset( $field['api_key'] ) ? $field['api_key'] : '',
137
- ) );
 
 
 
138
  return self::render_map( $value, $args );
139
  }
140
 
@@ -152,20 +171,24 @@ class RWMB_Map_Field extends RWMB_Field {
152
  return '';
153
  }
154
 
155
- $args = wp_parse_args( $args, array(
156
- 'latitude' => $latitude,
157
- 'longitude' => $longitude,
158
- 'width' => '100%',
159
- 'height' => '480px',
160
- 'marker' => true, // Display marker?
161
- 'marker_title' => '', // Marker title, when hover.
162
- 'info_window' => '', // Content of info window (when click on marker). HTML allowed.
163
- 'js_options' => array(),
164
-
165
- // Default API key, required by Google Maps since June 2016.
166
- // Users should overwrite this key with their own key.
167
- 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ',
168
- ) );
 
 
 
 
169
 
170
  $google_maps_url = add_query_arg( 'key', $args['api_key'], 'https://maps.google.com/maps/api/js' );
171
 
@@ -183,13 +206,16 @@ class RWMB_Map_Field extends RWMB_Field {
183
  * This array will be convert to Javascript Object and pass as map options.
184
  * @link https://developers.google.com/maps/documentation/javascript/reference
185
  */
186
- $args['js_options'] = wp_parse_args( $args['js_options'], array(
187
- // Default to 'zoom' level set in admin, but can be overwritten.
188
- 'zoom' => $zoom,
 
 
189
 
190
- // Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId.
191
- 'mapTypeId' => 'ROADMAP',
192
- ) );
 
193
 
194
  $output = sprintf(
195
  '<div class="rwmb-map-canvas" data-map_options="%s" style="width:%s;height:%s"></div>',
13
  * Enqueue scripts and styles.
14
  */
15
  public static function admin_enqueue_scripts() {
16
+ wp_enqueue_style( 'rwmb-map', RWMB_CSS_URL . 'map.css', array(), RWMB_VER );
17
 
18
  /**
19
  * Since June 2016, Google Maps requires a valid API key.
37
  * @link https://developers.google.com/maps/documentation/javascript/libraries
38
  */
39
  $google_maps_url = apply_filters( 'rwmb_google_maps_url', $google_maps_url );
40
+ wp_register_script( 'google-maps', esc_url_raw( $google_maps_url ), array(), RWMB_VER, true );
41
+ wp_enqueue_script(
42
+ 'rwmb-map',
43
+ RWMB_JS_URL . 'map.js',
44
+ array(
45
+ 'jquery-ui-autocomplete',
46
+ 'google-maps',
47
+ ),
48
+ RWMB_VER,
49
+ true
50
+ );
51
+ self::localize_script(
52
+ 'rwmb-map',
53
+ 'RWMB_Map',
54
+ array(
55
+ 'no_results_string' => __( 'No results found', 'meta-box' ),
56
+ )
57
+ );
58
  }
59
 
60
  /**
102
  */
103
  public static function normalize( $field ) {
104
  $field = parent::normalize( $field );
105
+ $field = wp_parse_args(
106
+ $field,
107
+ array(
108
+ 'std' => '',
109
+ 'address_field' => '',
110
+ 'language' => '',
111
+ 'region' => '',
112
+
113
+ // Default API key, required by Google Maps since June 2016.
114
+ // Users should overwrite this key with their own key.
115
+ 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ',
116
+ )
117
+ );
118
 
119
  return $field;
120
  }
131
  * @return mixed Array(latitude, longitude, zoom)
132
  */
133
  public static function get_value( $field, $args = array(), $post_id = null ) {
134
+ $value = parent::get_value( $field, $args, $post_id );
135
  list( $latitude, $longitude, $zoom ) = explode( ',', $value . ',,' );
136
  return compact( 'latitude', 'longitude', 'zoom' );
137
  }
148
  */
149
  public static function the_value( $field, $args = array(), $post_id = null ) {
150
  $value = parent::get_value( $field, $args, $post_id );
151
+ $args = wp_parse_args(
152
+ $args,
153
+ array(
154
+ 'api_key' => isset( $field['api_key'] ) ? $field['api_key'] : '',
155
+ )
156
+ );
157
  return self::render_map( $value, $args );
158
  }
159
 
171
  return '';
172
  }
173
 
174
+ $args = wp_parse_args(
175
+ $args,
176
+ array(
177
+ 'latitude' => $latitude,
178
+ 'longitude' => $longitude,
179
+ 'width' => '100%',
180
+ 'height' => '480px',
181
+ 'marker' => true, // Display marker?
182
+ 'marker_title' => '', // Marker title, when hover.
183
+ 'info_window' => '', // Content of info window (when click on marker). HTML allowed.
184
+ 'js_options' => array(),
185
+ 'zoom' => $zoom,
186
+
187
+ // Default API key, required by Google Maps since June 2016.
188
+ // Users should overwrite this key with their own key.
189
+ 'api_key' => 'AIzaSyC1mUh87SGFyf133tpZQJa-s96p0tgnraQ',
190
+ )
191
+ );
192
 
193
  $google_maps_url = add_query_arg( 'key', $args['api_key'], 'https://maps.google.com/maps/api/js' );
194
 
206
  * This array will be convert to Javascript Object and pass as map options.
207
  * @link https://developers.google.com/maps/documentation/javascript/reference
208
  */
209
+ $args['js_options'] = wp_parse_args(
210
+ $args['js_options'],
211
+ array(
212
+ // Default to 'zoom' level set in admin, but can be overwritten.
213
+ 'zoom' => $args['zoom'],
214
 
215
+ // Map type, see https://developers.google.com/maps/documentation/javascript/reference#MapTypeId.
216
+ 'mapTypeId' => 'ROADMAP',
217
+ )
218
+ );
219
 
220
  $output = sprintf(
221
  '<div class="rwmb-map-canvas" data-map_options="%s" style="width:%s;height:%s"></div>',
inc/fields/media.php CHANGED
@@ -15,25 +15,29 @@ class RWMB_Media_Field extends RWMB_File_Field {
15
  public static function admin_enqueue_scripts() {
16
  wp_enqueue_media();
17
  if ( ! is_admin() ) {
18
- wp_register_script( 'media-grid', includes_url( 'js/media-grid.min.js' ), array( 'media-editor' ), '', true );
19
  }
20
  wp_enqueue_style( 'rwmb-media', RWMB_CSS_URL . 'media.css', array(), RWMB_VER );
21
  wp_enqueue_script( 'rwmb-media', RWMB_JS_URL . 'media.js', array( 'jquery-ui-sortable', 'underscore', 'backbone', 'media-grid' ), RWMB_VER, true );
22
 
23
- self::localize_script( 'rwmb-media', 'i18nRwmbMedia', array(
24
- 'add' => apply_filters( 'rwmb_media_add_string', _x( '+ Add Media', 'media', 'meta-box' ) ),
25
- 'single' => apply_filters( 'rwmb_media_single_files_string', _x( ' file', 'media', 'meta-box' ) ),
26
- 'multiple' => apply_filters( 'rwmb_media_multiple_files_string', _x( ' files', 'media', 'meta-box' ) ),
27
- 'remove' => apply_filters( 'rwmb_media_remove_string', _x( 'Remove', 'media', 'meta-box' ) ),
28
- 'edit' => apply_filters( 'rwmb_media_edit_string', _x( 'Edit', 'media', 'meta-box' ) ),
29
- 'view' => apply_filters( 'rwmb_media_view_string', _x( 'View', 'media', 'meta-box' ) ),
30
- 'noTitle' => _x( 'No Title', 'media', 'meta-box' ),
31
- 'loadingUrl' => admin_url( 'images/spinner.gif' ),
32
- 'extensions' => self::get_mime_extensions(),
33
- 'select' => apply_filters( 'rwmb_media_select_string', _x( 'Select Files', 'media', 'meta-box' ) ),
34
- 'or' => apply_filters( 'rwmb_media_or_string', _x( 'or', 'media', 'meta-box' ) ),
35
- 'uploadInstructions' => apply_filters( 'rwmb_media_upload_instructions_string', _x( 'Drop files here to upload', 'media', 'meta-box' ) ),
36
- ) );
 
 
 
 
37
  }
38
 
39
  /**
@@ -76,21 +80,27 @@ class RWMB_Media_Field extends RWMB_File_Field {
76
  */
77
  public static function normalize( $field ) {
78
  $field = parent::normalize( $field );
79
- $field = wp_parse_args( $field, array(
80
- 'std' => array(),
81
- 'mime_type' => '',
82
- 'max_file_uploads' => 0,
83
- 'force_delete' => false,
84
- 'max_status' => true,
85
- 'js_options' => array(),
86
- ) );
87
-
88
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
89
- 'mimeType' => $field['mime_type'],
90
- 'maxFiles' => $field['max_file_uploads'],
91
- 'forceDelete' => $field['force_delete'] ? true : false,
92
- 'maxStatus' => $field['max_status'],
93
- ) );
 
 
 
 
 
 
94
 
95
  $field['multiple'] = true;
96
 
@@ -149,7 +159,7 @@ class RWMB_Media_Field extends RWMB_File_Field {
149
  * @return array|mixed
150
  */
151
  public static function value( $new, $old, $post_id, $field ) {
152
- $new = ! is_array( $new ) && is_string( $new ) ? explode( ',', $new ) : $new;
153
  array_walk( $new, 'absint' );
154
  return array_filter( array_unique( $new ) );
155
  }
@@ -163,6 +173,9 @@ class RWMB_Media_Field extends RWMB_File_Field {
163
  * @param array $field The field parameters.
164
  */
165
  public static function save( $new, $old, $post_id, $field ) {
 
 
 
166
  $storage = $field['storage'];
167
  $storage->delete( $post_id, $field['id'] );
168
  parent::save( $new, array(), $post_id, $field );
15
  public static function admin_enqueue_scripts() {
16
  wp_enqueue_media();
17
  if ( ! is_admin() ) {
18
+ wp_register_script( 'media-grid', includes_url( 'js/media-grid.min.js' ), array( 'media-editor' ), '4.9.7', true );
19
  }
20
  wp_enqueue_style( 'rwmb-media', RWMB_CSS_URL . 'media.css', array(), RWMB_VER );
21
  wp_enqueue_script( 'rwmb-media', RWMB_JS_URL . 'media.js', array( 'jquery-ui-sortable', 'underscore', 'backbone', 'media-grid' ), RWMB_VER, true );
22
 
23
+ self::localize_script(
24
+ 'rwmb-media',
25
+ 'i18nRwmbMedia',
26
+ array(
27
+ 'add' => apply_filters( 'rwmb_media_add_string', _x( '+ Add Media', 'media', 'meta-box' ) ),
28
+ 'single' => apply_filters( 'rwmb_media_single_files_string', _x( ' file', 'media', 'meta-box' ) ),
29
+ 'multiple' => apply_filters( 'rwmb_media_multiple_files_string', _x( ' files', 'media', 'meta-box' ) ),
30
+ 'remove' => apply_filters( 'rwmb_media_remove_string', _x( 'Remove', 'media', 'meta-box' ) ),
31
+ 'edit' => apply_filters( 'rwmb_media_edit_string', _x( 'Edit', 'media', 'meta-box' ) ),
32
+ 'view' => apply_filters( 'rwmb_media_view_string', _x( 'View', 'media', 'meta-box' ) ),
33
+ 'noTitle' => _x( 'No Title', 'media', 'meta-box' ),
34
+ 'loadingUrl' => admin_url( 'images/spinner.gif' ),
35
+ 'extensions' => self::get_mime_extensions(),
36
+ 'select' => apply_filters( 'rwmb_media_select_string', _x( 'Select Files', 'media', 'meta-box' ) ),
37
+ 'or' => apply_filters( 'rwmb_media_or_string', _x( 'or', 'media', 'meta-box' ) ),
38
+ 'uploadInstructions' => apply_filters( 'rwmb_media_upload_instructions_string', _x( 'Drop files here to upload', 'media', 'meta-box' ) ),
39
+ )
40
+ );
41
  }
42
 
43
  /**
80
  */
81
  public static function normalize( $field ) {
82
  $field = parent::normalize( $field );
83
+ $field = wp_parse_args(
84
+ $field,
85
+ array(
86
+ 'std' => array(),
87
+ 'mime_type' => '',
88
+ 'max_file_uploads' => 0,
89
+ 'force_delete' => false,
90
+ 'max_status' => true,
91
+ 'js_options' => array(),
92
+ )
93
+ );
94
+
95
+ $field['js_options'] = wp_parse_args(
96
+ $field['js_options'],
97
+ array(
98
+ 'mimeType' => $field['mime_type'],
99
+ 'maxFiles' => $field['max_file_uploads'],
100
+ 'forceDelete' => $field['force_delete'] ? true : false,
101
+ 'maxStatus' => $field['max_status'],
102
+ )
103
+ );
104
 
105
  $field['multiple'] = true;
106
 
159
  * @return array|mixed
160
  */
161
  public static function value( $new, $old, $post_id, $field ) {
162
+ $new = rwmb_csv_to_array( $new );
163
  array_walk( $new, 'absint' );
164
  return array_filter( array_unique( $new ) );
165
  }
173
  * @param array $field The field parameters.
174
  */
175
  public static function save( $new, $old, $post_id, $field ) {
176
+ if ( empty( $field['id'] ) || ! $field['save_field'] ) {
177
+ return;
178
+ }
179
  $storage = $field['storage'];
180
  $storage->delete( $post_id, $field['id'] );
181
  parent::save( $new, array(), $post_id, $field );
inc/fields/number.php CHANGED
@@ -19,11 +19,14 @@ class RWMB_Number_Field extends RWMB_Input_Field {
19
  public static function normalize( $field ) {
20
  $field = parent::normalize( $field );
21
 
22
- $field = wp_parse_args( $field, array(
23
- 'step' => 1,
24
- 'min' => 0,
25
- 'max' => false,
26
- ) );
 
 
 
27
 
28
  return $field;
29
  }
@@ -38,11 +41,14 @@ class RWMB_Number_Field extends RWMB_Input_Field {
38
  */
39
  public static function get_attributes( $field, $value = null ) {
40
  $attributes = parent::get_attributes( $field, $value );
41
- $attributes = wp_parse_args( $attributes, array(
42
- 'step' => $field['step'],
43
- 'max' => $field['max'],
44
- 'min' => $field['min'],
45
- ) );
 
 
 
46
  return $attributes;
47
  }
48
  }
19
  public static function normalize( $field ) {
20
  $field = parent::normalize( $field );
21
 
22
+ $field = wp_parse_args(
23
+ $field,
24
+ array(
25
+ 'step' => 1,
26
+ 'min' => 0,
27
+ 'max' => false,
28
+ )
29
+ );
30
 
31
  return $field;
32
  }
41
  */
42
  public static function get_attributes( $field, $value = null ) {
43
  $attributes = parent::get_attributes( $field, $value );
44
+ $attributes = wp_parse_args(
45
+ $attributes,
46
+ array(
47
+ 'step' => $field['step'],
48
+ 'max' => $field['max'],
49
+ 'min' => $field['min'],
50
+ )
51
+ );
52
  return $attributes;
53
  }
54
  }
inc/fields/object-choice.php CHANGED
@@ -10,16 +10,40 @@
10
  */
11
  abstract class RWMB_Object_Choice_Field extends RWMB_Choice_Field {
12
  /**
13
- * Get field HTML
 
14
  *
15
- * @param array $field Field parameters.
16
- * @param mixed $options Select options.
17
- * @param mixed $db_fields Database fields to use in the output.
18
- * @param mixed $meta Meta value.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  * @return string
20
  */
21
- public static function walk( $field, $options, $db_fields, $meta ) {
22
- return call_user_func( array( self::get_type_class( $field ), 'walk' ), $field, $options, $db_fields, $meta );
23
  }
24
 
25
  /**
@@ -31,11 +55,14 @@ abstract class RWMB_Object_Choice_Field extends RWMB_Choice_Field {
31
  */
32
  public static function normalize( $field ) {
33
  $field = parent::normalize( $field );
34
- $field = wp_parse_args( $field, array(
35
- 'flatten' => true,
36
- 'query_args' => array(),
37
- 'field_type' => 'select_advanced',
38
- ) );
 
 
 
39
 
40
  if ( 'checkbox_tree' === $field['field_type'] ) {
41
  $field['field_type'] = 'checkbox_list';
@@ -68,19 +95,6 @@ abstract class RWMB_Object_Choice_Field extends RWMB_Choice_Field {
68
  return $attributes;
69
  }
70
 
71
- /**
72
- * Get field names of object to be used by walker.
73
- *
74
- * @return array
75
- */
76
- public static function get_db_fields() {
77
- return array(
78
- 'parent' => '',
79
- 'id' => '',
80
- 'label' => '',
81
- );
82
- }
83
-
84
  /**
85
  * Enqueue scripts and styles.
86
  */
@@ -101,8 +115,10 @@ abstract class RWMB_Object_Choice_Field extends RWMB_Choice_Field {
101
  if ( in_array( $field['field_type'], array( 'checkbox_list', 'radio_list' ), true ) ) {
102
  return 'RWMB_Input_List_Field';
103
  }
104
- return self::get_class_name( array(
105
- 'type' => $field['field_type'],
106
- ) );
 
 
107
  }
108
  }
10
  */
11
  abstract class RWMB_Object_Choice_Field extends RWMB_Choice_Field {
12
  /**
13
+ * Show field HTML.
14
+ * Populate field options before showing to make sure query is made only once.
15
  *
16
+ * @param array $field Field parameters.
17
+ * @param bool $saved Whether the meta box is saved at least once.
18
+ * @param int $post_id Post ID.
19
+ */
20
+ public static function show( $field, $saved, $post_id = 0 ) {
21
+ $field['options'] = self::call( $field, 'query' );
22
+
23
+ parent::show( $field, $saved, $post_id );
24
+ }
25
+
26
+ /**
27
+ * Get field HTML.
28
+ *
29
+ * @param mixed $meta Meta value.
30
+ * @param array $field Field parameters.
31
+ * @return string
32
+ */
33
+ public static function html( $meta, $field ) {
34
+ $html = call_user_func( array( self::get_type_class( $field ), 'html' ), $meta, $field );
35
+ $html .= self::call( 'add_new_form', $field );
36
+ return $html;
37
+ }
38
+
39
+ /**
40
+ * Render "Add New" form
41
+ *
42
+ * @param array $field Field settings.
43
  * @return string
44
  */
45
+ public static function add_new_form( $field ) {
46
+ return '';
47
  }
48
 
49
  /**
55
  */
56
  public static function normalize( $field ) {
57
  $field = parent::normalize( $field );
58
+ $field = wp_parse_args(
59
+ $field,
60
+ array(
61
+ 'flatten' => true,
62
+ 'query_args' => array(),
63
+ 'field_type' => 'select_advanced',
64
+ )
65
+ );
66
 
67
  if ( 'checkbox_tree' === $field['field_type'] ) {
68
  $field['field_type'] = 'checkbox_list';
95
  return $attributes;
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Enqueue scripts and styles.
100
  */
115
  if ( in_array( $field['field_type'], array( 'checkbox_list', 'radio_list' ), true ) ) {
116
  return 'RWMB_Input_List_Field';
117
  }
118
+ return self::get_class_name(
119
+ array(
120
+ 'type' => $field['field_type'],
121
+ )
122
+ );
123
  }
124
  }
inc/fields/oembed.php CHANGED
@@ -9,11 +9,36 @@
9
  * OEmbed field class.
10
  */
11
  class RWMB_OEmbed_Field extends RWMB_Text_Field {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  /**
13
  * Enqueue scripts and styles.
14
  */
15
  public static function admin_enqueue_scripts() {
16
- wp_enqueue_style( 'rwmb-oembed', RWMB_CSS_URL . 'oembed.css' );
17
  wp_enqueue_script( 'rwmb-oembed', RWMB_JS_URL . 'oembed.js', array( 'jquery', 'underscore' ), RWMB_VER, true );
18
  }
19
 
@@ -28,17 +53,19 @@ class RWMB_OEmbed_Field extends RWMB_Text_Field {
28
  * Ajax callback for returning oEmbed HTML.
29
  */
30
  public static function wp_ajax_get_embed() {
31
- $url = (string) filter_input( INPUT_POST, 'url', FILTER_SANITIZE_URL );
32
- wp_send_json_success( self::get_embed( $url ) );
 
33
  }
34
 
35
  /**
36
  * Get embed html from url.
37
  *
38
- * @param string $url URL.
 
39
  * @return string
40
  */
41
- public static function get_embed( $url ) {
42
  /**
43
  * Set arguments for getting embeded HTML.
44
  * Without arguments, default width will be taken from global $content_width, which can break UI in the admin.
@@ -58,10 +85,19 @@ class RWMB_OEmbed_Field extends RWMB_Text_Field {
58
 
59
  // If no oembed provides found, try WordPress auto embed.
60
  if ( ! $embed ) {
61
- $embed = $GLOBALS['wp_embed']->shortcode( $args, $url );
 
 
 
 
 
 
 
 
62
  }
 
63
 
64
- return $embed ? $embed : __( 'Embed HTML not available.', 'meta-box' );
65
  }
66
 
67
  /**
@@ -75,7 +111,7 @@ class RWMB_OEmbed_Field extends RWMB_Text_Field {
75
  return parent::html( $meta, $field ) . sprintf(
76
  '<span class="spinner"></span>
77
  <div class="rwmb-embed-media">%s</div>',
78
- $meta ? self::get_embed( $meta ) : ''
79
  );
80
  }
81
 
@@ -88,7 +124,7 @@ class RWMB_OEmbed_Field extends RWMB_Text_Field {
88
  * @return array
89
  */
90
  public static function get_attributes( $field, $value = null ) {
91
- $attributes = parent::get_attributes( $field, $value );
92
  $attributes['type'] = 'url';
93
  return $attributes;
94
  }
@@ -104,6 +140,6 @@ class RWMB_OEmbed_Field extends RWMB_Text_Field {
104
  * @return string
105
  */
106
  public static function format_single_value( $field, $value, $args, $post_id ) {
107
- return self::get_embed( $value );
108
  }
109
  }
9
  * OEmbed field class.
10
  */
11
  class RWMB_OEmbed_Field extends RWMB_Text_Field {
12
+ /**
13
+ * Normalize parameters for field.
14
+ *
15
+ * @param array $field Field parameters.
16
+ * @return array
17
+ */
18
+ public static function normalize( $field ) {
19
+ $field = parent::normalize( $field );
20
+
21
+ $field = wp_parse_args(
22
+ $field,
23
+ array(
24
+ 'not_available_string' => __( 'Embed HTML not available.', 'meta-box' ),
25
+ )
26
+ );
27
+ $field['attributes'] = wp_parse_args(
28
+ $field['attributes'],
29
+ array(
30
+ 'data-not-available' => $field['not_available_string'],
31
+ )
32
+ );
33
+
34
+ return $field;
35
+ }
36
+
37
  /**
38
  * Enqueue scripts and styles.
39
  */
40
  public static function admin_enqueue_scripts() {
41
+ wp_enqueue_style( 'rwmb-oembed', RWMB_CSS_URL . 'oembed.css', '', RWMB_VER );
42
  wp_enqueue_script( 'rwmb-oembed', RWMB_JS_URL . 'oembed.js', array( 'jquery', 'underscore' ), RWMB_VER, true );
43
  }
44
 
53
  * Ajax callback for returning oEmbed HTML.
54
  */
55
  public static function wp_ajax_get_embed() {
56
+ $url = (string) filter_input( INPUT_POST, 'url', FILTER_SANITIZE_URL );
57
+ $not_available = (string) filter_input( INPUT_POST, 'not_available' );
58
+ wp_send_json_success( self::get_embed( $url, $not_available ) );
59
  }
60
 
61
  /**
62
  * Get embed html from url.
63
  *
64
+ * @param string $url URL.
65
+ * @param string $not_available Not available string displayed to users.
66
  * @return string
67
  */
68
+ public static function get_embed( $url, $not_available = '' ) {
69
  /**
70
  * Set arguments for getting embeded HTML.
71
  * Without arguments, default width will be taken from global $content_width, which can break UI in the admin.
85
 
86
  // If no oembed provides found, try WordPress auto embed.
87
  if ( ! $embed ) {
88
+ global $wp_embed;
89
+ $temp = $wp_embed->return_false_on_fail;
90
+ $wp_embed->return_false_on_fail = true; // Do not fallback to make a link.
91
+ $embed = $wp_embed->shortcode( $args, $url );
92
+ $wp_embed->return_false_on_fail = $temp;
93
+ }
94
+
95
+ if ( $not_available ) {
96
+ $not_available = '<div class="rwmb-oembed-not-available">' . wp_kses_post( $not_available ) . '</div>';
97
  }
98
+ $not_available = apply_filters( 'rwmb_oembed_not_available_string', $not_available );
99
 
100
+ return $embed ? $embed : $not_available;
101
  }
102
 
103
  /**
111
  return parent::html( $meta, $field ) . sprintf(
112
  '<span class="spinner"></span>
113
  <div class="rwmb-embed-media">%s</div>',
114
+ $meta ? self::get_embed( $meta, $field['not_available_string'] ) : ''
115
  );
116
  }
117
 
124
  * @return array
125
  */
126
  public static function get_attributes( $field, $value = null ) {
127
+ $attributes = parent::get_attributes( $field, $value );
128
  $attributes['type'] = 'url';
129
  return $attributes;
130
  }
140
  * @return string
141
  */
142
  public static function format_single_value( $field, $value, $args, $post_id ) {
143
+ return self::get_embed( $value, $field['not_available_string'] );
144
  }
145
  }
inc/fields/osm.php ADDED
@@ -0,0 +1,175 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Open Street Map field.
4
+ *
5
+ * @package Meta Box
6
+ * @since 4.15.0
7
+ */
8
+
9
+ /**
10
+ * Open Street Map field class.
11
+ */
12
+ class RWMB_OSM_Field extends RWMB_Field {
13
+ /**
14
+ * Enqueue scripts and styles.
15
+ */
16
+ public static function admin_enqueue_scripts() {
17
+ // Because map is a hosted service, it's ok to use hosted Leaflet scripts.
18
+ wp_enqueue_style( 'leaflet', 'https://unpkg.com/leaflet@1.3.1/dist/leaflet.css', array(), '1.3.1' );
19
+ wp_enqueue_script( 'leaflet', 'https://unpkg.com/leaflet@1.3.1/dist/leaflet.js', array(), '1.3.1', true );
20
+
21
+ wp_enqueue_style( 'rwmb-osm', RWMB_CSS_URL . 'osm.css', array( 'leaflet' ), RWMB_VER );
22
+ wp_enqueue_script( 'rwmb-osm', RWMB_JS_URL . 'osm.js', array( 'jquery', 'leaflet' ), RWMB_VER, true );
23
+ self::localize_script(
24
+ 'rwmb-osm',
25
+ 'RWMB_Osm',
26
+ array(
27
+ 'no_results_string' => __( 'No results found', 'meta-box' ),
28
+ )
29
+ );
30
+ }
31
+
32
+ /**
33
+ * Get field HTML.
34
+ *
35
+ * @param mixed $meta Meta value.
36
+ * @param array $field Field parameters.
37
+ *
38
+ * @return string
39
+ */
40
+ public static function html( $meta, $field ) {
41
+ $address = is_array( $field['address_field'] ) ? implode( ',', $field['address_field'] ) : $field['address_field'];
42
+ $html = sprintf(
43
+ '<div class="rwmb-osm-field" data-address-field="%s">',
44
+ esc_attr( $address )
45
+ );
46
+
47
+ $html .= sprintf(
48
+ '<div class="rwmb-osm-canvas" data-default-loc="%s" data-region="%s" data-language="%s"></div>
49
+ <input type="hidden" name="%s" class="rwmb-osm-coordinate" value="%s">',
50
+ esc_attr( $field['std'] ),
51
+ esc_attr( $field['region'] ),
52
+ esc_attr( $field['language'] ),
53
+ esc_attr( $field['field_name'] ),
54
+ esc_attr( $meta )
55
+ );
56
+
57
+ if ( $field['address_field'] ) {
58
+ $html .= sprintf(
59
+ '<button class="button rwmb-osm-goto-address-button">%s</button>',
60
+ esc_html__( 'Find Address', 'meta-box' )
61
+ );
62
+ }
63
+
64
+ $html .= '</div>';
65
+
66
+ return $html;
67
+ }
68
+
69
+ /**
70
+ * Normalize parameters for field.
71
+ *
72
+ * @param array $field Field parameters.
73
+ *
74
+ * @return array
75
+ */
76
+ public static function normalize( $field ) {
77
+ $field = parent::normalize( $field );
78
+ $field = wp_parse_args(
79
+ $field,
80
+ array(
81
+ 'std' => '',
82
+ 'address_field' => '',
83
+ 'language' => '',
84
+ 'region' => '',
85
+ )
86
+ );
87
+
88
+ return $field;
89
+ }
90
+
91
+ /**
92
+ * Get the field value.
93
+ * The difference between this function and 'meta' function is 'meta' function always returns the escaped value
94
+ * of the field saved in the database, while this function returns more meaningful value of the field.
95
+ *
96
+ * @param array $field Field parameters.
97
+ * @param array $args Not used for this field.
98
+ * @param int|null $post_id Post ID. null for current post. Optional.
99
+ *
100
+ * @return mixed Array(latitude, longitude, zoom)
101
+ */
102
+ public static function get_value( $field, $args = array(), $post_id = null ) {
103
+ $value = parent::get_value( $field, $args, $post_id );
104
+ list( $latitude, $longitude, $zoom ) = explode( ',', $value . ',,' );
105
+ return compact( 'latitude', 'longitude', 'zoom' );
106
+ }
107
+
108
+ /**
109
+ * Output the field value.
110
+ * Display Google maps.
111
+ *
112
+ * @param array $field Field parameters.
113
+ * @param array $args Additional arguments for the map.
114
+ * @param int|null $post_id Post ID. null for current post. Optional.
115
+ *
116
+ * @return string HTML output of the field
117
+ */
118
+ public static function the_value( $field, $args = array(), $post_id = null ) {
119
+ $value = parent::get_value( $field, $args, $post_id );
120
+ return self::render_map( $value, $args );
121
+ }
122
+
123
+ /**
124
+ * Render a map in the frontend.
125
+ *
126
+ * @param array $location The [latitude, longitude[, zoom]] location.
127
+ * @param array $args Additional arguments for the map.
128
+ *
129
+ * @return string
130
+ */
131
+ public static function render_map( $location, $args = array() ) {
132
+ list( $latitude, $longitude, $zoom ) = explode( ',', $location . ',,' );
133
+ if ( ! $latitude || ! $longitude ) {
134
+ return '';
135
+ }
136
+
137
+ $args = wp_parse_args(
138
+ $args,
139
+ array(
140
+ 'latitude' => $latitude,
141
+ 'longitude' => $longitude,
142
+ 'width' => '100%',
143
+ 'height' => '480px',
144
+ 'marker' => true, // Display marker?
145
+ 'marker_title' => '', // Marker title, when hover.
146
+ 'info_window' => '', // Content of info window (when click on marker). HTML allowed.
147
+ 'js_options' => array(),
148
+ )
149
+ );
150
+
151
+ wp_enqueue_style( 'leaflet', 'https://unpkg.com/leaflet@1.3.1/dist/leaflet.css', array(), '1.3.1' );
152
+ wp_enqueue_script( 'leaflet', 'https://unpkg.com/leaflet@1.3.1/dist/leaflet.js', array(), '1.3.1', true );
153
+ wp_enqueue_script( 'rwmb-osm-frontend', RWMB_JS_URL . 'osm-frontend.js', array( 'jquery', 'leaflet' ), RWMB_VER, true );
154
+
155
+ /*
156
+ * More Open Street Map options
157
+ * @link https://leafletjs.com/reference-1.3.0.html#map-option
158
+ */
159
+ $args['js_options'] = wp_parse_args(
160
+ $args['js_options'],
161
+ array(
162
+ // Default to 'zoom' level set in admin, but can be overwritten.
163
+ 'zoom' => $zoom,
164
+ )
165
+ );
166
+
167
+ $output = sprintf(
168
+ '<div class="rwmb-osm-canvas" data-osm_options="%s" style="width:%s;height:%s"></div>',
169
+ esc_attr( wp_json_encode( $args ) ),
170
+ esc_attr( $args['width'] ),
171
+ esc_attr( $args['height'] )
172
+ );
173
+ return $output;
174
+ }
175
+ }
inc/fields/post.php CHANGED
@@ -16,11 +16,14 @@ class RWMB_Post_Field extends RWMB_Object_Choice_Field {
16
  * @return array
17
  */
18
  public static function normalize( $field ) {
19
- // Set default field args.
20
- $field = wp_parse_args( $field, array(
21
- 'post_type' => 'post',
22
- 'parent' => false,
23
- ) );
 
 
 
24
 
25
  $field['post_type'] = (array) $field['post_type'];
26
 
@@ -31,21 +34,19 @@ class RWMB_Post_Field extends RWMB_Object_Choice_Field {
31
  */
32
  $placeholder = __( 'Select a post', 'meta-box' );
33
  if ( 1 === count( $field['post_type'] ) ) {
34
- $post_type = reset( $field['post_type'] );
35
  $post_type_object = get_post_type_object( $post_type );
36
  if ( ! empty( $post_type_object ) ) {
37
  // Translators: %s is the taxonomy singular label.
38
  $placeholder = sprintf( __( 'Select a %s', 'meta-box' ), strtolower( $post_type_object->labels->singular_name ) );
39
  }
40
  }
41
- $field = wp_parse_args( $field, array(
42
- 'placeholder' => $placeholder,
43
- ) );
44
- $field = parent::normalize( $field );
45
-
46
- if ( ! isset( $field['query_args']['post_type'] ) ) {
47
- $field['query_args']['post_type'] = $field['post_type'];
48
- }
49
 
50
  // Set parent option, which will change field name to `parent_id` to save as post parent.
51
  if ( $field['parent'] ) {
@@ -53,26 +54,42 @@ class RWMB_Post_Field extends RWMB_Object_Choice_Field {
53
  $field['field_name'] = 'parent_id';
54
  }
55
 
56
- // Set default query args.
57
- $field['query_args'] = wp_parse_args( $field['query_args'], array(
58
- 'post_status' => 'publish',
59
- 'posts_per_page' => - 1,
60
- ) );
61
 
62
  return $field;
63
  }
64
 
65
  /**
66
- * Get field names of object to be used by walker.
67
  *
68
- * @return array
 
69
  */
70
- public static function get_db_fields() {
71
- return array(
72
- 'parent' => 'post_parent',
73
- 'id' => 'ID',
74
- 'label' => 'post_title',
 
 
 
 
 
 
75
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
76
  }
77
 
78
  /**
@@ -93,32 +110,25 @@ class RWMB_Post_Field extends RWMB_Object_Choice_Field {
93
  }
94
 
95
  /**
96
- * Get options for walker.
97
- *
98
- * @param array $field Field parameters.
99
- * @return array
100
- */
101
- public static function get_options( $field ) {
102
- $query = new WP_Query( $field['query_args'] );
103
- return $query->have_posts() ? $query->posts : array();
104
- }
105
-
106
- /**
107
- * Get option label.
108
  *
109
- * @param array $field Field parameters.
110
- * @param string $value Option value.
 
 
111
  *
112
  * @return string
113
  */
114
- public static function get_option_label( $field, $value ) {
115
- return sprintf(
116
  '<a href="%s" title="%s">%s</a>',
117
  esc_url( get_permalink( $value ) ),
118
- the_title_attribute( array(
119
- 'post' => $value,
120
- 'echo' => false,
121
- ) ),
 
 
122
  get_the_title( $value )
123
  );
124
  }
16
  * @return array
17
  */
18
  public static function normalize( $field ) {
19
+ $field = wp_parse_args(
20
+ $field,
21
+ array(
22
+ 'post_type' => 'post',
23
+ 'parent' => false,
24
+ 'query_args' => array(),
25
+ )
26
+ );
27
 
28
  $field['post_type'] = (array) $field['post_type'];
29
 
34
  */
35
  $placeholder = __( 'Select a post', 'meta-box' );
36
  if ( 1 === count( $field['post_type'] ) ) {
37
+ $post_type = reset( $field['post_type'] );
38
  $post_type_object = get_post_type_object( $post_type );
39
  if ( ! empty( $post_type_object ) ) {
40
  // Translators: %s is the taxonomy singular label.
41
  $placeholder = sprintf( __( 'Select a %s', 'meta-box' ), strtolower( $post_type_object->labels->singular_name ) );
42
  }
43
  }
44
+ $field = wp_parse_args(
45
+ $field,
46
+ array(
47
+ 'placeholder' => $placeholder,
48
+ )
49
+ );
 
 
50
 
51
  // Set parent option, which will change field name to `parent_id` to save as post parent.
52
  if ( $field['parent'] ) {
54
  $field['field_name'] = 'parent_id';
55
  }
56
 
57
+ $field = parent::normalize( $field );
 
 
 
 
58
 
59
  return $field;
60
  }
61
 
62
  /**
63
+ * Query posts for field options.
64
  *
65
+ * @param array $field Field settings.
66
+ * @return array Field options array.
67
  */
68
+ public static function query( $field ) {
69
+ $args = wp_parse_args(
70
+ $field['query_args'],
71
+ array(
72
+ 'post_type' => $field['post_type'],
73
+ 'post_status' => 'publish',
74
+ 'posts_per_page' => -1,
75
+ 'no_found_rows' => true,
76
+ 'update_post_meta_cache' => false,
77
+ 'update_post_term_cache' => false,
78
+ )
79
  );
80
+ $query = new WP_Query( $args );
81
+ $options = array();
82
+ foreach ( $query->posts as $post ) {
83
+ $options[ $post->ID ] = array_merge(
84
+ array(
85
+ 'value' => $post->ID,
86
+ 'label' => $post->post_title,
87
+ 'parent' => $post->post_parent,
88
+ ),
89
+ (array) $post
90
+ );
91
+ }
92
+ return $options;
93
  }
94
 
95
  /**
110
  }
111
 
112
  /**
113
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
 
 
 
 
 
 
 
 
 
 
 
114
  *
115
+ * @param array $field Field parameters.
116
+ * @param string $value The value.
117
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
118
+ * @param int|null $post_id Post ID. null for current post. Optional.
119
  *
120
  * @return string
121
  */
122
+ public static function format_single_value( $field, $value, $args, $post_id ) {
123
+ return ! $value ? '' : sprintf(
124
  '<a href="%s" title="%s">%s</a>',
125
  esc_url( get_permalink( $value ) ),
126
+ the_title_attribute(
127
+ array(
128
+ 'post' => $value,
129
+ 'echo' => false,
130
+ )
131
+ ),
132
  get_the_title( $value )
133
  );
134
  }
inc/fields/radio.php CHANGED
@@ -17,7 +17,7 @@ class RWMB_Radio_Field extends RWMB_Input_List_Field {
17
  */
18
  public static function normalize( $field ) {
19
  $field['multiple'] = false;
20
- $field = parent::normalize( $field );
21
 
22
  return $field;
23
  }
17
  */
18
  public static function normalize( $field ) {
19
  $field['multiple'] = false;
20
+ $field = parent::normalize( $field );
21
 
22
  return $field;
23
  }
inc/fields/range.php CHANGED
@@ -17,7 +17,7 @@ class RWMB_Range_Field extends RWMB_Number_Field {
17
  * @return string
18
  */
19
  public static function html( $meta, $field ) {
20
- $output = parent::html( $meta, $field );
21
  $output .= sprintf( '<span class="rwmb-output">%s</span>', $meta );
22
  return $output;
23
  }
@@ -37,9 +37,12 @@ class RWMB_Range_Field extends RWMB_Number_Field {
37
  * @return array
38
  */
39
  public static function normalize( $field ) {
40
- $field = wp_parse_args( $field, array(
41
- 'max' => 10,
42
- ) );
 
 
 
43
  $field = parent::normalize( $field );
44
  return $field;
45
  }
17
  * @return string
18
  */
19
  public static function html( $meta, $field ) {
20
+ $output = parent::html( $meta, $field );
21
  $output .= sprintf( '<span class="rwmb-output">%s</span>', $meta );
22
  return $output;
23
  }
37
  * @return array
38
  */
39
  public static function normalize( $field ) {
40
+ $field = wp_parse_args(
41
+ $field,
42
+ array(
43
+ 'max' => 10,
44
+ )
45
+ );
46
  $field = parent::normalize( $field );
47
  return $field;
48
  }
inc/fields/select-advanced.php CHANGED
@@ -40,18 +40,24 @@ class RWMB_Select_Advanced_Field extends RWMB_Select_Field {
40
  * @return array
41
  */
42
  public static function normalize( $field ) {
43
- $field = wp_parse_args( $field, array(
44
- 'js_options' => array(),
45
- 'placeholder' => __( 'Select an item', 'meta-box' ),
46
- ) );
 
 
 
47
 
48
  $field = parent::normalize( $field );
49
 
50
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
51
- 'allowClear' => true,
52
- 'width' => 'none',
53
- 'placeholder' => $field['placeholder'],
54
- ) );
 
 
 
55
 
56
  return $field;
57
  }
@@ -65,9 +71,12 @@ class RWMB_Select_Advanced_Field extends RWMB_Select_Field {
65
  */
66
  public static function get_attributes( $field, $value = null ) {
67
  $attributes = parent::get_attributes( $field, $value );
68
- $attributes = wp_parse_args( $attributes, array(
69
- 'data-options' => wp_json_encode( $field['js_options'] ),
70
- ) );
 
 
 
71
 
72
  return $attributes;
73
  }
40
  * @return array
41
  */
42
  public static function normalize( $field ) {
43
+ $field = wp_parse_args(
44
+ $field,
45
+ array(
46
+ 'js_options' => array(),
47
+ 'placeholder' => __( 'Select an item', 'meta-box' ),
48
+ )
49
+ );
50
 
51
  $field = parent::normalize( $field );
52
 
53
+ $field['js_options'] = wp_parse_args(
54
+ $field['js_options'],
55
+ array(
56
+ 'allowClear' => true,
57
+ 'width' => 'none',
58
+ 'placeholder' => $field['placeholder'],
59
+ )
60
+ );
61
 
62
  return $field;
63
  }
71
  */
72
  public static function get_attributes( $field, $value = null ) {
73
  $attributes = parent::get_attributes( $field, $value );
74
+ $attributes = wp_parse_args(
75
+ $attributes,
76
+ array(
77
+ 'data-options' => wp_json_encode( $field['js_options'] ),
78
+ )
79
+ );
80
 
81
  return $attributes;
82
  }
inc/fields/select-tree.php CHANGED
@@ -10,18 +10,16 @@
10
  */
11
  class RWMB_Select_Tree_Field extends RWMB_Select_Field {
12
  /**
13
- * Walk options.
14
- *
15
- * @param array $field Field parameters.
16
- * @param mixed $options Select options.
17
- * @param mixed $db_fields Database fields to use in the output.
18
- * @param mixed $meta Meta value.
19
  *
 
 
20
  * @return string
21
  */
22
- public static function walk( $field, $options, $db_fields, $meta ) {
23
- $walker = new RWMB_Walker_Select_Tree( $db_fields, $field, $meta );
24
- return $walker->walk( $options );
 
25
  }
26
 
27
  /**
10
  */
11
  class RWMB_Select_Tree_Field extends RWMB_Select_Field {
12
  /**
13
+ * Get field HTML.
 
 
 
 
 
14
  *
15
+ * @param mixed $meta Meta value.
16
+ * @param array $field Field parameters.
17
  * @return string
18
  */
19
+ public static function html( $meta, $field ) {
20
+ $options = self::transform_options( $field['options'] );
21
+ $walker = new RWMB_Walker_Select_Tree( $field, $meta );
22
+ return $options ? $walker->walk( $options ) : '';
23
  }
24
 
25
  /**
inc/fields/select.php CHANGED
@@ -18,27 +18,25 @@ class RWMB_Select_Field extends RWMB_Choice_Field {
18
  }
19
 
20
  /**
21
- * Walk options.
22
- *
23
- * @param array $field Field parameters.
24
- * @param mixed $options Select options.
25
- * @param mixed $db_fields Database fields to use in the output.
26
- * @param mixed $meta Meta value.
27
  *
 
 
28
  * @return string
29
  */
30
- public static function walk( $field, $options, $db_fields, $meta ) {
 
31
  $attributes = self::call( 'get_attributes', $field, $meta );
32
  $attributes['data-selected'] = $meta;
33
- $walker = new RWMB_Walker_Select( $db_fields, $field, $meta );
34
  $output = sprintf(
35
  '<select %s>',
36
  self::render_attributes( $attributes )
37
  );
38
- if ( false === $field['multiple'] ) {
39
- $output .= $field['placeholder'] ? '<option value="">' . esc_html( $field['placeholder'] ) . '</option>' : '';
40
  }
41
- $output .= $walker->walk( $options, $field['flatten'] ? - 1 : 0 );
42
  $output .= '</select>';
43
  $output .= self::get_select_all_html( $field );
44
  return $output;
@@ -53,9 +51,12 @@ class RWMB_Select_Field extends RWMB_Choice_Field {
53
  public static function normalize( $field ) {
54
  $field = parent::normalize( $field );
55
  $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
56
- $field = wp_parse_args( $field, array(
57
- 'select_all_none' => false,
58
- ) );
 
 
 
59
 
60
  return $field;
61
  }
@@ -70,9 +71,12 @@ class RWMB_Select_Field extends RWMB_Choice_Field {
70
  */
71
  public static function get_attributes( $field, $value = null ) {
72
  $attributes = parent::get_attributes( $field, $value );
73
- $attributes = wp_parse_args( $attributes, array(
74
- 'multiple' => $field['multiple'],
75
- ) );
 
 
 
76
 
77
  return $attributes;
78
  }
18
  }
19
 
20
  /**
21
+ * Get field HTML.
 
 
 
 
 
22
  *
23
+ * @param mixed $meta Meta value.
24
+ * @param array $field Field parameters.
25
  * @return string
26
  */
27
+ public static function html( $meta, $field ) {
28
+ $options = self::transform_options( $field['options'] );
29
  $attributes = self::call( 'get_attributes', $field, $meta );
30
  $attributes['data-selected'] = $meta;
31
+ $walker = new RWMB_Walker_Select( $field, $meta );
32
  $output = sprintf(
33
  '<select %s>',
34
  self::render_attributes( $attributes )
35
  );
36
+ if ( ! $field['multiple'] && $field['placeholder'] ) {
37
+ $output .= '<option value="">' . esc_html( $field['placeholder'] ) . '</option>';
38
  }
39
+ $output .= $walker->walk( $options, $field['flatten'] ? -1 : 0 );
40
  $output .= '</select>';
41
  $output .= self::get_select_all_html( $field );
42
  return $output;
51
  public static function normalize( $field ) {
52
  $field = parent::normalize( $field );
53
  $field = $field['multiple'] ? RWMB_Multiple_Values_Field::normalize( $field ) : $field;
54
+ $field = wp_parse_args(
55
+ $field,
56
+ array(
57
+ 'select_all_none' => false,
58
+ )
59
+ );
60
 
61
  return $field;
62
  }
71
  */
72
  public static function get_attributes( $field, $value = null ) {
73
  $attributes = parent::get_attributes( $field, $value );
74
+ $attributes = wp_parse_args(
75
+ $attributes,
76
+ array(
77
+ 'multiple' => $field['multiple'],
78
+ )
79
+ );
80
 
81
  return $attributes;
82
  }
inc/fields/sidebar.php CHANGED
@@ -17,59 +17,47 @@ class RWMB_Sidebar_Field extends RWMB_Object_Choice_Field {
17
  * @return array
18
  */
19
  public static function normalize( $field ) {
20
- // Set default field args.
21
- $field = parent::normalize( $field );
22
-
23
- // Prevent select tree for user since it's not hierarchical.
24
- $field['field_type'] = 'select_tree' === $field['field_type'] ? 'select' : $field['field_type'];
25
-
26
- // Set to always flat.
27
- $field['flatten'] = true;
28
 
29
- // Set default placeholder.
30
- $field['placeholder'] = empty( $field['placeholder'] ) ? __( 'Select a sidebar', 'meta-box' ) : $field['placeholder'];
31
 
32
  return $field;
33
  }
34
 
35
  /**
36
- * Get users.
37
- *
38
- * @param array $field Field parameters.
39
  *
40
- * @return array
 
41
  */
42
- public static function get_options( $field ) {
43
  global $wp_registered_sidebars;
44
  $options = array();
45
  foreach ( $wp_registered_sidebars as $sidebar ) {
46
- $options[] = (object) $sidebar;
 
 
 
47
  }
48
  return $options;
49
  }
50
 
51
  /**
52
- * Get field names of object to be used by walker.
53
- *
54
- * @return array
55
- */
56
- public static function get_db_fields() {
57
- return array(
58
- 'parent' => 'parent',
59
- 'id' => 'id',
60
- 'label' => 'name',
61
- );
62
- }
63
-
64
- /**
65
- * Get option label.
66
  *
67
- * @param array $field Field parameters.
68
- * @param string $value Option value.
 
 
69
  *
70
  * @return string
71
  */
72
- public static function get_option_label( $field, $value ) {
73
  if ( ! is_active_sidebar( $value ) ) {
74
  return '';
75
  }
17
  * @return array
18
  */
19
  public static function normalize( $field ) {
20
+ $field = wp_parse_args(
21
+ $field,
22
+ array(
23
+ 'placeholder' => __( 'Select a sidebar', 'meta-box' ),
24
+ )
25
+ );
 
 
26
 
27
+ $field = parent::normalize( $field );
 
28
 
29
  return $field;
30
  }
31
 
32
  /**
33
+ * Get sidebars for field options.
 
 
34
  *
35
+ * @param array $field Field settings.
36
+ * @return array Field options array.
37
  */
38
+ public static function query( $field ) {
39
  global $wp_registered_sidebars;
40
  $options = array();
41
  foreach ( $wp_registered_sidebars as $sidebar ) {
42
+ $options[ $sidebar['id'] ] = array(
43
+ 'value' => $sidebar['id'],
44
+ 'label' => $sidebar['name'],
45
+ );
46
  }
47
  return $options;
48
  }
49
 
50
  /**
51
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
 
 
 
 
 
 
 
 
 
 
 
 
 
52
  *
53
+ * @param array $field Field parameters.
54
+ * @param string $value The value.
55
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
56
+ * @param int|null $post_id Post ID. null for current post. Optional.
57
  *
58
  * @return string
59
  */
60
+ public static function format_single_value( $field, $value, $args, $post_id ) {
61
  if ( ! is_active_sidebar( $value ) ) {
62
  return '';
63
  }
inc/fields/single-image.php CHANGED
@@ -22,13 +22,16 @@ class RWMB_Single_Image_Field extends RWMB_Image_Advanced_Field {
22
 
23
  $field = parent::normalize( $field );
24
 
25
- $field['attributes'] = wp_parse_args( $field['attributes'], array(
26
- 'class' => '',
27
- 'data-single-image' => 1,
28
- ) );
 
 
 
29
 
30
  $field['attributes']['class'] .= ' rwmb-image_advanced';
31
- $field['multiple'] = false;
32
 
33
  return $field;
34
  }
@@ -57,8 +60,17 @@ class RWMB_Single_Image_Field extends RWMB_Image_Advanced_Field {
57
  * @return mixed Full info of uploaded files
58
  */
59
  public static function get_value( $field, $args = array(), $post_id = null ) {
60
- $value = RWMB_Field::get_value( $field, $args, $post_id );
61
- $return = RWMB_Image_Field::file_info( $value, $args );
 
 
 
 
 
 
 
 
 
62
  return $return;
63
  }
64
  }
22
 
23
  $field = parent::normalize( $field );
24
 
25
+ $field['attributes'] = wp_parse_args(
26
+ $field['attributes'],
27
+ array(
28
+ 'class' => '',
29
+ 'data-single-image' => 1,
30
+ )
31
+ );
32
 
33
  $field['attributes']['class'] .= ' rwmb-image_advanced';
34
+ $field['multiple'] = false;
35
 
36
  return $field;
37
  }
60
  * @return mixed Full info of uploaded files
61
  */
62
  public static function get_value( $field, $args = array(), $post_id = null ) {
63
+ $value = RWMB_Field::get_value( $field, $args, $post_id );
64
+
65
+ if ( ! is_array( $value ) ) {
66
+ return RWMB_Image_Field::file_info( $value, $args );
67
+ }
68
+
69
+ $return = array();
70
+ foreach ( $value as $image_id ) {
71
+ $return[] = RWMB_Image_Field::file_info( $image_id, $args );
72
+ }
73
+
74
  return $return;
75
  }
76
  }
inc/fields/slider.php CHANGED
@@ -17,7 +17,7 @@ class RWMB_Slider_Field extends RWMB_Field {
17
  wp_enqueue_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
18
  wp_enqueue_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
19
  wp_enqueue_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array(), '1.8.17' );
20
- wp_enqueue_style( 'rwmb-slider', RWMB_CSS_URL . 'slider.css' );
21
 
22
  wp_enqueue_script( 'rwmb-slider', RWMB_JS_URL . 'slider.js', array( 'jquery-ui-slider', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-core' ), RWMB_VER, true );
23
  }
@@ -37,9 +37,13 @@ class RWMB_Slider_Field extends RWMB_Field {
37
  <span class="rwmb-slider-value-label">%s<span>%s</span>%s</span>
38
  <input type="hidden" name="%s" value="%s" class="rwmb-slider-value">
39
  </div>',
40
- $field['id'], esc_attr( wp_json_encode( $field['js_options'] ) ),
41
- $field['prefix'], ( $meta >= 0 ) ? $meta : $field['std'], $field['suffix'],
42
- $field['field_name'], ( $meta >= 0 ) ? $meta : $field['std']
 
 
 
 
43
  );
44
  }
45
 
@@ -52,16 +56,22 @@ class RWMB_Slider_Field extends RWMB_Field {
52
  */
53
  public static function normalize( $field ) {
54
  $field = parent::normalize( $field );
55
- $field = wp_parse_args( $field, array(
56
- 'prefix' => '',
57
- 'suffix' => '',
58
- 'std' => '',
59
- 'js_options' => array(),
60
- ) );
61
- $field['js_options'] = wp_parse_args( $field['js_options'], array(
62
- 'range' => 'min', // range = 'min' will add a dark background to sliding part, better UI.
63
- 'value' => $field['std'],
64
- ) );
 
 
 
 
 
 
65
 
66
  return $field;
67
  }
17
  wp_enqueue_style( 'jquery-ui-core', "{$url}/jquery.ui.core.css", array(), '1.8.17' );
18
  wp_enqueue_style( 'jquery-ui-theme', "{$url}/jquery.ui.theme.css", array(), '1.8.17' );
19
  wp_enqueue_style( 'jquery-ui-slider', "{$url}/jquery.ui.slider.css", array(), '1.8.17' );
20
+ wp_enqueue_style( 'rwmb-slider', RWMB_CSS_URL . 'slider.css', array(), RWMB_VER );
21
 
22
  wp_enqueue_script( 'rwmb-slider', RWMB_JS_URL . 'slider.js', array( 'jquery-ui-slider', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-core' ), RWMB_VER, true );
23
  }
37
  <span class="rwmb-slider-value-label">%s<span>%s</span>%s</span>
38
  <input type="hidden" name="%s" value="%s" class="rwmb-slider-value">
39
  </div>',
40
+ $field['id'],
41
+ esc_attr( wp_json_encode( $field['js_options'] ) ),
42
+ $field['prefix'],
43
+ ( $meta >= 0 ) ? $meta : $field['std'],
44
+ $field['suffix'],
45
+ $field['field_name'],
46
+ ( $meta >= 0 ) ? $meta : $field['std']
47
  );
48
  }
49
 
56
  */
57
  public static function normalize( $field ) {
58
  $field = parent::normalize( $field );
59
+ $field = wp_parse_args(
60
+ $field,
61
+ array(
62
+ 'prefix' => '',
63
+ 'suffix' => '',
64
+ 'std' => '',
65
+ 'js_options' => array(),
66
+ )
67
+ );
68
+ $field['js_options'] = wp_parse_args(
69
+ $field['js_options'],
70
+ array(
71
+ 'range' => 'min', // range = 'min' will add a dark background to sliding part, better UI.
72
+ 'value' => $field['std'],
73
+ )
74
+ );
75
 
76
  return $field;
77
  }
inc/fields/switch.php CHANGED
@@ -52,11 +52,14 @@ class RWMB_Switch_Field extends RWMB_Input_Field {
52
  */
53
  public static function normalize( $field ) {
54
  $field = parent::normalize( $field );
55
- $field = wp_parse_args( $field, array(
56
- 'style' => 'rounded',
57
- 'on_label' => '',
58
- 'off_label' => '',
59
- ) );
 
 
 
60
 
61
  return $field;
62
  }
52
  */
53
  public static function normalize( $field ) {
54
  $field = parent::normalize( $field );
55
+ $field = wp_parse_args(
56
+ $field,
57
+ array(
58
+ 'style' => 'rounded',
59
+ 'on_label' => '',
60
+ 'off_label' => '',
61
+ )
62
+ );
63
 
64
  return $field;
65
  }
inc/fields/taxonomy-advanced.php CHANGED
@@ -17,9 +17,12 @@ class RWMB_Taxonomy_Advanced_Field extends RWMB_Taxonomy_Field {
17
  * @return array
18
  */
19
  public static function normalize( $field ) {
20
- $field = wp_parse_args( $field, array(
21
- 'clone' => false,
22
- ) );
 
 
 
23
 
24
  $clone = $field['clone'];
25
  $field = parent::normalize( $field );
@@ -52,6 +55,9 @@ class RWMB_Taxonomy_Advanced_Field extends RWMB_Taxonomy_Field {
52
  * @param array $field The field parameters.
53
  */
54
  public static function save( $new, $old, $post_id, $field ) {
 
 
 
55
  $storage = $field['storage'];
56
 
57
  if ( $new ) {
@@ -72,7 +78,7 @@ class RWMB_Taxonomy_Advanced_Field extends RWMB_Taxonomy_Field {
72
  */
73
  public static function raw_meta( $object_id, $field, $args = array() ) {
74
  $args['single'] = true;
75
- $meta = RWMB_Field::raw_meta( $object_id, $field, $args );
76
 
77
  if ( empty( $meta ) ) {
78
  return $field['multiple'] ? array() : '';
@@ -121,10 +127,13 @@ class RWMB_Taxonomy_Advanced_Field extends RWMB_Taxonomy_Field {
121
  if ( empty( $term_ids ) ) {
122
  return array();
123
  }
124
- $args = wp_parse_args( array(
125
- 'include' => $term_ids,
126
- 'hide_empty' => false,
127
- ), $args );
 
 
 
128
 
129
  $info = get_terms( $field['taxonomy'], $args );
130
  $info = is_array( $info ) ? $info : array();
17
  * @return array
18
  */
19
  public static function normalize( $field ) {
20
+ $field = wp_parse_args(
21
+ $field,
22
+ array(
23
+ 'clone' => false,
24
+ )
25
+ );
26
 
27
  $clone = $field['clone'];
28
  $field = parent::normalize( $field );
55
  * @param array $field The field parameters.
56
  */
57
  public static function save( $new, $old, $post_id, $field ) {
58
+ if ( empty( $field['id'] ) || ! $field['save_field'] ) {
59
+ return;
60
+ }
61
  $storage = $field['storage'];
62
 
63
  if ( $new ) {
78
  */
79
  public static function raw_meta( $object_id, $field, $args = array() ) {
80
  $args['single'] = true;
81
+ $meta = RWMB_Field::raw_meta( $object_id, $field, $args );
82
 
83
  if ( empty( $meta ) ) {
84
  return $field['multiple'] ? array() : '';
127
  if ( empty( $term_ids ) ) {
128
  return array();
129
  }
130
+ $args = wp_parse_args(
131
+ array(
132
+ 'include' => $term_ids,
133
+ 'hide_empty' => false,
134
+ ),
135
+ $args
136
+ );
137
 
138
  $info = get_terms( $field['taxonomy'], $args );
139
  $info = is_array( $info ) ? $info : array();
inc/fields/taxonomy.php CHANGED
@@ -28,9 +28,13 @@ class RWMB_Taxonomy_Field extends RWMB_Object_Choice_Field {
28
  }
29
 
30
  // Set default field args.
31
- $field = wp_parse_args( $field, array(
32
- 'taxonomy' => 'category',
33
- ) );
 
 
 
 
34
 
35
  // Force taxonomy to be an array.
36
  $field['taxonomy'] = (array) $field['taxonomy'];
@@ -42,51 +46,67 @@ class RWMB_Taxonomy_Field extends RWMB_Object_Choice_Field {
42
  */
43
  $placeholder = __( 'Select a term', 'meta-box' );
44
  if ( 1 === count( $field['taxonomy'] ) ) {
45
- $taxonomy = reset( $field['taxonomy'] );
46
  $taxonomy_object = get_taxonomy( $taxonomy );
47
  if ( false !== $taxonomy_object ) {
48
  // Translators: %s is the taxonomy singular label.
49
  $placeholder = sprintf( __( 'Select a %s', 'meta-box' ), strtolower( $taxonomy_object->labels->singular_name ) );
50
  }
51
  }
52
- $field = wp_parse_args( $field, array(
53
- 'placeholder' => $placeholder,
54
- ) );
55
- $field = parent::normalize( $field );
 
 
56
 
57
  // Set default query args.
58
- $field['query_args'] = wp_parse_args( $field['query_args'], array(
59
- 'hide_empty' => false,
60
- ) );
 
 
 
61
 
62
  // Prevent cloning for taxonomy field.
63
  $field['clone'] = false;
64
 
 
 
65
  return $field;
66
  }
67
 
68
  /**
69
- * Get field names of object to be used by walker.
70
  *
71
- * @return array
 
72
  */
73
- public static function get_db_fields() {
74
- return array(
75
- 'parent' => 'parent',
76
- 'id' => 'term_id',
77
- 'label' => 'name',
 
 
 
 
78
  );
79
- }
80
-
81
- /**
82
- * Get options for selects, checkbox list, etc via the terms.
83
- *
84
- * @param array $field Field parameters.
85
- *
86
- * @return array
87
- */
88
- public static function get_options( $field ) {
89
- $options = get_terms( $field['taxonomy'], $field['query_args'] );
 
 
 
 
90
  return $options;
91
  }
92
 
@@ -99,6 +119,9 @@ class RWMB_Taxonomy_Field extends RWMB_Object_Choice_Field {
99
  * @param array $field The field parameters.
100
  */
101
  public static function save( $new, $old, $post_id, $field ) {
 
 
 
102
  $new = array_unique( array_map( 'intval', (array) $new ) );
103
  $new = empty( $new ) ? null : $new;
104
 
@@ -121,9 +144,16 @@ class RWMB_Taxonomy_Field extends RWMB_Object_Choice_Field {
121
  return '';
122
  }
123
 
124
- $meta = wp_get_object_terms( $object_id, $field['taxonomy'], array(
125
- 'orderby' => 'term_order',
126
- ) );
 
 
 
 
 
 
 
127
  $meta = wp_list_pluck( $meta, 'term_id' );
128
 
129
  return $field['multiple'] ? $meta : reset( $meta );
@@ -143,9 +173,13 @@ class RWMB_Taxonomy_Field extends RWMB_Object_Choice_Field {
143
  if ( ! $post_id ) {
144
  $post_id = get_the_ID();
145
  }
146
- $value = wp_get_object_terms( $post_id, $field['taxonomy'], array(
147
- 'orderby' => 'term_order',
148
- ) );
 
 
 
 
149
 
150
  // Get single value if necessary.
151
  if ( ! $field['clone'] && ! $field['multiple'] && is_array( $value ) ) {
@@ -155,20 +189,22 @@ class RWMB_Taxonomy_Field extends RWMB_Object_Choice_Field {
155
  }
156
 
157
  /**
158
- * Get option label.
159
  *
160
- * @param array $field Field parameters.
161
- * @param object $value The term object.
 
 
162
  *
163
  * @return string
164
  */
165
- public static function get_option_label( $field, $value ) {
166
  return sprintf(
167
  '<a href="%s" title="%s">%s</a>',
168
  // @codingStandardsIgnoreLine
169
  esc_url( get_term_link( $value ) ),
170
  esc_attr( $value->name ),
171
- $value->name
172
  );
173
  }
174
  }
28
  }
29
 
30
  // Set default field args.
31
+ $field = wp_parse_args(
32
+ $field,
33
+ array(
34
+ 'taxonomy' => 'category',
35
+ 'query_args' => array(),
36
+ )
37
+ );
38
 
39
  // Force taxonomy to be an array.
40
  $field['taxonomy'] = (array) $field['taxonomy'];
46
  */
47
  $placeholder = __( 'Select a term', 'meta-box' );
48
  if ( 1 === count( $field['taxonomy'] ) ) {
49
+ $taxonomy = reset( $field['taxonomy'] );
50
  $taxonomy_object = get_taxonomy( $taxonomy );
51
  if ( false !== $taxonomy_object ) {
52
  // Translators: %s is the taxonomy singular label.
53
  $placeholder = sprintf( __( 'Select a %s', 'meta-box' ), strtolower( $taxonomy_object->labels->singular_name ) );
54
  }
55
  }
56
+ $field = wp_parse_args(
57
+ $field,
58
+ array(
59
+ 'placeholder' => $placeholder,
60
+ )
61
+ );
62
 
63
  // Set default query args.
64
+ $field['query_args'] = wp_parse_args(
65
+ $field['query_args'],
66
+ array(
67
+ 'hide_empty' => false,
68
+ )
69
+ );
70
 
71
  // Prevent cloning for taxonomy field.
72
  $field['clone'] = false;
73
 
74
+ $field = parent::normalize( $field );
75
+
76
  return $field;
77
  }
78
 
79
  /**
80
+ * Query terms for field options.
81
  *
82
+ * @param array $field Field settings.
83
+ * @return array Field options array.
84
  */
85
+ public static function query( $field ) {
86
+ $args = wp_parse_args(
87
+ $field['query_args'],
88
+ array(
89
+ 'taxonomy' => $field['taxonomy'],
90
+ 'hide_empty' => false,
91
+ 'count' => false,
92
+ 'update_term_meta_cache' => false,
93
+ )
94
  );
95
+ $terms = get_terms( $args );
96
+ if ( ! is_array( $terms ) ) {
97
+ return array();
98
+ }
99
+ $options = array();
100
+ foreach ( $terms as $term ) {
101
+ $options[ $term->term_id ] = array_merge(
102
+ array(
103
+ 'value' => $term->term_id,
104
+ 'label' => $term->name,
105
+ 'parent' => $term->parent,
106
+ ),
107
+ (array) $term
108
+ );
109
+ }
110
  return $options;
111
  }
112
 
119
  * @param array $field The field parameters.
120
  */
121
  public static function save( $new, $old, $post_id, $field ) {
122
+ if ( empty( $field['id'] ) || ! $field['save_field'] ) {
123
+ return;
124
+ }
125
  $new = array_unique( array_map( 'intval', (array) $new ) );
126
  $new = empty( $new ) ? null : $new;
127
 
144
  return '';
145
  }
146
 
147
+ $meta = wp_get_object_terms(
148
+ $object_id,
149
+ $field['taxonomy'],
150
+ array(
151
+ 'orderby' => 'term_order',
152
+ )
153
+ );
154
+ if ( is_wp_error( $meta ) ) {
155
+ return '';
156
+ }
157
  $meta = wp_list_pluck( $meta, 'term_id' );
158
 
159
  return $field['multiple'] ? $meta : reset( $meta );
173
  if ( ! $post_id ) {
174
  $post_id = get_the_ID();
175
  }
176
+ $value = wp_get_object_terms(
177
+ $post_id,
178
+ $field['taxonomy'],
179
+ array(
180
+ 'orderby' => 'term_order',
181
+ )
182
+ );
183
 
184
  // Get single value if necessary.
185
  if ( ! $field['clone'] && ! $field['multiple'] && is_array( $value ) ) {
189
  }
190
 
191
  /**
192
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
193
  *
194
+ * @param array $field Field parameters.
195
+ * @param string $value The value.
196
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
197
+ * @param int|null $post_id Post ID. null for current post. Optional.
198
  *
199
  * @return string
200
  */
201
+ public static function format_single_value( $field, $value, $args, $post_id ) {
202
  return sprintf(
203
  '<a href="%s" title="%s">%s</a>',
204
  // @codingStandardsIgnoreLine
205
  esc_url( get_term_link( $value ) ),
206
  esc_attr( $value->name ),
207
+ esc_html( $value->name )
208
  );
209
  }
210
  }
inc/fields/text-list.php CHANGED
@@ -117,6 +117,9 @@ class RWMB_Text_List_Field extends RWMB_Multiple_Values_Field {
117
  * @param array $field The field parameters.
118
  */
119
  public static function save( $new, $old, $post_id, $field ) {
 
 
 
120
  $storage = $field['storage'];
121
  $storage->delete( $post_id, $field['id'] );
122
  parent::save( $new, array(), $post_id, $field );
117
  * @param array $field The field parameters.
118
  */
119
  public static function save( $new, $old, $post_id, $field ) {
120
+ if ( empty( $field['id'] ) || ! $field['save_field'] ) {
121
+ return;
122
+ }
123
  $storage = $field['storage'];
124
  $storage->delete( $post_id, $field['id'] );
125
  parent::save( $new, array(), $post_id, $field );
inc/fields/text.php CHANGED
@@ -18,11 +18,14 @@ class RWMB_Text_Field extends RWMB_Input_Field {
18
  public static function normalize( $field ) {
19
  $field = parent::normalize( $field );
20
 
21
- $field = wp_parse_args( $field, array(
22
- 'size' => 30,
23
- 'maxlength' => false,
24
- 'pattern' => false,
25
- ) );
 
 
 
26
 
27
  return $field;
28
  }
@@ -37,12 +40,15 @@ class RWMB_Text_Field extends RWMB_Input_Field {
37
  */
38
  public static function get_attributes( $field, $value = null ) {
39
  $attributes = parent::get_attributes( $field, $value );
40
- $attributes = wp_parse_args( $attributes, array(
41
- 'size' => $field['size'],
42
- 'maxlength' => $field['maxlength'],
43
- 'pattern' => $field['pattern'],
44
- 'placeholder' => $field['placeholder'],
45
- ) );
 
 
 
46
 
47
  return $attributes;
48
  }
18
  public static function normalize( $field ) {
19
  $field = parent::normalize( $field );
20
 
21
+ $field = wp_parse_args(
22
+ $field,
23
+ array(
24
+ 'size' => 30,
25
+ 'maxlength' => false,
26
+ 'pattern' => false,
27
+ )
28
+ );
29
 
30
  return $field;
31
  }
40
  */
41
  public static function get_attributes( $field, $value = null ) {
42
  $attributes = parent::get_attributes( $field, $value );
43
+ $attributes = wp_parse_args(
44
+ $attributes,
45
+ array(
46
+ 'size' => $field['size'],
47
+ 'maxlength' => $field['maxlength'],
48
+ 'pattern' => $field['pattern'],
49
+ 'placeholder' => $field['placeholder'],
50
+ )
51
+ );
52
 
53
  return $attributes;
54
  }
inc/fields/textarea.php CHANGED
@@ -44,14 +44,17 @@ class RWMB_Textarea_Field extends RWMB_Field {
44
  */
45
  public static function normalize( $field ) {
46
  $field = parent::normalize( $field );
47
- $field = wp_parse_args( $field, array(
48
- 'autocomplete' => false,
49
- 'cols' => 60,
50
- 'rows' => 3,
51
- 'maxlength' => false,
52
- 'wrap' => false,
53
- 'readonly' => false,
54
- ) );
 
 
 
55
 
56
  return $field;
57
  }
@@ -65,16 +68,19 @@ class RWMB_Textarea_Field extends RWMB_Field {
65
  * @return array
66
  */
67
  public static function get_attributes( $field, $value = null ) {
68
- $attributes = parent::get_attributes( $field, $value );
69
- $attributes = wp_parse_args( $attributes, array(
70
- 'autocomplete' => $field['autocomplete'],
71
- 'cols' => $field['cols'],
72
- 'rows' => $field['rows'],
73
- 'maxlength' => $field['maxlength'],
74
- 'wrap' => $field['wrap'],
75
- 'readonly' => $field['readonly'],
76
- 'placeholder' => $field['placeholder'],
77
- ) );
 
 
 
78
  $attributes['class'] .= ' large-text';
79
 
80
  return $attributes;
44
  */
45
  public static function normalize( $field ) {
46
  $field = parent::normalize( $field );
47
+ $field = wp_parse_args(
48
+ $field,
49
+ array(
50
+ 'autocomplete' => false,
51
+ 'cols' => 60,
52
+ 'rows' => 3,
53
+ 'maxlength' => false,
54
+ 'wrap' => false,
55
+ 'readonly' => false,
56
+ )
57
+ );
58
 
59
  return $field;
60
  }
68
  * @return array
69
  */
70
  public static function get_attributes( $field, $value = null ) {
71
+ $attributes = parent::get_attributes( $field, $value );
72
+ $attributes = wp_parse_args(
73
+ $attributes,
74
+ array(
75
+ 'autocomplete' => $field['autocomplete'],
76
+ 'cols' => $field['cols'],
77
+ 'rows' => $field['rows'],
78
+ 'maxlength' => $field['maxlength'],
79
+ 'wrap' => $field['wrap'],
80
+ 'readonly' => $field['readonly'],
81
+ 'placeholder' => $field['placeholder'],
82
+ )
83
+ );
84
  $attributes['class'] .= ' large-text';
85
 
86
  return $attributes;
inc/fields/time.php CHANGED
@@ -25,7 +25,7 @@ class RWMB_Time_Field extends RWMB_Datetime_Field {
25
  * @return array
26
  */
27
  public static function normalize( $field ) {
28
- $field = parent::normalize( $field );
29
  $field['js_options']['timeFormat'] = empty( $field['format'] ) ? $field['js_options']['timeFormat'] : $field['format'];
30
  return $field;
31
  }
25
  * @return array
26
  */
27
  public static function normalize( $field ) {
28
+ $field = parent::normalize( $field );
29
  $field['js_options']['timeFormat'] = empty( $field['format'] ) ? $field['js_options']['timeFormat'] : $field['format'];
30
  return $field;
31
  }
inc/fields/user.php CHANGED
@@ -18,63 +18,63 @@ class RWMB_User_Field extends RWMB_Object_Choice_Field {
18
  */
19
  public static function normalize( $field ) {
20
  // Set default field args.
21
- $field = wp_parse_args( $field, array(
22
- 'placeholder' => __( 'Select an user', 'meta-box' ),
23
- ) );
24
- $field = parent::normalize( $field );
25
-
26
- // Prevent select tree for user since it's not hierarchical.
27
- $field['field_type'] = 'select_tree' === $field['field_type'] ? 'select' : $field['field_type'];
28
-
29
- // Set to always flat.
30
- $field['flatten'] = true;
31
 
32
- // Set default query args.
33
- $field['query_args'] = wp_parse_args( $field['query_args'], array(
34
- 'orderby' => 'display_name',
35
- 'order' => 'asc',
36
- 'role' => '',
37
- 'fields' => 'all',
38
- ) );
39
 
40
  return $field;
41
  }
42
 
43
  /**
44
- * Get users.
45
- *
46
- * @param array $field Field parameters.
47
- *
48
- * @return array
49
- */
50
- public static function get_options( $field ) {
51
- $query = new WP_User_Query( $field['query_args'] );
52
- return $query->get_results();
53
- }
54
-
55
- /**
56
- * Get field names of object to be used by walker.
57
  *
58
- * @return array
 
59
  */
60
- public static function get_db_fields() {
61
- return array(
62
- 'parent' => 'parent',
63
- 'id' => 'ID',
64
- 'label' => 'display_name',
 
 
 
 
65
  );
 
 
 
 
 
 
 
 
 
 
 
 
66
  }
67
 
68
  /**
69
- * Get option label.
70
  *
71
- * @param array $field Field parameters.
72
- * @param string $value Option value.
 
 
73
  *
74
  * @return string
75
  */
76
- public static function get_option_label( $field, $value ) {
77
- $user = get_userdata( $value );
78
- return '<a href="' . get_author_posts_url( $value ) . '">' . $user->display_name . '</a>';
 
79
  }
80
  }
18
  */
19
  public static function normalize( $field ) {
20
  // Set default field args.
21
+ $field = wp_parse_args(
22
+ $field,
23
+ array(
24
+ 'placeholder' => __( 'Select an user', 'meta-box' ),
25
+ 'query_args' => array(),
26
+ 'display_field' => 'display_name',
27
+ )
28
+ );
 
 
29
 
30
+ $field = parent::normalize( $field );
 
 
 
 
 
 
31
 
32
  return $field;
33
  }
34
 
35
  /**
36
+ * Query users for field options.
 
 
 
 
 
 
 
 
 
 
 
 
37
  *
38
+ * @param array $field Field settings.
39
+ * @return array Field options array.
40
  */
41
+ public static function query( $field ) {
42
+ $display_field = $field['display_field'];
43
+ $args = wp_parse_args(
44
+ $field['query_args'],
45
+ array(
46
+ 'orderby' => $display_field,
47
+ 'order' => 'asc',
48
+ 'fields' => array( 'ID', $display_field ),
49
+ )
50
  );
51
+ $users = get_users( $args );
52
+ $options = array();
53
+ foreach ( $users as $user ) {
54
+ $options[ $user->ID ] = array_merge(
55
+ array(
56
+ 'value' => $user->ID,
57
+ 'label' => $user->$display_field,
58
+ ),
59
+ (array) $user
60
+ );
61
+ }
62
+ return $options;
63
  }
64
 
65
  /**
66
+ * Format a single value for the helper functions. Sub-fields should overwrite this method if necessary.
67
  *
68
+ * @param array $field Field parameters.
69
+ * @param string $value The value.
70
+ * @param array $args Additional arguments. Rarely used. See specific fields for details.
71
+ * @param int|null $post_id Post ID. null for current post. Optional.
72
  *
73
  * @return string
74
  */
75
+ public static function format_single_value( $field, $value, $args, $post_id ) {
76
+ $display_field = $field['display_field'];
77
+ $user = get_userdata( $value );
78
+ return '<a href="' . esc_url( get_author_posts_url( $value ) ) . '">' . esc_html( $user->$display_field ) . '</a>';
79
  }
80
  }
inc/fields/video.php CHANGED
@@ -17,9 +17,13 @@ class RWMB_Video_Field extends RWMB_Media_Field {
17
  parent::admin_enqueue_scripts();
18
  wp_enqueue_style( 'rwmb-video', RWMB_CSS_URL . 'video.css', array( 'rwmb-media' ), RWMB_VER );
19
  wp_enqueue_script( 'rwmb-video', RWMB_JS_URL . 'video.js', array( 'rwmb-media' ), RWMB_VER, true );
20
- self::localize_script( 'rwmb-video', 'i18nRwmbVideo', array(
21
- 'extensions' => wp_get_video_extensions(),
22
- ) );
 
 
 
 
23
  }
24
 
25
  /**
@@ -85,9 +89,9 @@ class RWMB_Video_Field extends RWMB_Media_Field {
85
  $thumb_id = get_post_thumbnail_id( $attachment->ID );
86
  if ( ! empty( $thumb_id ) ) {
87
  list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'full' );
88
- $data['image'] = compact( 'src', 'width', 'height' );
89
  list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'thumbnail' );
90
- $data['thumb'] = compact( 'src', 'width', 'height' );
91
  } else {
92
  $src = wp_mime_type_icon( $attachment->ID );
93
  $width = 48;
@@ -115,18 +119,22 @@ class RWMB_Video_Field extends RWMB_Media_Field {
115
  // Display single video.
116
  if ( 1 === count( $value ) ) {
117
  $video = reset( $value );
118
- return wp_video_shortcode( array(
119
- 'src' => $video['src'],
120
- 'width' => $video['dimensions']['width'],
121
- 'height' => $video['dimensions']['height'],
122
- ) );
 
 
123
  }
124
 
125
  // Display multiple videos in a playlist.
126
- return wp_playlist_shortcode( array(
127
- 'ids' => $ids,
128
- 'type' => 'video',
129
- ) );
 
 
130
  }
131
 
132
  /**
@@ -134,6 +142,6 @@ class RWMB_Video_Field extends RWMB_Media_Field {
134
  */
135
  public static function print_templates() {
136
  parent::print_templates();
137
- require_once( RWMB_INC_DIR . 'templates/video.php' );
138
  }
139
  }
17
  parent::admin_enqueue_scripts();
18
  wp_enqueue_style( 'rwmb-video', RWMB_CSS_URL . 'video.css', array( 'rwmb-media' ), RWMB_VER );
19
  wp_enqueue_script( 'rwmb-video', RWMB_JS_URL . 'video.js', array( 'rwmb-media' ), RWMB_VER, true );
20
+ self::localize_script(
21
+ 'rwmb-video',
22
+ 'i18nRwmbVideo',
23
+ array(
24
+ 'extensions' => wp_get_video_extensions(),
25
+ )
26
+ );
27
  }
28
 
29
  /**
89
  $thumb_id = get_post_thumbnail_id( $attachment->ID );
90
  if ( ! empty( $thumb_id ) ) {
91
  list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'full' );
92
+ $data['image'] = compact( 'src', 'width', 'height' );
93
  list( $src, $width, $height ) = wp_get_attachment_image_src( $thumb_id, 'thumbnail' );
94
+ $data['thumb'] = compact( 'src', 'width', 'height' );
95
  } else {
96
  $src = wp_mime_type_icon( $attachment->ID );
97
  $width = 48;
119
  // Display single video.
120
  if ( 1 === count( $value ) ) {
121
  $video = reset( $value );
122
+ return wp_video_shortcode(
123
+ array(
124
+ 'src' => $video['src'],
125
+ 'width' => $video['dimensions']['width'],
126
+ 'height' => $video['dimensions']['height'],
127
+ )
128
+ );
129
  }
130
 
131
  // Display multiple videos in a playlist.
132
+ return wp_playlist_shortcode(
133
+ array(
134
+ 'ids' => $ids,
135
+ 'type' => 'video',
136
+ )
137
+ );
138
  }
139
 
140
  /**
142
  */
143
  public static function print_templates() {
144
  parent::print_templates();
145
+ require_once RWMB_INC_DIR . 'templates/video.php';
146
  }
147
  }
inc/fields/wysiwyg.php CHANGED
@@ -49,7 +49,7 @@ class RWMB_Wysiwyg_Field extends RWMB_Field {
49
  ob_start();
50
 
51
  $field['options']['textarea_name'] = $field['field_name'];
52
- $attributes = self::get_attributes( $field );
53
 
54
  // Use new wp_editor() since WP 3.3.
55
  wp_editor( $meta, $attributes['id'], $field['options'] );
@@ -75,15 +75,21 @@ class RWMB_Wysiwyg_Field extends RWMB_Field {
75
  */
76
  public static function normalize( $field ) {
77
  $field = parent::normalize( $field );
78
- $field = wp_parse_args( $field, array(
79
- 'raw' => false,
80
- 'options' => array(),
81
- ) );
 
 
 
82
 
83
- $field['options'] = wp_parse_args( $field['options'], array(
84
- 'editor_class' => 'rwmb-wysiwyg',
85
- 'dfw' => true, // Use default WordPress full screen UI.
86
- ) );
 
 
 
87
 
88
  // Keep the filter to be compatible with previous versions.
89
  $field['options'] = apply_filters( 'rwmb_wysiwyg_settings', $field['options'] );
49
  ob_start();
50
 
51
  $field['options']['textarea_name'] = $field['field_name'];
52
+ $attributes = self::get_attributes( $field );
53
 
54
  // Use new wp_editor() since WP 3.3.
55
  wp_editor( $meta, $attributes['id'], $field['options'] );
75
  */
76
  public static function normalize( $field ) {
77
  $field = parent::normalize( $field );
78
+ $field = wp_parse_args(
79
+ $field,
80
+ array(
81
+ 'raw' => false,
82
+ 'options' => array(),
83
+ )
84
+ );
85
 
86
+ $field['options'] = wp_parse_args(
87
+ $field['options'],
88
+ array(
89
+ 'editor_class' => 'rwmb-wysiwyg',
90
+ 'dfw' => true, // Use default WordPress full screen UI.
91
+ )
92
+ );
93
 
94
  // Keep the filter to be compatible with previous versions.
95
  $field['options'] = apply_filters( 'rwmb_wysiwyg_settings', $field['options'] );
inc/functions.php CHANGED
@@ -26,7 +26,7 @@ if ( ! function_exists( 'rwmb_meta' ) ) {
26
  if ( false === $field ) {
27
  return apply_filters( 'rwmb_meta', rwmb_meta_legacy( $key, $args, $post_id ) );
28
  }
29
- $meta = in_array( $field['type'], array( 'oembed', 'map' ), true ) ?
30
  rwmb_the_value( $key, $args, $post_id, false ) :
31
  rwmb_get_value( $key, $args, $post_id );
32
  return apply_filters( 'rwmb_meta', $meta, $key, $args, $post_id );
@@ -44,10 +44,12 @@ if ( ! function_exists( 'rwmb_get_field_settings' ) ) {
44
  * @return array
45
  */
46
  function rwmb_get_field_settings( $key, $args = array(), $object_id = null ) {
47
- $args = wp_parse_args( $args, array(
48
- 'object_type' => 'post',
49
- ) );
50
- $type = get_post_type( $object_id );
 
 
51
 
52
  /**
53
  * Filter meta type from object type and object id.
@@ -56,7 +58,10 @@ if ( ! function_exists( 'rwmb_get_field_settings' ) ) {
56
  * @var string Object type.
57
  * @var string|int Object id.
58
  */
59
- $type = apply_filters( 'rwmb_meta_type', $type, $args['object_type'], $object_id );
 
 
 
60
 
61
  return rwmb_get_registry( 'field' )->get( $key, $type, $args['object_type'] );
62
  }
@@ -73,11 +78,14 @@ if ( ! function_exists( 'rwmb_meta_legacy' ) ) {
73
  * @return mixed
74
  */
75
  function rwmb_meta_legacy( $key, $args = array(), $post_id = null ) {
76
- $args = wp_parse_args( $args, array(
77
- 'type' => 'text',
78
- 'multiple' => false,
79
- 'clone' => false,
80
- ) );
 
 
 
81
  $field = array(
82
  'id' => $key,
83
  'type' => $args['type'],
@@ -92,6 +100,7 @@ if ( ! function_exists( 'rwmb_meta_legacy' ) ) {
92
  $field['taxonomy'] = $args['taxonomy'];
93
  break;
94
  case 'map':
 
95
  case 'oembed':
96
  $method = 'the_value';
97
  break;
@@ -175,6 +184,64 @@ if ( ! function_exists( 'rwmb_the_value' ) ) {
175
  }
176
  } // End if().
177
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
178
  if ( ! function_exists( 'rwmb_meta_shortcode' ) ) {
179
  /**
180
  * Shortcode to display meta value.
@@ -184,9 +251,12 @@ if ( ! function_exists( 'rwmb_meta_shortcode' ) ) {
184
  * @return string
185
  */
186
  function rwmb_meta_shortcode( $atts ) {
187
- $atts = wp_parse_args( $atts, array(
188
- 'post_id' => get_the_ID(),
189
- ) );
 
 
 
190
  if ( empty( $atts['meta_key'] ) ) {
191
  return '';
192
  }
@@ -235,7 +305,7 @@ if ( ! function_exists( 'rwmb_get_storage_class_name' ) ) {
235
  $object_type = str_replace( array( '-', '_' ), ' ', $object_type );
236
  $object_type = ucwords( $object_type );
237
  $object_type = str_replace( ' ', '_', $object_type );
238
- $class_name = 'RWMB_' . $object_type . '_Storage';
239
 
240
  if ( ! class_exists( $class_name ) ) {
241
  $class_name = 'RWMB_Post_Storage';
@@ -255,7 +325,7 @@ if ( ! function_exists( 'rwmb_get_storage' ) ) {
255
  */
256
  function rwmb_get_storage( $object_type, $meta_box = null ) {
257
  $class_name = rwmb_get_storage_class_name( $object_type );
258
- $storage = rwmb_get_registry( 'storage' )->get( $class_name );
259
 
260
  return apply_filters( 'rwmb_get_storage', $storage, $object_type, $meta_box );
261
  }
@@ -280,3 +350,36 @@ if ( ! function_exists( 'rwmb_get_meta_box' ) ) {
280
  return new $class_name( $meta_box );
281
  }
282
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  if ( false === $field ) {
27
  return apply_filters( 'rwmb_meta', rwmb_meta_legacy( $key, $args, $post_id ) );
28
  }
29
+ $meta = in_array( $field['type'], array( 'oembed', 'map', 'osm' ), true ) ?
30
  rwmb_the_value( $key, $args, $post_id, false ) :
31
  rwmb_get_value( $key, $args, $post_id );
32
  return apply_filters( 'rwmb_meta', $meta, $key, $args, $post_id );
44
  * @return array
45
  */
46
  function rwmb_get_field_settings( $key, $args = array(), $object_id = null ) {
47
+ $args = wp_parse_args(
48
+ $args,
49
+ array(
50
+ 'object_type' => 'post',
51
+ )
52
+ );
53
 
54
  /**
55
  * Filter meta type from object type and object id.
58
  * @var string Object type.
59
  * @var string|int Object id.
60
  */
61
+ $type = apply_filters( 'rwmb_meta_type', '', $args['object_type'], $object_id );
62
+ if ( ! $type ) {
63
+ $type = get_post_type( $object_id );
64
+ }
65
 
66
  return rwmb_get_registry( 'field' )->get( $key, $type, $args['object_type'] );
67
  }
78
  * @return mixed
79
  */
80
  function rwmb_meta_legacy( $key, $args = array(), $post_id = null ) {
81
+ $args = wp_parse_args(
82
+ $args,
83
+ array(
84
+ 'type' => 'text',
85
+ 'multiple' => false,
86
+ 'clone' => false,
87
+ )
88
+ );
89
  $field = array(
90
  'id' => $key,
91
  'type' => $args['type'],
100
  $field['taxonomy'] = $args['taxonomy'];
101
  break;
102
  case 'map':
103
+ case 'osm':
104
  case 'oembed':
105
  $method = 'the_value';
106
  break;
184
  }
185
  } // End if().
186
 
187
+ if ( ! function_exists( 'rwmb_get_object_fields' ) ) {
188
+ /**
189
+ * Get defined meta fields for object.
190
+ *
191
+ * @param int|string $type_or_id Object ID or post type / taxonomy (for terms) / user (for users).
192
+ * @param string $object_type Object type. Use post, term.
193
+ *
194
+ * @return array
195
+ */
196
+ function rwmb_get_object_fields( $type_or_id, $object_type = 'post' ) {
197
+ $meta_boxes = rwmb_get_registry( 'meta_box' )->get_by( array( 'object_type' => $object_type ) );
198
+ array_walk( $meta_boxes, 'rwmb_check_meta_box_supports', array( $object_type, $type_or_id ) );
199
+ $meta_boxes = array_filter( $meta_boxes );
200
+
201
+ $fields = array();
202
+ foreach ( $meta_boxes as $meta_box ) {
203
+ foreach ( $meta_box->fields as $field ) {
204
+ $fields[ $field['id'] ] = $field;
205
+ }
206
+ }
207
+
208
+ return $fields;
209
+ }
210
+ }
211
+
212
+ if ( ! function_exists( 'rwmb_check_meta_box_supports' ) ) {
213
+ /**
214
+ * Check if a meta box supports an object.
215
+ *
216
+ * @param object $meta_box Meta Box object.
217
+ * @param int $key Not used.
218
+ * @param array $object_data Object data (type and ID).
219
+ */
220
+ function rwmb_check_meta_box_supports( &$meta_box, $key, $object_data ) {
221
+ list( $object_type, $type_or_id ) = $object_data;
222
+
223
+ $type = null;
224
+ $prop = null;
225
+ switch ( $object_type ) {
226
+ case 'post':
227
+ $type = is_numeric( $type_or_id ) ? get_post_type( $type_or_id ) : $type_or_id;
228
+ $prop = 'post_types';
229
+ break;
230
+ case 'term':
231
+ $type = $type_or_id;
232
+ if ( is_numeric( $type_or_id ) ) {
233
+ $term = get_term( $type_or_id );
234
+ $type = is_array( $term ) ? $term->taxonomy : null;
235
+ }
236
+ $prop = 'taxonomies';
237
+ break;
238
+ }
239
+ if ( ! $type || ! in_array( $type, $meta_box->meta_box[ $prop ], true ) ) {
240
+ $meta_box = false;
241
+ }
242
+ }
243
+ }
244
+
245
  if ( ! function_exists( 'rwmb_meta_shortcode' ) ) {
246
  /**
247
  * Shortcode to display meta value.
251
  * @return string
252
  */
253
  function rwmb_meta_shortcode( $atts ) {
254
+ $atts = wp_parse_args(
255
+ $atts,
256
+ array(
257
+ 'post_id' => get_the_ID(),
258
+ )
259
+ );
260
  if ( empty( $atts['meta_key'] ) ) {
261
  return '';
262
  }
305
  $object_type = str_replace( array( '-', '_' ), ' ', $object_type );
306
  $object_type = ucwords( $object_type );
307
  $object_type = str_replace( ' ', '_', $object_type );
308
+ $class_name = 'RWMB_' . $object_type . '_Storage';
309
 
310
  if ( ! class_exists( $class_name ) ) {
311
  $class_name = 'RWMB_Post_Storage';
325
  */
326
  function rwmb_get_storage( $object_type, $meta_box = null ) {
327
  $class_name = rwmb_get_storage_class_name( $object_type );
328
+ $storage = rwmb_get_registry( 'storage' )->get( $class_name );
329
 
330
  return apply_filters( 'rwmb_get_storage', $storage, $object_type, $meta_box );
331
  }
350
  return new $class_name( $meta_box );
351
  }
352
  }
353
+
354
+ /**
355
+ * Helper functions
356
+ */
357
+
358
+ if ( ! function_exists( 'rwmb_change_array_key' ) ) {
359
+ /**
360
+ * Change array key.
361
+ *
362
+ * @param array $array Input array.
363
+ * @param string $from From key.
364
+ * @param string $to To key.
365
+ */
366
+ function rwmb_change_array_key( &$array, $from, $to ) {
367
+ if ( isset( $array[ $from ] ) ) {
368
+ $array[ $to ] = $array[ $from ];
369
+ }
370
+ unset( $array[ $from ] );
371
+ }
372
+ }
373
+
374
+ if ( ! function_exists( 'rwmb_csv_to_array' ) ) {
375
+ /**
376
+ * Convert a comma separated string to array.
377
+ *
378
+ * @param string $string Comma separated string.
379
+ *
380
+ * @return array
381
+ */
382
+ function rwmb_csv_to_array( $string ) {
383
+ return is_array( $string ) ? $string : array_filter( array_map( 'trim', explode( ',', $string . ',' ) ) );
384
+ }
385
+ }
inc/loader.php CHANGED
@@ -18,7 +18,7 @@ class RWMB_Loader {
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
- define( 'RWMB_VER', '4.14.10' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
18
  */
19
  protected function constants() {
20
  // Script version, used to add version for scripts and styles.
21
+ define( 'RWMB_VER', '4.15.6' );
22
 
23
  list( $path, $url ) = self::get_path( dirname( dirname( __FILE__ ) ) );
24
 
inc/meta-box.php CHANGED
@@ -49,7 +49,7 @@ class RW_Meta_Box {
49
  * @param array $meta_box Meta box definition.
50
  */
51
  public function __construct( $meta_box ) {
52
- $meta_box = self::normalize( $meta_box );
53
  $this->meta_box = $meta_box;
54
 
55
  $storage = $this->get_storage();
@@ -88,7 +88,7 @@ class RW_Meta_Box {
88
  *
89
  * @return bool
90
  */
91
- protected function is_shown() {
92
  $show = apply_filters( 'rwmb_show', true, $this->meta_box );
93
 
94
  return apply_filters( "rwmb_show_{$this->id}", $show, $this->meta_box );
@@ -144,10 +144,6 @@ class RW_Meta_Box {
144
  wp_enqueue_style( 'rwmb-rtl', RWMB_CSS_URL . 'style-rtl.css', array(), RWMB_VER );
145
  }
146
 
147
- if ( 'seamless' === $this->style ) {
148
- wp_enqueue_script( 'rwmb', RWMB_JS_URL . 'script.js', array( 'jquery' ), RWMB_VER, true );
149
- }
150
-
151
  // Load clone script conditionally.
152
  foreach ( $this->fields as $field ) {
153
  if ( $field['clone'] ) {
@@ -178,6 +174,9 @@ class RW_Meta_Box {
178
  * Add meta box for multiple post types
179
  */
180
  public function add_meta_boxes() {
 
 
 
181
  foreach ( $this->post_types as $post_type ) {
182
  add_meta_box(
183
  $this->id,
@@ -190,6 +189,23 @@ class RW_Meta_Box {
190
  }
191
  }
192
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
193
  /**
194
  * Hide meta box if it's set 'default_hidden'
195
  *
@@ -217,8 +233,7 @@ class RW_Meta_Box {
217
 
218
  // Container.
219
  printf(
220
- '<div class="rwmb-meta-box%s" data-autosave="%s" data-object-type="%s">',
221
- esc_attr( 'seamless' === $this->style ? ' rwmb-meta-box--seamless' : '' ),
222
  esc_attr( $this->autosave ? 'true' : 'false' ),
223
  esc_attr( $this->object_type )
224
  );
@@ -332,27 +347,28 @@ class RW_Meta_Box {
332
  */
333
  public static function normalize( $meta_box ) {
334
  // Set default values for meta box.
335
- $meta_box = wp_parse_args( $meta_box, array(
336
- 'id' => sanitize_title( $meta_box['title'] ),
337
- 'context' => 'normal',
338
- 'priority' => 'high',
339
- 'post_types' => 'post',
340
- 'autosave' => false,
341
- 'default_hidden' => false,
342
- 'style' => 'default',
343
- ) );
 
 
 
344
 
345
  /**
346
  * Use 'post_types' for better understanding and fallback to 'pages' for previous versions.
347
  *
348
  * @since 4.4.1
349
  */
350
- if ( ! empty( $meta_box['pages'] ) ) {
351
- $meta_box['post_types'] = $meta_box['pages'];
352
- }
353
 
354
  // Make sure the post type is an array and is sanitized.
355
- $meta_box['post_types'] = array_map( 'sanitize_key', (array) $meta_box['post_types'] );
356
 
357
  return $meta_box;
358
  }
@@ -396,13 +412,22 @@ class RW_Meta_Box {
396
  if ( empty( $field['id'] ) ) {
397
  continue;
398
  }
 
 
 
 
 
 
 
 
399
  $value = RWMB_Field::call( $field, 'raw_meta', $this->object_id );
400
  if ( false === $value ) {
401
  continue;
402
  }
 
403
  if (
404
  ( ! $field['multiple'] && '' !== $value )
405
- || ( $field['multiple'] && array() !== $value )
406
  ) {
407
  return true;
408
  }
49
  * @param array $meta_box Meta box definition.
50
  */
51
  public function __construct( $meta_box ) {
52
+ $meta_box = self::normalize( $meta_box );
53
  $this->meta_box = $meta_box;
54
 
55
  $storage = $this->get_storage();
88
  *
89
  * @return bool
90
  */
91
+ public function is_shown() {
92
  $show = apply_filters( 'rwmb_show', true, $this->meta_box );
93
 
94
  return apply_filters( "rwmb_show_{$this->id}", $show, $this->meta_box );
144
  wp_enqueue_style( 'rwmb-rtl', RWMB_CSS_URL . 'style-rtl.css', array(), RWMB_VER );
145
  }
146
 
 
 
 
 
147
  // Load clone script conditionally.
148
  foreach ( $this->fields as $field ) {
149
  if ( $field['clone'] ) {
174
  * Add meta box for multiple post types
175
  */
176
  public function add_meta_boxes() {
177
+ $screen = get_current_screen();
178
+ add_filter( "postbox_classes_{$screen->id}_{$this->id}", array( $this, 'postbox_classes' ) );
179
+
180
  foreach ( $this->post_types as $post_type ) {
181
  add_meta_box(
182
  $this->id,
189
  }
190
  }
191
 
192
+ /**
193
+ * Modify meta box postbox classes.
194
+ *
195
+ * @param array $classes Array of classes.
196
+ * @return array
197
+ */
198
+ public function postbox_classes( $classes ) {
199
+ if ( $this->closed && ! in_array( 'closed', $classes ) ) {
200
+ $classes[] = 'closed';
201
+ }
202
+ if ( 'seamless' === $this->style ) {
203
+ $classes[] = 'rwmb-seamless';
204
+ }
205
+
206
+ return $classes;
207
+ }
208
+
209
  /**
210
  * Hide meta box if it's set 'default_hidden'
211
  *
233
 
234
  // Container.
235
  printf(
236
+ '<div class="rwmb-meta-box" data-autosave="%s" data-object-type="%s">',
 
237
  esc_attr( $this->autosave ? 'true' : 'false' ),
238
  esc_attr( $this->object_type )
239
  );
347
  */
348
  public static function normalize( $meta_box ) {
349
  // Set default values for meta box.
350
+ $meta_box = wp_parse_args(
351
+ $meta_box,
352
+ array(
353
+ 'id' => sanitize_title( $meta_box['title'] ),
354
+ 'context' => 'normal',
355
+ 'priority' => 'high',
356
+ 'post_types' => 'post',
357
+ 'autosave' => false,
358
+ 'default_hidden' => false,
359
+ 'style' => 'default',
360
+ )
361
+ );
362
 
363
  /**
364
  * Use 'post_types' for better understanding and fallback to 'pages' for previous versions.
365
  *
366
  * @since 4.4.1
367
  */
368
+ rwmb_change_array_key( $meta_box, 'pages', 'post_types' );
 
 
369
 
370
  // Make sure the post type is an array and is sanitized.
371
+ $meta_box['post_types'] = array_map( 'sanitize_key', rwmb_csv_to_array( $meta_box['post_types'] ) );
372
 
373
  return $meta_box;
374
  }
412
  if ( empty( $field['id'] ) ) {
413
  continue;
414
  }
415
+
416
+ if ( method_exists( $field['storage'], 'exists' ) ) {
417
+ if ( $field['storage']->exists( $this->object_id, $field['id'] ) ) {
418
+ return true;
419
+ }
420
+ continue;
421
+ }
422
+
423
  $value = RWMB_Field::call( $field, 'raw_meta', $this->object_id );
424
  if ( false === $value ) {
425
  continue;
426
  }
427
+
428
  if (
429
  ( ! $field['multiple'] && '' !== $value )
430
+ || ( $field['multiple'] && is_array( $value ) && array() !== $value )
431
  ) {
432
  return true;
433
  }
inc/sanitizer.php CHANGED
@@ -32,9 +32,10 @@ class RWMB_Sanitizer {
32
  }
33
 
34
  // Custom callback.
35
- $types = array_diff( get_class_methods( __CLASS__ ), array( 'init' ) );
36
- foreach ( $types as $type ) {
37
- add_filter( "rwmb_{$type}_sanitize", array( $this, $type ) );
 
38
  }
39
  }
40
 
@@ -46,7 +47,18 @@ class RWMB_Sanitizer {
46
  * @param string $value Checkbox value.
47
  * @return int
48
  */
49
- public function checkbox( $value ) {
 
 
 
 
 
 
 
 
 
 
 
50
  return (int) ! empty( $value );
51
  }
52
  }
32
  }
33
 
34
  // Custom callback.
35
+ $methods = array_diff( get_class_methods( __CLASS__ ), array( 'init' ) );
36
+ foreach ( $methods as $method ) {
37
+ $type = substr( $method, 9 );
38
+ add_filter( "rwmb_{$type}_sanitize", array( $this, $method ) );
39
  }
40
  }
41
 
47
  * @param string $value Checkbox value.
48
  * @return int
49
  */
50
+ public function sanitize_checkbox( $value ) {
51
+ return (int) ! empty( $value );
52
+ }
53
+
54
+ /**
55
+ * Set the value of switch to 1 or 0 instead of 'checked' and empty string.
56
+ * This prevents using default value once the switch has been unchecked.
57
+ *
58
+ * @param string $value Switch value.
59
+ * @return int
60
+ */
61
+ public function sanitize_switch( $value ) {
62
  return (int) ! empty( $value );
63
  }
64
  }
inc/storages/base.php CHANGED
@@ -41,6 +41,19 @@ class RWMB_Base_Storage implements RWMB_Storage_Interface {
41
  return get_metadata( $this->object_type, $object_id, $meta_key, $single );
42
  }
43
 
 
 
 
 
 
 
 
 
 
 
 
 
 
44
  /**
45
  * Add metadata
46
  *
41
  return get_metadata( $this->object_type, $object_id, $meta_key, $single );
42
  }
43
 
44
+ /**
45
+ * Determine if a meta key is set for a given object
46
+ *
47
+ * @param int $object_id ID of the object metadata is for.
48
+ * @param string $meta_key Metadata key.
49
+ * @return bool True if exists.
50
+ *
51
+ * @see metadata_exists()
52
+ */
53
+ public function exists( $object_id, $meta_key ) {
54
+ return metadata_exists( $this->object_type, $object_id, $meta_key );
55
+ }
56
+
57
  /**
58
  * Add metadata
59
  *
inc/validation.php CHANGED
@@ -43,8 +43,12 @@ class RWMB_Validation {
43
  wp_enqueue_script( 'jquery-validation-additional-methods', RWMB_JS_URL . 'jquery-validation/additional-methods.min.js', array( 'jquery-validation' ), '1.15.0', true );
44
  wp_enqueue_script( 'rwmb-validate', RWMB_JS_URL . 'validate.js', array( 'jquery-validation', 'jquery-validation-additional-methods' ), RWMB_VER, true );
45
 
46
- RWMB_Field::localize_script( 'rwmb-validate', 'rwmbValidate', array(
47
- 'summaryMessage' => esc_html__( 'Please correct the errors highlighted below and try again.', 'meta-box' ),
48
- ) );
 
 
 
 
49
  }
50
  }
43
  wp_enqueue_script( 'jquery-validation-additional-methods', RWMB_JS_URL . 'jquery-validation/additional-methods.min.js', array( 'jquery-validation' ), '1.15.0', true );
44
  wp_enqueue_script( 'rwmb-validate', RWMB_JS_URL . 'validate.js', array( 'jquery-validation', 'jquery-validation-additional-methods' ), RWMB_VER, true );
45
 
46
+ RWMB_Field::localize_script(
47
+ 'rwmb-validate',
48
+ 'rwmbValidate',
49
+ array(
50
+ 'summaryMessage' => esc_html__( 'Please correct the errors highlighted below and try again.', 'meta-box' ),
51
+ )
52
+ );
53
  }
54
  }
inc/walkers/base.php CHANGED
@@ -11,35 +11,32 @@
11
  */
12
  abstract class RWMB_Walker_Base extends Walker {
13
  /**
14
- * Field data.
15
  *
16
- * @access public
17
  * @var array
18
  */
19
  public $field;
20
 
21
  /**
22
- * Meta data.
23
  *
24
- * @access public
25
  * @var array
26
  */
27
- public $meta = array();
28
 
29
  /**
30
  * Constructor.
31
  *
32
- * @param array $db_fields Database fields.
33
- * @param array $field Field parameters.
34
- * @param mixed $meta Meta value.
35
  */
36
- public function __construct( $db_fields, $field, $meta ) {
37
- $this->db_fields = wp_parse_args( (array) $db_fields, array(
38
- 'parent' => '',
39
- 'id' => '',
40
- 'label' => '',
41
- ) );
42
- $this->field = $field;
43
- $this->meta = (array) $meta;
44
  }
45
  }
11
  */
12
  abstract class RWMB_Walker_Base extends Walker {
13
  /**
14
+ * Field settings.
15
  *
 
16
  * @var array
17
  */
18
  public $field;
19
 
20
  /**
21
+ * Field meta data.
22
  *
 
23
  * @var array
24
  */
25
+ public $meta;
26
 
27
  /**
28
  * Constructor.
29
  *
30
+ * @param array $field Field parameters.
31
+ * @param mixed $meta Meta value.
 
32
  */
33
+ public function __construct( $field, $meta ) {
34
+ $this->db_fields = array(
35
+ 'id' => 'value',
36
+ 'parent' => 'parent',
37
+ );
38
+
39
+ $this->field = $field;
40
+ $this->meta = (array) $meta;
41
  }
42
  }
inc/walkers/input-list.php CHANGED
@@ -41,15 +41,13 @@ class RWMB_Walker_Input_List extends RWMB_Walker_Base {
41
  * @param int $current_object_id ID of the current item.
42
  */
43
  public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
44
- $label = $this->db_fields['label'];
45
- $id = $this->db_fields['id'];
46
- $attributes = RWMB_Field::call( 'get_attributes', $this->field, $object->$id );
47
 
48
  $output .= sprintf(
49
  '<li><label><input %s %s>%s</label>',
50
  RWMB_Field::render_attributes( $attributes ),
51
- checked( in_array( $object->$id, $this->meta ), 1, false ),
52
- RWMB_Field::filter( 'choice_label', $object->$label, $this->field, $object )
53
  );
54
  }
55
 
41
  * @param int $current_object_id ID of the current item.
42
  */
43
  public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
44
+ $attributes = RWMB_Field::call( 'get_attributes', $this->field, $object->value );
 
 
45
 
46
  $output .= sprintf(
47
  '<li><label><input %s %s>%s</label>',
48
  RWMB_Field::render_attributes( $attributes ),
49
+ checked( in_array( $object->value, $this->meta ), true, false ),
50
+ RWMB_Field::filter( 'choice_label', $object->label, $this->field, $object )
51
  );
52
  }
53
 
inc/walkers/select-tree.php CHANGED
@@ -10,7 +10,7 @@
10
  */
11
  class RWMB_Walker_Select_Tree {
12
  /**
13
- * Field data.
14
  *
15
  * @var string
16
  */
@@ -21,23 +21,17 @@ class RWMB_Walker_Select_Tree {
21
  *
22
  * @var array
23
  */
24
- public $meta = array();
25
 
26
  /**
27
  * Constructor.
28
  *
29
- * @param array $db_fields Database fields.
30
- * @param array $field Field parameters.
31
- * @param mixed $meta Meta value.
32
  */
33
- public function __construct( $db_fields, $field, $meta ) {
34
- $this->db_fields = wp_parse_args( (array) $db_fields, array(
35
- 'parent' => '',
36
- 'id' => '',
37
- 'label' => '',
38
- ) );
39
- $this->field = $field;
40
- $this->meta = (array) $meta;
41
  }
42
 
43
  /**
@@ -48,15 +42,14 @@ class RWMB_Walker_Select_Tree {
48
  * @return string
49
  */
50
  public function walk( $options ) {
51
- $parent = $this->db_fields['parent'];
52
  $children = array();
53
 
54
  foreach ( $options as $option ) {
55
- $index = isset( $option->$parent ) ? $option->$parent : 0;
56
- $children[ $index ][] = $option;
57
  }
58
 
59
- $top_level = isset( $children[0] ) ? 0 : $options[0]->$parent;
60
  return $this->display_level( $children, $top_level, true );
61
  }
62
 
@@ -70,25 +63,24 @@ class RWMB_Walker_Select_Tree {
70
  * @return string
71
  */
72
  public function display_level( $options, $parent_id = 0, $active = false ) {
73
- $id = $this->db_fields['id'];
74
  $field = $this->field;
75
- $walker = new RWMB_Walker_Select( $this->db_fields, $field, $this->meta );
76
  $attributes = RWMB_Field::call( 'get_attributes', $field, $this->meta );
77
 
78
  $children = $options[ $parent_id ];
79
  $output = sprintf(
80
  '<div class="rwmb-select-tree %s" data-parent-id="%s"><select %s>',
81
  $active ? '' : 'hidden',
82
- $parent_id,
83
  RWMB_Field::render_attributes( $attributes )
84
  );
85
- $output .= isset( $field['placeholder'] ) ? "<option value=''>{$field['placeholder']}</option>" : '<option></option>';
86
- $output .= $walker->walk( $children, - 1 );
87
- $output .= '</select>';
88
 
89
- foreach ( $children as $c ) {
90
- if ( isset( $options[ $c->$id ] ) ) {
91
- $output .= $this->display_level( $options, $c->$id, in_array( $c->$id, $this->meta ) && $active );
92
  }
93
  }
94
 
10
  */
11
  class RWMB_Walker_Select_Tree {
12
  /**
13
+ * Field settings.
14
  *
15
  * @var string
16
  */
21
  *
22
  * @var array
23
  */
24
+ public $meta;
25
 
26
  /**
27
  * Constructor.
28
  *
29
+ * @param array $field Field parameters.
30
+ * @param mixed $meta Meta value.
 
31
  */
32
+ public function __construct( $field, $meta ) {
33
+ $this->field = $field;
34
+ $this->meta = (array) $meta;
 
 
 
 
 
35
  }
36
 
37
  /**
42
  * @return string
43
  */
44
  public function walk( $options ) {
 
45
  $children = array();
46
 
47
  foreach ( $options as $option ) {
48
+ $parent = isset( $option->parent ) ? $option->parent : 0;
49
+ $children[ $parent ][] = $option;
50
  }
51
 
52
+ $top_level = isset( $children[0] ) ? 0 : $options[0]->parent;
53
  return $this->display_level( $children, $top_level, true );
54
  }
55
 
63
  * @return string
64
  */
65
  public function display_level( $options, $parent_id = 0, $active = false ) {
 
66
  $field = $this->field;
67
+ $walker = new RWMB_Walker_Select( $field, $this->meta );
68
  $attributes = RWMB_Field::call( 'get_attributes', $field, $this->meta );
69
 
70
  $children = $options[ $parent_id ];
71
  $output = sprintf(
72
  '<div class="rwmb-select-tree %s" data-parent-id="%s"><select %s>',
73
  $active ? '' : 'hidden',
74
+ esc_attr( $parent_id ),
75
  RWMB_Field::render_attributes( $attributes )
76
  );
77
+ $output .= $field['placeholder'] ? "<option value=''>{$field['placeholder']}</option>" : '<option></option>';
78
+ $output .= $walker->walk( $children, - 1 );
79
+ $output .= '</select>';
80
 
81
+ foreach ( $children as $child ) {
82
+ if ( isset( $options[ $child->value ] ) ) {
83
+ $output .= $this->display_level( $options, $child->value, in_array( $child->value, $this->meta ) && $active );
84
  }
85
  }
86
 
inc/walkers/select.php CHANGED
@@ -21,17 +21,15 @@ class RWMB_Walker_Select extends RWMB_Walker_Base {
21
  * @param int $current_object_id ID of the current item.
22
  */
23
  public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
24
- $label = $this->db_fields['label'];
25
- $id = $this->db_fields['id'];
26
  $meta = $this->meta;
27
  $indent = str_repeat( '&nbsp;', $depth * 4 );
28
 
29
  $output .= sprintf(
30
  '<option value="%s" %s>%s%s</option>',
31
- esc_attr( $object->$id ),
32
- selected( in_array( $object->$id, $meta ), true, false ),
33
  $indent,
34
- esc_html( RWMB_Field::filter( 'choice_label', $object->$label, $this->field, $object ) )
35
  );
36
  }
37
  }
21
  * @param int $current_object_id ID of the current item.
22
  */
23
  public function start_el( &$output, $object, $depth = 0, $args = array(), $current_object_id = 0 ) {
 
 
24
  $meta = $this->meta;
25
  $indent = str_repeat( '&nbsp;', $depth * 4 );
26
 
27
  $output .= sprintf(
28
  '<option value="%s" %s>%s%s</option>',
29
+ esc_attr( $object->value ),
30
+ selected( in_array( $object->value, $meta ), true, false ),
31
  $indent,
32
+ esc_html( RWMB_Field::filter( 'choice_label', $object->label, $this->field, $object ) )
33
  );
34
  }
35
  }
js/autosave.js CHANGED
@@ -2,7 +2,7 @@
2
  'use strict';
3
 
4
  $( document ).ajaxSend( function ( event, xhr, settings ) {
5
- if ( typeof settings.data === 'undefined' || -1 === settings.data.indexOf( 'wp_autosave' ) ) {
6
  return;
7
  }
8
  var inputSelectors = 'input[class*="rwmb"], textarea[class*="rwmb"], select[class*="rwmb"], button[class*="rwmb"], input[name^="nonce_"]';
2
  'use strict';
3
 
4
  $( document ).ajaxSend( function ( event, xhr, settings ) {
5
+ if ( ! Array.isArray( settings.data ) || -1 === settings.data.indexOf( 'wp_autosave' ) ) {
6
  return;
7
  }
8
  var inputSelectors = 'input[class*="rwmb"], textarea[class*="rwmb"], select[class*="rwmb"], button[class*="rwmb"], input[name^="nonce_"]';
js/input-list.js CHANGED
@@ -14,16 +14,16 @@ jQuery( function ( $ ) {
14
  }
15
 
16
  $( '.rwmb-input' )
17
- .on( 'change', '.rwmb-input-list.collapse :checkbox', update )
18
- .on( 'clone', '.rwmb-input-list.collapse :checkbox', update );
19
- $( '.rwmb-input-list.collapse :checkbox' ).each( update );
20
 
21
  $( '.rwmb-input-list-select-all-none' ).toggle(
22
  function () {
23
- $('input[name="' + $(this).data('name') + '[]"]').prop('checked', true);
24
  },
25
  function () {
26
- $('input[name="' + $(this).data('name') + '[]"]').prop('checked', false);
27
  }
28
  );
29
  } );
14
  }
15
 
16
  $( '.rwmb-input' )
17
+ .on( 'change', '.rwmb-input-list.rwmb-collapse input[type="checkbox"]', update )
18
+ .on( 'clone', '.rwmb-input-list.rwmb-collapse input[type="checkbox"]', update );
19
+ $( '.rwmb-input-list.rwmb-collapse input[type="checkbox"]' ).each( update );
20
 
21
  $( '.rwmb-input-list-select-all-none' ).toggle(
22
  function () {
23
+ $( this ).parent().siblings( '.rwmb-input-list' ).find( 'input' ).prop( 'checked', true );
24
  },
25
  function () {
26
+ $( this ).parent().siblings( '.rwmb-input-list' ).find( 'input' ).prop( 'checked', false );
27
  }
28
  );
29
  } );
js/map.js CHANGED
@@ -63,8 +63,7 @@
63
 
64
  this.map.setCenter( this.marker.position );
65
  this.map.setZoom( zoom );
66
- }
67
- else if ( this.addressField ) {
68
  this.geocodeAddress();
69
  }
70
  },
@@ -92,7 +91,7 @@
92
 
93
  /**
94
  * Add a custom event that allows other scripts to refresh the maps when needed
95
- * For example: when maps is in tabs or hidden div (this is known issue of Google Maps)
96
  *
97
  * @see https://developers.google.com/maps/documentation/javascript/reference ('resize' Event)
98
  */
@@ -111,32 +110,26 @@
111
  },
112
 
113
  refresh: function () {
 
 
 
114
  var zoom = this.map.getZoom(),
115
  center = this.map.getCenter();
116
 
117
- if ( this.map ) {
118
- google.maps.event.trigger( this.map, 'resize' );
119
- this.map.setZoom( zoom );
120
- this.map.setCenter( center );
121
- }
122
  },
123
 
124
  // Autocomplete address
125
  autocomplete: function () {
126
- var that = this;
 
127
 
128
- // No address field or more than 1 address fields, ignore
129
- if ( ! this.addressField || this.addressField.split( ',' ).length > 1 ) {
130
  return;
131
  }
132
 
133
- var $address = $( 'input[name="' + this.addressField + '"]');
134
-
135
- // If map and address is inside a group, the input name of address field is changed.
136
- if ( 0 === $address.length ) {
137
- $address = this.$container.closest( '.rwmb-group-wrapper' ).find( 'input[name*="[' + this.addressField + ']"]' );
138
- }
139
-
140
  // If Meta Box Geo Location installed. Do not run auto complete.
141
  if ( $( '.rwmb-geo-binding' ).length ) {
142
  $address.on( 'selected_address', function () {
@@ -153,7 +146,14 @@
153
  'region': that.$canvas.data( 'region' )
154
  };
155
  geocoder.geocode( options, function ( results ) {
156
- response( $.map( results, function ( item ) {
 
 
 
 
 
 
 
157
  return {
158
  label: item.formatted_address,
159
  value: item.formatted_address,
@@ -165,7 +165,6 @@
165
  },
166
  select: function ( event, ui ) {
167
  var latLng = new google.maps.LatLng( ui.item.latitude, ui.item.longitude );
168
-
169
  that.map.setCenter( latLng );
170
  that.marker.setPosition( latLng );
171
  that.updateCoordinate( latLng );
@@ -181,18 +180,8 @@
181
 
182
  // Find coordinates by address
183
  geocodeAddress: function () {
184
- var address,
185
- addressList = [],
186
- fieldList = this.addressField.split( ',' ),
187
- loop,
188
  that = this;
189
-
190
- for ( loop = 0; loop < fieldList.length; loop ++ ) {
191
- addressList[loop] = $( '#' + fieldList[loop] ).val();
192
- }
193
-
194
- address = addressList.join( ',' ).replace( /\n/g, ',' ).replace( /,,/g, ',' );
195
-
196
  if ( ! address ) {
197
  return;
198
  }
@@ -205,6 +194,50 @@
205
  that.marker.setPosition( results[0].geometry.location );
206
  that.updateCoordinate( results[0].geometry.location );
207
  } );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
  }
209
  };
210
 
@@ -216,7 +249,7 @@
216
  return;
217
  }
218
 
219
- controller = new MapField( $( this ) );
220
  controller.init();
221
  $this.data( 'mapController', controller );
222
  } );
63
 
64
  this.map.setCenter( this.marker.position );
65
  this.map.setZoom( zoom );
66
+ } else if ( this.addressField ) {
 
67
  this.geocodeAddress();
68
  }
69
  },
91
 
92
  /**
93
  * Add a custom event that allows other scripts to refresh the maps when needed
94
+ * For example: when maps is in tabs or hidden div.
95
  *
96
  * @see https://developers.google.com/maps/documentation/javascript/reference ('resize' Event)
97
  */
110
  },
111
 
112
  refresh: function () {
113
+ if ( ! this.map ) {
114
+ return;
115
+ }
116
  var zoom = this.map.getZoom(),
117
  center = this.map.getCenter();
118
 
119
+ google.maps.event.trigger( this.map, 'resize' );
120
+ this.map.setZoom( zoom );
121
+ this.map.panTo( center );
 
 
122
  },
123
 
124
  // Autocomplete address
125
  autocomplete: function () {
126
+ var that = this,
127
+ $address = this.getAddressField();
128
 
129
+ if ( null === $address ) {
 
130
  return;
131
  }
132
 
 
 
 
 
 
 
 
133
  // If Meta Box Geo Location installed. Do not run auto complete.
134
  if ( $( '.rwmb-geo-binding' ).length ) {
135
  $address.on( 'selected_address', function () {
146
  'region': that.$canvas.data( 'region' )
147
  };
148
  geocoder.geocode( options, function ( results ) {
149
+ if ( ! results.length ) {
150
+ response( [ {
151
+ value: '',
152
+ label: RWMB_Map.no_results_string
153
+ } ] );
154
+ return;
155
+ }
156
+ response( results.map( function ( item ) {
157
  return {
158
  label: item.formatted_address,
159
  value: item.formatted_address,
165
  },
166
  select: function ( event, ui ) {
167
  var latLng = new google.maps.LatLng( ui.item.latitude, ui.item.longitude );
 
168
  that.map.setCenter( latLng );
169
  that.marker.setPosition( latLng );
170
  that.updateCoordinate( latLng );
180
 
181
  // Find coordinates by address
182
  geocodeAddress: function () {
183
+ var address = this.getAddress(),
 
 
 
184
  that = this;
 
 
 
 
 
 
 
185
  if ( ! address ) {
186
  return;
187
  }
194
  that.marker.setPosition( results[0].geometry.location );
195
  that.updateCoordinate( results[0].geometry.location );
196
  } );
197
+ },
198
+
199
+ // Get the address field.
200
+ getAddressField: function() {
201
+ // No address field or more than 1 address fields, ignore
202
+ if ( ! this.addressField || this.addressField.split( ',' ).length > 1 ) {
203
+ return null;
204
+ }
205
+ return this.findAddressField( this.addressField );
206
+ },
207
+
208
+ // Get the address value for geocoding.
209
+ getAddress: function() {
210
+ var that = this;
211
+
212
+ return this.addressField.split( ',' )
213
+ .map( function( part ) {
214
+ part = that.findAddressField( part );
215
+ return null === part ? '' : part.val();
216
+ } )
217
+ .join( ',' ).replace( /\n/g, ',' ).replace( /,,/g, ',' );
218
+ },
219
+
220
+ // Find address field based on its name attribute. Auto search inside groups when needed.
221
+ findAddressField: function( fieldName ) {
222
+ // Not in a group.
223
+ var $address = $( 'input[name="' + fieldName + '"]');
224
+ if ( $address.length ) {
225
+ return $address;
226
+ }
227
+
228
+ // If map and address is inside a cloneable group.
229
+ $address = this.$container.closest( '.rwmb-group-clone' ).find( 'input[name*="[' + fieldName + ']"]' );
230
+ if ( $address.length ) {
231
+ return $address;
232
+ }
233
+
234
+ // If map and address is inside a non-cloneable group.
235
+ $address = this.$container.closest( '.rwmb-group-wrapper' ).find( 'input[name*="[' + fieldName + ']"]' );
236
+ if ( $address.length ) {
237
+ return $address;
238
+ }
239
+
240
+ return null;
241
  }
242
  };
243
 
249
  return;
250
  }
251
 
252
+ controller = new MapField( $this );
253
  controller.init();
254
  $this.data( 'mapController', controller );
255
  } );
js/media.js CHANGED
@@ -256,9 +256,9 @@ jQuery( function ( $ ) {
256
  this.collection.remove( item );
257
  },
258
 
259
- resetItemViews: function( items, options ){
260
  var that = this;
261
- _.each( options.previousModels, function( item ){
262
  that.removeItemView( item );
263
  } );
264
  items.each( function( item ) {
256
  this.collection.remove( item );
257
  },
258
 
259
+ resetItemViews: function( items ){
260
  var that = this;
261
+ _.each( that.models, function( item ){
262
  that.removeItemView( item );
263
  } );
264
  items.each( function( item ) {
js/oembed.js CHANGED
@@ -11,7 +11,8 @@ jQuery( function ( $ ) {
11
  $spinner = $this.siblings( '.spinner' ),
12
  data = {
13
  action: 'rwmb_get_embed',
14
- url: $this.val()
 
15
  };
16
 
17
  $spinner.css( 'visibility', 'visible' );
11
  $spinner = $this.siblings( '.spinner' ),
12
  data = {
13
  action: 'rwmb_get_embed',
14
+ url: this.value,
15
+ not_available: $this.data( 'not-available' ),
16
  };
17
 
18
  $spinner.css( 'visibility', 'visible' );
js/osm-frontend.js ADDED
@@ -0,0 +1,50 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ jQuery( function( $ ) {
2
+ 'use strict';
3
+
4
+ var osmTileLayer = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
5
+ attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
6
+ } );
7
+
8
+ /**
9
+ * Display Open Street Map
10
+ */
11
+ function displayMap() {
12
+ var options = $( this ).data( 'osm_options' ),
13
+ mapOptions = options.js_options,
14
+ center = L.latLng( options.latitude, options.longitude ),
15
+ map;
16
+
17
+ mapOptions.center = center;
18
+
19
+ // Typcast zoom to a number
20
+ mapOptions.zoom *= 1;
21
+
22
+ map = L.map( this, mapOptions );
23
+ map.addLayer( osmTileLayer );
24
+
25
+ // Set marker
26
+ if ( options.marker ) {
27
+ var markerOptions = {};
28
+
29
+ // Set marker title
30
+ if ( options.marker_title ) {
31
+ markerOptions.title = options.marker_title;
32
+ }
33
+
34
+ // Set marker icon
35
+ if ( options.marker_icon ) {
36
+ markerOptions.icon = L.icon( options.marker_icon );
37
+ }
38
+
39
+ var marker = L.marker( center, markerOptions ).addTo( map )
40
+ }
41
+
42
+ // Set info window
43
+ if ( options.info_window ) {
44
+ marker.bindPopup( options.info_window ).openPopup();
45
+ }
46
+ }
47
+
48
+ // Loop through all map instances and display them
49
+ $( '.rwmb-osm-canvas' ).each( displayMap );
50
+ } );
js/osm.js ADDED
@@ -0,0 +1,266 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ( function( $, L ) {
2
+ 'use strict';
3
+
4
+ var osmTileLayer = L.tileLayer( 'https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
5
+ attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors'
6
+ } );
7
+
8
+ // Use function construction to store map & DOM elements separately for each instance
9
+ var OsmField = function ( $container ) {
10
+ this.$container = $container;
11
+ };
12
+
13
+ // Use prototype for better performance
14
+ OsmField.prototype = {
15
+ // Initialize everything
16
+ init: function () {
17
+ this.initDomElements();
18
+ this.initMapElements();
19
+
20
+ this.initMarkerPosition();
21
+ this.addListeners();
22
+ this.autocomplete();
23
+ },
24
+
25
+ // Initialize DOM elements
26
+ initDomElements: function () {
27
+ this.$canvas = this.$container.find( '.rwmb-osm-canvas' );
28
+ this.canvas = this.$canvas[0];
29
+ this.$coordinate = this.$container.find( '.rwmb-osm-coordinate' );
30
+ this.$findButton = this.$container.find( '.rwmb-osm-goto-address-button' );
31
+ this.addressField = this.$container.data( 'address-field' );
32
+ },
33
+
34
+ // Initialize map elements
35
+ initMapElements: function () {
36
+ var defaultLoc = this.$canvas.data( 'default-loc' ),
37
+ latLng;
38
+
39
+ defaultLoc = defaultLoc ? defaultLoc.split( ',' ) : [53.346881, -6.258860];
40
+ latLng = L.latLng( defaultLoc[0], defaultLoc[1] ); // Initial position for map.
41
+
42
+ this.map = L.map( this.canvas, {
43
+ center: latLng,
44
+ zoom: 14
45
+ } );
46
+ this.map.addLayer( osmTileLayer );
47
+ this.marker = L.marker( latLng, {
48
+ draggable: true
49
+ } ).addTo( this.map );
50
+ },
51
+
52
+ // Initialize marker position
53
+ initMarkerPosition: function () {
54
+ var coordinate = this.$coordinate.val(),
55
+ location,
56
+ zoom;
57
+
58
+ if ( coordinate ) {
59
+ location = coordinate.split( ',' );
60
+ var latLng = L.latLng( location[0], location[1] );
61
+ this.marker.setLatLng( latLng );
62
+
63
+ zoom = location.length > 2 ? parseInt( location[2], 10 ) : 14;
64
+
65
+ this.map.panTo( latLng );
66
+ this.map.setZoom( zoom );
67
+ } else if ( this.addressField ) {
68
+ this.geocodeAddress();
69
+ }
70
+ },
71
+
72
+ // Add event listeners for 'click' & 'drag'
73
+ addListeners: function () {
74
+ var that = this;
75
+ this.map.on( 'click', function ( event ) {
76
+ that.marker.setLatLng( event.latlng );
77
+ that.updateCoordinate( event.latlng );
78
+ } );
79
+
80
+ this.map.on( 'zoom', function () {
81
+ that.updateCoordinate( that.marker.getLatLng() );
82
+ } );
83
+
84
+ this.marker.on( 'drag', function () {
85
+ that.updateCoordinate( that.marker.getLatLng() );
86
+ } );
87
+
88
+ this.$findButton.on( 'click', function ( e ) {
89
+ e.preventDefault();
90
+ that.geocodeAddress();
91
+ } );
92
+
93
+ /**
94
+ * Add a custom event that allows other scripts to refresh the maps when needed
95
+ * For example: when maps is in tabs or hidden div (this is known issue of Google Maps)
96
+ *
97
+ * @see https://developers.google.com/maps/documentation/javascript/reference ('resize' Event)
98
+ */
99
+ $( window ).on( 'rwmb_map_refresh', function () {
100
+ that.refresh();
101
+ } );
102
+
103
+ // Refresh on meta box hide and show
104
+ $( document ).on( 'postbox-toggled', function () {
105
+ that.refresh();
106
+ } );
107
+ // Refresh on sorting meta boxes
108
+ $( '.meta-box-sortables' ).on( 'sortstop', function () {
109
+ that.refresh();
110
+ } );
111
+ },
112
+
113
+ refresh: function () {
114
+ if ( ! this.map ) {
115
+ return;
116
+ }
117
+ this.map.invalidateSize();
118
+ this.map.panTo( this.map.getCenter() );
119
+ },
120
+
121
+ // Autocomplete address
122
+ autocomplete: function () {
123
+ var that = this,
124
+ $address = this.getAddressField();
125
+
126
+ if ( null === $address ) {
127
+ return;
128
+ }
129
+
130
+ // If Meta Box Geo Location installed. Do not run auto complete.
131
+ if ( $( '.rwmb-geo-binding' ).length ) {
132
+ $address.on( 'selected_address', that.geocodeAddress );
133
+ return;
134
+ }
135
+
136
+ $address.autocomplete( {
137
+ source: function ( request, response ) {
138
+ $.get( 'https://nominatim.openstreetmap.org/search', {
139
+ format: 'json',
140
+ q: request.term,
141
+ countrycodes: that.$canvas.data( 'region' ),
142
+ "accept-language": that.$canvas.data( 'language' )
143
+ }, function( results ) {
144
+ if ( ! results.length ) {
145
+ response( [ {
146
+ value: '',
147
+ label: RWMB_Osm.no_results_string
148
+ } ] );
149
+ return;
150
+ }
151
+ response( results.map( function ( item ) {
152
+ return {
153
+ label: item.display_name,
154
+ value: item.display_name,
155
+ latitude: item.lat,
156
+ longitude: item.lon
157
+ };
158
+ } ) );
159
+ }, 'json' );
160
+ },
161
+ select: function ( event, ui ) {
162
+ var latLng = L.latLng( ui.item.latitude, ui.item.longitude );
163
+
164
+ that.map.panTo( latLng );
165
+ that.marker.setLatLng( latLng );
166
+ that.updateCoordinate( latLng );
167
+ }
168
+ } );
169
+ },
170
+
171
+ // Update coordinate to input field
172
+ updateCoordinate: function ( latLng ) {
173
+ var zoom = this.map.getZoom();
174
+ this.$coordinate.val( latLng.lat + ',' + latLng.lng + ',' + zoom );
175
+ },
176
+
177
+ // Find coordinates by address
178
+ geocodeAddress: function () {
179
+ var address = this.getAddress(),
180
+ that = this;
181
+ if ( ! address ) {
182
+ return;
183
+ }
184
+
185
+ $.get( 'https://nominatim.openstreetmap.org/search', {
186
+ format: 'json',
187
+ q: address,
188
+ limit: 1,
189
+ countrycodes: that.$canvas.data( 'region' ),
190
+ "accept-language": that.$canvas.data( 'language' )
191
+ }, function( result ) {
192
+ if ( result.length !== 1 ) {
193
+ return;
194
+ }
195
+ var latLng = L.latLng( result[0].lat, result[0].lon );
196
+ that.map.panTo( latLng );
197
+ that.marker.setLatLng( latLng );
198
+ that.updateCoordinate( latLng );
199
+ }, 'json' );
200
+ },
201
+
202
+ // Get the address field.
203
+ getAddressField: function() {
204
+ // No address field or more than 1 address fields, ignore
205
+ if ( ! this.addressField || this.addressField.split( ',' ).length > 1 ) {
206
+ return null;
207
+ }
208
+ return this.findAddressField( this.addressField );
209
+ },
210
+
211
+ // Get the address value for geocoding.
212
+ getAddress: function() {
213
+ var that = this;
214
+
215
+ return this.addressField.split( ',' )
216
+ .map( function( part ) {
217
+ part = that.findAddressField( part );
218
+ return null === part ? '' : part.val();
219
+ } )
220
+ .join( ',' ).replace( /\n/g, ',' ).replace( /,,/g, ',' );
221
+ },
222
+
223
+ // Find address field based on its name attribute. Auto search inside groups when needed.
224
+ findAddressField: function( fieldName ) {
225
+ // Not in a group.
226
+ var $address = $( 'input[name="' + fieldName + '"]');
227
+ if ( $address.length ) {
228
+ return $address;
229
+ }
230
+
231
+ // If map and address is inside a cloneable group.
232
+ $address = this.$container.closest( '.rwmb-group-clone' ).find( 'input[name*="[' + fieldName + ']"]' );
233
+ if ( $address.length ) {
234
+ return $address;
235
+ }
236
+
237
+ // If map and address is inside a non-cloneable group.
238
+ $address = this.$container.closest( '.rwmb-group-wrapper' ).find( 'input[name*="[' + fieldName + ']"]' );
239
+ if ( $address.length ) {
240
+ return $address;
241
+ }
242
+
243
+ return null;
244
+ }
245
+ };
246
+
247
+ function update() {
248
+ $( '.rwmb-osm-field' ).each( function () {
249
+ var $this = $( this ),
250
+ controller = $this.data( 'osmController' );
251
+ if ( controller ) {
252
+ return;
253
+ }
254
+
255
+ controller = new OsmField( $this );
256
+ controller.init();
257
+ $this.data( 'osmController', controller );
258
+ } );
259
+ }
260
+
261
+ $( function () {
262
+ update();
263
+ $( '.rwmb-input' ).on( 'clone', update );
264
+ } );
265
+
266
+ } )( jQuery, L );
js/script.js DELETED
@@ -1,4 +0,0 @@
1
- jQuery( function ( $ ) {
2
- // Add class for seamless meta boxes.
3
- $( '.rwmb-meta-box--seamless' ).closest( '.postbox' ).addClass( 'rwmb-seamless' );
4
- } );
 
 
 
 
js/select2/i18n/af.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/af",[],function(){return{errorLoading:function(){return"Die resultate kon nie gelaai word nie."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Verwyders asseblief "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Voer asseblief "+t+" of meer karakters";return n},loadingMore:function(){return"Meer resultate word gelaai…"},maximumSelected:function(e){var t="Kies asseblief net "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"Geen resultate gevind"},searching:function(){return"Besig…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/ar.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="الرجاء حذف "+t+" عناصر";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="الرجاء إضافة "+t+" عناصر";return n},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){var t="تستطيع إختيار "+e.maximum+" بنود فقط";return t},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum;return"الرجاء حذف "+t+" عناصر"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"الرجاء إضافة "+t+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){return"تستطيع إختيار "+e.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/az.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/bg.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/bs.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bs",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspijelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/ca.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/cs.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadejte o jeden znak méně.":n<=4?"Prosím, zadejte o "+e(n,!0)+" znaky méně.":"Prosím, zadejte o "+n+" znaků méně."},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadejte ještě jeden znak.":n<=4?"Prosím, zadejte ještě další "+e(n,!0)+" znaky.":"Prosím, zadejte ještě dalších "+n+" znaků."},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku.":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky.":"Můžete zvolit maximálně "+n+" položek."},noResults:function(){return"Nenalezeny žádné položky."},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/da.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Angiv venligst "+t+" tegn mindre";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Angiv venligst "+t+" tegn mere";return n},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Angiv venligst "+t+" tegn mindre"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Angiv venligst "+t+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/de.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/dsb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/dsb",[],function(){var e=["znamuško","znamušce","znamuška","znamuškow"],t=["zapisk","zapiska","zapiski","zapiskow"],n=function(t,n){if(t===1)return n[0];if(t===2)return n[1];if(t>2&&t<=4)return n[2];if(t>=5)return n[3]};return{errorLoading:function(){return"Wuslědki njejsu se dali zacytaś."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Pšosym lašuj "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Pšosym zapódaj nanejmjenjej "+r+" "+n(r,e)},loadingMore:function(){return"Dalšne wuslědki se zacytaju…"},maximumSelected:function(e){return"Móžoš jano "+e.maximum+" "+n(e.maximum,t)+"wubraś."},noResults:function(){return"Žedne wuslědki namakane"},searching:function(){return"Pyta se…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/el.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/en.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/es.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"No se pudieron cargar los resultados"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/et.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/eu.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/fa.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها می‌توانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجه‌ای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
js/select2/i18n/fi.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/fr.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Supprimez "+t+" caractère"+(t>1)?"s":""},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Saisissez au moins "+t+" caractère"+(t>1)?"s":""},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){return"Vous pouvez seulement sélectionner "+e.maximum+" élément"+(e.maximum>1)?"s":""},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/gl.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Elimine ";return t===1?n+="un carácter":n+=t+" caracteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Engada ";return t===1?n+="un carácter":n+=t+" caracteres",n},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){var t="Só pode ";return e.maximum===1?t+="un elemento":t+=e.maximum+" elementos",t},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var t=e.input.length-e.maximum;return t===1?"Elimine un carácter":"Elimine "+t+" caracteres"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t===1?"Engada un carácter":"Engada "+t+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return e.maximum===1?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/he.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/hi.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
js/select2/i18n/hr.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/hsb.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hsb",[],function(){var e=["znamješko","znamješce","znamješka","znamješkow"],t=["zapisk","zapiskaj","zapiski","zapiskow"],n=function(t,n){if(t===1)return n[0];if(t===2)return n[1];if(t>2&&t<=4)return n[2];if(t>=5)return n[3]};return{errorLoading:function(){return"Wuslědki njedachu so začitać."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Prošu zhašej "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Prošu zapodaj znajmjeńša "+r+" "+n(r,e)},loadingMore:function(){return"Dalše wuslědki so začitaja…"},maximumSelected:function(e){return"Móžeš jenož "+e.maximum+" "+n(e.maximum,t)+"wubrać"},noResults:function(){return"Žane wuslědki namakane"},searching:function(){return"Pyta so…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/hu.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/hy.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Խնդրում ենք հեռացնել "+t+" նշան";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Խնդրում ենք մուտքագրել "+t+" կամ ավել նշաններ";return n},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(e){var t="Դուք կարող եք ընտրել առավելագույնը "+e.maximum+" կետ";return t},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/id.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/is.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/it.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/ja.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/km.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();
js/select2/i18n/ko.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/lt.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%100>9&&e%100<21||e%10===0?e%10>1?n:r:t}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"","ius","į"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"","ius","į"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ų","us","ą"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius",""),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius",""),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/lv.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/mk.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/ms.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/nb.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=" flere tegn":n+=" tegn til",n},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn "+t+" tegn til";return n+" tegn til"},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/nl.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/pl.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/ps.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ps",[],function(){return{errorLoading:function(){return"پايلي نه سي ترلاسه کېدای"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="د مهربانۍ لمخي "+t+" توری ړنګ کړئ";return t!=1&&(n=n.replace("توری","توري")),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لږ تر لږه "+t+" يا ډېر توري وليکئ";return n},loadingMore:function(){return"نوري پايلي ترلاسه کيږي..."},maximumSelected:function(e){var t="تاسو يوازي "+e.maximum+" قلم په نښه کولای سی";return e.maximum!=1&&(t=t.replace("قلم","قلمونه")),t},noResults:function(){return"پايلي و نه موندل سوې"},searching:function(){return"لټول کيږي..."}}}),{define:e.define,require:e.require}})();
js/select2/i18n/pt-BR.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/pt.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"carácter",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"caractere",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/ro.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+"sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+" sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/ru.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/sk.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{errorLoading:function(){return"Výsledky sa nepodarilo načítať."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Načítanie ďalších výsledkov…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/sl.js ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
+
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Prosim zbrišite "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Prosim vpišite še "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var t="Označite lahko največ "+e.maximum+" predmet";return e.maximum==2?t+="a":e.maximum!=1&&(t+="e"),t},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/sr-Cyrl.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/sr.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/sv.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/th.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/tr.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/uk.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/vi.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
- (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+' ký tự"';return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
+ (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+" ký tự";return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/zh-CN.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
js/select2/i18n/zh-TW.js CHANGED
@@ -1,3 +1,3 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
1
+ /*! Select2 4.0.5 | https://github.com/select2/select2/blob/master/LICENSE.md */
2
 
3
  (function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
js/select2/select2.min.js CHANGED
@@ -1,2 +1 @@
1
- /*! Select2 4.0.2 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.slice(0,n.length-1).concat(a),k=0;k<a.length;k+=1)if(m=a[k],"."===m)a.splice(k,1),k-=1;else if(".."===m){if(1===k&&(".."===a[2]||".."===a[0]))break;k>0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}else 0===a.indexOf("./")&&(a=a.substring(2));if((n||p)&&o){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),n)for(l=n.length;l>0;l-=1)if(e=o[n.slice(0,l).join("/")],e&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&p&&p[d]&&(i=p[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=v.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),n.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){q[a]=b}}function j(a){if(e(r,a)){var c=r[a];delete r[a],t[a]=!0,m.apply(b,c)}if(!e(q,a)&&!e(t,a))throw new Error("No "+a);return q[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return function(){return s&&s.config&&s.config[a]||{}}}var m,n,o,p,q={},r={},s={},t={},u=Object.prototype.hasOwnProperty,v=[].slice,w=/\.js$/;o=function(a,b){var c,d=k(a),e=d[0];return a=d[1],e&&(e=f(e,b),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(b)):f(a,b):(a=f(a,b),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},p={require:function(a){return g(a)},exports:function(a){var b=q[a];return"undefined"!=typeof b?b:q[a]={}},module:function(a){return{id:a,uri:"",exports:q[a],config:l(a)}}},m=function(a,c,d,f){var h,k,l,m,n,s,u=[],v=typeof d;if(f=f||a,"undefined"===v||"function"===v){for(c=!c.length&&d.length?["require","exports","module"]:c,n=0;n<c.length;n+=1)if(m=o(c[n],f),k=m.f,"require"===k)u[n]=p.require(a);else if("exports"===k)u[n]=p.exports(a),s=!0;else if("module"===k)h=u[n]=p.module(a);else if(e(q,k)||e(r,k)||e(t,k))u[n]=j(k);else{if(!m.p)throw new Error(a+" missing "+k);m.p.load(m.n,g(f,!0),i(k),{}),u[n]=q[k]}l=d?d.apply(q[a],u):void 0,a&&(h&&h.exports!==b&&h.exports!==q[a]?q[a]=h.exports:l===b&&s||(q[a]=l))}else a&&(q[a]=d)},a=c=n=function(a,c,d,e,f){if("string"==typeof a)return p[a]?p[a](c):j(o(a,c).f);if(!a.splice){if(s=a,s.deps&&n(s.deps,s.callback),!c)return;c.splice?(a=c,c=d,d=null):a=b}return c=c||function(){},"function"==typeof d&&(d=e,e=f),e?m(b,a,c,d):setTimeout(function(){m(b,a,c,d)},4),n},n.config=function(a){return n(a)},a._defined=q,d=function(a,b,c){if("string"!=typeof a)throw new Error("See almond README: incorrect module build, no module name");b.splice||(c=b,b=[]),e(q,a)||e(r,a)||(r[a]=[a,b,c])},d.amd={jQuery:!0}}(),b.requirejs=a,b.require=c,b.define=d}}(),b.define("almond",function(){}),b.define("jquery",[],function(){var b=a||$;return null==b&&console&&console.error&&console.error("Select2: An instance of jQuery or a jQuery-compatible library was not found. Make sure that you are including jQuery before Select2 on your web page."),b}),b.define("select2/utils",["jquery"],function(a){function b(a){var b=a.prototype,c=[];for(var d in b){var e=b[d];"function"==typeof e&&"constructor"!==d&&c.push(d)}return c}var c={};c.Extend=function(a,b){function c(){this.constructor=a}var d={}.hasOwnProperty;for(var e in b)d.call(b,e)&&(a[e]=b[e]);return c.prototype=b.prototype,a.prototype=new c,a.__super__=b.prototype,a},c.Decorate=function(a,c){function d(){var b=Array.prototype.unshift,d=c.prototype.constructor.length,e=a.prototype.constructor;d>0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h<g.length;h++){var i=g[h];d.prototype[i]=a.prototype[i]}for(var j=(function(a){var b=function(){};a in d.prototype&&(b=d.prototype[a]);var e=c.prototype[a];return function(){var a=Array.prototype.unshift;return a.call(arguments,b),e.apply(this,arguments)}}),k=0;k<f.length;k++){var l=f[k];d.prototype[l]=j(l)}return d};var d=function(){this.listeners={}};return d.prototype.on=function(a,b){this.listeners=this.listeners||{},a in this.listeners?this.listeners[a].push(b):this.listeners[a]=[b]},d.prototype.trigger=function(a){var b=Array.prototype.slice;this.listeners=this.listeners||{},a in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},d.prototype.invoke=function(a,b){for(var c=0,d=a.length;d>c;c++)a[c].apply(this,b)},c.Observable=d,c.generateChars=function(a){for(var b="",c=0;a>c;c++){var d=Math.floor(36*Math.random());b+=d.toString(36)}return b},c.bind=function(a,b){return function(){a.apply(b,arguments)}},c._convertData=function(a){for(var b in a){var c=b.split("-"),d=a;if(1!==c.length){for(var e=0;e<c.length;e++){var f=c[e];f=f.substring(0,1).toLowerCase()+f.substring(1),f in d||(d[f]={}),e==c.length-1&&(d[f]=a[b]),d=d[f]}delete a[b]}}return a},c.hasScroll=function(b,c){var d=a(c),e=c.style.overflowX,f=c.style.overflowY;return e!==f||"hidden"!==f&&"visible"!==f?"scroll"===e||"scroll"===f?!0:d.innerHeight()<c.scrollHeight||d.innerWidth()<c.scrollWidth:!1},c.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){var c=b.find(".select2-results");c.append(a)},c.prototype.sort=function(a){var b=this.options.get("sorter");return b(a)},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()}),e=b.$results.find(".select2-results__option[aria-selected]");e.each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("aria-selected","true"):b.attr("aria-selected","false")});var f=e.filter("[aria-selected=true]");f.length>0?f.first().trigger("mouseenter"):e.first().trigger("mouseenter")})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{"class":"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&d.setClasses()}),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()}),b.on("unselect",function(){b.isOpen()&&d.setClasses()}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):0>h-g&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");return"true"===c.attr("aria-selected")?void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{})):void d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){var a=this.$results.find(".select2-results__option--highlighted");return a},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),2>=c?this.$results.scrollTop(0):(g>this.$results.outerHeight()||0>g)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){var a={BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46};return a}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a('<span class="select2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id+"-container",a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2"),e=a(".select2.select2-container--open");e.each(function(){var b=a(this);if(this!=d[0]){var c=b.data("element");c.select2("close")}})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){var c=b.find(".selection");c.append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},e.prototype.selectionContainer=function(){return a("<span></span>")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection"),d=this.options.get("escapeMarkup");return d(c(a,b))},d.prototype.selectionContainer=function(){var b=a('<li class="select2-selection__choice"><span class="select2-selection__choice__remove" role="presentation">&times;</span></li>');return b},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id,d=b.length>1;if(d||c)return a.call(this,b);this.clear();var e=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(e)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e<d.length;e++){var f={data:d[e]};if(this.trigger("unselect",f),f.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},c.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||(c.which==b.DELETE||c.which==b.BACKSPACE)&&this._handleClear(c)},c.prototype.update=function(b,c){if(b.call(this,c),!(this.$selection.find(".select2-selection__placeholder").length>0||0===c.length)){var d=a('<span class="select2-selection__clear">&times;</span>');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a('<li class="select2-search select2-search--inline"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented();var b=a.which;if(b===c.BACKSPACE&&""===e.$search.val()){var d=e.$searchContainer.prev(".select2-selection__choice");if(d.length>0){var f=d.data("data");e.searchRemoveChoice(f),a.preventDefault()}}});var f=document.documentMode,g=f&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){return g?void e.$selection.off("input.search input.searchcheck"):void e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{var b=this.$search.val().length+1;a=.75*b+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){var a={"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return a}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d=b.id+"-result-";return d+=a.generateChars(4),d+=null!=c.id?"-"+c.id.toString():"-"+a.generateChars(4)},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f<a.length;f++){var g=a[f].id;-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")});else{var d=a.id;this.$element.val(d),this.$element.trigger("change")}},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple"))return a.selected=!1,
2
- c(a.element).is("option")?(a.element.selected=!1,void this.$element.trigger("change")):void this.current(function(d){for(var e=[],f=0;f<d.length;f++){var g=d[f].id;g!==a.id&&-1===c.inArray(g,e)&&e.push(g)}b.$element.val(e),b.$element.trigger("change")})},d.prototype.bind=function(a,b){var c=this;this.container=a,a.on("select",function(a){c.select(a.data)}),a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){c.removeData(this,"data")})},d.prototype.query=function(a,b){var d=[],e=this,f=this.$element.children();f.each(function(){var b=c(this);if(b.is("option")||b.is("optgroup")){var f=e.item(b),g=e.matches(a,f);null!==g&&d.push(g)}}),b({results:d})},d.prototype.addOptions=function(a){b.appendMany(this.$element,a)},d.prototype.option=function(a){var b;a.children?(b=document.createElement("optgroup"),b.label=a.text):(b=document.createElement("option"),void 0!==b.textContent?b.textContent=a.text:b.innerText=a.text),a.id&&(b.value=a.id),a.disabled&&(b.disabled=!0),a.selected&&(b.selected=!0),a.title&&(b.title=a.title);var d=c(b),e=this._normalizeItem(a);return e.element=b,c.data(b,"data",e),d},d.prototype.item=function(a){var b={};if(b=c.data(a[0],"data"),null!=b)return b;if(a.is("option"))b={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if(a.is("optgroup")){b={text:a.prop("label"),children:[],title:a.prop("title")};for(var d=a.children("option"),e=[],f=0;f<d.length;f++){var g=c(d[f]),h=this.item(g);e.push(h)}b.children=e}return b=this._normalizeItem(b),b.element=a[0],c.data(a[0],"data",b),b},d.prototype._normalizeItem=function(a){c.isPlainObject(a)||(a={id:a,text:a}),a=c.extend({},{text:""},a);var b={selected:!1,disabled:!1};return null!=a.id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},b,a)},d.prototype.matches=function(a,b){var c=this.options.get("matcher");return c(a,b)},d}),b.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){var c=b.get("data")||[];d.__super__.constructor.call(this,a,b),this.addOptions(this.convertToOptions(c))}return b.Extend(d,a),d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b)),d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){function d(a){return function(){return c(this).val()==a.id}}for(var e=this,f=this.$element.find("option"),g=f.map(function(){return e.item(c(this)).id}).get(),h=[],i=0;i<a.length;i++){var j=this._normalizeItem(a[i]);if(c.inArray(j.id,g)>=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f)},function(){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&&""!==a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h<e.length;h++){var i=e[h],j=this._normalizeItem(i),k=this.option(j);this.$element.append(k)}}return b.prototype.query=function(a,b,c){function d(a,f){for(var g=a.results,h=0;h<g.length;h++){var i=g[h],j=null!=i.children&&!d({results:i.children},!0),k=i.text===b.term;if(k||j)return f?!1:(a.data=g,void c(a))}if(f)return!0;var l=e.createTag(b);if(null!=l){var m=e.option(l);m.attr("data-select2-tag",!0),e.addOptions([m]),e.insertTag(g,l)}a.results=g,c(a)}var e=this;return this._removeOldTags(),null==b.term||null!=b.page?void a.call(this,b,c):void a.call(this,b,d)},b.prototype.createTag=function(b,c){var d=a.trim(c.term);return""===d?null:{id:d,text:d}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){var c=(this._lastTag,this.$element.find("option[data-select2-tag]"));c.each(function(){this.selected||a(this).remove()})},b}),b.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d),a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c),this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(a,b,c){function d(a){e.trigger("select",{data:a})}var e=this;b.term=b.term||"";var f=this.tokenizer(b,this.options,d);f.term!==b.term&&(this.$search.length&&(this.$search.val(f.term),this.$search.focus()),b.term=f.term),a.call(this,b,c)},b.prototype.tokenizer=function(b,c,d,e){for(var f=d.get("tokenSeparators")||[],g=c.term,h=0,i=this.createTag||function(a){return{id:a.term,text:a.term}};h<g.length;){var j=g[h];if(-1!==a.inArray(j,f)){var k=g.substr(0,h),l=a.extend({},c,{term:k}),m=i(l);null!=m?(e(m),g=g.substr(h+1)||"",h=0):h++}else h++}return{term:g}},b}),b.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",b.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumInputLength",[],function(){function a(a,b,c){this.maximumInputLength=c.get("maximumInputLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){return b.term=b.term||"",this.maximumInputLength>0&&b.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):void a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;return d.maximumSelectionLength>0&&f>=d.maximumSelectionLength?void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}}):void a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){var b=e.showSearch(a);b?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){var c=e.$results.offset().top+e.$results.outerHeight(!1),d=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1);c+50>=d&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id,h=this.$container.parents().filter(b.hasScroll);h.off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.top<f.top-h.height,k=i.bottom>f.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-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.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d<b.length;d++){var e=b[d];e.children?c+=a(e.children):c++}return c}function b(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),a.call(this,b,c,d)}return b.prototype.showSearch=function(b,c){return a(c.data.results)<this.minimumResultsForSearch?!1:b.call(this,c)},b}),b.define("select2/dropdown/selectOnClose",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),b.on("close",function(){d._handleSelectOnClose()})},a.prototype._handleSelectOnClose=function(){var a=this.getHighlightedResults();if(!(a.length<1)){var b=a.data("data");null!=b.element&&b.element.selected||null==b.element&&b.selected||this.trigger("select",{data:b})}},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",{})},a}),b.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum,c="Please delete "+b+" character";return 1!=b&&(c+="s"),c},inputTooShort:function(a){var b=a.minimum-a.input.length,c="Please enter "+b+" or more characters";return c},loadingMore:function(){return"Loading more results…"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),b.define("select2/defaults",["jquery","require","./results","./selection/single","./selection/multiple","./selection/placeholder","./selection/allowClear","./selection/search","./selection/eventRelay","./utils","./translation","./diacritics","./data/select","./data/array","./data/ajax","./data/tags","./data/tokenizer","./data/minimumInputLength","./data/maximumInputLength","./data/maximumSelectionLength","./dropdown","./dropdown/search","./dropdown/hidePlaceholder","./dropdown/infiniteScroll","./dropdown/attachBody","./dropdown/minimumResultsForSearch","./dropdown/selectOnClose","./dropdown/closeOnSelect","./i18n/en"],function(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C){function D(){this.reset()}D.prototype.apply=function(l){if(l=a.extend(!0,{},this.defaults,l),null==l.dataAdapter){if(null!=l.ajax?l.dataAdapter=o:null!=l.data?l.dataAdapter=n:l.dataAdapter=m,l.minimumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),(null!=l.tokenSeparators||null!=l.tokenizer)&&(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L<K.length;L++){var M=K[L],N={};try{N=k.loadPath(M)}catch(O){try{M=this.defaults.amdLanguageBase+M,N=k.loadPath(M)}catch(P){l.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+M+'" could not be automatically loaded. A fallback will be used instead.');continue}}J.extend(N)}l.translations=J}else{var Q=k.loadPath(this.defaults.amdLanguageBase+"en"),R=new k(l.language);R.extend(Q),l.translations=R}return l},D.prototype.reset=function(){function b(a){function b(a){return l[a]||a}return a.replace(/[^\u0000-\u007E]/g,b)}function c(d,e){if(""===a.trim(d.term))return e;if(e.children&&e.children.length>0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){var h=e.children[g],i=c(d,h);null==i&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var j=b(e.text).toUpperCase(),k=b(d.term).toUpperCase();return j.indexOf(k)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)};var E=new D;return E}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return 0>=e?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;i>h;h+=1){var j=g[h].replace(/\s/g,""),k=j.match(c);if(null!==k&&k.length>=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this._sync=c.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",b._sync,!1)},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype.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._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=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("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if(b=b||{},"object"==typeof b)return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d;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.");var e=Array.prototype.slice.call(arguments,1);d=c[b].apply(c,e)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
1
+ /*! Select2 4.0.5 | 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}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="tree"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a('<li role="treeitem" aria-live="assertive" class="select2-results__option"></li>'),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c<a.results.length;c++){var d=a.results[c],e=this.option(d);b.push(e)}this.$results.append(b)},c.prototype.position=function(a,b){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[aria-selected]"),b=a.filter("[aria-selected=true]");b.length>0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[aria-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("aria-selected","true"):b.attr("aria-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"treeitem","aria-selected":"false"};b.disabled&&(delete d["aria-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["aria-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d.role="group",d["aria-label"]=b.text,delete d["aria-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";a(h);this.template(b,h);for(var i=[],j=0;j<b.children.length;j++){var k=b.children[j],l=this.option(k);i.push(l)}var m=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested"});m.append(i),g.append(h),g.append(m)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("aria-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[aria-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted")}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[aria-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("aria-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[aria-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){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("[aria-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),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" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),d.$selection.focus(),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},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),this.$selection.attr("aria-labelledby",d),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");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"></ul>'),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");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">&times;</span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],d=0;d<a.length;d++){var e=a[d],f=this.selectionContainer(),g=this.display(e,f);f.append(g),f.prop("title",e.title||e.text),f.data("data",e),b.push(f)}var h=this.$selection.find(".select2-selection__rendered");c.appendMany(h,b)}},d}),b.define("select2/selection/placeholder",["../utils"],function(a){function b(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c)}return b.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},b.prototype.createPlaceholder=function(a,b){var c=this.selectionContainer();return c.html(this.display(b)),c.addClass("select2-selection__placeholder").removeClass("select2-selection__choice"),c},b.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;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="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this;a.call(this,b,d),b.on("open",function(){e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.id)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var f=document.documentMode,g=f&&f<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(g)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(g&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{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=b.id+"-result-";return 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&&null!=this.container&&(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)},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="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="none" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.val("")}),c.on("focus",function(){c.isOpen()||e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){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="treeitem" aria-disabled="true"></li>'),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a("<span></span>"),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;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 a=this;this.on("open",function(){a.$container.addClass("select2-container--open")}),this.on("close",function(){a.$container.removeClass("select2-container--open")}),this.on("enable",function(){a.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){a.$container.addClass("select2-container--disabled")}),this.on("blur",function(){a.$container.removeClass("select2-container--focus")}),this.on("query",function(b){a.isOpen()||a.trigger("open",{}),this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})}),this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})}),this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.TAB||c===d.UP&&b.altKey?(a.close(),b.preventDefault()):c===d.ENTER?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e<b.addedNodes.length;e++){var f=b.addedNodes[e];f.selected&&(c=!0)}else b.removedNodes&&b.removedNodes.length>0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.select2){var e=["open","close","destroy"];a.fn.select2=function(b){if("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.defaults&&(a.fn.select2.defaults=d),c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,c});
 
js/validate.js CHANGED
@@ -37,9 +37,14 @@ jQuery( function ( $ ) {
37
 
38
  // Required field styling
39
  $.each( subRules.rules, function ( k, v ) {
40
- if ( v['required'] ) {
41
- $( '#' + k ).parent().siblings( '.rwmb-label' ).append( '<span class="rwmb-required">*</span>' );
42
  }
 
 
 
 
 
43
  } );
44
  } );
45
 
37
 
38
  // Required field styling
39
  $.each( subRules.rules, function ( k, v ) {
40
+ if ( ! v['required'] ) {
41
+ return;
42
  }
43
+ var $el = $( '[name="' + k + '"]' );
44
+ if ( ! $el.length ) {
45
+ return;
46
+ }
47
+ $el.closest( '.rwmb-input' ).siblings( '.rwmb-label' ).append( '<span class="rwmb-required">*</span>' );
48
  } );
49
  } );
50
 
js/wysiwyg.js CHANGED
@@ -70,7 +70,7 @@ jQuery( function ( $ ) {
70
  function updateDom( $wrapper, id ) {
71
  // Wrapper div and media buttons
72
  $wrapper.attr( 'id', 'wp-' + id + '-wrap' )
73
- .removeClass( 'html-active' ).addClass( 'mce-active' ) // Active the visual mode by default
74
  .find( '.mce-container' ).remove().end() // Remove rendered tinyMCE editor
75
  .find( '.wp-editor-tools' ).attr( 'id', 'wp-' + id + '-editor-tools' )
76
  .find( '.wp-media-buttons' ).attr( 'id', 'wp-' + id + '-media-buttons' )
70
  function updateDom( $wrapper, id ) {
71
  // Wrapper div and media buttons
72
  $wrapper.attr( 'id', 'wp-' + id + '-wrap' )
73
+ .removeClass( 'html-active' ).addClass( 'tmce-active' ) // Active the visual mode by default
74
  .find( '.mce-container' ).remove().end() // Remove rendered tinyMCE editor
75
  .find( '.wp-editor-tools' ).attr( 'id', 'wp-' + id + '-editor-tools' )
76
  .find( '.wp-media-buttons' ).attr( 'id', 'wp-' + id + '-media-buttons' )
meta-box.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields in WordPress.
6
- * Version: 4.14.10
7
  * Author: MetaBox.io
8
  * Author URI: https://metabox.io
9
  * License: GPL2+
3
  * Plugin Name: Meta Box
4
  * Plugin URI: https://metabox.io
5
  * Description: Create custom meta boxes and custom fields in WordPress.
6
+ * Version: 4.15.6
7
  * Author: MetaBox.io
8
  * Author URI: https://metabox.io
9
  * License: GPL2+
readme.txt CHANGED
@@ -3,106 +3,138 @@ Contributors: metabox, rilwis, fitwp, f-j-kaiser, funkatronic, PerWiklander, rua
3
  Donate link: https://metabox.io/pricing/
4
  Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced, custom, edit, field, file, image, magic fields, matrix, more fields, Post, repeater, simple fields, text, textarea, type, cms, fields post
5
  Requires at least: 4.3
6
- Tested up to: 4.9.6
7
- Stable tag: 4.14.10
8
  License: GPLv2 or later
9
 
10
  Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
11
 
12
  == Description ==
13
 
14
- **Meta Box plugin is a powerful, professional toolkit for developers to create and handle everything related to custom meta boxes and custom fields for WordPress.**
15
 
16
- The plugin provides a **wide range of field types** and **a lot of options to for each field type**, which gives you unlimited possibility to control and customize the custom fields.
17
 
18
- With the extensions, you can easily build meta boxes not only for custom post types (default), but also for **settings page, user meta, term meta**. You can also display the fields the way you want with columns, tabs or groups.
19
 
20
- The plugin requires a little coding, but if you're not familiar with coding or prefer GUI for faster creating custom post types, meta boxes and custom fields, you can use our [Online Generator](https://metabox.io/online-generator/) or use the extensions [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/) or [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/).
 
 
 
 
 
 
21
 
22
  ### Features
23
 
24
- #### Create any type of meta data
25
 
26
- * Create custom meta boxes for posts, pages or any custom post type.
27
- * Create custom [settings pages or theme option page](https://metabox.io/plugins/mb-settings-page/).
28
- * Create custom meta boxes for [user profile pages](https://metabox.io/plugins/mb-user-meta/).
29
- * Create custom meta boxes for [taxonomy terms](https://metabox.io/plugins/mb-term-meta/).
30
 
31
- #### Wide-range of field types and options
32
 
33
- * Supports 40+ built-in [field types](https://docs.metabox.io/field-settings/) for all your needs (text, textarea, wysiwyg/editor, image, file, post, select, checkbox, radio buttons, date time picker, taxonomy, user, oembed and more to come!). You can also [create your own field type](https://docs.metabox.io/custom-field-type/) easily.
34
- * Support cloning (repeatable) fields for most field types, including WYSIWYG/editor field. Also support [repeatable field groups](https://metabox.io/plugins/meta-box-group/).
35
- * Powerful [actions](https://docs.metabox.io/actions/) and [filters](https://docs.metabox.io/filters/) that developers can build or change the appearance and behavior in the plugin.
 
 
 
 
 
 
36
 
37
- #### Create meta boxes and custom fields with UI
38
 
39
- The plugin is built mostly for developers with a little coding, but if you prefer GUI for faster creating custom post types, meta boxes and custom fields, the plugin has extensions for that:
40
 
41
- - [Online Generator](https://metabox.io/online-generator/)
42
- - [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/)
43
- - [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/)
 
44
 
45
- <blockquote>To make it easy for all users to create custom meta boxes and custom fields, we have created an <a href="https://metabox.io/online-generator/">Online Generator</a> tool. It has an user-friendly interface with drag and drop features. No custom code anymore!</blockquote>
46
 
47
- #### Developer-friendly
48
 
49
- * Uses the [native WordPress meta data storage](https://docs.metabox.io/database/) and functions for ease of use and fast processing.
50
- * [Easily integrate with themes and plugins](https://docs.metabox.io/integration/).
51
- * [Works with Composer](https://docs.metabox.io/composer/) if you want to include the plugin in your project.
52
- * Compatible with WPML multilingual plugin (officially supported by WPML team).
53
 
54
- #### Detailed Documentation
 
 
 
 
55
 
56
- We provide regular updated and extensive documentation. Not only technical things, but also tutorials on how to use the plugin better.
57
 
58
- - [Quick Start Guide](https://docs.metabox.io/quick-start/)
59
- - [Creating Meta Boxes](https://docs.metabox.io/creating-meta-boxes/)
60
- - [Field Settings](https://docs.metabox.io/field-settings/)
61
- - [Displaying Fields](https://docs.metabox.io/displaying-fields/)
 
 
 
62
 
63
- See more documentation [here](https://docs.metabox.io).
 
 
 
 
 
64
 
65
  ### Extensions
66
 
 
 
 
 
67
  #### Free Extensions
68
 
69
- - [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/): Create and manage custom post types and taxonomies easily in WordPress with an easy-to-use interface.
70
- - [MB Relationships](https://wordpress.org/plugins/mb-relationships/): Create many-to-many relationships from posts to posts.
71
- - [Meta Box Yoast SEO](https://wordpress.org/plugins/meta-box-yoast-seo/): Add content of custom fields to Yoast SEO Content Analysis to have better/correct SEO score.
72
- - [MB Rest API](https://metabox.io/plugins/mb-rest-api/): Pull all meta value from posts, terms into the WP REST API responses.
73
- - [MB Comment Meta](https://wordpress.org/plugins/mb-comment-meta/): Add custom fields to comments in WordPress. Support all field types and options.
74
- - [MB Custom Taxonomy](https://metabox.io/plugins/custom-taxonomy/): Create and manage custom taxonomies with an easy-to-use interface in WordPress.
75
  - [Meta Box Text Limiter](https://wordpress.org/plugins/meta-box-text-limiter/): Limit the number of characters or words entered for text and textarea fields.
76
- - [Meta Box – FacetWP Integrator](https://metabox.io/plugins/meta-box-facetwp-integrator/): Integrates Meta Box and FacetWP, makes custom fields searchable and filterable in the frontend.
 
77
 
78
  #### Premium Extensions
79
 
80
- - [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/): Create custom meta boxes and custom fields in WordPress using the drag-and-drop interface.
81
- - [Meta Box Group](https://metabox.io/plugins/meta-box-group/): Create repeatable groups of custom fields for better appearance and structure.
82
  - [MB Settings Page](https://metabox.io/plugins/mb-settings-page/): Create settings pages for themes, plugins or websites with beautiful syntax.
83
  - [MB Term Meta](https://metabox.io/plugins/mb-term-meta/): Add meta data to categories, tags or any custom taxonomy with simple syntax.
84
  - [Meta Box Conditional Logic](https://metabox.io/plugins/meta-box-conditional-logic/): Add visibility dependency for custom meta boxes and custom fields in WordPress.
85
- - [Meta Box Include Exclude](https://metabox.io/plugins/meta-box-include-exclude/): Show/hide meta boxes by ID, page template, taxonomy or custom function.
86
- - [MB Frontend Submission](https://metabox.io/plugins/mb-frontend-submission/): Create frontend forms for users to submit custom content. Embed everywhere with shortcode.
87
- - [Meta Box Columns](https://metabox.io/plugins/meta-box-columns/): Display fields more beautiful by putting them into 12-columns grid.
88
- - [Meta Box Tabs](https://metabox.io/plugins/meta-box-tabs/): Create tabs for meta boxes easily. Support 3 WordPress-native tab styles and tab icon.
89
- - [MB Admin Columns](https://metabox.io/plugins/mb-admin-columns/): Display custom fields in table columns in admin screens for All Posts (types).
90
- - [MB Custom Table](https://metabox.io/plugins/mb-custom-table/): Save custom fields data to custom table instead of the default meta tables. Reduce database size and increase performance.
91
- - [MB Revision](https://metabox.io/plugins/mb-revision/): Track changes of custom fields with WordPress revision. Save, compare, restore the changes easily.
92
- - [MB User Meta](https://metabox.io/plugins/mb-user-meta/): Add custom fields to user profile (user meta) quickly with simple syntax.
93
- - [Meta Box Geolocation](https://metabox.io/plugins/meta-box-geolocation/): Automatically and instantly populate location data with the power of Google Maps Geolocation API.
94
- - [Meta Box Template](https://metabox.io/plugins/meta-box-template/): Define custom meta boxes and custom fields easier with templates.
95
- - [Meta Box Tooltip](https://metabox.io/plugins/meta-box-tooltip/): Display help information for fields using beautiful tooltips.
96
- - [Meta Box Show Hide](https://metabox.io/plugins/meta-box-show-hide-javascript/): Toggle meta boxes by page template, post format, taxonomy (including category) via Javascript.
97
-
98
- See all extensions [here](https://metabox.io/plugins/).
99
-
100
- ### Plugin Links
101
-
102
- - [Project Page](https://metabox.io)
103
- - [Documentation](https://docs.metabox.io)
104
- - [Report Bugs/Issues](https://github.com/wpmetabox/meta-box/issues)
105
- - [Premium Extensions](https://metabox.io/plugins/)
 
 
 
 
 
 
 
 
106
 
107
  == Installation ==
108
 
@@ -119,7 +151,7 @@ Manually
119
  1. Upload `meta-box` to the `/wp-content/plugins/` directory
120
  1. Activate the plugin through the 'Plugins' menu in WordPress
121
 
122
- To getting started with the plugin, please read [this tutorial](https://docs.metabox.io/quick-start/).
123
 
124
  == Frequently Asked Questions ==
125
 
3
  Donate link: https://metabox.io/pricing/
4
  Tags: meta-box, custom fields, custom field, meta, meta-boxes, admin, advanced, custom, edit, field, file, image, magic fields, matrix, more fields, Post, repeater, simple fields, text, textarea, type, cms, fields post
5
  Requires at least: 4.3
6
+ Tested up to: 4.9.8
7
+ Stable tag: 4.15.6
8
  License: GPLv2 or later
9
 
10
  Meta Box plugin is a powerful, professional developer toolkit to create custom meta boxes and custom fields for WordPress.
11
 
12
  == Description ==
13
 
14
+ **Meta Box is a powerful, professional, and lightweight toolkit for developers to create unlimited custom meta boxes and WordPress custom fields.**
15
 
16
+ Meta Box helps you add [custom fields](https://metabox.io) and details on your website such as pages, posts, forms and anywhere you want using over 40 different field types such as text, images, file upload, checkboxes, and more.
17
 
18
+ On top of that, each WordPress custom field type has extensive internal options for unlimited content possibilities. Complete customization and control is just a few clicks away.
19
 
20
+ Adding WordPress custom fields and custom meta boxes is quick and painless: Select the field types you want in the user-friendly [Online Generator](https://metabox.io/online-generator/), then copy and paste the code into your child theme's `functions.php` file.
21
+
22
+ **Boom! All the power with none of the bloat.**
23
+
24
+ There are also free and premium extensions available to add enhanced capabilities. You can manage the display and organization of your WordPress custom fields, the conditions upon which they appear, and become the ultimate WordPress data wizard.
25
+
26
+ You can also check out the [full list of extensions](https://metabox.io/plugins/) and [MetaBox.io](https://metabox.io) for details.
27
 
28
  ### Features
29
 
30
+ #### Create any type of metadata or custom fields in WordPress
31
 
32
+ That's right – any type. No matter where you need to insert custom data and features, Meta Box's WordPress custom fields have your back, and with infinite options to boot.
 
 
 
33
 
34
+ **Here are just a few of the data types you can customize:**
35
 
36
+ - Posts
37
+ - Pages
38
+ - Custom post types
39
+ - [Taxonomies](https://metabox.io/plugins/mb-term-meta/)
40
+ - [Settings pages](https://metabox.io/plugins/mb-settings-page/)
41
+ - [Theme option pages](https://metabox.io/plugins/mb-settings-page/)
42
+ - [User profile pages](https://metabox.io/plugins/mb-user-profile/)
43
+ - [Post comments](https://metabox.io/plugins/mb-comment-meta/)
44
+ - [And even more data types](https://docs.metabox.io/field-settings/) than Batman has tools on his utility belt.
45
 
46
+ #### A wide-range of field types and options
47
 
48
+ Take your standard WordPress custom field and imagine it infinitely expanded. That's how many options Meta Box gives you:
49
 
50
+ - Meta Box supports [40+ built-in WordPress custom field types](https://docs.metabox.io/field-settings/) for all your needs including text, textarea, WYSIWYG editor, image, file, post, select, checkbox, radio buttons, date/time picker, taxonomy, user, oembed and more to come.
51
+ - Not enough? You can also [effortlessly create your own field type](https://docs.metabox.io/custom-field-type/).
52
+ - Meta Box supports cloning fields for most field types including the WYSIWYG editor field. It also supports [repeatable field groups](https://metabox.io/plugins/meta-box-group/).
53
+ - Utilize WordPress' powerful [action](https://docs.metabox.io/actions/) and [filter](https://docs.metabox.io/filters/) system so you can build or change a site's appearance and behavior in the plugin.
54
 
55
+ #### It's developer-friendly
56
 
57
+ As a developer, you have enough on your plate. You shouldn't have to create an entirely new system for each project. Use Meta Box to your full advantage.
58
 
59
+ You can use Meta Box and its custom fields in WordPress on as many websites as you want so you can use it on client projects as well.
 
 
 
60
 
61
+ - Has an ultra-lightweight, yet powerful API that won't overload your site.
62
+ - Add only what you need instead of getting stuck with a bundle of features you don't even want that bloat your site.
63
+ - Meta Box [easily integrates with any theme and plugin](https://docs.metabox.io/integration/), and also [works with the Composer package dependency manager](https://docs.metabox.io/composer/).
64
+ - We use the [native WordPress meta data storage](https://docs.metabox.io/database/) and functions for ease of use and lightning-fast processing.
65
+ - It's compatible with WPML multilingual plugin, and is officially supported by the WPML team.
66
 
67
+ #### Don't love coding? You're in luck!
68
 
69
+ Meta Box is built mostly for developers since you need to copy and paste some code, but if you prefer a more visual system to create custom fields in WordPress, you can choose one or all of the extensions below:
70
+
71
+ - [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/)
72
+ - [Meta Box – Beaver Themer Integrator](https://metabox.io/plugins/meta-box-beaver-themer-integrator/)
73
+ - [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/)
74
+
75
+ The [Meta Box Builder extension](https://metabox.io/plugins/meta-box-builder/) has a ton of features to make quick work of any project:
76
 
77
+ - All the power of Meta Box without touching a single line of code.
78
+ - It's designer-friendly, lightweight and works at top-notch speeds.
79
+ - Create an unlimited amount of WordPress custom fields at lightning speeds and with a user-friendly drag-and-drop interface.
80
+ - Over 40 custom field types available that you can drag and drop to where you need ‘em.
81
+ - Export your custom fields and settings to PHP. Then, add it to a new site without needing to install this extension for an incredibly lightweight option.
82
+ - It has the goods with conditional logic, priority and context options ready and waiting.
83
 
84
  ### Extensions
85
 
86
+ Speaking of extensions, there are a ton of free and premium ones available to further extend the already powerful core Meta Box plugin so you can supercharge your custom fields in WordPress.
87
+
88
+ You'll have ultimate control to add whatever meta box and custom fields in WordPress you could ever want. Then, you can tailor it all to fit your exact specifications.
89
+
90
  #### Free Extensions
91
 
92
+ - [MB Custom Post Type](https://wordpress.org/plugins/mb-custom-post-type/): Create and manage custom post types and taxonomies quickly with an easy-to-use interface.
93
+ - [MB Relationships](https://wordpress.org/plugins/mb-relationships/): Create as many connections as you want from post-to-post or page-to-page.
94
+ - [Meta Box Yoast SEO](https://wordpress.org/plugins/meta-box-yoast-seo/): Add WordPress custom fields to Yoast SEO Content Analysis to generate more accurate SEO scores.
95
+ - [MB Rest API](https://metabox.io/plugins/mb-rest-api/): Pull all meta values from posts and terms into the WP REST API responses.
96
+ - [MB Comment Meta](https://wordpress.org/plugins/mb-comment-meta/): Add WordPress custom fields to comments in WordPress. It supports all field types and options.
97
+ - [MB Custom Taxonomy](https://metabox.io/plugins/custom-taxonomy/): Create and manage custom taxonomies in WordPress with a user-friendly interface.
98
  - [Meta Box Text Limiter](https://wordpress.org/plugins/meta-box-text-limiter/): Limit the number of characters or words entered for text and textarea fields.
99
+ - [Meta Box – FacetWP Integrator](https://metabox.io/plugins/meta-box-facetwp-integrator/): Integrates Meta Box, and FacetWP to make WordPress custom fields searchable and filterable in the frontend.
100
+ - [Meta Box – Beaver Themer Integrator](https://metabox.io/plugins/meta-box-beaver-themer-integrator/): Integrates Meta Box, and Beaver Themer to show WordPress custom fields easier in the frontend.
101
 
102
  #### Premium Extensions
103
 
104
+ - [Meta Box Builder](https://metabox.io/plugins/meta-box-builder/): Create custom meta boxes and custom fields in WordPress using a user-friendly drag-and-drop interface.
105
+ - [Meta Box Group](https://metabox.io/plugins/meta-box-group/): Create repeatable groups of WordPress custom fields for better appearance and structure.
106
  - [MB Settings Page](https://metabox.io/plugins/mb-settings-page/): Create settings pages for themes, plugins or websites with beautiful syntax.
107
  - [MB Term Meta](https://metabox.io/plugins/mb-term-meta/): Add meta data to categories, tags or any custom taxonomy with simple syntax.
108
  - [Meta Box Conditional Logic](https://metabox.io/plugins/meta-box-conditional-logic/): Add visibility dependency for custom meta boxes and custom fields in WordPress.
109
+ - [Meta Box Include Exclude](https://metabox.io/plugins/meta-box-include-exclude/): Show or hide meta boxes by ID, page template, taxonomy, or custom function.
110
+ - [MB Frontend Submission](https://metabox.io/plugins/mb-frontend-submission/): Create frontend forms for users to submit custom content and embed them anywhere with a shortcode.
111
+ - [Meta Box Columns](https://metabox.io/plugins/meta-box-columns/): Display eye-catching custom fields in WordPress by putting them into 12-column grids.
112
+ - [Meta Box Tabs](https://metabox.io/plugins/meta-box-tabs/): Painlessly create tabs for meta boxes. There are 3 supported WordPress-native tab styles and icons.
113
+ - [MB Admin Columns](https://metabox.io/plugins/mb-admin-columns/): Display WordPress custom fields in table columns on admin screens for all post types.
114
+ - [MB Custom Table](https://metabox.io/plugins/mb-custom-table/): Save custom field data to custom tables instead of the default meta tables to reduce your database's size and increase its performance.
115
+ - [MB Revision](https://metabox.io/plugins/mb-revision/): Track changes to custom fields in WordPress with revisions. You can save, compare and restore the changes smoothly.
116
+ - [MB User Meta](https://metabox.io/plugins/mb-user-meta/): Quickly add WordPress custom fields to user profiles in the wp_usermeta table with simple syntax.
117
+ - [Meta Box Geolocation](https://metabox.io/plugins/meta-box-geolocation/): Automatically and instantly populate location data with the power of the Google Maps Geolocation API.
118
+ - [Meta Box Template](https://metabox.io/plugins/meta-box-template/): Make defining custom meta boxes and WordPress custom fields way easier with templates.
119
+ - [Meta Box Tooltip](https://metabox.io/plugins/meta-box-tooltip/): Display help information for custom fields in WordPress using beautiful tooltips.
120
+ - [Meta Box Show Hide](https://metabox.io/plugins/meta-box-show-hide-javascript/): Toggle meta boxes by page template, post format, taxonomy and category via JavaScript.
121
+
122
+ See all the available [extensions on the Meta Box website](https://metabox.io/plugins/).
123
+
124
+ ### Detailed Documentation
125
+
126
+ We won't leave you high and dry.
127
+
128
+ We provide regularly updated, and extensive documentation as well as tutorials on how to use MetaBox and custom fields in WordPress to your advantage as well as in the most efficient way possible.
129
+
130
+ Here are a few guides to quickly get you started with Meta Box and creating your own WordPress custom fields:
131
+
132
+ - [Quick Start Guide](https://docs.metabox.io/quick-start/)
133
+ - [Creating Meta Boxes](https://docs.metabox.io/creating-meta-boxes/)
134
+ - [Field Settings](https://docs.metabox.io/field-settings/)
135
+ - [Displaying Fields](https://docs.metabox.io/displaying-fields/)
136
+
137
+ Check out more on the [Meta Box Documentation](https://docs.metabox.io/) page.
138
 
139
  == Installation ==
140
 
151
  1. Upload `meta-box` to the `/wp-content/plugins/` directory
152
  1. Activate the plugin through the 'Plugins' menu in WordPress
153
 
154
+ To getting started with the plugin, please read the [Quick Start Guide](https://docs.metabox.io/quick-start/).
155
 
156
  == Frequently Asked Questions ==
157