Version Description
- Added support for hreflang x-default in Advanced Settings
- Improved checking if quota exceeded on google machine translation for each batch
- Fix a fatal error due to incorrect call to the_title filter made by some themes
- Fixed automatic translation character count not resetting daily
- Fixed possible incompatibility between trp_language shortcode and automatic translation
Download this release
Release Info
Developer | madalin.ungureanu |
Plugin | TranslatePress – Translate Multilingual sites |
Version | 1.6.1 |
Comparing to | |
See all releases |
Code changes from version 1.6.0 to 1.6.1
- assets/css/trp-back-end-style.css +184 -184
- assets/css/trp-editor.css +18 -18
- assets/css/trp-floater-language-switcher.css +119 -119
- assets/css/trp-language-switcher.css +121 -121
- assets/css/trp-preview-iframe-style.css +158 -158
- assets/js/trp-back-end-script.js +295 -295
- assets/js/trp-editor-overlay.js +27 -27
- assets/js/trp-editor.js +18 -18
- assets/js/trp-frontend-compatibility.js +17 -17
- assets/js/trp-iframe-preview-script.js +149 -149
- assets/js/trp-translate-dom-changes.js +564 -564
- assets/js/trp-update-database.js +22 -22
- assets/lib/select2-lib/LICENSE.md +21 -21
- assets/lib/select2-lib/README.md +121 -121
- assets/lib/select2-lib/dist/css/select2.css +484 -484
- assets/lib/select2-lib/dist/css/select2.min.css +1 -1
- assets/lib/select2-lib/dist/js/i18n/ar.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/az.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/bg.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/ca.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/cs.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/da.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/de.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/el.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/en.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/es.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/et.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/eu.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/fa.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/fi.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/fr.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/gl.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/he.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/hi.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/hr.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/hu.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/id.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/is.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/it.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/ja.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/km.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/ko.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/lt.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/lv.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/mk.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/ms.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/nb.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/nl.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/pl.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/pt-BR.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/pt.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/ro.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/ru.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/sk.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/sr-Cyrl.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/sr.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/sv.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/th.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/tr.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/uk.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/vi.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/zh-CN.js +2 -2
- assets/lib/select2-lib/dist/js/i18n/zh-TW.js +2 -2
- assets/lib/select2-lib/dist/js/select2.full.js +4705 -6436
assets/css/trp-back-end-style.css
CHANGED
@@ -1,185 +1,185 @@
|
|
1 |
-
/* Free */
|
2 |
-
|
3 |
-
table#trp-options td{
|
4 |
-
padding-left: 28px;
|
5 |
-
}
|
6 |
-
|
7 |
-
span.select2-container{
|
8 |
-
width: 240px !important;
|
9 |
-
}
|
10 |
-
|
11 |
-
#trp-options .trp-text-input{
|
12 |
-
width:40%;
|
13 |
-
}
|
14 |
-
|
15 |
-
#trp-options .trp-select{
|
16 |
-
min-width:240px;
|
17 |
-
}
|
18 |
-
|
19 |
-
#trp-published-language{
|
20 |
-
margin-left: 20px;
|
21 |
-
}
|
22 |
-
|
23 |
-
#trp-url-slug{
|
24 |
-
margin-left: 5px;
|
25 |
-
}
|
26 |
-
|
27 |
-
.nav-tab.trp-translation-editor {
|
28 |
-
background-color: #0085ba;
|
29 |
-
color: #ffffff;
|
30 |
-
}
|
31 |
-
|
32 |
-
.nav-tab.trp-translation-editor:hover {
|
33 |
-
background-color: #008ec2;
|
34 |
-
}
|
35 |
-
|
36 |
-
.nav-tab.trp-translation-editor:focus {
|
37 |
-
-webkit-box-shadow: none;
|
38 |
-
box-shadow: none;
|
39 |
-
}
|
40 |
-
|
41 |
-
|
42 |
-
/**************************************************/
|
43 |
-
/* Extra styling for admin notices
|
44 |
-
/**************************************************/
|
45 |
-
div.trp-notice {
|
46 |
-
position: relative;
|
47 |
-
}
|
48 |
-
|
49 |
-
div.trp-notice:after {
|
50 |
-
display: block;
|
51 |
-
content: '';
|
52 |
-
clear: both;
|
53 |
-
}
|
54 |
-
|
55 |
-
div.trp-notice.trp-narrow {
|
56 |
-
max-width: 825px;
|
57 |
-
}
|
58 |
-
|
59 |
-
div.trp-notice .notice-dismiss {
|
60 |
-
text-decoration: none;
|
61 |
-
}
|
62 |
-
|
63 |
-
.wrap div.trp-admin-notice {
|
64 |
-
margin-bottom: 0;
|
65 |
-
}
|
66 |
-
|
67 |
-
|
68 |
-
/* PRO */
|
69 |
-
/*
|
70 |
-
* Language Selector
|
71 |
-
*/
|
72 |
-
#trp-languages-table{
|
73 |
-
width: 1px;
|
74 |
-
margin-left: -42px
|
75 |
-
}
|
76 |
-
table#trp-languages-table td{
|
77 |
-
padding: 5px;
|
78 |
-
}
|
79 |
-
|
80 |
-
table#trp-languages-table th{
|
81 |
-
text-align: center;
|
82 |
-
}
|
83 |
-
|
84 |
-
.trp-language{
|
85 |
-
padding-bottom: 5px;
|
86 |
-
padding-top: 5px;
|
87 |
-
}
|
88 |
-
|
89 |
-
input.trp-translation-published{
|
90 |
-
margin-top: 1px;
|
91 |
-
}
|
92 |
-
|
93 |
-
.trp-code-slug{
|
94 |
-
width: 65px;
|
95 |
-
}
|
96 |
-
|
97 |
-
.trp-sortable-handle{
|
98 |
-
background: url('../images/sorting-icon-dots.png') no-repeat center center;
|
99 |
-
width: 16px;
|
100 |
-
height: 16px;
|
101 |
-
display: inline-block;
|
102 |
-
vertical-align: middle;
|
103 |
-
margin-right: 7px;
|
104 |
-
cursor: move;
|
105 |
-
margin-top: -1px;
|
106 |
-
}
|
107 |
-
|
108 |
-
#trp-new-language{
|
109 |
-
padding-bottom: 5px;
|
110 |
-
padding-top: 5px;
|
111 |
-
}
|
112 |
-
|
113 |
-
.trp-remove-language{
|
114 |
-
color: #a00;
|
115 |
-
cursor: pointer;
|
116 |
-
}
|
117 |
-
|
118 |
-
.trp-remove-language:hover{
|
119 |
-
color: red;
|
120 |
-
}
|
121 |
-
|
122 |
-
#trp-add-language{
|
123 |
-
margin-left: 10px;
|
124 |
-
}
|
125 |
-
|
126 |
-
.trp-ls-type{
|
127 |
-
margin-bottom: 20px;
|
128 |
-
}
|
129 |
-
|
130 |
-
.trp-ls-select-option{
|
131 |
-
margin-top: 10px;
|
132 |
-
}
|
133 |
-
|
134 |
-
.warning,
|
135 |
-
.trp-upsell-multiple-languages{
|
136 |
-
border: 1px solid #a00;
|
137 |
-
padding: 1rem;
|
138 |
-
background: #fff;
|
139 |
-
max-width:800px;
|
140 |
-
}
|
141 |
-
|
142 |
-
.trp-settings-delimiter-border {
|
143 |
-
border-top: 1px solid #d9d9d9;
|
144 |
-
}
|
145 |
-
|
146 |
-
/* License Page */
|
147 |
-
.trp-active-license{
|
148 |
-
line-height: 29px;
|
149 |
-
color: #008000;
|
150 |
-
}
|
151 |
-
|
152 |
-
.trp-invalid-license{
|
153 |
-
line-height: 29px;
|
154 |
-
color:#ca4a1f;
|
155 |
-
}
|
156 |
-
|
157 |
-
/* Advanced Settings Page */
|
158 |
-
|
159 |
-
table.trp-adst-list-option{
|
160 |
-
width: 1px;
|
161 |
-
margin-left: -30px
|
162 |
-
}
|
163 |
-
table.trp-adst-list-option td{
|
164 |
-
padding: 5px;
|
165 |
-
}
|
166 |
-
table.trp-adst-list-option th{
|
167 |
-
text-align: center;
|
168 |
-
}
|
169 |
-
.trp-adst-list-option textarea{
|
170 |
-
width: 250px;
|
171 |
-
}
|
172 |
-
.trp-adst-remove-element{
|
173 |
-
color: #a00;
|
174 |
-
cursor: pointer;
|
175 |
-
}
|
176 |
-
.trp-adst-remove-element:hover{
|
177 |
-
color: red;
|
178 |
-
}
|
179 |
-
.trp-adst-radio label{
|
180 |
-
display: inline-block;
|
181 |
-
margin-right: 3em;
|
182 |
-
}
|
183 |
-
.trp-adst-radio .description{
|
184 |
-
margin-top: 2em;
|
185 |
}
|
1 |
+
/* Free */
|
2 |
+
|
3 |
+
table#trp-options td{
|
4 |
+
padding-left: 28px;
|
5 |
+
}
|
6 |
+
|
7 |
+
span.select2-container{
|
8 |
+
width: 240px !important;
|
9 |
+
}
|
10 |
+
|
11 |
+
#trp-options .trp-text-input{
|
12 |
+
width:40%;
|
13 |
+
}
|
14 |
+
|
15 |
+
#trp-options .trp-select{
|
16 |
+
min-width:240px;
|
17 |
+
}
|
18 |
+
|
19 |
+
#trp-published-language{
|
20 |
+
margin-left: 20px;
|
21 |
+
}
|
22 |
+
|
23 |
+
#trp-url-slug{
|
24 |
+
margin-left: 5px;
|
25 |
+
}
|
26 |
+
|
27 |
+
.nav-tab.trp-translation-editor {
|
28 |
+
background-color: #0085ba;
|
29 |
+
color: #ffffff;
|
30 |
+
}
|
31 |
+
|
32 |
+
.nav-tab.trp-translation-editor:hover {
|
33 |
+
background-color: #008ec2;
|
34 |
+
}
|
35 |
+
|
36 |
+
.nav-tab.trp-translation-editor:focus {
|
37 |
+
-webkit-box-shadow: none;
|
38 |
+
box-shadow: none;
|
39 |
+
}
|
40 |
+
|
41 |
+
|
42 |
+
/**************************************************/
|
43 |
+
/* Extra styling for admin notices
|
44 |
+
/**************************************************/
|
45 |
+
div.trp-notice {
|
46 |
+
position: relative;
|
47 |
+
}
|
48 |
+
|
49 |
+
div.trp-notice:after {
|
50 |
+
display: block;
|
51 |
+
content: '';
|
52 |
+
clear: both;
|
53 |
+
}
|
54 |
+
|
55 |
+
div.trp-notice.trp-narrow {
|
56 |
+
max-width: 825px;
|
57 |
+
}
|
58 |
+
|
59 |
+
div.trp-notice .notice-dismiss {
|
60 |
+
text-decoration: none;
|
61 |
+
}
|
62 |
+
|
63 |
+
.wrap div.trp-admin-notice {
|
64 |
+
margin-bottom: 0;
|
65 |
+
}
|
66 |
+
|
67 |
+
|
68 |
+
/* PRO */
|
69 |
+
/*
|
70 |
+
* Language Selector
|
71 |
+
*/
|
72 |
+
#trp-languages-table{
|
73 |
+
width: 1px;
|
74 |
+
margin-left: -42px
|
75 |
+
}
|
76 |
+
table#trp-languages-table td{
|
77 |
+
padding: 5px;
|
78 |
+
}
|
79 |
+
|
80 |
+
table#trp-languages-table th{
|
81 |
+
text-align: center;
|
82 |
+
}
|
83 |
+
|
84 |
+
.trp-language{
|
85 |
+
padding-bottom: 5px;
|
86 |
+
padding-top: 5px;
|
87 |
+
}
|
88 |
+
|
89 |
+
input.trp-translation-published{
|
90 |
+
margin-top: 1px;
|
91 |
+
}
|
92 |
+
|
93 |
+
.trp-code-slug{
|
94 |
+
width: 65px;
|
95 |
+
}
|
96 |
+
|
97 |
+
.trp-sortable-handle{
|
98 |
+
background: url('../images/sorting-icon-dots.png') no-repeat center center;
|
99 |
+
width: 16px;
|
100 |
+
height: 16px;
|
101 |
+
display: inline-block;
|
102 |
+
vertical-align: middle;
|
103 |
+
margin-right: 7px;
|
104 |
+
cursor: move;
|
105 |
+
margin-top: -1px;
|
106 |
+
}
|
107 |
+
|
108 |
+
#trp-new-language{
|
109 |
+
padding-bottom: 5px;
|
110 |
+
padding-top: 5px;
|
111 |
+
}
|
112 |
+
|
113 |
+
.trp-remove-language{
|
114 |
+
color: #a00;
|
115 |
+
cursor: pointer;
|
116 |
+
}
|
117 |
+
|
118 |
+
.trp-remove-language:hover{
|
119 |
+
color: red;
|
120 |
+
}
|
121 |
+
|
122 |
+
#trp-add-language{
|
123 |
+
margin-left: 10px;
|
124 |
+
}
|
125 |
+
|
126 |
+
.trp-ls-type{
|
127 |
+
margin-bottom: 20px;
|
128 |
+
}
|
129 |
+
|
130 |
+
.trp-ls-select-option{
|
131 |
+
margin-top: 10px;
|
132 |
+
}
|
133 |
+
|
134 |
+
.warning,
|
135 |
+
.trp-upsell-multiple-languages{
|
136 |
+
border: 1px solid #a00;
|
137 |
+
padding: 1rem;
|
138 |
+
background: #fff;
|
139 |
+
max-width:800px;
|
140 |
+
}
|
141 |
+
|
142 |
+
.trp-settings-delimiter-border {
|
143 |
+
border-top: 1px solid #d9d9d9;
|
144 |
+
}
|
145 |
+
|
146 |
+
/* License Page */
|
147 |
+
.trp-active-license{
|
148 |
+
line-height: 29px;
|
149 |
+
color: #008000;
|
150 |
+
}
|
151 |
+
|
152 |
+
.trp-invalid-license{
|
153 |
+
line-height: 29px;
|
154 |
+
color:#ca4a1f;
|
155 |
+
}
|
156 |
+
|
157 |
+
/* Advanced Settings Page */
|
158 |
+
|
159 |
+
table.trp-adst-list-option{
|
160 |
+
width: 1px;
|
161 |
+
margin-left: -30px
|
162 |
+
}
|
163 |
+
table.trp-adst-list-option td{
|
164 |
+
padding: 5px;
|
165 |
+
}
|
166 |
+
table.trp-adst-list-option th{
|
167 |
+
text-align: center;
|
168 |
+
}
|
169 |
+
.trp-adst-list-option textarea{
|
170 |
+
width: 250px;
|
171 |
+
}
|
172 |
+
.trp-adst-remove-element{
|
173 |
+
color: #a00;
|
174 |
+
cursor: pointer;
|
175 |
+
}
|
176 |
+
.trp-adst-remove-element:hover{
|
177 |
+
color: red;
|
178 |
+
}
|
179 |
+
.trp-adst-radio label{
|
180 |
+
display: inline-block;
|
181 |
+
margin-right: 3em;
|
182 |
+
}
|
183 |
+
.trp-adst-radio .description{
|
184 |
+
margin-top: 2em;
|
185 |
}
|
assets/css/trp-editor.css
CHANGED
@@ -727,8 +727,8 @@ iframe#trp-preview-iframe {
|
|
727 |
font-size: 12px;
|
728 |
}
|
729 |
|
730 |
-
/*
|
731 |
-
View as Dropdown
|
732 |
*/
|
733 |
|
734 |
#trp-view-as {
|
@@ -748,8 +748,8 @@ iframe#trp-preview-iframe {
|
|
748 |
padding: 3px;
|
749 |
}
|
750 |
|
751 |
-
/*
|
752 |
-
String list
|
753 |
*/
|
754 |
|
755 |
#trp-string-categories {
|
@@ -768,8 +768,8 @@ span.select2-container {
|
|
768 |
margin-botton: 10px;
|
769 |
}
|
770 |
|
771 |
-
/*
|
772 |
-
Translation Editors
|
773 |
*/
|
774 |
|
775 |
.trp-toggle-languages {
|
@@ -908,8 +908,8 @@ span.select2-container {
|
|
908 |
display: none;
|
909 |
}
|
910 |
|
911 |
-
/*
|
912 |
-
* Loading animation
|
913 |
*/
|
914 |
|
915 |
.trp-ajax-loader {
|
@@ -970,8 +970,8 @@ span.select2-container {
|
|
970 |
text-align: center;
|
971 |
}
|
972 |
|
973 |
-
/*
|
974 |
-
* Select 2 Overlay in front-end
|
975 |
*/
|
976 |
|
977 |
.select2-selection.select2-selection--single {
|
@@ -1007,8 +1007,8 @@ span.select2-container {
|
|
1007 |
max-height: 400px !important;
|
1008 |
}
|
1009 |
|
1010 |
-
/*
|
1011 |
-
Language boxes component
|
1012 |
*/
|
1013 |
|
1014 |
.trp-translations-for-language {
|
@@ -1085,8 +1085,8 @@ span.trp-translation-icon {
|
|
1085 |
cursor: pointer;
|
1086 |
}
|
1087 |
|
1088 |
-
/*
|
1089 |
-
Translation Input component
|
1090 |
*/
|
1091 |
|
1092 |
.trp-input-media-container {
|
@@ -1134,8 +1134,8 @@ Translation Input component
|
|
1134 |
border: solid 2px red;
|
1135 |
}
|
1136 |
|
1137 |
-
/* Needed for Media upload
|
1138 |
-
* Hide visually but not from screen readers
|
1139 |
*/
|
1140 |
|
1141 |
.screen-reader-text,
|
@@ -1155,8 +1155,8 @@ Translation Input component
|
|
1155 |
/* many screen reader and browser combinations announce broken words as they would appear visually */
|
1156 |
}
|
1157 |
|
1158 |
-
/*
|
1159 |
-
* Translation Memory Component
|
1160 |
*/
|
1161 |
|
1162 |
.trp-translation-memory-wrap {
|
727 |
font-size: 12px;
|
728 |
}
|
729 |
|
730 |
+
/*
|
731 |
+
View as Dropdown
|
732 |
*/
|
733 |
|
734 |
#trp-view-as {
|
748 |
padding: 3px;
|
749 |
}
|
750 |
|
751 |
+
/*
|
752 |
+
String list
|
753 |
*/
|
754 |
|
755 |
#trp-string-categories {
|
768 |
margin-botton: 10px;
|
769 |
}
|
770 |
|
771 |
+
/*
|
772 |
+
Translation Editors
|
773 |
*/
|
774 |
|
775 |
.trp-toggle-languages {
|
908 |
display: none;
|
909 |
}
|
910 |
|
911 |
+
/*
|
912 |
+
* Loading animation
|
913 |
*/
|
914 |
|
915 |
.trp-ajax-loader {
|
970 |
text-align: center;
|
971 |
}
|
972 |
|
973 |
+
/*
|
974 |
+
* Select 2 Overlay in front-end
|
975 |
*/
|
976 |
|
977 |
.select2-selection.select2-selection--single {
|
1007 |
max-height: 400px !important;
|
1008 |
}
|
1009 |
|
1010 |
+
/*
|
1011 |
+
Language boxes component
|
1012 |
*/
|
1013 |
|
1014 |
.trp-translations-for-language {
|
1085 |
cursor: pointer;
|
1086 |
}
|
1087 |
|
1088 |
+
/*
|
1089 |
+
Translation Input component
|
1090 |
*/
|
1091 |
|
1092 |
.trp-input-media-container {
|
1134 |
border: solid 2px red;
|
1135 |
}
|
1136 |
|
1137 |
+
/* Needed for Media upload
|
1138 |
+
* Hide visually but not from screen readers
|
1139 |
*/
|
1140 |
|
1141 |
.screen-reader-text,
|
1155 |
/* many screen reader and browser combinations announce broken words as they would appear visually */
|
1156 |
}
|
1157 |
|
1158 |
+
/*
|
1159 |
+
* Translation Memory Component
|
1160 |
*/
|
1161 |
|
1162 |
.trp-translation-memory-wrap {
|
assets/css/trp-floater-language-switcher.css
CHANGED
@@ -1,120 +1,120 @@
|
|
1 |
-
#trp-floater-ls {
|
2 |
-
position: fixed;
|
3 |
-
z-index: 9999999;
|
4 |
-
bottom: 0;
|
5 |
-
left: 80%;
|
6 |
-
background-color: #212121;
|
7 |
-
border-radius: 5px 5px 0 0;
|
8 |
-
display: block;
|
9 |
-
overflow: hidden;
|
10 |
-
}
|
11 |
-
|
12 |
-
#trp-floater-ls.trp-bottom-left{
|
13 |
-
left: 10%;
|
14 |
-
}
|
15 |
-
|
16 |
-
#trp-floater-ls.trp-top-right{
|
17 |
-
bottom:auto;
|
18 |
-
top: 0;
|
19 |
-
border-radius: 0 0 5px 5px;
|
20 |
-
}
|
21 |
-
|
22 |
-
#trp-floater-ls.trp-top-left{
|
23 |
-
bottom:auto;
|
24 |
-
top: 0;
|
25 |
-
left: 10%;
|
26 |
-
border-radius: 0 0 5px 5px;
|
27 |
-
}
|
28 |
-
|
29 |
-
body.admin-bar #trp-floater-ls.trp-top-right,
|
30 |
-
body.admin-bar #trp-floater-ls.trp-top-left{
|
31 |
-
top: 32px;
|
32 |
-
}
|
33 |
-
|
34 |
-
@media screen and (max-width: 782px) {
|
35 |
-
body.admin-bar #trp-floater-ls.trp-top-right,
|
36 |
-
body.admin-bar #trp-floater-ls.trp-top-left {
|
37 |
-
top: 46px;
|
38 |
-
}
|
39 |
-
}
|
40 |
-
|
41 |
-
#trp-floater-ls.trp-floater-ls-names {
|
42 |
-
max-width: 160px;
|
43 |
-
}
|
44 |
-
|
45 |
-
#trp-floater-ls.trp-floater-ls-flags {
|
46 |
-
width: 50px;
|
47 |
-
}
|
48 |
-
|
49 |
-
#trp-floater-ls-language-list {
|
50 |
-
display: none;
|
51 |
-
}
|
52 |
-
|
53 |
-
#trp-floater-ls:focus #trp-floater-ls-current-language,
|
54 |
-
#trp-floater-ls:hover #trp-floater-ls-current-language {
|
55 |
-
display: none;
|
56 |
-
}
|
57 |
-
|
58 |
-
#trp-floater-ls:focus #trp-floater-ls-language-list,
|
59 |
-
#trp-floater-ls:hover #trp-floater-ls-language-list {
|
60 |
-
display: block;
|
61 |
-
}
|
62 |
-
|
63 |
-
#trp-floater-ls:hover {
|
64 |
-
box-shadow: 0 0 10px #212121;
|
65 |
-
}
|
66 |
-
|
67 |
-
#trp-floater-ls-current-language a,
|
68 |
-
#trp-floater-ls-language-list a {
|
69 |
-
display: block;
|
70 |
-
padding: 10px 15px 5px 15px;
|
71 |
-
font-size: 90%;
|
72 |
-
}
|
73 |
-
|
74 |
-
#trp-floater-ls-current-language,
|
75 |
-
#trp-floater-ls-language-list {
|
76 |
-
text-align: left;
|
77 |
-
}
|
78 |
-
|
79 |
-
#trp-floater-ls-current-language.trp-with-flags,
|
80 |
-
#trp-floater-ls-language-list.trp-with-flags {
|
81 |
-
text-align: left;
|
82 |
-
}
|
83 |
-
|
84 |
-
#trp-floater-ls-current-language {
|
85 |
-
display: block;
|
86 |
-
width: 100%;
|
87 |
-
height: 100%;
|
88 |
-
}
|
89 |
-
|
90 |
-
#trp-floater-ls-current-language a,
|
91 |
-
#trp-floater-ls-language-list a {
|
92 |
-
color: #BDBDBD;
|
93 |
-
overflow: hidden;
|
94 |
-
text-overflow: ellipsis;
|
95 |
-
white-space: nowrap;
|
96 |
-
}
|
97 |
-
|
98 |
-
#trp-floater-ls-language-list a:hover {
|
99 |
-
color: #FAFAFA;
|
100 |
-
background-color: #424242;
|
101 |
-
}
|
102 |
-
|
103 |
-
#trp-floater-ls .trp-floater-ls-disabled-language {
|
104 |
-
pointer-events: none;
|
105 |
-
cursor: default;
|
106 |
-
}
|
107 |
-
|
108 |
-
#trp-floater-ls .trp-with-flags .trp-flag-image {
|
109 |
-
margin-right: 5px;
|
110 |
-
margin-top: -1px;
|
111 |
-
vertical-align: middle;
|
112 |
-
height: auto;
|
113 |
-
max-width: 100%;
|
114 |
-
display: inline;
|
115 |
-
padding: 0;
|
116 |
-
}
|
117 |
-
|
118 |
-
#trp-floater-ls a {
|
119 |
-
text-decoration: none;
|
120 |
}
|
1 |
+
#trp-floater-ls {
|
2 |
+
position: fixed;
|
3 |
+
z-index: 9999999;
|
4 |
+
bottom: 0;
|
5 |
+
left: 80%;
|
6 |
+
background-color: #212121;
|
7 |
+
border-radius: 5px 5px 0 0;
|
8 |
+
display: block;
|
9 |
+
overflow: hidden;
|
10 |
+
}
|
11 |
+
|
12 |
+
#trp-floater-ls.trp-bottom-left{
|
13 |
+
left: 10%;
|
14 |
+
}
|
15 |
+
|
16 |
+
#trp-floater-ls.trp-top-right{
|
17 |
+
bottom:auto;
|
18 |
+
top: 0;
|
19 |
+
border-radius: 0 0 5px 5px;
|
20 |
+
}
|
21 |
+
|
22 |
+
#trp-floater-ls.trp-top-left{
|
23 |
+
bottom:auto;
|
24 |
+
top: 0;
|
25 |
+
left: 10%;
|
26 |
+
border-radius: 0 0 5px 5px;
|
27 |
+
}
|
28 |
+
|
29 |
+
body.admin-bar #trp-floater-ls.trp-top-right,
|
30 |
+
body.admin-bar #trp-floater-ls.trp-top-left{
|
31 |
+
top: 32px;
|
32 |
+
}
|
33 |
+
|
34 |
+
@media screen and (max-width: 782px) {
|
35 |
+
body.admin-bar #trp-floater-ls.trp-top-right,
|
36 |
+
body.admin-bar #trp-floater-ls.trp-top-left {
|
37 |
+
top: 46px;
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
#trp-floater-ls.trp-floater-ls-names {
|
42 |
+
max-width: 160px;
|
43 |
+
}
|
44 |
+
|
45 |
+
#trp-floater-ls.trp-floater-ls-flags {
|
46 |
+
width: 50px;
|
47 |
+
}
|
48 |
+
|
49 |
+
#trp-floater-ls-language-list {
|
50 |
+
display: none;
|
51 |
+
}
|
52 |
+
|
53 |
+
#trp-floater-ls:focus #trp-floater-ls-current-language,
|
54 |
+
#trp-floater-ls:hover #trp-floater-ls-current-language {
|
55 |
+
display: none;
|
56 |
+
}
|
57 |
+
|
58 |
+
#trp-floater-ls:focus #trp-floater-ls-language-list,
|
59 |
+
#trp-floater-ls:hover #trp-floater-ls-language-list {
|
60 |
+
display: block;
|
61 |
+
}
|
62 |
+
|
63 |
+
#trp-floater-ls:hover {
|
64 |
+
box-shadow: 0 0 10px #212121;
|
65 |
+
}
|
66 |
+
|
67 |
+
#trp-floater-ls-current-language a,
|
68 |
+
#trp-floater-ls-language-list a {
|
69 |
+
display: block;
|
70 |
+
padding: 10px 15px 5px 15px;
|
71 |
+
font-size: 90%;
|
72 |
+
}
|
73 |
+
|
74 |
+
#trp-floater-ls-current-language,
|
75 |
+
#trp-floater-ls-language-list {
|
76 |
+
text-align: left;
|
77 |
+
}
|
78 |
+
|
79 |
+
#trp-floater-ls-current-language.trp-with-flags,
|
80 |
+
#trp-floater-ls-language-list.trp-with-flags {
|
81 |
+
text-align: left;
|
82 |
+
}
|
83 |
+
|
84 |
+
#trp-floater-ls-current-language {
|
85 |
+
display: block;
|
86 |
+
width: 100%;
|
87 |
+
height: 100%;
|
88 |
+
}
|
89 |
+
|
90 |
+
#trp-floater-ls-current-language a,
|
91 |
+
#trp-floater-ls-language-list a {
|
92 |
+
color: #BDBDBD;
|
93 |
+
overflow: hidden;
|
94 |
+
text-overflow: ellipsis;
|
95 |
+
white-space: nowrap;
|
96 |
+
}
|
97 |
+
|
98 |
+
#trp-floater-ls-language-list a:hover {
|
99 |
+
color: #FAFAFA;
|
100 |
+
background-color: #424242;
|
101 |
+
}
|
102 |
+
|
103 |
+
#trp-floater-ls .trp-floater-ls-disabled-language {
|
104 |
+
pointer-events: none;
|
105 |
+
cursor: default;
|
106 |
+
}
|
107 |
+
|
108 |
+
#trp-floater-ls .trp-with-flags .trp-flag-image {
|
109 |
+
margin-right: 5px;
|
110 |
+
margin-top: -1px;
|
111 |
+
vertical-align: middle;
|
112 |
+
height: auto;
|
113 |
+
max-width: 100%;
|
114 |
+
display: inline;
|
115 |
+
padding: 0;
|
116 |
+
}
|
117 |
+
|
118 |
+
#trp-floater-ls a {
|
119 |
+
text-decoration: none;
|
120 |
}
|
assets/css/trp-language-switcher.css
CHANGED
@@ -1,121 +1,121 @@
|
|
1 |
-
/*
|
2 |
-
* Menu Language Switcher
|
3 |
-
*/
|
4 |
-
|
5 |
-
.menu-item-object-language_switcher .trp-flag-image {
|
6 |
-
display: inline-block;
|
7 |
-
margin: -1px 5px;
|
8 |
-
vertical-align: baseline;
|
9 |
-
padding: 0;
|
10 |
-
border: 0;
|
11 |
-
border-radius:0;
|
12 |
-
}
|
13 |
-
|
14 |
-
/*
|
15 |
-
* Shortcode Language Switcher
|
16 |
-
*/
|
17 |
-
.trp-language-switcher{
|
18 |
-
position: relative;
|
19 |
-
width: auto;
|
20 |
-
display: inline-block;
|
21 |
-
padding: 0;
|
22 |
-
border: 0;
|
23 |
-
margin: 2px;
|
24 |
-
box-sizing: border-box;
|
25 |
-
}
|
26 |
-
|
27 |
-
|
28 |
-
.trp-language-switcher > div {
|
29 |
-
box-sizing: border-box;
|
30 |
-
|
31 |
-
padding:3px 20px 3px 5px;
|
32 |
-
border: 1px solid #c1c1c1;
|
33 |
-
border-radius: 3px;
|
34 |
-
|
35 |
-
background-image:
|
36 |
-
linear-gradient(45deg, transparent 50%, gray 50%),
|
37 |
-
linear-gradient(135deg, gray 50%, transparent 50%);
|
38 |
-
|
39 |
-
background-position:
|
40 |
-
calc(100% - 8px) calc(1em + 0px),
|
41 |
-
calc(100% - 3px) calc(1em + 0px);
|
42 |
-
|
43 |
-
background-size:
|
44 |
-
5px 5px,
|
45 |
-
5px 5px;
|
46 |
-
|
47 |
-
background-repeat: no-repeat;
|
48 |
-
|
49 |
-
background-color: #fff;
|
50 |
-
}
|
51 |
-
|
52 |
-
.trp-language-switcher > div > a {
|
53 |
-
display: block;
|
54 |
-
padding: 2px;
|
55 |
-
border-radius: 3px;
|
56 |
-
color: rgb(7, 105, 173);
|
57 |
-
}
|
58 |
-
|
59 |
-
.trp-language-switcher > div > a:hover {
|
60 |
-
background: #f1f1f1;
|
61 |
-
}
|
62 |
-
.trp-language-switcher > div > a.trp-ls-shortcode-disabled-language {
|
63 |
-
cursor: default;
|
64 |
-
}
|
65 |
-
.trp-language-switcher > div > a.trp-ls-shortcode-disabled-language:hover {
|
66 |
-
background: none;
|
67 |
-
}
|
68 |
-
|
69 |
-
.trp-language-switcher > div > a > img{
|
70 |
-
display: inline;
|
71 |
-
margin: 0 3px;
|
72 |
-
width: 18px;
|
73 |
-
height: 12px;
|
74 |
-
border-radius: 0;
|
75 |
-
}
|
76 |
-
|
77 |
-
.trp-language-switcher .trp-ls-shortcode-current-language{
|
78 |
-
display: inline-block;
|
79 |
-
}
|
80 |
-
.trp-language-switcher:focus .trp-ls-shortcode-current-language,
|
81 |
-
.trp-language-switcher:hover .trp-ls-shortcode-current-language{
|
82 |
-
visibility: hidden;
|
83 |
-
}
|
84 |
-
|
85 |
-
.trp-language-switcher .trp-ls-shortcode-language{
|
86 |
-
display: inline-block;
|
87 |
-
height: 1px;
|
88 |
-
overflow: hidden;
|
89 |
-
visibility: hidden;
|
90 |
-
z-index: 1;
|
91 |
-
}
|
92 |
-
|
93 |
-
.trp-language-switcher:focus .trp-ls-shortcode-language,
|
94 |
-
.trp-language-switcher:hover .trp-ls-shortcode-language{
|
95 |
-
visibility:visible;
|
96 |
-
height:auto;
|
97 |
-
position: absolute;
|
98 |
-
left: 0;
|
99 |
-
top: 0;
|
100 |
-
display: inline-block !important;
|
101 |
-
|
102 |
-
}
|
103 |
-
|
104 |
-
/*
|
105 |
-
* Front-end Admin Bar Icon
|
106 |
-
*/
|
107 |
-
#wpadminbar #wp-admin-bar-trp_edit_translation .ab-icon:before {
|
108 |
-
content: '\f326';
|
109 |
-
top: 3px;
|
110 |
-
}
|
111 |
-
|
112 |
-
@media screen and ( max-width: 782px ) {
|
113 |
-
#wpadminbar #wp-admin-bar-trp_edit_translation > .ab-item {
|
114 |
-
text-indent: 0;
|
115 |
-
}
|
116 |
-
|
117 |
-
#wpadminbar li#wp-admin-bar-trp_edit_translation {
|
118 |
-
display: block;
|
119 |
-
}
|
120 |
-
}
|
121 |
-
|
1 |
+
/*
|
2 |
+
* Menu Language Switcher
|
3 |
+
*/
|
4 |
+
|
5 |
+
.menu-item-object-language_switcher .trp-flag-image {
|
6 |
+
display: inline-block;
|
7 |
+
margin: -1px 5px;
|
8 |
+
vertical-align: baseline;
|
9 |
+
padding: 0;
|
10 |
+
border: 0;
|
11 |
+
border-radius:0;
|
12 |
+
}
|
13 |
+
|
14 |
+
/*
|
15 |
+
* Shortcode Language Switcher
|
16 |
+
*/
|
17 |
+
.trp-language-switcher{
|
18 |
+
position: relative;
|
19 |
+
width: auto;
|
20 |
+
display: inline-block;
|
21 |
+
padding: 0;
|
22 |
+
border: 0;
|
23 |
+
margin: 2px;
|
24 |
+
box-sizing: border-box;
|
25 |
+
}
|
26 |
+
|
27 |
+
|
28 |
+
.trp-language-switcher > div {
|
29 |
+
box-sizing: border-box;
|
30 |
+
|
31 |
+
padding:3px 20px 3px 5px;
|
32 |
+
border: 1px solid #c1c1c1;
|
33 |
+
border-radius: 3px;
|
34 |
+
|
35 |
+
background-image:
|
36 |
+
linear-gradient(45deg, transparent 50%, gray 50%),
|
37 |
+
linear-gradient(135deg, gray 50%, transparent 50%);
|
38 |
+
|
39 |
+
background-position:
|
40 |
+
calc(100% - 8px) calc(1em + 0px),
|
41 |
+
calc(100% - 3px) calc(1em + 0px);
|
42 |
+
|
43 |
+
background-size:
|
44 |
+
5px 5px,
|
45 |
+
5px 5px;
|
46 |
+
|
47 |
+
background-repeat: no-repeat;
|
48 |
+
|
49 |
+
background-color: #fff;
|
50 |
+
}
|
51 |
+
|
52 |
+
.trp-language-switcher > div > a {
|
53 |
+
display: block;
|
54 |
+
padding: 2px;
|
55 |
+
border-radius: 3px;
|
56 |
+
color: rgb(7, 105, 173);
|
57 |
+
}
|
58 |
+
|
59 |
+
.trp-language-switcher > div > a:hover {
|
60 |
+
background: #f1f1f1;
|
61 |
+
}
|
62 |
+
.trp-language-switcher > div > a.trp-ls-shortcode-disabled-language {
|
63 |
+
cursor: default;
|
64 |
+
}
|
65 |
+
.trp-language-switcher > div > a.trp-ls-shortcode-disabled-language:hover {
|
66 |
+
background: none;
|
67 |
+
}
|
68 |
+
|
69 |
+
.trp-language-switcher > div > a > img{
|
70 |
+
display: inline;
|
71 |
+
margin: 0 3px;
|
72 |
+
width: 18px;
|
73 |
+
height: 12px;
|
74 |
+
border-radius: 0;
|
75 |
+
}
|
76 |
+
|
77 |
+
.trp-language-switcher .trp-ls-shortcode-current-language{
|
78 |
+
display: inline-block;
|
79 |
+
}
|
80 |
+
.trp-language-switcher:focus .trp-ls-shortcode-current-language,
|
81 |
+
.trp-language-switcher:hover .trp-ls-shortcode-current-language{
|
82 |
+
visibility: hidden;
|
83 |
+
}
|
84 |
+
|
85 |
+
.trp-language-switcher .trp-ls-shortcode-language{
|
86 |
+
display: inline-block;
|
87 |
+
height: 1px;
|
88 |
+
overflow: hidden;
|
89 |
+
visibility: hidden;
|
90 |
+
z-index: 1;
|
91 |
+
}
|
92 |
+
|
93 |
+
.trp-language-switcher:focus .trp-ls-shortcode-language,
|
94 |
+
.trp-language-switcher:hover .trp-ls-shortcode-language{
|
95 |
+
visibility:visible;
|
96 |
+
height:auto;
|
97 |
+
position: absolute;
|
98 |
+
left: 0;
|
99 |
+
top: 0;
|
100 |
+
display: inline-block !important;
|
101 |
+
|
102 |
+
}
|
103 |
+
|
104 |
+
/*
|
105 |
+
* Front-end Admin Bar Icon
|
106 |
+
*/
|
107 |
+
#wpadminbar #wp-admin-bar-trp_edit_translation .ab-icon:before {
|
108 |
+
content: '\f326';
|
109 |
+
top: 3px;
|
110 |
+
}
|
111 |
+
|
112 |
+
@media screen and ( max-width: 782px ) {
|
113 |
+
#wpadminbar #wp-admin-bar-trp_edit_translation > .ab-item {
|
114 |
+
text-indent: 0;
|
115 |
+
}
|
116 |
+
|
117 |
+
#wpadminbar li#wp-admin-bar-trp_edit_translation {
|
118 |
+
display: block;
|
119 |
+
}
|
120 |
+
}
|
121 |
+
|
assets/css/trp-preview-iframe-style.css
CHANGED
@@ -1,158 +1,158 @@
|
|
1 |
-
/*
|
2 |
-
String editor button
|
3 |
-
*/
|
4 |
-
|
5 |
-
.trp-icon {
|
6 |
-
width: 30px !important;
|
7 |
-
height: 30px !important;
|
8 |
-
display: none;
|
9 |
-
position: absolute !important;
|
10 |
-
margin-left: -30px !important;
|
11 |
-
cursor: pointer !important;
|
12 |
-
pointer-events: auto;
|
13 |
-
color: #fff !important;
|
14 |
-
min-width: 30px !important;
|
15 |
-
min-height: 30px !important;
|
16 |
-
line-height: 1em!important;
|
17 |
-
font-size: 18px !important;
|
18 |
-
z-index: 5 !important;
|
19 |
-
background: #0085ba!important;
|
20 |
-
-webkit-border-radius: 50% !important;
|
21 |
-
border-radius: 50% !important;
|
22 |
-
border: 2px solid #fff !important;
|
23 |
-
-webkit-box-shadow: 0 2px 1px rgba(46,68,83,.15) !important;
|
24 |
-
box-shadow: 0 2px 1px rgba(46,68,83,.15) !important;
|
25 |
-
text-align: center !important;
|
26 |
-
-webkit-box-sizing: border-box !important;
|
27 |
-
-moz-box-sizing: border-box !important;
|
28 |
-
box-sizing: border-box !important;
|
29 |
-
padding: 3px !important;
|
30 |
-
}
|
31 |
-
|
32 |
-
.trp-icon:hover {
|
33 |
-
background: #008ec2!important;
|
34 |
-
}
|
35 |
-
|
36 |
-
.trp-icon:before{
|
37 |
-
display:block !important;
|
38 |
-
}
|
39 |
-
|
40 |
-
.trp-icon svg {
|
41 |
-
fill: #fff;
|
42 |
-
min-width: 20px;
|
43 |
-
min-height: 20px;
|
44 |
-
width: 20px;
|
45 |
-
height: 20px;
|
46 |
-
margin: auto;
|
47 |
-
}
|
48 |
-
|
49 |
-
[data-trp-unpreviewable="trp-unpreviewable"]{
|
50 |
-
cursor: not-allowed !important;
|
51 |
-
}
|
52 |
-
|
53 |
-
.trp-highlight{
|
54 |
-
outline: 2px solid #e2e4e7 !important;
|
55 |
-
}
|
56 |
-
|
57 |
-
.trp-gettext-pencil{
|
58 |
-
background: #00ba3f !important;
|
59 |
-
}
|
60 |
-
|
61 |
-
*[data-trp-translate-id] .trp-icon.trp-gettext-pencil{
|
62 |
-
background: #0085ba!important;
|
63 |
-
}
|
64 |
-
|
65 |
-
.trp-gettext-pencil:hover{
|
66 |
-
background: #00ce44 !important;
|
67 |
-
}
|
68 |
-
|
69 |
-
*[data-trp-translate-id] .trp-gettext-pencil.trp-icon:hover{
|
70 |
-
background: #008ec2!important;
|
71 |
-
}
|
72 |
-
|
73 |
-
translate-press{
|
74 |
-
pointer-events: all;
|
75 |
-
}
|
76 |
-
|
77 |
-
.trp-overflow-transform-fixer{
|
78 |
-
transform: translate3d(0,0,0);
|
79 |
-
-moz-transform: translate3d(0,0,0);
|
80 |
-
-webkit-transform: translate3d(0,0,0);
|
81 |
-
}
|
82 |
-
|
83 |
-
.trp-overflow-transform-fixer trp-edit.trp-edit-translation{
|
84 |
-
position:fixed;
|
85 |
-
}
|
86 |
-
|
87 |
-
.trp-overflow-inside-fixer trp-edit.trp-edit-translation{
|
88 |
-
margin-left:0 !important;
|
89 |
-
}
|
90 |
-
|
91 |
-
|
92 |
-
/*
|
93 |
-
* Merge icon
|
94 |
-
*/
|
95 |
-
|
96 |
-
.trp-icon.trp-merge {
|
97 |
-
display: none;
|
98 |
-
margin-left: -60px !important;
|
99 |
-
background: #3CB371!important;
|
100 |
-
}
|
101 |
-
|
102 |
-
.trp-icon.trp-merge:hover {
|
103 |
-
display: none;
|
104 |
-
background: #40bf79!important;
|
105 |
-
}
|
106 |
-
|
107 |
-
.trp-icon.trp-merge.trp-active-icon, .trp-icon.trp-merge.trp-active-icon:hover{
|
108 |
-
display: inline;
|
109 |
-
}
|
110 |
-
|
111 |
-
/*
|
112 |
-
* Split icon
|
113 |
-
*/
|
114 |
-
|
115 |
-
.trp-icon.trp-split{
|
116 |
-
display: none;
|
117 |
-
margin-left: -60px !important;
|
118 |
-
background: #ffa500!important;
|
119 |
-
}
|
120 |
-
|
121 |
-
.trp-icon.trp-split:hover {
|
122 |
-
display: none;
|
123 |
-
background: #ffae19!important;
|
124 |
-
}
|
125 |
-
|
126 |
-
.trp-icon.trp-split.trp-active-icon, .trp-icon.trp-split.trp-active-icon:hover{
|
127 |
-
display: inline;
|
128 |
-
}
|
129 |
-
|
130 |
-
.trp-editor-notices{
|
131 |
-
font-family: inherit;
|
132 |
-
font-size: 13px;
|
133 |
-
font-style: inherit;
|
134 |
-
font-weight: inherit;
|
135 |
-
position:relative;
|
136 |
-
z-index: 99999;
|
137 |
-
width: 100%;
|
138 |
-
max-height: 200px;
|
139 |
-
overflow-y: auto;
|
140 |
-
background: #f1f1f1;
|
141 |
-
overflow-x: hidden;
|
142 |
-
}
|
143 |
-
|
144 |
-
.trp-notice{
|
145 |
-
background: #fff;
|
146 |
-
border-left: 4px solid #fff;
|
147 |
-
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
148 |
-
margin: 15px;
|
149 |
-
padding: 12px;
|
150 |
-
}
|
151 |
-
|
152 |
-
.trp-notice-warning {
|
153 |
-
border-left-color: #ffb900;
|
154 |
-
}
|
155 |
-
|
156 |
-
.trp-bad-encoded-strings-list{
|
157 |
-
padding-left: 15px;
|
158 |
-
}
|
1 |
+
/*
|
2 |
+
String editor button
|
3 |
+
*/
|
4 |
+
|
5 |
+
.trp-icon {
|
6 |
+
width: 30px !important;
|
7 |
+
height: 30px !important;
|
8 |
+
display: none;
|
9 |
+
position: absolute !important;
|
10 |
+
margin-left: -30px !important;
|
11 |
+
cursor: pointer !important;
|
12 |
+
pointer-events: auto;
|
13 |
+
color: #fff !important;
|
14 |
+
min-width: 30px !important;
|
15 |
+
min-height: 30px !important;
|
16 |
+
line-height: 1em!important;
|
17 |
+
font-size: 18px !important;
|
18 |
+
z-index: 5 !important;
|
19 |
+
background: #0085ba!important;
|
20 |
+
-webkit-border-radius: 50% !important;
|
21 |
+
border-radius: 50% !important;
|
22 |
+
border: 2px solid #fff !important;
|
23 |
+
-webkit-box-shadow: 0 2px 1px rgba(46,68,83,.15) !important;
|
24 |
+
box-shadow: 0 2px 1px rgba(46,68,83,.15) !important;
|
25 |
+
text-align: center !important;
|
26 |
+
-webkit-box-sizing: border-box !important;
|
27 |
+
-moz-box-sizing: border-box !important;
|
28 |
+
box-sizing: border-box !important;
|
29 |
+
padding: 3px !important;
|
30 |
+
}
|
31 |
+
|
32 |
+
.trp-icon:hover {
|
33 |
+
background: #008ec2!important;
|
34 |
+
}
|
35 |
+
|
36 |
+
.trp-icon:before{
|
37 |
+
display:block !important;
|
38 |
+
}
|
39 |
+
|
40 |
+
.trp-icon svg {
|
41 |
+
fill: #fff;
|
42 |
+
min-width: 20px;
|
43 |
+
min-height: 20px;
|
44 |
+
width: 20px;
|
45 |
+
height: 20px;
|
46 |
+
margin: auto;
|
47 |
+
}
|
48 |
+
|
49 |
+
[data-trp-unpreviewable="trp-unpreviewable"]{
|
50 |
+
cursor: not-allowed !important;
|
51 |
+
}
|
52 |
+
|
53 |
+
.trp-highlight{
|
54 |
+
outline: 2px solid #e2e4e7 !important;
|
55 |
+
}
|
56 |
+
|
57 |
+
.trp-gettext-pencil{
|
58 |
+
background: #00ba3f !important;
|
59 |
+
}
|
60 |
+
|
61 |
+
*[data-trp-translate-id] .trp-icon.trp-gettext-pencil{
|
62 |
+
background: #0085ba!important;
|
63 |
+
}
|
64 |
+
|
65 |
+
.trp-gettext-pencil:hover{
|
66 |
+
background: #00ce44 !important;
|
67 |
+
}
|
68 |
+
|
69 |
+
*[data-trp-translate-id] .trp-gettext-pencil.trp-icon:hover{
|
70 |
+
background: #008ec2!important;
|
71 |
+
}
|
72 |
+
|
73 |
+
translate-press{
|
74 |
+
pointer-events: all;
|
75 |
+
}
|
76 |
+
|
77 |
+
.trp-overflow-transform-fixer{
|
78 |
+
transform: translate3d(0,0,0);
|
79 |
+
-moz-transform: translate3d(0,0,0);
|
80 |
+
-webkit-transform: translate3d(0,0,0);
|
81 |
+
}
|
82 |
+
|
83 |
+
.trp-overflow-transform-fixer trp-edit.trp-edit-translation{
|
84 |
+
position:fixed;
|
85 |
+
}
|
86 |
+
|
87 |
+
.trp-overflow-inside-fixer trp-edit.trp-edit-translation{
|
88 |
+
margin-left:0 !important;
|
89 |
+
}
|
90 |
+
|
91 |
+
|
92 |
+
/*
|
93 |
+
* Merge icon
|
94 |
+
*/
|
95 |
+
|
96 |
+
.trp-icon.trp-merge {
|
97 |
+
display: none;
|
98 |
+
margin-left: -60px !important;
|
99 |
+
background: #3CB371!important;
|
100 |
+
}
|
101 |
+
|
102 |
+
.trp-icon.trp-merge:hover {
|
103 |
+
display: none;
|
104 |
+
background: #40bf79!important;
|
105 |
+
}
|
106 |
+
|
107 |
+
.trp-icon.trp-merge.trp-active-icon, .trp-icon.trp-merge.trp-active-icon:hover{
|
108 |
+
display: inline;
|
109 |
+
}
|
110 |
+
|
111 |
+
/*
|
112 |
+
* Split icon
|
113 |
+
*/
|
114 |
+
|
115 |
+
.trp-icon.trp-split{
|
116 |
+
display: none;
|
117 |
+
margin-left: -60px !important;
|
118 |
+
background: #ffa500!important;
|
119 |
+
}
|
120 |
+
|
121 |
+
.trp-icon.trp-split:hover {
|
122 |
+
display: none;
|
123 |
+
background: #ffae19!important;
|
124 |
+
}
|
125 |
+
|
126 |
+
.trp-icon.trp-split.trp-active-icon, .trp-icon.trp-split.trp-active-icon:hover{
|
127 |
+
display: inline;
|
128 |
+
}
|
129 |
+
|
130 |
+
.trp-editor-notices{
|
131 |
+
font-family: inherit;
|
132 |
+
font-size: 13px;
|
133 |
+
font-style: inherit;
|
134 |
+
font-weight: inherit;
|
135 |
+
position:relative;
|
136 |
+
z-index: 99999;
|
137 |
+
width: 100%;
|
138 |
+
max-height: 200px;
|
139 |
+
overflow-y: auto;
|
140 |
+
background: #f1f1f1;
|
141 |
+
overflow-x: hidden;
|
142 |
+
}
|
143 |
+
|
144 |
+
.trp-notice{
|
145 |
+
background: #fff;
|
146 |
+
border-left: 4px solid #fff;
|
147 |
+
box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
|
148 |
+
margin: 15px;
|
149 |
+
padding: 12px;
|
150 |
+
}
|
151 |
+
|
152 |
+
.trp-notice-warning {
|
153 |
+
border-left-color: #ffb900;
|
154 |
+
}
|
155 |
+
|
156 |
+
.trp-bad-encoded-strings-list{
|
157 |
+
padding-left: 15px;
|
158 |
+
}
|
assets/js/trp-back-end-script.js
CHANGED
@@ -1,295 +1,295 @@
|
|
1 |
-
/*
|
2 |
-
* Script used in Settings Page
|
3 |
-
*/
|
4 |
-
|
5 |
-
jQuery( function() {
|
6 |
-
|
7 |
-
/**
|
8 |
-
* Change the language selector and slugs
|
9 |
-
*/
|
10 |
-
function TRP_Settings_Language_Selector() {
|
11 |
-
var _this = this;
|
12 |
-
var duplicate_url_error_message;
|
13 |
-
var iso_codes;
|
14 |
-
|
15 |
-
/**
|
16 |
-
* Initialize select to become select2
|
17 |
-
*/
|
18 |
-
this.initialize_select2 = function () {
|
19 |
-
jQuery('.trp-select2').each(function () {
|
20 |
-
var select_element = jQuery(this);
|
21 |
-
select_element.select2(/*arguments*/);
|
22 |
-
});
|
23 |
-
};
|
24 |
-
|
25 |
-
this.get_default_url_slug = function( new_language ){
|
26 |
-
var return_slug = iso_codes[new_language];
|
27 |
-
var url_slugs = _this.get_existing_url_slugs();
|
28 |
-
url_slugs.push( return_slug );
|
29 |
-
if ( has_duplicates ( url_slugs ) ){
|
30 |
-
return_slug = new_language;
|
31 |
-
}
|
32 |
-
return return_slug.toLowerCase();
|
33 |
-
};
|
34 |
-
|
35 |
-
this.add_language = function(){
|
36 |
-
var selected_language = jQuery( '#trp-select-language' );
|
37 |
-
var new_language = selected_language.val();
|
38 |
-
if ( new_language == "" ){
|
39 |
-
return;
|
40 |
-
}
|
41 |
-
|
42 |
-
if (jQuery( "#trp-languages-table .trp-language" ).length >= 2 ){
|
43 |
-
jQuery(".trp-upsell-multiple-languages").show('fast');
|
44 |
-
return;
|
45 |
-
}
|
46 |
-
|
47 |
-
selected_language.val( '' ).trigger( 'change' );
|
48 |
-
|
49 |
-
var new_option = jQuery( '.trp-language' ).first().clone();
|
50 |
-
new_option = jQuery( new_option );
|
51 |
-
|
52 |
-
new_option.find( '.trp-hidden-default-language' ).remove();
|
53 |
-
new_option.find( '.select2-container' ).remove();
|
54 |
-
var select = new_option.find( 'select.trp-translation-language' );
|
55 |
-
select.removeAttr( 'disabled' );
|
56 |
-
select.find( 'option' ).each(function(index, el){
|
57 |
-
el.text = el.text.replace('Default: ', '');
|
58 |
-
})
|
59 |
-
|
60 |
-
select.val( new_language );
|
61 |
-
select.select2();
|
62 |
-
|
63 |
-
var checkbox = new_option.find( 'input.trp-translation-published' );
|
64 |
-
checkbox.removeAttr( 'disabled' );
|
65 |
-
checkbox.val( new_language );
|
66 |
-
|
67 |
-
var url_slug = new_option.find( 'input.trp-language-slug' );
|
68 |
-
url_slug.val( _this.get_default_url_slug( new_language ) );
|
69 |
-
url_slug.attr('name', 'trp_settings[url-slugs][' + new_language + ']' );
|
70 |
-
|
71 |
-
var language_code = new_option.find( 'input.trp-language-code' );
|
72 |
-
language_code.val( new_language);
|
73 |
-
|
74 |
-
var remove = new_option.find( '.trp-remove-language' ).toggle();
|
75 |
-
|
76 |
-
new_option = jQuery( '#trp-sortable-languages' ).append( new_option );
|
77 |
-
new_option.find( '.trp-remove-language' ).last().click( _this.remove_language );
|
78 |
-
};
|
79 |
-
|
80 |
-
this.remove_language = function( element ){
|
81 |
-
var message = jQuery( element.target ).attr( 'data-confirm-message' );
|
82 |
-
var confirmed = confirm( message );
|
83 |
-
if ( confirmed ) {
|
84 |
-
jQuery ( element.target ).parent().parent().remove();
|
85 |
-
}
|
86 |
-
};
|
87 |
-
|
88 |
-
this.update_default_language = function(){
|
89 |
-
var selected_language = jQuery( '#trp-default-language').val();
|
90 |
-
jQuery( '.trp-hidden-default-language' ).val( selected_language );
|
91 |
-
jQuery( '.trp-translation-published[disabled]' ).val( selected_language );
|
92 |
-
jQuery( '.trp-translation-language[disabled]').val( selected_language ).trigger( 'change' );
|
93 |
-
};
|
94 |
-
|
95 |
-
function has_duplicates(array) {
|
96 |
-
var valuesSoFar = Object.create(null);
|
97 |
-
for (var i = 0; i < array.length; ++i) {
|
98 |
-
var value = array[i];
|
99 |
-
if (value in valuesSoFar) {
|
100 |
-
return true;
|
101 |
-
}
|
102 |
-
valuesSoFar[value] = true;
|
103 |
-
}
|
104 |
-
return false;
|
105 |
-
}
|
106 |
-
|
107 |
-
this.get_existing_url_slugs = function(){
|
108 |
-
var url_slugs = [];
|
109 |
-
jQuery( '.trp-language-slug' ).each( function (){
|
110 |
-
url_slugs.push( jQuery( this ).val().toLowerCase() );
|
111 |
-
} );
|
112 |
-
return url_slugs;
|
113 |
-
};
|
114 |
-
|
115 |
-
this.check_unique_url_slugs = function (event){
|
116 |
-
var url_slugs = _this.get_existing_url_slugs();
|
117 |
-
if ( has_duplicates(url_slugs)){
|
118 |
-
alert( duplicate_url_error_message );
|
119 |
-
event.preventDefault();
|
120 |
-
}
|
121 |
-
};
|
122 |
-
|
123 |
-
this.update_url_slug_and_status = function ( event ) {
|
124 |
-
var select = jQuery( event.target );
|
125 |
-
var new_language = select.val();
|
126 |
-
var row = jQuery( select ).parents( '.trp-language' ) ;
|
127 |
-
row.find( '.trp-language-slug' ).attr( 'name', 'trp_settings[url-slugs][' + new_language + ']').val( '' ).val( _this.get_default_url_slug( new_language ) );
|
128 |
-
row.find( '.trp-language-code' ).val( '' ).val( new_language );
|
129 |
-
row.find( '.trp-translation-published' ).val( new_language );
|
130 |
-
};
|
131 |
-
|
132 |
-
this.initialize = function () {
|
133 |
-
this.initialize_select2();
|
134 |
-
|
135 |
-
if ( !jQuery( '.trp-language-selector-limited' ).length ){
|
136 |
-
return;
|
137 |
-
}
|
138 |
-
|
139 |
-
duplicate_url_error_message = trp_url_slugs_info['error_message_duplicate_slugs'];
|
140 |
-
iso_codes = trp_url_slugs_info['iso_codes'];
|
141 |
-
|
142 |
-
jQuery( '#trp-sortable-languages' ).sortable({ handle: '.trp-sortable-handle' });
|
143 |
-
jQuery( '#trp-add-language' ).click( _this.add_language );
|
144 |
-
jQuery( '.trp-remove-language' ).click( _this.remove_language );
|
145 |
-
jQuery( '#trp-default-language' ).on( 'change', _this.update_default_language );
|
146 |
-
jQuery( "form[action='options.php']").on ( 'submit', _this.check_unique_url_slugs );
|
147 |
-
jQuery( '#trp-languages-table' ).on( 'change', '.trp-translation-language', _this.update_url_slug_and_status );
|
148 |
-
};
|
149 |
-
|
150 |
-
this.initialize();
|
151 |
-
}
|
152 |
-
|
153 |
-
/*
|
154 |
-
* Manage adding and removing items from an option of tpe list from Advanced Settings page
|
155 |
-
*/
|
156 |
-
function TRP_Advanced_Settings_List( table ){
|
157 |
-
|
158 |
-
var _this = this
|
159 |
-
|
160 |
-
this.addEventHandlers = function( table ){
|
161 |
-
var add_list_entry = table.querySelector( '.trp-add-list-entry' );
|
162 |
-
|
163 |
-
// add event listener on ADD button
|
164 |
-
add_list_entry.querySelector('.trp-adst-button-add-new-item').addEventListener("click", function(){
|
165 |
-
|
166 |
-
var clone = add_list_entry.cloneNode(true)
|
167 |
-
|
168 |
-
// Show Add button, hide Remove button
|
169 |
-
clone.querySelector( '.trp-adst-button-add-new-item' ).style.display = 'none'
|
170 |
-
clone.querySelector( '.trp-adst-remove-element' ).style.display = 'block'
|
171 |
-
|
172 |
-
// Add row with new item in the html table
|
173 |
-
var itemInserted = add_list_entry.parentElement.insertBefore( clone, add_list_entry );
|
174 |
-
|
175 |
-
// Set name attributes
|
176 |
-
var dataNames = clone.querySelectorAll( '[data-name]' )
|
177 |
-
for( var i = 0 ; i < dataNames.length ; i++ ) {
|
178 |
-
dataNames[i].setAttribute( 'name', dataNames[i].getAttribute('data-name') );
|
179 |
-
}
|
180 |
-
|
181 |
-
// Reset values of textareas with new items
|
182 |
-
var dataValues = add_list_entry.querySelectorAll( '[data-name]' )
|
183 |
-
for( var i = 0 ; i < dataValues.length ; i++ ) {
|
184 |
-
dataValues[i].value = ''
|
185 |
-
}
|
186 |
-
|
187 |
-
// Add click listener on new row's Remove button
|
188 |
-
var removeButton = itemInserted.querySelector('.trp-adst-remove-element');
|
189 |
-
removeButton.addEventListener("click", _this.remove_item );
|
190 |
-
});
|
191 |
-
|
192 |
-
var removeButtons = table.querySelectorAll( '.trp-adst-remove-element' );
|
193 |
-
for( var i = 0 ; i < removeButtons.length ; i++ ) {
|
194 |
-
removeButtons[i].addEventListener("click", _this.remove_item)
|
195 |
-
}
|
196 |
-
}
|
197 |
-
|
198 |
-
this.remove_item = function( event ){
|
199 |
-
if ( confirm( event.target.getAttribute( 'data-confirm-message' ) ) ){
|
200 |
-
jQuery( event.target ).closest( '.trp-list-entry' ).remove()
|
201 |
-
}
|
202 |
-
}
|
203 |
-
|
204 |
-
_this.addEventHandlers( table )
|
205 |
-
}
|
206 |
-
|
207 |
-
var trpSettingsLanguages = new TRP_Settings_Language_Selector();
|
208 |
-
|
209 |
-
jQuery('#trp-default-language').on("select2:selecting", function(e) {
|
210 |
-
jQuery("#trp-options .warning").show('fast');
|
211 |
-
});
|
212 |
-
|
213 |
-
var trpGoogleTranslateKey = TRP_Field_Toggler();
|
214 |
-
trpGoogleTranslateKey.init('.trp-translation-engine', '#trp-g-translate-key', 'google_translate_v2' );
|
215 |
-
|
216 |
-
var deeplUpsell = TRP_Field_Toggler();
|
217 |
-
deeplUpsell.init('.trp-translation-engine', '#trp-upsell-deepl', 'deepl_upsell' );
|
218 |
-
|
219 |
-
jQuery(document).trigger( 'trpInitFieldToggler' );
|
220 |
-
|
221 |
-
// Used for the main machine translation toggle to show/hide all options below it
|
222 |
-
function TRP_show_hide_machine_translation_options(){
|
223 |
-
if( jQuery( '#trp-machine-translation-enabled' ).val() != 'yes' )
|
224 |
-
jQuery( '.trp-machine-translation-options tbody tr:not(:first-child)').hide()
|
225 |
-
else
|
226 |
-
jQuery( '.trp-machine-translation-options tbody tr:not(:first-child)').show()
|
227 |
-
|
228 |
-
if( jQuery( '#trp-machine-translation-enabled' ).val() == 'yes' )
|
229 |
-
jQuery('.trp-translation-engine:checked').trigger('change')
|
230 |
-
}
|
231 |
-
|
232 |
-
// Hide this row when DeepL upsell is showing
|
233 |
-
function TRP_hide_test_api_key(){
|
234 |
-
if( jQuery( '.trp-translation-engine:checked' ).val() == 'deepl_upsell' )
|
235 |
-
jQuery( '#trp-test-api-key' ).hide()
|
236 |
-
else {
|
237 |
-
if( jQuery('#trp-machine-translation-enabled').val() != 'no' )
|
238 |
-
jQuery( '#trp-test-api-key' ).show()
|
239 |
-
}
|
240 |
-
}
|
241 |
-
|
242 |
-
TRP_show_hide_machine_translation_options()
|
243 |
-
jQuery('#trp-machine-translation-enabled').on( 'change', function(){
|
244 |
-
TRP_show_hide_machine_translation_options()
|
245 |
-
})
|
246 |
-
|
247 |
-
TRP_hide_test_api_key()
|
248 |
-
jQuery('.trp-translation-engine').on( 'change', function(){
|
249 |
-
TRP_hide_test_api_key()
|
250 |
-
})
|
251 |
-
|
252 |
-
// Options of type List adding, from Advanced Settings page
|
253 |
-
var trpListOptions = document.querySelectorAll( '.trp-adst-list-option' );
|
254 |
-
for ( var i = 0 ; i < trpListOptions.length ; i++ ){
|
255 |
-
new TRP_Advanced_Settings_List( trpListOptions[i] );
|
256 |
-
}
|
257 |
-
|
258 |
-
});
|
259 |
-
|
260 |
-
function TRP_Field_Toggler (){
|
261 |
-
var _$setting_toggled, _$trigger_field, _trigger_field_value_for_show, _trigger_field_value
|
262 |
-
|
263 |
-
function show_hide_based_on_value( value ) {
|
264 |
-
if ( value === _trigger_field_value_for_show )
|
265 |
-
_$setting_toggled.show()
|
266 |
-
else
|
267 |
-
_$setting_toggled.hide()
|
268 |
-
}
|
269 |
-
|
270 |
-
function add_event_on_change() {
|
271 |
-
|
272 |
-
_$trigger_field.on('change', function () {
|
273 |
-
show_hide_based_on_value( this.value )
|
274 |
-
})
|
275 |
-
|
276 |
-
}
|
277 |
-
|
278 |
-
function init( trigger_select_id, setting_id, value_for_show ){
|
279 |
-
_trigger_field_value_for_show = value_for_show
|
280 |
-
_$trigger_field = jQuery( trigger_select_id )
|
281 |
-
_$setting_toggled = jQuery( setting_id ).parents('tr')
|
282 |
-
|
283 |
-
if( _$trigger_field.hasClass( 'trp-radio') )
|
284 |
-
_trigger_field_value = jQuery( trigger_select_id + ':checked' ).val()
|
285 |
-
else
|
286 |
-
_trigger_field_value = _$trigger_field.val()
|
287 |
-
|
288 |
-
show_hide_based_on_value( _trigger_field_value )
|
289 |
-
add_event_on_change()
|
290 |
-
}
|
291 |
-
|
292 |
-
return {
|
293 |
-
init: init
|
294 |
-
}
|
295 |
-
}
|
1 |
+
/*
|
2 |
+
* Script used in Settings Page
|
3 |
+
*/
|
4 |
+
|
5 |
+
jQuery( function() {
|
6 |
+
|
7 |
+
/**
|
8 |
+
* Change the language selector and slugs
|
9 |
+
*/
|
10 |
+
function TRP_Settings_Language_Selector() {
|
11 |
+
var _this = this;
|
12 |
+
var duplicate_url_error_message;
|
13 |
+
var iso_codes;
|
14 |
+
|
15 |
+
/**
|
16 |
+
* Initialize select to become select2
|
17 |
+
*/
|
18 |
+
this.initialize_select2 = function () {
|
19 |
+
jQuery('.trp-select2').each(function () {
|
20 |
+
var select_element = jQuery(this);
|
21 |
+
select_element.select2(/*arguments*/);
|
22 |
+
});
|
23 |
+
};
|
24 |
+
|
25 |
+
this.get_default_url_slug = function( new_language ){
|
26 |
+
var return_slug = iso_codes[new_language];
|
27 |
+
var url_slugs = _this.get_existing_url_slugs();
|
28 |
+
url_slugs.push( return_slug );
|
29 |
+
if ( has_duplicates ( url_slugs ) ){
|
30 |
+
return_slug = new_language;
|
31 |
+
}
|
32 |
+
return return_slug.toLowerCase();
|
33 |
+
};
|
34 |
+
|
35 |
+
this.add_language = function(){
|
36 |
+
var selected_language = jQuery( '#trp-select-language' );
|
37 |
+
var new_language = selected_language.val();
|
38 |
+
if ( new_language == "" ){
|
39 |
+
return;
|
40 |
+
}
|
41 |
+
|
42 |
+
if (jQuery( "#trp-languages-table .trp-language" ).length >= 2 ){
|
43 |
+
jQuery(".trp-upsell-multiple-languages").show('fast');
|
44 |
+
return;
|
45 |
+
}
|
46 |
+
|
47 |
+
selected_language.val( '' ).trigger( 'change' );
|
48 |
+
|
49 |
+
var new_option = jQuery( '.trp-language' ).first().clone();
|
50 |
+
new_option = jQuery( new_option );
|
51 |
+
|
52 |
+
new_option.find( '.trp-hidden-default-language' ).remove();
|
53 |
+
new_option.find( '.select2-container' ).remove();
|
54 |
+
var select = new_option.find( 'select.trp-translation-language' );
|
55 |
+
select.removeAttr( 'disabled' );
|
56 |
+
select.find( 'option' ).each(function(index, el){
|
57 |
+
el.text = el.text.replace('Default: ', '');
|
58 |
+
})
|
59 |
+
|
60 |
+
select.val( new_language );
|
61 |
+
select.select2();
|
62 |
+
|
63 |
+
var checkbox = new_option.find( 'input.trp-translation-published' );
|
64 |
+
checkbox.removeAttr( 'disabled' );
|
65 |
+
checkbox.val( new_language );
|
66 |
+
|
67 |
+
var url_slug = new_option.find( 'input.trp-language-slug' );
|
68 |
+
url_slug.val( _this.get_default_url_slug( new_language ) );
|
69 |
+
url_slug.attr('name', 'trp_settings[url-slugs][' + new_language + ']' );
|
70 |
+
|
71 |
+
var language_code = new_option.find( 'input.trp-language-code' );
|
72 |
+
language_code.val( new_language);
|
73 |
+
|
74 |
+
var remove = new_option.find( '.trp-remove-language' ).toggle();
|
75 |
+
|
76 |
+
new_option = jQuery( '#trp-sortable-languages' ).append( new_option );
|
77 |
+
new_option.find( '.trp-remove-language' ).last().click( _this.remove_language );
|
78 |
+
};
|
79 |
+
|
80 |
+
this.remove_language = function( element ){
|
81 |
+
var message = jQuery( element.target ).attr( 'data-confirm-message' );
|
82 |
+
var confirmed = confirm( message );
|
83 |
+
if ( confirmed ) {
|
84 |
+
jQuery ( element.target ).parent().parent().remove();
|
85 |
+
}
|
86 |
+
};
|
87 |
+
|
88 |
+
this.update_default_language = function(){
|
89 |
+
var selected_language = jQuery( '#trp-default-language').val();
|
90 |
+
jQuery( '.trp-hidden-default-language' ).val( selected_language );
|
91 |
+
jQuery( '.trp-translation-published[disabled]' ).val( selected_language );
|
92 |
+
jQuery( '.trp-translation-language[disabled]').val( selected_language ).trigger( 'change' );
|
93 |
+
};
|
94 |
+
|
95 |
+
function has_duplicates(array) {
|
96 |
+
var valuesSoFar = Object.create(null);
|
97 |
+
for (var i = 0; i < array.length; ++i) {
|
98 |
+
var value = array[i];
|
99 |
+
if (value in valuesSoFar) {
|
100 |
+
return true;
|
101 |
+
}
|
102 |
+
valuesSoFar[value] = true;
|
103 |
+
}
|
104 |
+
return false;
|
105 |
+
}
|
106 |
+
|
107 |
+
this.get_existing_url_slugs = function(){
|
108 |
+
var url_slugs = [];
|
109 |
+
jQuery( '.trp-language-slug' ).each( function (){
|
110 |
+
url_slugs.push( jQuery( this ).val().toLowerCase() );
|
111 |
+
} );
|
112 |
+
return url_slugs;
|
113 |
+
};
|
114 |
+
|
115 |
+
this.check_unique_url_slugs = function (event){
|
116 |
+
var url_slugs = _this.get_existing_url_slugs();
|
117 |
+
if ( has_duplicates(url_slugs)){
|
118 |
+
alert( duplicate_url_error_message );
|
119 |
+
event.preventDefault();
|
120 |
+
}
|
121 |
+
};
|
122 |
+
|
123 |
+
this.update_url_slug_and_status = function ( event ) {
|
124 |
+
var select = jQuery( event.target );
|
125 |
+
var new_language = select.val();
|
126 |
+
var row = jQuery( select ).parents( '.trp-language' ) ;
|
127 |
+
row.find( '.trp-language-slug' ).attr( 'name', 'trp_settings[url-slugs][' + new_language + ']').val( '' ).val( _this.get_default_url_slug( new_language ) );
|
128 |
+
row.find( '.trp-language-code' ).val( '' ).val( new_language );
|
129 |
+
row.find( '.trp-translation-published' ).val( new_language );
|
130 |
+
};
|
131 |
+
|
132 |
+
this.initialize = function () {
|
133 |
+
this.initialize_select2();
|
134 |
+
|
135 |
+
if ( !jQuery( '.trp-language-selector-limited' ).length ){
|
136 |
+
return;
|
137 |
+
}
|
138 |
+
|
139 |
+
duplicate_url_error_message = trp_url_slugs_info['error_message_duplicate_slugs'];
|
140 |
+
iso_codes = trp_url_slugs_info['iso_codes'];
|
141 |
+
|
142 |
+
jQuery( '#trp-sortable-languages' ).sortable({ handle: '.trp-sortable-handle' });
|
143 |
+
jQuery( '#trp-add-language' ).click( _this.add_language );
|
144 |
+
jQuery( '.trp-remove-language' ).click( _this.remove_language );
|
145 |
+
jQuery( '#trp-default-language' ).on( 'change', _this.update_default_language );
|
146 |
+
jQuery( "form[action='options.php']").on ( 'submit', _this.check_unique_url_slugs );
|
147 |
+
jQuery( '#trp-languages-table' ).on( 'change', '.trp-translation-language', _this.update_url_slug_and_status );
|
148 |
+
};
|
149 |
+
|
150 |
+
this.initialize();
|
151 |
+
}
|
152 |
+
|
153 |
+
/*
|
154 |
+
* Manage adding and removing items from an option of tpe list from Advanced Settings page
|
155 |
+
*/
|
156 |
+
function TRP_Advanced_Settings_List( table ){
|
157 |
+
|
158 |
+
var _this = this
|
159 |
+
|
160 |
+
this.addEventHandlers = function( table ){
|
161 |
+
var add_list_entry = table.querySelector( '.trp-add-list-entry' );
|
162 |
+
|
163 |
+
// add event listener on ADD button
|
164 |
+
add_list_entry.querySelector('.trp-adst-button-add-new-item').addEventListener("click", function(){
|
165 |
+
|
166 |
+
var clone = add_list_entry.cloneNode(true)
|
167 |
+
|
168 |
+
// Show Add button, hide Remove button
|
169 |
+
clone.querySelector( '.trp-adst-button-add-new-item' ).style.display = 'none'
|
170 |
+
clone.querySelector( '.trp-adst-remove-element' ).style.display = 'block'
|
171 |
+
|
172 |
+
// Add row with new item in the html table
|
173 |
+
var itemInserted = add_list_entry.parentElement.insertBefore( clone, add_list_entry );
|
174 |
+
|
175 |
+
// Set name attributes
|
176 |
+
var dataNames = clone.querySelectorAll( '[data-name]' )
|
177 |
+
for( var i = 0 ; i < dataNames.length ; i++ ) {
|
178 |
+
dataNames[i].setAttribute( 'name', dataNames[i].getAttribute('data-name') );
|
179 |
+
}
|
180 |
+
|
181 |
+
// Reset values of textareas with new items
|
182 |
+
var dataValues = add_list_entry.querySelectorAll( '[data-name]' )
|
183 |
+
for( var i = 0 ; i < dataValues.length ; i++ ) {
|
184 |
+
dataValues[i].value = ''
|
185 |
+
}
|
186 |
+
|
187 |
+
// Add click listener on new row's Remove button
|
188 |
+
var removeButton = itemInserted.querySelector('.trp-adst-remove-element');
|
189 |
+
removeButton.addEventListener("click", _this.remove_item );
|
190 |
+
});
|
191 |
+
|
192 |
+
var removeButtons = table.querySelectorAll( '.trp-adst-remove-element' );
|
193 |
+
for( var i = 0 ; i < removeButtons.length ; i++ ) {
|
194 |
+
removeButtons[i].addEventListener("click", _this.remove_item)
|
195 |
+
}
|
196 |
+
}
|
197 |
+
|
198 |
+
this.remove_item = function( event ){
|
199 |
+
if ( confirm( event.target.getAttribute( 'data-confirm-message' ) ) ){
|
200 |
+
jQuery( event.target ).closest( '.trp-list-entry' ).remove()
|
201 |
+
}
|
202 |
+
}
|
203 |
+
|
204 |
+
_this.addEventHandlers( table )
|
205 |
+
}
|
206 |
+
|
207 |
+
var trpSettingsLanguages = new TRP_Settings_Language_Selector();
|
208 |
+
|
209 |
+
jQuery('#trp-default-language').on("select2:selecting", function(e) {
|
210 |
+
jQuery("#trp-options .warning").show('fast');
|
211 |
+
});
|
212 |
+
|
213 |
+
var trpGoogleTranslateKey = TRP_Field_Toggler();
|
214 |
+
trpGoogleTranslateKey.init('.trp-translation-engine', '#trp-g-translate-key', 'google_translate_v2' );
|
215 |
+
|
216 |
+
var deeplUpsell = TRP_Field_Toggler();
|
217 |
+
deeplUpsell.init('.trp-translation-engine', '#trp-upsell-deepl', 'deepl_upsell' );
|
218 |
+
|
219 |
+
jQuery(document).trigger( 'trpInitFieldToggler' );
|
220 |
+
|
221 |
+
// Used for the main machine translation toggle to show/hide all options below it
|
222 |
+
function TRP_show_hide_machine_translation_options(){
|
223 |
+
if( jQuery( '#trp-machine-translation-enabled' ).val() != 'yes' )
|
224 |
+
jQuery( '.trp-machine-translation-options tbody tr:not(:first-child)').hide()
|
225 |
+
else
|
226 |
+
jQuery( '.trp-machine-translation-options tbody tr:not(:first-child)').show()
|
227 |
+
|
228 |
+
if( jQuery( '#trp-machine-translation-enabled' ).val() == 'yes' )
|
229 |
+
jQuery('.trp-translation-engine:checked').trigger('change')
|
230 |
+
}
|
231 |
+
|
232 |
+
// Hide this row when DeepL upsell is showing
|
233 |
+
function TRP_hide_test_api_key(){
|
234 |
+
if( jQuery( '.trp-translation-engine:checked' ).val() == 'deepl_upsell' )
|
235 |
+
jQuery( '#trp-test-api-key' ).hide()
|
236 |
+
else {
|
237 |
+
if( jQuery('#trp-machine-translation-enabled').val() != 'no' )
|
238 |
+
jQuery( '#trp-test-api-key' ).show()
|
239 |
+
}
|
240 |
+
}
|
241 |
+
|
242 |
+
TRP_show_hide_machine_translation_options()
|
243 |
+
jQuery('#trp-machine-translation-enabled').on( 'change', function(){
|
244 |
+
TRP_show_hide_machine_translation_options()
|
245 |
+
})
|
246 |
+
|
247 |
+
TRP_hide_test_api_key()
|
248 |
+
jQuery('.trp-translation-engine').on( 'change', function(){
|
249 |
+
TRP_hide_test_api_key()
|
250 |
+
})
|
251 |
+
|
252 |
+
// Options of type List adding, from Advanced Settings page
|
253 |
+
var trpListOptions = document.querySelectorAll( '.trp-adst-list-option' );
|
254 |
+
for ( var i = 0 ; i < trpListOptions.length ; i++ ){
|
255 |
+
new TRP_Advanced_Settings_List( trpListOptions[i] );
|
256 |
+
}
|
257 |
+
|
258 |
+
});
|
259 |
+
|
260 |
+
function TRP_Field_Toggler (){
|
261 |
+
var _$setting_toggled, _$trigger_field, _trigger_field_value_for_show, _trigger_field_value
|
262 |
+
|
263 |
+
function show_hide_based_on_value( value ) {
|
264 |
+
if ( value === _trigger_field_value_for_show )
|
265 |
+
_$setting_toggled.show()
|
266 |
+
else
|
267 |
+
_$setting_toggled.hide()
|
268 |
+
}
|
269 |
+
|
270 |
+
function add_event_on_change() {
|
271 |
+
|
272 |
+
_$trigger_field.on('change', function () {
|
273 |
+
show_hide_based_on_value( this.value )
|
274 |
+
})
|
275 |
+
|
276 |
+
}
|
277 |
+
|
278 |
+
function init( trigger_select_id, setting_id, value_for_show ){
|
279 |
+
_trigger_field_value_for_show = value_for_show
|
280 |
+
_$trigger_field = jQuery( trigger_select_id )
|
281 |
+
_$setting_toggled = jQuery( setting_id ).parents('tr')
|
282 |
+
|
283 |
+
if( _$trigger_field.hasClass( 'trp-radio') )
|
284 |
+
_trigger_field_value = jQuery( trigger_select_id + ':checked' ).val()
|
285 |
+
else
|
286 |
+
_trigger_field_value = _$trigger_field.val()
|
287 |
+
|
288 |
+
show_hide_based_on_value( _trigger_field_value )
|
289 |
+
add_event_on_change()
|
290 |
+
}
|
291 |
+
|
292 |
+
return {
|
293 |
+
init: init
|
294 |
+
}
|
295 |
+
}
|
assets/js/trp-editor-overlay.js
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
-
jQuery( document ).ready(function(){
|
2 |
-
/* jQuery('#wppb_manage_fields #field').select2({
|
3 |
-
placeholder: 'Select an option'
|
4 |
-
})*/
|
5 |
-
|
6 |
-
// var overlay = jQuery('<div id="trp_select2_overlay"> </div>')
|
7 |
-
// overlay.appendTo('#trp-controls');
|
8 |
-
|
9 |
-
var $eventSelectLanguage = jQuery("#trp-language-select");
|
10 |
-
$eventSelectLanguage.on("select2:open", function (e) {
|
11 |
-
jQuery('#trp_select2_overlay').fadeIn('100')
|
12 |
-
});
|
13 |
-
$eventSelectLanguage.on("select2:close", function (e) {
|
14 |
-
jQuery('#trp_select2_overlay').hide();
|
15 |
-
});
|
16 |
-
|
17 |
-
var $eventSelectString = jQuery("#trp-string-categories");
|
18 |
-
$eventSelectString.on("select2:open", function (e) {
|
19 |
-
jQuery('#trp_select2_overlay').fadeIn('100')
|
20 |
-
});
|
21 |
-
$eventSelectString.on("select2:close", function (e) {
|
22 |
-
jQuery('#trp_select2_overlay').hide();
|
23 |
-
});
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
})
|
1 |
+
jQuery( document ).ready(function(){
|
2 |
+
/* jQuery('#wppb_manage_fields #field').select2({
|
3 |
+
placeholder: 'Select an option'
|
4 |
+
})*/
|
5 |
+
|
6 |
+
// var overlay = jQuery('<div id="trp_select2_overlay"> </div>')
|
7 |
+
// overlay.appendTo('#trp-controls');
|
8 |
+
|
9 |
+
var $eventSelectLanguage = jQuery("#trp-language-select");
|
10 |
+
$eventSelectLanguage.on("select2:open", function (e) {
|
11 |
+
jQuery('#trp_select2_overlay').fadeIn('100')
|
12 |
+
});
|
13 |
+
$eventSelectLanguage.on("select2:close", function (e) {
|
14 |
+
jQuery('#trp_select2_overlay').hide();
|
15 |
+
});
|
16 |
+
|
17 |
+
var $eventSelectString = jQuery("#trp-string-categories");
|
18 |
+
$eventSelectString.on("select2:open", function (e) {
|
19 |
+
jQuery('#trp_select2_overlay').fadeIn('100')
|
20 |
+
});
|
21 |
+
$eventSelectString.on("select2:close", function (e) {
|
22 |
+
jQuery('#trp_select2_overlay').hide();
|
23 |
+
});
|
24 |
+
|
25 |
+
|
26 |
+
|
27 |
+
})
|
assets/js/trp-editor.js
CHANGED
@@ -94,7 +94,7 @@
|
|
94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
|
96 |
"use strict";
|
97 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _extra_content_vue_vue_type_template_id_1b1c5c60___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extra-content.vue?vue&type=template&id=1b1c5c60& */ \"./assets/src/js/components/extra-content.vue?vue&type=template&id=1b1c5c60&\");\n/* harmony import */ var _extra_content_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extra-content.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/extra-content.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _extra_content_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _extra_content_vue_vue_type_template_id_1b1c5c60___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _extra_content_vue_vue_type_template_id_1b1c5c60___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/extra-content.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvZXh0cmEtY29udGVudC52dWU/NjgzZCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUE0RjtBQUMzQjtBQUNMOzs7QUFHNUQ7QUFDZ0c7QUFDaEcsZ0JBQWdCLDJHQUFVO0FBQzFCLEVBQUUsbUZBQU07QUFDUixFQUFFLHdGQUFNO0FBQ1IsRUFBRSxpR0FBZTtBQUNqQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBLElBQUksS0FBVSxFQUFFLFlBaUJmO0FBQ0Q7QUFDZSxnRiIsImZpbGUiOiIuL2Fzc2V0cy9zcmMvanMvY29tcG9uZW50cy9leHRyYS1jb250ZW50LnZ1ZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHJlbmRlciwgc3RhdGljUmVuZGVyRm5zIH0gZnJvbSBcIi4vZXh0cmEtY29udGVudC52dWU/dnVlJnR5cGU9dGVtcGxhdGUmaWQ9MWIxYzVjNjAmXCJcbmltcG9ydCBzY3JpcHQgZnJvbSBcIi4vZXh0cmEtY29udGVudC52dWU/
|
98 |
|
99 |
/***/ }),
|
100 |
|
@@ -130,7 +130,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
130 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
131 |
|
132 |
"use strict";
|
133 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _hover_actions_vue_vue_type_template_id_b0793be0___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hover-actions.vue?vue&type=template&id=b0793be0& */ \"./assets/src/js/components/hover-actions.vue?vue&type=template&id=b0793be0&\");\n/* harmony import */ var _hover_actions_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hover-actions.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/hover-actions.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _hover_actions_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _hover_actions_vue_vue_type_template_id_b0793be0___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _hover_actions_vue_vue_type_template_id_b0793be0___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/hover-actions.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvaG92ZXItYWN0aW9ucy52dWU/ZTMzNyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUE0RjtBQUMzQjtBQUNMOzs7QUFHNUQ7QUFDZ0c7QUFDaEcsZ0JBQWdCLDJHQUFVO0FBQzFCLEVBQUUsbUZBQU07QUFDUixFQUFFLHdGQUFNO0FBQ1IsRUFBRSxpR0FBZTtBQUNqQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBLElBQUksS0FBVSxFQUFFLFlBaUJmO0FBQ0Q7QUFDZSxnRiIsImZpbGUiOiIuL2Fzc2V0cy9zcmMvanMvY29tcG9uZW50cy9ob3Zlci1hY3Rpb25zLnZ1ZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHJlbmRlciwgc3RhdGljUmVuZGVyRm5zIH0gZnJvbSBcIi4vaG92ZXItYWN0aW9ucy52dWU/dnVlJnR5cGU9dGVtcGxhdGUmaWQ9YjA3OTNiZTAmXCJcbmltcG9ydCBzY3JpcHQgZnJvbSBcIi4vaG92ZXItYWN0aW9ucy52dWU/
|
134 |
|
135 |
/***/ }),
|
136 |
|
@@ -166,7 +166,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
166 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
167 |
|
168 |
"use strict";
|
169 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _language_boxes_vue_vue_type_template_id_3f80cf10___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./language-boxes.vue?vue&type=template&id=3f80cf10& */ \"./assets/src/js/components/language-boxes.vue?vue&type=template&id=3f80cf10&\");\n/* harmony import */ var _language_boxes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./language-boxes.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/language-boxes.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _language_boxes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _language_boxes_vue_vue_type_template_id_3f80cf10___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _language_boxes_vue_vue_type_template_id_3f80cf10___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/language-boxes.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvbGFuZ3VhZ2UtYm94ZXMudnVlPzE3NWIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBNkY7QUFDM0I7QUFDTDs7O0FBRzdEO0FBQ2dHO0FBQ2hHLGdCQUFnQiwyR0FBVTtBQUMxQixFQUFFLG9GQUFNO0FBQ1IsRUFBRSx5RkFBTTtBQUNSLEVBQUUsa0dBQWU7QUFDakI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSxJQUFJLEtBQVUsRUFBRSxZQWlCZjtBQUNEO0FBQ2UsZ0YiLCJmaWxlIjoiLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvbGFuZ3VhZ2UtYm94ZXMudnVlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcmVuZGVyLCBzdGF0aWNSZW5kZXJGbnMgfSBmcm9tIFwiLi9sYW5ndWFnZS1ib3hlcy52dWU/dnVlJnR5cGU9dGVtcGxhdGUmaWQ9M2Y4MGNmMTAmXCJcbmltcG9ydCBzY3JpcHQgZnJvbSBcIi4vbGFuZ3VhZ2UtYm94ZXMudnVlP3Z1ZSZ0eXBlPXNjcmlwdCZsYW5nPWpzJlwiXG5leHBvcnQgKiBmcm9tIFwiLi9sYW5ndWFnZS1ib3hlcy52dWU/
|
170 |
|
171 |
/***/ }),
|
172 |
|
@@ -202,7 +202,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
202 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
203 |
|
204 |
"use strict";
|
205 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _save_translations_vue_vue_type_template_id_1ec6ec54___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./save-translations.vue?vue&type=template&id=1ec6ec54& */ \"./assets/src/js/components/save-translations.vue?vue&type=template&id=1ec6ec54&\");\n/* harmony import */ var _save_translations_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./save-translations.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/save-translations.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _save_translations_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _save_translations_vue_vue_type_template_id_1ec6ec54___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _save_translations_vue_vue_type_template_id_1ec6ec54___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/save-translations.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvc2F2ZS10cmFuc2xhdGlvbnMudnVlP2ZlNzciXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBZ0c7QUFDM0I7QUFDTDs7O0FBR2hFO0FBQ2dHO0FBQ2hHLGdCQUFnQiwyR0FBVTtBQUMxQixFQUFFLHVGQUFNO0FBQ1IsRUFBRSw0RkFBTTtBQUNSLEVBQUUscUdBQWU7QUFDakI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSxJQUFJLEtBQVUsRUFBRSxZQWlCZjtBQUNEO0FBQ2UsZ0YiLCJmaWxlIjoiLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvc2F2ZS10cmFuc2xhdGlvbnMudnVlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcmVuZGVyLCBzdGF0aWNSZW5kZXJGbnMgfSBmcm9tIFwiLi9zYXZlLXRyYW5zbGF0aW9ucy52dWU/dnVlJnR5cGU9dGVtcGxhdGUmaWQ9MWVjNmVjNTQmXCJcbmltcG9ydCBzY3JpcHQgZnJvbSBcIi4vc2F2ZS10cmFuc2xhdGlvbnMudnVlP3Z1ZSZ0eXBlPXNjcmlwdCZsYW5nPWpzJlwiXG5leHBvcnQgKiBmcm9tIFwiLi9zYXZlLXRyYW5zbGF0aW9ucy52dWU/
|
206 |
|
207 |
/***/ }),
|
208 |
|
@@ -238,7 +238,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
238 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
239 |
|
240 |
"use strict";
|
241 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _translation_input_vue_vue_type_template_id_3871315c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./translation-input.vue?vue&type=template&id=3871315c& */ \"./assets/src/js/components/translation-input.vue?vue&type=template&id=3871315c&\");\n/* harmony import */ var _translation_input_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-input.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/translation-input.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _translation_input_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _translation_input_vue_vue_type_template_id_3871315c___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _translation_input_vue_vue_type_template_id_3871315c___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/translation-input.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvdHJhbnNsYXRpb24taW5wdXQudnVlPzEzZTkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBZ0c7QUFDM0I7QUFDTDs7O0FBR2hFO0FBQ2dHO0FBQ2hHLGdCQUFnQiwyR0FBVTtBQUMxQixFQUFFLHVGQUFNO0FBQ1IsRUFBRSw0RkFBTTtBQUNSLEVBQUUscUdBQWU7QUFDakI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSxJQUFJLEtBQVUsRUFBRSxZQWlCZjtBQUNEO0FBQ2UsZ0YiLCJmaWxlIjoiLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvdHJhbnNsYXRpb24taW5wdXQudnVlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgcmVuZGVyLCBzdGF0aWNSZW5kZXJGbnMgfSBmcm9tIFwiLi90cmFuc2xhdGlvbi1pbnB1dC52dWU/dnVlJnR5cGU9dGVtcGxhdGUmaWQ9Mzg3MTMxNWMmXCJcbmltcG9ydCBzY3JpcHQgZnJvbSBcIi4vdHJhbnNsYXRpb24taW5wdXQudnVlP3Z1ZSZ0eXBlPXNjcmlwdCZsYW5nPWpzJlwiXG5leHBvcnQgKiBmcm9tIFwiLi90cmFuc2xhdGlvbi1pbnB1dC52dWU/
|
242 |
|
243 |
/***/ }),
|
244 |
|
@@ -274,7 +274,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
274 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
275 |
|
276 |
"use strict";
|
277 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _translation_memory_vue_vue_type_template_id_891e19ae___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./translation-memory.vue?vue&type=template&id=891e19ae& */ \"./assets/src/js/components/translation-memory.vue?vue&type=template&id=891e19ae&\");\n/* harmony import */ var _translation_memory_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-memory.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/translation-memory.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _translation_memory_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _translation_memory_vue_vue_type_template_id_891e19ae___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _translation_memory_vue_vue_type_template_id_891e19ae___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/translation-memory.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvdHJhbnNsYXRpb24tbWVtb3J5LnZ1ZT9mNTUwIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQWlHO0FBQzNCO0FBQ0w7OztBQUdqRTtBQUNnRztBQUNoRyxnQkFBZ0IsMkdBQVU7QUFDMUIsRUFBRSx3RkFBTTtBQUNSLEVBQUUsNkZBQU07QUFDUixFQUFFLHNHQUFlO0FBQ2pCO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0EsSUFBSSxLQUFVLEVBQUUsWUFpQmY7QUFDRDtBQUNlLGdGIiwiZmlsZSI6Ii4vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL3RyYW5zbGF0aW9uLW1lbW9yeS52dWUuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyByZW5kZXIsIHN0YXRpY1JlbmRlckZucyB9IGZyb20gXCIuL3RyYW5zbGF0aW9uLW1lbW9yeS52dWU/
|
278 |
|
279 |
/***/ }),
|
280 |
|
@@ -310,7 +310,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
310 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
311 |
|
312 |
"use strict";
|
313 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _editor_vue_vue_type_template_id_b046e8ec___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.vue?vue&type=template&id=b046e8ec& */ \"./assets/src/js/editor.vue?vue&type=template&id=b046e8ec&\");\n/* harmony import */ var _editor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./editor.vue?vue&type=script&lang=js& */ \"./assets/src/js/editor.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _editor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _editor_vue_vue_type_template_id_b046e8ec___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _editor_vue_vue_type_template_id_b046e8ec___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/editor.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2VkaXRvci52dWU/
|
314 |
|
315 |
/***/ }),
|
316 |
|
@@ -346,7 +346,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nod
|
|
346 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
347 |
|
348 |
"use strict";
|
349 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.common.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _editor_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./editor.vue */ \"./assets/src/js/editor.vue\");\n\n\n\nif (document.getElementById('trp-editor-container')) {\n window.tpEditorApp = new vue__WEBPACK_IMPORTED_MODULE_0___default.a({\n components: {\n 'trp-editor': _editor_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n },\n el: '#trp-editor-container',\n data: {}\n /* Not needed for now. Maybe activate this in the future\
|
350 |
|
351 |
/***/ }),
|
352 |
|
@@ -358,7 +358,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_
|
|
358 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
359 |
|
360 |
"use strict";
|
361 |
-
eval("__webpack_require__.r(__webpack_exports__);\nfunction removeUrlParameter(url, parameter) {\n var parts = url.split('?');\n\n if (parts.length >= 2) {\n var prefix = encodeURIComponent(parameter) + '=';\n var pairs = parts[1].split(/[&;]/g); //reverse iteration as may be destructive\n\n for (var i = pairs.length; i-- > 0;) {\n //idiom for string.startsWith\n if (pairs[i].lastIndexOf(prefix, 0) !== -1) {\n pairs.splice(i, 1);\n }\n }\n\n url = parts[0] + (pairs.length > 0 ? '?' + pairs.join('&') : \"\");\n return url;\n } else {\n return url;\n }\n}\n\nfunction escapeHtml(string) {\n var doc = new DOMParser().parseFromString(string, 'text/html');\n return doc.body.textContent || \"\";\n}\n\nfunction getFilename(url) {\n if (url) return url.substring(url.lastIndexOf(\"/\") + 1, url.lastIndexOf(\".\"));\n return url;\n}\n\nfunction unwrap(wrapper) {\n var docFrag = document.createDocumentFragment();\n\n while (wrapper.firstChild) {\n var child = wrapper.removeChild(wrapper.firstChild);\n docFrag.appendChild(child);\n }\n\n wrapper.parentNode.replaceChild(docFrag, wrapper);\n}\n\nfunction arrayContainsItem(array, item) {\n var i;\n var length = array.length;\n\n for (i = length - 1; i >= 0; i--) {\n if (array[i] === item) {\n return true;\n }\n }\n\n return false;\n} //Adds or updates an existing query parameter in an url\n\n\nfunction updateUrlParameter(uri, key, value) {\n var regex = new RegExp(\"([?&])\" + key + \"=.*?(&|#|$)\", \"i\");\n if (uri.match(regex)) return uri.replace(regex, '$1' + key + \"=\" + value + '$2');else {\n var hash = '';\n\n if (uri.indexOf('#') !== -1) {\n hash = uri.replace(/.*#/, '#');\n uri = uri.replace(/#.*/, '');\n }\n\n var separator = uri.indexOf('?') !== -1 ? \"&\" : \"?\";\n return uri + separator + key + \"=\" + value + hash;\n }\n} //Given an arbitrary URL, returns an array with the URL parameters\n\n\nfunction getUrlParameters(url) {\n var query = url.split('?');\n if (!query[1]) return null;\n var vars = query[1].split('&'),\n query_string = {},\n i;\n\n for (i = 0; i < vars.length; i++) {\n var pair = vars[i].split('='),\n key = decodeURIComponent(pair[0]),\n value = decodeURIComponent(pair[1]);\n if (typeof query_string[key] === 'undefined') query_string[key] = decodeURIComponent(value);else if (typeof query_string[key] === 'undefined') query_string[key] = [query_string[key], decodeURIComponent(value)];else query_string[key].push(decodeURIComponent(value));\n }\n\n return query_string;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n removeUrlParameter: removeUrlParameter,\n updateUrlParameter: updateUrlParameter,\n getUrlParameters: getUrlParameters,\n escapeHtml: escapeHtml,\n getFilename: getFilename,\n arrayContainsItem: arrayContainsItem,\n unwrap: unwrap\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL3V0aWxzLmpzPzRkOTAiXSwibmFtZXMiOlsicmVtb3ZlVXJsUGFyYW1ld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4gICAgZXNjYXBlSHRtbCxcclxuICAgIGdldEZpbGVuYW1lLFxyXG4gICAgYXJyYXlDb250YWluc0l0ZW0sXHJcbiAgICB1bndyYXBcclxufVxyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./assets/src/js/utils.js\n");
|
362 |
|
363 |
/***/ }),
|
364 |
|
@@ -690,7 +690,7 @@ eval("/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukh
|
|
690 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
691 |
|
692 |
"use strict";
|
693 |
-
eval("__webpack_require__.r(__webpack_exports__);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['languageNames', 'editorStrings', 'paidVersion'],\n methods: {\n showLanguagesMessage: function showLanguagesMessage() {\n if (Object.keys(this.languageNames).length == 1) return true;\n return false;\n },\n showUpsellMessage: function showUpsellMessage() {\n if (this.paidVersion != 'true') return true;\n return false;\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL2V4dHJhLWNvbnRlbnQudnVlP2ViYmQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUE2QkE7QUFDQSxVQUNBLGVBREEsRUFFQSxlQUZBLEVBR0EsYUFIQSxDQURBO0FBTUE7QUFDQSx3QkFEQSxrQ0FDQTtBQUNBLHVEQUNBO0FBRUE7QUFDQSxLQU5BO0FBT0EscUJBUEEsK0JBT0E7QUFDQSxzQ0FDQTtBQUVBO0FBQ0E7QUFaQTtBQU5BIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2JhYmVsLWxvYWRlci9saWIvaW5kZXguanM/IS4vbm9kZV9tb2R1bGVzL3Z1ZS1sb2FkZXIvbGliL2luZGV4LmpzPyEuL2Fzc2V0cy9zcmMvanMvY29tcG9uZW50cy9leHRyYS1jb250ZW50LnZ1ZT92dWUmdHlwZT1zY3JpcHQmbGFuZz1qcyYuanMiLCJzb3VyY2VzQ29udGVudCI6WyI8dGVtcGxhdGU+
|
694 |
|
695 |
/***/ }),
|
696 |
|
@@ -702,7 +702,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n//\n//\n//\n//\n//\n//\n//\n/
|
|
702 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
703 |
|
704 |
"use strict";
|
705 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./assets/src/js/utils.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);\n//\n//\n//\n//\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['dictionary', 'settings', 'iframe', 'dataAttributes', 'mergeRules', 'ajax_url', 'nonces', 'mergeData', 'editorStrings', 'currentLanguage'],\n data: function data() {\n return {\n hoveredStringId: '',\n hoveredStringSelector: '',\n hoveredTarget: '',\n counter: 0\n };\n },\n methods: {\n showPencilIcon: function showPencilIcon(element) {\n if (!this.dictionary || this.dictionary.length < 1) return;\n var self = this;\n var target = element.target;\n var relatedNode, relatedNodeAttr, position, stringSelector, stringId, mergeOrSplit; //for these tag names we need to insert our HTML before the element and not inside of it\n //@TODO: add/research more\n\n var beforePosition = ['IMG', 'INPUT', 'TEXTAREA'];\n if (self.hoveredTarget != '' && target.isSameNode(self.hoveredTarget)) return; //if other icons are showing, remove them\n\n self.removePencilIcon(); //remove highlight class\n\n self.removeHighlight(false); //figure out where to insert extra HTML\n\n if (beforePosition.includes(target.tagName)) position = 'beforebegin';else position = 'afterbegin'; //insert button HTML\n\n target.insertAdjacentHTML(position, this.getTrpSpan()); //inserted node\n\n var trpSpan = self.iframe.getElementsByTagName('trp-span')[0];\n if (!trpSpan) return; //get node info based on where we inserted our button\n\n if (position == 'afterbegin') relatedNode = trpSpan.parentNode;else relatedNode = trpSpan.nextElementSibling; //edit string button\n\n var editButton = this.iframe.querySelector('trp-edit');\n var foundNonGettext = false;\n self.dataAttributes.forEach(function (baseSelector) {\n self.$parent.prepareSelectorStrings(baseSelector).forEach(function (selector) {\n relatedNodeAttr = relatedNode.getAttribute(selector);\n\n if (relatedNodeAttr) {\n stringId = relatedNodeAttr;\n stringSelector = selector;\n\n if (!stringSelector.includes('data-trpgettextoriginal')) {\n // includes at least one data-base-selector that is not gettext. Useful for determining edit pencil color\n foundNonGettext = true;\n }\n }\n });\n });\n self.hoveredStringSelector = stringSelector;\n self.hoveredStringId = stringId;\n self.hoveredTarget = target; // show green edit pencil\n\n if (foundNonGettext) {\n editButton.classList.remove('trp-gettext-pencil');\n } else {\n editButton.classList.add('trp-gettext-pencil');\n } //figure out if split or merge is available\n\n\n mergeOrSplit = self.checkMergeOrSplit(target); //fit inside view\n\n self.fitPencilIconInsideView(trpSpan, target, mergeOrSplit);\n\n if (!self.mergeData.includes(stringId)) {\n editButton.style.display = 'inline-block'; //add class to highlight text\n\n if (!target.classList.contains('trp-highlight')) target.className += ' trp-highlight';\n } //merge or split event listeners\n\n\n if (mergeOrSplit != 'none' && !self.mergeData.includes(stringId)) {\n var button = this.iframe.querySelector('trp-' + mergeOrSplit);\n button.style.display = 'inline-block'; //setup event listeners for merge and split\n\n if (mergeOrSplit == 'split') button.addEventListener('click', self.splitHandler);else if (mergeOrSplit == 'merge') button.addEventListener('click', self.mergeHandler);\n }\n\n editButton.addEventListener('click', self.editHandler);\n },\n editHandler: function editHandler(event) {\n event.preventDefault();\n event.stopPropagation();\n if (this.$parent.mergingString) this.removeHighlight(true);\n this.$parent.mergeData = [];\n this.$parent.selectedString = this.$parent.getStringIndex(this.hoveredStringSelector, this.hoveredStringId);\n this.$parent.translationNotLoadedYet = this.$parent.selectedString === null;\n jQuery('#trp-string-categories').select2('close');\n },\n splitHandler: function splitHandler(event) {\n event.preventDefault();\n event.stopPropagation();\n this.$parent.mergingString = false;\n var split = confirm(this.editorStrings.split_confirmation);\n if (split === false) return;\n var strings = [];\n var hoveredStringIndex = this.$parent.getStringIndex(this.hoveredStringSelector, this.hoveredStringId);\n strings.push(this.dictionary[hoveredStringIndex].original);\n var data = new FormData();\n data.append('action', 'trp_split_translation_block');\n data.append('security', this.nonces['splittbnonce']);\n data.append('strings', JSON.stringify(strings));\n var self = this;\n axios__WEBPACK_IMPORTED_MODULE_1___default.a.post(this.ajax_url, data).then(function (response) {\n window.location.reload();\n })[\"catch\"](function (error) {\n console.log(error);\n });\n },\n mergeHandler: function mergeHandler(event) {\n event.preventDefault();\n event.stopPropagation();\n var self = this;\n var parent,\n isDeprecated = null,\n deprecatedString = null,\n stringId;\n self.$parent.mergingString = true; //remove classes\n\n var previouslyHighlighted = this.iframe.getElementsByClassName('trp-create-translation-block');\n\n if (previouslyHighlighted.length > 0) {\n var i;\n\n for (i = 0; i < previouslyHighlighted.length; i++) {\n previouslyHighlighted[i].classList.remove('trp-highlight');\n previouslyHighlighted[i].classList.remove('trp-create-translation-block');\n }\n }\n\n parent = self.hoveredTarget.closest(self.mergeRules.top_parents); //remove highlight classes from children\n\n parent.querySelectorAll('.trp-highlight').forEach(function (node) {\n node.classList.remove('trp-highlight');\n }); //determine the strings that are being prepared for merging (no gettext)\n\n self.$parent.mergeData = [];\n parent.querySelectorAll('[data-trp-translate-id]').forEach(function (node) {\n stringId = node.getAttribute('data-trp-translate-id');\n if (stringId) self.$parent.mergeData.push(stringId);\n }); //check if we have existing translations for this block\n\n isDeprecated = parent.getAttribute('data-trp-translate-id-deprecated');\n if (isDeprecated) deprecatedString = self.$parent.getStringIndex('data-trp-translate-id', isDeprecated);\n parent.setAttribute('data-trp-translate-id', 'trp_creating_translation_block');\n parent.className += ' trp-highlight trp-create-translation-block'; //create a placeholder string for the dictionary\n\n var dummyString = {\n type: 'regular',\n attribute: '',\n block_type: '1',\n dbID: 'create_translation_block' + this.counter,\n original: self.stripEditorData(parent),\n selector: 'data-trp-translate-id',\n translationsArray: {}\n };\n this.counter++;\n var dummyTranslations = {};\n var defaultLanguage = this.settings['default-language']; //populate translationsArray\n\n self.settings['translation-languages'].forEach(function (languageCode) {\n if (languageCode != defaultLanguage) {\n dummyTranslations = {\n block_type: '1',\n id: languageCode,\n status: '0',\n translated: '',\n editedTranslation: '' //populate existing translations\n\n };\n\n if (deprecatedString) {\n dummyTranslations.translated = self.dictionary[deprecatedString].translationsArray[languageCode].translated;\n dummyTranslations.editedTranslation = self.dictionary[deprecatedString].translationsArray[languageCode].translated;\n }\n\n dummyString.translationsArray[languageCode] = dummyTranslations;\n }\n }); //add item to dictionary and set selectedString as the index\n\n self.$parent.selectedString = self.dictionary.push(dummyString) - 1;\n },\n removePencilIcon: function removePencilIcon() {\n var icons = this.iframe.querySelectorAll('trp-span');\n\n if (icons.length > 0) {\n icons.forEach(function (icon) {\n icon.remove();\n });\n }\n },\n checkMergeOrSplit: function checkMergeOrSplit(target) {\n if (!this.mergeRules || !this.mergeRules.self_object_type || !this.mergeRules.top_parents) return 'none';\n var hoveredStringIndex = this.$parent.getStringIndex(this.hoveredStringSelector, this.hoveredStringId);\n if (!hoveredStringIndex) hoveredStringIndex = this.$parent.selectedString;\n if (typeof this.dictionary[hoveredStringIndex] != 'undefined' && this.dictionary[hoveredStringIndex].block_type == 1) return 'split';\n var self = this;\n var parentNode, childNodes, incompatibleSiblings;\n var action = 'none'; //check if target is the correct object type\n\n this.mergeRules.self_object_type.forEach(function (thisObjectType) {\n if (target.tagName.toLowerCase() == thisObjectType) {\n //get parent based on merge rules\n parentNode = target.closest(self.mergeRules.top_parents);\n\n if (parentNode != null) {\n //get childrens that are of the correct type based on parent,\n self.mergeRules.self_object_type.forEach(function (selfObjectType) {\n childNodes = parentNode.querySelectorAll(selfObjectType);\n\n if (childNodes.length > 1) {\n //check if between the children we have incompatible siblings (gettext or dynamic strings)\n incompatibleSiblings = parentNode.querySelectorAll(self.mergeRules.incompatible_siblings);\n if (incompatibleSiblings.length == 0) action = 'merge';\n }\n });\n }\n }\n });\n return action;\n },\n stripEditorData: function stripEditorData(target) {\n var copy = target.cloneNode(true);\n var self = this;\n var buttons = copy.querySelector('trp-span');\n if (buttons) buttons.remove();\n /** In case we are in secondary language and the strings that will be merged are already translated,\n * we must use the originals of these strings instead of what is in the preview iframe HTML page at this point\n */\n\n if (this.settings['default-language'] != this.currentLanguage) {\n copy.querySelectorAll('[data-trp-translate-id]').forEach(function (node) {\n var stringId = node.getAttribute('data-trp-translate-id');\n var index = self.$parent.getStringIndex('data-trp-translate-id', stringId);\n\n if (self.dictionary[index].translationsArray[self.currentLanguage] && self.dictionary[index].translationsArray[self.currentLanguage].status != 0) {\n node.innerHTML = node.innerText.replace(self.dictionary[index].translationsArray[self.currentLanguage].translated, self.dictionary[index].original);\n }\n });\n }\n\n copy.querySelectorAll('translate-press, trp-wrap, trp-highlight').forEach(function (node) {\n _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].unwrap(node);\n });\n var attributesToReplace = ['href', 'target'];\n attributesToReplace.forEach(function (attribute) {\n copy.querySelectorAll('[data-trp-original-' + attribute + ']').forEach(function (node) {\n var dataTrpOriginalAttribute = 'data-trp-original-' + attribute;\n node.setAttribute(attribute, node.getAttribute(dataTrpOriginalAttribute));\n node.removeAttribute(dataTrpOriginalAttribute);\n });\n });\n var node;\n var otherAttributes = ['data-trp-placeholder', 'data-trp-unpreviewable'];\n var attributesToRemove = otherAttributes.concat(self.$parent.prepareSelectorStrings('data-trp-translate-id'), self.$parent.prepareSelectorStrings('data-trp-node-group'), self.$parent.prepareSelectorStrings('data-trp-node-description'));\n attributesToRemove.forEach(function (attribute) {\n copy.querySelectorAll('[' + attribute + ']').forEach(function (node) {\n node.removeAttribute(attribute);\n });\n });\n return copy.innerHTML;\n },\n removeHighlight: function removeHighlight() {\n var removeFromBlocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var previouslyHighlighted = this.iframe.getElementsByClassName('trp-highlight');\n\n if (previouslyHighlighted.length > 0) {\n var i;\n\n for (i = 0; i < previouslyHighlighted.length; i++) {\n if (removeFromBlocks) previouslyHighlighted[i].classList.remove('trp-highlight');else if (!removeFromBlocks && !previouslyHighlighted[i].classList.contains('trp-create-translation-block')) previouslyHighlighted[i].classList.remove('trp-highlight');\n }\n }\n\n return true;\n },\n fitPencilIconInsideView: function fitPencilIconInsideView(pencil, target, mergeOrSplit) {\n // 'slick-slide-image' is a fix for elementor image slider to display pencil icon\n // 'attachment-woocommerce_thumbnail' - is a fix for WooCommerce product images on shop page (Hestia theme and others)\n // 'woocommerce-placeholder' - is a fix for WooCommerce product placeholder image on shop page (Hestia theme and others)\n var forcePencilDisplayClasses = ['slick-slide-image', 'attachment-woocommerce_thumbnail', 'woocommerce-placeholder'];\n var forcePencilDisplay = false;\n\n if (target.tagName === 'IMG') {\n var i;\n\n for (i = 0; i < forcePencilDisplayClasses.length; i++) {\n if (target.classList.contains(forcePencilDisplayClasses[i])) {\n forcePencilDisplay = true;\n break;\n }\n }\n }\n\n var rect = target.getBoundingClientRect();\n\n if (forcePencilDisplay || rect.left < 35) {\n var margin;\n if (mergeOrSplit != 'none') margin = 60;else margin = 30;\n pencil.setAttribute('style', 'margin-left: ' + margin + 'px !important');\n }\n },\n getTrpSpan: function getTrpSpan() {\n return '<trp-span><trp-merge title=\"' + this.editorStrings.merge + '\" class=\"trp-icon trp-merge dashicons dashicons-arrow-up-alt\"></trp-merge><trp-split title=\"' + this.editorStrings.split + '\" class=\"trp-icon trp-split dashicons dashicons-arrow-down-alt\"></trp-split><trp-edit title=\"' + this.editorStrings.edit + '\" class=\"trp-icon trp-edit-translation dashicons dashicons-edit\"></trp-edit></trp-span>';\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL2hvdmVyLWFjdGlvbnMudnVlPzg3MjMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFLQTtBQUNBO0FBRUE7QUFDQSxVQUNBLFlBREEsRUFFQSxVQUZBLEVBR0EsUUFIQSxFQUlBLGdCQUpBLEVBS0EsWUFMQSxFQU1BLFVBTkEsRUFPQSxRQVBBLEVBUUEsV0FSQSxFQVNBLGVBVEEsRUFVQSxpQkFWQSxDQURBO0FBYUEsTUFiQSxrQkFhQTtBQUNBO0FBQ0EseUJBREE7QUFFQSwrQkFGQTtBQUdBLHVCQUhBO0FBSUE7QUFKQTtBQU1BLEdBcEJBO0FBcUJBO0FBQ0Esa0JBREEsMEJBQ0EsT0FEQSxFQUNBO0FBQ0EsMERBQ0E7QUFFQTtBQUNBO0FBQ0EseUZBTkEsQ0FRQTtBQUNBOztBQUNBO0FBRUEsNkVBQ0EsT0FiQSxDQWVBOztBQUNBLDhCQWhCQSxDQWtCQTs7QUFDQSxrQ0FuQkEsQ0FxQkE7O0FBQ0EsbURBQ0EseUJBREEsS0FHQSx3QkF6QkEsQ0EyQkE7O0FBQ0EsNkRBNUJBLENBOEJBOztBQUNBO0FBRUEsb0JBQ0EsT0FsQ0EsQ0FvQ0E7O0FBQ0Esb0NBQ0EsaUNBREEsS0FHQSx5Q0F4Q0EsQ0EwQ0E7O0FBQ0E7QUFDQTtBQUVBO0FBRUE7QUFFQTs7QUFFQTtBQUNBO0FBQ0E7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBLFNBWkE7QU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AgICAgICAnZGljdGlvbmFyeScsXHJcbiAgICAgICAgICAgICdzZXR0aW5ncycsXHJcbiAgICAgICAgICAgICdpZnJhbWUnLFxyXG4gICAgICAgICAgICAnZGF0YUF0dHJpYnV0ZXMnLFxyXG4gICAgICAgICAgICAnbWVyZ2VSdWxlcycsXHJcbiAgICAgICAgICAgICdhamF4X3VybCcsXHJcbiAgICAgICAgICAgICdub25jZXMnLFxyXG4gICAgICAgICAgICAnbWVyZ2VEYXRhJyxcclxuICAgICAgICAgICAgJ2VkaXRvclN0cmluZ3MnLFxyXG4gICAgICAgICAgICAnY3VycmVudExhbmd1YWdlJ1xyXG4gICAgICAgIF0sXHJcbiAgICAgICAgZGF0YSgpe1xyXG4gICAgICAgICAgICByZXR1cm57XHJcbiAgICAgICAgICAgICAgICBob3ZlcmVkU3RyaW5nSWQgICAgICAgOiAnJyxcclxuICAgICAgICAgICAgICAgIGhvdmVyZWRTdHJpbmdTZWxlY3RvciA6ICcnLFxyXG4gICAgICAgICAgICAgICAgaG92ZXJlZFRhcmdldCAgICAgICAgIDogJycsXHJcbiAgICAgICAgICAgICAgICBjb3VudGVyICAgICAgICAgICAgICAgOiAwXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIG1ldGhvZHM6e1xyXG4gICAgICAgICAgICBzaG93UGVuY2lsSWNvbiggZWxlbWVudCApe1xyXG4gICAgICAgICAgICAgICAgaWYoICF0aGlzLmRpY3Rpb25hcnkgfHwgdGhpcy5kaWN0aW9uYXJ5Lmxlbmd0aCA8IDEgKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVyblxyXG5cclxuICAgICAgICAgICAgICAgIGxldCBzZWxmID0gdGhpc1xyXG4gICAgICAgICAgICAgICAgbGV0IHRhcmdldCA9IGVsZW1lbnQudGFyZ2V0XHJcbiAgICAgICAgICAgICAgICBsZXQgcmVsYXRlZE5vZGUsIHJlbGF0ZWROb2RlQXR0ciwgcG9zaXRpb24sIHN0cmluZ1NlbGVjdG9yLCBzdHJpbmdJZCwgbWVyZ2VPclNwbGl0XHJcblxyXG4gICAgICAgICAgICAgICAgLy9mb3IgdGhlc2UgdGFnIG5hbWVzIHdlIG5lZWQgdG8gaW5zZXJ0IG91ciBIVE1MIGJlZm9yZSB0aGUgZWxlbWVudCBhbmQgbm90IGluc2lkZSBvZiBpdFxyXG4gICAgICAgICAgICAgICAgLy9AVE9ETzogYWRkL3Jlc2VhcmNoIG1vcmVcclxuICAgICAgICAgICAgICAgIGxldCBiZWZvcmVQb3NpdGlvbiA9IFsgJ0lNRycsICdJTlBVVCcsICdURVhUQVJFQScgXVxyXG5cclxuICAgICAgICAgICAgICAgIGlmKCBzZWxmLmhvdmVyZWRUYXJnZXQgIT0gJycgJiYgdGFyZ2V0LmlzU2FtZU5vZGUoIHNlbGYuaG92ZXJlZFRhcmdldCApIClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cclxuXHJcbiAgICAgICAgICAgICAgICAvL2lmIG90aGVyIGljb25zIGFyZSBzaG93aW5nLCByZW1vdmUgdGhlbVxyXG4gICAgICAgICAgICAgICAgc2VsZi5yZW1vdmVQZW5jaWxJY29uKClcclxuXHJcbiAgICAgICAgICAgICAgICAvL3JlbW92ZSBoaWdobGlnaHQgY2xhc3NcclxuICAgICAgICAgICAgICAgIHNlbGYucmVtb3ZlSGlnaGxpZ2h0KCBmYWxzZSApXHJcblxyXG4gICAgICAgICAgICAgICAgLy9maWd1cmUgb3V0IHdoZXJlIHRvIGluc2VydCBleHRyYSBIVE1MXHJcbiAgICAgICAgICAgICAgICBpZiggYmVmb3JlUG9zaXRpb24uaW5jbHVkZXMoIHRhcmdldC50YWdOYW1lICkgKVxyXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gJ2JlZm9yZWJlZ2luJ1xyXG4gICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gJ2FmdGVyYmVnaW4nXHJcblxyXG4gICAgICAgICAgICAgICAgLy9pbnNlcnQgYnV0dG9uIEhUTUxcclxuICAgICAgICAgICAgICAgIHRhcmdldC5pbnNlcnRBZGphY2VudEhUTUwoIHBvc2l0aW9uLCB0aGlzLmdldFRycFNwYW4oKSApXHJcblxyXG4gICAgICAgICAgICAgICAgLy9pbnNlcnRlZCBub2RlXHJcbiAgICAgICAgICAgICAgICBsZXQgdHJwU3BhbiA9IHNlbGYuaWZyYW1lLmdldEVsZW1lbnRzQnlUYWdOYW1lKCAndHJwLXNwYW4nIClbMF1cclxuXHJcbiAgICAgICAgICAgICAgICBpZiggIXRycFNwYW4gKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVyblxyXG5cclxuICAgICAgICAgICAgICAgIC8vZ2V0IG5vZGUgaW5mbyBiYXNlZCBvbiB3aGVyZSB3ZSBpbnNlcnRlZCBvdXIgYnV0dG9uXHJcbiAgICAgICAgICAgICAgICBpZiggcG9zaXRpb24gPT0gJ2FmdGVyYmVnaW4nIClcclxuICAgICAgICAgICAgICAgICAgICByZWxhdGVkTm9kZSA9IHRycFNwYW4ucGFyZW50Tm9kZVxyXG4gICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICAgIHJlbGF0ZWROb2RlID0gdHJwU3Bhbi5uZXh0RWxlbWVudFNpYmxpbmdcclxuXHJcbiAgICAgICAgICAgICAgICAvL2VkaXQgc3RyaW5nIGJ1dHRvblxyXG4gICAgICAgICAgICAgICAgbGV0IGVkaXRCdXR0b24gPSB0aGlzLmlmcmFtZS5xdWVyeVNlbGVjdG9yKCAndHJwLWVkaXQnIClcclxuICAgICAgICAgICAgICAgIGxldCBmb3VuZE5vbkdldHRleHQgPSBmYWxzZVxyXG5cclxuICAgICAgICAgICAgICAgIHNlbGYuZGF0YUF0dHJpYnV0ZXMuZm9yRWFjaCggZnVuY3Rpb24oIGJhc2VTZWxlY3RvciApIHtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZi4kcGFyZW50LnByZXBhcmVTZWxlY3RvclN0cmluZ3MoIGJhc2VTZWxlY3RvciApLmZvckVhY2goIGZ1bmN0aW9uKCBzZWxlY3RvciApIHtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJlbGF0ZWROb2RlQXR0ciA9IHJlbGF0ZWROb2RlLmdldEF0dHJpYnV0ZSggc2VsZWN0b3IgKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCByZWxhdGVkTm9kZUF0dHIgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpbmdJZCA9IHJlbGF0ZWROb2RlQXR0clxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nU2VsZWN0b3IgPSBzZWxlY3RvclxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCAhIHN0cmluZ1NlbGVjdG9yLmluY2x1ZGVzKCAnZGF0YS10cnBnZXR0ZXh0b3JpZ2luYWwnICkgKXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBpbmNsdWRlcyBhdCBsZWFzdCBvbmUgZGF0YS1iYXNlLXNlbGVjdG9yIHRoYXQgaXMgbm90IGdldHRleHQuIFVzZWZ1bCBmb3IgZGV0ZXJtaW5pbmcgZWRpdCBwZW5jaWwgY29sb3JcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZE5vbkdldHRleHQgPSB0cnVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICBzZWxmLmhvdmVyZWRTdHJpbmdTZWxlY3RvciA9IHN0cmluZ1NlbGVjdG9yXHJcbiAgICAgICAgICAgICAgICBzZWxmLmhvdmVyZWRTdHJpbmdJZCAgICAgICA9IHN0cmluZ0lkXHJcbiAgICAgICAgICAgICAgICBzZWxmLmhvdmVyZWRUYXJnZXQgICAgICAgICA9IHRhcmdldFxyXG5cclxuICAgICAgICAgICAgICAgIC8vIHNob3cgZ3JlZW4gZWRpdCBwZW5jaWxcclxuICAgICAgICAgICAgICAgIGlmICggZm91bmROb25HZXR0ZXh0ICl7XHJcbiAgICAgICAgICAgICAgICAgICAgZWRpdEJ1dHRvbi5jbGFzc0xpc3QucmVtb3ZlKCAndHJwLWdldHRleHQtcGVuY2lsJyApXHJcbiAgICAgICAgICAgICAgICB9ZWxzZXtcclxuICAgICAgICAgICAgICAgICAgICBlZGl0QnV0dG9uLmNsYXNzTGlzdC5hZGQoICd0cnAtZ2V0dGV4dC1wZW5jaWwnIClcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvL2ZpZ3VyZSBvdXQgaWYgc3BsaXQgb3IgbWVyZ2UgaXMgYXZhaWxhYmxlXHJcbiAgICAgICAgICAgICAgICBtZXJnZU9yU3BsaXQgPSBzZWxmLmNoZWNrTWVyZ2VPclNwbGl0KCB0YXJnZXQgKVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZml0IGluc2lkZSB2aWV3XHJcbiAgICAgICAgICAgICAgICBzZWxmLmZpdFBlbmNpbEljb25JbnNpZGVWaWV3KCB0cnBTcGFuLCB0YXJnZXQsIG1lcmdlT3JTcGxpdCApXHJcblxyXG4gICAgICAgICAgICAgICAgaWYoICFzZWxmLm1lcmdlRGF0YS5pbmNsdWRlcyggc3RyaW5nSWQgKSApIHtcclxuICAgICAgICAgICAgICAgICAgICBlZGl0QnV0dG9uLnN0eWxlLmRpc3BsYXkgPSAnaW5saW5lLWJsb2NrJ1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAvL2FkZCBjbGFzcyB0byBoaWdobGlnaHQgdGV4dFxyXG4gICAgICAgICAgICAgICAgICAgIGlmKCAhdGFyZ2V0LmNsYXNzTGlzdC5jb250YWlucyggJ3RycC1oaWdobGlnaHQnICkgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB0YXJnZXQuY2xhc3NOYW1lICs9ICcgdHJwLWhpZ2hsaWdodCdcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAvL21lcmdlIG9yIHNwbGl0IGV2ZW50IGxpc3RlbmVyc1xyXG4gICAgICAgICAgICAgICAgaWYoIG1lcmdlT3JTcGxpdCAhPSAnbm9uZScgJiYgIXNlbGYubWVyZ2VEYXRhLmluY2x1ZGVzKCBzdHJpbmdJZCApICkge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBidXR0b24gPSB0aGlzLmlmcmFtZS5xdWVyeVNlbGVjdG9yKCAndHJwLScgKyBtZXJnZU9yU3BsaXQgKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBidXR0b24uc3R5bGUuZGlzcGxheSA9ICdpbmxpbmUtYmxvY2snXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vc2V0dXAgZXZlbnQgbGlzdGVuZXJzIGZvciBtZXJnZSBhbmQgc3BsaXRcclxuICAgICAgICAgICAgICAgICAgICBpZiggbWVyZ2VPclNwbGl0ID09ICdzcGxpdCcgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBidXR0b24uYWRkRXZlbnRMaXN0ZW5lciggJ2NsaWNrJywgc2VsZi5zcGxpdEhhbmRsZXIgKVxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2UgaWYoIG1lcmdlT3JTcGxpdCA9PSAnbWVyZ2UnIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgYnV0dG9uLmFkZEV2ZW50TGlzdGVuZXIoICdjbGljaycsIHNlbGYubWVyZ2VIYW5kbGVyIClcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICBlZGl0QnV0dG9uLmFkZEV2ZW50TGlzdGVuZXIoICdjbGljaycsIHNlbGYuZWRpdEhhbmRsZXIgKVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBlZGl0SGFuZGxlciggZXZlbnQgKXtcclxuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KClcclxuICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpXHJcblxyXG4gICAgICAgICAgICAgICAgaWYoIHRoaXMuJHBhcmVudC5tZXJnaW5nU3RyaW5nIClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUhpZ2hsaWdodCggdHJ1ZSApXHJcblxyXG4gICAgICAgICAgICAgICAgdGhpcy4kcGFyZW50Lm1lcmdlRGF0YSAgICAgID0gW11cclxuXHJcbiAgICAgICAgICAgICAgICB0aGlzLiRwYXJlbnQuc2VsZWN0ZWRTdHJpbmcgPSB0aGlzLiRwYXJlbnQuZ2V0U3RyaW5nSW5kZXgoIHRoaXMuaG92ZXJlZFN0cmluZ1NlbGVjdG9yLCB0aGlzLmhvdmVyZWRTdHJpbmdJZCApXHJcblxyXG4gICAgICAgICAgICAgICAgdGhpcy4kcGFyZW50LnRyYW5zbGF0aW9uTm90TG9hZGVkWWV0ICA9ICggdGhpcy4kcGFyZW50LnNlbGVjdGVkU3RyaW5nID09PSBudWxsIClcclxuXHJcbiAgICAgICAgICAgICAgICBqUXVlcnkoICcjdHJwLXN0cmluZy1jYXRlZ29yaWVzJyApLnNlbGVjdDIoICdjbG9zZScgKVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBzcGxpdEhhbmRsZXIoIGV2ZW50ICkge1xyXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKVxyXG4gICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKClcclxuICAgICAgICAgICAgICAgIHRoaXMuJHBhcmVudC5tZXJnaW5nU3RyaW5nID0gZmFsc2VcclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgc3BsaXQgPSBjb25maXJtKCB0aGlzLmVkaXRvclN0cmluZ3Muc3BsaXRfY29uZmlybWF0aW9uIClcclxuXHJcbiAgICAgICAgICAgICAgICBpZiggc3BsaXQgPT09IGZhbHNlIClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgc3RyaW5ncyA9IFtdXHJcbiAgICAgICAgICAgICAgICBsZXQgaG92ZXJlZFN0cmluZ0luZGV4ID0gdGhpcy4kcGFyZW50LmdldFN0cmluZ0luZGV4KCB0aGlzLmhvdmVyZWRTdHJpbmdTZWxlY3RvciwgdGhpcy5ob3ZlcmVkU3RyaW5nSWQgKVxyXG4gICAgICAgICAgICAgICAgc3RyaW5ncy5wdXNoKCB0aGlzLmRpY3Rpb25hcnlbIGhvdmVyZWRTdHJpbmdJbmRleCBdLm9yaWdpbmFsIClcclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IG5ldyBGb3JtRGF0YSgpXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdhY3Rpb24nLCAndHJwX3NwbGl0X3RyYW5zbGF0aW9uX2Jsb2NrJyApXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdzZWN1cml0eScsIHRoaXMubm9uY2VzWydzcGxpdHRibm9uY2UnXSApXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdzdHJpbmdzJywgSlNPTi5zdHJpbmdpZnkoIHN0cmluZ3MgKSApXHJcblxyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXHJcblxyXG4gICAgICAgICAgICAgICAgYXhpb3MucG9zdCh0aGlzLmFqYXhfdXJsLCBkYXRhKVxyXG4gICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXNwb25zZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cubG9jYXRpb24ucmVsb2FkKClcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbiAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpO1xyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBtZXJnZUhhbmRsZXIoIGV2ZW50ICkge1xyXG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKVxyXG4gICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKClcclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcclxuICAgICAgICAgICAgICAgIGxldCBwYXJlbnQsIGlzRGVwcmVjYXRlZCA9IG51bGwsIGRlcHJlY2F0ZWRTdHJpbmcgPSBudWxsLCBzdHJpbmdJZFxyXG5cclxuICAgICAgICAgICAgICAgIHNlbGYuJHBhcmVudC5tZXJnaW5nU3RyaW5nID0gdHJ1ZVxyXG5cclxuICAgICAgICAgICAgICAgIC8vcmVtb3ZlIGNsYXNzZXNcclxuICAgICAgICAgICAgICAgIGxldCBwcmV2aW91c2x5SGlnaGxpZ2h0ZWQgPSB0aGlzLmlmcmFtZS5nZXRFbGVtZW50c0J5Q2xhc3NOYW1lKCAndHJwLWNyZWF0ZS10cmFuc2xhdGlvbi1ibG9jaycgKVxyXG5cclxuICAgICAgICAgICAgICAgIGlmKCBwcmV2aW91c2x5SGlnaGxpZ2h0ZWQubGVuZ3RoID4gMCApIHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgaVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IHByZXZpb3VzbHlIaWdobGlnaHRlZC5sZW5ndGg7IGkrKyApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNseUhpZ2hsaWdodGVkW2ldLmNsYXNzTGlzdC5yZW1vdmUoICd0cnAtaGlnaGxpZ2h0JyApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzbHlIaWdobGlnaHRlZFtpXS5jbGFzc0xpc3QucmVtb3ZlKCAndHJwLWNyZWF0ZS10cmFuc2xhdGlvbi1ibG9jaycgKVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICBwYXJlbnQgPSBzZWxmLmhvdmVyZWRUYXJnZXQuY2xvc2VzdCggc2VsZi5tZXJnZVJ1bGVzLnRvcF9wYXJlbnRzIClcclxuXHJcbiAgICAgICAgICAgICAgICAvL3JlbW92ZSBoaWdobGlnaHQgY2xhc3NlcyBmcm9tIGNoaWxkcmVuXHJcbiAgICAgICAgICAgICAgICBwYXJlbnQucXVlcnlTZWxlY3RvckFsbCggJy50cnAtaGlnaGxpZ2h0JyApLmZvckVhY2goIGZ1bmN0aW9uKG5vZGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBub2RlLmNsYXNzTGlzdC5yZW1vdmUoICd0cnAtaGlnaGxpZ2h0JyApXHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIC8vZGV0ZXJtaW5lIHRoZSBzdHJpbmdzIHRoYXQgYXJlIGJlaW5nIHByZXBhcmVkIGZvciBtZXJnaW5nIChubyBnZXR0ZXh0KVxyXG4gICAgICAgICAgICAgICAgc2VsZi4kcGFyZW50Lm1lcmdlRGF0YSA9IFtdXHJcblxyXG4gICAgICAgICAgICAgICAgcGFyZW50LnF1ZXJ5U2VsZWN0b3JBbGwoICdbZGF0YS10cnAtdHJhbnNsYXRlLWlkXScgKS5mb3JFYWNoKCBmdW5jdGlvbiggbm9kZSApIHtcclxuICAgICAgICAgICAgICAgICAgICBzdHJpbmdJZCA9IG5vZGUuZ2V0QXR0cmlidXRlKCAnZGF0YS10cnAtdHJhbnNsYXRlLWlkJyApXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGlmICggc3RyaW5nSWQgKVxyXG4gICAgICAgICAgICAgICAg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ScsXHJcbiAgICAgICAgICAgICAgICAgICAgZGJJRCAgICAgICAgICAgICAgOiAnY3JlYXRlX3RyYW5zbGF0aW9uX2Jsb2NrJyArIHRoaXMuY291bnRlcixcclxuICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbCAgICAgICAgICA6IHNlbGYuc3RyaXBFZGl0b3JEYXRhKCBwYXJlbnQgKSxcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3RvciAgICAgICAgICA6ICdkYXRhLXRycC10cmFuc2xhdGUtaWQnLFxyXG4gICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0aW9uc0FycmF5IDoge31cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRoaXMuY291bnRlcisrXHJcblxyXG4gICAgICAgICAgICAgICAgbGV0IGR1bW15VHJhbnNsYXRpb25zID0ge31cclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdExhbmd1YWdlID0gdGhpcy5zZXR0aW5nc1snZGVmYXVsdC1sYW5ndWFnZSddXHJcblxyXG4gICAgICAgICAgICAgICAgLy9wb3B1bGF0ZSB0cmFuc2xhdGlvbnNBcnJheVxyXG4gICAgICAgICAgICAgICAgc2VsZi5zZXR0aW5nc1sndHJhbnNsYXRpb24tbGFuZ3VhZ2VzJ10uZm9yRWFjaCggZnVuY3Rpb24oIGxhbmd1YWdlQ29kZSAgKXtcclxuICAgICAgICAgICAgICAgICAgICBpZiggbGFuZ3VhZ2VDb2RlICE9IGRlZmF1bHRMYW5ndWFnZSApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZHVtbXlUcmFuc2xhdGlvbnMgPSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBibG9ja190eXBlIDogJzEnLFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQgICAgICAgICA6IGxhbmd1YWdlQ29kZSxcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0YXR1cyAgICAgOiAnMCcsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGVkIDogJycsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZGl0ZWRUcmFuc2xhdGlvbjogJydcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgLy9wb3B1bGF0ZSBleGlzdGluZyB0cmFuc2xhdGlvbnNcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGRlcHJlY2F0ZWRTdHJpbmcgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkdW1teVRyYW5zbGF0aW9ucy50cmFuc2xhdGVkICAgICAgICA9IHNlbGYuZGljdGlvbmFyeVtkZXByZWNhdGVkU3RyaW5nXS50cmFuc2xhdGlvbnNBcnJheVtsYW5ndWFnZUNvZGVdLnRyYW5zbGF0ZWRcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR1bW15VHJhbnNsYXRpb25zLmVkaXRlZFRyYW5zbGF0aW9uID0gc2VsZi5kaWN0aW9uYXJ5W2RlcHJlY2F0ZWRTdHJpbmddLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0udHJhbnNsYXRlZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkdW1teVN0cmluZy50cmFuc2xhdGlvbnNBcnJheVtsYW5ndWFnZUNvZGVdID0gZHVtbXlUcmFuc2xhdGlvbnNcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIC8vYWRkIGl0ZW0gdG8gZGljdGlvbmFyeSBhbmQgc2V0IHNlbGVjdGVkU3RyaW5nIGFzIHRoZSBpbmRleFxyXG4gICAgICAgICAgICAgICAgc2VsZi4kcGFyZW50LnNlbGVjdGVkU3RyaW5nID0gc2VsZi5kaWN0aW9uYXJ5LnB1c2goIGR1bW15U3RyaW5nICkgLSAxXHJcblxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICByZW1vdmVQZW5jaWxJY29uKCl7XHJcbiAgICAgICAgICAgICAgICBsZXQgaWNvbnMgPSB0aGlzLmlmcmFtZS5xdWVyeVNlbGVjdG9yQWxsKCAndHJwLXNwYW4nIClcclxuXHJcbiAgICAgICAgICAgICAgICBpZiAoIGljb25zLmxlbmd0aCA+IDAgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWNvbnMuZm9yRWFjaCggZnVuY3Rpb24oIGljb24gKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGljb24ucmVtb3ZlKClcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBjaGVja01lcmdlT3JTcGxpdCggdGFyZ2V0ICl7XHJcbiAgICAgICAgICAgICAgICBpZiggIXRoaXMubWVyZ2VSdWxlcyB8fCAhdGhpcy5tZXJnZVJ1bGVzLnNlbGZfb2JqZWN0X3R5cGUgfHwgIXRoaXMubWVyZ2VSdWxlcy50b3BfcGFyZW50cyApXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuICdub25lJ1xyXG5cclxuICAgICAgICAgICAgICAgIGxldCBob3ZlcmVkU3RyaW5nSW5kZXggPSB0aGlzLiRwYXJlbnQuZ2V0U3RyaW5nSW5kZXgoIHRoaXMuaG92ZXJlZFN0cmluZ1NlbGVjdG9yLCB0aGlzLmhvdmVyZWRTdHJpbmdJZCApXHJcbiAgICAgICAgICAgICAgICBpZiggIWhvdmVyZWRTdHJpbmdJbmRleCApXHJcbiAgICAgICAgICAgICAgICAgICAgaG92ZXJlZFN0cmluZ0luZGV4ID0gdGhpcy4kcGFyZW50LnNlbGVjdGVkU3RyaW5nXHJcblxyXG4gICAgICAgICAgICAgICAgaWYoIHR5cGVvZiB0aGlzLmRpY3Rpb25hcnlbaG92ZXJlZFN0cmluZ0luZGV4XSAhPSAndW5kZWZpbmVkJyAmJiB0aGlzLmRpY3Rpb25hcnlbaG92ZXJlZFN0cmluZ0luZGV4XS5ibG9ja190eXBlID09IDEgKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiAnc3BsaXQnXHJcblxyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXHJcbiAgICAgICAgICAgICAgICBsZXQgcGFyZW50Tm9kZSwgY2hpbGROb2RlcywgaW5jb21wYXRpYmxlU2libGluZ3NcclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgYWN0aW9uID0gJ25vbmUnXHJcblxyXG4gICAgICAgICAgICAgICAgLy9jaGVjayBpZiB0YXJnZXQgaXMgdGhlIGNvcnJlY3Qgb2JqZWN0IHR5cGVcclxuICAgICAgICAgICAgICAgIHRoaXMubWVyZ2VSdWxlcy5zZWxmX29iamVjdF90eXBlLmZvckVhY2goIGZ1bmN0aW9uKCB0aGlzT2JqZWN0VHlwZSApIHtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYoIHRhcmdldC50YWdOYW1lLnRvTG93ZXJDYXNlKCkgPT0gdGhpc09iamVjdFR5cGUgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0IHBhcmVudCBiYXNlZCBvbiBtZXJnZSBydWxlc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBwYXJlbnROb2RlID0gdGFyZ2V0LmNsb3Nlc3QoIHNlbGYubWVyZ2VSdWxlcy50b3BfcGFyZW50cyApXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiggcGFyZW50Tm9kZSAhPSBudWxsICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9nZXQgY2hpbGRyZW5zIHRoYXQgYXJlIG9mIHRoZSBjb3JyZWN0IHR5cGUgYmFzZWQgb24gcGFyZW50LFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5tZXJnZVJ1bGVzLnNlbGZfb2JqZWN0X3R5cGUuZm9yRWFjaCggZnVuY3Rpb24oIHNlbGZPYmplY3RUeXBlICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkTm9kZXMgPSBwYXJlbnROb2RlLnF1ZXJ5U2VsZWN0b3JBbGwoIHNlbGZPYmplY3RUeXBlIClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGNoaWxkTm9kZXMubGVuZ3RoID4gMSApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9jaGVjayBpZiBiZXR3ZWVuIHRoZSBjaGlsZHJlbiB3ZSBoYXZlIGluY29tcGF0aWJsZSBzaWJsaW5ncyAoZ2V0dGV4dCBvciBkeW5hbWljIHN0cmluZ3MpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGluY29tcGF0aWJsZVNpYmxpbmdzID0gcGFyZW50Tm9kZS5xdWVyeVNlbGVjdG9yQWxsKCBzZWxmLm1lcmdlUnVsZXMuaW5jb21wYXRpYmxlX3NpYmxpbmdzIClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggaW5jb21wYXRpYmxlU2libGluZ3MubGVuZ3RoID09IDAgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWN0aW9uID0gJ21lcmdlJ1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIHJldHVybiBhY3Rpb25cclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgc3RyaXBFZGl0b3JEYXRhKCB0YXJnZXQgKXtcclxuICAgICAgICAgICAgICAgI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GV4KCAnZGF0YS10cnAtdHJhbnNsYXRlLWlkJywgc3RyaW5nSWQgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHNlbGYuZGljdGlvbmFyeVtpbmRleF0udHJhbnNsYXRpb25zQXJyYXlbc2VsZi5jdXJyZW50TGFuZ3VhZ2VdICYmIHNlbGYuZGljdGlvbmFyeVtpbmRleF0udHJhbnNsYXRpb25zQXJyYXlbc2VsZi5jdXJyZW50TGFuZ3VhZ2VdLnN0YXR1cyAhPSAwICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5pbm5lckhUTUwgPSBub2RlLmlubmVyVGV4dC5yZXBsYWNlKCBzZWxmLmRpY3Rpb25hcnlbaW5kZXhdLnRyYW5zbGF0aW9uc0FycmF5W3NlbGYuY3VycmVudExhbmd1YWdlXS50cmFuc2xhdGVkLCBzZWxmLmRpY3Rpb25hcnlbaW5kZXhdLm9yaWdpbmFsIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgY29weS5xdWVyeVNlbGVjdG9yQWxsKCAndHJhbnNsYXRlLXByZXNzLCB0cnAtd3JhcCwgdHJwLWhpZ2hsaWdodCcgKS5mb3JFYWNoKCBmdW5jdGlvbiggbm9kZSApIHtcclxuICAgICAgICAgICAgICAgICAgICB1dGlscy51bndyYXAoIG5vZGUgKVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgYXR0cmlidXRlc1RvUmVwbGFjZSA9IFsgJ2hyZWYnLCAndGFyZ2V0JyBdXHJcblxyXG4gICAgICAgICAgICAgICAgYXR0cmlidXRlc1RvUmVwbGFjZS5mb3JFYWNoKCBmdW5jdGlvbiggYXR0cmlidXRlICkge1xyXG4gICAgICAgICAgICAgICAgICAgIGNvcHkucXVlcnlTZWxlY3RvckFsbCgg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Z1bmN0aW9uKCBhdHRyaWJ1dGUgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgY29weS5xdWVyeVNlbGVjdG9yQWxsKCAnWycgKyBhdHRyaWJ1dGUgKyAnXScgKS5mb3JFYWNoKCBmdW5jdGlvbiggbm9kZSApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5yZW1vdmVBdHRyaWJ1dGUoIGF0dHJpYnV0ZSApXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIGNvcHkuaW5uZXJIVE1MXHJcblxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICByZW1vdmVIaWdobGlnaHQoIHJlbW92ZUZyb21CbG9ja3MgPSB0cnVlICl7XHJcbiAgICAgICAgICAgICAgICBsZXQgcHJldmlvdXNseUhpZ2hsaWdodGVkID0gdGhpcy5pZnJhbWUuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSggJ3RycC1oaWdobGlnaHQnIClcclxuXHJcbiAgICAgICAgICAgICAgICBpZiggcHJldmlvdXNseUhpZ2hsaWdodGVkLmxlbmd0aCA+IDAgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgZm9yICggaSA9IDA7IGkgPCBwcmV2aW91c2x5SGlnaGxpZ2h0ZWQubGVuZ3RoOyBpKysgKSB7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHJlbW92ZUZyb21CbG9ja3MgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNseUhpZ2hsaWdodGVkW2ldLmNsYXNzTGlzdC5yZW1vdmUoICd0cnAtaGlnaGxpZ2h0JyApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKCAhcmVtb3ZlRnJvbUJsb2NrcyAmJiAhcHJldmlvdXNseUhpZ2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G9sZGVyJ11cclxuICAgICAgICAgICAgICAgIGxldCBmb3JjZVBlbmNpbERpc3BsYXkgPSBmYWxzZVxyXG4gICAgICAgICAgICAgICAgaWYgKCB0YXJnZXQudGFnTmFtZSA9PT0gJ0lNRycgKXtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgaVxyXG4gICAgICAgICAgICAgICAgICAgIGZvciAoIGkgPSAwOyBpIDwgZm9yY2VQZW5jaWxEaXNwbGF5Q2xhc3Nlcy5sZW5ndGg7IGkrKyApe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHRhcmdldC5jbGFzc0xpc3QuY29udGFpbnMoIGZvcmNlUGVuY2lsRGlzcGxheUNsYXNzZXNbaV0gKSApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmNlUGVuY2lsRGlzcGxheSA9IHRydWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIGxldCByZWN0ID0gdGFyZ2V0LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpXHJcbiAgICAgICAgICAgICAgICBpZiggZm9yY2VQZW5jaWxEaXNwbGF5IHx8IHJlY3QubGVmdCA8IDM1ICkge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBtYXJnaW5cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgaWYoIG1lcmdlT3JTcGxpdCAhPSAnbm9uZScgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBtYXJnaW4gPSA2MFxyXG4gICAgICAgICAgICAgICAgICAgIGVsc2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgbWFyZ2luID0gMzBcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgcGVuY2lsLnNldEF0dHJpYnV0ZSggJ3N0eWxlJywgJ21hcmdpbi1sZWZ0OiAnICsgbWFyZ2luICsgJ3B4ICFpbXBvcnRhbnQnIClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgZ2V0VHJwU3BhbigpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiAnPHRycC1zcGFuPjx0cnAtbWVyZ2UgdGl0bGU9XCInKyB0aGlzLmVkaXRvclN0cmluZ3MubWVyZ2UgKydcIiBjbGFzcz1cInRycC1pY29uIHRycC1tZXJnZSBkYXNoaWNvbnMgZGFzaGljb25zLWFycm93LXVwLWFsdFwiPjwvdHJwLW1lcmdlPjx0cnAtc3BsaXQgdGl0bGU9XCInKyB0aGlzLmVkaXRvclN0cmluZ3Muc3BsaXQgKydcIiBjbGFzcz1cInRycC1pY29uIHRycC1zcGxpdCBkYXNoaWNvbnMgZGFzaGljb25zLWFycm93LWRvd24tYWx0XCI+PC90cnAtc3BsaXQ+PHRycC1lZGl0IHRpdGxlPVwiJysgdGhpcy5lZGl0b3JTdHJpbmdzLmVkaXQgKydcIiBjbGFzcz1cInRycC1pY29uIHRycC1lZGl0LXRyYW5zbGF0aW9uIGRhc2hpY29ucyBkYXNoaWNvbnMtZWRpdFwiPjwvdHJwLWVkaXQ+PC90cnAtc3Bhbj4nXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbjwvc2NyaXB0PlxyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/hover-actions.vue?vue&type=script&lang=js&\n");
|
706 |
|
707 |
/***/ }),
|
708 |
|
@@ -714,7 +714,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uti
|
|
714 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
715 |
|
716 |
"use strict";
|
717 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _translation_input_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./translation-input.vue */ \"./assets/src/js/components/translation-input.vue\");\n/* harmony import */ var _translation_memory_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-memory.vue */ \"./assets/src/js/components/translation-memory.vue\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['selectedIndexesArray', 'dictionary', 'currentLanguage', 'onScreenLanguage', 'languageNames', 'settings', 'showChangesUnsavedMessage', 'editorStrings', 'flagsPath', 'iframe', 'nonces', 'ajax_url'],\n data: function data() {\n return {\n languages: [],\n completeLanguageNames: Object.assign({\n 'original': 'Original String'\n }, this.languageNames),\n othersButtonPositionOffset: 1,\n showOtherLanguages: false,\n orderedLanguages: [],\n showImageIcon: true\n };\n },\n components: {\n translationInput: _translation_input_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n translationMemory: _translation_memory_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n },\n mounted: function mounted() {\n this.determineLanguageOrder();\n this.addKeyboardShortcutsListener();\n },\n updated: function updated() {\n // if already active do nothing\n if (document.activeElement.classList.contains('trp-translation-input')) {\n return;\n } // place the cursor in the first textarea or input for translation\n\n\n var translationSection = document.getElementById('trp-translation-section');\n\n if (translationSection) {\n var focusableSelectors = ['textarea:not([readonly])', 'input[type=\"text\"]:not([readonly])'];\n\n for (var i = 0; i < focusableSelectors.length; i++) {\n var focusable = document.getElementById('trp-translation-section').querySelector(focusableSelectors[i]);\n\n if (focusable) {\n focusable.focus();\n break;\n }\n }\n }\n },\n watch: {\n selectedIndexesArray: function selectedIndexesArray() {\n this.updateLanguages();\n },\n onScreenLanguage: function onScreenLanguage() {\n this.determineLanguageOrder();\n this.updateLanguages();\n }\n },\n computed: {\n othersButtonPosition: function othersButtonPosition() {\n if (this.currentLanguage === this.settings['default-language'] || this.settings['translation-languages'].length <= 2) {\n // don't display it\n return 999;\n } else {\n return this.othersButtonPositionOffset;\n }\n }\n },\n methods: {\n determineLanguageOrder: function determineLanguageOrder() {\n var self = this;\n var filteredLanguages = this.settings['translation-languages'].filter(function (language, index, array) {\n // all languages except default and current or on screen language.\n return self.settings['default-language'] !== language && self.onScreenLanguage !== language;\n });\n this.orderedLanguages = [];\n this.orderedLanguages.push(this.settings['default-language']);\n if (this.onScreenLanguage !== '') this.orderedLanguages.push(this.onScreenLanguage);\n this.orderedLanguages = this.orderedLanguages.concat(filteredLanguages);\n },\n updateLanguages: function updateLanguages() {\n this.languages = [];\n var self = this;\n var defaultLanguage = this.settings['default-language'];\n var translateToDefault = false;\n this.showImageIcon = false;\n this.othersButtonPositionOffset = 1;\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n if (self.dictionary[selectedIndex] && self.dictionary[selectedIndex].translationsArray[defaultLanguage]) translateToDefault = true;\n if (self.dictionary[selectedIndex] && self.dictionary[selectedIndex].attribute === 'src') self.showImageIcon = true;\n });\n\n if (translateToDefault) {\n this.languages.push('original');\n this.othersButtonPositionOffset++;\n }\n\n this.languages = this.languages.concat(this.orderedLanguages);\n },\n discardChanges: function discardChanges(selectedIndex, languageCode) {\n this.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation = this.dictionary[selectedIndex].translationsArray[languageCode].translated;\n this.$emit('discarded-changes');\n },\n hasUnsavedChanges: function hasUnsavedChanges(selectedIndex, languageCode) {\n return this.dictionary[selectedIndex].translationsArray[languageCode].translated !== this.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation;\n },\n discardAll: function discardAll() {\n var self = this;\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n self.settings['translation-languages'].forEach(function (languageCode) {\n if (self.dictionary[selectedIndex].translationsArray[languageCode] && self.dictionary[selectedIndex].translationsArray[languageCode].translated !== self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation) {\n self.discardChanges(selectedIndex, languageCode);\n }\n });\n });\n\n if (this.$parent.mergingString === true) {\n this.$parent.selectedString = null;\n var previouslyHighlighted = this.iframe.getElementsByClassName('trp-create-translation-block');\n\n if (previouslyHighlighted.length > 0) {\n var i;\n\n for (i = 0; i < previouslyHighlighted.length; i++) {\n previouslyHighlighted[i].classList.remove('trp-highlight');\n previouslyHighlighted[i].classList.remove('trp-create-translation-block');\n }\n }\n\n this.$parent.mergingString = false;\n this.$parent.mergeData = [];\n }\n },\n addKeyboardShortcutsListener: function addKeyboardShortcutsListener() {\n document.addEventListener(\"keydown\", function (e) {\n // CTRL + ALT + Z\n if ((window.navigator.platform.match(\"Mac\") ? e.metaKey : e.ctrlKey) && e.altKey && e.keyCode === 90) {\n e.preventDefault();\n window.dispatchEvent(new Event('trp_trigger_discard_all_changes_event'));\n }\n }, false);\n window.addEventListener('trp_trigger_discard_all_changes_event', this.discardAll);\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL2xhbmd1YWdlLWJveGVzLnZ1ZT80OWJjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUE0Q0E7QUFDQTtBQUNBO0FBQ0EsVUFDQSxzQkFEQSxFQUVBLFlBRkEsRUFHQSxpQkFIQSxFQUlBLGtCQUpBLEVBS0EsZUFMQSxFQU1BLFVBTkEsRUFPQSwyQkFQQSxFQVFBLGVBUkEsRUFTQSxXQVRBLEVBVUEsUUFWQSxFQVdBLFFBWEEsRUFZQSxVQVpBLENBREE7QUFlQSxNQWZBLGtCQWVBO0FBQ0E7QUFDQSxtQkFEQ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AgICAgICA8L2Rpdj5cclxuICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgPC9kaXY+XHJcbiAgICA8L2Rpdj5cclxuPC90ZW1wbGF0ZT5cclxuXHJcbjxzY3JpcHQ+XHJcbiAgICBpbXBvcnQgdHJhbnNsYXRpb25JbnB1dCBmcm9tICcuL3RyYW5zbGF0aW9uLWlucHV0LnZ1ZSdcclxuICAgIGltcG9ydCB0cmFuc2xhdGlvbk1lbW9yeSBmcm9tICcuL3RyYW5zbGF0aW9uLW1lbW9yeS52dWUnXHJcbiAgICBleHBvcnQgZGVmYXVsdHtcclxuICAgICAgICBwcm9wczpbXHJcbiAgICAgICAgICAgICdzZWxlY3RlZEluZGV4ZXNBcnJheScsXHJcbiAgICAgICAgICAgICdkaWN0aW9uYXJ5JyxcclxuICAgICAgICAgICAgJ2N1cnJlbnRMYW5ndWFnZScsXHJcbiAgICAgICAgICAgICdvblNjcmVlbkxhbmd1YWdlJyxcclxuICAgICAgICAgICAgJ2xhbmd1YWdlTmFtZXMnLFxyXG4gICAgICAgICAgICAnc2V0dGluZ3MnLFxyXG4gICAgICAgICAgICAnc2hvd0NoYW5nZXNVbnNhdmVkTWVzc2FnZScsXHJcbiAgICAgICAgICAgICdlZGl0b3JTdHJpbmdzJyxcclxuICAgICAgICAgICAgJ2ZsYWdzUGF0aCcsXHJcbiAgICAgICAgICAgICdpZnJhbWUnLFxyXG4gICAgICAgICAgICAnbm9uY2VzJyxcclxuICAgICAgICAgICAgJ2FqYXhfdXJsJ1xyXG4gICAgICAgIF0sXHJcbiAgICAgICAgZGF0YSgpe1xyXG4gICAgICAgICAgICByZXR1cm57XHJcbiAgICAgICAgICAgICAgICBsYW5ndWFnZXMgICAgICAgICAgICAgICAgICA6IFtdLFxyXG4gICAgICAgICAgICAgICAgY29tcGxldGVMYW5ndWFnZU5hbWVzICAgICAgOiBPYmplY3QuYXNzaWduKCB7ICdvcmlnaW5hbCc6ICdPcmlnaW5hbCBTdHJpbmcnIH0sIHRoaXMubGFuZ3VhZ2VOYW1lcyApLFxyXG4gICAgICAgICAgICAgICAgb3RoZXJzQnV0dG9uUG9zaXRpb25PZmZzZXQgOiAxLFxyXG4gICAgICAgICAgICAgICAgc2hvd090aGVyTGFuZ3VhZ2VzICAgICAgICAgOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIG9yZGVyZWRMYW5ndWFnZXMgICAgICAgICAgIDogW10sXHJcbiAgICAgICAgICAgICAgICBzaG93SW1hZ2VJY29uICAgICAgICAgICAgICA6IHRydWVcclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAgY29tcG9uZW50czp7XHJcbiAgICAgICAgICAgIHRyYW5zbGF0aW9uSW5wdXQsXHJcbiAgICAgICAgICAgIHRyYW5zbGF0aW9uTWVtb3J5XHJcbiAgICAgICAgfSxcclxuICAgICAgICBtb3VudGVkKCl7XHJcbiAgICAgICAgICAgIHRoaXMuZGV0ZXJtaW5lTGFuZ3VhZ2VPcmRlcigpXHJcbiAgICAgICAgICAgIHRoaXMuYWRkS2V5Ym9hcmRTaG9ydGN1dHNMaXN0ZW5lcigpXHJcbiAgICAgICAgfSxcclxuICAgICAgICB1cGRhdGVkKCl7XHJcbiAgICAgICAgICAgIC8vIGlmIGFscmVhZHkgYWN0aXZlIGRvIG5vdGhpbmdcclxuICAgICAgICAgICAgaWYgKCBkb2N1bWVudC5hY3RpdmVFbGVtZW50LmNsYXNzTGlzdC5jb250YWlucyggJ3RycC10cmFuc2xhdGlvbi1pbnB1dCcgKSl7XHJcbiAgICAgICAgICAgICAgICByZXR1cm5cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAvLyBwbGFjZSB0aGUgY3Vyc29yIGluIHRoZSBmaXJzdCB0ZXh0YXJlYSBvciBpbnB1dCBmb3IgdHJhbnNsYXRpb25cclxuICAgICAgICAgICAgbGV0IHRyYW5zbGF0aW9uU2VjdGlvbiA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCAndHJwLXRyYW5zbGF0aW9uLXNlY3Rpb24nIClcclxuICAgICAgICAgICAgaWYgKCB0cmFuc2xhdGlvblNlY3Rpb24gKSAge1xyXG4gICAgICAgICAgICAgICAgbGV0IGZvY3VzYWJsZVNlbGVjdG9ycyA9IFsndGV4dGFyZWE6bm90KFtyZWFkb25seV0pJywgJ2lucHV0W3R5cGU9XCJ0ZXh0XCJdOm5vdChbcmVhZG9ubHldKSddXHJcbiAgICAgICAgICAgICAgICBmb3IgKCB2YXIgaSA9IDA7IGk8Zm9jdXNhYmxlU2VsZWN0b3JzLmxlbmd0aDsgaSsrICl7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGZvY3VzYWJsZSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCAndHJwLXRyYW5zbGF0aW9uLXNlY3Rpb24nICkucXVlcnlTZWxlY3Rvcihmb2N1c2FibGVTZWxlY3RvcnNbaV0pXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBmb2N1c2FibGUgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvY3VzYWJsZS5mb2N1cygpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG4gICAgICAgIH0sXHJcbiAgICAgICAgd2F0Y2g6IHtcclxuICAgICAgICAgICAgc2VsZWN0ZWRJbmRleGVzQXJyYXk6IGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlTGFuZ3VhZ2VzKClcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgb25TY3JlZW5MYW5ndWFnZTogZnVuY3Rpb24oKXtcclxuICAgICAgICAgICAgICAgIHRoaXMuZGV0ZXJtaW5lTGFuZ3VhZ2VPcmRlcigpXHJcbiAgICAgICAgICAgICAgICB0aGlzLnVwZGF0ZUxhbmd1YWdlcygpXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIGNvbXB1dGVkOntcclxuICAgICAgICAgICAgb3RoZXJzQnV0dG9uUG9zaXRpb246IGZ1bmN0aW9uICgpe1xyXG4gICAgICAgICAgICAgICAgaWYgKHRoaXMuY3VycmVudExhbmd1YWdlID09PSB0aGlzLnNldHRpbmdzWydkZWZhdWx0LWxhbmd1YWdlJ10gfHwgdGhpcy5zZXR0aW5nc1sndHJhbnNsYXRpb24tbGFuZ3VhZ2VzJ10ubGVuZ3RoIDw9IDIgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gZG9uJ3QgZGlzcGxheSBpdFxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiA5OTlcclxuICAgICAgICAgICAgICAgIH1lbHNle1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLm90aGVyc0J1dHRvblBvc2l0aW9uT2Zmc2V0XHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9LFxyXG4gICAgICAgIG1ldGhvZHM6e1xyXG4gICAgICAgICAgICBkZXRlcm1pbmVMYW5ndWFnZU9yZGVyOiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcclxuICAgICAgICAgICAgICAgIGxldCBmaWx0ZXJlZExhbmd1YWdlcyA9IHRoaXMuc2V0dGluZ3NbJ3RyYW5zbGF0aW9uLWxhbmd1YWdlcyddLmZpbHRlcihmdW5jdGlvbihsYW5ndWFnZSwgaW5kZXgsIGFycmF5KXtcclxuICAgICAgICAgICAgICAgICAgICAvLyBhbGwgbGFuZ3VhZ2VzIGV4Y2VwdCBkZWZhdWx0IGFuZCBjdXJyZW50IG9yIG9uIHNjcmVlbiBsYW5ndWFnZS5cclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gKCBzZWxmLnNldHRpbmdzWydkZWZhdWx0LWxhbmd1YWdlJ10gIT09IGxhbmd1YWdlICkgJiYgKCBzZWxmLm9uU2NyZWVuTGFuZ3VhZ2UgIT09IGxhbmd1YWdlIClcclxuICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgdGhpcy5vcmRlcmVkTGFuZ3VhZ2VzID0gW11cclxuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJlZExhbmd1YWdlcy5wdXNoKCB0aGlzLnNldHRpbmdzWydkZWZhdWx0LWxhbmd1YWdlJ10gKVxyXG4gICAgICAgICAgICAgICAgaWYgKCB0aGlzLm9uU2NyZWVuTGFuZ3VhZ2UgIT09ICcnIClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9yZGVyZWRMYW5ndWFnZXMucHVzaCggdGhpcy5vblNjcmVlbkxhbmd1YWdlIClcclxuICAgICAgICAgICAgICAgIHRoaXMub3JkZXJlZExhbmd1YWdlcyA9IHRoaXMub3JkZXJlZExhbmd1YWdlcy5jb25jYXQoIGZpbHRlcmVkTGFuZ3VhZ2VzIClcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgdXBkYXRlTGFuZ3VhZ2VzOiBmdW5jdGlvbiAoKSB7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmxhbmd1YWdlcyAgICAgICAgICAgICAgICAgID0gW11cclxuICAgICAgICAgICAgICAgIGxldCBzZWxmICAgICAgICAgICAgICAgICAgICAgICAgPSB0aGlzXHJcbiAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdExhbmd1YWdlICAgICAgICAgICAgID0gdGhpcy5zZXR0aW5nc1snZGVmYXVsdC1sYW5ndWFnZSddXHJcbiAgICAgICAgICAgICAgICBsZXQgdHJhbnNsYXRlVG9EZWZhdWx0ICAgICAgICAgID0gZmFsc2VcclxuICAgICAgICAgICAgICAgIHRoaXMuc2hvd0ltYWdlSWNvbiAgICAgICAgICAgICAgPSBmYWxzZVxyXG4gICAgICAgICAgICAgICAgdGhpcy5vdGhlcnNCdXR0b25Qb3NpdGlvb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S50cmFuc2xhdGlvbnNBcnJheVtsYW5ndWFnZUNvZGVdICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0udHJhbnNsYXRlZCAhPT0gc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0uZWRpdGVkVHJhbnNsYXRpb24pICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5kaXNjYXJkQ2hhbmdlcyhzZWxlY3RlZEluZGV4LGxhbmd1YWdlQ29kZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIGlmICggdGhpcy4kcGFyZW50Lm1lcmdpbmdTdHJpbmcgPT09IHRydWUgKXtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRwYXJlbnQuc2VsZWN0ZWRTdHJpbmcgPSBudWxsXHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IHByZXZpb3VzbHlIaWdobGlnaHRlZCA9IHRoaXMuaWZyYW1lLmdldEVsZW1lbnRzQnlDbGFzc05hbWUoICd0cnAtY3JlYXRlLXRyYW5zbGF0aW9uLWJsb2NrJyApXHJcbiAgICAgICAgICAgICAgICAgICAgaWYoIHByZXZpb3VzbHlIaWdobGlnaHRlZC5sZW5ndGggPiAwICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IHByZXZpb3VzbHlIaWdobGlnaHRlZC5sZW5ndGg7IGkrKyApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzbHlIaWdobGlnaHRlZFtpXS5jbGFzc0xpc3QucmVtb3ZlKCd0cnAtaGlnaGxpZ2h0JylcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzbHlIaWdobGlnaHRlZFtpXS5jbGFzc0xpc3QucmVtb3ZlKCd0cnAtY3JlYXRlLXRyYW5zbGF0aW9uLWJsb2NrJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB0aGlzLiRwYXJlbnQubWVyZ2luZ1N0cmluZyA9IGZhbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy4kcGFyZW50Lm1lcmdlRGF0YSA9IFtdXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGFkZEtleWJvYXJkU2hvcnRjdXRzTGlzdGVuZXIoKXtcclxuICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoXCJrZXlkb3duXCIsIGZ1bmN0aW9uKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICAvLyBDVFJMICsgQUxUICsgWlxyXG4gICAgICAgICAgICAgICAgICAgIGlmICgod2luZG93Lm5hdmlnYXRvci5wbGF0Zm9ybS5tYXRjaChcIk1hY1wiKSA/IGUubWV0YUtleSA6IGUuY3RybEtleSkgJiYgZS5hbHRLZXkgJiYgZS5rZXlDb2RlID09PSA5MCApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgZS5wcmV2ZW50RGVmYXVsdCgpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuZGlzcGF0Y2hFdmVudChuZXcgRXZlbnQoJ3RycF90cmlnZ2VyX2Rpc2NhcmRfYWxsX2NoYW5nZXNfZXZlbnQnKSk7XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSwgZmFsc2UpO1xyXG5cclxuICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCAndHJwX3RyaWdnZXJfZGlzY2FyZF9hbGxfY2hhbmdlc19ldmVudCcsIHRoaXMuZGlzY2FyZEFsbCApXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbjwvc2NyaXB0PlxyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/language-boxes.vue?vue&type=script&lang=js&\n");
|
718 |
|
719 |
/***/ }),
|
720 |
|
@@ -726,7 +726,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _tra
|
|
726 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
727 |
|
728 |
"use strict";
|
729 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);\n//\n//\n//\n//\n//\n//\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['selectedIndexesArray', 'selectedString', 'dictionary', 'settings', 'nonces', 'ajax_url', 'currentLanguage', 'onScreenLanguage', 'iframe', 'currentURL', 'mergingString', 'mergeData', 'editorStrings'],\n data: function data() {\n return {\n 'saveButtonText': this.editorStrings.save_translation,\n 'saveStringsRequestsLeft': 0,\n 'disabledSaveButton': false\n };\n },\n mounted: function mounted() {\n this.addKeyboardShortcutsListener();\n },\n watch: {\n saveStringsRequestsLeft: function saveStringsRequestsLeft(newValue, oldValue) {\n if (newValue > 0) {\n this.disabledSaveButton = true;\n this.saveButtonText = this.editorStrings.saving_translation;\n } else {\n this.disabledSaveButton = false;\n this.saveButtonText = this.editorStrings.save_translation;\n this.showTranslationsSaved();\n }\n }\n },\n methods: {\n save: function save() {\n if (this.mergingString) this.createTranslationBlock();else {\n this.saveStringType('gettext');\n this.saveStringType('regular');\n this.saveStringType('postslug');\n }\n\n if (this.saveStringsRequestsLeft === 0) {\n // no saving action was triggered\n this.showTranslationsSaved();\n }\n },\n saveStringType: function saveStringType(typeSlug) {\n this.saveStringsRequestsLeft++;\n var self = this;\n var saveData = {};\n var updateIframeData = {};\n var foundStringsToSave = false; // construct an array of the necessary information\n\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n if (typeSlug === self.dictionary[selectedIndex].type) {\n self.settings['translation-languages'].forEach(function (languageCode) {\n saveData[languageCode] = saveData[languageCode] ? saveData[languageCode] : [];\n updateIframeData[languageCode] = updateIframeData[languageCode] ? updateIframeData[languageCode] : [];\n\n if (self.dictionary[selectedIndex].translationsArray[languageCode] && self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation != self.dictionary[selectedIndex].translationsArray[languageCode].translated) {\n self.dictionary[selectedIndex].translationsArray[languageCode].status = self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation === '' ? 0 : 2;\n self.dictionary[selectedIndex].translationsArray[languageCode].translated = self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation;\n saveData[languageCode].push(self.dictionary[selectedIndex].translationsArray[languageCode]);\n updateIframeData[languageCode].push(self.dictionary[selectedIndex]);\n foundStringsToSave = true;\n }\n });\n }\n }); // send request to save strings in database\n\n if (foundStringsToSave) {\n var data = new FormData();\n data.append('action', 'trp_save_translations_' + typeSlug);\n data.append('security', this.nonces['savetranslationsnonce' + typeSlug]);\n data.append('strings', JSON.stringify(saveData));\n axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(this.ajax_url, data).then(function (response) {\n if (typeSlug === 'gettext') {\n axios__WEBPACK_IMPORTED_MODULE_0___default.a.get(self.currentURL).then(function (reloadedIframeResponse) {\n self.updateIframe(updateIframeData, reloadedIframeResponse.data);\n self.saveStringsRequestsLeft--;\n });\n } else {\n self.updateIframe(updateIframeData);\n self.saveStringsRequestsLeft--;\n }\n\n self.$emit('translations-saved');\n })[\"catch\"](function (error) {\n console.log(error);\n });\n } else {\n self.saveStringsRequestsLeft--;\n }\n },\n updateIframe: function updateIframe(updateIframeData) {\n var reloadedIframeResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var self = this;\n this.settings['translation-languages'].forEach(function (languageCode) {\n if (updateIframeData[languageCode].length > 0) {\n updateIframeData[languageCode].forEach(function (string) {\n if (self.currentLanguage === languageCode) {\n self.setTextInIframe(string, languageCode, reloadedIframeResponse);\n }\n });\n }\n });\n },\n setTextInIframe: function setTextInIframe(string, languageCode, reloadedIframeResponse) {\n var nodes = this.iframe.querySelectorAll(\"[\" + string.selector + \"='\" + string.dbID + \"']\");\n var textToSet = null;\n\n if (reloadedIframeResponse) {\n var translatedNode = document.createRange().createContextualFragment(reloadedIframeResponse).querySelector(\"[\" + string.selector + \"='\" + string.dbID + \"']\");\n\n if (translatedNode) {\n textToSet = typeof string.attribute === 'undefined' || string.attribute === \"\" ? translatedNode.textContent : translatedNode.getAttribute(string.attribute);\n }\n }\n\n if (textToSet === null) {\n textToSet = string.translationsArray[languageCode].translated === '' ? string.original : string.translationsArray[languageCode].translated;\n }\n\n nodes.forEach(function (node) {\n if (typeof string.attribute === 'undefined' || string.attribute === \"\" || string.attribute === 'innertext') {\n var initialValue = node.textContent;\n textToSet = initialValue.replace(initialValue.trim(), textToSet);\n node.innerHTML = textToSet;\n } else {\n var _initialValue = node.getAttribute(string.attribute);\n\n textToSet = _initialValue.replace(_initialValue.trim(), textToSet);\n node.setAttribute(string.attribute, textToSet);\n\n if (string.attribute === 'src') {\n node.setAttribute('srcset', '');\n }\n }\n });\n },\n createTranslationBlock: function createTranslationBlock() {\n this.saveStringsRequestsLeft++;\n var self = this;\n var saveData = {},\n translation = {},\n original;\n var foundStringsToSave = false;\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n self.settings['translation-languages'].forEach(function (languageCode) {\n saveData[languageCode] = saveData[languageCode] ? saveData[languageCode] : [];\n\n if (self.dictionary[selectedIndex] && self.dictionary[selectedIndex].translationsArray[languageCode]) {\n translation = self.dictionary[selectedIndex].translationsArray[languageCode];\n translation.block_type = self.dictionary[selectedIndex].block_type;\n translation.id = self.dictionary[selectedIndex].dbID;\n translation.original = self.dictionary[selectedIndex].original;\n\n if (self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation != self.dictionary[selectedIndex].translationsArray[languageCode].translated) {\n self.dictionary[selectedIndex].translationsArray[languageCode].translated = self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation;\n if (self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation !== '') self.dictionary[selectedIndex].translationsArray[languageCode].status = 2;\n }\n\n saveData[languageCode].push(translation);\n foundStringsToSave = true;\n }\n });\n original = self.dictionary[selectedIndex].original;\n });\n\n if (foundStringsToSave) {\n var data = new FormData();\n data.append('action', 'trp_create_translation_block');\n data.append('security', this.nonces['mergetbnonce']);\n data.append('language', this.currentLanguage);\n data.append('strings', JSON.stringify(saveData));\n data.append('original', original);\n data.append('all_languages', 'true');\n axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(this.ajax_url, data).then(function (response) {\n self.saveStringsRequestsLeft--;\n self.$parent.mergingString = false;\n var item = self.dictionary[self.selectedIndexesArray[0]]; //update dictionary string ids\n\n Object.keys(item.translationsArray).forEach(function (key) {\n Object.keys(response.data[key]).forEach(function (index) {\n if (key === self.onScreenLanguage) {\n self.dictionary[self.selectedIndexesArray[0]].dbID = response.data[key][index].id;\n }\n\n item.translationsArray[key].id = response.data[key][index].id;\n });\n });\n self.$parent.mergeData = []; //get merged string\n\n var mergedString;\n if (typeof item.translationsArray[self.currentLanguage] !== 'undefined' && item.translationsArray[self.currentLanguage].translated) mergedString = item.translationsArray[self.onScreenLanguage].translated;else mergedString = item.original; //replace HTML in iFrame\n\n var translationBlock = self.iframe.querySelector('.trp-create-translation-block');\n translationBlock.innerHTML = mergedString;\n translationBlock.setAttribute('data-trp-translate-id', item.dbID);\n translationBlock.classList.remove('trp-create-translation-block'); //setup event listener for new block\n\n self.$parent.setupEventListener(translationBlock);\n })[\"catch\"](function (error) {\n self.$parent.mergingString = false;\n console.log(error);\n });\n } else {\n this.saveStringsRequestsLeft--;\n }\n },\n showTranslationsSaved: function showTranslationsSaved() {\n var translationSaved = jQuery('#trp-translation-saved');\n translationSaved.css(\"display\", \"inline\");\n translationSaved.delay(3000).fadeOut(400);\n },\n addKeyboardShortcutsListener: function addKeyboardShortcutsListener() {\n document.addEventListener(\"keydown\", function (e) {\n // CTRL + S\n if ((window.navigator.platform.match(\"Mac\") ? e.metaKey : e.ctrlKey) && e.keyCode === 83) {\n e.preventDefault();\n window.dispatchEvent(new Event('trp_trigger_save_translations_event'));\n }\n }, false);\n window.addEventListener('trp_trigger_save_translations_event', this.save);\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL3NhdmUtdHJhbnNsYXRpb25zLnZ1ZT85ODU1Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7OztBQU9BO0FBRUE7QUFDQSxVQUNBLHNCQURBLEVBRUEsZ0JBRkEsRUFHQSxZQUhBLEVBSUEsVUFKQSxFQUtBLFFBTEEsRUFNQSxVQU5BLEVBT0EsaUJBUEEsRUFRQSxrQkFSQSxFQVNBLFFBVEEsRUFVQSxZQVZBLEVBV0EsZUFYQSxFQVlBLFdBWkEsRUFhQSxlQWJBLENBREE7QUFnQkEsTUFoQkEsa0JBZ0JBO0FBQ0E7QUFDQSwyREFEQTtBQUVBLGtDQUZBO0FBR0E7QUFIQTtBQUtBLEdBdEJBO0FBdUJBLFNBdkJBLHFCQXVCQTtBQUNBO0FBQ0EsR0F6QkE7QUEwQkE7QUFDQTtBQUN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3VhZ2UnLFxyXG4gICAgICAgICAgICAnaWZyYW1lJyxcclxuICAgICAgICAgICAgJ2N1cnJlbnRVUkwnLFxyXG4gICAgICAgICAgICAnbWVyZ2luZ1N0cmluZycsXHJcbiAgICAgICAgICAgICdtZXJnZURhdGEnLFxyXG4gICAgICAgICAgICAnZWRpdG9yU3RyaW5ncydcclxuICAgICAgICBdLFxyXG4gICAgICAgIGRhdGEoKXtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgICdzYXZlQnV0dG9uVGV4dCcgICAgICAgICAgICA6IHRoaXMuZWRpdG9yU3RyaW5ncy5zYXZlX3RyYW5zbGF0aW9uLFxyXG4gICAgICAgICAgICAgICAgJ3NhdmVTdHJpbmdzUmVxdWVzdHNMZWZ0JyAgIDogMCxcclxuICAgICAgICAgICAgICAgICdkaXNhYmxlZFNhdmVCdXR0b24nICAgICAgICA6IGZhbHNlLFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBtb3VudGVkKCl7XHJcbiAgICAgICAgICAgIHRoaXMuYWRkS2V5Ym9hcmRTaG9ydGN1dHNMaXN0ZW5lcigpXHJcbiAgICAgICAgfSxcclxuICAgICAgICB3YXRjaDp7XHJcbiAgICAgICAgICAgIHNhdmVTdHJpbmdzUmVxdWVzdHNMZWZ0IDogZnVuY3Rpb24oIG5ld1ZhbHVlLCBvbGRWYWx1ZSApe1xyXG4gICAgICAgICAgICAgICAgaWYgKCBuZXdWYWx1ZSA+IDAgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNhYmxlZFNhdmVCdXR0b24gPSB0cnVlXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zYXZlQnV0dG9uVGV4dCA9IHRoaXMuZWRpdG9yU3RyaW5ncy5zYXZpbmdfdHJhbnNsYXRpb25cclxuICAgICAgICAgICAgICAgIH1lbHNle1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuZGlzYWJsZWRTYXZlQnV0dG9uID0gZmFsc2VcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhdmVCdXR0b25UZXh0ID0gdGhpcy5lZGl0b3JTdHJpbmdzLnNhdmVfdHJhbnNsYXRpb25cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zaG93VHJhbnNsYXRpb25zU2F2ZWQoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBtZXRob2RzOntcclxuICAgICAgICAgICAgc2F2ZSgpe1xyXG4gICAgICAgICAgICAgICAgaWYgKCB0aGlzLm1lcmdpbmdTdHJpbmcgKVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlVHJhbnNsYXRpb25CbG9jaygpXHJcbiAgICAgICAgICAgICAgICBlbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhdmVTdHJpbmdUeXBlKCAnZ2V0dGV4dCcgKVxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2F2ZVN0cmluZ1R5cGUoICdyZWd1bGFyJyApXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zYXZlU3RyaW5nVHlwZSggJ3Bvc3RzbHVnJyApXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMuc2F2ZVN0cmluZ3NSZXF1ZXN0c0xlZnQgPT09IDAgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgLy8gbm8gc2F2aW5nIGFjdGlvbiB3YXMgdHJpZ2dlcmVkXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zaG93VHJhbnNsYXRpb25zU2F2ZWQoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBzYXZlU3RyaW5nVHlwZSggdHlwZVNsdWcgKXtcclxuICAgICAgICAgICAgICAgIHRoaXMuc2F2ZVN0cmluZ3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hZ2VDb2RlXS5wdXNoKCBzZWxmLmRpY3Rpb25hcnlbc2VsZWN0ZWRJbmRleF0gKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZFN0cmluZ3NUb1NhdmUgPSB0cnVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBzZW5kIHJlcXVlc3QgdG8gc2F2ZSBzdHJpbmdzIGluIGRhdGFiYXNlXHJcbiAgICAgICAgICAgICAgICBpZiAoIGZvdW5kU3RyaW5nc1RvU2F2ZSApIHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IG5ldyBGb3JtRGF0YSgpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdhY3Rpb24nLCAndHJwX3NhdmVfdHJhbnNsYXRpb25zXycgKyB0eXBlU2x1ZylcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3NlY3VyaXR5JywgdGhpcy5ub25jZXNbJ3NhdmV0cmFuc2xhdGlvbnNub25jZScgKyB0eXBlU2x1Z10pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdzdHJpbmdzJywgSlNPTi5zdHJpbmdpZnkoc2F2ZURhdGEpKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBheGlvcy5wb3N0KHRoaXMuYWpheF91cmwsIGRhdGEpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXNwb25zZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCB0eXBlU2x1ZyA9PT0gJ2dldHRleHQnICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF4aW9zLmdldChzZWxmLmN1cnJlbnRVUkwpLnRoZW4oIGZ1bmN0aW9uKCByZWxvYWRlZElmcmFtZVJlc3BvbnNlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYudXBkYXRlSWZyYW1lKHVwZGF0ZUlmcmFtZURhdGEsIHJlbG9hZGVkSWZyYW1lUmVzcG9uc2UuZGF0YSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zYXZlU3RyaW5nc1JlcXVlc3RzTGVmdC0tXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1lbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnVwZGF0ZUlmcmFtZSh1cGRhdGVJZnJhbWVEYXRhKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2F2ZVN0cmluZ3NSZXF1ZXN0c0xlZnQtLVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi4kZW1pdCgndHJhbnNsYXRpb25zLXNhdmVkJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmNhdGNoKGZ1bmN0aW9uIChlcnJvcikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICAgICAgfWVsc2V7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5zYXZlU3RyaW5nc1JlcXVlc3RzTGVmdC0tXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHVwZGF0ZUlmcmFtZSggdXBkYXRlSWZyYW1lRGF0YSwgcmVsb2FkZWRJZnJhbWVSZXNwb25zZSA9IG51bGwgKXtcclxuICAgICAgICAgICAgICAgIGxldCBzZWxmID0gdGhpc1xyXG4gICAgICAgICAgICAgICAgdGhpcy5zZXR0aW5nc1sndHJhbnNsYXRpb24tbGFuZ3VhZ2VzJ10uZm9yRWFjaCggZnVuY3Rpb24oIGxhbmd1YWdlQ29kZSAgKXtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIHVwZGF0ZUlmcmFtZURhdGFbbGFuZ3VhZ2VDb2RlXS5sZW5ndGggPiAwICl7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHVwZGF0ZUlmcmFtZURhdGFbbGFuZ3VhZ2VDb2RlXS5mb3JFYWNoKGZ1bmN0aW9uKCBzdHJpbmcgKXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggc2VsZi5jdXJyZW50TGFuZ3VhZ2UgPT09IGxhbmd1YWdlQ29kZSApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNldFRleHRJbklmcmFtZSggc3RyaW5nLCBsYW5ndWFnZUNvZGUsIHJlbG9hZGVkSWZyYW1lUmVzcG9uc2UgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIHNldFRleHRJbklmcmFtZSggc3RyaW5nLCBsYW5ndWFnZUNvZGUsIHJlbG9hZGVkSWZyYW1lUmVzcG9uc2UgKXtcclxuICAgICAgICAgICAgICAgIGxldCBub2RlcyA9IHRoaXMuaWZyYW1lLnF1ZXJ5U2VsZWN0b3JBbGwoIFwiW1wiICsgc3RyaW5nLnNlbGVjdG9yICsgXCI9J1wiICsgc3RyaW5nLmRiSUQgKyBcIiddXCIgKVxyXG4gICAgICAgICAgICAgICAgbGV0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ICAgICAgIGlmICh0eXBlb2Ygc3RyaW5nLmF0dHJpYnV0ZSA9PT0gJ3VuZGVmaW5lZCcgfHwgc3RyaW5nLmF0dHJpYnV0ZSA9PT0gXCJcIiB8fCBzdHJpbmcuYXR0cmlidXRlID09PSAnaW5uZXJ0ZXh0Jykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5pdGlhbFZhbHVlID0gbm9kZS50ZXh0Q29udGVudDtcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFRvU2V0ID0gaW5pdGlhbFZhbHVlLnJlcGxhY2UoaW5pdGlhbFZhbHVlLnRyaW0oKSwgdGV4dFRvU2V0KTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5pbm5lckhUTUwgPSB0ZXh0VG9TZXRcclxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5pdGlhbFZhbHVlID0gbm9kZS5nZXRBdHRyaWJ1dGUoc3RyaW5nLmF0dHJpYnV0ZSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgdGV4dFRvU2V0ID0gaW5pdGlhbFZhbHVlLnJlcGxhY2UoaW5pdGlhbFZhbHVlLnRyaW0oKSwgdGV4dFRvU2V0KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLnNldEF0dHJpYnV0ZShzdHJpbmcuYXR0cmlidXRlLCB0ZXh0VG9TZXQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBzdHJpbmcuYXR0cmlidXRlID09PSAnc3JjJyApe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5zZXRBdHRyaWJ1dGUoJ3NyY3NldCcsICcnKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgY3JlYXRlVHJhb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bbGFuZ3VhZ2VDb2RlXS5zdGF0dXMgPSAyXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2F2ZURhdGFbbGFuZ3VhZ2VDb2RlXS5wdXNoKCB0cmFuc2xhdGlvbiApXHJcblxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kU3RyaW5nc1RvU2F2ZSA9IHRydWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsID0gc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdLm9yaWdpbmFsXHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIGlmKCBmb3VuZFN0cmluZ3NUb1NhdmUgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBuZXcgRm9ybURhdGEoKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCggJ2FjdGlvbicgICAgICAgLCAndHJwX2NyZWF0ZV90cmFuc2xhdGlvbl9ibG9jaycgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCggJ3NlY3VyaXR5JyAgICAgLCB0aGlzLm5vbmNlc1snbWVyZ2V0Ym5vbmNlJ10gKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCggJ2xhbmd1YWdlJyAgICAgLCB0aGlzLmN1cnJlbnRMYW5ndWFnZSApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCAnc3RyaW5ncycgICAgICAsIEpTT04uc3RyaW5naWZ5KCBzYXZlRGF0YSApIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdvcmlnaW5hbCcgICAgICwgb3JpZ2luYWwgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCggJ2FsbF9sYW5ndWFnZXMnLCAndHJ1ZScgKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBheGlvcy5wb3N0KHRoaXMuYWpheF91cmwsIGRhdGEpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXNwb25zZSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zYXZlU3RyaW5nc1JlcXVlc3RzTGVmdC0tXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLiRwYXJlbnQubWVyZ2luZ1N0cmluZyA9IGZhbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaXRlbSA9IHNlbGYuZGljdGlvbmFyeVtzZWxmLnNlbGVjdGVkSW5kZXhlc0FycmF5WzBdXVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdXBkYXRlIGRpY3Rpb25hcnkgc3RyaW5nIGlkc1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgT2JqZWN0LmtleXMoIGl0ZW0udHJhbnNsYXRpb25zQXJyYXkgKS5mb3JFYWNoKCBmdW5jdGlvbihrZXkpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBPYmplY3Qua2V5cyggcmVzcG9uc2UuZGF0YVtrZXldICkuZm9yRWFjaCggZnVuY3Rpb24oaW5kZXgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBrZXkgPT09IHNlbGYub25TY3JlZW5MYW5ndWFnZSApe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5kaWN0aW9uYXJ5W3NlbGYuc2VsZWN0ZWRJbmRleGVzQXJyYXlbMF1dLmRiSUQgPSByZXNwb25zZS5kYXRhW2tleV1baW5kZXhdLmlkXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS50cmFuc2xhdGlvbnNBcnJheVtrZXldLmlkID0gcmVzcG9uc2UuZGF0YVtrZXldW2luZGV4XS5pZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuJHBhcmVudC5tZXJnZURhdGEgPSBbXVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0IG1lcmdlZCBzdHJpbmdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBtZXJnZWRTdHJpbmdcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggdHlwZW9mIGl0ZW0udHJhbnNsYXRpb25zQXJyYXlbc2VsZi5jdXJyZW50TGFuZ3VhZ2VdICE9PSAndW5kZWZpbmVkJyAmJiBpdGVtLnRyYW5zbGF0aW9uc0FycmF5W3NlbGYuY3VycmVudExhbmd1YWdlXS50cmFuc2xhdGVkIClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtZXJnZWRTdHJpbmcgPSBpdGVtLnRyYW5zbGF0aW9uc0FycmF5W3NlbGYub25TY3JlZW5MYW5ndWFnZV0udHJhbnNsYXRlZFxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZWxzZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lcmdlZFN0cmluZyA9IGl0ZW0ub3JpZ2luYWxcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL3JlcGxhY2UgSFRNTCBpbiBpRnJhbWVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0cmFuc2xhdGlvbkJsb2NrID0gc2VsZi5pZnJhbWUucXVlcnlTZWxlY3RvciggJy50cnAtY3JlYXRlLXRyYW5zbGF0aW9uLWJsb2NrJyApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRpb25CbG9jay5pbm5lckhUTUwgPSBtZXJnZWRTdHJpbmdcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0cmFuc2xhdGlvbkJsb2NrLnNldEF0dHJpYnV0ZSggJ2RhdGEtdHJwLXRyYW5zbGF0ZS1pZCcsIGl0ZW0uZGJJRCApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRpb25CbG9jay5jbGFzc0xpc3QucmVtb3ZlKCAndHJwLWNyZWF0ZS10cmFuc2xhdGlvbi1ibG9jaycgKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vc2V0dXAgZXZlbnQgbGlzdGVuZXIgZm9yIG5ldyBibG9ja1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi4kcGFyZW50LnNldHVwRXZlbnRMaXN0ZW5lciggdHJhbnNsYXRpb25CbG9jayApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbiAoZXJyb3IpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuJHBhcmVudC5tZXJnaW5nU3RyaW5nID0gZmFsc2VcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGVycm9yKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIH1lbHNle1xyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2F2ZVN0cmluZ3NSZXF1ZXN0c0xlZnQtLVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBzaG93VHJhbnNsYXRpb25zU2F2ZWQgOiBmdW5jdGlvbigpe1xyXG4gICAgICAgICAgICAgICAgbGV0IHRyYW5zbGF0aW9uU2F2ZWQgPSBqUXVlcnkoJyN0cnAtdHJhbnNsYXRpb24tc2F2ZWQnKVxyXG4gICAgICAgICAgICAgICAgdHJhbnNsYXRpb25TYXZlZC5jc3MoXCJkaXNwbGF5XCIsIFwiaW5saW5lXCIpXHJcbiAgICAgICAgICAgICAgICB0cmFuc2xhdGlvblNhdmVkLmRlbGF5KDMwMDApLmZhZGVPdXQoNDAwKVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBhZGRLZXlib2FyZFNob3J0Y3V0c0xpc3RlbmVyKCl7XHJcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFwia2V5ZG93blwiLCBmdW5jdGlvbihlKSB7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgIC8vIENUUkwgKyBTXHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh3aW5kb3cubmF2aWdhdG9yLnBsYXRmb3JtLm1hdGNoKFwiTWFjXCIpID8gZS5tZXRhS2V5IDogZS5jdHJsS2V5KSAgJiYgZS5rZXlDb2RlID09PSA4Mykge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cuZGlzcGF0Y2hFdmVudCggbmV3IEV2ZW50KCAndHJwX3RyaWdnZXJfc2F2ZV90cmFuc2xhdGlvbnNfZXZlbnQnICkgKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9LCBmYWxzZSk7XHJcblxyXG4gICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoICd0cnBfdHJpZ2dlcl9zYXZlX3RyYW5zbGF0aW9uc19ldmVudCcsIHRoaXMuc2F2ZSApXHJcbiAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgfVxyXG4gICAgfVxyXG48L3NjcmlwdD5cclxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/save-translations.vue?vue&type=script&lang=js&\n");
|
730 |
|
731 |
/***/ }),
|
732 |
|
@@ -738,7 +738,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axio
|
|
738 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
739 |
|
740 |
"use strict";
|
741 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! he */ \"./node_modules/he/he.js\");\n/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(he__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var autosize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! autosize */ \"./node_modules/autosize/dist/autosize.js\");\n/* harmony import */ var autosize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(autosize__WEBPACK_IMPORTED_MODULE_1__);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['value', 'string', 'readonly', 'highlightUnsavedChanges', 'editorStrings', 'nonces'],\n data: function data() {\n return {\n inputType: 'textarea',\n uploadMediaFrame: null,\n placeholder: ''\n };\n },\n mounted: function mounted() {\n var inputTypeArray = {\n '': 'textarea',\n 'content': 'textarea',\n 'alt': 'textarea',\n 'title': 'textarea',\n 'placeholder': 'textarea',\n 'outertext': 'textarea',\n 'value': 'textarea',\n 'src': 'inputmedia',\n 'href': 'inputmedia'\n };\n this.inputType = inputTypeArray[this.string.attribute] ? inputTypeArray[this.string.attribute] : 'textarea';\n this.inputType = this.readonly && this.inputType === 'inputmedia' ? 'input' : this.inputType;\n autosize__WEBPACK_IMPORTED_MODULE_1___default()(document.querySelectorAll('.trp-textarea'));\n\n if (this.inputType === 'inputmedia') {\n this.setupMediaUploader();\n\n if (this.string.attribute === 'href') {\n this.placeholder = 'http://example.com/';\n }\n }\n },\n methods: {\n getValue: function getValue() {\n if (this.value) return he__WEBPACK_IMPORTED_MODULE_0___default.a.decode(this.value);\n return this.value;\n },\n updateValue: function updateValue(value) {\n value = value ? value : this.$refs[this.inputType].value;\n this.$emit('input', value);\n },\n setupMediaUploader: function setupMediaUploader() {\n // Create a new media frame\n var self = this;\n this.uploadMediaFrame = wp.media({\n title: self.editorStrings.select_or_upload,\n button: {\n text: self.editorStrings.use_this_media\n },\n multiple: false // Set to true to allow multiple files to be selected\n\n }); // When an image is selected in the media frame...\n\n this.uploadMediaFrame.on('select', function () {\n // Get media attachment details from the frame state\n var attachment = self.uploadMediaFrame.state().get('selection').first().toJSON(); // Send the attachment URL to our custom image input field.\n\n self.updateValue(attachment.url);\n });\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
742 |
|
743 |
/***/ }),
|
744 |
|
@@ -750,7 +750,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var he__
|
|
750 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
751 |
|
752 |
"use strict";
|
753 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var autosize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! autosize */ \"./node_modules/autosize/dist/autosize.js\");\n/* harmony import */ var autosize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(autosize__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var simplediff__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! simplediff */ \"./node_modules/simplediff/simplediff.js\");\n/* harmony import */ var simplediff__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(simplediff__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var string_similarity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! string-similarity */ \"./node_modules/string-similarity/compare-strings.js\");\n/* harmony import */ var string_similarity__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(string_similarity__WEBPACK_IMPORTED_MODULE_3__);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['value', 'string', 'editorStrings', 'ajax_url', 'nonces', 'languageCode', 'inputValue'],\n data: function data() {\n return {\n suggestions: [],\n available_suggestions: false,\n similarity: 0,\n currentstring: this.string\n };\n },\n mounted: function mounted() {\n this.init();\n },\n methods: {\n init: function init() {\n var data = new FormData();\n data.append('action', 'trp_get_similar_string_translation');\n data.append('security', this.nonces['getsimilarstring']);\n data.append('original_string', this.string.original);\n data.append('language', this.languageCode);\n data.append('selector', this.string.selector);\n data.append('number', 3);\n var self = this;\n axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(this.ajax_url, data).then(function (response) {\n var suggestions = response.data;\n var i;\n\n for (i = suggestions.length - 1; i >= 0; --i) {\n suggestions[i]['similarity'] = Math.round(string_similarity__WEBPACK_IMPORTED_MODULE_3___default.a.compareTwoStrings(self.string.original, suggestions[i]['original']) * 100);\n suggestions[i]['original'] = simplediff__WEBPACK_IMPORTED_MODULE_2___default.a.htmlDiff(self.string.original, suggestions[i]['original']);\n\n if (suggestions[i]['similarity'] < 70) {\n suggestions.splice(i, 1); // drop suggestions less then 70%\n }\n }\n\n self.suggestions = suggestions;\n\n if (suggestions.length > 0) {\n self.available_suggestions = true;\n }\n })[\"catch\"](function (error) {\n console.log(error);\n });\n },\n copy: function copy(translated) {\n this.currentstring.translationsArray[this.languageCode].editedTranslation = translated; // why no store for you? Go with setTimeout.\n\n setTimeout(function () {\n autosize__WEBPACK_IMPORTED_MODULE_1___default.a.update(document.querySelectorAll('.trp-textarea'));\n }, 50);\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL3RyYW5zbGF0aW9uLW1lbW9yeS52dWU/MDlkZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBb0JBO0FBQ0E7QUFDQTtBQUNBO0FBR0E7QUFDQSxVQUNBLE9BREEsRUFFQSxRQUZBLEVBR0EsZUFIQSxFQUlBLFVBSkEsRUFLQSxRQUxBLEVBTUEsY0FOQSxFQU9BLFlBUEEsQ0FEQTtBQVVBLE1BVkEsa0JBVUE7QUFDQTtBQUNBLHFCQURBO0FBRUEsa0NBRkE7QUFHQSxtQkFIQTtBQUlBO0FBSkE7QUFNQSxHQWpCQTtBQWtCQSxTQWxCQSxxQkFrQkE7QUFDQTtBQUNBLEdBcEJBO0FBcUJBO0FBQ0EsUUFEQSxrQkFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBRUE7QUFDQSw2RUFDQSxJQURBLENBQ0E7QUFDQTtBQUNBOztBQUVBO0FBQ0E7QUFDQTs7QUFFQTtBQUNBLHFDQURBLENBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUNBO0FBQ0E7QUFDQTtBQUNBLE9BbEJBLFdBbUJBO0FBQ0E7QUFDQSxPQXJCQTtBQXNCQSxLQWpDQTtBQWtDQSxRQWxDQSxnQkFrQ0EsVUFsQ0EsRU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ICAgICdzdHJpbmcnLFxyXG4gICAgICAgICAgICAnZWRpdG9yU3RyaW5ncycsXHJcbiAgICAgICAgICAgICdhamF4X3VybCcsXHJcbiAgICAgICAgICAgICdub25jZXMnLFxyXG4gICAgICAgICAgICAnbGFuZ3VhZ2VDb2RlJyxcclxuICAgICAgICAgICAgJ2lucHV0VmFsdWUnLFxyXG4gICAgICAgIF0sXHJcbiAgICAgICAgZGF0YSgpe1xyXG4gICAgICAgICAgICByZXR1cm57XHJcbiAgICAgICAgICAgICAgICBzdWdnZXN0aW9ucyA6IFtdLFxyXG4gICAgICAgICAgICAgICAgYXZhaWxhYmxlX3N1Z2dlc3Rpb25zIDogZmFsc2UsXHJcbiAgICAgICAgICAgICAgICBzaW1pbGFyaXR5IDogMCxcclxuICAgICAgICAgICAgICAgIGN1cnJlbnRzdHJpbmcgOiB0aGlzLnN0cmluZ1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBtb3VudGVkKCl7XHJcbiAgICAgICAgICAgIHRoaXMuaW5pdCgpXHJcbiAgICAgICAgfSxcclxuICAgICAgICBtZXRob2RzOntcclxuICAgICAgICAgICAgaW5pdCgpe1xyXG4gICAgICAgICAgICAgICAgbGV0IGRhdGEgPSBuZXcgRm9ybURhdGEoKVxyXG4gICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ2FjdGlvbicgICAgICAgICAgICAsICd0cnBfZ2V0X3NpbWlsYXJfc3RyaW5nX3RyYW5zbGF0aW9uJylcclxuICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdzZWN1cml0eScgICAgICAgICAgLCB0aGlzLm5vbmNlc1snZ2V0c2ltaWxhcnN0cmluZyddKVxyXG4gICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ29yaWdpbmFsX3N0cmluZycgICAsIHRoaXMuc3RyaW5nLm9yaWdpbmFsKVxyXG4gICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ2xhbmd1YWdlJyAgICAgICAgICAsIHRoaXMubGFuZ3VhZ2VDb2RlKVxyXG4gICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3NlbGVjdG9yJyAgICAgICAgICAsIHRoaXMuc3RyaW5nLnNlbGVjdG9yKVxyXG4gICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ251bWJlcicgICAgICAgICAgICAsIDMpXHJcblxyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXHJcbiAgICAgICAgICAgICAgICBheGlvcy5wb3N0KHRoaXMuYWpheF91cmwsIGRhdGEpXHJcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHJlc3BvbnNlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdWdnZXN0aW9ucyA9IHJlc3BvbnNlLmRhdGFcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGlcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IHN1Z2dlc3Rpb25zLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWdnZXN0aW9uc1tpXVsnc2ltaWxhcml0eSddID0gTWF0aC5yb3VuZChzaW1pbGFyaXR5LmNvbXBhcmVUd29TdHJpbmdzKHNlbGYuc3RyaW5nLm9yaWdpbmFsLHN1Z2dlc3Rpb25zW2ldWydvcmlnaW5hbCddKSoxMDApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWdnZXN0aW9uc1tpXVsnb3JpZ2luYWwnXSA9IHNpbXBsZWRpZmYuaHRtbERpZmYoc2VsZi5zdHJpbmcub3JpZ2luYWwsIHN1Z2dlc3Rpb25zW2ldWydvcmlnaW5hbCddKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWdnZXN0aW9uc1tpXVsnc2ltaWxhcml0eSddIDwgNzAgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VnZ2VzdGlvbnMuc3BsaWNlKGksIDEpOyAvLyBkcm9wIHN1Z2dlc3Rpb25zIGxlc3MgdGhlbiA3MCVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zdWdnZXN0aW9ucyA9IHN1Z2dlc3Rpb25zXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdWdnZXN0aW9ucy5sZW5ndGggPiAwKXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuYXZhaWxhYmxlX3N1Z2dlc3Rpb25zID0gdHJ1ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGVycm9yKVxyXG4gICAgICAgICAgICAgICAgICAgIH0pO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBjb3B5KHRyYW5zbGF0ZWQpe1xyXG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50c3RyaW5nLnRyYW5zbGF0aW9uc0FycmF5W3RoaXMubGFuZ3VhZ2VDb2RlXS5lZGl0ZWRUcmFuc2xhdGlvbiA9IHRyYW5zbGF0ZWRcclxuXHJcbiAgICAgICAgICAgICAgICAvLyB3aHkgbm8gc3RvcmUgZm9yIHlvdT8gR28gd2l0aCBzZXRUaW1lb3V0LlxyXG4gICAgICAgICAgICAgICAgc2V0VGltZW91dChmdW5jdGlvbigpe1xyXG4gICAgICAgICAgICAgICAgICAgIGF1dG9zaXplLnVwZGF0ZShkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcudHJwLXRleHRhcmVhJykpXHJcbiAgICAgICAgICAgICAgICB9LCA1MCk7XHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbjwvc2NyaXB0PlxyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/translation-memory.vue?vue&type=script&lang=js&\n");
|
754 |
|
755 |
/***/ }),
|
756 |
|
@@ -762,7 +762,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axio
|
|
762 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
763 |
|
764 |
"use strict";
|
765 |
-
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var select2_dist_js_select2_min_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! select2/dist/js/select2.min.js */ \"./node_modules/select2/dist/js/select2.min.js\");\n/* harmony import */ var select2_dist_js_select2_min_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(select2_dist_js_select2_min_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./assets/src/js/utils.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _components_language_boxes_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/language-boxes.vue */ \"./assets/src/js/components/language-boxes.vue\");\n/* harmony import */ var _components_save_translations_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/save-translations.vue */ \"./assets/src/js/components/save-translations.vue\");\n/* harmony import */ var _components_hover_actions_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/hover-actions.vue */ \"./assets/src/js/components/hover-actions.vue\");\n/* harmony import */ var _components_extra_content_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/extra-content.vue */ \"./assets/src/js/components/extra-content.vue\");\n/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! he */ \"./node_modules/he/he.js\");\n/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(he__WEBPACK_IMPORTED_MODULE_7__);\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['trp_settings', 'language_names', 'ordered_secondary_languages', 'current_language', 'on_screen_language', 'view_as_roles', 'url_to_load', 'string_selectors', 'data_attributes', 'ajax_url', 'editor_nonces', 'string_group_order', 'merge_rules', 'localized_text', 'paid_version', 'flags_path'],\n components: {\n languageBoxes: _components_language_boxes_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n saveTranslations: _components_save_translations_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n hoverActions: _components_hover_actions_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n extraContent: _components_extra_content_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"]\n },\n data: function data() {\n return {\n //props\n settings: JSON.parse(this.trp_settings),\n languageNames: JSON.parse(this.language_names),\n orderedSecondaryLanguages: JSON.parse(this.ordered_secondary_languages),\n roles: JSON.parse(this.view_as_roles),\n nonces: JSON.parse(this.editor_nonces),\n stringGroupOrder: JSON.parse(this.string_group_order),\n selectors: JSON.parse(this.string_selectors),\n dataAttributes: JSON.parse(this.data_attributes),\n mergeRules: JSON.parse(this.merge_rules),\n editorStrings: trp_localized_strings,\n flagsPath: JSON.parse(this.flags_path),\n //data\n currentLanguage: this.current_language,\n onScreenLanguage: this.on_screen_language,\n currentURL: this.url_to_load,\n urlToLoad: this.url_to_load,\n iframe: '',\n dictionary: [],\n selectedString: null,\n selectedIndexesArray: [],\n detectedSelectorAndId: [],\n stringGroups: [],\n mergingString: false,\n mergeData: [],\n showChangesUnsavedMessage: false,\n viewAs: '',\n loading_strings: 0,\n translationNotLoadedYet: false\n };\n },\n created: function created() {\n this.settings['default-language-name'] = this.languageNames[this.settings['default-language']]; //set default value for the View As select\n\n var params = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getUrlParameters(this.currentURL);\n if (Object.keys(params).length > 1 && params['trp-view-as']) this.viewAs = params['trp-view-as'];else this.viewAs = 'current_user';\n },\n mounted: function mounted() {\n this.addKeyboardShortcutsListener();\n var self = this; // initialize select2\n\n jQuery('#trp-language-select, #trp-view-as-select').select2({\n width: '100%'\n }); //init strings dropdown\n\n this.stringsDropdownLoading(); // show overlay when select is opened\n\n jQuery('#trp-language-select, #trp-string-categories').on('select2:open', function () {\n jQuery('#trp_select2_overlay').fadeIn('100');\n }).on('select2:close', function () {\n jQuery('#trp_select2_overlay').hide();\n }).on('select2:opening', function (e) {\n /* when we have unsaved changes prevent the strings dropdown from opening so we do not have a disconnect between the textareas and the dropdown */\n if (self.hasUnsavedChanges()) {\n e.preventDefault();\n }\n }); // resize sidebar and consequently the iframe\n\n var previewContainer = jQuery('#trp-preview');\n var total_width = jQuery(window).width();\n jQuery('#trp-controls').resizable({\n start: function start() {\n previewContainer.toggle();\n },\n stop: function stop() {\n previewContainer.toggle();\n },\n handles: 'e',\n minWidth: 285,\n maxWidth: total_width - 20\n }).bind(\"resize\", this.resizeIframe); // resize iframe when resizing window\n\n jQuery(window).resize(function () {\n self.resizeIframe();\n });\n },\n watch: {\n currentLanguage: function currentLanguage(_currentLanguage) {\n var self = this; //grab the correct URL from the iFrame\n\n var newURL = this.iframe.querySelector('link[hreflang=\"' + _currentLanguage.replace('_', '-') + '\"]').getAttribute('href');\n this.currentURL = newURL;\n this.iframe.location = newURL; //reset vue props\n\n this.selectedString = '';\n this.selectedIndexesArray = []; //set strings dropdown to loading state\n\n jQuery('#trp-string-categories').val('').trigger('change');\n this.stringsDropdownLoading();\n this.onScreenLanguage = _currentLanguage;\n\n if (this.settings['default-language'] == this.currentLanguage && this.settings['translation-languages'].length > 1) {\n this.settings['translation-languages'].some(function (language) {\n if (language != self.settings['default-language']) {\n // return the first language not default\n self.onScreenLanguage = language;\n return true;\n }\n });\n }\n },\n currentURL: function currentURL(newUrl, oldUrl) {\n window.history.replaceState(null, null, this.parentURL(newUrl));\n },\n viewAs: function viewAs(role) {\n if (!this.currentURL || !this.iframe) return;\n var url = this.cleanURL(this.currentURL);\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].updateUrlParameter(url, 'trp-edit-translation', 'preview');\n\n if (role == 'current_user') {\n this.iframe.location = url;\n return;\n } //if nonce not available, an update to the Browse as Other Roles add-on is required\n\n\n if (!this.nonces[role]) {\n alert(this.editorStrings.bor_update_notice);\n return;\n }\n\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].updateUrlParameter(url, 'trp-view-as', role);\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].updateUrlParameter(url, 'trp-view-as-nonce', this.nonces[role]);\n this.iframe.location = url;\n },\n selectedString: function selectedString(selectedStringArrayIndex, oldString) {\n if (this.hasUnsavedChanges() || !selectedStringArrayIndex && selectedStringArrayIndex !== 0) return;\n jQuery('#trp-string-categories').val(selectedStringArrayIndex !== null ? selectedStringArrayIndex : '').trigger('change');\n var selectedString = this.dictionary[selectedStringArrayIndex];\n if (!selectedString) return;\n var currentNode = this.iframe.querySelector(\"[\" + selectedString.selector + \"='\" + selectedString.dbID + \"']\");\n var selectedIndexesArray = []; //when merging we do not have a valid current node, so we just add the fake id\n\n if (currentNode) {\n var self = this;\n var selectors = self.getAllSelectors();\n var nodes = [];\n nodes.push(currentNode);\n\n if (currentNode.tagName != \"A\") {\n // include the anchor's translatable attributes\n var anchorParent = currentNode.closest('a');\n\n if (anchorParent != null) {\n nodes.push(anchorParent);\n }\n }\n\n if (currentNode.tagName == \"A\" && currentNode.children.length > 0) {\n // include all the translatable attributes inside the anchor\n var childrenArray = _toConsumableArray(currentNode.children);\n\n childrenArray.forEach(function (child) {\n nodes.push(child);\n });\n }\n\n nodes.forEach(function (node) {\n selectors.forEach(function (selector) {\n var stringId = node.getAttribute(selector);\n\n if (stringId) {\n var found = false;\n var i;\n\n for (i = 0; i < selectedIndexesArray.length; i++) {\n if (typeof self.dictionary[selectedIndexesArray[i]] !== 'undefined' && self.dictionary[selectedIndexesArray[i]].dbID !== 'undefined' && self.dictionary[selectedIndexesArray[i]].dbID === stringId) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n selectedIndexesArray.push(self.getStringIndex(selector, stringId));\n }\n }\n });\n });\n } else selectedIndexesArray.push(selectedStringArrayIndex);\n\n this.selectedIndexesArray = selectedIndexesArray;\n }\n },\n computed: {\n closeURL: function closeURL() {\n return this.cleanURL(this.currentURL);\n }\n },\n methods: {\n iFrameLoaded: function iFrameLoaded() {\n var self = this;\n var iframeElement = document.querySelector('#trp-preview-iframe');\n this.iframe = iframeElement.contentDocument || iframeElement.contentWindow.document; //sync iFrame URL with parent\n\n if (this.currentURL != this.iframe.URL) this.currentURL = this.iframe.URL; //hide iFrame loader\n\n this.iframeLoader('hide');\n self.detectedSelectorAndId = [];\n self.dictionary = [];\n this.scanIframeForStrings();\n window.addEventListener('trp_iframe_page_updated', this.scanIframeForStrings); //event that is fired when the iFrame is navigated\n\n iframeElement.contentWindow.onbeforeunload = function () {\n self.iframeLoader('show');\n self.selectedString = null;\n self.selectedIndexesArray = [];\n self.translationNotLoadedYet = false;\n self.stringsDropdownLoading();\n };\n },\n scanIframeForStrings: function scanIframeForStrings() {\n this.scanForSelector('data-trp-translate-id', 'regular', this.onScreenLanguage);\n this.scanForSelector('data-trpgettextoriginal', 'gettext', this.currentLanguage);\n this.scanForSelector('data-trp-post-slug', 'postslug', this.currentLanguage);\n },\n scanForSelector: function scanForSelector(baseSelector, typeSlug, languageOfIds) {\n this.loading_strings++;\n var self = this;\n var selectors = this.prepareSelectorStrings(baseSelector);\n\n var nodes = _toConsumableArray(this.iframe.querySelectorAll('[' + selectors.join('],[') + ']'));\n\n var stringIdsArray = [],\n nodeData = [],\n nodeEntries = [];\n nodes.forEach(function (node) {\n nodeEntries = self.getNodeInfo(node, baseSelector);\n nodeEntries.forEach(function (entry) {\n // this check ensures that we don't create duplicates when rescanning after ajax complete\n if (!self.alreadyDetected(entry.selector, entry.dbID)) {\n stringIdsArray.push(entry.dbID);\n nodeData.push(entry);\n }\n });\n self.setupEventListener(node);\n }); //unique ids only\n\n stringIdsArray = _toConsumableArray(new Set(stringIdsArray));\n\n if (stringIdsArray.length > 0) {\n var data = new FormData();\n data.append('action', 'trp_get_translations_' + typeSlug);\n data.append('all_languages', 'true');\n data.append('security', this.nonces['gettranslationsnonce' + typeSlug]);\n data.append('language', languageOfIds);\n data.append('string_ids', JSON.stringify(stringIdsArray));\n axios__WEBPACK_IMPORTED_MODULE_2___default.a.post(this.ajax_url, data).then(function (response) {\n self.loading_strings--;\n self.addToDictionary(response.data, nodeData);\n })[\"catch\"](function (error) {\n console.log(error);\n });\n } else {\n self.loading_strings--;\n }\n },\n alreadyDetected: function alreadyDetected(selector, dbId) {\n var combined = selector + '=' + dbId;\n\n if (_utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].arrayContainsItem(this.detectedSelectorAndId, combined)) {\n return true;\n } else {\n this.detectedSelectorAndId.push(combined);\n return false;\n }\n },\n setupEventListener: function setupEventListener(node) {\n if (node.tagName == 'A' && !node.hasAttribute('data-trpgettextoriginal')) return false;\n var self = this;\n node.addEventListener('mouseenter', self.$refs.hoverActions.showPencilIcon);\n },\n addToDictionary: function addToDictionary(responseData) {\n var nodeInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var self = this;\n\n if (responseData != null) {\n if (nodeInfo) {\n nodeInfo.forEach(function (infoRow, index) {\n responseData.some(function (responseDataRow) {\n if (infoRow.dbID == responseDataRow.dbID) {\n //bring block_type to the top level object\n if (responseDataRow.type != 'gettext' && typeof responseDataRow.block_type == 'undefined') {\n var firstLanguage = self.orderedSecondaryLanguages[0];\n if (typeof responseDataRow.translationsArray[firstLanguage].block_type != 'undefined') responseDataRow.block_type = responseDataRow.translationsArray[firstLanguage].block_type;\n }\n\n nodeInfo[index] = Object.assign({}, responseDataRow, infoRow);\n return true; // a sort of break\n }\n });\n });\n } else {\n nodeInfo = responseData;\n }\n\n this.stringGroups = this.addToStringGroups(nodeInfo);\n this.dictionary = this.dictionary.concat(nodeInfo);\n this.initStringsDropdown();\n }\n },\n addToStringGroups: function addToStringGroups(strings) {\n // see what node groups are found\n var foundStringGroups = this.stringGroups;\n strings.forEach(function (string) {\n if (foundStringGroups.indexOf(string.group) === -1 && (typeof string.blockType === 'undefined' || string.blockType !== '2')) {\n foundStringGroups.push(string.group);\n }\n }); // put the node groups in the order that we want, according to the prop this.stringGroupOrder\n\n var orderedStringGroups = [];\n\n if (this.editorStrings.seo_update_notice != 'seo_pack_update_not_needed') {\n orderedStringGroups.push(this.editorStrings.seo_update_notice);\n }\n\n this.stringGroupOrder.forEach(function (group) {\n if (foundStringGroups.indexOf(group) !== -1) {\n orderedStringGroups.push(group);\n }\n }); // if there were any other string groups that were not in the prop, add them at the end.\n\n foundStringGroups.forEach(function (group) {\n if (orderedStringGroups.indexOf(group) === -1) {\n orderedStringGroups.push(group);\n }\n });\n return orderedStringGroups;\n },\n getStringIndex: function getStringIndex(selector, dbID) {\n var found = null;\n this.dictionary.some(function (string, index) {\n if (string.dbID == dbID && string.selector == selector) {\n found = index;\n return true;\n }\n });\n return found;\n },\n getNodeInfo: function getNodeInfo(node) {\n var baseSelector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var stringId;\n var nodeData = [];\n var selectors = this.prepareSelectorStrings(baseSelector);\n selectors.forEach(function (selector) {\n stringId = node.getAttribute(selector);\n\n if (stringId) {\n var nodeAttribute = selector.replace(baseSelector, '');\n var nodeGroup = node.getAttribute('data-trp-node-group' + nodeAttribute);\n var nodeDescription = node.getAttribute('data-trp-node-description' + nodeAttribute);\n var entry = {\n dbID: stringId,\n selector: selector,\n attribute: nodeAttribute.substr(1) // substr(1) is used to trim prefixing line - ex. -alt will result in alt (no line)\n\n };\n if (nodeGroup) entry.group = nodeGroup;\n if (nodeDescription) entry.description = nodeDescription;\n nodeData.push(entry);\n }\n });\n return nodeData;\n },\n getAllSelectors: function getAllSelectors() {\n var selectors = [];\n var self = this;\n this.dataAttributes.forEach(function (dataAttribute) {\n selectors = selectors.concat(self.prepareSelectorStrings(dataAttribute));\n });\n return selectors;\n },\n prepareSelectorStrings: function prepareSelectorStrings(baseNameSelector) {\n var parsed_selectors = [];\n this.selectors.forEach(function (selectorSuffix, index) {\n parsed_selectors.push(baseNameSelector + selectorSuffix);\n });\n return parsed_selectors;\n },\n parentURL: function parentURL(url) {\n return url.replace('trp-edit-translation=preview', 'trp-edit-translation=true');\n },\n cleanURL: function cleanURL(url) {\n //make removeUrlParameter recursive and only call it once with all the parameters that\n //need to stripped ?\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removeUrlParameter(url, 'lang');\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removeUrlParameter(url, 'trp-view-as');\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removeUrlParameter(url, 'trp-view-as-nonce');\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removeUrlParameter(url, 'trp-edit-translation');\n return url;\n },\n showString: function showString(string, type) {\n if (typeof string.blockType !== 'undefined' && string.blockType === '2') {\n // don't show deprecated translation blocks in the dropdown\n return false;\n }\n\n if (type === this.editorStrings.images && typeof string.attribute != 'undefined' && string.attribute == 'src') return true;\n if (typeof string.attribute !== 'undefined' && (string.attribute == 'href' || string.attribute == 'src')) return false;\n if (string.group === type) return true;\n return false;\n },\n initStringsDropdown: function initStringsDropdown() {\n var self = this;\n\n if (!this.isStringsDropdownOpen()) {\n jQuery('#trp-string-categories').select2('destroy');\n jQuery('#trp-string-categories').select2({\n placeholder: self.editorStrings.select_string,\n templateResult: function templateResult(option) {\n var original = he__WEBPACK_IMPORTED_MODULE_7___default.a.decode(option.text.substring(0, 90)) + (option.text.length <= 90 ? '' : '...');\n var description = option.title ? '(' + option.title + ')' : '';\n return jQuery('<div>' + original + '</div><div class=\"string-selector-description\">' + description + '</div>');\n },\n width: '100%'\n }).prop('disabled', false);\n jQuery('#trp_select2_overlay').hide();\n }\n },\n stringsDropdownLoading: function stringsDropdownLoading() {\n jQuery('#trp-string-categories').select2({\n placeholder: this.editorStrings.strings_loading,\n width: '100%'\n }).prop('disabled', true);\n },\n processOptionName: function processOptionName(name, type) {\n if (type == 'Images') return _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getFilename(name);\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].escapeHtml(name);\n },\n isStringsDropdownOpen: function isStringsDropdownOpen() {\n return jQuery('#trp-string-categories').select2('isOpen');\n },\n hasUnsavedChanges: function hasUnsavedChanges() {\n var unsavedChanges = false;\n var self = this;\n\n if (this.selectedIndexesArray.length > 0) {\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n self.settings['translation-languages'].forEach(function (languageCode) {\n if (self.dictionary[selectedIndex] && self.dictionary[selectedIndex].translationsArray[languageCode] && self.dictionary[selectedIndex].translationsArray[languageCode].translated !== self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation) {\n unsavedChanges = true;\n }\n });\n });\n }\n\n this.showChangesUnsavedMessage = unsavedChanges;\n return unsavedChanges;\n },\n iframeLoader: function iframeLoader(status) {\n var loader = document.getElementById('trp-preview-loader');\n if (status == 'show') loader.style.display = 'flex';else if (status == 'hide') loader.style.display = 'none';\n },\n previousString: function previousString() {\n var currentValue = document.getElementById('trp-string-categories').value;\n var newValue = +currentValue - 1;\n\n while (newValue >= 0 && document.querySelectorAll('#trp-string-categories option[value=\"' + newValue + '\"]').length === 0) {\n newValue--;\n }\n\n if (newValue < 0) return;\n this.selectedString = newValue.toString();\n },\n nextString: function nextString() {\n var currentValue = document.getElementById('trp-string-categories').value,\n newValue = 0;\n if (currentValue != '') newValue = +currentValue + 1;\n\n while (newValue < this.dictionary.length && document.querySelectorAll('#trp-string-categories option[value=\"' + newValue + '\"]').length === 0) {\n newValue++;\n }\n\n if (newValue >= this.dictionary.length) {\n return;\n }\n\n this.selectedString = newValue.toString();\n },\n addKeyboardShortcutsListener: function addKeyboardShortcutsListener() {\n document.addEventListener(\"keydown\", function (e) {\n if ((window.navigator.platform.match(\"Mac\") ? e.metaKey : e.ctrlKey) && e.altKey) {\n // CTRL + ALT + right arrow\n if (e.keyCode === 39) {\n e.preventDefault();\n window.dispatchEvent(new Event('trp_trigger_next_string_event'));\n } else {\n // CTRL + ALT + left arrow\n if (e.keyCode === 37) {\n e.preventDefault();\n window.dispatchEvent(new Event('trp_trigger_previous_string_event'));\n }\n }\n }\n }, false);\n window.addEventListener('trp_trigger_next_string_event', this.nextString);\n window.addEventListener('trp_trigger_previous_string_event', this.previousString);\n },\n resizeIframe: function resizeIframe(event, ui) {\n var total_width = jQuery(window).width();\n var width = jQuery('#trp-controls').width();\n\n if (width > total_width) {\n width = total_width;\n controls.css('width', width);\n }\n\n var previewContainer = jQuery('#trp-preview');\n previewContainer.css('right', width);\n previewContainer.css('left', width - 348);\n previewContainer.css('width', total_width - width);\n }\n },\n //add support for v-model in select2\n directives: {\n select2: {\n inserted: function inserted(el) {\n jQuery(el).on('select2:select', function () {\n var event = new Event('change', {\n bubbles: true,\n cancelable: true\n });\n el.dispatchEvent(event);\n });\n jQuery(el).on('select2:unselect', function () {\n var event = new Event('change', {\n bubbles: true,\n cancelable: true\n });\n el.dispatchEvent(event);\n });\n }\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9lZGl0b3IudnVlP2E3NjUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBMEhBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQTtBQUNBLFVBQ0EsY0FEQSxFQUVBLGdCQUZBLEVBR0EsNkJBSEEsRUF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PyEuL2Fzc2V0cy9zcmMvanMvZWRpdG9yLnZ1ZT92dWUmdHlwZT1zY3JpcHQmbGFuZz1qcyYuanMiLCJzb3VyY2VzQ29udGVudCI6WyI8dGVtcGxhdGU+XHJcbiAgICA8ZGl2IGlkPVwidHJwLWVkaXRvclwiPlxyXG5cclxuICAgICAgICA8ZGl2IGlkPVwidHJwLWNvbnRyb2xzXCI+XHJcbiAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0cnAtY29udHJvbHMtY29udGFpbmVyXCI+XHJcblxyXG4gICAgICAgICAgICAgICAgPGRpdiBpZD1cInRycC1jbG9zZS1zYXZlXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgPGEgaWQ9XCJ0cnAtY29udHJvbHMtY2xvc2VcIiA6aHJlZj1cImNsb3NlVVJMXCIgOnRpdGxlPVwiZWRpdG9yU3RyaW5ncy5jbG9zZVwiPjwvYT5cclxuICAgICAgICAgICAgICAgICAgICA8ZGl2IGlkPVwidHJwLXNhdmUtYW5kLWxvYWRlci1zcGlubmVyXCI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxzcGFuIGNsYXNzPVwidHJwLWFqYXgtbG9hZGVyXCIgdi1zaG93PVwibG9hZGluZ19zdHJpbmdzID4gMFwiIGlkPVwidHJwLXN0cmluZy1zYXZlZC1hamF4LWxvYWRlclwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRycC1zcGlubmVyXCI+PC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvc3Bhbj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPHNhdmUtdHJhbnNsYXRpb25zXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOnNlbGVjdGVkSW5kZXhlc0FycmF5PVwic2VsZWN0ZWRJbmRleGVzQXJyYXlcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpkaWN0aW9uYXJ5PVwiZGljdGlvbmFyeVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOnNldHRpbmdzPVwic2V0dGluZ3NcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpub25jZXM9XCJub25jZXNcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDphamF4X3VybD1cImFqYXhfdXJsXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6Y3VycmVudExhbmd1YWdlPVwiY3VycmVudExhbmd1YWdlXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6b25TY3JlZW5MYW5ndWFnZT1cIm9uU2NyZWVuTGFuZ3VhZ2VcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDppZnJhbWU9XCJpZnJhbWVcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpjdXJyZW50VVJMPVwiY3VycmVudFVSTFwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOm1lcmdpbmdTdHJpbmc9XCJtZXJnaW5nU3RyaW5nXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6bWVyZ2VEYXRhPVwibWVyZ2VEYXRhXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAdHJhbnNsYXRpb25zLXNhdmVkPVwic2hvd0NoYW5nZXNVbnNhdmVkTWVzc2FnZSA9IGZhbHNlXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6ZWRpdG9yU3RyaW5ncz1cImVkaXRvclN0cmluZ3NcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDwvc2F2ZS10cmFuc2xhdGlvbnM+XHJcbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICA8L2Rpdj5cclxuXHJcbiAgICAgICAgICAgICAgICA8ZGl2IGNsYXNzPVwidHJwLWNvbnRyb2xzLXNlY3Rpb25cIj5cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRycC1jb250cm9scy1zZWN0aW9uLWNvbnRlbnRcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPGRpdiBpZD1cInRycC1sYW5ndWFnZS1zd2l0Y2hcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzZWxlY3QgaWQ9XCJ0cnAtbGFuZ3VhZ2Utc2VsZWN0XCIgbmFtZT1cImxhbmdcIiB2LW1vZGVsPVwiY3VycmVudExhbmd1YWdlXCIgdi1zZWxlY3QyPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdi1mb3I9XCIobGFuZywgbGFuZ0luZGV4KSBpbiBsYW5ndWFnZU5hbWVzXCIgOnZhbHVlPVwibGFuZ0luZGV4XCI+e3tsYW5nfX08L29wdGlvbj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvc2VsZWN0PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8L2Rpdj5cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgaWQ9XCJ0cnAtc3RyaW5nLWxpc3RcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxzZWxlY3QgaWQ9XCJ0cnAtc3RyaW5nLWNhdGVnb3JpZXNcIiB2LW1vZGVsPVwic2VsZWN0ZWRTdHJpbmdcIiB2LXNlbGVjdDI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGdyb3VwIHYtZm9yPVwiKGdyb3VwKSBpbiBzdHJpbmdHcm91cHNcIiA6bGFiZWw9XCJncm91cFwiPlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA8b3B0aW9uIHYtZm9yPVwiKHN0cmluZywgaW5kZXgpIGluIGRpY3Rpb25hcnlcIiA6dmFsdWU9XCJpbmRleFwiIHYtaWY9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hbj48L2J1dHRvbj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGlkPVwidHJwLXZpZXctYXNcIj5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgaWQ9XCJ0cnAtdmlldy1hcy1kZXNjcmlwdGlvblwiPnt7IGVkaXRvclN0cmluZ3Mudmlld19hcyB9fTwvZGl2PlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNlbGVjdCBpZD1cInRycC12aWV3LWFzLXNlbGVjdFwiIHYtbW9kZWw9XCJ2aWV3QXNcIiB2LXNlbGVjdDI+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPG9wdGlvbiB2LWZvcj1cIihyb2xlLCByb2xlSW5kZXgpIGluIHJvbGVzXCIgOnZhbHVlPVwicm9sZVwiIDpkaXNhYmxlZD1cIiFyb2xlXCIgOnRpdGxlPVwiIXJvbGUgPyBlZGl0b3JTdHJpbmdzLnZpZXdfYXNfcHJvIDogJydcIj57e3JvbGVJbmRleH19PC9vcHRpb24+XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NlbGVjdD5cclxuICAgICAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XHJcblxyXG4gICAgICAgICAgICAgICAgPC9kaXY+XHJcblxyXG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRycC1jb250cm9scy1zZWN0aW9uXCIgdi1zaG93PVwic2VsZWN0ZWRTdHJpbmcgIT09IG51bGxcIj5cclxuICAgICAgICAgICAgICAgICAgICA8bGFuZ3VhZ2UtYm94ZXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpzZWxlY3RlZEluZGV4ZXNBcnJheT1cInNlbGVjdGVkSW5kZXhlc0FycmF5XCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpkaWN0aW9uYXJ5PVwiZGljdGlvbmFyeVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6Y3VycmVudExhbmd1YWdlPVwiY3VycmVudExhbmd1YWdlXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpvblNjcmVlbkxhbmd1YWdlPVwib25TY3JlZW5MYW5ndWFnZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6bGFuZ3VhZ2VOYW1lcz1cImxhbmd1YWdlTmFtZXNcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOnNldHRpbmdzPVwic2V0dGluZ3NcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOnNob3dDaGFuZ2VzVW5zYXZlZE1lc3NhZ2U9XCJzaG93Q2hhbmdlc1Vuc2F2ZWRNZXNzYWdlXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBkaXNjYXJkZWQtY2hhbmdlcz1cImhhc1Vuc2F2ZWRDaGFuZ2VzKClcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOmVkaXRvclN0cmluZ3M9XCJlZGl0b3JTdHJpbmdzXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpmbGFnc1BhdGg9XCJmbGFnc1BhdGhcIlxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOmlmcmFtZT1cImlmcmFtZVwiXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6bm9uY2VzPVwibm9uY2VzXCJcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDphamF4X3VybD1cImFqYXhfdXJsXCJcclxuICAgICAgICAgICAgICAgICAgICA+XHJcbiAgICAgICAgICAgICAgICAgICAgPC9sYW5ndWFnZS1ib3hlcz5cclxuICAgICAgICAgICAgICAgIDwvZGl2PlxyXG5cclxuICAgICAgICAgICAgICAgIDxleHRyYS1jb250ZW50IDpsYW5ndWFnZU5hbWVzPVwibGFuZ3VhZ2VOYW1lc1w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dkYXRhX2F0dHJpYnV0ZXMnLFxyXG4gICAgICAgICAgICAnYWpheF91cmwnLFxyXG4gICAgICAgICAgICAnZWRpdG9yX25vbmNlcycsXHJcbiAgICAgICAgICAgICdzdHJpbmdfZ3JvdXBfb3JkZXInLFxyXG4gICAgICAgICAgICAnbWVyZ2VfcnVsZXMnLFxyXG4gICAgICAgICAgICAnbG9jYWxpemVkX3RleHQnLFxyXG4gICAgICAgICAgICAncGFpZF92ZXJzaW9uJyxcclxuICAgICAgICAgICAgJ2ZsYWdzX3BhdGgnXHJcbiAgICAgICAgXSxcclxuICAgICAgICBjb21wb25lbnRzOntcclxuICAgICAgICAgICAgbGFuZ3VhZ2VCb3hlcyxcclxuICAgICAgICAgICAgc2F2ZVRyYW5zbGF0aW9ucyxcclxuICAgICAgICAgICAgaG92ZXJBY3Rpb25zLFxyXG4gICAgICAgICAgICBleHRyYUNvbnRlbnRcclxuICAgICAgICB9LFxyXG4gICAgICAgIGRhdGEoKXtcclxuICAgICAgICAgICAgcmV0dXJuIHtcclxuICAgICAgICAgICAgICAgIC8vcHJvcHNcclxuICAgICAgICAgICAgICAgIHNldHRpbmdzICAgICAgICAgICAgICAgICAgOiBKU09OLnBhcnNlKCB0aGlzLnRycF9zZXR0aW5ncyApLFxyXG4gICAgICAgICAgICAgICAgbGFuZ3VhZ2VOYW1lcyAgICAgICAgICAgICA6IEpTT04ucGFyc2UoIHRoaXMubGFuZ3VhZ2VfbmFtZXMgKSxcclxuICAgICAgICAgICAgICAgIG9yZGVyZWRTZWNvbmRhcnlMYW5ndWFnZXMgOiBKU09OLnBhcnNlKCB0aGlzLm9yZGVyZWRfc2Vjb25kYXJ5X2xhbmd1YWdlcyApLFxyXG4gICAgICAgICAgICAgICAgcm9sZXMgICAgICAgICAgICAgICAgICAgICA6IEpTT04ucGFyc2UoIHRoaXMudmlld19hc19yb2xlcyApLFxyXG4gICAgICAgICAgICAgICAgbm9uY2VzICAgICAgICAgICAgICAgICAgICA6IEpTT04ucGFyc2UoIHRoaXMuZWRpdG9yX25vbmNlcyksXHJcbiAgICAgICAgICAgICAgICBzdHJpbmdHcm91cE9yZGVyICAgICAgICAgIDogSlNPTi5wYXJzZSggdGhpcy5zdHJpbmdfZ3JvdXBfb3JkZXIpLFxyXG4gICAgICAgICAgICAgICAgc2VsZWN0b3JzICAgICAgICAgICAgICAgICA6IEpTT04ucGFyc2UoIHRoaXMuc3RyaW5nX3NlbGVjdG9ycyApLFxyXG4gICAgICAgICAgICAgICAgZGF0YUF0dHJpYnV0ZXMgICAgICAgICAgICA6IEpTT04ucGFyc2UoIHRoaXMuZGF0YV9hdHRyaWJ1dGVzICksXHJcbiAgICAgICAgICAgICAgICBtZXJnZVJ1bGVzICAgICAgICAgICAgICAgIDogSlNPTi5wYXJzZSggdGhpcy5tZXJnZV9ydWxlcyApLFxyXG4gICAgICAgICAgICAgICAgZWRpdG9yU3RyaW5ncyAgICAgICAgICAgICA6IHRycF9sb2NhbGl6ZWRfc3RyaW5ncyxcclxuICAgICAgICAgICAgICAgIGZsYWdzUGF0aCAgICAgICAgICAgICAgICAgOiBKU09OLnBhcnNlKCB0aGlzLmZsYWdzX3BhdGggKSxcclxuICAgICAgICAgICAgICAgIC8vZGF0YVxyXG4gICAgICAgICAgICAgICAgY3VycmVudExhbmd1YWdlICAgICAgICAgICA6IHRoaXMuY3VycmVudF9sYW5ndWFnZSxcclxuICAgICAgICAgICAgICAgIG9uU2NyZWVuTGFuZ3VhZ2UgICAgICAgICAgOiB0aGlzLm9uX3NjcmVlbl9sYW5ndWFnZSxcclxuICAgICAgICAgICAgICAgIGN1cnJlbnRVUkwgICAgICAgICAgICAgICAgOiB0aGlzLnVybF90b19sb2FkLFxyXG4gICAgICAgICAgICAgICAgdXJsVG9Mb2FkICAgICAgICAgICAgICAgICA6IHRoaXMudXJsX3RvX2xvYWQsXHJcbiAgICAgICAgICAgICAgICBpZnJhbWUgICAgICAgICAgICAgICAgICAgIDogJycsXHJcbiAgICAgICAgICAgICAgICBkaWN0aW9uYXJ5ICAgICAgICAgICAgICAgIDogW10sXHJcbiAgICAgICAgICAgICAgICBzZWxlY3RlZFN0cmluZyAgICAgICAgICAgIDogbnVsbCxcclxuICAgICAgICAgICAgICAgIHNlbGVjdGVkSW5kZXhlc0FycmF5ICAgICAgOiBbXSxcclxuICAgICAgICAgICAgICAgIGRldGVjdGVkU2VsZWN0b3JBbmRJZCAgICAgOiBbXSxcclxuICAgICAgICAgICAgICAgIHN0cmluZ0dyb3VwcyAgICAgICAgICAgICAgOiBbXSxcclxuICAgICAgICAgICAgICAgIG1lcmdpbmdTdHJpbmcgICAgICAgICAgICAgOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIG1lcmdlRGF0YSAgICAgICAgICAgICAgICAgOiBbXSxcclxuICAgICAgICAgICAgICAgIHNob3dDaGFuZ2VzVW5zYXZlZE1lc3NhZ2UgOiBmYWxzZSxcclxuICAgICAgICAgICAgICAgIHZpZXdBcyAgICAgICAgICAgICAgICAgICAgOiAnJyxcclxuICAgICAgICAgICAgICAgIGxvYWRpbmdfc3RyaW5ncyAgICAgICAgICAgOiAwLFxyXG4gICAgICAgICAgICAgICAgdHJhbnNsYXRpb25Ob3RMb2FkZWRZZXQgICA6IGZhbHNlLFxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBjcmVhdGVkKCl7XHJcbiAgICAgICAgICAgIHRoaXMuc2V0dGluZ3NbJ2RlZmF1bHQtbGFuZ3VhZ2UtbmFtZSddID0gdGhpcy5sYW5ndWFnZU5hbWVzWyB0aGlzLnNldHRpbmdzWydkZWZhdWx0LWxhbmd1YWdlJ10gXVxyXG5cclxuICAgICAgICAgICAgLy9zZXQgZGVmYXVsdCB2YWx1ZSBmb3IgdGhlIFZpZXcgQXMgc2VsZWN0XHJcbiAgICAgICAgICAgIGxldCBwYXJhbXMgPSB1dGlscy5nZXRVcmxQYXJhbWV0ZXJzKCB0aGlzLmN1cnJlbnRVUkwgKVxyXG5ccl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gICBqUXVlcnkoICcjdHJwX3NlbGVjdDJfb3ZlcmxheScgKS5oaWRlKClcclxuICAgICAgICAgICAgfSkub24oICdzZWxlY3QyOm9wZW5pbmcnLCBmdW5jdGlvbihlKSB7XHJcbiAgICAgICAgICAgICAgICAvKiB3aGVuIHdlIGhhdmUgdW5zYXZlZCBjaGFuZ2VzIHByZXZlbnQgdGhlIHN0cmluZ3MgZHJvcGRvd24gZnJvbSBvcGVuaW5nIHNvIHdlIGRvIG5vdCBoYXZlIGEgZGlzY29ubmVjdCBiZXR3ZWVuIHRoZSB0ZXh0YXJlYXMgYW5kIHRoZSBkcm9wZG93biAqL1xyXG4gICAgICAgICAgICAgICAgaWYgKHNlbGYuaGFzVW5zYXZlZENoYW5nZXMoKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgLy8gcmVzaXplIHNpZGViYXIgYW5kIGNvbnNlcXVlbnRseSB0aGUgaWZyYW1lXHJcbiAgICAgICAgICAgIGxldCBwcmV2aWV3Q29udGFpbmVyID0galF1ZXJ5KCAnI3RycC1wcmV2aWV3JyApO1xyXG4gICAgICAgICAgICBsZXQgdG90YWxfd2lkdGggPSBqUXVlcnkod2luZG93KS53aWR0aCgpO1xyXG4gICAgICAgICAgICBqUXVlcnkoICcjdHJwLWNvbnRyb2xzJyApLnJlc2l6YWJsZSh7XHJcbiAgICAgICAgICAgICAgICBzdGFydDogZnVuY3Rpb24oICkgeyBwcmV2aWV3Q29udGFpbmVyLnRvZ2dsZSgpOyB9LFxyXG4gICAgICAgICAgICAgICAgc3RvcDogZnVuY3Rpb24oICkgeyBwcmV2aWV3Q29udGFpbmVyLnRvZ2dsZSgpOyB9LFxyXG4gICAgICAgICAgICAgICAgaGFuZGxlczogJ2UnLFxyXG4gICAgICAgICAgICAgICAgbWluV2lkdGg6IDI4NSxcclxuICAgICAgICAgICAgICAgIG1heFdpZHRoOiB0b3RhbF93aWR0aCAtIDIwXHJcbiAgICAgICAgICAgIH0pLmJpbmQoIFwicmVzaXplXCIsIHRoaXMucmVzaXplSWZyYW1lICk7XHJcblxyXG4gICAgICAgICAgICAvLyByZXNpemUgaWZyYW1lIHdoZW4gcmVzaXppbmcgd2luZG93XHJcbiAgICAgICAgICAgIGpRdWVyeSggd2luZG93ICkucmVzaXplKGZ1bmN0aW9uICgpIHtcclxuICAgICAgICAgICAgICAgIHNlbGYucmVzaXplSWZyYW1lKCk7XHJcbiAgICAgICAgICAgIH0pO1xyXG4gICAgICAgIH0sXHJcbiAgICAgICAgd2F0Y2g6IHtcclxuICAgICAgICAgICAgY3VycmVudExhbmd1YWdlOiBmdW5jdGlvbiggY3VycmVudExhbmd1YWdlICkge1xyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXHJcbiAgICAgICAgICAgICAgICAvL2dyYWIgdGhlIGNvcnJlY3QgVVJMIGZyb20gdGhlIGlGcmFtZVxyXG4gICAgICAgICAgICAgICAgbGV0IG5ld1VSTCA9IHRoaXMuaWZyYW1lLnF1ZXJ5U2VsZWN0b3IoICdsaW5rW2hyZWZsYW5nPVwiJyArIGN1cnJlbnRMYW5ndWFnZS5yZXBsYWNlKCAnXycsICctJyApICsnXCJdJyApLmdldEF0dHJpYnV0ZSgnaHJlZicpXHJcblxyXG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50VVJMICAgICAgICAgICA9IG5ld1VSTFxyXG4gICAgICAgICAgICAgICAgdGhpcy5pZnJhbWUubG9jYXRpb24gICAgICA9IG5ld1VSTFxyXG5cclxuICAgICAgICAgICAgICAgIC8vcmVzZXQgdnVlIHByb3BzXHJcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdGVkU3RyaW5nICAgICAgID0gJydcclxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0ZWRJbmRleGVzQXJyYXkgPSBbXVxyXG5cclxuICAgIC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VJMOiBmdW5jdGlvbiAoIG5ld1VybCwgb2xkVXJsICkge1xyXG4gICAgICAgICAgICAgICAgd2luZG93Lmhpc3RvcnkucmVwbGFjZVN0YXRlKCBudWxsLCBudWxsLCB0aGlzLnBhcmVudFVSTCggbmV3VXJsICkgKVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICB2aWV3QXM6IGZ1bmN0aW9uKCByb2xlICkge1xyXG4gICAgICAgICAgICAgICAgaWYoICF0aGlzLmN1cnJlbnRVUkwgfHwgIXRoaXMuaWZyYW1lIClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cclxuXHJcbiAgICAgICAgICAgICAgICBsZXQgdXJsID0gdGhpcy5jbGVhblVSTCggdGhpcy5jdXJyZW50VVJMIClcclxuXHJcbiAgICAgICAgICAgICAgICB1cmwgPSB1dGlscy51cGRhdGVVcmxQYXJhbWV0ZXIoIHVybCwgJ3RycC1lZGl0LXRyYW5zbGF0aW9uJywgJ3ByZXZpZXcnIClcclxuXHJcbiAgICAgICAgICAgICAgICBpZiggcm9sZSA9PSAnY3VycmVudF91c2VyJyApIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmlmcmFtZS5sb2NhdGlvbiA9IHVybFxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIC8vaWYgbm9uY2Ugbm90IGF2YWlsYWJsZSwgYW4gdXBkYXRlIHRvIHRoZSBCcm93c2UgYXMgT3RoZXIgUm9sZXMgYWRkLW9uIGlzIHJlcXVpcmVkXHJcbiAgICAgICAgICAgICAgICBpZiggIXRoaXMubm9uY2VzW3JvbGVdICkge1xyXG4gICAgICAgICAgICAgICAgICAgIGFsZXJ0KCB0aGlzLmVkaXRvclN0cmluZ3MuYm9yX3VwZGF0ZV9ub3RpY2UgKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIHVybCA9IHV0aWxzLnVwZGF0ZVVybFBhcmFtZXRlciggdXJsLCAndHJwLXZpZXctYXMnLCByb2xlIClcclxuICAgICAgICAgICAgICAgIHVybCA9IHV0aWxzLnVwZGF0ZVVybFBhcmFtZXRlciggdXJsLCAndHJwLXZpZXctYXMtbm9uY2UnLCB0aGlzLm5vbmNlc1tyb2xlXSApXHJcblxyXG4gICAgICAgICAgICAgICAgdGhpcy5pZnJhbWUubG9jYXRpb24gPSB1cmxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgc2VsZWN0ZWRTdHJpbmc6IGZ1bmN0aW9uICggc2VsZWN0ZWRTdHJpbmdBcnJheUluZGV4LCBvbGRTdHJpbmcgKXtcclxuXHJcbiAgICAgICAgICAgICAgICBpZiggdGhpcy5oYXNVbnNhdmVkQ2hhbmdlcygpIHx8ICggIXNlbGVjdGVkU3RyaW5nQXJyYXlJbmRleCAmJiBzZWxlY3RlZFN0cmluZ0FycmF5SW5kZXggIT09IDAgKSApXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXHJcblxyXG4gICAgICAgICAgICAgICAgalF1ZXJ5KCAnI3RycC1zdHJpbmctY2F0ZWdvcmllcycgKS52YWwoIHNlbGVjdGVkU3RyaW5nQXJyYXlJbmRleCAhPT0gbnVsbCA/IHNlbGVjdGVkU3RyaW5nQXJyYXlJbmRleCA6ICcnICkudHJpZ2dlciggJ2NoYW5nZScgKVxyXG5cclxuICAgICAgICAgICAgICAgIGxldCBzZWxlY3RlZFN0cmluZyAgICAgICA9IHRoaXMuZGljdGlvbmFyeVtzZWxlY3RlZFN0cmluZ0FycmF5SW5kZXhdXHJcblxyXG4gICAgICAgICAgICAgICAgaWYoICFzZWxlY3RlZFN0cmluZyApXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXHJcblxyXG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbnROb2RlICAgICAgICAgID0gdGhpcy5pZnJhbWUucXVlcnlTZWxlY3RvciggXCJbXCIgKyBzZWxlY3RlZFN0cmluZy5zZWxlY3RvciArIFwiPSdcIiArIHNlbGVjdGVkU3RyaW5nLmRiSUQgKyBcIiddXCIpXHJcbiAgICAgICAgICAgICAgICBsZXQgc2VsZWN0ZWRJbmRleGVzQXJyYXkgPSBbXVxyXG5cclxuICAgICAgICAgICAgICAgIC8vd2hlbiBtZXJnaW5nIHdlIGRvIG5vdCBoYXZlIGEgdmFsaWQgY3VycmVudCBub2RlLCBzbyB3ZSBqdXN0IGFkZCB0aGUgZmFrZSBpZFxyXG4gICAgICAgICAgICAgICAgaWYoIGN1cnJlbnROb2RlICkge1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBzZWxmID0gdGhpc1xyXG4gICAgICAgICAgICAgICAgICAgIGxldCBzZWxlY3RvcnMgPSBzZWxmLmdldEFsbFNlbGVjdG9ycygpXHJcbiAgICAgICAgICAgICAgICAgICAgbGV0IG5vZGVzID0gW11cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgbm9kZXMucHVzaCggY3VycmVudE5vZGUgKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoIGN1cnJlbnROb2RlLnRhZ05hbWUgIT0gXCJBXCIgKXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgLy8gaW5jbHVkZSB0aGUgYW5jaG9yJ3MgdHJhbnNsYXRhYmxlIGF0dHJpYnV0ZXNcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGFuY2hvclBhcmVudCAgPSBjdXJyZW50Tm9kZS5jbG9zZXN0KCdhJylcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoICBhbmNob3JQYXJlbnQgIT0gbnVsbCApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVzLnB1c2goYW5jaG9yUGFyZW50KVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoIGN1cnJlbnROb2RlLnRhZ05hbWUgPT0gXCJBXCIgJiYgY3VycmVudE5vZGUuY2hpbGRyZW4ubGVuZ3RoID4gMCApe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpbmNsdWRlIGFsbCB0aGUgdHJhbnNsYXRhYmxlIGF0dHJpYnV0ZXMgaW5zaWRlIHRoZSBhbmNob3JcclxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGNoaWxkcmVuQXJyYXkgPSBbIC4uLmN1cnJlbnROb2RlLmNoaWxkcmVuIF07XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNoaWxkcmVuQXJyYXkuZm9yRWFjaCggZnVuY3Rpb24gKCBjaGlsZCApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVzLnB1c2goY2hpbGQpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgbm9kZXMuZm9yRWFjaCggZnVuY3Rpb24oIG5vZGUgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdG9ycy5mb3JFYWNoKGZ1bmN0aW9uIChzZWxlY3Rvcikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IHN0cmluZ0lkID0gbm9kZS5nZXRBdHRyaWJ1dGUoc2VsZWN0b3IpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RyaW5nSWQpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZm91bmQgPSBmYWxzZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9yKCBpID0gMDsgaSA8IHNlbGVjdGVkSW5kZXhlc0FycmF5Lmxlbmd0aDsgaSsrICl7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHNlbGYuZGljdGlvbmFyeVtzZWxlY3RlZEluZGV4ZXNBcnJheVtpXV0gIT09ICd1bmRlZmluZWQnICYmIHNlbGYuZGljdGlvbmFyeVtzZWxlY3RlZEluZGV4ZXNBcnJheVtpXV0uZGJJRCAhPT0gJ3VuZGVmaW5lZCcgJiYgc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhlc0FycmF5W2ldXS5kYklEID09PSBzdHJpbmdJZCApe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm91bmQgPSB0cnVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoICEgZm91bmQgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkSW5kZXhlc0FycmF5LnB1c2goc2VsZi5nZXRTdHJpbmdJbmRleChzZWxlY3Rvciwgc3RyaW5nSWQpKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG4gICAgICAgICAgICAgICAgfSBlbHNlXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRJbmRleGVzQXJyYXkucHVzaCggc2VsZWN0ZWRTdHJpbmdBcnJheUluZGV4IClcclxuXHJcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdGVkSW5kZXhlc0FycmF5ID0gc2VsZWN0ZWRJbmRleGVzQXJyYXlcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICB9LFxyXG4gICAgICAgIGNvbXB1dGVkOiB7XHJcbiAgICAgICAgICAgIGNsb3NlVVJMOiBmdW5jdGlvbigpIHtcclxuICAgICAgICAgICAgICAgIHJldHVybiB0aGlzLmNsZWFuVVJMKCB0aGlzLmN1cnJlbnRVUkwgKVxyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICBtZXRob2RzOiB7XHJcbiAgICAgICAgICAgIGlGcmFtZUxvYWRlZCgpe1xyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXHJcbiAgICAgICAgICAgICAgICBsZXQgaWZyYW1lRWxlbWVudCA9IGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3IoJyN0cnAtcHJldmlldy1pZnJhbWUnKVxyXG5cclxuICAgICAgICAgICAgICAgIHRoaXMuaWZyYW1lID0gaWZyYW1lRWxlbWVudC5jb250ZW50RG9jdW1lbnQgfHwgaWZyYW1lRWxlbWVudC5jb250ZW50V2luZG93LmRvY3VtZW50XHJcblxyXG4gICAgICAgICAgICAgICAgLy9zeW5jIGlGcmFtZSBVUkwgd2l0aCBwYXJlbnRcclxuICAgICAgICAgICAgICAgIGlmICggdGhpcy5jdXJyZW50VVJMICE9IHRoaXMuaWZyYW1lLlVSTCApXHJcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50VVJMID0gdGhpcy5pZnJhbWUuVVJMXHJcblxyXG4gICAgICAgICAgICAgICAgLy9oaWRlIGlGcmFtZSBsb2FkZXJcclxuICAgICAgICAgICAgICAgIHRoaXMuaWZyYW1lTG9hZGVyKCAnaGlkZScgKVxyXG5cclxuICAgICAgICAgICAgICAgIHNlbGYuZGV0ZWN0ZWRTZWxlY3RvckFuZElkID0gW11cclxuICAgICAgICAgICAgICAgIHNlbGYuZGljdGlvbmFyeSAgICAgICAgICAgID0gW11cclxuICAgICAgICAgICAgICAgIHRoaXMuc2NhbklmcmFtZUZvclN0cmluZ3MoKVxyXG5cclxuICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCAndHJwX2lmcmFtZV9wYWdlX3VwZGF0ZWQnLCB0aGlzLnNjYW5JZnJhbWVGb3JTdHJpbmdzIClcclxuXHJcbiAgICAgICAgICAgICAgICAvL2V2ZW50IHRoYXQgaXMgZmlyZWQgd2hlbiB0aGUgaUZyYW1lIGlzIG5hdmlnYXRlZFxyXG4gICAgICAgICAgICAgICAgaWZyYW1lRWxlbWVudC5jb250ZW50V2luZG93Lm9uYmVmb3JldW5sb2FkID0gZnVuY3Rpb24oKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5pZnJhbWVMb2FkZXIoICdzaG93JyApXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIHNlbGYuc2VsZWN0ZWRTdHJpbmcgPSBudWxsXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5zZWxlY3RlZEluZGV4ZXNBcnJheSA9IFtdXHJcbiAgICAgICAgICAgICAgICAgICAgc2VsZi50cmFuc2xhdGlvbk5vdExvYWRlZFlldCA9IGZhbHNlXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIHNlbGYuc3RyaW5nc0Ryb3Bkb3duTG9hZGluZygpXHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBzY2FuSWZyYW1lRm9yU3RyaW5ncygpe1xyXG4gICAgICAgICAgICAgICAgdGhpcy5zY2FuRm9yU2VsZWN0b3IoICdkYXRhLXRycC10cmFuc2xhdGUtaWQnLCAncmVndWxhcicsIHRoaXMub25TY3JlZW5MYW5ndWFnZSApXHJcbiAgICAgICAgICAgICAgICB0aGlzLnNjYW5Gb3JTZWxlY3RvciggJ2RhdGEtdHJwZ2V0dGV4dG9yaWdpbmFsJywgJ2dldHRleHQnLCB0aGlzLmN1cnJlbnRMYW5ndWFnZSApXHJcbiAgICAgICAgICAgICAgICB0aGlzLnNjYW5Gb3JTZWxlY3RvciggJ2RhdGEtdHJwLXBvc3Qtc2x1ZycsICdwb3N0c2x1ZycsIHRoaXMuY3VycmVudExhbmd1YWdlIClcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgc2NhbkZvclNlbGVjdG9yKCBiYXNlU2VsZWN0b3IsIHR5cGVTbHVnLCBsYW5ndWFnZU9mSWRzICl7XHJcbiAgICAgICAgICAgICAgICB0aGlzLmxvYWRpbmdfc3RyaW5ncysrXHJcbiAgICAgICAgICAgICAgICBsZXQgc2VsZiAgICAgICAgICAgPSB0aGlzXHJcbiAgICAgICAgICAgICAgICBsZXQgc2VsZWN0b3JzICAgICAgPSB0aGlzLnByZXBhcmVTZWxlY3RvclN0cmluZ3MoIGJhc2VTZWxlY3RvciApXHJcbiAgICAgICAgICAgICAgICBsZXQgbm9kZXMgICAgICAgICAgPSBbLi4udGhpcy5pZnJhbWUucXVlcnlTZWxlY3RvckFsbCggJ1snICsgc2VsZWN0b3JzLmpvaW4oJ10sWycpICsgJ10nICldXHJcbiAgICAgICAgICAgICAgICBsZXQgc3RyaW5nSWRzQXJyYXkgPSBbXSwgbm9kZURhdGEgPSBbXSwgbm9kZUVudHJpZXMgPSBbXVxyXG5cclxuICAgICAgICAgICAgICAgIG5vZGVzLmZvckVhY2goIGZ1bmN0aW9uICggbm9kZSApe1xyXG4gICAgICAgICAgICAgICAgICAgIG5vZGVFbnRyaWVzID0gc2VsZi5nZXROb2RlSW5mbyggbm9kZSwgYmFzZVNlbGVjdG9yIClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgbm9kZUVudHJpZXMuZm9yRWFjaCggZnVuY3Rpb24oIGVudHJ5ICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyB0aGlzIGNoZWNrIGVuc3VyZXMgdGhhdCB3ZSBkb24ndCBjcmVhdGUgZHVwbGljYXRlcyB3aGVuIHJlc2Nhbm5pbmcgYWZ0ZXIgYWpheCBjb21wbGV0ZVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoICFzZWxmLmFscmVhZHlEZXRlY3RlZCggZW50cnkuc2VsZWN0b3IsIGVudHJ5LmRiSUQgKSApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZ0lkc0FycmF5LnB1c2goZW50cnkuZGJJRClcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVEYXRhLnB1c2goZW50cnkpXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBzZWxmLnNldHVwRXZlbnRMaXN0ZW5lciggbm9kZSApXHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIC8vdW5pcXVlIGlkcyBvbmx5XHJcbiAgICAgICAgICAgICAgICBzdHJpbmdJZHNBcnJheSA9IFsuLi5uZXcgU2V0KHN0cmluZ0lkc0FycmF5KV1cclxuICAgICAgICAgICAgICAgIGlmICggc3RyaW5nSWRzQXJyYXkubGVuZ3RoID4gMCApIHtcclxuICAgICAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IG5ldyBGb3JtRGF0YSgpXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ2FjdGlvbicgICAgICAgLCAndHJwX2dldF90cmFuc2xhdGlvbnNfJyArIHR5cGVTbHVnKVxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdhbGxfbGFuZ3VhZ2VzJywgJ3RydWUnKVxyXG4gICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdzZWN1cml0eScgICAgICwgdGhpcy5ub25jZXNbJ2dldHRyYW5zbGF0aW9uc25vbmNlJyArIHR5cGVTbHVnXSlcclxuICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCgnbGFuZ3VhZ2UnICAgICAsIGxhbmd1YWdlT2ZJZHMpXHJcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3N0cmluZ19pZHMnICAgLCBKU09OLnN0cmluZ2lmeShzdHJpbmdJZHNBcnJheSkpXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIGF4aW9zLnBvc3QodGhpcy5hamF4X3VybCwgZGF0YSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHJlc3BvbnNlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmxvYWRpbmdfc3RyaW5ncy0tXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmFkZFRvRGljdGlvbmFyeShyZXNwb25zZS5kYXRhLCBub2RlRGF0YSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgLmNhdGNoKGZ1bmN0aW9uIChlcnJvcikge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcclxuICAgICAgICAgICAgICAgIH1lbHNle1xyXG4gICAgICAgICAgICAgICAgICAgIHNlbGYubG9hZGluZ19zdHJpbmdzLS1cclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGFscmVhZHlEZXRlY3RlZCggc2VsZWN0b3IsIGRiSWQgKXtcclxuICAgICAgICAgICAgICAgIGxldCBjb21iaW5lZCA9IHNlbGVjdG9yICsgJz0nICsgZGJJZFxyXG4gICAgICAgICAgICAgICAgaWYgKCB1dGlscy5hcnJheUNvbnRhaW5zSXRlbSggdGhpcy5kZXRlY3RlZFNlbGVjdG9yQW5kSWQsIGNvbWJpbmVkICkgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcclxuICAgICAgICAgICAgICAgIH1lbHNlIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRldGVjdGVkU2VsZWN0b3JBbmRJZC5wdXNoKGNvbWJpbmVkKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBzZXR1cEV2ZW50TGlzdGVuZXIoIG5vZGUgKXtcclxuICAgICAgICAgICAgICAgIGlmICggbm9kZS50YWdOYW1lID09ICdBJyAmJiAhbm9kZS5oYXNBdHRyaWJ1dGUoICdkYXRhLXRycGdldHRleHRvcmlnaW5hbCcgKSApXHJcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXHJcblxyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXHJcblxyXG4gICAgICAgICAgICAgICAgbm9kZS5hZGRFdmVudExpc3RlbmVyKCAnbW91c2VlbnRlcicsIHNlbGYuJHJlZnMuaG92ZXJBY3Rpb25zLnNob3dQZW5jaWxJY29uIClcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgYWRkVG9EaWN0aW9uYXJ5KCByZXNwb25zZURhdGEsIG5vZGVJbmZvID0gbnVsbCApe1xyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKCByZXNwb25zZURhdGEgIT0gbnVsbCApIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIG5vZGVJbmZvICl7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVJbmZvLmZvckVhY2goZnVuY3Rpb24gKCBpbmZvUm93LCBpbmRleCApe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2VEYXRhLnNvbWUoIGZ1bmN0aW9uICggcmVzcG9uc2VEYXRhUm93ICkge1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIGluZm9Sb3cuZGJJRCA9PSByZXNwb25zZURhdGFSb3cuZGJJRCApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9icmluZyBibG9ja190eXBlIHRvIHRoZSB0b3AgbGV2ZWwgb2JqZWN0XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggcmVzcG9uc2VEYXRhUm93LnR5cGUgIT0gJ2dldHRleHQnICYmIHR5cGVvZiByZXNwb25zZURhdGFSb3cuYmxvY2tfdHlwZSA9PSAndW5kZWZpbmVkJyApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBmaXJzdExhbmd1YWdlID0gc2VsZi5vcmRlcmVkU2Vjb25kYXJ5TGFuZ3VhZ2VzWzBdXHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCB0eXBlb2YgcmVzcG9uc2VEYXRhUm93LnRyYW5zbGF0aW9uc0FycmF5W2ZpcnN0TGFuZ3VhZ2VdLmJsb2NrX3R5cGUgIT0gJ3VuZGVmaW5lZCcgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc3BvbnNlRGF0YVJvdy5ibG9ja190eXBlID0gcmVzcG9uc2VEYXRhUm93LnRyYW5zbGF0aW9uc0FycmF5W2ZpcnN0TGFuZ3VhZ2VdLmJsb2NrX3R5cGVcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbm9kZUluZm9baW5kZXhdID0gT2JqZWN0LmFzc2lnbigge30sIHJlc3BvbnNlRGF0YVJvdywgaW5mb1JvdyApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlIC8vIGEgc29ydCBvZiBicmVha1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgfWVsc2V7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVJbmZvID0gcmVzcG9uc2VEYXRhXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnN0cmluZ0dyb3VwcyA9IHRoaXMuYWRkVG9TdHJpbmdHcm91cHMoIG5vZGVJbmZvIClcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpY3Rpb25hcnkgPSB0aGlzLmRpY3Rpb25hcnkuY29uY2F0KCBub2RlSW5mbyApXHJcblxyXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuaW5pdFN0cmluZ3NEcm9wZG93bigpXHJcbiAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGFkZFRvU3RyaW5nR3JvdXBzKCBzdHJpbmdzICl7XHJcblxyXG4gICAgICAgICAgICAgICAgLy8gc2VlIHdoYXQgbm9kZSBncm91cHMgYXJlIGZvdW5kXHJcbiAgICAgICAgICAgICAgICBsZXQgZm91bmRTdHJpbmdHcm91cHMgPSB0aGlzLnN0cmluZ0dyb3VwcztcclxuICAgICAgICAgICAgICAgIHN0cmluZ3MuZm9yRWFjaCggZnVuY3Rpb24gKCBzdHJpbmcgKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBmb3VuZFN0cmluZ0dyb3Vwcy5pbmRleE9mKCBzdHJpbmcuZ3JvdXAgKSA9PT0gLTEgJiYgKCAoIHR5cGVvZiBzdHJpbmcuYmxvY2tUeXBlID09PSAndW5kZWZpbmVkJyApIHx8IHN0cmluZy5ibG9ja1R5cGUgIT09ICcyJyApICl7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kU3RyaW5nR3JvdXBzLnB1c2goIHN0cmluZy5ncm91cCApXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBwdXQgdGhlIG5vZGUgZ3JvdXBzIGluIHRoZSBvcmRlciB0aGF0IHdlIHdhbnQsIGFjY29yZGluZyB0byB0aGUgcHJvcCB0aGlzLnN0cmluZ0dyb3VwT3JkZXJcclxuICAgICAgICAgICAgICAgIGxldCBvcmRlcmVkU3RyaW5nR3JvdXBzID0gW107XHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKCB0aGlzLmVkaXRvclN0cmluZ3Muc2VvX3VwZGF0ZV9ub3RpY2UgIT0gJ3Nlb19wYWNrX3VwZGF0ZV9ub3RfbmVlZGVkJyApe1xyXG4gICAgICAgICAgICAgICAgICAgIG9yZGVyZWRTdHJpbmdHcm91cHMucHVzaCggdGhpcy5lZGl0b3JTdHJpbmdzLnNlb191cGRhdGVfbm90aWNlICk7XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgdGhpcy5zdHJpbmdHcm91cE9yZGVyLmZvckVhY2goIGZ1bmN0aW9uKCBncm91cCApe1xyXG4gICAgICAgICAgICAgICAgICAgIGlmICggZm91bmRTdHJpbmdHcm91cHMuaW5kZXhPZiggZ3JvdXAgKSAhPT0gLTEgKXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXJlZFN0cmluZ0dyb3Vwcy5wdXNoKCBncm91cCApXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICAvLyBpZiB0aGVyZSB3ZXJlIGFueSBvdGhlciBzdHJpbmcgZ3JvdXBzIHRoYXQgd2VyZSBub3QgaW4gdGhlIHByb3AsIGFkZCB0aGVtIGF0IHRoZSBlbmQuXHJcbiAgICAgICAgICAgICAgICBmb3VuZFN0cmluZ0dyb3Vwcy5mb3JFYWNoKCBmdW5jdGlvbiAoZ3JvdXApIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoIG9yZGVyZWRTdHJpbmdHcm91cHMuaW5kZXhPZiggZ3JvdXAgKSA9PT0gLTEgKXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXJlZFN0cmluZ0dyb3Vwcy5wdXNoKGdyb3VwKTtcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIHJldHVybiBvcmRlcmVkU3RyaW5nR3JvdXBzO1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBnZXRTdHJpbmdJbmRleCggc2VsZWN0b3IsIGRiSUQgKXtcclxuICAgICAgICAgICAgICAgIGxldCBmb3VuZCA9IG51bGxcclxuXHJcbiAgICAgICAgICAgICAgICB0aGlzLmRpY3Rpb25hcnkuc29tZShmdW5jdGlvbiAoIHN0cmluZywgaW5kZXggKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBzdHJpbmcuZGJJRCA9PSBkYklEICYmIHN0cmluZy5zZWxlY3RvciA9PSBzZWxlY3RvciApe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IGluZGV4XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gZm91bmRcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgZ2V0Tm9kZUluZm8oIG5vZGUsIGJhc2VTZWxlY3RvciA9ICcnICl7XHJcbiAgICAgICAgICAgICAgICBsZXQgc3RyaW5nSWRcclxuICAgICAgICAgICAgICAgIGxldCBub2RlRGF0YSAgPSBbXVxyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGVjdG9ycyA9IHRoaXMucHJlcGFyZVNlbGVjdG9yU3RyaW5ncyggYmFzZVNlbGVjdG9yIClcclxuXHJcbiAgICAgICAgICAgICAgICBzZWxlY3RvcnMuZm9yRWFjaCggZnVuY3Rpb24gKCBzZWxlY3RvciApIHtcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgc3RyaW5nSWQgPSBub2RlLmdldEF0dHJpYnV0ZSggc2VsZWN0b3IgKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBpZiAoIHN0cmluZ0lkICkge1xyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vZGVBdHRyaWJ1dGUgICA9IHNlbGVjdG9yLnJlcGxhY2UoIGJhc2VTZWxlY3RvciwgJycgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm9kZUdyb3VwICAgICAgID0gbm9kZS5nZXRBdHRyaWJ1dGUoICdkYXRhLXRycC1ub2RlLWdyb3VwJyArIG5vZGVBdHRyaWJ1dGUgKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgbm9kZURlc2NyaXB0aW9uID0gbm9kZS5nZXRBdHRyaWJ1dGUoICdkYXRhLXRycC1ub2RlLWRlc2NyaXB0aW9uJyArIG5vZGVBdHRyaWJ1dGUgKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGVudHJ5ID0ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGJJRCAgICAgIDogc3RyaW5nSWQsXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RvciAgOiBzZWxlY3RvcixcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZSA6IG5vZGVBdHRyaWJ1dGUuc3Vic3RyKDEpLCAvLyBzdWJzdHIoMSkgaXMgdXNlZCB0byB0cmltIHByZWZpeGluZyBsaW5lIC0gZXguIC1hbHQgd2lsbCByZXN1bHQgaW4gYWx0IChubyBsaW5lKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoIG5vZGVHcm91cCApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeS5ncm91cCA9IG5vZGVHcm91cFxyXG5cclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBub2RlRGVzY3JpcHRpb24gKVxyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZW50cnkuZGVzY3JpcHRpb24gPSBub2RlRGVzY3JpcHRpb25cclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVEYXRhLnB1c2goIGVudHJ5IClcclxuICAgICAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgfSlcclxuXHJcbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZURhdGFcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgZ2V0QWxsU2VsZWN0b3JzKCl7XHJcbiAgICAgICAgICAgICAgICBsZXQgc2VsZWN0b3JzID0gW11cclxuICAgICAgICAgICAgICAgIGxldCBzZWxmICAgICAgPSB0aGlzXHJcblxyXG4gICAgICAgICAgICAgICAgdGhpcy5kYXRhQXR0cmlidXRlcy5mb3JFYWNoKCBmdW5jdGlvbiAoIGRhdGFBdHRyaWJ1dGUgKXtcclxuICAgICAgICAgICAgICAgICAgICBzZWxlY3RvcnMgPSBzZWxlY3RvcnMuY29uY2F0KCBzZWxmLnByZXBhcmVTZWxlY3RvclN0cmluZ3MoIGRhdGFBdHRyaWJ1dGUgKSApXHJcbiAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgIHJldHVybiBzZWxlY3RvcnNcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgcHJlcGFyZVNlbGVjdG9yU3RyaW5ncyggYmFzZU5hbWVTZWxlY3RvciApe1xyXG4gICAgICAgICAgICAgICAgbGV0IHBhcnNlZF9zZWxlY3RvcnMgPSBbXVxyXG5cclxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3JzLmZvckVhY2goIGZ1bmN0aW9uICggc2VsZWN0b3JTdWZmaXgsIGluZGV4ICl7XHJcbiAgICAgICAgICAgICAgICAgICAgcGFyc2VkX3NlbGVjdG9ycy5wdXNoKCBiYXNlTmFtZVNlbGVjdG9yICsgc2VsZWN0b3JTdWZmaXggIClcclxuICAgICAgICAgICAgICAgIH0pXHJcblxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHBhcnNlZF9zZWxlY3RvcnNcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgcGFyZW50VVJMKCB1cmwgKXtcclxuICAgICAgICAgICAgICAgIHJldHVybiB1cmwucmVwbGFjZSggJ3RycC1lZGl0LXRyYW5zbGF0aW9uPXByZXZpZXcnLCAndHJwLWVkaXQtdHJhbnNsYXRpb249dHJ1ZScgKVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBjbGVhblVSTCggdXJsICl7XHJcbiAgICAgICAgICAgICAgICAvL21ha2UgcmVtb3ZlVXJsUGFyYW1ldGVyIHJlY3Vyc2l2ZSBhbmQgb25seSBjYWxsIGl0IG9uY2Ugd2l0aCBhbGwgdGhlIHBhcmFtZXRlcnMgdGhhdFxyXG4gICAgICAgICAgICAgICAgLy9uZWVkIHRvIHN0cmlwcGVkID9cclxuICAgICAgICAgICAgICAgIHVybCA9IHV0aWxzLnJlbW92ZVVybFBhcmFtZXRlciggdXJsLCAnbGFuZycgKVxyXG4gICAgICAgICAgICAgICAgdXJsID0gdXRpbHMucmVtb3ZlVXJsUGFyYW1ldGVyKCB1cmwsICd0cnAtdmlldy1hcycgKVxyXG4gICAgICAgICAgICAgICAgdXJsID0gdXRpbHMucmVtb3ZlVXJsUGFyYW1ldGVyKCB1cmwsICd0cnAtdmlldy1hcy1ub25jZScgKVxyXG4gICAgICAgICAgICAgICAgdXJsID0gdXRpbHMucmVtb3ZlVXJsUGFyYW1ldGVyKCB1cmwsICd0cnAtZWRpdC10cmFuc2xhdGlvbicgKVxyXG5cclxuICAgICAgICAgICAgICAgIHJldHVybiB1cmxcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgc2hvd1N0cmluZyggc3RyaW5nLCB0eXBlICl7XHJcbiAgICAgICAgICAgICAgICBpZiAoIHR5cGVvZiBzdHJpbmcuYmxvY2tUeXBlICE9PSAndW5kZWZpbmVkJyAmJiBzdHJpbmcuYmxvY2tUeXBlID09PSAnMicgKXtcclxuICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCBzaG93IGRlcHJlY2F0ZWQgdHJhbnNsYXRpb24gYmxvY2tzIGluIHRoZSBkcm9wZG93blxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZVxyXG4gICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlID09PSB0aGlzLmVkaXRvclN0cmluZ3MuaW1hZ2VzICYmIHR5cGVvZiBzdHJpbmcuYXR0cmlidXRlICE9ICd1bmRlZmluZWQnICYmIHN0cmluZy5hdHRyaWJ1dGUgPT0gJ3NyYycgKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXHJcblxyXG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2Ygc3RyaW5nLmF0dHJpYnV0ZSAhPT0gJ3VuZGVmaW5lZCcgJiYgKCBzdHJpbmcuYXR0cmlidXRlID09ICdocmVmJyB8fCBzdHJpbmcuYXR0cmlidXRlID09ICdzcmMnICkgKVxyXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZVxyXG5cclxuICAgICAgICAgICAgICAgIGlmICggc3RyaW5nLmdyb3VwID09PSB0eXBlIClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxyXG5cclxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBpbml0U3RyaW5nc0Ryb3Bkb3duKCl7XHJcbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcclxuXHJcbiAgICAgICAgICAgICAgICBpZiAoICF0aGlzLmlzU3RyaW5nc0Ryb3Bkb3duT3BlbigpICkge1xyXG4gICAgICAgICAgICAgICAgICAgIGpRdWVyeSggJyN0cnAtc3RyaW5nLWNhdGVnb3JpZXMnICkuc2VsZWN0MiggJ2Rlc3Ryb3knIClcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgalF1ZXJ5KCAnI3RycC1zdHJpbmctY2F0ZWdvcmllcycgKS5zZWxlY3QyKCB7IHBsYWNlaG9sZGVyIDogc2VsZi5lZGl0b3JTdHJpbmdzLnNlbGVjdF9zdHJpbmcsIHRlbXBsYXRlUmVzdWx0OiBmdW5jdGlvbihvcHRpb24pe1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3JpZ2luYWwgICAgPSBoZS5kZWNvZGUoIG9wdGlvbi50ZXh0LnN1YnN0cmluZygwLCA5MCkgKSArICggKCBvcHRpb24udGV4dC5sZW5ndGggPD0gOTApID8gJycgOiAnLi4uJyApXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBkZXNjcmlwdGlvbiA9ICggb3B0aW9uLnRpdGxlICkgPyAgJygnICsgb3B0aW9uLnRpdGxlICsgJyknIDogJydcclxuXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqUXVlcnkoICc8ZGl2PicgKyBvcmlnaW5hbCArICc8L2Rpdj48ZGl2IGNsYXNzPVwic3RyaW5nLXNlbGVjdG9yLWRlc2NyaXB0aW9uXCI+JyArIGRlc2NyaXB0aW9uICsgJzwvZGl2PicgKTtcclxuICAgICAgICAgICAgICAgICAgICB9LCB3aWR0aCA6ICcxMDAlJyB9ICkucHJvcCggJ2Rpc2FibGVkJywgZmFsc2UgKVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBqUXVlcnkoICcjdHJwX3NlbGVjdDJfb3ZlcmxheScgKS5oaWRlKClcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgc3RyaW5nc0Ryb3Bkb3duTG9hZGluZygpe1xyXG4gICAgICAgICAgICAgICAgalF1ZXJ5KCAnI3RycC1zdHJpbmctY2F0ZWdvcmllcycgKS5zZWxlY3QyKCB7IHBsYWNlaG9sZGVyIDogdGhpcy5lZGl0b3JTdHJpbmdzLnN0cmluZ3NfbG9hZGluZywgd2lkdGggOiAnMTAwJScgfSApLnByb3AoICdkaXNhYmxlZCcsIHRydWUgKVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBwcm9jZXNzT3B0aW9uTmFtZSggbmFtZSwgdHlwZSApe1xyXG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlID09ICdJbWFnZXMnIClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdXRpbHMuZ2V0RmlsZW5hbWUoIG5hbWUgKVxyXG5cclxuICAgICAgICAgICAgICAgIHJldHVybiB1dGlscy5lc2NhcGVIdG1sKCBuYW1lIClcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgaXNTdHJpbmdzRHJvcGRvd25PcGVuKCl7XHJcbiAgICAgICAgICAgICAgICByZXR1cm4galF1ZXJ5KCAnI3RycC1zdHJpbmctY2F0ZWdvcmllcycgKS5zZWxlY3QyKCAnaXNPcGVuJyApXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGhhc1Vuc2F2ZWRDaGFuZ2VzKCl7XHJcbiAgICAgICAgICAgICAgICBsZXQgdW5zYXZlZENoYW5nZXMgPSBmYWxzZVxyXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXHJcbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMuc2VsZWN0ZWRJbmRleGVzQXJyYXkubGVuZ3RoID4gMCApIHtcclxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdGVkSW5kZXhlc0FycmF5LmZvckVhY2goZnVuY3Rpb24gKHNlbGVjdGVkSW5kZXgpIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zZXR0aW5nc1sndHJhbnNsYXRpb24tbGFuZ3VhZ2VzJ10uZm9yRWFjaChmdW5jdGlvbiAobGFuZ3VhZ2VDb2RlKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdICYmXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0gJiZcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAoc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0udHJhbnNsYXRlZCAhPT0gc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0uZWRpdGVkVHJhbnNsYXRpb24pKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zYXZlZENoYW5nZXMgPSB0cnVlXHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIHRoaXMuc2hvd0NoYW5nZXNVbnNhdmVkTWVzc2FnZSA9IHVuc2F2ZWRDaGFuZ2VzXHJcblxyXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVuc2F2ZWRDaGFuZ2VzXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGlmcmFtZUxvYWRlciggc3RhdHVzICkge1xyXG4gICAgICAgICAgICAgICAgbGV0IGxvYWRlciA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCAndHJwLXByZXZpZXctbG9hZGVyJyApXHJcblxyXG4gICAgICAgICAgICAgICAgaWYoIHN0YXR1cyA9PSAnc2hvdycgKVxyXG4gICAgICAgICAgICAgICAgICAgIGxvYWRlci5zdHlsZS5kaXNwbGF5ID0gJ2ZsZXgnXHJcbiAgICAgICAgICAgICAgICBlbHNlIGlmKCBzdGF0dXMgPT0gJ2hpZGUnIClcclxuICAgICAgICAgICAgICAgICAgICBsb2FkZXIuc3R5bGUuZGlzcGxheSA9ICdub25lJ1xyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBwcmV2aW91c1N0cmluZygpe1xyXG4gICAgICAgICAgICAgICAgbGV0IGN1cnJlbnRWYWx1ZSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCd0cnAtc3RyaW5nLWNhdGVnb3JpZXMnKS52YWx1ZVxyXG5cclxuICAgICAgICAgICAgICAgIGxldCBuZXdWYWx1ZSA9ICtjdXJyZW50VmFsdWUgLSAxXHJcblxyXG4gICAgICAgICAgICAgICAgd2hpbGUoIG5ld1ZhbHVlID49IDAgJiYgZG9jdW1lbnQucXVlcnlTZWxlY3RvckFsbCgnI3RycC1zdHJpbmctY2F0ZWdvcmllcyBvcHRpb25bdmFsdWU9XCInICsgbmV3VmFsdWUgKyAnXCJdJykubGVuZ3RoID09PSAwICl7XHJcbiAgICAgICAgICAgICAgICAgICAgbmV3VmFsdWUtLTtcclxuICAgICAgICAgICAgICAgIH1cclxuXHJcbiAgICAgICAgICAgICAgICBpZiggbmV3VmFsdWUgPCAwIClcclxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cclxuXHJcbiAgICAgICAgICAgICAgICB0aGlzLnNlbGVjdGVkU3RyaW5nID0gbmV3VmFsdWUudG9TdHJpbmcoKVxyXG4gICAgICAgICAgICB9LFxyXG4gICAgICAgICAgICBuZXh0U3RyaW5nKCl7XHJcbiAgICAgICAgICAgICAgICBsZXQgY3VycmVudFZhbHVlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoJ3RycC1zdHJpbmctY2F0ZWdvcmllcycpLnZhbHVlLCBuZXdWYWx1ZSA9IDBcclxuXHJcbiAgICAgICAgICAgICAgICBpZiggY3VycmVudFZhbHVlICE9ICcnIClcclxuICAgICAgICAgICAgICAgICAgICBuZXdWYWx1ZSA9ICtjdXJyZW50VmFsdWUgKyAxXHJcblxyXG4gICAgICAgICAgICAgICAgd2hpbGUoIG5ld1ZhbHVlIDwgdGhpcy5kaWN0aW9uYXJ5Lmxlbmd0aCAmJiBkb2N1bWVudC5xdWVyeVNlbGVjdG9yQWxsKCcjdHJwLXN0cmluZy1jYXRlZ29yaWVzIG9wdGlvblt2YWx1ZT1cIicgKyBuZXdWYWx1ZSArICdcIl0nKS5sZW5ndGggPT09IDAgKXtcclxuICAgICAgICAgICAgICAgICAgICBuZXdWYWx1ZSsrO1xyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIGlmICggbmV3VmFsdWUgPj0gdGhpcy5kaWN0aW9uYXJ5Lmxlbmd0aCApe1xyXG4gICAgICAgICAgICAgICAgICAgIHJldHVyblxyXG4gICAgICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0ZWRTdHJpbmcgPSBuZXdWYWx1ZS50b1N0cmluZygpXHJcbiAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIGFkZEtleWJvYXJkU2hvcnRjdXRzTGlzdGVuZXIoKXtcclxuICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoXCJrZXlkb3duXCIsIGZ1bmN0aW9uKGUpIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoKHdpbmRvdy5uYXZpZ2F0b3IucGxhdGZvcm0ubWF0Y2goXCJNYWNcIikgPyBlLm1ldGFLZXkgOiBlLmN0cmxLZXkpICYmIGUuYWx0S2V5ICkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBDVFJMICsgQUxUICsgcmlnaHQgYXJyb3dcclxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGUua2V5Q29kZSA9PT0gMzkgKXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5kaXNwYXRjaEV2ZW50KCBuZXcgRXZlbnQoICd0cnBfdHJpZ2dlcl9uZXh0X3N0cmluZ19ldmVudCcgKSApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIENUUkwgKyBBTFQgKyBsZWZ0IGFycm93XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggZS5rZXlDb2RlID09PSAzNyApIHtcclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmRpc3BhdGNoRXZlbnQoIG5ldyBFdmVudCggJ3RycF90cmlnZ2VyX3ByZXZpb3VzX3N0cmluZ19ldmVudCcgKSApO1xyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICAgICAgfVxyXG4gICAgICAgICAgICAgICAgfSwgZmFsc2UpO1xyXG5cclxuICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCAndHJwX3RyaWdnZXJfbmV4dF9zdHJpbmdfZXZlbnQnLCB0aGlzLm5leHRTdHJpbmcgKVxyXG4gICAgICAgICAgICAgICAgd2luZG93LmFkZEV2ZW50TGlzdGVuZXIoICd0cnBfdHJpZ2dlcl9wcmV2aW91c19zdHJpbmdfZXZlbnQnLCB0aGlzLnByZXZpb3VzU3RyaW5nIClcclxuICAgICAgICAgICAgfSxcclxuICAgICAgICAgICAgcmVzaXplSWZyYW1lIChldmVudCwgdWkpIHtcclxuICAgICAgICAgICAgICAgIGxldCB0b3RhbF93aWR0aCA9IGpRdWVyeSh3aW5kb3cpLndpZHRoKCk7XHJcbiAgICAgICAgICAgICAgICBsZXQgd2lkdGggPSBqUXVlcnkoICcjdHJwLWNvbnRyb2xzJyApLndpZHRoKCk7XHJcblxyXG4gICAgICAgICAgICAgICAgaWYod2lkdGggPiB0b3RhbF93aWR0aCkge1xyXG4gICAgICAgICAgICAgICAgICAgIHdpZHRoID0gdG90YWxfd2lkdGg7XHJcbiAgICAgICAgICAgICAgICAgICAgY29udHJvbHMuY3NzKCd3aWR0aCcsIHdpZHRoKTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgICAgIGxldCBwcmV2aWV3Q29udGFpbmVyID0galF1ZXJ5KCAnI3RycC1wcmV2aWV3JyApO1xyXG4gICAgICAgICAgICAgICAgcHJldmlld0NvbnRhaW5lci5jc3MoJ3JpZ2h0Jywgd2lkdGggKTtcclxuICAgICAgICAgICAgICAgIHByZXZpZXdDb250YWluZXIuY3NzKCdsZWZ0JywgKCB3aWR0aCAtIDM0OCApICk7XHJcbiAgICAgICAgICAgICAgICBwcmV2aWV3Q29udGFpbmVyLmNzcygnd2lkdGgnLCAodG90YWxfd2lkdGggLSB3aWR0aCkpO1xyXG4gICAgICAgICAgICB9XHJcbiAgICAgICAgfSxcclxuICAgICAgICAvL2FkZCBzdXBwb3J0IGZvciB2LW1vZGVsIGluIHNlbGVjdDJcclxuICAgICAgICBkaXJlY3RpdmVzOiB7XHJcbiAgICAgICAgICAgIHNlbGVjdDI6IHtcclxuICAgICAgICAgICAgICAgIGluc2VydGVkKGVsKSB7XHJcbiAgICAgICAgICAgICAgICAgICAgalF1ZXJ5KGVsKS5vbignc2VsZWN0MjpzZWxlY3QnLCAoKSA9PiB7XHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGV2ZW50ID0gbmV3IEV2ZW50KCdjaGFuZ2UnLCB7IGJ1YmJsZXM6IHRydWUsIGNhbmNlbGFibGU6IHRydWUgfSlcclxuICAgICAgICAgICAgICAgICAgICAgICAgZWwuZGlzcGF0Y2hFdmVudChldmVudClcclxuICAgICAgICAgICAgICAgICAgICB9KVxyXG5cclxuICAgICAgICAgICAgICAgICAgICBqUXVlcnkoZWwpLm9uKCdzZWxlY3QyOnVuc2VsZWN0JywgKCkgPT4ge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBldmVudCA9IG5ldyBFdmVudCgnY2hhbmdlJywgeyBidWJibGVzOiB0cnVlLCBjYW5jZWxhYmxlOiB0cnVlIH0pXHJcbiAgICAgICAgICAgICAgICAgICAgICAgIGVsLmRpc3BhdGNoRXZlbnQoZXZlbnQpXHJcbiAgICAgICAgICAgICAgICAgICAgfSlcclxuICAgICAgICAgICAgICAgIH0sXHJcbiAgICAgICAgICAgIH1cclxuICAgICAgICB9XHJcbiAgICB9XHJcbjwvc2NyaXB0PlxyXG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/editor.vue?vue&type=script&lang=js&\n");
|
766 |
|
767 |
/***/ }),
|
768 |
|
@@ -980,8 +980,8 @@ eval("module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\
|
|
980 |
/*! no static exports found */
|
981 |
/***/ (function(module, exports, __webpack_require__) {
|
982 |
|
983 |
-
__webpack_require__(/*!
|
984 |
-
module.exports = __webpack_require__(/*!
|
985 |
|
986 |
|
987 |
/***/ }),
|
94 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
95 |
|
96 |
"use strict";
|
97 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _extra_content_vue_vue_type_template_id_1b1c5c60___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./extra-content.vue?vue&type=template&id=1b1c5c60& */ \"./assets/src/js/components/extra-content.vue?vue&type=template&id=1b1c5c60&\");\n/* harmony import */ var _extra_content_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./extra-content.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/extra-content.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _extra_content_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _extra_content_vue_vue_type_template_id_1b1c5c60___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _extra_content_vue_vue_type_template_id_1b1c5c60___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/extra-content.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvZXh0cmEtY29udGVudC52dWU/NjgzZCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUE0RjtBQUMzQjtBQUNMOzs7QUFHNUQ7QUFDZ0c7QUFDaEcsZ0JBQWdCLDJHQUFVO0FBQzFCLEVBQUUsbUZBQU07QUFDUixFQUFFLHdGQUFNO0FBQ1IsRUFBRSxpR0FBZTtBQUNqQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBLElBQUksS0FBVSxFQUFFLFlBaUJmO0FBQ0Q7QUFDZ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jZXB0KClcbiAgICBpZiAoIW1vZHVsZS5ob3QuZGF0YSkge1xuICAgICAgYXBpLmNyZWF0ZVJlY29yZCgnMWIxYzVjNjAnLCBjb21wb25lbnQub3B0aW9ucylcbiAgICB9IGVsc2Uge1xuICAgICAgYXBpLnJlbG9hZCgnMWIxYzVjNjAnLCBjb21wb25lbnQub3B0aW9ucylcbiAgICB9XG4gICAgbW9kdWxlLmhvdC5hY2NlcHQoXCIuL2V4dHJhLWNvbnRlbnQudnVlP3Z1ZSZ0eXBlPXRlbXBsYXRlJmlkPTFiMWM1YzYwJlwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICBhcGkucmVyZW5kZXIoJzFiMWM1YzYwJywge1xuICAgICAgICByZW5kZXI6IHJlbmRlcixcbiAgICAgICAgc3RhdGljUmVuZGVyRm5zOiBzdGF0aWNSZW5kZXJGbnNcbiAgICAgIH0pXG4gICAgfSlcbiAgfVxufVxuY29tcG9uZW50Lm9wdGlvbnMuX19maWxlID0gXCJhc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvZXh0cmEtY29udGVudC52dWVcIlxuZXhwb3J0IGRlZmF1bHQgY29tcG9uZW50LmV4cG9ydHMiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./assets/src/js/components/extra-content.vue\n");
|
98 |
|
99 |
/***/ }),
|
100 |
|
130 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
131 |
|
132 |
"use strict";
|
133 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _hover_actions_vue_vue_type_template_id_b0793be0___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./hover-actions.vue?vue&type=template&id=b0793be0& */ \"./assets/src/js/components/hover-actions.vue?vue&type=template&id=b0793be0&\");\n/* harmony import */ var _hover_actions_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./hover-actions.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/hover-actions.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _hover_actions_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _hover_actions_vue_vue_type_template_id_b0793be0___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _hover_actions_vue_vue_type_template_id_b0793be0___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/hover-actions.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvaG92ZXItYWN0aW9ucy52dWU/ZTMzNyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUE0RjtBQUMzQjtBQUNMOzs7QUFHNUQ7QUFDZ0c7QUFDaEcsZ0JBQWdCLDJHQUFVO0FBQzFCLEVBQUUsbUZBQU07QUFDUixFQUFFLHdGQUFNO0FBQ1IsRUFBRSxpR0FBZTtBQUNqQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBLElBQUksS0FBVSxFQUFFLFlBaUJmO0FBQ0Q7QUFDZSxnRiIsImZpbGUiOiIuL2Fzc2V0cy9zcmMvanMvY29tcG9uZW50cy9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xuICAgICAgYXBpLmNyZWF0ZVJlY29yZCgnYjA3OTNiZTAnLCBjb21wb25lbnQub3B0aW9ucylcbiAgICB9IGVsc2Uge1xuICAgICAgYXBpLnJlbG9hZCgnYjA3OTNiZTAnLCBjb21wb25lbnQub3B0aW9ucylcbiAgICB9XG4gICAgbW9kdWxlLmhvdC5hY2NlcHQoXCIuL2hvdmVyLWFjdGlvbnMudnVlP3Z1ZSZ0eXBlPXRlbXBsYXRlJmlkPWIwNzkzYmUwJlwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICBhcGkucmVyZW5kZXIoJ2IwNzkzYmUwJywge1xuICAgICAgICByZW5kZXI6IHJlbmRlcixcbiAgICAgICAgc3RhdGljUmVuZGVyRm5zOiBzdGF0aWNSZW5kZXJGbnNcbiAgICAgIH0pXG4gICAgfSlcbiAgfVxufVxuY29tcG9uZW50Lm9wdGlvbnMuX19maWxlID0gXCJhc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvaG92ZXItYWN0aW9ucy52dWVcIlxuZXhwb3J0IGRlZmF1bHQgY29tcG9uZW50LmV4cG9ydHMiXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./assets/src/js/components/hover-actions.vue\n");
|
134 |
|
135 |
/***/ }),
|
136 |
|
166 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
167 |
|
168 |
"use strict";
|
169 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _language_boxes_vue_vue_type_template_id_3f80cf10___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./language-boxes.vue?vue&type=template&id=3f80cf10& */ \"./assets/src/js/components/language-boxes.vue?vue&type=template&id=3f80cf10&\");\n/* harmony import */ var _language_boxes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./language-boxes.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/language-boxes.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _language_boxes_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _language_boxes_vue_vue_type_template_id_3f80cf10___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _language_boxes_vue_vue_type_template_id_3f80cf10___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/language-boxes.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvbGFuZ3VhZ2UtYm94ZXMudnVlPzE3NWIiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBNkY7QUFDM0I7QUFDTDs7O0FBRzdEO0FBQ2dHO0FBQ2hHLGdCQUFnQiwyR0FBVTtBQUMxQixFQUFFLG9GQUFNO0FBQ1IsRUFBRSx5RkFBTTtBQUNSLEVBQUUsa0dBQWU7QUFDakI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSxJQUFJLEtBQVUsRUFBRSxZQWlCZjtBQUNEO0FBQ2UsZ0YiLCJmaWxlIjoiLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvbGFuZ3VhZ2UtYm94ZXMudnVlLmpzIi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XRlUmVjb3JkKCczZjgwY2YxMCcsIGNvbXBvbmVudC5vcHRpb25zKVxuICAgIH0gZWxzZSB7XG4gICAgICBhcGkucmVsb2FkKCczZjgwY2YxMCcsIGNvbXBvbmVudC5vcHRpb25zKVxuICAgIH1cbiAgICBtb2R1bGUuaG90LmFjY2VwdChcIi4vbGFuZ3VhZ2UtYm94ZXMudnVlP3Z1ZSZ0eXBlPXRlbXBsYXRlJmlkPTNmODBjZjEwJlwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICBhcGkucmVyZW5kZXIoJzNmODBjZjEwJywge1xuICAgICAgICByZW5kZXI6IHJlbmRlcixcbiAgICAgICAgc3RhdGljUmVuZGVyRm5zOiBzdGF0aWNSZW5kZXJGbnNcbiAgICAgIH0pXG4gICAgfSlcbiAgfVxufVxuY29tcG9uZW50Lm9wdGlvbnMuX19maWxlID0gXCJhc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvbGFuZ3VhZ2UtYm94ZXMudnVlXCJcbmV4cG9ydCBkZWZhdWx0IGNvbXBvbmVudC5leHBvcnRzIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./assets/src/js/components/language-boxes.vue\n");
|
170 |
|
171 |
/***/ }),
|
172 |
|
202 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
203 |
|
204 |
"use strict";
|
205 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _save_translations_vue_vue_type_template_id_1ec6ec54___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./save-translations.vue?vue&type=template&id=1ec6ec54& */ \"./assets/src/js/components/save-translations.vue?vue&type=template&id=1ec6ec54&\");\n/* harmony import */ var _save_translations_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./save-translations.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/save-translations.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _save_translations_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _save_translations_vue_vue_type_template_id_1ec6ec54___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _save_translations_vue_vue_type_template_id_1ec6ec54___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/save-translations.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvc2F2ZS10cmFuc2xhdGlvbnMudnVlP2ZlNzciXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBZ0c7QUFDM0I7QUFDTDs7O0FBR2hFO0FBQ2dHO0FBQ2hHLGdCQUFnQiwyR0FBVTtBQUMxQixFQUFFLHVGQUFNO0FBQ1IsRUFBRSw0RkFBTTtBQUNSLEVBQUUscUdBQWU7QUFDakI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSxJQUFJLEtBQVUsRUFBRSxZQWlCZjtBQUNEO0FBQ2UsZ0YiLCJmaWxlIjoiLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvc2F2ZS10cmFuc2xhdGlvbnMudnVlLmpzIiwic291cmNlc0Nvbn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mVjb3JkKCcxZWM2ZWM1NCcsIGNvbXBvbmVudC5vcHRpb25zKVxuICAgIH0gZWxzZSB7XG4gICAgICBhcGkucmVsb2FkKCcxZWM2ZWM1NCcsIGNvbXBvbmVudC5vcHRpb25zKVxuICAgIH1cbiAgICBtb2R1bGUuaG90LmFjY2VwdChcIi4vc2F2ZS10cmFuc2xhdGlvbnMudnVlP3Z1ZSZ0eXBlPXRlbXBsYXRlJmlkPTFlYzZlYzU0JlwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICBhcGkucmVyZW5kZXIoJzFlYzZlYzU0Jywge1xuICAgICAgICByZW5kZXI6IHJlbmRlcixcbiAgICAgICAgc3RhdGljUmVuZGVyRm5zOiBzdGF0aWNSZW5kZXJGbnNcbiAgICAgIH0pXG4gICAgfSlcbiAgfVxufVxuY29tcG9uZW50Lm9wdGlvbnMuX19maWxlID0gXCJhc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvc2F2ZS10cmFuc2xhdGlvbnMudnVlXCJcbmV4cG9ydCBkZWZhdWx0IGNvbXBvbmVudC5leHBvcnRzIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./assets/src/js/components/save-translations.vue\n");
|
206 |
|
207 |
/***/ }),
|
208 |
|
238 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
239 |
|
240 |
"use strict";
|
241 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _translation_input_vue_vue_type_template_id_3871315c___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./translation-input.vue?vue&type=template&id=3871315c& */ \"./assets/src/js/components/translation-input.vue?vue&type=template&id=3871315c&\");\n/* harmony import */ var _translation_input_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-input.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/translation-input.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _translation_input_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _translation_input_vue_vue_type_template_id_3871315c___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _translation_input_vue_vue_type_template_id_3871315c___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/translation-input.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvdHJhbnNsYXRpb24taW5wdXQudnVlPzEzZTkiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQTtBQUFBO0FBQUE7QUFBZ0c7QUFDM0I7QUFDTDs7O0FBR2hFO0FBQ2dHO0FBQ2hHLGdCQUFnQiwyR0FBVTtBQUMxQixFQUFFLHVGQUFNO0FBQ1IsRUFBRSw0RkFBTTtBQUNSLEVBQUUscUdBQWU7QUFDakI7QUFDQTtBQUNBO0FBQ0E7O0FBRUE7O0FBRUE7QUFDQSxJQUFJLEtBQVUsRUFBRSxZQWlCZjtBQUNEO0FBQ2UsZ0YiLCJmaWxlIjoiLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvdHJhbnNsYXRpb24taW5wdXQudnVlLmpzIiwic291cmNlc0NvbnRlbnQiOlsiaW1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1YycsIGNvbXBvbmVudC5vcHRpb25zKVxuICAgIH0gZWxzZSB7XG4gICAgICBhcGkucmVsb2FkKCczODcxMzE1YycsIGNvbXBvbmVudC5vcHRpb25zKVxuICAgIH1cbiAgICBtb2R1bGUuaG90LmFjY2VwdChcIi4vdHJhbnNsYXRpb24taW5wdXQudnVlP3Z1ZSZ0eXBlPXRlbXBsYXRlJmlkPTM4NzEzMTVjJlwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICBhcGkucmVyZW5kZXIoJzM4NzEzMTVjJywge1xuICAgICAgICByZW5kZXI6IHJlbmRlcixcbiAgICAgICAgc3RhdGljUmVuZGVyRm5zOiBzdGF0aWNSZW5kZXJGbnNcbiAgICAgIH0pXG4gICAgfSlcbiAgfVxufVxuY29tcG9uZW50Lm9wdGlvbnMuX19maWxlID0gXCJhc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvdHJhbnNsYXRpb24taW5wdXQudnVlXCJcbmV4cG9ydCBkZWZhdWx0IGNvbXBvbmVudC5leHBvcnRzIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./assets/src/js/components/translation-input.vue\n");
|
242 |
|
243 |
/***/ }),
|
244 |
|
274 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
275 |
|
276 |
"use strict";
|
277 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _translation_memory_vue_vue_type_template_id_891e19ae___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./translation-memory.vue?vue&type=template&id=891e19ae& */ \"./assets/src/js/components/translation-memory.vue?vue&type=template&id=891e19ae&\");\n/* harmony import */ var _translation_memory_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-memory.vue?vue&type=script&lang=js& */ \"./assets/src/js/components/translation-memory.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _translation_memory_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _translation_memory_vue_vue_type_template_id_891e19ae___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _translation_memory_vue_vue_type_template_id_891e19ae___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/components/translation-memory.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvdHJhbnNsYXRpb24tbWVtb3J5LnZ1ZT9mNTUwIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQWlHO0FBQzNCO0FBQ0w7OztBQUdqRTtBQUNnRztBQUNoRyxnQkFBZ0IsMkdBQVU7QUFDMUIsRUFBRSx3RkFBTTtBQUNSLEVBQUUsNkZBQU07QUFDUixFQUFFLHNHQUFlO0FBQ2pCO0FBQ0E7QUFDQTtBQUNBOztBQUVBOztBQUVBO0FBQ0EsSUFBSSxLQUFVLEVBQUUsWUFpQmY7QUFDRDtBQUNlLGdGIiwiZmlsZSI6Ii4vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL3RyYW5zbGF0aW9uLW1lbW9yeS52dWUuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgey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QoJzg5MWUxOWFlJywgY29tcG9uZW50Lm9wdGlvbnMpXG4gICAgfSBlbHNlIHtcbiAgICAgIGFwaS5yZWxvYWQoJzg5MWUxOWFlJywgY29tcG9uZW50Lm9wdGlvbnMpXG4gICAgfVxuICAgIG1vZHVsZS5ob3QuYWNjZXB0KFwiLi90cmFuc2xhdGlvbi1tZW1vcnkudnVlP3Z1ZSZ0eXBlPXRlbXBsYXRlJmlkPTg5MWUxOWFlJlwiLCBmdW5jdGlvbiAoKSB7XG4gICAgICBhcGkucmVyZW5kZXIoJzg5MWUxOWFlJywge1xuICAgICAgICByZW5kZXI6IHJlbmRlcixcbiAgICAgICAgc3RhdGljUmVuZGVyRm5zOiBzdGF0aWNSZW5kZXJGbnNcbiAgICAgIH0pXG4gICAgfSlcbiAgfVxufVxuY29tcG9uZW50Lm9wdGlvbnMuX19maWxlID0gXCJhc3NldHMvc3JjL2pzL2NvbXBvbmVudHMvdHJhbnNsYXRpb24tbWVtb3J5LnZ1ZVwiXG5leHBvcnQgZGVmYXVsdCBjb21wb25lbnQuZXhwb3J0cyJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./assets/src/js/components/translation-memory.vue\n");
|
278 |
|
279 |
/***/ }),
|
280 |
|
310 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
311 |
|
312 |
"use strict";
|
313 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _editor_vue_vue_type_template_id_b046e8ec___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./editor.vue?vue&type=template&id=b046e8ec& */ \"./assets/src/js/editor.vue?vue&type=template&id=b046e8ec&\");\n/* harmony import */ var _editor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./editor.vue?vue&type=script&lang=js& */ \"./assets/src/js/editor.vue?vue&type=script&lang=js&\");\n/* empty/unused harmony star reexport *//* harmony import */ var _node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_node_modules_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _editor_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _editor_vue_vue_type_template_id_b046e8ec___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _editor_vue_vue_type_template_id_b046e8ec___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"assets/src/js/editor.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL2VkaXRvci52dWU/OWFiZiJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFxRjtBQUMzQjtBQUNMOzs7QUFHckQ7QUFDNkY7QUFDN0YsZ0JBQWdCLDJHQUFVO0FBQzFCLEVBQUUsNEVBQU07QUFDUixFQUFFLGlGQUFNO0FBQ1IsRUFBRSwwRkFBZTtBQUNqQjtBQUNBO0FBQ0E7QUFDQTs7QUFFQTs7QUFFQTtBQUNBLElBQUksS0FBVSxFQUFFLFlBaUJmO0FBQ0Q7QUFDZSxnRiIsImZpbGUiOiIuL2Fzc2V0cy9zcmMvanMvZWRpdG9yLnZ1ZS5qcyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IHJlbmRlciwgc3RhdGljUmVuZGVyRm5zIH0gZnJvbSBcIi4vZWRpdG9yLnZ1ZT92dWUm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B9XG4gICAgbW9kdWxlLmhvdC5hY2NlcHQoXCIuL2VkaXRvci52dWU/dnVlJnR5cGU9dGVtcGxhdGUmaWQ9YjA0NmU4ZWMmXCIsIGZ1bmN0aW9uICgpIHtcbiAgICAgIGFwaS5yZXJlbmRlcignYjA0NmU4ZWMnLCB7XG4gICAgICAgIHJlbmRlcjogcmVuZGVyLFxuICAgICAgICBzdGF0aWNSZW5kZXJGbnM6IHN0YXRpY1JlbmRlckZuc1xuICAgICAgfSlcbiAgICB9KVxuICB9XG59XG5jb21wb25lbnQub3B0aW9ucy5fX2ZpbGUgPSBcImFzc2V0cy9zcmMvanMvZWRpdG9yLnZ1ZVwiXG5leHBvcnQgZGVmYXVsdCBjb21wb25lbnQuZXhwb3J0cyJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./assets/src/js/editor.vue\n");
|
314 |
|
315 |
/***/ }),
|
316 |
|
346 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
347 |
|
348 |
"use strict";
|
349 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue */ \"./node_modules/vue/dist/vue.common.js\");\n/* harmony import */ var vue__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _editor_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./editor.vue */ \"./assets/src/js/editor.vue\");\n\n\n\nif (document.getElementById('trp-editor-container')) {\n window.tpEditorApp = new vue__WEBPACK_IMPORTED_MODULE_0___default.a({\n components: {\n 'trp-editor': _editor_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n },\n el: '#trp-editor-container',\n data: {}\n /* Not needed for now. Maybe activate this in the future\n methods: {\n addToDictionary: function( strings, extraNodeInfo = null ) {\n this.$refs.trp_editor.addToDictionary( strings, extraNodeInfo );\n },\n setupEventListener: function( node ) {\n this.$refs.trp_editor.setupEventListener( node );\n }\n }*/\n\n });\n}//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL3RycC1lZGl0b3IuanM/ZDZlOCJdLCJuYW1lcyI6WyJkb2N1bWVudCIsImdldEVsZW1lbnRCeUlkIiwid2luZG93IiwidHBFZGl0b3JBcHAiLCJWdWUiLCJjb21wb25lbnRzIiwiRWRpdG9yIiwiZWwiLCJkYXRhIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUFBO0FBQUE7QUFBQTtBQUFBO0FBQ0E7O0FBRUEsSUFBS0EsUUFBUSxDQUFDQyxjQUFULENBQXlCLHNCQUF6QixDQUFMLEVBQXlEO0FBRXJEQyxRQUFNLENBQUNDLFdBQVAsR0FBcUIsSUFBSUMsMENBQUosQ0FBUTtBQUN6QkMsY0FBVSxFQUFFO0FBQ1Isb0JBQWVDLG1EQUFNQTtBQURiLEtBRGE7QUFJekJDLE1BQUUsRUFBRSx1QkFKcUI7QUFLekJDLFFBQUksRUFBRTtBQUVQOzs7Ozs7Ozs7O0FBUDBCLEdBQVIsQ0FBckI7QUFrQkgiLCJmaWxlIjoiLi9hc3NldHMvc3JjL2pzL3RycC1lZGl0b3IuanMuanMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgVnVlIGZyb20gJ3Z1ZSdcbmltcG9ydCBFZGl0b3IgZnJvbSAnLi9lZGl0b3IudnVlJ1xuXG5pZiAoIGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCAndHJwLWVkaXRvci1jb250YWluZXInICkgKSB7XG5cbiAgICB3aW5kb3cudHBFZGl0b3JBcHAgPSBuZXcgVnVlKHtcbiAgICAgICAgY29tcG9uZW50czoge1xuICAgICAgICAgICAgJ3RycC1lZGl0b3InIDogRWRpdG9yLFxuICAgICAgICB9LFxuICAgICAgICBlbDogJyN0cnAtZWRpdG9yLWNvbnRhaW5lcicsXG4gICAgICAgIGRhdGE6IHtcbiAgICAgICAgfSxcbiAgICAgICAvKiBOb3QgbmVlZGVkIGZvciBub3cuIE1heWJlIGFjdGl2YXRlIHRoaXMgaW4gdGhlIGZ1dHVyZVxuICAgICAgIG1ldGhvZHM6IHtcbiAgICAgICAgICAgIGFkZFRvRGljdGlvbmFyeTogZnVuY3Rpb24oIHN0cmluZ3MsIGV4dHJhTm9kZUluZm8gPSBudWxsICkge1xuICAgICAgICAgICAgICAgIHRoaXMuJHJlZnMudHJwX2VkaXRvci5hZGRUb0RpY3Rpb25hcnkoIHN0cmluZ3MsIGV4dHJhTm9kZUluZm8gKTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzZXR1cEV2ZW50TGlzdGVuZXI6IGZ1bmN0aW9uKCBub2RlICkge1xuICAgICAgICAgICAgICAgIHRoaXMuJHJlZnMudHJwX2VkaXRvci5zZXR1cEV2ZW50TGlzdGVuZXIoIG5vZGUgKTtcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSovXG4gICAgfSlcblxufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./assets/src/js/trp-editor.js\n");
|
350 |
|
351 |
/***/ }),
|
352 |
|
358 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
359 |
|
360 |
"use strict";
|
361 |
+
eval("__webpack_require__.r(__webpack_exports__);\nfunction removeUrlParameter(url, parameter) {\n var parts = url.split('?');\n\n if (parts.length >= 2) {\n var prefix = encodeURIComponent(parameter) + '=';\n var pairs = parts[1].split(/[&;]/g); //reverse iteration as may be destructive\n\n for (var i = pairs.length; i-- > 0;) {\n //idiom for string.startsWith\n if (pairs[i].lastIndexOf(prefix, 0) !== -1) {\n pairs.splice(i, 1);\n }\n }\n\n url = parts[0] + (pairs.length > 0 ? '?' + pairs.join('&') : \"\");\n return url;\n } else {\n return url;\n }\n}\n\nfunction escapeHtml(string) {\n var doc = new DOMParser().parseFromString(string, 'text/html');\n return doc.body.textContent || \"\";\n}\n\nfunction getFilename(url) {\n if (url) return url.substring(url.lastIndexOf(\"/\") + 1, url.lastIndexOf(\".\"));\n return url;\n}\n\nfunction unwrap(wrapper) {\n var docFrag = document.createDocumentFragment();\n\n while (wrapper.firstChild) {\n var child = wrapper.removeChild(wrapper.firstChild);\n docFrag.appendChild(child);\n }\n\n wrapper.parentNode.replaceChild(docFrag, wrapper);\n}\n\nfunction arrayContainsItem(array, item) {\n var i;\n var length = array.length;\n\n for (i = length - 1; i >= 0; i--) {\n if (array[i] === item) {\n return true;\n }\n }\n\n return false;\n} //Adds or updates an existing query parameter in an url\n\n\nfunction updateUrlParameter(uri, key, value) {\n var regex = new RegExp(\"([?&])\" + key + \"=.*?(&|#|$)\", \"i\");\n if (uri.match(regex)) return uri.replace(regex, '$1' + key + \"=\" + value + '$2');else {\n var hash = '';\n\n if (uri.indexOf('#') !== -1) {\n hash = uri.replace(/.*#/, '#');\n uri = uri.replace(/#.*/, '');\n }\n\n var separator = uri.indexOf('?') !== -1 ? \"&\" : \"?\";\n return uri + separator + key + \"=\" + value + hash;\n }\n} //Given an arbitrary URL, returns an array with the URL parameters\n\n\nfunction getUrlParameters(url) {\n var query = url.split('?');\n if (!query[1]) return null;\n var vars = query[1].split('&'),\n query_string = {},\n i;\n\n for (i = 0; i < vars.length; i++) {\n var pair = vars[i].split('='),\n key = decodeURIComponent(pair[0]),\n value = decodeURIComponent(pair[1]);\n if (typeof query_string[key] === 'undefined') query_string[key] = decodeURIComponent(value);else if (typeof query_string[key] === 'undefined') query_string[key] = [query_string[key], decodeURIComponent(value)];else query_string[key].push(decodeURIComponent(value));\n }\n\n return query_string;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n removeUrlParameter: removeUrlParameter,\n updateUrlParameter: updateUrlParameter,\n getUrlParameters: getUrlParameters,\n escapeHtml: escapeHtml,\n getFilename: getFilename,\n arrayContainsItem: arrayContainsItem,\n unwrap: unwrap\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vLi9hc3NldHMvc3JjL2pzL3V0aWxzLmpzPzRkOTAiXSwibmFtZXMiOlsicmVtb3ZlVXJsUGFyYW1ldGVyIiwidXJsIiwicGFyYW1ldGVyIiwicGFydHMiLCJzcGxpdCIsImxlbmd0aCIsInByZWZpeCIsImVuY29kZVVSSUNvbXBvbmVudCIsInBhaXJzIiwiaSIsImxhc3RJbmRleE9mIiwic3BsaWNlIiwiam9pbiIsImVzY2FwZUh0bWwiLCJzdHJpbmciLCJkb2MiLCJET01QYXJzZXIiLCJwYXJzZUZyb21TdHJpbmciLCJib2R5IiwidGV4dENvbnRlbnQiLCJnZXRGaWxlbmFtZSIsInN1YnN0cmluZyIsInVud3JhcCIsIndyYXBwZXIiLCJkb2NGcmFnIiwiZG9jdW1lbnQiLCJjcmVhdGVEb2N1bWVudEZyYWdtZW50IiwiZmlyc3RDaGlsZCIsImNoaWxkIiwicmVtb3ZlQ2hpbGQiLCJhcHBlbmRDaGlsZCIsInBhcmVudE5vZGUiLCJyZXBsYWNlQ2hpbGQiLCJhcnJheUNvbnRhaW5zSXRlbSIsImFycmF5IiwiaXRlbSIsInVwZGF0ZVVybFBhcmFtZXRlciIsInVyaSIsImtleSIsInZhbHVlIiwicmVnZXgiLCJSZWdFeHAiLCJtYXRjaCIsInJlcGxhY2UiLCJoYXNoIiwiaW5kZXhPZiIsInNlcGFyYXRvciIsImdldFVybFBhcmFtZXRlcnMiLCJxdWVyeSIsInZhcnMiLCJxdWVyeV9zdHJpbmciLCJwYWlyIiwiZGVjb2RlVVJJQ29tcG9uZW50IiwicHVzaCJdLCJtYXBwaW5ncyI6IkFBQUE7QUFBQSxTQUFTQSxrQkFBVCxDQUE2QkMsR0FBN0IsRUFBa0NDLFNBQWxDLEVBQThDO0FBQzFDLE1BQUlDLEtBQU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3JhcFxufVxuIl0sInNvdXJjZVJvb3QiOiIifQ==\n//# sourceURL=webpack-internal:///./assets/src/js/utils.js\n");
|
362 |
|
363 |
/***/ }),
|
364 |
|
690 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
691 |
|
692 |
"use strict";
|
693 |
+
eval("__webpack_require__.r(__webpack_exports__);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['languageNames', 'editorStrings', 'paidVersion'],\n methods: {\n showLanguagesMessage: function showLanguagesMessage() {\n if (Object.keys(this.languageNames).length == 1) return true;\n return false;\n },\n showUpsellMessage: function showUpsellMessage() {\n if (this.paidVersion != 'true') return true;\n return false;\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL2V4dHJhLWNvbnRlbnQudnVlP2ViYmQiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUE2QkE7QUFDQSxVQUNBLGVBREEsRUFFQSxlQUZBLEVBR0EsYUFIQSxDQURBO0FBTUE7QUFDQSx3QkFEQSxrQ0FDQTtBQUNBLHVEQUNBO0FBRUE7QUFDQSxLQU5BO0FBT0EscUJBUEEsK0JBT0E7QUFDQSxzQ0FDQTtBQUVBO0FBQ0E7QUFaQTtBQU5BIiwiZmlsZSI6Ii4vbm9kZV9tb2R1bGVzL2JhYmVsLWxvYWRlci9saWIvaW5kZXguanM/IS4vbm9kZV9tb2R1bGVzL3Z1ZS1sb2FkZXIvbGliL2luZGV4LmpzPyEuL2Fzc2V0cy9zcmMvanMvY29tcG9uZW50cy9leHRyYS1jb250ZW50L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oIHRoaXMubGFuZ3VhZ2VOYW1lcyApLmxlbmd0aCA9PSAxIClcbiAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxuXG4gICAgICAgICAgICByZXR1cm4gZmFsc2VcbiAgICAgICAgfSxcbiAgICAgICAgc2hvd1Vwc2VsbE1lc3NhZ2UoKXtcbiAgICAgICAgICAgIGlmKCB0aGlzLnBhaWRWZXJzaW9uICE9ICd0cnVlJyApXG4gICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcblxuICAgICAgICAgICAgcmV0dXJuIGZhbHNlXG4gICAgICAgIH1cbiAgICB9XG59XG48L3NjcmlwdD5cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/extra-content.vue?vue&type=script&lang=js&\n");
|
694 |
|
695 |
/***/ }),
|
696 |
|
702 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
703 |
|
704 |
"use strict";
|
705 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../utils */ \"./assets/src/js/utils.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_1__);\n//\n//\n//\n//\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['dictionary', 'settings', 'iframe', 'dataAttributes', 'mergeRules', 'ajax_url', 'nonces', 'mergeData', 'editorStrings', 'currentLanguage'],\n data: function data() {\n return {\n hoveredStringId: '',\n hoveredStringSelector: '',\n hoveredTarget: '',\n counter: 0\n };\n },\n methods: {\n showPencilIcon: function showPencilIcon(element) {\n if (!this.dictionary || this.dictionary.length < 1) return;\n var self = this;\n var target = element.target;\n var relatedNode, relatedNodeAttr, position, stringSelector, stringId, mergeOrSplit; //for these tag names we need to insert our HTML before the element and not inside of it\n //@TODO: add/research more\n\n var beforePosition = ['IMG', 'INPUT', 'TEXTAREA'];\n if (self.hoveredTarget != '' && target.isSameNode(self.hoveredTarget)) return; //if other icons are showing, remove them\n\n self.removePencilIcon(); //remove highlight class\n\n self.removeHighlight(false); //figure out where to insert extra HTML\n\n if (beforePosition.includes(target.tagName)) position = 'beforebegin';else position = 'afterbegin'; //insert button HTML\n\n target.insertAdjacentHTML(position, this.getTrpSpan()); //inserted node\n\n var trpSpan = self.iframe.getElementsByTagName('trp-span')[0];\n if (!trpSpan) return; //get node info based on where we inserted our button\n\n if (position == 'afterbegin') relatedNode = trpSpan.parentNode;else relatedNode = trpSpan.nextElementSibling; //edit string button\n\n var editButton = this.iframe.querySelector('trp-edit');\n var foundNonGettext = false;\n self.dataAttributes.forEach(function (baseSelector) {\n self.$parent.prepareSelectorStrings(baseSelector).forEach(function (selector) {\n relatedNodeAttr = relatedNode.getAttribute(selector);\n\n if (relatedNodeAttr) {\n stringId = relatedNodeAttr;\n stringSelector = selector;\n\n if (!stringSelector.includes('data-trpgettextoriginal')) {\n // includes at least one data-base-selector that is not gettext. Useful for determining edit pencil color\n foundNonGettext = true;\n }\n }\n });\n });\n self.hoveredStringSelector = stringSelector;\n self.hoveredStringId = stringId;\n self.hoveredTarget = target; // show green edit pencil\n\n if (foundNonGettext) {\n editButton.classList.remove('trp-gettext-pencil');\n } else {\n editButton.classList.add('trp-gettext-pencil');\n } //figure out if split or merge is available\n\n\n mergeOrSplit = self.checkMergeOrSplit(target); //fit inside view\n\n self.fitPencilIconInsideView(trpSpan, target, mergeOrSplit);\n\n if (!self.mergeData.includes(stringId)) {\n editButton.style.display = 'inline-block'; //add class to highlight text\n\n if (!target.classList.contains('trp-highlight')) target.className += ' trp-highlight';\n } //merge or split event listeners\n\n\n if (mergeOrSplit != 'none' && !self.mergeData.includes(stringId)) {\n var button = this.iframe.querySelector('trp-' + mergeOrSplit);\n button.style.display = 'inline-block'; //setup event listeners for merge and split\n\n if (mergeOrSplit == 'split') button.addEventListener('click', self.splitHandler);else if (mergeOrSplit == 'merge') button.addEventListener('click', self.mergeHandler);\n }\n\n editButton.addEventListener('click', self.editHandler);\n },\n editHandler: function editHandler(event) {\n event.preventDefault();\n event.stopPropagation();\n if (this.$parent.mergingString) this.removeHighlight(true);\n this.$parent.mergeData = [];\n this.$parent.selectedString = this.$parent.getStringIndex(this.hoveredStringSelector, this.hoveredStringId);\n this.$parent.translationNotLoadedYet = this.$parent.selectedString === null;\n jQuery('#trp-string-categories').select2('close');\n },\n splitHandler: function splitHandler(event) {\n event.preventDefault();\n event.stopPropagation();\n this.$parent.mergingString = false;\n var split = confirm(this.editorStrings.split_confirmation);\n if (split === false) return;\n var strings = [];\n var hoveredStringIndex = this.$parent.getStringIndex(this.hoveredStringSelector, this.hoveredStringId);\n strings.push(this.dictionary[hoveredStringIndex].original);\n var data = new FormData();\n data.append('action', 'trp_split_translation_block');\n data.append('security', this.nonces['splittbnonce']);\n data.append('strings', JSON.stringify(strings));\n var self = this;\n axios__WEBPACK_IMPORTED_MODULE_1___default.a.post(this.ajax_url, data).then(function (response) {\n window.location.reload();\n })[\"catch\"](function (error) {\n console.log(error);\n });\n },\n mergeHandler: function mergeHandler(event) {\n event.preventDefault();\n event.stopPropagation();\n var self = this;\n var parent,\n isDeprecated = null,\n deprecatedString = null,\n stringId;\n self.$parent.mergingString = true; //remove classes\n\n var previouslyHighlighted = this.iframe.getElementsByClassName('trp-create-translation-block');\n\n if (previouslyHighlighted.length > 0) {\n var i;\n\n for (i = 0; i < previouslyHighlighted.length; i++) {\n previouslyHighlighted[i].classList.remove('trp-highlight');\n previouslyHighlighted[i].classList.remove('trp-create-translation-block');\n }\n }\n\n parent = self.hoveredTarget.closest(self.mergeRules.top_parents); //remove highlight classes from children\n\n parent.querySelectorAll('.trp-highlight').forEach(function (node) {\n node.classList.remove('trp-highlight');\n }); //determine the strings that are being prepared for merging (no gettext)\n\n self.$parent.mergeData = [];\n parent.querySelectorAll('[data-trp-translate-id]').forEach(function (node) {\n stringId = node.getAttribute('data-trp-translate-id');\n if (stringId) self.$parent.mergeData.push(stringId);\n }); //check if we have existing translations for this block\n\n isDeprecated = parent.getAttribute('data-trp-translate-id-deprecated');\n if (isDeprecated) deprecatedString = self.$parent.getStringIndex('data-trp-translate-id', isDeprecated);\n parent.setAttribute('data-trp-translate-id', 'trp_creating_translation_block');\n parent.className += ' trp-highlight trp-create-translation-block'; //create a placeholder string for the dictionary\n\n var dummyString = {\n type: 'regular',\n attribute: '',\n block_type: '1',\n dbID: 'create_translation_block' + this.counter,\n original: self.stripEditorData(parent),\n selector: 'data-trp-translate-id',\n translationsArray: {}\n };\n this.counter++;\n var dummyTranslations = {};\n var defaultLanguage = this.settings['default-language']; //populate translationsArray\n\n self.settings['translation-languages'].forEach(function (languageCode) {\n if (languageCode != defaultLanguage) {\n dummyTranslations = {\n block_type: '1',\n id: languageCode,\n status: '0',\n translated: '',\n editedTranslation: '' //populate existing translations\n\n };\n\n if (deprecatedString) {\n dummyTranslations.translated = self.dictionary[deprecatedString].translationsArray[languageCode].translated;\n dummyTranslations.editedTranslation = self.dictionary[deprecatedString].translationsArray[languageCode].translated;\n }\n\n dummyString.translationsArray[languageCode] = dummyTranslations;\n }\n }); //add item to dictionary and set selectedString as the index\n\n self.$parent.selectedString = self.dictionary.push(dummyString) - 1;\n },\n removePencilIcon: function removePencilIcon() {\n var icons = this.iframe.querySelectorAll('trp-span');\n\n if (icons.length > 0) {\n icons.forEach(function (icon) {\n icon.remove();\n });\n }\n },\n checkMergeOrSplit: function checkMergeOrSplit(target) {\n if (!this.mergeRules || !this.mergeRules.self_object_type || !this.mergeRules.top_parents) return 'none';\n var hoveredStringIndex = this.$parent.getStringIndex(this.hoveredStringSelector, this.hoveredStringId);\n if (!hoveredStringIndex) hoveredStringIndex = this.$parent.selectedString;\n if (typeof this.dictionary[hoveredStringIndex] != 'undefined' && this.dictionary[hoveredStringIndex].block_type == 1) return 'split';\n var self = this;\n var parentNode, childNodes, incompatibleSiblings;\n var action = 'none'; //check if target is the correct object type\n\n this.mergeRules.self_object_type.forEach(function (thisObjectType) {\n if (target.tagName.toLowerCase() == thisObjectType) {\n //get parent based on merge rules\n parentNode = target.closest(self.mergeRules.top_parents);\n\n if (parentNode != null) {\n //get childrens that are of the correct type based on parent,\n self.mergeRules.self_object_type.forEach(function (selfObjectType) {\n childNodes = parentNode.querySelectorAll(selfObjectType);\n\n if (childNodes.length > 1) {\n //check if between the children we have incompatible siblings (gettext or dynamic strings)\n incompatibleSiblings = parentNode.querySelectorAll(self.mergeRules.incompatible_siblings);\n if (incompatibleSiblings.length == 0) action = 'merge';\n }\n });\n }\n }\n });\n return action;\n },\n stripEditorData: function stripEditorData(target) {\n var copy = target.cloneNode(true);\n var self = this;\n var buttons = copy.querySelector('trp-span');\n if (buttons) buttons.remove();\n /** In case we are in secondary language and the strings that will be merged are already translated,\n * we must use the originals of these strings instead of what is in the preview iframe HTML page at this point\n */\n\n if (this.settings['default-language'] != this.currentLanguage) {\n copy.querySelectorAll('[data-trp-translate-id]').forEach(function (node) {\n var stringId = node.getAttribute('data-trp-translate-id');\n var index = self.$parent.getStringIndex('data-trp-translate-id', stringId);\n\n if (self.dictionary[index].translationsArray[self.currentLanguage] && self.dictionary[index].translationsArray[self.currentLanguage].status != 0) {\n node.innerHTML = node.innerText.replace(self.dictionary[index].translationsArray[self.currentLanguage].translated, self.dictionary[index].original);\n }\n });\n }\n\n copy.querySelectorAll('translate-press, trp-wrap, trp-highlight').forEach(function (node) {\n _utils__WEBPACK_IMPORTED_MODULE_0__[\"default\"].unwrap(node);\n });\n var attributesToReplace = ['href', 'target'];\n attributesToReplace.forEach(function (attribute) {\n copy.querySelectorAll('[data-trp-original-' + attribute + ']').forEach(function (node) {\n var dataTrpOriginalAttribute = 'data-trp-original-' + attribute;\n node.setAttribute(attribute, node.getAttribute(dataTrpOriginalAttribute));\n node.removeAttribute(dataTrpOriginalAttribute);\n });\n });\n var node;\n var otherAttributes = ['data-trp-placeholder', 'data-trp-unpreviewable'];\n var attributesToRemove = otherAttributes.concat(self.$parent.prepareSelectorStrings('data-trp-translate-id'), self.$parent.prepareSelectorStrings('data-trp-node-group'), self.$parent.prepareSelectorStrings('data-trp-node-description'));\n attributesToRemove.forEach(function (attribute) {\n copy.querySelectorAll('[' + attribute + ']').forEach(function (node) {\n node.removeAttribute(attribute);\n });\n });\n return copy.innerHTML;\n },\n removeHighlight: function removeHighlight() {\n var removeFromBlocks = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n var previouslyHighlighted = this.iframe.getElementsByClassName('trp-highlight');\n\n if (previouslyHighlighted.length > 0) {\n var i;\n\n for (i = 0; i < previouslyHighlighted.length; i++) {\n if (removeFromBlocks) previouslyHighlighted[i].classList.remove('trp-highlight');else if (!removeFromBlocks && !previouslyHighlighted[i].classList.contains('trp-create-translation-block')) previouslyHighlighted[i].classList.remove('trp-highlight');\n }\n }\n\n return true;\n },\n fitPencilIconInsideView: function fitPencilIconInsideView(pencil, target, mergeOrSplit) {\n // 'slick-slide-image' is a fix for elementor image slider to display pencil icon\n // 'attachment-woocommerce_thumbnail' - is a fix for WooCommerce product images on shop page (Hestia theme and others)\n // 'woocommerce-placeholder' - is a fix for WooCommerce product placeholder image on shop page (Hestia theme and others)\n var forcePencilDisplayClasses = ['slick-slide-image', 'attachment-woocommerce_thumbnail', 'woocommerce-placeholder'];\n var forcePencilDisplay = false;\n\n if (target.tagName === 'IMG') {\n var i;\n\n for (i = 0; i < forcePencilDisplayClasses.length; i++) {\n if (target.classList.contains(forcePencilDisplayClasses[i])) {\n forcePencilDisplay = true;\n break;\n }\n }\n }\n\n var rect = target.getBoundingClientRect();\n\n if (forcePencilDisplay || rect.left < 35) {\n var margin;\n if (mergeOrSplit != 'none') margin = 60;else margin = 30;\n pencil.setAttribute('style', 'margin-left: ' + margin + 'px !important');\n }\n },\n getTrpSpan: function getTrpSpan() {\n return '<trp-span><trp-merge title=\"' + this.editorStrings.merge + '\" class=\"trp-icon trp-merge dashicons dashicons-arrow-up-alt\"></trp-merge><trp-split title=\"' + this.editorStrings.split + '\" class=\"trp-icon trp-split dashicons dashicons-arrow-down-alt\"></trp-split><trp-edit title=\"' + this.editorStrings.edit + '\" class=\"trp-icon trp-edit-translation dashicons dashicons-edit\"></trp-edit></trp-span>';\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL2hvdmVyLWFjdGlvbnMudnVlPzg3MjMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7QUFLQTtBQUNBO0FBRUE7QUFDQSxVQUNBLFlBREEsRUFFQSxVQUZBLEVBR0EsUUFIQSxFQUlBLGdCQUpBLEVBS0EsWUFMQSxFQU1BLFVBTkEsRUFPQSxRQVBBLEVBUUEsV0FSQSxFQVNBLGVBVEEsRUFVQSxpQkFWQSxDQURBO0FBYUEsTUFiQSxrQkFhQTtBQUNBO0FBQ0EseUJBREE7QUFFQSwrQkFGQTtBQUdBLHVCQUhBO0FBSUE7QUFKQTtBQU1BLEdBcEJBO0FBcUJBO0FBQ0Esa0JBREEsMEJBQ0EsT0FEQSxFQUNBO0FBQ0EsMERBQ0E7QUFFQTtBQUNBO0FBQ0EseUZBTkEsQ0FRQTtBQUNBOztBQUNBO0FBRUEsNkVBQ0EsT0FiQSxDQWVBOztBQUNBLDhCQWhCQSxDQWtCQTs7QUFDQSxrQ0FuQkEsQ0FxQkE7O0FBQ0EsbURBQ0EseUJBREEsS0FHQSx3QkF6QkEsQ0EyQkE7O0FBQ0EsNkRBNUJBLENBOEJBOztBQUNBO0FBRUEsb0JBQ0EsT0FsQ0EsQ0FvQ0E7O0FBQ0Esb0NB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cm9tICcuLi91dGlscydcbiAgICBpbXBvcnQgYXhpb3MgZnJvbSAnYXhpb3MnXG5cbiAgICBleHBvcnQgZGVmYXVsdHtcbiAgICAgICAgcHJvcHM6W1xuICAgICAgICAgICAgJ2RpY3Rpb25hcnknLFxuICAgICAgICAgICAgJ3NldHRpbmdzJyxcbiAgICAgICAgICAgICdpZnJhbWUnLFxuICAgICAgICAgICAgJ2RhdGFBdHRyaWJ1dGVzJyxcbiAgICAgICAgICAgICdtZXJnZVJ1bGVzJyxcbiAgICAgICAgICAgICdhamF4X3VybCcsXG4gICAgICAgICAgICAnbm9uY2VzJyxcbiAgICAgICAgICAgICdtZXJnZURhdGEnLFxuICAgICAgICAgICAgJ2VkaXRvclN0cmluZ3MnLFxuICAgICAgICAgICAgJ2N1cnJlbnRMYW5ndWFnZSdcbiAgICAgICAgXSxcbiAgICAgICAgZGF0YSgpe1xuICAgICAgICAgICAgcmV0dXJue1xuICAgICAgICAgICAgICAgIGhvdmVyZWRTdHJpbmdJZCAgICAgICA6ICcnLFxuICAgICAgICAgICAgICAgIGhvdmVyZWRTdHJpbmdTZWxlY3RvciA6ICcnLFxuICAgICAgICAgICAgICAgIGhvdmVyZWRUYXJnZXQgICAgICAgICA6ICcnLFxuICAgICAgICAgICAgICAgIGNvdW50ZXIgICAgICAgICAgICAgICA6IDBcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWV0aG9kczp7XG4gICAgICAgICAgICBzaG93UGVuY2lsSWNvbiggZWxlbWVudCApe1xuICAgICAgICAgICAgICAgIGlmKCAhdGhpcy5kaWN0aW9uYXJ5IHx8IHRoaXMuZGljdGlvbmFyeS5sZW5ndGggPCAxIClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXG5cbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcbiAgICAgICAgICAgICAgICBsZXQgdGFyZ2V0ID0gZWxlbWVudC50YXJnZXRcbiAgICAgICAgICAgICAgICBsZXQgc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mJlZ2luJ1xuXG4gICAgICAgICAgICAgICAgLy9pbnNlcnQgYnV0dG9uIEhUTUxcbiAgICAgICAgICAgICAgICB0YXJnZXQuaW5zZXJ0QWRqYWNlbnRIVE1MKCBwb3NpdGlvbiwgdGhpcy5nZXRUcnBTcGFuKCkgKVxuXG4gICAgICAgICAgICAgICAgLy9pbnNlcnRlZCBub2RlXG4gICAgICAgICAgICAgICAgbGV0IHRycFNwYW4gPSBzZWxmLmlmcmFtZS5nZXRFbGVtZW50c0J5VGFnTmFtZSggJ3RycC1zcGFuJyApWzBdXG5cbiAgICAgICAgICAgICAgICBpZiggIXRycFNwYW4gKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cblxuICAgICAgICAgICAgICAgIC8vZ2V0IG5vZGUgaW5mbyBiYXNlZCBvbiB3aGVyZSB3ZSBpbnNlcnRlZCBvdXIgYnV0dG9uXG4gICAgICAgICAgICAgICAgaWYoIHBvc2l0aW9uID09ICdhZnRlcmJlZ2luJyApXG4gICAgICAgICAgICAgICAgICAgIHJlbGF0ZWROb2RlID0gdHJwU3Bhbi5wYXJlbnROb2RlXG4gICAgICAgICAgICAgICAgZWxzZVxuICAgICAgICAgICAgICAgICAgICByZWxhdGVkTm9kZSA9IHRycFNwYW4ubmV4dEVsZW1lbnRTaWJsaW5nXG5cbiAgICAgICAgICAgICAgICAvL2VkaXQgc3RyaW5nIGJ1dHRvblxuICAgICAgICAgICAgICAgIGxldCBlZGl0QnV0dG9uID0gdGhpcy5pZnJhbWUucXVlcnlTZWxlY3RvciggJ3RycC1lZGl0JyApXG4gICAgICAgICAgICAgICAgbGV0IGZvdW5kTm9uR2V0dGV4dCA9IGZhbHNlXG5cbiAgICAgICAgICAgICAgICBzZWxmLmRhdGFBdHRyaWJ1dGVzLmZvckVhY2goIGZ1bmN0aW9uKCBiYXNlU2VsZWN0b3IgKSB7XG5cbiAgICAgICAgICAgICAgICAgICAgc2VsZi4kcGFyZW50LnByZXBhcmVTZWxlY3RvclN0cmluZ3MoIGJhc2VTZWxlY3RvciApLmZvckVhY2goIGZ1bmN0aW9uKCBzZWxlY3RvciApIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgcmVsYXRlZE5vZGVBdHRyID0gcmVsYXRlZE5vZGUuZ2V0QXR0cmlidXRlKCBzZWxlY3RvciApXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggcmVsYXRlZE5vZGVBdHRyICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZ0lkID0gcmVsYXRlZE5vZGVBdHRyXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RyaW5nU2VsZWN0b3IgPSBzZWxlY3RvclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggISBzdHJpbmdTZWxlY3Rvci5pbmNsdWRlcyggJ2RhdGEtdHJwZ2V0dGV4dG9yaWdpbmFsJyApICl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluY2x1ZGVzIGF0IGxlYXN0IG9uZSBkYXRhLWJhc2Utc2VsZWN0b3IgdGhhdCBpcyBub3QgZ2V0dGV4dC4gVXNlZnVsIGZvciBkZXRlcm1pbmluZyBlZGl0IHBlbmNpbCBjb2xvclxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZE5vbkdldHRleHQgPSB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICBzZWxmLmhvdmVyZWRTdHJpbmdTZWxlY3RvciA9IHN0cmluZ1NlbGVjdG9yXG4gICAgICAgICAgICAgICAgc2VsZi5ob3ZlcmVkU3RyaW5nSWQgICAgICAgPSBzdHJpbmdJZFxuICAgICAgICAgICAgICAgIHNlbGYuaG92ZXJlZFRhcmdldCAgICAgICAgID0gdGFyZ2V0XG5cbiAgICAgICAgICAgICAgICAvLyBzaG93IGdyZWVuIGVkaXQgcGVuY2lsXG4gICAgICAgICAgICAgICAgaWYgKCBmb3VuZE5vbkdldHRleHQgKXtcbiAgICAgICAgICAgICAgICAgICAgZWRpdEJ1dHRvbi5jbGFzc0xpc3QucmVtb3ZlKCAndHJwLWdldHRleHQtcGVuY2lsJyApXG4gICAgICAgICAgICAgICAgfWVsc2V7XG4gICAgICAgICAgICAgICAgICAgIGVkaXRCdXR0b24uY2xhc3NMaXN0LmFkZCggJ3RycC1nZXR0ZXh0LXBlbmNpbCcgKVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIC8vZmlndXJlIG91dCBpZiBzcGxpdCBvciBtZXJnZSBpcyBhdmFpbGFibGVcbiAgICAgICAgICAgICAgICBtZXJnZU9yU3BsaXQgPSBzZWxmLmNoZWNrTWVyZ2VPclNwbGl0KCB0YXJnZXQgKVxuXG4gICAgICAgICAgICAgICAgLy9maXQgaW5zaWRlIHZpZXdcbiAgICAgICAgICAgICAgICBzZWxmLmZpdFBlbmNpbEljb25JbnNpZGVWaWV3KCB0cnBTcGFuLCB0YXJnZXQsIG1lcmdlT3JTcGxpdCApXG5cbiAgICAgICAgICAgICAgICBpZiggIXNlbGYubWVyZ2VEYXRhLmluY2x1ZGVzKCBzdHJpbmdJZCApICkge1xuICAgICAgICAgICAgICAgICAgICBlZGl0QnV0dG9uLnN0eWxlLmRpc3BsYXkgPSAnaW5saW5lLWJsb2NrJ1xuXG4gICAgICAgICAgICAgICAgICAgIC8vYWRkIGNsYXNzIHRvIGhpZ2hsaWdodCB0ZXh0XG4gICAgICAgICAgICAgICAgICAgIGlmKCAhdGFyZ2V0LmNsYXNzTGlzdC5jb250YWlucyggJ3RycC1oaWdobGlnaHQnICkgKVxuICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0LmNsYXNzTmFtZSArPSAnIHRycC1oaWdobGlnaHQnXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy9tZXJnZSBvciBzcGxpdCBldmVudCBsaXN0ZW5lcnNcbiAgICAgICAgICAgICAgICBpZiggbWVyZ2VPclNwbGl0ICE9ICdub25lJyAmJiAhc2VsZi5tZXJnZURhdGEuaW5jbHVkZXMoIHN0cmluZ0lkICkgKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBidXR0b24gPSB0aGlzLmlmcmFtZS5xdWVyeVNlbGVjdG9yKCAndHJwLScgKyBtZXJnZU9yU3BsaXQgKVxuXG4gICAgICAgICAgICAgICAgICAgIGJ1dHRvbi5zdHlsZS5kaXNwbGF5ID0gJ2lubGluZS1ibG9jaydcblxuICAgICAgICAgICAgICAgICAgICAvL3NldHVwIGV2ZW50IGxpc3RlbmVycyBmb3IgbWVyZ2UgYW5kIHNwbGl0XG4gICAgICAgICAgICAgICAgICAgIGlmKCBtZXJnZU9yU3BsaXQgPT0gJ3NwbGl0JyApXG4gICAgICAgICAgICAgICAgICAgICAgICBidXR0b24uYWRkRXZlbnRMaXN0ZW5lciggJ2NsaWNrJywgc2VsZi5zcGxpdEhhbmRsZXIgKVxuICAgICAgICAgICAgICAgICAgICBlbHNlIGlmKCBtZXJnZU9yU3BsaXQgPT0gJ21lcmdlJyApXG4gICAgICAgICAgICAgICAgICAgICAgICBidXR0b24uYWRkRXZlbnRMaXN0ZW5lciggJ2NsaWNrJywgc2VsZi5tZXJnZUhhbmRsZXIgKVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGVkaXRCdXR0b24uYWRkRXZlbnRMaXN0ZW5lciggJ2NsaWNrJywgc2VsZi5lZGl0SGFuZGxlciApXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZWRpdEhhbmRsZXIoIGV2ZW50ICl7XG4gICAgICAgICAgICAgICAgZXZlbnQucHJldmVudERlZmF1bHQoKVxuICAgICAgICAgICAgICAgIGV2ZW50LnN0b3BQcm9wYWdhdGlvbigpXG5cbiAgICAgICAgICAgICAgICBpZiggdGhpcy4kcGFyZW50Lm1lcmdpbmdTdHJpbmcgKVxuICAgICAgICAgICAgICAgICAgICB0aGlzLnJlbW92ZUhpZ2hsaWdodCggdHJ1ZSApXG5cbiAgICAgICAgICAgICAgICB0aGlzLiRwYXJlbnQubWVyZ2VEYXRhICAgICAgPSBbXVxuXG4gICAgICAgICAgICAgICAgdGhpcy4kcGFyZW50LnNlbGVjdGVkU3RyaW5nID0gdGhpcy4kcGFyZW50LmdldFN0cmluZ0luZGV4KCB0aGlzLmhvdmVyZWRTdHJpbmdTZWxlY3RvciwgdGhpcy5ob3ZlcmVkU3RyaW5nSWQgKVxuXG4gICAgICAgICAgICAgICAgdGhpcy4kcGFyZW50LnRyYW5zbGF0aW9uTm90TG9hZGVkWWV0ICA9ICggdGhpcy4kcGFyZW50LnNlbGVjdGVkU3RyaW5nID09PSBudWxsIClcblxuICAgICAgICAgICAgICAgIGpRdWVyeSggJyN0cnAtc3RyaW5nLWNhdGVnb3JpZXMnICkuc2VsZWN0MiggJ2Nsb3NlJyApXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3BsaXRIYW5kbGVyKCBldmVudCApIHtcbiAgICAgICAgICAgICAgICBldmVudC5wcmV2ZW50RGVmYXVsdCgpXG4gICAgICAgICAgICAgICAgZXZlbnQuc3RvcFByb3BhZ2F0aW9uKClcbiAgICAgICAgICAgICAgICB0aGlzLiRwYXJlbnQubWVyZ2luZ1N0cmluZyA9IGZhbHNlXG5cbiAgICAgICAgICAgICAgICBsZXQgc3BsaXQgPSBjb25maXJtKCB0aGlzLmVkaXRvclN0cmluZ3Muc3BsaXRfY29uZmlybWF0aW9uIClcblxuICAgICAgICAgICAgICAgIGlmKCBzcGxpdCA9PT0gZmFsc2UgKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cblxuICAgICAgICAgICAgICAgIGxldCBzdHJpbmdzID0gW11cbiAgICAgICAgICAgICAgICBsZXQgaG92ZXJlZFN0cmluZ0luZGV4ID0gdGhpcy4kcGFyZW50LmdldFN0cmluZ0luZGV4KCB0aGlzLmhvdmVyZWRTdHJpbmdTZWxlY3RvciwgdGhpcy5ob3ZlcmVkU3RyaW5nSWQgKVxuICAgICAgICAgICAgICAgIHN0cmluZ3MucHVzaCggdGhpcy5kaWN0aW9uYXJ5WyBob3ZlcmVkU3RyaW5nSW5kZXggXS5vcmlnaW5hbCApXG5cbiAgICAgICAgICAgICAgICBsZXQgZGF0YSA9IG5ldyBGb3JtRGF0YSgpXG4gICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCAnYWN0aW9uJywgJ3RycF9zcGxpdF90cmFuc2xhdGlvbl9ibG9jaycgKVxuICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCggJ3NlY3VyaXR5JywgdGhpcy5ub25jZXNbJ3NwbGl0dGJub25jZSddIClcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdzdHJpbmdzJywgSlNPTi5zdHJpbmdpZnkoIHN0cmluZ3MgKSApXG5cbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcblxuICAgICAgICAgICAgICAgIGF4aW9zLnBvc3QodGhpcy5hamF4X3VybCwgZGF0YSlcbiAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICB3aW5kb3cubG9jYXRpb24ucmVsb2FkKClcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgLmNhdGNoKGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBtZXJnZUhhbmRsZXIoIGV2ZW50ICkge1xuICAgICAgICAgICAgICAgIGV2ZW50LnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICAgICAgICBldmVudC5zdG9wUHJvcGFnYXRpb24oKVxuXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXG4gICAgICAgICAgICAgICAgbGV0IHBhcmVudCwgaXNEZXByZWNhdGVkID0gbnVsbCwgZGVwcmVjYXRlZFN0cmluZyA9IG51bGwsIHN0cmluZ0lkXG5cbiAgICAgICAgICAgICAgICBzZWxmLiRwYXJlbnQubWVyZ2luZ1N0cmluZyA9IHRydWVcblxuICAgICAgICAgICAgICAgIC8vcmVtb3ZlIGNsYXNzZXNcbiAgICAgICAgICAgICAgICBsZXQgcHJldmlvdXNseUhpZ2hsaWdodGVkID0gdGhpcy5pZnJhbWUuZ2V0RWxlbWVudHNCeUNsYXNzTmFtZSggJ3RycC1jcmVhdGUtdHJhbnNsYXRpb24tYmxvY2snIClcblxuICAgICAgICAgICAgICAgIGlmKCBwcmV2aW91c2x5SGlnaGxpZ2h0ZWQubGVuZ3RoID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IGlcblxuICAgICAgICAgICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IHByZXZpb3VzbHlIaWdobGlnaHRlZC5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHByZXZpb3VzbHlIaWdobGlnaHRlZFtpXS5jbGFzc0xpc3QucmVtb3ZlKCAndHJwLWhpZ2hsaWdodCcgKVxuICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNseUhpZ2hsaWdodGVkW2ldLmNsYXNzTGlzdC5yZW1vdmUoICd0cnAtY3JlYXRlLXRyYW5zbGF0aW9uLWJsb2NrJyApXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICBwYXJlbnQgPSBzZWxmLmhvdmVyZWRUYXJnZXQuY2xvc2VzdCggc2VsZi5tZXJnZVJ1bGVzLnRvcF9wYXJlbnRzIClcblxuICAgICAgICAgICAgICAgIC8vcmVtb3ZlIGhpZ2hsaWdodCBjbGFzc2VzIGZyb20gY2hpbGRyZW5cbiAgICAgICAgICAgICAgICBwYXJlbnQucXVlcnlTZWxlY3RvckFsbCggJy50cnAtaGlnaGxpZ2h0JyApLmZvckVhY2goIGZ1bmN0aW9uKG5vZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgbm9kZS5jbGFzc0xpc3QucmVtb3ZlKCAndHJwLWhpZ2hsaWdodCcgKVxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAvL2RldGVybWluZSB0aGUgc3RyaW5ncyB0aGF0IGFyZSBiZWluZyBwcmVwYXJlZCBmb3IgbWVyZ2luZyAobm8gZ2V0dGV4dClcbiAgICAgICAgICAgICAgICBzZWxmLiRwYXJlbnQubWVyZ2VEYXRhID0gW11cblxuICAgICAgICAgICAgICAgIHBhcmVudC5xdWVyeVNlbGVjdG9yQWxsKCAnW2RhdGEtdHJwLXRyYW5zbGF0ZS1pZF0nICkuZm9yRWFjaCggZnVuY3Rpb24oIG5vZGUgKSB7XG4gICAgICAgICAgICAgICAgICAgIHN0cmluZ0lkID0gbm9kZS5nZXRBdHRyaWJ1dGUoICdkYXRhLXRycC10cmFuc2xhdGUtaWQnIClcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIHN0cmluZ0lkIClcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuJHBhcmVudC5tZXJnZURhdGEucHVzaCggc3RyaW5nSWQgKVxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAvL2NoZWNrIGlmIHdlIGhhdmUgZXhpc3RpbmcgdHJhbnNsYXRpb25zIGZvciB0aGlzIGJsb2NrXG4gICAgICAgICAgICAgICAgaXNEZXByZWNhdGVkID0gcGFyZW50LmdldEF0dHJpYnV0ZSggJ2RhdGEtdHJwLXRyYW5zbGF0ZS1pZC1kZXByZWNhdGVkJyApXG5cbiAgICAgICAgICAgICAgICBpZiggaXNEZXByZWNhdGVkIClcbiAgICAgICAgICAgICAgICAgICAgZGVwcmVjYXRlZFN0cmluZyA9IHNlbGYuJHBhcmVudC5nZXRTdHJpbmdJbmRleCggJ2RhdGEtdHJwLXRyYW5zbGF0ZS1pZCcsIGlzRGVwcmVjYXRlZCApXG5cbiAgICAgICAgICAgICAgICBwYXJlbnQuc2V0QXR0cmlidXRlKCAnZGF0YS10cnAtdHJhbnNsYXRlLWlkJywgJ3RycF9jcmVhdGluZ190cmFuc2xhdGlvbl9ibG9jaycgKVxuXG4gICAgICAgICAgICAgICAgcGFyZW50LmNsYXNzTmFtZSArPSAnIHRycC1oaWdobGlnaHQgdHJwLWNyZWF0ZS10cmFuc2xhdGlvbi1ibG9jaydcblxuICAgICAgICAgICAgICAgIC8vY3JlYXRlIGEgcGxhY2Vob2xkZXIgc3RyaW5nIGZvciB0aGUgZGljdGlvbmFyeVxuICAgICAgICAgICAgICAgIGxldCBkdW1teVN0cmluZyA9IHtcbiAgICAgICAgICAgICAgICAgICAgdHlwZSAgICAgICAgICAgICAgOiAncmVndWxhcicsXG4gICAgICAgICAgICAgICAgICAgIGF0dHJpYnV0ZSAgICAgICAgIDogJycsXG4gICAgICAgICAgICAgICAgICAgIGJsb2NrX3R5cGUgICAgICAgIDogJzEnLFxuICAgICAgICAgICAgICAgICAgICBkYklEICAgICAgICAgICAgICA6ICdjcmVhdGVfdHJhbnNsYXRpb25fYmxvY2snICsgdGhpcy5jb3VudGVyLFxuICAgICAgICAgICAgICAgICAgICBvcmlnaW5hbCAgICAgICAgICA6IHNlbGYuc3RyaXBFZGl0b3JEYXRhKCBwYXJlbnQgKSxcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3IgICAgICAgICAgOiAnZGF0YS10cnAtdHJhbnNsYXRlLWlkJyxcbiAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRpb25zQXJyYXkgOiB7fVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB0aGlzLmNvdW50ZXIrK1xuXG4gICAgICAgICAgICAgICAgbGV0IGR1bW15VHJhbnNsYXRpb25zID0ge31cblxuICAgICAgICAgICAgICAgIGxldCBkZWZhdWx0TGFuZ3VhZ2UgPSB0aGlzLnNldHRpbmdzWydkZWZhdWx0LWxhbmd1YWdlJ11cblxuICAgICAgICAgICAgICAgIC8vcG9wdWxhdGUgdHJhbnNsYXRpb25zQXJyYXlcbiAgICAgICAgICAgICAgICBzZWxmLnNldHRpbmdzWyd0cmFuc2xhdGlvbi1sYW5ndWFnZXMnXS5mb3JFYWNoKCBmdW5jdGlvbiggbGFuZ3VhZ2VDb2RlICApe1xuICAgICAgICAgICAgICAgICAgICBpZiggbGFuZ3VhZ2VDb2RlICE9IGRlZmF1bHRMYW5ndWFnZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGR1bW15VHJhbnNsYXRpb25zID0ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJsb2NrX3R5cGUgOiAnMScsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWQgICAgICAgICA6IGxhbmd1YWdlQ29kZSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdGF0dXMgICAgIDogJzAnLFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0ZWQgOiAnJyxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlZGl0ZWRUcmFuc2xhdGlvbjogJydcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgLy9wb3B1bGF0ZSBleGlzdGluZyB0cmFuc2xhdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBkZXByZWNhdGVkU3RyaW5nICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR1bW15VHJhbnNsYXRpb25zLnRyYW5zbGF0ZWQgICAgICAgID0gc2VsZi5kaWN0aW9uYXJ5W2RlcHJlY2F0ZWRTdHJpbmddLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0udHJhbnNsYXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGR1bW15VHJhbnNsYXRpb25zLmVkaXRlZFRyYW5zbGF0aW9uID0gc2VsZi5kaWN0aW9uYXJ5W2RlcHJlY2F0ZWRTdHJpbmddLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0udHJhbnNsYXRlZFxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICBkdW1teVN0cmluZy50cmFuc2xhdGlvbnNBcnJheVtsYW5ndWFnZUNvZGVdID0gZHVtbXlUcmFuc2xhdGlvbnNcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAvL2FkZCBpdGVtIHRvIGRpY3Rpb25hcnkgYW5kIHNldCBzZWxlY3RlZFN0cmluZyBhcyB0aGUgaW5kZXhcbiAgICAgICAgICAgICAgICBzZWxmLiRwYXJlbnQuc2VsZWN0ZWRTdHJpbmcgPSBzZWxmLmRpY3Rpb25hcnkucHVzaCggZHVtbXlTdHJpbmcgKSAtIDFcblxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlbW92ZVBlbmNpbEljb24oKXtcbiAgICAgICAgICAgICAgICBsZXQgaWNvbnMgPSB0aGlzLmlmcmFtZS5xdWVyeVNlbGVjdG9yQWxsKCAndHJwLXNwYW4nIClcblxuICAgICAgICAgICAgICAgIGlmICggaWNvbnMubGVuZ3RoID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgaWNvbnMuZm9yRWFjaCggZnVuY3Rpb24oIGljb24gKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBpY29uLnJlbW92ZSgpXG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGNoZWNrTWVyZ2VPclNwbGl0KCB0YXJnZXQgKXtcbiAgICAgICAgICAgICAgICBpZiggIXRoaXMubWVyZ2V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ICAgICAgaWYoIHRhcmdldC50YWdOYW1lLnRvTG93ZXJDYXNlKCkgPT0gdGhpc09iamVjdFR5cGUgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAvL2dldCBwYXJlbnQgYmFzZWQgb24gbWVyZ2UgcnVsZXNcbiAgICAgICAgICAgICAgICAgICAgICAgIHBhcmVudE5vZGUgPSB0YXJnZXQuY2xvc2VzdCggc2VsZi5tZXJnZVJ1bGVzLnRvcF9wYXJlbnRzIClcblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoIHBhcmVudE5vZGUgIT0gbnVsbCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvL2dldCBjaGlsZHJlbnMgdGhhdCBhcmUgb2YgdGhlIGNvcnJlY3QgdHlwZSBiYXNlZCBvbiBwYXJlbnQsXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5tZXJnZVJ1bGVzLnNlbGZfb2JqZWN0X3R5cGUuZm9yRWFjaCggZnVuY3Rpb24oIHNlbGZPYmplY3RUeXBlICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjaGlsZE5vZGVzID0gcGFyZW50Tm9kZS5xdWVyeVNlbGVjdG9yQWxsKCBzZWxmT2JqZWN0VHlwZSApXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGNoaWxkTm9kZXMubGVuZ3RoID4gMSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vY2hlY2sgaWYgYmV0d2VlbiB0aGUgY2hpbGRyZW4gd2UgaGF2ZSBpbmNvbXBhdGlibGUgc2libGluZ3MgKGdldHRleHQgb3IgZHluYW1pYyBzdHJpbmdzKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5jb21wYXRpYmxlU2libGluZ3MgPSBwYXJlbnROb2RlLnF1ZXJ5U2VsZWN0b3JBbGwoIHNlbGYubWVyZ2VSdWxlcy5pbmNvbXBhdGlibGVfc2libGluZ3MgKVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIGluY29tcGF0aWJsZVNpYmxpbmdzLmxlbmd0aCA9PSAwIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3Rpb24gPSAnbWVyZ2UnXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIHJldHVybiBhY3Rpb25cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBzdHJpcEVkaXRvckRhdGEoIHRhcmdldCApe1xuICAgICAgICAgICAgICAgIGxldCBjb3B5ID0gdGFyZ2V0LmNsb25lTm9kZSggdHJ1ZSApXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXG5cbiAgICAgICAgICAgICAgICBsZXQgYnV0dG9ucyA9IGNvcHkucXVlcnlTZWxlY3RvciggJ3RycC1zcGFuJyApXG5cbiAgICAgICAgICAgICAgICBpZiggYnV0dG9ucyApXG4gICAgICAgICAgICAgICAgICAgIGJ1dHRvbnMucmVtb3ZlKClcblxuICAgICAgICAgICAgICAgIC8qKiBJbiBjYXNlIHdlIGFyZSBpbiBzZWNvbmRhcnkgbGFuZ3VhZ2UgYW5kIHRoZSBzdHJpbmdzIHRoYXQgd2lsbCBiZSBtZXJnZWQgYXJlIGFscmVhZHkgdHJhbnNsYXRlZCxcbiAgICAgICAgICAgICAgICAgKiAgd2UgbXVzdCB1c2UgdGhlIG9yaWdpbmFscyBvZiB0aGVzZSBzdHJpbmdzIGluc3RlYWQgb2Ygd2hhdCBpcyBpbiB0aGUgcHJldmlldyBpZnJhbWUgSFRNTCBwYWdlIGF0IHRoaXMgcG9pbnRcbiAgICAgICAgICAgICAgICAgKi9cbiAgICA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lLXByZXNzLCB0cnAtd3JhcCwgdHJwLWhpZ2hsaWdodCcgKS5mb3JFYWNoKCBmdW5jdGlvbiggbm9kZSApIHtcbiAgICAgICAgICAgICAgICAgICAgdXRpbHMudW53cmFwKCBub2RlIClcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgbGV0IGF0dHJpYnV0ZXNUb1JlcGxhY2UgPSBbICdocmVmJywgJ3RhcmdldCcgXVxuXG4gICAgICAgICAgICAgICAgYXR0cmlidXRlc1RvUmVwbGFjZS5mb3JFYWNoKCBmdW5jdGlvbiggYXR0cmlidXRlICkge1xuICAgICAgICAgICAgICAgICAgICBjb3B5LnF1ZXJ5U2VsZWN0b3JBbGwoICdbZGF0YS10cnAtb3JpZ2luYWwtJyArIGF0dHJpYnV0ZSArICddJyApLmZvckVhY2goIGZ1bmN0aW9uKCBub2RlICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGRhdGFUcnBPcmlnaW5hbEF0dHJpYnV0ZSA9ICdkYXRhLXRycC1vcmlnaW5hbC0nICsgYXR0cmlidXRlO1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZS5zZXRBdHRyaWJ1dGUoIGF0dHJpYnV0ZSwgbm9kZS5nZXRBdHRyaWJ1dGUoIGRhdGFUcnBPcmlnaW5hbEF0dHJpYnV0ZSApIClcbiAgICAgICAgICAgICAgICAgICAgICAgIG5vZGUucmVtb3ZlQXR0cmlidXRlKGRhdGFUcnBPcmlnaW5hbEF0dHJpYnV0ZSlcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgbGV0IG5vZGVcbiAgICAgICAgICAgICAgICBsZXQgb3RoZXJBdHRyaWJ1dGVzID0gWyAnZGF0YS10cnAtcGxhY2Vob2xkZXInLCAnZGF0YS10cnAtdW5wcmV2aWV3YWJsZScgXVxuICAgICAgICAgICAgICAgIGxldCBhdHRyaWJ1dGVzVG9SZW1vdm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ml4IGZvciBXb29Db21tZXJjZSBwcm9kdWN0IHBsYWNlaG9sZGVyIGltYWdlIG9uIHNob3AgcGFnZSAoSGVzdGlhIHRoZW1lIGFuZCBvdGhlcnMpXG4gICAgICAgICAgICAgICAgbGV0IGZvcmNlUGVuY2lsRGlzcGxheUNsYXNzZXMgPSBbJ3NsaWNrLXNsaWRlLWltYWdlJywgJ2F0dGFjaG1lbnQtd29vY29tbWVyY2VfdGh1bWJuYWlsJywgJ3dvb2NvbW1lcmNlLXBsYWNlaG9sZGVyJ11cbiAgICAgICAgICAgICAgICBsZXQgZm9yY2VQZW5jaWxEaXNwbGF5ID0gZmFsc2VcbiAgICAgICAgICAgICAgICBpZiAoIHRhcmdldC50YWdOYW1lID09PSAnSU1HJyApe1xuICAgICAgICAgICAgICAgICAgICBsZXQgaVxuICAgICAgICAgICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IGZvcmNlUGVuY2lsRGlzcGxheUNsYXNzZXMubGVuZ3RoOyBpKysgKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggdGFyZ2V0LmNsYXNzTGlzdC5jb250YWlucyggZm9yY2VQZW5jaWxEaXNwbGF5Q2xhc3Nlc1tpXSApICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmNlUGVuY2lsRGlzcGxheSA9IHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIGxldCByZWN0ID0gdGFyZ2V0LmdldEJvdW5kaW5nQ2xpZW50UmVjdCgpXG4gICAgICAgICAgICAgICAgaWYoIGZvcmNlUGVuY2lsRGlzcGxheSB8fCByZWN0LmxlZnQgPCAzNSApIHtcbiAgICAgICAgICAgICAgICAgICAgbGV0IG1hcmdpblxuXG4gICAgICAgICAgICAgICAgICAgIGlmKCBtZXJnZU9yU3BsaXQgIT0gJ25vbmUnIClcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbiA9IDYwXG4gICAgICAgICAgICAgICAgICAgIGVsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgIG1hcmdpbiA9IDMwXG5cbiAgICAgICAgICAgICAgICAgICAgcGVuY2lsLnNldEF0dHJpYnV0ZSggJ3N0eWxlJywgJ21hcmdpbi1sZWZ0OiAnICsgbWFyZ2luICsgJ3B4ICFpbXBvcnRhbnQnIClcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0VHJwU3BhbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gJzx0cnAtc3Bhbj48dHJwLW1lcmdlIHRpdGxlPVwiJysgdGhpcy5lZGl0b3JTdHJpbmdzLm1lcmdlICsnXCIgY2xhc3M9XCJ0cnAtaWNvbiB0cnAtbWVyZ2UgZGFzaGljb25zIGRhc2hpY29ucy1hcnJvdy11cC1hbHRcIj48L3RycC1tZXJnZT48dHJwLXNwbGl0IHRpdGxlPVwiJysgdGhpcy5lZGl0b3JTdHJpbmdzLnNwbGl0ICsnXCIgY2xhc3M9XCJ0cnAtaWNvbiB0cnAtc3BsaXQgZGFzaGljb25zIGRhc2hpY29ucy1hcnJvdy1kb3duLWFsdFwiPjwvdHJwLXNwbGl0Pjx0cnAtZWRpdCB0aXRsZT1cIicrIHRoaXMuZWRpdG9yU3RyaW5ncy5lZGl0ICsnXCIgY2xhc3M9XCJ0cnAtaWNvbiB0cnAtZWRpdC10cmFuc2xhdGlvbiBkYXNoaWNvbnMgZGFzaGljb25zLWVkaXRcIj48L3RycC1lZGl0PjwvdHJwLXNwYW4+J1xuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuPC9zY3JpcHQ+XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/hover-actions.vue?vue&type=script&lang=js&\n");
|
706 |
|
707 |
/***/ }),
|
708 |
|
714 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
715 |
|
716 |
"use strict";
|
717 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _translation_input_vue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./translation-input.vue */ \"./assets/src/js/components/translation-input.vue\");\n/* harmony import */ var _translation_memory_vue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./translation-memory.vue */ \"./assets/src/js/components/translation-memory.vue\");\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['selectedIndexesArray', 'dictionary', 'currentLanguage', 'onScreenLanguage', 'languageNames', 'settings', 'showChangesUnsavedMessage', 'editorStrings', 'flagsPath', 'iframe', 'nonces', 'ajax_url'],\n data: function data() {\n return {\n languages: [],\n completeLanguageNames: Object.assign({\n 'original': 'Original String'\n }, this.languageNames),\n othersButtonPositionOffset: 1,\n showOtherLanguages: false,\n orderedLanguages: [],\n showImageIcon: true\n };\n },\n components: {\n translationInput: _translation_input_vue__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n translationMemory: _translation_memory_vue__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n },\n mounted: function mounted() {\n this.determineLanguageOrder();\n this.addKeyboardShortcutsListener();\n },\n updated: function updated() {\n // if already active do nothing\n if (document.activeElement.classList.contains('trp-translation-input')) {\n return;\n } // place the cursor in the first textarea or input for translation\n\n\n var translationSection = document.getElementById('trp-translation-section');\n\n if (translationSection) {\n var focusableSelectors = ['textarea:not([readonly])', 'input[type=\"text\"]:not([readonly])'];\n\n for (var i = 0; i < focusableSelectors.length; i++) {\n var focusable = document.getElementById('trp-translation-section').querySelector(focusableSelectors[i]);\n\n if (focusable) {\n focusable.focus();\n break;\n }\n }\n }\n },\n watch: {\n selectedIndexesArray: function selectedIndexesArray() {\n this.updateLanguages();\n },\n onScreenLanguage: function onScreenLanguage() {\n this.determineLanguageOrder();\n this.updateLanguages();\n }\n },\n computed: {\n othersButtonPosition: function othersButtonPosition() {\n if (this.currentLanguage === this.settings['default-language'] || this.settings['translation-languages'].length <= 2) {\n // don't display it\n return 999;\n } else {\n return this.othersButtonPositionOffset;\n }\n }\n },\n methods: {\n determineLanguageOrder: function determineLanguageOrder() {\n var self = this;\n var filteredLanguages = this.settings['translation-languages'].filter(function (language, index, array) {\n // all languages except default and current or on screen language.\n return self.settings['default-language'] !== language && self.onScreenLanguage !== language;\n });\n this.orderedLanguages = [];\n this.orderedLanguages.push(this.settings['default-language']);\n if (this.onScreenLanguage !== '') this.orderedLanguages.push(this.onScreenLanguage);\n this.orderedLanguages = this.orderedLanguages.concat(filteredLanguages);\n },\n updateLanguages: function updateLanguages() {\n this.languages = [];\n var self = this;\n var defaultLanguage = this.settings['default-language'];\n var translateToDefault = false;\n this.showImageIcon = false;\n this.othersButtonPositionOffset = 1;\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n if (self.dictionary[selectedIndex] && self.dictionary[selectedIndex].translationsArray[defaultLanguage]) translateToDefault = true;\n if (self.dictionary[selectedIndex] && self.dictionary[selectedIndex].attribute === 'src') self.showImageIcon = true;\n });\n\n if (translateToDefault) {\n this.languages.push('original');\n this.othersButtonPositionOffset++;\n }\n\n this.languages = this.languages.concat(this.orderedLanguages);\n },\n discardChanges: function discardChanges(selectedIndex, languageCode) {\n this.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation = this.dictionary[selectedIndex].translationsArray[languageCode].translated;\n this.$emit('discarded-changes');\n },\n hasUnsavedChanges: function hasUnsavedChanges(selectedIndex, languageCode) {\n return this.dictionary[selectedIndex].translationsArray[languageCode].translated !== this.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation;\n },\n discardAll: function discardAll() {\n var self = this;\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n self.settings['translation-languages'].forEach(function (languageCode) {\n if (self.dictionary[selectedIndex].translationsArray[languageCode] && self.dictionary[selectedIndex].translationsArray[languageCode].translated !== self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation) {\n self.discardChanges(selectedIndex, languageCode);\n }\n });\n });\n\n if (this.$parent.mergingString === true) {\n this.$parent.selectedString = null;\n var previouslyHighlighted = this.iframe.getElementsByClassName('trp-create-translation-block');\n\n if (previouslyHighlighted.length > 0) {\n var i;\n\n for (i = 0; i < previouslyHighlighted.length; i++) {\n previouslyHighlighted[i].classList.remove('trp-highlight');\n previouslyHighlighted[i].classList.remove('trp-create-translation-block');\n }\n }\n\n this.$parent.mergingString = false;\n this.$parent.mergeData = [];\n }\n },\n addKeyboardShortcutsListener: function addKeyboardShortcutsListener() {\n document.addEventListener(\"keydown\", function (e) {\n // CTRL + ALT + Z\n if ((window.navigator.platform.match(\"Mac\") ? e.metaKey : e.ctrlKey) && e.altKey && e.keyCode === 90) {\n e.preventDefault();\n window.dispatchEvent(new Event('trp_trigger_discard_all_changes_event'));\n }\n }, false);\n window.addEventListener('trp_trigger_discard_all_changes_event', this.discardAll);\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL2xhbmd1YWdlLWJveGVzLnZ1ZT80OWJjIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUE0Q0E7QUFDQTtBQUNBO0FBQ0EsVUFDQSxzQkFEQSxFQUVBLFlBRkEsRUFHQSxpQkFIQSxFQUlBLGtCQUpBLEV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bhbj5cbiAgICAgICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICAgICAgPC9kaXY+XG4gICAgICAgICAgICA8L2Rpdj5cbiAgICAgICAgPC9kaXY+XG4gICAgPC9kaXY+XG48L3RlbXBsYXRlPlxuXG48c2NyaXB0PlxuICAgIGltcG9ydCB0cmFuc2xhdGlvbklucHV0IGZyb20gJy4vdHJhbnNsYXRpb24taW5wdXQudnVlJ1xuICAgIGltcG9ydCB0cmFuc2xhdGlvbk1lbW9yeSBmcm9tICcuL3RyYW5zbGF0aW9uLW1lbW9yeS52dWUnXG4gICAgZXhwb3J0IGRlZmF1bHR7XG4gICAgICAgIHByb3BzOltcbiAgICAgICAgICAgICdzZWxlY3RlZEluZGV4ZXNBcnJheScsXG4gICAgICAgICAgICAnZGljdGlvbmFyeScsXG4gICAgICAgICAgICAnY3VycmVudExhbmd1YWdlJyxcbiAgICAgICAgICAgICdvblNjcmVlbkxhbmd1YWdlJyxcbiAgICAgICAgICAgICdsYW5ndWFnZU5hbWVzJyxcbiAgICAgICAgICAgICdzZXR0aW5ncycsXG4gICAgICAgICAgICAnc2hvd0NoYW5nZXNVbnNhdmVkTWVzc2FnZScsXG4gICAgICAgICAgICAnZWRpdG9yU3RyaW5ncycsXG4gICAgICAgICAgICAnZmxhZ3NQYXRoJyxcbiAgICAgICAgICAgICdpZnJhbWUnLFxuICAgICAgICAgICAgJ25vbmNlcycsXG4gICAgICAgICAgICAnYWpheF91cmwnXG4gICAgICAgIF0sXG4gICAgICAgIGRhdGEoKXtcbiAgICAgICAgICAgIHJldHVybntcbiAgICAgICAgICAgICAgICBsYW5ndWFnZXMgICAgICAgICAgICAgICAgICA6IFtdLFxuICAgICAgICAgICAgICAgIGNvbXBsZXRlTGFuZ3VhZ2VOYW1lcyAgICAgIDogT2JqZWN0LmFzc2lnbiggeyAnb3JpZ2luYWwnOiAnT3JpZ2luYWwgU3RyaW5nJyB9LCB0aGlzLmxhbmd1YWdlTmFtZXMgKSxcbiAgICAgICAgICAgICAgICBvdGhlcnNCdXR0b25Qb3NpdGlvbk9mZnNldCA6IDEsXG4gICAgICAgICAgICAgICAgc2hvd090aGVyTGFuZ3VhZ2VzICAgICAgICAgOiBmYWxzZSxcbiAgICAgICAgICAgICAgICBvcmRlcmVkTGFuZ3VhZ2VzICAgICAgICAgICA6IFtdLFxuICAgICAgICAgICAgICAgIHNob3dJbWFnZUljb24gICAgICAgICAgICAgIDogdHJ1ZVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjb21wb25lbnRzOntcbiAgICAgICAgICAgIHRyYW5zbGF0aW9uSW5wdXQsXG4gICAgICAgICAgICB0cmFuc2xhdGlvbk1lbW9yeVxuICAgICAgICB9LFxuICAgICAgICBtb3VudGVkKCl7XG4gICAgICAgICAgICB0aGlzLmRldGVybWluZUxhbmd1YWdlT3JkZXIoKVxuICAgICAgICAgICAgdGhpcy5hZGRLZXlib2FyZFNob3J0Y3V0c0xpc3RlbmVyKClcbiAgICAgICAgfSxcbiAgICAgICAgdXBkYXRlZCgpe1xuICAgICAgICAgICAgLy8gaWYgYWxyZWFkeSBhY3RpdmUgZG8gbm90aGluZ1xuICAgICAgICAgICAgaWYgKCBkb2N1bWVudC5hY3RpdmVFbGVtZW50LmNsYXNzTGlzdC5jb250YWlucyggJ3RycC10cmFuc2xhdGlvbi1pbnB1dCcgKSl7XG4gICAgICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgICB9XG4gICAgICAgICAgICAvLyBwbGFjZSB0aGUgY3Vyc29yIGluIHRoZSBmaXJzdCB0ZXh0YXJlYSBvciBpbnB1dCBmb3IgdHJhbnNsYXRpb25cbiAgICAgICAgICAgIGxldCB0cmFuc2xhdGlvblNlY3Rpb24gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCggJ3RycC10cmFuc2xhdGlvbi1zZWN0aW9uJyApXG4gICAgICAgICAgICBpZiAoIHRyYW5zbGF0aW9uU2VjdGlvbiApICB7XG4gICAgICAgICAgICAgICAgbGV0IGZvY3VzYWJsZVNlbGVjdG9ycyA9IFsndGV4dGFyZWE6bm90KFtyZWFkb25seV0pJywgJ2lucHV0W3R5cGU9XCJ0ZXh0XCJdOm5vdChbcmVhZG9ubHldKSddXG4gICAgICAgICAgICAgICAgZm9yICggdmFyIGkgPSAwOyBpPGZvY3VzYWJsZVNlbGVjdG9ycy5sZW5ndGg7IGkrKyApe1xuICAgICAgICAgICAgICAgICAgICBsZXQgZm9jdXNhYmxlID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoICd0cnAtdHJhbnNsYXRpb24tc2VjdGlvbicgKS5xdWVyeVNlbGVjdG9yKGZvY3VzYWJsZVNlbGVjdG9yc1tpXSlcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBmb2N1c2FibGUgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb2N1c2FibGUuZm9jdXMoKVxuICAgICAgICAgICAgICAgICAgICAgICAgYnJlYWs7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIHdhdGNoOiB7XG4gICAgICAgICAgICBzZWxlY3RlZEluZGV4ZXNBcnJheTogZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHRoaXMudXBkYXRlTGFuZ3VhZ2VzKClcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBvblNjcmVlbkxhbmd1YWdlOiBmdW5jdGlvbigpe1xuICAgICAgICAgICAgICAgIHRoaXMuZGV0ZXJtaW5lTGFuZ3VhZ2VPcmRlcigpXG4gICAgICAgICAgICAgICAgdGhpcy51cGRhdGVMYW5ndWFnZXMoKVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjb21wdXRlZDp7XG4gICAgICAgICAgICBvdGhlcnNCdXR0b25Qb3NpdGlvbjogZnVuY3Rpb24gKCl7XG4gICAgICAgICAgICAgICAgaWYgKHRoaXM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WRMYW5ndWFnZXMucHVzaCggdGhpcy5zZXR0aW5nc1snZGVmYXVsdC1sYW5ndWFnZSddIClcbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMub25TY3JlZW5MYW5ndWFnZSAhPT0gJycgKVxuICAgICAgICAgICAgICAgICAgICB0aGlzLm9yZGVyZWRMYW5ndWFnZXMucHVzaCggdGhpcy5vblNjcmVlbkxhbmd1YWdlIClcbiAgICAgICAgICAgICAgICB0aGlzLm9yZGVyZWRMYW5ndWFnZXMgPSB0aGlzLm9yZGVyZWRMYW5ndWFnZXMuY29uY2F0KCBmaWx0ZXJlZExhbmd1YWdlcyApXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdXBkYXRlTGFuZ3VhZ2VzOiBmdW5jdGlvbiAoKSB7XG4gICAgICAgICAgICAgICAgdGhpcy5sYW5ndWFnZXMgICAgICAgICAgICAgICAgICA9IFtdXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgICAgICAgICAgICAgICAgICAgICAgICA9IHRoaXNcbiAgICAgICAgICAgICAgICBsZXQgZGVmYXVsdExhbmd1YWdlICAgICAgICAgICAgID0gdGhpcy5zZXR0aW5nc1snZGVmYXVsdC1sYW5ndWFnZSddXG4gICAgICAgICAgICAgICAgbGV0IHRyYW5zbGF0ZVRvRGVmYXVsdCAgICAgICAgICA9IGZhbHNlXG4gICAgICAgICAgICAgICAgdGhpcy5zaG93SW1hZ2VJY29uICAgICAgICAgICAgICA9IGZhbHNlXG4gICAgICAgICAgICAgICAgdGhpcy5vdGhlcnNCdXR0b25Qb3NpdGlvbk9mZnNldCA9IDFcblxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0ZWRJbmRleGVzQXJyYXkuZm9yRWFjaChmdW5jdGlvbiAoc2VsZWN0ZWRJbmRleCkge1xuICAgICAgICAgICAgICAgICAgICBpZiggc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdICYmIHNlbGYuZGljdGlvbmFyeVtzZWxlY3Rl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iAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmRpc2NhcmRDaGFuZ2VzKHNlbGVjdGVkSW5kZXgsbGFuZ3VhZ2VDb2RlKVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMuJHBhcmVudC5tZXJnaW5nU3RyaW5nID09PSB0cnVlICl7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJHBhcmVudC5zZWxlY3RlZFN0cmluZyA9IG51bGxcbiAgICAgICAgICAgICAgICAgICAgbGV0IHByZXZpb3VzbHlIaWdobGlnaHRlZCA9IHRoaXMuaWZyYW1lLmdldEVsZW1lbnRzQnlDbGFzc05hbWUoICd0cnAtY3JlYXRlLXRyYW5zbGF0aW9uLWJsb2NrJyApXG4gICAgICAgICAgICAgICAgICAgIGlmKCBwcmV2aW91c2x5SGlnaGxpZ2h0ZWQubGVuZ3RoID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3IgKCBpID0gMDsgaSA8IHByZXZpb3VzbHlIaWdobGlnaHRlZC5sZW5ndGg7IGkrKyApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBwcmV2aW91c2x5SGlnaGxpZ2h0ZWRbaV0uY2xhc3NMaXN0LnJlbW92ZSgndHJwLWhpZ2hsaWdodCcpXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJldmlvdXNseUhpZ2hsaWdodGVkW2ldLmNsYXNzTGlzdC5yZW1vdmUoJ3RycC1jcmVhdGUtdHJhbnNsYXRpb24tYmxvY2snKVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuJHBhcmVudC5tZXJnaW5nU3RyaW5nID0gZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgdGhpcy4kcGFyZW50Lm1lcmdlRGF0YSA9IFtdXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGFkZEtleWJvYXJkU2hvcnRjdXRzTGlzdGVuZXIoKXtcbiAgICAgICAgICAgICAgICBkb2N1bWVudC5hZGRFdmVudExpc3RlbmVyKFwia2V5ZG93blwiLCBmdW5jdGlvbihlKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIENUUkwgKyBBTFQgKyBaXG4gICAgICAgICAgICAgICAgICAgIGlmICgod2luZG93Lm5hdmlnYXRvci5wbGF0Zm9ybS5tYXRjaChcIk1hY1wiKSA/IGUubWV0YUtleSA6IGUuY3RybEtleSkgJiYgZS5hbHRLZXkgJiYgZS5rZXlDb2RlID09PSA5MCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5kaXNwYXRjaEV2ZW50KG5ldyBFdmVudCgndHJwX3RyaWdnZXJfZGlzY2FyZF9hbGxfY2hhbmdlc19ldmVudCcpKTtcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0sIGZhbHNlKTtcblxuICAgICAgICAgICAgICAgIHdpbmRvdy5hZGRFdmVudExpc3RlbmVyKCAndHJwX3RyaWdnZXJfZGlzY2FyZF9hbGxfY2hhbmdlc19ldmVudCcsIHRoaXMuZGlzY2FyZEFsbCApXG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG48L3NjcmlwdD5cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/language-boxes.vue?vue&type=script&lang=js&\n");
|
718 |
|
719 |
/***/ }),
|
720 |
|
726 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
727 |
|
728 |
"use strict";
|
729 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);\n//\n//\n//\n//\n//\n//\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['selectedIndexesArray', 'selectedString', 'dictionary', 'settings', 'nonces', 'ajax_url', 'currentLanguage', 'onScreenLanguage', 'iframe', 'currentURL', 'mergingString', 'mergeData', 'editorStrings'],\n data: function data() {\n return {\n 'saveButtonText': this.editorStrings.save_translation,\n 'saveStringsRequestsLeft': 0,\n 'disabledSaveButton': false\n };\n },\n mounted: function mounted() {\n this.addKeyboardShortcutsListener();\n },\n watch: {\n saveStringsRequestsLeft: function saveStringsRequestsLeft(newValue, oldValue) {\n if (newValue > 0) {\n this.disabledSaveButton = true;\n this.saveButtonText = this.editorStrings.saving_translation;\n } else {\n this.disabledSaveButton = false;\n this.saveButtonText = this.editorStrings.save_translation;\n this.showTranslationsSaved();\n }\n }\n },\n methods: {\n save: function save() {\n if (this.mergingString) this.createTranslationBlock();else {\n this.saveStringType('gettext');\n this.saveStringType('regular');\n this.saveStringType('postslug');\n }\n\n if (this.saveStringsRequestsLeft === 0) {\n // no saving action was triggered\n this.showTranslationsSaved();\n }\n },\n saveStringType: function saveStringType(typeSlug) {\n this.saveStringsRequestsLeft++;\n var self = this;\n var saveData = {};\n var updateIframeData = {};\n var foundStringsToSave = false; // construct an array of the necessary information\n\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n if (typeSlug === self.dictionary[selectedIndex].type) {\n self.settings['translation-languages'].forEach(function (languageCode) {\n saveData[languageCode] = saveData[languageCode] ? saveData[languageCode] : [];\n updateIframeData[languageCode] = updateIframeData[languageCode] ? updateIframeData[languageCode] : [];\n\n if (self.dictionary[selectedIndex].translationsArray[languageCode] && self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation != self.dictionary[selectedIndex].translationsArray[languageCode].translated) {\n self.dictionary[selectedIndex].translationsArray[languageCode].status = self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation === '' ? 0 : 2;\n self.dictionary[selectedIndex].translationsArray[languageCode].translated = self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation;\n saveData[languageCode].push(self.dictionary[selectedIndex].translationsArray[languageCode]);\n updateIframeData[languageCode].push(self.dictionary[selectedIndex]);\n foundStringsToSave = true;\n }\n });\n }\n }); // send request to save strings in database\n\n if (foundStringsToSave) {\n var data = new FormData();\n data.append('action', 'trp_save_translations_' + typeSlug);\n data.append('security', this.nonces['savetranslationsnonce' + typeSlug]);\n data.append('strings', JSON.stringify(saveData));\n axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(this.ajax_url, data).then(function (response) {\n if (typeSlug === 'gettext') {\n axios__WEBPACK_IMPORTED_MODULE_0___default.a.get(self.currentURL).then(function (reloadedIframeResponse) {\n self.updateIframe(updateIframeData, reloadedIframeResponse.data);\n self.saveStringsRequestsLeft--;\n });\n } else {\n self.updateIframe(updateIframeData);\n self.saveStringsRequestsLeft--;\n }\n\n self.$emit('translations-saved');\n })[\"catch\"](function (error) {\n console.log(error);\n });\n } else {\n self.saveStringsRequestsLeft--;\n }\n },\n updateIframe: function updateIframe(updateIframeData) {\n var reloadedIframeResponse = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var self = this;\n this.settings['translation-languages'].forEach(function (languageCode) {\n if (updateIframeData[languageCode].length > 0) {\n updateIframeData[languageCode].forEach(function (string) {\n if (self.currentLanguage === languageCode) {\n self.setTextInIframe(string, languageCode, reloadedIframeResponse);\n }\n });\n }\n });\n },\n setTextInIframe: function setTextInIframe(string, languageCode, reloadedIframeResponse) {\n var nodes = this.iframe.querySelectorAll(\"[\" + string.selector + \"='\" + string.dbID + \"']\");\n var textToSet = null;\n\n if (reloadedIframeResponse) {\n var translatedNode = document.createRange().createContextualFragment(reloadedIframeResponse).querySelector(\"[\" + string.selector + \"='\" + string.dbID + \"']\");\n\n if (translatedNode) {\n textToSet = typeof string.attribute === 'undefined' || string.attribute === \"\" ? translatedNode.textContent : translatedNode.getAttribute(string.attribute);\n }\n }\n\n if (textToSet === null) {\n textToSet = string.translationsArray[languageCode].translated === '' ? string.original : string.translationsArray[languageCode].translated;\n }\n\n nodes.forEach(function (node) {\n if (typeof string.attribute === 'undefined' || string.attribute === \"\" || string.attribute === 'innertext') {\n var initialValue = node.textContent;\n textToSet = initialValue.replace(initialValue.trim(), textToSet);\n node.innerHTML = textToSet;\n } else {\n var _initialValue = node.getAttribute(string.attribute);\n\n textToSet = _initialValue.replace(_initialValue.trim(), textToSet);\n node.setAttribute(string.attribute, textToSet);\n\n if (string.attribute === 'src') {\n node.setAttribute('srcset', '');\n }\n }\n });\n },\n createTranslationBlock: function createTranslationBlock() {\n this.saveStringsRequestsLeft++;\n var self = this;\n var saveData = {},\n translation = {},\n original;\n var foundStringsToSave = false;\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n self.settings['translation-languages'].forEach(function (languageCode) {\n saveData[languageCode] = saveData[languageCode] ? saveData[languageCode] : [];\n\n if (self.dictionary[selectedIndex] && self.dictionary[selectedIndex].translationsArray[languageCode]) {\n translation = self.dictionary[selectedIndex].translationsArray[languageCode];\n translation.block_type = self.dictionary[selectedIndex].block_type;\n translation.id = self.dictionary[selectedIndex].dbID;\n translation.original = self.dictionary[selectedIndex].original;\n\n if (self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation != self.dictionary[selectedIndex].translationsArray[languageCode].translated) {\n self.dictionary[selectedIndex].translationsArray[languageCode].translated = self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation;\n if (self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation !== '') self.dictionary[selectedIndex].translationsArray[languageCode].status = 2;\n }\n\n saveData[languageCode].push(translation);\n foundStringsToSave = true;\n }\n });\n original = self.dictionary[selectedIndex].original;\n });\n\n if (foundStringsToSave) {\n var data = new FormData();\n data.append('action', 'trp_create_translation_block');\n data.append('security', this.nonces['mergetbnonce']);\n data.append('language', this.currentLanguage);\n data.append('strings', JSON.stringify(saveData));\n data.append('original', original);\n data.append('all_languages', 'true');\n axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(this.ajax_url, data).then(function (response) {\n self.saveStringsRequestsLeft--;\n self.$parent.mergingString = false;\n var item = self.dictionary[self.selectedIndexesArray[0]]; //update dictionary string ids\n\n Object.keys(item.translationsArray).forEach(function (key) {\n Object.keys(response.data[key]).forEach(function (index) {\n if (key === self.onScreenLanguage) {\n self.dictionary[self.selectedIndexesArray[0]].dbID = response.data[key][index].id;\n }\n\n item.translationsArray[key].id = response.data[key][index].id;\n });\n });\n self.$parent.mergeData = []; //get merged string\n\n var mergedString;\n if (typeof item.translationsArray[self.currentLanguage] !== 'undefined' && item.translationsArray[self.currentLanguage].translated) mergedString = item.translationsArray[self.onScreenLanguage].translated;else mergedString = item.original; //replace HTML in iFrame\n\n var translationBlock = self.iframe.querySelector('.trp-create-translation-block');\n translationBlock.innerHTML = mergedString;\n translationBlock.setAttribute('data-trp-translate-id', item.dbID);\n translationBlock.classList.remove('trp-create-translation-block'); //setup event listener for new block\n\n self.$parent.setupEventListener(translationBlock);\n })[\"catch\"](function (error) {\n self.$parent.mergingString = false;\n console.log(error);\n });\n } else {\n this.saveStringsRequestsLeft--;\n }\n },\n showTranslationsSaved: function showTranslationsSaved() {\n var translationSaved = jQuery('#trp-translation-saved');\n translationSaved.css(\"display\", \"inline\");\n translationSaved.delay(3000).fadeOut(400);\n },\n addKeyboardShortcutsListener: function addKeyboardShortcutsListener() {\n document.addEventListener(\"keydown\", function (e) {\n // CTRL + S\n if ((window.navigator.platform.match(\"Mac\") ? e.metaKey : e.ctrlKey) && e.keyCode === 83) {\n e.preventDefault();\n window.dispatchEvent(new Event('trp_trigger_save_translations_event'));\n }\n }, false);\n window.addEventListener('trp_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gICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1vdW50ZWQoKXtcbiAgICAgICAgICAgIHRoaXMuYWRkS2V5Ym9hcmRTaG9ydGN1dHNMaXN0ZW5lcigpXG4gICAgICAgIH0sXG4gICAgICAgIHdhdGNoOntcbiAgICAgICAgICAgIHNhdmVTdHJpbmdzUmVxdWVzdHNMZWZ0IDogZnVuY3Rpb24oIG5ld1ZhbHVlLCBvbGRWYWx1ZSApe1xuICAgICAgICAgICAgICAgIGlmICggbmV3VmFsdWUgPiAwICkge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpc2FibGVkU2F2ZUJ1dHRvbiA9IHRydWVcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zYXZlQnV0dG9uVGV4dCA9IHRoaXMuZWRpdG9yU3RyaW5ncy5zYXZpbmdfdHJhbnNsYXRpb25cbiAgICAgICAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5kaXNhYmxlZFNhdmVCdXR0b24gPSBmYWxzZVxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhdmVCdXR0b25UZXh0ID0gdGhpcy5lZGl0b3JTdHJpbmdzLnNhdmVfdHJhbnNsYXRpb25cblxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3dUcmFuc2xhdGlvbnNTYXZlZCgpXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBtZXRob2RzOntcbiAgICAgICAgICAgIHNhdmUoKXtcbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMubWVyZ2luZ1N0cmluZyApXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3JlYXRlVHJhbnNsYXRpb25CbG9jaygpXG4gICAgICAgICAgICAgICAgZWxzZSB7XG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2F2ZVN0cmluZ1R5cGUoICdnZXR0ZXh0JyApXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2F2ZVN0cmluZ1R5cGUoICdyZWd1bGFyJyApXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc2F2ZVN0cmluZ1R5cGUoICdwb3N0c2x1ZycgKVxuICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMuc2F2ZVN0cmluZ3NSZXF1ZXN0c0xlZnQgPT09IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIC8vIG5vIHNhdmluZyBhY3Rpb24gd2FzIHRyaWdnZXJlZFxuICAgICAgICAgICAgICAgICAgICB0aGlzLnNob3dUcmFuc2xhdGlvbnNTYXZlZCgpXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNhdmVTdHJpbmdUeXBlKCB0eXBlU2x1ZyApe1xuICAgICAgICAgICAgICAgIHRoaXMuc2F2ZVN0cmluZ3NSZXF1ZXN0c0xlZnQrK1xuICAgICAgICAgICAgICAgIGxldCBzZWxmID0gdGhpc1xuICAgICAgICAgICAgICAgIGxldCBzYXZlRGF0YSA9IHt9XG4gICAgICAgICAgICAgICAgbGV0IHVwZGF0ZUlmcmFtZURhdGEgID0ge31cbiAgICAgICAgICAgICAgICBsZXQgZm91bmRTdHJpbmdzVG9TYXZlID0gZmFsc2VcblxuICAgICAgICAgICAgICAgIC8vIGNvbnN0cnVjdCBhbiBhcnJheSBvZiB0aGUgbmVjZXNzYXJ5IGluZm9ybWF0aW9uXG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RlZEluZGV4ZXNBcnJheS5mb3JFYWNoKCBmdW5jdGlvbiggc2VsZWN0ZWRJbmRleCApe1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHR5cGVTbHVnID09PSBzZWxmLmRpY3Rpb25hcnlbc2VsZWN0ZWRJbmRleF0udHlwZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuc2V0dGluZ3NbJ3RyYW5zbGF0aW9uLWxhbmd1YWdlcyddLmZvckVhY2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dGlvbnNBcnJheVtsYW5ndWFnZUNvZGVdLnRyYW5zbGF0ZWQgPSBzZWxmLmRpY3Rpb25hcnlbc2VsZWN0ZWRJbmRleF0udHJhbnNsYXRpb25zQXJyYXlbbGFuZ3VhZ2VDb2RlXS5lZGl0ZWRUcmFuc2xhdGlvblxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVEYXRhW2xhbmd1YWdlQ29kZV0ucHVzaCggc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdLnRyYW5zbGF0aW9uc0FycmF5W2xhbmd1YWdlQ29kZV0gKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJZnJhbWVEYXRhW2xhbmd1YWdlQ29kZV0ucHVzaCggc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdIClcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3VuZFN0cmluZ3NUb1NhdmUgPSB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAvLyBzZW5kIHJlcXVlc3QgdG8gc2F2ZSBzdHJpbmdzIGluIGRhdGFiYXNlXG4gICAgICAgICAgICAgICAgaWYgKCBmb3VuZFN0cmluZ3NUb1NhdmUgKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdhY3Rpb24nLCAndHJwX3NhdmVfdHJhbnNsYXRpb25zXycgKyB0eXBlU2x1ZylcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdzZWN1cml0eScsIHRoaXMubm9uY2VzWydzYXZldHJhbnNsYXRpb25zbm9uY2UnICsgdHlwZVNsdWddKVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3N0cmluZ3MnLCBKU09OLnN0cmluZ2lmeShzYXZlRGF0YSkpXG5cbiAgICAgICAgICAgICAgICAgICAgYXhpb3MucG9zdCh0aGlzLmFqYXhfdXJsLCBkYXRhKVxuICAgICAgICAgICAgICAgICAgICAgICAgLnRoZW4oZnVuY3Rpb24gKHJlc3BvbnNlKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCB0eXBlU2x1ZyA9PT0gJ2dldHRleHQnICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBheGlvcy5nZXQoc2VsZi5jdXJyZW50VVJMKS50aGVuKCBmdW5jdGlvbiggcmVsb2FkZWRJZnJhbWVSZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi51cGRhdGVJZnJhbWUodXBkYXRlSWZyYW1lRGF0YSwgcmVsb2FkZWRJZnJhbWVSZXNwb25zZS5kYXRhKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zYXZlU3RyaW5nc1JlcXVlc3RzTGVmdC0tXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfWVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnVwZGF0ZUlmcmFtZSh1cGRhdGVJZnJhbWVEYXRhKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNhdmVTdHJpbmdzUmVxdWVzdHNMZWZ0LS1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi4kZW1pdCgndHJhbnNsYXRpb25zLXNhdmVkJylcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpXG4gICAgICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgICAgICAgICAgc2VsZi5zYXZlU3RyaW5nc1JlcXVlc3RzTGVmdC0tXG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHVwZGF0ZUlmcmFtZSggdXBkYXRlSWZyYW1lRGF0YSwgcmVsb2FkZWRJZnJhbWVSZXNwb25zZSA9IG51bGwgKXtcbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcbiAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzWyd0cmFuc2xhdGlvbi1sYW5ndWFnZXMnXS5mb3JFYWNoKCBmdW5jdGlvbiggbGFuZ3VhZ2VDb2RlICApe1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHVwZGF0ZUlmcmFtZURhdGFbbGFuZ3VhZ2VDb2RlXS5sZW5ndGggPiAwICl7XG4gICAgICAgICAgICAgICAgICAgICAgICB1cGRhdGVJZnJhbWVEYXRhW2xhbmd1YWdlQ29kZV0uZm9yRWFjaChmdW5jdGlvbiggc3RyaW5nICl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBzZWxmLmN1cnJlbnRMYW5ndWFnZSA9PT0gbGFuZ3VhZ2VDb2RlICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNldFRleHRJbklmcmFtZSggc3RyaW5nLCBsYW5ndWFnZUNvZGUsIHJlbG9hZGVkSWZyYW1lUmVzcG9uc2UgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNldFRleHRJbklmcmFtZSggc3RyaW5nLCBsYW5ndWFnZUNvZGUsIHJlbG9hZGVkSWZyYW1lUmVzcG9uc2UgKXtcbiAgICAgICAgICAgICAgICBsZXQgbm9kZXMgPSB0aGlzLmlmcmFtZS5xdWVyeVNlbGVjdG9yQWxsKCBcIltcIiArIHN0cmluZy5zZWxlY3RvciArIFwiPSdcIiArIHN0cmluZy5kYklEICsgXCInXVwiIClcbiAgICAgICAgICAgICAgICBsZXQgdGV4dFRvU2V0ID0gbnVsbFxuICAgICAgICAgICAgICAgIGlmICggcmVsb2FkZWRJZnJhbWVSZXNwb25zZSApe1xuICAgICAgICAgICAgICAgICAgICBsZXQgdHJhbnNsYXRlZE5vZGUgPSBkb2N1bWVudC5jcmVhdGVSYW5nZSgpLmNyZWF0ZUNvbnRleHR1YWxGcmFnbWVudChyZWxvYWRlZElmcmFtZVJlc3BvbnNlKS5xdWVyeVNlbGVjdG9yKCBcIltcIiArIHN0cmluZy5zZWxlY3RvciArIFwiPSdcIiArIHN0cmluZy5kYklEICsgXCInXVwiIClcbiAgICAgICAgICAgICAgICAgICAgaWYgKCB0cmFuc2xhdGVkTm9kZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRUb1NldCA9ICh0eXBlb2Ygc3RyaW5nLmF0dHJpYnV0ZSA9PT0gJ3VuZGVmaW5lZCcgfHwgc3RyaW5nLmF0dHJpYnV0ZSA9PT0gXCJcIikgPyB0cmFuc2xhdGVkTm9kZS50ZXh0Q29udGVudCA6IHRyYW5zbGF0ZWROb2RlLmdldEF0dHJpYnV0ZShzdHJpbmcuYXR0cmlidXRlKVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGlmICggdGV4dFRvU2V0ID09PSBudWxsICkge1xuICAgICAgICAgICAgICAgICAgICB0ZXh0VG9TZXQgPSAoIHN0cmluZy50cmFuc2xhdGlvbnNBcnJheVtsYW5ndWFnZUNvZGVdLnRyYW5zbGF0ZWQgPT09ICcnICkgPyBzdHJpbmcub3JpZ2luYWwgOiBzdHJpbmcudHJhbnNsYXRpb25zQXJyYXlbbGFuZ3VhZ2VDb2RlXS50cmFuc2xhdGVkXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgbm9kZXMuZm9yRWFjaChmdW5jdGlvbihub2RlKXtcbiAgICAgICAgICAgICAgICAgICAgaWYgKHR5cGVvZiBzdHJpbmcuYXR0cmlidXRlID09PSAndW5kZWZpbmVkJyB8fCBzdHJpbmcuYXR0cmlidXRlID09PSBcIlwiIHx8IHN0cmluZy5hdHRyaWJ1dGUgPT09ICdpbm5lcnRleHQnKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgaW5pdGlhbFZhbHVlID0gbm9kZS50ZXh0Q29udGVudDtcbiAgICAgICAgICAgICAgICAgICAgICAgIHRleHRUb1NldCA9IGluaXRpYWxWYWx1ZS5yZXBsYWNlKGluaXRpYWxWYWx1ZS50cmltKCksIHRleHRUb1NldCk7XG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLmlubmVySFRNTCA9IHRleHRUb1NldFxuICAgICAgICAgICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGluaXRpYWxWYWx1ZSA9IG5vZGUuZ2V0QXR0cmlidXRlKHN0cmluZy5hdHRyaWJ1dGUpXG4gICAgICAgICAgICAgICAgICAgICAgICB0ZXh0VG9TZXQgPSBpbml0aWFsVmFsdWUucmVwbGFjZShpbml0aWFsVmFsdWUudHJpbSgpLCB0ZXh0VG9TZXQpXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlLnNldEF0dHJpYnV0ZShzdHJpbmcuYXR0cmlidXRlLCB0ZXh0VG9TZXQpXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiggc3RyaW5nLmF0dHJpYnV0ZSA9PT0gJ3NyYycgKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlLn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iAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZGljdGlvbmFyeVtzZWxlY3RlZEluZGV4XS50cmFuc2xhdGlvbnNBcnJheVtsYW5ndWFnZUNvZGVdLnN0YXR1cyA9IDJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzYXZlRGF0YVtsYW5ndWFnZUNvZGVdLnB1c2goIHRyYW5zbGF0aW9uIClcblxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgZm91bmRTdHJpbmdzVG9TYXZlID0gdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgICAgIG9yaWdpbmFsID0gc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdLm9yaWdpbmFsXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIGlmKCBmb3VuZFN0cmluZ3NUb1NhdmUgKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCAnYWN0aW9uJyAgICAgICAsICd0cnBfY3JlYXRlX3RyYW5zbGF0aW9uX2Jsb2NrJyApXG4gICAgICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCggJ3NlY3VyaXR5JyAgICAgLCB0aGlzLm5vbmNlc1snbWVyZ2V0Ym5vbmNlJ10gKVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdsYW5ndWFnZScgICAgICwgdGhpcy5jdXJyZW50TGFuZ3VhZ2UgKVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdzdHJpbmdzJyAgICAgICwgSlNPTi5zdHJpbmdpZnkoIHNhdmVEYXRhICkgKVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdvcmlnaW5hbCcgICAgICwgb3JpZ2luYWwgKVxuICAgICAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoICdhbGxfbGFuZ3VhZ2VzJywgJ3RydWUnIClcblxuICAgICAgICAgICAgICAgICAgICBheGlvcy5wb3N0KHRoaXMuYWpheF91cmwsIGRhdGEpXG4gICAgICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNhdmVTdHJpbmdzUmVxdWVzdHNMZWZ0LS1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLiRwYXJlbnQubWVyZ2luZ1N0cmluZyA9IGZhbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGl0ZW0gPSBzZWxmLmRpY3Rpb25hcnlbc2VsZi5zZWxlY3RlZEluZGV4ZXNBcnJheVswXV1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vdXBkYXRlIGRpY3Rpb25hcnkgc3RyaW5nIGlkc1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKCBpdGVtLnRyYW5zbGF0aW9uc0FycmF5ICkuZm9yRWFjaCggZnVuY3Rpb24oa2V5KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE9iamVjdC5rZXlzKCByZXNwb25zZS5kYXRhW2tleV0gKS5mb3JFYWNoKCBmdW5jdGlvbihpbmRleCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBrZXkgPT09IHNlbGYub25TY3JlZW5MYW5ndWFnZSApe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZGljdGlvbmFyeVtzZWxmLnNlbGVjdGVkSW5kZXhlc0FycmF5WzBdXS5kYklEID0gcmVzcG9uc2UuZGF0YVtrZXldW2luZGV4XS5pZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaXRlbS50cmFuc2xhdGlvbnNBcnJheVtrZXldLmlkID0gcmVzcG9uc2UuZGF0YVtrZXldW2luZGV4XS5pZFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLiRwYXJlbnQubWVyZ2VEYXRhID0gW11cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vZ2V0IG1lcmdlZCBzdHJpbmdcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgbWVyZ2VkU3RyaW5nXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiggdHlwZW9mIGl0ZW0udHJhbnNsYXRpb25zQXJyYXlbc2VsZi5jdXJyZW50TGFuZ3VhZ2VdICE9PSAndW5kZWZpbmVkJyAmJiBpdGVtLnRyYW5zbGF0aW9uc0FycmF5W3NlbGYuY3VycmVudExhbmd1YWdlXS50cmFuc2xhdGVkIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVyZ2VkU3RyaW5nID0gaXRlbS50cmFuc2xhdGlvbnNBcnJheVtzZWxmLm9uU2NyZWVuTGFuZ3VhZ2VdLnRyYW5zbGF0ZWRcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbHNlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIG1lcmdlZFN0cmluZyA9IGl0ZW0ub3JpZ2luYWxcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8vcmVwbGFjZSBIVE1MIGluIGlGcmFtZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCB0cmFuc2xhdGlvbkJsb2NrID0gc2VsZi5pZnJhbWUucXVlcnlTZWxlY3RvciggJy50cnAtY3JlYXRlLXRyYW5zbGF0aW9uLWJsb2NrJyApXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0aW9uQmxvY2suaW5uZXJIVE1MID0gbWVyZ2VkU3RyaW5nXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRyYW5zbGF0aW9uQmxvY2suc2V0QXR0cmlidXRlKCAnZGF0YS10cnAtdHJhbnNsYXRlLWlkJywgaXRlbS5kYklEIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHJhbnNsYXRpb25CbG9jay5jbGFzc0xpc3QucmVtb3ZlKCAndHJwLWNyZWF0ZS10cmFuc2xhdGlvbi1ibG9jaycgKVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9zZXR1cCBldmVudCBsaXN0ZW5lciBmb3IgbmV3IGJsb2NrXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi4kcGFyZW50LnNldHVwRXZlbnRMaXN0ZW5lciggdHJhbnNsYXRpb25CbG9jayApXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgLmNhdGNoKGZ1bmN0aW9uIChlcnJvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuJHBhcmVudC5tZXJnaW5nU3RyaW5nID0gZmFsc2VcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zb2xlLmxvZyhlcnJvcilcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pO1xuICAgICAgICAgICAgICAgIH1lbHNle1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNhdmVTdHJpbmdzUmVxdWVzdHNMZWZ0LS1cbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2hvd1RyYW5zbGF0aW9uc1NhdmVkIDogZnVuY3Rpb24oKXtcbiAgICAgICAgICAgICAgICBsZXQgdHJhbnNsYXRpb25TYXZlZCA9IGpRdWVyeSgnI3RycC10cmFuc2xhdGlvbi1zYXZlZCcpXG4gICAgICAgICAgICAgICAgdHJhbnNsYXRpb25TYXZlZC5jc3MoXCJkaXNwbGF5XCIsIFwiaW5saW5lXCIpXG4gICAgICAgICAgICAgICAgdHJhbnNsYXRpb25TYXZlZC5kZWxheSgzMDAwKS5mYWRlT3V0KDQwMClcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhZGRLZXlib2FyZFNob3J0Y3V0c0xpc3RlbmVyKCl7XG4gICAgICAgICAgICAgICAgZG9jdW1lbnQuYWRkRXZlbnRMaXN0ZW5lcihcImtleWRvd25cIiwgZnVuY3Rpb24oZSkge1xuXG4gICAgICAgICAgICAgICAgICAgIC8vIENUUkwgKyBTXG4gICAgICAgICAgICAgICAgICAgIGlmICgod2luZG93Lm5hdmlnYXRvci5wbGF0Zm9ybS5tYXRjaChcIk1hY1wiKSA/IGUubWV0YUtleSA6IGUuY3RybEtleSkgICYmIGUua2V5Q29kZSA9PT0gODMpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmRpc3BhdGNoRXZlbnQoIG5ldyBFdmVudCggJ3RycF90cmlnZ2VyX3NhdmVfdHJhbnNsYXRpb25zX2V2ZW50JyApICk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LCBmYWxzZSk7XG5cbiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lciggJ3RycF90cmlnZ2VyX3NhdmVfdHJhbnNsYXRpb25zX2V2ZW50JywgdGhpcy5zYXZlIClcbiAgICAgICAgICAgIH1cblxuICAgICAgICB9XG4gICAgfVxuPC9zY3JpcHQ+XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/save-translations.vue?vue&type=script&lang=js&\n");
|
730 |
|
731 |
/***/ }),
|
732 |
|
738 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
739 |
|
740 |
"use strict";
|
741 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! he */ \"./node_modules/he/he.js\");\n/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(he__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var autosize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! autosize */ \"./node_modules/autosize/dist/autosize.js\");\n/* harmony import */ var autosize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(autosize__WEBPACK_IMPORTED_MODULE_1__);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['value', 'string', 'readonly', 'highlightUnsavedChanges', 'editorStrings', 'nonces'],\n data: function data() {\n return {\n inputType: 'textarea',\n uploadMediaFrame: null,\n placeholder: ''\n };\n },\n mounted: function mounted() {\n var inputTypeArray = {\n '': 'textarea',\n 'content': 'textarea',\n 'alt': 'textarea',\n 'title': 'textarea',\n 'placeholder': 'textarea',\n 'outertext': 'textarea',\n 'value': 'textarea',\n 'src': 'inputmedia',\n 'href': 'inputmedia'\n };\n this.inputType = inputTypeArray[this.string.attribute] ? inputTypeArray[this.string.attribute] : 'textarea';\n this.inputType = this.readonly && this.inputType === 'inputmedia' ? 'input' : this.inputType;\n autosize__WEBPACK_IMPORTED_MODULE_1___default()(document.querySelectorAll('.trp-textarea'));\n\n if (this.inputType === 'inputmedia') {\n this.setupMediaUploader();\n\n if (this.string.attribute === 'href') {\n this.placeholder = 'http://example.com/';\n }\n }\n },\n methods: {\n getValue: function getValue() {\n if (this.value) return he__WEBPACK_IMPORTED_MODULE_0___default.a.decode(this.value);\n return this.value;\n },\n updateValue: function updateValue(value) {\n value = value ? value : this.$refs[this.inputType].value;\n this.$emit('input', value);\n },\n setupMediaUploader: function setupMediaUploader() {\n // Create a new media frame\n var self = this;\n this.uploadMediaFrame = wp.media({\n title: self.editorStrings.select_or_upload,\n button: {\n text: self.editorStrings.use_this_media\n },\n multiple: false // Set to true to allow multiple files to be selected\n\n }); // When an image is selected in the media frame...\n\n this.uploadMediaFrame.on('select', function () {\n // Get media attachment details from the frame state\n var attachment = self.uploadMediaFrame.state().get('selection').first().toJSON(); // Send the attachment URL to our custom image input field.\n\n self.updateValue(attachment.url);\n });\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL3RyYW5zbGF0aW9uLWlucHV0LnZ1ZT80OTcyIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQWlCQTtBQUNBO0FBRUE7QUFDQSxVQUNBLE9BREEsRUFFQSxRQUZBLEVBR0EsVUFIQSxFQUlBLHlCQUpBLEVBS0EsZUFMQSxFQU1BLFFBTkEsQ0FEQTtBQVNBLE1BVEEsa0JBU0E7QUFDQTtBQUNBLDJCQURBO0FBRUEsNEJBRkE7QUFHQTtBQUhBO0FBS0EsR0FmQTtBQWdCQSxTQWhCQSxxQkFnQkE7QUFDQTtBQUNBLG9CQURBO0FBRUEsMkJBRkE7QUFHQSx1QkFIQTtBQUlBLHlCQUpBO0FBS0EsK0JBTEE7QUFNQSw2QkFOQTtBQU9BLHlCQVBBO0FBUUEseUJBUkE7QUFTQTtBQVRBO0FBV0E7QUFDQTtBQUVBOztBQUVBO0FBQ0E7O0FBQ0E7QUFDQTtBQUNBO0FBQ0E7QUFFQSxHQXhDQTtBQXlDQTtBQUNBLFlBREEsc0JBQ0E7QUFDQSxzQkFDQTtBQU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kaXY+XG48L3RlbXBsYXRlPlxuPHNjcmlwdD5cbmltcG9ydCBoZSBmcm9tICdoZSdcbmltcG9ydCBhdXRvc2l6ZSBmcm9tICdhdXRvc2l6ZSdcblxuZXhwb3J0IGRlZmF1bHR7XG4gICAgcHJvcHM6W1xuICAgICAgICAndmFsdWUnLFxuICAgICAgICAnc3RyaW5nJyxcbiAgICAgICAgJ3JlYWRvbmx5JyxcbiAgICAgICAgJ2hpZ2hsaWdodFVuc2F2ZWRDaGFuZ2VzJyxcbiAgICAgICAgJ2VkaXRvclN0cmluZ3MnLFxuICAgICAgICAnbm9uY2VzJyxcbiAgICBdLFxuICAgIGRhdGEoKXtcbiAgICAgICAgcmV0dXJue1xuICAgICAgICAgICAgaW5wdXRUeXBlICAgICAgICA6ICd0ZXh0YXJlYScsXG4gICAgICAgICAgICB1cGxvYWRNZWRpYUZyYW1lIDogbnVsbCxcbiAgICAgICAgICAgIHBsYWNlaG9sZGVyICAgICAgOiAnJ1xuICAgICAgICB9XG4gICAgfSxcbiAgICBtb3VudGVkKCl7XG4gICAgICAgIGxldCBpbnB1dFR5cGVBcnJheSA9IHtcbiAgICAgICAgICAgICcnICAgICAgICAgICAgOiAndGV4dGFyZWEnLFxuICAgICAgICAgICAgJ2NvbnRlbnQnICAgICA6ICd0ZXh0YXJlYScsXG4gICAgICAgICAgICAnYWx0JyAgICAgICAgIDogJ3RleHRhcmVhJyxcbiAgICAgICAgICAgICd0aXRsZScgICAgICAgOiAndGV4dGFyZWEnLFxuICAgICAgICAgICAgJ3BsYWNlaG9sZGVyJyA6ICd0ZXh0YXJlYScsXG4gICAgICAgICAgICAnb3V0ZXJ0ZXh0JyAgIDogJ3RleHRhcmVhJyxcbiAgICAgICAgICAgICd2YWx1ZScgICAgICAgOiAndGV4dGFyZWEnLFxuICAgICAgICAgICAgJ3NyYycgICAgICAgICA6ICdpbnB1dG1lZGlhJyxcbiAgICAgICAgICAgICdocmVmJyAgICAgICAgOiAnaW5wdXRtZWRpYS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ICAgICAgc2VsZi51cGRhdGVWYWx1ZShhdHRhY2htZW50LnVybClcbiAgICAgICAgICAgIH0pO1xuICAgICAgICB9XG4gICAgfVxufVxuPC9zY3JpcHQ+XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/translation-input.vue?vue&type=script&lang=js&\n");
|
742 |
|
743 |
/***/ }),
|
744 |
|
750 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
751 |
|
752 |
"use strict";
|
753 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var autosize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! autosize */ \"./node_modules/autosize/dist/autosize.js\");\n/* harmony import */ var autosize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(autosize__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var simplediff__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! simplediff */ \"./node_modules/simplediff/simplediff.js\");\n/* harmony import */ var simplediff__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(simplediff__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var string_similarity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! string-similarity */ \"./node_modules/string-similarity/compare-strings.js\");\n/* harmony import */ var string_similarity__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(string_similarity__WEBPACK_IMPORTED_MODULE_3__);\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['value', 'string', 'editorStrings', 'ajax_url', 'nonces', 'languageCode', 'inputValue'],\n data: function data() {\n return {\n suggestions: [],\n available_suggestions: false,\n similarity: 0,\n currentstring: this.string\n };\n },\n mounted: function mounted() {\n this.init();\n },\n methods: {\n init: function init() {\n var data = new FormData();\n data.append('action', 'trp_get_similar_string_translation');\n data.append('security', this.nonces['getsimilarstring']);\n data.append('original_string', this.string.original);\n data.append('language', this.languageCode);\n data.append('selector', this.string.selector);\n data.append('number', 3);\n var self = this;\n axios__WEBPACK_IMPORTED_MODULE_0___default.a.post(this.ajax_url, data).then(function (response) {\n var suggestions = response.data;\n var i;\n\n for (i = suggestions.length - 1; i >= 0; --i) {\n suggestions[i]['similarity'] = Math.round(string_similarity__WEBPACK_IMPORTED_MODULE_3___default.a.compareTwoStrings(self.string.original, suggestions[i]['original']) * 100);\n suggestions[i]['original'] = simplediff__WEBPACK_IMPORTED_MODULE_2___default.a.htmlDiff(self.string.original, suggestions[i]['original']);\n\n if (suggestions[i]['similarity'] < 70) {\n suggestions.splice(i, 1); // drop suggestions less then 70%\n }\n }\n\n self.suggestions = suggestions;\n\n if (suggestions.length > 0) {\n self.available_suggestions = true;\n }\n })[\"catch\"](function (error) {\n console.log(error);\n });\n },\n copy: function copy(translated) {\n this.currentstring.translationsArray[this.languageCode].editedTranslation = translated; // why no store for you? Go with setTimeout.\n\n setTimeout(function () {\n autosize__WEBPACK_IMPORTED_MODULE_1___default.a.update(document.querySelectorAll('.trp-textarea'));\n }, 50);\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9jb21wb25lbnRzL3RyYW5zbGF0aW9uLW1lbW9yeS52dWU/MDlkZSJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7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HNwYW4gY2xhc3M9XCJvcmlnaW5hbFwiIHYtaHRtbD1cInN1Z2dlc3Rpb24ub3JpZ2luYWxcIj48L3NwYW4+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L2xpPlxuICAgICAgICAgICAgICAgICAgICA8L3VsPlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgPC9kZXRhaWxzPlxuICAgICAgICA8L3RyYW5zaXRpb24+XG4gICAgPC9kaXY+XG48L3RlbXBsYXRlPlxuPHNjcmlwdD5cbiAgICBpbXBvcnQgYXhpb3MgZnJvbSAnYXhpb3MnXG4gICAgaW1wb3J0IGF1dG9zaXplIGZyb20gJ2F1dG9zaXplJ1xuICAgIGltcG9ydCBzaW1wbGVkaWZmIGZyb20gJ3NpbXBsZWRpZmYnXG4gICAgaW1wb3J0IHNpbWlsYXJpdHkgZnJvbSAnc3RyaW5nLXNpbWlsYXJpdHknXG5cblxuICAgIGV4cG9ydCBkZWZhdWx0e1xuICAgICAgICBwcm9wczpbXG4gICAgICAgICAgICAndmFsdWUnLFxuICAgICAgICAgICAgJ3N0cmluZycsXG4gICAgICAgICAgICAnZWRpdG9yU3RyaW5ncycsXG4gICAgICAgICAgICAnYWpheF91cmwnLFxuICAgICAgICAgICAgJ25vbmNlcycsXG4gICAgICAgICAgICAnbGFuZ3VhZ2VDb2RlJyxcbiAgICAgICAgICAgICdpbnB1dFZhbHVlJyxcbiAgICAgICAgXSxcbiAgICAgICAgZGF0YSgpe1xuICAgICAgICAgICAgcmV0dXJue1xuICAgICAgICAgICAgICAgIHN1Z2dlc3Rpb25zIDogW10sXG4gICAgICAgICAgICAgICAgYXZhaWxhYmxlX3N1Z2dlc3Rpb25zIDogZmFsc2UsXG4gICAgICAgICAgICAgICAgc2ltaWxhcml0eSA6IDAsXG4gICAgICAgICAgICAgICAgY3VycmVudHN0cmluZyA6IHRoaXMuc3RyaW5nXG4gICAgICAgICAgICB9XG4gICAgICAgIH0sXG4gICAgICAgIG1vdW50ZWQoKXtcbiAgICAgICAgICAgIHRoaXMuaW5pdCgpXG4gICAgICAgIH0sXG4gICAgICAgIG1ldGhvZHM6e1xuICAgICAgICAgICAgaW5pdCgpe1xuICAgICAgICAgICAgICAgIGxldCBkYXRhID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCgnYWN0aW9uJyAgICAgICAgICAgICwgJ3RycF9nZXRfc2ltaWxhcl9zdHJpbmdfdHJhbnNsYXRpb24nKVxuICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdzZWN1cml0eScgICAgICAgICAgLCB0aGlzLm5vbmNlc1snZ2V0c2ltaWxhcnN0cmluZyddKVxuICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdvcmlnaW5hbF9zdHJpbmcnICAgLCB0aGlzLnN0cmluZy5vcmlnaW5hbClcbiAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCgnbGFuZ3VhZ2UnICAgICAgICAgICwgdGhpcy5sYW5ndWFnZUNvZGUpXG4gICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3NlbGVjdG9yJyAgICAgICAgICAsIHRoaXMuc3RyaW5nLnNlbGVjdG9yKVxuICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdudW1iZXInICAgICAgICAgICAgLCAzKVxuXG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXG4gICAgICAgICAgICAgICAgYXhpb3MucG9zdCh0aGlzLmFqYXhfdXJsLCBkYXRhKVxuICAgICAgICAgICAgICAgICAgICAudGhlbihmdW5jdGlvbiAocmVzcG9uc2UpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdWdnZXN0aW9ucyA9IHJlc3BvbnNlLmRhdGFcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBpXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGZvciAoaSA9IHN1Z2dlc3Rpb25zLmxlbmd0aCAtIDE7IGkgPj0gMDsgLS1pKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc3VnZ2VzdGlvbnNbaV1bJ3NpbWlsYXJpdHknXSA9IE1hdGgucm91bmQoc2ltaWxhcml0eS5jb21wYXJlVHdvU3RyaW5ncyhzZWxmLnN0cmluZy5vcmlnaW5hbCxzdWdnZXN0aW9uc1tpXVsnb3JpZ2luYWwnXSkqMTAwKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN1Z2dlc3Rpb25zW2ldWydvcmlnaW5hbCddID0gc2ltcGxlZGlmZi5odG1sRGlmZihzZWxmLnN0cmluZy5vcmlnaW5hbCwgc3VnZ2VzdGlvbnNbaV1bJ29yaWdpbmFsJ10pXG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3VnZ2VzdGlvbnNbaV1bJ3NpbWlsYXJpdHknXSA8IDcwICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdWdnZXN0aW9ucy5zcGxpY2UoaSwgMSk7IC8vIGRyb3Agc3VnZ2VzdGlvbnMgbGVzcyB0aGVuIDcwJVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5zdWdnZXN0aW9ucyA9IHN1Z2dlc3Rpb25zXG4gICAgICAgICAgICAgICAgICAgICAgICBpZiAoc3VnZ2VzdGlvbnMubGVuZ3RoID4gMCl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZi5hdmFpbGFibGVfc3VnZ2VzdGlvbnMgPSB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIC5jYXRjaChmdW5jdGlvbiAoZXJyb3IpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIGNvbnNvbGUubG9nKGVycm9yKVxuICAgICAgICAgICAgICAgICAgICB9KTtcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjb3B5KHRyYW5zbGF0ZWQpe1xuICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudHN0cmluZy50cmFuc2xhdGlvbnNBcnJheVt0aGlzLmxhbmd1YWdlQ29kZV0uZWRpdGVkVHJhbnNsYXRpb24gPSB0cmFuc2xhdGVkXG5cbiAgICAgICAgICAgICAgICAvLyB3aHkgbm8gc3RvcmUgZm9yIHlvdT8gR28gd2l0aCBzZXRUaW1lb3V0LlxuICAgICAgICAgICAgICAgIHNldFRpbWVvdXQoZnVuY3Rpb24oKXtcbiAgICAgICAgICAgICAgICAgICAgYXV0b3NpemUudXBkYXRlKGRvY3VtZW50LnF1ZXJ5U2VsZWN0b3JBbGwoJy50cnAtdGV4dGFyZWEnKSlcbiAgICAgICAgICAgICAgICB9LCA1MCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH1cbiAgICB9XG48L3NjcmlwdD5cbiJdLCJzb3VyY2VSb290IjoiIn0=\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/components/translation-memory.vue?vue&type=script&lang=js&\n");
|
754 |
|
755 |
/***/ }),
|
756 |
|
762 |
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
763 |
|
764 |
"use strict";
|
765 |
+
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var select2_dist_js_select2_min_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! select2/dist/js/select2.min.js */ \"./node_modules/select2/dist/js/select2.min.js\");\n/* harmony import */ var select2_dist_js_select2_min_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(select2_dist_js_select2_min_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./assets/src/js/utils.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! axios */ \"./node_modules/axios/index.js\");\n/* harmony import */ var axios__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(axios__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _components_language_boxes_vue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/language-boxes.vue */ \"./assets/src/js/components/language-boxes.vue\");\n/* harmony import */ var _components_save_translations_vue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/save-translations.vue */ \"./assets/src/js/components/save-translations.vue\");\n/* harmony import */ var _components_hover_actions_vue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/hover-actions.vue */ \"./assets/src/js/components/hover-actions.vue\");\n/* harmony import */ var _components_extra_content_vue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/extra-content.vue */ \"./assets/src/js/components/extra-content.vue\");\n/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! he */ \"./node_modules/he/he.js\");\n/* harmony import */ var he__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(he__WEBPACK_IMPORTED_MODULE_7__);\nfunction _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread(); }\n\nfunction _nonIterableSpread() { throw new TypeError(\"Invalid attempt to spread non-iterable instance\"); }\n\nfunction _iterableToArray(iter) { if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === \"[object Arguments]\") return Array.from(iter); }\n\nfunction _arrayWithoutHoles(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } }\n\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n props: ['trp_settings', 'language_names', 'ordered_secondary_languages', 'current_language', 'on_screen_language', 'view_as_roles', 'url_to_load', 'string_selectors', 'data_attributes', 'ajax_url', 'editor_nonces', 'string_group_order', 'merge_rules', 'localized_text', 'paid_version', 'flags_path'],\n components: {\n languageBoxes: _components_language_boxes_vue__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n saveTranslations: _components_save_translations_vue__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n hoverActions: _components_hover_actions_vue__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n extraContent: _components_extra_content_vue__WEBPACK_IMPORTED_MODULE_6__[\"default\"]\n },\n data: function data() {\n return {\n //props\n settings: JSON.parse(this.trp_settings),\n languageNames: JSON.parse(this.language_names),\n orderedSecondaryLanguages: JSON.parse(this.ordered_secondary_languages),\n roles: JSON.parse(this.view_as_roles),\n nonces: JSON.parse(this.editor_nonces),\n stringGroupOrder: JSON.parse(this.string_group_order),\n selectors: JSON.parse(this.string_selectors),\n dataAttributes: JSON.parse(this.data_attributes),\n mergeRules: JSON.parse(this.merge_rules),\n editorStrings: trp_localized_strings,\n flagsPath: JSON.parse(this.flags_path),\n //data\n currentLanguage: this.current_language,\n onScreenLanguage: this.on_screen_language,\n currentURL: this.url_to_load,\n urlToLoad: this.url_to_load,\n iframe: '',\n dictionary: [],\n selectedString: null,\n selectedIndexesArray: [],\n detectedSelectorAndId: [],\n stringGroups: [],\n mergingString: false,\n mergeData: [],\n showChangesUnsavedMessage: false,\n viewAs: '',\n loading_strings: 0,\n translationNotLoadedYet: false\n };\n },\n created: function created() {\n this.settings['default-language-name'] = this.languageNames[this.settings['default-language']]; //set default value for the View As select\n\n var params = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getUrlParameters(this.currentURL);\n if (Object.keys(params).length > 1 && params['trp-view-as']) this.viewAs = params['trp-view-as'];else this.viewAs = 'current_user';\n },\n mounted: function mounted() {\n this.addKeyboardShortcutsListener();\n var self = this; // initialize select2\n\n jQuery('#trp-language-select, #trp-view-as-select').select2({\n width: '100%'\n }); //init strings dropdown\n\n this.stringsDropdownLoading(); // show overlay when select is opened\n\n jQuery('#trp-language-select, #trp-string-categories').on('select2:open', function () {\n jQuery('#trp_select2_overlay').fadeIn('100');\n }).on('select2:close', function () {\n jQuery('#trp_select2_overlay').hide();\n }).on('select2:opening', function (e) {\n /* when we have unsaved changes prevent the strings dropdown from opening so we do not have a disconnect between the textareas and the dropdown */\n if (self.hasUnsavedChanges()) {\n e.preventDefault();\n }\n }); // resize sidebar and consequently the iframe\n\n var previewContainer = jQuery('#trp-preview');\n var total_width = jQuery(window).width();\n jQuery('#trp-controls').resizable({\n start: function start() {\n previewContainer.toggle();\n },\n stop: function stop() {\n previewContainer.toggle();\n },\n handles: 'e',\n minWidth: 285,\n maxWidth: total_width - 20\n }).bind(\"resize\", this.resizeIframe); // resize iframe when resizing window\n\n jQuery(window).resize(function () {\n self.resizeIframe();\n });\n },\n watch: {\n currentLanguage: function currentLanguage(_currentLanguage) {\n var self = this; //grab the correct URL from the iFrame\n\n var newURL = this.iframe.querySelector('link[hreflang=\"' + _currentLanguage.replace('_', '-') + '\"]').getAttribute('href');\n this.currentURL = newURL;\n this.iframe.location = newURL; //reset vue props\n\n this.selectedString = '';\n this.selectedIndexesArray = []; //set strings dropdown to loading state\n\n jQuery('#trp-string-categories').val('').trigger('change');\n this.stringsDropdownLoading();\n this.onScreenLanguage = _currentLanguage;\n\n if (this.settings['default-language'] == this.currentLanguage && this.settings['translation-languages'].length > 1) {\n this.settings['translation-languages'].some(function (language) {\n if (language != self.settings['default-language']) {\n // return the first language not default\n self.onScreenLanguage = language;\n return true;\n }\n });\n }\n },\n currentURL: function currentURL(newUrl, oldUrl) {\n window.history.replaceState(null, null, this.parentURL(newUrl));\n },\n viewAs: function viewAs(role) {\n if (!this.currentURL || !this.iframe) return;\n var url = this.cleanURL(this.currentURL);\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].updateUrlParameter(url, 'trp-edit-translation', 'preview');\n\n if (role == 'current_user') {\n this.iframe.location = url;\n return;\n } //if nonce not available, an update to the Browse as Other Roles add-on is required\n\n\n if (!this.nonces[role]) {\n alert(this.editorStrings.bor_update_notice);\n return;\n }\n\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].updateUrlParameter(url, 'trp-view-as', role);\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].updateUrlParameter(url, 'trp-view-as-nonce', this.nonces[role]);\n this.iframe.location = url;\n },\n selectedString: function selectedString(selectedStringArrayIndex, oldString) {\n if (this.hasUnsavedChanges() || !selectedStringArrayIndex && selectedStringArrayIndex !== 0) return;\n jQuery('#trp-string-categories').val(selectedStringArrayIndex !== null ? selectedStringArrayIndex : '').trigger('change');\n var selectedString = this.dictionary[selectedStringArrayIndex];\n if (!selectedString) return;\n var currentNode = this.iframe.querySelector(\"[\" + selectedString.selector + \"='\" + selectedString.dbID + \"']\");\n var selectedIndexesArray = []; //when merging we do not have a valid current node, so we just add the fake id\n\n if (currentNode) {\n var self = this;\n var selectors = self.getAllSelectors();\n var nodes = [];\n nodes.push(currentNode);\n\n if (currentNode.tagName != \"A\") {\n // include the anchor's translatable attributes\n var anchorParent = currentNode.closest('a');\n\n if (anchorParent != null) {\n nodes.push(anchorParent);\n }\n }\n\n if (currentNode.tagName == \"A\" && currentNode.children.length > 0) {\n // include all the translatable attributes inside the anchor\n var childrenArray = _toConsumableArray(currentNode.children);\n\n childrenArray.forEach(function (child) {\n nodes.push(child);\n });\n }\n\n nodes.forEach(function (node) {\n selectors.forEach(function (selector) {\n var stringId = node.getAttribute(selector);\n\n if (stringId) {\n var found = false;\n var i;\n\n for (i = 0; i < selectedIndexesArray.length; i++) {\n if (typeof self.dictionary[selectedIndexesArray[i]] !== 'undefined' && self.dictionary[selectedIndexesArray[i]].dbID !== 'undefined' && self.dictionary[selectedIndexesArray[i]].dbID === stringId) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n selectedIndexesArray.push(self.getStringIndex(selector, stringId));\n }\n }\n });\n });\n } else selectedIndexesArray.push(selectedStringArrayIndex);\n\n this.selectedIndexesArray = selectedIndexesArray;\n }\n },\n computed: {\n closeURL: function closeURL() {\n return this.cleanURL(this.currentURL);\n }\n },\n methods: {\n iFrameLoaded: function iFrameLoaded() {\n var self = this;\n var iframeElement = document.querySelector('#trp-preview-iframe');\n this.iframe = iframeElement.contentDocument || iframeElement.contentWindow.document; //sync iFrame URL with parent\n\n if (this.currentURL != this.iframe.URL) this.currentURL = this.iframe.URL; //hide iFrame loader\n\n this.iframeLoader('hide');\n self.detectedSelectorAndId = [];\n self.dictionary = [];\n this.scanIframeForStrings();\n window.addEventListener('trp_iframe_page_updated', this.scanIframeForStrings); //event that is fired when the iFrame is navigated\n\n iframeElement.contentWindow.onbeforeunload = function () {\n self.iframeLoader('show');\n self.selectedString = null;\n self.selectedIndexesArray = [];\n self.translationNotLoadedYet = false;\n self.stringsDropdownLoading();\n };\n },\n scanIframeForStrings: function scanIframeForStrings() {\n this.scanForSelector('data-trp-translate-id', 'regular', this.onScreenLanguage);\n this.scanForSelector('data-trpgettextoriginal', 'gettext', this.currentLanguage);\n this.scanForSelector('data-trp-post-slug', 'postslug', this.currentLanguage);\n },\n scanForSelector: function scanForSelector(baseSelector, typeSlug, languageOfIds) {\n this.loading_strings++;\n var self = this;\n var selectors = this.prepareSelectorStrings(baseSelector);\n\n var nodes = _toConsumableArray(this.iframe.querySelectorAll('[' + selectors.join('],[') + ']'));\n\n var stringIdsArray = [],\n nodeData = [],\n nodeEntries = [];\n nodes.forEach(function (node) {\n nodeEntries = self.getNodeInfo(node, baseSelector);\n nodeEntries.forEach(function (entry) {\n // this check ensures that we don't create duplicates when rescanning after ajax complete\n if (!self.alreadyDetected(entry.selector, entry.dbID)) {\n stringIdsArray.push(entry.dbID);\n nodeData.push(entry);\n }\n });\n self.setupEventListener(node);\n }); //unique ids only\n\n stringIdsArray = _toConsumableArray(new Set(stringIdsArray));\n\n if (stringIdsArray.length > 0) {\n var data = new FormData();\n data.append('action', 'trp_get_translations_' + typeSlug);\n data.append('all_languages', 'true');\n data.append('security', this.nonces['gettranslationsnonce' + typeSlug]);\n data.append('language', languageOfIds);\n data.append('string_ids', JSON.stringify(stringIdsArray));\n axios__WEBPACK_IMPORTED_MODULE_2___default.a.post(this.ajax_url, data).then(function (response) {\n self.loading_strings--;\n self.addToDictionary(response.data, nodeData);\n })[\"catch\"](function (error) {\n console.log(error);\n });\n } else {\n self.loading_strings--;\n }\n },\n alreadyDetected: function alreadyDetected(selector, dbId) {\n var combined = selector + '=' + dbId;\n\n if (_utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].arrayContainsItem(this.detectedSelectorAndId, combined)) {\n return true;\n } else {\n this.detectedSelectorAndId.push(combined);\n return false;\n }\n },\n setupEventListener: function setupEventListener(node) {\n if (node.tagName == 'A' && !node.hasAttribute('data-trpgettextoriginal')) return false;\n var self = this;\n node.addEventListener('mouseenter', self.$refs.hoverActions.showPencilIcon);\n },\n addToDictionary: function addToDictionary(responseData) {\n var nodeInfo = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;\n var self = this;\n\n if (responseData != null) {\n if (nodeInfo) {\n nodeInfo.forEach(function (infoRow, index) {\n responseData.some(function (responseDataRow) {\n if (infoRow.dbID == responseDataRow.dbID) {\n //bring block_type to the top level object\n if (responseDataRow.type != 'gettext' && typeof responseDataRow.block_type == 'undefined') {\n var firstLanguage = self.orderedSecondaryLanguages[0];\n if (typeof responseDataRow.translationsArray[firstLanguage].block_type != 'undefined') responseDataRow.block_type = responseDataRow.translationsArray[firstLanguage].block_type;\n }\n\n nodeInfo[index] = Object.assign({}, responseDataRow, infoRow);\n return true; // a sort of break\n }\n });\n });\n } else {\n nodeInfo = responseData;\n }\n\n this.stringGroups = this.addToStringGroups(nodeInfo);\n this.dictionary = this.dictionary.concat(nodeInfo);\n this.initStringsDropdown();\n }\n },\n addToStringGroups: function addToStringGroups(strings) {\n // see what node groups are found\n var foundStringGroups = this.stringGroups;\n strings.forEach(function (string) {\n if (foundStringGroups.indexOf(string.group) === -1 && (typeof string.blockType === 'undefined' || string.blockType !== '2')) {\n foundStringGroups.push(string.group);\n }\n }); // put the node groups in the order that we want, according to the prop this.stringGroupOrder\n\n var orderedStringGroups = [];\n\n if (this.editorStrings.seo_update_notice != 'seo_pack_update_not_needed') {\n orderedStringGroups.push(this.editorStrings.seo_update_notice);\n }\n\n this.stringGroupOrder.forEach(function (group) {\n if (foundStringGroups.indexOf(group) !== -1) {\n orderedStringGroups.push(group);\n }\n }); // if there were any other string groups that were not in the prop, add them at the end.\n\n foundStringGroups.forEach(function (group) {\n if (orderedStringGroups.indexOf(group) === -1) {\n orderedStringGroups.push(group);\n }\n });\n return orderedStringGroups;\n },\n getStringIndex: function getStringIndex(selector, dbID) {\n var found = null;\n this.dictionary.some(function (string, index) {\n if (string.dbID == dbID && string.selector == selector) {\n found = index;\n return true;\n }\n });\n return found;\n },\n getNodeInfo: function getNodeInfo(node) {\n var baseSelector = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var stringId;\n var nodeData = [];\n var selectors = this.prepareSelectorStrings(baseSelector);\n selectors.forEach(function (selector) {\n stringId = node.getAttribute(selector);\n\n if (stringId) {\n var nodeAttribute = selector.replace(baseSelector, '');\n var nodeGroup = node.getAttribute('data-trp-node-group' + nodeAttribute);\n var nodeDescription = node.getAttribute('data-trp-node-description' + nodeAttribute);\n var entry = {\n dbID: stringId,\n selector: selector,\n attribute: nodeAttribute.substr(1) // substr(1) is used to trim prefixing line - ex. -alt will result in alt (no line)\n\n };\n if (nodeGroup) entry.group = nodeGroup;\n if (nodeDescription) entry.description = nodeDescription;\n nodeData.push(entry);\n }\n });\n return nodeData;\n },\n getAllSelectors: function getAllSelectors() {\n var selectors = [];\n var self = this;\n this.dataAttributes.forEach(function (dataAttribute) {\n selectors = selectors.concat(self.prepareSelectorStrings(dataAttribute));\n });\n return selectors;\n },\n prepareSelectorStrings: function prepareSelectorStrings(baseNameSelector) {\n var parsed_selectors = [];\n this.selectors.forEach(function (selectorSuffix, index) {\n parsed_selectors.push(baseNameSelector + selectorSuffix);\n });\n return parsed_selectors;\n },\n parentURL: function parentURL(url) {\n return url.replace('trp-edit-translation=preview', 'trp-edit-translation=true');\n },\n cleanURL: function cleanURL(url) {\n //make removeUrlParameter recursive and only call it once with all the parameters that\n //need to stripped ?\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removeUrlParameter(url, 'lang');\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removeUrlParameter(url, 'trp-view-as');\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removeUrlParameter(url, 'trp-view-as-nonce');\n url = _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].removeUrlParameter(url, 'trp-edit-translation');\n return url;\n },\n showString: function showString(string, type) {\n if (typeof string.blockType !== 'undefined' && string.blockType === '2') {\n // don't show deprecated translation blocks in the dropdown\n return false;\n }\n\n if (type === this.editorStrings.images && typeof string.attribute != 'undefined' && string.attribute == 'src') return true;\n if (typeof string.attribute !== 'undefined' && (string.attribute == 'href' || string.attribute == 'src')) return false;\n if (string.group === type) return true;\n return false;\n },\n initStringsDropdown: function initStringsDropdown() {\n var self = this;\n\n if (!this.isStringsDropdownOpen()) {\n jQuery('#trp-string-categories').select2('destroy');\n jQuery('#trp-string-categories').select2({\n placeholder: self.editorStrings.select_string,\n templateResult: function templateResult(option) {\n var original = he__WEBPACK_IMPORTED_MODULE_7___default.a.decode(option.text.substring(0, 90)) + (option.text.length <= 90 ? '' : '...');\n var description = option.title ? '(' + option.title + ')' : '';\n return jQuery('<div>' + original + '</div><div class=\"string-selector-description\">' + description + '</div>');\n },\n width: '100%'\n }).prop('disabled', false);\n jQuery('#trp_select2_overlay').hide();\n }\n },\n stringsDropdownLoading: function stringsDropdownLoading() {\n jQuery('#trp-string-categories').select2({\n placeholder: this.editorStrings.strings_loading,\n width: '100%'\n }).prop('disabled', true);\n },\n processOptionName: function processOptionName(name, type) {\n if (type == 'Images') return _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getFilename(name);\n return _utils__WEBPACK_IMPORTED_MODULE_1__[\"default\"].escapeHtml(name);\n },\n isStringsDropdownOpen: function isStringsDropdownOpen() {\n return jQuery('#trp-string-categories').select2('isOpen');\n },\n hasUnsavedChanges: function hasUnsavedChanges() {\n var unsavedChanges = false;\n var self = this;\n\n if (this.selectedIndexesArray.length > 0) {\n this.selectedIndexesArray.forEach(function (selectedIndex) {\n self.settings['translation-languages'].forEach(function (languageCode) {\n if (self.dictionary[selectedIndex] && self.dictionary[selectedIndex].translationsArray[languageCode] && self.dictionary[selectedIndex].translationsArray[languageCode].translated !== self.dictionary[selectedIndex].translationsArray[languageCode].editedTranslation) {\n unsavedChanges = true;\n }\n });\n });\n }\n\n this.showChangesUnsavedMessage = unsavedChanges;\n return unsavedChanges;\n },\n iframeLoader: function iframeLoader(status) {\n var loader = document.getElementById('trp-preview-loader');\n if (status == 'show') loader.style.display = 'flex';else if (status == 'hide') loader.style.display = 'none';\n },\n previousString: function previousString() {\n var currentValue = document.getElementById('trp-string-categories').value;\n var newValue = +currentValue - 1;\n\n while (newValue >= 0 && document.querySelectorAll('#trp-string-categories option[value=\"' + newValue + '\"]').length === 0) {\n newValue--;\n }\n\n if (newValue < 0) return;\n this.selectedString = newValue.toString();\n },\n nextString: function nextString() {\n var currentValue = document.getElementById('trp-string-categories').value,\n newValue = 0;\n if (currentValue != '') newValue = +currentValue + 1;\n\n while (newValue < this.dictionary.length && document.querySelectorAll('#trp-string-categories option[value=\"' + newValue + '\"]').length === 0) {\n newValue++;\n }\n\n if (newValue >= this.dictionary.length) {\n return;\n }\n\n this.selectedString = newValue.toString();\n },\n addKeyboardShortcutsListener: function addKeyboardShortcutsListener() {\n document.addEventListener(\"keydown\", function (e) {\n if ((window.navigator.platform.match(\"Mac\") ? e.metaKey : e.ctrlKey) && e.altKey) {\n // CTRL + ALT + right arrow\n if (e.keyCode === 39) {\n e.preventDefault();\n window.dispatchEvent(new Event('trp_trigger_next_string_event'));\n } else {\n // CTRL + ALT + left arrow\n if (e.keyCode === 37) {\n e.preventDefault();\n window.dispatchEvent(new Event('trp_trigger_previous_string_event'));\n }\n }\n }\n }, false);\n window.addEventListener('trp_trigger_next_string_event', this.nextString);\n window.addEventListener('trp_trigger_previous_string_event', this.previousString);\n },\n resizeIframe: function resizeIframe(event, ui) {\n var total_width = jQuery(window).width();\n var width = jQuery('#trp-controls').width();\n\n if (width > total_width) {\n width = total_width;\n controls.css('width', width);\n }\n\n var previewContainer = jQuery('#trp-preview');\n previewContainer.css('right', width);\n previewContainer.css('left', width - 348);\n previewContainer.css('width', total_width - width);\n }\n },\n //add support for v-model in select2\n directives: {\n select2: {\n inserted: function inserted(el) {\n jQuery(el).on('select2:select', function () {\n var event = new Event('change', {\n bubbles: true,\n cancelable: true\n });\n el.dispatchEvent(event);\n });\n jQuery(el).on('select2:unselect', function () {\n var event = new Event('change', {\n bubbles: true,\n cancelable: true\n });\n el.dispatchEvent(event);\n });\n }\n }\n }\n});//# sourceURL=[module]\n//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8vYXNzZXRzL3NyYy9qcy9lZGl0b3IudnVlP2E3NjUiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ij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iPlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgY2xhc3M9XCJ0cnAtc3Bpbm5lclwiPjwvZGl2PlxuICAgICAgICAgICAgICAgICAgICAgICAgPC9zcGFuPlxuICAgICAgICAgICAgICAgICAgICAgICAgPHNhdmUtdHJhbnNsYXRpb25zXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpzZWxlY3RlZEluZGV4ZXNBcnJheT1cInNlbGVjdGVkSW5kZXhlc0FycmF5XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOmRpY3Rpb25hcnk9XCJkaWN0aW9uYXJ5XCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOnNldHRpbmdzPVwic2V0dGluZ3NcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6bm9uY2VzPVwibm9uY2VzXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOmFqYXhfdXJsPVwiYWpheF91cmxcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6Y3VycmVudExhbmd1YWdlPVwiY3VycmVudExhbmd1YWdlXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOm9uU2NyZWVuTGFuZ3VhZ2U9XCJvblNjcmVlbkxhbmd1YWdlXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOmlmcmFtZT1cImlmcmFtZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpjdXJyZW50VVJMPVwiY3VycmVudFVSTFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDptZXJnaW5nU3RyaW5nPVwibWVyZ2luZ1N0cmluZ1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDptZXJnZURhdGE9XCJtZXJnZURhdGFcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBAdHJhbnNsYXRpb25zLXNhdmVkPVwic2hvd0NoYW5nZXNVbnNhdmVkTWVzc2FnZSA9IGZhbHNlXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOmVkaXRvclN0cmluZ3M9XCJlZGl0b3JTdHJpbmdzXCJcbiAgICAgICAgICAgICAgICAgICAgICAgID5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvc2F2ZS10cmFuc2xhdGlvbnM+XG4gICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuICAgICAgICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRycC1jb250cm9scy1zZWN0aW9uXCI+XG5cbiAgICAgICAgICAgICAgICAgICAgPGRpdiBjbGFzcz1cInRycC1jb250cm9scy1zZWN0aW9uLWNvbnRlbnRcIj5cbiAgICAgICAgICAgICAgICAgICAgICAgIDxkaXYgaWQ9XCJ0cnAtbGFuZ3VhZ2Utc3dpdGNoXCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNlbGVjdCBpZD1cInRycC1sYW5ndWFnZS1zZWxlY3RcIiBuYW1lPVwibGFuZ1wiIHYtbW9kZWw9XCJjdXJyZW50TGFuZ3VhZ2VcIiB2LXNlbGVjdDI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDxvcHRpb24gdi1mb3I9XCIobGFuZywgbGFuZ0luZGV4KSBpbiBsYW5ndWFnZU5hbWVzXCIgOnZhbHVlPVwibGFuZ0luZGV4XCI+e3tsYW5nfX08L29wdGlvbj5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA8L3NlbGVjdD5cbiAgICAgICAgICAgICAgICAgICAgICAgIDwvZGl2PlxuXG4gICAgICAgICAgICAgICAgICAgICAgICA8ZGl2IGlkPVwidHJwLXN0cmluZy1saXN0XCI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgPHNlbGVjdCBpZD1cInRycC1zdHJpbmctY2F0ZWdvcmllc1wiIHYtbW9kZWw9XCJzZWxlY3RlZFN0cmluZ1wiIHYtc2VsZ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93PVwic2VsZWN0ZWRTdHJpbmcgIT09IG51bGxcIj5cbiAgICAgICAgICAgICAgICAgICAgPGxhbmd1YWdlLWJveGVzXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOnNlbGVjdGVkSW5kZXhlc0FycmF5PVwic2VsZWN0ZWRJbmRleGVzQXJyYXlcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpkaWN0aW9uYXJ5PVwiZGljdGlvbmFyeVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOmN1cnJlbnRMYW5ndWFnZT1cImN1cnJlbnRMYW5ndWFnZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOm9uU2NyZWVuTGFuZ3VhZ2U9XCJvblNjcmVlbkxhbmd1YWdlXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6bGFuZ3VhZ2VOYW1lcz1cImxhbmd1YWdlTmFtZXNcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDpzZXR0aW5ncz1cInNldHRpbmdzXCJcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICA6c2hvd0NoYW5nZXNVbnNhdmVkTWVzc2FnZT1cInNob3dDaGFuZ2VzVW5zYXZlZE1lc3NhZ2VcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIEBkaXNjYXJkZWQtY2hhbmdlcz1cImhhc1Vuc2F2ZWRDaGFuZ2VzKClcIlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIDplZGl0b3JTdHJpbmdzPVwiZWRpdG9yU3RyaW5nc1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOmZsYWdzUGF0aD1cImZsYWdzUGF0aFwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOmlmcmFtZT1cImlmcmFtZVwiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOm5vbmNlcz1cIm5vbmNlc1wiXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgOmFqYXhfdXJsPVwiYWpheF91cmxc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gICAgICdzdHJpbmdfc2VsZWN0b3JzJyxcbiAgICAgICAgICAgICdkYXRhX2F0dHJpYnV0ZXMnLFxuICAgICAgICAgICAgJ2FqYXhfdXJsJyxcbiAgICAgICAgICAgICdlZGl0b3Jfbm9uY2VzJyxcbiAgICAgICAgICAgICdzdHJpbmdfZ3JvdXBfb3JkZXInLFxuICAgICAgICAgICAgJ21lcmdlX3J1bGVzJyxcbiAgICAgICAgICAgICdsb2NhbGl6ZWRfdGV4dCcsXG4gICAgICAgICAgICAncGFpZF92ZXJzaW9uJyxcbiAgICAgICAgICAgICdmbGFnc19wYXRoJ1xuICAgICAgICBdLFxuICAgICAgICBjb21wb25lbnRzOntcbiAgICAgICAgICAgIGxhbmd1YWdlQm94ZXMsXG4gICAgICAgICAgICBzYXZlVHJhbnNsYXRpb25zLFxuICAgICAgICAgICAgaG92ZXJBY3Rpb25zLFxuICAgICAgICAgICAgZXh0cmFDb250ZW50XG4gICAgICAgIH0sXG4gICAgICAgIGRhdGEoKXtcbiAgICAgICAgICAgIHJldHVybiB7XG4gICAgICAgICAgICAgICAgLy9wcm9wc1xuICAgICAgICAgICAgICAgIHNldHRpbmdzICAgICAgICAgICAgICAgICAgOiBKU09OLnBhcnNlKCB0aGlzLnRycF9zZXR0aW5ncyApLFxuICAgICAgICAgICAgICAgIGxhbmd1YWdlTmFtZXMgICAgICAgICAgICAgOiBKU09OLnBhcnNlKCB0aGlzLmxhbmd1YWdlX25hbWVzICksXG4gICAgICAgICAgICAgICAgb3JkZXJlZFNlY29uZGFyeUxhbmd1YWdlcyA6IEpTT04ucGFyc2UoIHRoaXMub3JkZXJlZF9zZWNvbmRhcnlfbGFuZ3VhZ2VzICksXG4gICAgICAgICAgICAgICAgcm9sZXMgICAgICAgICAgICAgICAgICAgICA6IEpTT04ucGFyc2UoIHRoaXMudmlld19hc19yb2xlcyApLFxuICAgICAgICAgICAgICAgIG5vbmNlcyAgICAgICAgICAgICAgICAgICAgOiBKU09OLnBhcnNlKCB0aGlzLmVkaXRvcl9ub25jZXMpLFxuICAgICAgICAgICAgICAgIHN0cmluZ0dyb3VwT3JkZXIgICAgICAgICAgOiBKU09OLnBhcnNlKCB0aGlzLnN0cmluZ19ncm91cF9vcmRlciksXG4gICAgICAgICAgICAgICAgc2VsZWN0b3JzICAgICAgICAgICAgICAgICA6IEpTT04ucGFyc2UoIHRoaXMuc3RyaW5nX3NlbGVjdG9ycyApLFxuICAgICAgICAgICAgICAgIGRhdGFBdHRyaWJ1dGVzICAgICAgICAgICAgOiBKU09OLnBhcnNlKCB0aGlzLmRhdGFfYXR0cmlidXRlcyApLFxuICAgICAgICAgICAgICAgIG1lcmdlUnVsZXMgICAgICAgICAgICAgICAgOiBKU09OLnBhcnNlKCB0aGlzLm1lcmdlX3J1bGVzICksXG4gICAgICAgICAgICAgICAgZWRpdG9yU3RyaW5ncyAgICAgICAgICAgICA6IHRycF9sb2NhbGl6ZWRfc3RyaW5ncyxcbiAgICAgICAgICAgICAgICBmbGFnc1BhdGggICAgICAgICAgICAgICAgIDogSlNPTi5wYXJzZSggdGhpcy5mbGFnc19wYXRoICksXG4gICAgICAgICAgICAgICAgLy9kYXRhXG4gICAgICAgICAgICAgICAgY3VycmVudExhbmd1YWdlICAgICAgICAgICA6IHRoaXMuY3VycmVudF9sYW5ndWFnZSxcbiAgICAgICAgICAgICAgICBvblNjcmVlbkxhbmd1YWdlICAgICAgICAgIDogdGhpcy5vbl9zY3JlZW5fbGFuZ3VhZ2UsXG4gICAgICAgICAgICAgICAgY3VycmVudFVSTCAgICAgICAgICAgICAgICA6IHRoaXMudXJsX3RvX2xvYWQsXG4gICAgICAgICAgICAgICAgdXJsVG9Mb2FkICAgICAgICAgICAgICAgICA6IHRoaXMudXJsX3RvX2xvYWQsXG4gICAgICAgICAgICAgICAgaWZyYW1lICAgICAgICAgICAgICAgICAgICA6ICcnLFxuICAgICAgICAgICAgICAgIGRpY3Rpb25hcnkgICAgICAgICAgICAgICAgOiBbXSxcbiAgICAgICAgICAgICAgICBzZWxlY3RlZFN0cmluZyAgICAgICAgICAgIDogbnVsbCxcbiAgICAgICAgICAgICAgICBzZWxlY3RlZEluZGV4ZXNBcnJheSAgICAgIDogW10sXG4gICAgICAgICAgICAgICAgZGV0ZWN0ZWRTZWxlY3RvckFuZElkICAgICA6IFtdLFxuICAgICAgICAgICAgICAgIHN0cmluZ0dyb3VwcyAgICAgICAgICAgICAgOiBbXSxcbiAgICAgICAgICAgICAgICBtZXJnaW5nU3RyaW5nICAgICAgICAgICAgIDogZmFsc2UsXG4gICAgICAgICAgICAgICAgbWVyZ2VEYXRhICAgICAgICAgICAgICAgICA6IFtdLFxuICAgICAgICAgICAgICAgIHNob3dDaGFuZ2VzVW5zYXZlZE1lc3NhZ2UgOiBmYWxzZSxcbiAgICAgICAgICAgICAgICB2aWV3QXMgICAgICAgICAgICAgICAgICAgIDogJycsXG4gICAgICAgICAgICAgICAgbG9hZGluZ19zdHJpbmdzICAgICAgICAgICA6IDAsXG4gICAgICAgICAgICAgICAgdHJhbnNsYXRpb25Ob3RMb2FkZWRZZXQgICA6IGZhbHNlLFxuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBjcmVhdGVkKCl7XG4gICAgICAgICAgICB0aGlzLnNldHRpbmdzWydkZWZhdWx0LWxhbmd1YWdlLW5hbWUnXSA9IHRoaXMubGFuZ3VhZ2VOYW1lc1sgdGhpcy5zZXR0aW5nc1snZGVmYXVsdC1sYW5ndWFnZSddIF1cblxuICAgICAgICAgICAgLy9zZXQgZGVmYXVsdCB2YWx1ZSBmb3IgdGhlIFZpZXcgQXMgc2VsZWN0XG4gICAgICAgICAgICBsZXQgcGFyYW1zID0gdXRpbHMuZ2V0VXJsUGFyYW1ldGVycyggdGhpcy5jdXJyZW50VVJMIClcblxuICAgICAgICAgICAgaWYoIE9iamVjdC5rZXlzKHBhcmFtcykubGVuZ3RoID4gMSAmJiBwYXJhbXNbJ3RycC12aWV3LWFzJ10gKVxuICAgICAgICAgICAg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SB1bnNhdmVkIGNoYW5nZXMgcHJldmVudCB0aGUgc3RyaW5ncyBkcm9wZG93biBmcm9tIG9wZW5pbmcgc28gd2UgZG8gbm90IGhhdmUgYSBkaXNjb25uZWN0IGJldHdlZW4gdGhlIHRleHRhcmVhcyBhbmQgdGhlIGRyb3Bkb3duICovXG4gICAgICAgICAgICAgICAgaWYgKHNlbGYuaGFzVW5zYXZlZENoYW5nZXMoKSkge1xuICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KClcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAvLyByZXNpemUgc2lkZWJhciBhbmQgY29uc2VxdWVudGx5IHRoZSBpZnJhbWVcbiAgICAgICAgICAgIGxldCBwcmV2aWV3Q29udGFpbmVyID0galF1ZXJ5KCAnI3RycC1wcmV2aWV3JyApO1xuICAgICAgICAgICAgbGV0IHRvdGFsX3dpZHRoID0galF1ZXJ5KHdpbmRvdykud2lkdGgoKTtcbiAgICAgICAgICAgIGpRdWVyeSggJyN0cnAtY29udHJvbHMnICkucmVzaXphYmxlKHtcbiAgICAgICAgICAgICAgICBzdGFydDogZnVuY3Rpb24oICkgeyBwcmV2aWV3Q29udGFpbmVyLnRvZ2dsZSgpOyB9LFxuICAgICAgICAgICAgICAgIHN0b3A6IGZ1bmN0aW9uKCApIHsgcHJldmlld0NvbnRhaW5lci50b2dnbGUoKTsgfSxcbiAgICAgICAgICAgICAgICBoYW5kbGVzOiAnZScsXG4gICAgICAgICAgICAgICAgbWluV2lkdGg6IDI4NSxcbiAgICAgICAgICAgICAgICBtYXhXaWR0aDogdG90YWxfd2lkdGggLSAyMFxuICAgICAgICAgICAgfSkuYmluZCggXCJyZXNpemVcIiwgdGhpcy5yZXNpemVJZnJhbWUgKTtcblxuICAgICAgICAgICAgLy8gcmVzaXplIGlmcmFtZSB3aGVuIHJlc2l6aW5nIHdpbmRvd1xuICAgICAgICAgICAgalF1ZXJ5KCB3aW5kb3cgKS5yZXNpemUoZnVuY3Rpb24gKCkge1xuICAgICAgICAgICAgICAgIHNlbGYucmVzaXplSWZyYW1lKCk7XG4gICAgICAgICAgICB9KTtcbiAgICAgICAgfSxcbiAgICAgICAgd2F0Y2g6IHtcbiAgICAgICAgICAgIGN1cnJlbnRMYW5ndWFnZTogZnVuY3Rpb24oIGN1cnJlbnRMYW5ndWFnZSApIHtcbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcbiAgICAgICAgICAgICAgICAvL2dyYWIgdGhlIGNvcnJlY3QgVVJMIGZyb20gdGhlIGlGcmFtZVxuICAgICAgICAgICAgICAgIGxldCBuZXdVUkwgPSB0aGlzLmlmcmFtZS5xdWVyeVNlbGVjdG9yKCAnbGlua1tocmVmbGFuZz1cIicgKyBjdXJyZW50TGFuZ3VhZ2UucmVwbGFjZSggJ18nLCAnLScgKSArJ1wiXScgKS5nZXRBdHRyaWJ1dGUoJ2hyZWYnKVxuXG4gICAgICAgICAgICAgICAgdGhpcy5jdXJyZW50VVJMICAgICAgICAgICA9IG5ld1VSTFxuICAgICAgICAgICAgICAgIHRoaXMuaWZyYW1lLmxvY2F0aW9uICAgICAgPSBuZXdVUkxcblxuICAgICAgICAgICAgICAgIC8vcmVzZXQgdnVlIHByb3BzXG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RlZFN0cmluZyAgICAgICA9ICcnXG4gICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RlZEluZGV4ZXNBcnJheSA9IFtdXG5cbiAgICAgICAgICAgICAgICAvL3NldCBzdHJpbmdzIGRyb3Bkb3duIHRvIGxvYWRpbmcgc3RhdGVcbiAgICAgICAgICAgICAgICBqUXVlcnkoJyN0cnAtc3RyaW5nLWNhdGVnb3JpZXMnKS52YWwoJycpLnRyaWdnZXIoJ2NoYW5nZScpXG4gICAgICAgICAgICAgICAgdGhpcy5zdHJpbmdzRHJvcGRvd25Mb2FkaW5nKClcblxuICAgICAgICAgICAgICAgIHRoaXMub25TY3JlZW5MYW5ndWFnZSA9IGN1cnJlbnRMYW5ndWFnZVxuICAgICAgICAgICAgICAgIGlmKCB0aGlzLnNldHRpbmdzWydkZWZhdWx0LWxhbmd1YWdlJ10gPT0gdGhpcy5jdXJyZW50TGFuZ3VhZ2UgJiYgdGhpcy5zZXR0aW5nc1sndHJhbnNsYXRpb24tbGFuZ3VhZ2VzJ10ubGVuZ3RoID4gMSApe1xuICAgICAgICAgICAgICAgICAgICB0aGlzLnNldHRpbmdzWyd0cmFuc2xhdGlvbi1sYW5ndWFnZXMnXS5zb21lKGZ1bmN0aW9uKGxhbmd1YWdlKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggbGFuZ3VhZ2UgIT0gc2VsZi5zZXR0aW5nc1snZGVmYXVsdC1sYW5ndWFnZSddICl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgLy8gcmV0dXJuIHRoZSBmaXJzdCBsYW5ndWFnZSBub3QgZGVmYXVsdFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYub25TY3JlZW5MYW5ndWFnZSA9IGxhbmd1YWdlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgY3VycmVudFVSTDogZnVuY3Rpb24gKCBuZXdVcmwsIG9sZFVybCApIHtcbiAgICAgICAgICAgICAgICB3aW5kb3cuaGlzdG9yeS5yZXBsYWNlU3RhdGUoIG51bGwsIG51bGwsIHRoaXMucGFyZW50VVJMKCBuZXdVcmwgKSApXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgdmlld0FzOiBmdW5jdGlvbiggcm9sZSApIHtcbiAgICAgICAgICAgICAgICBpZiggIXRoaXMuY3VycmVudFVSTCB8fCAhdGhpcy5pZnJhbWUgKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm5cblxuICAgICAgICAgICAgICAgIGxldCB1cmwgPSB0aGlzLmNsZWFuVVJMKCB0aGlzLmN1cnJlbnRVUkwgKVxuXG4gICAgICAgICAgICAgICAgdXJsID0gdXRpbHMudXBkYXRlVXJsUGFyYW1ldGVyKCB1cmwsICd0cnAtZWRpdC10cmFuc2xhdGlvbicsICdwcmV2aWV3JyApXG5cbiAgICAgICAgICAgICAgICBpZiggcm9sZSA9PSAnY3VycmVudF91c2VyJyApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pZnJhbWUubG9jYXRpb24gPSB1cmxcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgLy9pZiBub25jZSBub3QgYXZhaWxhYmxlLCBhbiB1cGRhdGUgdG8gdGhlIEJyb3dzZSBhcyBPdGhlciBSb2xlcyBhZGQtb24gaXMgcmVxdWlyZWRcbiAgICAgICAgICAgICAgICBpZiggIXRoaXMubm9uY2VzW3JvbGVdICkge1xuICAgICAgICAgICAgICAgICAgICBhbGVydCggdGhpcy5lZGl0b3JTdHJpbmdzLmJvcl91cGRhdGVfbm90aWNlIClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuXG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgdXJsID0gdXRpbHMudXBkYXRlVXJsUGFyYW1ldGVyKCB1cmwsICd0cnAtdmlldy1hcycsIHJvbGUgKVxuICAgICAgICAgICAgICAgIHVybCA9IHV0aWxzLnVwZGF0ZVVybFBhcmFtZXRlciggdXJsLCAndHJwLXZpZXctYXMtbm9uY2UnLCB0aGlzLm5vbmNlc1tyb2xlXSApXG5cbiAgICAgICAgICAgICAgICB0aGlzLmlmcmFtZS5sb2NhdGlvbiA9IHVybFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNlbGVjdGVkU3RyaW5nOiBmdW5jdGlvbiAoIHNlbGVjdGVkU3RyaW5n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AgICAgICAgICAgICAgICBsZXQgc2VsZWN0b3JzID0gc2VsZi5nZXRBbGxTZWxlY3RvcnMoKVxuICAgICAgICAgICAgICAgICAgICBsZXQgbm9kZXMgPSBbXVxuXG4gICAgICAgICAgICAgICAgICAgIG5vZGVzLnB1c2goIGN1cnJlbnROb2RlIClcblxuICAgICAgICAgICAgICAgICAgICBpZiAoIGN1cnJlbnROb2RlLnRhZ05hbWUgIT0gXCJBXCIgKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIGluY2x1ZGUgdGhlIGFuY2hvcidzIHRyYW5zbGF0YWJsZSBhdHRyaWJ1dGVzXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgYW5jaG9yUGFyZW50ICA9IGN1cnJlbnROb2RlLmNsb3Nlc3QoJ2EnKVxuICAgICAgICAgICAgICAgICAgICAgICAgaWYoICBhbmNob3JQYXJlbnQgIT0gbnVsbCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2Rlcy5wdXNoKGFuY2hvclBhcmVudClcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIGlmICggY3VycmVudE5vZGUudGFnTmFtZSA9PSBcIkFcIiAmJiBjdXJyZW50Tm9kZS5jaGlsZHJlbi5sZW5ndGggPiAwICl7XG4gICAgICAgICAgICAgICAgICAgICAgICAvLyBpbmNsdWRlIGFsbCB0aGUgdHJhbnNsYXRhYmxlIGF0dHJpYnV0ZXMgaW5zaWRlIHRoZSBhbmNob3JcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBjaGlsZHJlbkFycmF5ID0gWyAuLi5jdXJyZW50Tm9kZS5jaGlsZHJlbiBdO1xuICAgICAgICAgICAgICAgICAgICAgICAgY2hpbGRyZW5BcnJheS5mb3JFYWNoKCBmdW5jdGlvbiAoIGNoaWxkICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIG5vZGVzLnB1c2goY2hpbGQpXG4gICAgICAgICAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICBub2Rlcy5mb3JFYWNoKCBmdW5jdGlvbiggbm9kZSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdG9ycy5mb3JFYWNoKGZ1bmN0aW9uIChzZWxlY3Rvcikge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxldCBzdHJpbmdJZCA9IG5vZGUuZ2V0QXR0cmlidXRlKHNlbGVjdG9yKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmIChzdHJpbmdJZCkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgZm91bmQgPSBmYWxzZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZXQgaVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmb3IoIGkgPSAwOyBpIDwgc2VsZWN0ZWRJbmRleGVzQXJyYXkubGVuZ3RoOyBpKysgKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHNlbGYuZGljdGlvbmFyeVtzZWxlY3RlZEluZGV4ZXNBcnJheVtpXV0gIT09ICd1bmRlZmluZWQnICYmIHNlbGYuZGljdGlvbmFyeVtzZWxlY3RlZEluZGV4ZXNBcnJheVtpXV0uZGJJRCAhPT0gJ3VuZGVmaW5lZCcgJiYgc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhlc0FycmF5W2ldXS5kYklEID09PSBzdHJpbmdJZCApe1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvdW5kID0gdHJ1ZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJyZWFrO1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggISBmb3VuZCApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdGVkSW5kZXhlc0FycmF5LnB1c2goc2VsZi5nZXRTdHJpbmdJbmRleChzZWxlY3Rvciwgc3RyaW5nSWQpKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9IGVsc2VcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0ZWRJbmRleGVzQXJyYXkucHVzaCggc2VsZWN0ZWRTdHJpbmdBcnJheUluZGV4IClcblxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0ZWRJbmRleGVzQXJyYXkgPSBzZWxlY3RlZEluZGV4ZXNBcnJheVxuICAgICAgICAgICAgfSxcbiAgICAgICAgfSxcbiAgICAgICAgY29tcHV0ZWQ6IHtcbiAgICAgICAgICAgIGNsb3NlVVJMOiBmdW5jdGlvbigpIHtcbiAgICAgICAgICAgICAgICByZXR1cm4gdGhpcy5jbGVhblVSTCggdGhpcy5jdXJyZW50VVJMIClcbiAgICAgICAgICAgIH1cbiAgICAgICAgfSxcbiAgICAgICAgbWV0aG9kczoge1xuICAgICAgICAgICAgaUZyYW1lTG9hZGVkKCl7XG4gICAgICAgICAgICAgICAgbGV0IHNlbGYgPSB0aGlzXG4gICAgICAgICAgICAgICAgbGV0IGlmcmFtZUVsZW1lbnQgPSBkb2N1bWVudC5xdWVyeVNlbGVjdG9yKCcjdHJwLXByZXZpZXctaWZyYW1lJylcblxuICAgICAgICAgICAgICAgIHRoaXMuaWZyYW1lID0gaWZyYW1lRWxlbWVudC5jb250ZW50RG9jdW1lbnQgfHwgaWZyYW1lRWxlbWVudC5jb250ZW50V2luZG93LmRvY3VtZW50XG5cbiAgICAgICAgICAgICAgICAvL3N5bmMgaUZyYW1lIFVSTCB3aXRoIHBhcmVudFxuICAgICAgICAgICAgICAgIGlmICggdGhpcy5jdXJyZW50VVJMICE9IHRoaXMuaWZyYW1lLlVSTCApXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuY3VycmVudFVSTCA9IHRoaXMuaWZyYW1lLlVSTFxuXG4gICAgICAgICAgICAgICAgLy9oaWRlIGlGcmFtZSBsb2FkZXJcbiAgICAgICAgICAgICAgICB0aGlzLmlmcmFtZUxvYWRlciggJ2hpZGUnIClcblxuICAgICAgICAgICAgICAgIHNlbGYuZGV0ZWN0ZWRTZWxlY3RvckFuZElkID0gW11cbiAgICAgICAgICAgICAgICBzZWxmLmRpY3Rpb25hcnkgICAgICAgICAgICA9IFtdXG4gICAgICAgICAgICAgICAgdGhpcy5zY2FuSWZyYW1lRm9yU3RyaW5ncygpXG5cbiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lciggJ3RycF9pZnJhbWVfcGFnZV91cGRhdGVkJywgdGhpcy5zY2FuSWZyYW1lRm9yU3RyaW5ncyApXG5cbiAgICAgICAgICAgICAgICAvL2V2ZW50IHRoYXQgaXMgZmlyZWQgd2hlbiB0aGUgaUZyYW1lIGlzIG5hdmlnYXRlZFxuICAgICAgICAgICAgICAgIGlmcmFtZUVsZW1lbnQuY29udGVudFdpbmRvdy5vbmJlZm9yZXVubG9hZCA9IGZ1bmN0aW9uKCkge1xuICAgICAgICAgICAgICAgICAgICBzZWxmLmlmcmFtZUxvYWRlciggJ3Nob3cnIClcblxuICAgICAgICAgICAgICAgICAgICBzZWxmLnNlbGVjdGVkU3RyaW5nID0gbnVsbFxuICAgICAgICAgICAgICAgICAgICBzZWxmLnNlbGVjdGVkSW5kZXhlc0FycmF5ID0gW11cbiAgICAgICAgICAgICAgICAgICAgc2VsZi50cmFuc2xhdGlvbk5vdExvYWRlZFlldCA9IGZhbHNlXG5cbiAgICAgICAgICAgICAgICAgICA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ICAgICAgICAgIG5vZGVzLmZvckVhY2goIGZ1bmN0aW9uICggbm9kZSApe1xuICAgICAgICAgICAgICAgICAgICBub2RlRW50cmllcyA9IHNlbGYuZ2V0Tm9kZUluZm8oIG5vZGUsIGJhc2VTZWxlY3RvciApXG5cbiAgICAgICAgICAgICAgICAgICAgbm9kZUVudHJpZXMuZm9yRWFjaCggZnVuY3Rpb24oIGVudHJ5ICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgLy8gdGhpcyBjaGVjayBlbnN1cmVzIHRoYXQgd2UgZG9uJ3QgY3JlYXRlIGR1cGxpY2F0ZXMgd2hlbiByZXNjYW5uaW5nIGFmdGVyIGFqYXggY29tcGxldGVcbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggIXNlbGYuYWxyZWFkeURldGVjdGVkKCBlbnRyeS5zZWxlY3RvciwgZW50cnkuZGJJRCApICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cmluZ0lkc0FycmF5LnB1c2goZW50cnkuZGJJRClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlRGF0YS5wdXNoKGVudHJ5KVxuICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgICAgIHNlbGYuc2V0dXBFdmVudExpc3RlbmVyKCBub2RlIClcbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgLy91bmlxdWUgaWRzIG9ubHlcbiAgICAgICAgICAgICAgICBzdHJpbmdJZHNBcnJheSA9IFsuLi5uZXcgU2V0KHN0cmluZ0lkc0FycmF5KV1cbiAgICAgICAgICAgICAgICBpZiAoIHN0cmluZ0lkc0FycmF5Lmxlbmd0aCA+IDAgKSB7XG4gICAgICAgICAgICAgICAgICAgIGxldCBkYXRhID0gbmV3IEZvcm1EYXRhKClcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ2FjdGlvbicgICAgICAgLCAndHJwX2dldF90cmFuc2xhdGlvbnNfJyArIHR5cGVTbHVnKVxuICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCgnYWxsX2xhbmd1YWdlcycsICd0cnVlJylcbiAgICAgICAgICAgICAgICAgICAgZGF0YS5hcHBlbmQoJ3NlY3VyaXR5JyAgICAgLCB0aGlzLm5vbmNlc1snZ2V0dHJhbnNsYXRpb25zbm9uY2UnICsgdHlwZVNsdWddKVxuICAgICAgICAgICAgICAgICAgICBkYXRhLmFwcGVuZCgnbGFuZ3VhZ2UnICAgICAsIGxhbmd1YWdlT2ZJZHMpXG4gICAgICAgICAgICAgICAgICAgIGRhdGEuYXBwZW5kKCdzdHJpbmdfaWRzJyAgICwgSlNPTi5zdHJpbmdpZnkoc3RyaW5nSWRzQXJyYXkpKVxuXG4gICAgICAgICAgICAgICAgICAgIGF4aW9zLnBvc3QodGhpcy5hamF4X3VybCwgZGF0YSlcbiAgICAgICAgICAgICAgICAgICAgICAgIC50aGVuKGZ1bmN0aW9uIChyZXNwb25zZSkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYubG9hZGluZ19zdHJpbmdzLS1cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxmLmFkZFRvRGljdGlvbmFyeShyZXNwb25zZS5kYXRhLCBub2RlRGF0YSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgICAgICAuY2F0Y2goZnVuY3Rpb24gKGVycm9yKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc29sZS5sb2coZXJyb3IpO1xuICAgICAgICAgICAgICAgICAgICAgICAgfSk7XG4gICAgICAgICAgICAgICAgfWVsc2V7XG4gICAgICAgICAgICAgICAgICAgIHNlbGYubG9hZGluZ19zdHJpbmdzLS1cbiAgICAgICAgICAgICAgICB9XG5cbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBhbHJlYWR5RGV0ZWN0ZWQoIHNlbGVjdG9yLCBkYklkICl7XG4gICAgICAgICAgICAgICAgbGV0IGNvbWJpbmVkID0gc2VsZWN0b3IgKyAnPScgKyBkYklkXG4gICAgICAgICAgICAgICAgaWYgKCB1dGlscy5hcnJheUNvbnRhaW5zSXRlbSggdGhpcy5kZXRlY3RlZFNlbGVjdG9yQW5kSWQsIGNvbWJpbmVkICkgKSB7XG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlXG4gICAgICAgICAgICAgICAgfWVsc2Uge1xuICAgICAgICAgICAgICAgICAgICB0aGlzLmRldGVjdGVkU2VsZWN0b3JBbmRJZC5wdXNoKGNvbWJpbmVkKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc2V0dXBFdmVudExpc3RlbmVyKCBub2RlICl7XG4gICAgICAgICAgICAgICAgaWYgKCBub2RlLnRhZ05hbWUgPT0gJ0EnICYmICFub2RlLmhhc0F0dHJpYnV0ZSggJ2RhdGEtdHJwZ2V0dGV4dG9yaWdpbmFsJyApIClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlXG5cbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcblxuICAgICAgICAgICAgICAgIG5vZGUuYWRkRXZlbnRMaXN0ZW5lciggJ21vdXNlZW50ZXInLCBzZWxmLiRyZWZzLmhvdmVyQWN0aW9ucy5zaG93UGVuY2lsSWNvbiApXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWRkVG9EaWN0aW9uYXJ5KCByZXNwb25zZURhdGEsIG5vZGVJbmZvID0gbnVsbCApe1xuICAgICAgICAgICAgICAgIGxldCBzZWxmID0gdGhpc1xuXG4gICAgICAgICAgICAgICAgaWYgKCByZXNwb25zZURhdGEgIT0gbnVsbCApIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBub2RlSW5mbyApe1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZUluZm8uZm9yRWFjaChmdW5jdGlvbiAoIGluZm9Sb3csIGluZGV4ICl7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2VEYXRhLnNvbWUoIGZ1bmN0aW9uICggcmVzcG9uc2VEYXRhUm93ICkge1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggaW5mb1Jvdy5kYklEID09IHJlc3BvbnNlRGF0YVJvdy5kYklEICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLy9icmluZyBibG9ja190eXBlIHRvIHRoZSB0b3AgbGV2ZWwgb2JqZWN0XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoIHJlc3BvbnNlRGF0YVJvdy50eXBlICE9ICdnZXR0ZXh0JyAmJiB0eXBlb2YgcmVzcG9uc2VEYXRhUm93LmJsb2NrX3R5cGUgPT0gJ3VuZGVmaW5lZCcgKSB7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGV0IGZpcnN0TGFuZ3VhZ2UgPSBzZWxmLm9yZGVyZWRTZWNvbmRhcnlMYW5ndWFnZXNbMF1cblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHJlc3BvbnNlRGF0YVJvdy50cmFuc2xhdGlvbnNBcnJheVtmaXJzdExhbmd1YWdlXS5ibG9ja190eXBlICE9ICd1bmRlZmluZWQnIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmVzcG9uc2VEYXRhUm93LmJsb2NrX3R5cGUgPSByZXNwb25zZURhdGFSb3cudHJhbnNsYXRpb25zQXJyYXlbZmlyc3RMYW5ndWFnZV0uYmxvY2tfdHlwZVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBub2RlSW5mb1tpbmRleF0gPSBPYmplY3QuYXNzaWduKCB7fSwgcmVzcG9uc2VEYXRhUm93LCBpbmZvUm93IClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiB0cnVlIC8vIGEgc29ydCBvZiBicmVha1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH0pXG4gICAgICAgICAgICAgICAgICAgIH1lbHNle1xuICAgICAgICAgICAgICAgICAgICAgICAgbm9kZUluZm8gPSByZXNwb25zZURhdGFcbiAgICAgICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgICAgIHRoaXMuc3RyaW5nR3JvdXBzID0gdGhpcy5hZGRUb1N0cmluZ0dyb3Vwcyggbm9kZUluZm8gKVxuICAgICAgICAgICAgICAgICAgICB0aGlzLmRpY3Rpb25hcnkgPSB0aGlzLmRpY3Rpb25hcnkuY29uY2F0KCBub2RlSW5mbyApXG5cbiAgICAgICAgICAgICAgICAgICAgdGhpcy5pbml0U3RyaW5nc0Ryb3Bkb3duKClcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWRkVG9TdHJpbmdHcm91cHMoIHN0cmluZ3MgKXtcblxuICAgICAgICAgICAgICAgIC8vIHNlZSB3aGF0IG5vZGUgZ3JvdXBzIGFyZSBmb3VuZFxuICAgICAgICAgICAgICAgIGxldCBmb3VuZFN0cmluZ0dyb3VwcyA9IHRoaXMuc3RyaW5nR3JvdXBzO1xuICAgICAgICAgICAgICAgIHN0cmluZ3MuZm9yRWFjaCggZnVuY3Rpb24gKCBzdHJpbmcgKSB7XG4gICAgICAgICAgICAgICAgICAgIGlmICggZm91bmRTdHJpbmdHcm91cHMuaW5kZXhPZiggc3RyaW5nLmdyb3VwICkgPT09IC0xICYmICggKCB0eXBlb2Ygc3RyaW5nLmJsb2NrVHlwZSA9PT0gJ3VuZGVmaW5lZCcgKSB8fCBzdHJpbmcuYmxvY2tUeXBlICE9PSAnMicgKSApe1xuICAgICAgICAgICAgICAgICAgICAgICAgZm91bmRTdHJpbmdHcm91cHMucHVzaCggc3RyaW5nLmdyb3VwIClcbiAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICAvLyBwdXQgdGhlIG5vZGUgZ3JvdXBzIGluIHRoZSBvcmRlciB0aGF0IHdlIHdhbnQsIGFjY29yZGluZyB0byB0aGUgcHJvcCB0aGlzLnN0cmluZ0dyb3VwT3JkZXJcbiAgICAgICAgICAgICAgICBsZXQgb3JkZXJlZFN0cmluZ0dyb3VwcyA9IFtdO1xuXG4gICAgICAgICAgICAgICAgaWYgKCB0aGlzLmVkaXRvclN0cmluZ3Muc2VvX3VwZGF0ZV9ub3RpY2UgIT0gJ3Nlb19wYWNrX3VwZGF0ZV9ub3RfbmVlZGVkJyApe1xuICAgICAgICAgICAgICAgICAgICBvcmRlcmVkU3RyaW5nR3JvdXBzLnB1c2goIHRoaXMuZWRpdG9yU3RyaW5ncy5zZW9fdXBkYXRlX25vdGljZSApO1xuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMuc3RyaW5nR3JvdXBPcmRlci5mb3JFYWNoKCBmdW5jdGlvbiggZ3JvdXAgKXtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCBmb3VuZFN0cmluZ0dyb3Vwcy5pbmRleE9mKCBncm91cCApICE9PSAtMSApe1xuICAgICAgICAgICAgICAgICAgICAgICAgb3JkZXJlZFN0cmluZ0dyb3Vwcy5wdXNoKCBncm91cCApXG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgLy8gaWYgdGhlcmUgd2VyZSBhbnkgb3RoZXIgc3RyaW5nIGdyb3VwcyB0aGF0IHdlcmUgbm90IGluIHRoZSBwcm9wLCBhZGQgdGhlbSBhdCB0aGUgZW5kLlxuICAgICAgICAgICAgICAgIGZvdW5kU3RyaW5nR3JvdXBzLmZvckVhY2goIGZ1bmN0aW9uIChncm91cCkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIG9yZGVyZWRTdHJpbmdHcm91cHMuaW5kZXhPZiggZ3JvdXAgKSA9PT0gLTEgKXtcbiAgICAgICAgICAgICAgICAgICAgICAgIG9yZGVyZWRTdHJpbmdHcm91cHMucHVzaChncm91cCk7XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9KVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIG9yZGVyZWRTdHJpbmdHcm91cHM7XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgZ2V0U3RyaW5nSW5kZXgoIHNlbGVjdG9yLCBkYklEICl7XG4gICAgICAgICAgICAgICAgbGV0IGZvdW5kID0gbnVsbFxuXG4gICAgICAgICAgICAgICAgdGhpcy5kaWN0aW9uYXJ5LnNvbWUoZnVuY3Rpb24gKCBzdHJpbmcsIGluZGV4ICkge1xuICAgICAgICAgICAgICAgICAgICBpZiAoIHN0cmluZy5kYklEID09IGRiSUQgJiYgc3RyaW5nLnNlbGVjdG9yID09IHNlbGVjdG9yICl7XG4gICAgICAgICAgICAgICAgICAgICAgICBmb3VuZCA9IGluZGV4XG4gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxuICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIHJldHVybiBmb3VuZFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGdldE5vZGVJbmZvKCBub2RlLCBiYXNlU2VsZWN0b3IgPSAnJyApe1xuICAgICAgICAgICAgICAgIGxldCBzdHJpbmdJZFxuICAgICAgICAgICAgICAgIGxldCBub2RlRGF0YSAgPSBbXVxuICAgICAgICAgICAgICAgIGxldCBzZWxlY3RvcnMgPSB0aGlzLnByZXBhcmVTZWxlY3RvclN0cmluZ3MoIGJhc2VTZWxlY3RvciApXG5cbiAgICAgICAgICAgICAgICBzZWxlY3RvcnMuZm9yRWFjaCggZnVuY3Rpb24gKCBzZWxlY3RvciApIHtcblxuICAgICAgICAgICAgICAgICAgICBzdHJpbmdJZCA9IG5vZGUuZ2V0QXR0cmlidXRlKCBzZWxlY3RvciApXG5cbiAgICAgICAgICAgICAgICAgICAgaWYgKCBzdHJpbmdJZCApIHtcblxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vZGVBdHRyaWJ1dGUgICA9IHNlbGVjdG9yLnJlcGxhY2UoIGJhc2VTZWxlY3RvciwgJycgKVxuICAgICAgICAgICAgICAgICAgICAgICAgbGV0IG5vZGVHcm91cCAgICAgICA9IG5vZGUuZ2V0QXR0cmlidXRlKCAnZGF0YS10cnAtbm9kZS1ncm91cCcgKyBub2RlQXR0cmlidXRlIClcbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBub2RlRGVzY3JpcHRpb24gPSBub2RlLmdldEF0dHJpYnV0ZSggJ2RhdGEtdHJwLW5vZGUtZGVzY3JpcHRpb24nICsgbm9kZUF0dHJpYnV0ZSApXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGxldCBlbnRyeSA9IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBkYklEICAgICAgOiBzdHJpbmdJZCxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBzZWxlY3RvciAgOiBzZWxlY3RvcixcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyaWJ1dGUgOiBub2RlQXR0cmlidXRlLnN1YnN0cigxKSwgLy8gc3Vic3RyKDEpIGlzIHVzZWQgdG8gdHJpbSBwcmVmaXhpbmcgbGluZSAtIGV4LiAtYWx0IHdpbGwgcmVzdWx0IGluIGFsdCAobm8gbGluZSlcbiAgICAgICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgICAgICAgICAgaWYgKCBub2RlR3JvdXAgKVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudHJ5Lmdyb3VwID0gbm9kZUdyb3VwXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIGlmICggbm9kZURlc2NyaXB0aW9uIClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnRyeS5kZXNjcmlwdGlvbiA9IG5vZGVEZXNjcmlwdGlvblxuXG4gICAgICAgICAgICAgICAgICAgICAgICBub2RlRGF0YS5wdXNoKCBlbnRyeSApXG4gICAgICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICByZXR1cm4gbm9kZURhdGFcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBnZXRBbGxTZWxlY3RvcnMoKXtcbiAgICAgICAgICAgICAgICBsZXQgc2VsZWN0b3JzID0gW11cbiAgICAgICAgICAgICAgICBsZXQgc2VsZiAgICAgID0gdGhpc1xuXG4gICAgICAgICAgICAgICAgdGhpcy5kYXRhQXR0cmlidXRlcy5mb3JFYWNoKCBmdW5jdGlvbiAoIGRhdGFBdHRyaWJ1dGUgKXtcbiAgICAgICAgICAgICAgICAgICAgc2VsZWN0b3JzID0gc2VsZWN0b3JzLmNvbmNhdCggc2VsZi5wcmVwYXJlU2VsZWN0b3JTdHJpbmdzKCBkYXRhQXR0cmlidXRlICkgKVxuICAgICAgICAgICAgICAgIH0pXG5cbiAgICAgICAgICAgICAgICByZXR1cm4gc2VsZWN0b3JzXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcHJlcGFyZVNlbGVjdG9yU3RyaW5ncyggYmFzZU5hbWVTZWxlY3RvciApe1xuICAgICAgICAgICAgICAgIGxldCBwYXJzZWRfc2VsZWN0b3JzID0gW11cblxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0b3JzLmZvckVhY2goIGZ1bmN0aW9uICggc2VsZWN0b3JTdWZmaXgsIGluZGV4ICl7XG4gICAgICAgICAgICAgICAgICAgIHBhcnNlZF9zZWxlY3RvcnMucHVzaCggYmFzZU5hbWVTZWxlY3RvciArIHNlbGVjdG9yU3VmZml4ICApXG4gICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgIHJldHVybiBwYXJzZWRfc2VsZWN0b3JzXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgcGFyZW50VVJMKCB1cmwgKXtcbiAgICAgICAgICAgICAgICByZXR1cm4gdXJsLnJlcGxhY2UoICd0cnAtZWRpdC10cmFuc2xhdGlvbj1wcmV2aWV3JywgJ3RycC1lZGl0LXRyYW5zbGF0aW9uPXRydWUnIClcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBjbGVhblVSTCggdXJsICl7XG4gICAgICAgICAgICAgICAgLy9tYWtlIHJlbW92ZVVybFBhcmFtZXRlciByZWN1cnNpdmUgYW5kIG9ubHkgY2FsbCBpdCBvbmNlIHdpdGggYWxsIHRoZSBwYXJhbWV0ZXJzIHRoYXRcbiAgICAgICAgICAgICAgICAvL25lZWQgdG8gc3RyaXBwZWQgP1xuICAgICAgICAgICAgICAgIHVybCA9IHV0aWxzLnJlbW92ZVVybFBhcmFtZXRlciggdXJsLCAnbGFuZycgKVxuICAgICAgICAgICAgICAgIHVybCA9IHV0aWxzLnJlbW92ZVVybFBhcmFtZXRlciggdXJsLCAndHJwLXZpZXctYXMnIClcbiAgICAgICAgICAgICAgICB1cmwgPSB1dGlscy5yZW1vdmVVcmxQYXJhbWV0ZXIoIHVybCwgJ3RycC12aWV3LWFzLW5vbmNlJyApXG4gICAgICAgICAgICAgICAgdXJsID0gdXRpbHMucmVtb3ZlVXJsUGFyYW1ldGVyKCB1cmwsICd0cnAtZWRpdC10cmFuc2xhdGlvbicgKVxuXG4gICAgICAgICAgICAgICAgcmV0dXJuIHVybFxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHNob3dTdHJpbmcoIHN0cmluZywgdHlwZSApe1xuICAgICAgICAgICAgICAgIGlmICggdHlwZW9mIHN0cmluZy5ibG9ja1R5cGUgIT09ICd1bmRlZmluZWQnICYmIHN0cmluZy5ibG9ja1R5cGUgPT09ICcyJyApe1xuICAgICAgICAgICAgICAgICAgICAvLyBkb24ndCBzaG93IGRlcHJlY2F0ZWQgdHJhbnNsYXRpb24gYmxvY2tzIGluIHRoZSBkcm9wZG93blxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlID09PSB0aGlzLmVkaXRvclN0cmluZ3MuaW1hZ2VzICYmIHR5cGVvZiBzdHJpbmcuYXR0cmlidXRlICE9ICd1bmRlZmluZWQnICYmIHN0cmluZy5hdHRyaWJ1dGUgPT0gJ3NyYycgKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gdHJ1ZVxuXG4gICAgICAgICAgICAgICAgaWYgKCB0eXBlb2Ygc3RyaW5nLmF0dHJpYnV0ZSAhPT0gJ3VuZGVmaW5lZCcgJiYgKCBzdHJpbmcuYXR0cmlidXRlID09ICdocmVmJyB8fCBzdHJpbmcuYXR0cmlidXRlID09ICdzcmMnICkgKVxuICAgICAgICAgICAgICAgICAgICByZXR1cm4gZmFsc2VcblxuICAgICAgICAgICAgICAgIGlmICggc3RyaW5nLmdyb3VwID09PSB0eXBlIClcbiAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHRydWVcblxuICAgICAgICAgICAgICAgIHJldHVybiBmYWxzZVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGluaXRTdHJpbmdzRHJvcGRvd24oKXtcbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcblxuICAgICAgICAgICAgICAgIGlmICggIXRoaXMuaXNTdHJpbmdzRHJvcGRvd25PcGVuKCkgKSB7XG4gICAgICAgICAgICAgICAgICAgIGpRdWVyeSggJyN0cnAtc3RyaW5nLWNhdGVnb3JpZXMnICkuc2VsZWN0MiggJ2Rlc3Ryb3knIClcblxuICAgICAgICAgICAgICAgICAgICBqUXVlcnkoICcjdHJwLXN0cmluZy1jYXRlZ29yaWVzJyApLnNlbGVjdDIoIHsgcGxhY2Vob2xkZXIgOiBzZWxmLmVkaXRvclN0cmluZ3Muc2VsZWN0X3N0cmluZywgdGVtcGxhdGVSZXN1bHQ6IGZ1bmN0aW9uKG9wdGlvbil7XG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgb3JpZ2luYWwgICAgPSBoZS5kZWNvZGUoIG9wdGlvbi50ZXh0LnN1YnN0cmluZygwLCA5MCkgKSArICggKCBvcHRpb24udGV4dC5sZW5ndGggPD0gOTApID8gJycgOiAnLi4uJyApXG4gICAgICAgICAgICAgICAgICAgICAgICBsZXQgZGVzY3JpcHRpb24gPSAoIG9wdGlvbi50aXRsZSApID8gICcoJyArIG9wdGlvbi50aXRsZSArICcpJyA6ICcnXG5cbiAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiBqUXVlcnkoICc8ZGl2PicgKyBvcmlnaW5hbCArICc8L2Rpdj48ZGl2IGNsYXNzPVwic3RyaW5nLXNlbGVjdG9yLWRlc2NyaXB0aW9uXCI+JyArIGRlc2NyaXB0aW9uICsgJzwvZGl2PicgKTtcbiAgICAgICAgICAgICAgICAgICAgfSwgd2lkdGggOiAnMTAwJScgfSApLnByb3AoICdkaXNhYmxlZCcsIGZhbHNlIClcblxuICAgICAgICAgICAgICAgICAgICBqUXVlcnkoICcjdHJwX3NlbGVjdDJfb3ZlcmxheScgKS5oaWRlKClcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgc3RyaW5nc0Ryb3Bkb3duTG9hZGluZygpe1xuICAgICAgICAgICAgICAgIGpRdWVyeSggJyN0cnAtc3RyaW5nLWNhdGVnb3JpZXMnICkuc2VsZWN0MiggeyBwbGFjZWhvbGRlciA6IHRoaXMuZWRpdG9yU3RyaW5ncy5zdHJpbmdzX2xvYWRpbmcsIHdpZHRoIDogJzEwMCUnIH0gKS5wcm9wKCAnZGlzYWJsZWQnLCB0cnVlIClcbiAgICAgICAgICAgIH0sXG4gICAgICAgICAgICBwcm9jZXNzT3B0aW9uTmFtZSggbmFtZSwgdHlwZSApe1xuICAgICAgICAgICAgICAgIGlmICggdHlwZSA9PSAnSW1hZ2VzJyApXG4gICAgICAgICAgICAgICAgICAgIHJldHVybiB1dGlscy5nZXRGaWxlbmFtZSggbmFtZSApXG5cbiAgICAgICAgICAgICAgICByZXR1cm4gdXRpbHMuZXNjYXBlSHRtbCggbmFtZSApXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgaXNTdHJpbmdzRHJvcGRvd25PcGVuKCl7XG4gICAgICAgICAgICAgICAgcmV0dXJuIGpRdWVyeSggJyN0cnAtc3RyaW5nLWNhdGVnb3JpZXMnICkuc2VsZWN0MiggJ2lzT3BlbicgKVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGhhc1Vuc2F2ZWRDaGFuZ2VzKCl7XG4gICAgICAgICAgICAgICAgbGV0IHVuc2F2ZWRDaGFuZ2VzID0gZmFsc2VcbiAgICAgICAgICAgICAgICBsZXQgc2VsZiA9IHRoaXNcbiAgICAgICAgICAgICAgICBpZiAoIHRoaXMuc2VsZWN0ZWRJbmRleGVzQXJyYXkubGVuZ3RoID4gMCApIHtcbiAgICAgICAgICAgICAgICAgICAgdGhpcy5zZWxlY3RlZEluZGV4ZXNBcnJheS5mb3JFYWNoKGZ1bmN0aW9uIChzZWxlY3RlZEluZGV4KSB7XG4gICAgICAgICAgICAgICAgICAgICAgICBzZWxmLnNldHRpbmdzWyd0cmFuc2xhdGlvbi1sYW5ndWFnZXMnXS5mb3JFYWNoKGZ1bmN0aW9uIChsYW5ndWFnZUNvZGUpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBpZiAoc2VsZi5kaWN0aW9uYXJ5W3NlbGVjdGVkSW5kZXhdICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGYuZGljdGlvbmFyeVtzZWxlY3RlZEluZGV4XS50cmFuc2xhdGlvbnNBcnJheVtsYW5ndWFnZUNvZGVdICYmXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChzZWxmLmRpY3Rpb25hcnlbc2VsZWN0ZWRJbmRleF0udHJhbnNsYXRpb25zQXJyYXlbbGFuZ3VhZ2VDb2RlXS50cmFuc2xhdGVkICE9PSBzZWxmLmRpY3Rpb25hcnlbc2VsZWN0ZWRJbmRleF0udHJhbnNsYXRpb25zQXJyYXlbbGFuZ3VhZ2VDb2RlXS5lZGl0ZWRUcmFuc2xhdGlvbikpIHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdW5zYXZlZENoYW5nZXMgPSB0cnVlXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgdGhpcy5zaG93Q2hhbmdlc1Vuc2F2ZWRNZXNzYWdlID0gdW5zYXZlZENoYW5nZXNcblxuICAgICAgICAgICAgICAgIHJldHVybiB1bnNhdmVkQ2hhbmdlc1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIGlmcmFtZUxvYWRlciggc3RhdHVzICkge1xuICAgICAgICAgICAgICAgIGxldCBsb2FkZXIgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCggJ3RycC1wcmV2aWV3LWxvYWRlcicgKVxuXG4gICAgICAgICAgICAgICAgaWYoIHN0YXR1cyA9PSAnc2hvdycgKVxuICAgICAgICAgICAgICAgICAgICBsb2FkZXIuc3R5bGUuZGlzcGxheSA9ICdmbGV4J1xuICAgICAgICAgICAgICAgIGVsc2UgaWYoIHN0YXR1cyA9PSAnaGlkZScgKVxuICAgICAgICAgICAgICAgICAgICBsb2FkZXIuc3R5bGUuZGlzcGxheSA9ICdub25lJ1xuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHByZXZpb3VzU3RyaW5nKCl7XG4gICAg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V3VmFsdWUgKyAnXCJdJykubGVuZ3RoID09PSAwICl7XG4gICAgICAgICAgICAgICAgICAgIG5ld1ZhbHVlKys7XG4gICAgICAgICAgICAgICAgfVxuXG4gICAgICAgICAgICAgICAgaWYgKCBuZXdWYWx1ZSA+PSB0aGlzLmRpY3Rpb25hcnkubGVuZ3RoICl7XG4gICAgICAgICAgICAgICAgICAgIHJldHVyblxuICAgICAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgICAgIHRoaXMuc2VsZWN0ZWRTdHJpbmcgPSBuZXdWYWx1ZS50b1N0cmluZygpXG4gICAgICAgICAgICB9LFxuICAgICAgICAgICAgYWRkS2V5Ym9hcmRTaG9ydGN1dHNMaXN0ZW5lcigpe1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmFkZEV2ZW50TGlzdGVuZXIoXCJrZXlkb3duXCIsIGZ1bmN0aW9uKGUpIHtcbiAgICAgICAgICAgICAgICAgICAgaWYgKCh3aW5kb3cubmF2aWdhdG9yLnBsYXRmb3JtLm1hdGNoKFwiTWFjXCIpID8gZS5tZXRhS2V5IDogZS5jdHJsS2V5KSAmJiBlLmFsdEtleSApIHtcbiAgICAgICAgICAgICAgICAgICAgICAgIC8vIENUUkwgKyBBTFQgKyByaWdodCBhcnJvd1xuICAgICAgICAgICAgICAgICAgICAgICAgaWYoIGUua2V5Q29kZSA9PT0gMzkgKXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgd2luZG93LmRpc3BhdGNoRXZlbnQoIG5ldyBFdmVudCggJ3RycF90cmlnZ2VyX25leHRfc3RyaW5nX2V2ZW50JyApICk7XG4gICAgICAgICAgICAgICAgICAgICAgICB9ZWxzZXtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAvLyBDVFJMICsgQUxUICsgbGVmdCBhcnJvd1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlmKCBlLmtleUNvZGUgPT09IDM3ICkge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlLnByZXZlbnREZWZhdWx0KCk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpbmRvdy5kaXNwYXRjaEV2ZW50KCBuZXcgRXZlbnQoICd0cnBfdHJpZ2dlcl9wcmV2aW91c19zdHJpbmdfZXZlbnQnICkgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICAgICAgICAgIH1cbiAgICAgICAgICAgICAgICB9LCBmYWxzZSk7XG5cbiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lciggJ3RycF90cmlnZ2VyX25leHRfc3RyaW5nX2V2ZW50JywgdGhpcy5uZXh0U3RyaW5nIClcbiAgICAgICAgICAgICAgICB3aW5kb3cuYWRkRXZlbnRMaXN0ZW5lciggJ3RycF90cmlnZ2VyX3ByZXZpb3VzX3N0cmluZ19ldmVudCcsIHRoaXMucHJldmlvdXNTdHJpbmcgKVxuICAgICAgICAgICAgfSxcbiAgICAgICAgICAgIHJlc2l6ZUlmcmFtZSAoZXZlbnQsIHVpKSB7XG4gICAgICAgICAgICAgICAgbGV0IHRvdGFsX3dpZHRoID0galF1ZXJ5KHdpbmRvdykud2lkdGgoKTtcbiAgICAgICAgICAgICAgICBsZXQgd2lkdGggPSBqUXVlcnkoICcjdHJwLWNvbnRyb2xzJyApLndpZHRoKCk7XG5cbiAgICAgICAgICAgICAgICBpZih3aWR0aCA+IHRvdGFsX3dpZHRoKSB7XG4gICAgICAgICAgICAgICAgICAgIHdpZHRoID0gdG90YWxfd2lkdGg7XG4gICAgICAgICAgICAgICAgICAgIGNvbnRyb2xzLmNzcygnd2lkdGgnLCB3aWR0aCk7XG4gICAgICAgICAgICAgICAgfVxuICAgICAgICAgICAgICAgIGxldCBwcmV2aWV3Q29udGFpbmVyID0galF1ZXJ5KCAnI3RycC1wcmV2aWV3JyApO1xuICAgICAgICAgICAgICAgIHByZXZpZXdDb250YWluZXIuY3NzKCdyaWdodCcsIHdpZHRoICk7XG4gICAgICAgICAgICAgICAgcHJldmlld0NvbnRhaW5lci5jc3MoJ2xlZnQnLCAoIHdpZHRoIC0gMzQ4ICkgKTtcbiAgICAgICAgICAgICAgICBwcmV2aWV3Q29udGFpbmVyLmNzcygnd2lkdGgnLCAodG90YWxfd2lkdGggLSB3aWR0aCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICAvL2FkZCBzdXBwb3J0IGZvciB2LW1vZGVsIGluIHNlbGVjdDJcbiAgICAgICAgZGlyZWN0aXZlczoge1xuICAgICAgICAgICAgc2VsZWN0Mjoge1xuICAgICAgICAgICAgICAgIGluc2VydGVkKGVsKSB7XG4gICAgICAgICAgICAgICAgICAgIGpRdWVyeShlbCkub24oJ3NlbGVjdDI6c2VsZWN0JywgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXZlbnQgPSBuZXcgRXZlbnQoJ2NoYW5nZScsIHsgYnViYmxlczogdHJ1ZSwgY2FuY2VsYWJsZTogdHJ1ZSB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgZWwuZGlzcGF0Y2hFdmVudChldmVudClcbiAgICAgICAgICAgICAgICAgICAgfSlcblxuICAgICAgICAgICAgICAgICAgICBqUXVlcnkoZWwpLm9uKCdzZWxlY3QyOnVuc2VsZWN0JywgKCkgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgZXZlbnQgPSBuZXcgRXZlbnQoJ2NoYW5nZScsIHsgYnViYmxlczogdHJ1ZSwgY2FuY2VsYWJsZTogdHJ1ZSB9KVxuICAgICAgICAgICAgICAgICAgICAgICAgZWwuZGlzcGF0Y2hFdmVudChldmVudClcbiAgICAgICAgICAgICAgICAgICAgfSlcbiAgICAgICAgICAgICAgICB9LFxuICAgICAgICAgICAgfVxuICAgICAgICB9XG4gICAgfVxuPC9zY3JpcHQ+XG4iXSwic291cmNlUm9vdCI6IiJ9\n//# sourceURL=webpack-internal:///./node_modules/babel-loader/lib/index.js?!./node_modules/vue-loader/lib/index.js?!./assets/src/js/editor.vue?vue&type=script&lang=js&\n");
|
766 |
|
767 |
/***/ }),
|
768 |
|
980 |
/*! no static exports found */
|
981 |
/***/ (function(module, exports, __webpack_require__) {
|
982 |
|
983 |
+
__webpack_require__(/*! /home/madalin/Projects/translatepress/wp-content/plugins/translatepress/assets/src/js/trp-editor.js */"./assets/src/js/trp-editor.js");
|
984 |
+
module.exports = __webpack_require__(/*! /home/madalin/Projects/translatepress/wp-content/plugins/translatepress/assets/src/scss/trp-editor.scss */"./assets/src/scss/trp-editor.scss");
|
985 |
|
986 |
|
987 |
/***/ }),
|
assets/js/trp-frontend-compatibility.js
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
-
document.addEventListener("DOMContentLoaded", function(event) {
|
2 |
-
function trpClearWooCartFragments(){
|
3 |
-
|
4 |
-
// clear WooCommerce cart fragments when switching language
|
5 |
-
var trp_language_switcher_urls = document.querySelectorAll(".trp-language-switcher-container a:not(.trp-ls-disabled-language)");
|
6 |
-
|
7 |
-
for (i = 0; i < trp_language_switcher_urls.length; i++) {
|
8 |
-
trp_language_switcher_urls[i].addEventListener("click", function(){
|
9 |
-
if ( typeof wc_cart_fragments_params !== 'undefined' && typeof wc_cart_fragments_params.fragment_name !== 'undefined' ) {
|
10 |
-
window.sessionStorage.removeItem(wc_cart_fragments_params.fragment_name);
|
11 |
-
}
|
12 |
-
});
|
13 |
-
}
|
14 |
-
}
|
15 |
-
|
16 |
-
trpClearWooCartFragments();
|
17 |
-
});
|
1 |
+
document.addEventListener("DOMContentLoaded", function(event) {
|
2 |
+
function trpClearWooCartFragments(){
|
3 |
+
|
4 |
+
// clear WooCommerce cart fragments when switching language
|
5 |
+
var trp_language_switcher_urls = document.querySelectorAll(".trp-language-switcher-container a:not(.trp-ls-disabled-language)");
|
6 |
+
|
7 |
+
for (i = 0; i < trp_language_switcher_urls.length; i++) {
|
8 |
+
trp_language_switcher_urls[i].addEventListener("click", function(){
|
9 |
+
if ( typeof wc_cart_fragments_params !== 'undefined' && typeof wc_cart_fragments_params.fragment_name !== 'undefined' ) {
|
10 |
+
window.sessionStorage.removeItem(wc_cart_fragments_params.fragment_name);
|
11 |
+
}
|
12 |
+
});
|
13 |
+
}
|
14 |
+
}
|
15 |
+
|
16 |
+
trpClearWooCartFragments();
|
17 |
+
});
|
assets/js/trp-iframe-preview-script.js
CHANGED
@@ -1,149 +1,149 @@
|
|
1 |
-
/**
|
2 |
-
* Script used for window previewed in Translation Editor.
|
3 |
-
*/
|
4 |
-
function TRP_Iframe_Preview(){
|
5 |
-
|
6 |
-
var _this = this;
|
7 |
-
|
8 |
-
/**
|
9 |
-
* Add GET preview parameter for links and forms.
|
10 |
-
*/
|
11 |
-
this.initialize = function() {
|
12 |
-
if( typeof trpTranslator !== 'undefined' ) {
|
13 |
-
trpTranslator.pause_observer();
|
14 |
-
}
|
15 |
-
|
16 |
-
jQuery('a').each(function () {
|
17 |
-
// target parent brakes from the iframe so we're changing to self.
|
18 |
-
// We cannot remove it because we need it in Translation blocks
|
19 |
-
jQuery(this).attr('data-trp-original-target', jQuery(this).attr('target') );
|
20 |
-
jQuery(this).attr('target', '_self');
|
21 |
-
|
22 |
-
if( typeof this.href != "undefined" && this.href != '' ) {
|
23 |
-
if (this.action != '' && this.href.indexOf('void(0)') === -1) {
|
24 |
-
if (is_link_previewable(this) && !this.getAttribute('href').startsWith('#')) {
|
25 |
-
this.href = update_query_string('trp-edit-translation', 'preview', this.getAttribute('href'));
|
26 |
-
/* pass on trp-view-as parameters to all links that also have preview parameter */
|
27 |
-
if( typeof URL == 'function' && window.location.href.search("trp-view-as=") >= 0 && window.location.href.search("trp-view-as-nonce=") >= 0 ){
|
28 |
-
var currentUrl = new URL(window.location.href);
|
29 |
-
this.href = update_query_string('trp-view-as', currentUrl.searchParams.get("trp-view-as"), this.href);
|
30 |
-
this.href = update_query_string('trp-view-as-nonce', currentUrl.searchParams.get("trp-view-as-nonce"), this.href);
|
31 |
-
}
|
32 |
-
|
33 |
-
} else {
|
34 |
-
jQuery(this).on('click',
|
35 |
-
function (event) {
|
36 |
-
event.preventDefault();
|
37 |
-
}
|
38 |
-
);
|
39 |
-
}
|
40 |
-
}
|
41 |
-
}
|
42 |
-
});
|
43 |
-
|
44 |
-
jQuery('form').each(function () {
|
45 |
-
jQuery( this ).append( jQuery('<input></input>').attr({ type: 'hidden', value: 'preview', name: 'trp-edit-translation' }) );
|
46 |
-
});
|
47 |
-
|
48 |
-
addKeyboardShortcutsListener();
|
49 |
-
if( typeof trpTranslator !== 'undefined' ) {
|
50 |
-
trpTranslator.resume_observer();
|
51 |
-
}
|
52 |
-
};
|
53 |
-
|
54 |
-
function addKeyboardShortcutsListener(){
|
55 |
-
document.addEventListener("keydown", function(e) {
|
56 |
-
// CTRL + S
|
57 |
-
if ((window.navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey) && e.keyCode === 83) {
|
58 |
-
e.preventDefault();
|
59 |
-
window.parent.dispatchEvent( new Event( 'trp_trigger_save_translations_event' ) );
|
60 |
-
}
|
61 |
-
|
62 |
-
if ((window.navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey) && e.altKey ) {
|
63 |
-
switch (e.keyCode){
|
64 |
-
|
65 |
-
// CTRL + ALT + right arrow
|
66 |
-
case 39:
|
67 |
-
e.preventDefault();
|
68 |
-
window.parent.dispatchEvent( new Event( 'trp_trigger_next_string_event' ) );
|
69 |
-
break;
|
70 |
-
|
71 |
-
// CTRL + ALT + left arrow
|
72 |
-
case 37:
|
73 |
-
e.preventDefault();
|
74 |
-
window.parent.dispatchEvent( new Event( 'trp_trigger_previous_string_event' ) );
|
75 |
-
break;
|
76 |
-
|
77 |
-
// CTRL + ALT + Z
|
78 |
-
case 90:
|
79 |
-
e.preventDefault();
|
80 |
-
window.parent.dispatchEvent(new Event('trp_trigger_discard_all_changes_event'));
|
81 |
-
break;
|
82 |
-
}
|
83 |
-
}
|
84 |
-
}, false);
|
85 |
-
}
|
86 |
-
|
87 |
-
/**
|
88 |
-
* Update url with query string.
|
89 |
-
*
|
90 |
-
*/
|
91 |
-
function update_query_string(key, value, url) {
|
92 |
-
if (!url) url = window.location.href;
|
93 |
-
var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi"),
|
94 |
-
hash;
|
95 |
-
|
96 |
-
if (re.test(url)) {
|
97 |
-
if (typeof value !== 'undefined' && value !== null)
|
98 |
-
return url.replace(re, '$1' + key + "=" + value + '$2$3');
|
99 |
-
else {
|
100 |
-
hash = url.split('#');
|
101 |
-
url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
|
102 |
-
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
103 |
-
url += '#' + hash[1];
|
104 |
-
return url;
|
105 |
-
}
|
106 |
-
}
|
107 |
-
else {
|
108 |
-
if (typeof value !== 'undefined' && value !== null ) {
|
109 |
-
var separator = url.indexOf('?') !== -1 ? '&' : '?';
|
110 |
-
hash = url.split('#');
|
111 |
-
url = hash[0] + separator + key + '=' + value;
|
112 |
-
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
113 |
-
url += '#' + hash[1];
|
114 |
-
return url;
|
115 |
-
}
|
116 |
-
else
|
117 |
-
return url;
|
118 |
-
}
|
119 |
-
}
|
120 |
-
|
121 |
-
/**
|
122 |
-
* Return boolean whether element has unpreviewable attribute.
|
123 |
-
*/
|
124 |
-
function is_link_previewable( element ) {
|
125 |
-
if ( jQuery( element ).attr( 'data-trp-unpreviewable' ) == 'trp-unpreviewable' ){
|
126 |
-
return false;
|
127 |
-
}
|
128 |
-
return true;
|
129 |
-
}
|
130 |
-
|
131 |
-
_this.initialize();
|
132 |
-
}
|
133 |
-
|
134 |
-
var trp_preview_iframe;
|
135 |
-
|
136 |
-
jQuery( function(){
|
137 |
-
trp_preview_iframe = new TRP_Iframe_Preview();
|
138 |
-
window.addEventListener( 'trp_iframe_page_updated', trp_preview_iframe.initialize )
|
139 |
-
});
|
140 |
-
|
141 |
-
/**
|
142 |
-
* the startsWith method is not supported in IE so in that case we need to implement it
|
143 |
-
*/
|
144 |
-
if (!String.prototype.startsWith) {
|
145 |
-
String.prototype.startsWith = function(searchString, position) {
|
146 |
-
position = position || 0;
|
147 |
-
return this.indexOf(searchString, position) === position;
|
148 |
-
};
|
149 |
-
}
|
1 |
+
/**
|
2 |
+
* Script used for window previewed in Translation Editor.
|
3 |
+
*/
|
4 |
+
function TRP_Iframe_Preview(){
|
5 |
+
|
6 |
+
var _this = this;
|
7 |
+
|
8 |
+
/**
|
9 |
+
* Add GET preview parameter for links and forms.
|
10 |
+
*/
|
11 |
+
this.initialize = function() {
|
12 |
+
if( typeof trpTranslator !== 'undefined' ) {
|
13 |
+
trpTranslator.pause_observer();
|
14 |
+
}
|
15 |
+
|
16 |
+
jQuery('a').each(function () {
|
17 |
+
// target parent brakes from the iframe so we're changing to self.
|
18 |
+
// We cannot remove it because we need it in Translation blocks
|
19 |
+
jQuery(this).attr('data-trp-original-target', jQuery(this).attr('target') );
|
20 |
+
jQuery(this).attr('target', '_self');
|
21 |
+
|
22 |
+
if( typeof this.href != "undefined" && this.href != '' ) {
|
23 |
+
if (this.action != '' && this.href.indexOf('void(0)') === -1) {
|
24 |
+
if (is_link_previewable(this) && !this.getAttribute('href').startsWith('#')) {
|
25 |
+
this.href = update_query_string('trp-edit-translation', 'preview', this.getAttribute('href'));
|
26 |
+
/* pass on trp-view-as parameters to all links that also have preview parameter */
|
27 |
+
if( typeof URL == 'function' && window.location.href.search("trp-view-as=") >= 0 && window.location.href.search("trp-view-as-nonce=") >= 0 ){
|
28 |
+
var currentUrl = new URL(window.location.href);
|
29 |
+
this.href = update_query_string('trp-view-as', currentUrl.searchParams.get("trp-view-as"), this.href);
|
30 |
+
this.href = update_query_string('trp-view-as-nonce', currentUrl.searchParams.get("trp-view-as-nonce"), this.href);
|
31 |
+
}
|
32 |
+
|
33 |
+
} else {
|
34 |
+
jQuery(this).on('click',
|
35 |
+
function (event) {
|
36 |
+
event.preventDefault();
|
37 |
+
}
|
38 |
+
);
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
});
|
43 |
+
|
44 |
+
jQuery('form').each(function () {
|
45 |
+
jQuery( this ).append( jQuery('<input></input>').attr({ type: 'hidden', value: 'preview', name: 'trp-edit-translation' }) );
|
46 |
+
});
|
47 |
+
|
48 |
+
addKeyboardShortcutsListener();
|
49 |
+
if( typeof trpTranslator !== 'undefined' ) {
|
50 |
+
trpTranslator.resume_observer();
|
51 |
+
}
|
52 |
+
};
|
53 |
+
|
54 |
+
function addKeyboardShortcutsListener(){
|
55 |
+
document.addEventListener("keydown", function(e) {
|
56 |
+
// CTRL + S
|
57 |
+
if ((window.navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey) && e.keyCode === 83) {
|
58 |
+
e.preventDefault();
|
59 |
+
window.parent.dispatchEvent( new Event( 'trp_trigger_save_translations_event' ) );
|
60 |
+
}
|
61 |
+
|
62 |
+
if ((window.navigator.platform.match("Mac") ? e.metaKey : e.ctrlKey) && e.altKey ) {
|
63 |
+
switch (e.keyCode){
|
64 |
+
|
65 |
+
// CTRL + ALT + right arrow
|
66 |
+
case 39:
|
67 |
+
e.preventDefault();
|
68 |
+
window.parent.dispatchEvent( new Event( 'trp_trigger_next_string_event' ) );
|
69 |
+
break;
|
70 |
+
|
71 |
+
// CTRL + ALT + left arrow
|
72 |
+
case 37:
|
73 |
+
e.preventDefault();
|
74 |
+
window.parent.dispatchEvent( new Event( 'trp_trigger_previous_string_event' ) );
|
75 |
+
break;
|
76 |
+
|
77 |
+
// CTRL + ALT + Z
|
78 |
+
case 90:
|
79 |
+
e.preventDefault();
|
80 |
+
window.parent.dispatchEvent(new Event('trp_trigger_discard_all_changes_event'));
|
81 |
+
break;
|
82 |
+
}
|
83 |
+
}
|
84 |
+
}, false);
|
85 |
+
}
|
86 |
+
|
87 |
+
/**
|
88 |
+
* Update url with query string.
|
89 |
+
*
|
90 |
+
*/
|
91 |
+
function update_query_string(key, value, url) {
|
92 |
+
if (!url) url = window.location.href;
|
93 |
+
var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi"),
|
94 |
+
hash;
|
95 |
+
|
96 |
+
if (re.test(url)) {
|
97 |
+
if (typeof value !== 'undefined' && value !== null)
|
98 |
+
return url.replace(re, '$1' + key + "=" + value + '$2$3');
|
99 |
+
else {
|
100 |
+
hash = url.split('#');
|
101 |
+
url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
|
102 |
+
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
103 |
+
url += '#' + hash[1];
|
104 |
+
return url;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
else {
|
108 |
+
if (typeof value !== 'undefined' && value !== null ) {
|
109 |
+
var separator = url.indexOf('?') !== -1 ? '&' : '?';
|
110 |
+
hash = url.split('#');
|
111 |
+
url = hash[0] + separator + key + '=' + value;
|
112 |
+
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
113 |
+
url += '#' + hash[1];
|
114 |
+
return url;
|
115 |
+
}
|
116 |
+
else
|
117 |
+
return url;
|
118 |
+
}
|
119 |
+
}
|
120 |
+
|
121 |
+
/**
|
122 |
+
* Return boolean whether element has unpreviewable attribute.
|
123 |
+
*/
|
124 |
+
function is_link_previewable( element ) {
|
125 |
+
if ( jQuery( element ).attr( 'data-trp-unpreviewable' ) == 'trp-unpreviewable' ){
|
126 |
+
return false;
|
127 |
+
}
|
128 |
+
return true;
|
129 |
+
}
|
130 |
+
|
131 |
+
_this.initialize();
|
132 |
+
}
|
133 |
+
|
134 |
+
var trp_preview_iframe;
|
135 |
+
|
136 |
+
jQuery( function(){
|
137 |
+
trp_preview_iframe = new TRP_Iframe_Preview();
|
138 |
+
window.addEventListener( 'trp_iframe_page_updated', trp_preview_iframe.initialize )
|
139 |
+
});
|
140 |
+
|
141 |
+
/**
|
142 |
+
* the startsWith method is not supported in IE so in that case we need to implement it
|
143 |
+
*/
|
144 |
+
if (!String.prototype.startsWith) {
|
145 |
+
String.prototype.startsWith = function(searchString, position) {
|
146 |
+
position = position || 0;
|
147 |
+
return this.indexOf(searchString, position) === position;
|
148 |
+
};
|
149 |
+
}
|
assets/js/trp-translate-dom-changes.js
CHANGED
@@ -1,564 +1,564 @@
|
|
1 |
-
|
2 |
-
/**
|
3 |
-
* Script to replace dynamically added strings with their translation.
|
4 |
-
*/
|
5 |
-
function TRP_Translator(){
|
6 |
-
|
7 |
-
this.is_editor = false;
|
8 |
-
var _this = this;
|
9 |
-
var observer = null;
|
10 |
-
var observerConfig = {
|
11 |
-
attributes: true,
|
12 |
-
childList: true,
|
13 |
-
characterData: false,//this could be CDATA so I set it to false in v 1.4.5
|
14 |
-
subtree: true
|
15 |
-
};
|
16 |
-
var custom_ajax_url = trp_data.trp_custom_ajax_url;
|
17 |
-
var wp_ajax_url = trp_data.trp_wp_ajax_url;
|
18 |
-
var language_to_query;
|
19 |
-
var except_characters = " \t\n\r �.,/`~!@#$€£%^&*():;-_=+[]{}\\|?/<>1234567890'";
|
20 |
-
var trim_characters = " \t\n\r �\x0A\x0B" + "\302" + "\240";
|
21 |
-
var already_detected = [];
|
22 |
-
var duplicate_detections_allowed = parseInt( trp_data.duplicate_detections_allowed )
|
23 |
-
|
24 |
-
/**
|
25 |
-
* Ajax request to get translations for strings
|
26 |
-
*/
|
27 |
-
this.ajax_get_translation = function( nodesInfo, string_originals, url, skip_machine_translation ) {
|
28 |
-
jQuery.ajax({
|
29 |
-
url: url,
|
30 |
-
type: 'post',
|
31 |
-
dataType: 'json',
|
32 |
-
data: {
|
33 |
-
action : 'trp_get_translations_regular',
|
34 |
-
all_languages : 'false',
|
35 |
-
security : trp_data['gettranslationsnonceregular'],
|
36 |
-
language : language_to_query,
|
37 |
-
original_language : original_language, // used for trp custom ajax
|
38 |
-
originals : JSON.stringify( string_originals ),
|
39 |
-
skip_machine_translation : JSON.stringify( skip_machine_translation ),
|
40 |
-
dynamic_strings : 'true'
|
41 |
-
},
|
42 |
-
success: function( response ) {
|
43 |
-
if ( response === 'error' ) {
|
44 |
-
_this.ajax_get_translation( nodesInfo, string_originals, wp_ajax_url, skip_machine_translation );
|
45 |
-
console.log( 'Notice: TranslatePress trp-ajax request uses fall back to admin ajax.' );
|
46 |
-
}else{
|
47 |
-
_this.update_strings( response, nodesInfo );
|
48 |
-
}
|
49 |
-
},
|
50 |
-
error: function( errorThrown ){
|
51 |
-
if ( url == custom_ajax_url && custom_ajax_url != wp_ajax_url ){
|
52 |
-
_this.ajax_get_translation( nodesInfo, string_originals, wp_ajax_url, skip_machine_translation );
|
53 |
-
console.log( 'Notice: TranslatePress trp-ajax request uses fall back to admin ajax.' );
|
54 |
-
}else{
|
55 |
-
_this.update_strings( null, nodesInfo );
|
56 |
-
console.log( 'TranslatePress AJAX Request Error' );
|
57 |
-
}
|
58 |
-
}
|
59 |
-
});
|
60 |
-
};
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Return given text converted to html.
|
64 |
-
*
|
65 |
-
* Useful for decoding special characters into displayable form.
|
66 |
-
*
|
67 |
-
* @param html
|
68 |
-
* @returns {*}
|
69 |
-
*/
|
70 |
-
this.decode_html = function( html ) {
|
71 |
-
var txt = document.createElement( "textarea" );
|
72 |
-
txt.innerHTML = html;
|
73 |
-
return txt.value;
|
74 |
-
};
|
75 |
-
|
76 |
-
/**
|
77 |
-
* Replace original strings with translations if found.
|
78 |
-
*/
|
79 |
-
this.update_strings = function( response, nodesInfo ) {
|
80 |
-
_this.pause_observer();
|
81 |
-
if ( response != null && response.length > 0 ){
|
82 |
-
var newEntries = [];
|
83 |
-
for (var j = 0 ; j < nodesInfo.length; j++){
|
84 |
-
var nodeInfo = nodesInfo[j];
|
85 |
-
var translation_found = false;
|
86 |
-
var initial_value = nodeInfo.original;
|
87 |
-
for( var i in response ) {
|
88 |
-
var response_string = response[i].translationsArray[language_to_query];
|
89 |
-
if (response[i].original.trim() == nodeInfo.original.trim()) {
|
90 |
-
// The nodeInfo can contain duplicates and response cannot. We need duplicates to refer to different jQuery objects where the same string appears in different places on the page.
|
91 |
-
var entry = response[i]
|
92 |
-
entry.selector = 'data-trp-translate-id'
|
93 |
-
entry.attribute = ''
|
94 |
-
newEntries.push( entry )
|
95 |
-
if ( _this.is_editor ) {
|
96 |
-
var jquery_object;
|
97 |
-
var trp_translate_id = 'data-trp-translate-id'
|
98 |
-
var trp_node_group = 'data-trp-node-group'
|
99 |
-
if ( nodeInfo.attribute ) {
|
100 |
-
jquery_object = jQuery(nodeInfo.node)
|
101 |
-
trp_translate_id = trp_translate_id + '-' + nodeInfo.attribute
|
102 |
-
trp_node_group = trp_node_group + '-' + nodeInfo.attribute
|
103 |
-
}else{
|
104 |
-
jquery_object = jQuery(nodeInfo.node).parent('translate-press');
|
105 |
-
}
|
106 |
-
jquery_object.attr( trp_translate_id, response[i].dbID );
|
107 |
-
jquery_object.attr( trp_node_group, response[i].group );
|
108 |
-
}
|
109 |
-
|
110 |
-
if (response_string.translated != '' && language_to_query == current_language ) {
|
111 |
-
var text_to_set = _this.decode_html( initial_value.replace(initial_value.trim(), response_string.translated));
|
112 |
-
if ( nodeInfo.attribute ){
|
113 |
-
nodeInfo.node.setAttribute( nodeInfo.attribute, text_to_set )
|
114 |
-
if ( nodeInfo.attribute == 'src' ){
|
115 |
-
nodeInfo.node.setAttribute( 'srcset', '' )
|
116 |
-
nodeInfo.node.setAttribute( 'data-src', text_to_set )
|
117 |
-
}
|
118 |
-
}else {
|
119 |
-
nodeInfo.node.textContent = text_to_set;
|
120 |
-
}
|
121 |
-
translation_found = true;
|
122 |
-
}
|
123 |
-
break;
|
124 |
-
}
|
125 |
-
}
|
126 |
-
|
127 |
-
already_detected[ initial_value ] = (initial_value in already_detected ) ? already_detected[ initial_value ] + 1 : 0
|
128 |
-
if ( ! translation_found ){
|
129 |
-
if ( nodeInfo.attribute ){
|
130 |
-
if ( nodeInfo.attribute != 'src' ) {
|
131 |
-
nodeInfo.node.setAttribute(nodeInfo.attribute, initial_value)
|
132 |
-
}
|
133 |
-
}else {
|
134 |
-
nodeInfo.node.textContent = initial_value;
|
135 |
-
}
|
136 |
-
}
|
137 |
-
|
138 |
-
}
|
139 |
-
// this should always be outside the for loop
|
140 |
-
if ( _this.is_editor ) {
|
141 |
-
window.parent.dispatchEvent( new Event( 'trp_iframe_page_updated' ) );
|
142 |
-
window.dispatchEvent( new Event( 'trp_iframe_page_updated' ) );
|
143 |
-
}
|
144 |
-
|
145 |
-
}else{
|
146 |
-
for (var j = 0 ; j < nodesInfo.length; j++){
|
147 |
-
if ( nodesInfo[j].attribute ){
|
148 |
-
if ( nodesInfo[j].attribute != 'src' ) {
|
149 |
-
nodesInfo[j].node.setAttribute(nodesInfo[j].attribute, nodesInfo[j].original)
|
150 |
-
}
|
151 |
-
}else {
|
152 |
-
nodesInfo[j].node.textContent = nodesInfo[j].original;
|
153 |
-
}
|
154 |
-
already_detected[ nodesInfo[j].original ] = (nodesInfo[j].original in already_detected ) ? already_detected[ nodesInfo[j].original ] + 1 : 0
|
155 |
-
}
|
156 |
-
}
|
157 |
-
_this.resume_observer();
|
158 |
-
};
|
159 |
-
|
160 |
-
/*
|
161 |
-
* Separated from the detect_new_strings function to allow disconnecting observer.
|
162 |
-
*/
|
163 |
-
this.detect_new_strings_callback = function( mutations ){
|
164 |
-
// calling disconnect directly instead of calling pause_observer because we don't need to takeRecords() (called from pause_observer) because we would duplicate mutations
|
165 |
-
observer.disconnect()
|
166 |
-
_this.detect_new_strings( mutations );
|
167 |
-
_this.resume_observer();
|
168 |
-
}
|
169 |
-
|
170 |
-
/**
|
171 |
-
* Detect and remember added strings.
|
172 |
-
*/
|
173 |
-
this.detect_new_strings = function( mutations ){
|
174 |
-
var string_originals = [];
|
175 |
-
var nodesInfo = [];
|
176 |
-
var skip_machine_translation = [];
|
177 |
-
var translateable;
|
178 |
-
mutations.forEach( function (mutation) {
|
179 |
-
for (var i = 0; i < mutation.addedNodes.length; i++) {
|
180 |
-
var node = mutation.addedNodes[i]
|
181 |
-
/* if it is an anchor add the trp-edit-translation=preview parameter to it */
|
182 |
-
if ( _this.is_editor ) {
|
183 |
-
jQuery(node).find('a').context.href = _this.update_query_string('trp-edit-translation', 'preview', jQuery(node).find('a').context.href);
|
184 |
-
}
|
185 |
-
|
186 |
-
if ( _this.skip_string(node) ){
|
187 |
-
continue;
|
188 |
-
}
|
189 |
-
|
190 |
-
// Search for innertext modifications or newly added nodes with innertext
|
191 |
-
translateable = _this.get_translateable_textcontent( node )
|
192 |
-
string_originals = string_originals.concat( translateable.string_originals );
|
193 |
-
nodesInfo = nodesInfo.concat( translateable.nodesInfo );
|
194 |
-
|
195 |
-
// Search for text inside attributes of newly added nodes
|
196 |
-
translateable = _this.get_translateable_attributes( node )
|
197 |
-
string_originals = string_originals.concat( translateable.string_originals );
|
198 |
-
nodesInfo = nodesInfo.concat( translateable.nodesInfo );
|
199 |
-
skip_machine_translation = skip_machine_translation.concat( translateable.skip_machine_translation );
|
200 |
-
}
|
201 |
-
|
202 |
-
if ( mutation.attributeName ){
|
203 |
-
if ( ! _this.in_array( mutation.attributeName, trp_data.trp_attributes_accessors ) ){
|
204 |
-
return
|
205 |
-
}
|
206 |
-
if ( _this.skip_string_attribute( mutation.target, mutation.attributeName ) || _this.skip_string(mutation.target) ){
|
207 |
-
return
|
208 |
-
}
|
209 |
-
|
210 |
-
// Search for modified text inside attributes of existing nodes
|
211 |
-
translateable = _this.get_translateable_attributes( mutation.target )
|
212 |
-
string_originals = string_originals.concat( translateable.string_originals );
|
213 |
-
nodesInfo = nodesInfo.concat( translateable.nodesInfo );
|
214 |
-
skip_machine_translation = skip_machine_translation.concat( translateable.skip_machine_translation );
|
215 |
-
}
|
216 |
-
});
|
217 |
-
if ( nodesInfo.length > 0 ) {
|
218 |
-
var ajax_url_to_call = (_this.is_editor) ? wp_ajax_url : custom_ajax_url;
|
219 |
-
_this.ajax_get_translation( nodesInfo, string_originals, ajax_url_to_call, skip_machine_translation );
|
220 |
-
}
|
221 |
-
};
|
222 |
-
|
223 |
-
this.skip_string = function(node){
|
224 |
-
// skip nodes containing these attributes
|
225 |
-
var selectors = trp_data.trp_skip_selectors;
|
226 |
-
for (var i = 0; i < selectors.length ; i++ ){
|
227 |
-
if ( jQuery(node).closest( selectors[ i ] ).length > 0 ){
|
228 |
-
return true;
|
229 |
-
}
|
230 |
-
}
|
231 |
-
return false;
|
232 |
-
};
|
233 |
-
|
234 |
-
/*
|
235 |
-
* Skip string based on original string text
|
236 |
-
*/
|
237 |
-
this.skip_string_original = function ( string ){
|
238 |
-
return ( ( already_detected[string] > duplicate_detections_allowed ) || _this.in_array( string, trp_data.skip_strings_from_dynamic_translation ) )
|
239 |
-
}
|
240 |
-
|
241 |
-
this.skip_string_attribute = function(node, attribute){
|
242 |
-
// skip nodes containing these attributes
|
243 |
-
var selectors = trp_data.trp_base_selectors;
|
244 |
-
for (var i = 0; i < selectors.length ; i++ ){
|
245 |
-
if ( typeof jQuery(node).attr( selectors[ i ] + '-' + attribute ) !== 'undefined' ){
|
246 |
-
return true;
|
247 |
-
}
|
248 |
-
}
|
249 |
-
return false;
|
250 |
-
};
|
251 |
-
|
252 |
-
this.in_array = function (needle, array ) {
|
253 |
-
var i
|
254 |
-
var length = array.length
|
255 |
-
for( i = length - 1; i >= 0; i-- ){
|
256 |
-
if ( array[i] === needle ){
|
257 |
-
return true
|
258 |
-
}
|
259 |
-
}
|
260 |
-
return false
|
261 |
-
}
|
262 |
-
|
263 |
-
this.get_translateable_textcontent = function( node ){
|
264 |
-
var string_originals = [];
|
265 |
-
var nodesInfo = [];
|
266 |
-
if ( node.textContent && _this.trim( node.textContent.trim(), except_characters ) != '' ) {
|
267 |
-
|
268 |
-
var direct_string = get_string_from_node( node );
|
269 |
-
if ( direct_string ) {
|
270 |
-
// a text without HTML was added
|
271 |
-
if ( _this.trim( direct_string.textContent, except_characters ) != '' ) {
|
272 |
-
var extracted_original = _this.trim(direct_string.textContent, trim_characters);
|
273 |
-
if ( ! _this.skip_string_original( extracted_original )) {
|
274 |
-
nodesInfo.push({node: node, original: extracted_original, attribute: ''});
|
275 |
-
string_originals.push(extracted_original)
|
276 |
-
|
277 |
-
direct_string.textContent = '';
|
278 |
-
if (_this.is_editor) {
|
279 |
-
jQuery(node).wrap('<translate-press></translate-press>');
|
280 |
-
}
|
281 |
-
}
|
282 |
-
}
|
283 |
-
}else{
|
284 |
-
// node contains HTML
|
285 |
-
var all_nodes = jQuery( node ).find( '*').addBack();
|
286 |
-
var all_strings = all_nodes.contents().filter(function(){
|
287 |
-
if( this.nodeType === 3 && /\S/.test(this.nodeValue) ){
|
288 |
-
if ( ! _this.skip_string(this) ){
|
289 |
-
return this;
|
290 |
-
}
|
291 |
-
}});
|
292 |
-
if ( _this.is_editor ) {
|
293 |
-
all_strings.wrap('<translate-press></translate-press>');
|
294 |
-
}
|
295 |
-
var all_strings_length = all_strings.length;
|
296 |
-
for (var j = 0; j < all_strings_length; j++ ) {
|
297 |
-
if ( _this.trim( all_strings[j].textContent, except_characters ) != '' ) {
|
298 |
-
if ( ! _this.skip_string_original( all_strings[j].textContent )) {
|
299 |
-
nodesInfo.push({node: all_strings[j], original: all_strings[j].textContent, attribute: ''});
|
300 |
-
string_originals.push(all_strings[j].textContent)
|
301 |
-
if (trp_data ['showdynamiccontentbeforetranslation'] == false) {
|
302 |
-
all_strings[j].textContent = '';
|
303 |
-
}
|
304 |
-
}
|
305 |
-
}
|
306 |
-
}
|
307 |
-
}
|
308 |
-
}
|
309 |
-
return { 'string_originals': string_originals, 'nodesInfo': nodesInfo };
|
310 |
-
}
|
311 |
-
|
312 |
-
this.get_translateable_attributes = function ( node ) {
|
313 |
-
var nodesInfo = []
|
314 |
-
var string_originals = []
|
315 |
-
var skip_attr_machine_translation = [ 'href', 'src' ]
|
316 |
-
var skip_machine_translation = []
|
317 |
-
for (var trp_attribute_key in trp_data.trp_attributes_selectors) {
|
318 |
-
if (trp_data.trp_attributes_selectors.hasOwnProperty(trp_attribute_key)) {
|
319 |
-
var attribute_selector_item = trp_data.trp_attributes_selectors[trp_attribute_key]
|
320 |
-
if ( typeof attribute_selector_item['selector'] !== 'undefined' ){
|
321 |
-
var all_nodes = jQuery( node ).find( attribute_selector_item.selector ).addBack( attribute_selector_item.selector )
|
322 |
-
|
323 |
-
var all_nodes_length = all_nodes.length
|
324 |
-
for (var j = 0; j < all_nodes_length; j++ ) {
|
325 |
-
if ( _this.skip_string( all_nodes[j] ) || _this.skip_string_attribute( all_nodes[j], attribute_selector_item.accessor ) ){
|
326 |
-
continue;
|
327 |
-
}
|
328 |
-
|
329 |
-
var attribute_content = all_nodes[j].getAttribute( attribute_selector_item.accessor )
|
330 |
-
if ( _this.skip_string_original( attribute_content )){
|
331 |
-
continue;
|
332 |
-
}
|
333 |
-
if ( attribute_content && _this.trim( attribute_content.trim(), except_characters ) != '' ) {
|
334 |
-
nodesInfo.push({node: all_nodes[j], original: attribute_content, attribute: attribute_selector_item.accessor });
|
335 |
-
string_originals.push( attribute_content )
|
336 |
-
if ( trp_data ['showdynamiccontentbeforetranslation'] == false && ( attribute_selector_item.accessor != 'src' ) ) {
|
337 |
-
all_nodes[j].setAttribute( attribute_selector_item.accessor, '' );
|
338 |
-
}
|
339 |
-
for ( var s = 0; s < skip_attr_machine_translation.length; s++ ){
|
340 |
-
if ( attribute_selector_item.accessor === skip_attr_machine_translation[s] ){
|
341 |
-
skip_machine_translation.push( attribute_content )
|
342 |
-
break
|
343 |
-
}
|
344 |
-
}
|
345 |
-
}
|
346 |
-
}
|
347 |
-
}
|
348 |
-
}
|
349 |
-
}
|
350 |
-
return { 'string_originals': string_originals, 'nodesInfo': nodesInfo, 'skip_machine_translation': skip_machine_translation };
|
351 |
-
}
|
352 |
-
|
353 |
-
function get_string_from_node( node ){
|
354 |
-
if( node.nodeType === 3 && /\S/.test(node.nodeValue) ){
|
355 |
-
if ( ! _this.skip_string(node) ){
|
356 |
-
return node;
|
357 |
-
}
|
358 |
-
}
|
359 |
-
}
|
360 |
-
|
361 |
-
// cleans the gettext wrappers
|
362 |
-
this.cleanup_gettext_wrapper = function(){
|
363 |
-
jQuery('trp-gettext').contents().unwrap();
|
364 |
-
};
|
365 |
-
|
366 |
-
/**
|
367 |
-
* Update url with query string.
|
368 |
-
*
|
369 |
-
*/
|
370 |
-
this.update_query_string = function(key, value, url) {
|
371 |
-
if (!url) return url;
|
372 |
-
if ( url.startsWith('#') ){
|
373 |
-
return url;
|
374 |
-
}
|
375 |
-
var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi"),
|
376 |
-
hash;
|
377 |
-
|
378 |
-
if (re.test(url)) {
|
379 |
-
if (typeof value !== 'undefined' && value !== null)
|
380 |
-
return url.replace(re, '$1' + key + "=" + value + '$2$3');
|
381 |
-
else {
|
382 |
-
hash = url.split('#');
|
383 |
-
url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
|
384 |
-
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
385 |
-
url += '#' + hash[1];
|
386 |
-
return url;
|
387 |
-
}
|
388 |
-
}
|
389 |
-
else {
|
390 |
-
if (typeof value !== 'undefined' && value !== null ) {
|
391 |
-
var separator = url.indexOf('?') !== -1 ? '&' : '?';
|
392 |
-
hash = url.split('#');
|
393 |
-
url = hash[0] + separator + key + '=' + value;
|
394 |
-
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
395 |
-
url += '#' + hash[1];
|
396 |
-
return url;
|
397 |
-
}
|
398 |
-
else
|
399 |
-
return url;
|
400 |
-
}
|
401 |
-
};
|
402 |
-
|
403 |
-
/**
|
404 |
-
* Initialize and configure observer.
|
405 |
-
*/
|
406 |
-
this.initialize = function() {
|
407 |
-
this.is_editor = (typeof window.parent.tpEditorApp !== 'undefined' )
|
408 |
-
if ( this.is_editor ) {
|
409 |
-
trp_data['gettranslationsnonceregular'] = window.parent.trp_dynamic_nonce;
|
410 |
-
}
|
411 |
-
|
412 |
-
current_language = trp_data.trp_current_language;
|
413 |
-
original_language = trp_data.trp_original_language;
|
414 |
-
language_to_query = trp_data.trp_language_to_query;
|
415 |
-
|
416 |
-
// create an observer instance
|
417 |
-
observer = new MutationObserver( _this.detect_new_strings_callback );
|
418 |
-
|
419 |
-
_this.resume_observer();
|
420 |
-
|
421 |
-
jQuery( document ).ajaxComplete(function( event, request, settings ) {
|
422 |
-
if( typeof window.parent.jQuery !== "undefined" && window.parent.jQuery('#trp-preview-iframe').length != 0 ) {
|
423 |
-
var settingsdata = "" + settings.data;
|
424 |
-
if( typeof settings.data == 'undefined' || jQuery.isEmptyObject( settings.data ) || settingsdata.indexOf('action=trp_') === -1 ) {
|
425 |
-
window.parent.dispatchEvent( new Event( 'trp_iframe_page_updated' ) );
|
426 |
-
}
|
427 |
-
}
|
428 |
-
});
|
429 |
-
|
430 |
-
//try a final attempt at cleaning the gettext wrappers
|
431 |
-
_this.cleanup_gettext_wrapper();
|
432 |
-
};
|
433 |
-
|
434 |
-
/**
|
435 |
-
* Resume observing new strings added.
|
436 |
-
*/
|
437 |
-
this.resume_observer = function(){
|
438 |
-
if ( language_to_query === '' ) {
|
439 |
-
// No translation languages are set other than default language
|
440 |
-
return;
|
441 |
-
}
|
442 |
-
observer.observe(document.body, observerConfig);
|
443 |
-
};
|
444 |
-
|
445 |
-
/**
|
446 |
-
* Pause observing new strings added.
|
447 |
-
*/
|
448 |
-
this.pause_observer = function(){
|
449 |
-
/*
|
450 |
-
Disconnect will delete the existing mutations detected prior to being passed to callback function.
|
451 |
-
So we are calling takeRecords to save them first, disconnect, then detect the strings
|
452 |
-
Disconnect happens before detect_new_strings to avoid detecting mutations from within detect new strings functions
|
453 |
-
*/
|
454 |
-
if ( language_to_query === '' ) {
|
455 |
-
// No translation languages are set other than default language
|
456 |
-
return;
|
457 |
-
}
|
458 |
-
var mutations = observer.takeRecords()
|
459 |
-
observer.disconnect()
|
460 |
-
if ( mutations.length > 0 ) {
|
461 |
-
_this.detect_new_strings(mutations)
|
462 |
-
}
|
463 |
-
|
464 |
-
};
|
465 |
-
|
466 |
-
this.trim = function (str, charlist) {
|
467 |
-
// discuss at: http://locutus.io/php/trim/
|
468 |
-
// original by: Kevin van Zonneveld (http://kvz.io)
|
469 |
-
// improved by: mdsjack (http://www.mdsjack.bo.it)
|
470 |
-
// improved by: Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev)
|
471 |
-
// improved by: Kevin van Zonneveld (http://kvz.io)
|
472 |
-
// improved by: Steven Levithan (http://blog.stevenlevithan.com)
|
473 |
-
// improved by: Jack
|
474 |
-
// input by: Erkekjetter
|
475 |
-
// input by: DxGx
|
476 |
-
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
|
477 |
-
// example 1: trim(' Kevin van Zonneveld ')
|
478 |
-
// returns 1: 'Kevin van Zonneveld'
|
479 |
-
// example 2: trim('Hello World', 'Hdle')
|
480 |
-
// returns 2: 'o Wor'
|
481 |
-
// example 3: trim(16, 1)
|
482 |
-
// returns 3: '6'
|
483 |
-
var whitespace = [
|
484 |
-
' ',
|
485 |
-
'\n',
|
486 |
-
'\r',
|
487 |
-
'\t',
|
488 |
-
'\f',
|
489 |
-
'\x0b',
|
490 |
-
'\xa0',
|
491 |
-
'\u2000',
|
492 |
-
'\u2001',
|
493 |
-
'\u2002',
|
494 |
-
'\u2003',
|
495 |
-
'\u2004',
|
496 |
-
'\u2005',
|
497 |
-
'\u2006',
|
498 |
-
'\u2007',
|
499 |
-
'\u2008',
|
500 |
-
'\u2009',
|
501 |
-
'\u200a',
|
502 |
-
'\u200b',
|
503 |
-
'\u2028',
|
504 |
-
'\u2029',
|
505 |
-
'\u3000'
|
506 |
-
].join('');
|
507 |
-
var l = 0;
|
508 |
-
var i = 0;
|
509 |
-
str += '';
|
510 |
-
if (charlist) {
|
511 |
-
whitespace += (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1');
|
512 |
-
}
|
513 |
-
l = str.length;
|
514 |
-
for (i = 0; i < l; i++) {
|
515 |
-
if (whitespace.indexOf(str.charAt(i)) === -1) {
|
516 |
-
str = str.substring(i);
|
517 |
-
break;
|
518 |
-
}
|
519 |
-
}
|
520 |
-
l = str.length;
|
521 |
-
for (i = l - 1; i >= 0; i--) {
|
522 |
-
if (whitespace.indexOf(str.charAt(i)) === -1) {
|
523 |
-
str = str.substring(0, i + 1);
|
524 |
-
break;
|
525 |
-
}
|
526 |
-
}
|
527 |
-
return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
|
528 |
-
};
|
529 |
-
|
530 |
-
_this.initialize();
|
531 |
-
}
|
532 |
-
|
533 |
-
var trpTranslator;
|
534 |
-
var current_language;
|
535 |
-
var original_language;
|
536 |
-
|
537 |
-
function trp_get_IE_version() {
|
538 |
-
var sAgent = window.navigator.userAgent;
|
539 |
-
var Idx = sAgent.indexOf("MSIE");
|
540 |
-
|
541 |
-
// If IE, return version number.
|
542 |
-
if (Idx > 0)
|
543 |
-
return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx)));
|
544 |
-
|
545 |
-
// If IE 11 then look for Updated user agent string.
|
546 |
-
else if (!!navigator.userAgent.match(/Trident\/7\./))
|
547 |
-
return 11;
|
548 |
-
else
|
549 |
-
return 0; //It is not IE
|
550 |
-
}
|
551 |
-
|
552 |
-
function trp_allow_detect_dom_changes_to_run(){
|
553 |
-
var IE_version = trp_get_IE_version();
|
554 |
-
if ( IE_version != 0 && IE_version <= 11 ){
|
555 |
-
return false;
|
556 |
-
}
|
557 |
-
return true;
|
558 |
-
}
|
559 |
-
|
560 |
-
|
561 |
-
// Initialize the Translate Press Editor when the script loads
|
562 |
-
if ( trp_allow_detect_dom_changes_to_run() ) {
|
563 |
-
trpTranslator = new TRP_Translator();
|
564 |
-
}
|
1 |
+
|
2 |
+
/**
|
3 |
+
* Script to replace dynamically added strings with their translation.
|
4 |
+
*/
|
5 |
+
function TRP_Translator(){
|
6 |
+
|
7 |
+
this.is_editor = false;
|
8 |
+
var _this = this;
|
9 |
+
var observer = null;
|
10 |
+
var observerConfig = {
|
11 |
+
attributes: true,
|
12 |
+
childList: true,
|
13 |
+
characterData: false,//this could be CDATA so I set it to false in v 1.4.5
|
14 |
+
subtree: true
|
15 |
+
};
|
16 |
+
var custom_ajax_url = trp_data.trp_custom_ajax_url;
|
17 |
+
var wp_ajax_url = trp_data.trp_wp_ajax_url;
|
18 |
+
var language_to_query;
|
19 |
+
var except_characters = " \t\n\r �.,/`~!@#$€£%^&*():;-_=+[]{}\\|?/<>1234567890'";
|
20 |
+
var trim_characters = " \t\n\r �\x0A\x0B" + "\302" + "\240";
|
21 |
+
var already_detected = [];
|
22 |
+
var duplicate_detections_allowed = parseInt( trp_data.duplicate_detections_allowed )
|
23 |
+
|
24 |
+
/**
|
25 |
+
* Ajax request to get translations for strings
|
26 |
+
*/
|
27 |
+
this.ajax_get_translation = function( nodesInfo, string_originals, url, skip_machine_translation ) {
|
28 |
+
jQuery.ajax({
|
29 |
+
url: url,
|
30 |
+
type: 'post',
|
31 |
+
dataType: 'json',
|
32 |
+
data: {
|
33 |
+
action : 'trp_get_translations_regular',
|
34 |
+
all_languages : 'false',
|
35 |
+
security : trp_data['gettranslationsnonceregular'],
|
36 |
+
language : language_to_query,
|
37 |
+
original_language : original_language, // used for trp custom ajax
|
38 |
+
originals : JSON.stringify( string_originals ),
|
39 |
+
skip_machine_translation : JSON.stringify( skip_machine_translation ),
|
40 |
+
dynamic_strings : 'true'
|
41 |
+
},
|
42 |
+
success: function( response ) {
|
43 |
+
if ( response === 'error' ) {
|
44 |
+
_this.ajax_get_translation( nodesInfo, string_originals, wp_ajax_url, skip_machine_translation );
|
45 |
+
console.log( 'Notice: TranslatePress trp-ajax request uses fall back to admin ajax.' );
|
46 |
+
}else{
|
47 |
+
_this.update_strings( response, nodesInfo );
|
48 |
+
}
|
49 |
+
},
|
50 |
+
error: function( errorThrown ){
|
51 |
+
if ( url == custom_ajax_url && custom_ajax_url != wp_ajax_url ){
|
52 |
+
_this.ajax_get_translation( nodesInfo, string_originals, wp_ajax_url, skip_machine_translation );
|
53 |
+
console.log( 'Notice: TranslatePress trp-ajax request uses fall back to admin ajax.' );
|
54 |
+
}else{
|
55 |
+
_this.update_strings( null, nodesInfo );
|
56 |
+
console.log( 'TranslatePress AJAX Request Error' );
|
57 |
+
}
|
58 |
+
}
|
59 |
+
});
|
60 |
+
};
|
61 |
+
|
62 |
+
/**
|
63 |
+
* Return given text converted to html.
|
64 |
+
*
|
65 |
+
* Useful for decoding special characters into displayable form.
|
66 |
+
*
|
67 |
+
* @param html
|
68 |
+
* @returns {*}
|
69 |
+
*/
|
70 |
+
this.decode_html = function( html ) {
|
71 |
+
var txt = document.createElement( "textarea" );
|
72 |
+
txt.innerHTML = html;
|
73 |
+
return txt.value;
|
74 |
+
};
|
75 |
+
|
76 |
+
/**
|
77 |
+
* Replace original strings with translations if found.
|
78 |
+
*/
|
79 |
+
this.update_strings = function( response, nodesInfo ) {
|
80 |
+
_this.pause_observer();
|
81 |
+
if ( response != null && response.length > 0 ){
|
82 |
+
var newEntries = [];
|
83 |
+
for (var j = 0 ; j < nodesInfo.length; j++){
|
84 |
+
var nodeInfo = nodesInfo[j];
|
85 |
+
var translation_found = false;
|
86 |
+
var initial_value = nodeInfo.original;
|
87 |
+
for( var i in response ) {
|
88 |
+
var response_string = response[i].translationsArray[language_to_query];
|
89 |
+
if (response[i].original.trim() == nodeInfo.original.trim()) {
|
90 |
+
// The nodeInfo can contain duplicates and response cannot. We need duplicates to refer to different jQuery objects where the same string appears in different places on the page.
|
91 |
+
var entry = response[i]
|
92 |
+
entry.selector = 'data-trp-translate-id'
|
93 |
+
entry.attribute = ''
|
94 |
+
newEntries.push( entry )
|
95 |
+
if ( _this.is_editor ) {
|
96 |
+
var jquery_object;
|
97 |
+
var trp_translate_id = 'data-trp-translate-id'
|
98 |
+
var trp_node_group = 'data-trp-node-group'
|
99 |
+
if ( nodeInfo.attribute ) {
|
100 |
+
jquery_object = jQuery(nodeInfo.node)
|
101 |
+
trp_translate_id = trp_translate_id + '-' + nodeInfo.attribute
|
102 |
+
trp_node_group = trp_node_group + '-' + nodeInfo.attribute
|
103 |
+
}else{
|
104 |
+
jquery_object = jQuery(nodeInfo.node).parent('translate-press');
|
105 |
+
}
|
106 |
+
jquery_object.attr( trp_translate_id, response[i].dbID );
|
107 |
+
jquery_object.attr( trp_node_group, response[i].group );
|
108 |
+
}
|
109 |
+
|
110 |
+
if (response_string.translated != '' && language_to_query == current_language ) {
|
111 |
+
var text_to_set = _this.decode_html( initial_value.replace(initial_value.trim(), response_string.translated));
|
112 |
+
if ( nodeInfo.attribute ){
|
113 |
+
nodeInfo.node.setAttribute( nodeInfo.attribute, text_to_set )
|
114 |
+
if ( nodeInfo.attribute == 'src' ){
|
115 |
+
nodeInfo.node.setAttribute( 'srcset', '' )
|
116 |
+
nodeInfo.node.setAttribute( 'data-src', text_to_set )
|
117 |
+
}
|
118 |
+
}else {
|
119 |
+
nodeInfo.node.textContent = text_to_set;
|
120 |
+
}
|
121 |
+
translation_found = true;
|
122 |
+
}
|
123 |
+
break;
|
124 |
+
}
|
125 |
+
}
|
126 |
+
|
127 |
+
already_detected[ initial_value ] = (initial_value in already_detected ) ? already_detected[ initial_value ] + 1 : 0
|
128 |
+
if ( ! translation_found ){
|
129 |
+
if ( nodeInfo.attribute ){
|
130 |
+
if ( nodeInfo.attribute != 'src' ) {
|
131 |
+
nodeInfo.node.setAttribute(nodeInfo.attribute, initial_value)
|
132 |
+
}
|
133 |
+
}else {
|
134 |
+
nodeInfo.node.textContent = initial_value;
|
135 |
+
}
|
136 |
+
}
|
137 |
+
|
138 |
+
}
|
139 |
+
// this should always be outside the for loop
|
140 |
+
if ( _this.is_editor ) {
|
141 |
+
window.parent.dispatchEvent( new Event( 'trp_iframe_page_updated' ) );
|
142 |
+
window.dispatchEvent( new Event( 'trp_iframe_page_updated' ) );
|
143 |
+
}
|
144 |
+
|
145 |
+
}else{
|
146 |
+
for (var j = 0 ; j < nodesInfo.length; j++){
|
147 |
+
if ( nodesInfo[j].attribute ){
|
148 |
+
if ( nodesInfo[j].attribute != 'src' ) {
|
149 |
+
nodesInfo[j].node.setAttribute(nodesInfo[j].attribute, nodesInfo[j].original)
|
150 |
+
}
|
151 |
+
}else {
|
152 |
+
nodesInfo[j].node.textContent = nodesInfo[j].original;
|
153 |
+
}
|
154 |
+
already_detected[ nodesInfo[j].original ] = (nodesInfo[j].original in already_detected ) ? already_detected[ nodesInfo[j].original ] + 1 : 0
|
155 |
+
}
|
156 |
+
}
|
157 |
+
_this.resume_observer();
|
158 |
+
};
|
159 |
+
|
160 |
+
/*
|
161 |
+
* Separated from the detect_new_strings function to allow disconnecting observer.
|
162 |
+
*/
|
163 |
+
this.detect_new_strings_callback = function( mutations ){
|
164 |
+
// calling disconnect directly instead of calling pause_observer because we don't need to takeRecords() (called from pause_observer) because we would duplicate mutations
|
165 |
+
observer.disconnect()
|
166 |
+
_this.detect_new_strings( mutations );
|
167 |
+
_this.resume_observer();
|
168 |
+
}
|
169 |
+
|
170 |
+
/**
|
171 |
+
* Detect and remember added strings.
|
172 |
+
*/
|
173 |
+
this.detect_new_strings = function( mutations ){
|
174 |
+
var string_originals = [];
|
175 |
+
var nodesInfo = [];
|
176 |
+
var skip_machine_translation = [];
|
177 |
+
var translateable;
|
178 |
+
mutations.forEach( function (mutation) {
|
179 |
+
for (var i = 0; i < mutation.addedNodes.length; i++) {
|
180 |
+
var node = mutation.addedNodes[i]
|
181 |
+
/* if it is an anchor add the trp-edit-translation=preview parameter to it */
|
182 |
+
if ( _this.is_editor ) {
|
183 |
+
jQuery(node).find('a').context.href = _this.update_query_string('trp-edit-translation', 'preview', jQuery(node).find('a').context.href);
|
184 |
+
}
|
185 |
+
|
186 |
+
if ( _this.skip_string(node) ){
|
187 |
+
continue;
|
188 |
+
}
|
189 |
+
|
190 |
+
// Search for innertext modifications or newly added nodes with innertext
|
191 |
+
translateable = _this.get_translateable_textcontent( node )
|
192 |
+
string_originals = string_originals.concat( translateable.string_originals );
|
193 |
+
nodesInfo = nodesInfo.concat( translateable.nodesInfo );
|
194 |
+
|
195 |
+
// Search for text inside attributes of newly added nodes
|
196 |
+
translateable = _this.get_translateable_attributes( node )
|
197 |
+
string_originals = string_originals.concat( translateable.string_originals );
|
198 |
+
nodesInfo = nodesInfo.concat( translateable.nodesInfo );
|
199 |
+
skip_machine_translation = skip_machine_translation.concat( translateable.skip_machine_translation );
|
200 |
+
}
|
201 |
+
|
202 |
+
if ( mutation.attributeName ){
|
203 |
+
if ( ! _this.in_array( mutation.attributeName, trp_data.trp_attributes_accessors ) ){
|
204 |
+
return
|
205 |
+
}
|
206 |
+
if ( _this.skip_string_attribute( mutation.target, mutation.attributeName ) || _this.skip_string(mutation.target) ){
|
207 |
+
return
|
208 |
+
}
|
209 |
+
|
210 |
+
// Search for modified text inside attributes of existing nodes
|
211 |
+
translateable = _this.get_translateable_attributes( mutation.target )
|
212 |
+
string_originals = string_originals.concat( translateable.string_originals );
|
213 |
+
nodesInfo = nodesInfo.concat( translateable.nodesInfo );
|
214 |
+
skip_machine_translation = skip_machine_translation.concat( translateable.skip_machine_translation );
|
215 |
+
}
|
216 |
+
});
|
217 |
+
if ( nodesInfo.length > 0 ) {
|
218 |
+
var ajax_url_to_call = (_this.is_editor) ? wp_ajax_url : custom_ajax_url;
|
219 |
+
_this.ajax_get_translation( nodesInfo, string_originals, ajax_url_to_call, skip_machine_translation );
|
220 |
+
}
|
221 |
+
};
|
222 |
+
|
223 |
+
this.skip_string = function(node){
|
224 |
+
// skip nodes containing these attributes
|
225 |
+
var selectors = trp_data.trp_skip_selectors;
|
226 |
+
for (var i = 0; i < selectors.length ; i++ ){
|
227 |
+
if ( jQuery(node).closest( selectors[ i ] ).length > 0 ){
|
228 |
+
return true;
|
229 |
+
}
|
230 |
+
}
|
231 |
+
return false;
|
232 |
+
};
|
233 |
+
|
234 |
+
/*
|
235 |
+
* Skip string based on original string text
|
236 |
+
*/
|
237 |
+
this.skip_string_original = function ( string ){
|
238 |
+
return ( ( already_detected[string] > duplicate_detections_allowed ) || _this.in_array( string, trp_data.skip_strings_from_dynamic_translation ) )
|
239 |
+
}
|
240 |
+
|
241 |
+
this.skip_string_attribute = function(node, attribute){
|
242 |
+
// skip nodes containing these attributes
|
243 |
+
var selectors = trp_data.trp_base_selectors;
|
244 |
+
for (var i = 0; i < selectors.length ; i++ ){
|
245 |
+
if ( typeof jQuery(node).attr( selectors[ i ] + '-' + attribute ) !== 'undefined' ){
|
246 |
+
return true;
|
247 |
+
}
|
248 |
+
}
|
249 |
+
return false;
|
250 |
+
};
|
251 |
+
|
252 |
+
this.in_array = function (needle, array ) {
|
253 |
+
var i
|
254 |
+
var length = array.length
|
255 |
+
for( i = length - 1; i >= 0; i-- ){
|
256 |
+
if ( array[i] === needle ){
|
257 |
+
return true
|
258 |
+
}
|
259 |
+
}
|
260 |
+
return false
|
261 |
+
}
|
262 |
+
|
263 |
+
this.get_translateable_textcontent = function( node ){
|
264 |
+
var string_originals = [];
|
265 |
+
var nodesInfo = [];
|
266 |
+
if ( node.textContent && _this.trim( node.textContent.trim(), except_characters ) != '' ) {
|
267 |
+
|
268 |
+
var direct_string = get_string_from_node( node );
|
269 |
+
if ( direct_string ) {
|
270 |
+
// a text without HTML was added
|
271 |
+
if ( _this.trim( direct_string.textContent, except_characters ) != '' ) {
|
272 |
+
var extracted_original = _this.trim(direct_string.textContent, trim_characters);
|
273 |
+
if ( ! _this.skip_string_original( extracted_original )) {
|
274 |
+
nodesInfo.push({node: node, original: extracted_original, attribute: ''});
|
275 |
+
string_originals.push(extracted_original)
|
276 |
+
|
277 |
+
direct_string.textContent = '';
|
278 |
+
if (_this.is_editor) {
|
279 |
+
jQuery(node).wrap('<translate-press></translate-press>');
|
280 |
+
}
|
281 |
+
}
|
282 |
+
}
|
283 |
+
}else{
|
284 |
+
// node contains HTML
|
285 |
+
var all_nodes = jQuery( node ).find( '*').addBack();
|
286 |
+
var all_strings = all_nodes.contents().filter(function(){
|
287 |
+
if( this.nodeType === 3 && /\S/.test(this.nodeValue) ){
|
288 |
+
if ( ! _this.skip_string(this) ){
|
289 |
+
return this;
|
290 |
+
}
|
291 |
+
}});
|
292 |
+
if ( _this.is_editor ) {
|
293 |
+
all_strings.wrap('<translate-press></translate-press>');
|
294 |
+
}
|
295 |
+
var all_strings_length = all_strings.length;
|
296 |
+
for (var j = 0; j < all_strings_length; j++ ) {
|
297 |
+
if ( _this.trim( all_strings[j].textContent, except_characters ) != '' ) {
|
298 |
+
if ( ! _this.skip_string_original( all_strings[j].textContent )) {
|
299 |
+
nodesInfo.push({node: all_strings[j], original: all_strings[j].textContent, attribute: ''});
|
300 |
+
string_originals.push(all_strings[j].textContent)
|
301 |
+
if (trp_data ['showdynamiccontentbeforetranslation'] == false) {
|
302 |
+
all_strings[j].textContent = '';
|
303 |
+
}
|
304 |
+
}
|
305 |
+
}
|
306 |
+
}
|
307 |
+
}
|
308 |
+
}
|
309 |
+
return { 'string_originals': string_originals, 'nodesInfo': nodesInfo };
|
310 |
+
}
|
311 |
+
|
312 |
+
this.get_translateable_attributes = function ( node ) {
|
313 |
+
var nodesInfo = []
|
314 |
+
var string_originals = []
|
315 |
+
var skip_attr_machine_translation = [ 'href', 'src' ]
|
316 |
+
var skip_machine_translation = []
|
317 |
+
for (var trp_attribute_key in trp_data.trp_attributes_selectors) {
|
318 |
+
if (trp_data.trp_attributes_selectors.hasOwnProperty(trp_attribute_key)) {
|
319 |
+
var attribute_selector_item = trp_data.trp_attributes_selectors[trp_attribute_key]
|
320 |
+
if ( typeof attribute_selector_item['selector'] !== 'undefined' ){
|
321 |
+
var all_nodes = jQuery( node ).find( attribute_selector_item.selector ).addBack( attribute_selector_item.selector )
|
322 |
+
|
323 |
+
var all_nodes_length = all_nodes.length
|
324 |
+
for (var j = 0; j < all_nodes_length; j++ ) {
|
325 |
+
if ( _this.skip_string( all_nodes[j] ) || _this.skip_string_attribute( all_nodes[j], attribute_selector_item.accessor ) ){
|
326 |
+
continue;
|
327 |
+
}
|
328 |
+
|
329 |
+
var attribute_content = all_nodes[j].getAttribute( attribute_selector_item.accessor )
|
330 |
+
if ( _this.skip_string_original( attribute_content )){
|
331 |
+
continue;
|
332 |
+
}
|
333 |
+
if ( attribute_content && _this.trim( attribute_content.trim(), except_characters ) != '' ) {
|
334 |
+
nodesInfo.push({node: all_nodes[j], original: attribute_content, attribute: attribute_selector_item.accessor });
|
335 |
+
string_originals.push( attribute_content )
|
336 |
+
if ( trp_data ['showdynamiccontentbeforetranslation'] == false && ( attribute_selector_item.accessor != 'src' ) ) {
|
337 |
+
all_nodes[j].setAttribute( attribute_selector_item.accessor, '' );
|
338 |
+
}
|
339 |
+
for ( var s = 0; s < skip_attr_machine_translation.length; s++ ){
|
340 |
+
if ( attribute_selector_item.accessor === skip_attr_machine_translation[s] ){
|
341 |
+
skip_machine_translation.push( attribute_content )
|
342 |
+
break
|
343 |
+
}
|
344 |
+
}
|
345 |
+
}
|
346 |
+
}
|
347 |
+
}
|
348 |
+
}
|
349 |
+
}
|
350 |
+
return { 'string_originals': string_originals, 'nodesInfo': nodesInfo, 'skip_machine_translation': skip_machine_translation };
|
351 |
+
}
|
352 |
+
|
353 |
+
function get_string_from_node( node ){
|
354 |
+
if( node.nodeType === 3 && /\S/.test(node.nodeValue) ){
|
355 |
+
if ( ! _this.skip_string(node) ){
|
356 |
+
return node;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
}
|
360 |
+
|
361 |
+
// cleans the gettext wrappers
|
362 |
+
this.cleanup_gettext_wrapper = function(){
|
363 |
+
jQuery('trp-gettext').contents().unwrap();
|
364 |
+
};
|
365 |
+
|
366 |
+
/**
|
367 |
+
* Update url with query string.
|
368 |
+
*
|
369 |
+
*/
|
370 |
+
this.update_query_string = function(key, value, url) {
|
371 |
+
if (!url) return url;
|
372 |
+
if ( url.startsWith('#') ){
|
373 |
+
return url;
|
374 |
+
}
|
375 |
+
var re = new RegExp("([?&])" + key + "=.*?(&|#|$)(.*)", "gi"),
|
376 |
+
hash;
|
377 |
+
|
378 |
+
if (re.test(url)) {
|
379 |
+
if (typeof value !== 'undefined' && value !== null)
|
380 |
+
return url.replace(re, '$1' + key + "=" + value + '$2$3');
|
381 |
+
else {
|
382 |
+
hash = url.split('#');
|
383 |
+
url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, '');
|
384 |
+
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
385 |
+
url += '#' + hash[1];
|
386 |
+
return url;
|
387 |
+
}
|
388 |
+
}
|
389 |
+
else {
|
390 |
+
if (typeof value !== 'undefined' && value !== null ) {
|
391 |
+
var separator = url.indexOf('?') !== -1 ? '&' : '?';
|
392 |
+
hash = url.split('#');
|
393 |
+
url = hash[0] + separator + key + '=' + value;
|
394 |
+
if (typeof hash[1] !== 'undefined' && hash[1] !== null)
|
395 |
+
url += '#' + hash[1];
|
396 |
+
return url;
|
397 |
+
}
|
398 |
+
else
|
399 |
+
return url;
|
400 |
+
}
|
401 |
+
};
|
402 |
+
|
403 |
+
/**
|
404 |
+
* Initialize and configure observer.
|
405 |
+
*/
|
406 |
+
this.initialize = function() {
|
407 |
+
this.is_editor = (typeof window.parent.tpEditorApp !== 'undefined' )
|
408 |
+
if ( this.is_editor ) {
|
409 |
+
trp_data['gettranslationsnonceregular'] = window.parent.trp_dynamic_nonce;
|
410 |
+
}
|
411 |
+
|
412 |
+
current_language = trp_data.trp_current_language;
|
413 |
+
original_language = trp_data.trp_original_language;
|
414 |
+
language_to_query = trp_data.trp_language_to_query;
|
415 |
+
|
416 |
+
// create an observer instance
|
417 |
+
observer = new MutationObserver( _this.detect_new_strings_callback );
|
418 |
+
|
419 |
+
_this.resume_observer();
|
420 |
+
|
421 |
+
jQuery( document ).ajaxComplete(function( event, request, settings ) {
|
422 |
+
if( typeof window.parent.jQuery !== "undefined" && window.parent.jQuery('#trp-preview-iframe').length != 0 ) {
|
423 |
+
var settingsdata = "" + settings.data;
|
424 |
+
if( typeof settings.data == 'undefined' || jQuery.isEmptyObject( settings.data ) || settingsdata.indexOf('action=trp_') === -1 ) {
|
425 |
+
window.parent.dispatchEvent( new Event( 'trp_iframe_page_updated' ) );
|
426 |
+
}
|
427 |
+
}
|
428 |
+
});
|
429 |
+
|
430 |
+
//try a final attempt at cleaning the gettext wrappers
|
431 |
+
_this.cleanup_gettext_wrapper();
|
432 |
+
};
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Resume observing new strings added.
|
436 |
+
*/
|
437 |
+
this.resume_observer = function(){
|
438 |
+
if ( language_to_query === '' ) {
|
439 |
+
// No translation languages are set other than default language
|
440 |
+
return;
|
441 |
+
}
|
442 |
+
observer.observe(document.body, observerConfig);
|
443 |
+
};
|
444 |
+
|
445 |
+
/**
|
446 |
+
* Pause observing new strings added.
|
447 |
+
*/
|
448 |
+
this.pause_observer = function(){
|
449 |
+
/*
|
450 |
+
Disconnect will delete the existing mutations detected prior to being passed to callback function.
|
451 |
+
So we are calling takeRecords to save them first, disconnect, then detect the strings
|
452 |
+
Disconnect happens before detect_new_strings to avoid detecting mutations from within detect new strings functions
|
453 |
+
*/
|
454 |
+
if ( language_to_query === '' ) {
|
455 |
+
// No translation languages are set other than default language
|
456 |
+
return;
|
457 |
+
}
|
458 |
+
var mutations = observer.takeRecords()
|
459 |
+
observer.disconnect()
|
460 |
+
if ( mutations.length > 0 ) {
|
461 |
+
_this.detect_new_strings(mutations)
|
462 |
+
}
|
463 |
+
|
464 |
+
};
|
465 |
+
|
466 |
+
this.trim = function (str, charlist) {
|
467 |
+
// discuss at: http://locutus.io/php/trim/
|
468 |
+
// original by: Kevin van Zonneveld (http://kvz.io)
|
469 |
+
// improved by: mdsjack (http://www.mdsjack.bo.it)
|
470 |
+
// improved by: Alexander Ermolaev (http://snippets.dzone.com/user/AlexanderErmolaev)
|
471 |
+
// improved by: Kevin van Zonneveld (http://kvz.io)
|
472 |
+
// improved by: Steven Levithan (http://blog.stevenlevithan.com)
|
473 |
+
// improved by: Jack
|
474 |
+
// input by: Erkekjetter
|
475 |
+
// input by: DxGx
|
476 |
+
// bugfixed by: Onno Marsman (https://twitter.com/onnomarsman)
|
477 |
+
// example 1: trim(' Kevin van Zonneveld ')
|
478 |
+
// returns 1: 'Kevin van Zonneveld'
|
479 |
+
// example 2: trim('Hello World', 'Hdle')
|
480 |
+
// returns 2: 'o Wor'
|
481 |
+
// example 3: trim(16, 1)
|
482 |
+
// returns 3: '6'
|
483 |
+
var whitespace = [
|
484 |
+
' ',
|
485 |
+
'\n',
|
486 |
+
'\r',
|
487 |
+
'\t',
|
488 |
+
'\f',
|
489 |
+
'\x0b',
|
490 |
+
'\xa0',
|
491 |
+
'\u2000',
|
492 |
+
'\u2001',
|
493 |
+
'\u2002',
|
494 |
+
'\u2003',
|
495 |
+
'\u2004',
|
496 |
+
'\u2005',
|
497 |
+
'\u2006',
|
498 |
+
'\u2007',
|
499 |
+
'\u2008',
|
500 |
+
'\u2009',
|
501 |
+
'\u200a',
|
502 |
+
'\u200b',
|
503 |
+
'\u2028',
|
504 |
+
'\u2029',
|
505 |
+
'\u3000'
|
506 |
+
].join('');
|
507 |
+
var l = 0;
|
508 |
+
var i = 0;
|
509 |
+
str += '';
|
510 |
+
if (charlist) {
|
511 |
+
whitespace += (charlist + '').replace(/([[\]().?/*{}+$^:])/g, '$1');
|
512 |
+
}
|
513 |
+
l = str.length;
|
514 |
+
for (i = 0; i < l; i++) {
|
515 |
+
if (whitespace.indexOf(str.charAt(i)) === -1) {
|
516 |
+
str = str.substring(i);
|
517 |
+
break;
|
518 |
+
}
|
519 |
+
}
|
520 |
+
l = str.length;
|
521 |
+
for (i = l - 1; i >= 0; i--) {
|
522 |
+
if (whitespace.indexOf(str.charAt(i)) === -1) {
|
523 |
+
str = str.substring(0, i + 1);
|
524 |
+
break;
|
525 |
+
}
|
526 |
+
}
|
527 |
+
return whitespace.indexOf(str.charAt(0)) === -1 ? str : '';
|
528 |
+
};
|
529 |
+
|
530 |
+
_this.initialize();
|
531 |
+
}
|
532 |
+
|
533 |
+
var trpTranslator;
|
534 |
+
var current_language;
|
535 |
+
var original_language;
|
536 |
+
|
537 |
+
function trp_get_IE_version() {
|
538 |
+
var sAgent = window.navigator.userAgent;
|
539 |
+
var Idx = sAgent.indexOf("MSIE");
|
540 |
+
|
541 |
+
// If IE, return version number.
|
542 |
+
if (Idx > 0)
|
543 |
+
return parseInt(sAgent.substring(Idx+ 5, sAgent.indexOf(".", Idx)));
|
544 |
+
|
545 |
+
// If IE 11 then look for Updated user agent string.
|
546 |
+
else if (!!navigator.userAgent.match(/Trident\/7\./))
|
547 |
+
return 11;
|
548 |
+
else
|
549 |
+
return 0; //It is not IE
|
550 |
+
}
|
551 |
+
|
552 |
+
function trp_allow_detect_dom_changes_to_run(){
|
553 |
+
var IE_version = trp_get_IE_version();
|
554 |
+
if ( IE_version != 0 && IE_version <= 11 ){
|
555 |
+
return false;
|
556 |
+
}
|
557 |
+
return true;
|
558 |
+
}
|
559 |
+
|
560 |
+
|
561 |
+
// Initialize the Translate Press Editor when the script loads
|
562 |
+
if ( trp_allow_detect_dom_changes_to_run() ) {
|
563 |
+
trpTranslator = new TRP_Translator();
|
564 |
+
}
|
assets/js/trp-update-database.js
CHANGED
@@ -1,23 +1,23 @@
|
|
1 |
-
jQuery( function() {
|
2 |
-
function trigger_update_by_ajax( data ) {
|
3 |
-
jQuery.ajax({
|
4 |
-
url: trp_updb_localized['admin_ajax_url'],
|
5 |
-
type: 'post',
|
6 |
-
dataType: 'json',
|
7 |
-
data: data,
|
8 |
-
success: function (response) {
|
9 |
-
jQuery('#trp-update-database-progress').append(response['progress_message'])
|
10 |
-
if ( response['trp_update_completed'] == 'no' ) {
|
11 |
-
trigger_update_by_ajax(response);
|
12 |
-
}
|
13 |
-
},
|
14 |
-
error: function (errorThrown) {
|
15 |
-
console.log('TranslatePress AJAX Request Error while triggering database update');
|
16 |
-
}
|
17 |
-
});
|
18 |
-
};
|
19 |
-
trigger_update_by_ajax( {
|
20 |
-
action: 'trp_update_database',
|
21 |
-
trp_updb_nonce: trp_updb_localized['nonce'],
|
22 |
-
} );
|
23 |
});
|
1 |
+
jQuery( function() {
|
2 |
+
function trigger_update_by_ajax( data ) {
|
3 |
+
jQuery.ajax({
|
4 |
+
url: trp_updb_localized['admin_ajax_url'],
|
5 |
+
type: 'post',
|
6 |
+
dataType: 'json',
|
7 |
+
data: data,
|
8 |
+
success: function (response) {
|
9 |
+
jQuery('#trp-update-database-progress').append(response['progress_message'])
|
10 |
+
if ( response['trp_update_completed'] == 'no' ) {
|
11 |
+
trigger_update_by_ajax(response);
|
12 |
+
}
|
13 |
+
},
|
14 |
+
error: function (errorThrown) {
|
15 |
+
console.log('TranslatePress AJAX Request Error while triggering database update');
|
16 |
+
}
|
17 |
+
});
|
18 |
+
};
|
19 |
+
trigger_update_by_ajax( {
|
20 |
+
action: 'trp_update_database',
|
21 |
+
trp_updb_nonce: trp_updb_localized['nonce'],
|
22 |
+
} );
|
23 |
});
|
assets/lib/select2-lib/LICENSE.md
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
-
The MIT License (MIT)
|
2 |
-
|
3 |
-
Copyright (c) 2012-2015 Kevin Brown, Igor Vaynberg, and Select2 contributors
|
4 |
-
|
5 |
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
-
of this software and associated documentation files (the "Software"), to deal
|
7 |
-
in the Software without restriction, including without limitation the rights
|
8 |
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
-
copies of the Software, and to permit persons to whom the Software is
|
10 |
-
furnished to do so, subject to the following conditions:
|
11 |
-
|
12 |
-
The above copyright notice and this permission notice shall be included in
|
13 |
-
all copies or substantial portions of the Software.
|
14 |
-
|
15 |
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21 |
-
THE SOFTWARE.
|
1 |
+
The MIT License (MIT)
|
2 |
+
|
3 |
+
Copyright (c) 2012-2015 Kevin Brown, Igor Vaynberg, and Select2 contributors
|
4 |
+
|
5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6 |
+
of this software and associated documentation files (the "Software"), to deal
|
7 |
+
in the Software without restriction, including without limitation the rights
|
8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9 |
+
copies of the Software, and to permit persons to whom the Software is
|
10 |
+
furnished to do so, subject to the following conditions:
|
11 |
+
|
12 |
+
The above copyright notice and this permission notice shall be included in
|
13 |
+
all copies or substantial portions of the Software.
|
14 |
+
|
15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21 |
+
THE SOFTWARE.
|
assets/lib/select2-lib/README.md
CHANGED
@@ -1,121 +1,121 @@
|
|
1 |
-
Select2
|
2 |
-
=======
|
3 |
-
[![Build Status][travis-ci-image]][travis-ci-status]
|
4 |
-
|
5 |
-
Select2 is a jQuery-based replacement for select boxes. It supports searching,
|
6 |
-
remote data sets, and pagination of results.
|
7 |
-
|
8 |
-
To get started, checkout examples and documentation at
|
9 |
-
https://select2.github.io/
|
10 |
-
|
11 |
-
Use cases
|
12 |
-
---------
|
13 |
-
* Enhancing native selects with search.
|
14 |
-
* Enhancing native selects with a better multi-select interface.
|
15 |
-
* Loading data from JavaScript: easily load items via AJAX and have them
|
16 |
-
searchable.
|
17 |
-
* Nesting optgroups: native selects only support one level of nesting. Select2
|
18 |
-
does not have this restriction.
|
19 |
-
* Tagging: ability to add new items on the fly.
|
20 |
-
* Working with large, remote datasets: ability to partially load a dataset based
|
21 |
-
on the search term.
|
22 |
-
* Paging of large datasets: easy support for loading more pages when the results
|
23 |
-
are scrolled to the end.
|
24 |
-
* Templating: support for custom rendering of results and selections.
|
25 |
-
|
26 |
-
Browser compatibility
|
27 |
-
---------------------
|
28 |
-
* IE 8+
|
29 |
-
* Chrome 8+
|
30 |
-
* Firefox 10+
|
31 |
-
* Safari 3+
|
32 |
-
* Opera 10.6+
|
33 |
-
|
34 |
-
Select2 is automatically tested on the following browsers.
|
35 |
-
|
36 |
-
[![Sauce Labs Test Status][saucelabs-matrix]][saucelabs-status]
|
37 |
-
|
38 |
-
Usage
|
39 |
-
-----
|
40 |
-
You can source Select2 directly from a CDN like [JSDliver][jsdelivr] or
|
41 |
-
[CDNJS][cdnjs], [download it from this GitHub repo][releases], or use one of
|
42 |
-
the integrations below.
|
43 |
-
|
44 |
-
Integrations
|
45 |
-
------------
|
46 |
-
Third party developers have create plugins for platforms which allow Select2 to be integrated more natively and quickly. For many platforms, additional plugins are not required because Select2 acts as a standard `<select>` box.
|
47 |
-
|
48 |
-
Plugins
|
49 |
-
|
50 |
-
* [Django]
|
51 |
-
- [django-easy-select2]
|
52 |
-
- [django-select2]
|
53 |
-
* [Meteor] - [meteor-select2]
|
54 |
-
* [Ruby on Rails][ruby-on-rails] - [select2-rails]
|
55 |
-
* [Wicket] - [wicketstuff-select2]
|
56 |
-
* [Yii 2][yii2] - [yii2-widget-select2]
|
57 |
-
|
58 |
-
Themes
|
59 |
-
|
60 |
-
- [Bootstrap 3][bootstrap3] - [select2-bootstrap-theme]
|
61 |
-
- [Flat UI][flat-ui] - [select2-flat-theme]
|
62 |
-
- [Metro UI][metro-ui] - [select2-metro]
|
63 |
-
|
64 |
-
Missing an integration? Modify this `README` and make a pull request back here to Select2 on GitHub.
|
65 |
-
|
66 |
-
Internationalization (i18n)
|
67 |
-
---------------------------
|
68 |
-
Select2 supports multiple languages by simply including the right language JS
|
69 |
-
file (`dist/js/i18n/it.js`, `dist/js/i18n/nl.js`, etc.) after
|
70 |
-
`dist/js/select2.js`.
|
71 |
-
|
72 |
-
Missing a language? Just copy `src/js/select2/i18n/en.js`, translate it, and
|
73 |
-
make a pull request back to Select2 here on GitHub.
|
74 |
-
|
75 |
-
Documentation
|
76 |
-
-------------
|
77 |
-
The documentation for Select2 is available
|
78 |
-
[through GitHub Pages][documentation] and is located within this repository
|
79 |
-
in the [`docs` folder][documentation-folder].
|
80 |
-
|
81 |
-
Community
|
82 |
-
---------
|
83 |
-
You can find out about the different ways to get in touch with the Select2
|
84 |
-
community at the [Select2 community page][community].
|
85 |
-
|
86 |
-
Copyright and license
|
87 |
-
---------------------
|
88 |
-
The license is available within the repository in the [LICENSE][license] file.
|
89 |
-
|
90 |
-
[cdnjs]: http://www.cdnjs.com/libraries/select2
|
91 |
-
[community]: https://select2.github.io/community.html
|
92 |
-
[documentation]: https://select2.github.io/
|
93 |
-
[documentation-folder]: https://github.com/select2/select2/tree/master/docs
|
94 |
-
[freenode]: https://freenode.net/
|
95 |
-
[jsdelivr]: http://www.jsdelivr.com/#!select2
|
96 |
-
[license]: LICENSE.md
|
97 |
-
[releases]: https://github.com/select2/select2/releases
|
98 |
-
[saucelabs-matrix]: https://saucelabs.com/browser-matrix/select2.svg
|
99 |
-
[saucelabs-status]: https://saucelabs.com/u/select2
|
100 |
-
[travis-ci-image]: https://img.shields.io/travis/select2/select2/master.svg
|
101 |
-
[travis-ci-status]: https://travis-ci.org/select2/select2
|
102 |
-
|
103 |
-
[bootstrap3]: https://getbootstrap.com/
|
104 |
-
[django]: https://www.djangoproject.com/
|
105 |
-
[django-easy-select2]: https://github.com/asyncee/django-easy-select2
|
106 |
-
[django-select2]: https://github.com/applegrew/django-select2
|
107 |
-
[flat-ui]: http://designmodo.github.io/Flat-UI/
|
108 |
-
[meteor]: https://www.meteor.com/
|
109 |
-
[meteor-select2]: https://github.com/nate-strauser/meteor-select2
|
110 |
-
[metro-ui]: http://metroui.org.ua/
|
111 |
-
[select2-metro]: http://metroui.org.ua/select2.html
|
112 |
-
[ruby-on-rails]: http://rubyonrails.org/
|
113 |
-
[select2-bootstrap-theme]: https://github.com/select2/select2-bootstrap-theme
|
114 |
-
[select2-flat-theme]: https://github.com/techhysahil/select2-Flat_Theme
|
115 |
-
[select2-rails]: https://github.com/argerim/select2-rails
|
116 |
-
[vue.js]: http://vuejs.org/
|
117 |
-
[select2-vue]: http://vuejs.org/examples/select2.html
|
118 |
-
[wicket]: https://wicket.apache.org/
|
119 |
-
[wicketstuff-select2]: https://github.com/wicketstuff/core/tree/master/select2-parent
|
120 |
-
[yii2]: http://www.yiiframework.com/
|
121 |
-
[yii2-widget-select2]: https://github.com/kartik-v/yii2-widget-select2
|
1 |
+
Select2
|
2 |
+
=======
|
3 |
+
[![Build Status][travis-ci-image]][travis-ci-status]
|
4 |
+
|
5 |
+
Select2 is a jQuery-based replacement for select boxes. It supports searching,
|
6 |
+
remote data sets, and pagination of results.
|
7 |
+
|
8 |
+
To get started, checkout examples and documentation at
|
9 |
+
https://select2.github.io/
|
10 |
+
|
11 |
+
Use cases
|
12 |
+
---------
|
13 |
+
* Enhancing native selects with search.
|
14 |
+
* Enhancing native selects with a better multi-select interface.
|
15 |
+
* Loading data from JavaScript: easily load items via AJAX and have them
|
16 |
+
searchable.
|
17 |
+
* Nesting optgroups: native selects only support one level of nesting. Select2
|
18 |
+
does not have this restriction.
|
19 |
+
* Tagging: ability to add new items on the fly.
|
20 |
+
* Working with large, remote datasets: ability to partially load a dataset based
|
21 |
+
on the search term.
|
22 |
+
* Paging of large datasets: easy support for loading more pages when the results
|
23 |
+
are scrolled to the end.
|
24 |
+
* Templating: support for custom rendering of results and selections.
|
25 |
+
|
26 |
+
Browser compatibility
|
27 |
+
---------------------
|
28 |
+
* IE 8+
|
29 |
+
* Chrome 8+
|
30 |
+
* Firefox 10+
|
31 |
+
* Safari 3+
|
32 |
+
* Opera 10.6+
|
33 |
+
|
34 |
+
Select2 is automatically tested on the following browsers.
|
35 |
+
|
36 |
+
[![Sauce Labs Test Status][saucelabs-matrix]][saucelabs-status]
|
37 |
+
|
38 |
+
Usage
|
39 |
+
-----
|
40 |
+
You can source Select2 directly from a CDN like [JSDliver][jsdelivr] or
|
41 |
+
[CDNJS][cdnjs], [download it from this GitHub repo][releases], or use one of
|
42 |
+
the integrations below.
|
43 |
+
|
44 |
+
Integrations
|
45 |
+
------------
|
46 |
+
Third party developers have create plugins for platforms which allow Select2 to be integrated more natively and quickly. For many platforms, additional plugins are not required because Select2 acts as a standard `<select>` box.
|
47 |
+
|
48 |
+
Plugins
|
49 |
+
|
50 |
+
* [Django]
|
51 |
+
- [django-easy-select2]
|
52 |
+
- [django-select2]
|
53 |
+
* [Meteor] - [meteor-select2]
|
54 |
+
* [Ruby on Rails][ruby-on-rails] - [select2-rails]
|
55 |
+
* [Wicket] - [wicketstuff-select2]
|
56 |
+
* [Yii 2][yii2] - [yii2-widget-select2]
|
57 |
+
|
58 |
+
Themes
|
59 |
+
|
60 |
+
- [Bootstrap 3][bootstrap3] - [select2-bootstrap-theme]
|
61 |
+
- [Flat UI][flat-ui] - [select2-flat-theme]
|
62 |
+
- [Metro UI][metro-ui] - [select2-metro]
|
63 |
+
|
64 |
+
Missing an integration? Modify this `README` and make a pull request back here to Select2 on GitHub.
|
65 |
+
|
66 |
+
Internationalization (i18n)
|
67 |
+
---------------------------
|
68 |
+
Select2 supports multiple languages by simply including the right language JS
|
69 |
+
file (`dist/js/i18n/it.js`, `dist/js/i18n/nl.js`, etc.) after
|
70 |
+
`dist/js/select2.js`.
|
71 |
+
|
72 |
+
Missing a language? Just copy `src/js/select2/i18n/en.js`, translate it, and
|
73 |
+
make a pull request back to Select2 here on GitHub.
|
74 |
+
|
75 |
+
Documentation
|
76 |
+
-------------
|
77 |
+
The documentation for Select2 is available
|
78 |
+
[through GitHub Pages][documentation] and is located within this repository
|
79 |
+
in the [`docs` folder][documentation-folder].
|
80 |
+
|
81 |
+
Community
|
82 |
+
---------
|
83 |
+
You can find out about the different ways to get in touch with the Select2
|
84 |
+
community at the [Select2 community page][community].
|
85 |
+
|
86 |
+
Copyright and license
|
87 |
+
---------------------
|
88 |
+
The license is available within the repository in the [LICENSE][license] file.
|
89 |
+
|
90 |
+
[cdnjs]: http://www.cdnjs.com/libraries/select2
|
91 |
+
[community]: https://select2.github.io/community.html
|
92 |
+
[documentation]: https://select2.github.io/
|
93 |
+
[documentation-folder]: https://github.com/select2/select2/tree/master/docs
|
94 |
+
[freenode]: https://freenode.net/
|
95 |
+
[jsdelivr]: http://www.jsdelivr.com/#!select2
|
96 |
+
[license]: LICENSE.md
|
97 |
+
[releases]: https://github.com/select2/select2/releases
|
98 |
+
[saucelabs-matrix]: https://saucelabs.com/browser-matrix/select2.svg
|
99 |
+
[saucelabs-status]: https://saucelabs.com/u/select2
|
100 |
+
[travis-ci-image]: https://img.shields.io/travis/select2/select2/master.svg
|
101 |
+
[travis-ci-status]: https://travis-ci.org/select2/select2
|
102 |
+
|
103 |
+
[bootstrap3]: https://getbootstrap.com/
|
104 |
+
[django]: https://www.djangoproject.com/
|
105 |
+
[django-easy-select2]: https://github.com/asyncee/django-easy-select2
|
106 |
+
[django-select2]: https://github.com/applegrew/django-select2
|
107 |
+
[flat-ui]: http://designmodo.github.io/Flat-UI/
|
108 |
+
[meteor]: https://www.meteor.com/
|
109 |
+
[meteor-select2]: https://github.com/nate-strauser/meteor-select2
|
110 |
+
[metro-ui]: http://metroui.org.ua/
|
111 |
+
[select2-metro]: http://metroui.org.ua/select2.html
|
112 |
+
[ruby-on-rails]: http://rubyonrails.org/
|
113 |
+
[select2-bootstrap-theme]: https://github.com/select2/select2-bootstrap-theme
|
114 |
+
[select2-flat-theme]: https://github.com/techhysahil/select2-Flat_Theme
|
115 |
+
[select2-rails]: https://github.com/argerim/select2-rails
|
116 |
+
[vue.js]: http://vuejs.org/
|
117 |
+
[select2-vue]: http://vuejs.org/examples/select2.html
|
118 |
+
[wicket]: https://wicket.apache.org/
|
119 |
+
[wicketstuff-select2]: https://github.com/wicketstuff/core/tree/master/select2-parent
|
120 |
+
[yii2]: http://www.yiiframework.com/
|
121 |
+
[yii2-widget-select2]: https://github.com/kartik-v/yii2-widget-select2
|
assets/lib/select2-lib/dist/css/select2.css
CHANGED
@@ -1,484 +1,484 @@
|
|
1 |
-
.select2-container {
|
2 |
-
box-sizing: border-box;
|
3 |
-
display: inline-block;
|
4 |
-
margin: 0;
|
5 |
-
position: relative;
|
6 |
-
vertical-align: middle; }
|
7 |
-
.select2-container .select2-selection--single {
|
8 |
-
box-sizing: border-box;
|
9 |
-
cursor: pointer;
|
10 |
-
display: block;
|
11 |
-
height: 28px;
|
12 |
-
user-select: none;
|
13 |
-
-webkit-user-select: none; }
|
14 |
-
.select2-container .select2-selection--single .select2-selection__rendered {
|
15 |
-
display: block;
|
16 |
-
padding-left: 8px;
|
17 |
-
padding-right: 20px;
|
18 |
-
overflow: hidden;
|
19 |
-
text-overflow: ellipsis;
|
20 |
-
white-space: nowrap; }
|
21 |
-
.select2-container .select2-selection--single .select2-selection__clear {
|
22 |
-
position: relative; }
|
23 |
-
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
|
24 |
-
padding-right: 8px;
|
25 |
-
padding-left: 20px; }
|
26 |
-
.select2-container .select2-selection--multiple {
|
27 |
-
box-sizing: border-box;
|
28 |
-
cursor: pointer;
|
29 |
-
display: block;
|
30 |
-
min-height: 32px;
|
31 |
-
user-select: none;
|
32 |
-
-webkit-user-select: none; }
|
33 |
-
.select2-container .select2-selection--multiple .select2-selection__rendered {
|
34 |
-
display: inline-block;
|
35 |
-
overflow: hidden;
|
36 |
-
padding-left: 8px;
|
37 |
-
text-overflow: ellipsis;
|
38 |
-
white-space: nowrap; }
|
39 |
-
.select2-container .select2-search--inline {
|
40 |
-
float: left; }
|
41 |
-
.select2-container .select2-search--inline .select2-search__field {
|
42 |
-
box-sizing: border-box;
|
43 |
-
border: none;
|
44 |
-
font-size: 100%;
|
45 |
-
margin-top: 5px;
|
46 |
-
padding: 0; }
|
47 |
-
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
|
48 |
-
-webkit-appearance: none; }
|
49 |
-
|
50 |
-
.select2-dropdown {
|
51 |
-
background-color: white;
|
52 |
-
border: 1px solid #aaa;
|
53 |
-
border-radius: 4px;
|
54 |
-
box-sizing: border-box;
|
55 |
-
display: block;
|
56 |
-
position: absolute;
|
57 |
-
left: -100000px;
|
58 |
-
width: 100%;
|
59 |
-
z-index: 1051; }
|
60 |
-
|
61 |
-
.select2-results {
|
62 |
-
display: block; }
|
63 |
-
|
64 |
-
.select2-results__options {
|
65 |
-
list-style: none;
|
66 |
-
margin: 0;
|
67 |
-
padding: 0; }
|
68 |
-
|
69 |
-
.select2-results__option {
|
70 |
-
padding: 6px;
|
71 |
-
user-select: none;
|
72 |
-
-webkit-user-select: none; }
|
73 |
-
.select2-results__option[aria-selected] {
|
74 |
-
cursor: pointer; }
|
75 |
-
|
76 |
-
.select2-container--open .select2-dropdown {
|
77 |
-
left: 0; }
|
78 |
-
|
79 |
-
.select2-container--open .select2-dropdown--above {
|
80 |
-
border-bottom: none;
|
81 |
-
border-bottom-left-radius: 0;
|
82 |
-
border-bottom-right-radius: 0; }
|
83 |
-
|
84 |
-
.select2-container--open .select2-dropdown--below {
|
85 |
-
border-top: none;
|
86 |
-
border-top-left-radius: 0;
|
87 |
-
border-top-right-radius: 0; }
|
88 |
-
|
89 |
-
.select2-search--dropdown {
|
90 |
-
display: block;
|
91 |
-
padding: 4px; }
|
92 |
-
.select2-search--dropdown .select2-search__field {
|
93 |
-
padding: 4px;
|
94 |
-
width: 100%;
|
95 |
-
box-sizing: border-box; }
|
96 |
-
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
|
97 |
-
-webkit-appearance: none; }
|
98 |
-
.select2-search--dropdown.select2-search--hide {
|
99 |
-
display: none; }
|
100 |
-
|
101 |
-
.select2-close-mask {
|
102 |
-
border: 0;
|
103 |
-
margin: 0;
|
104 |
-
padding: 0;
|
105 |
-
display: block;
|
106 |
-
position: fixed;
|
107 |
-
left: 0;
|
108 |
-
top: 0;
|
109 |
-
min-height: 100%;
|
110 |
-
min-width: 100%;
|
111 |
-
height: auto;
|
112 |
-
width: auto;
|
113 |
-
opacity: 0;
|
114 |
-
z-index: 99;
|
115 |
-
background-color: #fff;
|
116 |
-
filter: alpha(opacity=0); }
|
117 |
-
|
118 |
-
.select2-hidden-accessible {
|
119 |
-
border: 0 !important;
|
120 |
-
clip: rect(0 0 0 0) !important;
|
121 |
-
height: 1px !important;
|
122 |
-
margin: -1px !important;
|
123 |
-
overflow: hidden !important;
|
124 |
-
padding: 0 !important;
|
125 |
-
position: absolute !important;
|
126 |
-
width: 1px !important; }
|
127 |
-
|
128 |
-
.select2-container--default .select2-selection--single {
|
129 |
-
background-color: #fff;
|
130 |
-
border: 1px solid #aaa;
|
131 |
-
border-radius: 4px; }
|
132 |
-
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
133 |
-
color: #444;
|
134 |
-
line-height: 28px; }
|
135 |
-
.select2-container--default .select2-selection--single .select2-selection__clear {
|
136 |
-
cursor: pointer;
|
137 |
-
float: right;
|
138 |
-
font-weight: bold; }
|
139 |
-
.select2-container--default .select2-selection--single .select2-selection__placeholder {
|
140 |
-
color: #999; }
|
141 |
-
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
142 |
-
height: 26px;
|
143 |
-
position: absolute;
|
144 |
-
top: 1px;
|
145 |
-
right: 1px;
|
146 |
-
width: 20px; }
|
147 |
-
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
148 |
-
border-color: #888 transparent transparent transparent;
|
149 |
-
border-style: solid;
|
150 |
-
border-width: 5px 4px 0 4px;
|
151 |
-
height: 0;
|
152 |
-
left: 50%;
|
153 |
-
margin-left: -4px;
|
154 |
-
margin-top: -2px;
|
155 |
-
position: absolute;
|
156 |
-
top: 50%;
|
157 |
-
width: 0; }
|
158 |
-
|
159 |
-
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
160 |
-
float: left; }
|
161 |
-
|
162 |
-
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
163 |
-
left: 1px;
|
164 |
-
right: auto; }
|
165 |
-
|
166 |
-
.select2-container--default.select2-container--disabled .select2-selection--single {
|
167 |
-
background-color: #eee;
|
168 |
-
cursor: default; }
|
169 |
-
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
|
170 |
-
display: none; }
|
171 |
-
|
172 |
-
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
173 |
-
border-color: transparent transparent #888 transparent;
|
174 |
-
border-width: 0 4px 5px 4px; }
|
175 |
-
|
176 |
-
.select2-container--default .select2-selection--multiple {
|
177 |
-
background-color: white;
|
178 |
-
border: 1px solid #aaa;
|
179 |
-
border-radius: 4px;
|
180 |
-
cursor: text; }
|
181 |
-
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
182 |
-
box-sizing: border-box;
|
183 |
-
list-style: none;
|
184 |
-
margin: 0;
|
185 |
-
padding: 0 5px;
|
186 |
-
width: 100%; }
|
187 |
-
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
188 |
-
list-style: none; }
|
189 |
-
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
|
190 |
-
color: #999;
|
191 |
-
margin-top: 5px;
|
192 |
-
float: left; }
|
193 |
-
.select2-container--default .select2-selection--multiple .select2-selection__clear {
|
194 |
-
cursor: pointer;
|
195 |
-
float: right;
|
196 |
-
font-weight: bold;
|
197 |
-
margin-top: 5px;
|
198 |
-
margin-right: 10px; }
|
199 |
-
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
200 |
-
background-color: #e4e4e4;
|
201 |
-
border: 1px solid #aaa;
|
202 |
-
border-radius: 4px;
|
203 |
-
cursor: default;
|
204 |
-
float: left;
|
205 |
-
margin-right: 5px;
|
206 |
-
margin-top: 5px;
|
207 |
-
padding: 0 5px; }
|
208 |
-
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
|
209 |
-
color: #999;
|
210 |
-
cursor: pointer;
|
211 |
-
display: inline-block;
|
212 |
-
font-weight: bold;
|
213 |
-
margin-right: 2px; }
|
214 |
-
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
|
215 |
-
color: #333; }
|
216 |
-
|
217 |
-
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
|
218 |
-
float: right; }
|
219 |
-
|
220 |
-
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
221 |
-
margin-left: 5px;
|
222 |
-
margin-right: auto; }
|
223 |
-
|
224 |
-
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
225 |
-
margin-left: 2px;
|
226 |
-
margin-right: auto; }
|
227 |
-
|
228 |
-
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
229 |
-
border: solid black 1px;
|
230 |
-
outline: 0; }
|
231 |
-
|
232 |
-
.select2-container--default.select2-container--disabled .select2-selection--multiple {
|
233 |
-
background-color: #eee;
|
234 |
-
cursor: default; }
|
235 |
-
|
236 |
-
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
|
237 |
-
display: none; }
|
238 |
-
|
239 |
-
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
|
240 |
-
border-top-left-radius: 0;
|
241 |
-
border-top-right-radius: 0; }
|
242 |
-
|
243 |
-
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
|
244 |
-
border-bottom-left-radius: 0;
|
245 |
-
border-bottom-right-radius: 0; }
|
246 |
-
|
247 |
-
.select2-container--default .select2-search--dropdown .select2-search__field {
|
248 |
-
border: 1px solid #aaa; }
|
249 |
-
|
250 |
-
.select2-container--default .select2-search--inline .select2-search__field {
|
251 |
-
background: transparent;
|
252 |
-
border: none;
|
253 |
-
outline: 0;
|
254 |
-
box-shadow: none;
|
255 |
-
-webkit-appearance: textfield; }
|
256 |
-
|
257 |
-
.select2-container--default .select2-results > .select2-results__options {
|
258 |
-
max-height: 200px;
|
259 |
-
overflow-y: auto; }
|
260 |
-
|
261 |
-
.select2-container--default .select2-results__option[role=group] {
|
262 |
-
padding: 0; }
|
263 |
-
|
264 |
-
.select2-container--default .select2-results__option[aria-disabled=true] {
|
265 |
-
color: #999; }
|
266 |
-
|
267 |
-
.select2-container--default .select2-results__option[aria-selected=true] {
|
268 |
-
background-color: #ddd; }
|
269 |
-
|
270 |
-
.select2-container--default .select2-results__option .select2-results__option {
|
271 |
-
padding-left: 1em; }
|
272 |
-
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
|
273 |
-
padding-left: 0; }
|
274 |
-
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
|
275 |
-
margin-left: -1em;
|
276 |
-
padding-left: 2em; }
|
277 |
-
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
278 |
-
margin-left: -2em;
|
279 |
-
padding-left: 3em; }
|
280 |
-
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
281 |
-
margin-left: -3em;
|
282 |
-
padding-left: 4em; }
|
283 |
-
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
284 |
-
margin-left: -4em;
|
285 |
-
padding-left: 5em; }
|
286 |
-
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
287 |
-
margin-left: -5em;
|
288 |
-
padding-left: 6em; }
|
289 |
-
|
290 |
-
.select2-container--default .select2-results__option--highlighted[aria-selected] {
|
291 |
-
background-color: #5897fb;
|
292 |
-
color: white; }
|
293 |
-
|
294 |
-
.select2-container--default .select2-results__group {
|
295 |
-
cursor: default;
|
296 |
-
display: block;
|
297 |
-
padding: 6px; }
|
298 |
-
|
299 |
-
.select2-container--classic .select2-selection--single {
|
300 |
-
background-color: #f7f7f7;
|
301 |
-
border: 1px solid #aaa;
|
302 |
-
border-radius: 4px;
|
303 |
-
outline: 0;
|
304 |
-
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
|
305 |
-
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
|
306 |
-
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
|
307 |
-
background-repeat: repeat-x;
|
308 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
309 |
-
.select2-container--classic .select2-selection--single:focus {
|
310 |
-
border: 1px solid #5897fb; }
|
311 |
-
.select2-container--classic .select2-selection--single .select2-selection__rendered {
|
312 |
-
color: #444;
|
313 |
-
line-height: 28px; }
|
314 |
-
.select2-container--classic .select2-selection--single .select2-selection__clear {
|
315 |
-
cursor: pointer;
|
316 |
-
float: right;
|
317 |
-
font-weight: bold;
|
318 |
-
margin-right: 10px; }
|
319 |
-
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
|
320 |
-
color: #999; }
|
321 |
-
.select2-container--classic .select2-selection--single .select2-selection__arrow {
|
322 |
-
background-color: #ddd;
|
323 |
-
border: none;
|
324 |
-
border-left: 1px solid #aaa;
|
325 |
-
border-top-right-radius: 4px;
|
326 |
-
border-bottom-right-radius: 4px;
|
327 |
-
height: 26px;
|
328 |
-
position: absolute;
|
329 |
-
top: 1px;
|
330 |
-
right: 1px;
|
331 |
-
width: 20px;
|
332 |
-
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
333 |
-
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
334 |
-
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
|
335 |
-
background-repeat: repeat-x;
|
336 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
|
337 |
-
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
|
338 |
-
border-color: #888 transparent transparent transparent;
|
339 |
-
border-style: solid;
|
340 |
-
border-width: 5px 4px 0 4px;
|
341 |
-
height: 0;
|
342 |
-
left: 50%;
|
343 |
-
margin-left: -4px;
|
344 |
-
margin-top: -2px;
|
345 |
-
position: absolute;
|
346 |
-
top: 50%;
|
347 |
-
width: 0; }
|
348 |
-
|
349 |
-
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
350 |
-
float: left; }
|
351 |
-
|
352 |
-
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
353 |
-
border: none;
|
354 |
-
border-right: 1px solid #aaa;
|
355 |
-
border-radius: 0;
|
356 |
-
border-top-left-radius: 4px;
|
357 |
-
border-bottom-left-radius: 4px;
|
358 |
-
left: 1px;
|
359 |
-
right: auto; }
|
360 |
-
|
361 |
-
.select2-container--classic.select2-container--open .select2-selection--single {
|
362 |
-
border: 1px solid #5897fb; }
|
363 |
-
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
|
364 |
-
background: transparent;
|
365 |
-
border: none; }
|
366 |
-
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
367 |
-
border-color: transparent transparent #888 transparent;
|
368 |
-
border-width: 0 4px 5px 4px; }
|
369 |
-
|
370 |
-
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
|
371 |
-
border-top: none;
|
372 |
-
border-top-left-radius: 0;
|
373 |
-
border-top-right-radius: 0;
|
374 |
-
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
|
375 |
-
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
|
376 |
-
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
|
377 |
-
background-repeat: repeat-x;
|
378 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
379 |
-
|
380 |
-
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
|
381 |
-
border-bottom: none;
|
382 |
-
border-bottom-left-radius: 0;
|
383 |
-
border-bottom-right-radius: 0;
|
384 |
-
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
|
385 |
-
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
|
386 |
-
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
|
387 |
-
background-repeat: repeat-x;
|
388 |
-
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
|
389 |
-
|
390 |
-
.select2-container--classic .select2-selection--multiple {
|
391 |
-
background-color: white;
|
392 |
-
border: 1px solid #aaa;
|
393 |
-
border-radius: 4px;
|
394 |
-
cursor: text;
|
395 |
-
outline: 0; }
|
396 |
-
.select2-container--classic .select2-selection--multiple:focus {
|
397 |
-
border: 1px solid #5897fb; }
|
398 |
-
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
|
399 |
-
list-style: none;
|
400 |
-
margin: 0;
|
401 |
-
padding: 0 5px; }
|
402 |
-
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
|
403 |
-
display: none; }
|
404 |
-
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
|
405 |
-
background-color: #e4e4e4;
|
406 |
-
border: 1px solid #aaa;
|
407 |
-
border-radius: 4px;
|
408 |
-
cursor: default;
|
409 |
-
float: left;
|
410 |
-
margin-right: 5px;
|
411 |
-
margin-top: 5px;
|
412 |
-
padding: 0 5px; }
|
413 |
-
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
|
414 |
-
color: #888;
|
415 |
-
cursor: pointer;
|
416 |
-
display: inline-block;
|
417 |
-
font-weight: bold;
|
418 |
-
margin-right: 2px; }
|
419 |
-
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
|
420 |
-
color: #555; }
|
421 |
-
|
422 |
-
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
423 |
-
float: right; }
|
424 |
-
|
425 |
-
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
426 |
-
margin-left: 5px;
|
427 |
-
margin-right: auto; }
|
428 |
-
|
429 |
-
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
430 |
-
margin-left: 2px;
|
431 |
-
margin-right: auto; }
|
432 |
-
|
433 |
-
.select2-container--classic.select2-container--open .select2-selection--multiple {
|
434 |
-
border: 1px solid #5897fb; }
|
435 |
-
|
436 |
-
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
|
437 |
-
border-top: none;
|
438 |
-
border-top-left-radius: 0;
|
439 |
-
border-top-right-radius: 0; }
|
440 |
-
|
441 |
-
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
|
442 |
-
border-bottom: none;
|
443 |
-
border-bottom-left-radius: 0;
|
444 |
-
border-bottom-right-radius: 0; }
|
445 |
-
|
446 |
-
.select2-container--classic .select2-search--dropdown .select2-search__field {
|
447 |
-
border: 1px solid #aaa;
|
448 |
-
outline: 0; }
|
449 |
-
|
450 |
-
.select2-container--classic .select2-search--inline .select2-search__field {
|
451 |
-
outline: 0;
|
452 |
-
box-shadow: none; }
|
453 |
-
|
454 |
-
.select2-container--classic .select2-dropdown {
|
455 |
-
background-color: white;
|
456 |
-
border: 1px solid transparent; }
|
457 |
-
|
458 |
-
.select2-container--classic .select2-dropdown--above {
|
459 |
-
border-bottom: none; }
|
460 |
-
|
461 |
-
.select2-container--classic .select2-dropdown--below {
|
462 |
-
border-top: none; }
|
463 |
-
|
464 |
-
.select2-container--classic .select2-results > .select2-results__options {
|
465 |
-
max-height: 200px;
|
466 |
-
overflow-y: auto; }
|
467 |
-
|
468 |
-
.select2-container--classic .select2-results__option[role=group] {
|
469 |
-
padding: 0; }
|
470 |
-
|
471 |
-
.select2-container--classic .select2-results__option[aria-disabled=true] {
|
472 |
-
color: grey; }
|
473 |
-
|
474 |
-
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
|
475 |
-
background-color: #3875d7;
|
476 |
-
color: white; }
|
477 |
-
|
478 |
-
.select2-container--classic .select2-results__group {
|
479 |
-
cursor: default;
|
480 |
-
display: block;
|
481 |
-
padding: 6px; }
|
482 |
-
|
483 |
-
.select2-container--classic.select2-container--open .select2-dropdown {
|
484 |
-
border-color: #5897fb; }
|
1 |
+
.select2-container {
|
2 |
+
box-sizing: border-box;
|
3 |
+
display: inline-block;
|
4 |
+
margin: 0;
|
5 |
+
position: relative;
|
6 |
+
vertical-align: middle; }
|
7 |
+
.select2-container .select2-selection--single {
|
8 |
+
box-sizing: border-box;
|
9 |
+
cursor: pointer;
|
10 |
+
display: block;
|
11 |
+
height: 28px;
|
12 |
+
user-select: none;
|
13 |
+
-webkit-user-select: none; }
|
14 |
+
.select2-container .select2-selection--single .select2-selection__rendered {
|
15 |
+
display: block;
|
16 |
+
padding-left: 8px;
|
17 |
+
padding-right: 20px;
|
18 |
+
overflow: hidden;
|
19 |
+
text-overflow: ellipsis;
|
20 |
+
white-space: nowrap; }
|
21 |
+
.select2-container .select2-selection--single .select2-selection__clear {
|
22 |
+
position: relative; }
|
23 |
+
.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
|
24 |
+
padding-right: 8px;
|
25 |
+
padding-left: 20px; }
|
26 |
+
.select2-container .select2-selection--multiple {
|
27 |
+
box-sizing: border-box;
|
28 |
+
cursor: pointer;
|
29 |
+
display: block;
|
30 |
+
min-height: 32px;
|
31 |
+
user-select: none;
|
32 |
+
-webkit-user-select: none; }
|
33 |
+
.select2-container .select2-selection--multiple .select2-selection__rendered {
|
34 |
+
display: inline-block;
|
35 |
+
overflow: hidden;
|
36 |
+
padding-left: 8px;
|
37 |
+
text-overflow: ellipsis;
|
38 |
+
white-space: nowrap; }
|
39 |
+
.select2-container .select2-search--inline {
|
40 |
+
float: left; }
|
41 |
+
.select2-container .select2-search--inline .select2-search__field {
|
42 |
+
box-sizing: border-box;
|
43 |
+
border: none;
|
44 |
+
font-size: 100%;
|
45 |
+
margin-top: 5px;
|
46 |
+
padding: 0; }
|
47 |
+
.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
|
48 |
+
-webkit-appearance: none; }
|
49 |
+
|
50 |
+
.select2-dropdown {
|
51 |
+
background-color: white;
|
52 |
+
border: 1px solid #aaa;
|
53 |
+
border-radius: 4px;
|
54 |
+
box-sizing: border-box;
|
55 |
+
display: block;
|
56 |
+
position: absolute;
|
57 |
+
left: -100000px;
|
58 |
+
width: 100%;
|
59 |
+
z-index: 1051; }
|
60 |
+
|
61 |
+
.select2-results {
|
62 |
+
display: block; }
|
63 |
+
|
64 |
+
.select2-results__options {
|
65 |
+
list-style: none;
|
66 |
+
margin: 0;
|
67 |
+
padding: 0; }
|
68 |
+
|
69 |
+
.select2-results__option {
|
70 |
+
padding: 6px;
|
71 |
+
user-select: none;
|
72 |
+
-webkit-user-select: none; }
|
73 |
+
.select2-results__option[aria-selected] {
|
74 |
+
cursor: pointer; }
|
75 |
+
|
76 |
+
.select2-container--open .select2-dropdown {
|
77 |
+
left: 0; }
|
78 |
+
|
79 |
+
.select2-container--open .select2-dropdown--above {
|
80 |
+
border-bottom: none;
|
81 |
+
border-bottom-left-radius: 0;
|
82 |
+
border-bottom-right-radius: 0; }
|
83 |
+
|
84 |
+
.select2-container--open .select2-dropdown--below {
|
85 |
+
border-top: none;
|
86 |
+
border-top-left-radius: 0;
|
87 |
+
border-top-right-radius: 0; }
|
88 |
+
|
89 |
+
.select2-search--dropdown {
|
90 |
+
display: block;
|
91 |
+
padding: 4px; }
|
92 |
+
.select2-search--dropdown .select2-search__field {
|
93 |
+
padding: 4px;
|
94 |
+
width: 100%;
|
95 |
+
box-sizing: border-box; }
|
96 |
+
.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
|
97 |
+
-webkit-appearance: none; }
|
98 |
+
.select2-search--dropdown.select2-search--hide {
|
99 |
+
display: none; }
|
100 |
+
|
101 |
+
.select2-close-mask {
|
102 |
+
border: 0;
|
103 |
+
margin: 0;
|
104 |
+
padding: 0;
|
105 |
+
display: block;
|
106 |
+
position: fixed;
|
107 |
+
left: 0;
|
108 |
+
top: 0;
|
109 |
+
min-height: 100%;
|
110 |
+
min-width: 100%;
|
111 |
+
height: auto;
|
112 |
+
width: auto;
|
113 |
+
opacity: 0;
|
114 |
+
z-index: 99;
|
115 |
+
background-color: #fff;
|
116 |
+
filter: alpha(opacity=0); }
|
117 |
+
|
118 |
+
.select2-hidden-accessible {
|
119 |
+
border: 0 !important;
|
120 |
+
clip: rect(0 0 0 0) !important;
|
121 |
+
height: 1px !important;
|
122 |
+
margin: -1px !important;
|
123 |
+
overflow: hidden !important;
|
124 |
+
padding: 0 !important;
|
125 |
+
position: absolute !important;
|
126 |
+
width: 1px !important; }
|
127 |
+
|
128 |
+
.select2-container--default .select2-selection--single {
|
129 |
+
background-color: #fff;
|
130 |
+
border: 1px solid #aaa;
|
131 |
+
border-radius: 4px; }
|
132 |
+
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
133 |
+
color: #444;
|
134 |
+
line-height: 28px; }
|
135 |
+
.select2-container--default .select2-selection--single .select2-selection__clear {
|
136 |
+
cursor: pointer;
|
137 |
+
float: right;
|
138 |
+
font-weight: bold; }
|
139 |
+
.select2-container--default .select2-selection--single .select2-selection__placeholder {
|
140 |
+
color: #999; }
|
141 |
+
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
142 |
+
height: 26px;
|
143 |
+
position: absolute;
|
144 |
+
top: 1px;
|
145 |
+
right: 1px;
|
146 |
+
width: 20px; }
|
147 |
+
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
148 |
+
border-color: #888 transparent transparent transparent;
|
149 |
+
border-style: solid;
|
150 |
+
border-width: 5px 4px 0 4px;
|
151 |
+
height: 0;
|
152 |
+
left: 50%;
|
153 |
+
margin-left: -4px;
|
154 |
+
margin-top: -2px;
|
155 |
+
position: absolute;
|
156 |
+
top: 50%;
|
157 |
+
width: 0; }
|
158 |
+
|
159 |
+
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
160 |
+
float: left; }
|
161 |
+
|
162 |
+
.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
163 |
+
left: 1px;
|
164 |
+
right: auto; }
|
165 |
+
|
166 |
+
.select2-container--default.select2-container--disabled .select2-selection--single {
|
167 |
+
background-color: #eee;
|
168 |
+
cursor: default; }
|
169 |
+
.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
|
170 |
+
display: none; }
|
171 |
+
|
172 |
+
.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
173 |
+
border-color: transparent transparent #888 transparent;
|
174 |
+
border-width: 0 4px 5px 4px; }
|
175 |
+
|
176 |
+
.select2-container--default .select2-selection--multiple {
|
177 |
+
background-color: white;
|
178 |
+
border: 1px solid #aaa;
|
179 |
+
border-radius: 4px;
|
180 |
+
cursor: text; }
|
181 |
+
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
|
182 |
+
box-sizing: border-box;
|
183 |
+
list-style: none;
|
184 |
+
margin: 0;
|
185 |
+
padding: 0 5px;
|
186 |
+
width: 100%; }
|
187 |
+
.select2-container--default .select2-selection--multiple .select2-selection__rendered li {
|
188 |
+
list-style: none; }
|
189 |
+
.select2-container--default .select2-selection--multiple .select2-selection__placeholder {
|
190 |
+
color: #999;
|
191 |
+
margin-top: 5px;
|
192 |
+
float: left; }
|
193 |
+
.select2-container--default .select2-selection--multiple .select2-selection__clear {
|
194 |
+
cursor: pointer;
|
195 |
+
float: right;
|
196 |
+
font-weight: bold;
|
197 |
+
margin-top: 5px;
|
198 |
+
margin-right: 10px; }
|
199 |
+
.select2-container--default .select2-selection--multiple .select2-selection__choice {
|
200 |
+
background-color: #e4e4e4;
|
201 |
+
border: 1px solid #aaa;
|
202 |
+
border-radius: 4px;
|
203 |
+
cursor: default;
|
204 |
+
float: left;
|
205 |
+
margin-right: 5px;
|
206 |
+
margin-top: 5px;
|
207 |
+
padding: 0 5px; }
|
208 |
+
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
|
209 |
+
color: #999;
|
210 |
+
cursor: pointer;
|
211 |
+
display: inline-block;
|
212 |
+
font-weight: bold;
|
213 |
+
margin-right: 2px; }
|
214 |
+
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
|
215 |
+
color: #333; }
|
216 |
+
|
217 |
+
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
|
218 |
+
float: right; }
|
219 |
+
|
220 |
+
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
221 |
+
margin-left: 5px;
|
222 |
+
margin-right: auto; }
|
223 |
+
|
224 |
+
.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
225 |
+
margin-left: 2px;
|
226 |
+
margin-right: auto; }
|
227 |
+
|
228 |
+
.select2-container--default.select2-container--focus .select2-selection--multiple {
|
229 |
+
border: solid black 1px;
|
230 |
+
outline: 0; }
|
231 |
+
|
232 |
+
.select2-container--default.select2-container--disabled .select2-selection--multiple {
|
233 |
+
background-color: #eee;
|
234 |
+
cursor: default; }
|
235 |
+
|
236 |
+
.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
|
237 |
+
display: none; }
|
238 |
+
|
239 |
+
.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
|
240 |
+
border-top-left-radius: 0;
|
241 |
+
border-top-right-radius: 0; }
|
242 |
+
|
243 |
+
.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
|
244 |
+
border-bottom-left-radius: 0;
|
245 |
+
border-bottom-right-radius: 0; }
|
246 |
+
|
247 |
+
.select2-container--default .select2-search--dropdown .select2-search__field {
|
248 |
+
border: 1px solid #aaa; }
|
249 |
+
|
250 |
+
.select2-container--default .select2-search--inline .select2-search__field {
|
251 |
+
background: transparent;
|
252 |
+
border: none;
|
253 |
+
outline: 0;
|
254 |
+
box-shadow: none;
|
255 |
+
-webkit-appearance: textfield; }
|
256 |
+
|
257 |
+
.select2-container--default .select2-results > .select2-results__options {
|
258 |
+
max-height: 200px;
|
259 |
+
overflow-y: auto; }
|
260 |
+
|
261 |
+
.select2-container--default .select2-results__option[role=group] {
|
262 |
+
padding: 0; }
|
263 |
+
|
264 |
+
.select2-container--default .select2-results__option[aria-disabled=true] {
|
265 |
+
color: #999; }
|
266 |
+
|
267 |
+
.select2-container--default .select2-results__option[aria-selected=true] {
|
268 |
+
background-color: #ddd; }
|
269 |
+
|
270 |
+
.select2-container--default .select2-results__option .select2-results__option {
|
271 |
+
padding-left: 1em; }
|
272 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__group {
|
273 |
+
padding-left: 0; }
|
274 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option {
|
275 |
+
margin-left: -1em;
|
276 |
+
padding-left: 2em; }
|
277 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
278 |
+
margin-left: -2em;
|
279 |
+
padding-left: 3em; }
|
280 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
281 |
+
margin-left: -3em;
|
282 |
+
padding-left: 4em; }
|
283 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
284 |
+
margin-left: -4em;
|
285 |
+
padding-left: 5em; }
|
286 |
+
.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
|
287 |
+
margin-left: -5em;
|
288 |
+
padding-left: 6em; }
|
289 |
+
|
290 |
+
.select2-container--default .select2-results__option--highlighted[aria-selected] {
|
291 |
+
background-color: #5897fb;
|
292 |
+
color: white; }
|
293 |
+
|
294 |
+
.select2-container--default .select2-results__group {
|
295 |
+
cursor: default;
|
296 |
+
display: block;
|
297 |
+
padding: 6px; }
|
298 |
+
|
299 |
+
.select2-container--classic .select2-selection--single {
|
300 |
+
background-color: #f7f7f7;
|
301 |
+
border: 1px solid #aaa;
|
302 |
+
border-radius: 4px;
|
303 |
+
outline: 0;
|
304 |
+
background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
|
305 |
+
background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
|
306 |
+
background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
|
307 |
+
background-repeat: repeat-x;
|
308 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
309 |
+
.select2-container--classic .select2-selection--single:focus {
|
310 |
+
border: 1px solid #5897fb; }
|
311 |
+
.select2-container--classic .select2-selection--single .select2-selection__rendered {
|
312 |
+
color: #444;
|
313 |
+
line-height: 28px; }
|
314 |
+
.select2-container--classic .select2-selection--single .select2-selection__clear {
|
315 |
+
cursor: pointer;
|
316 |
+
float: right;
|
317 |
+
font-weight: bold;
|
318 |
+
margin-right: 10px; }
|
319 |
+
.select2-container--classic .select2-selection--single .select2-selection__placeholder {
|
320 |
+
color: #999; }
|
321 |
+
.select2-container--classic .select2-selection--single .select2-selection__arrow {
|
322 |
+
background-color: #ddd;
|
323 |
+
border: none;
|
324 |
+
border-left: 1px solid #aaa;
|
325 |
+
border-top-right-radius: 4px;
|
326 |
+
border-bottom-right-radius: 4px;
|
327 |
+
height: 26px;
|
328 |
+
position: absolute;
|
329 |
+
top: 1px;
|
330 |
+
right: 1px;
|
331 |
+
width: 20px;
|
332 |
+
background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
333 |
+
background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
|
334 |
+
background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
|
335 |
+
background-repeat: repeat-x;
|
336 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
|
337 |
+
.select2-container--classic .select2-selection--single .select2-selection__arrow b {
|
338 |
+
border-color: #888 transparent transparent transparent;
|
339 |
+
border-style: solid;
|
340 |
+
border-width: 5px 4px 0 4px;
|
341 |
+
height: 0;
|
342 |
+
left: 50%;
|
343 |
+
margin-left: -4px;
|
344 |
+
margin-top: -2px;
|
345 |
+
position: absolute;
|
346 |
+
top: 50%;
|
347 |
+
width: 0; }
|
348 |
+
|
349 |
+
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
|
350 |
+
float: left; }
|
351 |
+
|
352 |
+
.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
|
353 |
+
border: none;
|
354 |
+
border-right: 1px solid #aaa;
|
355 |
+
border-radius: 0;
|
356 |
+
border-top-left-radius: 4px;
|
357 |
+
border-bottom-left-radius: 4px;
|
358 |
+
left: 1px;
|
359 |
+
right: auto; }
|
360 |
+
|
361 |
+
.select2-container--classic.select2-container--open .select2-selection--single {
|
362 |
+
border: 1px solid #5897fb; }
|
363 |
+
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
|
364 |
+
background: transparent;
|
365 |
+
border: none; }
|
366 |
+
.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
|
367 |
+
border-color: transparent transparent #888 transparent;
|
368 |
+
border-width: 0 4px 5px 4px; }
|
369 |
+
|
370 |
+
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
|
371 |
+
border-top: none;
|
372 |
+
border-top-left-radius: 0;
|
373 |
+
border-top-right-radius: 0;
|
374 |
+
background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
|
375 |
+
background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
|
376 |
+
background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
|
377 |
+
background-repeat: repeat-x;
|
378 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
|
379 |
+
|
380 |
+
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
|
381 |
+
border-bottom: none;
|
382 |
+
border-bottom-left-radius: 0;
|
383 |
+
border-bottom-right-radius: 0;
|
384 |
+
background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
|
385 |
+
background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
|
386 |
+
background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
|
387 |
+
background-repeat: repeat-x;
|
388 |
+
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
|
389 |
+
|
390 |
+
.select2-container--classic .select2-selection--multiple {
|
391 |
+
background-color: white;
|
392 |
+
border: 1px solid #aaa;
|
393 |
+
border-radius: 4px;
|
394 |
+
cursor: text;
|
395 |
+
outline: 0; }
|
396 |
+
.select2-container--classic .select2-selection--multiple:focus {
|
397 |
+
border: 1px solid #5897fb; }
|
398 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__rendered {
|
399 |
+
list-style: none;
|
400 |
+
margin: 0;
|
401 |
+
padding: 0 5px; }
|
402 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__clear {
|
403 |
+
display: none; }
|
404 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__choice {
|
405 |
+
background-color: #e4e4e4;
|
406 |
+
border: 1px solid #aaa;
|
407 |
+
border-radius: 4px;
|
408 |
+
cursor: default;
|
409 |
+
float: left;
|
410 |
+
margin-right: 5px;
|
411 |
+
margin-top: 5px;
|
412 |
+
padding: 0 5px; }
|
413 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
|
414 |
+
color: #888;
|
415 |
+
cursor: pointer;
|
416 |
+
display: inline-block;
|
417 |
+
font-weight: bold;
|
418 |
+
margin-right: 2px; }
|
419 |
+
.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
|
420 |
+
color: #555; }
|
421 |
+
|
422 |
+
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
423 |
+
float: right; }
|
424 |
+
|
425 |
+
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
|
426 |
+
margin-left: 5px;
|
427 |
+
margin-right: auto; }
|
428 |
+
|
429 |
+
.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
|
430 |
+
margin-left: 2px;
|
431 |
+
margin-right: auto; }
|
432 |
+
|
433 |
+
.select2-container--classic.select2-container--open .select2-selection--multiple {
|
434 |
+
border: 1px solid #5897fb; }
|
435 |
+
|
436 |
+
.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
|
437 |
+
border-top: none;
|
438 |
+
border-top-left-radius: 0;
|
439 |
+
border-top-right-radius: 0; }
|
440 |
+
|
441 |
+
.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
|
442 |
+
border-bottom: none;
|
443 |
+
border-bottom-left-radius: 0;
|
444 |
+
border-bottom-right-radius: 0; }
|
445 |
+
|
446 |
+
.select2-container--classic .select2-search--dropdown .select2-search__field {
|
447 |
+
border: 1px solid #aaa;
|
448 |
+
outline: 0; }
|
449 |
+
|
450 |
+
.select2-container--classic .select2-search--inline .select2-search__field {
|
451 |
+
outline: 0;
|
452 |
+
box-shadow: none; }
|
453 |
+
|
454 |
+
.select2-container--classic .select2-dropdown {
|
455 |
+
background-color: white;
|
456 |
+
border: 1px solid transparent; }
|
457 |
+
|
458 |
+
.select2-container--classic .select2-dropdown--above {
|
459 |
+
border-bottom: none; }
|
460 |
+
|
461 |
+
.select2-container--classic .select2-dropdown--below {
|
462 |
+
border-top: none; }
|
463 |
+
|
464 |
+
.select2-container--classic .select2-results > .select2-results__options {
|
465 |
+
max-height: 200px;
|
466 |
+
overflow-y: auto; }
|
467 |
+
|
468 |
+
.select2-container--classic .select2-results__option[role=group] {
|
469 |
+
padding: 0; }
|
470 |
+
|
471 |
+
.select2-container--classic .select2-results__option[aria-disabled=true] {
|
472 |
+
color: grey; }
|
473 |
+
|
474 |
+
.select2-container--classic .select2-results__option--highlighted[aria-selected] {
|
475 |
+
background-color: #3875d7;
|
476 |
+
color: white; }
|
477 |
+
|
478 |
+
.select2-container--classic .select2-results__group {
|
479 |
+
cursor: default;
|
480 |
+
display: block;
|
481 |
+
padding: 6px; }
|
482 |
+
|
483 |
+
.select2-container--classic.select2-container--open .select2-dropdown {
|
484 |
+
border-color: #5897fb; }
|
assets/lib/select2-lib/dist/css/select2.min.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
|
1 |
+
.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[aria-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[aria-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[aria-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[aria-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
|
assets/lib/select2-lib/dist/js/i18n/ar.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/az.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/bg.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/ca.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/cs.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/da.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/de.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/el.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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}})();
|
1 |
+
/*! Select2 4.0.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/en.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/es.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/et.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/eu.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/fa.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/fi.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/fr.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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,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.3 | 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,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}})();
|
assets/lib/select2-lib/dist/js/i18n/gl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/he.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/hi.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/hr.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/hu.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/id.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/is.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/it.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/ja.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/km.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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}})();
|
1 |
+
/*! Select2 4.0.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/ko.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/lt.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),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.3 | 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","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),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}})();
|
assets/lib/select2-lib/dist/js/i18n/lv.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/mk.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/ms.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/nb.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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 ";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.3 | 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 ";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}})();
|
assets/lib/select2-lib/dist/js/i18n/nl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/pl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/pt-BR.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/pt.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/ro.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/ru.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/sk.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/sr-Cyrl.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/sr.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/sv.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/th.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/tr.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/uk.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/vi.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/zh-CN.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/i18n/zh-TW.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
/*! Select2 4.0.3 | 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.3 | 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}})();
|
assets/lib/select2-lib/dist/js/select2.full.js
CHANGED
@@ -1,6436 +1,6436 @@
|
|
1 |
-
/*!
|
2 |
-
* Select2 4.0.3
|
3 |
-
* https://select2.github.io
|
4 |
-
*
|
5 |
-
* Released under the MIT license
|
6 |
-
* https://github.com/select2/select2/blob/master/LICENSE.md
|
7 |
-
*/
|
8 |
-
(function (factory) {
|
9 |
-
if (typeof define === 'function' && define.amd) {
|
10 |
-
// AMD. Register as an anonymous module.
|
11 |
-
define(['jquery'], factory);
|
12 |
-
} else if (typeof exports === 'object') {
|
13 |
-
// Node/CommonJS
|
14 |
-
factory(require('jquery'));
|
15 |
-
} else {
|
16 |
-
// Browser globals
|
17 |
-
factory(jQuery);
|
18 |
-
}
|
19 |
-
}(function (jQuery) {
|
20 |
-
// This is needed so we can catch the AMD loader configuration and use it
|
21 |
-
// The inner file should be wrapped (by `banner.start.js`) in a function that
|
22 |
-
// returns the AMD loader references.
|
23 |
-
var S2 =
|
24 |
-
(function () {
|
25 |
-
// Restore the Select2 AMD loader so it can be used
|
26 |
-
// Needed mostly in the language files, where the loader is not inserted
|
27 |
-
if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
|
28 |
-
var S2 = jQuery.fn.select2.amd;
|
29 |
-
}
|
30 |
-
var S2;(function () { if (!S2 || !S2.requirejs) {
|
31 |
-
if (!S2) { S2 = {}; } else { require = S2; }
|
32 |
-
/**
|
33 |
-
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
34 |
-
* Available via the MIT or new BSD license.
|
35 |
-
* see: http://github.com/jrburke/almond for details
|
36 |
-
*/
|
37 |
-
//Going sloppy to avoid 'use strict' string cost, but strict practices should
|
38 |
-
//be followed.
|
39 |
-
/*jslint sloppy: true */
|
40 |
-
/*global setTimeout: false */
|
41 |
-
|
42 |
-
var requirejs, require, define;
|
43 |
-
(function (undef) {
|
44 |
-
var main, req, makeMap, handlers,
|
45 |
-
defined = {},
|
46 |
-
waiting = {},
|
47 |
-
config = {},
|
48 |
-
defining = {},
|
49 |
-
hasOwn = Object.prototype.hasOwnProperty,
|
50 |
-
aps = [].slice,
|
51 |
-
jsSuffixRegExp = /\.js$/;
|
52 |
-
|
53 |
-
function hasProp(obj, prop) {
|
54 |
-
return hasOwn.call(obj, prop);
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* Given a relative module name, like ./something, normalize it to
|
59 |
-
* a real name that can be mapped to a path.
|
60 |
-
* @param {String} name the relative name
|
61 |
-
* @param {String} baseName a real name that the name arg is relative
|
62 |
-
* to.
|
63 |
-
* @returns {String} normalized name
|
64 |
-
*/
|
65 |
-
function normalize(name, baseName) {
|
66 |
-
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
|
67 |
-
foundI, foundStarMap, starI, i, j, part,
|
68 |
-
baseParts = baseName && baseName.split("/"),
|
69 |
-
map = config.map,
|
70 |
-
starMap = (map && map['*']) || {};
|
71 |
-
|
72 |
-
//Adjust any relative paths.
|
73 |
-
if (name && name.charAt(0) === ".") {
|
74 |
-
//If have a base name, try to normalize against it,
|
75 |
-
//otherwise, assume it is a top-level require that will
|
76 |
-
//be relative to baseUrl in the end.
|
77 |
-
if (baseName) {
|
78 |
-
name = name.split('/');
|
79 |
-
lastIndex = name.length - 1;
|
80 |
-
|
81 |
-
// Node .js allowance:
|
82 |
-
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
|
83 |
-
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
|
84 |
-
}
|
85 |
-
|
86 |
-
//Lop off the last part of baseParts, so that . matches the
|
87 |
-
//"directory" and not name of the baseName's module. For instance,
|
88 |
-
//baseName of "one/two/three", maps to "one/two/three.js", but we
|
89 |
-
//want the directory, "one/two" for this normalization.
|
90 |
-
name = baseParts.slice(0, baseParts.length - 1).concat(name);
|
91 |
-
|
92 |
-
//start trimDots
|
93 |
-
for (i = 0; i < name.length; i += 1) {
|
94 |
-
part = name[i];
|
95 |
-
if (part === ".") {
|
96 |
-
name.splice(i, 1);
|
97 |
-
i -= 1;
|
98 |
-
} else if (part === "..") {
|
99 |
-
if (i === 1 && (name[2] === '..' || name[0] === '..')) {
|
100 |
-
//End of the line. Keep at least one non-dot
|
101 |
-
//path segment at the front so it can be mapped
|
102 |
-
//correctly to disk. Otherwise, there is likely
|
103 |
-
//no path mapping for a path starting with '..'.
|
104 |
-
//This can still fail, but catches the most reasonable
|
105 |
-
//uses of ..
|
106 |
-
break;
|
107 |
-
} else if (i > 0) {
|
108 |
-
name.splice(i - 1, 2);
|
109 |
-
i -= 2;
|
110 |
-
}
|
111 |
-
}
|
112 |
-
}
|
113 |
-
//end trimDots
|
114 |
-
|
115 |
-
name = name.join("/");
|
116 |
-
} else if (name.indexOf('./') === 0) {
|
117 |
-
// No baseName, so this is ID is resolved relative
|
118 |
-
// to baseUrl, pull off the leading dot.
|
119 |
-
name = name.substring(2);
|
120 |
-
}
|
121 |
-
}
|
122 |
-
|
123 |
-
//Apply map config if available.
|
124 |
-
if ((baseParts || starMap) && map) {
|
125 |
-
nameParts = name.split('/');
|
126 |
-
|
127 |
-
for (i = nameParts.length; i > 0; i -= 1) {
|
128 |
-
nameSegment = nameParts.slice(0, i).join("/");
|
129 |
-
|
130 |
-
if (baseParts) {
|
131 |
-
//Find the longest baseName segment match in the config.
|
132 |
-
//So, do joins on the biggest to smallest lengths of baseParts.
|
133 |
-
for (j = baseParts.length; j > 0; j -= 1) {
|
134 |
-
mapValue = map[baseParts.slice(0, j).join('/')];
|
135 |
-
|
136 |
-
//baseName segment has config, find if it has one for
|
137 |
-
//this name.
|
138 |
-
if (mapValue) {
|
139 |
-
mapValue = mapValue[nameSegment];
|
140 |
-
if (mapValue) {
|
141 |
-
//Match, update name to the new value.
|
142 |
-
foundMap = mapValue;
|
143 |
-
foundI = i;
|
144 |
-
break;
|
145 |
-
}
|
146 |
-
}
|
147 |
-
}
|
148 |
-
}
|
149 |
-
|
150 |
-
if (foundMap) {
|
151 |
-
break;
|
152 |
-
}
|
153 |
-
|
154 |
-
//Check for a star map match, but just hold on to it,
|
155 |
-
//if there is a shorter segment match later in a matching
|
156 |
-
//config, then favor over this star map.
|
157 |
-
if (!foundStarMap && starMap && starMap[nameSegment]) {
|
158 |
-
foundStarMap = starMap[nameSegment];
|
159 |
-
starI = i;
|
160 |
-
}
|
161 |
-
}
|
162 |
-
|
163 |
-
if (!foundMap && foundStarMap) {
|
164 |
-
foundMap = foundStarMap;
|
165 |
-
foundI = starI;
|
166 |
-
}
|
167 |
-
|
168 |
-
if (foundMap) {
|
169 |
-
nameParts.splice(0, foundI, foundMap);
|
170 |
-
name = nameParts.join('/');
|
171 |
-
}
|
172 |
-
}
|
173 |
-
|
174 |
-
return name;
|
175 |
-
}
|
176 |
-
|
177 |
-
function makeRequire(relName, forceSync) {
|
178 |
-
return function () {
|
179 |
-
//A version of a require function that passes a moduleName
|
180 |
-
//value for items that may need to
|
181 |
-
//look up paths relative to the moduleName
|
182 |
-
var args = aps.call(arguments, 0);
|
183 |
-
|
184 |
-
//If first arg is not require('string'), and there is only
|
185 |
-
//one arg, it is the array form without a callback. Insert
|
186 |
-
//a null so that the following concat is correct.
|
187 |
-
if (typeof args[0] !== 'string' && args.length === 1) {
|
188 |
-
args.push(null);
|
189 |
-
}
|
190 |
-
return req.apply(undef, args.concat([relName, forceSync]));
|
191 |
-
};
|
192 |
-
}
|
193 |
-
|
194 |
-
function makeNormalize(relName) {
|
195 |
-
return function (name) {
|
196 |
-
return normalize(name, relName);
|
197 |
-
};
|
198 |
-
}
|
199 |
-
|
200 |
-
function makeLoad(depName) {
|
201 |
-
return function (value) {
|
202 |
-
defined[depName] = value;
|
203 |
-
};
|
204 |
-
}
|
205 |
-
|
206 |
-
function callDep(name) {
|
207 |
-
if (hasProp(waiting, name)) {
|
208 |
-
var args = waiting[name];
|
209 |
-
delete waiting[name];
|
210 |
-
defining[name] = true;
|
211 |
-
main.apply(undef, args);
|
212 |
-
}
|
213 |
-
|
214 |
-
if (!hasProp(defined, name) && !hasProp(defining, name)) {
|
215 |
-
throw new Error('No ' + name);
|
216 |
-
}
|
217 |
-
return defined[name];
|
218 |
-
}
|
219 |
-
|
220 |
-
//Turns a plugin!resource to [plugin, resource]
|
221 |
-
//with the plugin being undefined if the name
|
222 |
-
//did not have a plugin prefix.
|
223 |
-
function splitPrefix(name) {
|
224 |
-
var prefix,
|
225 |
-
index = name ? name.indexOf('!') : -1;
|
226 |
-
if (index > -1) {
|
227 |
-
prefix = name.substring(0, index);
|
228 |
-
name = name.substring(index + 1, name.length);
|
229 |
-
}
|
230 |
-
return [prefix, name];
|
231 |
-
}
|
232 |
-
|
233 |
-
/**
|
234 |
-
* Makes a name map, normalizing the name, and using a plugin
|
235 |
-
* for normalization if necessary. Grabs a ref to plugin
|
236 |
-
* too, as an optimization.
|
237 |
-
*/
|
238 |
-
makeMap = function (name, relName) {
|
239 |
-
var plugin,
|
240 |
-
parts = splitPrefix(name),
|
241 |
-
prefix = parts[0];
|
242 |
-
|
243 |
-
name = parts[1];
|
244 |
-
|
245 |
-
if (prefix) {
|
246 |
-
prefix = normalize(prefix, relName);
|
247 |
-
plugin = callDep(prefix);
|
248 |
-
}
|
249 |
-
|
250 |
-
//Normalize according
|
251 |
-
if (prefix) {
|
252 |
-
if (plugin && plugin.normalize) {
|
253 |
-
name = plugin.normalize(name, makeNormalize(relName));
|
254 |
-
} else {
|
255 |
-
name = normalize(name, relName);
|
256 |
-
}
|
257 |
-
} else {
|
258 |
-
name = normalize(name, relName);
|
259 |
-
parts = splitPrefix(name);
|
260 |
-
prefix = parts[0];
|
261 |
-
name = parts[1];
|
262 |
-
if (prefix) {
|
263 |
-
plugin = callDep(prefix);
|
264 |
-
}
|
265 |
-
}
|
266 |
-
|
267 |
-
//Using ridiculous property names for space reasons
|
268 |
-
return {
|
269 |
-
f: prefix ? prefix + '!' + name : name, //fullName
|
270 |
-
n: name,
|
271 |
-
pr: prefix,
|
272 |
-
p: plugin
|
273 |
-
};
|
274 |
-
};
|
275 |
-
|
276 |
-
function makeConfig(name) {
|
277 |
-
return function () {
|
278 |
-
return (config && config.config && config.config[name]) || {};
|
279 |
-
};
|
280 |
-
}
|
281 |
-
|
282 |
-
handlers = {
|
283 |
-
require: function (name) {
|
284 |
-
return makeRequire(name);
|
285 |
-
},
|
286 |
-
exports: function (name) {
|
287 |
-
var e = defined[name];
|
288 |
-
if (typeof e !== 'undefined') {
|
289 |
-
return e;
|
290 |
-
} else {
|
291 |
-
return (defined[name] = {});
|
292 |
-
}
|
293 |
-
},
|
294 |
-
module: function (name) {
|
295 |
-
return {
|
296 |
-
id: name,
|
297 |
-
uri: '',
|
298 |
-
exports: defined[name],
|
299 |
-
config: makeConfig(name)
|
300 |
-
};
|
301 |
-
}
|
302 |
-
};
|
303 |
-
|
304 |
-
main = function (name, deps, callback, relName) {
|
305 |
-
var cjsModule, depName, ret, map, i,
|
306 |
-
args = [],
|
307 |
-
callbackType = typeof callback,
|
308 |
-
usingExports;
|
309 |
-
|
310 |
-
//Use name if no relName
|
311 |
-
relName = relName || name;
|
312 |
-
|
313 |
-
//Call the callback to define the module, if necessary.
|
314 |
-
if (callbackType === 'undefined' || callbackType === 'function') {
|
315 |
-
//Pull out the defined dependencies and pass the ordered
|
316 |
-
//values to the callback.
|
317 |
-
//Default to [require, exports, module] if no deps
|
318 |
-
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
|
319 |
-
for (i = 0; i < deps.length; i += 1) {
|
320 |
-
map = makeMap(deps[i], relName);
|
321 |
-
depName = map.f;
|
322 |
-
|
323 |
-
//Fast path CommonJS standard dependencies.
|
324 |
-
if (depName === "require") {
|
325 |
-
args[i] = handlers.require(name);
|
326 |
-
} else if (depName === "exports") {
|
327 |
-
//CommonJS module spec 1.1
|
328 |
-
args[i] = handlers.exports(name);
|
329 |
-
usingExports = true;
|
330 |
-
} else if (depName === "module") {
|
331 |
-
//CommonJS module spec 1.1
|
332 |
-
cjsModule = args[i] = handlers.module(name);
|
333 |
-
} else if (hasProp(defined, depName) ||
|
334 |
-
hasProp(waiting, depName) ||
|
335 |
-
hasProp(defining, depName)) {
|
336 |
-
args[i] = callDep(depName);
|
337 |
-
} else if (map.p) {
|
338 |
-
map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
|
339 |
-
args[i] = defined[depName];
|
340 |
-
} else {
|
341 |
-
throw new Error(name + ' missing ' + depName);
|
342 |
-
}
|
343 |
-
}
|
344 |
-
|
345 |
-
ret = callback ? callback.apply(defined[name], args) : undefined;
|
346 |
-
|
347 |
-
if (name) {
|
348 |
-
//If setting exports via "module" is in play,
|
349 |
-
//favor that over return value and exports. After that,
|
350 |
-
//favor a non-undefined return value over exports use.
|
351 |
-
if (cjsModule && cjsModule.exports !== undef &&
|
352 |
-
cjsModule.exports !== defined[name]) {
|
353 |
-
defined[name] = cjsModule.exports;
|
354 |
-
} else if (ret !== undef || !usingExports) {
|
355 |
-
//Use the return value from the function.
|
356 |
-
defined[name] = ret;
|
357 |
-
}
|
358 |
-
}
|
359 |
-
} else if (name) {
|
360 |
-
//May just be an object definition for the module. Only
|
361 |
-
//worry about defining if have a module name.
|
362 |
-
defined[name] = callback;
|
363 |
-
}
|
364 |
-
};
|
365 |
-
|
366 |
-
requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
|
367 |
-
if (typeof deps === "string") {
|
368 |
-
if (handlers[deps]) {
|
369 |
-
//callback in this case is really relName
|
370 |
-
return handlers[deps](callback);
|
371 |
-
}
|
372 |
-
//Just return the module wanted. In this scenario, the
|
373 |
-
//deps arg is the module name, and second arg (if passed)
|
374 |
-
//is just the relName.
|
375 |
-
//Normalize module name, if it contains . or ..
|
376 |
-
return callDep(makeMap(deps, callback).f);
|
377 |
-
} else if (!deps.splice) {
|
378 |
-
//deps is a config object, not an array.
|
379 |
-
config = deps;
|
380 |
-
if (config.deps) {
|
381 |
-
req(config.deps, config.callback);
|
382 |
-
}
|
383 |
-
if (!callback) {
|
384 |
-
return;
|
385 |
-
}
|
386 |
-
|
387 |
-
if (callback.splice) {
|
388 |
-
//callback is an array, which means it is a dependency list.
|
389 |
-
//Adjust args if there are dependencies
|
390 |
-
deps = callback;
|
391 |
-
callback = relName;
|
392 |
-
relName = null;
|
393 |
-
} else {
|
394 |
-
deps = undef;
|
395 |
-
}
|
396 |
-
}
|
397 |
-
|
398 |
-
//Support require(['a'])
|
399 |
-
callback = callback || function () {};
|
400 |
-
|
401 |
-
//If relName is a function, it is an errback handler,
|
402 |
-
//so remove it.
|
403 |
-
if (typeof relName === 'function') {
|
404 |
-
relName = forceSync;
|
405 |
-
forceSync = alt;
|
406 |
-
}
|
407 |
-
|
408 |
-
//Simulate async callback;
|
409 |
-
if (forceSync) {
|
410 |
-
main(undef, deps, callback, relName);
|
411 |
-
} else {
|
412 |
-
//Using a non-zero value because of concern for what old browsers
|
413 |
-
//do, and latest browsers "upgrade" to 4 if lower value is used:
|
414 |
-
//http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
|
415 |
-
//If want a value immediately, use require('id') instead -- something
|
416 |
-
//that works in almond on the global level, but not guaranteed and
|
417 |
-
//unlikely to work in other AMD implementations.
|
418 |
-
setTimeout(function () {
|
419 |
-
main(undef, deps, callback, relName);
|
420 |
-
}, 4);
|
421 |
-
}
|
422 |
-
|
423 |
-
return req;
|
424 |
-
};
|
425 |
-
|
426 |
-
/**
|
427 |
-
* Just drops the config on the floor, but returns req in case
|
428 |
-
* the config return value is used.
|
429 |
-
*/
|
430 |
-
req.config = function (cfg) {
|
431 |
-
return req(cfg);
|
432 |
-
};
|
433 |
-
|
434 |
-
/**
|
435 |
-
* Expose module registry for debugging and tooling
|
436 |
-
*/
|
437 |
-
requirejs._defined = defined;
|
438 |
-
|
439 |
-
define = function (name, deps, callback) {
|
440 |
-
if (typeof name !== 'string') {
|
441 |
-
throw new Error('See almond README: incorrect module build, no module name');
|
442 |
-
}
|
443 |
-
|
444 |
-
//This module may not have dependencies
|
445 |
-
if (!deps.splice) {
|
446 |
-
//deps is not an array, so probably means
|
447 |
-
//an object literal or factory function for
|
448 |
-
//the value. Adjust args.
|
449 |
-
callback = deps;
|
450 |
-
deps = [];
|
451 |
-
}
|
452 |
-
|
453 |
-
if (!hasProp(defined, name) && !hasProp(waiting, name)) {
|
454 |
-
waiting[name] = [name, deps, callback];
|
455 |
-
}
|
456 |
-
};
|
457 |
-
|
458 |
-
define.amd = {
|
459 |
-
jQuery: true
|
460 |
-
};
|
461 |
-
}());
|
462 |
-
|
463 |
-
S2.requirejs = requirejs;S2.require = require;S2.define = define;
|
464 |
-
}
|
465 |
-
}());
|
466 |
-
S2.define("almond", function(){});
|
467 |
-
|
468 |
-
/* global jQuery:false, $:false */
|
469 |
-
S2.define('jquery',[],function () {
|
470 |
-
var _$ = jQuery || $;
|
471 |
-
|
472 |
-
if (_$ == null && console && console.error) {
|
473 |
-
console.error(
|
474 |
-
'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
|
475 |
-
'found. Make sure that you are including jQuery before Select2 on your ' +
|
476 |
-
'web page.'
|
477 |
-
);
|
478 |
-
}
|
479 |
-
|
480 |
-
return _$;
|
481 |
-
});
|
482 |
-
|
483 |
-
S2.define('select2/utils',[
|
484 |
-
'jquery'
|
485 |
-
], function ($) {
|
486 |
-
var Utils = {};
|
487 |
-
|
488 |
-
Utils.Extend = function (ChildClass, SuperClass) {
|
489 |
-
var __hasProp = {}.hasOwnProperty;
|
490 |
-
|
491 |
-
function BaseConstructor () {
|
492 |
-
this.constructor = ChildClass;
|
493 |
-
}
|
494 |
-
|
495 |
-
for (var key in SuperClass) {
|
496 |
-
if (__hasProp.call(SuperClass, key)) {
|
497 |
-
ChildClass[key] = SuperClass[key];
|
498 |
-
}
|
499 |
-
}
|
500 |
-
|
501 |
-
BaseConstructor.prototype = SuperClass.prototype;
|
502 |
-
ChildClass.prototype = new BaseConstructor();
|
503 |
-
ChildClass.__super__ = SuperClass.prototype;
|
504 |
-
|
505 |
-
return ChildClass;
|
506 |
-
};
|
507 |
-
|
508 |
-
function getMethods (theClass) {
|
509 |
-
var proto = theClass.prototype;
|
510 |
-
|
511 |
-
var methods = [];
|
512 |
-
|
513 |
-
for (var methodName in proto) {
|
514 |
-
var m = proto[methodName];
|
515 |
-
|
516 |
-
if (typeof m !== 'function') {
|
517 |
-
continue;
|
518 |
-
}
|
519 |
-
|
520 |
-
if (methodName === 'constructor') {
|
521 |
-
continue;
|
522 |
-
}
|
523 |
-
|
524 |
-
methods.push(methodName);
|
525 |
-
}
|
526 |
-
|
527 |
-
return methods;
|
528 |
-
}
|
529 |
-
|
530 |
-
Utils.Decorate = function (SuperClass, DecoratorClass) {
|
531 |
-
var decoratedMethods = getMethods(DecoratorClass);
|
532 |
-
var superMethods = getMethods(SuperClass);
|
533 |
-
|
534 |
-
function DecoratedClass () {
|
535 |
-
var unshift = Array.prototype.unshift;
|
536 |
-
|
537 |
-
var argCount = DecoratorClass.prototype.constructor.length;
|
538 |
-
|
539 |
-
var calledConstructor = SuperClass.prototype.constructor;
|
540 |
-
|
541 |
-
if (argCount > 0) {
|
542 |
-
unshift.call(arguments, SuperClass.prototype.constructor);
|
543 |
-
|
544 |
-
calledConstructor = DecoratorClass.prototype.constructor;
|
545 |
-
}
|
546 |
-
|
547 |
-
calledConstructor.apply(this, arguments);
|
548 |
-
}
|
549 |
-
|
550 |
-
DecoratorClass.displayName = SuperClass.displayName;
|
551 |
-
|
552 |
-
function ctr () {
|
553 |
-
this.constructor = DecoratedClass;
|
554 |
-
}
|
555 |
-
|
556 |
-
DecoratedClass.prototype = new ctr();
|
557 |
-
|
558 |
-
for (var m = 0; m < superMethods.length; m++) {
|
559 |
-
var superMethod = superMethods[m];
|
560 |
-
|
561 |
-
DecoratedClass.prototype[superMethod] =
|
562 |
-
SuperClass.prototype[superMethod];
|
563 |
-
}
|
564 |
-
|
565 |
-
var calledMethod = function (methodName) {
|
566 |
-
// Stub out the original method if it's not decorating an actual method
|
567 |
-
var originalMethod = function () {};
|
568 |
-
|
569 |
-
if (methodName in DecoratedClass.prototype) {
|
570 |
-
originalMethod = DecoratedClass.prototype[methodName];
|
571 |
-
}
|
572 |
-
|
573 |
-
var decoratedMethod = DecoratorClass.prototype[methodName];
|
574 |
-
|
575 |
-
return function () {
|
576 |
-
var unshift = Array.prototype.unshift;
|
577 |
-
|
578 |
-
unshift.call(arguments, originalMethod);
|
579 |
-
|
580 |
-
return decoratedMethod.apply(this, arguments);
|
581 |
-
};
|
582 |
-
};
|
583 |
-
|
584 |
-
for (var d = 0; d < decoratedMethods.length; d++) {
|
585 |
-
var decoratedMethod = decoratedMethods[d];
|
586 |
-
|
587 |
-
DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
|
588 |
-
}
|
589 |
-
|
590 |
-
return DecoratedClass;
|
591 |
-
};
|
592 |
-
|
593 |
-
var Observable = function () {
|
594 |
-
this.listeners = {};
|
595 |
-
};
|
596 |
-
|
597 |
-
Observable.prototype.on = function (event, callback) {
|
598 |
-
this.listeners = this.listeners || {};
|
599 |
-
|
600 |
-
if (event in this.listeners) {
|
601 |
-
this.listeners[event].push(callback);
|
602 |
-
} else {
|
603 |
-
this.listeners[event] = [callback];
|
604 |
-
}
|
605 |
-
};
|
606 |
-
|
607 |
-
Observable.prototype.trigger = function (event) {
|
608 |
-
var slice = Array.prototype.slice;
|
609 |
-
var params = slice.call(arguments, 1);
|
610 |
-
|
611 |
-
this.listeners = this.listeners || {};
|
612 |
-
|
613 |
-
// Params should always come in as an array
|
614 |
-
if (params == null) {
|
615 |
-
params = [];
|
616 |
-
}
|
617 |
-
|
618 |
-
// If there are no arguments to the event, use a temporary object
|
619 |
-
if (params.length === 0) {
|
620 |
-
params.push({});
|
621 |
-
}
|
622 |
-
|
623 |
-
// Set the `_type` of the first object to the event
|
624 |
-
params[0]._type = event;
|
625 |
-
|
626 |
-
if (event in this.listeners) {
|
627 |
-
this.invoke(this.listeners[event], slice.call(arguments, 1));
|
628 |
-
}
|
629 |
-
|
630 |
-
if ('*' in this.listeners) {
|
631 |
-
this.invoke(this.listeners['*'], arguments);
|
632 |
-
}
|
633 |
-
};
|
634 |
-
|
635 |
-
Observable.prototype.invoke = function (listeners, params) {
|
636 |
-
for (var i = 0, len = listeners.length; i < len; i++) {
|
637 |
-
listeners[i].apply(this, params);
|
638 |
-
}
|
639 |
-
};
|
640 |
-
|
641 |
-
Utils.Observable = Observable;
|
642 |
-
|
643 |
-
Utils.generateChars = function (length) {
|
644 |
-
var chars = '';
|
645 |
-
|
646 |
-
for (var i = 0; i < length; i++) {
|
647 |
-
var randomChar = Math.floor(Math.random() * 36);
|
648 |
-
chars += randomChar.toString(36);
|
649 |
-
}
|
650 |
-
|
651 |
-
return chars;
|
652 |
-
};
|
653 |
-
|
654 |
-
Utils.bind = function (func, context) {
|
655 |
-
return function () {
|
656 |
-
func.apply(context, arguments);
|
657 |
-
};
|
658 |
-
};
|
659 |
-
|
660 |
-
Utils._convertData = function (data) {
|
661 |
-
for (var originalKey in data) {
|
662 |
-
var keys = originalKey.split('-');
|
663 |
-
|
664 |
-
var dataLevel = data;
|
665 |
-
|
666 |
-
if (keys.length === 1) {
|
667 |
-
continue;
|
668 |
-
}
|
669 |
-
|
670 |
-
for (var k = 0; k < keys.length; k++) {
|
671 |
-
var key = keys[k];
|
672 |
-
|
673 |
-
// Lowercase the first letter
|
674 |
-
// By default, dash-separated becomes camelCase
|
675 |
-
key = key.substring(0, 1).toLowerCase() + key.substring(1);
|
676 |
-
|
677 |
-
if (!(key in dataLevel)) {
|
678 |
-
dataLevel[key] = {};
|
679 |
-
}
|
680 |
-
|
681 |
-
if (k == keys.length - 1) {
|
682 |
-
dataLevel[key] = data[originalKey];
|
683 |
-
}
|
684 |
-
|
685 |
-
dataLevel = dataLevel[key];
|
686 |
-
}
|
687 |
-
|
688 |
-
delete data[originalKey];
|
689 |
-
}
|
690 |
-
|
691 |
-
return data;
|
692 |
-
};
|
693 |
-
|
694 |
-
Utils.hasScroll = function (index, el) {
|
695 |
-
// Adapted from the function created by @ShadowScripter
|
696 |
-
// and adapted by @BillBarry on the Stack Exchange Code Review website.
|
697 |
-
// The original code can be found at
|
698 |
-
// http://codereview.stackexchange.com/q/13338
|
699 |
-
// and was designed to be used with the Sizzle selector engine.
|
700 |
-
|
701 |
-
var $el = $(el);
|
702 |
-
var overflowX = el.style.overflowX;
|
703 |
-
var overflowY = el.style.overflowY;
|
704 |
-
|
705 |
-
//Check both x and y declarations
|
706 |
-
if (overflowX === overflowY &&
|
707 |
-
(overflowY === 'hidden' || overflowY === 'visible')) {
|
708 |
-
return false;
|
709 |
-
}
|
710 |
-
|
711 |
-
if (overflowX === 'scroll' || overflowY === 'scroll') {
|
712 |
-
return true;
|
713 |
-
}
|
714 |
-
|
715 |
-
return ($el.innerHeight() < el.scrollHeight ||
|
716 |
-
$el.innerWidth() < el.scrollWidth);
|
717 |
-
};
|
718 |
-
|
719 |
-
Utils.escapeMarkup = function (markup) {
|
720 |
-
var replaceMap = {
|
721 |
-
'\\': '\',
|
722 |
-
'&': '&',
|
723 |
-
'<': '<',
|
724 |
-
'>': '>',
|
725 |
-
'"': '"',
|
726 |
-
'\'': ''',
|
727 |
-
'/': '/'
|
728 |
-
};
|
729 |
-
|
730 |
-
// Do not try to escape the markup if it's not a string
|
731 |
-
if (typeof markup !== 'string') {
|
732 |
-
return markup;
|
733 |
-
}
|
734 |
-
|
735 |
-
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
|
736 |
-
return replaceMap[match];
|
737 |
-
});
|
738 |
-
};
|
739 |
-
|
740 |
-
// Append an array of jQuery nodes to a given element.
|
741 |
-
Utils.appendMany = function ($element, $nodes) {
|
742 |
-
// jQuery 1.7.x does not support $.fn.append() with an array
|
743 |
-
// Fall back to a jQuery object collection using $.fn.add()
|
744 |
-
if ($.fn.jquery.substr(0, 3) === '1.7') {
|
745 |
-
var $jqNodes = $();
|
746 |
-
|
747 |
-
$.map($nodes, function (node) {
|
748 |
-
$jqNodes = $jqNodes.add(node);
|
749 |
-
});
|
750 |
-
|
751 |
-
$nodes = $jqNodes;
|
752 |
-
}
|
753 |
-
|
754 |
-
$element.append($nodes);
|
755 |
-
};
|
756 |
-
|
757 |
-
return Utils;
|
758 |
-
});
|
759 |
-
|
760 |
-
S2.define('select2/results',[
|
761 |
-
'jquery',
|
762 |
-
'./utils'
|
763 |
-
], function ($, Utils) {
|
764 |
-
function Results ($element, options, dataAdapter) {
|
765 |
-
this.$element = $element;
|
766 |
-
this.data = dataAdapter;
|
767 |
-
this.options = options;
|
768 |
-
|
769 |
-
Results.__super__.constructor.call(this);
|
770 |
-
}
|
771 |
-
|
772 |
-
Utils.Extend(Results, Utils.Observable);
|
773 |
-
|
774 |
-
Results.prototype.render = function () {
|
775 |
-
var $results = $(
|
776 |
-
'<ul class="select2-results__options" role="tree"></ul>'
|
777 |
-
);
|
778 |
-
|
779 |
-
if (this.options.get('multiple')) {
|
780 |
-
$results.attr('aria-multiselectable', 'true');
|
781 |
-
}
|
782 |
-
|
783 |
-
this.$results = $results;
|
784 |
-
|
785 |
-
return $results;
|
786 |
-
};
|
787 |
-
|
788 |
-
Results.prototype.clear = function () {
|
789 |
-
this.$results.empty();
|
790 |
-
};
|
791 |
-
|
792 |
-
Results.prototype.displayMessage = function (params) {
|
793 |
-
var escapeMarkup = this.options.get('escapeMarkup');
|
794 |
-
|
795 |
-
this.clear();
|
796 |
-
this.hideLoading();
|
797 |
-
|
798 |
-
var $message = $(
|
799 |
-
'<li role="treeitem" aria-live="assertive"' +
|
800 |
-
' class="select2-results__option"></li>'
|
801 |
-
);
|
802 |
-
|
803 |
-
var message = this.options.get('translations').get(params.message);
|
804 |
-
|
805 |
-
$message.append(
|
806 |
-
escapeMarkup(
|
807 |
-
message(params.args)
|
808 |
-
)
|
809 |
-
);
|
810 |
-
|
811 |
-
$message[0].className += ' select2-results__message';
|
812 |
-
|
813 |
-
this.$results.append($message);
|
814 |
-
};
|
815 |
-
|
816 |
-
Results.prototype.hideMessages = function () {
|
817 |
-
this.$results.find('.select2-results__message').remove();
|
818 |
-
};
|
819 |
-
|
820 |
-
Results.prototype.append = function (data) {
|
821 |
-
this.hideLoading();
|
822 |
-
|
823 |
-
var $options = [];
|
824 |
-
|
825 |
-
if (data.results == null || data.results.length === 0) {
|
826 |
-
if (this.$results.children().length === 0) {
|
827 |
-
this.trigger('results:message', {
|
828 |
-
message: 'noResults'
|
829 |
-
});
|
830 |
-
}
|
831 |
-
|
832 |
-
return;
|
833 |
-
}
|
834 |
-
|
835 |
-
data.results = this.sort(data.results);
|
836 |
-
|
837 |
-
for (var d = 0; d < data.results.length; d++) {
|
838 |
-
var item = data.results[d];
|
839 |
-
|
840 |
-
var $option = this.option(item);
|
841 |
-
|
842 |
-
$options.push($option);
|
843 |
-
}
|
844 |
-
|
845 |
-
this.$results.append($options);
|
846 |
-
};
|
847 |
-
|
848 |
-
Results.prototype.position = function ($results, $dropdown) {
|
849 |
-
var $resultsContainer = $dropdown.find('.select2-results');
|
850 |
-
$resultsContainer.append($results);
|
851 |
-
};
|
852 |
-
|
853 |
-
Results.prototype.sort = function (data) {
|
854 |
-
var sorter = this.options.get('sorter');
|
855 |
-
|
856 |
-
return sorter(data);
|
857 |
-
};
|
858 |
-
|
859 |
-
Results.prototype.highlightFirstItem = function () {
|
860 |
-
var $options = this.$results
|
861 |
-
.find('.select2-results__option[aria-selected]');
|
862 |
-
|
863 |
-
var $selected = $options.filter('[aria-selected=true]');
|
864 |
-
|
865 |
-
// Check if there are any selected options
|
866 |
-
if ($selected.length > 0) {
|
867 |
-
// If there are selected options, highlight the first
|
868 |
-
$selected.first().trigger('mouseenter');
|
869 |
-
} else {
|
870 |
-
// If there are no selected options, highlight the first option
|
871 |
-
// in the dropdown
|
872 |
-
$options.first().trigger('mouseenter');
|
873 |
-
}
|
874 |
-
|
875 |
-
this.ensureHighlightVisible();
|
876 |
-
};
|
877 |
-
|
878 |
-
Results.prototype.setClasses = function () {
|
879 |
-
var self = this;
|
880 |
-
|
881 |
-
this.data.current(function (selected) {
|
882 |
-
var selectedIds = $.map(selected, function (s) {
|
883 |
-
return s.id.toString();
|
884 |
-
});
|
885 |
-
|
886 |
-
var $options = self.$results
|
887 |
-
.find('.select2-results__option[aria-selected]');
|
888 |
-
|
889 |
-
$options.each(function () {
|
890 |
-
var $option = $(this);
|
891 |
-
|
892 |
-
var item = $.data(this, 'data');
|
893 |
-
|
894 |
-
// id needs to be converted to a string when comparing
|
895 |
-
var id = '' + item.id;
|
896 |
-
|
897 |
-
if ((item.element != null && item.element.selected) ||
|
898 |
-
(item.element == null && $.inArray(id, selectedIds) > -1)) {
|
899 |
-
$option.attr('aria-selected', 'true');
|
900 |
-
} else {
|
901 |
-
$option.attr('aria-selected', 'false');
|
902 |
-
}
|
903 |
-
});
|
904 |
-
|
905 |
-
});
|
906 |
-
};
|
907 |
-
|
908 |
-
Results.prototype.showLoading = function (params) {
|
909 |
-
this.hideLoading();
|
910 |
-
|
911 |
-
var loadingMore = this.options.get('translations').get('searching');
|
912 |
-
|
913 |
-
var loading = {
|
914 |
-
disabled: true,
|
915 |
-
loading: true,
|
916 |
-
text: loadingMore(params)
|
917 |
-
};
|
918 |
-
var $loading = this.option(loading);
|
919 |
-
$loading.className += ' loading-results';
|
920 |
-
|
921 |
-
this.$results.prepend($loading);
|
922 |
-
};
|
923 |
-
|
924 |
-
Results.prototype.hideLoading = function () {
|
925 |
-
this.$results.find('.loading-results').remove();
|
926 |
-
};
|
927 |
-
|
928 |
-
Results.prototype.option = function (data) {
|
929 |
-
var option = document.createElement('li');
|
930 |
-
option.className = 'select2-results__option';
|
931 |
-
|
932 |
-
var attrs = {
|
933 |
-
'role': 'treeitem',
|
934 |
-
'aria-selected': 'false'
|
935 |
-
};
|
936 |
-
|
937 |
-
if (data.disabled) {
|
938 |
-
delete attrs['aria-selected'];
|
939 |
-
attrs['aria-disabled'] = 'true';
|
940 |
-
}
|
941 |
-
|
942 |
-
if (data.id == null) {
|
943 |
-
delete attrs['aria-selected'];
|
944 |
-
}
|
945 |
-
|
946 |
-
if (data._resultId != null) {
|
947 |
-
option.id = data._resultId;
|
948 |
-
}
|
949 |
-
|
950 |
-
if (data.title) {
|
951 |
-
option.title = data.title;
|
952 |
-
}
|
953 |
-
|
954 |
-
if (data.children) {
|
955 |
-
attrs.role = 'group';
|
956 |
-
attrs['aria-label'] = data.text;
|
957 |
-
delete attrs['aria-selected'];
|
958 |
-
}
|
959 |
-
|
960 |
-
for (var attr in attrs) {
|
961 |
-
var val = attrs[attr];
|
962 |
-
|
963 |
-
option.setAttribute(attr, val);
|
964 |
-
}
|
965 |
-
|
966 |
-
if (data.children) {
|
967 |
-
var $option = $(option);
|
968 |
-
|
969 |
-
var label = document.createElement('strong');
|
970 |
-
label.className = 'select2-results__group';
|
971 |
-
|
972 |
-
var $label = $(label);
|
973 |
-
this.template(data, label);
|
974 |
-
|
975 |
-
var $children = [];
|
976 |
-
|
977 |
-
for (var c = 0; c < data.children.length; c++) {
|
978 |
-
var child = data.children[c];
|
979 |
-
|
980 |
-
var $child = this.option(child);
|
981 |
-
|
982 |
-
$children.push($child);
|
983 |
-
}
|
984 |
-
|
985 |
-
var $childrenContainer = $('<ul></ul>', {
|
986 |
-
'class': 'select2-results__options select2-results__options--nested'
|
987 |
-
});
|
988 |
-
|
989 |
-
$childrenContainer.append($children);
|
990 |
-
|
991 |
-
$option.append(label);
|
992 |
-
$option.append($childrenContainer);
|
993 |
-
} else {
|
994 |
-
this.template(data, option);
|
995 |
-
}
|
996 |
-
|
997 |
-
$.data(option, 'data', data);
|
998 |
-
|
999 |
-
return option;
|
1000 |
-
};
|
1001 |
-
|
1002 |
-
Results.prototype.bind = function (container, $container) {
|
1003 |
-
var self = this;
|
1004 |
-
|
1005 |
-
var id = container.id + '-results';
|
1006 |
-
|
1007 |
-
this.$results.attr('id', id);
|
1008 |
-
|
1009 |
-
container.on('results:all', function (params) {
|
1010 |
-
self.clear();
|
1011 |
-
self.append(params.data);
|
1012 |
-
|
1013 |
-
if (container.isOpen()) {
|
1014 |
-
self.setClasses();
|
1015 |
-
self.highlightFirstItem();
|
1016 |
-
}
|
1017 |
-
});
|
1018 |
-
|
1019 |
-
container.on('results:append', function (params) {
|
1020 |
-
self.append(params.data);
|
1021 |
-
|
1022 |
-
if (container.isOpen()) {
|
1023 |
-
self.setClasses();
|
1024 |
-
}
|
1025 |
-
});
|
1026 |
-
|
1027 |
-
container.on('query', function (params) {
|
1028 |
-
self.hideMessages();
|
1029 |
-
self.showLoading(params);
|
1030 |
-
});
|
1031 |
-
|
1032 |
-
container.on('select', function () {
|
1033 |
-
if (!container.isOpen()) {
|
1034 |
-
return;
|
1035 |
-
}
|
1036 |
-
|
1037 |
-
self.setClasses();
|
1038 |
-
self.highlightFirstItem();
|
1039 |
-
});
|
1040 |
-
|
1041 |
-
container.on('unselect', function () {
|
1042 |
-
if (!container.isOpen()) {
|
1043 |
-
return;
|
1044 |
-
}
|
1045 |
-
|
1046 |
-
self.setClasses();
|
1047 |
-
self.highlightFirstItem();
|
1048 |
-
});
|
1049 |
-
|
1050 |
-
container.on('open', function () {
|
1051 |
-
// When the dropdown is open, aria-expended="true"
|
1052 |
-
self.$results.attr('aria-expanded', 'true');
|
1053 |
-
self.$results.attr('aria-hidden', 'false');
|
1054 |
-
|
1055 |
-
self.setClasses();
|
1056 |
-
self.ensureHighlightVisible();
|
1057 |
-
});
|
1058 |
-
|
1059 |
-
container.on('close', function () {
|
1060 |
-
// When the dropdown is closed, aria-expended="false"
|
1061 |
-
self.$results.attr('aria-expanded', 'false');
|
1062 |
-
self.$results.attr('aria-hidden', 'true');
|
1063 |
-
self.$results.removeAttr('aria-activedescendant');
|
1064 |
-
});
|
1065 |
-
|
1066 |
-
container.on('results:toggle', function () {
|
1067 |
-
var $highlighted = self.getHighlightedResults();
|
1068 |
-
|
1069 |
-
if ($highlighted.length === 0) {
|
1070 |
-
return;
|
1071 |
-
}
|
1072 |
-
|
1073 |
-
$highlighted.trigger('mouseup');
|
1074 |
-
});
|
1075 |
-
|
1076 |
-
container.on('results:select', function () {
|
1077 |
-
var $highlighted = self.getHighlightedResults();
|
1078 |
-
|
1079 |
-
if ($highlighted.length === 0) {
|
1080 |
-
return;
|
1081 |
-
}
|
1082 |
-
|
1083 |
-
var data = $highlighted.data('data');
|
1084 |
-
|
1085 |
-
if ($highlighted.attr('aria-selected') == 'true') {
|
1086 |
-
self.trigger('close', {});
|
1087 |
-
} else {
|
1088 |
-
self.trigger('select', {
|
1089 |
-
data: data
|
1090 |
-
});
|
1091 |
-
}
|
1092 |
-
});
|
1093 |
-
|
1094 |
-
container.on('results:previous', function () {
|
1095 |
-
var $highlighted = self.getHighlightedResults();
|
1096 |
-
|
1097 |
-
var $options = self.$results.find('[aria-selected]');
|
1098 |
-
|
1099 |
-
var currentIndex = $options.index($highlighted);
|
1100 |
-
|
1101 |
-
// If we are already at te top, don't move further
|
1102 |
-
if (currentIndex === 0) {
|
1103 |
-
return;
|
1104 |
-
}
|
1105 |
-
|
1106 |
-
var nextIndex = currentIndex - 1;
|
1107 |
-
|
1108 |
-
// If none are highlighted, highlight the first
|
1109 |
-
if ($highlighted.length === 0) {
|
1110 |
-
nextIndex = 0;
|
1111 |
-
}
|
1112 |
-
|
1113 |
-
var $next = $options.eq(nextIndex);
|
1114 |
-
|
1115 |
-
$next.trigger('mouseenter');
|
1116 |
-
|
1117 |
-
var currentOffset = self.$results.offset().top;
|
1118 |
-
var nextTop = $next.offset().top;
|
1119 |
-
var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
|
1120 |
-
|
1121 |
-
if (nextIndex === 0) {
|
1122 |
-
self.$results.scrollTop(0);
|
1123 |
-
} else if (nextTop - currentOffset < 0) {
|
1124 |
-
self.$results.scrollTop(nextOffset);
|
1125 |
-
}
|
1126 |
-
});
|
1127 |
-
|
1128 |
-
container.on('results:next', function () {
|
1129 |
-
var $highlighted = self.getHighlightedResults();
|
1130 |
-
|
1131 |
-
var $options = self.$results.find('[aria-selected]');
|
1132 |
-
|
1133 |
-
var currentIndex = $options.index($highlighted);
|
1134 |
-
|
1135 |
-
var nextIndex = currentIndex + 1;
|
1136 |
-
|
1137 |
-
// If we are at the last option, stay there
|
1138 |
-
if (nextIndex >= $options.length) {
|
1139 |
-
return;
|
1140 |
-
}
|
1141 |
-
|
1142 |
-
var $next = $options.eq(nextIndex);
|
1143 |
-
|
1144 |
-
$next.trigger('mouseenter');
|
1145 |
-
|
1146 |
-
var currentOffset = self.$results.offset().top +
|
1147 |
-
self.$results.outerHeight(false);
|
1148 |
-
var nextBottom = $next.offset().top + $next.outerHeight(false);
|
1149 |
-
var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
|
1150 |
-
|
1151 |
-
if (nextIndex === 0) {
|
1152 |
-
self.$results.scrollTop(0);
|
1153 |
-
} else if (nextBottom > currentOffset) {
|
1154 |
-
self.$results.scrollTop(nextOffset);
|
1155 |
-
}
|
1156 |
-
});
|
1157 |
-
|
1158 |
-
container.on('results:focus', function (params) {
|
1159 |
-
params.element.addClass('select2-results__option--highlighted');
|
1160 |
-
});
|
1161 |
-
|
1162 |
-
container.on('results:message', function (params) {
|
1163 |
-
self.displayMessage(params);
|
1164 |
-
});
|
1165 |
-
|
1166 |
-
if ($.fn.mousewheel) {
|
1167 |
-
this.$results.on('mousewheel', function (e) {
|
1168 |
-
var top = self.$results.scrollTop();
|
1169 |
-
|
1170 |
-
var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
|
1171 |
-
|
1172 |
-
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
|
1173 |
-
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
|
1174 |
-
|
1175 |
-
if (isAtTop) {
|
1176 |
-
self.$results.scrollTop(0);
|
1177 |
-
|
1178 |
-
e.preventDefault();
|
1179 |
-
e.stopPropagation();
|
1180 |
-
} else if (isAtBottom) {
|
1181 |
-
self.$results.scrollTop(
|
1182 |
-
self.$results.get(0).scrollHeight - self.$results.height()
|
1183 |
-
);
|
1184 |
-
|
1185 |
-
e.preventDefault();
|
1186 |
-
e.stopPropagation();
|
1187 |
-
}
|
1188 |
-
});
|
1189 |
-
}
|
1190 |
-
|
1191 |
-
this.$results.on('mouseup', '.select2-results__option[aria-selected]',
|
1192 |
-
function (evt) {
|
1193 |
-
var $this = $(this);
|
1194 |
-
|
1195 |
-
var data = $this.data('data');
|
1196 |
-
|
1197 |
-
if ($this.attr('aria-selected') === 'true') {
|
1198 |
-
if (self.options.get('multiple')) {
|
1199 |
-
self.trigger('unselect', {
|
1200 |
-
originalEvent: evt,
|
1201 |
-
data: data
|
1202 |
-
});
|
1203 |
-
} else {
|
1204 |
-
self.trigger('close', {});
|
1205 |
-
}
|
1206 |
-
|
1207 |
-
return;
|
1208 |
-
}
|
1209 |
-
|
1210 |
-
self.trigger('select', {
|
1211 |
-
originalEvent: evt,
|
1212 |
-
data: data
|
1213 |
-
});
|
1214 |
-
});
|
1215 |
-
|
1216 |
-
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
|
1217 |
-
function (evt) {
|
1218 |
-
var data = $(this).data('data');
|
1219 |
-
|
1220 |
-
self.getHighlightedResults()
|
1221 |
-
.removeClass('select2-results__option--highlighted');
|
1222 |
-
|
1223 |
-
self.trigger('results:focus', {
|
1224 |
-
data: data,
|
1225 |
-
element: $(this)
|
1226 |
-
});
|
1227 |
-
});
|
1228 |
-
};
|
1229 |
-
|
1230 |
-
Results.prototype.getHighlightedResults = function () {
|
1231 |
-
var $highlighted = this.$results
|
1232 |
-
.find('.select2-results__option--highlighted');
|
1233 |
-
|
1234 |
-
return $highlighted;
|
1235 |
-
};
|
1236 |
-
|
1237 |
-
Results.prototype.destroy = function () {
|
1238 |
-
this.$results.remove();
|
1239 |
-
};
|
1240 |
-
|
1241 |
-
Results.prototype.ensureHighlightVisible = function () {
|
1242 |
-
var $highlighted = this.getHighlightedResults();
|
1243 |
-
|
1244 |
-
if ($highlighted.length === 0) {
|
1245 |
-
return;
|
1246 |
-
}
|
1247 |
-
|
1248 |
-
var $options = this.$results.find('[aria-selected]');
|
1249 |
-
|
1250 |
-
var currentIndex = $options.index($highlighted);
|
1251 |
-
|
1252 |
-
var currentOffset = this.$results.offset().top;
|
1253 |
-
var nextTop = $highlighted.offset().top;
|
1254 |
-
var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
|
1255 |
-
|
1256 |
-
var offsetDelta = nextTop - currentOffset;
|
1257 |
-
nextOffset -= $highlighted.outerHeight(false) * 2;
|
1258 |
-
|
1259 |
-
if (currentIndex <= 2) {
|
1260 |
-
this.$results.scrollTop(0);
|
1261 |
-
} else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
|
1262 |
-
this.$results.scrollTop(nextOffset);
|
1263 |
-
}
|
1264 |
-
};
|
1265 |
-
|
1266 |
-
Results.prototype.template = function (result, container) {
|
1267 |
-
var template = this.options.get('templateResult');
|
1268 |
-
var escapeMarkup = this.options.get('escapeMarkup');
|
1269 |
-
|
1270 |
-
var content = template(result, container);
|
1271 |
-
|
1272 |
-
if (content == null) {
|
1273 |
-
container.style.display = 'none';
|
1274 |
-
} else if (typeof content === 'string') {
|
1275 |
-
container.innerHTML = escapeMarkup(content);
|
1276 |
-
} else {
|
1277 |
-
$(container).append(content);
|
1278 |
-
}
|
1279 |
-
};
|
1280 |
-
|
1281 |
-
return Results;
|
1282 |
-
});
|
1283 |
-
|
1284 |
-
S2.define('select2/keys',[
|
1285 |
-
|
1286 |
-
], function () {
|
1287 |
-
var KEYS = {
|
1288 |
-
BACKSPACE: 8,
|
1289 |
-
TAB: 9,
|
1290 |
-
ENTER: 13,
|
1291 |
-
SHIFT: 16,
|
1292 |
-
CTRL: 17,
|
1293 |
-
ALT: 18,
|
1294 |
-
ESC: 27,
|
1295 |
-
SPACE: 32,
|
1296 |
-
PAGE_UP: 33,
|
1297 |
-
PAGE_DOWN: 34,
|
1298 |
-
END: 35,
|
1299 |
-
HOME: 36,
|
1300 |
-
LEFT: 37,
|
1301 |
-
UP: 38,
|
1302 |
-
RIGHT: 39,
|
1303 |
-
DOWN: 40,
|
1304 |
-
DELETE: 46
|
1305 |
-
};
|
1306 |
-
|
1307 |
-
return KEYS;
|
1308 |
-
});
|
1309 |
-
|
1310 |
-
S2.define('select2/selection/base',[
|
1311 |
-
'jquery',
|
1312 |
-
'../utils',
|
1313 |
-
'../keys'
|
1314 |
-
], function ($, Utils, KEYS) {
|
1315 |
-
function BaseSelection ($element, options) {
|
1316 |
-
this.$element = $element;
|
1317 |
-
this.options = options;
|
1318 |
-
|
1319 |
-
BaseSelection.__super__.constructor.call(this);
|
1320 |
-
}
|
1321 |
-
|
1322 |
-
Utils.Extend(BaseSelection, Utils.Observable);
|
1323 |
-
|
1324 |
-
BaseSelection.prototype.render = function () {
|
1325 |
-
var $selection = $(
|
1326 |
-
'<span class="select2-selection" role="combobox" ' +
|
1327 |
-
' aria-haspopup="true" aria-expanded="false">' +
|
1328 |
-
'</span>'
|
1329 |
-
);
|
1330 |
-
|
1331 |
-
this._tabindex = 0;
|
1332 |
-
|
1333 |
-
if (this.$element.data('old-tabindex') != null) {
|
1334 |
-
this._tabindex = this.$element.data('old-tabindex');
|
1335 |
-
} else if (this.$element.attr('tabindex') != null) {
|
1336 |
-
this._tabindex = this.$element.attr('tabindex');
|
1337 |
-
}
|
1338 |
-
|
1339 |
-
$selection.attr('title', this.$element.attr('title'));
|
1340 |
-
$selection.attr('tabindex', this._tabindex);
|
1341 |
-
|
1342 |
-
this.$selection = $selection;
|
1343 |
-
|
1344 |
-
return $selection;
|
1345 |
-
};
|
1346 |
-
|
1347 |
-
BaseSelection.prototype.bind = function (container, $container) {
|
1348 |
-
var self = this;
|
1349 |
-
|
1350 |
-
var id = container.id + '-container';
|
1351 |
-
var resultsId = container.id + '-results';
|
1352 |
-
|
1353 |
-
this.container = container;
|
1354 |
-
|
1355 |
-
this.$selection.on('focus', function (evt) {
|
1356 |
-
self.trigger('focus', evt);
|
1357 |
-
});
|
1358 |
-
|
1359 |
-
this.$selection.on('blur', function (evt) {
|
1360 |
-
self._handleBlur(evt);
|
1361 |
-
});
|
1362 |
-
|
1363 |
-
this.$selection.on('keydown', function (evt) {
|
1364 |
-
self.trigger('keypress', evt);
|
1365 |
-
|
1366 |
-
if (evt.which === KEYS.SPACE) {
|
1367 |
-
evt.preventDefault();
|
1368 |
-
}
|
1369 |
-
});
|
1370 |
-
|
1371 |
-
container.on('results:focus', function (params) {
|
1372 |
-
self.$selection.attr('aria-activedescendant', params.data._resultId);
|
1373 |
-
});
|
1374 |
-
|
1375 |
-
container.on('selection:update', function (params) {
|
1376 |
-
self.update(params.data);
|
1377 |
-
});
|
1378 |
-
|
1379 |
-
container.on('open', function () {
|
1380 |
-
// When the dropdown is open, aria-expanded="true"
|
1381 |
-
self.$selection.attr('aria-expanded', 'true');
|
1382 |
-
self.$selection.attr('aria-owns', resultsId);
|
1383 |
-
|
1384 |
-
self._attachCloseHandler(container);
|
1385 |
-
});
|
1386 |
-
|
1387 |
-
container.on('close', function () {
|
1388 |
-
// When the dropdown is closed, aria-expanded="false"
|
1389 |
-
self.$selection.attr('aria-expanded', 'false');
|
1390 |
-
self.$selection.removeAttr('aria-activedescendant');
|
1391 |
-
self.$selection.removeAttr('aria-owns');
|
1392 |
-
|
1393 |
-
self.$selection.focus();
|
1394 |
-
|
1395 |
-
self._detachCloseHandler(container);
|
1396 |
-
});
|
1397 |
-
|
1398 |
-
container.on('enable', function () {
|
1399 |
-
self.$selection.attr('tabindex', self._tabindex);
|
1400 |
-
});
|
1401 |
-
|
1402 |
-
container.on('disable', function () {
|
1403 |
-
self.$selection.attr('tabindex', '-1');
|
1404 |
-
});
|
1405 |
-
};
|
1406 |
-
|
1407 |
-
BaseSelection.prototype._handleBlur = function (evt) {
|
1408 |
-
var self = this;
|
1409 |
-
|
1410 |
-
// This needs to be delayed as the active element is the body when the tab
|
1411 |
-
// key is pressed, possibly along with others.
|
1412 |
-
window.setTimeout(function () {
|
1413 |
-
// Don't trigger `blur` if the focus is still in the selection
|
1414 |
-
if (
|
1415 |
-
(document.activeElement == self.$selection[0]) ||
|
1416 |
-
($.contains(self.$selection[0], document.activeElement))
|
1417 |
-
) {
|
1418 |
-
return;
|
1419 |
-
}
|
1420 |
-
|
1421 |
-
self.trigger('blur', evt);
|
1422 |
-
}, 1);
|
1423 |
-
};
|
1424 |
-
|
1425 |
-
BaseSelection.prototype._attachCloseHandler = function (container) {
|
1426 |
-
var self = this;
|
1427 |
-
|
1428 |
-
$(document.body).on('mousedown.select2.' + container.id, function (e) {
|
1429 |
-
var $target = $(e.target);
|
1430 |
-
|
1431 |
-
var $select = $target.closest('.select2');
|
1432 |
-
|
1433 |
-
var $all = $('.select2.select2-container--open');
|
1434 |
-
|
1435 |
-
$all.each(function () {
|
1436 |
-
var $this = $(this);
|
1437 |
-
|
1438 |
-
if (this == $select[0]) {
|
1439 |
-
return;
|
1440 |
-
}
|
1441 |
-
|
1442 |
-
var $element = $this.data('element');
|
1443 |
-
|
1444 |
-
$element.select2('close');
|
1445 |
-
});
|
1446 |
-
});
|
1447 |
-
};
|
1448 |
-
|
1449 |
-
BaseSelection.prototype._detachCloseHandler = function (container) {
|
1450 |
-
$(document.body).off('mousedown.select2.' + container.id);
|
1451 |
-
};
|
1452 |
-
|
1453 |
-
BaseSelection.prototype.position = function ($selection, $container) {
|
1454 |
-
var $selectionContainer = $container.find('.selection');
|
1455 |
-
$selectionContainer.append($selection);
|
1456 |
-
};
|
1457 |
-
|
1458 |
-
BaseSelection.prototype.destroy = function () {
|
1459 |
-
this._detachCloseHandler(this.container);
|
1460 |
-
};
|
1461 |
-
|
1462 |
-
BaseSelection.prototype.update = function (data) {
|
1463 |
-
throw new Error('The `update` method must be defined in child classes.');
|
1464 |
-
};
|
1465 |
-
|
1466 |
-
return BaseSelection;
|
1467 |
-
});
|
1468 |
-
|
1469 |
-
S2.define('select2/selection/single',[
|
1470 |
-
'jquery',
|
1471 |
-
'./base',
|
1472 |
-
'../utils',
|
1473 |
-
'../keys'
|
1474 |
-
], function ($, BaseSelection, Utils, KEYS) {
|
1475 |
-
function SingleSelection () {
|
1476 |
-
SingleSelection.__super__.constructor.apply(this, arguments);
|
1477 |
-
}
|
1478 |
-
|
1479 |
-
Utils.Extend(SingleSelection, BaseSelection);
|
1480 |
-
|
1481 |
-
SingleSelection.prototype.render = function () {
|
1482 |
-
var $selection = SingleSelection.__super__.render.call(this);
|
1483 |
-
|
1484 |
-
$selection.addClass('select2-selection--single');
|
1485 |
-
|
1486 |
-
$selection.html(
|
1487 |
-
'<span class="select2-selection__rendered"></span>' +
|
1488 |
-
'<span class="select2-selection__arrow" role="presentation">' +
|
1489 |
-
'<b role="presentation"></b>' +
|
1490 |
-
'</span>'
|
1491 |
-
);
|
1492 |
-
|
1493 |
-
return $selection;
|
1494 |
-
};
|
1495 |
-
|
1496 |
-
SingleSelection.prototype.bind = function (container, $container) {
|
1497 |
-
var self = this;
|
1498 |
-
|
1499 |
-
SingleSelection.__super__.bind.apply(this, arguments);
|
1500 |
-
|
1501 |
-
var id = container.id + '-container';
|
1502 |
-
|
1503 |
-
this.$selection.find('.select2-selection__rendered').attr('id', id);
|
1504 |
-
this.$selection.attr('aria-labelledby', id);
|
1505 |
-
|
1506 |
-
this.$selection.on('mousedown', function (evt) {
|
1507 |
-
// Only respond to left clicks
|
1508 |
-
if (evt.which !== 1) {
|
1509 |
-
return;
|
1510 |
-
}
|
1511 |
-
|
1512 |
-
self.trigger('toggle', {
|
1513 |
-
originalEvent: evt
|
1514 |
-
});
|
1515 |
-
});
|
1516 |
-
|
1517 |
-
this.$selection.on('focus', function (evt) {
|
1518 |
-
// User focuses on the container
|
1519 |
-
});
|
1520 |
-
|
1521 |
-
this.$selection.on('blur', function (evt) {
|
1522 |
-
// User exits the container
|
1523 |
-
});
|
1524 |
-
|
1525 |
-
container.on('focus', function (evt) {
|
1526 |
-
if (!container.isOpen()) {
|
1527 |
-
self.$selection.focus();
|
1528 |
-
}
|
1529 |
-
});
|
1530 |
-
|
1531 |
-
container.on('selection:update', function (params) {
|
1532 |
-
self.update(params.data);
|
1533 |
-
});
|
1534 |
-
};
|
1535 |
-
|
1536 |
-
SingleSelection.prototype.clear = function () {
|
1537 |
-
this.$selection.find('.select2-selection__rendered').empty();
|
1538 |
-
};
|
1539 |
-
|
1540 |
-
SingleSelection.prototype.display = function (data, container) {
|
1541 |
-
var template = this.options.get('templateSelection');
|
1542 |
-
var escapeMarkup = this.options.get('escapeMarkup');
|
1543 |
-
|
1544 |
-
return escapeMarkup(template(data, container));
|
1545 |
-
};
|
1546 |
-
|
1547 |
-
SingleSelection.prototype.selectionContainer = function () {
|
1548 |
-
return $('<span></span>');
|
1549 |
-
};
|
1550 |
-
|
1551 |
-
SingleSelection.prototype.update = function (data) {
|
1552 |
-
if (data.length === 0) {
|
1553 |
-
this.clear();
|
1554 |
-
return;
|
1555 |
-
}
|
1556 |
-
|
1557 |
-
var selection = data[0];
|
1558 |
-
|
1559 |
-
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1560 |
-
var formatted = this.display(selection, $rendered);
|
1561 |
-
|
1562 |
-
$rendered.empty().append(formatted);
|
1563 |
-
$rendered.prop('title', selection.title || selection.text);
|
1564 |
-
};
|
1565 |
-
|
1566 |
-
return SingleSelection;
|
1567 |
-
});
|
1568 |
-
|
1569 |
-
S2.define('select2/selection/multiple',[
|
1570 |
-
'jquery',
|
1571 |
-
'./base',
|
1572 |
-
'../utils'
|
1573 |
-
], function ($, BaseSelection, Utils) {
|
1574 |
-
function MultipleSelection ($element, options) {
|
1575 |
-
MultipleSelection.__super__.constructor.apply(this, arguments);
|
1576 |
-
}
|
1577 |
-
|
1578 |
-
Utils.Extend(MultipleSelection, BaseSelection);
|
1579 |
-
|
1580 |
-
MultipleSelection.prototype.render = function () {
|
1581 |
-
var $selection = MultipleSelection.__super__.render.call(this);
|
1582 |
-
|
1583 |
-
$selection.addClass('select2-selection--multiple');
|
1584 |
-
|
1585 |
-
$selection.html(
|
1586 |
-
'<ul class="select2-selection__rendered"></ul>'
|
1587 |
-
);
|
1588 |
-
|
1589 |
-
return $selection;
|
1590 |
-
};
|
1591 |
-
|
1592 |
-
MultipleSelection.prototype.bind = function (container, $container) {
|
1593 |
-
var self = this;
|
1594 |
-
|
1595 |
-
MultipleSelection.__super__.bind.apply(this, arguments);
|
1596 |
-
|
1597 |
-
this.$selection.on('click', function (evt) {
|
1598 |
-
self.trigger('toggle', {
|
1599 |
-
originalEvent: evt
|
1600 |
-
});
|
1601 |
-
});
|
1602 |
-
|
1603 |
-
this.$selection.on(
|
1604 |
-
'click',
|
1605 |
-
'.select2-selection__choice__remove',
|
1606 |
-
function (evt) {
|
1607 |
-
// Ignore the event if it is disabled
|
1608 |
-
if (self.options.get('disabled')) {
|
1609 |
-
return;
|
1610 |
-
}
|
1611 |
-
|
1612 |
-
var $remove = $(this);
|
1613 |
-
var $selection = $remove.parent();
|
1614 |
-
|
1615 |
-
var data = $selection.data('data');
|
1616 |
-
|
1617 |
-
self.trigger('unselect', {
|
1618 |
-
originalEvent: evt,
|
1619 |
-
data: data
|
1620 |
-
});
|
1621 |
-
}
|
1622 |
-
);
|
1623 |
-
};
|
1624 |
-
|
1625 |
-
MultipleSelection.prototype.clear = function () {
|
1626 |
-
this.$selection.find('.select2-selection__rendered').empty();
|
1627 |
-
};
|
1628 |
-
|
1629 |
-
MultipleSelection.prototype.display = function (data, container) {
|
1630 |
-
var template = this.options.get('templateSelection');
|
1631 |
-
var escapeMarkup = this.options.get('escapeMarkup');
|
1632 |
-
|
1633 |
-
return escapeMarkup(template(data, container));
|
1634 |
-
};
|
1635 |
-
|
1636 |
-
MultipleSelection.prototype.selectionContainer = function () {
|
1637 |
-
var $container = $(
|
1638 |
-
'<li class="select2-selection__choice">' +
|
1639 |
-
'<span class="select2-selection__choice__remove" role="presentation">' +
|
1640 |
-
'×' +
|
1641 |
-
'</span>' +
|
1642 |
-
'</li>'
|
1643 |
-
);
|
1644 |
-
|
1645 |
-
return $container;
|
1646 |
-
};
|
1647 |
-
|
1648 |
-
MultipleSelection.prototype.update = function (data) {
|
1649 |
-
this.clear();
|
1650 |
-
|
1651 |
-
if (data.length === 0) {
|
1652 |
-
return;
|
1653 |
-
}
|
1654 |
-
|
1655 |
-
var $selections = [];
|
1656 |
-
|
1657 |
-
for (var d = 0; d < data.length; d++) {
|
1658 |
-
var selection = data[d];
|
1659 |
-
|
1660 |
-
var $selection = this.selectionContainer();
|
1661 |
-
var formatted = this.display(selection, $selection);
|
1662 |
-
|
1663 |
-
$selection.append(formatted);
|
1664 |
-
$selection.prop('title', selection.title || selection.text);
|
1665 |
-
|
1666 |
-
$selection.data('data', selection);
|
1667 |
-
|
1668 |
-
$selections.push($selection);
|
1669 |
-
}
|
1670 |
-
|
1671 |
-
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1672 |
-
|
1673 |
-
Utils.appendMany($rendered, $selections);
|
1674 |
-
};
|
1675 |
-
|
1676 |
-
return MultipleSelection;
|
1677 |
-
});
|
1678 |
-
|
1679 |
-
S2.define('select2/selection/placeholder',[
|
1680 |
-
'../utils'
|
1681 |
-
], function (Utils) {
|
1682 |
-
function Placeholder (decorated, $element, options) {
|
1683 |
-
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
1684 |
-
|
1685 |
-
decorated.call(this, $element, options);
|
1686 |
-
}
|
1687 |
-
|
1688 |
-
Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
1689 |
-
if (typeof placeholder === 'string') {
|
1690 |
-
placeholder = {
|
1691 |
-
id: '',
|
1692 |
-
text: placeholder
|
1693 |
-
};
|
1694 |
-
}
|
1695 |
-
|
1696 |
-
return placeholder;
|
1697 |
-
};
|
1698 |
-
|
1699 |
-
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1700 |
-
var $placeholder = this.selectionContainer();
|
1701 |
-
|
1702 |
-
$placeholder.html(this.display(placeholder));
|
1703 |
-
$placeholder.addClass('select2-selection__placeholder')
|
1704 |
-
.removeClass('select2-selection__choice');
|
1705 |
-
|
1706 |
-
return $placeholder;
|
1707 |
-
};
|
1708 |
-
|
1709 |
-
Placeholder.prototype.update = function (decorated, data) {
|
1710 |
-
var singlePlaceholder = (
|
1711 |
-
data.length == 1 && data[0].id != this.placeholder.id
|
1712 |
-
);
|
1713 |
-
var multipleSelections = data.length > 1;
|
1714 |
-
|
1715 |
-
if (multipleSelections || singlePlaceholder) {
|
1716 |
-
return decorated.call(this, data);
|
1717 |
-
}
|
1718 |
-
|
1719 |
-
this.clear();
|
1720 |
-
|
1721 |
-
var $placeholder = this.createPlaceholder(this.placeholder);
|
1722 |
-
|
1723 |
-
this.$selection.find('.select2-selection__rendered').append($placeholder);
|
1724 |
-
};
|
1725 |
-
|
1726 |
-
return Placeholder;
|
1727 |
-
});
|
1728 |
-
|
1729 |
-
S2.define('select2/selection/allowClear',[
|
1730 |
-
'jquery',
|
1731 |
-
'../keys'
|
1732 |
-
], function ($, KEYS) {
|
1733 |
-
function AllowClear () { }
|
1734 |
-
|
1735 |
-
AllowClear.prototype.bind = function (decorated, container, $container) {
|
1736 |
-
var self = this;
|
1737 |
-
|
1738 |
-
decorated.call(this, container, $container);
|
1739 |
-
|
1740 |
-
if (this.placeholder == null) {
|
1741 |
-
if (this.options.get('debug') && window.console && console.error) {
|
1742 |
-
console.error(
|
1743 |
-
'Select2: The `allowClear` option should be used in combination ' +
|
1744 |
-
'with the `placeholder` option.'
|
1745 |
-
);
|
1746 |
-
}
|
1747 |
-
}
|
1748 |
-
|
1749 |
-
this.$selection.on('mousedown', '.select2-selection__clear',
|
1750 |
-
function (evt) {
|
1751 |
-
self._handleClear(evt);
|
1752 |
-
});
|
1753 |
-
|
1754 |
-
container.on('keypress', function (evt) {
|
1755 |
-
self._handleKeyboardClear(evt, container);
|
1756 |
-
});
|
1757 |
-
};
|
1758 |
-
|
1759 |
-
AllowClear.prototype._handleClear = function (_, evt) {
|
1760 |
-
// Ignore the event if it is disabled
|
1761 |
-
if (this.options.get('disabled')) {
|
1762 |
-
return;
|
1763 |
-
}
|
1764 |
-
|
1765 |
-
var $clear = this.$selection.find('.select2-selection__clear');
|
1766 |
-
|
1767 |
-
// Ignore the event if nothing has been selected
|
1768 |
-
if ($clear.length === 0) {
|
1769 |
-
return;
|
1770 |
-
}
|
1771 |
-
|
1772 |
-
evt.stopPropagation();
|
1773 |
-
|
1774 |
-
var data = $clear.data('data');
|
1775 |
-
|
1776 |
-
for (var d = 0; d < data.length; d++) {
|
1777 |
-
var unselectData = {
|
1778 |
-
data: data[d]
|
1779 |
-
};
|
1780 |
-
|
1781 |
-
// Trigger the `unselect` event, so people can prevent it from being
|
1782 |
-
// cleared.
|
1783 |
-
this.trigger('unselect', unselectData);
|
1784 |
-
|
1785 |
-
// If the event was prevented, don't clear it out.
|
1786 |
-
if (unselectData.prevented) {
|
1787 |
-
return;
|
1788 |
-
}
|
1789 |
-
}
|
1790 |
-
|
1791 |
-
this.$element.val(this.placeholder.id).trigger('change');
|
1792 |
-
|
1793 |
-
this.trigger('toggle', {});
|
1794 |
-
};
|
1795 |
-
|
1796 |
-
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
|
1797 |
-
if (container.isOpen()) {
|
1798 |
-
return;
|
1799 |
-
}
|
1800 |
-
|
1801 |
-
if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
|
1802 |
-
this._handleClear(evt);
|
1803 |
-
}
|
1804 |
-
};
|
1805 |
-
|
1806 |
-
AllowClear.prototype.update = function (decorated, data) {
|
1807 |
-
decorated.call(this, data);
|
1808 |
-
|
1809 |
-
if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
|
1810 |
-
data.length === 0) {
|
1811 |
-
return;
|
1812 |
-
}
|
1813 |
-
|
1814 |
-
var $remove = $(
|
1815 |
-
'<span class="select2-selection__clear">' +
|
1816 |
-
'×' +
|
1817 |
-
'</span>'
|
1818 |
-
);
|
1819 |
-
$remove.data('data', data);
|
1820 |
-
|
1821 |
-
this.$selection.find('.select2-selection__rendered').prepend($remove);
|
1822 |
-
};
|
1823 |
-
|
1824 |
-
return AllowClear;
|
1825 |
-
});
|
1826 |
-
|
1827 |
-
S2.define('select2/selection/search',[
|
1828 |
-
'jquery',
|
1829 |
-
'../utils',
|
1830 |
-
'../keys'
|
1831 |
-
], function ($, Utils, KEYS) {
|
1832 |
-
function Search (decorated, $element, options) {
|
1833 |
-
decorated.call(this, $element, options);
|
1834 |
-
}
|
1835 |
-
|
1836 |
-
Search.prototype.render = function (decorated) {
|
1837 |
-
var $search = $(
|
1838 |
-
'<li class="select2-search select2-search--inline">' +
|
1839 |
-
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
1840 |
-
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
|
1841 |
-
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1842 |
-
'</li>'
|
1843 |
-
);
|
1844 |
-
|
1845 |
-
this.$searchContainer = $search;
|
1846 |
-
this.$search = $search.find('input');
|
1847 |
-
|
1848 |
-
var $rendered = decorated.call(this);
|
1849 |
-
|
1850 |
-
this._transferTabIndex();
|
1851 |
-
|
1852 |
-
return $rendered;
|
1853 |
-
};
|
1854 |
-
|
1855 |
-
Search.prototype.bind = function (decorated, container, $container) {
|
1856 |
-
var self = this;
|
1857 |
-
|
1858 |
-
decorated.call(this, container, $container);
|
1859 |
-
|
1860 |
-
container.on('open', function () {
|
1861 |
-
self.$search.trigger('focus');
|
1862 |
-
});
|
1863 |
-
|
1864 |
-
container.on('close', function () {
|
1865 |
-
self.$search.val('');
|
1866 |
-
self.$search.removeAttr('aria-activedescendant');
|
1867 |
-
self.$search.trigger('focus');
|
1868 |
-
});
|
1869 |
-
|
1870 |
-
container.on('enable', function () {
|
1871 |
-
self.$search.prop('disabled', false);
|
1872 |
-
|
1873 |
-
self._transferTabIndex();
|
1874 |
-
});
|
1875 |
-
|
1876 |
-
container.on('disable', function () {
|
1877 |
-
self.$search.prop('disabled', true);
|
1878 |
-
});
|
1879 |
-
|
1880 |
-
container.on('focus', function (evt) {
|
1881 |
-
self.$search.trigger('focus');
|
1882 |
-
});
|
1883 |
-
|
1884 |
-
container.on('results:focus', function (params) {
|
1885 |
-
self.$search.attr('aria-activedescendant', params.id);
|
1886 |
-
});
|
1887 |
-
|
1888 |
-
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
|
1889 |
-
self.trigger('focus', evt);
|
1890 |
-
});
|
1891 |
-
|
1892 |
-
this.$selection.on('focusout', '.select2-search--inline', function (evt) {
|
1893 |
-
self._handleBlur(evt);
|
1894 |
-
});
|
1895 |
-
|
1896 |
-
this.$selection.on('keydown', '.select2-search--inline', function (evt) {
|
1897 |
-
evt.stopPropagation();
|
1898 |
-
|
1899 |
-
self.trigger('keypress', evt);
|
1900 |
-
|
1901 |
-
self._keyUpPrevented = evt.isDefaultPrevented();
|
1902 |
-
|
1903 |
-
var key = evt.which;
|
1904 |
-
|
1905 |
-
if (key === KEYS.BACKSPACE && self.$search.val() === '') {
|
1906 |
-
var $previousChoice = self.$searchContainer
|
1907 |
-
.prev('.select2-selection__choice');
|
1908 |
-
|
1909 |
-
if ($previousChoice.length > 0) {
|
1910 |
-
var item = $previousChoice.data('data');
|
1911 |
-
|
1912 |
-
self.searchRemoveChoice(item);
|
1913 |
-
|
1914 |
-
evt.preventDefault();
|
1915 |
-
}
|
1916 |
-
}
|
1917 |
-
});
|
1918 |
-
|
1919 |
-
// Try to detect the IE version should the `documentMode` property that
|
1920 |
-
// is stored on the document. This is only implemented in IE and is
|
1921 |
-
// slightly cleaner than doing a user agent check.
|
1922 |
-
// This property is not available in Edge, but Edge also doesn't have
|
1923 |
-
// this bug.
|
1924 |
-
var msie = document.documentMode;
|
1925 |
-
var disableInputEvents = msie && msie <= 11;
|
1926 |
-
|
1927 |
-
// Workaround for browsers which do not support the `input` event
|
1928 |
-
// This will prevent double-triggering of events for browsers which support
|
1929 |
-
// both the `keyup` and `input` events.
|
1930 |
-
this.$selection.on(
|
1931 |
-
'input.searchcheck',
|
1932 |
-
'.select2-search--inline',
|
1933 |
-
function (evt) {
|
1934 |
-
// IE will trigger the `input` event when a placeholder is used on a
|
1935 |
-
// search box. To get around this issue, we are forced to ignore all
|
1936 |
-
// `input` events in IE and keep using `keyup`.
|
1937 |
-
if (disableInputEvents) {
|
1938 |
-
self.$selection.off('input.search input.searchcheck');
|
1939 |
-
return;
|
1940 |
-
}
|
1941 |
-
|
1942 |
-
// Unbind the duplicated `keyup` event
|
1943 |
-
self.$selection.off('keyup.search');
|
1944 |
-
}
|
1945 |
-
);
|
1946 |
-
|
1947 |
-
this.$selection.on(
|
1948 |
-
'keyup.search input.search',
|
1949 |
-
'.select2-search--inline',
|
1950 |
-
function (evt) {
|
1951 |
-
// IE will trigger the `input` event when a placeholder is used on a
|
1952 |
-
// search box. To get around this issue, we are forced to ignore all
|
1953 |
-
// `input` events in IE and keep using `keyup`.
|
1954 |
-
if (disableInputEvents && evt.type === 'input') {
|
1955 |
-
self.$selection.off('input.search input.searchcheck');
|
1956 |
-
return;
|
1957 |
-
}
|
1958 |
-
|
1959 |
-
var key = evt.which;
|
1960 |
-
|
1961 |
-
// We can freely ignore events from modifier keys
|
1962 |
-
if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
|
1963 |
-
return;
|
1964 |
-
}
|
1965 |
-
|
1966 |
-
// Tabbing will be handled during the `keydown` phase
|
1967 |
-
if (key == KEYS.TAB) {
|
1968 |
-
return;
|
1969 |
-
}
|
1970 |
-
|
1971 |
-
self.handleSearch(evt);
|
1972 |
-
}
|
1973 |
-
);
|
1974 |
-
};
|
1975 |
-
|
1976 |
-
/**
|
1977 |
-
* This method will transfer the tabindex attribute from the rendered
|
1978 |
-
* selection to the search box. This allows for the search box to be used as
|
1979 |
-
* the primary focus instead of the selection container.
|
1980 |
-
*
|
1981 |
-
* @private
|
1982 |
-
*/
|
1983 |
-
Search.prototype._transferTabIndex = function (decorated) {
|
1984 |
-
this.$search.attr('tabindex', this.$selection.attr('tabindex'));
|
1985 |
-
this.$selection.attr('tabindex', '-1');
|
1986 |
-
};
|
1987 |
-
|
1988 |
-
Search.prototype.createPlaceholder = function (decorated, placeholder) {
|
1989 |
-
this.$search.attr('placeholder', placeholder.text);
|
1990 |
-
};
|
1991 |
-
|
1992 |
-
Search.prototype.update = function (decorated, data) {
|
1993 |
-
var searchHadFocus = this.$search[0] == document.activeElement;
|
1994 |
-
|
1995 |
-
this.$search.attr('placeholder', '');
|
1996 |
-
|
1997 |
-
decorated.call(this, data);
|
1998 |
-
|
1999 |
-
this.$selection.find('.select2-selection__rendered')
|
2000 |
-
.append(this.$searchContainer);
|
2001 |
-
|
2002 |
-
this.resizeSearch();
|
2003 |
-
if (searchHadFocus) {
|
2004 |
-
this.$search.focus();
|
2005 |
-
}
|
2006 |
-
};
|
2007 |
-
|
2008 |
-
Search.prototype.handleSearch = function () {
|
2009 |
-
this.resizeSearch();
|
2010 |
-
|
2011 |
-
if (!this._keyUpPrevented) {
|
2012 |
-
var input = this.$search.val();
|
2013 |
-
|
2014 |
-
this.trigger('query', {
|
2015 |
-
term: input
|
2016 |
-
});
|
2017 |
-
}
|
2018 |
-
|
2019 |
-
this._keyUpPrevented = false;
|
2020 |
-
};
|
2021 |
-
|
2022 |
-
Search.prototype.searchRemoveChoice = function (decorated, item) {
|
2023 |
-
this.trigger('unselect', {
|
2024 |
-
data: item
|
2025 |
-
});
|
2026 |
-
|
2027 |
-
this.$search.val(item.text);
|
2028 |
-
this.handleSearch();
|
2029 |
-
};
|
2030 |
-
|
2031 |
-
Search.prototype.resizeSearch = function () {
|
2032 |
-
this.$search.css('width', '25px');
|
2033 |
-
|
2034 |
-
var width = '';
|
2035 |
-
|
2036 |
-
if (this.$search.attr('placeholder') !== '') {
|
2037 |
-
width = this.$selection.find('.select2-selection__rendered').innerWidth();
|
2038 |
-
} else {
|
2039 |
-
var minimumWidth = this.$search.val().length + 1;
|
2040 |
-
|
2041 |
-
width = (minimumWidth * 0.75) + 'em';
|
2042 |
-
}
|
2043 |
-
|
2044 |
-
this.$search.css('width', width);
|
2045 |
-
};
|
2046 |
-
|
2047 |
-
return Search;
|
2048 |
-
});
|
2049 |
-
|
2050 |
-
S2.define('select2/selection/eventRelay',[
|
2051 |
-
'jquery'
|
2052 |
-
], function ($) {
|
2053 |
-
function EventRelay () { }
|
2054 |
-
|
2055 |
-
EventRelay.prototype.bind = function (decorated, container, $container) {
|
2056 |
-
var self = this;
|
2057 |
-
var relayEvents = [
|
2058 |
-
'open', 'opening',
|
2059 |
-
'close', 'closing',
|
2060 |
-
'select', 'selecting',
|
2061 |
-
'unselect', 'unselecting'
|
2062 |
-
];
|
2063 |
-
|
2064 |
-
var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
|
2065 |
-
|
2066 |
-
decorated.call(this, container, $container);
|
2067 |
-
|
2068 |
-
container.on('*', function (name, params) {
|
2069 |
-
// Ignore events that should not be relayed
|
2070 |
-
if ($.inArray(name, relayEvents) === -1) {
|
2071 |
-
return;
|
2072 |
-
}
|
2073 |
-
|
2074 |
-
// The parameters should always be an object
|
2075 |
-
params = params || {};
|
2076 |
-
|
2077 |
-
// Generate the jQuery event for the Select2 event
|
2078 |
-
var evt = $.Event('select2:' + name, {
|
2079 |
-
params: params
|
2080 |
-
});
|
2081 |
-
|
2082 |
-
self.$element.trigger(evt);
|
2083 |
-
|
2084 |
-
// Only handle preventable events if it was one
|
2085 |
-
if ($.inArray(name, preventableEvents) === -1) {
|
2086 |
-
return;
|
2087 |
-
}
|
2088 |
-
|
2089 |
-
params.prevented = evt.isDefaultPrevented();
|
2090 |
-
});
|
2091 |
-
};
|
2092 |
-
|
2093 |
-
return EventRelay;
|
2094 |
-
});
|
2095 |
-
|
2096 |
-
S2.define('select2/translation',[
|
2097 |
-
'jquery',
|
2098 |
-
'require'
|
2099 |
-
], function ($, require) {
|
2100 |
-
function Translation (dict) {
|
2101 |
-
this.dict = dict || {};
|
2102 |
-
}
|
2103 |
-
|
2104 |
-
Translation.prototype.all = function () {
|
2105 |
-
return this.dict;
|
2106 |
-
};
|
2107 |
-
|
2108 |
-
Translation.prototype.get = function (key) {
|
2109 |
-
return this.dict[key];
|
2110 |
-
};
|
2111 |
-
|
2112 |
-
Translation.prototype.extend = function (translation) {
|
2113 |
-
this.dict = $.extend({}, translation.all(), this.dict);
|
2114 |
-
};
|
2115 |
-
|
2116 |
-
// Static functions
|
2117 |
-
|
2118 |
-
Translation._cache = {};
|
2119 |
-
|
2120 |
-
Translation.loadPath = function (path) {
|
2121 |
-
if (!(path in Translation._cache)) {
|
2122 |
-
var translations = require(path);
|
2123 |
-
|
2124 |
-
Translation._cache[path] = translations;
|
2125 |
-
}
|
2126 |
-
|
2127 |
-
return new Translation(Translation._cache[path]);
|
2128 |
-
};
|
2129 |
-
|
2130 |
-
return Translation;
|
2131 |
-
});
|
2132 |
-
|
2133 |
-
S2.define('select2/diacritics',[
|
2134 |
-
|
2135 |
-
], function () {
|
2136 |
-
var diacritics = {
|
2137 |
-
'\u24B6': 'A',
|
2138 |
-
'\uFF21': 'A',
|
2139 |
-
'\u00C0': 'A',
|
2140 |
-
'\u00C1': 'A',
|
2141 |
-
'\u00C2': 'A',
|
2142 |
-
'\u1EA6': 'A',
|
2143 |
-
'\u1EA4': 'A',
|
2144 |
-
'\u1EAA': 'A',
|
2145 |
-
'\u1EA8': 'A',
|
2146 |
-
'\u00C3': 'A',
|
2147 |
-
'\u0100': 'A',
|
2148 |
-
'\u0102': 'A',
|
2149 |
-
'\u1EB0': 'A',
|
2150 |
-
'\u1EAE': 'A',
|
2151 |
-
'\u1EB4': 'A',
|
2152 |
-
'\u1EB2': 'A',
|
2153 |
-
'\u0226': 'A',
|
2154 |
-
'\u01E0': 'A',
|
2155 |
-
'\u00C4': 'A',
|
2156 |
-
'\u01DE': 'A',
|
2157 |
-
'\u1EA2': 'A',
|
2158 |
-
'\u00C5': 'A',
|
2159 |
-
'\u01FA': 'A',
|
2160 |
-
'\u01CD': 'A',
|
2161 |
-
'\u0200': 'A',
|
2162 |
-
'\u0202': 'A',
|
2163 |
-
'\u1EA0': 'A',
|
2164 |
-
'\u1EAC': 'A',
|
2165 |
-
'\u1EB6': 'A',
|
2166 |
-
'\u1E00': 'A',
|
2167 |
-
'\u0104': 'A',
|
2168 |
-
'\u023A': 'A',
|
2169 |
-
'\u2C6F': 'A',
|
2170 |
-
'\uA732': 'AA',
|
2171 |
-
'\u00C6': 'AE',
|
2172 |
-
'\u01FC': 'AE',
|
2173 |
-
'\u01E2': 'AE',
|
2174 |
-
'\uA734': 'AO',
|
2175 |
-
'\uA736': 'AU',
|
2176 |
-
'\uA738': 'AV',
|
2177 |
-
'\uA73A': 'AV',
|
2178 |
-
'\uA73C': 'AY',
|
2179 |
-
'\u24B7': 'B',
|
2180 |
-
'\uFF22': 'B',
|
2181 |
-
'\u1E02': 'B',
|
2182 |
-
'\u1E04': 'B',
|
2183 |
-
'\u1E06': 'B',
|
2184 |
-
'\u0243': 'B',
|
2185 |
-
'\u0182': 'B',
|
2186 |
-
'\u0181': 'B',
|
2187 |
-
'\u24B8': 'C',
|
2188 |
-
'\uFF23': 'C',
|
2189 |
-
'\u0106': 'C',
|
2190 |
-
'\u0108': 'C',
|
2191 |
-
'\u010A': 'C',
|
2192 |
-
'\u010C': 'C',
|
2193 |
-
'\u00C7': 'C',
|
2194 |
-
'\u1E08': 'C',
|
2195 |
-
'\u0187': 'C',
|
2196 |
-
'\u023B': 'C',
|
2197 |
-
'\uA73E': 'C',
|
2198 |
-
'\u24B9': 'D',
|
2199 |
-
'\uFF24': 'D',
|
2200 |
-
'\u1E0A': 'D',
|
2201 |
-
'\u010E': 'D',
|
2202 |
-
'\u1E0C': 'D',
|
2203 |
-
'\u1E10': 'D',
|
2204 |
-
'\u1E12': 'D',
|
2205 |
-
'\u1E0E': 'D',
|
2206 |
-
'\u0110': 'D',
|
2207 |
-
'\u018B': 'D',
|
2208 |
-
'\u018A': 'D',
|
2209 |
-
'\u0189': 'D',
|
2210 |
-
'\uA779': 'D',
|
2211 |
-
'\u01F1': 'DZ',
|
2212 |
-
'\u01C4': 'DZ',
|
2213 |
-
'\u01F2': 'Dz',
|
2214 |
-
'\u01C5': 'Dz',
|
2215 |
-
'\u24BA': 'E',
|
2216 |
-
'\uFF25': 'E',
|
2217 |
-
'\u00C8': 'E',
|
2218 |
-
'\u00C9': 'E',
|
2219 |
-
'\u00CA': 'E',
|
2220 |
-
'\u1EC0': 'E',
|
2221 |
-
'\u1EBE': 'E',
|
2222 |
-
'\u1EC4': 'E',
|
2223 |
-
'\u1EC2': 'E',
|
2224 |
-
'\u1EBC': 'E',
|
2225 |
-
'\u0112': 'E',
|
2226 |
-
'\u1E14': 'E',
|
2227 |
-
'\u1E16': 'E',
|
2228 |
-
'\u0114': 'E',
|
2229 |
-
'\u0116': 'E',
|
2230 |
-
'\u00CB': 'E',
|
2231 |
-
'\u1EBA': 'E',
|
2232 |
-
'\u011A': 'E',
|
2233 |
-
'\u0204': 'E',
|
2234 |
-
'\u0206': 'E',
|
2235 |
-
'\u1EB8': 'E',
|
2236 |
-
'\u1EC6': 'E',
|
2237 |
-
'\u0228': 'E',
|
2238 |
-
'\u1E1C': 'E',
|
2239 |
-
'\u0118': 'E',
|
2240 |
-
'\u1E18': 'E',
|
2241 |
-
'\u1E1A': 'E',
|
2242 |
-
'\u0190': 'E',
|
2243 |
-
'\u018E': 'E',
|
2244 |
-
'\u24BB': 'F',
|
2245 |
-
'\uFF26': 'F',
|
2246 |
-
'\u1E1E': 'F',
|
2247 |
-
'\u0191': 'F',
|
2248 |
-
'\uA77B': 'F',
|
2249 |
-
'\u24BC': 'G',
|
2250 |
-
'\uFF27': 'G',
|
2251 |
-
'\u01F4': 'G',
|
2252 |
-
'\u011C': 'G',
|
2253 |
-
'\u1E20': 'G',
|
2254 |
-
'\u011E': 'G',
|
2255 |
-
'\u0120': 'G',
|
2256 |
-
'\u01E6': 'G',
|
2257 |
-
'\u0122': 'G',
|
2258 |
-
'\u01E4': 'G',
|
2259 |
-
'\u0193': 'G',
|
2260 |
-
'\uA7A0': 'G',
|
2261 |
-
'\uA77D': 'G',
|
2262 |
-
'\uA77E': 'G',
|
2263 |
-
'\u24BD': 'H',
|
2264 |
-
'\uFF28': 'H',
|
2265 |
-
'\u0124': 'H',
|
2266 |
-
'\u1E22': 'H',
|
2267 |
-
'\u1E26': 'H',
|
2268 |
-
'\u021E': 'H',
|
2269 |
-
'\u1E24': 'H',
|
2270 |
-
'\u1E28': 'H',
|
2271 |
-
'\u1E2A': 'H',
|
2272 |
-
'\u0126': 'H',
|
2273 |
-
'\u2C67': 'H',
|
2274 |
-
'\u2C75': 'H',
|
2275 |
-
'\uA78D': 'H',
|
2276 |
-
'\u24BE': 'I',
|
2277 |
-
'\uFF29': 'I',
|
2278 |
-
'\u00CC': 'I',
|
2279 |
-
'\u00CD': 'I',
|
2280 |
-
'\u00CE': 'I',
|
2281 |
-
'\u0128': 'I',
|
2282 |
-
'\u012A': 'I',
|
2283 |
-
'\u012C': 'I',
|
2284 |
-
'\u0130': 'I',
|
2285 |
-
'\u00CF': 'I',
|
2286 |
-
'\u1E2E': 'I',
|
2287 |
-
'\u1EC8': 'I',
|
2288 |
-
'\u01CF': 'I',
|
2289 |
-
'\u0208': 'I',
|
2290 |
-
'\u020A': 'I',
|
2291 |
-
'\u1ECA': 'I',
|
2292 |
-
'\u012E': 'I',
|
2293 |
-
'\u1E2C': 'I',
|
2294 |
-
'\u0197': 'I',
|
2295 |
-
'\u24BF': 'J',
|
2296 |
-
'\uFF2A': 'J',
|
2297 |
-
'\u0134': 'J',
|
2298 |
-
'\u0248': 'J',
|
2299 |
-
'\u24C0': 'K',
|
2300 |
-
'\uFF2B': 'K',
|
2301 |
-
'\u1E30': 'K',
|
2302 |
-
'\u01E8': 'K',
|
2303 |
-
'\u1E32': 'K',
|
2304 |
-
'\u0136': 'K',
|
2305 |
-
'\u1E34': 'K',
|
2306 |
-
'\u0198': 'K',
|
2307 |
-
'\u2C69': 'K',
|
2308 |
-
'\uA740': 'K',
|
2309 |
-
'\uA742': 'K',
|
2310 |
-
'\uA744': 'K',
|
2311 |
-
'\uA7A2': 'K',
|
2312 |
-
'\u24C1': 'L',
|
2313 |
-
'\uFF2C': 'L',
|
2314 |
-
'\u013F': 'L',
|
2315 |
-
'\u0139': 'L',
|
2316 |
-
'\u013D': 'L',
|
2317 |
-
'\u1E36': 'L',
|
2318 |
-
'\u1E38': 'L',
|
2319 |
-
'\u013B': 'L',
|
2320 |
-
'\u1E3C': 'L',
|
2321 |
-
'\u1E3A': 'L',
|
2322 |
-
'\u0141': 'L',
|
2323 |
-
'\u023D': 'L',
|
2324 |
-
'\u2C62': 'L',
|
2325 |
-
'\u2C60': 'L',
|
2326 |
-
'\uA748': 'L',
|
2327 |
-
'\uA746': 'L',
|
2328 |
-
'\uA780': 'L',
|
2329 |
-
'\u01C7': 'LJ',
|
2330 |
-
'\u01C8': 'Lj',
|
2331 |
-
'\u24C2': 'M',
|
2332 |
-
'\uFF2D': 'M',
|
2333 |
-
'\u1E3E': 'M',
|
2334 |
-
'\u1E40': 'M',
|
2335 |
-
'\u1E42': 'M',
|
2336 |
-
'\u2C6E': 'M',
|
2337 |
-
'\u019C': 'M',
|
2338 |
-
'\u24C3': 'N',
|
2339 |
-
'\uFF2E': 'N',
|
2340 |
-
'\u01F8': 'N',
|
2341 |
-
'\u0143': 'N',
|
2342 |
-
'\u00D1': 'N',
|
2343 |
-
'\u1E44': 'N',
|
2344 |
-
'\u0147': 'N',
|
2345 |
-
'\u1E46': 'N',
|
2346 |
-
'\u0145': 'N',
|
2347 |
-
'\u1E4A': 'N',
|
2348 |
-
'\u1E48': 'N',
|
2349 |
-
'\u0220': 'N',
|
2350 |
-
'\u019D': 'N',
|
2351 |
-
'\uA790': 'N',
|
2352 |
-
'\uA7A4': 'N',
|
2353 |
-
'\u01CA': 'NJ',
|
2354 |
-
'\u01CB': 'Nj',
|
2355 |
-
'\u24C4': 'O',
|
2356 |
-
'\uFF2F': 'O',
|
2357 |
-
'\u00D2': 'O',
|
2358 |
-
'\u00D3': 'O',
|
2359 |
-
'\u00D4': 'O',
|
2360 |
-
'\u1ED2': 'O',
|
2361 |
-
'\u1ED0': 'O',
|
2362 |
-
'\u1ED6': 'O',
|
2363 |
-
'\u1ED4': 'O',
|
2364 |
-
'\u00D5': 'O',
|
2365 |
-
'\u1E4C': 'O',
|
2366 |
-
'\u022C': 'O',
|
2367 |
-
'\u1E4E': 'O',
|
2368 |
-
'\u014C': 'O',
|
2369 |
-
'\u1E50': 'O',
|
2370 |
-
'\u1E52': 'O',
|
2371 |
-
'\u014E': 'O',
|
2372 |
-
'\u022E': 'O',
|
2373 |
-
'\u0230': 'O',
|
2374 |
-
'\u00D6': 'O',
|
2375 |
-
'\u022A': 'O',
|
2376 |
-
'\u1ECE': 'O',
|
2377 |
-
'\u0150': 'O',
|
2378 |
-
'\u01D1': 'O',
|
2379 |
-
'\u020C': 'O',
|
2380 |
-
'\u020E': 'O',
|
2381 |
-
'\u01A0': 'O',
|
2382 |
-
'\u1EDC': 'O',
|
2383 |
-
'\u1EDA': 'O',
|
2384 |
-
'\u1EE0': 'O',
|
2385 |
-
'\u1EDE': 'O',
|
2386 |
-
'\u1EE2': 'O',
|
2387 |
-
'\u1ECC': 'O',
|
2388 |
-
'\u1ED8': 'O',
|
2389 |
-
'\u01EA': 'O',
|
2390 |
-
'\u01EC': 'O',
|
2391 |
-
'\u00D8': 'O',
|
2392 |
-
'\u01FE': 'O',
|
2393 |
-
'\u0186': 'O',
|
2394 |
-
'\u019F': 'O',
|
2395 |
-
'\uA74A': 'O',
|
2396 |
-
'\uA74C': 'O',
|
2397 |
-
'\u01A2': 'OI',
|
2398 |
-
'\uA74E': 'OO',
|
2399 |
-
'\u0222': 'OU',
|
2400 |
-
'\u24C5': 'P',
|
2401 |
-
'\uFF30': 'P',
|
2402 |
-
'\u1E54': 'P',
|
2403 |
-
'\u1E56': 'P',
|
2404 |
-
'\u01A4': 'P',
|
2405 |
-
'\u2C63': 'P',
|
2406 |
-
'\uA750': 'P',
|
2407 |
-
'\uA752': 'P',
|
2408 |
-
'\uA754': 'P',
|
2409 |
-
'\u24C6': 'Q',
|
2410 |
-
'\uFF31': 'Q',
|
2411 |
-
'\uA756': 'Q',
|
2412 |
-
'\uA758': 'Q',
|
2413 |
-
'\u024A': 'Q',
|
2414 |
-
'\u24C7': 'R',
|
2415 |
-
'\uFF32': 'R',
|
2416 |
-
'\u0154': 'R',
|
2417 |
-
'\u1E58': 'R',
|
2418 |
-
'\u0158': 'R',
|
2419 |
-
'\u0210': 'R',
|
2420 |
-
'\u0212': 'R',
|
2421 |
-
'\u1E5A': 'R',
|
2422 |
-
'\u1E5C': 'R',
|
2423 |
-
'\u0156': 'R',
|
2424 |
-
'\u1E5E': 'R',
|
2425 |
-
'\u024C': 'R',
|
2426 |
-
'\u2C64': 'R',
|
2427 |
-
'\uA75A': 'R',
|
2428 |
-
'\uA7A6': 'R',
|
2429 |
-
'\uA782': 'R',
|
2430 |
-
'\u24C8': 'S',
|
2431 |
-
'\uFF33': 'S',
|
2432 |
-
'\u1E9E': 'S',
|
2433 |
-
'\u015A': 'S',
|
2434 |
-
'\u1E64': 'S',
|
2435 |
-
'\u015C': 'S',
|
2436 |
-
'\u1E60': 'S',
|
2437 |
-
'\u0160': 'S',
|
2438 |
-
'\u1E66': 'S',
|
2439 |
-
'\u1E62': 'S',
|
2440 |
-
'\u1E68': 'S',
|
2441 |
-
'\u0218': 'S',
|
2442 |
-
'\u015E': 'S',
|
2443 |
-
'\u2C7E': 'S',
|
2444 |
-
'\uA7A8': 'S',
|
2445 |
-
'\uA784': 'S',
|
2446 |
-
'\u24C9': 'T',
|
2447 |
-
'\uFF34': 'T',
|
2448 |
-
'\u1E6A': 'T',
|
2449 |
-
'\u0164': 'T',
|
2450 |
-
'\u1E6C': 'T',
|
2451 |
-
'\u021A': 'T',
|
2452 |
-
'\u0162': 'T',
|
2453 |
-
'\u1E70': 'T',
|
2454 |
-
'\u1E6E': 'T',
|
2455 |
-
'\u0166': 'T',
|
2456 |
-
'\u01AC': 'T',
|
2457 |
-
'\u01AE': 'T',
|
2458 |
-
'\u023E': 'T',
|
2459 |
-
'\uA786': 'T',
|
2460 |
-
'\uA728': 'TZ',
|
2461 |
-
'\u24CA': 'U',
|
2462 |
-
'\uFF35': 'U',
|
2463 |
-
'\u00D9': 'U',
|
2464 |
-
'\u00DA': 'U',
|
2465 |
-
'\u00DB': 'U',
|
2466 |
-
'\u0168': 'U',
|
2467 |
-
'\u1E78': 'U',
|
2468 |
-
'\u016A': 'U',
|
2469 |
-
'\u1E7A': 'U',
|
2470 |
-
'\u016C': 'U',
|
2471 |
-
'\u00DC': 'U',
|
2472 |
-
'\u01DB': 'U',
|
2473 |
-
'\u01D7': 'U',
|
2474 |
-
'\u01D5': 'U',
|
2475 |
-
'\u01D9': 'U',
|
2476 |
-
'\u1EE6': 'U',
|
2477 |
-
'\u016E': 'U',
|
2478 |
-
'\u0170': 'U',
|
2479 |
-
'\u01D3': 'U',
|
2480 |
-
'\u0214': 'U',
|
2481 |
-
'\u0216': 'U',
|
2482 |
-
'\u01AF': 'U',
|
2483 |
-
'\u1EEA': 'U',
|
2484 |
-
'\u1EE8': 'U',
|
2485 |
-
'\u1EEE': 'U',
|
2486 |
-
'\u1EEC': 'U',
|
2487 |
-
'\u1EF0': 'U',
|
2488 |
-
'\u1EE4': 'U',
|
2489 |
-
'\u1E72': 'U',
|
2490 |
-
'\u0172': 'U',
|
2491 |
-
'\u1E76': 'U',
|
2492 |
-
'\u1E74': 'U',
|
2493 |
-
'\u0244': 'U',
|
2494 |
-
'\u24CB': 'V',
|
2495 |
-
'\uFF36': 'V',
|
2496 |
-
'\u1E7C': 'V',
|
2497 |
-
'\u1E7E': 'V',
|
2498 |
-
'\u01B2': 'V',
|
2499 |
-
'\uA75E': 'V',
|
2500 |
-
'\u0245': 'V',
|
2501 |
-
'\uA760': 'VY',
|
2502 |
-
'\u24CC': 'W',
|
2503 |
-
'\uFF37': 'W',
|
2504 |
-
'\u1E80': 'W',
|
2505 |
-
'\u1E82': 'W',
|
2506 |
-
'\u0174': 'W',
|
2507 |
-
'\u1E86': 'W',
|
2508 |
-
'\u1E84': 'W',
|
2509 |
-
'\u1E88': 'W',
|
2510 |
-
'\u2C72': 'W',
|
2511 |
-
'\u24CD': 'X',
|
2512 |
-
'\uFF38': 'X',
|
2513 |
-
'\u1E8A': 'X',
|
2514 |
-
'\u1E8C': 'X',
|
2515 |
-
'\u24CE': 'Y',
|
2516 |
-
'\uFF39': 'Y',
|
2517 |
-
'\u1EF2': 'Y',
|
2518 |
-
'\u00DD': 'Y',
|
2519 |
-
'\u0176': 'Y',
|
2520 |
-
'\u1EF8': 'Y',
|
2521 |
-
'\u0232': 'Y',
|
2522 |
-
'\u1E8E': 'Y',
|
2523 |
-
'\u0178': 'Y',
|
2524 |
-
'\u1EF6': 'Y',
|
2525 |
-
'\u1EF4': 'Y',
|
2526 |
-
'\u01B3': 'Y',
|
2527 |
-
'\u024E': 'Y',
|
2528 |
-
'\u1EFE': 'Y',
|
2529 |
-
'\u24CF': 'Z',
|
2530 |
-
'\uFF3A': 'Z',
|
2531 |
-
'\u0179': 'Z',
|
2532 |
-
'\u1E90': 'Z',
|
2533 |
-
'\u017B': 'Z',
|
2534 |
-
'\u017D': 'Z',
|
2535 |
-
'\u1E92': 'Z',
|
2536 |
-
'\u1E94': 'Z',
|
2537 |
-
'\u01B5': 'Z',
|
2538 |
-
'\u0224': 'Z',
|
2539 |
-
'\u2C7F': 'Z',
|
2540 |
-
'\u2C6B': 'Z',
|
2541 |
-
'\uA762': 'Z',
|
2542 |
-
'\u24D0': 'a',
|
2543 |
-
'\uFF41': 'a',
|
2544 |
-
'\u1E9A': 'a',
|
2545 |
-
'\u00E0': 'a',
|
2546 |
-
'\u00E1': 'a',
|
2547 |
-
'\u00E2': 'a',
|
2548 |
-
'\u1EA7': 'a',
|
2549 |
-
'\u1EA5': 'a',
|
2550 |
-
'\u1EAB': 'a',
|
2551 |
-
'\u1EA9': 'a',
|
2552 |
-
'\u00E3': 'a',
|
2553 |
-
'\u0101': 'a',
|
2554 |
-
'\u0103': 'a',
|
2555 |
-
'\u1EB1': 'a',
|
2556 |
-
'\u1EAF': 'a',
|
2557 |
-
'\u1EB5': 'a',
|
2558 |
-
'\u1EB3': 'a',
|
2559 |
-
'\u0227': 'a',
|
2560 |
-
'\u01E1': 'a',
|
2561 |
-
'\u00E4': 'a',
|
2562 |
-
'\u01DF': 'a',
|
2563 |
-
'\u1EA3': 'a',
|
2564 |
-
'\u00E5': 'a',
|
2565 |
-
'\u01FB': 'a',
|
2566 |
-
'\u01CE': 'a',
|
2567 |
-
'\u0201': 'a',
|
2568 |
-
'\u0203': 'a',
|
2569 |
-
'\u1EA1': 'a',
|
2570 |
-
'\u1EAD': 'a',
|
2571 |
-
'\u1EB7': 'a',
|
2572 |
-
'\u1E01': 'a',
|
2573 |
-
'\u0105': 'a',
|
2574 |
-
'\u2C65': 'a',
|
2575 |
-
'\u0250': 'a',
|
2576 |
-
'\uA733': 'aa',
|
2577 |
-
'\u00E6': 'ae',
|
2578 |
-
'\u01FD': 'ae',
|
2579 |
-
'\u01E3': 'ae',
|
2580 |
-
'\uA735': 'ao',
|
2581 |
-
'\uA737': 'au',
|
2582 |
-
'\uA739': 'av',
|
2583 |
-
'\uA73B': 'av',
|
2584 |
-
'\uA73D': 'ay',
|
2585 |
-
'\u24D1': 'b',
|
2586 |
-
'\uFF42': 'b',
|
2587 |
-
'\u1E03': 'b',
|
2588 |
-
'\u1E05': 'b',
|
2589 |
-
'\u1E07': 'b',
|
2590 |
-
'\u0180': 'b',
|
2591 |
-
'\u0183': 'b',
|
2592 |
-
'\u0253': 'b',
|
2593 |
-
'\u24D2': 'c',
|
2594 |
-
'\uFF43': 'c',
|
2595 |
-
'\u0107': 'c',
|
2596 |
-
'\u0109': 'c',
|
2597 |
-
'\u010B': 'c',
|
2598 |
-
'\u010D': 'c',
|
2599 |
-
'\u00E7': 'c',
|
2600 |
-
'\u1E09': 'c',
|
2601 |
-
'\u0188': 'c',
|
2602 |
-
'\u023C': 'c',
|
2603 |
-
'\uA73F': 'c',
|
2604 |
-
'\u2184': 'c',
|
2605 |
-
'\u24D3': 'd',
|
2606 |
-
'\uFF44': 'd',
|
2607 |
-
'\u1E0B': 'd',
|
2608 |
-
'\u010F': 'd',
|
2609 |
-
'\u1E0D': 'd',
|
2610 |
-
'\u1E11': 'd',
|
2611 |
-
'\u1E13': 'd',
|
2612 |
-
'\u1E0F': 'd',
|
2613 |
-
'\u0111': 'd',
|
2614 |
-
'\u018C': 'd',
|
2615 |
-
'\u0256': 'd',
|
2616 |
-
'\u0257': 'd',
|
2617 |
-
'\uA77A': 'd',
|
2618 |
-
'\u01F3': 'dz',
|
2619 |
-
'\u01C6': 'dz',
|
2620 |
-
'\u24D4': 'e',
|
2621 |
-
'\uFF45': 'e',
|
2622 |
-
'\u00E8': 'e',
|
2623 |
-
'\u00E9': 'e',
|
2624 |
-
'\u00EA': 'e',
|
2625 |
-
'\u1EC1': 'e',
|
2626 |
-
'\u1EBF': 'e',
|
2627 |
-
'\u1EC5': 'e',
|
2628 |
-
'\u1EC3': 'e',
|
2629 |
-
'\u1EBD': 'e',
|
2630 |
-
'\u0113': 'e',
|
2631 |
-
'\u1E15': 'e',
|
2632 |
-
'\u1E17': 'e',
|
2633 |
-
'\u0115': 'e',
|
2634 |
-
'\u0117': 'e',
|
2635 |
-
'\u00EB': 'e',
|
2636 |
-
'\u1EBB': 'e',
|
2637 |
-
'\u011B': 'e',
|
2638 |
-
'\u0205': 'e',
|
2639 |
-
'\u0207': 'e',
|
2640 |
-
'\u1EB9': 'e',
|
2641 |
-
'\u1EC7': 'e',
|
2642 |
-
'\u0229': 'e',
|
2643 |
-
'\u1E1D': 'e',
|
2644 |
-
'\u0119': 'e',
|
2645 |
-
'\u1E19': 'e',
|
2646 |
-
'\u1E1B': 'e',
|
2647 |
-
'\u0247': 'e',
|
2648 |
-
'\u025B': 'e',
|
2649 |
-
'\u01DD': 'e',
|
2650 |
-
'\u24D5': 'f',
|
2651 |
-
'\uFF46': 'f',
|
2652 |
-
'\u1E1F': 'f',
|
2653 |
-
'\u0192': 'f',
|
2654 |
-
'\uA77C': 'f',
|
2655 |
-
'\u24D6': 'g',
|
2656 |
-
'\uFF47': 'g',
|
2657 |
-
'\u01F5': 'g',
|
2658 |
-
'\u011D': 'g',
|
2659 |
-
'\u1E21': 'g',
|
2660 |
-
'\u011F': 'g',
|
2661 |
-
'\u0121': 'g',
|
2662 |
-
'\u01E7': 'g',
|
2663 |
-
'\u0123': 'g',
|
2664 |
-
'\u01E5': 'g',
|
2665 |
-
'\u0260': 'g',
|
2666 |
-
'\uA7A1': 'g',
|
2667 |
-
'\u1D79': 'g',
|
2668 |
-
'\uA77F': 'g',
|
2669 |
-
'\u24D7': 'h',
|
2670 |
-
'\uFF48': 'h',
|
2671 |
-
'\u0125': 'h',
|
2672 |
-
'\u1E23': 'h',
|
2673 |
-
'\u1E27': 'h',
|
2674 |
-
'\u021F': 'h',
|
2675 |
-
'\u1E25': 'h',
|
2676 |
-
'\u1E29': 'h',
|
2677 |
-
'\u1E2B': 'h',
|
2678 |
-
'\u1E96': 'h',
|
2679 |
-
'\u0127': 'h',
|
2680 |
-
'\u2C68': 'h',
|
2681 |
-
'\u2C76': 'h',
|
2682 |
-
'\u0265': 'h',
|
2683 |
-
'\u0195': 'hv',
|
2684 |
-
'\u24D8': 'i',
|
2685 |
-
'\uFF49': 'i',
|
2686 |
-
'\u00EC': 'i',
|
2687 |
-
'\u00ED': 'i',
|
2688 |
-
'\u00EE': 'i',
|
2689 |
-
'\u0129': 'i',
|
2690 |
-
'\u012B': 'i',
|
2691 |
-
'\u012D': 'i',
|
2692 |
-
'\u00EF': 'i',
|
2693 |
-
'\u1E2F': 'i',
|
2694 |
-
'\u1EC9': 'i',
|
2695 |
-
'\u01D0': 'i',
|
2696 |
-
'\u0209': 'i',
|
2697 |
-
'\u020B': 'i',
|
2698 |
-
'\u1ECB': 'i',
|
2699 |
-
'\u012F': 'i',
|
2700 |
-
'\u1E2D': 'i',
|
2701 |
-
'\u0268': 'i',
|
2702 |
-
'\u0131': 'i',
|
2703 |
-
'\u24D9': 'j',
|
2704 |
-
'\uFF4A': 'j',
|
2705 |
-
'\u0135': 'j',
|
2706 |
-
'\u01F0': 'j',
|
2707 |
-
'\u0249': 'j',
|
2708 |
-
'\u24DA': 'k',
|
2709 |
-
'\uFF4B': 'k',
|
2710 |
-
'\u1E31': 'k',
|
2711 |
-
'\u01E9': 'k',
|
2712 |
-
'\u1E33': 'k',
|
2713 |
-
'\u0137': 'k',
|
2714 |
-
'\u1E35': 'k',
|
2715 |
-
'\u0199': 'k',
|
2716 |
-
'\u2C6A': 'k',
|
2717 |
-
'\uA741': 'k',
|
2718 |
-
'\uA743': 'k',
|
2719 |
-
'\uA745': 'k',
|
2720 |
-
'\uA7A3': 'k',
|
2721 |
-
'\u24DB': 'l',
|
2722 |
-
'\uFF4C': 'l',
|
2723 |
-
'\u0140': 'l',
|
2724 |
-
'\u013A': 'l',
|
2725 |
-
'\u013E': 'l',
|
2726 |
-
'\u1E37': 'l',
|
2727 |
-
'\u1E39': 'l',
|
2728 |
-
'\u013C': 'l',
|
2729 |
-
'\u1E3D': 'l',
|
2730 |
-
'\u1E3B': 'l',
|
2731 |
-
'\u017F': 'l',
|
2732 |
-
'\u0142': 'l',
|
2733 |
-
'\u019A': 'l',
|
2734 |
-
'\u026B': 'l',
|
2735 |
-
'\u2C61': 'l',
|
2736 |
-
'\uA749': 'l',
|
2737 |
-
'\uA781': 'l',
|
2738 |
-
'\uA747': 'l',
|
2739 |
-
'\u01C9': 'lj',
|
2740 |
-
'\u24DC': 'm',
|
2741 |
-
'\uFF4D': 'm',
|
2742 |
-
'\u1E3F': 'm',
|
2743 |
-
'\u1E41': 'm',
|
2744 |
-
'\u1E43': 'm',
|
2745 |
-
'\u0271': 'm',
|
2746 |
-
'\u026F': 'm',
|
2747 |
-
'\u24DD': 'n',
|
2748 |
-
'\uFF4E': 'n',
|
2749 |
-
'\u01F9': 'n',
|
2750 |
-
'\u0144': 'n',
|
2751 |
-
'\u00F1': 'n',
|
2752 |
-
'\u1E45': 'n',
|
2753 |
-
'\u0148': 'n',
|
2754 |
-
'\u1E47': 'n',
|
2755 |
-
'\u0146': 'n',
|
2756 |
-
'\u1E4B': 'n',
|
2757 |
-
'\u1E49': 'n',
|
2758 |
-
'\u019E': 'n',
|
2759 |
-
'\u0272': 'n',
|
2760 |
-
'\u0149': 'n',
|
2761 |
-
'\uA791': 'n',
|
2762 |
-
'\uA7A5': 'n',
|
2763 |
-
'\u01CC': 'nj',
|
2764 |
-
'\u24DE': 'o',
|
2765 |
-
'\uFF4F': 'o',
|
2766 |
-
'\u00F2': 'o',
|
2767 |
-
'\u00F3': 'o',
|
2768 |
-
'\u00F4': 'o',
|
2769 |
-
'\u1ED3': 'o',
|
2770 |
-
'\u1ED1': 'o',
|
2771 |
-
'\u1ED7': 'o',
|
2772 |
-
'\u1ED5': 'o',
|
2773 |
-
'\u00F5': 'o',
|
2774 |
-
'\u1E4D': 'o',
|
2775 |
-
'\u022D': 'o',
|
2776 |
-
'\u1E4F': 'o',
|
2777 |
-
'\u014D': 'o',
|
2778 |
-
'\u1E51': 'o',
|
2779 |
-
'\u1E53': 'o',
|
2780 |
-
'\u014F': 'o',
|
2781 |
-
'\u022F': 'o',
|
2782 |
-
'\u0231': 'o',
|
2783 |
-
'\u00F6': 'o',
|
2784 |
-
'\u022B': 'o',
|
2785 |
-
'\u1ECF': 'o',
|
2786 |
-
'\u0151': 'o',
|
2787 |
-
'\u01D2': 'o',
|
2788 |
-
'\u020D': 'o',
|
2789 |
-
'\u020F': 'o',
|
2790 |
-
'\u01A1': 'o',
|
2791 |
-
'\u1EDD': 'o',
|
2792 |
-
'\u1EDB': 'o',
|
2793 |
-
'\u1EE1': 'o',
|
2794 |
-
'\u1EDF': 'o',
|
2795 |
-
'\u1EE3': 'o',
|
2796 |
-
'\u1ECD': 'o',
|
2797 |
-
'\u1ED9': 'o',
|
2798 |
-
'\u01EB': 'o',
|
2799 |
-
'\u01ED': 'o',
|
2800 |
-
'\u00F8': 'o',
|
2801 |
-
'\u01FF': 'o',
|
2802 |
-
'\u0254': 'o',
|
2803 |
-
'\uA74B': 'o',
|
2804 |
-
'\uA74D': 'o',
|
2805 |
-
'\u0275': 'o',
|
2806 |
-
'\u01A3': 'oi',
|
2807 |
-
'\u0223': 'ou',
|
2808 |
-
'\uA74F': 'oo',
|
2809 |
-
'\u24DF': 'p',
|
2810 |
-
'\uFF50': 'p',
|
2811 |
-
'\u1E55': 'p',
|
2812 |
-
'\u1E57': 'p',
|
2813 |
-
'\u01A5': 'p',
|
2814 |
-
'\u1D7D': 'p',
|
2815 |
-
'\uA751': 'p',
|
2816 |
-
'\uA753': 'p',
|
2817 |
-
'\uA755': 'p',
|
2818 |
-
'\u24E0': 'q',
|
2819 |
-
'\uFF51': 'q',
|
2820 |
-
'\u024B': 'q',
|
2821 |
-
'\uA757': 'q',
|
2822 |
-
'\uA759': 'q',
|
2823 |
-
'\u24E1': 'r',
|
2824 |
-
'\uFF52': 'r',
|
2825 |
-
'\u0155': 'r',
|
2826 |
-
'\u1E59': 'r',
|
2827 |
-
'\u0159': 'r',
|
2828 |
-
'\u0211': 'r',
|
2829 |
-
'\u0213': 'r',
|
2830 |
-
'\u1E5B': 'r',
|
2831 |
-
'\u1E5D': 'r',
|
2832 |
-
'\u0157': 'r',
|
2833 |
-
'\u1E5F': 'r',
|
2834 |
-
'\u024D': 'r',
|
2835 |
-
'\u027D': 'r',
|
2836 |
-
'\uA75B': 'r',
|
2837 |
-
'\uA7A7': 'r',
|
2838 |
-
'\uA783': 'r',
|
2839 |
-
'\u24E2': 's',
|
2840 |
-
'\uFF53': 's',
|
2841 |
-
'\u00DF': 's',
|
2842 |
-
'\u015B': 's',
|
2843 |
-
'\u1E65': 's',
|
2844 |
-
'\u015D': 's',
|
2845 |
-
'\u1E61': 's',
|
2846 |
-
'\u0161': 's',
|
2847 |
-
'\u1E67': 's',
|
2848 |
-
'\u1E63': 's',
|
2849 |
-
'\u1E69': 's',
|
2850 |
-
'\u0219': 's',
|
2851 |
-
'\u015F': 's',
|
2852 |
-
'\u023F': 's',
|
2853 |
-
'\uA7A9': 's',
|
2854 |
-
'\uA785': 's',
|
2855 |
-
'\u1E9B': 's',
|
2856 |
-
'\u24E3': 't',
|
2857 |
-
'\uFF54': 't',
|
2858 |
-
'\u1E6B': 't',
|
2859 |
-
'\u1E97': 't',
|
2860 |
-
'\u0165': 't',
|
2861 |
-
'\u1E6D': 't',
|
2862 |
-
'\u021B': 't',
|
2863 |
-
'\u0163': 't',
|
2864 |
-
'\u1E71': 't',
|
2865 |
-
'\u1E6F': 't',
|
2866 |
-
'\u0167': 't',
|
2867 |
-
'\u01AD': 't',
|
2868 |
-
'\u0288': 't',
|
2869 |
-
'\u2C66': 't',
|
2870 |
-
'\uA787': 't',
|
2871 |
-
'\uA729': 'tz',
|
2872 |
-
'\u24E4': 'u',
|
2873 |
-
'\uFF55': 'u',
|
2874 |
-
'\u00F9': 'u',
|
2875 |
-
'\u00FA': 'u',
|
2876 |
-
'\u00FB': 'u',
|
2877 |
-
'\u0169': 'u',
|
2878 |
-
'\u1E79': 'u',
|
2879 |
-
'\u016B': 'u',
|
2880 |
-
'\u1E7B': 'u',
|
2881 |
-
'\u016D': 'u',
|
2882 |
-
'\u00FC': 'u',
|
2883 |
-
'\u01DC': 'u',
|
2884 |
-
'\u01D8': 'u',
|
2885 |
-
'\u01D6': 'u',
|
2886 |
-
'\u01DA': 'u',
|
2887 |
-
'\u1EE7': 'u',
|
2888 |
-
'\u016F': 'u',
|
2889 |
-
'\u0171': 'u',
|
2890 |
-
'\u01D4': 'u',
|
2891 |
-
'\u0215': 'u',
|
2892 |
-
'\u0217': 'u',
|
2893 |
-
'\u01B0': 'u',
|
2894 |
-
'\u1EEB': 'u',
|
2895 |
-
'\u1EE9': 'u',
|
2896 |
-
'\u1EEF': 'u',
|
2897 |
-
'\u1EED': 'u',
|
2898 |
-
'\u1EF1': 'u',
|
2899 |
-
'\u1EE5': 'u',
|
2900 |
-
'\u1E73': 'u',
|
2901 |
-
'\u0173': 'u',
|
2902 |
-
'\u1E77': 'u',
|
2903 |
-
'\u1E75': 'u',
|
2904 |
-
'\u0289': 'u',
|
2905 |
-
'\u24E5': 'v',
|
2906 |
-
'\uFF56': 'v',
|
2907 |
-
'\u1E7D': 'v',
|
2908 |
-
'\u1E7F': 'v',
|
2909 |
-
'\u028B': 'v',
|
2910 |
-
'\uA75F': 'v',
|
2911 |
-
'\u028C': 'v',
|
2912 |
-
'\uA761': 'vy',
|
2913 |
-
'\u24E6': 'w',
|
2914 |
-
'\uFF57': 'w',
|
2915 |
-
'\u1E81': 'w',
|
2916 |
-
'\u1E83': 'w',
|
2917 |
-
'\u0175': 'w',
|
2918 |
-
'\u1E87': 'w',
|
2919 |
-
'\u1E85': 'w',
|
2920 |
-
'\u1E98': 'w',
|
2921 |
-
'\u1E89': 'w',
|
2922 |
-
'\u2C73': 'w',
|
2923 |
-
'\u24E7': 'x',
|
2924 |
-
'\uFF58': 'x',
|
2925 |
-
'\u1E8B': 'x',
|
2926 |
-
'\u1E8D': 'x',
|
2927 |
-
'\u24E8': 'y',
|
2928 |
-
'\uFF59': 'y',
|
2929 |
-
'\u1EF3': 'y',
|
2930 |
-
'\u00FD': 'y',
|
2931 |
-
'\u0177': 'y',
|
2932 |
-
'\u1EF9': 'y',
|
2933 |
-
'\u0233': 'y',
|
2934 |
-
'\u1E8F': 'y',
|
2935 |
-
'\u00FF': 'y',
|
2936 |
-
'\u1EF7': 'y',
|
2937 |
-
'\u1E99': 'y',
|
2938 |
-
'\u1EF5': 'y',
|
2939 |
-
'\u01B4': 'y',
|
2940 |
-
'\u024F': 'y',
|
2941 |
-
'\u1EFF': 'y',
|
2942 |
-
'\u24E9': 'z',
|
2943 |
-
'\uFF5A': 'z',
|
2944 |
-
'\u017A': 'z',
|
2945 |
-
'\u1E91': 'z',
|
2946 |
-
'\u017C': 'z',
|
2947 |
-
'\u017E': 'z',
|
2948 |
-
'\u1E93': 'z',
|
2949 |
-
'\u1E95': 'z',
|
2950 |
-
'\u01B6': 'z',
|
2951 |
-
'\u0225': 'z',
|
2952 |
-
'\u0240': 'z',
|
2953 |
-
'\u2C6C': 'z',
|
2954 |
-
'\uA763': 'z',
|
2955 |
-
'\u0386': '\u0391',
|
2956 |
-
'\u0388': '\u0395',
|
2957 |
-
'\u0389': '\u0397',
|
2958 |
-
'\u038A': '\u0399',
|
2959 |
-
'\u03AA': '\u0399',
|
2960 |
-
'\u038C': '\u039F',
|
2961 |
-
'\u038E': '\u03A5',
|
2962 |
-
'\u03AB': '\u03A5',
|
2963 |
-
'\u038F': '\u03A9',
|
2964 |
-
'\u03AC': '\u03B1',
|
2965 |
-
'\u03AD': '\u03B5',
|
2966 |
-
'\u03AE': '\u03B7',
|
2967 |
-
'\u03AF': '\u03B9',
|
2968 |
-
'\u03CA': '\u03B9',
|
2969 |
-
'\u0390': '\u03B9',
|
2970 |
-
'\u03CC': '\u03BF',
|
2971 |
-
'\u03CD': '\u03C5',
|
2972 |
-
'\u03CB': '\u03C5',
|
2973 |
-
'\u03B0': '\u03C5',
|
2974 |
-
'\u03C9': '\u03C9',
|
2975 |
-
'\u03C2': '\u03C3'
|
2976 |
-
};
|
2977 |
-
|
2978 |
-
return diacritics;
|
2979 |
-
});
|
2980 |
-
|
2981 |
-
S2.define('select2/data/base',[
|
2982 |
-
'../utils'
|
2983 |
-
], function (Utils) {
|
2984 |
-
function BaseAdapter ($element, options) {
|
2985 |
-
BaseAdapter.__super__.constructor.call(this);
|
2986 |
-
}
|
2987 |
-
|
2988 |
-
Utils.Extend(BaseAdapter, Utils.Observable);
|
2989 |
-
|
2990 |
-
BaseAdapter.prototype.current = function (callback) {
|
2991 |
-
throw new Error('The `current` method must be defined in child classes.');
|
2992 |
-
};
|
2993 |
-
|
2994 |
-
BaseAdapter.prototype.query = function (params, callback) {
|
2995 |
-
throw new Error('The `query` method must be defined in child classes.');
|
2996 |
-
};
|
2997 |
-
|
2998 |
-
BaseAdapter.prototype.bind = function (container, $container) {
|
2999 |
-
// Can be implemented in subclasses
|
3000 |
-
};
|
3001 |
-
|
3002 |
-
BaseAdapter.prototype.destroy = function () {
|
3003 |
-
// Can be implemented in subclasses
|
3004 |
-
};
|
3005 |
-
|
3006 |
-
BaseAdapter.prototype.generateResultId = function (container, data) {
|
3007 |
-
var id = container.id + '-result-';
|
3008 |
-
|
3009 |
-
id += Utils.generateChars(4);
|
3010 |
-
|
3011 |
-
if (data.id != null) {
|
3012 |
-
id += '-' + data.id.toString();
|
3013 |
-
} else {
|
3014 |
-
id += '-' + Utils.generateChars(4);
|
3015 |
-
}
|
3016 |
-
return id;
|
3017 |
-
};
|
3018 |
-
|
3019 |
-
return BaseAdapter;
|
3020 |
-
});
|
3021 |
-
|
3022 |
-
S2.define('select2/data/select',[
|
3023 |
-
'./base',
|
3024 |
-
'../utils',
|
3025 |
-
'jquery'
|
3026 |
-
], function (BaseAdapter, Utils, $) {
|
3027 |
-
function SelectAdapter ($element, options) {
|
3028 |
-
this.$element = $element;
|
3029 |
-
this.options = options;
|
3030 |
-
|
3031 |
-
SelectAdapter.__super__.constructor.call(this);
|
3032 |
-
}
|
3033 |
-
|
3034 |
-
Utils.Extend(SelectAdapter, BaseAdapter);
|
3035 |
-
|
3036 |
-
SelectAdapter.prototype.current = function (callback) {
|
3037 |
-
var data = [];
|
3038 |
-
var self = this;
|
3039 |
-
|
3040 |
-
this.$element.find(':selected').each(function () {
|
3041 |
-
var $option = $(this);
|
3042 |
-
|
3043 |
-
var option = self.item($option);
|
3044 |
-
|
3045 |
-
data.push(option);
|
3046 |
-
});
|
3047 |
-
|
3048 |
-
callback(data);
|
3049 |
-
};
|
3050 |
-
|
3051 |
-
SelectAdapter.prototype.select = function (data) {
|
3052 |
-
var self = this;
|
3053 |
-
|
3054 |
-
data.selected = true;
|
3055 |
-
|
3056 |
-
// If data.element is a DOM node, use it instead
|
3057 |
-
if ($(data.element).is('option')) {
|
3058 |
-
data.element.selected = true;
|
3059 |
-
|
3060 |
-
this.$element.trigger('change');
|
3061 |
-
|
3062 |
-
return;
|
3063 |
-
}
|
3064 |
-
|
3065 |
-
if (this.$element.prop('multiple')) {
|
3066 |
-
this.current(function (currentData) {
|
3067 |
-
var val = [];
|
3068 |
-
|
3069 |
-
data = [data];
|
3070 |
-
data.push.apply(data, currentData);
|
3071 |
-
|
3072 |
-
for (var d = 0; d < data.length; d++) {
|
3073 |
-
var id = data[d].id;
|
3074 |
-
|
3075 |
-
if ($.inArray(id, val) === -1) {
|
3076 |
-
val.push(id);
|
3077 |
-
}
|
3078 |
-
}
|
3079 |
-
|
3080 |
-
self.$element.val(val);
|
3081 |
-
self.$element.trigger('change');
|
3082 |
-
});
|
3083 |
-
} else {
|
3084 |
-
var val = data.id;
|
3085 |
-
|
3086 |
-
this.$element.val(val);
|
3087 |
-
this.$element.trigger('change');
|
3088 |
-
}
|
3089 |
-
};
|
3090 |
-
|
3091 |
-
SelectAdapter.prototype.unselect = function (data) {
|
3092 |
-
var self = this;
|
3093 |
-
|
3094 |
-
if (!this.$element.prop('multiple')) {
|
3095 |
-
return;
|
3096 |
-
}
|
3097 |
-
|
3098 |
-
data.selected = false;
|
3099 |
-
|
3100 |
-
if ($(data.element).is('option')) {
|
3101 |
-
data.element.selected = false;
|
3102 |
-
|
3103 |
-
this.$element.trigger('change');
|
3104 |
-
|
3105 |
-
return;
|
3106 |
-
}
|
3107 |
-
|
3108 |
-
this.current(function (currentData) {
|
3109 |
-
var val = [];
|
3110 |
-
|
3111 |
-
for (var d = 0; d < currentData.length; d++) {
|
3112 |
-
var id = currentData[d].id;
|
3113 |
-
|
3114 |
-
if (id !== data.id && $.inArray(id, val) === -1) {
|
3115 |
-
val.push(id);
|
3116 |
-
}
|
3117 |
-
}
|
3118 |
-
|
3119 |
-
self.$element.val(val);
|
3120 |
-
|
3121 |
-
self.$element.trigger('change');
|
3122 |
-
});
|
3123 |
-
};
|
3124 |
-
|
3125 |
-
SelectAdapter.prototype.bind = function (container, $container) {
|
3126 |
-
var self = this;
|
3127 |
-
|
3128 |
-
this.container = container;
|
3129 |
-
|
3130 |
-
container.on('select', function (params) {
|
3131 |
-
self.select(params.data);
|
3132 |
-
});
|
3133 |
-
|
3134 |
-
container.on('unselect', function (params) {
|
3135 |
-
self.unselect(params.data);
|
3136 |
-
});
|
3137 |
-
};
|
3138 |
-
|
3139 |
-
SelectAdapter.prototype.destroy = function () {
|
3140 |
-
// Remove anything added to child elements
|
3141 |
-
this.$element.find('*').each(function () {
|
3142 |
-
// Remove any custom data set by Select2
|
3143 |
-
$.removeData(this, 'data');
|
3144 |
-
});
|
3145 |
-
};
|
3146 |
-
|
3147 |
-
SelectAdapter.prototype.query = function (params, callback) {
|
3148 |
-
var data = [];
|
3149 |
-
var self = this;
|
3150 |
-
|
3151 |
-
var $options = this.$element.children();
|
3152 |
-
|
3153 |
-
$options.each(function () {
|
3154 |
-
var $option = $(this);
|
3155 |
-
|
3156 |
-
if (!$option.is('option') && !$option.is('optgroup')) {
|
3157 |
-
return;
|
3158 |
-
}
|
3159 |
-
|
3160 |
-
var option = self.item($option);
|
3161 |
-
|
3162 |
-
var matches = self.matches(params, option);
|
3163 |
-
|
3164 |
-
if (matches !== null) {
|
3165 |
-
data.push(matches);
|
3166 |
-
}
|
3167 |
-
});
|
3168 |
-
|
3169 |
-
callback({
|
3170 |
-
results: data
|
3171 |
-
});
|
3172 |
-
};
|
3173 |
-
|
3174 |
-
SelectAdapter.prototype.addOptions = function ($options) {
|
3175 |
-
Utils.appendMany(this.$element, $options);
|
3176 |
-
};
|
3177 |
-
|
3178 |
-
SelectAdapter.prototype.option = function (data) {
|
3179 |
-
var option;
|
3180 |
-
|
3181 |
-
if (data.children) {
|
3182 |
-
option = document.createElement('optgroup');
|
3183 |
-
option.label = data.text;
|
3184 |
-
} else {
|
3185 |
-
option = document.createElement('option');
|
3186 |
-
|
3187 |
-
if (option.textContent !== undefined) {
|
3188 |
-
option.textContent = data.text;
|
3189 |
-
} else {
|
3190 |
-
option.innerText = data.text;
|
3191 |
-
}
|
3192 |
-
}
|
3193 |
-
|
3194 |
-
if (data.id) {
|
3195 |
-
option.value = data.id;
|
3196 |
-
}
|
3197 |
-
|
3198 |
-
if (data.disabled) {
|
3199 |
-
option.disabled = true;
|
3200 |
-
}
|
3201 |
-
|
3202 |
-
if (data.selected) {
|
3203 |
-
option.selected = true;
|
3204 |
-
}
|
3205 |
-
|
3206 |
-
if (data.title) {
|
3207 |
-
option.title = data.title;
|
3208 |
-
}
|
3209 |
-
|
3210 |
-
var $option = $(option);
|
3211 |
-
|
3212 |
-
var normalizedData = this._normalizeItem(data);
|
3213 |
-
normalizedData.element = option;
|
3214 |
-
|
3215 |
-
// Override the option's data with the combined data
|
3216 |
-
$.data(option, 'data', normalizedData);
|
3217 |
-
|
3218 |
-
return $option;
|
3219 |
-
};
|
3220 |
-
|
3221 |
-
SelectAdapter.prototype.item = function ($option) {
|
3222 |
-
var data = {};
|
3223 |
-
|
3224 |
-
data = $.data($option[0], 'data');
|
3225 |
-
|
3226 |
-
if (data != null) {
|
3227 |
-
return data;
|
3228 |
-
}
|
3229 |
-
|
3230 |
-
if ($option.is('option')) {
|
3231 |
-
data = {
|
3232 |
-
id: $option.val(),
|
3233 |
-
text: $option.text(),
|
3234 |
-
disabled: $option.prop('disabled'),
|
3235 |
-
selected: $option.prop('selected'),
|
3236 |
-
title: $option.prop('title')
|
3237 |
-
};
|
3238 |
-
} else if ($option.is('optgroup')) {
|
3239 |
-
data = {
|
3240 |
-
text: $option.prop('label'),
|
3241 |
-
children: [],
|
3242 |
-
title: $option.prop('title')
|
3243 |
-
};
|
3244 |
-
|
3245 |
-
var $children = $option.children('option');
|
3246 |
-
var children = [];
|
3247 |
-
|
3248 |
-
for (var c = 0; c < $children.length; c++) {
|
3249 |
-
var $child = $($children[c]);
|
3250 |
-
|
3251 |
-
var child = this.item($child);
|
3252 |
-
|
3253 |
-
children.push(child);
|
3254 |
-
}
|
3255 |
-
|
3256 |
-
data.children = children;
|
3257 |
-
}
|
3258 |
-
|
3259 |
-
data = this._normalizeItem(data);
|
3260 |
-
data.element = $option[0];
|
3261 |
-
|
3262 |
-
$.data($option[0], 'data', data);
|
3263 |
-
|
3264 |
-
return data;
|
3265 |
-
};
|
3266 |
-
|
3267 |
-
SelectAdapter.prototype._normalizeItem = function (item) {
|
3268 |
-
if (!$.isPlainObject(item)) {
|
3269 |
-
item = {
|
3270 |
-
id: item,
|
3271 |
-
text: item
|
3272 |
-
};
|
3273 |
-
}
|
3274 |
-
|
3275 |
-
item = $.extend({}, {
|
3276 |
-
text: ''
|
3277 |
-
}, item);
|
3278 |
-
|
3279 |
-
var defaults = {
|
3280 |
-
selected: false,
|
3281 |
-
disabled: false
|
3282 |
-
};
|
3283 |
-
|
3284 |
-
if (item.id != null) {
|
3285 |
-
item.id = item.id.toString();
|
3286 |
-
}
|
3287 |
-
|
3288 |
-
if (item.text != null) {
|
3289 |
-
item.text = item.text.toString();
|
3290 |
-
}
|
3291 |
-
|
3292 |
-
if (item._resultId == null && item.id && this.container != null) {
|
3293 |
-
item._resultId = this.generateResultId(this.container, item);
|
3294 |
-
}
|
3295 |
-
|
3296 |
-
return $.extend({}, defaults, item);
|
3297 |
-
};
|
3298 |
-
|
3299 |
-
SelectAdapter.prototype.matches = function (params, data) {
|
3300 |
-
var matcher = this.options.get('matcher');
|
3301 |
-
|
3302 |
-
return matcher(params, data);
|
3303 |
-
};
|
3304 |
-
|
3305 |
-
return SelectAdapter;
|
3306 |
-
});
|
3307 |
-
|
3308 |
-
S2.define('select2/data/array',[
|
3309 |
-
'./select',
|
3310 |
-
'../utils',
|
3311 |
-
'jquery'
|
3312 |
-
], function (SelectAdapter, Utils, $) {
|
3313 |
-
function ArrayAdapter ($element, options) {
|
3314 |
-
var data = options.get('data') || [];
|
3315 |
-
|
3316 |
-
ArrayAdapter.__super__.constructor.call(this, $element, options);
|
3317 |
-
|
3318 |
-
this.addOptions(this.convertToOptions(data));
|
3319 |
-
}
|
3320 |
-
|
3321 |
-
Utils.Extend(ArrayAdapter, SelectAdapter);
|
3322 |
-
|
3323 |
-
ArrayAdapter.prototype.select = function (data) {
|
3324 |
-
var $option = this.$element.find('option').filter(function (i, elm) {
|
3325 |
-
return elm.value == data.id.toString();
|
3326 |
-
});
|
3327 |
-
|
3328 |
-
if ($option.length === 0) {
|
3329 |
-
$option = this.option(data);
|
3330 |
-
|
3331 |
-
this.addOptions($option);
|
3332 |
-
}
|
3333 |
-
|
3334 |
-
ArrayAdapter.__super__.select.call(this, data);
|
3335 |
-
};
|
3336 |
-
|
3337 |
-
ArrayAdapter.prototype.convertToOptions = function (data) {
|
3338 |
-
var self = this;
|
3339 |
-
|
3340 |
-
var $existing = this.$element.find('option');
|
3341 |
-
var existingIds = $existing.map(function () {
|
3342 |
-
return self.item($(this)).id;
|
3343 |
-
}).get();
|
3344 |
-
|
3345 |
-
var $options = [];
|
3346 |
-
|
3347 |
-
// Filter out all items except for the one passed in the argument
|
3348 |
-
function onlyItem (item) {
|
3349 |
-
return function () {
|
3350 |
-
return $(this).val() == item.id;
|
3351 |
-
};
|
3352 |
-
}
|
3353 |
-
|
3354 |
-
for (var d = 0; d < data.length; d++) {
|
3355 |
-
var item = this._normalizeItem(data[d]);
|
3356 |
-
|
3357 |
-
// Skip items which were pre-loaded, only merge the data
|
3358 |
-
if ($.inArray(item.id, existingIds) >= 0) {
|
3359 |
-
var $existingOption = $existing.filter(onlyItem(item));
|
3360 |
-
|
3361 |
-
var existingData = this.item($existingOption);
|
3362 |
-
var newData = $.extend(true, {}, item, existingData);
|
3363 |
-
|
3364 |
-
var $newOption = this.option(newData);
|
3365 |
-
|
3366 |
-
$existingOption.replaceWith($newOption);
|
3367 |
-
|
3368 |
-
continue;
|
3369 |
-
}
|
3370 |
-
|
3371 |
-
var $option = this.option(item);
|
3372 |
-
|
3373 |
-
if (item.children) {
|
3374 |
-
var $children = this.convertToOptions(item.children);
|
3375 |
-
|
3376 |
-
Utils.appendMany($option, $children);
|
3377 |
-
}
|
3378 |
-
|
3379 |
-
$options.push($option);
|
3380 |
-
}
|
3381 |
-
|
3382 |
-
return $options;
|
3383 |
-
};
|
3384 |
-
|
3385 |
-
return ArrayAdapter;
|
3386 |
-
});
|
3387 |
-
|
3388 |
-
S2.define('select2/data/ajax',[
|
3389 |
-
'./array',
|
3390 |
-
'../utils',
|
3391 |
-
'jquery'
|
3392 |
-
], function (ArrayAdapter, Utils, $) {
|
3393 |
-
function AjaxAdapter ($element, options) {
|
3394 |
-
this.ajaxOptions = this._applyDefaults(options.get('ajax'));
|
3395 |
-
|
3396 |
-
if (this.ajaxOptions.processResults != null) {
|
3397 |
-
this.processResults = this.ajaxOptions.processResults;
|
3398 |
-
}
|
3399 |
-
|
3400 |
-
AjaxAdapter.__super__.constructor.call(this, $element, options);
|
3401 |
-
}
|
3402 |
-
|
3403 |
-
Utils.Extend(AjaxAdapter, ArrayAdapter);
|
3404 |
-
|
3405 |
-
AjaxAdapter.prototype._applyDefaults = function (options) {
|
3406 |
-
var defaults = {
|
3407 |
-
data: function (params) {
|
3408 |
-
return $.extend({}, params, {
|
3409 |
-
q: params.term
|
3410 |
-
});
|
3411 |
-
},
|
3412 |
-
transport: function (params, success, failure) {
|
3413 |
-
var $request = $.ajax(params);
|
3414 |
-
|
3415 |
-
$request.then(success);
|
3416 |
-
$request.fail(failure);
|
3417 |
-
|
3418 |
-
return $request;
|
3419 |
-
}
|
3420 |
-
};
|
3421 |
-
|
3422 |
-
return $.extend({}, defaults, options, true);
|
3423 |
-
};
|
3424 |
-
|
3425 |
-
AjaxAdapter.prototype.processResults = function (results) {
|
3426 |
-
return results;
|
3427 |
-
};
|
3428 |
-
|
3429 |
-
AjaxAdapter.prototype.query = function (params, callback) {
|
3430 |
-
var matches = [];
|
3431 |
-
var self = this;
|
3432 |
-
|
3433 |
-
if (this._request != null) {
|
3434 |
-
// JSONP requests cannot always be aborted
|
3435 |
-
if ($.isFunction(this._request.abort)) {
|
3436 |
-
this._request.abort();
|
3437 |
-
}
|
3438 |
-
|
3439 |
-
this._request = null;
|
3440 |
-
}
|
3441 |
-
|
3442 |
-
var options = $.extend({
|
3443 |
-
type: 'GET'
|
3444 |
-
}, this.ajaxOptions);
|
3445 |
-
|
3446 |
-
if (typeof options.url === 'function') {
|
3447 |
-
options.url = options.url.call(this.$element, params);
|
3448 |
-
}
|
3449 |
-
|
3450 |
-
if (typeof options.data === 'function') {
|
3451 |
-
options.data = options.data.call(this.$element, params);
|
3452 |
-
}
|
3453 |
-
|
3454 |
-
function request () {
|
3455 |
-
var $request = options.transport(options, function (data) {
|
3456 |
-
var results = self.processResults(data, params);
|
3457 |
-
|
3458 |
-
if (self.options.get('debug') && window.console && console.error) {
|
3459 |
-
// Check to make sure that the response included a `results` key.
|
3460 |
-
if (!results || !results.results || !$.isArray(results.results)) {
|
3461 |
-
console.error(
|
3462 |
-
'Select2: The AJAX results did not return an array in the ' +
|
3463 |
-
'`results` key of the response.'
|
3464 |
-
);
|
3465 |
-
}
|
3466 |
-
}
|
3467 |
-
|
3468 |
-
callback(results);
|
3469 |
-
}, function () {
|
3470 |
-
// Attempt to detect if a request was aborted
|
3471 |
-
// Only works if the transport exposes a status property
|
3472 |
-
if ($request.status && $request.status === '0') {
|
3473 |
-
return;
|
3474 |
-
}
|
3475 |
-
|
3476 |
-
self.trigger('results:message', {
|
3477 |
-
message: 'errorLoading'
|
3478 |
-
});
|
3479 |
-
});
|
3480 |
-
|
3481 |
-
self._request = $request;
|
3482 |
-
}
|
3483 |
-
|
3484 |
-
if (this.ajaxOptions.delay && params.term != null) {
|
3485 |
-
if (this._queryTimeout) {
|
3486 |
-
window.clearTimeout(this._queryTimeout);
|
3487 |
-
}
|
3488 |
-
|
3489 |
-
this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
|
3490 |
-
} else {
|
3491 |
-
request();
|
3492 |
-
}
|
3493 |
-
};
|
3494 |
-
|
3495 |
-
return AjaxAdapter;
|
3496 |
-
});
|
3497 |
-
|
3498 |
-
S2.define('select2/data/tags',[
|
3499 |
-
'jquery'
|
3500 |
-
], function ($) {
|
3501 |
-
function Tags (decorated, $element, options) {
|
3502 |
-
var tags = options.get('tags');
|
3503 |
-
|
3504 |
-
var createTag = options.get('createTag');
|
3505 |
-
|
3506 |
-
if (createTag !== undefined) {
|
3507 |
-
this.createTag = createTag;
|
3508 |
-
}
|
3509 |
-
|
3510 |
-
var insertTag = options.get('insertTag');
|
3511 |
-
|
3512 |
-
if (insertTag !== undefined) {
|
3513 |
-
this.insertTag = insertTag;
|
3514 |
-
}
|
3515 |
-
|
3516 |
-
decorated.call(this, $element, options);
|
3517 |
-
|
3518 |
-
if ($.isArray(tags)) {
|
3519 |
-
for (var t = 0; t < tags.length; t++) {
|
3520 |
-
var tag = tags[t];
|
3521 |
-
var item = this._normalizeItem(tag);
|
3522 |
-
|
3523 |
-
var $option = this.option(item);
|
3524 |
-
|
3525 |
-
this.$element.append($option);
|
3526 |
-
}
|
3527 |
-
}
|
3528 |
-
}
|
3529 |
-
|
3530 |
-
Tags.prototype.query = function (decorated, params, callback) {
|
3531 |
-
var self = this;
|
3532 |
-
|
3533 |
-
this._removeOldTags();
|
3534 |
-
|
3535 |
-
if (params.term == null || params.page != null) {
|
3536 |
-
decorated.call(this, params, callback);
|
3537 |
-
return;
|
3538 |
-
}
|
3539 |
-
|
3540 |
-
function wrapper (obj, child) {
|
3541 |
-
var data = obj.results;
|
3542 |
-
|
3543 |
-
for (var i = 0; i < data.length; i++) {
|
3544 |
-
var option = data[i];
|
3545 |
-
|
3546 |
-
var checkChildren = (
|
3547 |
-
option.children != null &&
|
3548 |
-
!wrapper({
|
3549 |
-
results: option.children
|
3550 |
-
}, true)
|
3551 |
-
);
|
3552 |
-
|
3553 |
-
var checkText = option.text === params.term;
|
3554 |
-
|
3555 |
-
if (checkText || checkChildren) {
|
3556 |
-
if (child) {
|
3557 |
-
return false;
|
3558 |
-
}
|
3559 |
-
|
3560 |
-
obj.data = data;
|
3561 |
-
callback(obj);
|
3562 |
-
|
3563 |
-
return;
|
3564 |
-
}
|
3565 |
-
}
|
3566 |
-
|
3567 |
-
if (child) {
|
3568 |
-
return true;
|
3569 |
-
}
|
3570 |
-
|
3571 |
-
var tag = self.createTag(params);
|
3572 |
-
|
3573 |
-
if (tag != null) {
|
3574 |
-
var $option = self.option(tag);
|
3575 |
-
$option.attr('data-select2-tag', true);
|
3576 |
-
|
3577 |
-
self.addOptions([$option]);
|
3578 |
-
|
3579 |
-
self.insertTag(data, tag);
|
3580 |
-
}
|
3581 |
-
|
3582 |
-
obj.results = data;
|
3583 |
-
|
3584 |
-
callback(obj);
|
3585 |
-
}
|
3586 |
-
|
3587 |
-
decorated.call(this, params, wrapper);
|
3588 |
-
};
|
3589 |
-
|
3590 |
-
Tags.prototype.createTag = function (decorated, params) {
|
3591 |
-
var term = $.trim(params.term);
|
3592 |
-
|
3593 |
-
if (term === '') {
|
3594 |
-
return null;
|
3595 |
-
}
|
3596 |
-
|
3597 |
-
return {
|
3598 |
-
id: term,
|
3599 |
-
text: term
|
3600 |
-
};
|
3601 |
-
};
|
3602 |
-
|
3603 |
-
Tags.prototype.insertTag = function (_, data, tag) {
|
3604 |
-
data.unshift(tag);
|
3605 |
-
};
|
3606 |
-
|
3607 |
-
Tags.prototype._removeOldTags = function (_) {
|
3608 |
-
var tag = this._lastTag;
|
3609 |
-
|
3610 |
-
var $options = this.$element.find('option[data-select2-tag]');
|
3611 |
-
|
3612 |
-
$options.each(function () {
|
3613 |
-
if (this.selected) {
|
3614 |
-
return;
|
3615 |
-
}
|
3616 |
-
|
3617 |
-
$(this).remove();
|
3618 |
-
});
|
3619 |
-
};
|
3620 |
-
|
3621 |
-
return Tags;
|
3622 |
-
});
|
3623 |
-
|
3624 |
-
S2.define('select2/data/tokenizer',[
|
3625 |
-
'jquery'
|
3626 |
-
], function ($) {
|
3627 |
-
function Tokenizer (decorated, $element, options) {
|
3628 |
-
var tokenizer = options.get('tokenizer');
|
3629 |
-
|
3630 |
-
if (tokenizer !== undefined) {
|
3631 |
-
this.tokenizer = tokenizer;
|
3632 |
-
}
|
3633 |
-
|
3634 |
-
decorated.call(this, $element, options);
|
3635 |
-
}
|
3636 |
-
|
3637 |
-
Tokenizer.prototype.bind = function (decorated, container, $container) {
|
3638 |
-
decorated.call(this, container, $container);
|
3639 |
-
|
3640 |
-
this.$search = container.dropdown.$search || container.selection.$search ||
|
3641 |
-
$container.find('.select2-search__field');
|
3642 |
-
};
|
3643 |
-
|
3644 |
-
Tokenizer.prototype.query = function (decorated, params, callback) {
|
3645 |
-
var self = this;
|
3646 |
-
|
3647 |
-
function createAndSelect (data) {
|
3648 |
-
// Normalize the data object so we can use it for checks
|
3649 |
-
var item = self._normalizeItem(data);
|
3650 |
-
|
3651 |
-
// Check if the data object already exists as a tag
|
3652 |
-
// Select it if it doesn't
|
3653 |
-
var $existingOptions = self.$element.find('option').filter(function () {
|
3654 |
-
return $(this).val() === item.id;
|
3655 |
-
});
|
3656 |
-
|
3657 |
-
// If an existing option wasn't found for it, create the option
|
3658 |
-
if (!$existingOptions.length) {
|
3659 |
-
var $option = self.option(item);
|
3660 |
-
$option.attr('data-select2-tag', true);
|
3661 |
-
|
3662 |
-
self._removeOldTags();
|
3663 |
-
self.addOptions([$option]);
|
3664 |
-
}
|
3665 |
-
|
3666 |
-
// Select the item, now that we know there is an option for it
|
3667 |
-
select(item);
|
3668 |
-
}
|
3669 |
-
|
3670 |
-
function select (data) {
|
3671 |
-
self.trigger('select', {
|
3672 |
-
data: data
|
3673 |
-
});
|
3674 |
-
}
|
3675 |
-
|
3676 |
-
params.term = params.term || '';
|
3677 |
-
|
3678 |
-
var tokenData = this.tokenizer(params, this.options, createAndSelect);
|
3679 |
-
|
3680 |
-
if (tokenData.term !== params.term) {
|
3681 |
-
// Replace the search term if we have the search box
|
3682 |
-
if (this.$search.length) {
|
3683 |
-
this.$search.val(tokenData.term);
|
3684 |
-
this.$search.focus();
|
3685 |
-
}
|
3686 |
-
|
3687 |
-
params.term = tokenData.term;
|
3688 |
-
}
|
3689 |
-
|
3690 |
-
decorated.call(this, params, callback);
|
3691 |
-
};
|
3692 |
-
|
3693 |
-
Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
|
3694 |
-
var separators = options.get('tokenSeparators') || [];
|
3695 |
-
var term = params.term;
|
3696 |
-
var i = 0;
|
3697 |
-
|
3698 |
-
var createTag = this.createTag || function (params) {
|
3699 |
-
return {
|
3700 |
-
id: params.term,
|
3701 |
-
text: params.term
|
3702 |
-
};
|
3703 |
-
};
|
3704 |
-
|
3705 |
-
while (i < term.length) {
|
3706 |
-
var termChar = term[i];
|
3707 |
-
|
3708 |
-
if ($.inArray(termChar, separators) === -1) {
|
3709 |
-
i++;
|
3710 |
-
|
3711 |
-
continue;
|
3712 |
-
}
|
3713 |
-
|
3714 |
-
var part = term.substr(0, i);
|
3715 |
-
var partParams = $.extend({}, params, {
|
3716 |
-
term: part
|
3717 |
-
});
|
3718 |
-
|
3719 |
-
var data = createTag(partParams);
|
3720 |
-
|
3721 |
-
if (data == null) {
|
3722 |
-
i++;
|
3723 |
-
continue;
|
3724 |
-
}
|
3725 |
-
|
3726 |
-
callback(data);
|
3727 |
-
|
3728 |
-
// Reset the term to not include the tokenized portion
|
3729 |
-
term = term.substr(i + 1) || '';
|
3730 |
-
i = 0;
|
3731 |
-
}
|
3732 |
-
|
3733 |
-
return {
|
3734 |
-
term: term
|
3735 |
-
};
|
3736 |
-
};
|
3737 |
-
|
3738 |
-
return Tokenizer;
|
3739 |
-
});
|
3740 |
-
|
3741 |
-
S2.define('select2/data/minimumInputLength',[
|
3742 |
-
|
3743 |
-
], function () {
|
3744 |
-
function MinimumInputLength (decorated, $e, options) {
|
3745 |
-
this.minimumInputLength = options.get('minimumInputLength');
|
3746 |
-
|
3747 |
-
decorated.call(this, $e, options);
|
3748 |
-
}
|
3749 |
-
|
3750 |
-
MinimumInputLength.prototype.query = function (decorated, params, callback) {
|
3751 |
-
params.term = params.term || '';
|
3752 |
-
|
3753 |
-
if (params.term.length < this.minimumInputLength) {
|
3754 |
-
this.trigger('results:message', {
|
3755 |
-
message: 'inputTooShort',
|
3756 |
-
args: {
|
3757 |
-
minimum: this.minimumInputLength,
|
3758 |
-
input: params.term,
|
3759 |
-
params: params
|
3760 |
-
}
|
3761 |
-
});
|
3762 |
-
|
3763 |
-
return;
|
3764 |
-
}
|
3765 |
-
|
3766 |
-
decorated.call(this, params, callback);
|
3767 |
-
};
|
3768 |
-
|
3769 |
-
return MinimumInputLength;
|
3770 |
-
});
|
3771 |
-
|
3772 |
-
S2.define('select2/data/maximumInputLength',[
|
3773 |
-
|
3774 |
-
], function () {
|
3775 |
-
function MaximumInputLength (decorated, $e, options) {
|
3776 |
-
this.maximumInputLength = options.get('maximumInputLength');
|
3777 |
-
|
3778 |
-
decorated.call(this, $e, options);
|
3779 |
-
}
|
3780 |
-
|
3781 |
-
MaximumInputLength.prototype.query = function (decorated, params, callback) {
|
3782 |
-
params.term = params.term || '';
|
3783 |
-
|
3784 |
-
if (this.maximumInputLength > 0 &&
|
3785 |
-
params.term.length > this.maximumInputLength) {
|
3786 |
-
this.trigger('results:message', {
|
3787 |
-
message: 'inputTooLong',
|
3788 |
-
args: {
|
3789 |
-
maximum: this.maximumInputLength,
|
3790 |
-
input: params.term,
|
3791 |
-
params: params
|
3792 |
-
}
|
3793 |
-
});
|
3794 |
-
|
3795 |
-
return;
|
3796 |
-
}
|
3797 |
-
|
3798 |
-
decorated.call(this, params, callback);
|
3799 |
-
};
|
3800 |
-
|
3801 |
-
return MaximumInputLength;
|
3802 |
-
});
|
3803 |
-
|
3804 |
-
S2.define('select2/data/maximumSelectionLength',[
|
3805 |
-
|
3806 |
-
], function (){
|
3807 |
-
function MaximumSelectionLength (decorated, $e, options) {
|
3808 |
-
this.maximumSelectionLength = options.get('maximumSelectionLength');
|
3809 |
-
|
3810 |
-
decorated.call(this, $e, options);
|
3811 |
-
}
|
3812 |
-
|
3813 |
-
MaximumSelectionLength.prototype.query =
|
3814 |
-
function (decorated, params, callback) {
|
3815 |
-
var self = this;
|
3816 |
-
|
3817 |
-
this.current(function (currentData) {
|
3818 |
-
var count = currentData != null ? currentData.length : 0;
|
3819 |
-
if (self.maximumSelectionLength > 0 &&
|
3820 |
-
count >= self.maximumSelectionLength) {
|
3821 |
-
self.trigger('results:message', {
|
3822 |
-
message: 'maximumSelected',
|
3823 |
-
args: {
|
3824 |
-
maximum: self.maximumSelectionLength
|
3825 |
-
}
|
3826 |
-
});
|
3827 |
-
return;
|
3828 |
-
}
|
3829 |
-
decorated.call(self, params, callback);
|
3830 |
-
});
|
3831 |
-
};
|
3832 |
-
|
3833 |
-
return MaximumSelectionLength;
|
3834 |
-
});
|
3835 |
-
|
3836 |
-
S2.define('select2/dropdown',[
|
3837 |
-
'jquery',
|
3838 |
-
'./utils'
|
3839 |
-
], function ($, Utils) {
|
3840 |
-
function Dropdown ($element, options) {
|
3841 |
-
this.$element = $element;
|
3842 |
-
this.options = options;
|
3843 |
-
|
3844 |
-
Dropdown.__super__.constructor.call(this);
|
3845 |
-
}
|
3846 |
-
|
3847 |
-
Utils.Extend(Dropdown, Utils.Observable);
|
3848 |
-
|
3849 |
-
Dropdown.prototype.render = function () {
|
3850 |
-
var $dropdown = $(
|
3851 |
-
'<span class="select2-dropdown">' +
|
3852 |
-
'<span class="select2-results"></span>' +
|
3853 |
-
'</span>'
|
3854 |
-
);
|
3855 |
-
|
3856 |
-
$dropdown.attr('dir', this.options.get('dir'));
|
3857 |
-
|
3858 |
-
this.$dropdown = $dropdown;
|
3859 |
-
|
3860 |
-
return $dropdown;
|
3861 |
-
};
|
3862 |
-
|
3863 |
-
Dropdown.prototype.bind = function () {
|
3864 |
-
// Should be implemented in subclasses
|
3865 |
-
};
|
3866 |
-
|
3867 |
-
Dropdown.prototype.position = function ($dropdown, $container) {
|
3868 |
-
// Should be implmented in subclasses
|
3869 |
-
};
|
3870 |
-
|
3871 |
-
Dropdown.prototype.destroy = function () {
|
3872 |
-
// Remove the dropdown from the DOM
|
3873 |
-
this.$dropdown.remove();
|
3874 |
-
};
|
3875 |
-
|
3876 |
-
return Dropdown;
|
3877 |
-
});
|
3878 |
-
|
3879 |
-
S2.define('select2/dropdown/search',[
|
3880 |
-
'jquery',
|
3881 |
-
'../utils'
|
3882 |
-
], function ($, Utils) {
|
3883 |
-
function Search () { }
|
3884 |
-
|
3885 |
-
Search.prototype.render = function (decorated) {
|
3886 |
-
var $rendered = decorated.call(this);
|
3887 |
-
|
3888 |
-
var $search = $(
|
3889 |
-
'<span class="select2-search select2-search--dropdown">' +
|
3890 |
-
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
3891 |
-
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
|
3892 |
-
' spellcheck="false" role="textbox" />' +
|
3893 |
-
'</span>'
|
3894 |
-
);
|
3895 |
-
|
3896 |
-
this.$searchContainer = $search;
|
3897 |
-
this.$search = $search.find('input');
|
3898 |
-
|
3899 |
-
$rendered.prepend($search);
|
3900 |
-
|
3901 |
-
return $rendered;
|
3902 |
-
};
|
3903 |
-
|
3904 |
-
Search.prototype.bind = function (decorated, container, $container) {
|
3905 |
-
var self = this;
|
3906 |
-
|
3907 |
-
decorated.call(this, container, $container);
|
3908 |
-
|
3909 |
-
this.$search.on('keydown', function (evt) {
|
3910 |
-
self.trigger('keypress', evt);
|
3911 |
-
|
3912 |
-
self._keyUpPrevented = evt.isDefaultPrevented();
|
3913 |
-
});
|
3914 |
-
|
3915 |
-
// Workaround for browsers which do not support the `input` event
|
3916 |
-
// This will prevent double-triggering of events for browsers which support
|
3917 |
-
// both the `keyup` and `input` events.
|
3918 |
-
this.$search.on('input', function (evt) {
|
3919 |
-
// Unbind the duplicated `keyup` event
|
3920 |
-
$(this).off('keyup');
|
3921 |
-
});
|
3922 |
-
|
3923 |
-
this.$search.on('keyup input', function (evt) {
|
3924 |
-
self.handleSearch(evt);
|
3925 |
-
});
|
3926 |
-
|
3927 |
-
container.on('open', function () {
|
3928 |
-
self.$search.attr('tabindex', 0);
|
3929 |
-
|
3930 |
-
self.$search.focus();
|
3931 |
-
|
3932 |
-
window.setTimeout(function () {
|
3933 |
-
self.$search.focus();
|
3934 |
-
}, 0);
|
3935 |
-
});
|
3936 |
-
|
3937 |
-
container.on('close', function () {
|
3938 |
-
self.$search.attr('tabindex', -1);
|
3939 |
-
|
3940 |
-
self.$search.val('');
|
3941 |
-
});
|
3942 |
-
|
3943 |
-
container.on('focus', function () {
|
3944 |
-
if (container.isOpen()) {
|
3945 |
-
self.$search.focus();
|
3946 |
-
}
|
3947 |
-
});
|
3948 |
-
|
3949 |
-
container.on('results:all', function (params) {
|
3950 |
-
if (params.query.term == null || params.query.term === '') {
|
3951 |
-
var showSearch = self.showSearch(params);
|
3952 |
-
|
3953 |
-
if (showSearch) {
|
3954 |
-
self.$searchContainer.removeClass('select2-search--hide');
|
3955 |
-
} else {
|
3956 |
-
self.$searchContainer.addClass('select2-search--hide');
|
3957 |
-
}
|
3958 |
-
}
|
3959 |
-
});
|
3960 |
-
};
|
3961 |
-
|
3962 |
-
Search.prototype.handleSearch = function (evt) {
|
3963 |
-
if (!this._keyUpPrevented) {
|
3964 |
-
var input = this.$search.val();
|
3965 |
-
|
3966 |
-
this.trigger('query', {
|
3967 |
-
term: input
|
3968 |
-
});
|
3969 |
-
}
|
3970 |
-
|
3971 |
-
this._keyUpPrevented = false;
|
3972 |
-
};
|
3973 |
-
|
3974 |
-
Search.prototype.showSearch = function (_, params) {
|
3975 |
-
return true;
|
3976 |
-
};
|
3977 |
-
|
3978 |
-
return Search;
|
3979 |
-
});
|
3980 |
-
|
3981 |
-
S2.define('select2/dropdown/hidePlaceholder',[
|
3982 |
-
|
3983 |
-
], function () {
|
3984 |
-
function HidePlaceholder (decorated, $element, options, dataAdapter) {
|
3985 |
-
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
3986 |
-
|
3987 |
-
decorated.call(this, $element, options, dataAdapter);
|
3988 |
-
}
|
3989 |
-
|
3990 |
-
HidePlaceholder.prototype.append = function (decorated, data) {
|
3991 |
-
data.results = this.removePlaceholder(data.results);
|
3992 |
-
|
3993 |
-
decorated.call(this, data);
|
3994 |
-
};
|
3995 |
-
|
3996 |
-
HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
3997 |
-
if (typeof placeholder === 'string') {
|
3998 |
-
placeholder = {
|
3999 |
-
id: '',
|
4000 |
-
text: placeholder
|
4001 |
-
};
|
4002 |
-
}
|
4003 |
-
|
4004 |
-
return placeholder;
|
4005 |
-
};
|
4006 |
-
|
4007 |
-
HidePlaceholder.prototype.removePlaceholder = function (_, data) {
|
4008 |
-
var modifiedData = data.slice(0);
|
4009 |
-
|
4010 |
-
for (var d = data.length - 1; d >= 0; d--) {
|
4011 |
-
var item = data[d];
|
4012 |
-
|
4013 |
-
if (this.placeholder.id === item.id) {
|
4014 |
-
modifiedData.splice(d, 1);
|
4015 |
-
}
|
4016 |
-
}
|
4017 |
-
|
4018 |
-
return modifiedData;
|
4019 |
-
};
|
4020 |
-
|
4021 |
-
return HidePlaceholder;
|
4022 |
-
});
|
4023 |
-
|
4024 |
-
S2.define('select2/dropdown/infiniteScroll',[
|
4025 |
-
'jquery'
|
4026 |
-
], function ($) {
|
4027 |
-
function InfiniteScroll (decorated, $element, options, dataAdapter) {
|
4028 |
-
this.lastParams = {};
|
4029 |
-
|
4030 |
-
decorated.call(this, $element, options, dataAdapter);
|
4031 |
-
|
4032 |
-
this.$loadingMore = this.createLoadingMore();
|
4033 |
-
this.loading = false;
|
4034 |
-
}
|
4035 |
-
|
4036 |
-
InfiniteScroll.prototype.append = function (decorated, data) {
|
4037 |
-
this.$loadingMore.remove();
|
4038 |
-
this.loading = false;
|
4039 |
-
|
4040 |
-
decorated.call(this, data);
|
4041 |
-
|
4042 |
-
if (this.showLoadingMore(data)) {
|
4043 |
-
this.$results.append(this.$loadingMore);
|
4044 |
-
}
|
4045 |
-
};
|
4046 |
-
|
4047 |
-
InfiniteScroll.prototype.bind = function (decorated, container, $container) {
|
4048 |
-
var self = this;
|
4049 |
-
|
4050 |
-
decorated.call(this, container, $container);
|
4051 |
-
|
4052 |
-
container.on('query', function (params) {
|
4053 |
-
self.lastParams = params;
|
4054 |
-
self.loading = true;
|
4055 |
-
});
|
4056 |
-
|
4057 |
-
container.on('query:append', function (params) {
|
4058 |
-
self.lastParams = params;
|
4059 |
-
self.loading = true;
|
4060 |
-
});
|
4061 |
-
|
4062 |
-
this.$results.on('scroll', function () {
|
4063 |
-
var isLoadMoreVisible = $.contains(
|
4064 |
-
document.documentElement,
|
4065 |
-
self.$loadingMore[0]
|
4066 |
-
);
|
4067 |
-
|
4068 |
-
if (self.loading || !isLoadMoreVisible) {
|
4069 |
-
return;
|
4070 |
-
}
|
4071 |
-
|
4072 |
-
var currentOffset = self.$results.offset().top +
|
4073 |
-
self.$results.outerHeight(false);
|
4074 |
-
var loadingMoreOffset = self.$loadingMore.offset().top +
|
4075 |
-
self.$loadingMore.outerHeight(false);
|
4076 |
-
|
4077 |
-
if (currentOffset + 50 >= loadingMoreOffset) {
|
4078 |
-
self.loadMore();
|
4079 |
-
}
|
4080 |
-
});
|
4081 |
-
};
|
4082 |
-
|
4083 |
-
InfiniteScroll.prototype.loadMore = function () {
|
4084 |
-
this.loading = true;
|
4085 |
-
|
4086 |
-
var params = $.extend({}, {page: 1}, this.lastParams);
|
4087 |
-
|
4088 |
-
params.page++;
|
4089 |
-
|
4090 |
-
this.trigger('query:append', params);
|
4091 |
-
};
|
4092 |
-
|
4093 |
-
InfiniteScroll.prototype.showLoadingMore = function (_, data) {
|
4094 |
-
return data.pagination && data.pagination.more;
|
4095 |
-
};
|
4096 |
-
|
4097 |
-
InfiniteScroll.prototype.createLoadingMore = function () {
|
4098 |
-
var $option = $(
|
4099 |
-
'<li ' +
|
4100 |
-
'class="select2-results__option select2-results__option--load-more"' +
|
4101 |
-
'role="treeitem" aria-disabled="true"></li>'
|
4102 |
-
);
|
4103 |
-
|
4104 |
-
var message = this.options.get('translations').get('loadingMore');
|
4105 |
-
|
4106 |
-
$option.html(message(this.lastParams));
|
4107 |
-
|
4108 |
-
return $option;
|
4109 |
-
};
|
4110 |
-
|
4111 |
-
return InfiniteScroll;
|
4112 |
-
});
|
4113 |
-
|
4114 |
-
S2.define('select2/dropdown/attachBody',[
|
4115 |
-
'jquery',
|
4116 |
-
'../utils'
|
4117 |
-
], function ($, Utils) {
|
4118 |
-
function AttachBody (decorated, $element, options) {
|
4119 |
-
this.$dropdownParent = options.get('dropdownParent') || $(document.body);
|
4120 |
-
|
4121 |
-
decorated.call(this, $element, options);
|
4122 |
-
}
|
4123 |
-
|
4124 |
-
AttachBody.prototype.bind = function (decorated, container, $container) {
|
4125 |
-
var self = this;
|
4126 |
-
|
4127 |
-
var setupResultsEvents = false;
|
4128 |
-
|
4129 |
-
decorated.call(this, container, $container);
|
4130 |
-
|
4131 |
-
container.on('open', function () {
|
4132 |
-
self._showDropdown();
|
4133 |
-
self._attachPositioningHandler(container);
|
4134 |
-
|
4135 |
-
if (!setupResultsEvents) {
|
4136 |
-
setupResultsEvents = true;
|
4137 |
-
|
4138 |
-
container.on('results:all', function () {
|
4139 |
-
self._positionDropdown();
|
4140 |
-
self._resizeDropdown();
|
4141 |
-
});
|
4142 |
-
|
4143 |
-
container.on('results:append', function () {
|
4144 |
-
self._positionDropdown();
|
4145 |
-
self._resizeDropdown();
|
4146 |
-
});
|
4147 |
-
}
|
4148 |
-
});
|
4149 |
-
|
4150 |
-
container.on('close', function () {
|
4151 |
-
self._hideDropdown();
|
4152 |
-
self._detachPositioningHandler(container);
|
4153 |
-
});
|
4154 |
-
|
4155 |
-
this.$dropdownContainer.on('mousedown', function (evt) {
|
4156 |
-
evt.stopPropagation();
|
4157 |
-
});
|
4158 |
-
};
|
4159 |
-
|
4160 |
-
AttachBody.prototype.destroy = function (decorated) {
|
4161 |
-
decorated.call(this);
|
4162 |
-
|
4163 |
-
this.$dropdownContainer.remove();
|
4164 |
-
};
|
4165 |
-
|
4166 |
-
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
|
4167 |
-
// Clone all of the container classes
|
4168 |
-
$dropdown.attr('class', $container.attr('class'));
|
4169 |
-
|
4170 |
-
$dropdown.removeClass('select2');
|
4171 |
-
$dropdown.addClass('select2-container--open');
|
4172 |
-
|
4173 |
-
$dropdown.css({
|
4174 |
-
position: 'absolute',
|
4175 |
-
top: -999999
|
4176 |
-
});
|
4177 |
-
|
4178 |
-
this.$container = $container;
|
4179 |
-
};
|
4180 |
-
|
4181 |
-
AttachBody.prototype.render = function (decorated) {
|
4182 |
-
var $container = $('<span></span>');
|
4183 |
-
|
4184 |
-
var $dropdown = decorated.call(this);
|
4185 |
-
$container.append($dropdown);
|
4186 |
-
|
4187 |
-
this.$dropdownContainer = $container;
|
4188 |
-
|
4189 |
-
return $container;
|
4190 |
-
};
|
4191 |
-
|
4192 |
-
AttachBody.prototype._hideDropdown = function (decorated) {
|
4193 |
-
this.$dropdownContainer.detach();
|
4194 |
-
};
|
4195 |
-
|
4196 |
-
AttachBody.prototype._attachPositioningHandler =
|
4197 |
-
function (decorated, container) {
|
4198 |
-
var self = this;
|
4199 |
-
|
4200 |
-
var scrollEvent = 'scroll.select2.' + container.id;
|
4201 |
-
var resizeEvent = 'resize.select2.' + container.id;
|
4202 |
-
var orientationEvent = 'orientationchange.select2.' + container.id;
|
4203 |
-
|
4204 |
-
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4205 |
-
$watchers.each(function () {
|
4206 |
-
$(this).data('select2-scroll-position', {
|
4207 |
-
x: $(this).scrollLeft(),
|
4208 |
-
y: $(this).scrollTop()
|
4209 |
-
});
|
4210 |
-
});
|
4211 |
-
|
4212 |
-
$watchers.on(scrollEvent, function (ev) {
|
4213 |
-
var position = $(this).data('select2-scroll-position');
|
4214 |
-
$(this).scrollTop(position.y);
|
4215 |
-
});
|
4216 |
-
|
4217 |
-
$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
|
4218 |
-
function (e) {
|
4219 |
-
self._positionDropdown();
|
4220 |
-
self._resizeDropdown();
|
4221 |
-
});
|
4222 |
-
};
|
4223 |
-
|
4224 |
-
AttachBody.prototype._detachPositioningHandler =
|
4225 |
-
function (decorated, container) {
|
4226 |
-
var scrollEvent = 'scroll.select2.' + container.id;
|
4227 |
-
var resizeEvent = 'resize.select2.' + container.id;
|
4228 |
-
var orientationEvent = 'orientationchange.select2.' + container.id;
|
4229 |
-
|
4230 |
-
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4231 |
-
$watchers.off(scrollEvent);
|
4232 |
-
|
4233 |
-
$(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
|
4234 |
-
};
|
4235 |
-
|
4236 |
-
AttachBody.prototype._positionDropdown = function () {
|
4237 |
-
var $window = $(window);
|
4238 |
-
|
4239 |
-
var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
|
4240 |
-
var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
|
4241 |
-
|
4242 |
-
var newDirection = null;
|
4243 |
-
|
4244 |
-
var offset = this.$container.offset();
|
4245 |
-
|
4246 |
-
offset.bottom = offset.top + this.$container.outerHeight(false);
|
4247 |
-
|
4248 |
-
var container = {
|
4249 |
-
height: this.$container.outerHeight(false)
|
4250 |
-
};
|
4251 |
-
|
4252 |
-
container.top = offset.top;
|
4253 |
-
container.bottom = offset.top + container.height;
|
4254 |
-
|
4255 |
-
var dropdown = {
|
4256 |
-
height: this.$dropdown.outerHeight(false)
|
4257 |
-
};
|
4258 |
-
|
4259 |
-
var viewport = {
|
4260 |
-
top: $window.scrollTop(),
|
4261 |
-
bottom: $window.scrollTop() + $window.height()
|
4262 |
-
};
|
4263 |
-
|
4264 |
-
var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
|
4265 |
-
var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
|
4266 |
-
|
4267 |
-
var css = {
|
4268 |
-
left: offset.left,
|
4269 |
-
top: container.bottom
|
4270 |
-
};
|
4271 |
-
|
4272 |
-
// Determine what the parent element is to use for calciulating the offset
|
4273 |
-
var $offsetParent = this.$dropdownParent;
|
4274 |
-
|
4275 |
-
// For statically positoned elements, we need to get the element
|
4276 |
-
// that is determining the offset
|
4277 |
-
if ($offsetParent.css('position') === 'static') {
|
4278 |
-
$offsetParent = $offsetParent.offsetParent();
|
4279 |
-
}
|
4280 |
-
|
4281 |
-
var parentOffset = $offsetParent.offset();
|
4282 |
-
|
4283 |
-
css.top -= parentOffset.top;
|
4284 |
-
css.left -= parentOffset.left;
|
4285 |
-
|
4286 |
-
if (!isCurrentlyAbove && !isCurrentlyBelow) {
|
4287 |
-
newDirection = 'below';
|
4288 |
-
}
|
4289 |
-
|
4290 |
-
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
|
4291 |
-
newDirection = 'above';
|
4292 |
-
} else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
|
4293 |
-
newDirection = 'below';
|
4294 |
-
}
|
4295 |
-
|
4296 |
-
if (newDirection == 'above' ||
|
4297 |
-
(isCurrentlyAbove && newDirection !== 'below')) {
|
4298 |
-
css.top = container.top - parentOffset.top - dropdown.height;
|
4299 |
-
}
|
4300 |
-
|
4301 |
-
if (newDirection != null) {
|
4302 |
-
this.$dropdown
|
4303 |
-
.removeClass('select2-dropdown--below select2-dropdown--above')
|
4304 |
-
.addClass('select2-dropdown--' + newDirection);
|
4305 |
-
this.$container
|
4306 |
-
.removeClass('select2-container--below select2-container--above')
|
4307 |
-
.addClass('select2-container--' + newDirection);
|
4308 |
-
}
|
4309 |
-
|
4310 |
-
this.$dropdownContainer.css(css);
|
4311 |
-
};
|
4312 |
-
|
4313 |
-
AttachBody.prototype._resizeDropdown = function () {
|
4314 |
-
var css = {
|
4315 |
-
width: this.$container.outerWidth(false) + 'px'
|
4316 |
-
};
|
4317 |
-
|
4318 |
-
if (this.options.get('dropdownAutoWidth')) {
|
4319 |
-
css.minWidth = css.width;
|
4320 |
-
css.position = 'relative';
|
4321 |
-
css.width = 'auto';
|
4322 |
-
}
|
4323 |
-
|
4324 |
-
this.$dropdown.css(css);
|
4325 |
-
};
|
4326 |
-
|
4327 |
-
AttachBody.prototype._showDropdown = function (decorated) {
|
4328 |
-
this.$dropdownContainer.appendTo(this.$dropdownParent);
|
4329 |
-
|
4330 |
-
this._positionDropdown();
|
4331 |
-
this._resizeDropdown();
|
4332 |
-
};
|
4333 |
-
|
4334 |
-
return AttachBody;
|
4335 |
-
});
|
4336 |
-
|
4337 |
-
S2.define('select2/dropdown/minimumResultsForSearch',[
|
4338 |
-
|
4339 |
-
], function () {
|
4340 |
-
function countResults (data) {
|
4341 |
-
var count = 0;
|
4342 |
-
|
4343 |
-
for (var d = 0; d < data.length; d++) {
|
4344 |
-
var item = data[d];
|
4345 |
-
|
4346 |
-
if (item.children) {
|
4347 |
-
count += countResults(item.children);
|
4348 |
-
} else {
|
4349 |
-
count++;
|
4350 |
-
}
|
4351 |
-
}
|
4352 |
-
|
4353 |
-
return count;
|
4354 |
-
}
|
4355 |
-
|
4356 |
-
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
4357 |
-
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
4358 |
-
|
4359 |
-
if (this.minimumResultsForSearch < 0) {
|
4360 |
-
this.minimumResultsForSearch = Infinity;
|
4361 |
-
}
|
4362 |
-
|
4363 |
-
decorated.call(this, $element, options, dataAdapter);
|
4364 |
-
}
|
4365 |
-
|
4366 |
-
MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
|
4367 |
-
if (countResults(params.data.results) < this.minimumResultsForSearch) {
|
4368 |
-
return false;
|
4369 |
-
}
|
4370 |
-
|
4371 |
-
return decorated.call(this, params);
|
4372 |
-
};
|
4373 |
-
|
4374 |
-
return MinimumResultsForSearch;
|
4375 |
-
});
|
4376 |
-
|
4377 |
-
S2.define('select2/dropdown/selectOnClose',[
|
4378 |
-
|
4379 |
-
], function () {
|
4380 |
-
function SelectOnClose () { }
|
4381 |
-
|
4382 |
-
SelectOnClose.prototype.bind = function (decorated, container, $container) {
|
4383 |
-
var self = this;
|
4384 |
-
|
4385 |
-
decorated.call(this, container, $container);
|
4386 |
-
|
4387 |
-
container.on('close', function (params) {
|
4388 |
-
self._handleSelectOnClose(params);
|
4389 |
-
});
|
4390 |
-
};
|
4391 |
-
|
4392 |
-
SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
|
4393 |
-
if (params && params.originalSelect2Event != null) {
|
4394 |
-
var event = params.originalSelect2Event;
|
4395 |
-
|
4396 |
-
// Don't select an item if the close event was triggered from a select or
|
4397 |
-
// unselect event
|
4398 |
-
if (event._type === 'select' || event._type === 'unselect') {
|
4399 |
-
return;
|
4400 |
-
}
|
4401 |
-
}
|
4402 |
-
|
4403 |
-
var $highlightedResults = this.getHighlightedResults();
|
4404 |
-
|
4405 |
-
// Only select highlighted results
|
4406 |
-
if ($highlightedResults.length < 1) {
|
4407 |
-
return;
|
4408 |
-
}
|
4409 |
-
|
4410 |
-
var data = $highlightedResults.data('data');
|
4411 |
-
|
4412 |
-
// Don't re-select already selected resulte
|
4413 |
-
if (
|
4414 |
-
(data.element != null && data.element.selected) ||
|
4415 |
-
(data.element == null && data.selected)
|
4416 |
-
) {
|
4417 |
-
return;
|
4418 |
-
}
|
4419 |
-
|
4420 |
-
this.trigger('select', {
|
4421 |
-
data: data
|
4422 |
-
});
|
4423 |
-
};
|
4424 |
-
|
4425 |
-
return SelectOnClose;
|
4426 |
-
});
|
4427 |
-
|
4428 |
-
S2.define('select2/dropdown/closeOnSelect',[
|
4429 |
-
|
4430 |
-
], function () {
|
4431 |
-
function CloseOnSelect () { }
|
4432 |
-
|
4433 |
-
CloseOnSelect.prototype.bind = function (decorated, container, $container) {
|
4434 |
-
var self = this;
|
4435 |
-
|
4436 |
-
decorated.call(this, container, $container);
|
4437 |
-
|
4438 |
-
container.on('select', function (evt) {
|
4439 |
-
self._selectTriggered(evt);
|
4440 |
-
});
|
4441 |
-
|
4442 |
-
container.on('unselect', function (evt) {
|
4443 |
-
self._selectTriggered(evt);
|
4444 |
-
});
|
4445 |
-
};
|
4446 |
-
|
4447 |
-
CloseOnSelect.prototype._selectTriggered = function (_, evt) {
|
4448 |
-
var originalEvent = evt.originalEvent;
|
4449 |
-
|
4450 |
-
// Don't close if the control key is being held
|
4451 |
-
if (originalEvent && originalEvent.ctrlKey) {
|
4452 |
-
return;
|
4453 |
-
}
|
4454 |
-
|
4455 |
-
this.trigger('close', {
|
4456 |
-
originalEvent: originalEvent,
|
4457 |
-
originalSelect2Event: evt
|
4458 |
-
});
|
4459 |
-
};
|
4460 |
-
|
4461 |
-
return CloseOnSelect;
|
4462 |
-
});
|
4463 |
-
|
4464 |
-
S2.define('select2/i18n/en',[],function () {
|
4465 |
-
// English
|
4466 |
-
return {
|
4467 |
-
errorLoading: function () {
|
4468 |
-
return 'The results could not be loaded.';
|
4469 |
-
},
|
4470 |
-
inputTooLong: function (args) {
|
4471 |
-
var overChars = args.input.length - args.maximum;
|
4472 |
-
|
4473 |
-
var message = 'Please delete ' + overChars + ' character';
|
4474 |
-
|
4475 |
-
if (overChars != 1) {
|
4476 |
-
message += 's';
|
4477 |
-
}
|
4478 |
-
|
4479 |
-
return message;
|
4480 |
-
},
|
4481 |
-
inputTooShort: function (args) {
|
4482 |
-
var remainingChars = args.minimum - args.input.length;
|
4483 |
-
|
4484 |
-
var message = 'Please enter ' + remainingChars + ' or more characters';
|
4485 |
-
|
4486 |
-
return message;
|
4487 |
-
},
|
4488 |
-
loadingMore: function () {
|
4489 |
-
return 'Loading more results…';
|
4490 |
-
},
|
4491 |
-
maximumSelected: function (args) {
|
4492 |
-
var message = 'You can only select ' + args.maximum + ' item';
|
4493 |
-
|
4494 |
-
if (args.maximum != 1) {
|
4495 |
-
message += 's';
|
4496 |
-
}
|
4497 |
-
|
4498 |
-
return message;
|
4499 |
-
},
|
4500 |
-
noResults: function () {
|
4501 |
-
return 'No results found';
|
4502 |
-
},
|
4503 |
-
searching: function () {
|
4504 |
-
return 'Searching…';
|
4505 |
-
}
|
4506 |
-
};
|
4507 |
-
});
|
4508 |
-
|
4509 |
-
S2.define('select2/defaults',[
|
4510 |
-
'jquery',
|
4511 |
-
'require',
|
4512 |
-
|
4513 |
-
'./results',
|
4514 |
-
|
4515 |
-
'./selection/single',
|
4516 |
-
'./selection/multiple',
|
4517 |
-
'./selection/placeholder',
|
4518 |
-
'./selection/allowClear',
|
4519 |
-
'./selection/search',
|
4520 |
-
'./selection/eventRelay',
|
4521 |
-
|
4522 |
-
'./utils',
|
4523 |
-
'./translation',
|
4524 |
-
'./diacritics',
|
4525 |
-
|
4526 |
-
'./data/select',
|
4527 |
-
'./data/array',
|
4528 |
-
'./data/ajax',
|
4529 |
-
'./data/tags',
|
4530 |
-
'./data/tokenizer',
|
4531 |
-
'./data/minimumInputLength',
|
4532 |
-
'./data/maximumInputLength',
|
4533 |
-
'./data/maximumSelectionLength',
|
4534 |
-
|
4535 |
-
'./dropdown',
|
4536 |
-
'./dropdown/search',
|
4537 |
-
'./dropdown/hidePlaceholder',
|
4538 |
-
'./dropdown/infiniteScroll',
|
4539 |
-
'./dropdown/attachBody',
|
4540 |
-
'./dropdown/minimumResultsForSearch',
|
4541 |
-
'./dropdown/selectOnClose',
|
4542 |
-
'./dropdown/closeOnSelect',
|
4543 |
-
|
4544 |
-
'./i18n/en'
|
4545 |
-
], function ($, require,
|
4546 |
-
|
4547 |
-
ResultsList,
|
4548 |
-
|
4549 |
-
SingleSelection, MultipleSelection, Placeholder, AllowClear,
|
4550 |
-
SelectionSearch, EventRelay,
|
4551 |
-
|
4552 |
-
Utils, Translation, DIACRITICS,
|
4553 |
-
|
4554 |
-
SelectData, ArrayData, AjaxData, Tags, Tokenizer,
|
4555 |
-
MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
|
4556 |
-
|
4557 |
-
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
|
4558 |
-
AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
|
4559 |
-
|
4560 |
-
EnglishTranslation) {
|
4561 |
-
function Defaults () {
|
4562 |
-
this.reset();
|
4563 |
-
}
|
4564 |
-
|
4565 |
-
Defaults.prototype.apply = function (options) {
|
4566 |
-
options = $.extend(true, {}, this.defaults, options);
|
4567 |
-
|
4568 |
-
if (options.dataAdapter == null) {
|
4569 |
-
if (options.ajax != null) {
|
4570 |
-
options.dataAdapter = AjaxData;
|
4571 |
-
} else if (options.data != null) {
|
4572 |
-
options.dataAdapter = ArrayData;
|
4573 |
-
} else {
|
4574 |
-
options.dataAdapter = SelectData;
|
4575 |
-
}
|
4576 |
-
|
4577 |
-
if (options.minimumInputLength > 0) {
|
4578 |
-
options.dataAdapter = Utils.Decorate(
|
4579 |
-
options.dataAdapter,
|
4580 |
-
MinimumInputLength
|
4581 |
-
);
|
4582 |
-
}
|
4583 |
-
|
4584 |
-
if (options.maximumInputLength > 0) {
|
4585 |
-
options.dataAdapter = Utils.Decorate(
|
4586 |
-
options.dataAdapter,
|
4587 |
-
MaximumInputLength
|
4588 |
-
);
|
4589 |
-
}
|
4590 |
-
|
4591 |
-
if (options.maximumSelectionLength > 0) {
|
4592 |
-
options.dataAdapter = Utils.Decorate(
|
4593 |
-
options.dataAdapter,
|
4594 |
-
MaximumSelectionLength
|
4595 |
-
);
|
4596 |
-
}
|
4597 |
-
|
4598 |
-
if (options.tags) {
|
4599 |
-
options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
|
4600 |
-
}
|
4601 |
-
|
4602 |
-
if (options.tokenSeparators != null || options.tokenizer != null) {
|
4603 |
-
options.dataAdapter = Utils.Decorate(
|
4604 |
-
options.dataAdapter,
|
4605 |
-
Tokenizer
|
4606 |
-
);
|
4607 |
-
}
|
4608 |
-
|
4609 |
-
if (options.query != null) {
|
4610 |
-
var Query = require(options.amdBase + 'compat/query');
|
4611 |
-
|
4612 |
-
options.dataAdapter = Utils.Decorate(
|
4613 |
-
options.dataAdapter,
|
4614 |
-
Query
|
4615 |
-
);
|
4616 |
-
}
|
4617 |
-
|
4618 |
-
if (options.initSelection != null) {
|
4619 |
-
var InitSelection = require(options.amdBase + 'compat/initSelection');
|
4620 |
-
|
4621 |
-
options.dataAdapter = Utils.Decorate(
|
4622 |
-
options.dataAdapter,
|
4623 |
-
InitSelection
|
4624 |
-
);
|
4625 |
-
}
|
4626 |
-
}
|
4627 |
-
|
4628 |
-
if (options.resultsAdapter == null) {
|
4629 |
-
options.resultsAdapter = ResultsList;
|
4630 |
-
|
4631 |
-
if (options.ajax != null) {
|
4632 |
-
options.resultsAdapter = Utils.Decorate(
|
4633 |
-
options.resultsAdapter,
|
4634 |
-
InfiniteScroll
|
4635 |
-
);
|
4636 |
-
}
|
4637 |
-
|
4638 |
-
if (options.placeholder != null) {
|
4639 |
-
options.resultsAdapter = Utils.Decorate(
|
4640 |
-
options.resultsAdapter,
|
4641 |
-
HidePlaceholder
|
4642 |
-
);
|
4643 |
-
}
|
4644 |
-
|
4645 |
-
if (options.selectOnClose) {
|
4646 |
-
options.resultsAdapter = Utils.Decorate(
|
4647 |
-
options.resultsAdapter,
|
4648 |
-
SelectOnClose
|
4649 |
-
);
|
4650 |
-
}
|
4651 |
-
}
|
4652 |
-
|
4653 |
-
if (options.dropdownAdapter == null) {
|
4654 |
-
if (options.multiple) {
|
4655 |
-
options.dropdownAdapter = Dropdown;
|
4656 |
-
} else {
|
4657 |
-
var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
|
4658 |
-
|
4659 |
-
options.dropdownAdapter = SearchableDropdown;
|
4660 |
-
}
|
4661 |
-
|
4662 |
-
if (options.minimumResultsForSearch !== 0) {
|
4663 |
-
options.dropdownAdapter = Utils.Decorate(
|
4664 |
-
options.dropdownAdapter,
|
4665 |
-
MinimumResultsForSearch
|
4666 |
-
);
|
4667 |
-
}
|
4668 |
-
|
4669 |
-
if (options.closeOnSelect) {
|
4670 |
-
options.dropdownAdapter = Utils.Decorate(
|
4671 |
-
options.dropdownAdapter,
|
4672 |
-
CloseOnSelect
|
4673 |
-
);
|
4674 |
-
}
|
4675 |
-
|
4676 |
-
if (
|
4677 |
-
options.dropdownCssClass != null ||
|
4678 |
-
options.dropdownCss != null ||
|
4679 |
-
options.adaptDropdownCssClass != null
|
4680 |
-
) {
|
4681 |
-
var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
|
4682 |
-
|
4683 |
-
options.dropdownAdapter = Utils.Decorate(
|
4684 |
-
options.dropdownAdapter,
|
4685 |
-
DropdownCSS
|
4686 |
-
);
|
4687 |
-
}
|
4688 |
-
|
4689 |
-
options.dropdownAdapter = Utils.Decorate(
|
4690 |
-
options.dropdownAdapter,
|
4691 |
-
AttachBody
|
4692 |
-
);
|
4693 |
-
}
|
4694 |
-
|
4695 |
-
if (options.selectionAdapter == null) {
|
4696 |
-
if (options.multiple) {
|
4697 |
-
options.selectionAdapter = MultipleSelection;
|
4698 |
-
} else {
|
4699 |
-
options.selectionAdapter = SingleSelection;
|
4700 |
-
}
|
4701 |
-
|
4702 |
-
// Add the placeholder mixin if a placeholder was specified
|
4703 |
-
if (options.placeholder != null) {
|
4704 |
-
options.selectionAdapter = Utils.Decorate(
|
4705 |
-
options
|
4706 |
-
Placeholder
|
4707 |
-
);
|
4708 |
-
}
|
4709 |
-
|
4710 |
-
if (options.allowClear) {
|
4711 |
-
options.selectionAdapter = Utils.Decorate(
|
4712 |
-
options.selectionAdapter,
|
4713 |
-
AllowClear
|
4714 |
-
);
|
4715 |
-
}
|
4716 |
-
|
4717 |
-
if (options.multiple) {
|
4718 |
-
options.selectionAdapter = Utils.Decorate(
|
4719 |
-
options.selectionAdapter,
|
4720 |
-
SelectionSearch
|
4721 |
-
);
|
4722 |
-
}
|
4723 |
-
|
4724 |
-
if (
|
4725 |
-
options.containerCssClass != null ||
|
4726 |
-
options.containerCss != null ||
|
4727 |
-
options.adaptContainerCssClass != null
|
4728 |
-
) {
|
4729 |
-
var ContainerCSS = require(options.amdBase + 'compat/containerCss');
|
4730 |
-
|
4731 |
-
options.selectionAdapter = Utils.Decorate(
|
4732 |
-
options.selectionAdapter,
|
4733 |
-
ContainerCSS
|
4734 |
-
);
|
4735 |
-
}
|
4736 |
-
|
4737 |
-
options.selectionAdapter = Utils.Decorate(
|
4738 |
-
options.selectionAdapter,
|
4739 |
-
EventRelay
|
4740 |
-
);
|
4741 |
-
}
|
4742 |
-
|
4743 |
-
if (typeof options.language === 'string') {
|
4744 |
-
// Check if the language is specified with a region
|
4745 |
-
if (options.language.indexOf('-') > 0) {
|
4746 |
-
// Extract the region information if it is included
|
4747 |
-
var languageParts = options.language.split('-');
|
4748 |
-
var baseLanguage = languageParts[0];
|
4749 |
-
|
4750 |
-
options.language = [options.language, baseLanguage];
|
4751 |
-
} else {
|
4752 |
-
options.language = [options.language];
|
4753 |
-
}
|
4754 |
-
}
|
4755 |
-
|
4756 |
-
if ($.isArray(options.language)) {
|
4757 |
-
var languages = new Translation();
|
4758 |
-
options.language.push('en');
|
4759 |
-
|
4760 |
-
var languageNames = options.language;
|
4761 |
-
|
4762 |
-
for (var l = 0; l < languageNames.length; l++) {
|
4763 |
-
var name = languageNames[l];
|
4764 |
-
var language = {};
|
4765 |
-
|
4766 |
-
try {
|
4767 |
-
// Try to load it with the original name
|
4768 |
-
language = Translation.loadPath(name);
|
4769 |
-
} catch (e) {
|
4770 |
-
try {
|
4771 |
-
// If we couldn't load it, check if it wasn't the full path
|
4772 |
-
name = this.defaults.amdLanguageBase + name;
|
4773 |
-
language = Translation.loadPath(name);
|
4774 |
-
} catch (ex) {
|
4775 |
-
// The translation could not be loaded at all. Sometimes this is
|
4776 |
-
// because of a configuration problem, other times this can be
|
4777 |
-
// because of how Select2 helps load all possible translation files.
|
4778 |
-
if (options.debug && window.console && console.warn) {
|
4779 |
-
console.warn(
|
4780 |
-
'Select2: The language file for "' + name + '" could not be ' +
|
4781 |
-
'automatically loaded. A fallback will be used instead.'
|
4782 |
-
);
|
4783 |
-
}
|
4784 |
-
|
4785 |
-
continue;
|
4786 |
-
}
|
4787 |
-
}
|
4788 |
-
|
4789 |
-
languages.extend(language);
|
4790 |
-
}
|
4791 |
-
|
4792 |
-
options.translations = languages;
|
4793 |
-
} else {
|
4794 |
-
var baseTranslation = Translation.loadPath(
|
4795 |
-
this.defaults.amdLanguageBase + 'en'
|
4796 |
-
);
|
4797 |
-
var customTranslation = new Translation(options.language);
|
4798 |
-
|
4799 |
-
customTranslation.extend(baseTranslation);
|
4800 |
-
|
4801 |
-
options.translations = customTranslation;
|
4802 |
-
}
|
4803 |
-
|
4804 |
-
return options;
|
4805 |
-
};
|
4806 |
-
|
4807 |
-
Defaults.prototype.reset = function () {
|
4808 |
-
function stripDiacritics (text) {
|
4809 |
-
// Used 'uni range + named function' from http://jsperf.com/diacritics/18
|
4810 |
-
function match(a) {
|
4811 |
-
return DIACRITICS[a] || a;
|
4812 |
-
}
|
4813 |
-
|
4814 |
-
return text.replace(/[^\u0000-\u007E]/g, match);
|
4815 |
-
}
|
4816 |
-
|
4817 |
-
function matcher (params, data) {
|
4818 |
-
// Always return the object if there is nothing to compare
|
4819 |
-
if ($.trim(params.term) === '') {
|
4820 |
-
return data;
|
4821 |
-
}
|
4822 |
-
|
4823 |
-
// Do a recursive check for options with children
|
4824 |
-
if (data.children && data.children.length > 0) {
|
4825 |
-
// Clone the data object if there are children
|
4826 |
-
// This is required as we modify the object to remove any non-matches
|
4827 |
-
var match = $.extend(true, {}, data);
|
4828 |
-
|
4829 |
-
// Check each child of the option
|
4830 |
-
for (var c = data.children.length - 1; c >= 0; c--) {
|
4831 |
-
var child = data.children[c];
|
4832 |
-
|
4833 |
-
var matches = matcher(params, child);
|
4834 |
-
|
4835 |
-
// If there wasn't a match, remove the object in the array
|
4836 |
-
if (matches == null) {
|
4837 |
-
match.children.splice(c, 1);
|
4838 |
-
}
|
4839 |
-
}
|
4840 |
-
|
4841 |
-
// If any children matched, return the new object
|
4842 |
-
if (match.children.length > 0) {
|
4843 |
-
return match;
|
4844 |
-
}
|
4845 |
-
|
4846 |
-
// If there were no matching children, check just the plain object
|
4847 |
-
return matcher(params, match);
|
4848 |
-
}
|
4849 |
-
|
4850 |
-
var original = stripDiacritics(data.text).toUpperCase();
|
4851 |
-
var term = stripDiacritics(params.term).toUpperCase();
|
4852 |
-
|
4853 |
-
// Check if the text contains the term
|
4854 |
-
if (original.indexOf(term) > -1) {
|
4855 |
-
return data;
|
4856 |
-
}
|
4857 |
-
|
4858 |
-
// If it doesn't contain the term, don't return anything
|
4859 |
-
return null;
|
4860 |
-
}
|
4861 |
-
|
4862 |
-
this.defaults = {
|
4863 |
-
amdBase: './',
|
4864 |
-
amdLanguageBase: './i18n/',
|
4865 |
-
closeOnSelect: true,
|
4866 |
-
debug: false,
|
4867 |
-
dropdownAutoWidth: false,
|
4868 |
-
escapeMarkup: Utils.escapeMarkup,
|
4869 |
-
language: EnglishTranslation,
|
4870 |
-
matcher: matcher,
|
4871 |
-
minimumInputLength: 0,
|
4872 |
-
maximumInputLength: 0,
|
4873 |
-
maximumSelectionLength: 0,
|
4874 |
-
minimumResultsForSearch: 0,
|
4875 |
-
selectOnClose: false,
|
4876 |
-
sorter: function (data) {
|
4877 |
-
return data;
|
4878 |
-
},
|
4879 |
-
templateResult: function (result) {
|
4880 |
-
return result.text;
|
4881 |
-
},
|
4882 |
-
templateSelection: function (selection) {
|
4883 |
-
return selection.text;
|
4884 |
-
},
|
4885 |
-
theme: 'default',
|
4886 |
-
width: 'resolve'
|
4887 |
-
};
|
4888 |
-
};
|
4889 |
-
|
4890 |
-
Defaults.prototype.set = function (key, value) {
|
4891 |
-
var camelKey = $.camelCase(key);
|
4892 |
-
|
4893 |
-
var data = {};
|
4894 |
-
data[camelKey] = value;
|
4895 |
-
|
4896 |
-
var convertedData = Utils._convertData(data);
|
4897 |
-
|
4898 |
-
$.extend(this.defaults, convertedData);
|
4899 |
-
};
|
4900 |
-
|
4901 |
-
var defaults = new Defaults();
|
4902 |
-
|
4903 |
-
return defaults;
|
4904 |
-
});
|
4905 |
-
|
4906 |
-
S2.define('select2/options',[
|
4907 |
-
'require',
|
4908 |
-
'jquery',
|
4909 |
-
'./defaults',
|
4910 |
-
'./utils'
|
4911 |
-
], function (require, $, Defaults, Utils) {
|
4912 |
-
function Options (options, $element) {
|
4913 |
-
this.options = options;
|
4914 |
-
|
4915 |
-
if ($element != null) {
|
4916 |
-
this.fromElement($element);
|
4917 |
-
}
|
4918 |
-
|
4919 |
-
this.options = Defaults.apply(this.options);
|
4920 |
-
|
4921 |
-
if ($element && $element.is('input')) {
|
4922 |
-
var InputCompat = require(this.get('amdBase') + 'compat/inputData');
|
4923 |
-
|
4924 |
-
this.options.dataAdapter = Utils.Decorate(
|
4925 |
-
this.options.dataAdapter,
|
4926 |
-
InputCompat
|
4927 |
-
);
|
4928 |
-
}
|
4929 |
-
}
|
4930 |
-
|
4931 |
-
Options.prototype.fromElement = function ($e) {
|
4932 |
-
var excludedData = ['select2'];
|
4933 |
-
|
4934 |
-
if (this.options.multiple == null) {
|
4935 |
-
this.options.multiple = $e.prop('multiple');
|
4936 |
-
}
|
4937 |
-
|
4938 |
-
if (this.options.disabled == null) {
|
4939 |
-
this.options.disabled = $e.prop('disabled');
|
4940 |
-
}
|
4941 |
-
|
4942 |
-
if (this.options.language == null) {
|
4943 |
-
if ($e.prop('lang')) {
|
4944 |
-
this.options.language = $e.prop('lang').toLowerCase();
|
4945 |
-
} else if ($e.closest('[lang]').prop('lang')) {
|
4946 |
-
this.options.language = $e.closest('[lang]').prop('lang');
|
4947 |
-
}
|
4948 |
-
}
|
4949 |
-
|
4950 |
-
if (this.options.dir == null) {
|
4951 |
-
if ($e.prop('dir')) {
|
4952 |
-
this.options.dir = $e.prop('dir');
|
4953 |
-
} else if ($e.closest('[dir]').prop('dir')) {
|
4954 |
-
this.options.dir = $e.closest('[dir]').prop('dir');
|
4955 |
-
} else {
|
4956 |
-
this.options.dir = 'ltr';
|
4957 |
-
}
|
4958 |
-
}
|
4959 |
-
|
4960 |
-
$e.prop('disabled', this.options.disabled);
|
4961 |
-
$e.prop('multiple', this.options.multiple);
|
4962 |
-
|
4963 |
-
if ($e.data('select2Tags')) {
|
4964 |
-
if (this.options.debug && window.console && console.warn) {
|
4965 |
-
console.warn(
|
4966 |
-
'Select2: The `data-select2-tags` attribute has been changed to ' +
|
4967 |
-
'use the `data-data` and `data-tags="true"` attributes and will be ' +
|
4968 |
-
'removed in future versions of Select2.'
|
4969 |
-
);
|
4970 |
-
}
|
4971 |
-
|
4972 |
-
$e.data('data', $e.data('select2Tags'));
|
4973 |
-
$e.data('tags', true);
|
4974 |
-
}
|
4975 |
-
|
4976 |
-
if ($e.data('ajaxUrl')) {
|
4977 |
-
if (this.options.debug && window.console && console.warn) {
|
4978 |
-
console.warn(
|
4979 |
-
'Select2: The `data-ajax-url` attribute has been changed to ' +
|
4980 |
-
'`data-ajax--url` and support for the old attribute will be removed' +
|
4981 |
-
' in future versions of Select2.'
|
4982 |
-
);
|
4983 |
-
}
|
4984 |
-
|
4985 |
-
$e.attr('ajax--url', $e.data('ajaxUrl'));
|
4986 |
-
$e.data('ajax--url', $e.data('ajaxUrl'));
|
4987 |
-
}
|
4988 |
-
|
4989 |
-
var dataset = {};
|
4990 |
-
|
4991 |
-
// Prefer the element's `dataset` attribute if it exists
|
4992 |
-
// jQuery 1.x does not correctly handle data attributes with multiple dashes
|
4993 |
-
if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
|
4994 |
-
dataset = $.extend(true, {}, $e[0].dataset, $e.data());
|
4995 |
-
} else {
|
4996 |
-
dataset = $e.data();
|
4997 |
-
}
|
4998 |
-
|
4999 |
-
var data = $.extend(true, {}, dataset);
|
5000 |
-
|
5001 |
-
data = Utils._convertData(data);
|
5002 |
-
|
5003 |
-
for (var key in data) {
|
5004 |
-
if ($.inArray(key, excludedData) > -1) {
|
5005 |
-
continue;
|
5006 |
-
}
|
5007 |
-
|
5008 |
-
if ($.isPlainObject(this.options[key])) {
|
5009 |
-
$.extend(this.options[key], data[key]);
|
5010 |
-
} else {
|
5011 |
-
this.options[key] = data[key];
|
5012 |
-
}
|
5013 |
-
}
|
5014 |
-
|
5015 |
-
return this;
|
5016 |
-
};
|
5017 |
-
|
5018 |
-
Options.prototype.get = function (key) {
|
5019 |
-
return this.options[key];
|
5020 |
-
};
|
5021 |
-
|
5022 |
-
Options.prototype.set = function (key, val) {
|
5023 |
-
this.options[key] = val;
|
5024 |
-
};
|
5025 |
-
|
5026 |
-
return Options;
|
5027 |
-
});
|
5028 |
-
|
5029 |
-
S2.define('select2/core',[
|
5030 |
-
'jquery',
|
5031 |
-
'./options',
|
5032 |
-
'./utils',
|
5033 |
-
'./keys'
|
5034 |
-
], function ($, Options, Utils, KEYS) {
|
5035 |
-
var Select2 = function ($element, options) {
|
5036 |
-
if ($element.data('select2') != null) {
|
5037 |
-
$element.data('select2').destroy();
|
5038 |
-
}
|
5039 |
-
|
5040 |
-
this.$element = $element;
|
5041 |
-
|
5042 |
-
this.id = this._generateId($element);
|
5043 |
-
|
5044 |
-
options = options || {};
|
5045 |
-
|
5046 |
-
this.options = new Options(options, $element);
|
5047 |
-
|
5048 |
-
Select2.__super__.constructor.call(this);
|
5049 |
-
|
5050 |
-
// Set up the tabindex
|
5051 |
-
|
5052 |
-
var tabindex = $element.attr('tabindex') || 0;
|
5053 |
-
$element.data('old-tabindex', tabindex);
|
5054 |
-
$element.attr('tabindex', '-1');
|
5055 |
-
|
5056 |
-
// Set up containers and adapters
|
5057 |
-
|
5058 |
-
var DataAdapter = this.options.get('dataAdapter');
|
5059 |
-
this.dataAdapter = new DataAdapter($element, this.options);
|
5060 |
-
|
5061 |
-
var $container = this.render();
|
5062 |
-
|
5063 |
-
this._placeContainer($container);
|
5064 |
-
|
5065 |
-
var SelectionAdapter = this.options.get('selectionAdapter');
|
5066 |
-
this.selection = new SelectionAdapter($element, this.options);
|
5067 |
-
this.$selection = this.selection.render();
|
5068 |
-
|
5069 |
-
this.selection.position(this.$selection, $container);
|
5070 |
-
|
5071 |
-
var DropdownAdapter = this.options.get('dropdownAdapter');
|
5072 |
-
this.dropdown = new DropdownAdapter($element, this.options);
|
5073 |
-
this.$dropdown = this.dropdown.render();
|
5074 |
-
|
5075 |
-
this.dropdown.position(this.$dropdown, $container);
|
5076 |
-
|
5077 |
-
var ResultsAdapter = this.options.get('resultsAdapter');
|
5078 |
-
this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
|
5079 |
-
this.$results = this.results.render();
|
5080 |
-
|
5081 |
-
this.results.position(this.$results, this.$dropdown);
|
5082 |
-
|
5083 |
-
// Bind events
|
5084 |
-
|
5085 |
-
var self = this;
|
5086 |
-
|
5087 |
-
// Bind the container to all of the adapters
|
5088 |
-
this._bindAdapters();
|
5089 |
-
|
5090 |
-
// Register any DOM event handlers
|
5091 |
-
this._registerDomEvents();
|
5092 |
-
|
5093 |
-
// Register any internal event handlers
|
5094 |
-
this._registerDataEvents();
|
5095 |
-
this._registerSelectionEvents();
|
5096 |
-
this._registerDropdownEvents();
|
5097 |
-
this._registerResultsEvents();
|
5098 |
-
this._registerEvents();
|
5099 |
-
|
5100 |
-
// Set the initial state
|
5101 |
-
this.dataAdapter.current(function (initialData) {
|
5102 |
-
self.trigger('selection:update', {
|
5103 |
-
data: initialData
|
5104 |
-
});
|
5105 |
-
});
|
5106 |
-
|
5107 |
-
// Hide the original select
|
5108 |
-
$element.addClass('select2-hidden-accessible');
|
5109 |
-
$element.attr('aria-hidden', 'true');
|
5110 |
-
|
5111 |
-
// Synchronize any monitored attributes
|
5112 |
-
this._syncAttributes();
|
5113 |
-
|
5114 |
-
$element.data('select2', this);
|
5115 |
-
};
|
5116 |
-
|
5117 |
-
Utils.Extend(Select2, Utils.Observable);
|
5118 |
-
|
5119 |
-
Select2.prototype._generateId = function ($element) {
|
5120 |
-
var id = '';
|
5121 |
-
|
5122 |
-
if ($element.attr('id') != null) {
|
5123 |
-
id = $element.attr('id');
|
5124 |
-
} else if ($element.attr('name') != null) {
|
5125 |
-
id = $element.attr('name') + '-' + Utils.generateChars(2);
|
5126 |
-
} else {
|
5127 |
-
id = Utils.generateChars(4);
|
5128 |
-
}
|
5129 |
-
|
5130 |
-
id = id.replace(/(:|\.|\[|\]|,)/g, '');
|
5131 |
-
id = 'select2-' + id;
|
5132 |
-
|
5133 |
-
return id;
|
5134 |
-
};
|
5135 |
-
|
5136 |
-
Select2.prototype._placeContainer = function ($container) {
|
5137 |
-
$container.insertAfter(this.$element);
|
5138 |
-
|
5139 |
-
var width = this._resolveWidth(this.$element, this.options.get('width'));
|
5140 |
-
|
5141 |
-
if (width != null) {
|
5142 |
-
$container.css('width', width);
|
5143 |
-
}
|
5144 |
-
};
|
5145 |
-
|
5146 |
-
Select2.prototype._resolveWidth = function ($element, method) {
|
5147 |
-
var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
|
5148 |
-
|
5149 |
-
if (method == 'resolve') {
|
5150 |
-
var styleWidth = this._resolveWidth($element, 'style');
|
5151 |
-
|
5152 |
-
if (styleWidth != null) {
|
5153 |
-
return styleWidth;
|
5154 |
-
}
|
5155 |
-
|
5156 |
-
return this._resolveWidth($element, 'element');
|
5157 |
-
}
|
5158 |
-
|
5159 |
-
if (method == 'element') {
|
5160 |
-
var elementWidth = $element.outerWidth(false);
|
5161 |
-
|
5162 |
-
if (elementWidth <= 0) {
|
5163 |
-
return 'auto';
|
5164 |
-
}
|
5165 |
-
|
5166 |
-
return elementWidth + 'px';
|
5167 |
-
}
|
5168 |
-
|
5169 |
-
if (method == 'style') {
|
5170 |
-
var style = $element.attr('style');
|
5171 |
-
|
5172 |
-
if (typeof(style) !== 'string') {
|
5173 |
-
return null;
|
5174 |
-
}
|
5175 |
-
|
5176 |
-
var attrs = style.split(';');
|
5177 |
-
|
5178 |
-
for (var i = 0, l = attrs.length; i < l; i = i + 1) {
|
5179 |
-
var attr = attrs[i].replace(/\s/g, '');
|
5180 |
-
var matches = attr.match(WIDTH);
|
5181 |
-
|
5182 |
-
if (matches !== null && matches.length >= 1) {
|
5183 |
-
return matches[1];
|
5184 |
-
}
|
5185 |
-
}
|
5186 |
-
|
5187 |
-
return null;
|
5188 |
-
}
|
5189 |
-
|
5190 |
-
return method;
|
5191 |
-
};
|
5192 |
-
|
5193 |
-
Select2.prototype._bindAdapters = function () {
|
5194 |
-
this.dataAdapter.bind(this, this.$container);
|
5195 |
-
this.selection.bind(this, this.$container);
|
5196 |
-
|
5197 |
-
this.dropdown.bind(this, this.$container);
|
5198 |
-
this.results.bind(this, this.$container);
|
5199 |
-
};
|
5200 |
-
|
5201 |
-
Select2.prototype._registerDomEvents = function () {
|
5202 |
-
var self = this;
|
5203 |
-
|
5204 |
-
this.$element.on('change.select2', function () {
|
5205 |
-
self.dataAdapter.current(function (data) {
|
5206 |
-
self.trigger('selection:update', {
|
5207 |
-
data: data
|
5208 |
-
});
|
5209 |
-
});
|
5210 |
-
});
|
5211 |
-
|
5212 |
-
this.$element.on('focus.select2', function (evt) {
|
5213 |
-
self.trigger('focus', evt);
|
5214 |
-
});
|
5215 |
-
|
5216 |
-
this._syncA = Utils.bind(this._syncAttributes, this);
|
5217 |
-
this._syncS = Utils.bind(this._syncSubtree, this);
|
5218 |
-
|
5219 |
-
if (this.$element[0].attachEvent) {
|
5220 |
-
this.$element[0].attachEvent('onpropertychange', this._syncA);
|
5221 |
-
}
|
5222 |
-
|
5223 |
-
var observer = window.MutationObserver ||
|
5224 |
-
window.WebKitMutationObserver ||
|
5225 |
-
window.MozMutationObserver
|
5226 |
-
;
|
5227 |
-
|
5228 |
-
if (observer != null) {
|
5229 |
-
this._observer = new observer(function (mutations) {
|
5230 |
-
$.each(mutations, self._syncA);
|
5231 |
-
$.each(mutations, self._syncS);
|
5232 |
-
});
|
5233 |
-
this._observer.observe(this.$element[0], {
|
5234 |
-
attributes: true,
|
5235 |
-
childList: true,
|
5236 |
-
subtree: false
|
5237 |
-
});
|
5238 |
-
} else if (this.$element[0].addEventListener) {
|
5239 |
-
this.$element[0].addEventListener(
|
5240 |
-
'DOMAttrModified',
|
5241 |
-
self._syncA,
|
5242 |
-
false
|
5243 |
-
);
|
5244 |
-
this.$element[0].addEventListener(
|
5245 |
-
'DOMNodeInserted',
|
5246 |
-
self._syncS,
|
5247 |
-
false
|
5248 |
-
);
|
5249 |
-
this.$element[0].addEventListener(
|
5250 |
-
'DOMNodeRemoved',
|
5251 |
-
self._syncS,
|
5252 |
-
false
|
5253 |
-
);
|
5254 |
-
}
|
5255 |
-
};
|
5256 |
-
|
5257 |
-
Select2.prototype._registerDataEvents = function () {
|
5258 |
-
var self = this;
|
5259 |
-
|
5260 |
-
this.dataAdapter.on('*', function (name, params) {
|
5261 |
-
self.trigger(name, params);
|
5262 |
-
});
|
5263 |
-
};
|
5264 |
-
|
5265 |
-
Select2.prototype._registerSelectionEvents = function () {
|
5266 |
-
var self = this;
|
5267 |
-
var nonRelayEvents = ['toggle', 'focus'];
|
5268 |
-
|
5269 |
-
this.selection.on('toggle', function () {
|
5270 |
-
self.toggleDropdown();
|
5271 |
-
});
|
5272 |
-
|
5273 |
-
this.selection.on('focus', function (params) {
|
5274 |
-
self.focus(params);
|
5275 |
-
});
|
5276 |
-
|
5277 |
-
this.selection.on('*', function (name, params) {
|
5278 |
-
if ($.inArray(name, nonRelayEvents) !== -1) {
|
5279 |
-
return;
|
5280 |
-
}
|
5281 |
-
|
5282 |
-
self.trigger(name, params);
|
5283 |
-
});
|
5284 |
-
};
|
5285 |
-
|
5286 |
-
Select2.prototype._registerDropdownEvents = function () {
|
5287 |
-
var self = this;
|
5288 |
-
|
5289 |
-
this.dropdown.on('*', function (name, params) {
|
5290 |
-
self.trigger(name, params);
|
5291 |
-
});
|
5292 |
-
};
|
5293 |
-
|
5294 |
-
Select2.prototype._registerResultsEvents = function () {
|
5295 |
-
var self = this;
|
5296 |
-
|
5297 |
-
this.results.on('*', function (name, params) {
|
5298 |
-
self.trigger(name, params);
|
5299 |
-
});
|
5300 |
-
};
|
5301 |
-
|
5302 |
-
Select2.prototype._registerEvents = function () {
|
5303 |
-
var self = this;
|
5304 |
-
|
5305 |
-
this.on('open', function () {
|
5306 |
-
self.$container.addClass('select2-container--open');
|
5307 |
-
});
|
5308 |
-
|
5309 |
-
this.on('close', function () {
|
5310 |
-
self.$container.removeClass('select2-container--open');
|
5311 |
-
});
|
5312 |
-
|
5313 |
-
this.on('enable', function () {
|
5314 |
-
self.$container.removeClass('select2-container--disabled');
|
5315 |
-
});
|
5316 |
-
|
5317 |
-
this.on('disable', function () {
|
5318 |
-
self.$container.addClass('select2-container--disabled');
|
5319 |
-
});
|
5320 |
-
|
5321 |
-
this.on('blur', function () {
|
5322 |
-
self.$container.removeClass('select2-container--focus');
|
5323 |
-
});
|
5324 |
-
|
5325 |
-
this.on('query', function (params) {
|
5326 |
-
if (!self.isOpen()) {
|
5327 |
-
self.trigger('open', {});
|
5328 |
-
}
|
5329 |
-
|
5330 |
-
this.dataAdapter.query(params, function (data) {
|
5331 |
-
self.trigger('results:all', {
|
5332 |
-
data: data,
|
5333 |
-
query: params
|
5334 |
-
});
|
5335 |
-
});
|
5336 |
-
});
|
5337 |
-
|
5338 |
-
this.on('query:append', function (params) {
|
5339 |
-
this.dataAdapter.query(params, function (data) {
|
5340 |
-
self.trigger('results:append', {
|
5341 |
-
data: data,
|
5342 |
-
query: params
|
5343 |
-
});
|
5344 |
-
});
|
5345 |
-
});
|
5346 |
-
|
5347 |
-
this.on('keypress', function (evt) {
|
5348 |
-
var key = evt.which;
|
5349 |
-
|
5350 |
-
if (self.isOpen()) {
|
5351 |
-
if (key === KEYS.ESC || key === KEYS.TAB ||
|
5352 |
-
(key === KEYS.UP && evt.altKey)) {
|
5353 |
-
self.close();
|
5354 |
-
|
5355 |
-
evt.preventDefault();
|
5356 |
-
} else if (key === KEYS.ENTER) {
|
5357 |
-
self.trigger('results:select', {});
|
5358 |
-
|
5359 |
-
evt.preventDefault();
|
5360 |
-
} else if ((key === KEYS.SPACE && evt.ctrlKey)) {
|
5361 |
-
self.trigger('results:toggle', {});
|
5362 |
-
|
5363 |
-
evt.preventDefault();
|
5364 |
-
} else if (key === KEYS.UP) {
|
5365 |
-
self.trigger('results:previous', {});
|
5366 |
-
|
5367 |
-
evt.preventDefault();
|
5368 |
-
} else if (key === KEYS.DOWN) {
|
5369 |
-
self.trigger('results:next', {});
|
5370 |
-
|
5371 |
-
evt.preventDefault();
|
5372 |
-
}
|
5373 |
-
} else {
|
5374 |
-
if (key === KEYS.ENTER || key === KEYS.SPACE ||
|
5375 |
-
(key === KEYS.DOWN && evt.altKey)) {
|
5376 |
-
self.open();
|
5377 |
-
|
5378 |
-
evt.preventDefault();
|
5379 |
-
}
|
5380 |
-
}
|
5381 |
-
});
|
5382 |
-
};
|
5383 |
-
|
5384 |
-
Select2.prototype._syncAttributes = function () {
|
5385 |
-
this.options.set('disabled', this.$element.prop('disabled'));
|
5386 |
-
|
5387 |
-
if (this.options.get('disabled')) {
|
5388 |
-
if (this.isOpen()) {
|
5389 |
-
this.close();
|
5390 |
-
}
|
5391 |
-
|
5392 |
-
this.trigger('disable', {});
|
5393 |
-
} else {
|
5394 |
-
this.trigger('enable', {});
|
5395 |
-
}
|
5396 |
-
};
|
5397 |
-
|
5398 |
-
Select2.prototype._syncSubtree = function (evt, mutations) {
|
5399 |
-
var changed = false;
|
5400 |
-
var self = this;
|
5401 |
-
|
5402 |
-
// Ignore any mutation events raised for elements that aren't options or
|
5403 |
-
// optgroups. This handles the case when the select element is destroyed
|
5404 |
-
if (
|
5405 |
-
evt && evt.target && (
|
5406 |
-
evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
|
5407 |
-
)
|
5408 |
-
) {
|
5409 |
-
return;
|
5410 |
-
}
|
5411 |
-
|
5412 |
-
if (!mutations) {
|
5413 |
-
// If mutation events aren't supported, then we can only assume that the
|
5414 |
-
// change affected the selections
|
5415 |
-
changed = true;
|
5416 |
-
} else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
|
5417 |
-
for (var n = 0; n < mutations.addedNodes.length; n++) {
|
5418 |
-
var node = mutations.addedNodes[n];
|
5419 |
-
|
5420 |
-
if (node.selected) {
|
5421 |
-
changed = true;
|
5422 |
-
}
|
5423 |
-
}
|
5424 |
-
} else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
|
5425 |
-
changed = true;
|
5426 |
-
}
|
5427 |
-
|
5428 |
-
// Only re-pull the data if we think there is a change
|
5429 |
-
if (changed) {
|
5430 |
-
this.dataAdapter.current(function (currentData) {
|
5431 |
-
self.trigger('selection:update', {
|
5432 |
-
data: currentData
|
5433 |
-
});
|
5434 |
-
});
|
5435 |
-
}
|
5436 |
-
};
|
5437 |
-
|
5438 |
-
/**
|
5439 |
-
* Override the trigger method to automatically trigger pre-events when
|
5440 |
-
* there are events that can be prevented.
|
5441 |
-
*/
|
5442 |
-
Select2.prototype.trigger = function (name, args) {
|
5443 |
-
var actualTrigger = Select2.__super__.trigger;
|
5444 |
-
var preTriggerMap = {
|
5445 |
-
'open': 'opening',
|
5446 |
-
'close': 'closing',
|
5447 |
-
'select': 'selecting',
|
5448 |
-
'unselect': 'unselecting'
|
5449 |
-
};
|
5450 |
-
|
5451 |
-
if (args === undefined) {
|
5452 |
-
args = {};
|
5453 |
-
}
|
5454 |
-
|
5455 |
-
if (name in preTriggerMap) {
|
5456 |
-
var preTriggerName = preTriggerMap[name];
|
5457 |
-
var preTriggerArgs = {
|
5458 |
-
prevented: false,
|
5459 |
-
name: name,
|
5460 |
-
args: args
|
5461 |
-
};
|
5462 |
-
|
5463 |
-
actualTrigger.call(this, preTriggerName, preTriggerArgs);
|
5464 |
-
|
5465 |
-
if (preTriggerArgs.prevented) {
|
5466 |
-
args.prevented = true;
|
5467 |
-
|
5468 |
-
return;
|
5469 |
-
}
|
5470 |
-
}
|
5471 |
-
|
5472 |
-
actualTrigger.call(this, name, args);
|
5473 |
-
};
|
5474 |
-
|
5475 |
-
Select2.prototype.toggleDropdown = function () {
|
5476 |
-
if (this.options.get('disabled')) {
|
5477 |
-
return;
|
5478 |
-
}
|
5479 |
-
|
5480 |
-
if (this.isOpen()) {
|
5481 |
-
this.close();
|
5482 |
-
} else {
|
5483 |
-
this.open();
|
5484 |
-
}
|
5485 |
-
};
|
5486 |
-
|
5487 |
-
Select2.prototype.open = function () {
|
5488 |
-
if (this.isOpen()) {
|
5489 |
-
return;
|
5490 |
-
}
|
5491 |
-
|
5492 |
-
this.trigger('query', {});
|
5493 |
-
};
|
5494 |
-
|
5495 |
-
Select2.prototype.close = function () {
|
5496 |
-
if (!this.isOpen()) {
|
5497 |
-
return;
|
5498 |
-
}
|
5499 |
-
|
5500 |
-
this.trigger('close', {});
|
5501 |
-
};
|
5502 |
-
|
5503 |
-
Select2.prototype.isOpen = function () {
|
5504 |
-
return this.$container.hasClass('select2-container--open');
|
5505 |
-
};
|
5506 |
-
|
5507 |
-
Select2.prototype.hasFocus = function () {
|
5508 |
-
return this.$container.hasClass('select2-container--focus');
|
5509 |
-
};
|
5510 |
-
|
5511 |
-
Select2.prototype.focus = function (data) {
|
5512 |
-
// No need to re-trigger focus events if we are already focused
|
5513 |
-
if (this.hasFocus()) {
|
5514 |
-
return;
|
5515 |
-
}
|
5516 |
-
|
5517 |
-
this.$container.addClass('select2-container--focus');
|
5518 |
-
this.trigger('focus', {});
|
5519 |
-
};
|
5520 |
-
|
5521 |
-
Select2.prototype.enable = function (args) {
|
5522 |
-
if (this.options.get('debug') && window.console && console.warn) {
|
5523 |
-
console.warn(
|
5524 |
-
'Select2: The `select2("enable")` method has been deprecated and will' +
|
5525 |
-
' be removed in later Select2 versions. Use $element.prop("disabled")' +
|
5526 |
-
' instead.'
|
5527 |
-
);
|
5528 |
-
}
|
5529 |
-
|
5530 |
-
if (args == null || args.length === 0) {
|
5531 |
-
args = [true];
|
5532 |
-
}
|
5533 |
-
|
5534 |
-
var disabled = !args[0];
|
5535 |
-
|
5536 |
-
this.$element.prop('disabled', disabled);
|
5537 |
-
};
|
5538 |
-
|
5539 |
-
Select2.prototype.data = function () {
|
5540 |
-
if (this.options.get('debug') &&
|
5541 |
-
arguments.length > 0 && window.console && console.warn) {
|
5542 |
-
console.warn(
|
5543 |
-
'Select2: Data can no longer be set using `select2("data")`. You ' +
|
5544 |
-
'should consider setting the value instead using `$element.val()`.'
|
5545 |
-
);
|
5546 |
-
}
|
5547 |
-
|
5548 |
-
var data = [];
|
5549 |
-
|
5550 |
-
this.dataAdapter.current(function (currentData) {
|
5551 |
-
data = currentData;
|
5552 |
-
});
|
5553 |
-
|
5554 |
-
return data;
|
5555 |
-
};
|
5556 |
-
|
5557 |
-
Select2.prototype.val = function (args) {
|
5558 |
-
if (this.options.get('debug') && window.console && console.warn) {
|
5559 |
-
console.warn(
|
5560 |
-
'Select2: The `select2("val")` method has been deprecated and will be' +
|
5561 |
-
' removed in later Select2 versions. Use $element.val() instead.'
|
5562 |
-
);
|
5563 |
-
}
|
5564 |
-
|
5565 |
-
if (args == null || args.length === 0) {
|
5566 |
-
return this.$element.val();
|
5567 |
-
}
|
5568 |
-
|
5569 |
-
var newVal = args[0];
|
5570 |
-
|
5571 |
-
if ($.isArray(newVal)) {
|
5572 |
-
newVal = $.map(newVal, function (obj) {
|
5573 |
-
return obj.toString();
|
5574 |
-
});
|
5575 |
-
}
|
5576 |
-
|
5577 |
-
this.$element.val(newVal).trigger('change');
|
5578 |
-
};
|
5579 |
-
|
5580 |
-
Select2.prototype.destroy = function () {
|
5581 |
-
this.$container.remove();
|
5582 |
-
|
5583 |
-
if (this.$element[0].detachEvent) {
|
5584 |
-
this.$element[0].detachEvent('onpropertychange', this._syncA);
|
5585 |
-
}
|
5586 |
-
|
5587 |
-
if (this._observer != null) {
|
5588 |
-
this._observer.disconnect();
|
5589 |
-
this._observer = null;
|
5590 |
-
} else if (this.$element[0].removeEventListener) {
|
5591 |
-
this.$element[0]
|
5592 |
-
.removeEventListener('DOMAttrModified', this._syncA, false);
|
5593 |
-
this.$element[0]
|
5594 |
-
.removeEventListener('DOMNodeInserted', this._syncS, false);
|
5595 |
-
this.$element[0]
|
5596 |
-
.removeEventListener('DOMNodeRemoved', this._syncS, false);
|
5597 |
-
}
|
5598 |
-
|
5599 |
-
this._syncA = null;
|
5600 |
-
this._syncS = null;
|
5601 |
-
|
5602 |
-
this.$element.off('.select2');
|
5603 |
-
this.$element.attr('tabindex', this.$element.data('old-tabindex'));
|
5604 |
-
|
5605 |
-
this.$element.removeClass('select2-hidden-accessible');
|
5606 |
-
this.$element.attr('aria-hidden', 'false');
|
5607 |
-
this.$element.removeData('select2');
|
5608 |
-
|
5609 |
-
this.dataAdapter.destroy();
|
5610 |
-
this.selection.destroy();
|
5611 |
-
this.dropdown.destroy();
|
5612 |
-
this.results.destroy();
|
5613 |
-
|
5614 |
-
this.dataAdapter = null;
|
5615 |
-
this.selection = null;
|
5616 |
-
this.dropdown = null;
|
5617 |
-
this.results = null;
|
5618 |
-
};
|
5619 |
-
|
5620 |
-
Select2.prototype.render = function () {
|
5621 |
-
var $container = $(
|
5622 |
-
'<span class="select2 select2-container">' +
|
5623 |
-
'<span class="selection"></span>' +
|
5624 |
-
'<span class="dropdown-wrapper" aria-hidden="true"></span>' +
|
5625 |
-
'</span>'
|
5626 |
-
);
|
5627 |
-
|
5628 |
-
$container.attr('dir', this.options.get('dir'));
|
5629 |
-
|
5630 |
-
this.$container = $container;
|
5631 |
-
|
5632 |
-
this.$container.addClass('select2-container--' + this.options.get('theme'));
|
5633 |
-
|
5634 |
-
$container.data('element', this.$element);
|
5635 |
-
|
5636 |
-
return $container;
|
5637 |
-
};
|
5638 |
-
|
5639 |
-
return Select2;
|
5640 |
-
});
|
5641 |
-
|
5642 |
-
S2.define('select2/compat/utils',[
|
5643 |
-
'jquery'
|
5644 |
-
], function ($) {
|
5645 |
-
function syncCssClasses ($dest, $src, adapter) {
|
5646 |
-
var classes, replacements = [], adapted;
|
5647 |
-
|
5648 |
-
classes = $.trim($dest.attr('class'));
|
5649 |
-
|
5650 |
-
if (classes) {
|
5651 |
-
classes = '' + classes; // for IE which returns object
|
5652 |
-
|
5653 |
-
$(classes.split(/\s+/)).each(function () {
|
5654 |
-
// Save all Select2 classes
|
5655 |
-
if (this.indexOf('select2-') === 0) {
|
5656 |
-
replacements.push(this);
|
5657 |
-
}
|
5658 |
-
});
|
5659 |
-
}
|
5660 |
-
|
5661 |
-
classes = $.trim($src.attr('class'));
|
5662 |
-
|
5663 |
-
if (classes) {
|
5664 |
-
classes = '' + classes; // for IE which returns object
|
5665 |
-
|
5666 |
-
$(classes.split(/\s+/)).each(function () {
|
5667 |
-
// Only adapt non-Select2 classes
|
5668 |
-
if (this.indexOf('select2-') !== 0) {
|
5669 |
-
adapted = adapter(this);
|
5670 |
-
|
5671 |
-
if (adapted != null) {
|
5672 |
-
replacements.push(adapted);
|
5673 |
-
}
|
5674 |
-
}
|
5675 |
-
});
|
5676 |
-
}
|
5677 |
-
|
5678 |
-
$dest.attr('class', replacements.join(' '));
|
5679 |
-
}
|
5680 |
-
|
5681 |
-
return {
|
5682 |
-
syncCssClasses: syncCssClasses
|
5683 |
-
};
|
5684 |
-
});
|
5685 |
-
|
5686 |
-
S2.define('select2/compat/containerCss',[
|
5687 |
-
'jquery',
|
5688 |
-
'./utils'
|
5689 |
-
], function ($, CompatUtils) {
|
5690 |
-
// No-op CSS adapter that discards all classes by default
|
5691 |
-
function _containerAdapter (clazz) {
|
5692 |
-
return null;
|
5693 |
-
}
|
5694 |
-
|
5695 |
-
function ContainerCSS () { }
|
5696 |
-
|
5697 |
-
ContainerCSS.prototype.render = function (decorated) {
|
5698 |
-
var $container = decorated.call(this);
|
5699 |
-
|
5700 |
-
var containerCssClass = this.options.get('containerCssClass') || '';
|
5701 |
-
|
5702 |
-
if ($.isFunction(containerCssClass)) {
|
5703 |
-
containerCssClass = containerCssClass(this.$element);
|
5704 |
-
}
|
5705 |
-
|
5706 |
-
var containerCssAdapter = this.options.get('adaptContainerCssClass');
|
5707 |
-
containerCssAdapter = containerCssAdapter || _containerAdapter;
|
5708 |
-
|
5709 |
-
if (containerCssClass.indexOf(':all:') !== -1) {
|
5710 |
-
containerCssClass = containerCssClass.replace(':all:', '');
|
5711 |
-
|
5712 |
-
var _cssAdapter = containerCssAdapter;
|
5713 |
-
|
5714 |
-
containerCssAdapter = function (clazz) {
|
5715 |
-
var adapted = _cssAdapter(clazz);
|
5716 |
-
|
5717 |
-
if (adapted != null) {
|
5718 |
-
// Append the old one along with the adapted one
|
5719 |
-
return adapted + ' ' + clazz;
|
5720 |
-
}
|
5721 |
-
|
5722 |
-
return clazz;
|
5723 |
-
};
|
5724 |
-
}
|
5725 |
-
|
5726 |
-
var containerCss = this.options.get('containerCss') || {};
|
5727 |
-
|
5728 |
-
if ($.isFunction(containerCss)) {
|
5729 |
-
containerCss = containerCss(this.$element);
|
5730 |
-
}
|
5731 |
-
|
5732 |
-
CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter);
|
5733 |
-
|
5734 |
-
$container.css(containerCss);
|
5735 |
-
$container.addClass(containerCssClass);
|
5736 |
-
|
5737 |
-
return $container;
|
5738 |
-
};
|
5739 |
-
|
5740 |
-
return ContainerCSS;
|
5741 |
-
});
|
5742 |
-
|
5743 |
-
S2.define('select2/compat/dropdownCss',[
|
5744 |
-
'jquery',
|
5745 |
-
'./utils'
|
5746 |
-
], function ($, CompatUtils) {
|
5747 |
-
// No-op CSS adapter that discards all classes by default
|
5748 |
-
function _dropdownAdapter (clazz) {
|
5749 |
-
return null;
|
5750 |
-
}
|
5751 |
-
|
5752 |
-
function DropdownCSS () { }
|
5753 |
-
|
5754 |
-
DropdownCSS.prototype.render = function (decorated) {
|
5755 |
-
var $dropdown = decorated.call(this);
|
5756 |
-
|
5757 |
-
var dropdownCssClass = this.options.get('dropdownCssClass') || '';
|
5758 |
-
|
5759 |
-
if ($.isFunction(dropdownCssClass)) {
|
5760 |
-
dropdownCssClass = dropdownCssClass(this.$element);
|
5761 |
-
}
|
5762 |
-
|
5763 |
-
var dropdownCssAdapter = this.options.get('adaptDropdownCssClass');
|
5764 |
-
dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;
|
5765 |
-
|
5766 |
-
if (dropdownCssClass.indexOf(':all:') !== -1) {
|
5767 |
-
dropdownCssClass = dropdownCssClass.replace(':all:', '');
|
5768 |
-
|
5769 |
-
var _cssAdapter = dropdownCssAdapter;
|
5770 |
-
|
5771 |
-
dropdownCssAdapter = function (clazz) {
|
5772 |
-
var adapted = _cssAdapter(clazz);
|
5773 |
-
|
5774 |
-
if (adapted != null) {
|
5775 |
-
// Append the old one along with the adapted one
|
5776 |
-
return adapted + ' ' + clazz;
|
5777 |
-
}
|
5778 |
-
|
5779 |
-
return clazz;
|
5780 |
-
};
|
5781 |
-
}
|
5782 |
-
|
5783 |
-
var dropdownCss = this.options.get('dropdownCss') || {};
|
5784 |
-
|
5785 |
-
if ($.isFunction(dropdownCss)) {
|
5786 |
-
dropdownCss = dropdownCss(this.$element);
|
5787 |
-
}
|
5788 |
-
|
5789 |
-
CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter);
|
5790 |
-
|
5791 |
-
$dropdown.css(dropdownCss);
|
5792 |
-
$dropdown.addClass(dropdownCssClass);
|
5793 |
-
|
5794 |
-
return $dropdown;
|
5795 |
-
};
|
5796 |
-
|
5797 |
-
return DropdownCSS;
|
5798 |
-
});
|
5799 |
-
|
5800 |
-
S2.define('select2/compat/initSelection',[
|
5801 |
-
'jquery'
|
5802 |
-
], function ($) {
|
5803 |
-
function InitSelection (decorated, $element, options) {
|
5804 |
-
if (options.get('debug') && window.console && console.warn) {
|
5805 |
-
console.warn(
|
5806 |
-
'Select2: The `initSelection` option has been deprecated in favor' +
|
5807 |
-
' of a custom data adapter that overrides the `current` method. ' +
|
5808 |
-
'This method is now called multiple times instead of a single ' +
|
5809 |
-
'time when the instance is initialized. Support will be removed ' +
|
5810 |
-
'for the `initSelection` option in future versions of Select2'
|
5811 |
-
);
|
5812 |
-
}
|
5813 |
-
|
5814 |
-
this.initSelection = options.get('initSelection');
|
5815 |
-
this._isInitialized = false;
|
5816 |
-
|
5817 |
-
decorated.call(this, $element, options);
|
5818 |
-
}
|
5819 |
-
|
5820 |
-
InitSelection.prototype.current = function (decorated, callback) {
|
5821 |
-
var self = this;
|
5822 |
-
|
5823 |
-
if (this._isInitialized) {
|
5824 |
-
decorated.call(this, callback);
|
5825 |
-
|
5826 |
-
return;
|
5827 |
-
}
|
5828 |
-
|
5829 |
-
this.initSelection.call(null, this.$element, function (data) {
|
5830 |
-
self._isInitialized = true;
|
5831 |
-
|
5832 |
-
if (!$.isArray(data)) {
|
5833 |
-
data = [data];
|
5834 |
-
}
|
5835 |
-
|
5836 |
-
callback(data);
|
5837 |
-
});
|
5838 |
-
};
|
5839 |
-
|
5840 |
-
return InitSelection;
|
5841 |
-
});
|
5842 |
-
|
5843 |
-
S2.define('select2/compat/inputData',[
|
5844 |
-
'jquery'
|
5845 |
-
], function ($) {
|
5846 |
-
function InputData (decorated, $element, options) {
|
5847 |
-
this._currentData = [];
|
5848 |
-
this._valueSeparator = options.get('valueSeparator') || ',';
|
5849 |
-
|
5850 |
-
if ($element.prop('type') === 'hidden') {
|
5851 |
-
if (options.get('debug') && console && console.warn) {
|
5852 |
-
console.warn(
|
5853 |
-
'Select2: Using a hidden input with Select2 is no longer ' +
|
5854 |
-
'supported and may stop working in the future. It is recommended ' +
|
5855 |
-
'to use a `<select>` element instead.'
|
5856 |
-
);
|
5857 |
-
}
|
5858 |
-
}
|
5859 |
-
|
5860 |
-
decorated.call(this, $element, options);
|
5861 |
-
}
|
5862 |
-
|
5863 |
-
InputData.prototype.current = function (_, callback) {
|
5864 |
-
function getSelected (data, selectedIds) {
|
5865 |
-
var selected = [];
|
5866 |
-
|
5867 |
-
if (data.selected || $.inArray(data.id, selectedIds) !== -1) {
|
5868 |
-
data.selected = true;
|
5869 |
-
selected.push(data);
|
5870 |
-
} else {
|
5871 |
-
data.selected = false;
|
5872 |
-
}
|
5873 |
-
|
5874 |
-
if (data.children) {
|
5875 |
-
selected.push.apply(selected, getSelected(data.children, selectedIds));
|
5876 |
-
}
|
5877 |
-
|
5878 |
-
return selected;
|
5879 |
-
}
|
5880 |
-
|
5881 |
-
var selected = [];
|
5882 |
-
|
5883 |
-
for (var d = 0; d < this._currentData.length; d++) {
|
5884 |
-
var data = this._currentData[d];
|
5885 |
-
|
5886 |
-
selected.push.apply(
|
5887 |
-
selected,
|
5888 |
-
getSelected(
|
5889 |
-
data,
|
5890 |
-
this.$element.val().split(
|
5891 |
-
this._valueSeparator
|
5892 |
-
)
|
5893 |
-
)
|
5894 |
-
);
|
5895 |
-
}
|
5896 |
-
|
5897 |
-
callback(selected);
|
5898 |
-
};
|
5899 |
-
|
5900 |
-
InputData.prototype.select = function (_, data) {
|
5901 |
-
if (!this.options.get('multiple')) {
|
5902 |
-
this.current(function (allData) {
|
5903 |
-
$.map(allData, function (data) {
|
5904 |
-
data.selected = false;
|
5905 |
-
});
|
5906 |
-
});
|
5907 |
-
|
5908 |
-
this.$element.val(data.id);
|
5909 |
-
this.$element.trigger('change');
|
5910 |
-
} else {
|
5911 |
-
var value = this.$element.val();
|
5912 |
-
value += this._valueSeparator + data.id;
|
5913 |
-
|
5914 |
-
this.$element.val(value);
|
5915 |
-
this.$element.trigger('change');
|
5916 |
-
}
|
5917 |
-
};
|
5918 |
-
|
5919 |
-
InputData.prototype.unselect = function (_, data) {
|
5920 |
-
var self = this;
|
5921 |
-
|
5922 |
-
data.selected = false;
|
5923 |
-
|
5924 |
-
this.current(function (allData) {
|
5925 |
-
var values = [];
|
5926 |
-
|
5927 |
-
for (var d = 0; d < allData.length; d++) {
|
5928 |
-
var item = allData[d];
|
5929 |
-
|
5930 |
-
if (data.id == item.id) {
|
5931 |
-
continue;
|
5932 |
-
}
|
5933 |
-
|
5934 |
-
values.push(item.id);
|
5935 |
-
}
|
5936 |
-
|
5937 |
-
self.$element.val(values.join(self._valueSeparator));
|
5938 |
-
self.$element.trigger('change');
|
5939 |
-
});
|
5940 |
-
};
|
5941 |
-
|
5942 |
-
InputData.prototype.query = function (_, params, callback) {
|
5943 |
-
var results = [];
|
5944 |
-
|
5945 |
-
for (var d = 0; d < this._currentData.length; d++) {
|
5946 |
-
var data = this._currentData[d];
|
5947 |
-
|
5948 |
-
var matches = this.matches(params, data);
|
5949 |
-
|
5950 |
-
if (matches !== null) {
|
5951 |
-
results.push(matches);
|
5952 |
-
}
|
5953 |
-
}
|
5954 |
-
|
5955 |
-
callback({
|
5956 |
-
results: results
|
5957 |
-
});
|
5958 |
-
};
|
5959 |
-
|
5960 |
-
InputData.prototype.addOptions = function (_, $options) {
|
5961 |
-
var options = $.map($options, function ($option) {
|
5962 |
-
return $.data($option[0], 'data');
|
5963 |
-
});
|
5964 |
-
|
5965 |
-
this._currentData.push.apply(this._currentData, options);
|
5966 |
-
};
|
5967 |
-
|
5968 |
-
return InputData;
|
5969 |
-
});
|
5970 |
-
|
5971 |
-
S2.define('select2/compat/matcher',[
|
5972 |
-
'jquery'
|
5973 |
-
], function ($) {
|
5974 |
-
function oldMatcher (matcher) {
|
5975 |
-
function wrappedMatcher (params, data) {
|
5976 |
-
var match = $.extend(true, {}, data);
|
5977 |
-
|
5978 |
-
if (params.term == null || $.trim(params.term) === '') {
|
5979 |
-
return match;
|
5980 |
-
}
|
5981 |
-
|
5982 |
-
if (data.children) {
|
5983 |
-
for (var c = data.children.length - 1; c >= 0; c--) {
|
5984 |
-
var child = data.children[c];
|
5985 |
-
|
5986 |
-
// Check if the child object matches
|
5987 |
-
// The old matcher returned a boolean true or false
|
5988 |
-
var doesMatch = matcher(params.term, child.text, child);
|
5989 |
-
|
5990 |
-
// If the child didn't match, pop it off
|
5991 |
-
if (!doesMatch) {
|
5992 |
-
match.children.splice(c, 1);
|
5993 |
-
}
|
5994 |
-
}
|
5995 |
-
|
5996 |
-
if (match.children.length > 0) {
|
5997 |
-
return match;
|
5998 |
-
}
|
5999 |
-
}
|
6000 |
-
|
6001 |
-
if (matcher(params.term, data.text, data)) {
|
6002 |
-
return match;
|
6003 |
-
}
|
6004 |
-
|
6005 |
-
return null;
|
6006 |
-
}
|
6007 |
-
|
6008 |
-
return wrappedMatcher;
|
6009 |
-
}
|
6010 |
-
|
6011 |
-
return oldMatcher;
|
6012 |
-
});
|
6013 |
-
|
6014 |
-
S2.define('select2/compat/query',[
|
6015 |
-
|
6016 |
-
], function () {
|
6017 |
-
function Query (decorated, $element, options) {
|
6018 |
-
if (options.get('debug') && window.console && console.warn) {
|
6019 |
-
console.warn(
|
6020 |
-
'Select2: The `query` option has been deprecated in favor of a ' +
|
6021 |
-
'custom data adapter that overrides the `query` method. Support ' +
|
6022 |
-
'will be removed for the `query` option in future versions of ' +
|
6023 |
-
'Select2.'
|
6024 |
-
);
|
6025 |
-
}
|
6026 |
-
|
6027 |
-
decorated.call(this, $element, options);
|
6028 |
-
}
|
6029 |
-
|
6030 |
-
Query.prototype.query = function (_, params, callback) {
|
6031 |
-
params.callback = callback;
|
6032 |
-
|
6033 |
-
var query = this.options.get('query');
|
6034 |
-
|
6035 |
-
query.call(null, params);
|
6036 |
-
};
|
6037 |
-
|
6038 |
-
return Query;
|
6039 |
-
});
|
6040 |
-
|
6041 |
-
S2.define('select2/dropdown/attachContainer',[
|
6042 |
-
|
6043 |
-
], function () {
|
6044 |
-
function AttachContainer (decorated, $element, options) {
|
6045 |
-
decorated.call(this, $element, options);
|
6046 |
-
}
|
6047 |
-
|
6048 |
-
AttachContainer.prototype.position =
|
6049 |
-
function (decorated, $dropdown, $container) {
|
6050 |
-
var $dropdownContainer = $container.find('.dropdown-wrapper');
|
6051 |
-
$dropdownContainer.append($dropdown);
|
6052 |
-
|
6053 |
-
$dropdown.addClass('select2-dropdown--below');
|
6054 |
-
$container.addClass('select2-container--below');
|
6055 |
-
};
|
6056 |
-
|
6057 |
-
return AttachContainer;
|
6058 |
-
});
|
6059 |
-
|
6060 |
-
S2.define('select2/dropdown/stopPropagation',[
|
6061 |
-
|
6062 |
-
], function () {
|
6063 |
-
function StopPropagation () { }
|
6064 |
-
|
6065 |
-
StopPropagation.prototype.bind = function (decorated, container, $container) {
|
6066 |
-
decorated.call(this, container, $container);
|
6067 |
-
|
6068 |
-
var stoppedEvents = [
|
6069 |
-
'blur',
|
6070 |
-
'change',
|
6071 |
-
'click',
|
6072 |
-
'dblclick',
|
6073 |
-
'focus',
|
6074 |
-
'focusin',
|
6075 |
-
'focusout',
|
6076 |
-
'input',
|
6077 |
-
'keydown',
|
6078 |
-
'keyup',
|
6079 |
-
'keypress',
|
6080 |
-
'mousedown',
|
6081 |
-
'mouseenter',
|
6082 |
-
'mouseleave',
|
6083 |
-
'mousemove',
|
6084 |
-
'mouseover',
|
6085 |
-
'mouseup',
|
6086 |
-
'search',
|
6087 |
-
'touchend',
|
6088 |
-
'touchstart'
|
6089 |
-
];
|
6090 |
-
|
6091 |
-
this.$dropdown.on(stoppedEvents.join(' '), function (evt) {
|
6092 |
-
evt.stopPropagation();
|
6093 |
-
});
|
6094 |
-
};
|
6095 |
-
|
6096 |
-
return StopPropagation;
|
6097 |
-
});
|
6098 |
-
|
6099 |
-
S2.define('select2/selection/stopPropagation',[
|
6100 |
-
|
6101 |
-
], function () {
|
6102 |
-
function StopPropagation () { }
|
6103 |
-
|
6104 |
-
StopPropagation.prototype.bind = function (decorated, container, $container) {
|
6105 |
-
decorated.call(this, container, $container);
|
6106 |
-
|
6107 |
-
var stoppedEvents = [
|
6108 |
-
'blur',
|
6109 |
-
'change',
|
6110 |
-
'click',
|
6111 |
-
'dblclick',
|
6112 |
-
'focus',
|
6113 |
-
'focusin',
|
6114 |
-
'focusout',
|
6115 |
-
'input',
|
6116 |
-
'keydown',
|
6117 |
-
'keyup',
|
6118 |
-
'keypress',
|
6119 |
-
'mousedown',
|
6120 |
-
'mouseenter',
|
6121 |
-
'mouseleave',
|
6122 |
-
'mousemove',
|
6123 |
-
'mouseover',
|
6124 |
-
'mouseup',
|
6125 |
-
'search',
|
6126 |
-
'touchend',
|
6127 |
-
'touchstart'
|
6128 |
-
];
|
6129 |
-
|
6130 |
-
this.$selection.on(stoppedEvents.join(' '), function (evt) {
|
6131 |
-
evt.stopPropagation();
|
6132 |
-
});
|
6133 |
-
};
|
6134 |
-
|
6135 |
-
return StopPropagation;
|
6136 |
-
});
|
6137 |
-
|
6138 |
-
/*!
|
6139 |
-
* jQuery Mousewheel 3.1.13
|
6140 |
-
*
|
6141 |
-
* Copyright jQuery Foundation and other contributors
|
6142 |
-
* Released under the MIT license
|
6143 |
-
* http://jquery.org/license
|
6144 |
-
*/
|
6145 |
-
|
6146 |
-
(function (factory) {
|
6147 |
-
if ( typeof S2.define === 'function' && S2.define.amd ) {
|
6148 |
-
// AMD. Register as an anonymous module.
|
6149 |
-
S2.define('jquery-mousewheel',['jquery'], factory);
|
6150 |
-
} else if (typeof exports === 'object') {
|
6151 |
-
// Node/CommonJS style for Browserify
|
6152 |
-
module.exports = factory;
|
6153 |
-
} else {
|
6154 |
-
// Browser globals
|
6155 |
-
factory(jQuery);
|
6156 |
-
}
|
6157 |
-
}(function ($) {
|
6158 |
-
|
6159 |
-
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
|
6160 |
-
toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
|
6161 |
-
['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
|
6162 |
-
slice = Array.prototype.slice,
|
6163 |
-
nullLowestDeltaTimeout, lowestDelta;
|
6164 |
-
|
6165 |
-
if ( $.event.fixHooks ) {
|
6166 |
-
for ( var i = toFix.length; i; ) {
|
6167 |
-
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
|
6168 |
-
}
|
6169 |
-
}
|
6170 |
-
|
6171 |
-
var special = $.event.special.mousewheel = {
|
6172 |
-
version: '3.1.12',
|
6173 |
-
|
6174 |
-
setup: function() {
|
6175 |
-
if ( this.addEventListener ) {
|
6176 |
-
for ( var i = toBind.length; i; ) {
|
6177 |
-
this.addEventListener( toBind[--i], handler, false );
|
6178 |
-
}
|
6179 |
-
} else {
|
6180 |
-
this.onmousewheel = handler;
|
6181 |
-
}
|
6182 |
-
// Store the line height and page height for this particular element
|
6183 |
-
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
|
6184 |
-
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
|
6185 |
-
},
|
6186 |
-
|
6187 |
-
teardown: function() {
|
6188 |
-
if ( this.removeEventListener ) {
|
6189 |
-
for ( var i = toBind.length; i; ) {
|
6190 |
-
this.removeEventListener( toBind[--i], handler, false );
|
6191 |
-
}
|
6192 |
-
} else {
|
6193 |
-
this.onmousewheel = null;
|
6194 |
-
}
|
6195 |
-
// Clean up the data we added to the element
|
6196 |
-
$.removeData(this, 'mousewheel-line-height');
|
6197 |
-
$.removeData(this, 'mousewheel-page-height');
|
6198 |
-
},
|
6199 |
-
|
6200 |
-
getLineHeight: function(elem) {
|
6201 |
-
var $elem = $(elem),
|
6202 |
-
$parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
|
6203 |
-
if (!$parent.length) {
|
6204 |
-
$parent = $('body');
|
6205 |
-
}
|
6206 |
-
return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
|
6207 |
-
},
|
6208 |
-
|
6209 |
-
getPageHeight: function(elem) {
|
6210 |
-
return $(elem).height();
|
6211 |
-
},
|
6212 |
-
|
6213 |
-
settings: {
|
6214 |
-
adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
|
6215 |
-
normalizeOffset: true // calls getBoundingClientRect for each event
|
6216 |
-
}
|
6217 |
-
};
|
6218 |
-
|
6219 |
-
$.fn.extend({
|
6220 |
-
mousewheel: function(fn) {
|
6221 |
-
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
|
6222 |
-
},
|
6223 |
-
|
6224 |
-
unmousewheel: function(fn) {
|
6225 |
-
return this.unbind('mousewheel', fn);
|
6226 |
-
}
|
6227 |
-
});
|
6228 |
-
|
6229 |
-
|
6230 |
-
function handler(event) {
|
6231 |
-
var orgEvent = event || window.event,
|
6232 |
-
args = slice.call(arguments, 1),
|
6233 |
-
delta = 0,
|
6234 |
-
deltaX = 0,
|
6235 |
-
deltaY = 0,
|
6236 |
-
absDelta = 0,
|
6237 |
-
offsetX = 0,
|
6238 |
-
offsetY = 0;
|
6239 |
-
event = $.event.fix(orgEvent);
|
6240 |
-
event.type = 'mousewheel';
|
6241 |
-
|
6242 |
-
// Old school scrollwheel delta
|
6243 |
-
if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
|
6244 |
-
if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
|
6245 |
-
if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
|
6246 |
-
if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
|
6247 |
-
|
6248 |
-
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
|
6249 |
-
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
|
6250 |
-
deltaX = deltaY * -1;
|
6251 |
-
deltaY = 0;
|
6252 |
-
}
|
6253 |
-
|
6254 |
-
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
|
6255 |
-
delta = deltaY === 0 ? deltaX : deltaY;
|
6256 |
-
|
6257 |
-
// New school wheel delta (wheel event)
|
6258 |
-
if ( 'deltaY' in orgEvent ) {
|
6259 |
-
deltaY = orgEvent.deltaY * -1;
|
6260 |
-
delta = deltaY;
|
6261 |
-
}
|
6262 |
-
if ( 'deltaX' in orgEvent ) {
|
6263 |
-
deltaX = orgEvent.deltaX;
|
6264 |
-
if ( deltaY === 0 ) { delta = deltaX * -1; }
|
6265 |
-
}
|
6266 |
-
|
6267 |
-
// No change actually happened, no reason to go any further
|
6268 |
-
if ( deltaY === 0 && deltaX === 0 ) { return; }
|
6269 |
-
|
6270 |
-
// Need to convert lines and pages to pixels if we aren't already in pixels
|
6271 |
-
// There are three delta modes:
|
6272 |
-
// * deltaMode 0 is by pixels, nothing to do
|
6273 |
-
// * deltaMode 1 is by lines
|
6274 |
-
// * deltaMode 2 is by pages
|
6275 |
-
if ( orgEvent.deltaMode === 1 ) {
|
6276 |
-
var lineHeight = $.data(this, 'mousewheel-line-height');
|
6277 |
-
delta *= lineHeight;
|
6278 |
-
deltaY *= lineHeight;
|
6279 |
-
deltaX *= lineHeight;
|
6280 |
-
} else if ( orgEvent.deltaMode === 2 ) {
|
6281 |
-
var pageHeight = $.data(this, 'mousewheel-page-height');
|
6282 |
-
delta *= pageHeight;
|
6283 |
-
deltaY *= pageHeight;
|
6284 |
-
deltaX *= pageHeight;
|
6285 |
-
}
|
6286 |
-
|
6287 |
-
// Store lowest absolute delta to normalize the delta values
|
6288 |
-
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
|
6289 |
-
|
6290 |
-
if ( !lowestDelta || absDelta < lowestDelta ) {
|
6291 |
-
lowestDelta = absDelta;
|
6292 |
-
|
6293 |
-
// Adjust older deltas if necessary
|
6294 |
-
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
|
6295 |
-
lowestDelta /= 40;
|
6296 |
-
}
|
6297 |
-
}
|
6298 |
-
|
6299 |
-
// Adjust older deltas if necessary
|
6300 |
-
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
|
6301 |
-
// Divide all the things by 40!
|
6302 |
-
delta /= 40;
|
6303 |
-
deltaX /= 40;
|
6304 |
-
deltaY /= 40;
|
6305 |
-
}
|
6306 |
-
|
6307 |
-
// Get a whole, normalized value for the deltas
|
6308 |
-
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
|
6309 |
-
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
|
6310 |
-
deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
|
6311 |
-
|
6312 |
-
// Normalise offsetX and offsetY properties
|
6313 |
-
if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
|
6314 |
-
var boundingRect = this.getBoundingClientRect();
|
6315 |
-
offsetX = event.clientX - boundingRect.left;
|
6316 |
-
offsetY = event.clientY - boundingRect.top;
|
6317 |
-
}
|
6318 |
-
|
6319 |
-
// Add information to the event object
|
6320 |
-
event.deltaX = deltaX;
|
6321 |
-
event.deltaY = deltaY;
|
6322 |
-
event.deltaFactor = lowestDelta;
|
6323 |
-
event.offsetX = offsetX;
|
6324 |
-
event.offsetY = offsetY;
|
6325 |
-
// Go ahead and set deltaMode to 0 since we converted to pixels
|
6326 |
-
// Although this is a little odd since we overwrite the deltaX/Y
|
6327 |
-
// properties with normalized deltas.
|
6328 |
-
event.deltaMode = 0;
|
6329 |
-
|
6330 |
-
// Add event and delta to the front of the arguments
|
6331 |
-
args.unshift(event, delta, deltaX, deltaY);
|
6332 |
-
|
6333 |
-
// Clearout lowestDelta after sometime to better
|
6334 |
-
// handle multiple device types that give different
|
6335 |
-
// a different lowestDelta
|
6336 |
-
// Ex: trackpad = 3 and mouse wheel = 120
|
6337 |
-
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
|
6338 |
-
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
|
6339 |
-
|
6340 |
-
return ($.event.dispatch || $.event.handle).apply(this, args);
|
6341 |
-
}
|
6342 |
-
|
6343 |
-
function nullLowestDelta() {
|
6344 |
-
lowestDelta = null;
|
6345 |
-
}
|
6346 |
-
|
6347 |
-
function shouldAdjustOldDeltas(orgEvent, absDelta) {
|
6348 |
-
// If this is an older event and the delta is divisable by 120,
|
6349 |
-
// then we are assuming that the browser is treating this as an
|
6350 |
-
// older mouse wheel event and that we should divide the deltas
|
6351 |
-
// by 40 to try and get a more usable deltaFactor.
|
6352 |
-
// Side note, this actually impacts the reported scroll distance
|
6353 |
-
// in older browsers and can cause scrolling to be slower than native.
|
6354 |
-
// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
|
6355 |
-
return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
|
6356 |
-
}
|
6357 |
-
|
6358 |
-
}));
|
6359 |
-
|
6360 |
-
S2.define('jquery.select2',[
|
6361 |
-
'jquery',
|
6362 |
-
'jquery-mousewheel',
|
6363 |
-
|
6364 |
-
'./select2/core',
|
6365 |
-
'./select2/defaults'
|
6366 |
-
], function ($, _, Select2, Defaults) {
|
6367 |
-
if ($.fn.select2 == null) {
|
6368 |
-
// All methods that should return the element
|
6369 |
-
var thisMethods = ['open', 'close', 'destroy'];
|
6370 |
-
|
6371 |
-
$.fn.select2 = function (options) {
|
6372 |
-
options = options || {};
|
6373 |
-
|
6374 |
-
if (typeof options === 'object') {
|
6375 |
-
this.each(function () {
|
6376 |
-
var instanceOptions = $.extend(true, {}, options);
|
6377 |
-
|
6378 |
-
var instance = new Select2($(this), instanceOptions);
|
6379 |
-
});
|
6380 |
-
|
6381 |
-
return this;
|
6382 |
-
} else if (typeof options === 'string') {
|
6383 |
-
var ret;
|
6384 |
-
var args = Array.prototype.slice.call(arguments, 1);
|
6385 |
-
|
6386 |
-
this.each(function () {
|
6387 |
-
var instance = $(this).data('select2');
|
6388 |
-
|
6389 |
-
if (instance == null && window.console && console.error) {
|
6390 |
-
console.error(
|
6391 |
-
'The select2(\'' + options + '\') method was called on an ' +
|
6392 |
-
'element that is not using Select2.'
|
6393 |
-
);
|
6394 |
-
}
|
6395 |
-
|
6396 |
-
ret = instance[options].apply(instance, args);
|
6397 |
-
});
|
6398 |
-
|
6399 |
-
// Check if we should be returning `this`
|
6400 |
-
if ($.inArray(options, thisMethods) > -1) {
|
6401 |
-
return this;
|
6402 |
-
}
|
6403 |
-
|
6404 |
-
return ret;
|
6405 |
-
} else {
|
6406 |
-
throw new Error('Invalid arguments for Select2: ' + options);
|
6407 |
-
}
|
6408 |
-
};
|
6409 |
-
}
|
6410 |
-
|
6411 |
-
if ($.fn.select2.defaults == null) {
|
6412 |
-
$.fn.select2.defaults = Defaults;
|
6413 |
-
}
|
6414 |
-
|
6415 |
-
return Select2;
|
6416 |
-
});
|
6417 |
-
|
6418 |
-
// Return the AMD loader configuration so it can be used outside of this file
|
6419 |
-
return {
|
6420 |
-
define: S2.define,
|
6421 |
-
require: S2.require
|
6422 |
-
};
|
6423 |
-
}());
|
6424 |
-
|
6425 |
-
// Autoload the jQuery bindings
|
6426 |
-
// We know that all of the modules exist above this, so we're safe
|
6427 |
-
var select2 = S2.require('jquery.select2');
|
6428 |
-
|
6429 |
-
// Hold the AMD module references on the jQuery function that was just loaded
|
6430 |
-
// This allows Select2 to use the internal loader outside of this file, such
|
6431 |
-
// as in the language files.
|
6432 |
-
jQuery.fn.select2.amd = S2;
|
6433 |
-
|
6434 |
-
// Return the Select2 instance for anyone who is importing it.
|
6435 |
-
return select2;
|
6436 |
-
}));
|
1 |
+
/*!
|
2 |
+
* Select2 4.0.3
|
3 |
+
* https://select2.github.io
|
4 |
+
*
|
5 |
+
* Released under the MIT license
|
6 |
+
* https://github.com/select2/select2/blob/master/LICENSE.md
|
7 |
+
*/
|
8 |
+
(function (factory) {
|
9 |
+
if (typeof define === 'function' && define.amd) {
|
10 |
+
// AMD. Register as an anonymous module.
|
11 |
+
define(['jquery'], factory);
|
12 |
+
} else if (typeof exports === 'object') {
|
13 |
+
// Node/CommonJS
|
14 |
+
factory(require('jquery'));
|
15 |
+
} else {
|
16 |
+
// Browser globals
|
17 |
+
factory(jQuery);
|
18 |
+
}
|
19 |
+
}(function (jQuery) {
|
20 |
+
// This is needed so we can catch the AMD loader configuration and use it
|
21 |
+
// The inner file should be wrapped (by `banner.start.js`) in a function that
|
22 |
+
// returns the AMD loader references.
|
23 |
+
var S2 =
|
24 |
+
(function () {
|
25 |
+
// Restore the Select2 AMD loader so it can be used
|
26 |
+
// Needed mostly in the language files, where the loader is not inserted
|
27 |
+
if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
|
28 |
+
var S2 = jQuery.fn.select2.amd;
|
29 |
+
}
|
30 |
+
var S2;(function () { if (!S2 || !S2.requirejs) {
|
31 |
+
if (!S2) { S2 = {}; } else { require = S2; }
|
32 |
+
/**
|
33 |
+
* @license almond 0.3.1 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
|
34 |
+
* Available via the MIT or new BSD license.
|
35 |
+
* see: http://github.com/jrburke/almond for details
|
36 |
+
*/
|
37 |
+
//Going sloppy to avoid 'use strict' string cost, but strict practices should
|
38 |
+
//be followed.
|
39 |
+
/*jslint sloppy: true */
|
40 |
+
/*global setTimeout: false */
|
41 |
+
|
42 |
+
var requirejs, require, define;
|
43 |
+
(function (undef) {
|
44 |
+
var main, req, makeMap, handlers,
|
45 |
+
defined = {},
|
46 |
+
waiting = {},
|
47 |
+
config = {},
|
48 |
+
defining = {},
|
49 |
+
hasOwn = Object.prototype.hasOwnProperty,
|
50 |
+
aps = [].slice,
|
51 |
+
jsSuffixRegExp = /\.js$/;
|
52 |
+
|
53 |
+
function hasProp(obj, prop) {
|
54 |
+
return hasOwn.call(obj, prop);
|
55 |
+
}
|
56 |
+
|
57 |
+
/**
|
58 |
+
* Given a relative module name, like ./something, normalize it to
|
59 |
+
* a real name that can be mapped to a path.
|
60 |
+
* @param {String} name the relative name
|
61 |
+
* @param {String} baseName a real name that the name arg is relative
|
62 |
+
* to.
|
63 |
+
* @returns {String} normalized name
|
64 |
+
*/
|
65 |
+
function normalize(name, baseName) {
|
66 |
+
var nameParts, nameSegment, mapValue, foundMap, lastIndex,
|
67 |
+
foundI, foundStarMap, starI, i, j, part,
|
68 |
+
baseParts = baseName && baseName.split("/"),
|
69 |
+
map = config.map,
|
70 |
+
starMap = (map && map['*']) || {};
|
71 |
+
|
72 |
+
//Adjust any relative paths.
|
73 |
+
if (name && name.charAt(0) === ".") {
|
74 |
+
//If have a base name, try to normalize against it,
|
75 |
+
//otherwise, assume it is a top-level require that will
|
76 |
+
//be relative to baseUrl in the end.
|
77 |
+
if (baseName) {
|
78 |
+
name = name.split('/');
|
79 |
+
lastIndex = name.length - 1;
|
80 |
+
|
81 |
+
// Node .js allowance:
|
82 |
+
if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
|
83 |
+
name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
|
84 |
+
}
|
85 |
+
|
86 |
+
//Lop off the last part of baseParts, so that . matches the
|
87 |
+
//"directory" and not name of the baseName's module. For instance,
|
88 |
+
//baseName of "one/two/three", maps to "one/two/three.js", but we
|
89 |
+
//want the directory, "one/two" for this normalization.
|
90 |
+
name = baseParts.slice(0, baseParts.length - 1).concat(name);
|
91 |
+
|
92 |
+
//start trimDots
|
93 |
+
for (i = 0; i < name.length; i += 1) {
|
94 |
+
part = name[i];
|
95 |
+
if (part === ".") {
|
96 |
+
name.splice(i, 1);
|
97 |
+
i -= 1;
|
98 |
+
} else if (part === "..") {
|
99 |
+
if (i === 1 && (name[2] === '..' || name[0] === '..')) {
|
100 |
+
//End of the line. Keep at least one non-dot
|
101 |
+
//path segment at the front so it can be mapped
|
102 |
+
//correctly to disk. Otherwise, there is likely
|
103 |
+
//no path mapping for a path starting with '..'.
|
104 |
+
//This can still fail, but catches the most reasonable
|
105 |
+
//uses of ..
|
106 |
+
break;
|
107 |
+
} else if (i > 0) {
|
108 |
+
name.splice(i - 1, 2);
|
109 |
+
i -= 2;
|
110 |
+
}
|
111 |
+
}
|
112 |
+
}
|
113 |
+
//end trimDots
|
114 |
+
|
115 |
+
name = name.join("/");
|
116 |
+
} else if (name.indexOf('./') === 0) {
|
117 |
+
// No baseName, so this is ID is resolved relative
|
118 |
+
// to baseUrl, pull off the leading dot.
|
119 |
+
name = name.substring(2);
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
//Apply map config if available.
|
124 |
+
if ((baseParts || starMap) && map) {
|
125 |
+
nameParts = name.split('/');
|
126 |
+
|
127 |
+
for (i = nameParts.length; i > 0; i -= 1) {
|
128 |
+
nameSegment = nameParts.slice(0, i).join("/");
|
129 |
+
|
130 |
+
if (baseParts) {
|
131 |
+
//Find the longest baseName segment match in the config.
|
132 |
+
//So, do joins on the biggest to smallest lengths of baseParts.
|
133 |
+
for (j = baseParts.length; j > 0; j -= 1) {
|
134 |
+
mapValue = map[baseParts.slice(0, j).join('/')];
|
135 |
+
|
136 |
+
//baseName segment has config, find if it has one for
|
137 |
+
//this name.
|
138 |
+
if (mapValue) {
|
139 |
+
mapValue = mapValue[nameSegment];
|
140 |
+
if (mapValue) {
|
141 |
+
//Match, update name to the new value.
|
142 |
+
foundMap = mapValue;
|
143 |
+
foundI = i;
|
144 |
+
break;
|
145 |
+
}
|
146 |
+
}
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
if (foundMap) {
|
151 |
+
break;
|
152 |
+
}
|
153 |
+
|
154 |
+
//Check for a star map match, but just hold on to it,
|
155 |
+
//if there is a shorter segment match later in a matching
|
156 |
+
//config, then favor over this star map.
|
157 |
+
if (!foundStarMap && starMap && starMap[nameSegment]) {
|
158 |
+
foundStarMap = starMap[nameSegment];
|
159 |
+
starI = i;
|
160 |
+
}
|
161 |
+
}
|
162 |
+
|
163 |
+
if (!foundMap && foundStarMap) {
|
164 |
+
foundMap = foundStarMap;
|
165 |
+
foundI = starI;
|
166 |
+
}
|
167 |
+
|
168 |
+
if (foundMap) {
|
169 |
+
nameParts.splice(0, foundI, foundMap);
|
170 |
+
name = nameParts.join('/');
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
return name;
|
175 |
+
}
|
176 |
+
|
177 |
+
function makeRequire(relName, forceSync) {
|
178 |
+
return function () {
|
179 |
+
//A version of a require function that passes a moduleName
|
180 |
+
//value for items that may need to
|
181 |
+
//look up paths relative to the moduleName
|
182 |
+
var args = aps.call(arguments, 0);
|
183 |
+
|
184 |
+
//If first arg is not require('string'), and there is only
|
185 |
+
//one arg, it is the array form without a callback. Insert
|
186 |
+
//a null so that the following concat is correct.
|
187 |
+
if (typeof args[0] !== 'string' && args.length === 1) {
|
188 |
+
args.push(null);
|
189 |
+
}
|
190 |
+
return req.apply(undef, args.concat([relName, forceSync]));
|
191 |
+
};
|
192 |
+
}
|
193 |
+
|
194 |
+
function makeNormalize(relName) {
|
195 |
+
return function (name) {
|
196 |
+
return normalize(name, relName);
|
197 |
+
};
|
198 |
+
}
|
199 |
+
|
200 |
+
function makeLoad(depName) {
|
201 |
+
return function (value) {
|
202 |
+
defined[depName] = value;
|
203 |
+
};
|
204 |
+
}
|
205 |
+
|
206 |
+
function callDep(name) {
|
207 |
+
if (hasProp(waiting, name)) {
|
208 |
+
var args = waiting[name];
|
209 |
+
delete waiting[name];
|
210 |
+
defining[name] = true;
|
211 |
+
main.apply(undef, args);
|
212 |
+
}
|
213 |
+
|
214 |
+
if (!hasProp(defined, name) && !hasProp(defining, name)) {
|
215 |
+
throw new Error('No ' + name);
|
216 |
+
}
|
217 |
+
return defined[name];
|
218 |
+
}
|
219 |
+
|
220 |
+
//Turns a plugin!resource to [plugin, resource]
|
221 |
+
//with the plugin being undefined if the name
|
222 |
+
//did not have a plugin prefix.
|
223 |
+
function splitPrefix(name) {
|
224 |
+
var prefix,
|
225 |
+
index = name ? name.indexOf('!') : -1;
|
226 |
+
if (index > -1) {
|
227 |
+
prefix = name.substring(0, index);
|
228 |
+
name = name.substring(index + 1, name.length);
|
229 |
+
}
|
230 |
+
return [prefix, name];
|
231 |
+
}
|
232 |
+
|
233 |
+
/**
|
234 |
+
* Makes a name map, normalizing the name, and using a plugin
|
235 |
+
* for normalization if necessary. Grabs a ref to plugin
|
236 |
+
* too, as an optimization.
|
237 |
+
*/
|
238 |
+
makeMap = function (name, relName) {
|
239 |
+
var plugin,
|
240 |
+
parts = splitPrefix(name),
|
241 |
+
prefix = parts[0];
|
242 |
+
|
243 |
+
name = parts[1];
|
244 |
+
|
245 |
+
if (prefix) {
|
246 |
+
prefix = normalize(prefix, relName);
|
247 |
+
plugin = callDep(prefix);
|
248 |
+
}
|
249 |
+
|
250 |
+
//Normalize according
|
251 |
+
if (prefix) {
|
252 |
+
if (plugin && plugin.normalize) {
|
253 |
+
name = plugin.normalize(name, makeNormalize(relName));
|
254 |
+
} else {
|
255 |
+
name = normalize(name, relName);
|
256 |
+
}
|
257 |
+
} else {
|
258 |
+
name = normalize(name, relName);
|
259 |
+
parts = splitPrefix(name);
|
260 |
+
prefix = parts[0];
|
261 |
+
name = parts[1];
|
262 |
+
if (prefix) {
|
263 |
+
plugin = callDep(prefix);
|
264 |
+
}
|
265 |
+
}
|
266 |
+
|
267 |
+
//Using ridiculous property names for space reasons
|
268 |
+
return {
|
269 |
+
f: prefix ? prefix + '!' + name : name, //fullName
|
270 |
+
n: name,
|
271 |
+
pr: prefix,
|
272 |
+
p: plugin
|
273 |
+
};
|
274 |
+
};
|
275 |
+
|
276 |
+
function makeConfig(name) {
|
277 |
+
return function () {
|
278 |
+
return (config && config.config && config.config[name]) || {};
|
279 |
+
};
|
280 |
+
}
|
281 |
+
|
282 |
+
handlers = {
|
283 |
+
require: function (name) {
|
284 |
+
return makeRequire(name);
|
285 |
+
},
|
286 |
+
exports: function (name) {
|
287 |
+
var e = defined[name];
|
288 |
+
if (typeof e !== 'undefined') {
|
289 |
+
return e;
|
290 |
+
} else {
|
291 |
+
return (defined[name] = {});
|
292 |
+
}
|
293 |
+
},
|
294 |
+
module: function (name) {
|
295 |
+
return {
|
296 |
+
id: name,
|
297 |
+
uri: '',
|
298 |
+
exports: defined[name],
|
299 |
+
config: makeConfig(name)
|
300 |
+
};
|
301 |
+
}
|
302 |
+
};
|
303 |
+
|
304 |
+
main = function (name, deps, callback, relName) {
|
305 |
+
var cjsModule, depName, ret, map, i,
|
306 |
+
args = [],
|
307 |
+
callbackType = typeof callback,
|
308 |
+
usingExports;
|
309 |
+
|
310 |
+
//Use name if no relName
|
311 |
+
relName = relName || name;
|
312 |
+
|
313 |
+
//Call the callback to define the module, if necessary.
|
314 |
+
if (callbackType === 'undefined' || callbackType === 'function') {
|
315 |
+
//Pull out the defined dependencies and pass the ordered
|
316 |
+
//values to the callback.
|
317 |
+
//Default to [require, exports, module] if no deps
|
318 |
+
deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
|
319 |
+
for (i = 0; i < deps.length; i += 1) {
|
320 |
+
map = makeMap(deps[i], relName);
|
321 |
+
depName = map.f;
|
322 |
+
|
323 |
+
//Fast path CommonJS standard dependencies.
|
324 |
+
if (depName === "require") {
|
325 |
+
args[i] = handlers.require(name);
|
326 |
+
} else if (depName === "exports") {
|
327 |
+
//CommonJS module spec 1.1
|
328 |
+
args[i] = handlers.exports(name);
|
329 |
+
usingExports = true;
|
330 |
+
} else if (depName === "module") {
|
331 |
+
//CommonJS module spec 1.1
|
332 |
+
cjsModule = args[i] = handlers.module(name);
|
333 |
+
} else if (hasProp(defined, depName) ||
|
334 |
+
hasProp(waiting, depName) ||
|
335 |
+
hasProp(defining, depName)) {
|
336 |
+
args[i] = callDep(depName);
|
337 |
+
} else if (map.p) {
|
338 |
+
map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
|
339 |
+
args[i] = defined[depName];
|
340 |
+
} else {
|
341 |
+
throw new Error(name + ' missing ' + depName);
|
342 |
+
}
|
343 |
+
}
|
344 |
+
|
345 |
+
ret = callback ? callback.apply(defined[name], args) : undefined;
|
346 |
+
|
347 |
+
if (name) {
|
348 |
+
//If setting exports via "module" is in play,
|
349 |
+
//favor that over return value and exports. After that,
|
350 |
+
//favor a non-undefined return value over exports use.
|
351 |
+
if (cjsModule && cjsModule.exports !== undef &&
|
352 |
+
cjsModule.exports !== defined[name]) {
|
353 |
+
defined[name] = cjsModule.exports;
|
354 |
+
} else if (ret !== undef || !usingExports) {
|
355 |
+
//Use the return value from the function.
|
356 |
+
defined[name] = ret;
|
357 |
+
}
|
358 |
+
}
|
359 |
+
} else if (name) {
|
360 |
+
//May just be an object definition for the module. Only
|
361 |
+
//worry about defining if have a module name.
|
362 |
+
defined[name] = callback;
|
363 |
+
}
|
364 |
+
};
|
365 |
+
|
366 |
+
requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
|
367 |
+
if (typeof deps === "string") {
|
368 |
+
if (handlers[deps]) {
|
369 |
+
//callback in this case is really relName
|
370 |
+
return handlers[deps](callback);
|
371 |
+
}
|
372 |
+
//Just return the module wanted. In this scenario, the
|
373 |
+
//deps arg is the module name, and second arg (if passed)
|
374 |
+
//is just the relName.
|
375 |
+
//Normalize module name, if it contains . or ..
|
376 |
+
return callDep(makeMap(deps, callback).f);
|
377 |
+
} else if (!deps.splice) {
|
378 |
+
//deps is a config object, not an array.
|
379 |
+
config = deps;
|
380 |
+
if (config.deps) {
|
381 |
+
req(config.deps, config.callback);
|
382 |
+
}
|
383 |
+
if (!callback) {
|
384 |
+
return;
|
385 |
+
}
|
386 |
+
|
387 |
+
if (callback.splice) {
|
388 |
+
//callback is an array, which means it is a dependency list.
|
389 |
+
//Adjust args if there are dependencies
|
390 |
+
deps = callback;
|
391 |
+
callback = relName;
|
392 |
+
relName = null;
|
393 |
+
} else {
|
394 |
+
deps = undef;
|
395 |
+
}
|
396 |
+
}
|
397 |
+
|
398 |
+
//Support require(['a'])
|
399 |
+
callback = callback || function () {};
|
400 |
+
|
401 |
+
//If relName is a function, it is an errback handler,
|
402 |
+
//so remove it.
|
403 |
+
if (typeof relName === 'function') {
|
404 |
+
relName = forceSync;
|
405 |
+
forceSync = alt;
|
406 |
+
}
|
407 |
+
|
408 |
+
//Simulate async callback;
|
409 |
+
if (forceSync) {
|
410 |
+
main(undef, deps, callback, relName);
|
411 |
+
} else {
|
412 |
+
//Using a non-zero value because of concern for what old browsers
|
413 |
+
//do, and latest browsers "upgrade" to 4 if lower value is used:
|
414 |
+
//http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
|
415 |
+
//If want a value immediately, use require('id') instead -- something
|
416 |
+
//that works in almond on the global level, but not guaranteed and
|
417 |
+
//unlikely to work in other AMD implementations.
|
418 |
+
setTimeout(function () {
|
419 |
+
main(undef, deps, callback, relName);
|
420 |
+
}, 4);
|
421 |
+
}
|
422 |
+
|
423 |
+
return req;
|
424 |
+
};
|
425 |
+
|
426 |
+
/**
|
427 |
+
* Just drops the config on the floor, but returns req in case
|
428 |
+
* the config return value is used.
|
429 |
+
*/
|
430 |
+
req.config = function (cfg) {
|
431 |
+
return req(cfg);
|
432 |
+
};
|
433 |
+
|
434 |
+
/**
|
435 |
+
* Expose module registry for debugging and tooling
|
436 |
+
*/
|
437 |
+
requirejs._defined = defined;
|
438 |
+
|
439 |
+
define = function (name, deps, callback) {
|
440 |
+
if (typeof name !== 'string') {
|
441 |
+
throw new Error('See almond README: incorrect module build, no module name');
|
442 |
+
}
|
443 |
+
|
444 |
+
//This module may not have dependencies
|
445 |
+
if (!deps.splice) {
|
446 |
+
//deps is not an array, so probably means
|
447 |
+
//an object literal or factory function for
|
448 |
+
//the value. Adjust args.
|
449 |
+
callback = deps;
|
450 |
+
deps = [];
|
451 |
+
}
|
452 |
+
|
453 |
+
if (!hasProp(defined, name) && !hasProp(waiting, name)) {
|
454 |
+
waiting[name] = [name, deps, callback];
|
455 |
+
}
|
456 |
+
};
|
457 |
+
|
458 |
+
define.amd = {
|
459 |
+
jQuery: true
|
460 |
+
};
|
461 |
+
}());
|
462 |
+
|
463 |
+
S2.requirejs = requirejs;S2.require = require;S2.define = define;
|
464 |
+
}
|
465 |
+
}());
|
466 |
+
S2.define("almond", function(){});
|
467 |
+
|
468 |
+
/* global jQuery:false, $:false */
|
469 |
+
S2.define('jquery',[],function () {
|
470 |
+
var _$ = jQuery || $;
|
471 |
+
|
472 |
+
if (_$ == null && console && console.error) {
|
473 |
+
console.error(
|
474 |
+
'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
|
475 |
+
'found. Make sure that you are including jQuery before Select2 on your ' +
|
476 |
+
'web page.'
|
477 |
+
);
|
478 |
+
}
|
479 |
+
|
480 |
+
return _$;
|
481 |
+
});
|
482 |
+
|
483 |
+
S2.define('select2/utils',[
|
484 |
+
'jquery'
|
485 |
+
], function ($) {
|
486 |
+
var Utils = {};
|
487 |
+
|
488 |
+
Utils.Extend = function (ChildClass, SuperClass) {
|
489 |
+
var __hasProp = {}.hasOwnProperty;
|
490 |
+
|
491 |
+
function BaseConstructor () {
|
492 |
+
this.constructor = ChildClass;
|
493 |
+
}
|
494 |
+
|
495 |
+
for (var key in SuperClass) {
|
496 |
+
if (__hasProp.call(SuperClass, key)) {
|
497 |
+
ChildClass[key] = SuperClass[key];
|
498 |
+
}
|
499 |
+
}
|
500 |
+
|
501 |
+
BaseConstructor.prototype = SuperClass.prototype;
|
502 |
+
ChildClass.prototype = new BaseConstructor();
|
503 |
+
ChildClass.__super__ = SuperClass.prototype;
|
504 |
+
|
505 |
+
return ChildClass;
|
506 |
+
};
|
507 |
+
|
508 |
+
function getMethods (theClass) {
|
509 |
+
var proto = theClass.prototype;
|
510 |
+
|
511 |
+
var methods = [];
|
512 |
+
|
513 |
+
for (var methodName in proto) {
|
514 |
+
var m = proto[methodName];
|
515 |
+
|
516 |
+
if (typeof m !== 'function') {
|
517 |
+
continue;
|
518 |
+
}
|
519 |
+
|
520 |
+
if (methodName === 'constructor') {
|
521 |
+
continue;
|
522 |
+
}
|
523 |
+
|
524 |
+
methods.push(methodName);
|
525 |
+
}
|
526 |
+
|
527 |
+
return methods;
|
528 |
+
}
|
529 |
+
|
530 |
+
Utils.Decorate = function (SuperClass, DecoratorClass) {
|
531 |
+
var decoratedMethods = getMethods(DecoratorClass);
|
532 |
+
var superMethods = getMethods(SuperClass);
|
533 |
+
|
534 |
+
function DecoratedClass () {
|
535 |
+
var unshift = Array.prototype.unshift;
|
536 |
+
|
537 |
+
var argCount = DecoratorClass.prototype.constructor.length;
|
538 |
+
|
539 |
+
var calledConstructor = SuperClass.prototype.constructor;
|
540 |
+
|
541 |
+
if (argCount > 0) {
|
542 |
+
unshift.call(arguments, SuperClass.prototype.constructor);
|
543 |
+
|
544 |
+
calledConstructor = DecoratorClass.prototype.constructor;
|
545 |
+
}
|
546 |
+
|
547 |
+
calledConstructor.apply(this, arguments);
|
548 |
+
}
|
549 |
+
|
550 |
+
DecoratorClass.displayName = SuperClass.displayName;
|
551 |
+
|
552 |
+
function ctr () {
|
553 |
+
this.constructor = DecoratedClass;
|
554 |
+
}
|
555 |
+
|
556 |
+
DecoratedClass.prototype = new ctr();
|
557 |
+
|
558 |
+
for (var m = 0; m < superMethods.length; m++) {
|
559 |
+
var superMethod = superMethods[m];
|
560 |
+
|
561 |
+
DecoratedClass.prototype[superMethod] =
|
562 |
+
SuperClass.prototype[superMethod];
|
563 |
+
}
|
564 |
+
|
565 |
+
var calledMethod = function (methodName) {
|
566 |
+
// Stub out the original method if it's not decorating an actual method
|
567 |
+
var originalMethod = function () {};
|
568 |
+
|
569 |
+
if (methodName in DecoratedClass.prototype) {
|
570 |
+
originalMethod = DecoratedClass.prototype[methodName];
|
571 |
+
}
|
572 |
+
|
573 |
+
var decoratedMethod = DecoratorClass.prototype[methodName];
|
574 |
+
|
575 |
+
return function () {
|
576 |
+
var unshift = Array.prototype.unshift;
|
577 |
+
|
578 |
+
unshift.call(arguments, originalMethod);
|
579 |
+
|
580 |
+
return decoratedMethod.apply(this, arguments);
|
581 |
+
};
|
582 |
+
};
|
583 |
+
|
584 |
+
for (var d = 0; d < decoratedMethods.length; d++) {
|
585 |
+
var decoratedMethod = decoratedMethods[d];
|
586 |
+
|
587 |
+
DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
|
588 |
+
}
|
589 |
+
|
590 |
+
return DecoratedClass;
|
591 |
+
};
|
592 |
+
|
593 |
+
var Observable = function () {
|
594 |
+
this.listeners = {};
|
595 |
+
};
|
596 |
+
|
597 |
+
Observable.prototype.on = function (event, callback) {
|
598 |
+
this.listeners = this.listeners || {};
|
599 |
+
|
600 |
+
if (event in this.listeners) {
|
601 |
+
this.listeners[event].push(callback);
|
602 |
+
} else {
|
603 |
+
this.listeners[event] = [callback];
|
604 |
+
}
|
605 |
+
};
|
606 |
+
|
607 |
+
Observable.prototype.trigger = function (event) {
|
608 |
+
var slice = Array.prototype.slice;
|
609 |
+
var params = slice.call(arguments, 1);
|
610 |
+
|
611 |
+
this.listeners = this.listeners || {};
|
612 |
+
|
613 |
+
// Params should always come in as an array
|
614 |
+
if (params == null) {
|
615 |
+
params = [];
|
616 |
+
}
|
617 |
+
|
618 |
+
// If there are no arguments to the event, use a temporary object
|
619 |
+
if (params.length === 0) {
|
620 |
+
params.push({});
|
621 |
+
}
|
622 |
+
|
623 |
+
// Set the `_type` of the first object to the event
|
624 |
+
params[0]._type = event;
|
625 |
+
|
626 |
+
if (event in this.listeners) {
|
627 |
+
this.invoke(this.listeners[event], slice.call(arguments, 1));
|
628 |
+
}
|
629 |
+
|
630 |
+
if ('*' in this.listeners) {
|
631 |
+
this.invoke(this.listeners['*'], arguments);
|
632 |
+
}
|
633 |
+
};
|
634 |
+
|
635 |
+
Observable.prototype.invoke = function (listeners, params) {
|
636 |
+
for (var i = 0, len = listeners.length; i < len; i++) {
|
637 |
+
listeners[i].apply(this, params);
|
638 |
+
}
|
639 |
+
};
|
640 |
+
|
641 |
+
Utils.Observable = Observable;
|
642 |
+
|
643 |
+
Utils.generateChars = function (length) {
|
644 |
+
var chars = '';
|
645 |
+
|
646 |
+
for (var i = 0; i < length; i++) {
|
647 |
+
var randomChar = Math.floor(Math.random() * 36);
|
648 |
+
chars += randomChar.toString(36);
|
649 |
+
}
|
650 |
+
|
651 |
+
return chars;
|
652 |
+
};
|
653 |
+
|
654 |
+
Utils.bind = function (func, context) {
|
655 |
+
return function () {
|
656 |
+
func.apply(context, arguments);
|
657 |
+
};
|
658 |
+
};
|
659 |
+
|
660 |
+
Utils._convertData = function (data) {
|
661 |
+
for (var originalKey in data) {
|
662 |
+
var keys = originalKey.split('-');
|
663 |
+
|
664 |
+
var dataLevel = data;
|
665 |
+
|
666 |
+
if (keys.length === 1) {
|
667 |
+
continue;
|
668 |
+
}
|
669 |
+
|
670 |
+
for (var k = 0; k < keys.length; k++) {
|
671 |
+
var key = keys[k];
|
672 |
+
|
673 |
+
// Lowercase the first letter
|
674 |
+
// By default, dash-separated becomes camelCase
|
675 |
+
key = key.substring(0, 1).toLowerCase() + key.substring(1);
|
676 |
+
|
677 |
+
if (!(key in dataLevel)) {
|
678 |
+
dataLevel[key] = {};
|
679 |
+
}
|
680 |
+
|
681 |
+
if (k == keys.length - 1) {
|
682 |
+
dataLevel[key] = data[originalKey];
|
683 |
+
}
|
684 |
+
|
685 |
+
dataLevel = dataLevel[key];
|
686 |
+
}
|
687 |
+
|
688 |
+
delete data[originalKey];
|
689 |
+
}
|
690 |
+
|
691 |
+
return data;
|
692 |
+
};
|
693 |
+
|
694 |
+
Utils.hasScroll = function (index, el) {
|
695 |
+
// Adapted from the function created by @ShadowScripter
|
696 |
+
// and adapted by @BillBarry on the Stack Exchange Code Review website.
|
697 |
+
// The original code can be found at
|
698 |
+
// http://codereview.stackexchange.com/q/13338
|
699 |
+
// and was designed to be used with the Sizzle selector engine.
|
700 |
+
|
701 |
+
var $el = $(el);
|
702 |
+
var overflowX = el.style.overflowX;
|
703 |
+
var overflowY = el.style.overflowY;
|
704 |
+
|
705 |
+
//Check both x and y declarations
|
706 |
+
if (overflowX === overflowY &&
|
707 |
+
(overflowY === 'hidden' || overflowY === 'visible')) {
|
708 |
+
return false;
|
709 |
+
}
|
710 |
+
|
711 |
+
if (overflowX === 'scroll' || overflowY === 'scroll') {
|
712 |
+
return true;
|
713 |
+
}
|
714 |
+
|
715 |
+
return ($el.innerHeight() < el.scrollHeight ||
|
716 |
+
$el.innerWidth() < el.scrollWidth);
|
717 |
+
};
|
718 |
+
|
719 |
+
Utils.escapeMarkup = function (markup) {
|
720 |
+
var replaceMap = {
|
721 |
+
'\\': '\',
|
722 |
+
'&': '&',
|
723 |
+
'<': '<',
|
724 |
+
'>': '>',
|
725 |
+
'"': '"',
|
726 |
+
'\'': ''',
|
727 |
+
'/': '/'
|
728 |
+
};
|
729 |
+
|
730 |
+
// Do not try to escape the markup if it's not a string
|
731 |
+
if (typeof markup !== 'string') {
|
732 |
+
return markup;
|
733 |
+
}
|
734 |
+
|
735 |
+
return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
|
736 |
+
return replaceMap[match];
|
737 |
+
});
|
738 |
+
};
|
739 |
+
|
740 |
+
// Append an array of jQuery nodes to a given element.
|
741 |
+
Utils.appendMany = function ($element, $nodes) {
|
742 |
+
// jQuery 1.7.x does not support $.fn.append() with an array
|
743 |
+
// Fall back to a jQuery object collection using $.fn.add()
|
744 |
+
if ($.fn.jquery.substr(0, 3) === '1.7') {
|
745 |
+
var $jqNodes = $();
|
746 |
+
|
747 |
+
$.map($nodes, function (node) {
|
748 |
+
$jqNodes = $jqNodes.add(node);
|
749 |
+
});
|
750 |
+
|
751 |
+
$nodes = $jqNodes;
|
752 |
+
}
|
753 |
+
|
754 |
+
$element.append($nodes);
|
755 |
+
};
|
756 |
+
|
757 |
+
return Utils;
|
758 |
+
});
|
759 |
+
|
760 |
+
S2.define('select2/results',[
|
761 |
+
'jquery',
|
762 |
+
'./utils'
|
763 |
+
], function ($, Utils) {
|
764 |
+
function Results ($element, options, dataAdapter) {
|
765 |
+
this.$element = $element;
|
766 |
+
this.data = dataAdapter;
|
767 |
+
this.options = options;
|
768 |
+
|
769 |
+
Results.__super__.constructor.call(this);
|
770 |
+
}
|
771 |
+
|
772 |
+
Utils.Extend(Results, Utils.Observable);
|
773 |
+
|
774 |
+
Results.prototype.render = function () {
|
775 |
+
var $results = $(
|
776 |
+
'<ul class="select2-results__options" role="tree"></ul>'
|
777 |
+
);
|
778 |
+
|
779 |
+
if (this.options.get('multiple')) {
|
780 |
+
$results.attr('aria-multiselectable', 'true');
|
781 |
+
}
|
782 |
+
|
783 |
+
this.$results = $results;
|
784 |
+
|
785 |
+
return $results;
|
786 |
+
};
|
787 |
+
|
788 |
+
Results.prototype.clear = function () {
|
789 |
+
this.$results.empty();
|
790 |
+
};
|
791 |
+
|
792 |
+
Results.prototype.displayMessage = function (params) {
|
793 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
794 |
+
|
795 |
+
this.clear();
|
796 |
+
this.hideLoading();
|
797 |
+
|
798 |
+
var $message = $(
|
799 |
+
'<li role="treeitem" aria-live="assertive"' +
|
800 |
+
' class="select2-results__option"></li>'
|
801 |
+
);
|
802 |
+
|
803 |
+
var message = this.options.get('translations').get(params.message);
|
804 |
+
|
805 |
+
$message.append(
|
806 |
+
escapeMarkup(
|
807 |
+
message(params.args)
|
808 |
+
)
|
809 |
+
);
|
810 |
+
|
811 |
+
$message[0].className += ' select2-results__message';
|
812 |
+
|
813 |
+
this.$results.append($message);
|
814 |
+
};
|
815 |
+
|
816 |
+
Results.prototype.hideMessages = function () {
|
817 |
+
this.$results.find('.select2-results__message').remove();
|
818 |
+
};
|
819 |
+
|
820 |
+
Results.prototype.append = function (data) {
|
821 |
+
this.hideLoading();
|
822 |
+
|
823 |
+
var $options = [];
|
824 |
+
|
825 |
+
if (data.results == null || data.results.length === 0) {
|
826 |
+
if (this.$results.children().length === 0) {
|
827 |
+
this.trigger('results:message', {
|
828 |
+
message: 'noResults'
|
829 |
+
});
|
830 |
+
}
|
831 |
+
|
832 |
+
return;
|
833 |
+
}
|
834 |
+
|
835 |
+
data.results = this.sort(data.results);
|
836 |
+
|
837 |
+
for (var d = 0; d < data.results.length; d++) {
|
838 |
+
var item = data.results[d];
|
839 |
+
|
840 |
+
var $option = this.option(item);
|
841 |
+
|
842 |
+
$options.push($option);
|
843 |
+
}
|
844 |
+
|
845 |
+
this.$results.append($options);
|
846 |
+
};
|
847 |
+
|
848 |
+
Results.prototype.position = function ($results, $dropdown) {
|
849 |
+
var $resultsContainer = $dropdown.find('.select2-results');
|
850 |
+
$resultsContainer.append($results);
|
851 |
+
};
|
852 |
+
|
853 |
+
Results.prototype.sort = function (data) {
|
854 |
+
var sorter = this.options.get('sorter');
|
855 |
+
|
856 |
+
return sorter(data);
|
857 |
+
};
|
858 |
+
|
859 |
+
Results.prototype.highlightFirstItem = function () {
|
860 |
+
var $options = this.$results
|
861 |
+
.find('.select2-results__option[aria-selected]');
|
862 |
+
|
863 |
+
var $selected = $options.filter('[aria-selected=true]');
|
864 |
+
|
865 |
+
// Check if there are any selected options
|
866 |
+
if ($selected.length > 0) {
|
867 |
+
// If there are selected options, highlight the first
|
868 |
+
$selected.first().trigger('mouseenter');
|
869 |
+
} else {
|
870 |
+
// If there are no selected options, highlight the first option
|
871 |
+
// in the dropdown
|
872 |
+
$options.first().trigger('mouseenter');
|
873 |
+
}
|
874 |
+
|
875 |
+
this.ensureHighlightVisible();
|
876 |
+
};
|
877 |
+
|
878 |
+
Results.prototype.setClasses = function () {
|
879 |
+
var self = this;
|
880 |
+
|
881 |
+
this.data.current(function (selected) {
|
882 |
+
var selectedIds = $.map(selected, function (s) {
|
883 |
+
return s.id.toString();
|
884 |
+
});
|
885 |
+
|
886 |
+
var $options = self.$results
|
887 |
+
.find('.select2-results__option[aria-selected]');
|
888 |
+
|
889 |
+
$options.each(function () {
|
890 |
+
var $option = $(this);
|
891 |
+
|
892 |
+
var item = $.data(this, 'data');
|
893 |
+
|
894 |
+
// id needs to be converted to a string when comparing
|
895 |
+
var id = '' + item.id;
|
896 |
+
|
897 |
+
if ((item.element != null && item.element.selected) ||
|
898 |
+
(item.element == null && $.inArray(id, selectedIds) > -1)) {
|
899 |
+
$option.attr('aria-selected', 'true');
|
900 |
+
} else {
|
901 |
+
$option.attr('aria-selected', 'false');
|
902 |
+
}
|
903 |
+
});
|
904 |
+
|
905 |
+
});
|
906 |
+
};
|
907 |
+
|
908 |
+
Results.prototype.showLoading = function (params) {
|
909 |
+
this.hideLoading();
|
910 |
+
|
911 |
+
var loadingMore = this.options.get('translations').get('searching');
|
912 |
+
|
913 |
+
var loading = {
|
914 |
+
disabled: true,
|
915 |
+
loading: true,
|
916 |
+
text: loadingMore(params)
|
917 |
+
};
|
918 |
+
var $loading = this.option(loading);
|
919 |
+
$loading.className += ' loading-results';
|
920 |
+
|
921 |
+
this.$results.prepend($loading);
|
922 |
+
};
|
923 |
+
|
924 |
+
Results.prototype.hideLoading = function () {
|
925 |
+
this.$results.find('.loading-results').remove();
|
926 |
+
};
|
927 |
+
|
928 |
+
Results.prototype.option = function (data) {
|
929 |
+
var option = document.createElement('li');
|
930 |
+
option.className = 'select2-results__option';
|
931 |
+
|
932 |
+
var attrs = {
|
933 |
+
'role': 'treeitem',
|
934 |
+
'aria-selected': 'false'
|
935 |
+
};
|
936 |
+
|
937 |
+
if (data.disabled) {
|
938 |
+
delete attrs['aria-selected'];
|
939 |
+
attrs['aria-disabled'] = 'true';
|
940 |
+
}
|
941 |
+
|
942 |
+
if (data.id == null) {
|
943 |
+
delete attrs['aria-selected'];
|
944 |
+
}
|
945 |
+
|
946 |
+
if (data._resultId != null) {
|
947 |
+
option.id = data._resultId;
|
948 |
+
}
|
949 |
+
|
950 |
+
if (data.title) {
|
951 |
+
option.title = data.title;
|
952 |
+
}
|
953 |
+
|
954 |
+
if (data.children) {
|
955 |
+
attrs.role = 'group';
|
956 |
+
attrs['aria-label'] = data.text;
|
957 |
+
delete attrs['aria-selected'];
|
958 |
+
}
|
959 |
+
|
960 |
+
for (var attr in attrs) {
|
961 |
+
var val = attrs[attr];
|
962 |
+
|
963 |
+
option.setAttribute(attr, val);
|
964 |
+
}
|
965 |
+
|
966 |
+
if (data.children) {
|
967 |
+
var $option = $(option);
|
968 |
+
|
969 |
+
var label = document.createElement('strong');
|
970 |
+
label.className = 'select2-results__group';
|
971 |
+
|
972 |
+
var $label = $(label);
|
973 |
+
this.template(data, label);
|
974 |
+
|
975 |
+
var $children = [];
|
976 |
+
|
977 |
+
for (var c = 0; c < data.children.length; c++) {
|
978 |
+
var child = data.children[c];
|
979 |
+
|
980 |
+
var $child = this.option(child);
|
981 |
+
|
982 |
+
$children.push($child);
|
983 |
+
}
|
984 |
+
|
985 |
+
var $childrenContainer = $('<ul></ul>', {
|
986 |
+
'class': 'select2-results__options select2-results__options--nested'
|
987 |
+
});
|
988 |
+
|
989 |
+
$childrenContainer.append($children);
|
990 |
+
|
991 |
+
$option.append(label);
|
992 |
+
$option.append($childrenContainer);
|
993 |
+
} else {
|
994 |
+
this.template(data, option);
|
995 |
+
}
|
996 |
+
|
997 |
+
$.data(option, 'data', data);
|
998 |
+
|
999 |
+
return option;
|
1000 |
+
};
|
1001 |
+
|
1002 |
+
Results.prototype.bind = function (container, $container) {
|
1003 |
+
var self = this;
|
1004 |
+
|
1005 |
+
var id = container.id + '-results';
|
1006 |
+
|
1007 |
+
this.$results.attr('id', id);
|
1008 |
+
|
1009 |
+
container.on('results:all', function (params) {
|
1010 |
+
self.clear();
|
1011 |
+
self.append(params.data);
|
1012 |
+
|
1013 |
+
if (container.isOpen()) {
|
1014 |
+
self.setClasses();
|
1015 |
+
self.highlightFirstItem();
|
1016 |
+
}
|
1017 |
+
});
|
1018 |
+
|
1019 |
+
container.on('results:append', function (params) {
|
1020 |
+
self.append(params.data);
|
1021 |
+
|
1022 |
+
if (container.isOpen()) {
|
1023 |
+
self.setClasses();
|
1024 |
+
}
|
1025 |
+
});
|
1026 |
+
|
1027 |
+
container.on('query', function (params) {
|
1028 |
+
self.hideMessages();
|
1029 |
+
self.showLoading(params);
|
1030 |
+
});
|
1031 |
+
|
1032 |
+
container.on('select', function () {
|
1033 |
+
if (!container.isOpen()) {
|
1034 |
+
return;
|
1035 |
+
}
|
1036 |
+
|
1037 |
+
self.setClasses();
|
1038 |
+
self.highlightFirstItem();
|
1039 |
+
});
|
1040 |
+
|
1041 |
+
container.on('unselect', function () {
|
1042 |
+
if (!container.isOpen()) {
|
1043 |
+
return;
|
1044 |
+
}
|
1045 |
+
|
1046 |
+
self.setClasses();
|
1047 |
+
self.highlightFirstItem();
|
1048 |
+
});
|
1049 |
+
|
1050 |
+
container.on('open', function () {
|
1051 |
+
// When the dropdown is open, aria-expended="true"
|
1052 |
+
self.$results.attr('aria-expanded', 'true');
|
1053 |
+
self.$results.attr('aria-hidden', 'false');
|
1054 |
+
|
1055 |
+
self.setClasses();
|
1056 |
+
self.ensureHighlightVisible();
|
1057 |
+
});
|
1058 |
+
|
1059 |
+
container.on('close', function () {
|
1060 |
+
// When the dropdown is closed, aria-expended="false"
|
1061 |
+
self.$results.attr('aria-expanded', 'false');
|
1062 |
+
self.$results.attr('aria-hidden', 'true');
|
1063 |
+
self.$results.removeAttr('aria-activedescendant');
|
1064 |
+
});
|
1065 |
+
|
1066 |
+
container.on('results:toggle', function () {
|
1067 |
+
var $highlighted = self.getHighlightedResults();
|
1068 |
+
|
1069 |
+
if ($highlighted.length === 0) {
|
1070 |
+
return;
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
$highlighted.trigger('mouseup');
|
1074 |
+
});
|
1075 |
+
|
1076 |
+
container.on('results:select', function () {
|
1077 |
+
var $highlighted = self.getHighlightedResults();
|
1078 |
+
|
1079 |
+
if ($highlighted.length === 0) {
|
1080 |
+
return;
|
1081 |
+
}
|
1082 |
+
|
1083 |
+
var data = $highlighted.data('data');
|
1084 |
+
|
1085 |
+
if ($highlighted.attr('aria-selected') == 'true') {
|
1086 |
+
self.trigger('close', {});
|
1087 |
+
} else {
|
1088 |
+
self.trigger('select', {
|
1089 |
+
data: data
|
1090 |
+
});
|
1091 |
+
}
|
1092 |
+
});
|
1093 |
+
|
1094 |
+
container.on('results:previous', function () {
|
1095 |
+
var $highlighted = self.getHighlightedResults();
|
1096 |
+
|
1097 |
+
var $options = self.$results.find('[aria-selected]');
|
1098 |
+
|
1099 |
+
var currentIndex = $options.index($highlighted);
|
1100 |
+
|
1101 |
+
// If we are already at te top, don't move further
|
1102 |
+
if (currentIndex === 0) {
|
1103 |
+
return;
|
1104 |
+
}
|
1105 |
+
|
1106 |
+
var nextIndex = currentIndex - 1;
|
1107 |
+
|
1108 |
+
// If none are highlighted, highlight the first
|
1109 |
+
if ($highlighted.length === 0) {
|
1110 |
+
nextIndex = 0;
|
1111 |
+
}
|
1112 |
+
|
1113 |
+
var $next = $options.eq(nextIndex);
|
1114 |
+
|
1115 |
+
$next.trigger('mouseenter');
|
1116 |
+
|
1117 |
+
var currentOffset = self.$results.offset().top;
|
1118 |
+
var nextTop = $next.offset().top;
|
1119 |
+
var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
|
1120 |
+
|
1121 |
+
if (nextIndex === 0) {
|
1122 |
+
self.$results.scrollTop(0);
|
1123 |
+
} else if (nextTop - currentOffset < 0) {
|
1124 |
+
self.$results.scrollTop(nextOffset);
|
1125 |
+
}
|
1126 |
+
});
|
1127 |
+
|
1128 |
+
container.on('results:next', function () {
|
1129 |
+
var $highlighted = self.getHighlightedResults();
|
1130 |
+
|
1131 |
+
var $options = self.$results.find('[aria-selected]');
|
1132 |
+
|
1133 |
+
var currentIndex = $options.index($highlighted);
|
1134 |
+
|
1135 |
+
var nextIndex = currentIndex + 1;
|
1136 |
+
|
1137 |
+
// If we are at the last option, stay there
|
1138 |
+
if (nextIndex >= $options.length) {
|
1139 |
+
return;
|
1140 |
+
}
|
1141 |
+
|
1142 |
+
var $next = $options.eq(nextIndex);
|
1143 |
+
|
1144 |
+
$next.trigger('mouseenter');
|
1145 |
+
|
1146 |
+
var currentOffset = self.$results.offset().top +
|
1147 |
+
self.$results.outerHeight(false);
|
1148 |
+
var nextBottom = $next.offset().top + $next.outerHeight(false);
|
1149 |
+
var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
|
1150 |
+
|
1151 |
+
if (nextIndex === 0) {
|
1152 |
+
self.$results.scrollTop(0);
|
1153 |
+
} else if (nextBottom > currentOffset) {
|
1154 |
+
self.$results.scrollTop(nextOffset);
|
1155 |
+
}
|
1156 |
+
});
|
1157 |
+
|
1158 |
+
container.on('results:focus', function (params) {
|
1159 |
+
params.element.addClass('select2-results__option--highlighted');
|
1160 |
+
});
|
1161 |
+
|
1162 |
+
container.on('results:message', function (params) {
|
1163 |
+
self.displayMessage(params);
|
1164 |
+
});
|
1165 |
+
|
1166 |
+
if ($.fn.mousewheel) {
|
1167 |
+
this.$results.on('mousewheel', function (e) {
|
1168 |
+
var top = self.$results.scrollTop();
|
1169 |
+
|
1170 |
+
var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
|
1171 |
+
|
1172 |
+
var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
|
1173 |
+
var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
|
1174 |
+
|
1175 |
+
if (isAtTop) {
|
1176 |
+
self.$results.scrollTop(0);
|
1177 |
+
|
1178 |
+
e.preventDefault();
|
1179 |
+
e.stopPropagation();
|
1180 |
+
} else if (isAtBottom) {
|
1181 |
+
self.$results.scrollTop(
|
1182 |
+
self.$results.get(0).scrollHeight - self.$results.height()
|
1183 |
+
);
|
1184 |
+
|
1185 |
+
e.preventDefault();
|
1186 |
+
e.stopPropagation();
|
1187 |
+
}
|
1188 |
+
});
|
1189 |
+
}
|
1190 |
+
|
1191 |
+
this.$results.on('mouseup', '.select2-results__option[aria-selected]',
|
1192 |
+
function (evt) {
|
1193 |
+
var $this = $(this);
|
1194 |
+
|
1195 |
+
var data = $this.data('data');
|
1196 |
+
|
1197 |
+
if ($this.attr('aria-selected') === 'true') {
|
1198 |
+
if (self.options.get('multiple')) {
|
1199 |
+
self.trigger('unselect', {
|
1200 |
+
originalEvent: evt,
|
1201 |
+
data: data
|
1202 |
+
});
|
1203 |
+
} else {
|
1204 |
+
self.trigger('close', {});
|
1205 |
+
}
|
1206 |
+
|
1207 |
+
return;
|
1208 |
+
}
|
1209 |
+
|
1210 |
+
self.trigger('select', {
|
1211 |
+
originalEvent: evt,
|
1212 |
+
data: data
|
1213 |
+
});
|
1214 |
+
});
|
1215 |
+
|
1216 |
+
this.$results.on('mouseenter', '.select2-results__option[aria-selected]',
|
1217 |
+
function (evt) {
|
1218 |
+
var data = $(this).data('data');
|
1219 |
+
|
1220 |
+
self.getHighlightedResults()
|
1221 |
+
.removeClass('select2-results__option--highlighted');
|
1222 |
+
|
1223 |
+
self.trigger('results:focus', {
|
1224 |
+
data: data,
|
1225 |
+
element: $(this)
|
1226 |
+
});
|
1227 |
+
});
|
1228 |
+
};
|
1229 |
+
|
1230 |
+
Results.prototype.getHighlightedResults = function () {
|
1231 |
+
var $highlighted = this.$results
|
1232 |
+
.find('.select2-results__option--highlighted');
|
1233 |
+
|
1234 |
+
return $highlighted;
|
1235 |
+
};
|
1236 |
+
|
1237 |
+
Results.prototype.destroy = function () {
|
1238 |
+
this.$results.remove();
|
1239 |
+
};
|
1240 |
+
|
1241 |
+
Results.prototype.ensureHighlightVisible = function () {
|
1242 |
+
var $highlighted = this.getHighlightedResults();
|
1243 |
+
|
1244 |
+
if ($highlighted.length === 0) {
|
1245 |
+
return;
|
1246 |
+
}
|
1247 |
+
|
1248 |
+
var $options = this.$results.find('[aria-selected]');
|
1249 |
+
|
1250 |
+
var currentIndex = $options.index($highlighted);
|
1251 |
+
|
1252 |
+
var currentOffset = this.$results.offset().top;
|
1253 |
+
var nextTop = $highlighted.offset().top;
|
1254 |
+
var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
|
1255 |
+
|
1256 |
+
var offsetDelta = nextTop - currentOffset;
|
1257 |
+
nextOffset -= $highlighted.outerHeight(false) * 2;
|
1258 |
+
|
1259 |
+
if (currentIndex <= 2) {
|
1260 |
+
this.$results.scrollTop(0);
|
1261 |
+
} else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
|
1262 |
+
this.$results.scrollTop(nextOffset);
|
1263 |
+
}
|
1264 |
+
};
|
1265 |
+
|
1266 |
+
Results.prototype.template = function (result, container) {
|
1267 |
+
var template = this.options.get('templateResult');
|
1268 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1269 |
+
|
1270 |
+
var content = template(result, container);
|
1271 |
+
|
1272 |
+
if (content == null) {
|
1273 |
+
container.style.display = 'none';
|
1274 |
+
} else if (typeof content === 'string') {
|
1275 |
+
container.innerHTML = escapeMarkup(content);
|
1276 |
+
} else {
|
1277 |
+
$(container).append(content);
|
1278 |
+
}
|
1279 |
+
};
|
1280 |
+
|
1281 |
+
return Results;
|
1282 |
+
});
|
1283 |
+
|
1284 |
+
S2.define('select2/keys',[
|
1285 |
+
|
1286 |
+
], function () {
|
1287 |
+
var KEYS = {
|
1288 |
+
BACKSPACE: 8,
|
1289 |
+
TAB: 9,
|
1290 |
+
ENTER: 13,
|
1291 |
+
SHIFT: 16,
|
1292 |
+
CTRL: 17,
|
1293 |
+
ALT: 18,
|
1294 |
+
ESC: 27,
|
1295 |
+
SPACE: 32,
|
1296 |
+
PAGE_UP: 33,
|
1297 |
+
PAGE_DOWN: 34,
|
1298 |
+
END: 35,
|
1299 |
+
HOME: 36,
|
1300 |
+
LEFT: 37,
|
1301 |
+
UP: 38,
|
1302 |
+
RIGHT: 39,
|
1303 |
+
DOWN: 40,
|
1304 |
+
DELETE: 46
|
1305 |
+
};
|
1306 |
+
|
1307 |
+
return KEYS;
|
1308 |
+
});
|
1309 |
+
|
1310 |
+
S2.define('select2/selection/base',[
|
1311 |
+
'jquery',
|
1312 |
+
'../utils',
|
1313 |
+
'../keys'
|
1314 |
+
], function ($, Utils, KEYS) {
|
1315 |
+
function BaseSelection ($element, options) {
|
1316 |
+
this.$element = $element;
|
1317 |
+
this.options = options;
|
1318 |
+
|
1319 |
+
BaseSelection.__super__.constructor.call(this);
|
1320 |
+
}
|
1321 |
+
|
1322 |
+
Utils.Extend(BaseSelection, Utils.Observable);
|
1323 |
+
|
1324 |
+
BaseSelection.prototype.render = function () {
|
1325 |
+
var $selection = $(
|
1326 |
+
'<span class="select2-selection" role="combobox" ' +
|
1327 |
+
' aria-haspopup="true" aria-expanded="false">' +
|
1328 |
+
'</span>'
|
1329 |
+
);
|
1330 |
+
|
1331 |
+
this._tabindex = 0;
|
1332 |
+
|
1333 |
+
if (this.$element.data('old-tabindex') != null) {
|
1334 |
+
this._tabindex = this.$element.data('old-tabindex');
|
1335 |
+
} else if (this.$element.attr('tabindex') != null) {
|
1336 |
+
this._tabindex = this.$element.attr('tabindex');
|
1337 |
+
}
|
1338 |
+
|
1339 |
+
$selection.attr('title', this.$element.attr('title'));
|
1340 |
+
$selection.attr('tabindex', this._tabindex);
|
1341 |
+
|
1342 |
+
this.$selection = $selection;
|
1343 |
+
|
1344 |
+
return $selection;
|
1345 |
+
};
|
1346 |
+
|
1347 |
+
BaseSelection.prototype.bind = function (container, $container) {
|
1348 |
+
var self = this;
|
1349 |
+
|
1350 |
+
var id = container.id + '-container';
|
1351 |
+
var resultsId = container.id + '-results';
|
1352 |
+
|
1353 |
+
this.container = container;
|
1354 |
+
|
1355 |
+
this.$selection.on('focus', function (evt) {
|
1356 |
+
self.trigger('focus', evt);
|
1357 |
+
});
|
1358 |
+
|
1359 |
+
this.$selection.on('blur', function (evt) {
|
1360 |
+
self._handleBlur(evt);
|
1361 |
+
});
|
1362 |
+
|
1363 |
+
this.$selection.on('keydown', function (evt) {
|
1364 |
+
self.trigger('keypress', evt);
|
1365 |
+
|
1366 |
+
if (evt.which === KEYS.SPACE) {
|
1367 |
+
evt.preventDefault();
|
1368 |
+
}
|
1369 |
+
});
|
1370 |
+
|
1371 |
+
container.on('results:focus', function (params) {
|
1372 |
+
self.$selection.attr('aria-activedescendant', params.data._resultId);
|
1373 |
+
});
|
1374 |
+
|
1375 |
+
container.on('selection:update', function (params) {
|
1376 |
+
self.update(params.data);
|
1377 |
+
});
|
1378 |
+
|
1379 |
+
container.on('open', function () {
|
1380 |
+
// When the dropdown is open, aria-expanded="true"
|
1381 |
+
self.$selection.attr('aria-expanded', 'true');
|
1382 |
+
self.$selection.attr('aria-owns', resultsId);
|
1383 |
+
|
1384 |
+
self._attachCloseHandler(container);
|
1385 |
+
});
|
1386 |
+
|
1387 |
+
container.on('close', function () {
|
1388 |
+
// When the dropdown is closed, aria-expanded="false"
|
1389 |
+
self.$selection.attr('aria-expanded', 'false');
|
1390 |
+
self.$selection.removeAttr('aria-activedescendant');
|
1391 |
+
self.$selection.removeAttr('aria-owns');
|
1392 |
+
|
1393 |
+
self.$selection.focus();
|
1394 |
+
|
1395 |
+
self._detachCloseHandler(container);
|
1396 |
+
});
|
1397 |
+
|
1398 |
+
container.on('enable', function () {
|
1399 |
+
self.$selection.attr('tabindex', self._tabindex);
|
1400 |
+
});
|
1401 |
+
|
1402 |
+
container.on('disable', function () {
|
1403 |
+
self.$selection.attr('tabindex', '-1');
|
1404 |
+
});
|
1405 |
+
};
|
1406 |
+
|
1407 |
+
BaseSelection.prototype._handleBlur = function (evt) {
|
1408 |
+
var self = this;
|
1409 |
+
|
1410 |
+
// This needs to be delayed as the active element is the body when the tab
|
1411 |
+
// key is pressed, possibly along with others.
|
1412 |
+
window.setTimeout(function () {
|
1413 |
+
// Don't trigger `blur` if the focus is still in the selection
|
1414 |
+
if (
|
1415 |
+
(document.activeElement == self.$selection[0]) ||
|
1416 |
+
($.contains(self.$selection[0], document.activeElement))
|
1417 |
+
) {
|
1418 |
+
return;
|
1419 |
+
}
|
1420 |
+
|
1421 |
+
self.trigger('blur', evt);
|
1422 |
+
}, 1);
|
1423 |
+
};
|
1424 |
+
|
1425 |
+
BaseSelection.prototype._attachCloseHandler = function (container) {
|
1426 |
+
var self = this;
|
1427 |
+
|
1428 |
+
$(document.body).on('mousedown.select2.' + container.id, function (e) {
|
1429 |
+
var $target = $(e.target);
|
1430 |
+
|
1431 |
+
var $select = $target.closest('.select2');
|
1432 |
+
|
1433 |
+
var $all = $('.select2.select2-container--open');
|
1434 |
+
|
1435 |
+
$all.each(function () {
|
1436 |
+
var $this = $(this);
|
1437 |
+
|
1438 |
+
if (this == $select[0]) {
|
1439 |
+
return;
|
1440 |
+
}
|
1441 |
+
|
1442 |
+
var $element = $this.data('element');
|
1443 |
+
|
1444 |
+
$element.select2('close');
|
1445 |
+
});
|
1446 |
+
});
|
1447 |
+
};
|
1448 |
+
|
1449 |
+
BaseSelection.prototype._detachCloseHandler = function (container) {
|
1450 |
+
$(document.body).off('mousedown.select2.' + container.id);
|
1451 |
+
};
|
1452 |
+
|
1453 |
+
BaseSelection.prototype.position = function ($selection, $container) {
|
1454 |
+
var $selectionContainer = $container.find('.selection');
|
1455 |
+
$selectionContainer.append($selection);
|
1456 |
+
};
|
1457 |
+
|
1458 |
+
BaseSelection.prototype.destroy = function () {
|
1459 |
+
this._detachCloseHandler(this.container);
|
1460 |
+
};
|
1461 |
+
|
1462 |
+
BaseSelection.prototype.update = function (data) {
|
1463 |
+
throw new Error('The `update` method must be defined in child classes.');
|
1464 |
+
};
|
1465 |
+
|
1466 |
+
return BaseSelection;
|
1467 |
+
});
|
1468 |
+
|
1469 |
+
S2.define('select2/selection/single',[
|
1470 |
+
'jquery',
|
1471 |
+
'./base',
|
1472 |
+
'../utils',
|
1473 |
+
'../keys'
|
1474 |
+
], function ($, BaseSelection, Utils, KEYS) {
|
1475 |
+
function SingleSelection () {
|
1476 |
+
SingleSelection.__super__.constructor.apply(this, arguments);
|
1477 |
+
}
|
1478 |
+
|
1479 |
+
Utils.Extend(SingleSelection, BaseSelection);
|
1480 |
+
|
1481 |
+
SingleSelection.prototype.render = function () {
|
1482 |
+
var $selection = SingleSelection.__super__.render.call(this);
|
1483 |
+
|
1484 |
+
$selection.addClass('select2-selection--single');
|
1485 |
+
|
1486 |
+
$selection.html(
|
1487 |
+
'<span class="select2-selection__rendered"></span>' +
|
1488 |
+
'<span class="select2-selection__arrow" role="presentation">' +
|
1489 |
+
'<b role="presentation"></b>' +
|
1490 |
+
'</span>'
|
1491 |
+
);
|
1492 |
+
|
1493 |
+
return $selection;
|
1494 |
+
};
|
1495 |
+
|
1496 |
+
SingleSelection.prototype.bind = function (container, $container) {
|
1497 |
+
var self = this;
|
1498 |
+
|
1499 |
+
SingleSelection.__super__.bind.apply(this, arguments);
|
1500 |
+
|
1501 |
+
var id = container.id + '-container';
|
1502 |
+
|
1503 |
+
this.$selection.find('.select2-selection__rendered').attr('id', id);
|
1504 |
+
this.$selection.attr('aria-labelledby', id);
|
1505 |
+
|
1506 |
+
this.$selection.on('mousedown', function (evt) {
|
1507 |
+
// Only respond to left clicks
|
1508 |
+
if (evt.which !== 1) {
|
1509 |
+
return;
|
1510 |
+
}
|
1511 |
+
|
1512 |
+
self.trigger('toggle', {
|
1513 |
+
originalEvent: evt
|
1514 |
+
});
|
1515 |
+
});
|
1516 |
+
|
1517 |
+
this.$selection.on('focus', function (evt) {
|
1518 |
+
// User focuses on the container
|
1519 |
+
});
|
1520 |
+
|
1521 |
+
this.$selection.on('blur', function (evt) {
|
1522 |
+
// User exits the container
|
1523 |
+
});
|
1524 |
+
|
1525 |
+
container.on('focus', function (evt) {
|
1526 |
+
if (!container.isOpen()) {
|
1527 |
+
self.$selection.focus();
|
1528 |
+
}
|
1529 |
+
});
|
1530 |
+
|
1531 |
+
container.on('selection:update', function (params) {
|
1532 |
+
self.update(params.data);
|
1533 |
+
});
|
1534 |
+
};
|
1535 |
+
|
1536 |
+
SingleSelection.prototype.clear = function () {
|
1537 |
+
this.$selection.find('.select2-selection__rendered').empty();
|
1538 |
+
};
|
1539 |
+
|
1540 |
+
SingleSelection.prototype.display = function (data, container) {
|
1541 |
+
var template = this.options.get('templateSelection');
|
1542 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1543 |
+
|
1544 |
+
return escapeMarkup(template(data, container));
|
1545 |
+
};
|
1546 |
+
|
1547 |
+
SingleSelection.prototype.selectionContainer = function () {
|
1548 |
+
return $('<span></span>');
|
1549 |
+
};
|
1550 |
+
|
1551 |
+
SingleSelection.prototype.update = function (data) {
|
1552 |
+
if (data.length === 0) {
|
1553 |
+
this.clear();
|
1554 |
+
return;
|
1555 |
+
}
|
1556 |
+
|
1557 |
+
var selection = data[0];
|
1558 |
+
|
1559 |
+
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1560 |
+
var formatted = this.display(selection, $rendered);
|
1561 |
+
|
1562 |
+
$rendered.empty().append(formatted);
|
1563 |
+
$rendered.prop('title', selection.title || selection.text);
|
1564 |
+
};
|
1565 |
+
|
1566 |
+
return SingleSelection;
|
1567 |
+
});
|
1568 |
+
|
1569 |
+
S2.define('select2/selection/multiple',[
|
1570 |
+
'jquery',
|
1571 |
+
'./base',
|
1572 |
+
'../utils'
|
1573 |
+
], function ($, BaseSelection, Utils) {
|
1574 |
+
function MultipleSelection ($element, options) {
|
1575 |
+
MultipleSelection.__super__.constructor.apply(this, arguments);
|
1576 |
+
}
|
1577 |
+
|
1578 |
+
Utils.Extend(MultipleSelection, BaseSelection);
|
1579 |
+
|
1580 |
+
MultipleSelection.prototype.render = function () {
|
1581 |
+
var $selection = MultipleSelection.__super__.render.call(this);
|
1582 |
+
|
1583 |
+
$selection.addClass('select2-selection--multiple');
|
1584 |
+
|
1585 |
+
$selection.html(
|
1586 |
+
'<ul class="select2-selection__rendered"></ul>'
|
1587 |
+
);
|
1588 |
+
|
1589 |
+
return $selection;
|
1590 |
+
};
|
1591 |
+
|
1592 |
+
MultipleSelection.prototype.bind = function (container, $container) {
|
1593 |
+
var self = this;
|
1594 |
+
|
1595 |
+
MultipleSelection.__super__.bind.apply(this, arguments);
|
1596 |
+
|
1597 |
+
this.$selection.on('click', function (evt) {
|
1598 |
+
self.trigger('toggle', {
|
1599 |
+
originalEvent: evt
|
1600 |
+
});
|
1601 |
+
});
|
1602 |
+
|
1603 |
+
this.$selection.on(
|
1604 |
+
'click',
|
1605 |
+
'.select2-selection__choice__remove',
|
1606 |
+
function (evt) {
|
1607 |
+
// Ignore the event if it is disabled
|
1608 |
+
if (self.options.get('disabled')) {
|
1609 |
+
return;
|
1610 |
+
}
|
1611 |
+
|
1612 |
+
var $remove = $(this);
|
1613 |
+
var $selection = $remove.parent();
|
1614 |
+
|
1615 |
+
var data = $selection.data('data');
|
1616 |
+
|
1617 |
+
self.trigger('unselect', {
|
1618 |
+
originalEvent: evt,
|
1619 |
+
data: data
|
1620 |
+
});
|
1621 |
+
}
|
1622 |
+
);
|
1623 |
+
};
|
1624 |
+
|
1625 |
+
MultipleSelection.prototype.clear = function () {
|
1626 |
+
this.$selection.find('.select2-selection__rendered').empty();
|
1627 |
+
};
|
1628 |
+
|
1629 |
+
MultipleSelection.prototype.display = function (data, container) {
|
1630 |
+
var template = this.options.get('templateSelection');
|
1631 |
+
var escapeMarkup = this.options.get('escapeMarkup');
|
1632 |
+
|
1633 |
+
return escapeMarkup(template(data, container));
|
1634 |
+
};
|
1635 |
+
|
1636 |
+
MultipleSelection.prototype.selectionContainer = function () {
|
1637 |
+
var $container = $(
|
1638 |
+
'<li class="select2-selection__choice">' +
|
1639 |
+
'<span class="select2-selection__choice__remove" role="presentation">' +
|
1640 |
+
'×' +
|
1641 |
+
'</span>' +
|
1642 |
+
'</li>'
|
1643 |
+
);
|
1644 |
+
|
1645 |
+
return $container;
|
1646 |
+
};
|
1647 |
+
|
1648 |
+
MultipleSelection.prototype.update = function (data) {
|
1649 |
+
this.clear();
|
1650 |
+
|
1651 |
+
if (data.length === 0) {
|
1652 |
+
return;
|
1653 |
+
}
|
1654 |
+
|
1655 |
+
var $selections = [];
|
1656 |
+
|
1657 |
+
for (var d = 0; d < data.length; d++) {
|
1658 |
+
var selection = data[d];
|
1659 |
+
|
1660 |
+
var $selection = this.selectionContainer();
|
1661 |
+
var formatted = this.display(selection, $selection);
|
1662 |
+
|
1663 |
+
$selection.append(formatted);
|
1664 |
+
$selection.prop('title', selection.title || selection.text);
|
1665 |
+
|
1666 |
+
$selection.data('data', selection);
|
1667 |
+
|
1668 |
+
$selections.push($selection);
|
1669 |
+
}
|
1670 |
+
|
1671 |
+
var $rendered = this.$selection.find('.select2-selection__rendered');
|
1672 |
+
|
1673 |
+
Utils.appendMany($rendered, $selections);
|
1674 |
+
};
|
1675 |
+
|
1676 |
+
return MultipleSelection;
|
1677 |
+
});
|
1678 |
+
|
1679 |
+
S2.define('select2/selection/placeholder',[
|
1680 |
+
'../utils'
|
1681 |
+
], function (Utils) {
|
1682 |
+
function Placeholder (decorated, $element, options) {
|
1683 |
+
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
1684 |
+
|
1685 |
+
decorated.call(this, $element, options);
|
1686 |
+
}
|
1687 |
+
|
1688 |
+
Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
1689 |
+
if (typeof placeholder === 'string') {
|
1690 |
+
placeholder = {
|
1691 |
+
id: '',
|
1692 |
+
text: placeholder
|
1693 |
+
};
|
1694 |
+
}
|
1695 |
+
|
1696 |
+
return placeholder;
|
1697 |
+
};
|
1698 |
+
|
1699 |
+
Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
|
1700 |
+
var $placeholder = this.selectionContainer();
|
1701 |
+
|
1702 |
+
$placeholder.html(this.display(placeholder));
|
1703 |
+
$placeholder.addClass('select2-selection__placeholder')
|
1704 |
+
.removeClass('select2-selection__choice');
|
1705 |
+
|
1706 |
+
return $placeholder;
|
1707 |
+
};
|
1708 |
+
|
1709 |
+
Placeholder.prototype.update = function (decorated, data) {
|
1710 |
+
var singlePlaceholder = (
|
1711 |
+
data.length == 1 && data[0].id != this.placeholder.id
|
1712 |
+
);
|
1713 |
+
var multipleSelections = data.length > 1;
|
1714 |
+
|
1715 |
+
if (multipleSelections || singlePlaceholder) {
|
1716 |
+
return decorated.call(this, data);
|
1717 |
+
}
|
1718 |
+
|
1719 |
+
this.clear();
|
1720 |
+
|
1721 |
+
var $placeholder = this.createPlaceholder(this.placeholder);
|
1722 |
+
|
1723 |
+
this.$selection.find('.select2-selection__rendered').append($placeholder);
|
1724 |
+
};
|
1725 |
+
|
1726 |
+
return Placeholder;
|
1727 |
+
});
|
1728 |
+
|
1729 |
+
S2.define('select2/selection/allowClear',[
|
1730 |
+
'jquery',
|
1731 |
+
'../keys'
|
1732 |
+
], function ($, KEYS) {
|
1733 |
+
function AllowClear () { }
|
1734 |
+
|
1735 |
+
AllowClear.prototype.bind = function (decorated, container, $container) {
|
1736 |
+
var self = this;
|
1737 |
+
|
1738 |
+
decorated.call(this, container, $container);
|
1739 |
+
|
1740 |
+
if (this.placeholder == null) {
|
1741 |
+
if (this.options.get('debug') && window.console && console.error) {
|
1742 |
+
console.error(
|
1743 |
+
'Select2: The `allowClear` option should be used in combination ' +
|
1744 |
+
'with the `placeholder` option.'
|
1745 |
+
);
|
1746 |
+
}
|
1747 |
+
}
|
1748 |
+
|
1749 |
+
this.$selection.on('mousedown', '.select2-selection__clear',
|
1750 |
+
function (evt) {
|
1751 |
+
self._handleClear(evt);
|
1752 |
+
});
|
1753 |
+
|
1754 |
+
container.on('keypress', function (evt) {
|
1755 |
+
self._handleKeyboardClear(evt, container);
|
1756 |
+
});
|
1757 |
+
};
|
1758 |
+
|
1759 |
+
AllowClear.prototype._handleClear = function (_, evt) {
|
1760 |
+
// Ignore the event if it is disabled
|
1761 |
+
if (this.options.get('disabled')) {
|
1762 |
+
return;
|
1763 |
+
}
|
1764 |
+
|
1765 |
+
var $clear = this.$selection.find('.select2-selection__clear');
|
1766 |
+
|
1767 |
+
// Ignore the event if nothing has been selected
|
1768 |
+
if ($clear.length === 0) {
|
1769 |
+
return;
|
1770 |
+
}
|
1771 |
+
|
1772 |
+
evt.stopPropagation();
|
1773 |
+
|
1774 |
+
var data = $clear.data('data');
|
1775 |
+
|
1776 |
+
for (var d = 0; d < data.length; d++) {
|
1777 |
+
var unselectData = {
|
1778 |
+
data: data[d]
|
1779 |
+
};
|
1780 |
+
|
1781 |
+
// Trigger the `unselect` event, so people can prevent it from being
|
1782 |
+
// cleared.
|
1783 |
+
this.trigger('unselect', unselectData);
|
1784 |
+
|
1785 |
+
// If the event was prevented, don't clear it out.
|
1786 |
+
if (unselectData.prevented) {
|
1787 |
+
return;
|
1788 |
+
}
|
1789 |
+
}
|
1790 |
+
|
1791 |
+
this.$element.val(this.placeholder.id).trigger('change');
|
1792 |
+
|
1793 |
+
this.trigger('toggle', {});
|
1794 |
+
};
|
1795 |
+
|
1796 |
+
AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
|
1797 |
+
if (container.isOpen()) {
|
1798 |
+
return;
|
1799 |
+
}
|
1800 |
+
|
1801 |
+
if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
|
1802 |
+
this._handleClear(evt);
|
1803 |
+
}
|
1804 |
+
};
|
1805 |
+
|
1806 |
+
AllowClear.prototype.update = function (decorated, data) {
|
1807 |
+
decorated.call(this, data);
|
1808 |
+
|
1809 |
+
if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
|
1810 |
+
data.length === 0) {
|
1811 |
+
return;
|
1812 |
+
}
|
1813 |
+
|
1814 |
+
var $remove = $(
|
1815 |
+
'<span class="select2-selection__clear">' +
|
1816 |
+
'×' +
|
1817 |
+
'</span>'
|
1818 |
+
);
|
1819 |
+
$remove.data('data', data);
|
1820 |
+
|
1821 |
+
this.$selection.find('.select2-selection__rendered').prepend($remove);
|
1822 |
+
};
|
1823 |
+
|
1824 |
+
return AllowClear;
|
1825 |
+
});
|
1826 |
+
|
1827 |
+
S2.define('select2/selection/search',[
|
1828 |
+
'jquery',
|
1829 |
+
'../utils',
|
1830 |
+
'../keys'
|
1831 |
+
], function ($, Utils, KEYS) {
|
1832 |
+
function Search (decorated, $element, options) {
|
1833 |
+
decorated.call(this, $element, options);
|
1834 |
+
}
|
1835 |
+
|
1836 |
+
Search.prototype.render = function (decorated) {
|
1837 |
+
var $search = $(
|
1838 |
+
'<li class="select2-search select2-search--inline">' +
|
1839 |
+
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
1840 |
+
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
|
1841 |
+
' spellcheck="false" role="textbox" aria-autocomplete="list" />' +
|
1842 |
+
'</li>'
|
1843 |
+
);
|
1844 |
+
|
1845 |
+
this.$searchContainer = $search;
|
1846 |
+
this.$search = $search.find('input');
|
1847 |
+
|
1848 |
+
var $rendered = decorated.call(this);
|
1849 |
+
|
1850 |
+
this._transferTabIndex();
|
1851 |
+
|
1852 |
+
return $rendered;
|
1853 |
+
};
|
1854 |
+
|
1855 |
+
Search.prototype.bind = function (decorated, container, $container) {
|
1856 |
+
var self = this;
|
1857 |
+
|
1858 |
+
decorated.call(this, container, $container);
|
1859 |
+
|
1860 |
+
container.on('open', function () {
|
1861 |
+
self.$search.trigger('focus');
|
1862 |
+
});
|
1863 |
+
|
1864 |
+
container.on('close', function () {
|
1865 |
+
self.$search.val('');
|
1866 |
+
self.$search.removeAttr('aria-activedescendant');
|
1867 |
+
self.$search.trigger('focus');
|
1868 |
+
});
|
1869 |
+
|
1870 |
+
container.on('enable', function () {
|
1871 |
+
self.$search.prop('disabled', false);
|
1872 |
+
|
1873 |
+
self._transferTabIndex();
|
1874 |
+
});
|
1875 |
+
|
1876 |
+
container.on('disable', function () {
|
1877 |
+
self.$search.prop('disabled', true);
|
1878 |
+
});
|
1879 |
+
|
1880 |
+
container.on('focus', function (evt) {
|
1881 |
+
self.$search.trigger('focus');
|
1882 |
+
});
|
1883 |
+
|
1884 |
+
container.on('results:focus', function (params) {
|
1885 |
+
self.$search.attr('aria-activedescendant', params.id);
|
1886 |
+
});
|
1887 |
+
|
1888 |
+
this.$selection.on('focusin', '.select2-search--inline', function (evt) {
|
1889 |
+
self.trigger('focus', evt);
|
1890 |
+
});
|
1891 |
+
|
1892 |
+
this.$selection.on('focusout', '.select2-search--inline', function (evt) {
|
1893 |
+
self._handleBlur(evt);
|
1894 |
+
});
|
1895 |
+
|
1896 |
+
this.$selection.on('keydown', '.select2-search--inline', function (evt) {
|
1897 |
+
evt.stopPropagation();
|
1898 |
+
|
1899 |
+
self.trigger('keypress', evt);
|
1900 |
+
|
1901 |
+
self._keyUpPrevented = evt.isDefaultPrevented();
|
1902 |
+
|
1903 |
+
var key = evt.which;
|
1904 |
+
|
1905 |
+
if (key === KEYS.BACKSPACE && self.$search.val() === '') {
|
1906 |
+
var $previousChoice = self.$searchContainer
|
1907 |
+
.prev('.select2-selection__choice');
|
1908 |
+
|
1909 |
+
if ($previousChoice.length > 0) {
|
1910 |
+
var item = $previousChoice.data('data');
|
1911 |
+
|
1912 |
+
self.searchRemoveChoice(item);
|
1913 |
+
|
1914 |
+
evt.preventDefault();
|
1915 |
+
}
|
1916 |
+
}
|
1917 |
+
});
|
1918 |
+
|
1919 |
+
// Try to detect the IE version should the `documentMode` property that
|
1920 |
+
// is stored on the document. This is only implemented in IE and is
|
1921 |
+
// slightly cleaner than doing a user agent check.
|
1922 |
+
// This property is not available in Edge, but Edge also doesn't have
|
1923 |
+
// this bug.
|
1924 |
+
var msie = document.documentMode;
|
1925 |
+
var disableInputEvents = msie && msie <= 11;
|
1926 |
+
|
1927 |
+
// Workaround for browsers which do not support the `input` event
|
1928 |
+
// This will prevent double-triggering of events for browsers which support
|
1929 |
+
// both the `keyup` and `input` events.
|
1930 |
+
this.$selection.on(
|
1931 |
+
'input.searchcheck',
|
1932 |
+
'.select2-search--inline',
|
1933 |
+
function (evt) {
|
1934 |
+
// IE will trigger the `input` event when a placeholder is used on a
|
1935 |
+
// search box. To get around this issue, we are forced to ignore all
|
1936 |
+
// `input` events in IE and keep using `keyup`.
|
1937 |
+
if (disableInputEvents) {
|
1938 |
+
self.$selection.off('input.search input.searchcheck');
|
1939 |
+
return;
|
1940 |
+
}
|
1941 |
+
|
1942 |
+
// Unbind the duplicated `keyup` event
|
1943 |
+
self.$selection.off('keyup.search');
|
1944 |
+
}
|
1945 |
+
);
|
1946 |
+
|
1947 |
+
this.$selection.on(
|
1948 |
+
'keyup.search input.search',
|
1949 |
+
'.select2-search--inline',
|
1950 |
+
function (evt) {
|
1951 |
+
// IE will trigger the `input` event when a placeholder is used on a
|
1952 |
+
// search box. To get around this issue, we are forced to ignore all
|
1953 |
+
// `input` events in IE and keep using `keyup`.
|
1954 |
+
if (disableInputEvents && evt.type === 'input') {
|
1955 |
+
self.$selection.off('input.search input.searchcheck');
|
1956 |
+
return;
|
1957 |
+
}
|
1958 |
+
|
1959 |
+
var key = evt.which;
|
1960 |
+
|
1961 |
+
// We can freely ignore events from modifier keys
|
1962 |
+
if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
|
1963 |
+
return;
|
1964 |
+
}
|
1965 |
+
|
1966 |
+
// Tabbing will be handled during the `keydown` phase
|
1967 |
+
if (key == KEYS.TAB) {
|
1968 |
+
return;
|
1969 |
+
}
|
1970 |
+
|
1971 |
+
self.handleSearch(evt);
|
1972 |
+
}
|
1973 |
+
);
|
1974 |
+
};
|
1975 |
+
|
1976 |
+
/**
|
1977 |
+
* This method will transfer the tabindex attribute from the rendered
|
1978 |
+
* selection to the search box. This allows for the search box to be used as
|
1979 |
+
* the primary focus instead of the selection container.
|
1980 |
+
*
|
1981 |
+
* @private
|
1982 |
+
*/
|
1983 |
+
Search.prototype._transferTabIndex = function (decorated) {
|
1984 |
+
this.$search.attr('tabindex', this.$selection.attr('tabindex'));
|
1985 |
+
this.$selection.attr('tabindex', '-1');
|
1986 |
+
};
|
1987 |
+
|
1988 |
+
Search.prototype.createPlaceholder = function (decorated, placeholder) {
|
1989 |
+
this.$search.attr('placeholder', placeholder.text);
|
1990 |
+
};
|
1991 |
+
|
1992 |
+
Search.prototype.update = function (decorated, data) {
|
1993 |
+
var searchHadFocus = this.$search[0] == document.activeElement;
|
1994 |
+
|
1995 |
+
this.$search.attr('placeholder', '');
|
1996 |
+
|
1997 |
+
decorated.call(this, data);
|
1998 |
+
|
1999 |
+
this.$selection.find('.select2-selection__rendered')
|
2000 |
+
.append(this.$searchContainer);
|
2001 |
+
|
2002 |
+
this.resizeSearch();
|
2003 |
+
if (searchHadFocus) {
|
2004 |
+
this.$search.focus();
|
2005 |
+
}
|
2006 |
+
};
|
2007 |
+
|
2008 |
+
Search.prototype.handleSearch = function () {
|
2009 |
+
this.resizeSearch();
|
2010 |
+
|
2011 |
+
if (!this._keyUpPrevented) {
|
2012 |
+
var input = this.$search.val();
|
2013 |
+
|
2014 |
+
this.trigger('query', {
|
2015 |
+
term: input
|
2016 |
+
});
|
2017 |
+
}
|
2018 |
+
|
2019 |
+
this._keyUpPrevented = false;
|
2020 |
+
};
|
2021 |
+
|
2022 |
+
Search.prototype.searchRemoveChoice = function (decorated, item) {
|
2023 |
+
this.trigger('unselect', {
|
2024 |
+
data: item
|
2025 |
+
});
|
2026 |
+
|
2027 |
+
this.$search.val(item.text);
|
2028 |
+
this.handleSearch();
|
2029 |
+
};
|
2030 |
+
|
2031 |
+
Search.prototype.resizeSearch = function () {
|
2032 |
+
this.$search.css('width', '25px');
|
2033 |
+
|
2034 |
+
var width = '';
|
2035 |
+
|
2036 |
+
if (this.$search.attr('placeholder') !== '') {
|
2037 |
+
width = this.$selection.find('.select2-selection__rendered').innerWidth();
|
2038 |
+
} else {
|
2039 |
+
var minimumWidth = this.$search.val().length + 1;
|
2040 |
+
|
2041 |
+
width = (minimumWidth * 0.75) + 'em';
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
this.$search.css('width', width);
|
2045 |
+
};
|
2046 |
+
|
2047 |
+
return Search;
|
2048 |
+
});
|
2049 |
+
|
2050 |
+
S2.define('select2/selection/eventRelay',[
|
2051 |
+
'jquery'
|
2052 |
+
], function ($) {
|
2053 |
+
function EventRelay () { }
|
2054 |
+
|
2055 |
+
EventRelay.prototype.bind = function (decorated, container, $container) {
|
2056 |
+
var self = this;
|
2057 |
+
var relayEvents = [
|
2058 |
+
'open', 'opening',
|
2059 |
+
'close', 'closing',
|
2060 |
+
'select', 'selecting',
|
2061 |
+
'unselect', 'unselecting'
|
2062 |
+
];
|
2063 |
+
|
2064 |
+
var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
|
2065 |
+
|
2066 |
+
decorated.call(this, container, $container);
|
2067 |
+
|
2068 |
+
container.on('*', function (name, params) {
|
2069 |
+
// Ignore events that should not be relayed
|
2070 |
+
if ($.inArray(name, relayEvents) === -1) {
|
2071 |
+
return;
|
2072 |
+
}
|
2073 |
+
|
2074 |
+
// The parameters should always be an object
|
2075 |
+
params = params || {};
|
2076 |
+
|
2077 |
+
// Generate the jQuery event for the Select2 event
|
2078 |
+
var evt = $.Event('select2:' + name, {
|
2079 |
+
params: params
|
2080 |
+
});
|
2081 |
+
|
2082 |
+
self.$element.trigger(evt);
|
2083 |
+
|
2084 |
+
// Only handle preventable events if it was one
|
2085 |
+
if ($.inArray(name, preventableEvents) === -1) {
|
2086 |
+
return;
|
2087 |
+
}
|
2088 |
+
|
2089 |
+
params.prevented = evt.isDefaultPrevented();
|
2090 |
+
});
|
2091 |
+
};
|
2092 |
+
|
2093 |
+
return EventRelay;
|
2094 |
+
});
|
2095 |
+
|
2096 |
+
S2.define('select2/translation',[
|
2097 |
+
'jquery',
|
2098 |
+
'require'
|
2099 |
+
], function ($, require) {
|
2100 |
+
function Translation (dict) {
|
2101 |
+
this.dict = dict || {};
|
2102 |
+
}
|
2103 |
+
|
2104 |
+
Translation.prototype.all = function () {
|
2105 |
+
return this.dict;
|
2106 |
+
};
|
2107 |
+
|
2108 |
+
Translation.prototype.get = function (key) {
|
2109 |
+
return this.dict[key];
|
2110 |
+
};
|
2111 |
+
|
2112 |
+
Translation.prototype.extend = function (translation) {
|
2113 |
+
this.dict = $.extend({}, translation.all(), this.dict);
|
2114 |
+
};
|
2115 |
+
|
2116 |
+
// Static functions
|
2117 |
+
|
2118 |
+
Translation._cache = {};
|
2119 |
+
|
2120 |
+
Translation.loadPath = function (path) {
|
2121 |
+
if (!(path in Translation._cache)) {
|
2122 |
+
var translations = require(path);
|
2123 |
+
|
2124 |
+
Translation._cache[path] = translations;
|
2125 |
+
}
|
2126 |
+
|
2127 |
+
return new Translation(Translation._cache[path]);
|
2128 |
+
};
|
2129 |
+
|
2130 |
+
return Translation;
|
2131 |
+
});
|
2132 |
+
|
2133 |
+
S2.define('select2/diacritics',[
|
2134 |
+
|
2135 |
+
], function () {
|
2136 |
+
var diacritics = {
|
2137 |
+
'\u24B6': 'A',
|
2138 |
+
'\uFF21': 'A',
|
2139 |
+
'\u00C0': 'A',
|
2140 |
+
'\u00C1': 'A',
|
2141 |
+
'\u00C2': 'A',
|
2142 |
+
'\u1EA6': 'A',
|
2143 |
+
'\u1EA4': 'A',
|
2144 |
+
'\u1EAA': 'A',
|
2145 |
+
'\u1EA8': 'A',
|
2146 |
+
'\u00C3': 'A',
|
2147 |
+
'\u0100': 'A',
|
2148 |
+
'\u0102': 'A',
|
2149 |
+
'\u1EB0': 'A',
|
2150 |
+
'\u1EAE': 'A',
|
2151 |
+
'\u1EB4': 'A',
|
2152 |
+
'\u1EB2': 'A',
|
2153 |
+
'\u0226': 'A',
|
2154 |
+
'\u01E0': 'A',
|
2155 |
+
'\u00C4': 'A',
|
2156 |
+
'\u01DE': 'A',
|
2157 |
+
'\u1EA2': 'A',
|
2158 |
+
'\u00C5': 'A',
|
2159 |
+
'\u01FA': 'A',
|
2160 |
+
'\u01CD': 'A',
|
2161 |
+
'\u0200': 'A',
|
2162 |
+
'\u0202': 'A',
|
2163 |
+
'\u1EA0': 'A',
|
2164 |
+
'\u1EAC': 'A',
|
2165 |
+
'\u1EB6': 'A',
|
2166 |
+
'\u1E00': 'A',
|
2167 |
+
'\u0104': 'A',
|
2168 |
+
'\u023A': 'A',
|
2169 |
+
'\u2C6F': 'A',
|
2170 |
+
'\uA732': 'AA',
|
2171 |
+
'\u00C6': 'AE',
|
2172 |
+
'\u01FC': 'AE',
|
2173 |
+
'\u01E2': 'AE',
|
2174 |
+
'\uA734': 'AO',
|
2175 |
+
'\uA736': 'AU',
|
2176 |
+
'\uA738': 'AV',
|
2177 |
+
'\uA73A': 'AV',
|
2178 |
+
'\uA73C': 'AY',
|
2179 |
+
'\u24B7': 'B',
|
2180 |
+
'\uFF22': 'B',
|
2181 |
+
'\u1E02': 'B',
|
2182 |
+
'\u1E04': 'B',
|
2183 |
+
'\u1E06': 'B',
|
2184 |
+
'\u0243': 'B',
|
2185 |
+
'\u0182': 'B',
|
2186 |
+
'\u0181': 'B',
|
2187 |
+
'\u24B8': 'C',
|
2188 |
+
'\uFF23': 'C',
|
2189 |
+
'\u0106': 'C',
|
2190 |
+
'\u0108': 'C',
|
2191 |
+
'\u010A': 'C',
|
2192 |
+
'\u010C': 'C',
|
2193 |
+
'\u00C7': 'C',
|
2194 |
+
'\u1E08': 'C',
|
2195 |
+
'\u0187': 'C',
|
2196 |
+
'\u023B': 'C',
|
2197 |
+
'\uA73E': 'C',
|
2198 |
+
'\u24B9': 'D',
|
2199 |
+
'\uFF24': 'D',
|
2200 |
+
'\u1E0A': 'D',
|
2201 |
+
'\u010E': 'D',
|
2202 |
+
'\u1E0C': 'D',
|
2203 |
+
'\u1E10': 'D',
|
2204 |
+
'\u1E12': 'D',
|
2205 |
+
'\u1E0E': 'D',
|
2206 |
+
'\u0110': 'D',
|
2207 |
+
'\u018B': 'D',
|
2208 |
+
'\u018A': 'D',
|
2209 |
+
'\u0189': 'D',
|
2210 |
+
'\uA779': 'D',
|
2211 |
+
'\u01F1': 'DZ',
|
2212 |
+
'\u01C4': 'DZ',
|
2213 |
+
'\u01F2': 'Dz',
|
2214 |
+
'\u01C5': 'Dz',
|
2215 |
+
'\u24BA': 'E',
|
2216 |
+
'\uFF25': 'E',
|
2217 |
+
'\u00C8': 'E',
|
2218 |
+
'\u00C9': 'E',
|
2219 |
+
'\u00CA': 'E',
|
2220 |
+
'\u1EC0': 'E',
|
2221 |
+
'\u1EBE': 'E',
|
2222 |
+
'\u1EC4': 'E',
|
2223 |
+
'\u1EC2': 'E',
|
2224 |
+
'\u1EBC': 'E',
|
2225 |
+
'\u0112': 'E',
|
2226 |
+
'\u1E14': 'E',
|
2227 |
+
'\u1E16': 'E',
|
2228 |
+
'\u0114': 'E',
|
2229 |
+
'\u0116': 'E',
|
2230 |
+
'\u00CB': 'E',
|
2231 |
+
'\u1EBA': 'E',
|
2232 |
+
'\u011A': 'E',
|
2233 |
+
'\u0204': 'E',
|
2234 |
+
'\u0206': 'E',
|
2235 |
+
'\u1EB8': 'E',
|
2236 |
+
'\u1EC6': 'E',
|
2237 |
+
'\u0228': 'E',
|
2238 |
+
'\u1E1C': 'E',
|
2239 |
+
'\u0118': 'E',
|
2240 |
+
'\u1E18': 'E',
|
2241 |
+
'\u1E1A': 'E',
|
2242 |
+
'\u0190': 'E',
|
2243 |
+
'\u018E': 'E',
|
2244 |
+
'\u24BB': 'F',
|
2245 |
+
'\uFF26': 'F',
|
2246 |
+
'\u1E1E': 'F',
|
2247 |
+
'\u0191': 'F',
|
2248 |
+
'\uA77B': 'F',
|
2249 |
+
'\u24BC': 'G',
|
2250 |
+
'\uFF27': 'G',
|
2251 |
+
'\u01F4': 'G',
|
2252 |
+
'\u011C': 'G',
|
2253 |
+
'\u1E20': 'G',
|
2254 |
+
'\u011E': 'G',
|
2255 |
+
'\u0120': 'G',
|
2256 |
+
'\u01E6': 'G',
|
2257 |
+
'\u0122': 'G',
|
2258 |
+
'\u01E4': 'G',
|
2259 |
+
'\u0193': 'G',
|
2260 |
+
'\uA7A0': 'G',
|
2261 |
+
'\uA77D': 'G',
|
2262 |
+
'\uA77E': 'G',
|
2263 |
+
'\u24BD': 'H',
|
2264 |
+
'\uFF28': 'H',
|
2265 |
+
'\u0124': 'H',
|
2266 |
+
'\u1E22': 'H',
|
2267 |
+
'\u1E26': 'H',
|
2268 |
+
'\u021E': 'H',
|
2269 |
+
'\u1E24': 'H',
|
2270 |
+
'\u1E28': 'H',
|
2271 |
+
'\u1E2A': 'H',
|
2272 |
+
'\u0126': 'H',
|
2273 |
+
'\u2C67': 'H',
|
2274 |
+
'\u2C75': 'H',
|
2275 |
+
'\uA78D': 'H',
|
2276 |
+
'\u24BE': 'I',
|
2277 |
+
'\uFF29': 'I',
|
2278 |
+
'\u00CC': 'I',
|
2279 |
+
'\u00CD': 'I',
|
2280 |
+
'\u00CE': 'I',
|
2281 |
+
'\u0128': 'I',
|
2282 |
+
'\u012A': 'I',
|
2283 |
+
'\u012C': 'I',
|
2284 |
+
'\u0130': 'I',
|
2285 |
+
'\u00CF': 'I',
|
2286 |
+
'\u1E2E': 'I',
|
2287 |
+
'\u1EC8': 'I',
|
2288 |
+
'\u01CF': 'I',
|
2289 |
+
'\u0208': 'I',
|
2290 |
+
'\u020A': 'I',
|
2291 |
+
'\u1ECA': 'I',
|
2292 |
+
'\u012E': 'I',
|
2293 |
+
'\u1E2C': 'I',
|
2294 |
+
'\u0197': 'I',
|
2295 |
+
'\u24BF': 'J',
|
2296 |
+
'\uFF2A': 'J',
|
2297 |
+
'\u0134': 'J',
|
2298 |
+
'\u0248': 'J',
|
2299 |
+
'\u24C0': 'K',
|
2300 |
+
'\uFF2B': 'K',
|
2301 |
+
'\u1E30': 'K',
|
2302 |
+
'\u01E8': 'K',
|
2303 |
+
'\u1E32': 'K',
|
2304 |
+
'\u0136': 'K',
|
2305 |
+
'\u1E34': 'K',
|
2306 |
+
'\u0198': 'K',
|
2307 |
+
'\u2C69': 'K',
|
2308 |
+
'\uA740': 'K',
|
2309 |
+
'\uA742': 'K',
|
2310 |
+
'\uA744': 'K',
|
2311 |
+
'\uA7A2': 'K',
|
2312 |
+
'\u24C1': 'L',
|
2313 |
+
'\uFF2C': 'L',
|
2314 |
+
'\u013F': 'L',
|
2315 |
+
'\u0139': 'L',
|
2316 |
+
'\u013D': 'L',
|
2317 |
+
'\u1E36': 'L',
|
2318 |
+
'\u1E38': 'L',
|
2319 |
+
'\u013B': 'L',
|
2320 |
+
'\u1E3C': 'L',
|
2321 |
+
'\u1E3A': 'L',
|
2322 |
+
'\u0141': 'L',
|
2323 |
+
'\u023D': 'L',
|
2324 |
+
'\u2C62': 'L',
|
2325 |
+
'\u2C60': 'L',
|
2326 |
+
'\uA748': 'L',
|
2327 |
+
'\uA746': 'L',
|
2328 |
+
'\uA780': 'L',
|
2329 |
+
'\u01C7': 'LJ',
|
2330 |
+
'\u01C8': 'Lj',
|
2331 |
+
'\u24C2': 'M',
|
2332 |
+
'\uFF2D': 'M',
|
2333 |
+
'\u1E3E': 'M',
|
2334 |
+
'\u1E40': 'M',
|
2335 |
+
'\u1E42': 'M',
|
2336 |
+
'\u2C6E': 'M',
|
2337 |
+
'\u019C': 'M',
|
2338 |
+
'\u24C3': 'N',
|
2339 |
+
'\uFF2E': 'N',
|
2340 |
+
'\u01F8': 'N',
|
2341 |
+
'\u0143': 'N',
|
2342 |
+
'\u00D1': 'N',
|
2343 |
+
'\u1E44': 'N',
|
2344 |
+
'\u0147': 'N',
|
2345 |
+
'\u1E46': 'N',
|
2346 |
+
'\u0145': 'N',
|
2347 |
+
'\u1E4A': 'N',
|
2348 |
+
'\u1E48': 'N',
|
2349 |
+
'\u0220': 'N',
|
2350 |
+
'\u019D': 'N',
|
2351 |
+
'\uA790': 'N',
|
2352 |
+
'\uA7A4': 'N',
|
2353 |
+
'\u01CA': 'NJ',
|
2354 |
+
'\u01CB': 'Nj',
|
2355 |
+
'\u24C4': 'O',
|
2356 |
+
'\uFF2F': 'O',
|
2357 |
+
'\u00D2': 'O',
|
2358 |
+
'\u00D3': 'O',
|
2359 |
+
'\u00D4': 'O',
|
2360 |
+
'\u1ED2': 'O',
|
2361 |
+
'\u1ED0': 'O',
|
2362 |
+
'\u1ED6': 'O',
|
2363 |
+
'\u1ED4': 'O',
|
2364 |
+
'\u00D5': 'O',
|
2365 |
+
'\u1E4C': 'O',
|
2366 |
+
'\u022C': 'O',
|
2367 |
+
'\u1E4E': 'O',
|
2368 |
+
'\u014C': 'O',
|
2369 |
+
'\u1E50': 'O',
|
2370 |
+
'\u1E52': 'O',
|
2371 |
+
'\u014E': 'O',
|
2372 |
+
'\u022E': 'O',
|
2373 |
+
'\u0230': 'O',
|
2374 |
+
'\u00D6': 'O',
|
2375 |
+
'\u022A': 'O',
|
2376 |
+
'\u1ECE': 'O',
|
2377 |
+
'\u0150': 'O',
|
2378 |
+
'\u01D1': 'O',
|
2379 |
+
'\u020C': 'O',
|
2380 |
+
'\u020E': 'O',
|
2381 |
+
'\u01A0': 'O',
|
2382 |
+
'\u1EDC': 'O',
|
2383 |
+
'\u1EDA': 'O',
|
2384 |
+
'\u1EE0': 'O',
|
2385 |
+
'\u1EDE': 'O',
|
2386 |
+
'\u1EE2': 'O',
|
2387 |
+
'\u1ECC': 'O',
|
2388 |
+
'\u1ED8': 'O',
|
2389 |
+
'\u01EA': 'O',
|
2390 |
+
'\u01EC': 'O',
|
2391 |
+
'\u00D8': 'O',
|
2392 |
+
'\u01FE': 'O',
|
2393 |
+
'\u0186': 'O',
|
2394 |
+
'\u019F': 'O',
|
2395 |
+
'\uA74A': 'O',
|
2396 |
+
'\uA74C': 'O',
|
2397 |
+
'\u01A2': 'OI',
|
2398 |
+
'\uA74E': 'OO',
|
2399 |
+
'\u0222': 'OU',
|
2400 |
+
'\u24C5': 'P',
|
2401 |
+
'\uFF30': 'P',
|
2402 |
+
'\u1E54': 'P',
|
2403 |
+
'\u1E56': 'P',
|
2404 |
+
'\u01A4': 'P',
|
2405 |
+
'\u2C63': 'P',
|
2406 |
+
'\uA750': 'P',
|
2407 |
+
'\uA752': 'P',
|
2408 |
+
'\uA754': 'P',
|
2409 |
+
'\u24C6': 'Q',
|
2410 |
+
'\uFF31': 'Q',
|
2411 |
+
'\uA756': 'Q',
|
2412 |
+
'\uA758': 'Q',
|
2413 |
+
'\u024A': 'Q',
|
2414 |
+
'\u24C7': 'R',
|
2415 |
+
'\uFF32': 'R',
|
2416 |
+
'\u0154': 'R',
|
2417 |
+
'\u1E58': 'R',
|
2418 |
+
'\u0158': 'R',
|
2419 |
+
'\u0210': 'R',
|
2420 |
+
'\u0212': 'R',
|
2421 |
+
'\u1E5A': 'R',
|
2422 |
+
'\u1E5C': 'R',
|
2423 |
+
'\u0156': 'R',
|
2424 |
+
'\u1E5E': 'R',
|
2425 |
+
'\u024C': 'R',
|
2426 |
+
'\u2C64': 'R',
|
2427 |
+
'\uA75A': 'R',
|
2428 |
+
'\uA7A6': 'R',
|
2429 |
+
'\uA782': 'R',
|
2430 |
+
'\u24C8': 'S',
|
2431 |
+
'\uFF33': 'S',
|
2432 |
+
'\u1E9E': 'S',
|
2433 |
+
'\u015A': 'S',
|
2434 |
+
'\u1E64': 'S',
|
2435 |
+
'\u015C': 'S',
|
2436 |
+
'\u1E60': 'S',
|
2437 |
+
'\u0160': 'S',
|
2438 |
+
'\u1E66': 'S',
|
2439 |
+
'\u1E62': 'S',
|
2440 |
+
'\u1E68': 'S',
|
2441 |
+
'\u0218': 'S',
|
2442 |
+
'\u015E': 'S',
|
2443 |
+
'\u2C7E': 'S',
|
2444 |
+
'\uA7A8': 'S',
|
2445 |
+
'\uA784': 'S',
|
2446 |
+
'\u24C9': 'T',
|
2447 |
+
'\uFF34': 'T',
|
2448 |
+
'\u1E6A': 'T',
|
2449 |
+
'\u0164': 'T',
|
2450 |
+
'\u1E6C': 'T',
|
2451 |
+
'\u021A': 'T',
|
2452 |
+
'\u0162': 'T',
|
2453 |
+
'\u1E70': 'T',
|
2454 |
+
'\u1E6E': 'T',
|
2455 |
+
'\u0166': 'T',
|
2456 |
+
'\u01AC': 'T',
|
2457 |
+
'\u01AE': 'T',
|
2458 |
+
'\u023E': 'T',
|
2459 |
+
'\uA786': 'T',
|
2460 |
+
'\uA728': 'TZ',
|
2461 |
+
'\u24CA': 'U',
|
2462 |
+
'\uFF35': 'U',
|
2463 |
+
'\u00D9': 'U',
|
2464 |
+
'\u00DA': 'U',
|
2465 |
+
'\u00DB': 'U',
|
2466 |
+
'\u0168': 'U',
|
2467 |
+
'\u1E78': 'U',
|
2468 |
+
'\u016A': 'U',
|
2469 |
+
'\u1E7A': 'U',
|
2470 |
+
'\u016C': 'U',
|
2471 |
+
'\u00DC': 'U',
|
2472 |
+
'\u01DB': 'U',
|
2473 |
+
'\u01D7': 'U',
|
2474 |
+
'\u01D5': 'U',
|
2475 |
+
'\u01D9': 'U',
|
2476 |
+
'\u1EE6': 'U',
|
2477 |
+
'\u016E': 'U',
|
2478 |
+
'\u0170': 'U',
|
2479 |
+
'\u01D3': 'U',
|
2480 |
+
'\u0214': 'U',
|
2481 |
+
'\u0216': 'U',
|
2482 |
+
'\u01AF': 'U',
|
2483 |
+
'\u1EEA': 'U',
|
2484 |
+
'\u1EE8': 'U',
|
2485 |
+
'\u1EEE': 'U',
|
2486 |
+
'\u1EEC': 'U',
|
2487 |
+
'\u1EF0': 'U',
|
2488 |
+
'\u1EE4': 'U',
|
2489 |
+
'\u1E72': 'U',
|
2490 |
+
'\u0172': 'U',
|
2491 |
+
'\u1E76': 'U',
|
2492 |
+
'\u1E74': 'U',
|
2493 |
+
'\u0244': 'U',
|
2494 |
+
'\u24CB': 'V',
|
2495 |
+
'\uFF36': 'V',
|
2496 |
+
'\u1E7C': 'V',
|
2497 |
+
'\u1E7E': 'V',
|
2498 |
+
'\u01B2': 'V',
|
2499 |
+
'\uA75E': 'V',
|
2500 |
+
'\u0245': 'V',
|
2501 |
+
'\uA760': 'VY',
|
2502 |
+
'\u24CC': 'W',
|
2503 |
+
'\uFF37': 'W',
|
2504 |
+
'\u1E80': 'W',
|
2505 |
+
'\u1E82': 'W',
|
2506 |
+
'\u0174': 'W',
|
2507 |
+
'\u1E86': 'W',
|
2508 |
+
'\u1E84': 'W',
|
2509 |
+
'\u1E88': 'W',
|
2510 |
+
'\u2C72': 'W',
|
2511 |
+
'\u24CD': 'X',
|
2512 |
+
'\uFF38': 'X',
|
2513 |
+
'\u1E8A': 'X',
|
2514 |
+
'\u1E8C': 'X',
|
2515 |
+
'\u24CE': 'Y',
|
2516 |
+
'\uFF39': 'Y',
|
2517 |
+
'\u1EF2': 'Y',
|
2518 |
+
'\u00DD': 'Y',
|
2519 |
+
'\u0176': 'Y',
|
2520 |
+
'\u1EF8': 'Y',
|
2521 |
+
'\u0232': 'Y',
|
2522 |
+
'\u1E8E': 'Y',
|
2523 |
+
'\u0178': 'Y',
|
2524 |
+
'\u1EF6': 'Y',
|
2525 |
+
'\u1EF4': 'Y',
|
2526 |
+
'\u01B3': 'Y',
|
2527 |
+
'\u024E': 'Y',
|
2528 |
+
'\u1EFE': 'Y',
|
2529 |
+
'\u24CF': 'Z',
|
2530 |
+
'\uFF3A': 'Z',
|
2531 |
+
'\u0179': 'Z',
|
2532 |
+
'\u1E90': 'Z',
|
2533 |
+
'\u017B': 'Z',
|
2534 |
+
'\u017D': 'Z',
|
2535 |
+
'\u1E92': 'Z',
|
2536 |
+
'\u1E94': 'Z',
|
2537 |
+
'\u01B5': 'Z',
|
2538 |
+
'\u0224': 'Z',
|
2539 |
+
'\u2C7F': 'Z',
|
2540 |
+
'\u2C6B': 'Z',
|
2541 |
+
'\uA762': 'Z',
|
2542 |
+
'\u24D0': 'a',
|
2543 |
+
'\uFF41': 'a',
|
2544 |
+
'\u1E9A': 'a',
|
2545 |
+
'\u00E0': 'a',
|
2546 |
+
'\u00E1': 'a',
|
2547 |
+
'\u00E2': 'a',
|
2548 |
+
'\u1EA7': 'a',
|
2549 |
+
'\u1EA5': 'a',
|
2550 |
+
'\u1EAB': 'a',
|
2551 |
+
'\u1EA9': 'a',
|
2552 |
+
'\u00E3': 'a',
|
2553 |
+
'\u0101': 'a',
|
2554 |
+
'\u0103': 'a',
|
2555 |
+
'\u1EB1': 'a',
|
2556 |
+
'\u1EAF': 'a',
|
2557 |
+
'\u1EB5': 'a',
|
2558 |
+
'\u1EB3': 'a',
|
2559 |
+
'\u0227': 'a',
|
2560 |
+
'\u01E1': 'a',
|
2561 |
+
'\u00E4': 'a',
|
2562 |
+
'\u01DF': 'a',
|
2563 |
+
'\u1EA3': 'a',
|
2564 |
+
'\u00E5': 'a',
|
2565 |
+
'\u01FB': 'a',
|
2566 |
+
'\u01CE': 'a',
|
2567 |
+
'\u0201': 'a',
|
2568 |
+
'\u0203': 'a',
|
2569 |
+
'\u1EA1': 'a',
|
2570 |
+
'\u1EAD': 'a',
|
2571 |
+
'\u1EB7': 'a',
|
2572 |
+
'\u1E01': 'a',
|
2573 |
+
'\u0105': 'a',
|
2574 |
+
'\u2C65': 'a',
|
2575 |
+
'\u0250': 'a',
|
2576 |
+
'\uA733': 'aa',
|
2577 |
+
'\u00E6': 'ae',
|
2578 |
+
'\u01FD': 'ae',
|
2579 |
+
'\u01E3': 'ae',
|
2580 |
+
'\uA735': 'ao',
|
2581 |
+
'\uA737': 'au',
|
2582 |
+
'\uA739': 'av',
|
2583 |
+
'\uA73B': 'av',
|
2584 |
+
'\uA73D': 'ay',
|
2585 |
+
'\u24D1': 'b',
|
2586 |
+
'\uFF42': 'b',
|
2587 |
+
'\u1E03': 'b',
|
2588 |
+
'\u1E05': 'b',
|
2589 |
+
'\u1E07': 'b',
|
2590 |
+
'\u0180': 'b',
|
2591 |
+
'\u0183': 'b',
|
2592 |
+
'\u0253': 'b',
|
2593 |
+
'\u24D2': 'c',
|
2594 |
+
'\uFF43': 'c',
|
2595 |
+
'\u0107': 'c',
|
2596 |
+
'\u0109': 'c',
|
2597 |
+
'\u010B': 'c',
|
2598 |
+
'\u010D': 'c',
|
2599 |
+
'\u00E7': 'c',
|
2600 |
+
'\u1E09': 'c',
|
2601 |
+
'\u0188': 'c',
|
2602 |
+
'\u023C': 'c',
|
2603 |
+
'\uA73F': 'c',
|
2604 |
+
'\u2184': 'c',
|
2605 |
+
'\u24D3': 'd',
|
2606 |
+
'\uFF44': 'd',
|
2607 |
+
'\u1E0B': 'd',
|
2608 |
+
'\u010F': 'd',
|
2609 |
+
'\u1E0D': 'd',
|
2610 |
+
'\u1E11': 'd',
|
2611 |
+
'\u1E13': 'd',
|
2612 |
+
'\u1E0F': 'd',
|
2613 |
+
'\u0111': 'd',
|
2614 |
+
'\u018C': 'd',
|
2615 |
+
'\u0256': 'd',
|
2616 |
+
'\u0257': 'd',
|
2617 |
+
'\uA77A': 'd',
|
2618 |
+
'\u01F3': 'dz',
|
2619 |
+
'\u01C6': 'dz',
|
2620 |
+
'\u24D4': 'e',
|
2621 |
+
'\uFF45': 'e',
|
2622 |
+
'\u00E8': 'e',
|
2623 |
+
'\u00E9': 'e',
|
2624 |
+
'\u00EA': 'e',
|
2625 |
+
'\u1EC1': 'e',
|
2626 |
+
'\u1EBF': 'e',
|
2627 |
+
'\u1EC5': 'e',
|
2628 |
+
'\u1EC3': 'e',
|
2629 |
+
'\u1EBD': 'e',
|
2630 |
+
'\u0113': 'e',
|
2631 |
+
'\u1E15': 'e',
|
2632 |
+
'\u1E17': 'e',
|
2633 |
+
'\u0115': 'e',
|
2634 |
+
'\u0117': 'e',
|
2635 |
+
'\u00EB': 'e',
|
2636 |
+
'\u1EBB': 'e',
|
2637 |
+
'\u011B': 'e',
|
2638 |
+
'\u0205': 'e',
|
2639 |
+
'\u0207': 'e',
|
2640 |
+
'\u1EB9': 'e',
|
2641 |
+
'\u1EC7': 'e',
|
2642 |
+
'\u0229': 'e',
|
2643 |
+
'\u1E1D': 'e',
|
2644 |
+
'\u0119': 'e',
|
2645 |
+
'\u1E19': 'e',
|
2646 |
+
'\u1E1B': 'e',
|
2647 |
+
'\u0247': 'e',
|
2648 |
+
'\u025B': 'e',
|
2649 |
+
'\u01DD': 'e',
|
2650 |
+
'\u24D5': 'f',
|
2651 |
+
'\uFF46': 'f',
|
2652 |
+
'\u1E1F': 'f',
|
2653 |
+
'\u0192': 'f',
|
2654 |
+
'\uA77C': 'f',
|
2655 |
+
'\u24D6': 'g',
|
2656 |
+
'\uFF47': 'g',
|
2657 |
+
'\u01F5': 'g',
|
2658 |
+
'\u011D': 'g',
|
2659 |
+
'\u1E21': 'g',
|
2660 |
+
'\u011F': 'g',
|
2661 |
+
'\u0121': 'g',
|
2662 |
+
'\u01E7': 'g',
|
2663 |
+
'\u0123': 'g',
|
2664 |
+
'\u01E5': 'g',
|
2665 |
+
'\u0260': 'g',
|
2666 |
+
'\uA7A1': 'g',
|
2667 |
+
'\u1D79': 'g',
|
2668 |
+
'\uA77F': 'g',
|
2669 |
+
'\u24D7': 'h',
|
2670 |
+
'\uFF48': 'h',
|
2671 |
+
'\u0125': 'h',
|
2672 |
+
'\u1E23': 'h',
|
2673 |
+
'\u1E27': 'h',
|
2674 |
+
'\u021F': 'h',
|
2675 |
+
'\u1E25': 'h',
|
2676 |
+
'\u1E29': 'h',
|
2677 |
+
'\u1E2B': 'h',
|
2678 |
+
'\u1E96': 'h',
|
2679 |
+
'\u0127': 'h',
|
2680 |
+
'\u2C68': 'h',
|
2681 |
+
'\u2C76': 'h',
|
2682 |
+
'\u0265': 'h',
|
2683 |
+
'\u0195': 'hv',
|
2684 |
+
'\u24D8': 'i',
|
2685 |
+
'\uFF49': 'i',
|
2686 |
+
'\u00EC': 'i',
|
2687 |
+
'\u00ED': 'i',
|
2688 |
+
'\u00EE': 'i',
|
2689 |
+
'\u0129': 'i',
|
2690 |
+
'\u012B': 'i',
|
2691 |
+
'\u012D': 'i',
|
2692 |
+
'\u00EF': 'i',
|
2693 |
+
'\u1E2F': 'i',
|
2694 |
+
'\u1EC9': 'i',
|
2695 |
+
'\u01D0': 'i',
|
2696 |
+
'\u0209': 'i',
|
2697 |
+
'\u020B': 'i',
|
2698 |
+
'\u1ECB': 'i',
|
2699 |
+
'\u012F': 'i',
|
2700 |
+
'\u1E2D': 'i',
|
2701 |
+
'\u0268': 'i',
|
2702 |
+
'\u0131': 'i',
|
2703 |
+
'\u24D9': 'j',
|
2704 |
+
'\uFF4A': 'j',
|
2705 |
+
'\u0135': 'j',
|
2706 |
+
'\u01F0': 'j',
|
2707 |
+
'\u0249': 'j',
|
2708 |
+
'\u24DA': 'k',
|
2709 |
+
'\uFF4B': 'k',
|
2710 |
+
'\u1E31': 'k',
|
2711 |
+
'\u01E9': 'k',
|
2712 |
+
'\u1E33': 'k',
|
2713 |
+
'\u0137': 'k',
|
2714 |
+
'\u1E35': 'k',
|
2715 |
+
'\u0199': 'k',
|
2716 |
+
'\u2C6A': 'k',
|
2717 |
+
'\uA741': 'k',
|
2718 |
+
'\uA743': 'k',
|
2719 |
+
'\uA745': 'k',
|
2720 |
+
'\uA7A3': 'k',
|
2721 |
+
'\u24DB': 'l',
|
2722 |
+
'\uFF4C': 'l',
|
2723 |
+
'\u0140': 'l',
|
2724 |
+
'\u013A': 'l',
|
2725 |
+
'\u013E': 'l',
|
2726 |
+
'\u1E37': 'l',
|
2727 |
+
'\u1E39': 'l',
|
2728 |
+
'\u013C': 'l',
|
2729 |
+
'\u1E3D': 'l',
|
2730 |
+
'\u1E3B': 'l',
|
2731 |
+
'\u017F': 'l',
|
2732 |
+
'\u0142': 'l',
|
2733 |
+
'\u019A': 'l',
|
2734 |
+
'\u026B': 'l',
|
2735 |
+
'\u2C61': 'l',
|
2736 |
+
'\uA749': 'l',
|
2737 |
+
'\uA781': 'l',
|
2738 |
+
'\uA747': 'l',
|
2739 |
+
'\u01C9': 'lj',
|
2740 |
+
'\u24DC': 'm',
|
2741 |
+
'\uFF4D': 'm',
|
2742 |
+
'\u1E3F': 'm',
|
2743 |
+
'\u1E41': 'm',
|
2744 |
+
'\u1E43': 'm',
|
2745 |
+
'\u0271': 'm',
|
2746 |
+
'\u026F': 'm',
|
2747 |
+
'\u24DD': 'n',
|
2748 |
+
'\uFF4E': 'n',
|
2749 |
+
'\u01F9': 'n',
|
2750 |
+
'\u0144': 'n',
|
2751 |
+
'\u00F1': 'n',
|
2752 |
+
'\u1E45': 'n',
|
2753 |
+
'\u0148': 'n',
|
2754 |
+
'\u1E47': 'n',
|
2755 |
+
'\u0146': 'n',
|
2756 |
+
'\u1E4B': 'n',
|
2757 |
+
'\u1E49': 'n',
|
2758 |
+
'\u019E': 'n',
|
2759 |
+
'\u0272': 'n',
|
2760 |
+
'\u0149': 'n',
|
2761 |
+
'\uA791': 'n',
|
2762 |
+
'\uA7A5': 'n',
|
2763 |
+
'\u01CC': 'nj',
|
2764 |
+
'\u24DE': 'o',
|
2765 |
+
'\uFF4F': 'o',
|
2766 |
+
'\u00F2': 'o',
|
2767 |
+
'\u00F3': 'o',
|
2768 |
+
'\u00F4': 'o',
|
2769 |
+
'\u1ED3': 'o',
|
2770 |
+
'\u1ED1': 'o',
|
2771 |
+
'\u1ED7': 'o',
|
2772 |
+
'\u1ED5': 'o',
|
2773 |
+
'\u00F5': 'o',
|
2774 |
+
'\u1E4D': 'o',
|
2775 |
+
'\u022D': 'o',
|
2776 |
+
'\u1E4F': 'o',
|
2777 |
+
'\u014D': 'o',
|
2778 |
+
'\u1E51': 'o',
|
2779 |
+
'\u1E53': 'o',
|
2780 |
+
'\u014F': 'o',
|
2781 |
+
'\u022F': 'o',
|
2782 |
+
'\u0231': 'o',
|
2783 |
+
'\u00F6': 'o',
|
2784 |
+
'\u022B': 'o',
|
2785 |
+
'\u1ECF': 'o',
|
2786 |
+
'\u0151': 'o',
|
2787 |
+
'\u01D2': 'o',
|
2788 |
+
'\u020D': 'o',
|
2789 |
+
'\u020F': 'o',
|
2790 |
+
'\u01A1': 'o',
|
2791 |
+
'\u1EDD': 'o',
|
2792 |
+
'\u1EDB': 'o',
|
2793 |
+
'\u1EE1': 'o',
|
2794 |
+
'\u1EDF': 'o',
|
2795 |
+
'\u1EE3': 'o',
|
2796 |
+
'\u1ECD': 'o',
|
2797 |
+
'\u1ED9': 'o',
|
2798 |
+
'\u01EB': 'o',
|
2799 |
+
'\u01ED': 'o',
|
2800 |
+
'\u00F8': 'o',
|
2801 |
+
'\u01FF': 'o',
|
2802 |
+
'\u0254': 'o',
|
2803 |
+
'\uA74B': 'o',
|
2804 |
+
'\uA74D': 'o',
|
2805 |
+
'\u0275': 'o',
|
2806 |
+
'\u01A3': 'oi',
|
2807 |
+
'\u0223': 'ou',
|
2808 |
+
'\uA74F': 'oo',
|
2809 |
+
'\u24DF': 'p',
|
2810 |
+
'\uFF50': 'p',
|
2811 |
+
'\u1E55': 'p',
|
2812 |
+
'\u1E57': 'p',
|
2813 |
+
'\u01A5': 'p',
|
2814 |
+
'\u1D7D': 'p',
|
2815 |
+
'\uA751': 'p',
|
2816 |
+
'\uA753': 'p',
|
2817 |
+
'\uA755': 'p',
|
2818 |
+
'\u24E0': 'q',
|
2819 |
+
'\uFF51': 'q',
|
2820 |
+
'\u024B': 'q',
|
2821 |
+
'\uA757': 'q',
|
2822 |
+
'\uA759': 'q',
|
2823 |
+
'\u24E1': 'r',
|
2824 |
+
'\uFF52': 'r',
|
2825 |
+
'\u0155': 'r',
|
2826 |
+
'\u1E59': 'r',
|
2827 |
+
'\u0159': 'r',
|
2828 |
+
'\u0211': 'r',
|
2829 |
+
'\u0213': 'r',
|
2830 |
+
'\u1E5B': 'r',
|
2831 |
+
'\u1E5D': 'r',
|
2832 |
+
'\u0157': 'r',
|
2833 |
+
'\u1E5F': 'r',
|
2834 |
+
'\u024D': 'r',
|
2835 |
+
'\u027D': 'r',
|
2836 |
+
'\uA75B': 'r',
|
2837 |
+
'\uA7A7': 'r',
|
2838 |
+
'\uA783': 'r',
|
2839 |
+
'\u24E2': 's',
|
2840 |
+
'\uFF53': 's',
|
2841 |
+
'\u00DF': 's',
|
2842 |
+
'\u015B': 's',
|
2843 |
+
'\u1E65': 's',
|
2844 |
+
'\u015D': 's',
|
2845 |
+
'\u1E61': 's',
|
2846 |
+
'\u0161': 's',
|
2847 |
+
'\u1E67': 's',
|
2848 |
+
'\u1E63': 's',
|
2849 |
+
'\u1E69': 's',
|
2850 |
+
'\u0219': 's',
|
2851 |
+
'\u015F': 's',
|
2852 |
+
'\u023F': 's',
|
2853 |
+
'\uA7A9': 's',
|
2854 |
+
'\uA785': 's',
|
2855 |
+
'\u1E9B': 's',
|
2856 |
+
'\u24E3': 't',
|
2857 |
+
'\uFF54': 't',
|
2858 |
+
'\u1E6B': 't',
|
2859 |
+
'\u1E97': 't',
|
2860 |
+
'\u0165': 't',
|
2861 |
+
'\u1E6D': 't',
|
2862 |
+
'\u021B': 't',
|
2863 |
+
'\u0163': 't',
|
2864 |
+
'\u1E71': 't',
|
2865 |
+
'\u1E6F': 't',
|
2866 |
+
'\u0167': 't',
|
2867 |
+
'\u01AD': 't',
|
2868 |
+
'\u0288': 't',
|
2869 |
+
'\u2C66': 't',
|
2870 |
+
'\uA787': 't',
|
2871 |
+
'\uA729': 'tz',
|
2872 |
+
'\u24E4': 'u',
|
2873 |
+
'\uFF55': 'u',
|
2874 |
+
'\u00F9': 'u',
|
2875 |
+
'\u00FA': 'u',
|
2876 |
+
'\u00FB': 'u',
|
2877 |
+
'\u0169': 'u',
|
2878 |
+
'\u1E79': 'u',
|
2879 |
+
'\u016B': 'u',
|
2880 |
+
'\u1E7B': 'u',
|
2881 |
+
'\u016D': 'u',
|
2882 |
+
'\u00FC': 'u',
|
2883 |
+
'\u01DC': 'u',
|
2884 |
+
'\u01D8': 'u',
|
2885 |
+
'\u01D6': 'u',
|
2886 |
+
'\u01DA': 'u',
|
2887 |
+
'\u1EE7': 'u',
|
2888 |
+
'\u016F': 'u',
|
2889 |
+
'\u0171': 'u',
|
2890 |
+
'\u01D4': 'u',
|
2891 |
+
'\u0215': 'u',
|
2892 |
+
'\u0217': 'u',
|
2893 |
+
'\u01B0': 'u',
|
2894 |
+
'\u1EEB': 'u',
|
2895 |
+
'\u1EE9': 'u',
|
2896 |
+
'\u1EEF': 'u',
|
2897 |
+
'\u1EED': 'u',
|
2898 |
+
'\u1EF1': 'u',
|
2899 |
+
'\u1EE5': 'u',
|
2900 |
+
'\u1E73': 'u',
|
2901 |
+
'\u0173': 'u',
|
2902 |
+
'\u1E77': 'u',
|
2903 |
+
'\u1E75': 'u',
|
2904 |
+
'\u0289': 'u',
|
2905 |
+
'\u24E5': 'v',
|
2906 |
+
'\uFF56': 'v',
|
2907 |
+
'\u1E7D': 'v',
|
2908 |
+
'\u1E7F': 'v',
|
2909 |
+
'\u028B': 'v',
|
2910 |
+
'\uA75F': 'v',
|
2911 |
+
'\u028C': 'v',
|
2912 |
+
'\uA761': 'vy',
|
2913 |
+
'\u24E6': 'w',
|
2914 |
+
'\uFF57': 'w',
|
2915 |
+
'\u1E81': 'w',
|
2916 |
+
'\u1E83': 'w',
|
2917 |
+
'\u0175': 'w',
|
2918 |
+
'\u1E87': 'w',
|
2919 |
+
'\u1E85': 'w',
|
2920 |
+
'\u1E98': 'w',
|
2921 |
+
'\u1E89': 'w',
|
2922 |
+
'\u2C73': 'w',
|
2923 |
+
'\u24E7': 'x',
|
2924 |
+
'\uFF58': 'x',
|
2925 |
+
'\u1E8B': 'x',
|
2926 |
+
'\u1E8D': 'x',
|
2927 |
+
'\u24E8': 'y',
|
2928 |
+
'\uFF59': 'y',
|
2929 |
+
'\u1EF3': 'y',
|
2930 |
+
'\u00FD': 'y',
|
2931 |
+
'\u0177': 'y',
|
2932 |
+
'\u1EF9': 'y',
|
2933 |
+
'\u0233': 'y',
|
2934 |
+
'\u1E8F': 'y',
|
2935 |
+
'\u00FF': 'y',
|
2936 |
+
'\u1EF7': 'y',
|
2937 |
+
'\u1E99': 'y',
|
2938 |
+
'\u1EF5': 'y',
|
2939 |
+
'\u01B4': 'y',
|
2940 |
+
'\u024F': 'y',
|
2941 |
+
'\u1EFF': 'y',
|
2942 |
+
'\u24E9': 'z',
|
2943 |
+
'\uFF5A': 'z',
|
2944 |
+
'\u017A': 'z',
|
2945 |
+
'\u1E91': 'z',
|
2946 |
+
'\u017C': 'z',
|
2947 |
+
'\u017E': 'z',
|
2948 |
+
'\u1E93': 'z',
|
2949 |
+
'\u1E95': 'z',
|
2950 |
+
'\u01B6': 'z',
|
2951 |
+
'\u0225': 'z',
|
2952 |
+
'\u0240': 'z',
|
2953 |
+
'\u2C6C': 'z',
|
2954 |
+
'\uA763': 'z',
|
2955 |
+
'\u0386': '\u0391',
|
2956 |
+
'\u0388': '\u0395',
|
2957 |
+
'\u0389': '\u0397',
|
2958 |
+
'\u038A': '\u0399',
|
2959 |
+
'\u03AA': '\u0399',
|
2960 |
+
'\u038C': '\u039F',
|
2961 |
+
'\u038E': '\u03A5',
|
2962 |
+
'\u03AB': '\u03A5',
|
2963 |
+
'\u038F': '\u03A9',
|
2964 |
+
'\u03AC': '\u03B1',
|
2965 |
+
'\u03AD': '\u03B5',
|
2966 |
+
'\u03AE': '\u03B7',
|
2967 |
+
'\u03AF': '\u03B9',
|
2968 |
+
'\u03CA': '\u03B9',
|
2969 |
+
'\u0390': '\u03B9',
|
2970 |
+
'\u03CC': '\u03BF',
|
2971 |
+
'\u03CD': '\u03C5',
|
2972 |
+
'\u03CB': '\u03C5',
|
2973 |
+
'\u03B0': '\u03C5',
|
2974 |
+
'\u03C9': '\u03C9',
|
2975 |
+
'\u03C2': '\u03C3'
|
2976 |
+
};
|
2977 |
+
|
2978 |
+
return diacritics;
|
2979 |
+
});
|
2980 |
+
|
2981 |
+
S2.define('select2/data/base',[
|
2982 |
+
'../utils'
|
2983 |
+
], function (Utils) {
|
2984 |
+
function BaseAdapter ($element, options) {
|
2985 |
+
BaseAdapter.__super__.constructor.call(this);
|
2986 |
+
}
|
2987 |
+
|
2988 |
+
Utils.Extend(BaseAdapter, Utils.Observable);
|
2989 |
+
|
2990 |
+
BaseAdapter.prototype.current = function (callback) {
|
2991 |
+
throw new Error('The `current` method must be defined in child classes.');
|
2992 |
+
};
|
2993 |
+
|
2994 |
+
BaseAdapter.prototype.query = function (params, callback) {
|
2995 |
+
throw new Error('The `query` method must be defined in child classes.');
|
2996 |
+
};
|
2997 |
+
|
2998 |
+
BaseAdapter.prototype.bind = function (container, $container) {
|
2999 |
+
// Can be implemented in subclasses
|
3000 |
+
};
|
3001 |
+
|
3002 |
+
BaseAdapter.prototype.destroy = function () {
|
3003 |
+
// Can be implemented in subclasses
|
3004 |
+
};
|
3005 |
+
|
3006 |
+
BaseAdapter.prototype.generateResultId = function (container, data) {
|
3007 |
+
var id = container.id + '-result-';
|
3008 |
+
|
3009 |
+
id += Utils.generateChars(4);
|
3010 |
+
|
3011 |
+
if (data.id != null) {
|
3012 |
+
id += '-' + data.id.toString();
|
3013 |
+
} else {
|
3014 |
+
id += '-' + Utils.generateChars(4);
|
3015 |
+
}
|
3016 |
+
return id;
|
3017 |
+
};
|
3018 |
+
|
3019 |
+
return BaseAdapter;
|
3020 |
+
});
|
3021 |
+
|
3022 |
+
S2.define('select2/data/select',[
|
3023 |
+
'./base',
|
3024 |
+
'../utils',
|
3025 |
+
'jquery'
|
3026 |
+
], function (BaseAdapter, Utils, $) {
|
3027 |
+
function SelectAdapter ($element, options) {
|
3028 |
+
this.$element = $element;
|
3029 |
+
this.options = options;
|
3030 |
+
|
3031 |
+
SelectAdapter.__super__.constructor.call(this);
|
3032 |
+
}
|
3033 |
+
|
3034 |
+
Utils.Extend(SelectAdapter, BaseAdapter);
|
3035 |
+
|
3036 |
+
SelectAdapter.prototype.current = function (callback) {
|
3037 |
+
var data = [];
|
3038 |
+
var self = this;
|
3039 |
+
|
3040 |
+
this.$element.find(':selected').each(function () {
|
3041 |
+
var $option = $(this);
|
3042 |
+
|
3043 |
+
var option = self.item($option);
|
3044 |
+
|
3045 |
+
data.push(option);
|
3046 |
+
});
|
3047 |
+
|
3048 |
+
callback(data);
|
3049 |
+
};
|
3050 |
+
|
3051 |
+
SelectAdapter.prototype.select = function (data) {
|
3052 |
+
var self = this;
|
3053 |
+
|
3054 |
+
data.selected = true;
|
3055 |
+
|
3056 |
+
// If data.element is a DOM node, use it instead
|
3057 |
+
if ($(data.element).is('option')) {
|
3058 |
+
data.element.selected = true;
|
3059 |
+
|
3060 |
+
this.$element.trigger('change');
|
3061 |
+
|
3062 |
+
return;
|
3063 |
+
}
|
3064 |
+
|
3065 |
+
if (this.$element.prop('multiple')) {
|
3066 |
+
this.current(function (currentData) {
|
3067 |
+
var val = [];
|
3068 |
+
|
3069 |
+
data = [data];
|
3070 |
+
data.push.apply(data, currentData);
|
3071 |
+
|
3072 |
+
for (var d = 0; d < data.length; d++) {
|
3073 |
+
var id = data[d].id;
|
3074 |
+
|
3075 |
+
if ($.inArray(id, val) === -1) {
|
3076 |
+
val.push(id);
|
3077 |
+
}
|
3078 |
+
}
|
3079 |
+
|
3080 |
+
self.$element.val(val);
|
3081 |
+
self.$element.trigger('change');
|
3082 |
+
});
|
3083 |
+
} else {
|
3084 |
+
var val = data.id;
|
3085 |
+
|
3086 |
+
this.$element.val(val);
|
3087 |
+
this.$element.trigger('change');
|
3088 |
+
}
|
3089 |
+
};
|
3090 |
+
|
3091 |
+
SelectAdapter.prototype.unselect = function (data) {
|
3092 |
+
var self = this;
|
3093 |
+
|
3094 |
+
if (!this.$element.prop('multiple')) {
|
3095 |
+
return;
|
3096 |
+
}
|
3097 |
+
|
3098 |
+
data.selected = false;
|
3099 |
+
|
3100 |
+
if ($(data.element).is('option')) {
|
3101 |
+
data.element.selected = false;
|
3102 |
+
|
3103 |
+
this.$element.trigger('change');
|
3104 |
+
|
3105 |
+
return;
|
3106 |
+
}
|
3107 |
+
|
3108 |
+
this.current(function (currentData) {
|
3109 |
+
var val = [];
|
3110 |
+
|
3111 |
+
for (var d = 0; d < currentData.length; d++) {
|
3112 |
+
var id = currentData[d].id;
|
3113 |
+
|
3114 |
+
if (id !== data.id && $.inArray(id, val) === -1) {
|
3115 |
+
val.push(id);
|
3116 |
+
}
|
3117 |
+
}
|
3118 |
+
|
3119 |
+
self.$element.val(val);
|
3120 |
+
|
3121 |
+
self.$element.trigger('change');
|
3122 |
+
});
|
3123 |
+
};
|
3124 |
+
|
3125 |
+
SelectAdapter.prototype.bind = function (container, $container) {
|
3126 |
+
var self = this;
|
3127 |
+
|
3128 |
+
this.container = container;
|
3129 |
+
|
3130 |
+
container.on('select', function (params) {
|
3131 |
+
self.select(params.data);
|
3132 |
+
});
|
3133 |
+
|
3134 |
+
container.on('unselect', function (params) {
|
3135 |
+
self.unselect(params.data);
|
3136 |
+
});
|
3137 |
+
};
|
3138 |
+
|
3139 |
+
SelectAdapter.prototype.destroy = function () {
|
3140 |
+
// Remove anything added to child elements
|
3141 |
+
this.$element.find('*').each(function () {
|
3142 |
+
// Remove any custom data set by Select2
|
3143 |
+
$.removeData(this, 'data');
|
3144 |
+
});
|
3145 |
+
};
|
3146 |
+
|
3147 |
+
SelectAdapter.prototype.query = function (params, callback) {
|
3148 |
+
var data = [];
|
3149 |
+
var self = this;
|
3150 |
+
|
3151 |
+
var $options = this.$element.children();
|
3152 |
+
|
3153 |
+
$options.each(function () {
|
3154 |
+
var $option = $(this);
|
3155 |
+
|
3156 |
+
if (!$option.is('option') && !$option.is('optgroup')) {
|
3157 |
+
return;
|
3158 |
+
}
|
3159 |
+
|
3160 |
+
var option = self.item($option);
|
3161 |
+
|
3162 |
+
var matches = self.matches(params, option);
|
3163 |
+
|
3164 |
+
if (matches !== null) {
|
3165 |
+
data.push(matches);
|
3166 |
+
}
|
3167 |
+
});
|
3168 |
+
|
3169 |
+
callback({
|
3170 |
+
results: data
|
3171 |
+
});
|
3172 |
+
};
|
3173 |
+
|
3174 |
+
SelectAdapter.prototype.addOptions = function ($options) {
|
3175 |
+
Utils.appendMany(this.$element, $options);
|
3176 |
+
};
|
3177 |
+
|
3178 |
+
SelectAdapter.prototype.option = function (data) {
|
3179 |
+
var option;
|
3180 |
+
|
3181 |
+
if (data.children) {
|
3182 |
+
option = document.createElement('optgroup');
|
3183 |
+
option.label = data.text;
|
3184 |
+
} else {
|
3185 |
+
option = document.createElement('option');
|
3186 |
+
|
3187 |
+
if (option.textContent !== undefined) {
|
3188 |
+
option.textContent = data.text;
|
3189 |
+
} else {
|
3190 |
+
option.innerText = data.text;
|
3191 |
+
}
|
3192 |
+
}
|
3193 |
+
|
3194 |
+
if (data.id) {
|
3195 |
+
option.value = data.id;
|
3196 |
+
}
|
3197 |
+
|
3198 |
+
if (data.disabled) {
|
3199 |
+
option.disabled = true;
|
3200 |
+
}
|
3201 |
+
|
3202 |
+
if (data.selected) {
|
3203 |
+
option.selected = true;
|
3204 |
+
}
|
3205 |
+
|
3206 |
+
if (data.title) {
|
3207 |
+
option.title = data.title;
|
3208 |
+
}
|
3209 |
+
|
3210 |
+
var $option = $(option);
|
3211 |
+
|
3212 |
+
var normalizedData = this._normalizeItem(data);
|
3213 |
+
normalizedData.element = option;
|
3214 |
+
|
3215 |
+
// Override the option's data with the combined data
|
3216 |
+
$.data(option, 'data', normalizedData);
|
3217 |
+
|
3218 |
+
return $option;
|
3219 |
+
};
|
3220 |
+
|
3221 |
+
SelectAdapter.prototype.item = function ($option) {
|
3222 |
+
var data = {};
|
3223 |
+
|
3224 |
+
data = $.data($option[0], 'data');
|
3225 |
+
|
3226 |
+
if (data != null) {
|
3227 |
+
return data;
|
3228 |
+
}
|
3229 |
+
|
3230 |
+
if ($option.is('option')) {
|
3231 |
+
data = {
|
3232 |
+
id: $option.val(),
|
3233 |
+
text: $option.text(),
|
3234 |
+
disabled: $option.prop('disabled'),
|
3235 |
+
selected: $option.prop('selected'),
|
3236 |
+
title: $option.prop('title')
|
3237 |
+
};
|
3238 |
+
} else if ($option.is('optgroup')) {
|
3239 |
+
data = {
|
3240 |
+
text: $option.prop('label'),
|
3241 |
+
children: [],
|
3242 |
+
title: $option.prop('title')
|
3243 |
+
};
|
3244 |
+
|
3245 |
+
var $children = $option.children('option');
|
3246 |
+
var children = [];
|
3247 |
+
|
3248 |
+
for (var c = 0; c < $children.length; c++) {
|
3249 |
+
var $child = $($children[c]);
|
3250 |
+
|
3251 |
+
var child = this.item($child);
|
3252 |
+
|
3253 |
+
children.push(child);
|
3254 |
+
}
|
3255 |
+
|
3256 |
+
data.children = children;
|
3257 |
+
}
|
3258 |
+
|
3259 |
+
data = this._normalizeItem(data);
|
3260 |
+
data.element = $option[0];
|
3261 |
+
|
3262 |
+
$.data($option[0], 'data', data);
|
3263 |
+
|
3264 |
+
return data;
|
3265 |
+
};
|
3266 |
+
|
3267 |
+
SelectAdapter.prototype._normalizeItem = function (item) {
|
3268 |
+
if (!$.isPlainObject(item)) {
|
3269 |
+
item = {
|
3270 |
+
id: item,
|
3271 |
+
text: item
|
3272 |
+
};
|
3273 |
+
}
|
3274 |
+
|
3275 |
+
item = $.extend({}, {
|
3276 |
+
text: ''
|
3277 |
+
}, item);
|
3278 |
+
|
3279 |
+
var defaults = {
|
3280 |
+
selected: false,
|
3281 |
+
disabled: false
|
3282 |
+
};
|
3283 |
+
|
3284 |
+
if (item.id != null) {
|
3285 |
+
item.id = item.id.toString();
|
3286 |
+
}
|
3287 |
+
|
3288 |
+
if (item.text != null) {
|
3289 |
+
item.text = item.text.toString();
|
3290 |
+
}
|
3291 |
+
|
3292 |
+
if (item._resultId == null && item.id && this.container != null) {
|
3293 |
+
item._resultId = this.generateResultId(this.container, item);
|
3294 |
+
}
|
3295 |
+
|
3296 |
+
return $.extend({}, defaults, item);
|
3297 |
+
};
|
3298 |
+
|
3299 |
+
SelectAdapter.prototype.matches = function (params, data) {
|
3300 |
+
var matcher = this.options.get('matcher');
|
3301 |
+
|
3302 |
+
return matcher(params, data);
|
3303 |
+
};
|
3304 |
+
|
3305 |
+
return SelectAdapter;
|
3306 |
+
});
|
3307 |
+
|
3308 |
+
S2.define('select2/data/array',[
|
3309 |
+
'./select',
|
3310 |
+
'../utils',
|
3311 |
+
'jquery'
|
3312 |
+
], function (SelectAdapter, Utils, $) {
|
3313 |
+
function ArrayAdapter ($element, options) {
|
3314 |
+
var data = options.get('data') || [];
|
3315 |
+
|
3316 |
+
ArrayAdapter.__super__.constructor.call(this, $element, options);
|
3317 |
+
|
3318 |
+
this.addOptions(this.convertToOptions(data));
|
3319 |
+
}
|
3320 |
+
|
3321 |
+
Utils.Extend(ArrayAdapter, SelectAdapter);
|
3322 |
+
|
3323 |
+
ArrayAdapter.prototype.select = function (data) {
|
3324 |
+
var $option = this.$element.find('option').filter(function (i, elm) {
|
3325 |
+
return elm.value == data.id.toString();
|
3326 |
+
});
|
3327 |
+
|
3328 |
+
if ($option.length === 0) {
|
3329 |
+
$option = this.option(data);
|
3330 |
+
|
3331 |
+
this.addOptions($option);
|
3332 |
+
}
|
3333 |
+
|
3334 |
+
ArrayAdapter.__super__.select.call(this, data);
|
3335 |
+
};
|
3336 |
+
|
3337 |
+
ArrayAdapter.prototype.convertToOptions = function (data) {
|
3338 |
+
var self = this;
|
3339 |
+
|
3340 |
+
var $existing = this.$element.find('option');
|
3341 |
+
var existingIds = $existing.map(function () {
|
3342 |
+
return self.item($(this)).id;
|
3343 |
+
}).get();
|
3344 |
+
|
3345 |
+
var $options = [];
|
3346 |
+
|
3347 |
+
// Filter out all items except for the one passed in the argument
|
3348 |
+
function onlyItem (item) {
|
3349 |
+
return function () {
|
3350 |
+
return $(this).val() == item.id;
|
3351 |
+
};
|
3352 |
+
}
|
3353 |
+
|
3354 |
+
for (var d = 0; d < data.length; d++) {
|
3355 |
+
var item = this._normalizeItem(data[d]);
|
3356 |
+
|
3357 |
+
// Skip items which were pre-loaded, only merge the data
|
3358 |
+
if ($.inArray(item.id, existingIds) >= 0) {
|
3359 |
+
var $existingOption = $existing.filter(onlyItem(item));
|
3360 |
+
|
3361 |
+
var existingData = this.item($existingOption);
|
3362 |
+
var newData = $.extend(true, {}, item, existingData);
|
3363 |
+
|
3364 |
+
var $newOption = this.option(newData);
|
3365 |
+
|
3366 |
+
$existingOption.replaceWith($newOption);
|
3367 |
+
|
3368 |
+
continue;
|
3369 |
+
}
|
3370 |
+
|
3371 |
+
var $option = this.option(item);
|
3372 |
+
|
3373 |
+
if (item.children) {
|
3374 |
+
var $children = this.convertToOptions(item.children);
|
3375 |
+
|
3376 |
+
Utils.appendMany($option, $children);
|
3377 |
+
}
|
3378 |
+
|
3379 |
+
$options.push($option);
|
3380 |
+
}
|
3381 |
+
|
3382 |
+
return $options;
|
3383 |
+
};
|
3384 |
+
|
3385 |
+
return ArrayAdapter;
|
3386 |
+
});
|
3387 |
+
|
3388 |
+
S2.define('select2/data/ajax',[
|
3389 |
+
'./array',
|
3390 |
+
'../utils',
|
3391 |
+
'jquery'
|
3392 |
+
], function (ArrayAdapter, Utils, $) {
|
3393 |
+
function AjaxAdapter ($element, options) {
|
3394 |
+
this.ajaxOptions = this._applyDefaults(options.get('ajax'));
|
3395 |
+
|
3396 |
+
if (this.ajaxOptions.processResults != null) {
|
3397 |
+
this.processResults = this.ajaxOptions.processResults;
|
3398 |
+
}
|
3399 |
+
|
3400 |
+
AjaxAdapter.__super__.constructor.call(this, $element, options);
|
3401 |
+
}
|
3402 |
+
|
3403 |
+
Utils.Extend(AjaxAdapter, ArrayAdapter);
|
3404 |
+
|
3405 |
+
AjaxAdapter.prototype._applyDefaults = function (options) {
|
3406 |
+
var defaults = {
|
3407 |
+
data: function (params) {
|
3408 |
+
return $.extend({}, params, {
|
3409 |
+
q: params.term
|
3410 |
+
});
|
3411 |
+
},
|
3412 |
+
transport: function (params, success, failure) {
|
3413 |
+
var $request = $.ajax(params);
|
3414 |
+
|
3415 |
+
$request.then(success);
|
3416 |
+
$request.fail(failure);
|
3417 |
+
|
3418 |
+
return $request;
|
3419 |
+
}
|
3420 |
+
};
|
3421 |
+
|
3422 |
+
return $.extend({}, defaults, options, true);
|
3423 |
+
};
|
3424 |
+
|
3425 |
+
AjaxAdapter.prototype.processResults = function (results) {
|
3426 |
+
return results;
|
3427 |
+
};
|
3428 |
+
|
3429 |
+
AjaxAdapter.prototype.query = function (params, callback) {
|
3430 |
+
var matches = [];
|
3431 |
+
var self = this;
|
3432 |
+
|
3433 |
+
if (this._request != null) {
|
3434 |
+
// JSONP requests cannot always be aborted
|
3435 |
+
if ($.isFunction(this._request.abort)) {
|
3436 |
+
this._request.abort();
|
3437 |
+
}
|
3438 |
+
|
3439 |
+
this._request = null;
|
3440 |
+
}
|
3441 |
+
|
3442 |
+
var options = $.extend({
|
3443 |
+
type: 'GET'
|
3444 |
+
}, this.ajaxOptions);
|
3445 |
+
|
3446 |
+
if (typeof options.url === 'function') {
|
3447 |
+
options.url = options.url.call(this.$element, params);
|
3448 |
+
}
|
3449 |
+
|
3450 |
+
if (typeof options.data === 'function') {
|
3451 |
+
options.data = options.data.call(this.$element, params);
|
3452 |
+
}
|
3453 |
+
|
3454 |
+
function request () {
|
3455 |
+
var $request = options.transport(options, function (data) {
|
3456 |
+
var results = self.processResults(data, params);
|
3457 |
+
|
3458 |
+
if (self.options.get('debug') && window.console && console.error) {
|
3459 |
+
// Check to make sure that the response included a `results` key.
|
3460 |
+
if (!results || !results.results || !$.isArray(results.results)) {
|
3461 |
+
console.error(
|
3462 |
+
'Select2: The AJAX results did not return an array in the ' +
|
3463 |
+
'`results` key of the response.'
|
3464 |
+
);
|
3465 |
+
}
|
3466 |
+
}
|
3467 |
+
|
3468 |
+
callback(results);
|
3469 |
+
}, function () {
|
3470 |
+
// Attempt to detect if a request was aborted
|
3471 |
+
// Only works if the transport exposes a status property
|
3472 |
+
if ($request.status && $request.status === '0') {
|
3473 |
+
return;
|
3474 |
+
}
|
3475 |
+
|
3476 |
+
self.trigger('results:message', {
|
3477 |
+
message: 'errorLoading'
|
3478 |
+
});
|
3479 |
+
});
|
3480 |
+
|
3481 |
+
self._request = $request;
|
3482 |
+
}
|
3483 |
+
|
3484 |
+
if (this.ajaxOptions.delay && params.term != null) {
|
3485 |
+
if (this._queryTimeout) {
|
3486 |
+
window.clearTimeout(this._queryTimeout);
|
3487 |
+
}
|
3488 |
+
|
3489 |
+
this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
|
3490 |
+
} else {
|
3491 |
+
request();
|
3492 |
+
}
|
3493 |
+
};
|
3494 |
+
|
3495 |
+
return AjaxAdapter;
|
3496 |
+
});
|
3497 |
+
|
3498 |
+
S2.define('select2/data/tags',[
|
3499 |
+
'jquery'
|
3500 |
+
], function ($) {
|
3501 |
+
function Tags (decorated, $element, options) {
|
3502 |
+
var tags = options.get('tags');
|
3503 |
+
|
3504 |
+
var createTag = options.get('createTag');
|
3505 |
+
|
3506 |
+
if (createTag !== undefined) {
|
3507 |
+
this.createTag = createTag;
|
3508 |
+
}
|
3509 |
+
|
3510 |
+
var insertTag = options.get('insertTag');
|
3511 |
+
|
3512 |
+
if (insertTag !== undefined) {
|
3513 |
+
this.insertTag = insertTag;
|
3514 |
+
}
|
3515 |
+
|
3516 |
+
decorated.call(this, $element, options);
|
3517 |
+
|
3518 |
+
if ($.isArray(tags)) {
|
3519 |
+
for (var t = 0; t < tags.length; t++) {
|
3520 |
+
var tag = tags[t];
|
3521 |
+
var item = this._normalizeItem(tag);
|
3522 |
+
|
3523 |
+
var $option = this.option(item);
|
3524 |
+
|
3525 |
+
this.$element.append($option);
|
3526 |
+
}
|
3527 |
+
}
|
3528 |
+
}
|
3529 |
+
|
3530 |
+
Tags.prototype.query = function (decorated, params, callback) {
|
3531 |
+
var self = this;
|
3532 |
+
|
3533 |
+
this._removeOldTags();
|
3534 |
+
|
3535 |
+
if (params.term == null || params.page != null) {
|
3536 |
+
decorated.call(this, params, callback);
|
3537 |
+
return;
|
3538 |
+
}
|
3539 |
+
|
3540 |
+
function wrapper (obj, child) {
|
3541 |
+
var data = obj.results;
|
3542 |
+
|
3543 |
+
for (var i = 0; i < data.length; i++) {
|
3544 |
+
var option = data[i];
|
3545 |
+
|
3546 |
+
var checkChildren = (
|
3547 |
+
option.children != null &&
|
3548 |
+
!wrapper({
|
3549 |
+
results: option.children
|
3550 |
+
}, true)
|
3551 |
+
);
|
3552 |
+
|
3553 |
+
var checkText = option.text === params.term;
|
3554 |
+
|
3555 |
+
if (checkText || checkChildren) {
|
3556 |
+
if (child) {
|
3557 |
+
return false;
|
3558 |
+
}
|
3559 |
+
|
3560 |
+
obj.data = data;
|
3561 |
+
callback(obj);
|
3562 |
+
|
3563 |
+
return;
|
3564 |
+
}
|
3565 |
+
}
|
3566 |
+
|
3567 |
+
if (child) {
|
3568 |
+
return true;
|
3569 |
+
}
|
3570 |
+
|
3571 |
+
var tag = self.createTag(params);
|
3572 |
+
|
3573 |
+
if (tag != null) {
|
3574 |
+
var $option = self.option(tag);
|
3575 |
+
$option.attr('data-select2-tag', true);
|
3576 |
+
|
3577 |
+
self.addOptions([$option]);
|
3578 |
+
|
3579 |
+
self.insertTag(data, tag);
|
3580 |
+
}
|
3581 |
+
|
3582 |
+
obj.results = data;
|
3583 |
+
|
3584 |
+
callback(obj);
|
3585 |
+
}
|
3586 |
+
|
3587 |
+
decorated.call(this, params, wrapper);
|
3588 |
+
};
|
3589 |
+
|
3590 |
+
Tags.prototype.createTag = function (decorated, params) {
|
3591 |
+
var term = $.trim(params.term);
|
3592 |
+
|
3593 |
+
if (term === '') {
|
3594 |
+
return null;
|
3595 |
+
}
|
3596 |
+
|
3597 |
+
return {
|
3598 |
+
id: term,
|
3599 |
+
text: term
|
3600 |
+
};
|
3601 |
+
};
|
3602 |
+
|
3603 |
+
Tags.prototype.insertTag = function (_, data, tag) {
|
3604 |
+
data.unshift(tag);
|
3605 |
+
};
|
3606 |
+
|
3607 |
+
Tags.prototype._removeOldTags = function (_) {
|
3608 |
+
var tag = this._lastTag;
|
3609 |
+
|
3610 |
+
var $options = this.$element.find('option[data-select2-tag]');
|
3611 |
+
|
3612 |
+
$options.each(function () {
|
3613 |
+
if (this.selected) {
|
3614 |
+
return;
|
3615 |
+
}
|
3616 |
+
|
3617 |
+
$(this).remove();
|
3618 |
+
});
|
3619 |
+
};
|
3620 |
+
|
3621 |
+
return Tags;
|
3622 |
+
});
|
3623 |
+
|
3624 |
+
S2.define('select2/data/tokenizer',[
|
3625 |
+
'jquery'
|
3626 |
+
], function ($) {
|
3627 |
+
function Tokenizer (decorated, $element, options) {
|
3628 |
+
var tokenizer = options.get('tokenizer');
|
3629 |
+
|
3630 |
+
if (tokenizer !== undefined) {
|
3631 |
+
this.tokenizer = tokenizer;
|
3632 |
+
}
|
3633 |
+
|
3634 |
+
decorated.call(this, $element, options);
|
3635 |
+
}
|
3636 |
+
|
3637 |
+
Tokenizer.prototype.bind = function (decorated, container, $container) {
|
3638 |
+
decorated.call(this, container, $container);
|
3639 |
+
|
3640 |
+
this.$search = container.dropdown.$search || container.selection.$search ||
|
3641 |
+
$container.find('.select2-search__field');
|
3642 |
+
};
|
3643 |
+
|
3644 |
+
Tokenizer.prototype.query = function (decorated, params, callback) {
|
3645 |
+
var self = this;
|
3646 |
+
|
3647 |
+
function createAndSelect (data) {
|
3648 |
+
// Normalize the data object so we can use it for checks
|
3649 |
+
var item = self._normalizeItem(data);
|
3650 |
+
|
3651 |
+
// Check if the data object already exists as a tag
|
3652 |
+
// Select it if it doesn't
|
3653 |
+
var $existingOptions = self.$element.find('option').filter(function () {
|
3654 |
+
return $(this).val() === item.id;
|
3655 |
+
});
|
3656 |
+
|
3657 |
+
// If an existing option wasn't found for it, create the option
|
3658 |
+
if (!$existingOptions.length) {
|
3659 |
+
var $option = self.option(item);
|
3660 |
+
$option.attr('data-select2-tag', true);
|
3661 |
+
|
3662 |
+
self._removeOldTags();
|
3663 |
+
self.addOptions([$option]);
|
3664 |
+
}
|
3665 |
+
|
3666 |
+
// Select the item, now that we know there is an option for it
|
3667 |
+
select(item);
|
3668 |
+
}
|
3669 |
+
|
3670 |
+
function select (data) {
|
3671 |
+
self.trigger('select', {
|
3672 |
+
data: data
|
3673 |
+
});
|
3674 |
+
}
|
3675 |
+
|
3676 |
+
params.term = params.term || '';
|
3677 |
+
|
3678 |
+
var tokenData = this.tokenizer(params, this.options, createAndSelect);
|
3679 |
+
|
3680 |
+
if (tokenData.term !== params.term) {
|
3681 |
+
// Replace the search term if we have the search box
|
3682 |
+
if (this.$search.length) {
|
3683 |
+
this.$search.val(tokenData.term);
|
3684 |
+
this.$search.focus();
|
3685 |
+
}
|
3686 |
+
|
3687 |
+
params.term = tokenData.term;
|
3688 |
+
}
|
3689 |
+
|
3690 |
+
decorated.call(this, params, callback);
|
3691 |
+
};
|
3692 |
+
|
3693 |
+
Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
|
3694 |
+
var separators = options.get('tokenSeparators') || [];
|
3695 |
+
var term = params.term;
|
3696 |
+
var i = 0;
|
3697 |
+
|
3698 |
+
var createTag = this.createTag || function (params) {
|
3699 |
+
return {
|
3700 |
+
id: params.term,
|
3701 |
+
text: params.term
|
3702 |
+
};
|
3703 |
+
};
|
3704 |
+
|
3705 |
+
while (i < term.length) {
|
3706 |
+
var termChar = term[i];
|
3707 |
+
|
3708 |
+
if ($.inArray(termChar, separators) === -1) {
|
3709 |
+
i++;
|
3710 |
+
|
3711 |
+
continue;
|
3712 |
+
}
|
3713 |
+
|
3714 |
+
var part = term.substr(0, i);
|
3715 |
+
var partParams = $.extend({}, params, {
|
3716 |
+
term: part
|
3717 |
+
});
|
3718 |
+
|
3719 |
+
var data = createTag(partParams);
|
3720 |
+
|
3721 |
+
if (data == null) {
|
3722 |
+
i++;
|
3723 |
+
continue;
|
3724 |
+
}
|
3725 |
+
|
3726 |
+
callback(data);
|
3727 |
+
|
3728 |
+
// Reset the term to not include the tokenized portion
|
3729 |
+
term = term.substr(i + 1) || '';
|
3730 |
+
i = 0;
|
3731 |
+
}
|
3732 |
+
|
3733 |
+
return {
|
3734 |
+
term: term
|
3735 |
+
};
|
3736 |
+
};
|
3737 |
+
|
3738 |
+
return Tokenizer;
|
3739 |
+
});
|
3740 |
+
|
3741 |
+
S2.define('select2/data/minimumInputLength',[
|
3742 |
+
|
3743 |
+
], function () {
|
3744 |
+
function MinimumInputLength (decorated, $e, options) {
|
3745 |
+
this.minimumInputLength = options.get('minimumInputLength');
|
3746 |
+
|
3747 |
+
decorated.call(this, $e, options);
|
3748 |
+
}
|
3749 |
+
|
3750 |
+
MinimumInputLength.prototype.query = function (decorated, params, callback) {
|
3751 |
+
params.term = params.term || '';
|
3752 |
+
|
3753 |
+
if (params.term.length < this.minimumInputLength) {
|
3754 |
+
this.trigger('results:message', {
|
3755 |
+
message: 'inputTooShort',
|
3756 |
+
args: {
|
3757 |
+
minimum: this.minimumInputLength,
|
3758 |
+
input: params.term,
|
3759 |
+
params: params
|
3760 |
+
}
|
3761 |
+
});
|
3762 |
+
|
3763 |
+
return;
|
3764 |
+
}
|
3765 |
+
|
3766 |
+
decorated.call(this, params, callback);
|
3767 |
+
};
|
3768 |
+
|
3769 |
+
return MinimumInputLength;
|
3770 |
+
});
|
3771 |
+
|
3772 |
+
S2.define('select2/data/maximumInputLength',[
|
3773 |
+
|
3774 |
+
], function () {
|
3775 |
+
function MaximumInputLength (decorated, $e, options) {
|
3776 |
+
this.maximumInputLength = options.get('maximumInputLength');
|
3777 |
+
|
3778 |
+
decorated.call(this, $e, options);
|
3779 |
+
}
|
3780 |
+
|
3781 |
+
MaximumInputLength.prototype.query = function (decorated, params, callback) {
|
3782 |
+
params.term = params.term || '';
|
3783 |
+
|
3784 |
+
if (this.maximumInputLength > 0 &&
|
3785 |
+
params.term.length > this.maximumInputLength) {
|
3786 |
+
this.trigger('results:message', {
|
3787 |
+
message: 'inputTooLong',
|
3788 |
+
args: {
|
3789 |
+
maximum: this.maximumInputLength,
|
3790 |
+
input: params.term,
|
3791 |
+
params: params
|
3792 |
+
}
|
3793 |
+
});
|
3794 |
+
|
3795 |
+
return;
|
3796 |
+
}
|
3797 |
+
|
3798 |
+
decorated.call(this, params, callback);
|
3799 |
+
};
|
3800 |
+
|
3801 |
+
return MaximumInputLength;
|
3802 |
+
});
|
3803 |
+
|
3804 |
+
S2.define('select2/data/maximumSelectionLength',[
|
3805 |
+
|
3806 |
+
], function (){
|
3807 |
+
function MaximumSelectionLength (decorated, $e, options) {
|
3808 |
+
this.maximumSelectionLength = options.get('maximumSelectionLength');
|
3809 |
+
|
3810 |
+
decorated.call(this, $e, options);
|
3811 |
+
}
|
3812 |
+
|
3813 |
+
MaximumSelectionLength.prototype.query =
|
3814 |
+
function (decorated, params, callback) {
|
3815 |
+
var self = this;
|
3816 |
+
|
3817 |
+
this.current(function (currentData) {
|
3818 |
+
var count = currentData != null ? currentData.length : 0;
|
3819 |
+
if (self.maximumSelectionLength > 0 &&
|
3820 |
+
count >= self.maximumSelectionLength) {
|
3821 |
+
self.trigger('results:message', {
|
3822 |
+
message: 'maximumSelected',
|
3823 |
+
args: {
|
3824 |
+
maximum: self.maximumSelectionLength
|
3825 |
+
}
|
3826 |
+
});
|
3827 |
+
return;
|
3828 |
+
}
|
3829 |
+
decorated.call(self, params, callback);
|
3830 |
+
});
|
3831 |
+
};
|
3832 |
+
|
3833 |
+
return MaximumSelectionLength;
|
3834 |
+
});
|
3835 |
+
|
3836 |
+
S2.define('select2/dropdown',[
|
3837 |
+
'jquery',
|
3838 |
+
'./utils'
|
3839 |
+
], function ($, Utils) {
|
3840 |
+
function Dropdown ($element, options) {
|
3841 |
+
this.$element = $element;
|
3842 |
+
this.options = options;
|
3843 |
+
|
3844 |
+
Dropdown.__super__.constructor.call(this);
|
3845 |
+
}
|
3846 |
+
|
3847 |
+
Utils.Extend(Dropdown, Utils.Observable);
|
3848 |
+
|
3849 |
+
Dropdown.prototype.render = function () {
|
3850 |
+
var $dropdown = $(
|
3851 |
+
'<span class="select2-dropdown">' +
|
3852 |
+
'<span class="select2-results"></span>' +
|
3853 |
+
'</span>'
|
3854 |
+
);
|
3855 |
+
|
3856 |
+
$dropdown.attr('dir', this.options.get('dir'));
|
3857 |
+
|
3858 |
+
this.$dropdown = $dropdown;
|
3859 |
+
|
3860 |
+
return $dropdown;
|
3861 |
+
};
|
3862 |
+
|
3863 |
+
Dropdown.prototype.bind = function () {
|
3864 |
+
// Should be implemented in subclasses
|
3865 |
+
};
|
3866 |
+
|
3867 |
+
Dropdown.prototype.position = function ($dropdown, $container) {
|
3868 |
+
// Should be implmented in subclasses
|
3869 |
+
};
|
3870 |
+
|
3871 |
+
Dropdown.prototype.destroy = function () {
|
3872 |
+
// Remove the dropdown from the DOM
|
3873 |
+
this.$dropdown.remove();
|
3874 |
+
};
|
3875 |
+
|
3876 |
+
return Dropdown;
|
3877 |
+
});
|
3878 |
+
|
3879 |
+
S2.define('select2/dropdown/search',[
|
3880 |
+
'jquery',
|
3881 |
+
'../utils'
|
3882 |
+
], function ($, Utils) {
|
3883 |
+
function Search () { }
|
3884 |
+
|
3885 |
+
Search.prototype.render = function (decorated) {
|
3886 |
+
var $rendered = decorated.call(this);
|
3887 |
+
|
3888 |
+
var $search = $(
|
3889 |
+
'<span class="select2-search select2-search--dropdown">' +
|
3890 |
+
'<input class="select2-search__field" type="search" tabindex="-1"' +
|
3891 |
+
' autocomplete="off" autocorrect="off" autocapitalize="off"' +
|
3892 |
+
' spellcheck="false" role="textbox" />' +
|
3893 |
+
'</span>'
|
3894 |
+
);
|
3895 |
+
|
3896 |
+
this.$searchContainer = $search;
|
3897 |
+
this.$search = $search.find('input');
|
3898 |
+
|
3899 |
+
$rendered.prepend($search);
|
3900 |
+
|
3901 |
+
return $rendered;
|
3902 |
+
};
|
3903 |
+
|
3904 |
+
Search.prototype.bind = function (decorated, container, $container) {
|
3905 |
+
var self = this;
|
3906 |
+
|
3907 |
+
decorated.call(this, container, $container);
|
3908 |
+
|
3909 |
+
this.$search.on('keydown', function (evt) {
|
3910 |
+
self.trigger('keypress', evt);
|
3911 |
+
|
3912 |
+
self._keyUpPrevented = evt.isDefaultPrevented();
|
3913 |
+
});
|
3914 |
+
|
3915 |
+
// Workaround for browsers which do not support the `input` event
|
3916 |
+
// This will prevent double-triggering of events for browsers which support
|
3917 |
+
// both the `keyup` and `input` events.
|
3918 |
+
this.$search.on('input', function (evt) {
|
3919 |
+
// Unbind the duplicated `keyup` event
|
3920 |
+
$(this).off('keyup');
|
3921 |
+
});
|
3922 |
+
|
3923 |
+
this.$search.on('keyup input', function (evt) {
|
3924 |
+
self.handleSearch(evt);
|
3925 |
+
});
|
3926 |
+
|
3927 |
+
container.on('open', function () {
|
3928 |
+
self.$search.attr('tabindex', 0);
|
3929 |
+
|
3930 |
+
self.$search.focus();
|
3931 |
+
|
3932 |
+
window.setTimeout(function () {
|
3933 |
+
self.$search.focus();
|
3934 |
+
}, 0);
|
3935 |
+
});
|
3936 |
+
|
3937 |
+
container.on('close', function () {
|
3938 |
+
self.$search.attr('tabindex', -1);
|
3939 |
+
|
3940 |
+
self.$search.val('');
|
3941 |
+
});
|
3942 |
+
|
3943 |
+
container.on('focus', function () {
|
3944 |
+
if (container.isOpen()) {
|
3945 |
+
self.$search.focus();
|
3946 |
+
}
|
3947 |
+
});
|
3948 |
+
|
3949 |
+
container.on('results:all', function (params) {
|
3950 |
+
if (params.query.term == null || params.query.term === '') {
|
3951 |
+
var showSearch = self.showSearch(params);
|
3952 |
+
|
3953 |
+
if (showSearch) {
|
3954 |
+
self.$searchContainer.removeClass('select2-search--hide');
|
3955 |
+
} else {
|
3956 |
+
self.$searchContainer.addClass('select2-search--hide');
|
3957 |
+
}
|
3958 |
+
}
|
3959 |
+
});
|
3960 |
+
};
|
3961 |
+
|
3962 |
+
Search.prototype.handleSearch = function (evt) {
|
3963 |
+
if (!this._keyUpPrevented) {
|
3964 |
+
var input = this.$search.val();
|
3965 |
+
|
3966 |
+
this.trigger('query', {
|
3967 |
+
term: input
|
3968 |
+
});
|
3969 |
+
}
|
3970 |
+
|
3971 |
+
this._keyUpPrevented = false;
|
3972 |
+
};
|
3973 |
+
|
3974 |
+
Search.prototype.showSearch = function (_, params) {
|
3975 |
+
return true;
|
3976 |
+
};
|
3977 |
+
|
3978 |
+
return Search;
|
3979 |
+
});
|
3980 |
+
|
3981 |
+
S2.define('select2/dropdown/hidePlaceholder',[
|
3982 |
+
|
3983 |
+
], function () {
|
3984 |
+
function HidePlaceholder (decorated, $element, options, dataAdapter) {
|
3985 |
+
this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
|
3986 |
+
|
3987 |
+
decorated.call(this, $element, options, dataAdapter);
|
3988 |
+
}
|
3989 |
+
|
3990 |
+
HidePlaceholder.prototype.append = function (decorated, data) {
|
3991 |
+
data.results = this.removePlaceholder(data.results);
|
3992 |
+
|
3993 |
+
decorated.call(this, data);
|
3994 |
+
};
|
3995 |
+
|
3996 |
+
HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
|
3997 |
+
if (typeof placeholder === 'string') {
|
3998 |
+
placeholder = {
|
3999 |
+
id: '',
|
4000 |
+
text: placeholder
|
4001 |
+
};
|
4002 |
+
}
|
4003 |
+
|
4004 |
+
return placeholder;
|
4005 |
+
};
|
4006 |
+
|
4007 |
+
HidePlaceholder.prototype.removePlaceholder = function (_, data) {
|
4008 |
+
var modifiedData = data.slice(0);
|
4009 |
+
|
4010 |
+
for (var d = data.length - 1; d >= 0; d--) {
|
4011 |
+
var item = data[d];
|
4012 |
+
|
4013 |
+
if (this.placeholder.id === item.id) {
|
4014 |
+
modifiedData.splice(d, 1);
|
4015 |
+
}
|
4016 |
+
}
|
4017 |
+
|
4018 |
+
return modifiedData;
|
4019 |
+
};
|
4020 |
+
|
4021 |
+
return HidePlaceholder;
|
4022 |
+
});
|
4023 |
+
|
4024 |
+
S2.define('select2/dropdown/infiniteScroll',[
|
4025 |
+
'jquery'
|
4026 |
+
], function ($) {
|
4027 |
+
function InfiniteScroll (decorated, $element, options, dataAdapter) {
|
4028 |
+
this.lastParams = {};
|
4029 |
+
|
4030 |
+
decorated.call(this, $element, options, dataAdapter);
|
4031 |
+
|
4032 |
+
this.$loadingMore = this.createLoadingMore();
|
4033 |
+
this.loading = false;
|
4034 |
+
}
|
4035 |
+
|
4036 |
+
InfiniteScroll.prototype.append = function (decorated, data) {
|
4037 |
+
this.$loadingMore.remove();
|
4038 |
+
this.loading = false;
|
4039 |
+
|
4040 |
+
decorated.call(this, data);
|
4041 |
+
|
4042 |
+
if (this.showLoadingMore(data)) {
|
4043 |
+
this.$results.append(this.$loadingMore);
|
4044 |
+
}
|
4045 |
+
};
|
4046 |
+
|
4047 |
+
InfiniteScroll.prototype.bind = function (decorated, container, $container) {
|
4048 |
+
var self = this;
|
4049 |
+
|
4050 |
+
decorated.call(this, container, $container);
|
4051 |
+
|
4052 |
+
container.on('query', function (params) {
|
4053 |
+
self.lastParams = params;
|
4054 |
+
self.loading = true;
|
4055 |
+
});
|
4056 |
+
|
4057 |
+
container.on('query:append', function (params) {
|
4058 |
+
self.lastParams = params;
|
4059 |
+
self.loading = true;
|
4060 |
+
});
|
4061 |
+
|
4062 |
+
this.$results.on('scroll', function () {
|
4063 |
+
var isLoadMoreVisible = $.contains(
|
4064 |
+
document.documentElement,
|
4065 |
+
self.$loadingMore[0]
|
4066 |
+
);
|
4067 |
+
|
4068 |
+
if (self.loading || !isLoadMoreVisible) {
|
4069 |
+
return;
|
4070 |
+
}
|
4071 |
+
|
4072 |
+
var currentOffset = self.$results.offset().top +
|
4073 |
+
self.$results.outerHeight(false);
|
4074 |
+
var loadingMoreOffset = self.$loadingMore.offset().top +
|
4075 |
+
self.$loadingMore.outerHeight(false);
|
4076 |
+
|
4077 |
+
if (currentOffset + 50 >= loadingMoreOffset) {
|
4078 |
+
self.loadMore();
|
4079 |
+
}
|
4080 |
+
});
|
4081 |
+
};
|
4082 |
+
|
4083 |
+
InfiniteScroll.prototype.loadMore = function () {
|
4084 |
+
this.loading = true;
|
4085 |
+
|
4086 |
+
var params = $.extend({}, {page: 1}, this.lastParams);
|
4087 |
+
|
4088 |
+
params.page++;
|
4089 |
+
|
4090 |
+
this.trigger('query:append', params);
|
4091 |
+
};
|
4092 |
+
|
4093 |
+
InfiniteScroll.prototype.showLoadingMore = function (_, data) {
|
4094 |
+
return data.pagination && data.pagination.more;
|
4095 |
+
};
|
4096 |
+
|
4097 |
+
InfiniteScroll.prototype.createLoadingMore = function () {
|
4098 |
+
var $option = $(
|
4099 |
+
'<li ' +
|
4100 |
+
'class="select2-results__option select2-results__option--load-more"' +
|
4101 |
+
'role="treeitem" aria-disabled="true"></li>'
|
4102 |
+
);
|
4103 |
+
|
4104 |
+
var message = this.options.get('translations').get('loadingMore');
|
4105 |
+
|
4106 |
+
$option.html(message(this.lastParams));
|
4107 |
+
|
4108 |
+
return $option;
|
4109 |
+
};
|
4110 |
+
|
4111 |
+
return InfiniteScroll;
|
4112 |
+
});
|
4113 |
+
|
4114 |
+
S2.define('select2/dropdown/attachBody',[
|
4115 |
+
'jquery',
|
4116 |
+
'../utils'
|
4117 |
+
], function ($, Utils) {
|
4118 |
+
function AttachBody (decorated, $element, options) {
|
4119 |
+
this.$dropdownParent = options.get('dropdownParent') || $(document.body);
|
4120 |
+
|
4121 |
+
decorated.call(this, $element, options);
|
4122 |
+
}
|
4123 |
+
|
4124 |
+
AttachBody.prototype.bind = function (decorated, container, $container) {
|
4125 |
+
var self = this;
|
4126 |
+
|
4127 |
+
var setupResultsEvents = false;
|
4128 |
+
|
4129 |
+
decorated.call(this, container, $container);
|
4130 |
+
|
4131 |
+
container.on('open', function () {
|
4132 |
+
self._showDropdown();
|
4133 |
+
self._attachPositioningHandler(container);
|
4134 |
+
|
4135 |
+
if (!setupResultsEvents) {
|
4136 |
+
setupResultsEvents = true;
|
4137 |
+
|
4138 |
+
container.on('results:all', function () {
|
4139 |
+
self._positionDropdown();
|
4140 |
+
self._resizeDropdown();
|
4141 |
+
});
|
4142 |
+
|
4143 |
+
container.on('results:append', function () {
|
4144 |
+
self._positionDropdown();
|
4145 |
+
self._resizeDropdown();
|
4146 |
+
});
|
4147 |
+
}
|
4148 |
+
});
|
4149 |
+
|
4150 |
+
container.on('close', function () {
|
4151 |
+
self._hideDropdown();
|
4152 |
+
self._detachPositioningHandler(container);
|
4153 |
+
});
|
4154 |
+
|
4155 |
+
this.$dropdownContainer.on('mousedown', function (evt) {
|
4156 |
+
evt.stopPropagation();
|
4157 |
+
});
|
4158 |
+
};
|
4159 |
+
|
4160 |
+
AttachBody.prototype.destroy = function (decorated) {
|
4161 |
+
decorated.call(this);
|
4162 |
+
|
4163 |
+
this.$dropdownContainer.remove();
|
4164 |
+
};
|
4165 |
+
|
4166 |
+
AttachBody.prototype.position = function (decorated, $dropdown, $container) {
|
4167 |
+
// Clone all of the container classes
|
4168 |
+
$dropdown.attr('class', $container.attr('class'));
|
4169 |
+
|
4170 |
+
$dropdown.removeClass('select2');
|
4171 |
+
$dropdown.addClass('select2-container--open');
|
4172 |
+
|
4173 |
+
$dropdown.css({
|
4174 |
+
position: 'absolute',
|
4175 |
+
top: -999999
|
4176 |
+
});
|
4177 |
+
|
4178 |
+
this.$container = $container;
|
4179 |
+
};
|
4180 |
+
|
4181 |
+
AttachBody.prototype.render = function (decorated) {
|
4182 |
+
var $container = $('<span></span>');
|
4183 |
+
|
4184 |
+
var $dropdown = decorated.call(this);
|
4185 |
+
$container.append($dropdown);
|
4186 |
+
|
4187 |
+
this.$dropdownContainer = $container;
|
4188 |
+
|
4189 |
+
return $container;
|
4190 |
+
};
|
4191 |
+
|
4192 |
+
AttachBody.prototype._hideDropdown = function (decorated) {
|
4193 |
+
this.$dropdownContainer.detach();
|
4194 |
+
};
|
4195 |
+
|
4196 |
+
AttachBody.prototype._attachPositioningHandler =
|
4197 |
+
function (decorated, container) {
|
4198 |
+
var self = this;
|
4199 |
+
|
4200 |
+
var scrollEvent = 'scroll.select2.' + container.id;
|
4201 |
+
var resizeEvent = 'resize.select2.' + container.id;
|
4202 |
+
var orientationEvent = 'orientationchange.select2.' + container.id;
|
4203 |
+
|
4204 |
+
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4205 |
+
$watchers.each(function () {
|
4206 |
+
$(this).data('select2-scroll-position', {
|
4207 |
+
x: $(this).scrollLeft(),
|
4208 |
+
y: $(this).scrollTop()
|
4209 |
+
});
|
4210 |
+
});
|
4211 |
+
|
4212 |
+
$watchers.on(scrollEvent, function (ev) {
|
4213 |
+
var position = $(this).data('select2-scroll-position');
|
4214 |
+
$(this).scrollTop(position.y);
|
4215 |
+
});
|
4216 |
+
|
4217 |
+
$(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
|
4218 |
+
function (e) {
|
4219 |
+
self._positionDropdown();
|
4220 |
+
self._resizeDropdown();
|
4221 |
+
});
|
4222 |
+
};
|
4223 |
+
|
4224 |
+
AttachBody.prototype._detachPositioningHandler =
|
4225 |
+
function (decorated, container) {
|
4226 |
+
var scrollEvent = 'scroll.select2.' + container.id;
|
4227 |
+
var resizeEvent = 'resize.select2.' + container.id;
|
4228 |
+
var orientationEvent = 'orientationchange.select2.' + container.id;
|
4229 |
+
|
4230 |
+
var $watchers = this.$container.parents().filter(Utils.hasScroll);
|
4231 |
+
$watchers.off(scrollEvent);
|
4232 |
+
|
4233 |
+
$(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
|
4234 |
+
};
|
4235 |
+
|
4236 |
+
AttachBody.prototype._positionDropdown = function () {
|
4237 |
+
var $window = $(window);
|
4238 |
+
|
4239 |
+
var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
|
4240 |
+
var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
|
4241 |
+
|
4242 |
+
var newDirection = null;
|
4243 |
+
|
4244 |
+
var offset = this.$container.offset();
|
4245 |
+
|
4246 |
+
offset.bottom = offset.top + this.$container.outerHeight(false);
|
4247 |
+
|
4248 |
+
var container = {
|
4249 |
+
height: this.$container.outerHeight(false)
|
4250 |
+
};
|
4251 |
+
|
4252 |
+
container.top = offset.top;
|
4253 |
+
container.bottom = offset.top + container.height;
|
4254 |
+
|
4255 |
+
var dropdown = {
|
4256 |
+
height: this.$dropdown.outerHeight(false)
|
4257 |
+
};
|
4258 |
+
|
4259 |
+
var viewport = {
|
4260 |
+
top: $window.scrollTop(),
|
4261 |
+
bottom: $window.scrollTop() + $window.height()
|
4262 |
+
};
|
4263 |
+
|
4264 |
+
var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
|
4265 |
+
var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
|
4266 |
+
|
4267 |
+
var css = {
|
4268 |
+
left: offset.left,
|
4269 |
+
top: container.bottom
|
4270 |
+
};
|
4271 |
+
|
4272 |
+
// Determine what the parent element is to use for calciulating the offset
|
4273 |
+
var $offsetParent = this.$dropdownParent;
|
4274 |
+
|
4275 |
+
// For statically positoned elements, we need to get the element
|
4276 |
+
// that is determining the offset
|
4277 |
+
if ($offsetParent.css('position') === 'static') {
|
4278 |
+
$offsetParent = $offsetParent.offsetParent();
|
4279 |
+
}
|
4280 |
+
|
4281 |
+
var parentOffset = $offsetParent.offset();
|
4282 |
+
|
4283 |
+
css.top -= parentOffset.top;
|
4284 |
+
css.left -= parentOffset.left;
|
4285 |
+
|
4286 |
+
if (!isCurrentlyAbove && !isCurrentlyBelow) {
|
4287 |
+
newDirection = 'below';
|
4288 |
+
}
|
4289 |
+
|
4290 |
+
if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
|
4291 |
+
newDirection = 'above';
|
4292 |
+
} else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
|
4293 |
+
newDirection = 'below';
|
4294 |
+
}
|
4295 |
+
|
4296 |
+
if (newDirection == 'above' ||
|
4297 |
+
(isCurrentlyAbove && newDirection !== 'below')) {
|
4298 |
+
css.top = container.top - parentOffset.top - dropdown.height;
|
4299 |
+
}
|
4300 |
+
|
4301 |
+
if (newDirection != null) {
|
4302 |
+
this.$dropdown
|
4303 |
+
.removeClass('select2-dropdown--below select2-dropdown--above')
|
4304 |
+
.addClass('select2-dropdown--' + newDirection);
|
4305 |
+
this.$container
|
4306 |
+
.removeClass('select2-container--below select2-container--above')
|
4307 |
+
.addClass('select2-container--' + newDirection);
|
4308 |
+
}
|
4309 |
+
|
4310 |
+
this.$dropdownContainer.css(css);
|
4311 |
+
};
|
4312 |
+
|
4313 |
+
AttachBody.prototype._resizeDropdown = function () {
|
4314 |
+
var css = {
|
4315 |
+
width: this.$container.outerWidth(false) + 'px'
|
4316 |
+
};
|
4317 |
+
|
4318 |
+
if (this.options.get('dropdownAutoWidth')) {
|
4319 |
+
css.minWidth = css.width;
|
4320 |
+
css.position = 'relative';
|
4321 |
+
css.width = 'auto';
|
4322 |
+
}
|
4323 |
+
|
4324 |
+
this.$dropdown.css(css);
|
4325 |
+
};
|
4326 |
+
|
4327 |
+
AttachBody.prototype._showDropdown = function (decorated) {
|
4328 |
+
this.$dropdownContainer.appendTo(this.$dropdownParent);
|
4329 |
+
|
4330 |
+
this._positionDropdown();
|
4331 |
+
this._resizeDropdown();
|
4332 |
+
};
|
4333 |
+
|
4334 |
+
return AttachBody;
|
4335 |
+
});
|
4336 |
+
|
4337 |
+
S2.define('select2/dropdown/minimumResultsForSearch',[
|
4338 |
+
|
4339 |
+
], function () {
|
4340 |
+
function countResults (data) {
|
4341 |
+
var count = 0;
|
4342 |
+
|
4343 |
+
for (var d = 0; d < data.length; d++) {
|
4344 |
+
var item = data[d];
|
4345 |
+
|
4346 |
+
if (item.children) {
|
4347 |
+
count += countResults(item.children);
|
4348 |
+
} else {
|
4349 |
+
count++;
|
4350 |
+
}
|
4351 |
+
}
|
4352 |
+
|
4353 |
+
return count;
|
4354 |
+
}
|
4355 |
+
|
4356 |
+
function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
|
4357 |
+
this.minimumResultsForSearch = options.get('minimumResultsForSearch');
|
4358 |
+
|
4359 |
+
if (this.minimumResultsForSearch < 0) {
|
4360 |
+
this.minimumResultsForSearch = Infinity;
|
4361 |
+
}
|
4362 |
+
|
4363 |
+
decorated.call(this, $element, options, dataAdapter);
|
4364 |
+
}
|
4365 |
+
|
4366 |
+
MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
|
4367 |
+
if (countResults(params.data.results) < this.minimumResultsForSearch) {
|
4368 |
+
return false;
|
4369 |
+
}
|
4370 |
+
|
4371 |
+
return decorated.call(this, params);
|
4372 |
+
};
|
4373 |
+
|
4374 |
+
return MinimumResultsForSearch;
|
4375 |
+
});
|
4376 |
+
|
4377 |
+
S2.define('select2/dropdown/selectOnClose',[
|
4378 |
+
|
4379 |
+
], function () {
|
4380 |
+
function SelectOnClose () { }
|
4381 |
+
|
4382 |
+
SelectOnClose.prototype.bind = function (decorated, container, $container) {
|
4383 |
+
var self = this;
|
4384 |
+
|
4385 |
+
decorated.call(this, container, $container);
|
4386 |
+
|
4387 |
+
container.on('close', function (params) {
|
4388 |
+
self._handleSelectOnClose(params);
|
4389 |
+
});
|
4390 |
+
};
|
4391 |
+
|
4392 |
+
SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
|
4393 |
+
if (params && params.originalSelect2Event != null) {
|
4394 |
+
var event = params.originalSelect2Event;
|
4395 |
+
|
4396 |
+
// Don't select an item if the close event was triggered from a select or
|
4397 |
+
// unselect event
|
4398 |
+
if (event._type === 'select' || event._type === 'unselect') {
|
4399 |
+
return;
|
4400 |
+
}
|
4401 |
+
}
|
4402 |
+
|
4403 |
+
var $highlightedResults = this.getHighlightedResults();
|
4404 |
+
|
4405 |
+
// Only select highlighted results
|
4406 |
+
if ($highlightedResults.length < 1) {
|
4407 |
+
return;
|
4408 |
+
}
|
4409 |
+
|
4410 |
+
var data = $highlightedResults.data('data');
|
4411 |
+
|
4412 |
+
// Don't re-select already selected resulte
|
4413 |
+
if (
|
4414 |
+
(data.element != null && data.element.selected) ||
|
4415 |
+
(data.element == null && data.selected)
|
4416 |
+
) {
|
4417 |
+
return;
|
4418 |
+
}
|
4419 |
+
|
4420 |
+
this.trigger('select', {
|
4421 |
+
data: data
|
4422 |
+
});
|
4423 |
+
};
|
4424 |
+
|
4425 |
+
return SelectOnClose;
|
4426 |
+
});
|
4427 |
+
|
4428 |
+
S2.define('select2/dropdown/closeOnSelect',[
|
4429 |
+
|
4430 |
+
], function () {
|
4431 |
+
function CloseOnSelect () { }
|
4432 |
+
|
4433 |
+
CloseOnSelect.prototype.bind = function (decorated, container, $container) {
|
4434 |
+
var self = this;
|
4435 |
+
|
4436 |
+
decorated.call(this, container, $container);
|
4437 |
+
|
4438 |
+
container.on('select', function (evt) {
|
4439 |
+
self._selectTriggered(evt);
|
4440 |
+
});
|
4441 |
+
|
4442 |
+
container.on('unselect', function (evt) {
|
4443 |
+
self._selectTriggered(evt);
|
4444 |
+
});
|
4445 |
+
};
|
4446 |
+
|
4447 |
+
CloseOnSelect.prototype._selectTriggered = function (_, evt) {
|
4448 |
+
var originalEvent = evt.originalEvent;
|
4449 |
+
|
4450 |
+
// Don't close if the control key is being held
|
4451 |
+
if (originalEvent && originalEvent.ctrlKey) {
|
4452 |
+
return;
|
4453 |
+
}
|
4454 |
+
|
4455 |
+
this.trigger('close', {
|
4456 |
+
originalEvent: originalEvent,
|
4457 |
+
originalSelect2Event: evt
|
4458 |
+
});
|
4459 |
+
};
|
4460 |
+
|
4461 |
+
return CloseOnSelect;
|
4462 |
+
});
|
4463 |
+
|
4464 |
+
S2.define('select2/i18n/en',[],function () {
|
4465 |
+
// English
|
4466 |
+
return {
|
4467 |
+
errorLoading: function () {
|
4468 |
+
return 'The results could not be loaded.';
|
4469 |
+
},
|
4470 |
+
inputTooLong: function (args) {
|
4471 |
+
var overChars = args.input.length - args.maximum;
|
4472 |
+
|
4473 |
+
var message = 'Please delete ' + overChars + ' character';
|
4474 |
+
|
4475 |
+
if (overChars != 1) {
|
4476 |
+
message += 's';
|
4477 |
+
}
|
4478 |
+
|
4479 |
+
return message;
|
4480 |
+
},
|
4481 |
+
inputTooShort: function (args) {
|
4482 |
+
var remainingChars = args.minimum - args.input.length;
|
4483 |
+
|
4484 |
+
var message = 'Please enter ' + remainingChars + ' or more characters';
|
4485 |
+
|
4486 |
+
return message;
|
4487 |
+
},
|
4488 |
+
loadingMore: function () {
|
4489 |
+
return 'Loading more results…';
|
4490 |
+
},
|
4491 |
+
maximumSelected: function (args) {
|
4492 |
+
var message = 'You can only select ' + args.maximum + ' item';
|
4493 |
+
|
4494 |
+
if (args.maximum != 1) {
|
4495 |
+
message += 's';
|
4496 |
+
}
|
4497 |
+
|
4498 |
+
return message;
|
4499 |
+
},
|
4500 |
+
noResults: function () {
|
4501 |
+
return 'No results found';
|
4502 |
+
},
|
4503 |
+
searching: function () {
|
4504 |
+
return 'Searching…';
|
4505 |
+
}
|
4506 |
+
};
|
4507 |
+
});
|
4508 |
+
|
4509 |
+
S2.define('select2/defaults',[
|
4510 |
+
'jquery',
|
4511 |
+
'require',
|
4512 |
+
|
4513 |
+
'./results',
|
4514 |
+
|
4515 |
+
'./selection/single',
|
4516 |
+
'./selection/multiple',
|
4517 |
+
'./selection/placeholder',
|
4518 |
+
'./selection/allowClear',
|
4519 |
+
'./selection/search',
|
4520 |
+
'./selection/eventRelay',
|
4521 |
+
|
4522 |
+
'./utils',
|
4523 |
+
'./translation',
|
4524 |
+
'./diacritics',
|
4525 |
+
|
4526 |
+
'./data/select',
|
4527 |
+
'./data/array',
|
4528 |
+
'./data/ajax',
|
4529 |
+
'./data/tags',
|
4530 |
+
'./data/tokenizer',
|
4531 |
+
'./data/minimumInputLength',
|
4532 |
+
'./data/maximumInputLength',
|
4533 |
+
'./data/maximumSelectionLength',
|
4534 |
+
|
4535 |
+
'./dropdown',
|
4536 |
+
'./dropdown/search',
|
4537 |
+
'./dropdown/hidePlaceholder',
|
4538 |
+
'./dropdown/infiniteScroll',
|
4539 |
+
'./dropdown/attachBody',
|
4540 |
+
'./dropdown/minimumResultsForSearch',
|
4541 |
+
'./dropdown/selectOnClose',
|
4542 |
+
'./dropdown/closeOnSelect',
|
4543 |
+
|
4544 |
+
'./i18n/en'
|
4545 |
+
], function ($, require,
|
4546 |
+
|
4547 |
+
ResultsList,
|
4548 |
+
|
4549 |
+
SingleSelection, MultipleSelection, Placeholder, AllowClear,
|
4550 |
+
SelectionSearch, EventRelay,
|
4551 |
+
|
4552 |
+
Utils, Translation, DIACRITICS,
|
4553 |
+
|
4554 |
+
SelectData, ArrayData, AjaxData, Tags, Tokenizer,
|
4555 |
+
MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
|
4556 |
+
|
4557 |
+
Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
|
4558 |
+
AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
|
4559 |
+
|
4560 |
+
EnglishTranslation) {
|
4561 |
+
function Defaults () {
|
4562 |
+
this.reset();
|
4563 |
+
}
|
4564 |
+
|
4565 |
+
Defaults.prototype.apply = function (options) {
|
4566 |
+
options = $.extend(true, {}, this.defaults, options);
|
4567 |
+
|
4568 |
+
if (options.dataAdapter == null) {
|
4569 |
+
if (options.ajax != null) {
|
4570 |
+
options.dataAdapter = AjaxData;
|
4571 |
+
} else if (options.data != null) {
|
4572 |
+
options.dataAdapter = ArrayData;
|
4573 |
+
} else {
|
4574 |
+
options.dataAdapter = SelectData;
|
4575 |
+
}
|
4576 |
+
|
4577 |
+
if (options.minimumInputLength > 0) {
|
4578 |
+
options.dataAdapter = Utils.Decorate(
|
4579 |
+
options.dataAdapter,
|
4580 |
+
MinimumInputLength
|
4581 |
+
);
|
4582 |
+
}
|
4583 |
+
|
4584 |
+
if (options.maximumInputLength > 0) {
|
4585 |
+
options.dataAdapter = Utils.Decorate(
|
4586 |
+
options.dataAdapter,
|
4587 |
+
MaximumInputLength
|
4588 |
+
);
|
4589 |
+
}
|
4590 |
+
|
4591 |
+
if (options.maximumSelectionLength > 0) {
|
4592 |
+
options.dataAdapter = Utils.Decorate(
|
4593 |
+
options.dataAdapter,
|
4594 |
+
MaximumSelectionLength
|
4595 |
+
);
|
4596 |
+
}
|
4597 |
+
|
4598 |
+
if (options.tags) {
|
4599 |
+
options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
|
4600 |
+
}
|
4601 |
+
|
4602 |
+
if (options.tokenSeparators != null || options.tokenizer != null) {
|
4603 |
+
options.dataAdapter = Utils.Decorate(
|
4604 |
+
options.dataAdapter,
|
4605 |
+
Tokenizer
|
4606 |
+
);
|
4607 |
+
}
|
4608 |
+
|
4609 |
+
if (options.query != null) {
|
4610 |
+
var Query = require(options.amdBase + 'compat/query');
|
4611 |
+
|
4612 |
+
options.dataAdapter = Utils.Decorate(
|
4613 |
+
options.dataAdapter,
|
4614 |
+
Query
|
4615 |
+
);
|
4616 |
+
}
|
4617 |
+
|
4618 |
+
if (options.initSelection != null) {
|
4619 |
+
var InitSelection = require(options.amdBase + 'compat/initSelection');
|
4620 |
+
|
4621 |
+
options.dataAdapter = Utils.Decorate(
|
4622 |
+
options.dataAdapter,
|
4623 |
+
InitSelection
|
4624 |
+
);
|
4625 |
+
}
|
4626 |
+
}
|
4627 |
+
|
4628 |
+
if (options.resultsAdapter == null) {
|
4629 |
+
options.resultsAdapter = ResultsList;
|
4630 |
+
|
4631 |
+
if (options.ajax != null) {
|
4632 |
+
options.resultsAdapter = Utils.Decorate(
|
4633 |
+
options.resultsAdapter,
|
4634 |
+
InfiniteScroll
|
4635 |
+
);
|
4636 |
+
}
|
4637 |
+
|
4638 |
+
if (options.placeholder != null) {
|
4639 |
+
options.resultsAdapter = Utils.Decorate(
|
4640 |
+
options.resultsAdapter,
|
4641 |
+
HidePlaceholder
|
4642 |
+
);
|
4643 |
+
}
|
4644 |
+
|
4645 |
+
if (options.selectOnClose) {
|
4646 |
+
options.resultsAdapter = Utils.Decorate(
|
4647 |
+
options.resultsAdapter,
|
4648 |
+
SelectOnClose
|
4649 |
+
);
|
4650 |
+
}
|
4651 |
+
}
|
4652 |
+
|
4653 |
+
if (options.dropdownAdapter == null) {
|
4654 |
+
if (options.multiple) {
|
4655 |
+
options.dropdownAdapter = Dropdown;
|
4656 |
+
} else {
|
4657 |
+
var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
|
4658 |
+
|
4659 |
+
options.dropdownAdapter = SearchableDropdown;
|
4660 |
+
}
|
4661 |
+
|
4662 |
+
if (options.minimumResultsForSearch !== 0) {
|
4663 |
+
options.dropdownAdapter = Utils.Decorate(
|
4664 |
+
options.dropdownAdapter,
|
4665 |
+
MinimumResultsForSearch
|
4666 |
+
);
|
4667 |
+
}
|
4668 |
+
|
4669 |
+
if (options.closeOnSelect) {
|
4670 |
+
options.dropdownAdapter = Utils.Decorate(
|
4671 |
+
options.dropdownAdapter,
|
4672 |
+
CloseOnSelect
|
4673 |
+
);
|
4674 |
+
}
|
4675 |
+
|
4676 |
+
if (
|
4677 |
+
options.dropdownCssClass != null ||
|
4678 |
+
options.dropdownCss != null ||
|
4679 |
+
options.adaptDropdownCssClass != null
|
4680 |
+
) {
|
4681 |
+
var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
|
4682 |
+
|
4683 |
+
options.dropdownAdapter = Utils.Decorate(
|
4684 |
+
options.dropdownAdapter,
|
4685 |
+
DropdownCSS
|
4686 |
+
);
|
4687 |
+
}
|
4688 |
+
|
4689 |
+
options.dropdownAdapter = Utils.Decorate(
|
4690 |
+
options.dropdownAdapter,
|
4691 |
+
AttachBody
|
4692 |
+
);
|
4693 |
+
}
|
4694 |
+
|
4695 |
+
if (options.selectionAdapter == null) {
|
4696 |
+
if (options.multiple) {
|
4697 |
+
options.selectionAdapter = MultipleSelection;
|
4698 |
+
} else {
|
4699 |
+
options.selectionAdapter = SingleSelection;
|
4700 |
+
}
|
4701 |
+
|
4702 |
+
// Add the placeholder mixin if a placeholder was specified
|
4703 |
+
if (options.placeholder != null) {
|
4704 |
+
options.selectionAdapter = Utils.Decorate(
|
4705 |
+
options
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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