Version Description
- Changes in all versions:
- Improvement Added primary key to booking dates table for correct working at wordpress.com (8.7.9.1)
- Improvement updated "Chosen" library from 0.9.7 to 1.8.7 (8.7.9.8)
- Improvement updated "jquery.meio.mask" library from 1.1.3 to 1.1.14 (8.7.9.10)
- Fix. Issue of incorrectly showing new booking icon (8.7.9.6)
- Fix. Issue in mobile devices at Timeline of showing the booking details in mouse over tooltip intersected with booking labels (8.7.9.4)
- Fix. Issue of sending emails, while the checkbox "Emails sending" was unchecked (8.7.9.4)
- Fix. Showing deprecated message: ../core/any/js/admin-support.js: jQuery.fn.load() is deprecated (8.7.9.7)
- Fix. Showing deprecated message: ../assets/libs/chosen/chosen.jquery.min.js: jQuery.browser is deprecated (8.7.9.9)
- Fix. Showing deprecated message: ../inc/js/jquery.meio.mask.min.js: jQuery.browser is deprecated (8.7.9.11)
- Fix. Showing deprecated message: ../js/wpbc-migrate.js: jQuery.browser is deprecated. Removed the wpbc-migrate script, it's does not require anymore. (8.7.9.12)
- Changes in Personal / Business Small / Business Medium / Business Large / MultiUser versions:
- Improvement Replaced stripe library from 6.33.0 to 7.46.1 (8.7.9.2) (Business Small/Medium/Large, MultiUser)
- Fix. Issue of showing error "Unknown-Stripe-Payment" during Stripe payments for the booking resources that belong to "regular users" in Booking Calendar MultiUser version (8.7.9.3) (MultiUser)
Download this release
Release Info
Developer | wpdevelop |
Plugin | Booking Calendar |
Version | 8.7.9 |
Comparing to | |
See all releases |
Code changes from version 8.7.8 to 8.7.9
- assets/libs/chosen/LICENSE.md +4 -5
- assets/libs/chosen/chosen-sprite.png +0 -0
- assets/libs/chosen/chosen-sprite@2x.png +0 -0
- assets/libs/chosen/chosen.css +369 -257
- assets/libs/chosen/chosen.jquery.js +929 -516
- assets/libs/chosen/chosen.jquery.min.js +2 -9
- assets/libs/chosen/chosen.min.css +11 -0
- assets/libs/chosen/chosen.proto.js +1401 -0
- assets/libs/chosen/chosen.proto.min.js +3 -0
- assets/libs/chosen/index.php +0 -3
- core/admin/wpbc-class-listing.php +1 -1
- core/admin/wpbc-toolbars.php +637 -636
- core/any/css/admin-listing-table.css +4 -1
- core/any/js/admin-support.js +2 -1
- core/timeline/v2/css/timeline_v2.css +2 -1
- core/timeline/v2/wpbc-class-timeline_v2.php +4 -2
- core/wpbc-activation.php +4 -1
- core/wpbc-js.php +1 -2
- js/admin.js +9 -9
- js/client.js +4 -5
- js/wpbc-migrate.js +0 -83
- languages/booking-nl_NL.mo +0 -0
- readme.txt +17 -1
- wpdev-booking.php +2 -2
assets/libs/chosen/LICENSE.md
CHANGED
@@ -1,10 +1,9 @@
|
|
1 |
-
|
2 |
-
|
|
|
3 |
|
4 |
Available for use under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
|
5 |
|
6 |
-
Copyright (c) 2011 by Harvest
|
7 |
-
|
8 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
9 |
of this software and associated documentation files (the "Software"), to deal
|
10 |
in the Software without restriction, including without limitation the rights
|
@@ -21,4 +20,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
21 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
22 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
23 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
24 |
-
THE SOFTWARE.
|
1 |
+
#### Chosen
|
2 |
+
- by Patrick Filler for [Harvest](http://getharvest.com)
|
3 |
+
- Copyright (c) 2011-2016 by Harvest
|
4 |
|
5 |
Available for use under the [MIT License](http://en.wikipedia.org/wiki/MIT_License)
|
6 |
|
|
|
|
|
7 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
8 |
of this software and associated documentation files (the "Software"), to deal
|
9 |
in the Software without restriction, including without limitation the rights
|
20 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
21 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
22 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
23 |
+
THE SOFTWARE.
|
assets/libs/chosen/chosen-sprite.png
CHANGED
Binary file
|
assets/libs/chosen/chosen-sprite@2x.png
ADDED
Binary file
|
assets/libs/chosen/chosen.css
CHANGED
@@ -1,389 +1,501 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
/* @group Base */
|
2 |
.chzn-container {
|
3 |
-
font-size: 13px;
|
4 |
position: relative;
|
5 |
display: inline-block;
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
}
|
|
|
9 |
.chzn-container .chzn-drop {
|
10 |
-
|
|
|
|
|
|
|
11 |
border: 1px solid #aaa;
|
12 |
border-top: 0;
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
-
|
18 |
-
|
19 |
-
box-shadow : 0 4px 5px rgba(0,0,0,.15);
|
20 |
-
z-index: 999;
|
21 |
}
|
22 |
-
/* @end */
|
23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24 |
/* @group Single Chosen */
|
25 |
.chzn-container-single .chzn-single {
|
26 |
-
|
27 |
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#eeeeee', GradientType=0 );
|
28 |
-
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #ffffff), color-stop(50%, #f6f6f6), color-stop(52%, #eeeeee), color-stop(100%, #f4f4f4));
|
29 |
-
background-image: -webkit-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
30 |
-
background-image: -moz-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
31 |
-
background-image: -o-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
32 |
-
background-image: -ms-linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
33 |
-
background-image: linear-gradient(top, #ffffff 20%, #f6f6f6 50%, #eeeeee 52%, #f4f4f4 100%);
|
34 |
-
-webkit-border-radius: 5px;
|
35 |
-
-moz-border-radius : 5px;
|
36 |
-
border-radius : 5px;
|
37 |
-
-moz-background-clip : padding;
|
38 |
-
-webkit-background-clip: padding-box;
|
39 |
-
background-clip : padding-box;
|
40 |
-
border: 1px solid #aaaaaa;
|
41 |
-
-webkit-box-shadow: 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
|
42 |
-
-moz-box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
|
43 |
-
box-shadow : 0 0 3px #ffffff inset, 0 1px 1px rgba(0,0,0,0.1);
|
44 |
display: block;
|
45 |
overflow: hidden;
|
46 |
-
white-space: nowrap;
|
47 |
-
position: relative;
|
48 |
-
height: 23px;
|
49 |
-
line-height: 24px;
|
50 |
padding: 0 0 0 8px;
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
text-decoration: none;
|
|
|
|
|
53 |
}
|
|
|
|
|
|
|
|
|
|
|
54 |
.chzn-container-single .chzn-single span {
|
55 |
-
margin-right: 26px;
|
56 |
display: block;
|
57 |
overflow: hidden;
|
58 |
-
|
59 |
-
-o-text-overflow: ellipsis;
|
60 |
-
-ms-text-overflow: ellipsis;
|
61 |
text-overflow: ellipsis;
|
|
|
|
|
|
|
|
|
|
|
62 |
}
|
|
|
63 |
.chzn-container-single .chzn-single abbr {
|
64 |
-
display: block;
|
65 |
position: absolute;
|
66 |
-
right: 26px;
|
67 |
top: 6px;
|
|
|
|
|
68 |
width: 12px;
|
69 |
-
height:
|
|
|
70 |
font-size: 1px;
|
71 |
-
background: url(chosen-sprite.png) right top no-repeat;
|
72 |
}
|
|
|
73 |
.chzn-container-single .chzn-single abbr:hover {
|
74 |
-
background-position:
|
|
|
|
|
|
|
|
|
75 |
}
|
|
|
76 |
.chzn-container-single .chzn-single div {
|
77 |
position: absolute;
|
78 |
-
right: 0;
|
79 |
top: 0;
|
|
|
80 |
display: block;
|
81 |
-
height: 100%;
|
82 |
width: 18px;
|
|
|
83 |
}
|
|
|
84 |
.chzn-container-single .chzn-single div b {
|
85 |
-
background: url('chosen-sprite.png') no-repeat 0 0;
|
86 |
display: block;
|
87 |
width: 100%;
|
88 |
height: 100%;
|
|
|
89 |
}
|
|
|
90 |
.chzn-container-single .chzn-search {
|
91 |
-
padding: 3px 4px;
|
92 |
position: relative;
|
|
|
93 |
margin: 0;
|
|
|
94 |
white-space: nowrap;
|
95 |
-
z-index: 1010;
|
96 |
}
|
97 |
-
|
98 |
-
|
99 |
-
background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
|
100 |
-
background: url('chosen-sprite.png') no-repeat 100% -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
101 |
-
background: url('chosen-sprite.png') no-repeat 100% -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
102 |
-
background: url('chosen-sprite.png') no-repeat 100% -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
103 |
-
background: url('chosen-sprite.png') no-repeat 100% -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
104 |
-
background: url('chosen-sprite.png') no-repeat 100% -22px, linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
105 |
margin: 1px 0;
|
106 |
padding: 4px 20px 4px 5px;
|
|
|
|
|
107 |
outline: 0;
|
108 |
border: 1px solid #aaa;
|
109 |
-
|
110 |
font-size: 1em;
|
|
|
|
|
|
|
111 |
}
|
|
|
112 |
.chzn-container-single .chzn-drop {
|
113 |
-
-
|
114 |
-
|
115 |
-
|
116 |
-
-moz-background-clip : padding;
|
117 |
-
-webkit-background-clip: padding-box;
|
118 |
-
background-clip : padding-box;
|
119 |
}
|
120 |
-
/* @end */
|
121 |
|
122 |
-
.chzn-container-single-nosearch .chzn-search
|
123 |
position: absolute;
|
124 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
125 |
}
|
126 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
127 |
/* @group Multi Chosen */
|
128 |
.chzn-container-multi .chzn-choices {
|
129 |
-
|
130 |
-
|
131 |
-
background-image: -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
132 |
-
background-image: -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
133 |
-
background-image: -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
134 |
-
background-image: -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
135 |
-
background-image: linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
136 |
-
border: 1px solid #aaa;
|
137 |
margin: 0;
|
138 |
-
padding: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
139 |
cursor: text;
|
140 |
-
overflow: hidden;
|
141 |
-
height: auto !important;
|
142 |
-
height: 1%;
|
143 |
-
position: relative;
|
144 |
}
|
|
|
145 |
.chzn-container-multi .chzn-choices li {
|
146 |
float: left;
|
147 |
list-style: none;
|
148 |
}
|
149 |
-
|
150 |
-
|
151 |
margin: 0;
|
152 |
padding: 0;
|
|
|
153 |
}
|
154 |
-
|
155 |
-
|
156 |
-
background: transparent !important;
|
157 |
-
border: 0 !important;
|
158 |
-
font-family: sans-serif;
|
159 |
-
font-size: 100%;
|
160 |
-
height: 15px;
|
161 |
-
padding: 5px;
|
162 |
margin: 1px 0;
|
|
|
|
|
163 |
outline: 0;
|
|
|
|
|
164 |
-webkit-box-shadow: none;
|
165 |
-
|
166 |
-
-o-box-shadow : none;
|
167 |
-
box-shadow : none;
|
168 |
-
}
|
169 |
-
.chzn-container-multi .chzn-choices .search-field .default {
|
170 |
color: #999;
|
|
|
|
|
|
|
|
|
|
|
171 |
}
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
background-image: -webkit-gradient(linear,
|
182 |
-
background-image:
|
183 |
-
background-
|
184 |
-
background-
|
185 |
-
background-
|
186 |
-
|
187 |
-
|
188 |
-
-moz-box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
189 |
-
box-shadow : 0 0 2px #ffffff inset, 0 1px 0 rgba(0,0,0,0.05);
|
190 |
color: #333;
|
191 |
-
border: 1px solid #aaaaaa;
|
192 |
line-height: 13px;
|
193 |
-
padding: 3px 20px 3px 5px;
|
194 |
-
margin: 3px 0 3px 5px;
|
195 |
-
position: relative;
|
196 |
cursor: default;
|
197 |
}
|
198 |
-
|
199 |
-
|
|
|
200 |
}
|
201 |
-
|
202 |
-
|
203 |
position: absolute;
|
204 |
-
right: 3px;
|
205 |
top: 4px;
|
|
|
|
|
206 |
width: 12px;
|
207 |
-
height:
|
|
|
208 |
font-size: 1px;
|
209 |
-
background: url(chosen-sprite.png) right top no-repeat;
|
210 |
}
|
211 |
-
|
212 |
-
|
|
|
213 |
}
|
214 |
-
|
215 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
216 |
}
|
217 |
-
/* @end */
|
218 |
|
219 |
-
|
220 |
-
|
221 |
-
margin: 0 4px 4px 0;
|
222 |
-
max-height: 240px;
|
223 |
-
padding: 0 0 0 4px;
|
224 |
-
position: relative;
|
225 |
-
overflow-x: hidden;
|
226 |
-
overflow-y: auto;
|
227 |
}
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
}
|
232 |
-
|
233 |
-
|
234 |
-
line-height: 15px;
|
235 |
-
padding: 5px 6px;
|
236 |
margin: 0;
|
237 |
-
|
238 |
-
}
|
239 |
-
.chzn-container .chzn-results .active-result {
|
240 |
-
cursor: pointer;
|
241 |
-
display: list-item;
|
242 |
-
}
|
243 |
-
.chzn-container .chzn-results .highlighted {
|
244 |
-
background-color: #3875d7;
|
245 |
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3875d7', endColorstr='#2a62bc', GradientType=0 );
|
246 |
-
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
|
247 |
-
background-image: -webkit-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
|
248 |
-
background-image: -moz-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
|
249 |
-
background-image: -o-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
|
250 |
-
background-image: -ms-linear-gradient(top, #3875d7 20%, #2a62bc 90%);
|
251 |
-
background-image: linear-gradient(top, #3875d7 20%, #2a62bc 90%);
|
252 |
-
color: #fff;
|
253 |
-
}
|
254 |
-
.chzn-container .chzn-results li em {
|
255 |
-
background: #feffde;
|
256 |
-
font-style: normal;
|
257 |
-
}
|
258 |
-
.chzn-container .chzn-results .highlighted em {
|
259 |
-
background: transparent;
|
260 |
}
|
261 |
-
|
262 |
-
|
263 |
display: list-item;
|
264 |
-
|
265 |
-
.chzn-container .chzn-results .group-result {
|
266 |
cursor: default;
|
267 |
-
color: #999;
|
268 |
-
font-weight: 600;
|
269 |
-
}
|
270 |
-
.chzn-container .chzn-results .group-option {
|
271 |
-
padding-left: 15px;
|
272 |
-
}
|
273 |
-
.chzn-container-multi .chzn-drop .result-selected {
|
274 |
-
display: none;
|
275 |
-
}
|
276 |
-
.chzn-container .chzn-results-scroll {
|
277 |
-
background: white;
|
278 |
-
margin: 0 4px;
|
279 |
-
position: absolute;
|
280 |
-
text-align: center;
|
281 |
-
width: 321px; /* This should by dynamic with js */
|
282 |
-
z-index: 1;
|
283 |
}
|
284 |
-
.chzn-container .chzn-results-scroll span {
|
285 |
-
display: inline-block;
|
286 |
-
height: 17px;
|
287 |
-
text-indent: -5000px;
|
288 |
-
width: 9px;
|
289 |
-
}
|
290 |
-
.chzn-container .chzn-results-scroll-down {
|
291 |
-
bottom: 0;
|
292 |
-
}
|
293 |
-
.chzn-container .chzn-results-scroll-down span {
|
294 |
-
background: url('chosen-sprite.png') no-repeat -4px -3px;
|
295 |
-
}
|
296 |
-
.chzn-container .chzn-results-scroll-up span {
|
297 |
-
background: url('chosen-sprite.png') no-repeat -22px -3px;
|
298 |
-
}
|
299 |
-
/* @end */
|
300 |
|
|
|
301 |
/* @group Active */
|
302 |
.chzn-container-active .chzn-single {
|
303 |
-
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
304 |
-
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
305 |
-
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
306 |
-
box-shadow : 0 0 5px rgba(0,0,0,.3);
|
307 |
border: 1px solid #5897fb;
|
|
|
|
|
308 |
}
|
309 |
-
|
|
|
310 |
border: 1px solid #aaa;
|
311 |
-
-webkit-box-shadow: 0 1px 0 #fff inset;
|
312 |
-
-moz-box-shadow : 0 1px 0 #fff inset;
|
313 |
-
-o-box-shadow : 0 1px 0 #fff inset;
|
314 |
-
box-shadow : 0 1px 0 #fff inset;
|
315 |
-
background-color: #eee;
|
316 |
-
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#ffffff', GradientType=0 );
|
317 |
-
background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(20%, #eeeeee), color-stop(80%, #ffffff));
|
318 |
-
background-image: -webkit-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
|
319 |
-
background-image: -moz-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
|
320 |
-
background-image: -o-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
|
321 |
-
background-image: -ms-linear-gradient(top, #eeeeee 20%, #ffffff 80%);
|
322 |
-
background-image: linear-gradient(top, #eeeeee 20%, #ffffff 80%);
|
323 |
-
-webkit-border-bottom-left-radius : 0;
|
324 |
-
-webkit-border-bottom-right-radius: 0;
|
325 |
-
-moz-border-radius-bottomleft : 0;
|
326 |
-
-moz-border-radius-bottomright: 0;
|
327 |
-
border-bottom-left-radius : 0;
|
328 |
border-bottom-right-radius: 0;
|
|
|
|
|
|
|
|
|
|
|
329 |
}
|
330 |
-
|
331 |
-
|
332 |
border-left: none;
|
|
|
333 |
}
|
334 |
-
|
335 |
-
|
|
|
336 |
}
|
|
|
337 |
.chzn-container-active .chzn-choices {
|
338 |
-
-webkit-box-shadow: 0 0 5px rgba(0,0,0,.3);
|
339 |
-
-moz-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
340 |
-
-o-box-shadow : 0 0 5px rgba(0,0,0,.3);
|
341 |
-
box-shadow : 0 0 5px rgba(0,0,0,.3);
|
342 |
border: 1px solid #5897fb;
|
|
|
|
|
343 |
}
|
344 |
-
|
345 |
-
|
|
|
346 |
}
|
347 |
-
/* @end */
|
348 |
|
|
|
349 |
/* @group Disabled Support */
|
350 |
.chzn-disabled {
|
|
|
351 |
cursor: default;
|
352 |
-
opacity:0.5 !important;
|
353 |
}
|
|
|
354 |
.chzn-disabled .chzn-single {
|
355 |
cursor: default;
|
356 |
}
|
|
|
357 |
.chzn-disabled .chzn-choices .search-choice .search-choice-close {
|
358 |
cursor: default;
|
359 |
}
|
360 |
|
|
|
361 |
/* @group Right to Left */
|
362 |
-
.chzn-rtl {
|
363 |
-
|
364 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
365 |
|
366 |
-
.chzn-rtl .chzn-single div { left: 3px; right: auto; }
|
367 |
.chzn-rtl .chzn-single abbr {
|
|
|
368 |
left: 26px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
369 |
right: auto;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
370 |
}
|
371 |
-
|
372 |
-
.chzn-rtl .chzn-
|
373 |
-
.chzn-rtl .chzn-choices .search-choice { padding: 3px 5px 3px 19px; margin: 3px 5px 3px 0; }
|
374 |
-
.chzn-rtl .chzn-choices .search-choice .search-choice-close { left: 4px; right: auto; background-position: right top;}
|
375 |
-
.chzn-rtl.chzn-container-single .chzn-results { margin: 0 0 4px 4px; padding: 0 4px 0 0; }
|
376 |
-
.chzn-rtl .chzn-results .group-option { padding-left: 0; padding-right: 15px; }
|
377 |
-
.chzn-rtl.chzn-container-active .chzn-single-with-drop div { border-right: none; }
|
378 |
-
.chzn-rtl .chzn-search input {
|
379 |
-
background: #fff url('chosen-sprite.png') no-repeat -38px -22px;
|
380 |
-
background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-gradient(linear, 0% 0%, 0% 100%, color-stop(1%, #eeeeee), color-stop(15%, #ffffff));
|
381 |
-
background: url('chosen-sprite.png') no-repeat -38px -22px, -webkit-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
382 |
-
background: url('chosen-sprite.png') no-repeat -38px -22px, -moz-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
383 |
-
background: url('chosen-sprite.png') no-repeat -38px -22px, -o-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
384 |
-
background: url('chosen-sprite.png') no-repeat -38px -22px, -ms-linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
385 |
-
background: url('chosen-sprite.png') no-repeat -38px -22px, linear-gradient(top, #eeeeee 1%, #ffffff 15%);
|
386 |
padding: 4px 5px 4px 20px;
|
|
|
387 |
direction: rtl;
|
388 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
/* @end */
|
1 |
+
/*!
|
2 |
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
3 |
+
by Patrick Filler for Harvest, http://getharvest.com
|
4 |
+
|
5 |
+
Version 1.8.7
|
6 |
+
Full source at https://github.com/harvesthq/chosen
|
7 |
+
Copyright (c) 2011-2018 Harvest http://getharvest.com
|
8 |
+
|
9 |
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
10 |
+
This file is generated by `grunt build`, do not edit it by hand.
|
11 |
+
|
12 |
+
*/
|
13 |
+
|
14 |
+
/**
|
15 |
+
oplugins: customization - I have replaced .choosen- to .chzn- in CSS and JS files.
|
16 |
+
*/
|
17 |
+
|
18 |
/* @group Base */
|
19 |
.chzn-container {
|
|
|
20 |
position: relative;
|
21 |
display: inline-block;
|
22 |
+
vertical-align: middle;
|
23 |
+
font-size: 13px;
|
24 |
+
-webkit-user-select: none;
|
25 |
+
-moz-user-select: none;
|
26 |
+
-ms-user-select: none;
|
27 |
+
user-select: none;
|
28 |
+
}
|
29 |
+
|
30 |
+
.chzn-container * {
|
31 |
+
-webkit-box-sizing: border-box;
|
32 |
+
box-sizing: border-box;
|
33 |
}
|
34 |
+
|
35 |
.chzn-container .chzn-drop {
|
36 |
+
position: absolute;
|
37 |
+
top: 100%;
|
38 |
+
z-index: 1010;
|
39 |
+
width: 100%;
|
40 |
border: 1px solid #aaa;
|
41 |
border-top: 0;
|
42 |
+
background: #fff;
|
43 |
+
-webkit-box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
|
44 |
+
box-shadow: 0 4px 5px rgba(0, 0, 0, 0.15);
|
45 |
+
clip: rect(0, 0, 0, 0);
|
46 |
+
-webkit-clip-path: inset(100% 100%);
|
47 |
+
clip-path: inset(100% 100%);
|
|
|
|
|
48 |
}
|
|
|
49 |
|
50 |
+
.chzn-container.chzn-with-drop .chzn-drop {
|
51 |
+
clip: auto;
|
52 |
+
-webkit-clip-path: none;
|
53 |
+
clip-path: none;
|
54 |
+
}
|
55 |
+
|
56 |
+
.chzn-container a {
|
57 |
+
cursor: pointer;
|
58 |
+
}
|
59 |
+
|
60 |
+
.chzn-container .search-choice .group-name, .chzn-container .chzn-single .group-name {
|
61 |
+
margin-right: 4px;
|
62 |
+
overflow: hidden;
|
63 |
+
white-space: nowrap;
|
64 |
+
text-overflow: ellipsis;
|
65 |
+
font-weight: normal;
|
66 |
+
color: #999999;
|
67 |
+
}
|
68 |
+
|
69 |
+
.chzn-container .search-choice .group-name:after, .chzn-container .chzn-single .group-name:after {
|
70 |
+
content: ":";
|
71 |
+
padding-left: 2px;
|
72 |
+
vertical-align: top;
|
73 |
+
}
|
74 |
+
|
75 |
+
/* @end */
|
76 |
/* @group Single Chosen */
|
77 |
.chzn-container-single .chzn-single {
|
78 |
+
position: relative;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
display: block;
|
80 |
overflow: hidden;
|
|
|
|
|
|
|
|
|
81 |
padding: 0 0 0 8px;
|
82 |
+
height: 25px;
|
83 |
+
border: 1px solid #aaa;
|
84 |
+
border-radius: 5px;
|
85 |
+
background-color: #fff;
|
86 |
+
background: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #fff), color-stop(50%, #f6f6f6), color-stop(52%, #eee), to(#f4f4f4));
|
87 |
+
background: linear-gradient(#fff 20%, #f6f6f6 50%, #eee 52%, #f4f4f4 100%);
|
88 |
+
background-clip: padding-box;
|
89 |
+
-webkit-box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
|
90 |
+
box-shadow: 0 0 3px #fff inset, 0 1px 1px rgba(0, 0, 0, 0.1);
|
91 |
+
color: #444;
|
92 |
text-decoration: none;
|
93 |
+
white-space: nowrap;
|
94 |
+
line-height: 24px;
|
95 |
}
|
96 |
+
|
97 |
+
.chzn-container-single .chzn-default {
|
98 |
+
color: #999;
|
99 |
+
}
|
100 |
+
|
101 |
.chzn-container-single .chzn-single span {
|
|
|
102 |
display: block;
|
103 |
overflow: hidden;
|
104 |
+
margin-right: 26px;
|
|
|
|
|
105 |
text-overflow: ellipsis;
|
106 |
+
white-space: nowrap;
|
107 |
+
}
|
108 |
+
|
109 |
+
.chzn-container-single .chzn-single-with-deselect span {
|
110 |
+
margin-right: 38px;
|
111 |
}
|
112 |
+
|
113 |
.chzn-container-single .chzn-single abbr {
|
|
|
114 |
position: absolute;
|
|
|
115 |
top: 6px;
|
116 |
+
right: 26px;
|
117 |
+
display: block;
|
118 |
width: 12px;
|
119 |
+
height: 12px;
|
120 |
+
background: url("chzn-sprite.png") -42px 1px no-repeat;
|
121 |
font-size: 1px;
|
|
|
122 |
}
|
123 |
+
|
124 |
.chzn-container-single .chzn-single abbr:hover {
|
125 |
+
background-position: -42px -10px;
|
126 |
+
}
|
127 |
+
|
128 |
+
.chzn-container-single.chzn-disabled .chzn-single abbr:hover {
|
129 |
+
background-position: -42px -10px;
|
130 |
}
|
131 |
+
|
132 |
.chzn-container-single .chzn-single div {
|
133 |
position: absolute;
|
|
|
134 |
top: 0;
|
135 |
+
right: 0;
|
136 |
display: block;
|
|
|
137 |
width: 18px;
|
138 |
+
height: 100%;
|
139 |
}
|
140 |
+
|
141 |
.chzn-container-single .chzn-single div b {
|
|
|
142 |
display: block;
|
143 |
width: 100%;
|
144 |
height: 100%;
|
145 |
+
background: url("chzn-sprite.png") no-repeat 0px 2px;
|
146 |
}
|
147 |
+
|
148 |
.chzn-container-single .chzn-search {
|
|
|
149 |
position: relative;
|
150 |
+
z-index: 1010;
|
151 |
margin: 0;
|
152 |
+
padding: 3px 4px;
|
153 |
white-space: nowrap;
|
|
|
154 |
}
|
155 |
+
|
156 |
+
.chzn-container-single .chzn-search input[type="text"] {
|
|
|
|
|
|
|
|
|
|
|
|
|
157 |
margin: 1px 0;
|
158 |
padding: 4px 20px 4px 5px;
|
159 |
+
width: 100%;
|
160 |
+
height: auto;
|
161 |
outline: 0;
|
162 |
border: 1px solid #aaa;
|
163 |
+
background: url("chzn-sprite.png") no-repeat 100% -20px;
|
164 |
font-size: 1em;
|
165 |
+
font-family: sans-serif;
|
166 |
+
line-height: normal;
|
167 |
+
border-radius: 0;
|
168 |
}
|
169 |
+
|
170 |
.chzn-container-single .chzn-drop {
|
171 |
+
margin-top: -1px;
|
172 |
+
border-radius: 0 0 4px 4px;
|
173 |
+
background-clip: padding-box;
|
|
|
|
|
|
|
174 |
}
|
|
|
175 |
|
176 |
+
.chzn-container-single.chzn-container-single-nosearch .chzn-search {
|
177 |
position: absolute;
|
178 |
+
clip: rect(0, 0, 0, 0);
|
179 |
+
-webkit-clip-path: inset(100% 100%);
|
180 |
+
clip-path: inset(100% 100%);
|
181 |
+
}
|
182 |
+
|
183 |
+
/* @end */
|
184 |
+
/* @group Results */
|
185 |
+
.chzn-container .chzn-results {
|
186 |
+
color: #444;
|
187 |
+
position: relative;
|
188 |
+
overflow-x: hidden;
|
189 |
+
overflow-y: auto;
|
190 |
+
margin: 0 4px 4px 0;
|
191 |
+
padding: 0 0 0 4px;
|
192 |
+
max-height: 240px;
|
193 |
+
-webkit-overflow-scrolling: touch;
|
194 |
+
}
|
195 |
+
|
196 |
+
.chzn-container .chzn-results li {
|
197 |
+
display: none;
|
198 |
+
margin: 0;
|
199 |
+
padding: 5px 6px;
|
200 |
+
list-style: none;
|
201 |
+
line-height: 15px;
|
202 |
+
word-wrap: break-word;
|
203 |
+
-webkit-touch-callout: none;
|
204 |
+
}
|
205 |
+
|
206 |
+
.chzn-container .chzn-results li.active-result {
|
207 |
+
display: list-item;
|
208 |
+
cursor: pointer;
|
209 |
+
}
|
210 |
+
|
211 |
+
.chzn-container .chzn-results li.disabled-result {
|
212 |
+
display: list-item;
|
213 |
+
color: #ccc;
|
214 |
+
cursor: default;
|
215 |
}
|
216 |
|
217 |
+
.chzn-container .chzn-results li.highlighted {
|
218 |
+
background-color: #3875d7;
|
219 |
+
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #3875d7), color-stop(90%, #2a62bc));
|
220 |
+
background-image: linear-gradient(#3875d7 20%, #2a62bc 90%);
|
221 |
+
color: #fff;
|
222 |
+
}
|
223 |
+
|
224 |
+
.chzn-container .chzn-results li.no-results {
|
225 |
+
color: #777;
|
226 |
+
display: list-item;
|
227 |
+
background: #f4f4f4;
|
228 |
+
}
|
229 |
+
|
230 |
+
.chzn-container .chzn-results li.group-result {
|
231 |
+
display: list-item;
|
232 |
+
font-weight: bold;
|
233 |
+
cursor: default;
|
234 |
+
}
|
235 |
+
|
236 |
+
.chzn-container .chzn-results li.group-option {
|
237 |
+
padding-left: 15px;
|
238 |
+
}
|
239 |
+
|
240 |
+
.chzn-container .chzn-results li em {
|
241 |
+
font-style: normal;
|
242 |
+
text-decoration: underline;
|
243 |
+
}
|
244 |
+
|
245 |
+
/* @end */
|
246 |
/* @group Multi Chosen */
|
247 |
.chzn-container-multi .chzn-choices {
|
248 |
+
position: relative;
|
249 |
+
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
|
|
|
250 |
margin: 0;
|
251 |
+
padding: 0 5px;
|
252 |
+
width: 100%;
|
253 |
+
height: auto;
|
254 |
+
border: 1px solid #aaa;
|
255 |
+
background-color: #fff;
|
256 |
+
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(1%, #eee), color-stop(15%, #fff));
|
257 |
+
background-image: linear-gradient(#eee 1%, #fff 15%);
|
258 |
cursor: text;
|
|
|
|
|
|
|
|
|
259 |
}
|
260 |
+
|
261 |
.chzn-container-multi .chzn-choices li {
|
262 |
float: left;
|
263 |
list-style: none;
|
264 |
}
|
265 |
+
|
266 |
+
.chzn-container-multi .chzn-choices li.search-field {
|
267 |
margin: 0;
|
268 |
padding: 0;
|
269 |
+
white-space: nowrap;
|
270 |
}
|
271 |
+
|
272 |
+
.chzn-container-multi .chzn-choices li.search-field input[type="text"] {
|
|
|
|
|
|
|
|
|
|
|
|
|
273 |
margin: 1px 0;
|
274 |
+
padding: 0;
|
275 |
+
height: 25px;
|
276 |
outline: 0;
|
277 |
+
border: 0 !important;
|
278 |
+
background: transparent !important;
|
279 |
-webkit-box-shadow: none;
|
280 |
+
box-shadow: none;
|
|
|
|
|
|
|
|
|
281 |
color: #999;
|
282 |
+
font-size: 100%;
|
283 |
+
font-family: sans-serif;
|
284 |
+
line-height: normal;
|
285 |
+
border-radius: 0;
|
286 |
+
width: 25px;
|
287 |
}
|
288 |
+
|
289 |
+
.chzn-container-multi .chzn-choices li.search-choice {
|
290 |
+
position: relative;
|
291 |
+
margin: 3px 5px 3px 0;
|
292 |
+
padding: 3px 20px 3px 5px;
|
293 |
+
border: 1px solid #aaa;
|
294 |
+
max-width: 100%;
|
295 |
+
border-radius: 3px;
|
296 |
+
background-color: #eeeeee;
|
297 |
+
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), to(#eee));
|
298 |
+
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
|
299 |
+
background-size: 100% 19px;
|
300 |
+
background-repeat: repeat-x;
|
301 |
+
background-clip: padding-box;
|
302 |
+
-webkit-box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
|
303 |
+
box-shadow: 0 0 2px #fff inset, 0 1px 0 rgba(0, 0, 0, 0.05);
|
|
|
|
|
304 |
color: #333;
|
|
|
305 |
line-height: 13px;
|
|
|
|
|
|
|
306 |
cursor: default;
|
307 |
}
|
308 |
+
|
309 |
+
.chzn-container-multi .chzn-choices li.search-choice span {
|
310 |
+
word-wrap: break-word;
|
311 |
}
|
312 |
+
|
313 |
+
.chzn-container-multi .chzn-choices li.search-choice .search-choice-close {
|
314 |
position: absolute;
|
|
|
315 |
top: 4px;
|
316 |
+
right: 3px;
|
317 |
+
display: block;
|
318 |
width: 12px;
|
319 |
+
height: 12px;
|
320 |
+
background: url("chzn-sprite.png") -42px 1px no-repeat;
|
321 |
font-size: 1px;
|
|
|
322 |
}
|
323 |
+
|
324 |
+
.chzn-container-multi .chzn-choices li.search-choice .search-choice-close:hover {
|
325 |
+
background-position: -42px -10px;
|
326 |
}
|
327 |
+
|
328 |
+
.chzn-container-multi .chzn-choices li.search-choice-disabled {
|
329 |
+
padding-right: 5px;
|
330 |
+
border: 1px solid #ccc;
|
331 |
+
background-color: #e4e4e4;
|
332 |
+
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #f4f4f4), color-stop(50%, #f0f0f0), color-stop(52%, #e8e8e8), to(#eee));
|
333 |
+
background-image: linear-gradient(#f4f4f4 20%, #f0f0f0 50%, #e8e8e8 52%, #eee 100%);
|
334 |
+
color: #666;
|
335 |
}
|
|
|
336 |
|
337 |
+
.chzn-container-multi .chzn-choices li.search-choice-focus {
|
338 |
+
background: #d4d4d4;
|
|
|
|
|
|
|
|
|
|
|
|
|
339 |
}
|
340 |
+
|
341 |
+
.chzn-container-multi .chzn-choices li.search-choice-focus .search-choice-close {
|
342 |
+
background-position: -42px -10px;
|
343 |
}
|
344 |
+
|
345 |
+
.chzn-container-multi .chzn-results {
|
|
|
|
|
346 |
margin: 0;
|
347 |
+
padding: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
348 |
}
|
349 |
+
|
350 |
+
.chzn-container-multi .chzn-drop .result-selected {
|
351 |
display: list-item;
|
352 |
+
color: #ccc;
|
|
|
353 |
cursor: default;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
354 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
355 |
|
356 |
+
/* @end */
|
357 |
/* @group Active */
|
358 |
.chzn-container-active .chzn-single {
|
|
|
|
|
|
|
|
|
359 |
border: 1px solid #5897fb;
|
360 |
+
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
|
361 |
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
|
362 |
}
|
363 |
+
|
364 |
+
.chzn-container-active.chzn-with-drop .chzn-single {
|
365 |
border: 1px solid #aaa;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
366 |
border-bottom-right-radius: 0;
|
367 |
+
border-bottom-left-radius: 0;
|
368 |
+
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(20%, #eee), color-stop(80%, #fff));
|
369 |
+
background-image: linear-gradient(#eee 20%, #fff 80%);
|
370 |
+
-webkit-box-shadow: 0 1px 0 #fff inset;
|
371 |
+
box-shadow: 0 1px 0 #fff inset;
|
372 |
}
|
373 |
+
|
374 |
+
.chzn-container-active.chzn-with-drop .chzn-single div {
|
375 |
border-left: none;
|
376 |
+
background: transparent;
|
377 |
}
|
378 |
+
|
379 |
+
.chzn-container-active.chzn-with-drop .chzn-single div b {
|
380 |
+
background-position: -18px 2px;
|
381 |
}
|
382 |
+
|
383 |
.chzn-container-active .chzn-choices {
|
|
|
|
|
|
|
|
|
384 |
border: 1px solid #5897fb;
|
385 |
+
-webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
|
386 |
+
box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
|
387 |
}
|
388 |
+
|
389 |
+
.chzn-container-active .chzn-choices li.search-field input[type="text"] {
|
390 |
+
color: #222 !important;
|
391 |
}
|
|
|
392 |
|
393 |
+
/* @end */
|
394 |
/* @group Disabled Support */
|
395 |
.chzn-disabled {
|
396 |
+
opacity: 0.5 !important;
|
397 |
cursor: default;
|
|
|
398 |
}
|
399 |
+
|
400 |
.chzn-disabled .chzn-single {
|
401 |
cursor: default;
|
402 |
}
|
403 |
+
|
404 |
.chzn-disabled .chzn-choices .search-choice .search-choice-close {
|
405 |
cursor: default;
|
406 |
}
|
407 |
|
408 |
+
/* @end */
|
409 |
/* @group Right to Left */
|
410 |
+
.chzn-rtl {
|
411 |
+
text-align: right;
|
412 |
+
}
|
413 |
+
|
414 |
+
.chzn-rtl .chzn-single {
|
415 |
+
overflow: visible;
|
416 |
+
padding: 0 8px 0 0;
|
417 |
+
}
|
418 |
+
|
419 |
+
.chzn-rtl .chzn-single span {
|
420 |
+
margin-right: 0;
|
421 |
+
margin-left: 26px;
|
422 |
+
direction: rtl;
|
423 |
+
}
|
424 |
+
|
425 |
+
.chzn-rtl .chzn-single-with-deselect span {
|
426 |
+
margin-left: 38px;
|
427 |
+
}
|
428 |
+
|
429 |
+
.chzn-rtl .chzn-single div {
|
430 |
+
right: auto;
|
431 |
+
left: 3px;
|
432 |
+
}
|
433 |
|
|
|
434 |
.chzn-rtl .chzn-single abbr {
|
435 |
+
right: auto;
|
436 |
left: 26px;
|
437 |
+
}
|
438 |
+
|
439 |
+
.chzn-rtl .chzn-choices li {
|
440 |
+
float: right;
|
441 |
+
}
|
442 |
+
|
443 |
+
.chzn-rtl .chzn-choices li.search-field input[type="text"] {
|
444 |
+
direction: rtl;
|
445 |
+
}
|
446 |
+
|
447 |
+
.chzn-rtl .chzn-choices li.search-choice {
|
448 |
+
margin: 3px 5px 3px 0;
|
449 |
+
padding: 3px 5px 3px 19px;
|
450 |
+
}
|
451 |
+
|
452 |
+
.chzn-rtl .chzn-choices li.search-choice .search-choice-close {
|
453 |
right: auto;
|
454 |
+
left: 4px;
|
455 |
+
}
|
456 |
+
|
457 |
+
.chzn-rtl.chzn-container-single .chzn-results {
|
458 |
+
margin: 0 0 4px 4px;
|
459 |
+
padding: 0 4px 0 0;
|
460 |
+
}
|
461 |
+
|
462 |
+
.chzn-rtl .chzn-results li.group-option {
|
463 |
+
padding-right: 15px;
|
464 |
+
padding-left: 0;
|
465 |
+
}
|
466 |
+
|
467 |
+
.chzn-rtl.chzn-container-active.chzn-with-drop .chzn-single div {
|
468 |
+
border-right: none;
|
469 |
}
|
470 |
+
|
471 |
+
.chzn-rtl .chzn-search input[type="text"] {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
472 |
padding: 4px 5px 4px 20px;
|
473 |
+
background: url("chzn-sprite.png") no-repeat -30px -20px;
|
474 |
direction: rtl;
|
475 |
}
|
476 |
+
|
477 |
+
.chzn-rtl.chzn-container-single .chzn-single div b {
|
478 |
+
background-position: 6px 2px;
|
479 |
+
}
|
480 |
+
|
481 |
+
.chzn-rtl.chzn-container-single.chzn-with-drop .chzn-single div b {
|
482 |
+
background-position: -12px 2px;
|
483 |
+
}
|
484 |
+
|
485 |
+
/* @end */
|
486 |
+
/* @group Retina compatibility */
|
487 |
+
@media only screen and (-webkit-min-device-pixel-ratio: 1.5), only screen and (min-resolution: 144dpi), only screen and (min-resolution: 1.5dppx) {
|
488 |
+
.chzn-rtl .chzn-search input[type="text"],
|
489 |
+
.chzn-container-single .chzn-single abbr,
|
490 |
+
.chzn-container-single .chzn-single div b,
|
491 |
+
.chzn-container-single .chzn-search input[type="text"],
|
492 |
+
.chzn-container-multi .chzn-choices .search-choice .search-choice-close,
|
493 |
+
.chzn-container .chzn-results-scroll-down span,
|
494 |
+
.chzn-container .chzn-results-scroll-up span {
|
495 |
+
background-image: url("chzn-sprite@2x.png") !important;
|
496 |
+
background-size: 52px 37px !important;
|
497 |
+
background-repeat: no-repeat !important;
|
498 |
+
}
|
499 |
+
}
|
500 |
+
|
501 |
/* @end */
|
assets/libs/chosen/chosen.jquery.js
CHANGED
@@ -1,24 +1,29 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
|
|
|
|
|
|
10 |
(function() {
|
11 |
-
var SelectParser
|
|
|
|
|
|
|
12 |
|
13 |
SelectParser = (function() {
|
14 |
-
|
15 |
function SelectParser() {
|
16 |
this.options_index = 0;
|
17 |
this.parsed = [];
|
18 |
}
|
19 |
|
20 |
SelectParser.prototype.add_node = function(child) {
|
21 |
-
if (child.nodeName === "OPTGROUP") {
|
22 |
return this.add_group(child);
|
23 |
} else {
|
24 |
return this.add_option(child);
|
@@ -26,37 +31,43 @@
|
|
26 |
};
|
27 |
|
28 |
SelectParser.prototype.add_group = function(group) {
|
29 |
-
var group_position,
|
30 |
group_position = this.parsed.length;
|
31 |
this.parsed.push({
|
32 |
array_index: group_position,
|
33 |
group: true,
|
34 |
label: group.label,
|
|
|
35 |
children: 0,
|
36 |
-
disabled: group.disabled
|
|
|
37 |
});
|
38 |
-
|
39 |
-
|
40 |
-
for (
|
41 |
-
option =
|
42 |
-
|
43 |
}
|
44 |
-
return
|
45 |
};
|
46 |
|
47 |
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
48 |
-
if (option.nodeName === "OPTION") {
|
49 |
if (option.text !== "") {
|
50 |
-
if (group_position != null)
|
|
|
|
|
51 |
this.parsed.push({
|
52 |
array_index: this.parsed.length,
|
53 |
options_index: this.options_index,
|
54 |
value: option.value,
|
55 |
text: option.text,
|
56 |
html: option.innerHTML,
|
|
|
57 |
selected: option.selected,
|
58 |
disabled: group_disabled === true ? group_disabled : option.disabled,
|
59 |
group_array_index: group_position,
|
|
|
60 |
classes: option.className,
|
61 |
style: option.style.cssText
|
62 |
});
|
@@ -76,61 +87,84 @@
|
|
76 |
})();
|
77 |
|
78 |
SelectParser.select_to_array = function(select) {
|
79 |
-
var child,
|
80 |
parser = new SelectParser();
|
81 |
-
|
82 |
-
for (
|
83 |
-
child =
|
84 |
parser.add_node(child);
|
85 |
}
|
86 |
return parser.parsed;
|
87 |
};
|
88 |
|
89 |
-
this.SelectParser = SelectParser;
|
90 |
-
|
91 |
-
}).call(this);
|
92 |
-
|
93 |
-
/*
|
94 |
-
Chosen source: generate output using 'cake build'
|
95 |
-
Copyright (c) 2011 by Harvest
|
96 |
-
*/
|
97 |
-
|
98 |
-
(function() {
|
99 |
-
var AbstractChosen, root;
|
100 |
-
|
101 |
-
root = this;
|
102 |
-
|
103 |
AbstractChosen = (function() {
|
104 |
-
|
105 |
-
function AbstractChosen(form_field, options) {
|
106 |
this.form_field = form_field;
|
107 |
-
this.options =
|
108 |
-
this.
|
|
|
|
|
|
|
109 |
this.is_multiple = this.form_field.multiple;
|
110 |
-
this.
|
|
|
111 |
this.setup();
|
112 |
this.set_up_html();
|
113 |
this.register_observers();
|
114 |
-
this.
|
115 |
}
|
116 |
|
117 |
AbstractChosen.prototype.set_default_values = function() {
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
this
|
123 |
-
|
124 |
-
|
|
|
|
|
|
|
125 |
this.active_field = false;
|
126 |
this.mouse_on_container = false;
|
127 |
this.results_showing = false;
|
128 |
this.result_highlighted = null;
|
129 |
-
this.
|
130 |
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
131 |
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
132 |
-
this.
|
133 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
};
|
135 |
|
136 |
AbstractChosen.prototype.mouse_enter = function() {
|
@@ -142,43 +176,155 @@ Copyright (c) 2011 by Harvest
|
|
142 |
};
|
143 |
|
144 |
AbstractChosen.prototype.input_focus = function(evt) {
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
150 |
}
|
151 |
};
|
152 |
|
153 |
AbstractChosen.prototype.input_blur = function(evt) {
|
154 |
-
var _this = this;
|
155 |
if (!this.mouse_on_container) {
|
156 |
this.active_field = false;
|
157 |
-
return setTimeout((function() {
|
158 |
-
return
|
159 |
-
|
|
|
|
|
160 |
}
|
161 |
};
|
162 |
|
163 |
-
AbstractChosen.prototype.
|
164 |
-
|
165 |
-
|
166 |
-
option.dom_id = this.container_id + "_o_" + option.array_index;
|
167 |
-
classes = option.selected && this.is_multiple ? [] : ["active-result"];
|
168 |
-
if (option.selected) classes.push("result-selected");
|
169 |
-
if (option.group_array_index != null) classes.push("group-option");
|
170 |
-
if (option.classes !== "") classes.push(option.classes);
|
171 |
-
style = option.style.cssText !== "" ? " style=\"" + option.style + "\"" : "";
|
172 |
-
return '<li id="' + option.dom_id + '" class="' + classes.join(' ') + '"' + style + '>' + option.html + '</li>';
|
173 |
} else {
|
174 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
175 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
176 |
};
|
177 |
|
178 |
AbstractChosen.prototype.results_update_field = function() {
|
|
|
|
|
|
|
|
|
179 |
this.result_clear_highlight();
|
180 |
-
this.
|
181 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
182 |
};
|
183 |
|
184 |
AbstractChosen.prototype.results_toggle = function() {
|
@@ -197,128 +343,344 @@ Copyright (c) 2011 by Harvest
|
|
197 |
}
|
198 |
};
|
199 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
200 |
AbstractChosen.prototype.keyup_checker = function(evt) {
|
201 |
-
var
|
202 |
-
stroke = (
|
203 |
this.search_field_scale();
|
204 |
switch (stroke) {
|
205 |
case 8:
|
206 |
-
if (this.is_multiple && this.backstroke_length < 1 && this.
|
207 |
-
|
208 |
} else if (!this.pending_backstroke) {
|
209 |
this.result_clear_highlight();
|
210 |
-
|
211 |
}
|
212 |
break;
|
213 |
case 13:
|
214 |
evt.preventDefault();
|
215 |
-
if (this.results_showing)
|
|
|
|
|
216 |
break;
|
217 |
case 27:
|
218 |
-
if (this.results_showing)
|
219 |
-
|
|
|
|
|
220 |
case 9:
|
|
|
|
|
|
|
221 |
case 38:
|
222 |
case 40:
|
223 |
-
case 16:
|
224 |
case 91:
|
225 |
-
case 17:
|
226 |
break;
|
227 |
default:
|
228 |
-
|
|
|
229 |
}
|
230 |
};
|
231 |
|
232 |
-
AbstractChosen.prototype.
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
return
|
|
|
|
|
|
|
|
|
237 |
};
|
238 |
|
239 |
-
AbstractChosen.prototype.
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
|
|
244 |
};
|
245 |
|
246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
|
248 |
-
|
|
|
|
|
|
|
249 |
|
250 |
-
|
|
|
|
|
|
|
251 |
|
252 |
-
|
|
|
|
|
|
|
|
|
253 |
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
|
|
|
|
|
|
|
|
|
|
258 |
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
263 |
|
264 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
265 |
|
266 |
$ = jQuery;
|
267 |
|
268 |
$.fn.extend({
|
269 |
chosen: function(options) {
|
270 |
-
if (
|
271 |
return this;
|
272 |
}
|
273 |
-
return
|
274 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
275 |
});
|
276 |
}
|
277 |
});
|
278 |
|
279 |
-
Chosen = (function(
|
280 |
-
|
281 |
-
__extends(Chosen, _super);
|
282 |
|
283 |
function Chosen() {
|
284 |
-
Chosen.__super__.constructor.apply(this, arguments);
|
285 |
}
|
286 |
|
287 |
Chosen.prototype.setup = function() {
|
288 |
this.form_field_jq = $(this.form_field);
|
289 |
-
return this.
|
290 |
-
};
|
291 |
-
|
292 |
-
Chosen.prototype.finish_setup = function() {
|
293 |
-
return this.form_field_jq.addClass("chzn-done");
|
294 |
};
|
295 |
|
296 |
Chosen.prototype.set_up_html = function() {
|
297 |
-
var
|
298 |
-
|
299 |
-
this.
|
300 |
-
this.
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
"
|
305 |
-
|
306 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
307 |
if (this.is_multiple) {
|
308 |
-
|
309 |
} else {
|
310 |
-
|
311 |
}
|
312 |
-
this.form_field_jq.hide().after(
|
313 |
-
this.container = $('#' + this.container_id);
|
314 |
-
this.container.addClass("chzn-container-" + (this.is_multiple ? "multi" : "single"));
|
315 |
this.dropdown = this.container.find('div.chzn-drop').first();
|
316 |
-
dd_top = this.container.height();
|
317 |
-
dd_width = this.f_width - get_side_border_padding(this.dropdown);
|
318 |
-
this.dropdown.css({
|
319 |
-
"width": dd_width + "px",
|
320 |
-
"top": dd_top + "px"
|
321 |
-
});
|
322 |
this.search_field = this.container.find('input').first();
|
323 |
this.search_results = this.container.find('ul.chzn-results').first();
|
324 |
this.search_field_scale();
|
@@ -329,108 +691,215 @@ Copyright (c) 2011 by Harvest
|
|
329 |
} else {
|
330 |
this.search_container = this.container.find('div.chzn-search').first();
|
331 |
this.selected_item = this.container.find('.chzn-single').first();
|
332 |
-
sf_width = dd_width - get_side_border_padding(this.search_container) - get_side_border_padding(this.search_field);
|
333 |
-
this.search_field.css({
|
334 |
-
"width": sf_width + "px"
|
335 |
-
});
|
336 |
}
|
337 |
this.results_build();
|
338 |
this.set_tab_index();
|
339 |
-
return this.
|
|
|
|
|
|
|
|
|
340 |
chosen: this
|
341 |
});
|
342 |
};
|
343 |
|
344 |
Chosen.prototype.register_observers = function() {
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
this
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
});
|
355 |
-
this.container.
|
356 |
-
return
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
this
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
});
|
370 |
-
this.
|
371 |
-
return
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
379 |
if (this.is_multiple) {
|
380 |
-
this.search_choices.click(function(
|
381 |
-
return
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
});
|
386 |
} else {
|
387 |
-
return this.container.click
|
388 |
-
|
389 |
});
|
390 |
}
|
391 |
};
|
392 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
393 |
Chosen.prototype.search_field_disabled = function() {
|
394 |
-
this.is_disabled = this.form_field_jq
|
|
|
|
|
|
|
|
|
|
|
395 |
if (this.is_disabled) {
|
396 |
-
this.container.addClass('chzn-disabled');
|
397 |
-
this.search_field[0].disabled = true;
|
398 |
-
if (!this.is_multiple) {
|
399 |
-
this.selected_item.unbind("focus", this.activate_action);
|
400 |
-
}
|
401 |
return this.close_field();
|
402 |
-
} else {
|
403 |
-
this.
|
404 |
-
this.search_field[0].disabled = false;
|
405 |
-
if (!this.is_multiple) {
|
406 |
-
return this.selected_item.bind("focus", this.activate_action);
|
407 |
-
}
|
408 |
}
|
409 |
};
|
410 |
|
411 |
Chosen.prototype.container_mousedown = function(evt) {
|
412 |
-
var
|
413 |
-
if (
|
414 |
-
|
415 |
-
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
this.results_toggle();
|
424 |
}
|
425 |
-
|
426 |
-
|
427 |
-
|
|
|
|
|
428 |
}
|
|
|
429 |
}
|
430 |
};
|
431 |
|
432 |
Chosen.prototype.container_mouseup = function(evt) {
|
433 |
-
if (evt.target.nodeName === "ABBR"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
434 |
};
|
435 |
|
436 |
Chosen.prototype.blur_test = function(evt) {
|
@@ -440,24 +909,19 @@ Copyright (c) 2011 by Harvest
|
|
440 |
};
|
441 |
|
442 |
Chosen.prototype.close_field = function() {
|
443 |
-
$(
|
444 |
-
if (!this.is_multiple) {
|
445 |
-
this.selected_item.attr("tabindex", this.search_field.attr("tabindex"));
|
446 |
-
this.search_field.attr("tabindex", -1);
|
447 |
-
}
|
448 |
this.active_field = false;
|
449 |
this.results_hide();
|
450 |
this.container.removeClass("chzn-container-active");
|
451 |
-
this.winnow_results_clear();
|
452 |
this.clear_backstroke();
|
453 |
this.show_search_field_default();
|
454 |
-
|
|
|
455 |
};
|
456 |
|
457 |
Chosen.prototype.activate_field = function() {
|
458 |
-
if (
|
459 |
-
|
460 |
-
this.selected_item.attr("tabindex", -1);
|
461 |
}
|
462 |
this.container.addClass("chzn-container-active");
|
463 |
this.active_field = true;
|
@@ -466,7 +930,9 @@ Copyright (c) 2011 by Harvest
|
|
466 |
};
|
467 |
|
468 |
Chosen.prototype.test_active_click = function(evt) {
|
469 |
-
|
|
|
|
|
470 |
return this.active_field = true;
|
471 |
} else {
|
472 |
return this.close_field();
|
@@ -474,52 +940,30 @@ Copyright (c) 2011 by Harvest
|
|
474 |
};
|
475 |
|
476 |
Chosen.prototype.results_build = function() {
|
477 |
-
var content, data, _i, _len, _ref;
|
478 |
this.parsing = true;
|
479 |
-
this.
|
480 |
-
|
|
|
481 |
this.search_choices.find("li.search-choice").remove();
|
482 |
-
|
483 |
-
|
484 |
-
this.
|
485 |
-
|
486 |
this.container.addClass("chzn-container-single-nosearch");
|
487 |
} else {
|
|
|
488 |
this.container.removeClass("chzn-container-single-nosearch");
|
489 |
}
|
490 |
}
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
data = _ref[_i];
|
495 |
-
if (data.group) {
|
496 |
-
content += this.result_add_group(data);
|
497 |
-
} else if (!data.empty) {
|
498 |
-
content += this.result_add_option(data);
|
499 |
-
if (data.selected && this.is_multiple) {
|
500 |
-
this.choice_build(data);
|
501 |
-
} else if (data.selected && !this.is_multiple) {
|
502 |
-
this.selected_item.find("span").text(data.text);
|
503 |
-
if (this.allow_single_deselect) this.single_deselect_control_build();
|
504 |
-
}
|
505 |
-
}
|
506 |
-
}
|
507 |
this.search_field_disabled();
|
508 |
this.show_search_field_default();
|
509 |
this.search_field_scale();
|
510 |
-
this.search_results.html(content);
|
511 |
return this.parsing = false;
|
512 |
};
|
513 |
|
514 |
-
Chosen.prototype.result_add_group = function(group) {
|
515 |
-
if (!group.disabled) {
|
516 |
-
group.dom_id = this.container_id + "_g_" + group.array_index;
|
517 |
-
return '<li id="' + group.dom_id + '" class="group-result">' + $("<div />").text(group.label).html() + '</li>';
|
518 |
-
} else {
|
519 |
-
return "";
|
520 |
-
}
|
521 |
-
};
|
522 |
-
|
523 |
Chosen.prototype.result_do_highlight = function(el) {
|
524 |
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
525 |
if (el.length) {
|
@@ -540,56 +984,65 @@ Copyright (c) 2011 by Harvest
|
|
540 |
};
|
541 |
|
542 |
Chosen.prototype.result_clear_highlight = function() {
|
543 |
-
if (this.result_highlight)
|
|
|
|
|
544 |
return this.result_highlight = null;
|
545 |
};
|
546 |
|
547 |
Chosen.prototype.results_show = function() {
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
}
|
554 |
}
|
555 |
-
|
556 |
-
this.dropdown.css({
|
557 |
-
"top": dd_top + "px",
|
558 |
-
"left": 0
|
559 |
-
});
|
560 |
this.results_showing = true;
|
561 |
this.search_field.focus();
|
562 |
-
this.search_field.val(this.
|
563 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
564 |
};
|
565 |
|
566 |
Chosen.prototype.results_hide = function() {
|
567 |
-
if (
|
568 |
-
this.
|
|
|
|
|
|
|
|
|
569 |
}
|
570 |
-
this.result_clear_highlight();
|
571 |
-
this.dropdown.css({
|
572 |
-
"left": "-9000px"
|
573 |
-
});
|
574 |
return this.results_showing = false;
|
575 |
};
|
576 |
|
577 |
Chosen.prototype.set_tab_index = function(el) {
|
578 |
var ti;
|
579 |
-
if (this.
|
580 |
-
ti = this.
|
581 |
-
this.
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
|
|
|
|
|
|
|
|
|
|
588 |
}
|
589 |
};
|
590 |
|
591 |
Chosen.prototype.show_search_field_default = function() {
|
592 |
-
if (this.is_multiple && this.
|
593 |
this.search_field.val(this.default_text);
|
594 |
return this.search_field.addClass("default");
|
595 |
} else {
|
@@ -603,221 +1056,209 @@ Copyright (c) 2011 by Harvest
|
|
603 |
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
604 |
if (target.length) {
|
605 |
this.result_highlight = target;
|
606 |
-
|
|
|
607 |
}
|
608 |
};
|
609 |
|
610 |
Chosen.prototype.search_results_mouseover = function(evt) {
|
611 |
var target;
|
612 |
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
613 |
-
if (target)
|
|
|
|
|
614 |
};
|
615 |
|
616 |
Chosen.prototype.search_results_mouseout = function(evt) {
|
617 |
-
if ($(evt.target).hasClass("active-result" || $(evt.target).parents('.active-result').first())
|
618 |
return this.result_clear_highlight();
|
619 |
}
|
620 |
};
|
621 |
|
622 |
-
Chosen.prototype.choices_click = function(evt) {
|
623 |
-
evt.preventDefault();
|
624 |
-
if (this.active_field && !($(evt.target).hasClass("search-choice" || $(evt.target).parents('.search-choice').first)) && !this.results_showing) {
|
625 |
-
return this.results_show();
|
626 |
-
}
|
627 |
-
};
|
628 |
-
|
629 |
Chosen.prototype.choice_build = function(item) {
|
630 |
-
var
|
631 |
-
|
632 |
-
|
633 |
-
this.
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
639 |
};
|
640 |
|
641 |
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
642 |
evt.preventDefault();
|
|
|
643 |
if (!this.is_disabled) {
|
644 |
-
this.pending_destroy_click = true;
|
645 |
return this.choice_destroy($(evt.target));
|
646 |
-
} else {
|
647 |
-
return evt.stopPropagation;
|
648 |
}
|
649 |
};
|
650 |
|
651 |
Chosen.prototype.choice_destroy = function(link) {
|
652 |
-
this.
|
653 |
-
|
654 |
-
|
655 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
656 |
}
|
657 |
-
this.result_deselect(link.attr("rel"));
|
658 |
-
return link.parents('li').first().remove();
|
659 |
};
|
660 |
|
661 |
-
Chosen.prototype.results_reset = function(
|
|
|
662 |
this.form_field.options[0].selected = true;
|
663 |
-
this.
|
664 |
this.show_search_field_default();
|
665 |
-
|
666 |
-
this.
|
667 |
-
if (this.active_field)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
668 |
};
|
669 |
|
670 |
Chosen.prototype.result_select = function(evt) {
|
671 |
-
var high,
|
672 |
if (this.result_highlight) {
|
673 |
high = this.result_highlight;
|
674 |
-
high_id = high.attr("id");
|
675 |
this.result_clear_highlight();
|
|
|
|
|
|
|
|
|
|
|
|
|
676 |
if (this.is_multiple) {
|
677 |
-
|
678 |
} else {
|
679 |
-
this.
|
680 |
-
this.result_single_selected = high;
|
681 |
}
|
682 |
high.addClass("result-selected");
|
683 |
-
|
684 |
-
item = this.results_data[position];
|
685 |
item.selected = true;
|
686 |
this.form_field.options[item.options_index].selected = true;
|
|
|
687 |
if (this.is_multiple) {
|
688 |
this.choice_build(item);
|
689 |
} else {
|
690 |
-
this.
|
691 |
-
if (this.allow_single_deselect) this.single_deselect_control_build();
|
692 |
}
|
693 |
-
if (!(evt.metaKey
|
694 |
-
|
695 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
696 |
return this.search_field_scale();
|
697 |
}
|
698 |
};
|
699 |
|
700 |
-
Chosen.prototype.
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
|
|
|
|
|
|
|
|
|
|
706 |
};
|
707 |
|
708 |
Chosen.prototype.result_deselect = function(pos) {
|
709 |
-
var
|
710 |
result_data = this.results_data[pos];
|
711 |
-
result_data.
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
719 |
};
|
720 |
|
721 |
Chosen.prototype.single_deselect_control_build = function() {
|
722 |
-
if (this.allow_single_deselect
|
723 |
-
return
|
|
|
|
|
|
|
724 |
}
|
|
|
725 |
};
|
726 |
|
727 |
-
Chosen.prototype.
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
if (!option.disabled && !option.empty) {
|
738 |
-
if (option.group) {
|
739 |
-
$('#' + option.dom_id).css('display', 'none');
|
740 |
-
} else if (!(this.is_multiple && option.selected)) {
|
741 |
-
found = false;
|
742 |
-
result_id = option.dom_id;
|
743 |
-
result = $("#" + result_id);
|
744 |
-
if (regex.test(option.html)) {
|
745 |
-
found = true;
|
746 |
-
results += 1;
|
747 |
-
} else if (option.html.indexOf(" ") >= 0 || option.html.indexOf("[") === 0) {
|
748 |
-
parts = option.html.replace(/\[|\]/g, "").split(" ");
|
749 |
-
if (parts.length) {
|
750 |
-
for (_j = 0, _len2 = parts.length; _j < _len2; _j++) {
|
751 |
-
part = parts[_j];
|
752 |
-
if (regex.test(part)) {
|
753 |
-
found = true;
|
754 |
-
results += 1;
|
755 |
-
}
|
756 |
-
}
|
757 |
-
}
|
758 |
-
}
|
759 |
-
if (found) {
|
760 |
-
if (searchText.length) {
|
761 |
-
startpos = option.html.search(zregex);
|
762 |
-
text = option.html.substr(0, startpos + searchText.length) + '</em>' + option.html.substr(startpos + searchText.length);
|
763 |
-
text = text.substr(0, startpos) + '<em>' + text.substr(startpos);
|
764 |
-
} else {
|
765 |
-
text = option.html;
|
766 |
-
}
|
767 |
-
result.html(text);
|
768 |
-
this.result_activate(result);
|
769 |
-
if (option.group_array_index != null) {
|
770 |
-
$("#" + this.results_data[option.group_array_index].dom_id).css('display', 'list-item');
|
771 |
-
}
|
772 |
-
} else {
|
773 |
-
if (this.result_highlight && result_id === this.result_highlight.attr('id')) {
|
774 |
-
this.result_clear_highlight();
|
775 |
-
}
|
776 |
-
this.result_deactivate(result);
|
777 |
-
}
|
778 |
-
}
|
779 |
-
}
|
780 |
-
}
|
781 |
-
if (results < 1 && searchText.length) {
|
782 |
-
return this.no_results(searchText);
|
783 |
-
} else {
|
784 |
-
return this.winnow_results_set_highlight();
|
785 |
-
}
|
786 |
-
};
|
787 |
-
|
788 |
-
Chosen.prototype.winnow_results_clear = function() {
|
789 |
-
var li, lis, _i, _len, _results;
|
790 |
-
this.search_field.val("");
|
791 |
-
lis = this.search_results.find("li");
|
792 |
-
_results = [];
|
793 |
-
for (_i = 0, _len = lis.length; _i < _len; _i++) {
|
794 |
-
li = lis[_i];
|
795 |
-
li = $(li);
|
796 |
-
if (li.hasClass("group-result")) {
|
797 |
-
_results.push(li.css('display', 'auto'));
|
798 |
-
} else if (!this.is_multiple || !li.hasClass("result-selected")) {
|
799 |
-
_results.push(this.result_activate(li));
|
800 |
-
} else {
|
801 |
-
_results.push(void 0);
|
802 |
-
}
|
803 |
-
}
|
804 |
-
return _results;
|
805 |
};
|
806 |
|
807 |
Chosen.prototype.winnow_results_set_highlight = function() {
|
808 |
var do_high, selected_results;
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
}
|
814 |
};
|
815 |
|
816 |
Chosen.prototype.no_results = function(terms) {
|
817 |
var no_results_html;
|
818 |
-
no_results_html =
|
819 |
-
|
820 |
-
return this.
|
|
|
|
|
821 |
};
|
822 |
|
823 |
Chosen.prototype.no_results_clear = function() {
|
@@ -825,15 +1266,15 @@ Copyright (c) 2011 by Harvest
|
|
825 |
};
|
826 |
|
827 |
Chosen.prototype.keydown_arrow = function() {
|
828 |
-
var
|
829 |
-
if (
|
830 |
-
first_active = this.search_results.find("li.active-result").first();
|
831 |
-
if (first_active) this.result_do_highlight($(first_active));
|
832 |
-
} else if (this.results_showing) {
|
833 |
next_sib = this.result_highlight.nextAll("li.active-result").first();
|
834 |
-
if (next_sib)
|
|
|
|
|
|
|
|
|
835 |
}
|
836 |
-
if (!this.results_showing) return this.results_show();
|
837 |
};
|
838 |
|
839 |
Chosen.prototype.keyup_arrow = function() {
|
@@ -845,19 +1286,29 @@ Copyright (c) 2011 by Harvest
|
|
845 |
if (prev_sibs.length) {
|
846 |
return this.result_do_highlight(prev_sibs.first());
|
847 |
} else {
|
848 |
-
if (this.
|
|
|
|
|
849 |
return this.result_clear_highlight();
|
850 |
}
|
851 |
}
|
852 |
};
|
853 |
|
854 |
Chosen.prototype.keydown_backstroke = function() {
|
|
|
855 |
if (this.pending_backstroke) {
|
856 |
this.choice_destroy(this.pending_backstroke.find("a").first());
|
857 |
return this.clear_backstroke();
|
858 |
} else {
|
859 |
-
|
860 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
861 |
}
|
862 |
};
|
863 |
|
@@ -868,79 +1319,41 @@ Copyright (c) 2011 by Harvest
|
|
868 |
return this.pending_backstroke = null;
|
869 |
};
|
870 |
|
871 |
-
Chosen.prototype.keydown_checker = function(evt) {
|
872 |
-
var stroke, _ref;
|
873 |
-
stroke = (_ref = evt.which) != null ? _ref : evt.keyCode;
|
874 |
-
this.search_field_scale();
|
875 |
-
if (stroke !== 8 && this.pending_backstroke) this.clear_backstroke();
|
876 |
-
switch (stroke) {
|
877 |
-
case 8:
|
878 |
-
this.backstroke_length = this.search_field.val().length;
|
879 |
-
break;
|
880 |
-
case 9:
|
881 |
-
if (this.results_showing && !this.is_multiple) this.result_select(evt);
|
882 |
-
this.mouse_on_container = false;
|
883 |
-
break;
|
884 |
-
case 13:
|
885 |
-
evt.preventDefault();
|
886 |
-
break;
|
887 |
-
case 38:
|
888 |
-
evt.preventDefault();
|
889 |
-
this.keyup_arrow();
|
890 |
-
break;
|
891 |
-
case 40:
|
892 |
-
this.keydown_arrow();
|
893 |
-
break;
|
894 |
-
}
|
895 |
-
};
|
896 |
-
|
897 |
Chosen.prototype.search_field_scale = function() {
|
898 |
-
var
|
899 |
-
if (this.is_multiple) {
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
"top": dd_top + "px"
|
922 |
-
});
|
923 |
}
|
|
|
924 |
};
|
925 |
|
926 |
-
Chosen.prototype.
|
927 |
-
|
928 |
-
|
929 |
-
while ($("#" + string).length > 0) {
|
930 |
-
string += this.generate_random_char();
|
931 |
-
}
|
932 |
-
return string;
|
933 |
};
|
934 |
|
935 |
return Chosen;
|
936 |
|
937 |
})(AbstractChosen);
|
938 |
|
939 |
-
get_side_border_padding = function(elmt) {
|
940 |
-
var side_border_padding;
|
941 |
-
return side_border_padding = elmt.outerWidth() - elmt.width();
|
942 |
-
};
|
943 |
-
|
944 |
-
root.get_side_border_padding = get_side_border_padding;
|
945 |
-
|
946 |
}).call(this);
|
1 |
+
/*!
|
2 |
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
3 |
+
by Patrick Filler for Harvest, http://getharvest.com
|
4 |
+
|
5 |
+
Version 1.8.7
|
6 |
+
Full source at https://github.com/harvesthq/chosen
|
7 |
+
Copyright (c) 2011-2018 Harvest http://getharvest.com
|
8 |
+
|
9 |
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
10 |
+
This file is generated by `grunt build`, do not edit it by hand.
|
11 |
+
*/
|
12 |
+
|
13 |
(function() {
|
14 |
+
var $, AbstractChosen, Chosen, SelectParser,
|
15 |
+
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
16 |
+
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
17 |
+
hasProp = {}.hasOwnProperty;
|
18 |
|
19 |
SelectParser = (function() {
|
|
|
20 |
function SelectParser() {
|
21 |
this.options_index = 0;
|
22 |
this.parsed = [];
|
23 |
}
|
24 |
|
25 |
SelectParser.prototype.add_node = function(child) {
|
26 |
+
if (child.nodeName.toUpperCase() === "OPTGROUP") {
|
27 |
return this.add_group(child);
|
28 |
} else {
|
29 |
return this.add_option(child);
|
31 |
};
|
32 |
|
33 |
SelectParser.prototype.add_group = function(group) {
|
34 |
+
var group_position, i, len, option, ref, results1;
|
35 |
group_position = this.parsed.length;
|
36 |
this.parsed.push({
|
37 |
array_index: group_position,
|
38 |
group: true,
|
39 |
label: group.label,
|
40 |
+
title: group.title ? group.title : void 0,
|
41 |
children: 0,
|
42 |
+
disabled: group.disabled,
|
43 |
+
classes: group.className
|
44 |
});
|
45 |
+
ref = group.childNodes;
|
46 |
+
results1 = [];
|
47 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
48 |
+
option = ref[i];
|
49 |
+
results1.push(this.add_option(option, group_position, group.disabled));
|
50 |
}
|
51 |
+
return results1;
|
52 |
};
|
53 |
|
54 |
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
55 |
+
if (option.nodeName.toUpperCase() === "OPTION") {
|
56 |
if (option.text !== "") {
|
57 |
+
if (group_position != null) {
|
58 |
+
this.parsed[group_position].children += 1;
|
59 |
+
}
|
60 |
this.parsed.push({
|
61 |
array_index: this.parsed.length,
|
62 |
options_index: this.options_index,
|
63 |
value: option.value,
|
64 |
text: option.text,
|
65 |
html: option.innerHTML,
|
66 |
+
title: option.title ? option.title : void 0,
|
67 |
selected: option.selected,
|
68 |
disabled: group_disabled === true ? group_disabled : option.disabled,
|
69 |
group_array_index: group_position,
|
70 |
+
group_label: group_position != null ? this.parsed[group_position].label : null,
|
71 |
classes: option.className,
|
72 |
style: option.style.cssText
|
73 |
});
|
87 |
})();
|
88 |
|
89 |
SelectParser.select_to_array = function(select) {
|
90 |
+
var child, i, len, parser, ref;
|
91 |
parser = new SelectParser();
|
92 |
+
ref = select.childNodes;
|
93 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
94 |
+
child = ref[i];
|
95 |
parser.add_node(child);
|
96 |
}
|
97 |
return parser.parsed;
|
98 |
};
|
99 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
AbstractChosen = (function() {
|
101 |
+
function AbstractChosen(form_field, options1) {
|
|
|
102 |
this.form_field = form_field;
|
103 |
+
this.options = options1 != null ? options1 : {};
|
104 |
+
this.label_click_handler = bind(this.label_click_handler, this);
|
105 |
+
if (!AbstractChosen.browser_is_supported()) {
|
106 |
+
return;
|
107 |
+
}
|
108 |
this.is_multiple = this.form_field.multiple;
|
109 |
+
this.set_default_text();
|
110 |
+
this.set_default_values();
|
111 |
this.setup();
|
112 |
this.set_up_html();
|
113 |
this.register_observers();
|
114 |
+
this.on_ready();
|
115 |
}
|
116 |
|
117 |
AbstractChosen.prototype.set_default_values = function() {
|
118 |
+
this.click_test_action = (function(_this) {
|
119 |
+
return function(evt) {
|
120 |
+
return _this.test_active_click(evt);
|
121 |
+
};
|
122 |
+
})(this);
|
123 |
+
this.activate_action = (function(_this) {
|
124 |
+
return function(evt) {
|
125 |
+
return _this.activate_field(evt);
|
126 |
+
};
|
127 |
+
})(this);
|
128 |
this.active_field = false;
|
129 |
this.mouse_on_container = false;
|
130 |
this.results_showing = false;
|
131 |
this.result_highlighted = null;
|
132 |
+
this.is_rtl = this.options.rtl || /\bchzn-rtl\b/.test(this.form_field.className);
|
133 |
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
134 |
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
135 |
+
this.disable_search = this.options.disable_search || false;
|
136 |
+
this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
|
137 |
+
this.group_search = this.options.group_search != null ? this.options.group_search : true;
|
138 |
+
this.search_contains = this.options.search_contains || false;
|
139 |
+
this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
|
140 |
+
this.max_selected_options = this.options.max_selected_options || Infinity;
|
141 |
+
this.inherit_select_classes = this.options.inherit_select_classes || false;
|
142 |
+
this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
|
143 |
+
this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
|
144 |
+
this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
|
145 |
+
this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
|
146 |
+
this.case_sensitive_search = this.options.case_sensitive_search || false;
|
147 |
+
return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;
|
148 |
+
};
|
149 |
+
|
150 |
+
AbstractChosen.prototype.set_default_text = function() {
|
151 |
+
if (this.form_field.getAttribute("data-placeholder")) {
|
152 |
+
this.default_text = this.form_field.getAttribute("data-placeholder");
|
153 |
+
} else if (this.is_multiple) {
|
154 |
+
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
|
155 |
+
} else {
|
156 |
+
this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
|
157 |
+
}
|
158 |
+
this.default_text = this.escape_html(this.default_text);
|
159 |
+
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
|
160 |
+
};
|
161 |
+
|
162 |
+
AbstractChosen.prototype.choice_label = function(item) {
|
163 |
+
if (this.include_group_label_in_selected && (item.group_label != null)) {
|
164 |
+
return "<b class='group-name'>" + (this.escape_html(item.group_label)) + "</b>" + item.html;
|
165 |
+
} else {
|
166 |
+
return item.html;
|
167 |
+
}
|
168 |
};
|
169 |
|
170 |
AbstractChosen.prototype.mouse_enter = function() {
|
176 |
};
|
177 |
|
178 |
AbstractChosen.prototype.input_focus = function(evt) {
|
179 |
+
if (this.is_multiple) {
|
180 |
+
if (!this.active_field) {
|
181 |
+
return setTimeout(((function(_this) {
|
182 |
+
return function() {
|
183 |
+
return _this.container_mousedown();
|
184 |
+
};
|
185 |
+
})(this)), 50);
|
186 |
+
}
|
187 |
+
} else {
|
188 |
+
if (!this.active_field) {
|
189 |
+
return this.activate_field();
|
190 |
+
}
|
191 |
}
|
192 |
};
|
193 |
|
194 |
AbstractChosen.prototype.input_blur = function(evt) {
|
|
|
195 |
if (!this.mouse_on_container) {
|
196 |
this.active_field = false;
|
197 |
+
return setTimeout(((function(_this) {
|
198 |
+
return function() {
|
199 |
+
return _this.blur_test();
|
200 |
+
};
|
201 |
+
})(this)), 100);
|
202 |
}
|
203 |
};
|
204 |
|
205 |
+
AbstractChosen.prototype.label_click_handler = function(evt) {
|
206 |
+
if (this.is_multiple) {
|
207 |
+
return this.container_mousedown(evt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
208 |
} else {
|
209 |
+
return this.activate_field();
|
210 |
+
}
|
211 |
+
};
|
212 |
+
|
213 |
+
AbstractChosen.prototype.results_option_build = function(options) {
|
214 |
+
var content, data, data_content, i, len, ref, shown_results;
|
215 |
+
content = '';
|
216 |
+
shown_results = 0;
|
217 |
+
ref = this.results_data;
|
218 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
219 |
+
data = ref[i];
|
220 |
+
data_content = '';
|
221 |
+
if (data.group) {
|
222 |
+
data_content = this.result_add_group(data);
|
223 |
+
} else {
|
224 |
+
data_content = this.result_add_option(data);
|
225 |
+
}
|
226 |
+
if (data_content !== '') {
|
227 |
+
shown_results++;
|
228 |
+
content += data_content;
|
229 |
+
}
|
230 |
+
if (options != null ? options.first : void 0) {
|
231 |
+
if (data.selected && this.is_multiple) {
|
232 |
+
this.choice_build(data);
|
233 |
+
} else if (data.selected && !this.is_multiple) {
|
234 |
+
this.single_set_selected_text(this.choice_label(data));
|
235 |
+
}
|
236 |
+
}
|
237 |
+
if (shown_results >= this.max_shown_results) {
|
238 |
+
break;
|
239 |
+
}
|
240 |
+
}
|
241 |
+
return content;
|
242 |
+
};
|
243 |
+
|
244 |
+
AbstractChosen.prototype.result_add_option = function(option) {
|
245 |
+
var classes, option_el;
|
246 |
+
if (!option.search_match) {
|
247 |
+
return '';
|
248 |
+
}
|
249 |
+
if (!this.include_option_in_results(option)) {
|
250 |
+
return '';
|
251 |
+
}
|
252 |
+
classes = [];
|
253 |
+
if (!option.disabled && !(option.selected && this.is_multiple)) {
|
254 |
+
classes.push("active-result");
|
255 |
+
}
|
256 |
+
if (option.disabled && !(option.selected && this.is_multiple)) {
|
257 |
+
classes.push("disabled-result");
|
258 |
+
}
|
259 |
+
if (option.selected) {
|
260 |
+
classes.push("result-selected");
|
261 |
+
}
|
262 |
+
if (option.group_array_index != null) {
|
263 |
+
classes.push("group-option");
|
264 |
+
}
|
265 |
+
if (option.classes !== "") {
|
266 |
+
classes.push(option.classes);
|
267 |
+
}
|
268 |
+
option_el = document.createElement("li");
|
269 |
+
option_el.className = classes.join(" ");
|
270 |
+
if (option.style) {
|
271 |
+
option_el.style.cssText = option.style;
|
272 |
+
}
|
273 |
+
option_el.setAttribute("data-option-array-index", option.array_index);
|
274 |
+
option_el.innerHTML = option.highlighted_html || option.html;
|
275 |
+
if (option.title) {
|
276 |
+
option_el.title = option.title;
|
277 |
}
|
278 |
+
return this.outerHTML(option_el);
|
279 |
+
};
|
280 |
+
|
281 |
+
AbstractChosen.prototype.result_add_group = function(group) {
|
282 |
+
var classes, group_el;
|
283 |
+
if (!(group.search_match || group.group_match)) {
|
284 |
+
return '';
|
285 |
+
}
|
286 |
+
if (!(group.active_options > 0)) {
|
287 |
+
return '';
|
288 |
+
}
|
289 |
+
classes = [];
|
290 |
+
classes.push("group-result");
|
291 |
+
if (group.classes) {
|
292 |
+
classes.push(group.classes);
|
293 |
+
}
|
294 |
+
group_el = document.createElement("li");
|
295 |
+
group_el.className = classes.join(" ");
|
296 |
+
group_el.innerHTML = group.highlighted_html || this.escape_html(group.label);
|
297 |
+
if (group.title) {
|
298 |
+
group_el.title = group.title;
|
299 |
+
}
|
300 |
+
return this.outerHTML(group_el);
|
301 |
};
|
302 |
|
303 |
AbstractChosen.prototype.results_update_field = function() {
|
304 |
+
this.set_default_text();
|
305 |
+
if (!this.is_multiple) {
|
306 |
+
this.results_reset_cleanup();
|
307 |
+
}
|
308 |
this.result_clear_highlight();
|
309 |
+
this.results_build();
|
310 |
+
if (this.results_showing) {
|
311 |
+
return this.winnow_results();
|
312 |
+
}
|
313 |
+
};
|
314 |
+
|
315 |
+
AbstractChosen.prototype.reset_single_select_options = function() {
|
316 |
+
var i, len, ref, result, results1;
|
317 |
+
ref = this.results_data;
|
318 |
+
results1 = [];
|
319 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
320 |
+
result = ref[i];
|
321 |
+
if (result.selected) {
|
322 |
+
results1.push(result.selected = false);
|
323 |
+
} else {
|
324 |
+
results1.push(void 0);
|
325 |
+
}
|
326 |
+
}
|
327 |
+
return results1;
|
328 |
};
|
329 |
|
330 |
AbstractChosen.prototype.results_toggle = function() {
|
343 |
}
|
344 |
};
|
345 |
|
346 |
+
AbstractChosen.prototype.winnow_results = function(options) {
|
347 |
+
var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;
|
348 |
+
this.no_results_clear();
|
349 |
+
results = 0;
|
350 |
+
query = this.get_search_text();
|
351 |
+
escapedQuery = query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
352 |
+
regex = this.get_search_regex(escapedQuery);
|
353 |
+
ref = this.results_data;
|
354 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
355 |
+
option = ref[i];
|
356 |
+
option.search_match = false;
|
357 |
+
results_group = null;
|
358 |
+
search_match = null;
|
359 |
+
option.highlighted_html = '';
|
360 |
+
if (this.include_option_in_results(option)) {
|
361 |
+
if (option.group) {
|
362 |
+
option.group_match = false;
|
363 |
+
option.active_options = 0;
|
364 |
+
}
|
365 |
+
if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
|
366 |
+
results_group = this.results_data[option.group_array_index];
|
367 |
+
if (results_group.active_options === 0 && results_group.search_match) {
|
368 |
+
results += 1;
|
369 |
+
}
|
370 |
+
results_group.active_options += 1;
|
371 |
+
}
|
372 |
+
text = option.group ? option.label : option.text;
|
373 |
+
if (!(option.group && !this.group_search)) {
|
374 |
+
search_match = this.search_string_match(text, regex);
|
375 |
+
option.search_match = search_match != null;
|
376 |
+
if (option.search_match && !option.group) {
|
377 |
+
results += 1;
|
378 |
+
}
|
379 |
+
if (option.search_match) {
|
380 |
+
if (query.length) {
|
381 |
+
startpos = search_match.index;
|
382 |
+
prefix = text.slice(0, startpos);
|
383 |
+
fix = text.slice(startpos, startpos + query.length);
|
384 |
+
suffix = text.slice(startpos + query.length);
|
385 |
+
option.highlighted_html = (this.escape_html(prefix)) + "<em>" + (this.escape_html(fix)) + "</em>" + (this.escape_html(suffix));
|
386 |
+
}
|
387 |
+
if (results_group != null) {
|
388 |
+
results_group.group_match = true;
|
389 |
+
}
|
390 |
+
} else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
|
391 |
+
option.search_match = true;
|
392 |
+
}
|
393 |
+
}
|
394 |
+
}
|
395 |
+
}
|
396 |
+
this.result_clear_highlight();
|
397 |
+
if (results < 1 && query.length) {
|
398 |
+
this.update_results_content("");
|
399 |
+
return this.no_results(query);
|
400 |
+
} else {
|
401 |
+
this.update_results_content(this.results_option_build());
|
402 |
+
if (!(options != null ? options.skip_highlight : void 0)) {
|
403 |
+
return this.winnow_results_set_highlight();
|
404 |
+
}
|
405 |
+
}
|
406 |
+
};
|
407 |
+
|
408 |
+
AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
|
409 |
+
var regex_flag, regex_string;
|
410 |
+
regex_string = this.search_contains ? escaped_search_string : "(^|\\s|\\b)" + escaped_search_string + "[^\\s]*";
|
411 |
+
if (!(this.enable_split_word_search || this.search_contains)) {
|
412 |
+
regex_string = "^" + regex_string;
|
413 |
+
}
|
414 |
+
regex_flag = this.case_sensitive_search ? "" : "i";
|
415 |
+
return new RegExp(regex_string, regex_flag);
|
416 |
+
};
|
417 |
+
|
418 |
+
AbstractChosen.prototype.search_string_match = function(search_string, regex) {
|
419 |
+
var match;
|
420 |
+
match = regex.exec(search_string);
|
421 |
+
if (!this.search_contains && (match != null ? match[1] : void 0)) {
|
422 |
+
match.index += 1;
|
423 |
+
}
|
424 |
+
return match;
|
425 |
+
};
|
426 |
+
|
427 |
+
AbstractChosen.prototype.choices_count = function() {
|
428 |
+
var i, len, option, ref;
|
429 |
+
if (this.selected_option_count != null) {
|
430 |
+
return this.selected_option_count;
|
431 |
+
}
|
432 |
+
this.selected_option_count = 0;
|
433 |
+
ref = this.form_field.options;
|
434 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
435 |
+
option = ref[i];
|
436 |
+
if (option.selected) {
|
437 |
+
this.selected_option_count += 1;
|
438 |
+
}
|
439 |
+
}
|
440 |
+
return this.selected_option_count;
|
441 |
+
};
|
442 |
+
|
443 |
+
AbstractChosen.prototype.choices_click = function(evt) {
|
444 |
+
evt.preventDefault();
|
445 |
+
this.activate_field();
|
446 |
+
if (!(this.results_showing || this.is_disabled)) {
|
447 |
+
return this.results_show();
|
448 |
+
}
|
449 |
+
};
|
450 |
+
|
451 |
+
AbstractChosen.prototype.keydown_checker = function(evt) {
|
452 |
+
var ref, stroke;
|
453 |
+
stroke = (ref = evt.which) != null ? ref : evt.keyCode;
|
454 |
+
this.search_field_scale();
|
455 |
+
if (stroke !== 8 && this.pending_backstroke) {
|
456 |
+
this.clear_backstroke();
|
457 |
+
}
|
458 |
+
switch (stroke) {
|
459 |
+
case 8:
|
460 |
+
this.backstroke_length = this.get_search_field_value().length;
|
461 |
+
break;
|
462 |
+
case 9:
|
463 |
+
if (this.results_showing && !this.is_multiple) {
|
464 |
+
this.result_select(evt);
|
465 |
+
}
|
466 |
+
this.mouse_on_container = false;
|
467 |
+
break;
|
468 |
+
case 13:
|
469 |
+
if (this.results_showing) {
|
470 |
+
evt.preventDefault();
|
471 |
+
}
|
472 |
+
break;
|
473 |
+
case 27:
|
474 |
+
if (this.results_showing) {
|
475 |
+
evt.preventDefault();
|
476 |
+
}
|
477 |
+
break;
|
478 |
+
case 32:
|
479 |
+
if (this.disable_search) {
|
480 |
+
evt.preventDefault();
|
481 |
+
}
|
482 |
+
break;
|
483 |
+
case 38:
|
484 |
+
evt.preventDefault();
|
485 |
+
this.keyup_arrow();
|
486 |
+
break;
|
487 |
+
case 40:
|
488 |
+
evt.preventDefault();
|
489 |
+
this.keydown_arrow();
|
490 |
+
break;
|
491 |
+
}
|
492 |
+
};
|
493 |
+
|
494 |
AbstractChosen.prototype.keyup_checker = function(evt) {
|
495 |
+
var ref, stroke;
|
496 |
+
stroke = (ref = evt.which) != null ? ref : evt.keyCode;
|
497 |
this.search_field_scale();
|
498 |
switch (stroke) {
|
499 |
case 8:
|
500 |
+
if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
|
501 |
+
this.keydown_backstroke();
|
502 |
} else if (!this.pending_backstroke) {
|
503 |
this.result_clear_highlight();
|
504 |
+
this.results_search();
|
505 |
}
|
506 |
break;
|
507 |
case 13:
|
508 |
evt.preventDefault();
|
509 |
+
if (this.results_showing) {
|
510 |
+
this.result_select(evt);
|
511 |
+
}
|
512 |
break;
|
513 |
case 27:
|
514 |
+
if (this.results_showing) {
|
515 |
+
this.results_hide();
|
516 |
+
}
|
517 |
+
break;
|
518 |
case 9:
|
519 |
+
case 16:
|
520 |
+
case 17:
|
521 |
+
case 18:
|
522 |
case 38:
|
523 |
case 40:
|
|
|
524 |
case 91:
|
|
|
525 |
break;
|
526 |
default:
|
527 |
+
this.results_search();
|
528 |
+
break;
|
529 |
}
|
530 |
};
|
531 |
|
532 |
+
AbstractChosen.prototype.clipboard_event_checker = function(evt) {
|
533 |
+
if (this.is_disabled) {
|
534 |
+
return;
|
535 |
+
}
|
536 |
+
return setTimeout(((function(_this) {
|
537 |
+
return function() {
|
538 |
+
return _this.results_search();
|
539 |
+
};
|
540 |
+
})(this)), 50);
|
541 |
};
|
542 |
|
543 |
+
AbstractChosen.prototype.container_width = function() {
|
544 |
+
if (this.options.width != null) {
|
545 |
+
return this.options.width;
|
546 |
+
} else {
|
547 |
+
return this.form_field.offsetWidth + "px";
|
548 |
+
}
|
549 |
};
|
550 |
|
551 |
+
AbstractChosen.prototype.include_option_in_results = function(option) {
|
552 |
+
if (this.is_multiple && (!this.display_selected_options && option.selected)) {
|
553 |
+
return false;
|
554 |
+
}
|
555 |
+
if (!this.display_disabled_options && option.disabled) {
|
556 |
+
return false;
|
557 |
+
}
|
558 |
+
if (option.empty) {
|
559 |
+
return false;
|
560 |
+
}
|
561 |
+
return true;
|
562 |
+
};
|
563 |
|
564 |
+
AbstractChosen.prototype.search_results_touchstart = function(evt) {
|
565 |
+
this.touch_started = true;
|
566 |
+
return this.search_results_mouseover(evt);
|
567 |
+
};
|
568 |
|
569 |
+
AbstractChosen.prototype.search_results_touchmove = function(evt) {
|
570 |
+
this.touch_started = false;
|
571 |
+
return this.search_results_mouseout(evt);
|
572 |
+
};
|
573 |
|
574 |
+
AbstractChosen.prototype.search_results_touchend = function(evt) {
|
575 |
+
if (this.touch_started) {
|
576 |
+
return this.search_results_mouseup(evt);
|
577 |
+
}
|
578 |
+
};
|
579 |
|
580 |
+
AbstractChosen.prototype.outerHTML = function(element) {
|
581 |
+
var tmp;
|
582 |
+
if (element.outerHTML) {
|
583 |
+
return element.outerHTML;
|
584 |
+
}
|
585 |
+
tmp = document.createElement("div");
|
586 |
+
tmp.appendChild(element);
|
587 |
+
return tmp.innerHTML;
|
588 |
+
};
|
589 |
|
590 |
+
AbstractChosen.prototype.get_single_html = function() {
|
591 |
+
return "<a class=\"chzn-single chzn-default\">\n <span>" + this.default_text + "</span>\n <div><b></b></div>\n</a>\n<div class=\"chzn-drop\">\n <div class=\"chzn-search\">\n <input class=\"chzn-search-input\" type=\"text\" autocomplete=\"off\" />\n </div>\n <ul class=\"chzn-results\"></ul>\n</div>";
|
592 |
+
};
|
593 |
+
|
594 |
+
AbstractChosen.prototype.get_multi_html = function() {
|
595 |
+
return "<ul class=\"chzn-choices\">\n <li class=\"search-field\">\n <input class=\"chzn-search-input\" type=\"text\" autocomplete=\"off\" value=\"" + this.default_text + "\" />\n </li>\n</ul>\n<div class=\"chzn-drop\">\n <ul class=\"chzn-results\"></ul>\n</div>";
|
596 |
+
};
|
597 |
+
|
598 |
+
AbstractChosen.prototype.get_no_results_html = function(terms) {
|
599 |
+
return "<li class=\"no-results\">\n " + this.results_none_found + " <span>" + (this.escape_html(terms)) + "</span>\n</li>";
|
600 |
+
};
|
601 |
+
|
602 |
+
AbstractChosen.browser_is_supported = function() {
|
603 |
+
if ("Microsoft Internet Explorer" === window.navigator.appName) {
|
604 |
+
return document.documentMode >= 8;
|
605 |
+
}
|
606 |
+
if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {
|
607 |
+
return false;
|
608 |
+
}
|
609 |
+
return true;
|
610 |
+
};
|
611 |
|
612 |
+
AbstractChosen.default_multiple_text = "Select Some Options";
|
613 |
+
|
614 |
+
AbstractChosen.default_single_text = "Select an Option";
|
615 |
+
|
616 |
+
AbstractChosen.default_no_result_text = "No results match";
|
617 |
+
|
618 |
+
return AbstractChosen;
|
619 |
+
|
620 |
+
})();
|
621 |
|
622 |
$ = jQuery;
|
623 |
|
624 |
$.fn.extend({
|
625 |
chosen: function(options) {
|
626 |
+
if (!AbstractChosen.browser_is_supported()) {
|
627 |
return this;
|
628 |
}
|
629 |
+
return this.each(function(input_field) {
|
630 |
+
var $this, chosen;
|
631 |
+
$this = $(this);
|
632 |
+
chosen = $this.data('chosen');
|
633 |
+
if (options === 'destroy') {
|
634 |
+
if (chosen instanceof Chosen) {
|
635 |
+
chosen.destroy();
|
636 |
+
}
|
637 |
+
return;
|
638 |
+
}
|
639 |
+
if (!(chosen instanceof Chosen)) {
|
640 |
+
$this.data('chosen', new Chosen(this, options));
|
641 |
+
}
|
642 |
});
|
643 |
}
|
644 |
});
|
645 |
|
646 |
+
Chosen = (function(superClass) {
|
647 |
+
extend(Chosen, superClass);
|
|
|
648 |
|
649 |
function Chosen() {
|
650 |
+
return Chosen.__super__.constructor.apply(this, arguments);
|
651 |
}
|
652 |
|
653 |
Chosen.prototype.setup = function() {
|
654 |
this.form_field_jq = $(this.form_field);
|
655 |
+
return this.current_selectedIndex = this.form_field.selectedIndex;
|
|
|
|
|
|
|
|
|
656 |
};
|
657 |
|
658 |
Chosen.prototype.set_up_html = function() {
|
659 |
+
var container_classes, container_props;
|
660 |
+
container_classes = ["chzn-container"];
|
661 |
+
container_classes.push("chzn-container-" + (this.is_multiple ? "multi" : "single"));
|
662 |
+
if (this.inherit_select_classes && this.form_field.className) {
|
663 |
+
container_classes.push(this.form_field.className);
|
664 |
+
}
|
665 |
+
if (this.is_rtl) {
|
666 |
+
container_classes.push("chzn-rtl");
|
667 |
+
}
|
668 |
+
container_props = {
|
669 |
+
'class': container_classes.join(' '),
|
670 |
+
'title': this.form_field.title
|
671 |
+
};
|
672 |
+
if (this.form_field.id.length) {
|
673 |
+
container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
|
674 |
+
}
|
675 |
+
this.container = $("<div />", container_props);
|
676 |
+
this.container.width(this.container_width());
|
677 |
if (this.is_multiple) {
|
678 |
+
this.container.html(this.get_multi_html());
|
679 |
} else {
|
680 |
+
this.container.html(this.get_single_html());
|
681 |
}
|
682 |
+
this.form_field_jq.hide().after(this.container);
|
|
|
|
|
683 |
this.dropdown = this.container.find('div.chzn-drop').first();
|
|
|
|
|
|
|
|
|
|
|
|
|
684 |
this.search_field = this.container.find('input').first();
|
685 |
this.search_results = this.container.find('ul.chzn-results').first();
|
686 |
this.search_field_scale();
|
691 |
} else {
|
692 |
this.search_container = this.container.find('div.chzn-search').first();
|
693 |
this.selected_item = this.container.find('.chzn-single').first();
|
|
|
|
|
|
|
|
|
694 |
}
|
695 |
this.results_build();
|
696 |
this.set_tab_index();
|
697 |
+
return this.set_label_behavior();
|
698 |
+
};
|
699 |
+
|
700 |
+
Chosen.prototype.on_ready = function() {
|
701 |
+
return this.form_field_jq.trigger("chosen:ready", {
|
702 |
chosen: this
|
703 |
});
|
704 |
};
|
705 |
|
706 |
Chosen.prototype.register_observers = function() {
|
707 |
+
this.container.on('touchstart.chosen', (function(_this) {
|
708 |
+
return function(evt) {
|
709 |
+
_this.container_mousedown(evt);
|
710 |
+
};
|
711 |
+
})(this));
|
712 |
+
this.container.on('touchend.chosen', (function(_this) {
|
713 |
+
return function(evt) {
|
714 |
+
_this.container_mouseup(evt);
|
715 |
+
};
|
716 |
+
})(this));
|
717 |
+
this.container.on('mousedown.chosen', (function(_this) {
|
718 |
+
return function(evt) {
|
719 |
+
_this.container_mousedown(evt);
|
720 |
+
};
|
721 |
+
})(this));
|
722 |
+
this.container.on('mouseup.chosen', (function(_this) {
|
723 |
+
return function(evt) {
|
724 |
+
_this.container_mouseup(evt);
|
725 |
+
};
|
726 |
+
})(this));
|
727 |
+
this.container.on('mouseenter.chosen', (function(_this) {
|
728 |
+
return function(evt) {
|
729 |
+
_this.mouse_enter(evt);
|
730 |
+
};
|
731 |
+
})(this));
|
732 |
+
this.container.on('mouseleave.chosen', (function(_this) {
|
733 |
+
return function(evt) {
|
734 |
+
_this.mouse_leave(evt);
|
735 |
+
};
|
736 |
+
})(this));
|
737 |
+
this.search_results.on('mouseup.chosen', (function(_this) {
|
738 |
+
return function(evt) {
|
739 |
+
_this.search_results_mouseup(evt);
|
740 |
+
};
|
741 |
+
})(this));
|
742 |
+
this.search_results.on('mouseover.chosen', (function(_this) {
|
743 |
+
return function(evt) {
|
744 |
+
_this.search_results_mouseover(evt);
|
745 |
+
};
|
746 |
+
})(this));
|
747 |
+
this.search_results.on('mouseout.chosen', (function(_this) {
|
748 |
+
return function(evt) {
|
749 |
+
_this.search_results_mouseout(evt);
|
750 |
+
};
|
751 |
+
})(this));
|
752 |
+
this.search_results.on('mousewheel.chosen DOMMouseScroll.chosen', (function(_this) {
|
753 |
+
return function(evt) {
|
754 |
+
_this.search_results_mousewheel(evt);
|
755 |
+
};
|
756 |
+
})(this));
|
757 |
+
this.search_results.on('touchstart.chosen', (function(_this) {
|
758 |
+
return function(evt) {
|
759 |
+
_this.search_results_touchstart(evt);
|
760 |
+
};
|
761 |
+
})(this));
|
762 |
+
this.search_results.on('touchmove.chosen', (function(_this) {
|
763 |
+
return function(evt) {
|
764 |
+
_this.search_results_touchmove(evt);
|
765 |
+
};
|
766 |
+
})(this));
|
767 |
+
this.search_results.on('touchend.chosen', (function(_this) {
|
768 |
+
return function(evt) {
|
769 |
+
_this.search_results_touchend(evt);
|
770 |
+
};
|
771 |
+
})(this));
|
772 |
+
this.form_field_jq.on("chosen:updated.chosen", (function(_this) {
|
773 |
+
return function(evt) {
|
774 |
+
_this.results_update_field(evt);
|
775 |
+
};
|
776 |
+
})(this));
|
777 |
+
this.form_field_jq.on("chosen:activate.chosen", (function(_this) {
|
778 |
+
return function(evt) {
|
779 |
+
_this.activate_field(evt);
|
780 |
+
};
|
781 |
+
})(this));
|
782 |
+
this.form_field_jq.on("chosen:open.chosen", (function(_this) {
|
783 |
+
return function(evt) {
|
784 |
+
_this.container_mousedown(evt);
|
785 |
+
};
|
786 |
+
})(this));
|
787 |
+
this.form_field_jq.on("chosen:close.chosen", (function(_this) {
|
788 |
+
return function(evt) {
|
789 |
+
_this.close_field(evt);
|
790 |
+
};
|
791 |
+
})(this));
|
792 |
+
this.search_field.on('blur.chosen', (function(_this) {
|
793 |
+
return function(evt) {
|
794 |
+
_this.input_blur(evt);
|
795 |
+
};
|
796 |
+
})(this));
|
797 |
+
this.search_field.on('keyup.chosen', (function(_this) {
|
798 |
+
return function(evt) {
|
799 |
+
_this.keyup_checker(evt);
|
800 |
+
};
|
801 |
+
})(this));
|
802 |
+
this.search_field.on('keydown.chosen', (function(_this) {
|
803 |
+
return function(evt) {
|
804 |
+
_this.keydown_checker(evt);
|
805 |
+
};
|
806 |
+
})(this));
|
807 |
+
this.search_field.on('focus.chosen', (function(_this) {
|
808 |
+
return function(evt) {
|
809 |
+
_this.input_focus(evt);
|
810 |
+
};
|
811 |
+
})(this));
|
812 |
+
this.search_field.on('cut.chosen', (function(_this) {
|
813 |
+
return function(evt) {
|
814 |
+
_this.clipboard_event_checker(evt);
|
815 |
+
};
|
816 |
+
})(this));
|
817 |
+
this.search_field.on('paste.chosen', (function(_this) {
|
818 |
+
return function(evt) {
|
819 |
+
_this.clipboard_event_checker(evt);
|
820 |
+
};
|
821 |
+
})(this));
|
822 |
if (this.is_multiple) {
|
823 |
+
return this.search_choices.on('click.chosen', (function(_this) {
|
824 |
+
return function(evt) {
|
825 |
+
_this.choices_click(evt);
|
826 |
+
};
|
827 |
+
})(this));
|
|
|
828 |
} else {
|
829 |
+
return this.container.on('click.chosen', function(evt) {
|
830 |
+
evt.preventDefault();
|
831 |
});
|
832 |
}
|
833 |
};
|
834 |
|
835 |
+
Chosen.prototype.destroy = function() {
|
836 |
+
$(this.container[0].ownerDocument).off('click.chosen', this.click_test_action);
|
837 |
+
if (this.form_field_label.length > 0) {
|
838 |
+
this.form_field_label.off('click.chosen');
|
839 |
+
}
|
840 |
+
if (this.search_field[0].tabIndex) {
|
841 |
+
this.form_field_jq[0].tabIndex = this.search_field[0].tabIndex;
|
842 |
+
}
|
843 |
+
this.container.remove();
|
844 |
+
this.form_field_jq.removeData('chosen');
|
845 |
+
return this.form_field_jq.show();
|
846 |
+
};
|
847 |
+
|
848 |
Chosen.prototype.search_field_disabled = function() {
|
849 |
+
this.is_disabled = this.form_field.disabled || this.form_field_jq.parents('fieldset').is(':disabled');
|
850 |
+
this.container.toggleClass('chzn-disabled', this.is_disabled);
|
851 |
+
this.search_field[0].disabled = this.is_disabled;
|
852 |
+
if (!this.is_multiple) {
|
853 |
+
this.selected_item.off('focus.chosen', this.activate_field);
|
854 |
+
}
|
855 |
if (this.is_disabled) {
|
|
|
|
|
|
|
|
|
|
|
856 |
return this.close_field();
|
857 |
+
} else if (!this.is_multiple) {
|
858 |
+
return this.selected_item.on('focus.chosen', this.activate_field);
|
|
|
|
|
|
|
|
|
859 |
}
|
860 |
};
|
861 |
|
862 |
Chosen.prototype.container_mousedown = function(evt) {
|
863 |
+
var ref;
|
864 |
+
if (this.is_disabled) {
|
865 |
+
return;
|
866 |
+
}
|
867 |
+
if (evt && ((ref = evt.type) === 'mousedown' || ref === 'touchstart') && !this.results_showing) {
|
868 |
+
evt.preventDefault();
|
869 |
+
}
|
870 |
+
if (!((evt != null) && ($(evt.target)).hasClass("search-choice-close"))) {
|
871 |
+
if (!this.active_field) {
|
872 |
+
if (this.is_multiple) {
|
873 |
+
this.search_field.val("");
|
|
|
874 |
}
|
875 |
+
$(this.container[0].ownerDocument).on('click.chosen', this.click_test_action);
|
876 |
+
this.results_show();
|
877 |
+
} else if (!this.is_multiple && evt && (($(evt.target)[0] === this.selected_item[0]) || $(evt.target).parents("a.chzn-single").length)) {
|
878 |
+
evt.preventDefault();
|
879 |
+
this.results_toggle();
|
880 |
}
|
881 |
+
return this.activate_field();
|
882 |
}
|
883 |
};
|
884 |
|
885 |
Chosen.prototype.container_mouseup = function(evt) {
|
886 |
+
if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
|
887 |
+
return this.results_reset(evt);
|
888 |
+
}
|
889 |
+
};
|
890 |
+
|
891 |
+
Chosen.prototype.search_results_mousewheel = function(evt) {
|
892 |
+
var delta;
|
893 |
+
if (evt.originalEvent) {
|
894 |
+
delta = evt.originalEvent.deltaY || -evt.originalEvent.wheelDelta || evt.originalEvent.detail;
|
895 |
+
}
|
896 |
+
if (delta != null) {
|
897 |
+
evt.preventDefault();
|
898 |
+
if (evt.type === 'DOMMouseScroll') {
|
899 |
+
delta = delta * 40;
|
900 |
+
}
|
901 |
+
return this.search_results.scrollTop(delta + this.search_results.scrollTop());
|
902 |
+
}
|
903 |
};
|
904 |
|
905 |
Chosen.prototype.blur_test = function(evt) {
|
909 |
};
|
910 |
|
911 |
Chosen.prototype.close_field = function() {
|
912 |
+
$(this.container[0].ownerDocument).off("click.chosen", this.click_test_action);
|
|
|
|
|
|
|
|
|
913 |
this.active_field = false;
|
914 |
this.results_hide();
|
915 |
this.container.removeClass("chzn-container-active");
|
|
|
916 |
this.clear_backstroke();
|
917 |
this.show_search_field_default();
|
918 |
+
this.search_field_scale();
|
919 |
+
return this.search_field.blur();
|
920 |
};
|
921 |
|
922 |
Chosen.prototype.activate_field = function() {
|
923 |
+
if (this.is_disabled) {
|
924 |
+
return;
|
|
|
925 |
}
|
926 |
this.container.addClass("chzn-container-active");
|
927 |
this.active_field = true;
|
930 |
};
|
931 |
|
932 |
Chosen.prototype.test_active_click = function(evt) {
|
933 |
+
var active_container;
|
934 |
+
active_container = $(evt.target).closest('.chzn-container');
|
935 |
+
if (active_container.length && this.container[0] === active_container[0]) {
|
936 |
return this.active_field = true;
|
937 |
} else {
|
938 |
return this.close_field();
|
940 |
};
|
941 |
|
942 |
Chosen.prototype.results_build = function() {
|
|
|
943 |
this.parsing = true;
|
944 |
+
this.selected_option_count = null;
|
945 |
+
this.results_data = SelectParser.select_to_array(this.form_field);
|
946 |
+
if (this.is_multiple) {
|
947 |
this.search_choices.find("li.search-choice").remove();
|
948 |
+
} else {
|
949 |
+
this.single_set_selected_text();
|
950 |
+
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
|
951 |
+
this.search_field[0].readOnly = true;
|
952 |
this.container.addClass("chzn-container-single-nosearch");
|
953 |
} else {
|
954 |
+
this.search_field[0].readOnly = false;
|
955 |
this.container.removeClass("chzn-container-single-nosearch");
|
956 |
}
|
957 |
}
|
958 |
+
this.update_results_content(this.results_option_build({
|
959 |
+
first: true
|
960 |
+
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
961 |
this.search_field_disabled();
|
962 |
this.show_search_field_default();
|
963 |
this.search_field_scale();
|
|
|
964 |
return this.parsing = false;
|
965 |
};
|
966 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
967 |
Chosen.prototype.result_do_highlight = function(el) {
|
968 |
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
969 |
if (el.length) {
|
984 |
};
|
985 |
|
986 |
Chosen.prototype.result_clear_highlight = function() {
|
987 |
+
if (this.result_highlight) {
|
988 |
+
this.result_highlight.removeClass("highlighted");
|
989 |
+
}
|
990 |
return this.result_highlight = null;
|
991 |
};
|
992 |
|
993 |
Chosen.prototype.results_show = function() {
|
994 |
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
995 |
+
this.form_field_jq.trigger("chosen:maxselected", {
|
996 |
+
chosen: this
|
997 |
+
});
|
998 |
+
return false;
|
|
|
999 |
}
|
1000 |
+
this.container.addClass("chzn-with-drop");
|
|
|
|
|
|
|
|
|
1001 |
this.results_showing = true;
|
1002 |
this.search_field.focus();
|
1003 |
+
this.search_field.val(this.get_search_field_value());
|
1004 |
+
this.winnow_results();
|
1005 |
+
return this.form_field_jq.trigger("chosen:showing_dropdown", {
|
1006 |
+
chosen: this
|
1007 |
+
});
|
1008 |
+
};
|
1009 |
+
|
1010 |
+
Chosen.prototype.update_results_content = function(content) {
|
1011 |
+
return this.search_results.html(content);
|
1012 |
};
|
1013 |
|
1014 |
Chosen.prototype.results_hide = function() {
|
1015 |
+
if (this.results_showing) {
|
1016 |
+
this.result_clear_highlight();
|
1017 |
+
this.container.removeClass("chzn-with-drop");
|
1018 |
+
this.form_field_jq.trigger("chosen:hiding_dropdown", {
|
1019 |
+
chosen: this
|
1020 |
+
});
|
1021 |
}
|
|
|
|
|
|
|
|
|
1022 |
return this.results_showing = false;
|
1023 |
};
|
1024 |
|
1025 |
Chosen.prototype.set_tab_index = function(el) {
|
1026 |
var ti;
|
1027 |
+
if (this.form_field.tabIndex) {
|
1028 |
+
ti = this.form_field.tabIndex;
|
1029 |
+
this.form_field.tabIndex = -1;
|
1030 |
+
return this.search_field[0].tabIndex = ti;
|
1031 |
+
}
|
1032 |
+
};
|
1033 |
+
|
1034 |
+
Chosen.prototype.set_label_behavior = function() {
|
1035 |
+
this.form_field_label = this.form_field_jq.parents("label");
|
1036 |
+
if (!this.form_field_label.length && this.form_field.id.length) {
|
1037 |
+
this.form_field_label = $("label[for='" + this.form_field.id + "']");
|
1038 |
+
}
|
1039 |
+
if (this.form_field_label.length > 0) {
|
1040 |
+
return this.form_field_label.on('click.chosen', this.label_click_handler);
|
1041 |
}
|
1042 |
};
|
1043 |
|
1044 |
Chosen.prototype.show_search_field_default = function() {
|
1045 |
+
if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
|
1046 |
this.search_field.val(this.default_text);
|
1047 |
return this.search_field.addClass("default");
|
1048 |
} else {
|
1056 |
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
1057 |
if (target.length) {
|
1058 |
this.result_highlight = target;
|
1059 |
+
this.result_select(evt);
|
1060 |
+
return this.search_field.focus();
|
1061 |
}
|
1062 |
};
|
1063 |
|
1064 |
Chosen.prototype.search_results_mouseover = function(evt) {
|
1065 |
var target;
|
1066 |
target = $(evt.target).hasClass("active-result") ? $(evt.target) : $(evt.target).parents(".active-result").first();
|
1067 |
+
if (target) {
|
1068 |
+
return this.result_do_highlight(target);
|
1069 |
+
}
|
1070 |
};
|
1071 |
|
1072 |
Chosen.prototype.search_results_mouseout = function(evt) {
|
1073 |
+
if ($(evt.target).hasClass("active-result") || $(evt.target).parents('.active-result').first()) {
|
1074 |
return this.result_clear_highlight();
|
1075 |
}
|
1076 |
};
|
1077 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1078 |
Chosen.prototype.choice_build = function(item) {
|
1079 |
+
var choice, close_link;
|
1080 |
+
choice = $('<li />', {
|
1081 |
+
"class": "search-choice"
|
1082 |
+
}).html("<span>" + (this.choice_label(item)) + "</span>");
|
1083 |
+
if (item.disabled) {
|
1084 |
+
choice.addClass('search-choice-disabled');
|
1085 |
+
} else {
|
1086 |
+
close_link = $('<a />', {
|
1087 |
+
"class": 'search-choice-close',
|
1088 |
+
'data-option-array-index': item.array_index
|
1089 |
+
});
|
1090 |
+
close_link.on('click.chosen', (function(_this) {
|
1091 |
+
return function(evt) {
|
1092 |
+
return _this.choice_destroy_link_click(evt);
|
1093 |
+
};
|
1094 |
+
})(this));
|
1095 |
+
choice.append(close_link);
|
1096 |
+
}
|
1097 |
+
return this.search_container.before(choice);
|
1098 |
};
|
1099 |
|
1100 |
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
1101 |
evt.preventDefault();
|
1102 |
+
evt.stopPropagation();
|
1103 |
if (!this.is_disabled) {
|
|
|
1104 |
return this.choice_destroy($(evt.target));
|
|
|
|
|
1105 |
}
|
1106 |
};
|
1107 |
|
1108 |
Chosen.prototype.choice_destroy = function(link) {
|
1109 |
+
if (this.result_deselect(link[0].getAttribute("data-option-array-index"))) {
|
1110 |
+
if (this.active_field) {
|
1111 |
+
this.search_field.focus();
|
1112 |
+
} else {
|
1113 |
+
this.show_search_field_default();
|
1114 |
+
}
|
1115 |
+
if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {
|
1116 |
+
this.results_hide();
|
1117 |
+
}
|
1118 |
+
link.parents('li').first().remove();
|
1119 |
+
return this.search_field_scale();
|
1120 |
}
|
|
|
|
|
1121 |
};
|
1122 |
|
1123 |
+
Chosen.prototype.results_reset = function() {
|
1124 |
+
this.reset_single_select_options();
|
1125 |
this.form_field.options[0].selected = true;
|
1126 |
+
this.single_set_selected_text();
|
1127 |
this.show_search_field_default();
|
1128 |
+
this.results_reset_cleanup();
|
1129 |
+
this.trigger_form_field_change();
|
1130 |
+
if (this.active_field) {
|
1131 |
+
return this.results_hide();
|
1132 |
+
}
|
1133 |
+
};
|
1134 |
+
|
1135 |
+
Chosen.prototype.results_reset_cleanup = function() {
|
1136 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
1137 |
+
return this.selected_item.find("abbr").remove();
|
1138 |
};
|
1139 |
|
1140 |
Chosen.prototype.result_select = function(evt) {
|
1141 |
+
var high, item;
|
1142 |
if (this.result_highlight) {
|
1143 |
high = this.result_highlight;
|
|
|
1144 |
this.result_clear_highlight();
|
1145 |
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
1146 |
+
this.form_field_jq.trigger("chosen:maxselected", {
|
1147 |
+
chosen: this
|
1148 |
+
});
|
1149 |
+
return false;
|
1150 |
+
}
|
1151 |
if (this.is_multiple) {
|
1152 |
+
high.removeClass("active-result");
|
1153 |
} else {
|
1154 |
+
this.reset_single_select_options();
|
|
|
1155 |
}
|
1156 |
high.addClass("result-selected");
|
1157 |
+
item = this.results_data[high[0].getAttribute("data-option-array-index")];
|
|
|
1158 |
item.selected = true;
|
1159 |
this.form_field.options[item.options_index].selected = true;
|
1160 |
+
this.selected_option_count = null;
|
1161 |
if (this.is_multiple) {
|
1162 |
this.choice_build(item);
|
1163 |
} else {
|
1164 |
+
this.single_set_selected_text(this.choice_label(item));
|
|
|
1165 |
}
|
1166 |
+
if (this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey))) {
|
1167 |
+
if (evt.metaKey || evt.ctrlKey) {
|
1168 |
+
this.winnow_results({
|
1169 |
+
skip_highlight: true
|
1170 |
+
});
|
1171 |
+
} else {
|
1172 |
+
this.search_field.val("");
|
1173 |
+
this.winnow_results();
|
1174 |
+
}
|
1175 |
+
} else {
|
1176 |
+
this.results_hide();
|
1177 |
+
this.show_search_field_default();
|
1178 |
+
}
|
1179 |
+
if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
|
1180 |
+
this.trigger_form_field_change({
|
1181 |
+
selected: this.form_field.options[item.options_index].value
|
1182 |
+
});
|
1183 |
+
}
|
1184 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
1185 |
+
evt.preventDefault();
|
1186 |
return this.search_field_scale();
|
1187 |
}
|
1188 |
};
|
1189 |
|
1190 |
+
Chosen.prototype.single_set_selected_text = function(text) {
|
1191 |
+
if (text == null) {
|
1192 |
+
text = this.default_text;
|
1193 |
+
}
|
1194 |
+
if (text === this.default_text) {
|
1195 |
+
this.selected_item.addClass("chzn-default");
|
1196 |
+
} else {
|
1197 |
+
this.single_deselect_control_build();
|
1198 |
+
this.selected_item.removeClass("chzn-default");
|
1199 |
+
}
|
1200 |
+
return this.selected_item.find("span").html(text);
|
1201 |
};
|
1202 |
|
1203 |
Chosen.prototype.result_deselect = function(pos) {
|
1204 |
+
var result_data;
|
1205 |
result_data = this.results_data[pos];
|
1206 |
+
if (!this.form_field.options[result_data.options_index].disabled) {
|
1207 |
+
result_data.selected = false;
|
1208 |
+
this.form_field.options[result_data.options_index].selected = false;
|
1209 |
+
this.selected_option_count = null;
|
1210 |
+
this.result_clear_highlight();
|
1211 |
+
if (this.results_showing) {
|
1212 |
+
this.winnow_results();
|
1213 |
+
}
|
1214 |
+
this.trigger_form_field_change({
|
1215 |
+
deselected: this.form_field.options[result_data.options_index].value
|
1216 |
+
});
|
1217 |
+
this.search_field_scale();
|
1218 |
+
return true;
|
1219 |
+
} else {
|
1220 |
+
return false;
|
1221 |
+
}
|
1222 |
};
|
1223 |
|
1224 |
Chosen.prototype.single_deselect_control_build = function() {
|
1225 |
+
if (!this.allow_single_deselect) {
|
1226 |
+
return;
|
1227 |
+
}
|
1228 |
+
if (!this.selected_item.find("abbr").length) {
|
1229 |
+
this.selected_item.find("span").first().after("<abbr class=\"search-choice-close\"></abbr>");
|
1230 |
}
|
1231 |
+
return this.selected_item.addClass("chzn-single-with-deselect");
|
1232 |
};
|
1233 |
|
1234 |
+
Chosen.prototype.get_search_field_value = function() {
|
1235 |
+
return this.search_field.val();
|
1236 |
+
};
|
1237 |
+
|
1238 |
+
Chosen.prototype.get_search_text = function() {
|
1239 |
+
return $.trim(this.get_search_field_value());
|
1240 |
+
};
|
1241 |
+
|
1242 |
+
Chosen.prototype.escape_html = function(text) {
|
1243 |
+
return $('<div/>').text(text).html();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1244 |
};
|
1245 |
|
1246 |
Chosen.prototype.winnow_results_set_highlight = function() {
|
1247 |
var do_high, selected_results;
|
1248 |
+
selected_results = !this.is_multiple ? this.search_results.find(".result-selected.active-result") : [];
|
1249 |
+
do_high = selected_results.length ? selected_results.first() : this.search_results.find(".active-result").first();
|
1250 |
+
if (do_high != null) {
|
1251 |
+
return this.result_do_highlight(do_high);
|
1252 |
}
|
1253 |
};
|
1254 |
|
1255 |
Chosen.prototype.no_results = function(terms) {
|
1256 |
var no_results_html;
|
1257 |
+
no_results_html = this.get_no_results_html(terms);
|
1258 |
+
this.search_results.append(no_results_html);
|
1259 |
+
return this.form_field_jq.trigger("chosen:no_results", {
|
1260 |
+
chosen: this
|
1261 |
+
});
|
1262 |
};
|
1263 |
|
1264 |
Chosen.prototype.no_results_clear = function() {
|
1266 |
};
|
1267 |
|
1268 |
Chosen.prototype.keydown_arrow = function() {
|
1269 |
+
var next_sib;
|
1270 |
+
if (this.results_showing && this.result_highlight) {
|
|
|
|
|
|
|
1271 |
next_sib = this.result_highlight.nextAll("li.active-result").first();
|
1272 |
+
if (next_sib) {
|
1273 |
+
return this.result_do_highlight(next_sib);
|
1274 |
+
}
|
1275 |
+
} else {
|
1276 |
+
return this.results_show();
|
1277 |
}
|
|
|
1278 |
};
|
1279 |
|
1280 |
Chosen.prototype.keyup_arrow = function() {
|
1286 |
if (prev_sibs.length) {
|
1287 |
return this.result_do_highlight(prev_sibs.first());
|
1288 |
} else {
|
1289 |
+
if (this.choices_count() > 0) {
|
1290 |
+
this.results_hide();
|
1291 |
+
}
|
1292 |
return this.result_clear_highlight();
|
1293 |
}
|
1294 |
}
|
1295 |
};
|
1296 |
|
1297 |
Chosen.prototype.keydown_backstroke = function() {
|
1298 |
+
var next_available_destroy;
|
1299 |
if (this.pending_backstroke) {
|
1300 |
this.choice_destroy(this.pending_backstroke.find("a").first());
|
1301 |
return this.clear_backstroke();
|
1302 |
} else {
|
1303 |
+
next_available_destroy = this.search_container.siblings("li.search-choice").last();
|
1304 |
+
if (next_available_destroy.length && !next_available_destroy.hasClass("search-choice-disabled")) {
|
1305 |
+
this.pending_backstroke = next_available_destroy;
|
1306 |
+
if (this.single_backstroke_delete) {
|
1307 |
+
return this.keydown_backstroke();
|
1308 |
+
} else {
|
1309 |
+
return this.pending_backstroke.addClass("search-choice-focus");
|
1310 |
+
}
|
1311 |
+
}
|
1312 |
}
|
1313 |
};
|
1314 |
|
1319 |
return this.pending_backstroke = null;
|
1320 |
};
|
1321 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1322 |
Chosen.prototype.search_field_scale = function() {
|
1323 |
+
var div, i, len, style, style_block, styles, width;
|
1324 |
+
if (!this.is_multiple) {
|
1325 |
+
return;
|
1326 |
+
}
|
1327 |
+
style_block = {
|
1328 |
+
position: 'absolute',
|
1329 |
+
left: '-1000px',
|
1330 |
+
top: '-1000px',
|
1331 |
+
display: 'none',
|
1332 |
+
whiteSpace: 'pre'
|
1333 |
+
};
|
1334 |
+
styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];
|
1335 |
+
for (i = 0, len = styles.length; i < len; i++) {
|
1336 |
+
style = styles[i];
|
1337 |
+
style_block[style] = this.search_field.css(style);
|
1338 |
+
}
|
1339 |
+
div = $('<div />').css(style_block);
|
1340 |
+
div.text(this.get_search_field_value());
|
1341 |
+
$('body').append(div);
|
1342 |
+
width = div.width() + 25;
|
1343 |
+
div.remove();
|
1344 |
+
if (this.container.is(':visible')) {
|
1345 |
+
width = Math.min(this.container.outerWidth() - 10, width);
|
|
|
|
|
1346 |
}
|
1347 |
+
return this.search_field.width(width);
|
1348 |
};
|
1349 |
|
1350 |
+
Chosen.prototype.trigger_form_field_change = function(extra) {
|
1351 |
+
this.form_field_jq.trigger("input", extra);
|
1352 |
+
return this.form_field_jq.trigger("change", extra);
|
|
|
|
|
|
|
|
|
1353 |
};
|
1354 |
|
1355 |
return Chosen;
|
1356 |
|
1357 |
})(AbstractChosen);
|
1358 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1359 |
}).call(this);
|
assets/libs/chosen/chosen.jquery.min.js
CHANGED
@@ -1,10 +1,3 @@
|
|
1 |
-
|
2 |
-
// by Patrick Filler for Harvest, http://getharvest.com
|
3 |
-
//
|
4 |
-
// Version 0.9.7
|
5 |
-
// Full source at https://github.com/harvesthq/chosen
|
6 |
-
// Copyright (c) 2011 Harvest http://getharvest.com
|
7 |
|
8 |
-
// MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
9 |
-
// This file is generated by `cake build`, do not edit it by hand.
|
10 |
-
((function(){var a;a=function(){function a(){this.options_index=0,this.parsed=[]}return a.prototype.add_node=function(a){return a.nodeName==="OPTGROUP"?this.add_group(a):this.add_option(a)},a.prototype.add_group=function(a){var b,c,d,e,f,g;b=this.parsed.length,this.parsed.push({array_index:b,group:!0,label:a.label,children:0,disabled:a.disabled}),f=a.childNodes,g=[];for(d=0,e=f.length;d<e;d++)c=f[d],g.push(this.add_option(c,b,a.disabled));return g},a.prototype.add_option=function(a,b,c){if(a.nodeName==="OPTION")return a.text!==""?(b!=null&&(this.parsed[b].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:a.value,text:a.text,html:a.innerHTML,selected:a.selected,disabled:c===!0?c:a.disabled,group_array_index:b,classes:a.className,style:a.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},a}(),a.select_to_array=function(b){var c,d,e,f,g;d=new a,g=b.childNodes;for(e=0,f=g.length;e<f;e++)c=g[e],d.add_node(c);return d.parsed},this.SelectParser=a})).call(this),function(){var a,b;b=this,a=function(){function a(a,b){this.form_field=a,this.options=b!=null?b:{},this.set_default_values(),this.is_multiple=this.form_field.multiple,this.default_text_default=this.is_multiple?"Select Some Options":"Select an Option",this.setup(),this.set_up_html(),this.register_observers(),this.finish_setup()}return a.prototype.set_default_values=function(){var a=this;return this.click_test_action=function(b){return a.test_active_click(b)},this.activate_action=function(b){return a.activate_field(b)},this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.result_single_selected=null,this.allow_single_deselect=this.options.allow_single_deselect!=null&&this.form_field.options[0]!=null&&this.form_field.options[0].text===""?this.options.allow_single_deselect:!1,this.disable_search_threshold=this.options.disable_search_threshold||0,this.choices=0,this.results_none_found=this.options.no_results_text||"No results match"},a.prototype.mouse_enter=function(){return this.mouse_on_container=!0},a.prototype.mouse_leave=function(){return this.mouse_on_container=!1},a.prototype.input_focus=function(a){var b=this;if(!this.active_field)return setTimeout(function(){return b.container_mousedown()},50)},a.prototype.input_blur=function(a){var b=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return b.blur_test()},100)},a.prototype.result_add_option=function(a){var b,c;return a.disabled?"":(a.dom_id=this.container_id+"_o_"+a.array_index,b=a.selected&&this.is_multiple?[]:["active-result"],a.selected&&b.push("result-selected"),a.group_array_index!=null&&b.push("group-option"),a.classes!==""&&b.push(a.classes),c=a.style.cssText!==""?' style="'+a.style+'"':"",'<li id="'+a.dom_id+'" class="'+b.join(" ")+'"'+c+">"+a.html+"</li>")},a.prototype.results_update_field=function(){return this.result_clear_highlight(),this.result_single_selected=null,this.results_build()},a.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},a.prototype.results_search=function(a){return this.results_showing?this.winnow_results():this.results_show()},a.prototype.keyup_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale();switch(b){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:a.preventDefault();if(this.results_showing)return this.result_select(a);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},a.prototype.generate_field_id=function(){var a;return a=this.generate_random_id(),this.form_field.id=a,a},a.prototype.generate_random_char=function(){var a,b,c;return a="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZ",c=Math.floor(Math.random()*a.length),b=a.substring(c,c+1)},a}(),b.AbstractChosen=a}.call(this),function(){var a,b,c,d,e=Object.prototype.hasOwnProperty,f=function(a,b){function d(){this.constructor=a}for(var c in b)e.call(b,c)&&(a[c]=b[c]);return d.prototype=b.prototype,a.prototype=new d,a.__super__=b.prototype,a};d=this,a=jQuery,a.fn.extend({chosen:function(c){return!a.browser.msie||a.browser.version!=="6.0"&&a.browser.version!=="7.0"?a(this).each(function(d){if(!a(this).hasClass("chzn-done"))return new b(this,c)}):this}}),b=function(b){function e(){e.__super__.constructor.apply(this,arguments)}return f(e,b),e.prototype.setup=function(){return this.form_field_jq=a(this.form_field),this.is_rtl=this.form_field_jq.hasClass("chzn-rtl")},e.prototype.finish_setup=function(){return this.form_field_jq.addClass("chzn-done")},e.prototype.set_up_html=function(){var b,d,e,f;return this.container_id=this.form_field.id.length?this.form_field.id.replace(/(:|\.)/g,"_"):this.generate_field_id(),this.container_id+="_chzn",this.f_width=this.form_field_jq.outerWidth(),this.default_text=this.form_field_jq.data("placeholder")?this.form_field_jq.data("placeholder"):this.default_text_default,b=a("<div />",{id:this.container_id,"class":"chzn-container"+(this.is_rtl?" chzn-rtl":""),style:"width: "+this.f_width+"px;"}),this.is_multiple?b.html('<ul class="chzn-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chzn-drop" style="left:-9000px;"><ul class="chzn-results"></ul></div>'):b.html('<a href="javascript:void(0)" class="chzn-single"><span>'+this.default_text+'</span><div><b></b></div></a><div class="chzn-drop" style="left:-9000px;"><div class="chzn-search"><input type="text" autocomplete="off" /></div><ul class="chzn-results"></ul></div>'),this.form_field_jq.hide().after(b),this.container=a("#"+this.container_id),this.container.addClass("chzn-container-"+(this.is_multiple?"multi":"single")),this.dropdown=this.container.find("div.chzn-drop").first(),d=this.container.height(),e=this.f_width-c(this.dropdown),this.dropdown.css({width:e+"px",top:d+"px"}),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first(),f=e-c(this.search_container)-c(this.search_field),this.search_field.css({width:f+"px"})),this.results_build(),this.set_tab_index(),this.form_field_jq.trigger("liszt:ready",{chosen:this})},e.prototype.register_observers=function(){var a=this;return this.container.mousedown(function(b){return a.container_mousedown(b)}),this.container.mouseup(function(b){return a.container_mouseup(b)}),this.container.mouseenter(function(b){return a.mouse_enter(b)}),this.container.mouseleave(function(b){return a.mouse_leave(b)}),this.search_results.mouseup(function(b){return a.search_results_mouseup(b)}),this.search_results.mouseover(function(b){return a.search_results_mouseover(b)}),this.search_results.mouseout(function(b){return a.search_results_mouseout(b)}),this.form_field_jq.bind("liszt:updated",function(b){return a.results_update_field(b)}),this.search_field.blur(function(b){return a.input_blur(b)}),this.search_field.keyup(function(b){return a.keyup_checker(b)}),this.search_field.keydown(function(b){return a.keydown_checker(b)}),this.is_multiple?(this.search_choices.click(function(b){return a.choices_click(b)}),this.search_field.focus(function(b){return a.input_focus(b)})):this.container.click(function(a){return a.preventDefault()})},e.prototype.search_field_disabled=function(){this.is_disabled=this.form_field_jq[0].disabled;if(this.is_disabled)return this.container.addClass("chzn-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus",this.activate_action),this.close_field();this.container.removeClass("chzn-disabled"),this.search_field[0].disabled=!1;if(!this.is_multiple)return this.selected_item.bind("focus",this.activate_action)},e.prototype.container_mousedown=function(b){var c;if(!this.is_disabled)return c=b!=null?a(b.target).hasClass("search-choice-close"):!1,b&&b.type==="mousedown"&&b.stopPropagation(),!this.pending_destroy_click&&!c?(this.active_field?!this.is_multiple&&b&&(a(b.target)[0]===this.selected_item[0]||a(b.target).parents("a.chzn-single").length)&&(b.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),a(document).click(this.click_test_action),this.results_show()),this.activate_field()):this.pending_destroy_click=!1},e.prototype.container_mouseup=function(a){if(a.target.nodeName==="ABBR")return this.results_reset(a)},e.prototype.blur_test=function(a){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},e.prototype.close_field=function(){return a(document).unbind("click",this.click_test_action),this.is_multiple||(this.selected_item.attr("tabindex",this.search_field.attr("tabindex")),this.search_field.attr("tabindex",-1)),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.winnow_results_clear(),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},e.prototype.activate_field=function(){return!this.is_multiple&&!this.active_field&&(this.search_field.attr("tabindex",this.selected_item.attr("tabindex")),this.selected_item.attr("tabindex",-1)),this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},e.prototype.test_active_click=function(b){return a(b.target).parents("#"+this.container_id).length?this.active_field=!0:this.close_field()},e.prototype.results_build=function(){var a,b,c,e,f;this.parsing=!0,this.results_data=d.SelectParser.select_to_array(this.form_field),this.is_multiple&&this.choices>0?(this.search_choices.find("li.search-choice").remove(),this.choices=0):this.is_multiple||(this.selected_item.find("span").text(this.default_text),this.form_field.options.length<=this.disable_search_threshold?this.container.addClass("chzn-container-single-nosearch"):this.container.removeClass("chzn-container-single-nosearch")),a="",f=this.results_data;for(c=0,e=f.length;c<e;c++)b=f[c],b.group?a+=this.result_add_group(b):b.empty||(a+=this.result_add_option(b),b.selected&&this.is_multiple?this.choice_build(b):b.selected&&!this.is_multiple&&(this.selected_item.find("span").text(b.text),this.allow_single_deselect&&this.single_deselect_control_build()));return this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.search_results.html(a),this.parsing=!1},e.prototype.result_add_group=function(b){return b.disabled?"":(b.dom_id=this.container_id+"_g_"+b.array_index,'<li id="'+b.dom_id+'" class="group-result">'+a("<div />").text(b.label).html()+"</li>")},e.prototype.result_do_highlight=function(a){var b,c,d,e,f;if(a.length){this.result_clear_highlight(),this.result_highlight=a,this.result_highlight.addClass("highlighted"),d=parseInt(this.search_results.css("maxHeight"),10),f=this.search_results.scrollTop(),e=d+f,c=this.result_highlight.position().top+this.search_results.scrollTop(),b=c+this.result_highlight.outerHeight();if(b>=e)return this.search_results.scrollTop(b-d>0?b-d:0);if(c<f)return this.search_results.scrollTop(c)}},e.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},e.prototype.results_show=function(){var a;return this.is_multiple||(this.selected_item.addClass("chzn-single-with-drop"),this.result_single_selected&&this.result_do_highlight(this.result_single_selected)),a=this.is_multiple?this.container.height():this.container.height()-1,this.dropdown.css({top:a+"px",left:0}),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.search_field.val()),this.winnow_results()},e.prototype.results_hide=function(){return this.is_multiple||this.selected_item.removeClass("chzn-single-with-drop"),this.result_clear_highlight(),this.dropdown.css({left:"-9000px"}),this.results_showing=!1},e.prototype.set_tab_index=function(a){var b;if(this.form_field_jq.attr("tabindex"))return b=this.form_field_jq.attr("tabindex"),this.form_field_jq.attr("tabindex",-1),this.is_multiple?this.search_field.attr("tabindex",b):(this.selected_item.attr("tabindex",b),this.search_field.attr("tabindex",-1))},e.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},e.prototype.search_results_mouseup=function(b){var c;c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first();if(c.length)return this.result_highlight=c,this.result_select(b)},e.prototype.search_results_mouseover=function(b){var c;c=a(b.target).hasClass("active-result")?a(b.target):a(b.target).parents(".active-result").first();if(c)return this.result_do_highlight(c)},e.prototype.search_results_mouseout=function(b){if(a(b.target).hasClass("active-result"))return this.result_clear_highlight()},e.prototype.choices_click=function(b){b.preventDefault();if(this.active_field&&!a(b.target).hasClass("search-choice")&&!this.results_showing)return this.results_show()},e.prototype.choice_build=function(b){var c,d,e=this;return c=this.container_id+"_c_"+b.array_index,this.choices+=1,this.search_container.before('<li class="search-choice" id="'+c+'"><span>'+b.html+'</span><a href="javascript:void(0)" class="search-choice-close" rel="'+b.array_index+'"></a></li>'),d=a("#"+c).find("a").first(),d.click(function(a){return e.choice_destroy_link_click(a)})},e.prototype.choice_destroy_link_click=function(b){return b.preventDefault(),this.is_disabled?b.stopPropagation:(this.pending_destroy_click=!0,this.choice_destroy(a(b.target)))},e.prototype.choice_destroy=function(a){return this.choices-=1,this.show_search_field_default(),this.is_multiple&&this.choices>0&&this.search_field.val().length<1&&this.results_hide(),this.result_deselect(a.attr("rel")),a.parents("li").first().remove()},e.prototype.results_reset=function(b){this.form_field.options[0].selected=!0,this.selected_item.find("span").text(this.default_text),this.show_search_field_default(),a(b.target).remove(),this.form_field_jq.trigger("change");if(this.active_field)return this.results_hide()},e.prototype.result_select=function(a){var b,c,d,e;if(this.result_highlight)return b=this.result_highlight,c=b.attr("id"),this.result_clear_highlight(),this.is_multiple?this.result_deactivate(b):(this.search_results.find(".result-selected").removeClass("result-selected"),this.result_single_selected=b),b.addClass("result-selected"),e=c.substr(c.lastIndexOf("_")+1),d=this.results_data[e],d.selected=!0,this.form_field.options[d.options_index].selected=!0,this.is_multiple?this.choice_build(d):(this.selected_item.find("span").first().text(d.text),this.allow_single_deselect&&this.single_deselect_control_build()),(!a.metaKey||!this.is_multiple)&&this.results_hide(),this.search_field.val(""),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.result_activate=function(a){return a.addClass("active-result")},e.prototype.result_deactivate=function(a){return a.removeClass("active-result")},e.prototype.result_deselect=function(b){var c,d;return d=this.results_data[b],d.selected=!1,this.form_field.options[d.options_index].selected=!1,c=a("#"+this.container_id+"_o_"+b),c.removeClass("result-selected").addClass("active-result").show(),this.result_clear_highlight(),this.winnow_results(),this.form_field_jq.trigger("change"),this.search_field_scale()},e.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect&&this.selected_item.find("abbr").length<1)return this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>')},e.prototype.winnow_results=function(){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r;this.no_results_clear(),i=0,j=this.search_field.val()===this.default_text?"":a("<div/>").text(a.trim(this.search_field.val())).html(),f=new RegExp("^"+j.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),m=new RegExp(j.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"i"),r=this.results_data;for(n=0,p=r.length;n<p;n++){c=r[n];if(!c.disabled&&!c.empty)if(c.group)a("#"+c.dom_id).css("display","none");else if(!this.is_multiple||!c.selected){b=!1,h=c.dom_id,g=a("#"+h);if(f.test(c.html))b=!0,i+=1;else if(c.html.indexOf(" ")>=0||c.html.indexOf("[")===0){e=c.html.replace(/\[|\]/g,"").split(" ");if(e.length)for(o=0,q=e.length;o<q;o++)d=e[o],f.test(d)&&(b=!0,i+=1)}b?(j.length?(k=c.html.search(m),l=c.html.substr(0,k+j.length)+"</em>"+c.html.substr(k+j.length),l=l.substr(0,k)+"<em>"+l.substr(k)):l=c.html,g.html(l),this.result_activate(g),c.group_array_index!=null&&a("#"+this.results_data[c.group_array_index].dom_id).css("display","list-item")):(this.result_highlight&&h===this.result_highlight.attr("id")&&this.result_clear_highlight(),this.result_deactivate(g))}}return i<1&&j.length?this.no_results(j):this.winnow_results_set_highlight()},e.prototype.winnow_results_clear=function(){var b,c,d,e,f;this.search_field.val(""),c=this.search_results.find("li"),f=[];for(d=0,e=c.length;d<e;d++)b=c[d],b=a(b),b.hasClass("group-result")?f.push(b.css("display","auto")):!this.is_multiple||!b.hasClass("result-selected")?f.push(this.result_activate(b)):f.push(void 0);return f},e.prototype.winnow_results_set_highlight=function(){var a,b;if(!this.result_highlight){b=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),a=b.length?b.first():this.search_results.find(".active-result").first();if(a!=null)return this.result_do_highlight(a)}},e.prototype.no_results=function(b){var c;return c=a('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),c.find("span").first().html(b),this.search_results.append(c)},e.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},e.prototype.keydown_arrow=function(){var b,c;this.result_highlight?this.results_showing&&(c=this.result_highlight.nextAll("li.active-result").first(),c&&this.result_do_highlight(c)):(b=this.search_results.find("li.active-result").first(),b&&this.result_do_highlight(a(b)));if(!this.results_showing)return this.results_show()},e.prototype.keyup_arrow=function(){var a;if(!this.results_showing&&!this.is_multiple)return this.results_show();if(this.result_highlight)return a=this.result_highlight.prevAll("li.active-result"),a.length?this.result_do_highlight(a.first()):(this.choices>0&&this.results_hide(),this.result_clear_highlight())},e.prototype.keydown_backstroke=function(){return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(this.pending_backstroke=this.search_container.siblings("li.search-choice").last(),this.pending_backstroke.addClass("search-choice-focus"))},e.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},e.prototype.keydown_checker=function(a){var b,c;b=(c=a.which)!=null?c:a.keyCode,this.search_field_scale(),b!==8&&this.pending_backstroke&&this.clear_backstroke();switch(b){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(a),this.mouse_on_container=!1;break;case 13:a.preventDefault();break;case 38:a.preventDefault(),this.keyup_arrow();break;case 40:this.keydown_arrow()}},e.prototype.search_field_scale=function(){var b,c,d,e,f,g,h,i,j;if(this.is_multiple){d=0,h=0,f="position:absolute; left: -1000px; top: -1000px; display:none;",g=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"];for(i=0,j=g.length;i<j;i++)e=g[i],f+=e+":"+this.search_field.css(e)+";";return c=a("<div />",{style:f}),c.text(this.search_field.val()),a("body").append(c),h=c.width()+25,c.remove(),h>this.f_width-10&&(h=this.f_width-10),this.search_field.css({width:h+"px"}),b=this.container.height(),this.dropdown.css({top:b+"px"})}},e.prototype.generate_random_id=function(){var b;b="sel"+this.generate_random_char()+this.generate_random_char()+this.generate_random_char();while(a("#"+b).length>0)b+=this.generate_random_char();return b},e}(AbstractChosen),c=function(a){var b;return b=a.outerWidth()-a.width()},d.get_side_border_padding=c}.call(this)
|
1 |
+
/* Chosen v1.8.7 | (c) 2011-2018 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
+
(function(){var t,e,s,i,n=function(t,e){return function(){return t.apply(e,arguments)}},r=function(t,e){function s(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return s.prototype=e.prototype,t.prototype=new s,t.__super__=e.prototype,t},o={}.hasOwnProperty;(i=function(){function t(){this.options_index=0,this.parsed=[]}return t.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},t.prototype.add_group=function(t){var e,s,i,n,r,o;for(e=this.parsed.length,this.parsed.push({array_index:e,group:!0,label:t.label,title:t.title?t.title:void 0,children:0,disabled:t.disabled,classes:t.className}),o=[],s=0,i=(r=t.childNodes).length;s<i;s++)n=r[s],o.push(this.add_option(n,e,t.disabled));return o},t.prototype.add_option=function(t,e,s){if("OPTION"===t.nodeName.toUpperCase())return""!==t.text?(null!=e&&(this.parsed[e].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:t.value,text:t.text,html:t.innerHTML,title:t.title?t.title:void 0,selected:t.selected,disabled:!0===s?s:t.disabled,group_array_index:e,group_label:null!=e?this.parsed[e].label:null,classes:t.className,style:t.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},t}()).select_to_array=function(t){var e,s,n,r,o;for(r=new i,s=0,n=(o=t.childNodes).length;s<n;s++)e=o[s],r.add_node(e);return r.parsed},e=function(){function t(e,s){this.form_field=e,this.options=null!=s?s:{},this.label_click_handler=n(this.label_click_handler,this),t.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return t.prototype.set_default_values=function(){return this.click_test_action=function(t){return function(e){return t.test_active_click(e)}}(this),this.activate_action=function(t){return function(e){return t.activate_field(e)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchzn-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||Infinity,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},t.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||t.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||t.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||t.default_no_result_text},t.prototype.choice_label=function(t){return this.include_group_label_in_selected&&null!=t.group_label?"<b class='group-name'>"+this.escape_html(t.group_label)+"</b>"+t.html:t.html},t.prototype.mouse_enter=function(){return this.mouse_on_container=!0},t.prototype.mouse_leave=function(){return this.mouse_on_container=!1},t.prototype.input_focus=function(t){if(this.is_multiple){if(!this.active_field)return setTimeout(function(t){return function(){return t.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},t.prototype.input_blur=function(t){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(t){return function(){return t.blur_test()}}(this),100)},t.prototype.label_click_handler=function(t){return this.is_multiple?this.container_mousedown(t):this.activate_field()},t.prototype.results_option_build=function(t){var e,s,i,n,r,o,h;for(e="",h=0,n=0,r=(o=this.results_data).length;n<r&&(s=o[n],i="",""!==(i=s.group?this.result_add_group(s):this.result_add_option(s))&&(h++,e+=i),(null!=t?t.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(h>=this.max_shown_results));n++);return e},t.prototype.result_add_option=function(t){var e,s;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),t.style&&(s.style.cssText=t.style),s.setAttribute("data-option-array-index",t.array_index),s.innerHTML=t.highlighted_html||t.html,t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.result_add_group=function(t){var e,s;return(t.search_match||t.group_match)&&t.active_options>0?((e=[]).push("group-result"),t.classes&&e.push(t.classes),s=document.createElement("li"),s.className=e.join(" "),s.innerHTML=t.highlighted_html||this.escape_html(t.label),t.title&&(s.title=t.title),this.outerHTML(s)):""},t.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},t.prototype.reset_single_select_options=function(){var t,e,s,i,n;for(n=[],t=0,e=(s=this.results_data).length;t<e;t++)(i=s[t]).selected?n.push(i.selected=!1):n.push(void 0);return n},t.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},t.prototype.results_search=function(t){return this.results_showing?this.winnow_results():this.results_show()},t.prototype.winnow_results=function(t){var e,s,i,n,r,o,h,l,c,_,a,u,d,p,f;for(this.no_results_clear(),_=0,e=(h=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(e),i=0,n=(l=this.results_data).length;i<n;i++)(r=l[i]).search_match=!1,a=null,u=null,r.highlighted_html="",this.include_option_in_results(r)&&(r.group&&(r.group_match=!1,r.active_options=0),null!=r.group_array_index&&this.results_data[r.group_array_index]&&(0===(a=this.results_data[r.group_array_index]).active_options&&a.search_match&&(_+=1),a.active_options+=1),f=r.group?r.label:r.text,r.group&&!this.group_search||(u=this.search_string_match(f,c),r.search_match=null!=u,r.search_match&&!r.group&&(_+=1),r.search_match?(h.length&&(d=u.index,o=f.slice(0,d),s=f.slice(d,d+h.length),p=f.slice(d+h.length),r.highlighted_html=this.escape_html(o)+"<em>"+this.escape_html(s)+"</em>"+this.escape_html(p)),null!=a&&(a.group_match=!0)):null!=r.group_array_index&&this.results_data[r.group_array_index].search_match&&(r.search_match=!0)));return this.result_clear_highlight(),_<1&&h.length?(this.update_results_content(""),this.no_results(h)):(this.update_results_content(this.results_option_build()),(null!=t?t.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},t.prototype.get_search_regex=function(t){var e,s;return s=this.search_contains?t:"(^|\\s|\\b)"+t+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),e=this.case_sensitive_search?"":"i",new RegExp(s,e)},t.prototype.search_string_match=function(t,e){var s;return s=e.exec(t),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},t.prototype.choices_count=function(){var t,e,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,t=0,e=(s=this.form_field.options).length;t<e;t++)s[t].selected&&(this.selected_option_count+=1);return this.selected_option_count},t.prototype.choices_click=function(t){if(t.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},t.prototype.keydown_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&t.preventDefault();break;case 32:this.disable_search&&t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},t.prototype.keyup_checker=function(t){var e,s;switch(s=null!=(e=t.which)?e:t.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:t.preventDefault(),this.results_showing&&this.result_select(t);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},t.prototype.clipboard_event_checker=function(t){if(!this.is_disabled)return setTimeout(function(t){return function(){return t.results_search()}}(this),50)},t.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},t.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},t.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},t.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},t.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},t.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:((e=document.createElement("div")).appendChild(t),e.innerHTML)},t.prototype.get_single_html=function(){return'<a class="chzn-single chzn-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chzn-drop">\n <div class="chzn-search">\n <input class="chzn-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chzn-results"></ul>\n</div>'},t.prototype.get_multi_html=function(){return'<ul class="chzn-choices">\n <li class="search-field">\n <input class="chzn-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chzn-drop">\n <ul class="chzn-results"></ul>\n</div>'},t.prototype.get_no_results_html=function(t){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(t)+"</span>\n</li>"},t.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},t.default_multiple_text="Select Some Options",t.default_single_text="Select an Option",t.default_no_result_text="No results match",t}(),(t=jQuery).fn.extend({chosen:function(i){return e.browser_is_supported()?this.each(function(e){var n,r;r=(n=t(this)).data("chosen"),"destroy"!==i?r instanceof s||n.data("chosen",new s(this,i)):r instanceof s&&r.destroy()}):this}}),s=function(s){function n(){return n.__super__.constructor.apply(this,arguments)}return r(n,e),n.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex},n.prototype.set_up_html=function(){var e,s;return(e=["chzn-container"]).push("chzn-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chzn-rtl"),s={"class":e.join(" "),title:this.form_field.title},this.form_field.id.length&&(s.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",s),this.container.width(this.container_width()),this.is_multiple?this.container.html(this.get_multi_html()):this.container.html(this.get_single_html()),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chzn-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chzn-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chzn-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chzn-search").first(),this.selected_item=this.container.find(".chzn-single").first()),this.results_build(),this.set_tab_index(),this.set_label_behavior()},n.prototype.on_ready=function(){return this.form_field_jq.trigger("chosen:ready",{chosen:this})},n.prototype.register_observers=function(){return this.container.on("touchstart.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("touchend.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mousedown.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.container.on("mouseup.chosen",function(t){return function(e){t.container_mouseup(e)}}(this)),this.container.on("mouseenter.chosen",function(t){return function(e){t.mouse_enter(e)}}(this)),this.container.on("mouseleave.chosen",function(t){return function(e){t.mouse_leave(e)}}(this)),this.search_results.on("mouseup.chosen",function(t){return function(e){t.search_results_mouseup(e)}}(this)),this.search_results.on("mouseover.chosen",function(t){return function(e){t.search_results_mouseover(e)}}(this)),this.search_results.on("mouseout.chosen",function(t){return function(e){t.search_results_mouseout(e)}}(this)),this.search_results.on("mousewheel.chosen DOMMouseScroll.chosen",function(t){return function(e){t.search_results_mousewheel(e)}}(this)),this.search_results.on("touchstart.chosen",function(t){return function(e){t.search_results_touchstart(e)}}(this)),this.search_results.on("touchmove.chosen",function(t){return function(e){t.search_results_touchmove(e)}}(this)),this.search_results.on("touchend.chosen",function(t){return function(e){t.search_results_touchend(e)}}(this)),this.form_field_jq.on("chosen:updated.chosen",function(t){return function(e){t.results_update_field(e)}}(this)),this.form_field_jq.on("chosen:activate.chosen",function(t){return function(e){t.activate_field(e)}}(this)),this.form_field_jq.on("chosen:open.chosen",function(t){return function(e){t.container_mousedown(e)}}(this)),this.form_field_jq.on("chosen:close.chosen",function(t){return function(e){t.close_field(e)}}(this)),this.search_field.on("blur.chosen",function(t){return function(e){t.input_blur(e)}}(this)),this.search_field.on("keyup.chosen",function(t){return function(e){t.keyup_checker(e)}}(this)),this.search_field.on("keydown.chosen",function(t){return function(e){t.keydown_checker(e)}}(this)),this.search_field.on("focus.chosen",function(t){return function(e){t.input_focus(e)}}(this)),this.search_field.on("cut.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.search_field.on("paste.chosen",function(t){return function(e){t.clipboard_event_checker(e)}}(this)),this.is_multiple?this.search_choices.on("click.chosen",function(t){return function(e){t.choices_click(e)}}(this)):this.container.on("click.chosen",function(t){t.preventDefault()})},n.prototype.destroy=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.form_field_label.length>0&&this.form_field_label.off("click.chosen"),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},n.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field.disabled||this.form_field_jq.parents("fieldset").is(":disabled"),this.container.toggleClass("chzn-disabled",this.is_disabled),this.search_field[0].disabled=this.is_disabled,this.is_multiple||this.selected_item.off("focus.chosen",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.on("focus.chosen",this.activate_field)},n.prototype.container_mousedown=function(e){var s;if(!this.is_disabled)return!e||"mousedown"!==(s=e.type)&&"touchstart"!==s||this.results_showing||e.preventDefault(),null!=e&&t(e.target).hasClass("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chzn-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).on("click.chosen",this.click_test_action),this.results_show()),this.activate_field())},n.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},n.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=t.originalEvent.deltaY||-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e*=40),this.search_results.scrollTop(e+this.search_results.scrollTop())},n.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chzn-container-active"))return this.close_field()},n.prototype.close_field=function(){return t(this.container[0].ownerDocument).off("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chzn-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},n.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClass("chzn-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},n.prototype.test_active_click=function(e){var s;return(s=t(e.target).closest(".chzn-container")).length&&this.container[0]===s[0]?this.active_field=!0:this.close_field()},n.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=i.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chzn-container-single-nosearch")):(this.search_field[0].readOnly=!1,this.container.removeClass("chzn-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},n.prototype.result_do_highlight=function(t){var e,s,i,n,r;if(t.length){if(this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),i=parseInt(this.search_results.css("maxHeight"),10),r=this.search_results.scrollTop(),n=i+r,s=this.result_highlight.position().top+this.search_results.scrollTop(),(e=s+this.result_highlight.outerHeight())>=n)return this.search_results.scrollTop(e-i>0?e-i:0);if(s<r)return this.search_results.scrollTop(s)}},n.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},n.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.container.addClass("chzn-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.val(this.get_search_field_value()),this.winnow_results(),this.form_field_jq.trigger("chosen:showing_dropdown",{chosen:this}))},n.prototype.update_results_content=function(t){return this.search_results.html(t)},n.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClass("chzn-with-drop"),this.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},n.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},n.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.on("click.chosen",this.label_click_handler)},n.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},n.prototype.search_results_mouseup=function(e){var s;if((s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first()).length)return this.result_highlight=s,this.result_select(e),this.search_field.focus()},n.prototype.search_results_mouseover=function(e){var s;if(s=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(s)},n.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result")||t(e.target).parents(".active-result").first())return this.result_clear_highlight()},n.prototype.choice_build=function(e){var s,i;return s=t("<li />",{"class":"search-choice"}).html("<span>"+this.choice_label(e)+"</span>"),e.disabled?s.addClass("search-choice-disabled"):((i=t("<a />",{"class":"search-choice-close","data-option-array-index":e.array_index})).on("click.chosen",function(t){return function(e){return t.choice_destroy_link_click(e)}}(this)),s.append(i)),this.search_container.before(s)},n.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},n.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},n.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},n.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},n.prototype.result_select=function(t){var e,s;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),e.addClass("result-selected"),s=this.results_data[e[0].getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||t.metaKey||t.ctrlKey)?t.metaKey||t.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.val(""),this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change({selected:this.form_field.options[s.options_index].value}),this.current_selectedIndex=this.form_field.selectedIndex,t.preventDefault(),this.search_field_scale())},n.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chzn-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chzn-default")),this.selected_item.find("span").html(t)},n.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change({deselected:this.form_field.options[e.options_index].value}),this.search_field_scale(),!0)},n.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chzn-single-with-deselect")},n.prototype.get_search_field_value=function(){return this.search_field.val()},n.prototype.get_search_text=function(){return t.trim(this.get_search_field_value())},n.prototype.escape_html=function(e){return t("<div/>").text(e).html()},n.prototype.winnow_results_set_highlight=function(){var t,e;if(e=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),null!=(t=e.length?e.first():this.search_results.find(".active-result").first()))return this.result_do_highlight(t)},n.prototype.no_results=function(t){var e;return e=this.get_no_results_html(t),this.search_results.append(e),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},n.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},n.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},n.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result")).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight()):void 0:this.results_show()},n.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last()).length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0},n.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},n.prototype.search_field_scale=function(){var e,s,i,n,r,o,h;if(this.is_multiple){for(r={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s<i;s++)r[n=o[s]]=this.search_field.css(n);return(e=t("<div />").css(r)).text(this.get_search_field_value()),t("body").append(e),h=e.width()+25,e.remove(),this.container.is(":visible")&&(h=Math.min(this.container.outerWidth()-10,h)),this.search_field.width(h)}},n.prototype.trigger_form_field_change=function(t){return this.form_field_jq.trigger("input",t),this.form_field_jq.trigger("change",t)},n}()}).call(this);
|
|
|
|
assets/libs/chosen/chosen.min.css
ADDED
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
3 |
+
by Patrick Filler for Harvest, http://getharvest.com
|
4 |
+
|
5 |
+
Version 1.8.7
|
6 |
+
Full source at https://github.com/harvesthq/chosen
|
7 |
+
Copyright (c) 2011-2018 Harvest http://getharvest.com
|
8 |
+
|
9 |
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
10 |
+
This file is generated by `grunt build`, do not edit it by hand.
|
11 |
+
*/.chzn-container{position:relative;display:inline-block;vertical-align:middle;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.chzn-container *{-webkit-box-sizing:border-box;box-sizing:border-box}.chzn-container .chzn-drop{position:absolute;top:100%;z-index:1010;width:100%;border:1px solid #aaa;border-top:0;background:#fff;-webkit-box-shadow:0 4px 5px rgba(0,0,0,.15);box-shadow:0 4px 5px rgba(0,0,0,.15);clip:rect(0,0,0,0);-webkit-clip-path:inset(100% 100%);clip-path:inset(100% 100%)}.chzn-container.chzn-with-drop .chzn-drop{clip:auto;-webkit-clip-path:none;clip-path:none}.chzn-container a{cursor:pointer}.chzn-container .chzn-single .group-name,.chzn-container .search-choice .group-name{margin-right:4px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;font-weight:400;color:#999}.chzn-container .chzn-single .group-name:after,.chzn-container .search-choice .group-name:after{content:":";padding-left:2px;vertical-align:top}.chzn-container-single .chzn-single{position:relative;display:block;overflow:hidden;padding:0 0 0 8px;height:25px;border:1px solid #aaa;border-radius:5px;background-color:#fff;background:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#fff),color-stop(50%,#f6f6f6),color-stop(52%,#eee),to(#f4f4f4));background:linear-gradient(#fff 20%,#f6f6f6 50%,#eee 52%,#f4f4f4 100%);background-clip:padding-box;-webkit-box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);box-shadow:0 0 3px #fff inset,0 1px 1px rgba(0,0,0,.1);color:#444;text-decoration:none;white-space:nowrap;line-height:24px}.chzn-container-single .chzn-default{color:#999}.chzn-container-single .chzn-single span{display:block;overflow:hidden;margin-right:26px;text-overflow:ellipsis;white-space:nowrap}.chzn-container-single .chzn-single-with-deselect span{margin-right:38px}.chzn-container-single .chzn-single abbr{position:absolute;top:6px;right:26px;display:block;width:12px;height:12px;background:url(chzn-sprite.png) -42px 1px no-repeat;font-size:1px}.chzn-container-single .chzn-single abbr:hover{background-position:-42px -10px}.chzn-container-single.chzn-disabled .chzn-single abbr:hover{background-position:-42px -10px}.chzn-container-single .chzn-single div{position:absolute;top:0;right:0;display:block;width:18px;height:100%}.chzn-container-single .chzn-single div b{display:block;width:100%;height:100%;background:url(chzn-sprite.png) no-repeat 0 2px}.chzn-container-single .chzn-search{position:relative;z-index:1010;margin:0;padding:3px 4px;white-space:nowrap}.chzn-container-single .chzn-search input[type=text]{margin:1px 0;padding:4px 20px 4px 5px;width:100%;height:auto;outline:0;border:1px solid #aaa;background:url(chzn-sprite.png) no-repeat 100% -20px;font-size:1em;font-family:sans-serif;line-height:normal;border-radius:0}.chzn-container-single .chzn-drop{margin-top:-1px;border-radius:0 0 4px 4px;background-clip:padding-box}.chzn-container-single.chzn-container-single-nosearch .chzn-search{position:absolute;clip:rect(0,0,0,0);-webkit-clip-path:inset(100% 100%);clip-path:inset(100% 100%)}.chzn-container .chzn-results{color:#444;position:relative;overflow-x:hidden;overflow-y:auto;margin:0 4px 4px 0;padding:0 0 0 4px;max-height:240px;-webkit-overflow-scrolling:touch}.chzn-container .chzn-results li{display:none;margin:0;padding:5px 6px;list-style:none;line-height:15px;word-wrap:break-word;-webkit-touch-callout:none}.chzn-container .chzn-results li.active-result{display:list-item;cursor:pointer}.chzn-container .chzn-results li.disabled-result{display:list-item;color:#ccc;cursor:default}.chzn-container .chzn-results li.highlighted{background-color:#3875d7;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#3875d7),color-stop(90%,#2a62bc));background-image:linear-gradient(#3875d7 20%,#2a62bc 90%);color:#fff}.chzn-container .chzn-results li.no-results{color:#777;display:list-item;background:#f4f4f4}.chzn-container .chzn-results li.group-result{display:list-item;font-weight:700;cursor:default}.chzn-container .chzn-results li.group-option{padding-left:15px}.chzn-container .chzn-results li em{font-style:normal;text-decoration:underline}.chzn-container-multi .chzn-choices{position:relative;overflow:hidden;margin:0;padding:0 5px;width:100%;height:auto;border:1px solid #aaa;background-color:#fff;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(1%,#eee),color-stop(15%,#fff));background-image:linear-gradient(#eee 1%,#fff 15%);cursor:text}.chzn-container-multi .chzn-choices li{float:left;list-style:none}.chzn-container-multi .chzn-choices li.search-field{margin:0;padding:0;white-space:nowrap}.chzn-container-multi .chzn-choices li.search-field input[type=text]{margin:1px 0;padding:0;height:25px;outline:0;border:0!important;background:0 0!important;-webkit-box-shadow:none;box-shadow:none;color:#999;font-size:100%;font-family:sans-serif;line-height:normal;border-radius:0;width:25px}.chzn-container-multi .chzn-choices li.search-choice{position:relative;margin:3px 5px 3px 0;padding:3px 20px 3px 5px;border:1px solid #aaa;max-width:100%;border-radius:3px;background-color:#eee;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),to(#eee));background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);background-size:100% 19px;background-repeat:repeat-x;background-clip:padding-box;-webkit-box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);box-shadow:0 0 2px #fff inset,0 1px 0 rgba(0,0,0,.05);color:#333;line-height:13px;cursor:default}.chzn-container-multi .chzn-choices li.search-choice span{word-wrap:break-word}.chzn-container-multi .chzn-choices li.search-choice .search-choice-close{position:absolute;top:4px;right:3px;display:block;width:12px;height:12px;background:url(chzn-sprite.png) -42px 1px no-repeat;font-size:1px}.chzn-container-multi .chzn-choices li.search-choice .search-choice-close:hover{background-position:-42px -10px}.chzn-container-multi .chzn-choices li.search-choice-disabled{padding-right:5px;border:1px solid #ccc;background-color:#e4e4e4;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#f4f4f4),color-stop(50%,#f0f0f0),color-stop(52%,#e8e8e8),to(#eee));background-image:linear-gradient(#f4f4f4 20%,#f0f0f0 50%,#e8e8e8 52%,#eee 100%);color:#666}.chzn-container-multi .chzn-choices li.search-choice-focus{background:#d4d4d4}.chzn-container-multi .chzn-choices li.search-choice-focus .search-choice-close{background-position:-42px -10px}.chzn-container-multi .chzn-results{margin:0;padding:0}.chzn-container-multi .chzn-drop .result-selected{display:list-item;color:#ccc;cursor:default}.chzn-container-active .chzn-single{border:1px solid #5897fb;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.chzn-container-active.chzn-with-drop .chzn-single{border:1px solid #aaa;border-bottom-right-radius:0;border-bottom-left-radius:0;background-image:-webkit-gradient(linear,left top,left bottom,color-stop(20%,#eee),color-stop(80%,#fff));background-image:linear-gradient(#eee 20%,#fff 80%);-webkit-box-shadow:0 1px 0 #fff inset;box-shadow:0 1px 0 #fff inset}.chzn-container-active.chzn-with-drop .chzn-single div{border-left:none;background:0 0}.chzn-container-active.chzn-with-drop .chzn-single div b{background-position:-18px 2px}.chzn-container-active .chzn-choices{border:1px solid #5897fb;-webkit-box-shadow:0 0 5px rgba(0,0,0,.3);box-shadow:0 0 5px rgba(0,0,0,.3)}.chzn-container-active .chzn-choices li.search-field input[type=text]{color:#222!important}.chzn-disabled{opacity:.5!important;cursor:default}.chzn-disabled .chzn-single{cursor:default}.chzn-disabled .chzn-choices .search-choice .search-choice-close{cursor:default}.chzn-rtl{text-align:right}.chzn-rtl .chzn-single{overflow:visible;padding:0 8px 0 0}.chzn-rtl .chzn-single span{margin-right:0;margin-left:26px;direction:rtl}.chzn-rtl .chzn-single-with-deselect span{margin-left:38px}.chzn-rtl .chzn-single div{right:auto;left:3px}.chzn-rtl .chzn-single abbr{right:auto;left:26px}.chzn-rtl .chzn-choices li{float:right}.chzn-rtl .chzn-choices li.search-field input[type=text]{direction:rtl}.chzn-rtl .chzn-choices li.search-choice{margin:3px 5px 3px 0;padding:3px 5px 3px 19px}.chzn-rtl .chzn-choices li.search-choice .search-choice-close{right:auto;left:4px}.chzn-rtl.chzn-container-single .chzn-results{margin:0 0 4px 4px;padding:0 4px 0 0}.chzn-rtl .chzn-results li.group-option{padding-right:15px;padding-left:0}.chzn-rtl.chzn-container-active.chzn-with-drop .chzn-single div{border-right:none}.chzn-rtl .chzn-search input[type=text]{padding:4px 5px 4px 20px;background:url(chzn-sprite.png) no-repeat -30px -20px;direction:rtl}.chzn-rtl.chzn-container-single .chzn-single div b{background-position:6px 2px}.chzn-rtl.chzn-container-single.chzn-with-drop .chzn-single div b{background-position:-12px 2px}@media only screen and (-webkit-min-device-pixel-ratio:1.5),only screen and (min-resolution:144dpi),only screen and (min-resolution:1.5dppx){.chzn-container .chzn-results-scroll-down span,.chzn-container .chzn-results-scroll-up span,.chzn-container-multi .chzn-choices .search-choice .search-choice-close,.chzn-container-single .chzn-search input[type=text],.chzn-container-single .chzn-single abbr,.chzn-container-single .chzn-single div b,.chzn-rtl .chzn-search input[type=text]{background-image:url(chzn-sprite@2x.png)!important;background-size:52px 37px!important;background-repeat:no-repeat!important}}
|
assets/libs/chosen/chosen.proto.js
ADDED
@@ -0,0 +1,1401 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*!
|
2 |
+
Chosen, a Select Box Enhancer for jQuery and Prototype
|
3 |
+
by Patrick Filler for Harvest, http://getharvest.com
|
4 |
+
|
5 |
+
Version 1.8.7
|
6 |
+
Full source at https://github.com/harvesthq/chosen
|
7 |
+
Copyright (c) 2011-2018 Harvest http://getharvest.com
|
8 |
+
|
9 |
+
MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
|
10 |
+
This file is generated by `grunt build`, do not edit it by hand.
|
11 |
+
|
12 |
+
Docs: https://harvesthq.github.io/chosen/options.html
|
13 |
+
*/
|
14 |
+
|
15 |
+
(function() {
|
16 |
+
var AbstractChosen, SelectParser,
|
17 |
+
bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
|
18 |
+
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
|
19 |
+
hasProp = {}.hasOwnProperty;
|
20 |
+
|
21 |
+
SelectParser = (function() {
|
22 |
+
function SelectParser() {
|
23 |
+
this.options_index = 0;
|
24 |
+
this.parsed = [];
|
25 |
+
}
|
26 |
+
|
27 |
+
SelectParser.prototype.add_node = function(child) {
|
28 |
+
if (child.nodeName.toUpperCase() === "OPTGROUP") {
|
29 |
+
return this.add_group(child);
|
30 |
+
} else {
|
31 |
+
return this.add_option(child);
|
32 |
+
}
|
33 |
+
};
|
34 |
+
|
35 |
+
SelectParser.prototype.add_group = function(group) {
|
36 |
+
var group_position, i, len, option, ref, results1;
|
37 |
+
group_position = this.parsed.length;
|
38 |
+
this.parsed.push({
|
39 |
+
array_index: group_position,
|
40 |
+
group: true,
|
41 |
+
label: group.label,
|
42 |
+
title: group.title ? group.title : void 0,
|
43 |
+
children: 0,
|
44 |
+
disabled: group.disabled,
|
45 |
+
classes: group.className
|
46 |
+
});
|
47 |
+
ref = group.childNodes;
|
48 |
+
results1 = [];
|
49 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
50 |
+
option = ref[i];
|
51 |
+
results1.push(this.add_option(option, group_position, group.disabled));
|
52 |
+
}
|
53 |
+
return results1;
|
54 |
+
};
|
55 |
+
|
56 |
+
SelectParser.prototype.add_option = function(option, group_position, group_disabled) {
|
57 |
+
if (option.nodeName.toUpperCase() === "OPTION") {
|
58 |
+
if (option.text !== "") {
|
59 |
+
if (group_position != null) {
|
60 |
+
this.parsed[group_position].children += 1;
|
61 |
+
}
|
62 |
+
this.parsed.push({
|
63 |
+
array_index: this.parsed.length,
|
64 |
+
options_index: this.options_index,
|
65 |
+
value: option.value,
|
66 |
+
text: option.text,
|
67 |
+
html: option.innerHTML,
|
68 |
+
title: option.title ? option.title : void 0,
|
69 |
+
selected: option.selected,
|
70 |
+
disabled: group_disabled === true ? group_disabled : option.disabled,
|
71 |
+
group_array_index: group_position,
|
72 |
+
group_label: group_position != null ? this.parsed[group_position].label : null,
|
73 |
+
classes: option.className,
|
74 |
+
style: option.style.cssText
|
75 |
+
});
|
76 |
+
} else {
|
77 |
+
this.parsed.push({
|
78 |
+
array_index: this.parsed.length,
|
79 |
+
options_index: this.options_index,
|
80 |
+
empty: true
|
81 |
+
});
|
82 |
+
}
|
83 |
+
return this.options_index += 1;
|
84 |
+
}
|
85 |
+
};
|
86 |
+
|
87 |
+
return SelectParser;
|
88 |
+
|
89 |
+
})();
|
90 |
+
|
91 |
+
SelectParser.select_to_array = function(select) {
|
92 |
+
var child, i, len, parser, ref;
|
93 |
+
parser = new SelectParser();
|
94 |
+
ref = select.childNodes;
|
95 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
96 |
+
child = ref[i];
|
97 |
+
parser.add_node(child);
|
98 |
+
}
|
99 |
+
return parser.parsed;
|
100 |
+
};
|
101 |
+
|
102 |
+
AbstractChosen = (function() {
|
103 |
+
function AbstractChosen(form_field, options1) {
|
104 |
+
this.form_field = form_field;
|
105 |
+
this.options = options1 != null ? options1 : {};
|
106 |
+
this.label_click_handler = bind(this.label_click_handler, this);
|
107 |
+
if (!AbstractChosen.browser_is_supported()) {
|
108 |
+
return;
|
109 |
+
}
|
110 |
+
this.is_multiple = this.form_field.multiple;
|
111 |
+
this.set_default_text();
|
112 |
+
this.set_default_values();
|
113 |
+
this.setup();
|
114 |
+
this.set_up_html();
|
115 |
+
this.register_observers();
|
116 |
+
this.on_ready();
|
117 |
+
}
|
118 |
+
|
119 |
+
AbstractChosen.prototype.set_default_values = function() {
|
120 |
+
this.click_test_action = (function(_this) {
|
121 |
+
return function(evt) {
|
122 |
+
return _this.test_active_click(evt);
|
123 |
+
};
|
124 |
+
})(this);
|
125 |
+
this.activate_action = (function(_this) {
|
126 |
+
return function(evt) {
|
127 |
+
return _this.activate_field(evt);
|
128 |
+
};
|
129 |
+
})(this);
|
130 |
+
this.active_field = false;
|
131 |
+
this.mouse_on_container = false;
|
132 |
+
this.results_showing = false;
|
133 |
+
this.result_highlighted = null;
|
134 |
+
this.is_rtl = this.options.rtl || /\bchosen-rtl\b/.test(this.form_field.className);
|
135 |
+
this.allow_single_deselect = (this.options.allow_single_deselect != null) && (this.form_field.options[0] != null) && this.form_field.options[0].text === "" ? this.options.allow_single_deselect : false;
|
136 |
+
this.disable_search_threshold = this.options.disable_search_threshold || 0;
|
137 |
+
this.disable_search = this.options.disable_search || false;
|
138 |
+
this.enable_split_word_search = this.options.enable_split_word_search != null ? this.options.enable_split_word_search : true;
|
139 |
+
this.group_search = this.options.group_search != null ? this.options.group_search : true;
|
140 |
+
this.search_contains = this.options.search_contains || false;
|
141 |
+
this.single_backstroke_delete = this.options.single_backstroke_delete != null ? this.options.single_backstroke_delete : true;
|
142 |
+
this.max_selected_options = this.options.max_selected_options || Infinity;
|
143 |
+
this.inherit_select_classes = this.options.inherit_select_classes || false;
|
144 |
+
this.display_selected_options = this.options.display_selected_options != null ? this.options.display_selected_options : true;
|
145 |
+
this.display_disabled_options = this.options.display_disabled_options != null ? this.options.display_disabled_options : true;
|
146 |
+
this.include_group_label_in_selected = this.options.include_group_label_in_selected || false;
|
147 |
+
this.max_shown_results = this.options.max_shown_results || Number.POSITIVE_INFINITY;
|
148 |
+
this.case_sensitive_search = this.options.case_sensitive_search || false;
|
149 |
+
return this.hide_results_on_select = this.options.hide_results_on_select != null ? this.options.hide_results_on_select : true;
|
150 |
+
};
|
151 |
+
|
152 |
+
AbstractChosen.prototype.set_default_text = function() {
|
153 |
+
if (this.form_field.getAttribute("data-placeholder")) {
|
154 |
+
this.default_text = this.form_field.getAttribute("data-placeholder");
|
155 |
+
} else if (this.is_multiple) {
|
156 |
+
this.default_text = this.options.placeholder_text_multiple || this.options.placeholder_text || AbstractChosen.default_multiple_text;
|
157 |
+
} else {
|
158 |
+
this.default_text = this.options.placeholder_text_single || this.options.placeholder_text || AbstractChosen.default_single_text;
|
159 |
+
}
|
160 |
+
this.default_text = this.escape_html(this.default_text);
|
161 |
+
return this.results_none_found = this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || AbstractChosen.default_no_result_text;
|
162 |
+
};
|
163 |
+
|
164 |
+
AbstractChosen.prototype.choice_label = function(item) {
|
165 |
+
if (this.include_group_label_in_selected && (item.group_label != null)) {
|
166 |
+
return "<b class='group-name'>" + (this.escape_html(item.group_label)) + "</b>" + item.html;
|
167 |
+
} else {
|
168 |
+
return item.html;
|
169 |
+
}
|
170 |
+
};
|
171 |
+
|
172 |
+
AbstractChosen.prototype.mouse_enter = function() {
|
173 |
+
return this.mouse_on_container = true;
|
174 |
+
};
|
175 |
+
|
176 |
+
AbstractChosen.prototype.mouse_leave = function() {
|
177 |
+
return this.mouse_on_container = false;
|
178 |
+
};
|
179 |
+
|
180 |
+
AbstractChosen.prototype.input_focus = function(evt) {
|
181 |
+
if (this.is_multiple) {
|
182 |
+
if (!this.active_field) {
|
183 |
+
return setTimeout(((function(_this) {
|
184 |
+
return function() {
|
185 |
+
return _this.container_mousedown();
|
186 |
+
};
|
187 |
+
})(this)), 50);
|
188 |
+
}
|
189 |
+
} else {
|
190 |
+
if (!this.active_field) {
|
191 |
+
return this.activate_field();
|
192 |
+
}
|
193 |
+
}
|
194 |
+
};
|
195 |
+
|
196 |
+
AbstractChosen.prototype.input_blur = function(evt) {
|
197 |
+
if (!this.mouse_on_container) {
|
198 |
+
this.active_field = false;
|
199 |
+
return setTimeout(((function(_this) {
|
200 |
+
return function() {
|
201 |
+
return _this.blur_test();
|
202 |
+
};
|
203 |
+
})(this)), 100);
|
204 |
+
}
|
205 |
+
};
|
206 |
+
|
207 |
+
AbstractChosen.prototype.label_click_handler = function(evt) {
|
208 |
+
if (this.is_multiple) {
|
209 |
+
return this.container_mousedown(evt);
|
210 |
+
} else {
|
211 |
+
return this.activate_field();
|
212 |
+
}
|
213 |
+
};
|
214 |
+
|
215 |
+
AbstractChosen.prototype.results_option_build = function(options) {
|
216 |
+
var content, data, data_content, i, len, ref, shown_results;
|
217 |
+
content = '';
|
218 |
+
shown_results = 0;
|
219 |
+
ref = this.results_data;
|
220 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
221 |
+
data = ref[i];
|
222 |
+
data_content = '';
|
223 |
+
if (data.group) {
|
224 |
+
data_content = this.result_add_group(data);
|
225 |
+
} else {
|
226 |
+
data_content = this.result_add_option(data);
|
227 |
+
}
|
228 |
+
if (data_content !== '') {
|
229 |
+
shown_results++;
|
230 |
+
content += data_content;
|
231 |
+
}
|
232 |
+
if (options != null ? options.first : void 0) {
|
233 |
+
if (data.selected && this.is_multiple) {
|
234 |
+
this.choice_build(data);
|
235 |
+
} else if (data.selected && !this.is_multiple) {
|
236 |
+
this.single_set_selected_text(this.choice_label(data));
|
237 |
+
}
|
238 |
+
}
|
239 |
+
if (shown_results >= this.max_shown_results) {
|
240 |
+
break;
|
241 |
+
}
|
242 |
+
}
|
243 |
+
return content;
|
244 |
+
};
|
245 |
+
|
246 |
+
AbstractChosen.prototype.result_add_option = function(option) {
|
247 |
+
var classes, option_el;
|
248 |
+
if (!option.search_match) {
|
249 |
+
return '';
|
250 |
+
}
|
251 |
+
if (!this.include_option_in_results(option)) {
|
252 |
+
return '';
|
253 |
+
}
|
254 |
+
classes = [];
|
255 |
+
if (!option.disabled && !(option.selected && this.is_multiple)) {
|
256 |
+
classes.push("active-result");
|
257 |
+
}
|
258 |
+
if (option.disabled && !(option.selected && this.is_multiple)) {
|
259 |
+
classes.push("disabled-result");
|
260 |
+
}
|
261 |
+
if (option.selected) {
|
262 |
+
classes.push("result-selected");
|
263 |
+
}
|
264 |
+
if (option.group_array_index != null) {
|
265 |
+
classes.push("group-option");
|
266 |
+
}
|
267 |
+
if (option.classes !== "") {
|
268 |
+
classes.push(option.classes);
|
269 |
+
}
|
270 |
+
option_el = document.createElement("li");
|
271 |
+
option_el.className = classes.join(" ");
|
272 |
+
if (option.style) {
|
273 |
+
option_el.style.cssText = option.style;
|
274 |
+
}
|
275 |
+
option_el.setAttribute("data-option-array-index", option.array_index);
|
276 |
+
option_el.innerHTML = option.highlighted_html || option.html;
|
277 |
+
if (option.title) {
|
278 |
+
option_el.title = option.title;
|
279 |
+
}
|
280 |
+
return this.outerHTML(option_el);
|
281 |
+
};
|
282 |
+
|
283 |
+
AbstractChosen.prototype.result_add_group = function(group) {
|
284 |
+
var classes, group_el;
|
285 |
+
if (!(group.search_match || group.group_match)) {
|
286 |
+
return '';
|
287 |
+
}
|
288 |
+
if (!(group.active_options > 0)) {
|
289 |
+
return '';
|
290 |
+
}
|
291 |
+
classes = [];
|
292 |
+
classes.push("group-result");
|
293 |
+
if (group.classes) {
|
294 |
+
classes.push(group.classes);
|
295 |
+
}
|
296 |
+
group_el = document.createElement("li");
|
297 |
+
group_el.className = classes.join(" ");
|
298 |
+
group_el.innerHTML = group.highlighted_html || this.escape_html(group.label);
|
299 |
+
if (group.title) {
|
300 |
+
group_el.title = group.title;
|
301 |
+
}
|
302 |
+
return this.outerHTML(group_el);
|
303 |
+
};
|
304 |
+
|
305 |
+
AbstractChosen.prototype.results_update_field = function() {
|
306 |
+
this.set_default_text();
|
307 |
+
if (!this.is_multiple) {
|
308 |
+
this.results_reset_cleanup();
|
309 |
+
}
|
310 |
+
this.result_clear_highlight();
|
311 |
+
this.results_build();
|
312 |
+
if (this.results_showing) {
|
313 |
+
return this.winnow_results();
|
314 |
+
}
|
315 |
+
};
|
316 |
+
|
317 |
+
AbstractChosen.prototype.reset_single_select_options = function() {
|
318 |
+
var i, len, ref, result, results1;
|
319 |
+
ref = this.results_data;
|
320 |
+
results1 = [];
|
321 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
322 |
+
result = ref[i];
|
323 |
+
if (result.selected) {
|
324 |
+
results1.push(result.selected = false);
|
325 |
+
} else {
|
326 |
+
results1.push(void 0);
|
327 |
+
}
|
328 |
+
}
|
329 |
+
return results1;
|
330 |
+
};
|
331 |
+
|
332 |
+
AbstractChosen.prototype.results_toggle = function() {
|
333 |
+
if (this.results_showing) {
|
334 |
+
return this.results_hide();
|
335 |
+
} else {
|
336 |
+
return this.results_show();
|
337 |
+
}
|
338 |
+
};
|
339 |
+
|
340 |
+
AbstractChosen.prototype.results_search = function(evt) {
|
341 |
+
if (this.results_showing) {
|
342 |
+
return this.winnow_results();
|
343 |
+
} else {
|
344 |
+
return this.results_show();
|
345 |
+
}
|
346 |
+
};
|
347 |
+
|
348 |
+
AbstractChosen.prototype.winnow_results = function(options) {
|
349 |
+
var escapedQuery, fix, i, len, option, prefix, query, ref, regex, results, results_group, search_match, startpos, suffix, text;
|
350 |
+
this.no_results_clear();
|
351 |
+
results = 0;
|
352 |
+
query = this.get_search_text();
|
353 |
+
escapedQuery = query.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
|
354 |
+
regex = this.get_search_regex(escapedQuery);
|
355 |
+
ref = this.results_data;
|
356 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
357 |
+
option = ref[i];
|
358 |
+
option.search_match = false;
|
359 |
+
results_group = null;
|
360 |
+
search_match = null;
|
361 |
+
option.highlighted_html = '';
|
362 |
+
if (this.include_option_in_results(option)) {
|
363 |
+
if (option.group) {
|
364 |
+
option.group_match = false;
|
365 |
+
option.active_options = 0;
|
366 |
+
}
|
367 |
+
if ((option.group_array_index != null) && this.results_data[option.group_array_index]) {
|
368 |
+
results_group = this.results_data[option.group_array_index];
|
369 |
+
if (results_group.active_options === 0 && results_group.search_match) {
|
370 |
+
results += 1;
|
371 |
+
}
|
372 |
+
results_group.active_options += 1;
|
373 |
+
}
|
374 |
+
text = option.group ? option.label : option.text;
|
375 |
+
if (!(option.group && !this.group_search)) {
|
376 |
+
search_match = this.search_string_match(text, regex);
|
377 |
+
option.search_match = search_match != null;
|
378 |
+
if (option.search_match && !option.group) {
|
379 |
+
results += 1;
|
380 |
+
}
|
381 |
+
if (option.search_match) {
|
382 |
+
if (query.length) {
|
383 |
+
startpos = search_match.index;
|
384 |
+
prefix = text.slice(0, startpos);
|
385 |
+
fix = text.slice(startpos, startpos + query.length);
|
386 |
+
suffix = text.slice(startpos + query.length);
|
387 |
+
option.highlighted_html = (this.escape_html(prefix)) + "<em>" + (this.escape_html(fix)) + "</em>" + (this.escape_html(suffix));
|
388 |
+
}
|
389 |
+
if (results_group != null) {
|
390 |
+
results_group.group_match = true;
|
391 |
+
}
|
392 |
+
} else if ((option.group_array_index != null) && this.results_data[option.group_array_index].search_match) {
|
393 |
+
option.search_match = true;
|
394 |
+
}
|
395 |
+
}
|
396 |
+
}
|
397 |
+
}
|
398 |
+
this.result_clear_highlight();
|
399 |
+
if (results < 1 && query.length) {
|
400 |
+
this.update_results_content("");
|
401 |
+
return this.no_results(query);
|
402 |
+
} else {
|
403 |
+
this.update_results_content(this.results_option_build());
|
404 |
+
if (!(options != null ? options.skip_highlight : void 0)) {
|
405 |
+
return this.winnow_results_set_highlight();
|
406 |
+
}
|
407 |
+
}
|
408 |
+
};
|
409 |
+
|
410 |
+
AbstractChosen.prototype.get_search_regex = function(escaped_search_string) {
|
411 |
+
var regex_flag, regex_string;
|
412 |
+
regex_string = this.search_contains ? escaped_search_string : "(^|\\s|\\b)" + escaped_search_string + "[^\\s]*";
|
413 |
+
if (!(this.enable_split_word_search || this.search_contains)) {
|
414 |
+
regex_string = "^" + regex_string;
|
415 |
+
}
|
416 |
+
regex_flag = this.case_sensitive_search ? "" : "i";
|
417 |
+
return new RegExp(regex_string, regex_flag);
|
418 |
+
};
|
419 |
+
|
420 |
+
AbstractChosen.prototype.search_string_match = function(search_string, regex) {
|
421 |
+
var match;
|
422 |
+
match = regex.exec(search_string);
|
423 |
+
if (!this.search_contains && (match != null ? match[1] : void 0)) {
|
424 |
+
match.index += 1;
|
425 |
+
}
|
426 |
+
return match;
|
427 |
+
};
|
428 |
+
|
429 |
+
AbstractChosen.prototype.choices_count = function() {
|
430 |
+
var i, len, option, ref;
|
431 |
+
if (this.selected_option_count != null) {
|
432 |
+
return this.selected_option_count;
|
433 |
+
}
|
434 |
+
this.selected_option_count = 0;
|
435 |
+
ref = this.form_field.options;
|
436 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
437 |
+
option = ref[i];
|
438 |
+
if (option.selected) {
|
439 |
+
this.selected_option_count += 1;
|
440 |
+
}
|
441 |
+
}
|
442 |
+
return this.selected_option_count;
|
443 |
+
};
|
444 |
+
|
445 |
+
AbstractChosen.prototype.choices_click = function(evt) {
|
446 |
+
evt.preventDefault();
|
447 |
+
this.activate_field();
|
448 |
+
if (!(this.results_showing || this.is_disabled)) {
|
449 |
+
return this.results_show();
|
450 |
+
}
|
451 |
+
};
|
452 |
+
|
453 |
+
AbstractChosen.prototype.keydown_checker = function(evt) {
|
454 |
+
var ref, stroke;
|
455 |
+
stroke = (ref = evt.which) != null ? ref : evt.keyCode;
|
456 |
+
this.search_field_scale();
|
457 |
+
if (stroke !== 8 && this.pending_backstroke) {
|
458 |
+
this.clear_backstroke();
|
459 |
+
}
|
460 |
+
switch (stroke) {
|
461 |
+
case 8:
|
462 |
+
this.backstroke_length = this.get_search_field_value().length;
|
463 |
+
break;
|
464 |
+
case 9:
|
465 |
+
if (this.results_showing && !this.is_multiple) {
|
466 |
+
this.result_select(evt);
|
467 |
+
}
|
468 |
+
this.mouse_on_container = false;
|
469 |
+
break;
|
470 |
+
case 13:
|
471 |
+
if (this.results_showing) {
|
472 |
+
evt.preventDefault();
|
473 |
+
}
|
474 |
+
break;
|
475 |
+
case 27:
|
476 |
+
if (this.results_showing) {
|
477 |
+
evt.preventDefault();
|
478 |
+
}
|
479 |
+
break;
|
480 |
+
case 32:
|
481 |
+
if (this.disable_search) {
|
482 |
+
evt.preventDefault();
|
483 |
+
}
|
484 |
+
break;
|
485 |
+
case 38:
|
486 |
+
evt.preventDefault();
|
487 |
+
this.keyup_arrow();
|
488 |
+
break;
|
489 |
+
case 40:
|
490 |
+
evt.preventDefault();
|
491 |
+
this.keydown_arrow();
|
492 |
+
break;
|
493 |
+
}
|
494 |
+
};
|
495 |
+
|
496 |
+
AbstractChosen.prototype.keyup_checker = function(evt) {
|
497 |
+
var ref, stroke;
|
498 |
+
stroke = (ref = evt.which) != null ? ref : evt.keyCode;
|
499 |
+
this.search_field_scale();
|
500 |
+
switch (stroke) {
|
501 |
+
case 8:
|
502 |
+
if (this.is_multiple && this.backstroke_length < 1 && this.choices_count() > 0) {
|
503 |
+
this.keydown_backstroke();
|
504 |
+
} else if (!this.pending_backstroke) {
|
505 |
+
this.result_clear_highlight();
|
506 |
+
this.results_search();
|
507 |
+
}
|
508 |
+
break;
|
509 |
+
case 13:
|
510 |
+
evt.preventDefault();
|
511 |
+
if (this.results_showing) {
|
512 |
+
this.result_select(evt);
|
513 |
+
}
|
514 |
+
break;
|
515 |
+
case 27:
|
516 |
+
if (this.results_showing) {
|
517 |
+
this.results_hide();
|
518 |
+
}
|
519 |
+
break;
|
520 |
+
case 9:
|
521 |
+
case 16:
|
522 |
+
case 17:
|
523 |
+
case 18:
|
524 |
+
case 38:
|
525 |
+
case 40:
|
526 |
+
case 91:
|
527 |
+
break;
|
528 |
+
default:
|
529 |
+
this.results_search();
|
530 |
+
break;
|
531 |
+
}
|
532 |
+
};
|
533 |
+
|
534 |
+
AbstractChosen.prototype.clipboard_event_checker = function(evt) {
|
535 |
+
if (this.is_disabled) {
|
536 |
+
return;
|
537 |
+
}
|
538 |
+
return setTimeout(((function(_this) {
|
539 |
+
return function() {
|
540 |
+
return _this.results_search();
|
541 |
+
};
|
542 |
+
})(this)), 50);
|
543 |
+
};
|
544 |
+
|
545 |
+
AbstractChosen.prototype.container_width = function() {
|
546 |
+
if (this.options.width != null) {
|
547 |
+
return this.options.width;
|
548 |
+
} else {
|
549 |
+
return this.form_field.offsetWidth + "px";
|
550 |
+
}
|
551 |
+
};
|
552 |
+
|
553 |
+
AbstractChosen.prototype.include_option_in_results = function(option) {
|
554 |
+
if (this.is_multiple && (!this.display_selected_options && option.selected)) {
|
555 |
+
return false;
|
556 |
+
}
|
557 |
+
if (!this.display_disabled_options && option.disabled) {
|
558 |
+
return false;
|
559 |
+
}
|
560 |
+
if (option.empty) {
|
561 |
+
return false;
|
562 |
+
}
|
563 |
+
return true;
|
564 |
+
};
|
565 |
+
|
566 |
+
AbstractChosen.prototype.search_results_touchstart = function(evt) {
|
567 |
+
this.touch_started = true;
|
568 |
+
return this.search_results_mouseover(evt);
|
569 |
+
};
|
570 |
+
|
571 |
+
AbstractChosen.prototype.search_results_touchmove = function(evt) {
|
572 |
+
this.touch_started = false;
|
573 |
+
return this.search_results_mouseout(evt);
|
574 |
+
};
|
575 |
+
|
576 |
+
AbstractChosen.prototype.search_results_touchend = function(evt) {
|
577 |
+
if (this.touch_started) {
|
578 |
+
return this.search_results_mouseup(evt);
|
579 |
+
}
|
580 |
+
};
|
581 |
+
|
582 |
+
AbstractChosen.prototype.outerHTML = function(element) {
|
583 |
+
var tmp;
|
584 |
+
if (element.outerHTML) {
|
585 |
+
return element.outerHTML;
|
586 |
+
}
|
587 |
+
tmp = document.createElement("div");
|
588 |
+
tmp.appendChild(element);
|
589 |
+
return tmp.innerHTML;
|
590 |
+
};
|
591 |
+
|
592 |
+
AbstractChosen.prototype.get_single_html = function() {
|
593 |
+
return "<a class=\"chosen-single chosen-default\">\n <span>" + this.default_text + "</span>\n <div><b></b></div>\n</a>\n<div class=\"chosen-drop\">\n <div class=\"chosen-search\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" />\n </div>\n <ul class=\"chosen-results\"></ul>\n</div>";
|
594 |
+
};
|
595 |
+
|
596 |
+
AbstractChosen.prototype.get_multi_html = function() {
|
597 |
+
return "<ul class=\"chosen-choices\">\n <li class=\"search-field\">\n <input class=\"chosen-search-input\" type=\"text\" autocomplete=\"off\" value=\"" + this.default_text + "\" />\n </li>\n</ul>\n<div class=\"chosen-drop\">\n <ul class=\"chosen-results\"></ul>\n</div>";
|
598 |
+
};
|
599 |
+
|
600 |
+
AbstractChosen.prototype.get_no_results_html = function(terms) {
|
601 |
+
return "<li class=\"no-results\">\n " + this.results_none_found + " <span>" + (this.escape_html(terms)) + "</span>\n</li>";
|
602 |
+
};
|
603 |
+
|
604 |
+
AbstractChosen.browser_is_supported = function() {
|
605 |
+
if ("Microsoft Internet Explorer" === window.navigator.appName) {
|
606 |
+
return document.documentMode >= 8;
|
607 |
+
}
|
608 |
+
if (/iP(od|hone)/i.test(window.navigator.userAgent) || /IEMobile/i.test(window.navigator.userAgent) || /Windows Phone/i.test(window.navigator.userAgent) || /BlackBerry/i.test(window.navigator.userAgent) || /BB10/i.test(window.navigator.userAgent) || /Android.*Mobile/i.test(window.navigator.userAgent)) {
|
609 |
+
return false;
|
610 |
+
}
|
611 |
+
return true;
|
612 |
+
};
|
613 |
+
|
614 |
+
AbstractChosen.default_multiple_text = "Select Some Options";
|
615 |
+
|
616 |
+
AbstractChosen.default_single_text = "Select an Option";
|
617 |
+
|
618 |
+
AbstractChosen.default_no_result_text = "No results match";
|
619 |
+
|
620 |
+
return AbstractChosen;
|
621 |
+
|
622 |
+
})();
|
623 |
+
|
624 |
+
this.Chosen = (function(superClass) {
|
625 |
+
var triggerHtmlEvent;
|
626 |
+
|
627 |
+
extend(Chosen, superClass);
|
628 |
+
|
629 |
+
function Chosen() {
|
630 |
+
return Chosen.__super__.constructor.apply(this, arguments);
|
631 |
+
}
|
632 |
+
|
633 |
+
Chosen.prototype.setup = function() {
|
634 |
+
return this.current_selectedIndex = this.form_field.selectedIndex;
|
635 |
+
};
|
636 |
+
|
637 |
+
Chosen.prototype.set_up_html = function() {
|
638 |
+
var container_classes, container_props;
|
639 |
+
container_classes = ["chosen-container"];
|
640 |
+
container_classes.push("chosen-container-" + (this.is_multiple ? "multi" : "single"));
|
641 |
+
if (this.inherit_select_classes && this.form_field.className) {
|
642 |
+
container_classes.push(this.form_field.className);
|
643 |
+
}
|
644 |
+
if (this.is_rtl) {
|
645 |
+
container_classes.push("chosen-rtl");
|
646 |
+
}
|
647 |
+
container_props = {
|
648 |
+
'class': container_classes.join(' '),
|
649 |
+
'title': this.form_field.title
|
650 |
+
};
|
651 |
+
if (this.form_field.id.length) {
|
652 |
+
container_props.id = this.form_field.id.replace(/[^\w]/g, '_') + "_chosen";
|
653 |
+
}
|
654 |
+
this.container = new Element('div', container_props);
|
655 |
+
this.container.setStyle({
|
656 |
+
width: this.container_width()
|
657 |
+
});
|
658 |
+
if (this.is_multiple) {
|
659 |
+
this.container.update(this.get_multi_html());
|
660 |
+
} else {
|
661 |
+
this.container.update(this.get_single_html());
|
662 |
+
}
|
663 |
+
this.form_field.hide().insert({
|
664 |
+
after: this.container
|
665 |
+
});
|
666 |
+
this.dropdown = this.container.down('div.chosen-drop');
|
667 |
+
this.search_field = this.container.down('input');
|
668 |
+
this.search_results = this.container.down('ul.chosen-results');
|
669 |
+
this.search_field_scale();
|
670 |
+
this.search_no_results = this.container.down('li.no-results');
|
671 |
+
if (this.is_multiple) {
|
672 |
+
this.search_choices = this.container.down('ul.chosen-choices');
|
673 |
+
this.search_container = this.container.down('li.search-field');
|
674 |
+
} else {
|
675 |
+
this.search_container = this.container.down('div.chosen-search');
|
676 |
+
this.selected_item = this.container.down('.chosen-single');
|
677 |
+
}
|
678 |
+
this.results_build();
|
679 |
+
this.set_tab_index();
|
680 |
+
return this.set_label_behavior();
|
681 |
+
};
|
682 |
+
|
683 |
+
Chosen.prototype.on_ready = function() {
|
684 |
+
return this.form_field.fire("chosen:ready", {
|
685 |
+
chosen: this
|
686 |
+
});
|
687 |
+
};
|
688 |
+
|
689 |
+
Chosen.prototype.register_observers = function() {
|
690 |
+
this.container.observe("touchstart", (function(_this) {
|
691 |
+
return function(evt) {
|
692 |
+
return _this.container_mousedown(evt);
|
693 |
+
};
|
694 |
+
})(this));
|
695 |
+
this.container.observe("touchend", (function(_this) {
|
696 |
+
return function(evt) {
|
697 |
+
return _this.container_mouseup(evt);
|
698 |
+
};
|
699 |
+
})(this));
|
700 |
+
this.container.observe("mousedown", (function(_this) {
|
701 |
+
return function(evt) {
|
702 |
+
return _this.container_mousedown(evt);
|
703 |
+
};
|
704 |
+
})(this));
|
705 |
+
this.container.observe("mouseup", (function(_this) {
|
706 |
+
return function(evt) {
|
707 |
+
return _this.container_mouseup(evt);
|
708 |
+
};
|
709 |
+
})(this));
|
710 |
+
this.container.observe("mouseenter", (function(_this) {
|
711 |
+
return function(evt) {
|
712 |
+
return _this.mouse_enter(evt);
|
713 |
+
};
|
714 |
+
})(this));
|
715 |
+
this.container.observe("mouseleave", (function(_this) {
|
716 |
+
return function(evt) {
|
717 |
+
return _this.mouse_leave(evt);
|
718 |
+
};
|
719 |
+
})(this));
|
720 |
+
this.search_results.observe("mouseup", (function(_this) {
|
721 |
+
return function(evt) {
|
722 |
+
return _this.search_results_mouseup(evt);
|
723 |
+
};
|
724 |
+
})(this));
|
725 |
+
this.search_results.observe("mouseover", (function(_this) {
|
726 |
+
return function(evt) {
|
727 |
+
return _this.search_results_mouseover(evt);
|
728 |
+
};
|
729 |
+
})(this));
|
730 |
+
this.search_results.observe("mouseout", (function(_this) {
|
731 |
+
return function(evt) {
|
732 |
+
return _this.search_results_mouseout(evt);
|
733 |
+
};
|
734 |
+
})(this));
|
735 |
+
this.search_results.observe("mousewheel", (function(_this) {
|
736 |
+
return function(evt) {
|
737 |
+
return _this.search_results_mousewheel(evt);
|
738 |
+
};
|
739 |
+
})(this));
|
740 |
+
this.search_results.observe("DOMMouseScroll", (function(_this) {
|
741 |
+
return function(evt) {
|
742 |
+
return _this.search_results_mousewheel(evt);
|
743 |
+
};
|
744 |
+
})(this));
|
745 |
+
this.search_results.observe("touchstart", (function(_this) {
|
746 |
+
return function(evt) {
|
747 |
+
return _this.search_results_touchstart(evt);
|
748 |
+
};
|
749 |
+
})(this));
|
750 |
+
this.search_results.observe("touchmove", (function(_this) {
|
751 |
+
return function(evt) {
|
752 |
+
return _this.search_results_touchmove(evt);
|
753 |
+
};
|
754 |
+
})(this));
|
755 |
+
this.search_results.observe("touchend", (function(_this) {
|
756 |
+
return function(evt) {
|
757 |
+
return _this.search_results_touchend(evt);
|
758 |
+
};
|
759 |
+
})(this));
|
760 |
+
this.form_field.observe("chosen:updated", (function(_this) {
|
761 |
+
return function(evt) {
|
762 |
+
return _this.results_update_field(evt);
|
763 |
+
};
|
764 |
+
})(this));
|
765 |
+
this.form_field.observe("chosen:activate", (function(_this) {
|
766 |
+
return function(evt) {
|
767 |
+
return _this.activate_field(evt);
|
768 |
+
};
|
769 |
+
})(this));
|
770 |
+
this.form_field.observe("chosen:open", (function(_this) {
|
771 |
+
return function(evt) {
|
772 |
+
return _this.container_mousedown(evt);
|
773 |
+
};
|
774 |
+
})(this));
|
775 |
+
this.form_field.observe("chosen:close", (function(_this) {
|
776 |
+
return function(evt) {
|
777 |
+
return _this.close_field(evt);
|
778 |
+
};
|
779 |
+
})(this));
|
780 |
+
this.search_field.observe("blur", (function(_this) {
|
781 |
+
return function(evt) {
|
782 |
+
return _this.input_blur(evt);
|
783 |
+
};
|
784 |
+
})(this));
|
785 |
+
this.search_field.observe("keyup", (function(_this) {
|
786 |
+
return function(evt) {
|
787 |
+
return _this.keyup_checker(evt);
|
788 |
+
};
|
789 |
+
})(this));
|
790 |
+
this.search_field.observe("keydown", (function(_this) {
|
791 |
+
return function(evt) {
|
792 |
+
return _this.keydown_checker(evt);
|
793 |
+
};
|
794 |
+
})(this));
|
795 |
+
this.search_field.observe("focus", (function(_this) {
|
796 |
+
return function(evt) {
|
797 |
+
return _this.input_focus(evt);
|
798 |
+
};
|
799 |
+
})(this));
|
800 |
+
this.search_field.observe("cut", (function(_this) {
|
801 |
+
return function(evt) {
|
802 |
+
return _this.clipboard_event_checker(evt);
|
803 |
+
};
|
804 |
+
})(this));
|
805 |
+
this.search_field.observe("paste", (function(_this) {
|
806 |
+
return function(evt) {
|
807 |
+
return _this.clipboard_event_checker(evt);
|
808 |
+
};
|
809 |
+
})(this));
|
810 |
+
if (this.is_multiple) {
|
811 |
+
return this.search_choices.observe("click", (function(_this) {
|
812 |
+
return function(evt) {
|
813 |
+
return _this.choices_click(evt);
|
814 |
+
};
|
815 |
+
})(this));
|
816 |
+
} else {
|
817 |
+
return this.container.observe("click", (function(_this) {
|
818 |
+
return function(evt) {
|
819 |
+
return evt.preventDefault();
|
820 |
+
};
|
821 |
+
})(this));
|
822 |
+
}
|
823 |
+
};
|
824 |
+
|
825 |
+
Chosen.prototype.destroy = function() {
|
826 |
+
var event, i, len, ref;
|
827 |
+
this.container.ownerDocument.stopObserving("click", this.click_test_action);
|
828 |
+
ref = ['chosen:updated', 'chosen:activate', 'chosen:open', 'chosen:close'];
|
829 |
+
for (i = 0, len = ref.length; i < len; i++) {
|
830 |
+
event = ref[i];
|
831 |
+
this.form_field.stopObserving(event);
|
832 |
+
}
|
833 |
+
this.container.stopObserving();
|
834 |
+
this.search_results.stopObserving();
|
835 |
+
this.search_field.stopObserving();
|
836 |
+
if (this.form_field_label != null) {
|
837 |
+
this.form_field_label.stopObserving();
|
838 |
+
}
|
839 |
+
if (this.is_multiple) {
|
840 |
+
this.search_choices.stopObserving();
|
841 |
+
this.container.select(".search-choice-close").each(function(choice) {
|
842 |
+
return choice.stopObserving();
|
843 |
+
});
|
844 |
+
} else {
|
845 |
+
this.selected_item.stopObserving();
|
846 |
+
}
|
847 |
+
if (this.search_field.tabIndex) {
|
848 |
+
this.form_field.tabIndex = this.search_field.tabIndex;
|
849 |
+
}
|
850 |
+
this.container.remove();
|
851 |
+
return this.form_field.show();
|
852 |
+
};
|
853 |
+
|
854 |
+
Chosen.prototype.search_field_disabled = function() {
|
855 |
+
var ref;
|
856 |
+
this.is_disabled = this.form_field.disabled || ((ref = this.form_field.up('fieldset')) != null ? ref.disabled : void 0) || false;
|
857 |
+
if (this.is_disabled) {
|
858 |
+
this.container.addClassName('chosen-disabled');
|
859 |
+
} else {
|
860 |
+
this.container.removeClassName('chosen-disabled');
|
861 |
+
}
|
862 |
+
this.search_field.disabled = this.is_disabled;
|
863 |
+
if (!this.is_multiple) {
|
864 |
+
this.selected_item.stopObserving('focus', this.activate_field);
|
865 |
+
}
|
866 |
+
if (this.is_disabled) {
|
867 |
+
return this.close_field();
|
868 |
+
} else if (!this.is_multiple) {
|
869 |
+
return this.selected_item.observe('focus', this.activate_field);
|
870 |
+
}
|
871 |
+
};
|
872 |
+
|
873 |
+
Chosen.prototype.container_mousedown = function(evt) {
|
874 |
+
var ref;
|
875 |
+
if (this.is_disabled) {
|
876 |
+
return;
|
877 |
+
}
|
878 |
+
if (evt && ((ref = evt.type) === 'mousedown' || ref === 'touchstart') && !this.results_showing) {
|
879 |
+
evt.preventDefault();
|
880 |
+
}
|
881 |
+
if (!((evt != null) && evt.target.hasClassName("search-choice-close"))) {
|
882 |
+
if (!this.active_field) {
|
883 |
+
if (this.is_multiple) {
|
884 |
+
this.search_field.clear();
|
885 |
+
}
|
886 |
+
this.container.ownerDocument.observe("click", this.click_test_action);
|
887 |
+
this.results_show();
|
888 |
+
} else if (!this.is_multiple && evt && (evt.target === this.selected_item || evt.target.up("a.chosen-single"))) {
|
889 |
+
this.results_toggle();
|
890 |
+
}
|
891 |
+
return this.activate_field();
|
892 |
+
}
|
893 |
+
};
|
894 |
+
|
895 |
+
Chosen.prototype.container_mouseup = function(evt) {
|
896 |
+
if (evt.target.nodeName === "ABBR" && !this.is_disabled) {
|
897 |
+
return this.results_reset(evt);
|
898 |
+
}
|
899 |
+
};
|
900 |
+
|
901 |
+
Chosen.prototype.search_results_mousewheel = function(evt) {
|
902 |
+
var delta;
|
903 |
+
delta = evt.deltaY || -evt.wheelDelta || evt.detail;
|
904 |
+
if (delta != null) {
|
905 |
+
evt.preventDefault();
|
906 |
+
if (evt.type === 'DOMMouseScroll') {
|
907 |
+
delta = delta * 40;
|
908 |
+
}
|
909 |
+
return this.search_results.scrollTop = delta + this.search_results.scrollTop;
|
910 |
+
}
|
911 |
+
};
|
912 |
+
|
913 |
+
Chosen.prototype.blur_test = function(evt) {
|
914 |
+
if (!this.active_field && this.container.hasClassName("chosen-container-active")) {
|
915 |
+
return this.close_field();
|
916 |
+
}
|
917 |
+
};
|
918 |
+
|
919 |
+
Chosen.prototype.close_field = function() {
|
920 |
+
this.container.ownerDocument.stopObserving("click", this.click_test_action);
|
921 |
+
this.active_field = false;
|
922 |
+
this.results_hide();
|
923 |
+
this.container.removeClassName("chosen-container-active");
|
924 |
+
this.clear_backstroke();
|
925 |
+
this.show_search_field_default();
|
926 |
+
this.search_field_scale();
|
927 |
+
return this.search_field.blur();
|
928 |
+
};
|
929 |
+
|
930 |
+
Chosen.prototype.activate_field = function() {
|
931 |
+
if (this.is_disabled) {
|
932 |
+
return;
|
933 |
+
}
|
934 |
+
this.container.addClassName("chosen-container-active");
|
935 |
+
this.active_field = true;
|
936 |
+
this.search_field.value = this.get_search_field_value();
|
937 |
+
return this.search_field.focus();
|
938 |
+
};
|
939 |
+
|
940 |
+
Chosen.prototype.test_active_click = function(evt) {
|
941 |
+
if (evt.target.up('.chosen-container') === this.container) {
|
942 |
+
return this.active_field = true;
|
943 |
+
} else {
|
944 |
+
return this.close_field();
|
945 |
+
}
|
946 |
+
};
|
947 |
+
|
948 |
+
Chosen.prototype.results_build = function() {
|
949 |
+
this.parsing = true;
|
950 |
+
this.selected_option_count = null;
|
951 |
+
this.results_data = SelectParser.select_to_array(this.form_field);
|
952 |
+
if (this.is_multiple) {
|
953 |
+
this.search_choices.select("li.search-choice").invoke("remove");
|
954 |
+
} else {
|
955 |
+
this.single_set_selected_text();
|
956 |
+
if (this.disable_search || this.form_field.options.length <= this.disable_search_threshold) {
|
957 |
+
this.search_field.readOnly = true;
|
958 |
+
this.container.addClassName("chosen-container-single-nosearch");
|
959 |
+
} else {
|
960 |
+
this.search_field.readOnly = false;
|
961 |
+
this.container.removeClassName("chosen-container-single-nosearch");
|
962 |
+
}
|
963 |
+
}
|
964 |
+
this.update_results_content(this.results_option_build({
|
965 |
+
first: true
|
966 |
+
}));
|
967 |
+
this.search_field_disabled();
|
968 |
+
this.show_search_field_default();
|
969 |
+
this.search_field_scale();
|
970 |
+
return this.parsing = false;
|
971 |
+
};
|
972 |
+
|
973 |
+
Chosen.prototype.result_do_highlight = function(el) {
|
974 |
+
var high_bottom, high_top, maxHeight, visible_bottom, visible_top;
|
975 |
+
this.result_clear_highlight();
|
976 |
+
this.result_highlight = el;
|
977 |
+
this.result_highlight.addClassName("highlighted");
|
978 |
+
maxHeight = parseInt(this.search_results.getStyle('maxHeight'), 10);
|
979 |
+
visible_top = this.search_results.scrollTop;
|
980 |
+
visible_bottom = maxHeight + visible_top;
|
981 |
+
high_top = this.result_highlight.positionedOffset().top;
|
982 |
+
high_bottom = high_top + this.result_highlight.getHeight();
|
983 |
+
if (high_bottom >= visible_bottom) {
|
984 |
+
return this.search_results.scrollTop = (high_bottom - maxHeight) > 0 ? high_bottom - maxHeight : 0;
|
985 |
+
} else if (high_top < visible_top) {
|
986 |
+
return this.search_results.scrollTop = high_top;
|
987 |
+
}
|
988 |
+
};
|
989 |
+
|
990 |
+
Chosen.prototype.result_clear_highlight = function() {
|
991 |
+
if (this.result_highlight) {
|
992 |
+
this.result_highlight.removeClassName('highlighted');
|
993 |
+
}
|
994 |
+
return this.result_highlight = null;
|
995 |
+
};
|
996 |
+
|
997 |
+
Chosen.prototype.results_show = function() {
|
998 |
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
999 |
+
this.form_field.fire("chosen:maxselected", {
|
1000 |
+
chosen: this
|
1001 |
+
});
|
1002 |
+
return false;
|
1003 |
+
}
|
1004 |
+
this.container.addClassName("chosen-with-drop");
|
1005 |
+
this.results_showing = true;
|
1006 |
+
this.search_field.focus();
|
1007 |
+
this.search_field.value = this.get_search_field_value();
|
1008 |
+
this.winnow_results();
|
1009 |
+
return this.form_field.fire("chosen:showing_dropdown", {
|
1010 |
+
chosen: this
|
1011 |
+
});
|
1012 |
+
};
|
1013 |
+
|
1014 |
+
Chosen.prototype.update_results_content = function(content) {
|
1015 |
+
return this.search_results.update(content);
|
1016 |
+
};
|
1017 |
+
|
1018 |
+
Chosen.prototype.results_hide = function() {
|
1019 |
+
if (this.results_showing) {
|
1020 |
+
this.result_clear_highlight();
|
1021 |
+
this.container.removeClassName("chosen-with-drop");
|
1022 |
+
this.form_field.fire("chosen:hiding_dropdown", {
|
1023 |
+
chosen: this
|
1024 |
+
});
|
1025 |
+
}
|
1026 |
+
return this.results_showing = false;
|
1027 |
+
};
|
1028 |
+
|
1029 |
+
Chosen.prototype.set_tab_index = function(el) {
|
1030 |
+
var ti;
|
1031 |
+
if (this.form_field.tabIndex) {
|
1032 |
+
ti = this.form_field.tabIndex;
|
1033 |
+
this.form_field.tabIndex = -1;
|
1034 |
+
return this.search_field.tabIndex = ti;
|
1035 |
+
}
|
1036 |
+
};
|
1037 |
+
|
1038 |
+
Chosen.prototype.set_label_behavior = function() {
|
1039 |
+
this.form_field_label = this.form_field.up("label");
|
1040 |
+
if (this.form_field_label == null) {
|
1041 |
+
this.form_field_label = $$("label[for='" + this.form_field.id + "']").first();
|
1042 |
+
}
|
1043 |
+
if (this.form_field_label != null) {
|
1044 |
+
return this.form_field_label.observe("click", this.label_click_handler);
|
1045 |
+
}
|
1046 |
+
};
|
1047 |
+
|
1048 |
+
Chosen.prototype.show_search_field_default = function() {
|
1049 |
+
if (this.is_multiple && this.choices_count() < 1 && !this.active_field) {
|
1050 |
+
this.search_field.value = this.default_text;
|
1051 |
+
return this.search_field.addClassName("default");
|
1052 |
+
} else {
|
1053 |
+
this.search_field.value = "";
|
1054 |
+
return this.search_field.removeClassName("default");
|
1055 |
+
}
|
1056 |
+
};
|
1057 |
+
|
1058 |
+
Chosen.prototype.search_results_mouseup = function(evt) {
|
1059 |
+
var target;
|
1060 |
+
target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
|
1061 |
+
if (target) {
|
1062 |
+
this.result_highlight = target;
|
1063 |
+
this.result_select(evt);
|
1064 |
+
return this.search_field.focus();
|
1065 |
+
}
|
1066 |
+
};
|
1067 |
+
|
1068 |
+
Chosen.prototype.search_results_mouseover = function(evt) {
|
1069 |
+
var target;
|
1070 |
+
target = evt.target.hasClassName("active-result") ? evt.target : evt.target.up(".active-result");
|
1071 |
+
if (target) {
|
1072 |
+
return this.result_do_highlight(target);
|
1073 |
+
}
|
1074 |
+
};
|
1075 |
+
|
1076 |
+
Chosen.prototype.search_results_mouseout = function(evt) {
|
1077 |
+
if (evt.target.hasClassName('active-result') || evt.target.up('.active-result')) {
|
1078 |
+
return this.result_clear_highlight();
|
1079 |
+
}
|
1080 |
+
};
|
1081 |
+
|
1082 |
+
Chosen.prototype.choice_build = function(item) {
|
1083 |
+
var choice, close_link;
|
1084 |
+
choice = new Element('li', {
|
1085 |
+
"class": "search-choice"
|
1086 |
+
}).update("<span>" + (this.choice_label(item)) + "</span>");
|
1087 |
+
if (item.disabled) {
|
1088 |
+
choice.addClassName('search-choice-disabled');
|
1089 |
+
} else {
|
1090 |
+
close_link = new Element('a', {
|
1091 |
+
href: '#',
|
1092 |
+
"class": 'search-choice-close',
|
1093 |
+
rel: item.array_index
|
1094 |
+
});
|
1095 |
+
close_link.observe("click", (function(_this) {
|
1096 |
+
return function(evt) {
|
1097 |
+
return _this.choice_destroy_link_click(evt);
|
1098 |
+
};
|
1099 |
+
})(this));
|
1100 |
+
choice.insert(close_link);
|
1101 |
+
}
|
1102 |
+
return this.search_container.insert({
|
1103 |
+
before: choice
|
1104 |
+
});
|
1105 |
+
};
|
1106 |
+
|
1107 |
+
Chosen.prototype.choice_destroy_link_click = function(evt) {
|
1108 |
+
evt.preventDefault();
|
1109 |
+
evt.stopPropagation();
|
1110 |
+
if (!this.is_disabled) {
|
1111 |
+
return this.choice_destroy(evt.target);
|
1112 |
+
}
|
1113 |
+
};
|
1114 |
+
|
1115 |
+
Chosen.prototype.choice_destroy = function(link) {
|
1116 |
+
if (this.result_deselect(link.readAttribute("rel"))) {
|
1117 |
+
if (this.active_field) {
|
1118 |
+
this.search_field.focus();
|
1119 |
+
} else {
|
1120 |
+
this.show_search_field_default();
|
1121 |
+
}
|
1122 |
+
if (this.is_multiple && this.choices_count() > 0 && this.get_search_field_value().length < 1) {
|
1123 |
+
this.results_hide();
|
1124 |
+
}
|
1125 |
+
link.up('li').remove();
|
1126 |
+
return this.search_field_scale();
|
1127 |
+
}
|
1128 |
+
};
|
1129 |
+
|
1130 |
+
Chosen.prototype.results_reset = function() {
|
1131 |
+
this.reset_single_select_options();
|
1132 |
+
this.form_field.options[0].selected = true;
|
1133 |
+
this.single_set_selected_text();
|
1134 |
+
this.show_search_field_default();
|
1135 |
+
this.results_reset_cleanup();
|
1136 |
+
this.trigger_form_field_change();
|
1137 |
+
if (this.active_field) {
|
1138 |
+
return this.results_hide();
|
1139 |
+
}
|
1140 |
+
};
|
1141 |
+
|
1142 |
+
Chosen.prototype.results_reset_cleanup = function() {
|
1143 |
+
var deselect_trigger;
|
1144 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
1145 |
+
deselect_trigger = this.selected_item.down("abbr");
|
1146 |
+
if (deselect_trigger) {
|
1147 |
+
return deselect_trigger.remove();
|
1148 |
+
}
|
1149 |
+
};
|
1150 |
+
|
1151 |
+
Chosen.prototype.result_select = function(evt) {
|
1152 |
+
var high, item;
|
1153 |
+
if (this.result_highlight) {
|
1154 |
+
high = this.result_highlight;
|
1155 |
+
this.result_clear_highlight();
|
1156 |
+
if (this.is_multiple && this.max_selected_options <= this.choices_count()) {
|
1157 |
+
this.form_field.fire("chosen:maxselected", {
|
1158 |
+
chosen: this
|
1159 |
+
});
|
1160 |
+
return false;
|
1161 |
+
}
|
1162 |
+
if (this.is_multiple) {
|
1163 |
+
high.removeClassName("active-result");
|
1164 |
+
} else {
|
1165 |
+
this.reset_single_select_options();
|
1166 |
+
}
|
1167 |
+
high.addClassName("result-selected");
|
1168 |
+
item = this.results_data[high.getAttribute("data-option-array-index")];
|
1169 |
+
item.selected = true;
|
1170 |
+
this.form_field.options[item.options_index].selected = true;
|
1171 |
+
this.selected_option_count = null;
|
1172 |
+
if (this.is_multiple) {
|
1173 |
+
this.choice_build(item);
|
1174 |
+
} else {
|
1175 |
+
this.single_set_selected_text(this.choice_label(item));
|
1176 |
+
}
|
1177 |
+
if (this.is_multiple && (!this.hide_results_on_select || (evt.metaKey || evt.ctrlKey))) {
|
1178 |
+
if (evt.metaKey || evt.ctrlKey) {
|
1179 |
+
this.winnow_results({
|
1180 |
+
skip_highlight: true
|
1181 |
+
});
|
1182 |
+
} else {
|
1183 |
+
this.search_field.value = "";
|
1184 |
+
this.winnow_results();
|
1185 |
+
}
|
1186 |
+
} else {
|
1187 |
+
this.results_hide();
|
1188 |
+
this.show_search_field_default();
|
1189 |
+
}
|
1190 |
+
if (this.is_multiple || this.form_field.selectedIndex !== this.current_selectedIndex) {
|
1191 |
+
this.trigger_form_field_change();
|
1192 |
+
}
|
1193 |
+
this.current_selectedIndex = this.form_field.selectedIndex;
|
1194 |
+
evt.preventDefault();
|
1195 |
+
return this.search_field_scale();
|
1196 |
+
}
|
1197 |
+
};
|
1198 |
+
|
1199 |
+
Chosen.prototype.single_set_selected_text = function(text) {
|
1200 |
+
if (text == null) {
|
1201 |
+
text = this.default_text;
|
1202 |
+
}
|
1203 |
+
if (text === this.default_text) {
|
1204 |
+
this.selected_item.addClassName("chosen-default");
|
1205 |
+
} else {
|
1206 |
+
this.single_deselect_control_build();
|
1207 |
+
this.selected_item.removeClassName("chosen-default");
|
1208 |
+
}
|
1209 |
+
return this.selected_item.down("span").update(text);
|
1210 |
+
};
|
1211 |
+
|
1212 |
+
Chosen.prototype.result_deselect = function(pos) {
|
1213 |
+
var result_data;
|
1214 |
+
result_data = this.results_data[pos];
|
1215 |
+
if (!this.form_field.options[result_data.options_index].disabled) {
|
1216 |
+
result_data.selected = false;
|
1217 |
+
this.form_field.options[result_data.options_index].selected = false;
|
1218 |
+
this.selected_option_count = null;
|
1219 |
+
this.result_clear_highlight();
|
1220 |
+
if (this.results_showing) {
|
1221 |
+
this.winnow_results();
|
1222 |
+
}
|
1223 |
+
this.trigger_form_field_change();
|
1224 |
+
this.search_field_scale();
|
1225 |
+
return true;
|
1226 |
+
} else {
|
1227 |
+
return false;
|
1228 |
+
}
|
1229 |
+
};
|
1230 |
+
|
1231 |
+
Chosen.prototype.single_deselect_control_build = function() {
|
1232 |
+
if (!this.allow_single_deselect) {
|
1233 |
+
return;
|
1234 |
+
}
|
1235 |
+
if (!this.selected_item.down("abbr")) {
|
1236 |
+
this.selected_item.down("span").insert({
|
1237 |
+
after: "<abbr class=\"search-choice-close\"></abbr>"
|
1238 |
+
});
|
1239 |
+
}
|
1240 |
+
return this.selected_item.addClassName("chosen-single-with-deselect");
|
1241 |
+
};
|
1242 |
+
|
1243 |
+
Chosen.prototype.get_search_field_value = function() {
|
1244 |
+
return this.search_field.value;
|
1245 |
+
};
|
1246 |
+
|
1247 |
+
Chosen.prototype.get_search_text = function() {
|
1248 |
+
return this.get_search_field_value().strip();
|
1249 |
+
};
|
1250 |
+
|
1251 |
+
Chosen.prototype.escape_html = function(text) {
|
1252 |
+
return text.escapeHTML();
|
1253 |
+
};
|
1254 |
+
|
1255 |
+
Chosen.prototype.winnow_results_set_highlight = function() {
|
1256 |
+
var do_high;
|
1257 |
+
if (!this.is_multiple) {
|
1258 |
+
do_high = this.search_results.down(".result-selected.active-result");
|
1259 |
+
}
|
1260 |
+
if (do_high == null) {
|
1261 |
+
do_high = this.search_results.down(".active-result");
|
1262 |
+
}
|
1263 |
+
if (do_high != null) {
|
1264 |
+
return this.result_do_highlight(do_high);
|
1265 |
+
}
|
1266 |
+
};
|
1267 |
+
|
1268 |
+
Chosen.prototype.no_results = function(terms) {
|
1269 |
+
this.search_results.insert(this.get_no_results_html(terms));
|
1270 |
+
return this.form_field.fire("chosen:no_results", {
|
1271 |
+
chosen: this
|
1272 |
+
});
|
1273 |
+
};
|
1274 |
+
|
1275 |
+
Chosen.prototype.no_results_clear = function() {
|
1276 |
+
var nr, results1;
|
1277 |
+
nr = null;
|
1278 |
+
results1 = [];
|
1279 |
+
while (nr = this.search_results.down(".no-results")) {
|
1280 |
+
results1.push(nr.remove());
|
1281 |
+
}
|
1282 |
+
return results1;
|
1283 |
+
};
|
1284 |
+
|
1285 |
+
Chosen.prototype.keydown_arrow = function() {
|
1286 |
+
var next_sib;
|
1287 |
+
if (this.results_showing && this.result_highlight) {
|
1288 |
+
next_sib = this.result_highlight.next('.active-result');
|
1289 |
+
if (next_sib) {
|
1290 |
+
return this.result_do_highlight(next_sib);
|
1291 |
+
}
|
1292 |
+
} else {
|
1293 |
+
return this.results_show();
|
1294 |
+
}
|
1295 |
+
};
|
1296 |
+
|
1297 |
+
Chosen.prototype.keyup_arrow = function() {
|
1298 |
+
var actives, prevs, sibs;
|
1299 |
+
if (!this.results_showing && !this.is_multiple) {
|
1300 |
+
return this.results_show();
|
1301 |
+
} else if (this.result_highlight) {
|
1302 |
+
sibs = this.result_highlight.previousSiblings();
|
1303 |
+
actives = this.search_results.select("li.active-result");
|
1304 |
+
prevs = sibs.intersect(actives);
|
1305 |
+
if (prevs.length) {
|
1306 |
+
return this.result_do_highlight(prevs.first());
|
1307 |
+
} else {
|
1308 |
+
if (this.choices_count() > 0) {
|
1309 |
+
this.results_hide();
|
1310 |
+
}
|
1311 |
+
return this.result_clear_highlight();
|
1312 |
+
}
|
1313 |
+
}
|
1314 |
+
};
|
1315 |
+
|
1316 |
+
Chosen.prototype.keydown_backstroke = function() {
|
1317 |
+
var next_available_destroy;
|
1318 |
+
if (this.pending_backstroke) {
|
1319 |
+
this.choice_destroy(this.pending_backstroke.down("a"));
|
1320 |
+
return this.clear_backstroke();
|
1321 |
+
} else {
|
1322 |
+
next_available_destroy = this.search_container.siblings().last();
|
1323 |
+
if (next_available_destroy && next_available_destroy.hasClassName("search-choice") && !next_available_destroy.hasClassName("search-choice-disabled")) {
|
1324 |
+
this.pending_backstroke = next_available_destroy;
|
1325 |
+
if (this.pending_backstroke) {
|
1326 |
+
this.pending_backstroke.addClassName("search-choice-focus");
|
1327 |
+
}
|
1328 |
+
if (this.single_backstroke_delete) {
|
1329 |
+
return this.keydown_backstroke();
|
1330 |
+
} else {
|
1331 |
+
return this.pending_backstroke.addClassName("search-choice-focus");
|
1332 |
+
}
|
1333 |
+
}
|
1334 |
+
}
|
1335 |
+
};
|
1336 |
+
|
1337 |
+
Chosen.prototype.clear_backstroke = function() {
|
1338 |
+
if (this.pending_backstroke) {
|
1339 |
+
this.pending_backstroke.removeClassName("search-choice-focus");
|
1340 |
+
}
|
1341 |
+
return this.pending_backstroke = null;
|
1342 |
+
};
|
1343 |
+
|
1344 |
+
Chosen.prototype.search_field_scale = function() {
|
1345 |
+
var container_width, div, i, len, style, style_block, styles, width;
|
1346 |
+
if (!this.is_multiple) {
|
1347 |
+
return;
|
1348 |
+
}
|
1349 |
+
style_block = {
|
1350 |
+
position: 'absolute',
|
1351 |
+
left: '-1000px',
|
1352 |
+
top: '-1000px',
|
1353 |
+
display: 'none',
|
1354 |
+
whiteSpace: 'pre'
|
1355 |
+
};
|
1356 |
+
styles = ['fontSize', 'fontStyle', 'fontWeight', 'fontFamily', 'lineHeight', 'textTransform', 'letterSpacing'];
|
1357 |
+
for (i = 0, len = styles.length; i < len; i++) {
|
1358 |
+
style = styles[i];
|
1359 |
+
style_block[style] = this.search_field.getStyle(style);
|
1360 |
+
}
|
1361 |
+
div = new Element('div').update(this.escape_html(this.get_search_field_value()));
|
1362 |
+
div.setStyle(style_block);
|
1363 |
+
document.body.appendChild(div);
|
1364 |
+
width = div.measure('width') + 25;
|
1365 |
+
div.remove();
|
1366 |
+
if (container_width = this.container.getWidth()) {
|
1367 |
+
width = Math.min(container_width - 10, width);
|
1368 |
+
}
|
1369 |
+
return this.search_field.setStyle({
|
1370 |
+
width: width + 'px'
|
1371 |
+
});
|
1372 |
+
};
|
1373 |
+
|
1374 |
+
Chosen.prototype.trigger_form_field_change = function() {
|
1375 |
+
triggerHtmlEvent(this.form_field, 'input');
|
1376 |
+
return triggerHtmlEvent(this.form_field, 'change');
|
1377 |
+
};
|
1378 |
+
|
1379 |
+
triggerHtmlEvent = function(element, eventType) {
|
1380 |
+
var error, evt;
|
1381 |
+
if (element.dispatchEvent) {
|
1382 |
+
try {
|
1383 |
+
evt = new Event(eventType, {
|
1384 |
+
bubbles: true,
|
1385 |
+
cancelable: true
|
1386 |
+
});
|
1387 |
+
} catch (error) {
|
1388 |
+
evt = document.createEvent('HTMLEvents');
|
1389 |
+
evt.initEvent(eventType, true, true);
|
1390 |
+
}
|
1391 |
+
return element.dispatchEvent(evt);
|
1392 |
+
} else {
|
1393 |
+
return element.fireEvent("on" + eventType, document.createEventObject());
|
1394 |
+
}
|
1395 |
+
};
|
1396 |
+
|
1397 |
+
return Chosen;
|
1398 |
+
|
1399 |
+
})(AbstractChosen);
|
1400 |
+
|
1401 |
+
}).call(this);
|
assets/libs/chosen/chosen.proto.min.js
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
1 |
+
/* Chosen v1.8.7 | (c) 2011-2018 by Harvest | MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md */
|
2 |
+
|
3 |
+
(function(){var e,t,s=function(e,t){return function(){return e.apply(t,arguments)}},i=function(e,t){function s(){this.constructor=e}for(var i in t)r.call(t,i)&&(e[i]=t[i]);return s.prototype=t.prototype,e.prototype=new s,e.__super__=t.prototype,e},r={}.hasOwnProperty;(t=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(e){return"OPTGROUP"===e.nodeName.toUpperCase()?this.add_group(e):this.add_option(e)},e.prototype.add_group=function(e){var t,s,i,r,n,o;for(t=this.parsed.length,this.parsed.push({array_index:t,group:!0,label:e.label,title:e.title?e.title:void 0,children:0,disabled:e.disabled,classes:e.className}),o=[],s=0,i=(n=e.childNodes).length;s<i;s++)r=n[s],o.push(this.add_option(r,t,e.disabled));return o},e.prototype.add_option=function(e,t,s){if("OPTION"===e.nodeName.toUpperCase())return""!==e.text?(null!=t&&(this.parsed[t].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,html:e.innerHTML,title:e.title?e.title:void 0,selected:e.selected,disabled:!0===s?s:e.disabled,group_array_index:t,group_label:null!=t?this.parsed[t].label:null,classes:e.className,style:e.style.cssText})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e}()).select_to_array=function(e){var s,i,r,n,o;for(n=new t,i=0,r=(o=e.childNodes).length;i<r;i++)s=o[i],n.add_node(s);return n.parsed},e=function(){function e(t,i){this.form_field=t,this.options=null!=i?i:{},this.label_click_handler=s(this.label_click_handler,this),e.browser_is_supported()&&(this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers(),this.on_ready())}return e.prototype.set_default_values=function(){return this.click_test_action=function(e){return function(t){return e.test_active_click(t)}}(this),this.activate_action=function(e){return function(t){return e.activate_field(t)}}(this),this.active_field=!1,this.mouse_on_container=!1,this.results_showing=!1,this.result_highlighted=null,this.is_rtl=this.options.rtl||/\bchosen-rtl\b/.test(this.form_field.className),this.allow_single_deselect=null!=this.options.allow_single_deselect&&null!=this.form_field.options[0]&&""===this.form_field.options[0].text&&this.options.allow_single_deselect,this.disable_search_threshold=this.options.disable_search_threshold||0,this.disable_search=this.options.disable_search||!1,this.enable_split_word_search=null==this.options.enable_split_word_search||this.options.enable_split_word_search,this.group_search=null==this.options.group_search||this.options.group_search,this.search_contains=this.options.search_contains||!1,this.single_backstroke_delete=null==this.options.single_backstroke_delete||this.options.single_backstroke_delete,this.max_selected_options=this.options.max_selected_options||1/0,this.inherit_select_classes=this.options.inherit_select_classes||!1,this.display_selected_options=null==this.options.display_selected_options||this.options.display_selected_options,this.display_disabled_options=null==this.options.display_disabled_options||this.options.display_disabled_options,this.include_group_label_in_selected=this.options.include_group_label_in_selected||!1,this.max_shown_results=this.options.max_shown_results||Number.POSITIVE_INFINITY,this.case_sensitive_search=this.options.case_sensitive_search||!1,this.hide_results_on_select=null==this.options.hide_results_on_select||this.options.hide_results_on_select},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.default_text=this.escape_html(this.default_text),this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||e.default_no_result_text},e.prototype.choice_label=function(e){return this.include_group_label_in_selected&&null!=e.group_label?"<b class='group-name'>"+this.escape_html(e.group_label)+"</b>"+e.html:e.html},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(e){if(this.is_multiple){if(!this.active_field)return setTimeout(function(e){return function(){return e.container_mousedown()}}(this),50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(e){if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(e){return function(){return e.blur_test()}}(this),100)},e.prototype.label_click_handler=function(e){return this.is_multiple?this.container_mousedown(e):this.activate_field()},e.prototype.results_option_build=function(e){var t,s,i,r,n,o,l;for(t="",l=0,r=0,n=(o=this.results_data).length;r<n&&(s=o[r],i="",""!==(i=s.group?this.result_add_group(s):this.result_add_option(s))&&(l++,t+=i),(null!=e?e.first:void 0)&&(s.selected&&this.is_multiple?this.choice_build(s):s.selected&&!this.is_multiple&&this.single_set_selected_text(this.choice_label(s))),!(l>=this.max_shown_results));r++);return t},e.prototype.result_add_option=function(e){var t,s;return e.search_match&&this.include_option_in_results(e)?(t=[],e.disabled||e.selected&&this.is_multiple||t.push("active-result"),!e.disabled||e.selected&&this.is_multiple||t.push("disabled-result"),e.selected&&t.push("result-selected"),null!=e.group_array_index&&t.push("group-option"),""!==e.classes&&t.push(e.classes),s=document.createElement("li"),s.className=t.join(" "),e.style&&(s.style.cssText=e.style),s.setAttribute("data-option-array-index",e.array_index),s.innerHTML=e.highlighted_html||e.html,e.title&&(s.title=e.title),this.outerHTML(s)):""},e.prototype.result_add_group=function(e){var t,s;return(e.search_match||e.group_match)&&e.active_options>0?((t=[]).push("group-result"),e.classes&&t.push(e.classes),s=document.createElement("li"),s.className=t.join(" "),s.innerHTML=e.highlighted_html||this.escape_html(e.label),e.title&&(s.title=e.title),this.outerHTML(s)):""},e.prototype.results_update_field=function(){if(this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing)return this.winnow_results()},e.prototype.reset_single_select_options=function(){var e,t,s,i,r;for(r=[],e=0,t=(s=this.results_data).length;e<t;e++)(i=s[e]).selected?r.push(i.selected=!1):r.push(void 0);return r},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(e){return this.results_showing?this.winnow_results():this.results_show()},e.prototype.winnow_results=function(e){var t,s,i,r,n,o,l,h,c,a,_,u,d,p,f;for(this.no_results_clear(),a=0,t=(l=this.get_search_text()).replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),c=this.get_search_regex(t),i=0,r=(h=this.results_data).length;i<r;i++)(n=h[i]).search_match=!1,_=null,u=null,n.highlighted_html="",this.include_option_in_results(n)&&(n.group&&(n.group_match=!1,n.active_options=0),null!=n.group_array_index&&this.results_data[n.group_array_index]&&(0===(_=this.results_data[n.group_array_index]).active_options&&_.search_match&&(a+=1),_.active_options+=1),f=n.group?n.label:n.text,n.group&&!this.group_search||(u=this.search_string_match(f,c),n.search_match=null!=u,n.search_match&&!n.group&&(a+=1),n.search_match?(l.length&&(d=u.index,o=f.slice(0,d),s=f.slice(d,d+l.length),p=f.slice(d+l.length),n.highlighted_html=this.escape_html(o)+"<em>"+this.escape_html(s)+"</em>"+this.escape_html(p)),null!=_&&(_.group_match=!0)):null!=n.group_array_index&&this.results_data[n.group_array_index].search_match&&(n.search_match=!0)));return this.result_clear_highlight(),a<1&&l.length?(this.update_results_content(""),this.no_results(l)):(this.update_results_content(this.results_option_build()),(null!=e?e.skip_highlight:void 0)?void 0:this.winnow_results_set_highlight())},e.prototype.get_search_regex=function(e){var t,s;return s=this.search_contains?e:"(^|\\s|\\b)"+e+"[^\\s]*",this.enable_split_word_search||this.search_contains||(s="^"+s),t=this.case_sensitive_search?"":"i",new RegExp(s,t)},e.prototype.search_string_match=function(e,t){var s;return s=t.exec(e),!this.search_contains&&(null!=s?s[1]:void 0)&&(s.index+=1),s},e.prototype.choices_count=function(){var e,t,s;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,e=0,t=(s=this.form_field.options).length;e<t;e++)s[e].selected&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(e){if(e.preventDefault(),this.activate_field(),!this.results_showing&&!this.is_disabled)return this.results_show()},e.prototype.keydown_checker=function(e){var t,s;switch(s=null!=(t=e.which)?t:e.keyCode,this.search_field_scale(),8!==s&&this.pending_backstroke&&this.clear_backstroke(),s){case 8:this.backstroke_length=this.get_search_field_value().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(e),this.mouse_on_container=!1;break;case 13:case 27:this.results_showing&&e.preventDefault();break;case 32:this.disable_search&&e.preventDefault();break;case 38:e.preventDefault(),this.keyup_arrow();break;case 40:e.preventDefault(),this.keydown_arrow()}},e.prototype.keyup_checker=function(e){var t,s;switch(s=null!=(t=e.which)?t:e.keyCode,this.search_field_scale(),s){case 8:this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0?this.keydown_backstroke():this.pending_backstroke||(this.result_clear_highlight(),this.results_search());break;case 13:e.preventDefault(),this.results_showing&&this.result_select(e);break;case 27:this.results_showing&&this.results_hide();break;case 9:case 16:case 17:case 18:case 38:case 40:case 91:break;default:this.results_search()}},e.prototype.clipboard_event_checker=function(e){if(!this.is_disabled)return setTimeout(function(e){return function(){return e.results_search()}}(this),50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(e){return!(this.is_multiple&&!this.display_selected_options&&e.selected)&&(!(!this.display_disabled_options&&e.disabled)&&!e.empty)},e.prototype.search_results_touchstart=function(e){return this.touch_started=!0,this.search_results_mouseover(e)},e.prototype.search_results_touchmove=function(e){return this.touch_started=!1,this.search_results_mouseout(e)},e.prototype.search_results_touchend=function(e){if(this.touch_started)return this.search_results_mouseup(e)},e.prototype.outerHTML=function(e){var t;return e.outerHTML?e.outerHTML:((t=document.createElement("div")).appendChild(e),t.innerHTML)},e.prototype.get_single_html=function(){return'<a class="chosen-single chosen-default">\n <span>'+this.default_text+'</span>\n <div><b></b></div>\n</a>\n<div class="chosen-drop">\n <div class="chosen-search">\n <input class="chosen-search-input" type="text" autocomplete="off" />\n </div>\n <ul class="chosen-results"></ul>\n</div>'},e.prototype.get_multi_html=function(){return'<ul class="chosen-choices">\n <li class="search-field">\n <input class="chosen-search-input" type="text" autocomplete="off" value="'+this.default_text+'" />\n </li>\n</ul>\n<div class="chosen-drop">\n <ul class="chosen-results"></ul>\n</div>'},e.prototype.get_no_results_html=function(e){return'<li class="no-results">\n '+this.results_none_found+" <span>"+this.escape_html(e)+"</span>\n</li>"},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!(/iP(od|hone)/i.test(window.navigator.userAgent)||/IEMobile/i.test(window.navigator.userAgent)||/Windows Phone/i.test(window.navigator.userAgent)||/BlackBerry/i.test(window.navigator.userAgent)||/BB10/i.test(window.navigator.userAgent)||/Android.*Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="Select Some Options",e.default_single_text="Select an Option",e.default_no_result_text="No results match",e}(),this.Chosen=function(s){function r(){return r.__super__.constructor.apply(this,arguments)}var n;return i(r,e),r.prototype.setup=function(){return this.current_selectedIndex=this.form_field.selectedIndex},r.prototype.set_up_html=function(){var e,t;return(e=["chosen-container"]).push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl"),t={class:e.join(" "),title:this.form_field.title},this.form_field.id.length&&(t.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=new Element("div",t),this.container.setStyle({width:this.container_width()}),this.is_multiple?this.container.update(this.get_multi_html()):this.container.update(this.get_single_html()),this.form_field.hide().insert({after:this.container}),this.dropdown=this.container.down("div.chosen-drop"),this.search_field=this.container.down("input"),this.search_results=this.container.down("ul.chosen-results"),this.search_field_scale(),this.search_no_results=this.container.down("li.no-results"),this.is_multiple?(this.search_choices=this.container.down("ul.chosen-choices"),this.search_container=this.container.down("li.search-field")):(this.search_container=this.container.down("div.chosen-search"),this.selected_item=this.container.down(".chosen-single")),this.results_build(),this.set_tab_index(),this.set_label_behavior()},r.prototype.on_ready=function(){return this.form_field.fire("chosen:ready",{chosen:this})},r.prototype.register_observers=function(){return this.container.observe("touchstart",function(e){return function(t){return e.container_mousedown(t)}}(this)),this.container.observe("touchend",function(e){return function(t){return e.container_mouseup(t)}}(this)),this.container.observe("mousedown",function(e){return function(t){return e.container_mousedown(t)}}(this)),this.container.observe("mouseup",function(e){return function(t){return e.container_mouseup(t)}}(this)),this.container.observe("mouseenter",function(e){return function(t){return e.mouse_enter(t)}}(this)),this.container.observe("mouseleave",function(e){return function(t){return e.mouse_leave(t)}}(this)),this.search_results.observe("mouseup",function(e){return function(t){return e.search_results_mouseup(t)}}(this)),this.search_results.observe("mouseover",function(e){return function(t){return e.search_results_mouseover(t)}}(this)),this.search_results.observe("mouseout",function(e){return function(t){return e.search_results_mouseout(t)}}(this)),this.search_results.observe("mousewheel",function(e){return function(t){return e.search_results_mousewheel(t)}}(this)),this.search_results.observe("DOMMouseScroll",function(e){return function(t){return e.search_results_mousewheel(t)}}(this)),this.search_results.observe("touchstart",function(e){return function(t){return e.search_results_touchstart(t)}}(this)),this.search_results.observe("touchmove",function(e){return function(t){return e.search_results_touchmove(t)}}(this)),this.search_results.observe("touchend",function(e){return function(t){return e.search_results_touchend(t)}}(this)),this.form_field.observe("chosen:updated",function(e){return function(t){return e.results_update_field(t)}}(this)),this.form_field.observe("chosen:activate",function(e){return function(t){return e.activate_field(t)}}(this)),this.form_field.observe("chosen:open",function(e){return function(t){return e.container_mousedown(t)}}(this)),this.form_field.observe("chosen:close",function(e){return function(t){return e.close_field(t)}}(this)),this.search_field.observe("blur",function(e){return function(t){return e.input_blur(t)}}(this)),this.search_field.observe("keyup",function(e){return function(t){return e.keyup_checker(t)}}(this)),this.search_field.observe("keydown",function(e){return function(t){return e.keydown_checker(t)}}(this)),this.search_field.observe("focus",function(e){return function(t){return e.input_focus(t)}}(this)),this.search_field.observe("cut",function(e){return function(t){return e.clipboard_event_checker(t)}}(this)),this.search_field.observe("paste",function(e){return function(t){return e.clipboard_event_checker(t)}}(this)),this.is_multiple?this.search_choices.observe("click",function(e){return function(t){return e.choices_click(t)}}(this)):this.container.observe("click",function(e){return e.preventDefault()})},r.prototype.destroy=function(){var e,t,s,i;for(this.container.ownerDocument.stopObserving("click",this.click_test_action),t=0,s=(i=["chosen:updated","chosen:activate","chosen:open","chosen:close"]).length;t<s;t++)e=i[t],this.form_field.stopObserving(e);return this.container.stopObserving(),this.search_results.stopObserving(),this.search_field.stopObserving(),null!=this.form_field_label&&this.form_field_label.stopObserving(),this.is_multiple?(this.search_choices.stopObserving(),this.container.select(".search-choice-close").each(function(e){return e.stopObserving()})):this.selected_item.stopObserving(),this.search_field.tabIndex&&(this.form_field.tabIndex=this.search_field.tabIndex),this.container.remove(),this.form_field.show()},r.prototype.search_field_disabled=function(){var e;return this.is_disabled=this.form_field.disabled||(null!=(e=this.form_field.up("fieldset"))?e.disabled:void 0)||!1,this.is_disabled?this.container.addClassName("chosen-disabled"):this.container.removeClassName("chosen-disabled"),this.search_field.disabled=this.is_disabled,this.is_multiple||this.selected_item.stopObserving("focus",this.activate_field),this.is_disabled?this.close_field():this.is_multiple?void 0:this.selected_item.observe("focus",this.activate_field)},r.prototype.container_mousedown=function(e){var t;if(!this.is_disabled)return!e||"mousedown"!==(t=e.type)&&"touchstart"!==t||this.results_showing||e.preventDefault(),null!=e&&e.target.hasClassName("search-choice-close")?void 0:(this.active_field?this.is_multiple||!e||e.target!==this.selected_item&&!e.target.up("a.chosen-single")||this.results_toggle():(this.is_multiple&&this.search_field.clear(),this.container.ownerDocument.observe("click",this.click_test_action),this.results_show()),this.activate_field())},r.prototype.container_mouseup=function(e){if("ABBR"===e.target.nodeName&&!this.is_disabled)return this.results_reset(e)},r.prototype.search_results_mousewheel=function(e){var t;if(null!=(t=e.deltaY||-e.wheelDelta||e.detail))return e.preventDefault(),"DOMMouseScroll"===e.type&&(t*=40),this.search_results.scrollTop=t+this.search_results.scrollTop},r.prototype.blur_test=function(e){if(!this.active_field&&this.container.hasClassName("chosen-container-active"))return this.close_field()},r.prototype.close_field=function(){return this.container.ownerDocument.stopObserving("click",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClassName("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale(),this.search_field.blur()},r.prototype.activate_field=function(){if(!this.is_disabled)return this.container.addClassName("chosen-container-active"),this.active_field=!0,this.search_field.value=this.get_search_field_value(),this.search_field.focus()},r.prototype.test_active_click=function(e){return e.target.up(".chosen-container")===this.container?this.active_field=!0:this.close_field()},r.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=t.select_to_array(this.form_field),this.is_multiple?this.search_choices.select("li.search-choice").invoke("remove"):(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field.readOnly=!0,this.container.addClassName("chosen-container-single-nosearch")):(this.search_field.readOnly=!1,this.container.removeClassName("chosen-container-single-nosearch"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},r.prototype.result_do_highlight=function(e){var t,s,i,r,n;return this.result_clear_highlight(),this.result_highlight=e,this.result_highlight.addClassName("highlighted"),i=parseInt(this.search_results.getStyle("maxHeight"),10),n=this.search_results.scrollTop,r=i+n,s=this.result_highlight.positionedOffset().top,(t=s+this.result_highlight.getHeight())>=r?this.search_results.scrollTop=t-i>0?t-i:0:s<n?this.search_results.scrollTop=s:void 0},r.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClassName("highlighted"),this.result_highlight=null},r.prototype.results_show=function(){return this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field.fire("chosen:maxselected",{chosen:this}),!1):(this.container.addClassName("chosen-with-drop"),this.results_showing=!0,this.search_field.focus(),this.search_field.value=this.get_search_field_value(),this.winnow_results(),this.form_field.fire("chosen:showing_dropdown",{chosen:this}))},r.prototype.update_results_content=function(e){return this.search_results.update(e)},r.prototype.results_hide=function(){return this.results_showing&&(this.result_clear_highlight(),this.container.removeClassName("chosen-with-drop"),this.form_field.fire("chosen:hiding_dropdown",{chosen:this})),this.results_showing=!1},r.prototype.set_tab_index=function(e){var t;if(this.form_field.tabIndex)return t=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field.tabIndex=t},r.prototype.set_label_behavior=function(){if(this.form_field_label=this.form_field.up("label"),null==this.form_field_label&&(this.form_field_label=$$("label[for='"+this.form_field.id+"']").first()),null!=this.form_field_label)return this.form_field_label.observe("click",this.label_click_handler)},r.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.value=this.default_text,this.search_field.addClassName("default")):(this.search_field.value="",this.search_field.removeClassName("default"))},r.prototype.search_results_mouseup=function(e){var t;if(t=e.target.hasClassName("active-result")?e.target:e.target.up(".active-result"))return this.result_highlight=t,this.result_select(e),this.search_field.focus()},r.prototype.search_results_mouseover=function(e){var t;if(t=e.target.hasClassName("active-result")?e.target:e.target.up(".active-result"))return this.result_do_highlight(t)},r.prototype.search_results_mouseout=function(e){if(e.target.hasClassName("active-result")||e.target.up(".active-result"))return this.result_clear_highlight()},r.prototype.choice_build=function(e){var t,s;return t=new Element("li",{class:"search-choice"}).update("<span>"+this.choice_label(e)+"</span>"),e.disabled?t.addClassName("search-choice-disabled"):((s=new Element("a",{href:"#",class:"search-choice-close",rel:e.array_index})).observe("click",function(e){return function(t){return e.choice_destroy_link_click(t)}}(this)),t.insert(s)),this.search_container.insert({before:t})},r.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(e.target)},r.prototype.choice_destroy=function(e){if(this.result_deselect(e.readAttribute("rel")))return this.active_field?this.search_field.focus():this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.get_search_field_value().length<1&&this.results_hide(),e.up("li").remove(),this.search_field_scale()},r.prototype.results_reset=function(){if(this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup(),this.trigger_form_field_change(),this.active_field)return this.results_hide()},r.prototype.results_reset_cleanup=function(){var e;if(this.current_selectedIndex=this.form_field.selectedIndex,e=this.selected_item.down("abbr"))return e.remove()},r.prototype.result_select=function(e){var t,s;if(this.result_highlight)return t=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field.fire("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?t.removeClassName("active-result"):this.reset_single_select_options(),t.addClassName("result-selected"),s=this.results_data[t.getAttribute("data-option-array-index")],s.selected=!0,this.form_field.options[s.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(s):this.single_set_selected_text(this.choice_label(s)),this.is_multiple&&(!this.hide_results_on_select||e.metaKey||e.ctrlKey)?e.metaKey||e.ctrlKey?this.winnow_results({skip_highlight:!0}):(this.search_field.value="",this.winnow_results()):(this.results_hide(),this.show_search_field_default()),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&this.trigger_form_field_change(),this.current_selectedIndex=this.form_field.selectedIndex,e.preventDefault(),this.search_field_scale())},r.prototype.single_set_selected_text=function(e){return null==e&&(e=this.default_text),e===this.default_text?this.selected_item.addClassName("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClassName("chosen-default")),this.selected_item.down("span").update(e)},r.prototype.result_deselect=function(e){var t;return t=this.results_data[e],!this.form_field.options[t.options_index].disabled&&(t.selected=!1,this.form_field.options[t.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.trigger_form_field_change(),this.search_field_scale(),!0)},r.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.down("abbr")||this.selected_item.down("span").insert({after:'<abbr class="search-choice-close"></abbr>'}),this.selected_item.addClassName("chosen-single-with-deselect")},r.prototype.get_search_field_value=function(){return this.search_field.value},r.prototype.get_search_text=function(){return this.get_search_field_value().strip()},r.prototype.escape_html=function(e){return e.escapeHTML()},r.prototype.winnow_results_set_highlight=function(){var e;if(this.is_multiple||(e=this.search_results.down(".result-selected.active-result")),null==e&&(e=this.search_results.down(".active-result")),null!=e)return this.result_do_highlight(e)},r.prototype.no_results=function(e){return this.search_results.insert(this.get_no_results_html(e)),this.form_field.fire("chosen:no_results",{chosen:this})},r.prototype.no_results_clear=function(){var e,t;for(e=null,t=[];e=this.search_results.down(".no-results");)t.push(e.remove());return t},r.prototype.keydown_arrow=function(){var e;return this.results_showing&&this.result_highlight?(e=this.result_highlight.next(".active-result"))?this.result_do_highlight(e):void 0:this.results_show()},r.prototype.keyup_arrow=function(){var e,t,s;return this.results_showing||this.is_multiple?this.result_highlight?(s=this.result_highlight.previousSiblings(),e=this.search_results.select("li.active-result"),(t=s.intersect(e)).length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},r.prototype.keydown_backstroke=function(){var e;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.down("a")),this.clear_backstroke()):(e=this.search_container.siblings().last())&&e.hasClassName("search-choice")&&!e.hasClassName("search-choice-disabled")?(this.pending_backstroke=e,this.pending_backstroke&&this.pending_backstroke.addClassName("search-choice-focus"),this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClassName("search-choice-focus")):void 0},r.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClassName("search-choice-focus"),this.pending_backstroke=null},r.prototype.search_field_scale=function(){var e,t,s,i,r,n,o,l;if(this.is_multiple){for(n={position:"absolute",left:"-1000px",top:"-1000px",display:"none",whiteSpace:"pre"},s=0,i=(o=["fontSize","fontStyle","fontWeight","fontFamily","lineHeight","textTransform","letterSpacing"]).length;s<i;s++)n[r=o[s]]=this.search_field.getStyle(r);return(t=new Element("div").update(this.escape_html(this.get_search_field_value()))).setStyle(n),document.body.appendChild(t),l=t.measure("width")+25,t.remove(),(e=this.container.getWidth())&&(l=Math.min(e-10,l)),this.search_field.setStyle({width:l+"px"})}},r.prototype.trigger_form_field_change=function(){return n(this.form_field,"input"),n(this.form_field,"change")},n=function(e,t){var s;if(e.dispatchEvent){try{s=new Event(t,{bubbles:!0,cancelable:!0})}catch(e){(s=document.createEvent("HTMLEvents")).initEvent(t,!0,!0)}return e.dispatchEvent(s)}return e.fireEvent("on"+t,document.createEventObject())},r}()}).call(this);
|
assets/libs/chosen/index.php
DELETED
@@ -1,3 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
// Silence is golden.
|
3 |
-
?>
|
|
|
|
|
|
core/admin/wpbc-class-listing.php
CHANGED
@@ -295,7 +295,7 @@ class WPBC_Booking_Listing_Table {
|
|
295 |
|
296 |
// is New
|
297 |
?><div id="booking_mark_<?php echo $row_data[ 'id' ]; ?>"
|
298 |
-
class="<?php if ( $row_data[ 'is_new'] != '1') echo ' hidden_items '; ?> wpbc-listing-collumn new-label clearfix-height"
|
299 |
<a href="javascript:void(0)"
|
300 |
onclick="javascript:mark_read_booking( '<?php echo $row_data[ 'id' ]; ?>', 0, <?php echo $this->user_id; ?>, '<?php echo wpbc_get_booking_locale(); ?>' );"
|
301 |
class="tooltip_right approve_bk_link"
|
295 |
|
296 |
// is New
|
297 |
?><div id="booking_mark_<?php echo $row_data[ 'id' ]; ?>"
|
298 |
+
class="<?php if ( $row_data[ 'is_new'] != '1') echo ' hidden_items '; ?> wpbc-listing-collumn new-label clearfix-height">
|
299 |
<a href="javascript:void(0)"
|
300 |
onclick="javascript:mark_read_booking( '<?php echo $row_data[ 'id' ]; ?>', 0, <?php echo $this->user_id; ?>, '<?php echo wpbc_get_booking_locale(); ?>' );"
|
301 |
class="tooltip_right approve_bk_link"
|
core/admin/wpbc-toolbars.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php /**
|
2 |
* @version 1.0
|
3 |
-
* @package Booking Calendar
|
4 |
* @category Toolbar. Data for UI Elements at Booking Calendar admin pages
|
5 |
* @author wpdevelop
|
6 |
*
|
7 |
* @web-site https://wpbookingcalendar.com/
|
8 |
-
* @email info@wpbookingcalendar.com
|
9 |
-
*
|
10 |
* @modified 2015-11-16
|
11 |
*/
|
12 |
|
@@ -21,31 +21,31 @@ if ( ! defined( 'ABSPATH' ) ) exit;
|
|
21 |
function wpbc_bookings_toolbar() {
|
22 |
|
23 |
wpbc_clear_div();
|
24 |
-
|
25 |
wpbc_toolbar_search_by_id_bookings(); // Search bookings by ID - form at the top right side of the page
|
26 |
-
|
27 |
-
wpbc_toolbar_btn__view_mode(); // Vertical Buttons
|
28 |
-
|
29 |
// Toolbar ////////////////////////////////////////////////////////////////
|
30 |
-
|
31 |
?><div id="toolbar_booking_listing" style="margin-left: 50px;position:relative;"><?php
|
32 |
|
33 |
wpbc_bs_toolbar_tabs_html_container_start();
|
34 |
|
35 |
// <editor-fold defaultstate="collapsed" desc=" T O P T A B s " >
|
36 |
-
|
37 |
-
if ( ! isset( $_REQUEST['tab'] ) ) $_REQUEST['tab'] = 'filter';
|
38 |
$selected_tab = $_REQUEST['tab'];
|
39 |
|
40 |
wpbc_bs_display_tab( array(
|
41 |
-
'title' => ' ' . __('Filters', 'booking')
|
42 |
, 'onclick' => "jQuery('.visibility_container').hide();"
|
43 |
. "jQuery('#filter_toolbar_container').show();"
|
44 |
. "jQuery('.nav-tab').removeClass('nav-tab-active');"
|
45 |
. "jQuery(this).addClass('nav-tab-active');"
|
46 |
. "jQuery('.nav-tab i.icon-white').removeClass('icon-white');"
|
47 |
. "jQuery('.nav-tab-active i').addClass('icon-white');"
|
48 |
-
, 'font_icon' => 'glyphicon glyphicon-random'
|
49 |
, 'default' => ( $selected_tab == 'filter' ) ? true : false
|
50 |
) );
|
51 |
wpbc_bs_display_tab( array(
|
@@ -57,30 +57,30 @@ function wpbc_bookings_toolbar() {
|
|
57 |
. "jQuery(this).addClass('nav-tab-active');"
|
58 |
. "jQuery('.nav-tab i.icon-white').removeClass('icon-white');"
|
59 |
. "jQuery('.nav-tab-active i').addClass('icon-white');"
|
60 |
-
|
61 |
, 'font_icon' => 'glyphicon glyphicon-fire'
|
62 |
, 'default' => ( $selected_tab == 'actions' ) ? true : false
|
63 |
|
64 |
-
) );
|
65 |
|
66 |
wpbc_bs_dropdown_menu_help();
|
67 |
-
|
68 |
// </editor-fold>
|
69 |
-
|
70 |
wpbc_bs_toolbar_tabs_html_container_end();
|
71 |
|
72 |
////////////////////////////////////////////////////////////////////////
|
73 |
-
|
74 |
wpbc_bs_toolbar_sub_html_container_start();
|
75 |
-
|
76 |
// F i l t e r T o o l b a r f o r B o o k i n g L i s t i n g
|
77 |
-
|
78 |
-
?><div id="filter_toolbar_container" class="visibility_container clearfix-height" style="display:<?php echo ( $selected_tab == 'filter' ) ? 'block' : 'none' ?>;margin-top:-5px;"><?php
|
79 |
|
80 |
?><form name="booking_filters_form" action="" method="post" id="booking_filters_form" class="form-inline">
|
81 |
-
<input type="hidden" name="page_num" id ="page_num" value="1" /><?php
|
82 |
|
83 |
-
wpbc_toolbar_btn__apply_reset(); // A p p l y R e s e t B u t t o n s
|
84 |
|
85 |
wpbc_toolbar_filter__approve_pending(); // A p p r o v e d | P e n d i n g F i l t e r
|
86 |
|
@@ -89,8 +89,8 @@ function wpbc_bookings_toolbar() {
|
|
89 |
wpbc_toolbar_filter__sort(); // S o r t F i l t e r
|
90 |
|
91 |
wpbc_toolbar_filter__trash(); // T r a s h F i l t e r
|
92 |
-
|
93 |
-
?><span class="advanced_booking_filter" style="display:none;"><?php
|
94 |
|
95 |
wpbc_toolbar_filter__new_bookings(); // N e w | A l l B o o k i n g s F i l t e r
|
96 |
|
@@ -108,22 +108,22 @@ function wpbc_bookings_toolbar() {
|
|
108 |
|
109 |
make_bk_action( 'wpbc_br_selection_for_listing' );
|
110 |
|
111 |
-
if ( function_exists( 'wpbc_filter_template_save_delete' ) ) wpbc_filter_template_save_delete();
|
112 |
|
113 |
?></form><?php
|
114 |
-
|
115 |
wpbc_clear_div();
|
116 |
-
|
117 |
-
wpbc_toolbar_expand_collapse_btn( 'advanced_booking_filter' );
|
118 |
-
|
119 |
?></div><?php
|
120 |
-
|
121 |
-
|
122 |
// A c t i o n s T o o l b a r f o r B o o k i n g L i s t i n g
|
123 |
-
|
124 |
-
?><div id="actions_toolbar_container" class="visibility_container clearfix-height" style="display:<?php echo ( $selected_tab == 'actions' ) ? 'block' : 'none' ?>;margin-top:-5px;"><?php
|
125 |
-
|
126 |
-
$user = wp_get_current_user();
|
127 |
$user_bk_id = $user->ID;
|
128 |
|
129 |
wpbc_toolbar_btn__approve_reject( $user_bk_id ); // A p p r o v e | R e j e c t
|
@@ -139,18 +139,18 @@ function wpbc_bookings_toolbar() {
|
|
139 |
if ( function_exists('wpbc_toolbar_action_export_print_buttons') ) wpbc_toolbar_action_export_print_buttons();
|
140 |
|
141 |
wpbc_toolbar_btn__empty_trash( $user_bk_id ); // Empty Trash //FixIn: 8.5.2.24
|
142 |
-
|
143 |
wpbc_clear_div();
|
144 |
-
|
145 |
-
?></div><?php
|
146 |
-
|
147 |
wpbc_bs_toolbar_sub_html_container_end();
|
148 |
-
|
149 |
wpbc_toolbar_is_send_emails_btn();
|
150 |
-
|
151 |
?></div><?php
|
152 |
-
|
153 |
-
wpbc_clear_div();
|
154 |
}
|
155 |
|
156 |
|
@@ -158,20 +158,20 @@ function wpbc_bookings_toolbar() {
|
|
158 |
function wpbc_timeline_toolbar() {
|
159 |
|
160 |
wpbc_clear_div();
|
161 |
-
|
162 |
wpbc_toolbar_search_by_id_bookings(); // Search bookings by ID - form at the top right side of the page
|
163 |
-
|
164 |
-
wpbc_toolbar_btn__view_mode(); // Vertical Buttons
|
165 |
-
|
166 |
// Toolbar ////////////////////////////////////////////////////////////////
|
167 |
-
|
168 |
?><div id="toolbar_booking_listing" style="margin-left: 50px;position:relative;"><?php
|
169 |
|
170 |
wpbc_bs_toolbar_tabs_html_container_start();
|
171 |
-
|
172 |
// <editor-fold defaultstate="collapsed" desc=" T O P T A B s " >
|
173 |
-
|
174 |
-
if ( ! isset( $_REQUEST['tab_cvm'] ) ) $_REQUEST['tab_cvm'] = 'actions_cvm';
|
175 |
$selected_tab = $_REQUEST['tab_cvm'];
|
176 |
|
177 |
wpbc_bs_display_tab( array(
|
@@ -186,39 +186,39 @@ function wpbc_timeline_toolbar() {
|
|
186 |
, 'font_icon' => 'glyphicon glyphicon-fire'
|
187 |
, 'default' => ( $selected_tab == 'actions_cvm' ) ? true : false
|
188 |
|
189 |
-
) );
|
190 |
|
191 |
|
192 |
wpbc_bs_dropdown_menu_help();
|
193 |
|
194 |
// </editor-fold>
|
195 |
-
|
196 |
wpbc_bs_toolbar_tabs_html_container_end();
|
197 |
|
198 |
////////////////////////////////////////////////////////////////////////
|
199 |
-
|
200 |
wpbc_bs_toolbar_sub_html_container_start();
|
201 |
-
|
202 |
// A c t i o n s T o o l b a r f o r T i m e l i n e
|
203 |
-
|
204 |
-
?><div id="actions_toolbar_container" class="visibility_container clearfix-height" style="display:<?php echo ( $selected_tab == 'actions_cvm' ) ? 'block' : 'none' ?>;margin-top:-5px;"><?php
|
205 |
-
|
206 |
wpbc_toolbar_btn__timeline_view_mode(); // View Mode Buttons
|
207 |
|
208 |
wpbc_toolbar_btn__timeline_navigation(); // Navigation Buttons
|
209 |
|
210 |
make_bk_action( 'wpbc_br_selection_for_timeline' );
|
211 |
-
|
212 |
-
?></div><?php
|
213 |
-
|
214 |
wpbc_bs_toolbar_sub_html_container_end();
|
215 |
-
|
216 |
wpbc_toolbar_is_send_emails_btn();
|
217 |
-
|
218 |
?></div><?php
|
219 |
-
|
220 |
wpbc_clear_div();
|
221 |
-
|
222 |
}
|
223 |
|
224 |
|
@@ -226,16 +226,16 @@ function wpbc_timeline_toolbar() {
|
|
226 |
function wpbc_add_new_booking_toolbar() {
|
227 |
|
228 |
wpbc_clear_div();
|
229 |
-
|
230 |
// Toolbar ////////////////////////////////////////////////////////////////
|
231 |
-
|
232 |
?><div id="toolbar_booking_listing" style="position:relative;"><?php
|
233 |
|
234 |
wpbc_bs_toolbar_tabs_html_container_start();
|
235 |
-
|
236 |
// <editor-fold defaultstate="collapsed" desc=" T O P T A B s " >
|
237 |
-
|
238 |
-
if ( ! isset( $_REQUEST['toolbar'] ) ) $_REQUEST['toolbar'] = 'filter';
|
239 |
$selected_tab = $_REQUEST['toolbar'];
|
240 |
|
241 |
wpbc_bs_display_tab( array(
|
@@ -250,117 +250,117 @@ function wpbc_add_new_booking_toolbar() {
|
|
250 |
, 'font_icon' => 'glyphicon glyphicon-fire'
|
251 |
, 'default' => ( $selected_tab == 'filter' ) ? true : false
|
252 |
|
253 |
-
) );
|
254 |
|
255 |
|
256 |
wpbc_bs_dropdown_menu_help();
|
257 |
|
258 |
// </editor-fold>
|
259 |
-
|
260 |
wpbc_bs_toolbar_tabs_html_container_end();
|
261 |
|
262 |
////////////////////////////////////////////////////////////////////////
|
263 |
-
|
264 |
wpbc_bs_toolbar_sub_html_container_start();
|
265 |
-
|
266 |
// T o o l b a r
|
267 |
-
?><div id="filter_toolbar_container" class="visibility_container clearfix-height" style="display:<?php echo ( $selected_tab == 'filter' ) ? 'block' : 'none' ?>;margin-top:-5px;"><?php
|
268 |
-
|
269 |
-
if ( ( function_exists( 'wpbc_toolbar_btn__resource_selection' ) )
|
270 |
&& ( empty( $_GET['booking_hash'] ) ) ) //Do not show resource seleciton if editing booking. //FixIn:7.1.2.10
|
271 |
wpbc_toolbar_btn__resource_selection();
|
272 |
-
|
273 |
if ( function_exists( 'wpbc_toolbar_btn__form_selection' ) )
|
274 |
wpbc_toolbar_btn__form_selection();
|
275 |
-
|
276 |
////////////////////////////////////////////////////////////////////
|
277 |
-
?><div class="clear-for-mobile"></div><?php
|
278 |
-
|
279 |
-
?><div class="control-group wpbc-no-padding" style="float:right;margin-right: 0;margin-left: 15px;"><?php
|
280 |
-
|
281 |
if ( function_exists( 'wpbc_toolbar_btn__auto_fill' ) )
|
282 |
wpbc_toolbar_btn__auto_fill();
|
283 |
-
|
284 |
wpbc_toolbar_btn__add_new_booking();
|
285 |
-
|
286 |
?></div><?php
|
287 |
////////////////////////////////////////////////////////////////////
|
288 |
|
289 |
-
|
290 |
-
?><span class="advanced_booking_filter" style="display:none;"><div class="clear" style="width:100%;border-bottom:1px solid #ccc;height:10px;"></div><?php
|
291 |
-
|
292 |
// Get possible saved previous "Custom User Calendar data"
|
293 |
$user_calendar_options = get_user_option( 'booking_custom_' . 'add_booking_calendar_options', get_wpbc_current_user_id() );
|
294 |
|
295 |
if ( $user_calendar_options === false ) { // Default, if no saved previously.
|
296 |
-
$user_calendar_options = array();
|
297 |
$user_calendar_options['calendar_months_count'] = 1;
|
298 |
$user_calendar_options['calendar_months_num_in_1_row'] = 0 ;
|
299 |
$user_calendar_options['calendar_width'] = '';
|
300 |
-
$user_calendar_options['calendar_widthunits'] = 'px';
|
301 |
-
$user_calendar_options['calendar_cell_height'] = '';
|
302 |
-
$user_calendar_options['calendar_cell_heightunits'] = 'px';
|
303 |
} else {
|
304 |
$user_calendar_options = maybe_unserialize( $user_calendar_options );
|
305 |
}
|
306 |
-
|
307 |
wpbc_toolbar_btn__calendar_months_number_selection( $user_calendar_options );
|
308 |
-
|
309 |
wpbc_toolbar_btn__calendar_months_num_in_1_row_selection( $user_calendar_options );
|
310 |
|
311 |
wpbc_toolbar_btn__calendar_width( $user_calendar_options );
|
312 |
-
|
313 |
wpbc_toolbar_btn__calendar_cell_height( $user_calendar_options );
|
314 |
-
|
315 |
wpbc_toolbar_btn__calendar_options_save();
|
316 |
-
|
317 |
?><div class="clear"></div></span><?php
|
318 |
-
|
319 |
-
|
320 |
wpbc_clear_div();
|
321 |
-
|
322 |
-
wpbc_toolbar_expand_collapse_btn( 'advanced_booking_filter' );
|
323 |
-
|
324 |
?></div><?php
|
325 |
|
326 |
-
|
327 |
wpbc_bs_toolbar_sub_html_container_end();
|
328 |
-
|
329 |
wpbc_toolbar_is_send_emails_btn();
|
330 |
-
|
331 |
?></div><?php
|
332 |
-
|
333 |
wpbc_clear_div();
|
334 |
-
|
335 |
}
|
336 |
|
337 |
|
338 |
-
////////////////////////////////////////////////////////////////////////////////
|
339 |
// HTML elements for Toolbar
|
340 |
////////////////////////////////////////////////////////////////////////////////
|
341 |
|
342 |
/**
|
343 |
* Expand or Collapse Advanced Filter set
|
344 |
-
*
|
345 |
* @param string $css_class_of_expand_element - CSS Class of element section to show or hide
|
346 |
*/
|
347 |
function wpbc_toolbar_expand_collapse_btn( $css_class_of_expand_element ) {
|
348 |
-
|
349 |
-
?><span id="show_link_advanced_booking_filter" class="tab-bottom tooltip_right"
|
350 |
-
title="<?php _e('Expand Advanced Toolbar' ,'booking'); ?>"
|
351 |
-
><a href="javascript:void(0)"
|
352 |
onclick="javascript:jQuery('.<?php echo $css_class_of_expand_element; ?>').show();
|
353 |
jQuery('#show_link_advanced_booking_filter').hide();
|
354 |
-
jQuery('#hide_link_advanced_booking_filter').show();"><i
|
355 |
class="glyphicon glyphicon-chevron-down"></i></a></span>
|
356 |
-
<span id="hide_link_advanced_booking_filter" class="tab-bottom tooltip_right" style="display:none;"
|
357 |
-
title="<?php _e('Collapse Advanced Toolbar' ,'booking'); ?>"
|
358 |
-
><a href="javascript:void(0)"
|
359 |
-
onclick="javascript:jQuery('.<?php echo $css_class_of_expand_element; ?>').hide();
|
360 |
-
jQuery('#hide_link_advanced_booking_filter').hide();
|
361 |
-
jQuery('#show_link_advanced_booking_filter').show();"><i
|
362 |
-
class="glyphicon glyphicon-chevron-up"></i></a></span><?php
|
363 |
-
|
364 |
}
|
365 |
|
366 |
|
@@ -387,39 +387,39 @@ function wpbc_toolbar_is_send_emails_btn() {
|
|
387 |
|
388 |
/** Search form by booking ID (at top right side of page) */
|
389 |
function wpbc_toolbar_search_by_id_bookings() {
|
390 |
-
|
391 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( true, false ), array('view_mode', 'wh_booking_id', 'page_num' ) );
|
392 |
-
|
393 |
-
?>
|
394 |
<div style=" position: absolute; right: 20px; top: 10px;">
|
395 |
<form name="booking_filters_formID" action="<?php echo $bk_admin_url . '&view_mode=vm_listing' ; ?>" method="post" id="booking_filters_formID" >
|
396 |
-
<?php
|
397 |
-
|
398 |
if (isset($_REQUEST['wh_booking_id'])) $wh_booking_id = wpbc_clean_digit_or_csd( $_REQUEST['wh_booking_id'] ); // {'1', '2', .... }
|
399 |
-
else $wh_booking_id = '';
|
400 |
-
|
401 |
-
|
402 |
-
$params = array( 'label_for' => 'wh_booking_id'
|
403 |
, 'label' => ''//__('Keyword:', 'booking')
|
404 |
, 'items' => array(
|
405 |
-
array( 'type' => 'text', 'id' => 'wh_booking_id', 'value' => $wh_booking_id, 'placeholder' => __('Booking ID', 'booking') )
|
406 |
-
, array(
|
407 |
'type' => 'button'
|
408 |
, 'title' => __('Go', 'booking')
|
409 |
-
, 'class' => 'button-secondary'
|
410 |
, 'font_icon' => 'glyphicon glyphicon-search'
|
411 |
, 'icon_position' => 'right'
|
412 |
-
, 'action' => "jQuery('#booking_filters_formID').submit();" )
|
413 |
)
|
414 |
-
);
|
415 |
?><div class="control-group wpbc-no-padding" ><?php
|
416 |
-
wpbc_bs_input_group( $params );
|
417 |
?></div><?php
|
418 |
?>
|
419 |
</form>
|
420 |
<?php wpbc_clear_div(); ?>
|
421 |
</div>
|
422 |
-
<?php
|
423 |
}
|
424 |
|
425 |
|
@@ -430,11 +430,11 @@ function wpbc_toolbar_search_by_id_bookings() {
|
|
430 |
/** Help - Drop Down Menu - T a b */
|
431 |
function wpbc_bs_dropdown_menu_help() {
|
432 |
|
433 |
-
wpbc_bs_dropdown_menu( array(
|
434 |
-
'title' => __( 'Help', 'booking' )
|
435 |
, 'font_icon' => 'glyphicon glyphicon-question-sign'
|
436 |
, 'position' => 'right'
|
437 |
-
, 'items' => array(
|
438 |
array( 'type' => 'link', 'title' => "What's New"/*__('Get Started')*/, 'url' => esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-about' ), 'index.php' ) ) ) )
|
439 |
, array( 'type' => 'divider' )
|
440 |
, array( 'type' => 'link', 'title' => __('Help', 'booking'), 'url' => 'https://wpbookingcalendar.com/help/' )
|
@@ -447,16 +447,16 @@ function wpbc_bs_dropdown_menu_help() {
|
|
447 |
, 'attr' => array(
|
448 |
// 'target' => '_blank'
|
449 |
'style' => 'font-weight: 600;font-size: 1em;'
|
450 |
-
)
|
451 |
)
|
452 |
)
|
453 |
-
) );
|
454 |
}
|
455 |
|
456 |
|
457 |
/** View Mode - B u t t o n */
|
458 |
function wpbc_toolbar_btn__view_mode() {
|
459 |
-
|
460 |
$selected_view_mode = $_REQUEST['view_mode'];
|
461 |
|
462 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false ), array('view_mode', 'wh_booking_id', 'page_num' ) );
|
@@ -468,15 +468,15 @@ function wpbc_toolbar_btn__view_mode() {
|
|
468 |
, 'selected' => ( $selected_view_mode == 'vm_listing' ) ? true : false
|
469 |
, 'link' => $bk_admin_url . '&view_mode=vm_listing'
|
470 |
, 'icon' => ''
|
471 |
-
, 'font_icon' => 'glyphicon glyphicon-align-justify'
|
472 |
);
|
473 |
-
|
474 |
-
|
475 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false ) , array() // Exclude Value of this parameter
|
476 |
-
, array( 'page', 'tab', 'tab_cvm', 'wh_booking_type', 'scroll_start_date', 'scroll_month', 'view_days_num'
|
477 |
-
, 'wh_trash' //FixIn: 6.1.1.10
|
478 |
) // Only this parameters
|
479 |
-
);
|
480 |
$params['btn_vm_calendar'] = array(
|
481 |
'title' => ''
|
482 |
, 'hint' => array( 'title' => __('Calendar Overview' ,'booking') , 'position' => 'bottom' )
|
@@ -487,27 +487,27 @@ function wpbc_toolbar_btn__view_mode() {
|
|
487 |
);
|
488 |
|
489 |
?><div style="position:absolute;"><?php
|
490 |
-
|
491 |
wpbc_bs_vertical_buttons_group( $params );
|
492 |
-
|
493 |
?></div><?php
|
494 |
}
|
495 |
|
496 |
|
497 |
////////////////////////////////////////////////////////////////////////////////
|
498 |
-
// Toolbar Filter B u t t o n s
|
499 |
////////////////////////////////////////////////////////////////////////////////
|
500 |
|
501 |
/** Apply | Reset - B u t t o n s */
|
502 |
function wpbc_toolbar_btn__apply_reset(){
|
503 |
|
504 |
-
$params = array(
|
505 |
'label_for' => 'wpbc_refresh' // "For" parameter of button group element
|
506 |
, 'label' => ''// '//__('Refresh listing', 'booking') // Label above the button group
|
507 |
, 'style' => '' // CSS Style of entire div element
|
508 |
, 'items' => array(
|
509 |
-
array(
|
510 |
-
'type' => 'button'
|
511 |
, 'title' => __('Apply', 'booking') // Title of the button
|
512 |
, 'hint' => array( 'title' => __('Refresh booking listing' ,'booking') , 'position' => 'top' ) // Hint
|
513 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
@@ -520,13 +520,13 @@ function wpbc_toolbar_btn__apply_reset(){
|
|
520 |
, 'attr' => array()
|
521 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
522 |
)
|
523 |
-
, array(
|
524 |
'type' => 'button'
|
525 |
, 'title' => ''
|
526 |
, 'hint' => array( 'title' => __('Reset filter to default values' ,'booking') , 'position' => 'top' ) // Hint
|
527 |
, 'link' => wpbc_get_bookings_url( true, false ) . '&view_mode=vm_listing'
|
528 |
-
, 'action' => ''
|
529 |
-
, 'class' => ''
|
530 |
, 'style' => '' //
|
531 |
, 'icon' => ''
|
532 |
, 'font_icon' => 'glyphicon glyphicon-remove'
|
@@ -535,15 +535,15 @@ function wpbc_toolbar_btn__apply_reset(){
|
|
535 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
536 |
)
|
537 |
)
|
538 |
-
);
|
539 |
-
wpbc_bs_button_group( $params );
|
540 |
}
|
541 |
|
542 |
|
543 |
/** Approved | Pending - F i l t e r */
|
544 |
function wpbc_toolbar_filter__approve_pending(){
|
545 |
|
546 |
-
$params = array(
|
547 |
'id' => 'wh_approved'
|
548 |
, 'options' => array (
|
549 |
__('Pending', 'booking') => '0',
|
@@ -553,17 +553,17 @@ function wpbc_toolbar_filter__approve_pending(){
|
|
553 |
)
|
554 |
, 'default' => ( isset( $_REQUEST[ 'wh_approved' ] ) ) ? esc_attr( $_REQUEST[ 'wh_approved' ] ) : ''
|
555 |
, 'label' => ''//__('Status', 'booking') . ':'
|
556 |
-
, 'title' => __('Bookings', 'booking')
|
557 |
-
);
|
558 |
|
559 |
-
wpbc_bs_dropdown_list( $params );
|
560 |
}
|
561 |
|
562 |
|
563 |
/** Booked Dates - F i l t e r */
|
564 |
function wpbc_toolbar_filter__booked_dates(){
|
565 |
|
566 |
-
$dates_interval = array(
|
567 |
1 => '1' . ' ' . __('day' ,'booking')
|
568 |
, 2 => '2' . ' ' . __('days' ,'booking')
|
569 |
, 3 => '3' . ' ' . __('days' ,'booking')
|
@@ -578,14 +578,14 @@ function wpbc_toolbar_filter__booked_dates(){
|
|
578 |
, 183 => '6' . ' ' . __('months' ,'booking')
|
579 |
, 365 => '1' . ' ' . __('Year' ,'booking')
|
580 |
);
|
581 |
-
$params = array(
|
582 |
'id' => 'wh_booking_date'
|
583 |
, 'id2' => 'wh_booking_date2'
|
584 |
, 'default' => ( isset( $_REQUEST[ 'wh_booking_date' ] ) ) ? esc_attr( $_REQUEST[ 'wh_booking_date' ] ) : ''
|
585 |
, 'default2' => ( isset( $_REQUEST[ 'wh_booking_date2' ] ) ) ? esc_attr( $_REQUEST[ 'wh_booking_date2' ] ) : ''
|
586 |
, 'hint' => array( 'title' => __('Filter bookings by booking dates' ,'booking') , 'position' => 'top' )
|
587 |
, 'label' => ''//__('Booked Dates', 'booking') . ':'
|
588 |
-
, 'title' => __('Dates', 'booking')
|
589 |
, 'options' => array (
|
590 |
__('Current dates' ,'booking') => '0'
|
591 |
, __('Today' ,'booking') => '1'
|
@@ -595,99 +595,99 @@ function wpbc_toolbar_filter__booked_dates(){
|
|
595 |
, __('Today check in/out' ,'booking') => '9'
|
596 |
, __('Check In - Tomorrow' ,'booking') => '7'
|
597 |
, __('Check Out - Tomorrow' ,'booking') => '8'
|
598 |
-
, 'divider2' => 'divider'
|
599 |
-
, 'next' => array(
|
600 |
array(
|
601 |
-
'type' => 'radio'
|
602 |
, 'label' => __('Next' ,'booking')
|
603 |
-
, 'id' => 'wh_booking_datedays_interval1'
|
604 |
-
, 'name' => 'wh_booking_datedays_interval_Radios'
|
605 |
, 'style' => '' // CSS of select element
|
606 |
-
, 'class' => '' // CSS Class of select element
|
607 |
, 'disabled' => false
|
608 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
609 |
-
, 'legend' => '' // aria-label parameter
|
610 |
-
, 'value' => '4' // Some Value from optins array that selected by default
|
611 |
-
, 'selected' => ( isset($_REQUEST[ 'wh_booking_datedays_interval_Radios'] )
|
612 |
&& ( $_REQUEST[ 'wh_booking_datedays_interval_Radios'] == '4' ) ) ? true : false
|
613 |
)
|
614 |
-
, array(
|
615 |
'type' => 'select'
|
616 |
-
, 'attr' => array()
|
617 |
, 'name' => 'wh_booking_datenext'
|
618 |
-
, 'id' => 'wh_booking_datenext'
|
619 |
, 'options' => $dates_interval
|
620 |
, 'value' => isset( $_REQUEST[ 'wh_booking_datenext'] ) ? esc_attr( $_REQUEST[ 'wh_booking_datenext'] ) : ''
|
621 |
-
)
|
622 |
-
)
|
623 |
-
, 'prior' => array(
|
624 |
-
array(
|
625 |
'type' => 'radio'
|
626 |
, 'label' => __('Prior' ,'booking')
|
627 |
-
, 'id' => 'wh_booking_datedays_interval2'
|
628 |
-
, 'name' => 'wh_booking_datedays_interval_Radios'
|
629 |
, 'style' => '' // CSS of select element
|
630 |
-
, 'class' => '' // CSS Class of select element
|
631 |
, 'disabled' => false
|
632 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
633 |
-
, 'legend' => '' // aria-label parameter
|
634 |
-
, 'value' => '5' // Some Value from optins array that selected by default
|
635 |
-
, 'selected' => ( isset($_REQUEST[ 'wh_booking_datedays_interval_Radios'] )
|
636 |
&& ( $_REQUEST[ 'wh_booking_datedays_interval_Radios'] == '5' ) ) ? true : false
|
637 |
)
|
638 |
-
, array(
|
639 |
'type' => 'select'
|
640 |
-
, 'attr' => array()
|
641 |
, 'name' => 'wh_booking_dateprior'
|
642 |
-
, 'id' => 'wh_booking_dateprior'
|
643 |
, 'options' => $dates_interval
|
644 |
, 'value' => isset( $_REQUEST[ 'wh_booking_dateprior'] ) ? esc_attr( $_REQUEST[ 'wh_booking_dateprior'] ) : ''
|
645 |
-
)
|
646 |
-
)
|
647 |
-
, 'fixed' => array( array( 'type' => 'group', 'class' => 'input-group text-group'),
|
648 |
-
array(
|
649 |
'type' => 'radio'
|
650 |
, 'label' => __('Dates' ,'booking')
|
651 |
-
, 'id' => 'wh_booking_datedays_interval3'
|
652 |
-
, 'name' => 'wh_booking_datedays_interval_Radios'
|
653 |
, 'style' => '' // CSS of select element
|
654 |
-
, 'class' => '' // CSS Class of select element
|
655 |
, 'disabled' => false
|
656 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
657 |
-
, 'legend' => '' // aria-label parameter
|
658 |
-
, 'value' => '6' // Some Value from optins array that selected by default
|
659 |
-
, 'selected' => ( isset($_REQUEST[ 'wh_booking_datedays_interval_Radios'] )
|
660 |
&& ( $_REQUEST[ 'wh_booking_datedays_interval_Radios'] == '6' ) ) ? true : false
|
661 |
)
|
662 |
-
, array(
|
663 |
-
'type' => 'text'
|
664 |
-
, 'id' => 'wh_booking_datefixeddates'
|
665 |
-
, 'name' => 'wh_booking_datefixeddates'
|
666 |
, 'label' => __('Check-in' ,'booking') . ':'
|
667 |
, 'disabled' => false
|
668 |
, 'class' => 'wpdevbk-filters-section-calendar' // This class add datepicker
|
669 |
, 'style' => ''
|
670 |
-
, 'placeholder' => date( 'Y-m-d' )
|
671 |
-
, 'attr' => array()
|
672 |
, 'value' => isset( $_REQUEST[ 'wh_booking_datefixeddates'] ) ? esc_attr( $_REQUEST[ 'wh_booking_datefixeddates'] ) : ''
|
673 |
-
)
|
674 |
-
, array(
|
675 |
-
'type' => 'text'
|
676 |
-
, 'id' => 'wh_booking_date2fixeddates'
|
677 |
-
, 'name' => 'wh_booking_date2fixeddates'
|
678 |
, 'label' => __('Check-out' ,'booking') . ':'
|
679 |
, 'disabled' => false
|
680 |
, 'class' => 'wpdevbk-filters-section-calendar' // This class add datepicker
|
681 |
, 'style' => ''
|
682 |
-
, 'placeholder' => date( 'Y-m-d' )
|
683 |
-
, 'attr' => array()
|
684 |
, 'value' => isset( $_REQUEST[ 'wh_booking_date2fixeddates'] ) ? esc_attr( $_REQUEST[ 'wh_booking_date2fixeddates'] ) : ''
|
685 |
-
)
|
686 |
-
)
|
687 |
-
, 'divider3' => 'divider'
|
688 |
-
, 'buttons' => array( array( 'type' => 'group', 'class' => 'btn-group' ),
|
689 |
-
array(
|
690 |
-
'type' => 'button'
|
691 |
, 'title' => __('Apply' ,'booking') // Title of the button
|
692 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
693 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
@@ -705,8 +705,8 @@ function wpbc_toolbar_filter__booked_dates(){
|
|
705 |
, 'attr' => array()
|
706 |
|
707 |
)
|
708 |
-
, array(
|
709 |
-
'type' => 'button'
|
710 |
, 'title' => __('Close' ,'booking') // Title of the button
|
711 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
712 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
@@ -717,13 +717,13 @@ function wpbc_toolbar_filter__booked_dates(){
|
|
717 |
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
|
718 |
, 'style' => '' // Any CSS class here
|
719 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
720 |
-
, 'attr' => array()
|
721 |
)
|
722 |
)
|
723 |
)
|
724 |
-
);
|
725 |
|
726 |
-
wpbc_bs_dropdown_list( $params );
|
727 |
|
728 |
}
|
729 |
|
@@ -742,15 +742,15 @@ function wpbc_toolbar_filter__sort(){
|
|
742 |
$selectors = apply_bk_filter('bk_filter_sort_options', $selectors);
|
743 |
$default_value = get_bk_option( 'booking_sort_order');
|
744 |
|
745 |
-
$params = array( // Pending, Active, Suspended, Terminated, Cancelled, Fraud
|
746 |
'id' => 'or_sort'
|
747 |
, 'options' => $selectors
|
748 |
, 'default' => ( isset( $_REQUEST[ 'or_sort' ] ) ) ? esc_attr( $_REQUEST[ 'or_sort' ] ) : $default_value
|
749 |
, 'label' => ''//__('Status', 'booking') . ':'
|
750 |
-
, 'title' => __('Order by', 'booking')
|
751 |
-
);
|
752 |
|
753 |
-
wpbc_bs_dropdown_list( $params );
|
754 |
}
|
755 |
|
756 |
|
@@ -758,7 +758,7 @@ function wpbc_toolbar_filter__sort(){
|
|
758 |
function wpbc_toolbar_filter__trash(){ //FixIn: 6.1.1.10
|
759 |
|
760 |
|
761 |
-
$params = array(
|
762 |
'id' => 'wh_trash'
|
763 |
, 'options' => array (
|
764 |
__('Exist', 'booking') => '0',
|
@@ -768,18 +768,18 @@ function wpbc_toolbar_filter__trash(){
|
|
768 |
)
|
769 |
, 'default' => ( isset( $_REQUEST[ 'wh_trash' ] ) ) ? esc_attr( $_REQUEST[ 'wh_trash' ] ) : ''
|
770 |
, 'label' => ''//__('Status', 'booking') . ':'
|
771 |
-
, 'title' => __('Bookings', 'booking')
|
772 |
-
);
|
|
|
|
|
773 |
|
774 |
-
wpbc_bs_dropdown_list( $params );
|
775 |
-
|
776 |
}
|
777 |
|
778 |
|
779 |
/** New Bookings - F i l t e r */
|
780 |
function wpbc_toolbar_filter__new_bookings() {
|
781 |
-
|
782 |
-
$params = array(
|
783 |
'id' => 'wh_is_new'
|
784 |
, 'options' => array (
|
785 |
__('All bookings', 'booking') => '',
|
@@ -787,17 +787,17 @@ function wpbc_toolbar_filter__new_bookings() {
|
|
787 |
)
|
788 |
, 'default' => ( isset( $_REQUEST[ 'wh_is_new' ] ) ) ? esc_attr( $_REQUEST[ 'wh_is_new' ] ) : ''
|
789 |
, 'label' => ''//__('Status', 'booking') . ':'
|
790 |
-
, 'title' => __('Show', 'booking')
|
791 |
-
);
|
792 |
|
793 |
-
wpbc_bs_dropdown_list( $params );
|
794 |
}
|
795 |
|
796 |
|
797 |
/** Creation Date - F i l t e r */
|
798 |
function wpbc_toolbar_filter__creation_date(){
|
799 |
-
|
800 |
-
$dates_interval = array(
|
801 |
1 => '1' . ' ' . __('day' ,'booking')
|
802 |
, 2 => '2' . ' ' . __('days' ,'booking')
|
803 |
, 3 => '3' . ' ' . __('days' ,'booking')
|
@@ -812,87 +812,87 @@ function wpbc_toolbar_filter__creation_date(){
|
|
812 |
, 183 => '6' . ' ' . __('months' ,'booking')
|
813 |
, 365 => '1' . ' ' . __('Year' ,'booking')
|
814 |
);
|
815 |
-
|
816 |
-
$params = array(
|
817 |
'id' => 'wh_modification_date'
|
818 |
, 'id2' => 'wh_modification_date2'
|
819 |
, 'default' => ( isset( $_REQUEST[ 'wh_modification_date' ] ) ) ? esc_attr( $_REQUEST[ 'wh_modification_date' ] ) : '3'
|
820 |
, 'default2' => ( isset( $_REQUEST[ 'wh_modification_date2' ] ) ) ? esc_attr( $_REQUEST[ 'wh_modification_date2' ] ) : ''
|
821 |
, 'hint' => array( 'title' => __('Filter bookings by booking dates' ,'booking') , 'position' => 'top' )
|
822 |
, 'label' => ''//__('Booking Creation Date', 'booking') . ':'
|
823 |
-
, 'title' => __('Creation', 'booking')
|
824 |
, 'options' => array (
|
825 |
__('Today' ,'booking') => '1'
|
826 |
, __('All dates' ,'booking') => '3'
|
827 |
, 'divider1' => 'divider'
|
828 |
-
, 'prior' => array(
|
829 |
-
array(
|
830 |
'type' => 'radio'
|
831 |
, 'label' => __('Prior' ,'booking')
|
832 |
-
, 'id' => 'wh_modification_datedays_interval2'
|
833 |
-
, 'name' => 'wh_modification_datedays_interval_Radios'
|
834 |
, 'style' => '' // CSS of select element
|
835 |
-
, 'class' => '' // CSS Class of select element
|
836 |
, 'disabled' => false
|
837 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
838 |
-
, 'legend' => '' // aria-label parameter
|
839 |
-
, 'value' => '5' // Some Value from optins array that selected by default
|
840 |
-
, 'selected' => ( isset($_REQUEST[ 'wh_modification_datedays_interval_Radios'] )
|
841 |
&& ( $_REQUEST[ 'wh_modification_datedays_interval_Radios'] == '5' ) ) ? true : false
|
842 |
)
|
843 |
-
, array(
|
844 |
'type' => 'select'
|
845 |
-
, 'attr' => array()
|
846 |
, 'name' => 'wh_modification_dateprior'
|
847 |
-
, 'id' => 'wh_modification_dateprior'
|
848 |
, 'options' => $dates_interval
|
849 |
, 'value' => isset( $_REQUEST[ 'wh_modification_dateprior'] ) ? esc_attr( $_REQUEST[ 'wh_modification_dateprior'] ) : ''
|
850 |
-
)
|
851 |
-
)
|
852 |
-
, 'fixed' => array( array( 'type' => 'group', 'class' => 'input-group text-group'),
|
853 |
-
array(
|
854 |
'type' => 'radio'
|
855 |
, 'label' => __('Dates' ,'booking')
|
856 |
-
, 'id' => 'wh_modification_datedays_interval3'
|
857 |
-
, 'name' => 'wh_modification_datedays_interval_Radios'
|
858 |
, 'style' => '' // CSS of select element
|
859 |
-
, 'class' => '' // CSS Class of select element
|
860 |
, 'disabled' => false
|
861 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
862 |
-
, 'legend' => '' // aria-label parameter
|
863 |
-
, 'value' => '6' // Some Value from optins array that selected by default
|
864 |
-
, 'selected' => ( isset($_REQUEST[ 'wh_modification_datedays_interval_Radios'] )
|
865 |
&& ( $_REQUEST[ 'wh_modification_datedays_interval_Radios'] == '6' ) ) ? true : false
|
866 |
)
|
867 |
-
, array(
|
868 |
-
'type' => 'text'
|
869 |
-
, 'id' => 'wh_modification_datefixeddates'
|
870 |
-
, 'name' => 'wh_modification_datefixeddates'
|
871 |
, 'label' => __('Check-in' ,'booking') . ':'
|
872 |
, 'disabled' => false
|
873 |
, 'class' => 'wpdevbk-filters-section-calendar' // This class add datepicker
|
874 |
, 'style' => ''
|
875 |
-
, 'placeholder' => date( 'Y-m-d' )
|
876 |
-
, 'attr' => array()
|
877 |
, 'value' => isset( $_REQUEST[ 'wh_modification_datefixeddates'] ) ? esc_attr( $_REQUEST[ 'wh_modification_datefixeddates'] ) : ''
|
878 |
-
)
|
879 |
-
, array(
|
880 |
-
'type' => 'text'
|
881 |
-
, 'id' => 'wh_modification_date2fixeddates'
|
882 |
-
, 'name' => 'wh_modification_date2fixeddates'
|
883 |
, 'label' => __('Check-out' ,'booking') . ':'
|
884 |
, 'disabled' => false
|
885 |
, 'class' => 'wpdevbk-filters-section-calendar' // This class add datepicker
|
886 |
, 'style' => ''
|
887 |
-
, 'placeholder' => date( 'Y-m-d' )
|
888 |
-
, 'attr' => array()
|
889 |
, 'value' => isset( $_REQUEST[ 'wh_modification_date2fixeddates'] ) ? esc_attr( $_REQUEST[ 'wh_modification_date2fixeddates'] ) : ''
|
890 |
-
)
|
891 |
-
)
|
892 |
-
, 'divider3' => 'divider'
|
893 |
-
, 'buttons' => array( array( 'type' => 'group', 'class' => 'btn-group' ),
|
894 |
-
array(
|
895 |
-
'type' => 'button'
|
896 |
, 'title' => __('Apply' ,'booking') // Title of the button
|
897 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
898 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
@@ -910,8 +910,8 @@ function wpbc_toolbar_filter__creation_date(){
|
|
910 |
, 'attr' => array()
|
911 |
|
912 |
)
|
913 |
-
, array(
|
914 |
-
'type' => 'button'
|
915 |
, 'title' => __('Close' ,'booking') // Title of the button
|
916 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
917 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
@@ -922,34 +922,34 @@ function wpbc_toolbar_filter__creation_date(){
|
|
922 |
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
|
923 |
, 'style' => '' // Any CSS class here
|
924 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
925 |
-
, 'attr' => array()
|
926 |
)
|
927 |
)
|
928 |
)
|
929 |
-
);
|
930 |
|
931 |
-
wpbc_bs_dropdown_list( $params );
|
932 |
}
|
933 |
|
934 |
|
935 |
////////////////////////////////////////////////////////////////////////////////
|
936 |
-
// Toolbar Actions B u t t o n s
|
937 |
////////////////////////////////////////////////////////////////////////////////
|
938 |
|
939 |
/** Approve | Reject - B u t t o n s */
|
940 |
function wpbc_toolbar_btn__approve_reject( $user_bk_id ) {
|
941 |
-
|
942 |
-
$params = array(
|
943 |
'label_for' => 'actions' // "For" parameter of button group element
|
944 |
, 'label' => '' //__('Actions:', 'booking') // Label above the button group
|
945 |
, 'style' => '' // CSS Style of entire div element
|
946 |
, 'items' => array(
|
947 |
-
array(
|
948 |
-
'type' => 'button'
|
949 |
, 'title' => __('Approve', 'booking') . ' ' // Title of the button
|
950 |
, 'hint' => array( 'title' => __('Approve selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
951 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
952 |
-
, 'action' => "approve_unapprove_booking( get_selected_bookings_id_in_booking_listing(), 1, " .
|
953 |
$user_bk_id . ", '" . wpbc_get_booking_locale() . "' , 1);" // Some JavaScript to execure, for example run the function
|
954 |
, 'class' => 'button-primary' // button-secondary | button-primary
|
955 |
, 'icon' => ''
|
@@ -959,8 +959,8 @@ function wpbc_toolbar_btn__approve_reject( $user_bk_id ) {
|
|
959 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
960 |
, 'attr' => array()
|
961 |
)
|
962 |
-
, array(
|
963 |
-
'type' => 'button'
|
964 |
, 'title' => __('Pending', 'booking') . ' ' // Title of the button
|
965 |
, 'hint' => array( 'title' => __('Set selected bookings as pending' ,'booking') , 'position' => 'top' ) // Hint
|
966 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
@@ -976,7 +976,7 @@ function wpbc_toolbar_btn__approve_reject( $user_bk_id ) {
|
|
976 |
, 'attr' => array()
|
977 |
)
|
978 |
)
|
979 |
-
);
|
980 |
wpbc_bs_button_group( $params );
|
981 |
}
|
982 |
|
@@ -984,19 +984,19 @@ function wpbc_toolbar_btn__approve_reject( $user_bk_id ) {
|
|
984 |
/** Delete | Reason - B u t t o n s */
|
985 |
function wpbc_toolbar_btn__delete_reason( $user_bk_id ) {
|
986 |
|
987 |
-
$params = array(
|
988 |
'label_for' => 'denyreason' // "For" parameter of label element
|
989 |
, 'label' => '' // Label above the input group
|
990 |
, 'style' => '' // CSS Style of entire div element
|
991 |
, 'items' => array(
|
992 |
-
array( //FixIn: 6.1.1.10
|
993 |
-
'type' => 'button'
|
994 |
, 'title' => __('Trash / Reject', 'booking') . ' ' // Title of the button
|
995 |
, 'hint' => array( 'title' => __('Reject booking - move selected bookings to trash' ,'booking') , 'position' => 'top' ) // Hint
|
996 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
997 |
, 'action' => "if ( wpbc_are_you_sure('" . esc_js( __('Do you really want to do this ?' ,'booking') ) . "') )
|
998 |
-
trash__restore_booking( 1, get_selected_bookings_id_in_booking_listing() , "
|
999 |
-
. $user_bk_id . ", '"
|
1000 |
. wpbc_get_booking_locale() . "' , 1 );" // Some JavaScript to execure, for example run the function
|
1001 |
, 'class' => '' // button-secondary | button-primary
|
1002 |
, 'icon' => ''
|
@@ -1006,14 +1006,14 @@ function wpbc_toolbar_btn__delete_reason( $user_bk_id ) {
|
|
1006 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1007 |
, 'attr' => array()
|
1008 |
)
|
1009 |
-
, array(
|
1010 |
-
'type' => 'button'
|
1011 |
, 'title' => __('Restore', 'booking') . ' ' // Title of the button
|
1012 |
, 'hint' => array( 'title' => __('Restore selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1013 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1014 |
, 'action' => "if ( wpbc_are_you_sure('" . esc_js( __('Do you really want to do this ?' ,'booking') ) . "') )
|
1015 |
-
trash__restore_booking( 0, get_selected_bookings_id_in_booking_listing() , "
|
1016 |
-
. $user_bk_id . ", '"
|
1017 |
. wpbc_get_booking_locale() . "' , 1 );" // Some JavaScript to execure, for example run the function
|
1018 |
, 'class' => '' // button-secondary | button-primary
|
1019 |
, 'icon' => ''
|
@@ -1023,14 +1023,14 @@ function wpbc_toolbar_btn__delete_reason( $user_bk_id ) {
|
|
1023 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1024 |
, 'attr' => array()
|
1025 |
)
|
1026 |
-
, array(
|
1027 |
-
'type' => 'button'
|
1028 |
, 'title' => __('Delete', 'booking') . ' ' // Title of the button
|
1029 |
, 'hint' => array( 'title' => __('Delete selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1030 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1031 |
, 'action' => "if ( wpbc_are_you_sure('" . esc_js( __('Do you really want to delete selected booking(s) ?' ,'booking') ) . "') )
|
1032 |
-
delete_booking( get_selected_bookings_id_in_booking_listing() , "
|
1033 |
-
. $user_bk_id . ", '"
|
1034 |
. wpbc_get_booking_locale() . "' , 1 );" // Some JavaScript to execure, for example run the function
|
1035 |
, 'class' => '' // button-secondary | button-primary
|
1036 |
, 'icon' => ''
|
@@ -1040,20 +1040,20 @@ function wpbc_toolbar_btn__delete_reason( $user_bk_id ) {
|
|
1040 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1041 |
, 'attr' => array()
|
1042 |
)
|
1043 |
-
, array(
|
1044 |
'type' => 'text'
|
1045 |
-
, 'id' => 'denyreason' // HTML ID of element
|
1046 |
, 'value' => '' // Value of Text field
|
1047 |
, 'placeholder' => __('Reason of cancellation', 'booking')
|
1048 |
, 'style' => '' // CSS of select element
|
1049 |
, 'class' => '' // CSS Class of select element
|
1050 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1051 |
-
)
|
1052 |
)
|
1053 |
-
);
|
1054 |
-
?><div class="control-group wpbc-no-padding wpbc-sm-100" ><?php
|
1055 |
-
wpbc_bs_input_group( $params );
|
1056 |
-
?></div><?php
|
1057 |
}
|
1058 |
|
1059 |
|
@@ -1095,14 +1095,14 @@ function wpbc_toolbar_btn__empty_trash( $user_bk_id ) {
|
|
1095 |
|
1096 |
/** Read All - B u t t o n s */
|
1097 |
function wpbc_toolbar_btn__read_all( $user_bk_id ) {
|
1098 |
-
|
1099 |
-
$params = array(
|
1100 |
'label_for' => 'actions' // "For" parameter of button group element
|
1101 |
, 'label' => '' //__('Actions:', 'booking') // Label above the button group
|
1102 |
, 'style' => '' // CSS Style of entire div element
|
1103 |
, 'items' => array(
|
1104 |
-
array(
|
1105 |
-
'type' => 'button'
|
1106 |
, 'title' => __('Read All', 'booking') . ' ' // Title of the button
|
1107 |
, 'hint' => array( 'title' => __('Mark as read all bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1108 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
@@ -1115,12 +1115,12 @@ function wpbc_toolbar_btn__read_all( $user_bk_id ) {
|
|
1115 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1116 |
, 'attr' => array()
|
1117 |
)
|
1118 |
-
, array(
|
1119 |
-
'type' => 'button'
|
1120 |
, 'title' => __('Read', 'booking') . ' ' // Title of the button
|
1121 |
, 'hint' => array( 'title' => __('Mark as read selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1122 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1123 |
-
, 'action' => "mark_read_booking( get_selected_bookings_id_in_booking_listing(), 0, "
|
1124 |
. $user_bk_id . ", '" . wpbc_get_booking_locale() . "' );" // Some JavaScript to execure, for example run the function
|
1125 |
, 'class' => '' // button-secondary | button-primary
|
1126 |
, 'icon' => ''
|
@@ -1130,12 +1130,12 @@ function wpbc_toolbar_btn__read_all( $user_bk_id ) {
|
|
1130 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1131 |
, 'attr' => array()
|
1132 |
)
|
1133 |
-
, array(
|
1134 |
-
'type' => 'button'
|
1135 |
, 'title' => __('Unread', 'booking') . ' ' // Title of the button
|
1136 |
, 'hint' => array( 'title' => __('Mark as Unread selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1137 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1138 |
-
, 'action' => "mark_read_booking( get_selected_bookings_id_in_booking_listing() , 1, "
|
1139 |
. $user_bk_id . ", '" . wpbc_get_booking_locale() . "' );" // Some JavaScript to execure, for example run the function
|
1140 |
, 'class' => '' // button-secondary | button-primary
|
1141 |
, 'icon' => ''
|
@@ -1146,8 +1146,8 @@ function wpbc_toolbar_btn__read_all( $user_bk_id ) {
|
|
1146 |
, 'attr' => array()
|
1147 |
)
|
1148 |
)
|
1149 |
-
);
|
1150 |
-
wpbc_bs_button_group( $params );
|
1151 |
}
|
1152 |
|
1153 |
|
@@ -1158,28 +1158,28 @@ function wpbc_toolbar_btn__read_all( $user_bk_id ) {
|
|
1158 |
|
1159 |
/** View Mode Timeline - B u t t o n s */
|
1160 |
function wpbc_toolbar_btn__timeline_view_mode() {
|
1161 |
-
|
1162 |
if ((isset($_REQUEST['wh_booking_type'])) && ( strpos($_REQUEST['wh_booking_type'], ',') !== false ) )
|
1163 |
-
$is_show_resources_matrix = true;
|
1164 |
else $is_show_resources_matrix = false;
|
1165 |
|
1166 |
-
|
1167 |
-
if ( isset( $_REQUEST['view_days_num'] ) )
|
1168 |
$view_days_num = intval( $_REQUEST['view_days_num'] );
|
1169 |
else $view_days_num = get_bk_option( 'booking_view_days_num');
|
1170 |
|
1171 |
-
|
1172 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false ), array('view_days_num') );
|
1173 |
-
|
1174 |
-
|
1175 |
-
if ( ! $is_show_resources_matrix ) {
|
1176 |
-
|
1177 |
-
$params = array(
|
1178 |
'label_for' => 'calendar_overview_number_of_days_to_show' // "For" parameter of button group element
|
1179 |
, 'label' => '' //__('Calendar view mode', 'booking') // Label above the button group
|
1180 |
, 'style' => '' // CSS Style of entire div element
|
1181 |
, 'items' => array(
|
1182 |
-
array(
|
1183 |
'type' => 'button'
|
1184 |
, 'title' => __('Day', 'booking') . ' ' // Title of the button //FixIn: Flex TimeLine 1.0
|
1185 |
, 'hint' => array( 'title' => __('Show day' ,'booking') , 'position' => 'top' ) // Hint
|
@@ -1196,7 +1196,7 @@ function wpbc_toolbar_btn__timeline_view_mode() {
|
|
1196 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1197 |
, 'attr' => array()
|
1198 |
)
|
1199 |
-
, array(
|
1200 |
'type' => 'button'
|
1201 |
, 'title' => __('Week', 'booking') . ' ' // Title of the button //FixIn: Flex TimeLine 1.0
|
1202 |
, 'hint' => array( 'title' => __('Show week' ,'booking') , 'position' => 'top' ) // Hint
|
@@ -1213,7 +1213,7 @@ function wpbc_toolbar_btn__timeline_view_mode() {
|
|
1213 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1214 |
, 'attr' => array()
|
1215 |
)
|
1216 |
-
, array(
|
1217 |
'type' => 'button'
|
1218 |
, 'title' => __('Month', 'booking') . ' ' // Title of the button
|
1219 |
, 'hint' => array( 'title' => __('Show month' ,'booking') , 'position' => 'top' ) // Hint
|
@@ -1231,16 +1231,16 @@ function wpbc_toolbar_btn__timeline_view_mode() {
|
|
1231 |
, 'attr' => array()
|
1232 |
)
|
1233 |
)
|
1234 |
-
);
|
1235 |
} else {
|
1236 |
|
1237 |
-
$params = array(
|
1238 |
'label_for' => 'calendar_overview_number_of_days_to_show' // "For" parameter of button group element
|
1239 |
, 'label' => '' //__('Calendar view mode:', 'booking') // Label above the button group
|
1240 |
, 'style' => '' // CSS Style of entire div element
|
1241 |
, 'items' => array(
|
1242 |
-
array(
|
1243 |
-
'type' => 'button'
|
1244 |
, 'title' => __('Day', 'booking') . ' ' // Title of the button
|
1245 |
, 'hint' => array( 'title' => __('Show day' ,'booking') , 'position' => 'top' ) // Hint
|
1246 |
, 'link' => $bk_admin_url . '&view_days_num=1' // Direct link or skip it
|
@@ -1253,8 +1253,8 @@ function wpbc_toolbar_btn__timeline_view_mode() {
|
|
1253 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1254 |
, 'attr' => array()
|
1255 |
)
|
1256 |
-
, array(
|
1257 |
-
'type' => 'button'
|
1258 |
, 'title' => __('Week', 'booking') . ' ' // Title of the button
|
1259 |
, 'hint' => array( 'title' => __('Show week' ,'booking') , 'position' => 'top' ) // Hint
|
1260 |
, 'link' => $bk_admin_url . '&view_days_num=7' // Direct link or skip it
|
@@ -1267,8 +1267,8 @@ function wpbc_toolbar_btn__timeline_view_mode() {
|
|
1267 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1268 |
, 'attr' => array()
|
1269 |
)
|
1270 |
-
, array(
|
1271 |
-
'type' => 'button'
|
1272 |
, 'title' => __('Month', 'booking') . ' ' // Title of the button
|
1273 |
, 'hint' => array( 'title' => __('Show month' ,'booking') , 'position' => 'top' ) // Hint
|
1274 |
, 'link' => $bk_admin_url . '&view_days_num=30' // Direct link or skip it
|
@@ -1281,8 +1281,8 @@ function wpbc_toolbar_btn__timeline_view_mode() {
|
|
1281 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1282 |
, 'attr' => array()
|
1283 |
)
|
1284 |
-
, array(
|
1285 |
-
'type' => 'button'
|
1286 |
, 'title' => __('2 Months', 'booking') . ' ' // Title of the button
|
1287 |
, 'hint' => array( 'title' => __('Show 2 months' ,'booking') , 'position' => 'top' ) // Hint
|
1288 |
, 'link' => $bk_admin_url . '&view_days_num=60' // Direct link or skip it
|
@@ -1296,8 +1296,8 @@ function wpbc_toolbar_btn__timeline_view_mode() {
|
|
1296 |
, 'attr' => array()
|
1297 |
)
|
1298 |
)
|
1299 |
-
);
|
1300 |
-
|
1301 |
}
|
1302 |
wpbc_bs_button_group( $params );
|
1303 |
|
@@ -1309,29 +1309,29 @@ function wpbc_toolbar_btn__timeline_view_mode() {
|
|
1309 |
} else {
|
1310 |
console.log('Warning! Booking Calendar. Its seems that you have deactivated loading of Bootstrap JS files at Booking Settings General page in Advanced section.')
|
1311 |
}
|
1312 |
-
</script><?php
|
1313 |
}
|
1314 |
|
1315 |
|
1316 |
/** Navigation Timeline - B u t t o n s */
|
1317 |
function wpbc_toolbar_btn__timeline_navigation() {
|
1318 |
-
|
1319 |
if ((isset($_REQUEST['wh_booking_type'])) && ( strpos($_REQUEST['wh_booking_type'], ',') !== false ) )
|
1320 |
-
$is_show_resources_matrix = true;
|
1321 |
else $is_show_resources_matrix = false;
|
1322 |
|
1323 |
-
|
1324 |
-
if ( isset( $_REQUEST['view_days_num'] ) )
|
1325 |
$view_days_num = intval( $_REQUEST['view_days_num'] );
|
1326 |
else $view_days_num = get_bk_option( 'booking_view_days_num');
|
1327 |
|
1328 |
-
|
1329 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false ), array('scroll_month', 'scroll_day') );
|
1330 |
-
//debuge($_REQUEST, $bk_admin_url);
|
1331 |
-
|
1332 |
// Get Data For buttons
|
1333 |
-
if (! $is_show_resources_matrix) {
|
1334 |
-
|
1335 |
switch ($view_days_num) {
|
1336 |
case '90':
|
1337 |
if (isset($_REQUEST['scroll_day'])) $scroll_day = intval( $_REQUEST['scroll_day'] );
|
@@ -1410,7 +1410,7 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1410 |
break;
|
1411 |
|
1412 |
case '30':
|
1413 |
-
case '60':
|
1414 |
case '90': //3 months
|
1415 |
if (! isset($_REQUEST['scroll_month'])) $_REQUEST['scroll_month'] = 0;
|
1416 |
$scroll_month = intval( $_REQUEST['scroll_month'] );
|
@@ -1440,17 +1440,17 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1440 |
__('Next month' ,'booking'),
|
1441 |
__('Next 3 months' ,'booking') );
|
1442 |
break;
|
1443 |
-
}
|
1444 |
}
|
1445 |
|
1446 |
-
|
1447 |
-
$params = array(
|
1448 |
'label_for' => 'calendar_overview_navigation' // "For" parameter of button group element
|
1449 |
, 'label' => '' //__('Calendar Navigation', 'booking') // Label above the button group
|
1450 |
, 'style' => '' // CSS Style of entire div element
|
1451 |
, 'items' => array(
|
1452 |
-
array(
|
1453 |
-
'type' => 'button'
|
1454 |
, 'title' => '' // Title of the button
|
1455 |
, 'hint' => array( 'title' => $scroll_titles[0] , 'position' => 'top' ) // Hint
|
1456 |
, 'link' => $bk_admin_url .$scroll_params[0] // Direct link or skip it
|
@@ -1463,8 +1463,8 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1463 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1464 |
, 'attr' => array()
|
1465 |
)
|
1466 |
-
, array(
|
1467 |
-
'type' => 'button'
|
1468 |
, 'title' => '' // Title of the button
|
1469 |
, 'hint' => array( 'title' => $scroll_titles[1] , 'position' => 'top' ) // Hint
|
1470 |
, 'link' => $bk_admin_url .$scroll_params[1] // Direct link or skip it
|
@@ -1477,8 +1477,8 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1477 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1478 |
, 'attr' => array()
|
1479 |
)
|
1480 |
-
, array(
|
1481 |
-
'type' => 'dropdown'
|
1482 |
, 'id' => 'timeline_navigation_date'
|
1483 |
, 'title' => '' // Title of the button
|
1484 |
, 'hint' => array( 'title' => __('Custom' ,'booking') , 'position' => 'top' ) // Hint
|
@@ -1490,38 +1490,38 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1490 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1491 |
, 'attr' => array()
|
1492 |
, 'options' => array(
|
1493 |
-
$scroll_titles[2] => "window.location.href='"
|
1494 |
. wpbc_get_params_in_url( wpbc_get_bookings_url( false )
|
1495 |
-
, array('scroll_month', 'scroll_day', 'scroll_start_date') )
|
1496 |
-
. $scroll_params[2] . "'"
|
1497 |
, 'divider1' => 'divider'
|
1498 |
-
, 'custom' => array( array( 'type' => 'group', 'class' => 'input-group text-group')
|
1499 |
-
, array(
|
1500 |
-
'type' => 'text'
|
1501 |
-
, 'id' => 'calendar_overview_navigation_currentdate'
|
1502 |
-
, 'name' => 'calendar_overview_navigation_currentdate'
|
1503 |
, 'label' => __('Start Date' ,'booking') . ':'
|
1504 |
, 'disabled' => false
|
1505 |
, 'class' => 'wpdevbk-filters-section-calendar'
|
1506 |
, 'style' => ''
|
1507 |
, 'placeholder' => date('Y-m-d')
|
1508 |
-
, 'attr' => array()
|
1509 |
, 'value' => ''
|
1510 |
)
|
1511 |
)
|
1512 |
-
, 'divider2' => 'divider'
|
1513 |
-
, 'buttons' => array( array( 'type' => 'group', 'class' => 'btn-group' ),
|
1514 |
-
array(
|
1515 |
-
'type' => 'button'
|
1516 |
, 'title' => __('Apply' ,'booking') // Title of the button
|
1517 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
1518 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1519 |
, 'action' => "jQuery('#calendar_overview_navigation_container').hide();
|
1520 |
-
window.location.href='"
|
1521 |
. wpbc_get_params_in_url( wpbc_get_bookings_url( false )
|
1522 |
-
, array('scroll_month', 'scroll_day', 'scroll_start_date') )
|
1523 |
. "&scroll_start_date=' + jQuery('#calendar_overview_navigation_currentdate').val();"
|
1524 |
-
|
1525 |
, 'class' => 'button-primary' // button-secondary | button-primary
|
1526 |
, 'icon' => ''
|
1527 |
, 'font_icon' => ''
|
@@ -1531,8 +1531,8 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1531 |
, 'attr' => array()
|
1532 |
|
1533 |
)
|
1534 |
-
, array(
|
1535 |
-
'type' => 'button'
|
1536 |
, 'title' => __('Close' ,'booking') // Title of the button
|
1537 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
1538 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
@@ -1543,13 +1543,13 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1543 |
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
|
1544 |
, 'style' => '' // Any CSS class here
|
1545 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1546 |
-
, 'attr' => array()
|
1547 |
)
|
1548 |
-
)
|
1549 |
-
)
|
1550 |
-
)
|
1551 |
-
, array(
|
1552 |
-
'type' => 'button'
|
1553 |
, 'title' => '' // Title of the button
|
1554 |
, 'hint' => array( 'title' => $scroll_titles[3] , 'position' => 'top' ) // Hint
|
1555 |
, 'link' => $bk_admin_url .$scroll_params[3] // Direct link or skip it
|
@@ -1562,8 +1562,8 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1562 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1563 |
, 'attr' => array()
|
1564 |
)
|
1565 |
-
, array(
|
1566 |
-
'type' => 'button'
|
1567 |
, 'title' => '' // Title of the button
|
1568 |
, 'hint' => array( 'title' => $scroll_titles[4] , 'position' => 'top' ) // Hint
|
1569 |
, 'link' => $bk_admin_url .$scroll_params[4] // Direct link or skip it
|
@@ -1577,9 +1577,9 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1577 |
, 'attr' => array()
|
1578 |
)
|
1579 |
)
|
1580 |
-
);
|
1581 |
|
1582 |
-
wpbc_bs_button_group( $params );
|
1583 |
}
|
1584 |
|
1585 |
|
@@ -1590,31 +1590,31 @@ function wpbc_toolbar_btn__timeline_navigation() {
|
|
1590 |
|
1591 |
/** Genereate URL based on GET parameters */
|
1592 |
function wpbc_get_new_booking_url__base( $skip_parameters = array() ) {
|
1593 |
-
|
1594 |
$link_base = wpbc_get_new_booking_url( true, false );
|
1595 |
-
|
1596 |
$link_params = array();
|
1597 |
-
if ( ( isset( $_GET['booking_type'] ) ) && ( $_GET['booking_type'] > 0 ) ) $link_params['booking_type'] = $_GET['booking_type'];
|
1598 |
-
if ( isset( $_GET['booking_hash'] ) ) $link_params['booking_hash'] = $_GET['booking_hash'];
|
1599 |
-
if ( isset( $_GET['parent_res'] ) ) $link_params['parent_res'] = $_GET['parent_res'];
|
1600 |
if ( isset( $_GET['booking_form'] ) ) $link_params['booking_form'] = $_GET['booking_form'];
|
1601 |
if ( isset( $_GET['calendar_months_count'] ) ) $link_params['calendar_months_count'] = intval( $_GET['calendar_months_count'] );
|
1602 |
if ( isset( $_GET['calendar_months_num_in_1_row'] ) ) $link_params['calendar_months_num_in_1_row'] = intval( $_GET['calendar_months_num_in_1_row'] );
|
1603 |
|
1604 |
-
|
1605 |
foreach ( $link_params as $key => $value ) {
|
1606 |
|
1607 |
if ( ! in_array( $key, $skip_parameters) ) {
|
1608 |
$link_base .= '&' . $key . '=' . $value;
|
1609 |
}
|
1610 |
}
|
1611 |
-
|
1612 |
return $link_base;
|
1613 |
}
|
1614 |
|
1615 |
/** Selection Number of visible months */
|
1616 |
function wpbc_toolbar_btn__calendar_months_number_selection( $user_calendar_options = array() ) {
|
1617 |
-
|
1618 |
$text_label = __('Visible months' ,'booking') .':' ;
|
1619 |
|
1620 |
$form_options = array( 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12 );
|
@@ -1624,38 +1624,38 @@ function wpbc_toolbar_btn__calendar_months_number_selection( $user_calendar_opti
|
|
1624 |
if ( isset( $user_calendar_options[$parameter_name] ) ) $selected_value = intval ( $user_calendar_options[ $parameter_name ] );
|
1625 |
else $selected_value = 1;
|
1626 |
|
1627 |
-
$link_base = wpbc_get_new_booking_url__base( array( $parameter_name ) ) . '&' . $parameter_name . '=' ;
|
1628 |
|
1629 |
$on_change = ''; //'location.href=\'' . $link_base . '\' + this.value;';
|
1630 |
|
1631 |
|
1632 |
-
$params = array(
|
1633 |
'label_for' => $parameter_name // "For" parameter of label element
|
1634 |
, 'label' => '' // Label above the input group
|
1635 |
, 'style' => '' // CSS Style of entire div element
|
1636 |
, 'items' => array(
|
1637 |
-
array(
|
1638 |
-
'type' => 'addon'
|
1639 |
, 'element' => 'text' // text | radio | checkbox
|
1640 |
, 'text' => $text_label
|
1641 |
, 'class' => '' // Any CSS class here
|
1642 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
1643 |
-
)
|
1644 |
-
, array(
|
1645 |
-
'type' => 'select'
|
1646 |
, 'id' => $parameter_name // HTML ID of element
|
1647 |
-
, 'options' => $form_options // Associated array of titles and values
|
1648 |
-
, 'value' => $selected_value // Some Value from optins array that selected by default
|
1649 |
, 'style' => '' // CSS of select element
|
1650 |
, 'class' => '' // CSS Class of select element
|
1651 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1652 |
-
, 'onchange' => $on_change
|
1653 |
)
|
1654 |
)
|
1655 |
-
);
|
1656 |
-
?><div class="control-group wpbc-no-padding" style="width:auto;"><?php
|
1657 |
-
wpbc_bs_input_group( $params );
|
1658 |
-
?></div><?php
|
1659 |
}
|
1660 |
|
1661 |
|
@@ -1664,151 +1664,151 @@ function wpbc_toolbar_btn__calendar_months_num_in_1_row_selection( $user_calenda
|
|
1664 |
|
1665 |
$text_label = __('Number of months in one row' ,'booking') . ':';
|
1666 |
$form_options = array( 0 => __('All', 'booking'), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12 );
|
1667 |
-
|
1668 |
$parameter_name = 'calendar_months_num_in_1_row';
|
1669 |
|
1670 |
if ( isset( $user_calendar_options[$parameter_name] ) ) $selected_value = intval ( $user_calendar_options[ $parameter_name ] );
|
1671 |
else $selected_value = 0;
|
1672 |
-
|
1673 |
-
$link_base = wpbc_get_new_booking_url__base( array( $parameter_name ) ) . '&' . $parameter_name . '=' ;
|
1674 |
|
1675 |
$on_change = ''; // 'location.href=\'' . $link_base . '\' + this.value;';
|
1676 |
|
1677 |
|
1678 |
-
$params = array(
|
1679 |
'label_for' => $parameter_name // "For" parameter of label element
|
1680 |
, 'label' => '' // Label above the input group
|
1681 |
, 'style' => '' // CSS Style of entire div element
|
1682 |
, 'items' => array(
|
1683 |
-
array(
|
1684 |
-
'type' => 'addon'
|
1685 |
, 'element' => 'text' // text | radio | checkbox
|
1686 |
, 'text' => $text_label
|
1687 |
, 'class' => '' // Any CSS class here
|
1688 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
1689 |
-
)
|
1690 |
-
, array(
|
1691 |
-
'type' => 'select'
|
1692 |
, 'id' => $parameter_name // HTML ID of element
|
1693 |
-
, 'options' => $form_options // Associated array of titles and values
|
1694 |
-
, 'value' => $selected_value // Some Value from optins array that selected by default
|
1695 |
, 'style' => '' // CSS of select element
|
1696 |
, 'class' => '' // CSS Class of select element
|
1697 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1698 |
-
, 'onchange' => $on_change
|
1699 |
)
|
1700 |
)
|
1701 |
-
);
|
1702 |
-
?><div class="control-group wpbc-no-padding"><?php
|
1703 |
-
wpbc_bs_input_group( $params );
|
1704 |
-
?></div><?php
|
1705 |
}
|
1706 |
|
1707 |
|
1708 |
function wpbc_toolbar_btn__calendar_width( $user_calendar_options = array() ){
|
1709 |
-
|
1710 |
$text_label = __('Calendar width' ,'booking') . ':';
|
1711 |
$parameter_name = 'calendar_width';
|
1712 |
-
|
1713 |
if ( isset( $user_calendar_options[$parameter_name] ) ) $selected_value = intval( $user_calendar_options[ $parameter_name ] );
|
1714 |
else $selected_value = '';
|
1715 |
-
|
1716 |
if ( isset( $user_calendar_options[$parameter_name . 'units'] ) ) $selected_value_units = esc_attr( $user_calendar_options[ $parameter_name . 'units' ] );
|
1717 |
else $selected_value_units = '';
|
1718 |
-
|
1719 |
-
$params = array(
|
1720 |
'label_for' => $parameter_name // "For" parameter of label element
|
1721 |
, 'label' => '' // Label above the input group
|
1722 |
, 'style' => '' // CSS Style of entire div element
|
1723 |
, 'items' => array(
|
1724 |
-
array(
|
1725 |
-
'type' => 'addon'
|
1726 |
, 'element' => 'text' // text | radio | checkbox
|
1727 |
, 'text' => $text_label
|
1728 |
, 'class' => '' // Any CSS class here
|
1729 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
1730 |
-
)
|
1731 |
-
, array(
|
1732 |
-
'type' => 'text'
|
1733 |
, 'id' => $parameter_name // HTML ID of element
|
1734 |
-
, 'value' => $selected_value // Some Value from optins array that selected by default
|
1735 |
, 'style' => 'width: 5em;' // CSS of select element
|
1736 |
, 'placeholder' => '100%'
|
1737 |
, 'class' => '' // CSS Class of select element
|
1738 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1739 |
)
|
1740 |
-
, array(
|
1741 |
-
'type' => 'select'
|
1742 |
, 'id' => $parameter_name . 'units' // HTML ID of element
|
1743 |
-
, 'options' => array( 'px' => 'px', 'percent' => '%' ) // Associated array of titles and values
|
1744 |
-
, 'value' => $selected_value_units // Some Value from optins array that selected by default
|
1745 |
, 'style' => 'width: 5em;' // CSS of select element
|
1746 |
, 'class' => '' // CSS Class of select element
|
1747 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1748 |
-
)
|
1749 |
)
|
1750 |
-
);
|
1751 |
-
?><div class="control-group wpbc-no-padding"><?php
|
1752 |
-
wpbc_bs_input_group( $params );
|
1753 |
-
?></div><?php
|
1754 |
}
|
1755 |
-
|
1756 |
function wpbc_toolbar_btn__calendar_cell_height( $user_calendar_options = array() ){
|
1757 |
-
|
1758 |
$text_label = __('Calendar cell height' ,'booking') . ':';
|
1759 |
$parameter_name = 'calendar_cell_height';
|
1760 |
-
|
1761 |
if ( isset( $user_calendar_options[$parameter_name] ) ) $selected_value = intval( $user_calendar_options[ $parameter_name ] );
|
1762 |
else $selected_value = '';
|
1763 |
|
1764 |
if ( isset( $user_calendar_options[$parameter_name . 'units'] ) ) $selected_value_units = esc_attr( $user_calendar_options[ $parameter_name . 'units' ] );
|
1765 |
else $selected_value_units = '';
|
1766 |
-
|
1767 |
-
$params = array(
|
1768 |
'label_for' => $parameter_name // "For" parameter of label element
|
1769 |
, 'label' => '' // Label above the input group
|
1770 |
, 'style' => '' // CSS Style of entire div element
|
1771 |
, 'items' => array(
|
1772 |
-
array(
|
1773 |
-
'type' => 'addon'
|
1774 |
, 'element' => 'text' // text | radio | checkbox
|
1775 |
, 'text' => $text_label
|
1776 |
, 'class' => '' // Any CSS class here
|
1777 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
1778 |
-
)
|
1779 |
-
, array(
|
1780 |
-
'type' => 'text'
|
1781 |
, 'id' => $parameter_name // HTML ID of element
|
1782 |
-
, 'value' => $selected_value // Some Value from optins array that selected by default
|
1783 |
, 'style' => 'width: 5em;' // CSS of select element
|
1784 |
, 'placeholder' => '39px'
|
1785 |
, 'class' => '' // CSS Class of select element
|
1786 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1787 |
)
|
1788 |
-
, array(
|
1789 |
-
'type' => 'select'
|
1790 |
, 'id' => $parameter_name . 'units' // HTML ID of element
|
1791 |
-
, 'options' => array( 'px' => 'px', 'percent' => '%' ) // Associated array of titles and values
|
1792 |
-
, 'value' => $selected_value_units // Some Value from optins array that selected by default
|
1793 |
, 'style' => 'width: 5em;' // CSS of select element
|
1794 |
, 'class' => '' // CSS Class of select element
|
1795 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1796 |
-
)
|
1797 |
-
|
1798 |
)
|
1799 |
-
);
|
1800 |
-
?><div class="control-group wpbc-no-padding"><?php
|
1801 |
-
wpbc_bs_input_group( $params );
|
1802 |
-
?></div><?php
|
1803 |
}
|
1804 |
|
1805 |
|
1806 |
/** Add New Booking Button*/
|
1807 |
function wpbc_toolbar_btn__calendar_options_save() {
|
1808 |
-
|
1809 |
-
?><div class="control-group wpbc-no-padding"><?php
|
1810 |
-
?><a
|
1811 |
-
class="button button-primary "
|
1812 |
href="javascript:void(0)"
|
1813 |
onclick="javascript:var data_params = {};
|
1814 |
data_params.calendar_months_count = jQuery('#calendar_months_count').val();
|
@@ -1821,10 +1821,10 @@ function wpbc_toolbar_btn__calendar_options_save() {
|
|
1821 |
wpbc_save_custom_user_data(<?php echo get_wpbc_current_user_id(); ?>
|
1822 |
, '<?php echo 'add_booking_calendar_options'; ?>'
|
1823 |
, ajax_data_params
|
1824 |
-
, 1
|
1825 |
-
);"
|
1826 |
-
><?php _e('Save Changes' , 'booking') ?></a><?php
|
1827 |
-
?></div><?php
|
1828 |
}
|
1829 |
|
1830 |
|
@@ -1835,22 +1835,22 @@ function wpbc_toolbar_btn__add_new_booking() {
|
|
1835 |
if ( isset( $_GET['booking_type'] ) )
|
1836 |
$bk_type = intval ( $_GET['booking_type'] );
|
1837 |
else $bk_type = 1;
|
1838 |
-
|
1839 |
-
?><a
|
1840 |
-
class="button button-primary wpbc_submit_button"
|
1841 |
href="javascript:void(0)"
|
1842 |
-
onclick="mybooking_submit(
|
1843 |
document.getElementById('booking_form<?php echo $bk_type; ?>' )
|
1844 |
, <?php echo $bk_type; ?>
|
1845 |
-
, '<?php echo wpbc_get_booking_locale(); ?>'
|
1846 |
-
);"
|
1847 |
-
><?php _e('Add booking' , 'booking') ?></a><?php
|
1848 |
}
|
1849 |
|
1850 |
|
1851 |
/** Checkbox - sending emails or not - duplicated button, usually at the bottom of page*/
|
1852 |
function wpbc_toolbar_is_send_emails_btn_duplicated() {
|
1853 |
-
|
1854 |
?>
|
1855 |
<div class="btn-group" style="color:#888;">
|
1856 |
<fieldset>
|
@@ -1860,9 +1860,9 @@ function wpbc_toolbar_is_send_emails_btn_duplicated() {
|
|
1860 |
<?php if ( get_bk_option('booking_send_emails_off_addbooking') === 'On' ) { } else { //FixIn: 8.4.5.4 ?>
|
1861 |
checked="CHECKED"
|
1862 |
<?php } ?>
|
1863 |
-
id="is_send_email_for_new_booking"
|
1864 |
-
name="is_send_email_for_new_booking"
|
1865 |
-
class="tooltip_top"
|
1866 |
style="margin:0 4px 2px;"
|
1867 |
title="<?php echo esc_js( __( 'Send email notification to customer about this operation', 'booking' ) ); ?>"
|
1868 |
/><?php _e( 'Send email notification to customer about this operation', 'booking' ) ?>
|
@@ -1879,33 +1879,34 @@ function wpbc_toolbar_is_send_emails_btn_duplicated() {
|
|
1879 |
<?php } ?>
|
1880 |
});
|
1881 |
|
1882 |
-
jQuery( '#is_send_email_for_pending' ).change(function() {
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
|
|
1889 |
</script>
|
1890 |
-
<?php
|
1891 |
}
|
1892 |
|
1893 |
|
1894 |
/**
|
1895 |
* Show Link (button) for adding booking to Google Calendar
|
1896 |
-
*
|
1897 |
* @param int $booking_id
|
1898 |
* @param array $button_attr
|
1899 |
* @param bool $echo
|
1900 |
* @return string
|
1901 |
*/
|
1902 |
function wpbc_btn_add_booking_to_google_calendar( $booking_data, $button_attr = array(), $echo = true ) { //FixIn: 7.1.2.5
|
1903 |
-
|
1904 |
-
//debuge($booking_data);
|
1905 |
if ( ! $echo ) {
|
1906 |
ob_start();
|
1907 |
}
|
1908 |
-
|
1909 |
$defaults = array(
|
1910 |
'title' => __( 'Add to Google Calendar', 'booking' )
|
1911 |
, 'hint' => __( 'Add to Google Calendar', 'booking' )
|
@@ -1914,13 +1915,13 @@ function wpbc_btn_add_booking_to_google_calendar( $booking_data, $button_attr =
|
|
1914 |
, 'is_only_url' => false
|
1915 |
);
|
1916 |
$button_attr = wp_parse_args( $button_attr, $defaults );
|
1917 |
-
|
1918 |
$params = array();
|
1919 |
$params['timezone'] = get_bk_option('booking_gcal_timezone');
|
1920 |
|
1921 |
-
$booking_gcal_events_form_fields = get_bk_option( 'booking_gcal_events_form_fields');
|
1922 |
-
if ( is_serialized( $booking_gcal_events_form_fields ) )
|
1923 |
-
$booking_gcal_events_form_fields = unserialize( $booking_gcal_events_form_fields );
|
1924 |
|
1925 |
/**
|
1926 |
* Array
|
@@ -1930,8 +1931,8 @@ function wpbc_btn_add_booking_to_google_calendar( $booking_data, $button_attr =
|
|
1930 |
[where] => text^
|
1931 |
)
|
1932 |
*/
|
1933 |
-
|
1934 |
-
|
1935 |
// Fields
|
1936 |
$fields = array( 'title' => '', 'description' => '', 'where' => '' );
|
1937 |
|
@@ -1944,7 +1945,7 @@ function wpbc_btn_add_booking_to_google_calendar( $booking_data, $button_attr =
|
|
1944 |
$field_name = $field_name[ ( count( $field_name ) - 1 ) ]; //FixIn: 8.7.7.6
|
1945 |
|
1946 |
if ( (! empty($field_name))
|
1947 |
-
&& (! empty($booking_data['form_data']))
|
1948 |
&& (! empty($booking_data['form_data']['_all_fields_']))
|
1949 |
&& (! empty($booking_data['form_data']['_all_fields_'][ $field_name ]))
|
1950 |
) {
|
@@ -1966,18 +1967,18 @@ function wpbc_btn_add_booking_to_google_calendar( $booking_data, $button_attr =
|
|
1966 |
}
|
1967 |
}
|
1968 |
//debuge($booking_gcal_events_form_fields, $fields,$booking_data['form_data']);
|
1969 |
-
|
1970 |
// Dates.
|
1971 |
-
|
1972 |
$check_in_timestamp = $check_out_timestamp = '';
|
1973 |
if ( ! empty( $booking_data[ 'dates_short' ] ) ) {
|
1974 |
-
|
1975 |
|
1976 |
-
|
1977 |
-
|
1978 |
-
*
|
|
|
1979 |
*/
|
1980 |
-
|
1981 |
$check_in_timestamp = strtotime( $booking_data[ 'dates_short' ][ 0 ], current_time( 'timestamp' ) );
|
1982 |
if ( trim( substr( $booking_data[ 'dates_short' ][ 0 ], 11 ) ) == '00:00:00' ) {
|
1983 |
$check_in_timestamp = date( "Ymd", $check_in_timestamp ); // All day
|
@@ -1994,17 +1995,17 @@ function wpbc_btn_add_booking_to_google_calendar( $booking_data, $button_attr =
|
|
1994 |
$check_out_timestamp = date( "Ymd\THis", $check_out_timestamp );
|
1995 |
//$check_out_timestamp = date( "Ymd\THis\Z", $check_out_timestamp );
|
1996 |
}
|
1997 |
-
|
1998 |
}
|
1999 |
|
2000 |
-
//debuge($check_in_timestamp,$check_out_timestamp, $fields );die;
|
2001 |
//Convert an ISO date/time to a UNIX timestamp
|
2002 |
//function iso_to_ts( $iso ) {
|
2003 |
// sscanf( $iso, "%u-%u-%uT%u:%u:%uZ", $year, $month, $day, $hour, $minute, $second );
|
2004 |
// return mktime( $hour, $minute, $second, $month, $day, $year );
|
2005 |
// 20140127T224000Z
|
2006 |
// date("Ymd\THis\Z", time());
|
2007 |
-
|
2008 |
/**
|
2009 |
action:
|
2010 |
action=TEMPLATE
|
@@ -2040,7 +2041,7 @@ sprop:
|
|
2040 |
Example: sprop=name:Home%20Page
|
2041 |
Format: sprop=website and/or sprop=name:website_name
|
2042 |
*/
|
2043 |
-
|
2044 |
// $link_add2gcal = 'http://www.google.com/calendar/event?action=TEMPLATE';
|
2045 |
// $link_add2gcal .= '&text=' . $fields['title'];
|
2046 |
//FixIn: 8.7.3.10
|
@@ -2064,88 +2065,88 @@ sprop:
|
|
2064 |
if ( $button_attr['is_only_url'] ) {
|
2065 |
echo $link_add2gcal;
|
2066 |
} else {
|
2067 |
-
|
2068 |
-
?><a href="<?php echo $link_add2gcal; ?>" target="_blank" rel="nofollow"
|
2069 |
-
class="tooltip_top <?php echo esc_attr( $button_attr['class'] ) ?>"
|
2070 |
title="<?php echo esc_js( $button_attr['hint'] ); ?>"
|
2071 |
-
><?php
|
2072 |
-
if ( $button_attr['is_show_icon'] ) {
|
2073 |
-
?><i class="glyphicon icon-1x glyphicon-export"></i><?php
|
2074 |
} else {
|
2075 |
echo esc_js( $button_attr['title'] );
|
2076 |
}
|
2077 |
-
?></a><?php
|
2078 |
}
|
2079 |
-
|
2080 |
if ( ! $echo ) {
|
2081 |
-
return ob_get_clean();
|
2082 |
}
|
2083 |
-
|
2084 |
}
|
2085 |
////////////////////////////////////////////////////////////////////////////////
|
2086 |
// Toolbar Other UI elements - General
|
2087 |
////////////////////////////////////////////////////////////////////////////////
|
2088 |
-
|
2089 |
/**
|
2090 |
* Selection elements in toolbar UI selectbox
|
2091 |
-
*
|
2092 |
* @param array $params
|
2093 |
-
*
|
2094 |
* Exmaple:
|
2095 |
wpbc_toolbar_btn__selection_element( array(
|
2096 |
'name' => 'resources_count'
|
2097 |
, 'title' => __('Resources count' ,'booking') . ':'
|
2098 |
-
, 'selected' => 1
|
2099 |
-
, 'options' => array_combine( range(1, 201) ,range(1, 201) )
|
2100 |
-
) ) ;
|
2101 |
|
2102 |
-
*/
|
2103 |
function wpbc_toolbar_btn__selection_element( $params ) {
|
2104 |
-
|
2105 |
-
$defaults = array(
|
2106 |
'name' => 'random_' . rand( 1000, 10000 )
|
2107 |
, 'title' => __('Total', 'booking') . ':'
|
2108 |
-
, 'on_change' => '' //'location.href=\'' . $link_base . '\' + this.value;'; //$link_base = wpbc_get_new_booking_url__base( array( $params['name'] ) ) . '&' . $params['name'] . '=' ;
|
2109 |
, 'options' => array()
|
2110 |
, 'selected' => 0
|
2111 |
);
|
2112 |
$params = wp_parse_args( $params, $defaults );
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
|
2117 |
for ( $i = 1; $i < 201; $i++ ) {
|
2118 |
$form_options[ $i ] = $i;
|
2119 |
}
|
2120 |
|
2121 |
-
$params = array(
|
2122 |
'label_for' => $params['name'] // "For" parameter of label element
|
2123 |
, 'label' => '' // Label above the input group
|
2124 |
, 'style' => '' // CSS Style of entire div element
|
2125 |
, 'items' => array(
|
2126 |
-
array(
|
2127 |
-
'type' => 'addon'
|
2128 |
, 'element' => 'text' // text | radio | checkbox
|
2129 |
, 'text' => $params['title']
|
2130 |
, 'class' => '' // Any CSS class here
|
2131 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
2132 |
-
)
|
2133 |
-
, array(
|
2134 |
-
'type' => 'select'
|
2135 |
, 'id' => $params['name'] // HTML ID of element
|
2136 |
, 'name' => $params['name'] // HTML ID of element
|
2137 |
-
, 'options' => $params['options'] // Associated array of titles and values
|
2138 |
-
, 'value' => $params['selected'] // Some Value from optins array that selected by default
|
2139 |
, 'style' => '' // CSS of select element
|
2140 |
, 'class' => '' // CSS Class of select element
|
2141 |
-
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
2142 |
, 'onchange' => $params['on_change']
|
2143 |
)
|
2144 |
)
|
2145 |
-
);
|
2146 |
-
?><div class="control-group wpbc-no-padding"><?php
|
2147 |
-
wpbc_bs_input_group( $params );
|
2148 |
-
?></div><?php
|
2149 |
}
|
2150 |
|
2151 |
|
@@ -2184,10 +2185,10 @@ function wpbc_hidden_search_by_id_field_in_main_form( $params = array() ){
|
|
2184 |
|
2185 |
/**
|
2186 |
* Real Search booking data by ID | Title (at top right side of page)
|
2187 |
-
*
|
2188 |
* @param array $params - array of parameters
|
2189 |
* Exmaple:
|
2190 |
-
wpbc_toolbar_search_by_id__top_form( array(
|
2191 |
'search_form_id' => 'wpbc_seasonfilters_search_form'
|
2192 |
, 'search_get_key' => 'wh_search_id'
|
2193 |
, 'is_pseudo' => false
|
@@ -2195,111 +2196,111 @@ function wpbc_hidden_search_by_id_field_in_main_form( $params = array() ){
|
|
2195 |
|
2196 |
*/
|
2197 |
function wpbc_toolbar_search_by_id__top_form( $params ) {
|
2198 |
-
|
2199 |
-
$defaults = array(
|
2200 |
'search_form_id' => 'wpbc_seasonfilters_search_form'
|
2201 |
, 'search_get_key' => 'wh_search_id'
|
2202 |
-
, 'is_pseudo' => false //'location.href=\'' . $link_base . '\' + this.value;'; //$link_base = wpbc_get_new_booking_url__base( array( $params['name'] ) ) . '&' . $params['name'] . '=' ;
|
2203 |
);
|
2204 |
$params = wp_parse_args( $params, $defaults );
|
2205 |
-
|
2206 |
-
|
2207 |
$exclude_params = array(); //array('page_num', 'orderby', 'order'); - if using "only_these_parameters", then this parameter does NOT require
|
2208 |
$only_these_parameters = array( 'page', 'tab', 'subtab', $params[ 'search_get_key' ] ); //FixIn: 8.1.1.11 - added , 'subtab' - ability to search booking resources in sub tab pages in settings
|
2209 |
$wpbc_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false, false ), $exclude_params, $only_these_parameters );
|
2210 |
-
|
2211 |
-
|
2212 |
-
$search_form_value = '';
|
2213 |
if ( isset( $_REQUEST[ $params[ 'search_get_key' ] ] ) ) {
|
2214 |
-
$wh_resource_id = wpbc_clean_digit_or_csd( $_REQUEST[ $params[ 'search_get_key' ] ] ); // '12,0,45,9' or '10'
|
2215 |
$wh_resource_title = wpbc_clean_string_for_form( $_REQUEST[ $params[ 'search_get_key' ] ] ); // Clean string
|
2216 |
if ( ! empty( $wh_resource_id ) ) {
|
2217 |
$search_form_value = $wh_resource_id;
|
2218 |
} else {
|
2219 |
$search_form_value = $wh_resource_title;
|
2220 |
-
}
|
2221 |
-
}
|
2222 |
-
|
2223 |
-
|
2224 |
wpbc_clear_div();
|
2225 |
-
|
2226 |
?>
|
2227 |
<span class="wpdevelop">
|
2228 |
-
|
2229 |
<?php if ( ! $params['is_pseudo'] ) { ?>
|
2230 |
<div style="position: absolute; right: 20px; top: 10px;">
|
2231 |
<form action="<?php echo $wpbc_admin_url; ?>" method="post" id="<?php echo $params[ 'search_form_id' ]; ?>" name="<?php echo $params[ 'search_form_id' ]; ?>" >
|
2232 |
-
<?php
|
2233 |
} else {
|
2234 |
?><div style="float:right;" id="<?php echo $params['search_form_id'] . '_pseudo'; ?>"><?php
|
2235 |
}
|
2236 |
-
|
2237 |
$params_for_element = array( 'label_for' => $params[ 'search_get_key' ] . ( ( $params['is_pseudo'] ) ? '_pseudo' : '' )
|
2238 |
, 'label' => ''//__('Keyword:', 'booking')
|
2239 |
, 'items' => array(
|
2240 |
array( 'type' => 'text'
|
2241 |
, 'id' => $params[ 'search_get_key' ] . ( ( $params['is_pseudo'] ) ? '_pseudo' : '' )
|
2242 |
, 'value' => $search_form_value
|
2243 |
-
, 'placeholder' => __('ID or Title', 'booking')
|
2244 |
-
)
|
2245 |
-
, array(
|
2246 |
'type' => 'button'
|
2247 |
, 'title' => __('Go', 'booking')
|
2248 |
-
, 'class' => 'button-secondary'
|
2249 |
, 'font_icon' => 'glyphicon glyphicon-search'
|
2250 |
, 'icon_position' => 'right'
|
2251 |
-
, 'action' => ( ( ! $params['is_pseudo'] ) ? "jQuery('#". $params[ 'search_form_id' ] ."').submit();"
|
2252 |
: "jQuery('#" . $params[ 'search_get_key' ] . "').val( jQuery('#" . $params[ 'search_get_key' ] . "_pseudo').val() ); jQuery('#". $params[ 'search_form_id' ] ."').submit();" ) //Submit real form at the top of page.
|
2253 |
-
)
|
2254 |
)
|
2255 |
-
);
|
2256 |
-
|
2257 |
?><div class="control-group wpbc-no-padding" ><?php
|
2258 |
-
wpbc_bs_input_group( $params_for_element );
|
2259 |
?></div><?php
|
2260 |
-
|
2261 |
if ( ! $params['is_pseudo'] ) { ?>
|
2262 |
</form>
|
2263 |
<?php } ?>
|
2264 |
<?php wpbc_clear_div(); ?>
|
2265 |
-
|
2266 |
-
<?php
|
2267 |
-
if ( $params['is_pseudo'] ) {
|
2268 |
// Required for opening specific page NUM during saving ////////
|
2269 |
-
?><input type="hidden" value="<?php echo $search_form_value; ?>" name="<?php echo $params[ 'search_get_key' ]; ?>" /><?php
|
2270 |
?><div class="clear" style="height:20px;"></div><?php
|
2271 |
}
|
2272 |
?>
|
2273 |
</div>
|
2274 |
</span>
|
2275 |
-
<?php
|
2276 |
-
|
2277 |
-
if ( $params['is_pseudo'] ) {
|
2278 |
-
|
2279 |
-
// Hide pseudo form, if real search form does not exist
|
2280 |
?>
|
2281 |
<script type="text/javascript">
|
2282 |
jQuery(document).ready(function(){
|
2283 |
if ( jQuery('#<?php echo $params[ 'search_form_id' ]; ?>').length == 0 ) {
|
2284 |
jQuery('#<?php echo $params['search_form_id'] . '_pseudo'; ?>').hide();
|
2285 |
-
}
|
2286 |
});
|
2287 |
</script>
|
2288 |
-
<?php
|
2289 |
}
|
2290 |
}
|
2291 |
|
2292 |
|
2293 |
-
////////////////////////////////////////////////////////////////////////////////
|
2294 |
// M o d a l s
|
2295 |
////////////////////////////////////////////////////////////////////////////////
|
2296 |
|
2297 |
-
/** Start Loyouts - Modal Window structure */
|
2298 |
function wpbc_write_content_for_modals_start_here() {
|
2299 |
-
|
2300 |
?><span id="wpbc_content_for_modals"></span><?php
|
2301 |
}
|
2302 |
-
add_bk_action( 'wpbc_write_content_for_modals', 'wpbc_write_content_for_modals_start_here');
|
2303 |
|
2304 |
|
2305 |
////////////////////////////////////////////////////////////////////////////////
|
@@ -2308,13 +2309,13 @@ add_bk_action( 'wpbc_write_content_for_modals', 'wpbc_write_content_for_modals_s
|
|
2308 |
|
2309 |
/** Load suport JavaScript for "Bookings" page*/
|
2310 |
function wpbc_js_for_bookings_page() {
|
2311 |
-
|
2312 |
$is_use_hints = get_bk_option( 'booking_is_use_hints_at_admin_panel' );
|
2313 |
if ( $is_use_hints == 'On' )
|
2314 |
wpbc_bs_javascript_tooltips(); // JS Tooltips
|
2315 |
|
2316 |
-
wpbc_bs_javascript_popover(); // JS Popover
|
2317 |
-
|
2318 |
wpbc_datepicker_js(); // JS Datepicker
|
2319 |
wpbc_datepicker_css(); // CSS DatePicker
|
2320 |
}
|
@@ -2322,12 +2323,12 @@ function wpbc_js_for_bookings_page() {
|
|
2322 |
|
2323 |
/** Datepicker activation JavaScript */
|
2324 |
function wpbc_datepicker_js() {
|
2325 |
-
|
2326 |
?><script type="text/javascript">
|
2327 |
jQuery(document).ready( function(){
|
2328 |
|
2329 |
function applyCSStoDays( date ){
|
2330 |
-
return [true, 'date_available'];
|
2331 |
}
|
2332 |
jQuery('input.wpdevbk-filters-section-calendar').datepick(
|
2333 |
{ beforeShowDay: applyCSStoDays,
|
@@ -2340,7 +2341,7 @@ function wpbc_datepicker_js() {
|
|
2340 |
dateFormat: 'yy-mm-dd',
|
2341 |
changeMonth: false,
|
2342 |
changeYear: false,
|
2343 |
-
minDate: null,
|
2344 |
maxDate: null, //'1Y',
|
2345 |
showStatus: false,
|
2346 |
multiSeparator: ', ',
|
@@ -2353,7 +2354,7 @@ function wpbc_datepicker_js() {
|
|
2353 |
}
|
2354 |
);
|
2355 |
});
|
2356 |
-
</script><?php
|
2357 |
}
|
2358 |
|
2359 |
|
@@ -2391,14 +2392,14 @@ function wpbc_datepicker_css(){
|
|
2391 |
}
|
2392 |
</style>
|
2393 |
<?php
|
2394 |
-
}
|
2395 |
|
2396 |
|
2397 |
/** Sortable Table JavaScript */
|
2398 |
function wpbc_sortable_js() {
|
2399 |
?>
|
2400 |
-
<script type="text/javascript">
|
2401 |
-
// Activate Sortable Functionality
|
2402 |
jQuery( document ).ready(function(){
|
2403 |
|
2404 |
jQuery('.wpbc_input_table tbody th').css('cursor','move');
|
@@ -2424,5 +2425,5 @@ function wpbc_sortable_js() {
|
|
2424 |
});
|
2425 |
</script>
|
2426 |
<?php
|
2427 |
-
|
2428 |
}
|
1 |
<?php /**
|
2 |
* @version 1.0
|
3 |
+
* @package Booking Calendar
|
4 |
* @category Toolbar. Data for UI Elements at Booking Calendar admin pages
|
5 |
* @author wpdevelop
|
6 |
*
|
7 |
* @web-site https://wpbookingcalendar.com/
|
8 |
+
* @email info@wpbookingcalendar.com
|
9 |
+
*
|
10 |
* @modified 2015-11-16
|
11 |
*/
|
12 |
|
21 |
function wpbc_bookings_toolbar() {
|
22 |
|
23 |
wpbc_clear_div();
|
24 |
+
|
25 |
wpbc_toolbar_search_by_id_bookings(); // Search bookings by ID - form at the top right side of the page
|
26 |
+
|
27 |
+
wpbc_toolbar_btn__view_mode(); // Vertical Buttons
|
28 |
+
|
29 |
// Toolbar ////////////////////////////////////////////////////////////////
|
30 |
+
|
31 |
?><div id="toolbar_booking_listing" style="margin-left: 50px;position:relative;"><?php
|
32 |
|
33 |
wpbc_bs_toolbar_tabs_html_container_start();
|
34 |
|
35 |
// <editor-fold defaultstate="collapsed" desc=" T O P T A B s " >
|
36 |
+
|
37 |
+
if ( ! isset( $_REQUEST['tab'] ) ) $_REQUEST['tab'] = 'filter';
|
38 |
$selected_tab = $_REQUEST['tab'];
|
39 |
|
40 |
wpbc_bs_display_tab( array(
|
41 |
+
'title' => ' ' . __('Filters', 'booking')
|
42 |
, 'onclick' => "jQuery('.visibility_container').hide();"
|
43 |
. "jQuery('#filter_toolbar_container').show();"
|
44 |
. "jQuery('.nav-tab').removeClass('nav-tab-active');"
|
45 |
. "jQuery(this).addClass('nav-tab-active');"
|
46 |
. "jQuery('.nav-tab i.icon-white').removeClass('icon-white');"
|
47 |
. "jQuery('.nav-tab-active i').addClass('icon-white');"
|
48 |
+
, 'font_icon' => 'glyphicon glyphicon-random'
|
49 |
, 'default' => ( $selected_tab == 'filter' ) ? true : false
|
50 |
) );
|
51 |
wpbc_bs_display_tab( array(
|
57 |
. "jQuery(this).addClass('nav-tab-active');"
|
58 |
. "jQuery('.nav-tab i.icon-white').removeClass('icon-white');"
|
59 |
. "jQuery('.nav-tab-active i').addClass('icon-white');"
|
60 |
+
|
61 |
, 'font_icon' => 'glyphicon glyphicon-fire'
|
62 |
, 'default' => ( $selected_tab == 'actions' ) ? true : false
|
63 |
|
64 |
+
) );
|
65 |
|
66 |
wpbc_bs_dropdown_menu_help();
|
67 |
+
|
68 |
// </editor-fold>
|
69 |
+
|
70 |
wpbc_bs_toolbar_tabs_html_container_end();
|
71 |
|
72 |
////////////////////////////////////////////////////////////////////////
|
73 |
+
|
74 |
wpbc_bs_toolbar_sub_html_container_start();
|
75 |
+
|
76 |
// F i l t e r T o o l b a r f o r B o o k i n g L i s t i n g
|
77 |
+
|
78 |
+
?><div id="filter_toolbar_container" class="visibility_container clearfix-height" style="display:<?php echo ( $selected_tab == 'filter' ) ? 'block' : 'none' ?>;margin-top:-5px;"><?php
|
79 |
|
80 |
?><form name="booking_filters_form" action="" method="post" id="booking_filters_form" class="form-inline">
|
81 |
+
<input type="hidden" name="page_num" id ="page_num" value="1" /><?php
|
82 |
|
83 |
+
wpbc_toolbar_btn__apply_reset(); // A p p l y R e s e t B u t t o n s
|
84 |
|
85 |
wpbc_toolbar_filter__approve_pending(); // A p p r o v e d | P e n d i n g F i l t e r
|
86 |
|
89 |
wpbc_toolbar_filter__sort(); // S o r t F i l t e r
|
90 |
|
91 |
wpbc_toolbar_filter__trash(); // T r a s h F i l t e r
|
92 |
+
|
93 |
+
?><span class="advanced_booking_filter" style="display:none;"><?php
|
94 |
|
95 |
wpbc_toolbar_filter__new_bookings(); // N e w | A l l B o o k i n g s F i l t e r
|
96 |
|
108 |
|
109 |
make_bk_action( 'wpbc_br_selection_for_listing' );
|
110 |
|
111 |
+
if ( function_exists( 'wpbc_filter_template_save_delete' ) ) wpbc_filter_template_save_delete();
|
112 |
|
113 |
?></form><?php
|
114 |
+
|
115 |
wpbc_clear_div();
|
116 |
+
|
117 |
+
wpbc_toolbar_expand_collapse_btn( 'advanced_booking_filter' );
|
118 |
+
|
119 |
?></div><?php
|
120 |
+
|
121 |
+
|
122 |
// A c t i o n s T o o l b a r f o r B o o k i n g L i s t i n g
|
123 |
+
|
124 |
+
?><div id="actions_toolbar_container" class="visibility_container clearfix-height" style="display:<?php echo ( $selected_tab == 'actions' ) ? 'block' : 'none' ?>;margin-top:-5px;"><?php
|
125 |
+
|
126 |
+
$user = wp_get_current_user();
|
127 |
$user_bk_id = $user->ID;
|
128 |
|
129 |
wpbc_toolbar_btn__approve_reject( $user_bk_id ); // A p p r o v e | R e j e c t
|
139 |
if ( function_exists('wpbc_toolbar_action_export_print_buttons') ) wpbc_toolbar_action_export_print_buttons();
|
140 |
|
141 |
wpbc_toolbar_btn__empty_trash( $user_bk_id ); // Empty Trash //FixIn: 8.5.2.24
|
142 |
+
|
143 |
wpbc_clear_div();
|
144 |
+
|
145 |
+
?></div><?php
|
146 |
+
|
147 |
wpbc_bs_toolbar_sub_html_container_end();
|
148 |
+
|
149 |
wpbc_toolbar_is_send_emails_btn();
|
150 |
+
|
151 |
?></div><?php
|
152 |
+
|
153 |
+
wpbc_clear_div();
|
154 |
}
|
155 |
|
156 |
|
158 |
function wpbc_timeline_toolbar() {
|
159 |
|
160 |
wpbc_clear_div();
|
161 |
+
|
162 |
wpbc_toolbar_search_by_id_bookings(); // Search bookings by ID - form at the top right side of the page
|
163 |
+
|
164 |
+
wpbc_toolbar_btn__view_mode(); // Vertical Buttons
|
165 |
+
|
166 |
// Toolbar ////////////////////////////////////////////////////////////////
|
167 |
+
|
168 |
?><div id="toolbar_booking_listing" style="margin-left: 50px;position:relative;"><?php
|
169 |
|
170 |
wpbc_bs_toolbar_tabs_html_container_start();
|
171 |
+
|
172 |
// <editor-fold defaultstate="collapsed" desc=" T O P T A B s " >
|
173 |
+
|
174 |
+
if ( ! isset( $_REQUEST['tab_cvm'] ) ) $_REQUEST['tab_cvm'] = 'actions_cvm';
|
175 |
$selected_tab = $_REQUEST['tab_cvm'];
|
176 |
|
177 |
wpbc_bs_display_tab( array(
|
186 |
, 'font_icon' => 'glyphicon glyphicon-fire'
|
187 |
, 'default' => ( $selected_tab == 'actions_cvm' ) ? true : false
|
188 |
|
189 |
+
) );
|
190 |
|
191 |
|
192 |
wpbc_bs_dropdown_menu_help();
|
193 |
|
194 |
// </editor-fold>
|
195 |
+
|
196 |
wpbc_bs_toolbar_tabs_html_container_end();
|
197 |
|
198 |
////////////////////////////////////////////////////////////////////////
|
199 |
+
|
200 |
wpbc_bs_toolbar_sub_html_container_start();
|
201 |
+
|
202 |
// A c t i o n s T o o l b a r f o r T i m e l i n e
|
203 |
+
|
204 |
+
?><div id="actions_toolbar_container" class="visibility_container clearfix-height" style="display:<?php echo ( $selected_tab == 'actions_cvm' ) ? 'block' : 'none' ?>;margin-top:-5px;"><?php
|
205 |
+
|
206 |
wpbc_toolbar_btn__timeline_view_mode(); // View Mode Buttons
|
207 |
|
208 |
wpbc_toolbar_btn__timeline_navigation(); // Navigation Buttons
|
209 |
|
210 |
make_bk_action( 'wpbc_br_selection_for_timeline' );
|
211 |
+
|
212 |
+
?></div><?php
|
213 |
+
|
214 |
wpbc_bs_toolbar_sub_html_container_end();
|
215 |
+
|
216 |
wpbc_toolbar_is_send_emails_btn();
|
217 |
+
|
218 |
?></div><?php
|
219 |
+
|
220 |
wpbc_clear_div();
|
221 |
+
|
222 |
}
|
223 |
|
224 |
|
226 |
function wpbc_add_new_booking_toolbar() {
|
227 |
|
228 |
wpbc_clear_div();
|
229 |
+
|
230 |
// Toolbar ////////////////////////////////////////////////////////////////
|
231 |
+
|
232 |
?><div id="toolbar_booking_listing" style="position:relative;"><?php
|
233 |
|
234 |
wpbc_bs_toolbar_tabs_html_container_start();
|
235 |
+
|
236 |
// <editor-fold defaultstate="collapsed" desc=" T O P T A B s " >
|
237 |
+
|
238 |
+
if ( ! isset( $_REQUEST['toolbar'] ) ) $_REQUEST['toolbar'] = 'filter';
|
239 |
$selected_tab = $_REQUEST['toolbar'];
|
240 |
|
241 |
wpbc_bs_display_tab( array(
|
250 |
, 'font_icon' => 'glyphicon glyphicon-fire'
|
251 |
, 'default' => ( $selected_tab == 'filter' ) ? true : false
|
252 |
|
253 |
+
) );
|
254 |
|
255 |
|
256 |
wpbc_bs_dropdown_menu_help();
|
257 |
|
258 |
// </editor-fold>
|
259 |
+
|
260 |
wpbc_bs_toolbar_tabs_html_container_end();
|
261 |
|
262 |
////////////////////////////////////////////////////////////////////////
|
263 |
+
|
264 |
wpbc_bs_toolbar_sub_html_container_start();
|
265 |
+
|
266 |
// T o o l b a r
|
267 |
+
?><div id="filter_toolbar_container" class="visibility_container clearfix-height" style="display:<?php echo ( $selected_tab == 'filter' ) ? 'block' : 'none' ?>;margin-top:-5px;"><?php
|
268 |
+
|
269 |
+
if ( ( function_exists( 'wpbc_toolbar_btn__resource_selection' ) )
|
270 |
&& ( empty( $_GET['booking_hash'] ) ) ) //Do not show resource seleciton if editing booking. //FixIn:7.1.2.10
|
271 |
wpbc_toolbar_btn__resource_selection();
|
272 |
+
|
273 |
if ( function_exists( 'wpbc_toolbar_btn__form_selection' ) )
|
274 |
wpbc_toolbar_btn__form_selection();
|
275 |
+
|
276 |
////////////////////////////////////////////////////////////////////
|
277 |
+
?><div class="clear-for-mobile"></div><?php
|
278 |
+
|
279 |
+
?><div class="control-group wpbc-no-padding" style="float:right;margin-right: 0;margin-left: 15px;"><?php
|
280 |
+
|
281 |
if ( function_exists( 'wpbc_toolbar_btn__auto_fill' ) )
|
282 |
wpbc_toolbar_btn__auto_fill();
|
283 |
+
|
284 |
wpbc_toolbar_btn__add_new_booking();
|
285 |
+
|
286 |
?></div><?php
|
287 |
////////////////////////////////////////////////////////////////////
|
288 |
|
289 |
+
|
290 |
+
?><span class="advanced_booking_filter" style="display:none;"><div class="clear" style="width:100%;border-bottom:1px solid #ccc;height:10px;"></div><?php
|
291 |
+
|
292 |
// Get possible saved previous "Custom User Calendar data"
|
293 |
$user_calendar_options = get_user_option( 'booking_custom_' . 'add_booking_calendar_options', get_wpbc_current_user_id() );
|
294 |
|
295 |
if ( $user_calendar_options === false ) { // Default, if no saved previously.
|
296 |
+
$user_calendar_options = array();
|
297 |
$user_calendar_options['calendar_months_count'] = 1;
|
298 |
$user_calendar_options['calendar_months_num_in_1_row'] = 0 ;
|
299 |
$user_calendar_options['calendar_width'] = '';
|
300 |
+
$user_calendar_options['calendar_widthunits'] = 'px';
|
301 |
+
$user_calendar_options['calendar_cell_height'] = '';
|
302 |
+
$user_calendar_options['calendar_cell_heightunits'] = 'px';
|
303 |
} else {
|
304 |
$user_calendar_options = maybe_unserialize( $user_calendar_options );
|
305 |
}
|
306 |
+
|
307 |
wpbc_toolbar_btn__calendar_months_number_selection( $user_calendar_options );
|
308 |
+
|
309 |
wpbc_toolbar_btn__calendar_months_num_in_1_row_selection( $user_calendar_options );
|
310 |
|
311 |
wpbc_toolbar_btn__calendar_width( $user_calendar_options );
|
312 |
+
|
313 |
wpbc_toolbar_btn__calendar_cell_height( $user_calendar_options );
|
314 |
+
|
315 |
wpbc_toolbar_btn__calendar_options_save();
|
316 |
+
|
317 |
?><div class="clear"></div></span><?php
|
318 |
+
|
319 |
+
|
320 |
wpbc_clear_div();
|
321 |
+
|
322 |
+
wpbc_toolbar_expand_collapse_btn( 'advanced_booking_filter' );
|
323 |
+
|
324 |
?></div><?php
|
325 |
|
326 |
+
|
327 |
wpbc_bs_toolbar_sub_html_container_end();
|
328 |
+
|
329 |
wpbc_toolbar_is_send_emails_btn();
|
330 |
+
|
331 |
?></div><?php
|
332 |
+
|
333 |
wpbc_clear_div();
|
334 |
+
|
335 |
}
|
336 |
|
337 |
|
338 |
+
////////////////////////////////////////////////////////////////////////////////
|
339 |
// HTML elements for Toolbar
|
340 |
////////////////////////////////////////////////////////////////////////////////
|
341 |
|
342 |
/**
|
343 |
* Expand or Collapse Advanced Filter set
|
344 |
+
*
|
345 |
* @param string $css_class_of_expand_element - CSS Class of element section to show or hide
|
346 |
*/
|
347 |
function wpbc_toolbar_expand_collapse_btn( $css_class_of_expand_element ) {
|
348 |
+
|
349 |
+
?><span id="show_link_advanced_booking_filter" class="tab-bottom tooltip_right"
|
350 |
+
title="<?php _e('Expand Advanced Toolbar' ,'booking'); ?>"
|
351 |
+
><a href="javascript:void(0)"
|
352 |
onclick="javascript:jQuery('.<?php echo $css_class_of_expand_element; ?>').show();
|
353 |
jQuery('#show_link_advanced_booking_filter').hide();
|
354 |
+
jQuery('#hide_link_advanced_booking_filter').show();"><i
|
355 |
class="glyphicon glyphicon-chevron-down"></i></a></span>
|
356 |
+
<span id="hide_link_advanced_booking_filter" class="tab-bottom tooltip_right" style="display:none;"
|
357 |
+
title="<?php _e('Collapse Advanced Toolbar' ,'booking'); ?>"
|
358 |
+
><a href="javascript:void(0)"
|
359 |
+
onclick="javascript:jQuery('.<?php echo $css_class_of_expand_element; ?>').hide();
|
360 |
+
jQuery('#hide_link_advanced_booking_filter').hide();
|
361 |
+
jQuery('#show_link_advanced_booking_filter').show();"><i
|
362 |
+
class="glyphicon glyphicon-chevron-up"></i></a></span><?php
|
363 |
+
|
364 |
}
|
365 |
|
366 |
|
387 |
|
388 |
/** Search form by booking ID (at top right side of page) */
|
389 |
function wpbc_toolbar_search_by_id_bookings() {
|
390 |
+
|
391 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( true, false ), array('view_mode', 'wh_booking_id', 'page_num' ) );
|
392 |
+
|
393 |
+
?>
|
394 |
<div style=" position: absolute; right: 20px; top: 10px;">
|
395 |
<form name="booking_filters_formID" action="<?php echo $bk_admin_url . '&view_mode=vm_listing' ; ?>" method="post" id="booking_filters_formID" >
|
396 |
+
<?php
|
397 |
+
|
398 |
if (isset($_REQUEST['wh_booking_id'])) $wh_booking_id = wpbc_clean_digit_or_csd( $_REQUEST['wh_booking_id'] ); // {'1', '2', .... }
|
399 |
+
else $wh_booking_id = '';
|
400 |
+
|
401 |
+
|
402 |
+
$params = array( 'label_for' => 'wh_booking_id'
|
403 |
, 'label' => ''//__('Keyword:', 'booking')
|
404 |
, 'items' => array(
|
405 |
+
array( 'type' => 'text', 'id' => 'wh_booking_id', 'value' => $wh_booking_id, 'placeholder' => __('Booking ID', 'booking') )
|
406 |
+
, array(
|
407 |
'type' => 'button'
|
408 |
, 'title' => __('Go', 'booking')
|
409 |
+
, 'class' => 'button-secondary'
|
410 |
, 'font_icon' => 'glyphicon glyphicon-search'
|
411 |
, 'icon_position' => 'right'
|
412 |
+
, 'action' => "jQuery('#booking_filters_formID').submit();" )
|
413 |
)
|
414 |
+
);
|
415 |
?><div class="control-group wpbc-no-padding" ><?php
|
416 |
+
wpbc_bs_input_group( $params );
|
417 |
?></div><?php
|
418 |
?>
|
419 |
</form>
|
420 |
<?php wpbc_clear_div(); ?>
|
421 |
</div>
|
422 |
+
<?php
|
423 |
}
|
424 |
|
425 |
|
430 |
/** Help - Drop Down Menu - T a b */
|
431 |
function wpbc_bs_dropdown_menu_help() {
|
432 |
|
433 |
+
wpbc_bs_dropdown_menu( array(
|
434 |
+
'title' => __( 'Help', 'booking' )
|
435 |
, 'font_icon' => 'glyphicon glyphicon-question-sign'
|
436 |
, 'position' => 'right'
|
437 |
+
, 'items' => array(
|
438 |
array( 'type' => 'link', 'title' => "What's New"/*__('Get Started')*/, 'url' => esc_url( admin_url( add_query_arg( array( 'page' => 'wpbc-about' ), 'index.php' ) ) ) )
|
439 |
, array( 'type' => 'divider' )
|
440 |
, array( 'type' => 'link', 'title' => __('Help', 'booking'), 'url' => 'https://wpbookingcalendar.com/help/' )
|
447 |
, 'attr' => array(
|
448 |
// 'target' => '_blank'
|
449 |
'style' => 'font-weight: 600;font-size: 1em;'
|
450 |
+
)
|
451 |
)
|
452 |
)
|
453 |
+
) );
|
454 |
}
|
455 |
|
456 |
|
457 |
/** View Mode - B u t t o n */
|
458 |
function wpbc_toolbar_btn__view_mode() {
|
459 |
+
|
460 |
$selected_view_mode = $_REQUEST['view_mode'];
|
461 |
|
462 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false ), array('view_mode', 'wh_booking_id', 'page_num' ) );
|
468 |
, 'selected' => ( $selected_view_mode == 'vm_listing' ) ? true : false
|
469 |
, 'link' => $bk_admin_url . '&view_mode=vm_listing'
|
470 |
, 'icon' => ''
|
471 |
+
, 'font_icon' => 'glyphicon glyphicon-align-justify'
|
472 |
);
|
473 |
+
|
474 |
+
|
475 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false ) , array() // Exclude Value of this parameter
|
476 |
+
, array( 'page', 'tab', 'tab_cvm', 'wh_booking_type', 'scroll_start_date', 'scroll_month', 'view_days_num'
|
477 |
+
, 'wh_trash' //FixIn: 6.1.1.10
|
478 |
) // Only this parameters
|
479 |
+
);
|
480 |
$params['btn_vm_calendar'] = array(
|
481 |
'title' => ''
|
482 |
, 'hint' => array( 'title' => __('Calendar Overview' ,'booking') , 'position' => 'bottom' )
|
487 |
);
|
488 |
|
489 |
?><div style="position:absolute;"><?php
|
490 |
+
|
491 |
wpbc_bs_vertical_buttons_group( $params );
|
492 |
+
|
493 |
?></div><?php
|
494 |
}
|
495 |
|
496 |
|
497 |
////////////////////////////////////////////////////////////////////////////////
|
498 |
+
// Toolbar Filter B u t t o n s
|
499 |
////////////////////////////////////////////////////////////////////////////////
|
500 |
|
501 |
/** Apply | Reset - B u t t o n s */
|
502 |
function wpbc_toolbar_btn__apply_reset(){
|
503 |
|
504 |
+
$params = array(
|
505 |
'label_for' => 'wpbc_refresh' // "For" parameter of button group element
|
506 |
, 'label' => ''// '//__('Refresh listing', 'booking') // Label above the button group
|
507 |
, 'style' => '' // CSS Style of entire div element
|
508 |
, 'items' => array(
|
509 |
+
array(
|
510 |
+
'type' => 'button'
|
511 |
, 'title' => __('Apply', 'booking') // Title of the button
|
512 |
, 'hint' => array( 'title' => __('Refresh booking listing' ,'booking') , 'position' => 'top' ) // Hint
|
513 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
520 |
, 'attr' => array()
|
521 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
522 |
)
|
523 |
+
, array(
|
524 |
'type' => 'button'
|
525 |
, 'title' => ''
|
526 |
, 'hint' => array( 'title' => __('Reset filter to default values' ,'booking') , 'position' => 'top' ) // Hint
|
527 |
, 'link' => wpbc_get_bookings_url( true, false ) . '&view_mode=vm_listing'
|
528 |
+
, 'action' => ''
|
529 |
+
, 'class' => ''
|
530 |
, 'style' => '' //
|
531 |
, 'icon' => ''
|
532 |
, 'font_icon' => 'glyphicon glyphicon-remove'
|
535 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
536 |
)
|
537 |
)
|
538 |
+
);
|
539 |
+
wpbc_bs_button_group( $params );
|
540 |
}
|
541 |
|
542 |
|
543 |
/** Approved | Pending - F i l t e r */
|
544 |
function wpbc_toolbar_filter__approve_pending(){
|
545 |
|
546 |
+
$params = array(
|
547 |
'id' => 'wh_approved'
|
548 |
, 'options' => array (
|
549 |
__('Pending', 'booking') => '0',
|
553 |
)
|
554 |
, 'default' => ( isset( $_REQUEST[ 'wh_approved' ] ) ) ? esc_attr( $_REQUEST[ 'wh_approved' ] ) : ''
|
555 |
, 'label' => ''//__('Status', 'booking') . ':'
|
556 |
+
, 'title' => __('Bookings', 'booking')
|
557 |
+
);
|
558 |
|
559 |
+
wpbc_bs_dropdown_list( $params );
|
560 |
}
|
561 |
|
562 |
|
563 |
/** Booked Dates - F i l t e r */
|
564 |
function wpbc_toolbar_filter__booked_dates(){
|
565 |
|
566 |
+
$dates_interval = array(
|
567 |
1 => '1' . ' ' . __('day' ,'booking')
|
568 |
, 2 => '2' . ' ' . __('days' ,'booking')
|
569 |
, 3 => '3' . ' ' . __('days' ,'booking')
|
578 |
, 183 => '6' . ' ' . __('months' ,'booking')
|
579 |
, 365 => '1' . ' ' . __('Year' ,'booking')
|
580 |
);
|
581 |
+
$params = array(
|
582 |
'id' => 'wh_booking_date'
|
583 |
, 'id2' => 'wh_booking_date2'
|
584 |
, 'default' => ( isset( $_REQUEST[ 'wh_booking_date' ] ) ) ? esc_attr( $_REQUEST[ 'wh_booking_date' ] ) : ''
|
585 |
, 'default2' => ( isset( $_REQUEST[ 'wh_booking_date2' ] ) ) ? esc_attr( $_REQUEST[ 'wh_booking_date2' ] ) : ''
|
586 |
, 'hint' => array( 'title' => __('Filter bookings by booking dates' ,'booking') , 'position' => 'top' )
|
587 |
, 'label' => ''//__('Booked Dates', 'booking') . ':'
|
588 |
+
, 'title' => __('Dates', 'booking')
|
589 |
, 'options' => array (
|
590 |
__('Current dates' ,'booking') => '0'
|
591 |
, __('Today' ,'booking') => '1'
|
595 |
, __('Today check in/out' ,'booking') => '9'
|
596 |
, __('Check In - Tomorrow' ,'booking') => '7'
|
597 |
, __('Check Out - Tomorrow' ,'booking') => '8'
|
598 |
+
, 'divider2' => 'divider'
|
599 |
+
, 'next' => array(
|
600 |
array(
|
601 |
+
'type' => 'radio'
|
602 |
, 'label' => __('Next' ,'booking')
|
603 |
+
, 'id' => 'wh_booking_datedays_interval1'
|
604 |
+
, 'name' => 'wh_booking_datedays_interval_Radios'
|
605 |
, 'style' => '' // CSS of select element
|
606 |
+
, 'class' => '' // CSS Class of select element
|
607 |
, 'disabled' => false
|
608 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
609 |
+
, 'legend' => '' // aria-label parameter
|
610 |
+
, 'value' => '4' // Some Value from optins array that selected by default
|
611 |
+
, 'selected' => ( isset($_REQUEST[ 'wh_booking_datedays_interval_Radios'] )
|
612 |
&& ( $_REQUEST[ 'wh_booking_datedays_interval_Radios'] == '4' ) ) ? true : false
|
613 |
)
|
614 |
+
, array(
|
615 |
'type' => 'select'
|
616 |
+
, 'attr' => array()
|
617 |
, 'name' => 'wh_booking_datenext'
|
618 |
+
, 'id' => 'wh_booking_datenext'
|
619 |
, 'options' => $dates_interval
|
620 |
, 'value' => isset( $_REQUEST[ 'wh_booking_datenext'] ) ? esc_attr( $_REQUEST[ 'wh_booking_datenext'] ) : ''
|
621 |
+
)
|
622 |
+
)
|
623 |
+
, 'prior' => array(
|
624 |
+
array(
|
625 |
'type' => 'radio'
|
626 |
, 'label' => __('Prior' ,'booking')
|
627 |
+
, 'id' => 'wh_booking_datedays_interval2'
|
628 |
+
, 'name' => 'wh_booking_datedays_interval_Radios'
|
629 |
, 'style' => '' // CSS of select element
|
630 |
+
, 'class' => '' // CSS Class of select element
|
631 |
, 'disabled' => false
|
632 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
633 |
+
, 'legend' => '' // aria-label parameter
|
634 |
+
, 'value' => '5' // Some Value from optins array that selected by default
|
635 |
+
, 'selected' => ( isset($_REQUEST[ 'wh_booking_datedays_interval_Radios'] )
|
636 |
&& ( $_REQUEST[ 'wh_booking_datedays_interval_Radios'] == '5' ) ) ? true : false
|
637 |
)
|
638 |
+
, array(
|
639 |
'type' => 'select'
|
640 |
+
, 'attr' => array()
|
641 |
, 'name' => 'wh_booking_dateprior'
|
642 |
+
, 'id' => 'wh_booking_dateprior'
|
643 |
, 'options' => $dates_interval
|
644 |
, 'value' => isset( $_REQUEST[ 'wh_booking_dateprior'] ) ? esc_attr( $_REQUEST[ 'wh_booking_dateprior'] ) : ''
|
645 |
+
)
|
646 |
+
)
|
647 |
+
, 'fixed' => array( array( 'type' => 'group', 'class' => 'input-group text-group'),
|
648 |
+
array(
|
649 |
'type' => 'radio'
|
650 |
, 'label' => __('Dates' ,'booking')
|
651 |
+
, 'id' => 'wh_booking_datedays_interval3'
|
652 |
+
, 'name' => 'wh_booking_datedays_interval_Radios'
|
653 |
, 'style' => '' // CSS of select element
|
654 |
+
, 'class' => '' // CSS Class of select element
|
655 |
, 'disabled' => false
|
656 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
657 |
+
, 'legend' => '' // aria-label parameter
|
658 |
+
, 'value' => '6' // Some Value from optins array that selected by default
|
659 |
+
, 'selected' => ( isset($_REQUEST[ 'wh_booking_datedays_interval_Radios'] )
|
660 |
&& ( $_REQUEST[ 'wh_booking_datedays_interval_Radios'] == '6' ) ) ? true : false
|
661 |
)
|
662 |
+
, array(
|
663 |
+
'type' => 'text'
|
664 |
+
, 'id' => 'wh_booking_datefixeddates'
|
665 |
+
, 'name' => 'wh_booking_datefixeddates'
|
666 |
, 'label' => __('Check-in' ,'booking') . ':'
|
667 |
, 'disabled' => false
|
668 |
, 'class' => 'wpdevbk-filters-section-calendar' // This class add datepicker
|
669 |
, 'style' => ''
|
670 |
+
, 'placeholder' => date( 'Y-m-d' )
|
671 |
+
, 'attr' => array()
|
672 |
, 'value' => isset( $_REQUEST[ 'wh_booking_datefixeddates'] ) ? esc_attr( $_REQUEST[ 'wh_booking_datefixeddates'] ) : ''
|
673 |
+
)
|
674 |
+
, array(
|
675 |
+
'type' => 'text'
|
676 |
+
, 'id' => 'wh_booking_date2fixeddates'
|
677 |
+
, 'name' => 'wh_booking_date2fixeddates'
|
678 |
, 'label' => __('Check-out' ,'booking') . ':'
|
679 |
, 'disabled' => false
|
680 |
, 'class' => 'wpdevbk-filters-section-calendar' // This class add datepicker
|
681 |
, 'style' => ''
|
682 |
+
, 'placeholder' => date( 'Y-m-d' )
|
683 |
+
, 'attr' => array()
|
684 |
, 'value' => isset( $_REQUEST[ 'wh_booking_date2fixeddates'] ) ? esc_attr( $_REQUEST[ 'wh_booking_date2fixeddates'] ) : ''
|
685 |
+
)
|
686 |
+
)
|
687 |
+
, 'divider3' => 'divider'
|
688 |
+
, 'buttons' => array( array( 'type' => 'group', 'class' => 'btn-group' ),
|
689 |
+
array(
|
690 |
+
'type' => 'button'
|
691 |
, 'title' => __('Apply' ,'booking') // Title of the button
|
692 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
693 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
705 |
, 'attr' => array()
|
706 |
|
707 |
)
|
708 |
+
, array(
|
709 |
+
'type' => 'button'
|
710 |
, 'title' => __('Close' ,'booking') // Title of the button
|
711 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
712 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
717 |
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
|
718 |
, 'style' => '' // Any CSS class here
|
719 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
720 |
+
, 'attr' => array()
|
721 |
)
|
722 |
)
|
723 |
)
|
724 |
+
);
|
725 |
|
726 |
+
wpbc_bs_dropdown_list( $params );
|
727 |
|
728 |
}
|
729 |
|
742 |
$selectors = apply_bk_filter('bk_filter_sort_options', $selectors);
|
743 |
$default_value = get_bk_option( 'booking_sort_order');
|
744 |
|
745 |
+
$params = array( // Pending, Active, Suspended, Terminated, Cancelled, Fraud
|
746 |
'id' => 'or_sort'
|
747 |
, 'options' => $selectors
|
748 |
, 'default' => ( isset( $_REQUEST[ 'or_sort' ] ) ) ? esc_attr( $_REQUEST[ 'or_sort' ] ) : $default_value
|
749 |
, 'label' => ''//__('Status', 'booking') . ':'
|
750 |
+
, 'title' => __('Order by', 'booking')
|
751 |
+
);
|
752 |
|
753 |
+
wpbc_bs_dropdown_list( $params );
|
754 |
}
|
755 |
|
756 |
|
758 |
function wpbc_toolbar_filter__trash(){ //FixIn: 6.1.1.10
|
759 |
|
760 |
|
761 |
+
$params = array(
|
762 |
'id' => 'wh_trash'
|
763 |
, 'options' => array (
|
764 |
__('Exist', 'booking') => '0',
|
768 |
)
|
769 |
, 'default' => ( isset( $_REQUEST[ 'wh_trash' ] ) ) ? esc_attr( $_REQUEST[ 'wh_trash' ] ) : ''
|
770 |
, 'label' => ''//__('Status', 'booking') . ':'
|
771 |
+
, 'title' => __('Bookings', 'booking')
|
772 |
+
);
|
773 |
+
|
774 |
+
wpbc_bs_dropdown_list( $params );
|
775 |
|
|
|
|
|
776 |
}
|
777 |
|
778 |
|
779 |
/** New Bookings - F i l t e r */
|
780 |
function wpbc_toolbar_filter__new_bookings() {
|
781 |
+
|
782 |
+
$params = array(
|
783 |
'id' => 'wh_is_new'
|
784 |
, 'options' => array (
|
785 |
__('All bookings', 'booking') => '',
|
787 |
)
|
788 |
, 'default' => ( isset( $_REQUEST[ 'wh_is_new' ] ) ) ? esc_attr( $_REQUEST[ 'wh_is_new' ] ) : ''
|
789 |
, 'label' => ''//__('Status', 'booking') . ':'
|
790 |
+
, 'title' => __('Show', 'booking')
|
791 |
+
);
|
792 |
|
793 |
+
wpbc_bs_dropdown_list( $params );
|
794 |
}
|
795 |
|
796 |
|
797 |
/** Creation Date - F i l t e r */
|
798 |
function wpbc_toolbar_filter__creation_date(){
|
799 |
+
|
800 |
+
$dates_interval = array(
|
801 |
1 => '1' . ' ' . __('day' ,'booking')
|
802 |
, 2 => '2' . ' ' . __('days' ,'booking')
|
803 |
, 3 => '3' . ' ' . __('days' ,'booking')
|
812 |
, 183 => '6' . ' ' . __('months' ,'booking')
|
813 |
, 365 => '1' . ' ' . __('Year' ,'booking')
|
814 |
);
|
815 |
+
|
816 |
+
$params = array(
|
817 |
'id' => 'wh_modification_date'
|
818 |
, 'id2' => 'wh_modification_date2'
|
819 |
, 'default' => ( isset( $_REQUEST[ 'wh_modification_date' ] ) ) ? esc_attr( $_REQUEST[ 'wh_modification_date' ] ) : '3'
|
820 |
, 'default2' => ( isset( $_REQUEST[ 'wh_modification_date2' ] ) ) ? esc_attr( $_REQUEST[ 'wh_modification_date2' ] ) : ''
|
821 |
, 'hint' => array( 'title' => __('Filter bookings by booking dates' ,'booking') , 'position' => 'top' )
|
822 |
, 'label' => ''//__('Booking Creation Date', 'booking') . ':'
|
823 |
+
, 'title' => __('Creation', 'booking')
|
824 |
, 'options' => array (
|
825 |
__('Today' ,'booking') => '1'
|
826 |
, __('All dates' ,'booking') => '3'
|
827 |
, 'divider1' => 'divider'
|
828 |
+
, 'prior' => array(
|
829 |
+
array(
|
830 |
'type' => 'radio'
|
831 |
, 'label' => __('Prior' ,'booking')
|
832 |
+
, 'id' => 'wh_modification_datedays_interval2'
|
833 |
+
, 'name' => 'wh_modification_datedays_interval_Radios'
|
834 |
, 'style' => '' // CSS of select element
|
835 |
+
, 'class' => '' // CSS Class of select element
|
836 |
, 'disabled' => false
|
837 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
838 |
+
, 'legend' => '' // aria-label parameter
|
839 |
+
, 'value' => '5' // Some Value from optins array that selected by default
|
840 |
+
, 'selected' => ( isset($_REQUEST[ 'wh_modification_datedays_interval_Radios'] )
|
841 |
&& ( $_REQUEST[ 'wh_modification_datedays_interval_Radios'] == '5' ) ) ? true : false
|
842 |
)
|
843 |
+
, array(
|
844 |
'type' => 'select'
|
845 |
+
, 'attr' => array()
|
846 |
, 'name' => 'wh_modification_dateprior'
|
847 |
+
, 'id' => 'wh_modification_dateprior'
|
848 |
, 'options' => $dates_interval
|
849 |
, 'value' => isset( $_REQUEST[ 'wh_modification_dateprior'] ) ? esc_attr( $_REQUEST[ 'wh_modification_dateprior'] ) : ''
|
850 |
+
)
|
851 |
+
)
|
852 |
+
, 'fixed' => array( array( 'type' => 'group', 'class' => 'input-group text-group'),
|
853 |
+
array(
|
854 |
'type' => 'radio'
|
855 |
, 'label' => __('Dates' ,'booking')
|
856 |
+
, 'id' => 'wh_modification_datedays_interval3'
|
857 |
+
, 'name' => 'wh_modification_datedays_interval_Radios'
|
858 |
, 'style' => '' // CSS of select element
|
859 |
+
, 'class' => '' // CSS Class of select element
|
860 |
, 'disabled' => false
|
861 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
862 |
+
, 'legend' => '' // aria-label parameter
|
863 |
+
, 'value' => '6' // Some Value from optins array that selected by default
|
864 |
+
, 'selected' => ( isset($_REQUEST[ 'wh_modification_datedays_interval_Radios'] )
|
865 |
&& ( $_REQUEST[ 'wh_modification_datedays_interval_Radios'] == '6' ) ) ? true : false
|
866 |
)
|
867 |
+
, array(
|
868 |
+
'type' => 'text'
|
869 |
+
, 'id' => 'wh_modification_datefixeddates'
|
870 |
+
, 'name' => 'wh_modification_datefixeddates'
|
871 |
, 'label' => __('Check-in' ,'booking') . ':'
|
872 |
, 'disabled' => false
|
873 |
, 'class' => 'wpdevbk-filters-section-calendar' // This class add datepicker
|
874 |
, 'style' => ''
|
875 |
+
, 'placeholder' => date( 'Y-m-d' )
|
876 |
+
, 'attr' => array()
|
877 |
, 'value' => isset( $_REQUEST[ 'wh_modification_datefixeddates'] ) ? esc_attr( $_REQUEST[ 'wh_modification_datefixeddates'] ) : ''
|
878 |
+
)
|
879 |
+
, array(
|
880 |
+
'type' => 'text'
|
881 |
+
, 'id' => 'wh_modification_date2fixeddates'
|
882 |
+
, 'name' => 'wh_modification_date2fixeddates'
|
883 |
, 'label' => __('Check-out' ,'booking') . ':'
|
884 |
, 'disabled' => false
|
885 |
, 'class' => 'wpdevbk-filters-section-calendar' // This class add datepicker
|
886 |
, 'style' => ''
|
887 |
+
, 'placeholder' => date( 'Y-m-d' )
|
888 |
+
, 'attr' => array()
|
889 |
, 'value' => isset( $_REQUEST[ 'wh_modification_date2fixeddates'] ) ? esc_attr( $_REQUEST[ 'wh_modification_date2fixeddates'] ) : ''
|
890 |
+
)
|
891 |
+
)
|
892 |
+
, 'divider3' => 'divider'
|
893 |
+
, 'buttons' => array( array( 'type' => 'group', 'class' => 'btn-group' ),
|
894 |
+
array(
|
895 |
+
'type' => 'button'
|
896 |
, 'title' => __('Apply' ,'booking') // Title of the button
|
897 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
898 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
910 |
, 'attr' => array()
|
911 |
|
912 |
)
|
913 |
+
, array(
|
914 |
+
'type' => 'button'
|
915 |
, 'title' => __('Close' ,'booking') // Title of the button
|
916 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
917 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
922 |
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
|
923 |
, 'style' => '' // Any CSS class here
|
924 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
925 |
+
, 'attr' => array()
|
926 |
)
|
927 |
)
|
928 |
)
|
929 |
+
);
|
930 |
|
931 |
+
wpbc_bs_dropdown_list( $params );
|
932 |
}
|
933 |
|
934 |
|
935 |
////////////////////////////////////////////////////////////////////////////////
|
936 |
+
// Toolbar Actions B u t t o n s
|
937 |
////////////////////////////////////////////////////////////////////////////////
|
938 |
|
939 |
/** Approve | Reject - B u t t o n s */
|
940 |
function wpbc_toolbar_btn__approve_reject( $user_bk_id ) {
|
941 |
+
|
942 |
+
$params = array(
|
943 |
'label_for' => 'actions' // "For" parameter of button group element
|
944 |
, 'label' => '' //__('Actions:', 'booking') // Label above the button group
|
945 |
, 'style' => '' // CSS Style of entire div element
|
946 |
, 'items' => array(
|
947 |
+
array(
|
948 |
+
'type' => 'button'
|
949 |
, 'title' => __('Approve', 'booking') . ' ' // Title of the button
|
950 |
, 'hint' => array( 'title' => __('Approve selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
951 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
952 |
+
, 'action' => "approve_unapprove_booking( get_selected_bookings_id_in_booking_listing(), 1, " .
|
953 |
$user_bk_id . ", '" . wpbc_get_booking_locale() . "' , 1);" // Some JavaScript to execure, for example run the function
|
954 |
, 'class' => 'button-primary' // button-secondary | button-primary
|
955 |
, 'icon' => ''
|
959 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
960 |
, 'attr' => array()
|
961 |
)
|
962 |
+
, array(
|
963 |
+
'type' => 'button'
|
964 |
, 'title' => __('Pending', 'booking') . ' ' // Title of the button
|
965 |
, 'hint' => array( 'title' => __('Set selected bookings as pending' ,'booking') , 'position' => 'top' ) // Hint
|
966 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
976 |
, 'attr' => array()
|
977 |
)
|
978 |
)
|
979 |
+
);
|
980 |
wpbc_bs_button_group( $params );
|
981 |
}
|
982 |
|
984 |
/** Delete | Reason - B u t t o n s */
|
985 |
function wpbc_toolbar_btn__delete_reason( $user_bk_id ) {
|
986 |
|
987 |
+
$params = array(
|
988 |
'label_for' => 'denyreason' // "For" parameter of label element
|
989 |
, 'label' => '' // Label above the input group
|
990 |
, 'style' => '' // CSS Style of entire div element
|
991 |
, 'items' => array(
|
992 |
+
array( //FixIn: 6.1.1.10
|
993 |
+
'type' => 'button'
|
994 |
, 'title' => __('Trash / Reject', 'booking') . ' ' // Title of the button
|
995 |
, 'hint' => array( 'title' => __('Reject booking - move selected bookings to trash' ,'booking') , 'position' => 'top' ) // Hint
|
996 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
997 |
, 'action' => "if ( wpbc_are_you_sure('" . esc_js( __('Do you really want to do this ?' ,'booking') ) . "') )
|
998 |
+
trash__restore_booking( 1, get_selected_bookings_id_in_booking_listing() , "
|
999 |
+
. $user_bk_id . ", '"
|
1000 |
. wpbc_get_booking_locale() . "' , 1 );" // Some JavaScript to execure, for example run the function
|
1001 |
, 'class' => '' // button-secondary | button-primary
|
1002 |
, 'icon' => ''
|
1006 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1007 |
, 'attr' => array()
|
1008 |
)
|
1009 |
+
, array(
|
1010 |
+
'type' => 'button'
|
1011 |
, 'title' => __('Restore', 'booking') . ' ' // Title of the button
|
1012 |
, 'hint' => array( 'title' => __('Restore selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1013 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1014 |
, 'action' => "if ( wpbc_are_you_sure('" . esc_js( __('Do you really want to do this ?' ,'booking') ) . "') )
|
1015 |
+
trash__restore_booking( 0, get_selected_bookings_id_in_booking_listing() , "
|
1016 |
+
. $user_bk_id . ", '"
|
1017 |
. wpbc_get_booking_locale() . "' , 1 );" // Some JavaScript to execure, for example run the function
|
1018 |
, 'class' => '' // button-secondary | button-primary
|
1019 |
, 'icon' => ''
|
1023 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1024 |
, 'attr' => array()
|
1025 |
)
|
1026 |
+
, array(
|
1027 |
+
'type' => 'button'
|
1028 |
, 'title' => __('Delete', 'booking') . ' ' // Title of the button
|
1029 |
, 'hint' => array( 'title' => __('Delete selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1030 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1031 |
, 'action' => "if ( wpbc_are_you_sure('" . esc_js( __('Do you really want to delete selected booking(s) ?' ,'booking') ) . "') )
|
1032 |
+
delete_booking( get_selected_bookings_id_in_booking_listing() , "
|
1033 |
+
. $user_bk_id . ", '"
|
1034 |
. wpbc_get_booking_locale() . "' , 1 );" // Some JavaScript to execure, for example run the function
|
1035 |
, 'class' => '' // button-secondary | button-primary
|
1036 |
, 'icon' => ''
|
1040 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1041 |
, 'attr' => array()
|
1042 |
)
|
1043 |
+
, array(
|
1044 |
'type' => 'text'
|
1045 |
+
, 'id' => 'denyreason' // HTML ID of element
|
1046 |
, 'value' => '' // Value of Text field
|
1047 |
, 'placeholder' => __('Reason of cancellation', 'booking')
|
1048 |
, 'style' => '' // CSS of select element
|
1049 |
, 'class' => '' // CSS Class of select element
|
1050 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1051 |
+
)
|
1052 |
)
|
1053 |
+
);
|
1054 |
+
?><div class="control-group wpbc-no-padding wpbc-sm-100" ><?php
|
1055 |
+
wpbc_bs_input_group( $params );
|
1056 |
+
?></div><?php
|
1057 |
}
|
1058 |
|
1059 |
|
1095 |
|
1096 |
/** Read All - B u t t o n s */
|
1097 |
function wpbc_toolbar_btn__read_all( $user_bk_id ) {
|
1098 |
+
|
1099 |
+
$params = array(
|
1100 |
'label_for' => 'actions' // "For" parameter of button group element
|
1101 |
, 'label' => '' //__('Actions:', 'booking') // Label above the button group
|
1102 |
, 'style' => '' // CSS Style of entire div element
|
1103 |
, 'items' => array(
|
1104 |
+
array(
|
1105 |
+
'type' => 'button'
|
1106 |
, 'title' => __('Read All', 'booking') . ' ' // Title of the button
|
1107 |
, 'hint' => array( 'title' => __('Mark as read all bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1108 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1115 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1116 |
, 'attr' => array()
|
1117 |
)
|
1118 |
+
, array(
|
1119 |
+
'type' => 'button'
|
1120 |
, 'title' => __('Read', 'booking') . ' ' // Title of the button
|
1121 |
, 'hint' => array( 'title' => __('Mark as read selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1122 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1123 |
+
, 'action' => "mark_read_booking( get_selected_bookings_id_in_booking_listing(), 0, "
|
1124 |
. $user_bk_id . ", '" . wpbc_get_booking_locale() . "' );" // Some JavaScript to execure, for example run the function
|
1125 |
, 'class' => '' // button-secondary | button-primary
|
1126 |
, 'icon' => ''
|
1130 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1131 |
, 'attr' => array()
|
1132 |
)
|
1133 |
+
, array(
|
1134 |
+
'type' => 'button'
|
1135 |
, 'title' => __('Unread', 'booking') . ' ' // Title of the button
|
1136 |
, 'hint' => array( 'title' => __('Mark as Unread selected bookings' ,'booking') , 'position' => 'top' ) // Hint
|
1137 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1138 |
+
, 'action' => "mark_read_booking( get_selected_bookings_id_in_booking_listing() , 1, "
|
1139 |
. $user_bk_id . ", '" . wpbc_get_booking_locale() . "' );" // Some JavaScript to execure, for example run the function
|
1140 |
, 'class' => '' // button-secondary | button-primary
|
1141 |
, 'icon' => ''
|
1146 |
, 'attr' => array()
|
1147 |
)
|
1148 |
)
|
1149 |
+
);
|
1150 |
+
wpbc_bs_button_group( $params );
|
1151 |
}
|
1152 |
|
1153 |
|
1158 |
|
1159 |
/** View Mode Timeline - B u t t o n s */
|
1160 |
function wpbc_toolbar_btn__timeline_view_mode() {
|
1161 |
+
|
1162 |
if ((isset($_REQUEST['wh_booking_type'])) && ( strpos($_REQUEST['wh_booking_type'], ',') !== false ) )
|
1163 |
+
$is_show_resources_matrix = true;
|
1164 |
else $is_show_resources_matrix = false;
|
1165 |
|
1166 |
+
|
1167 |
+
if ( isset( $_REQUEST['view_days_num'] ) )
|
1168 |
$view_days_num = intval( $_REQUEST['view_days_num'] );
|
1169 |
else $view_days_num = get_bk_option( 'booking_view_days_num');
|
1170 |
|
1171 |
+
|
1172 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false ), array('view_days_num') );
|
1173 |
+
|
1174 |
+
|
1175 |
+
if ( ! $is_show_resources_matrix ) {
|
1176 |
+
|
1177 |
+
$params = array(
|
1178 |
'label_for' => 'calendar_overview_number_of_days_to_show' // "For" parameter of button group element
|
1179 |
, 'label' => '' //__('Calendar view mode', 'booking') // Label above the button group
|
1180 |
, 'style' => '' // CSS Style of entire div element
|
1181 |
, 'items' => array(
|
1182 |
+
array(
|
1183 |
'type' => 'button'
|
1184 |
, 'title' => __('Day', 'booking') . ' ' // Title of the button //FixIn: Flex TimeLine 1.0
|
1185 |
, 'hint' => array( 'title' => __('Show day' ,'booking') , 'position' => 'top' ) // Hint
|
1196 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1197 |
, 'attr' => array()
|
1198 |
)
|
1199 |
+
, array(
|
1200 |
'type' => 'button'
|
1201 |
, 'title' => __('Week', 'booking') . ' ' // Title of the button //FixIn: Flex TimeLine 1.0
|
1202 |
, 'hint' => array( 'title' => __('Show week' ,'booking') , 'position' => 'top' ) // Hint
|
1213 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1214 |
, 'attr' => array()
|
1215 |
)
|
1216 |
+
, array(
|
1217 |
'type' => 'button'
|
1218 |
, 'title' => __('Month', 'booking') . ' ' // Title of the button
|
1219 |
, 'hint' => array( 'title' => __('Show month' ,'booking') , 'position' => 'top' ) // Hint
|
1231 |
, 'attr' => array()
|
1232 |
)
|
1233 |
)
|
1234 |
+
);
|
1235 |
} else {
|
1236 |
|
1237 |
+
$params = array(
|
1238 |
'label_for' => 'calendar_overview_number_of_days_to_show' // "For" parameter of button group element
|
1239 |
, 'label' => '' //__('Calendar view mode:', 'booking') // Label above the button group
|
1240 |
, 'style' => '' // CSS Style of entire div element
|
1241 |
, 'items' => array(
|
1242 |
+
array(
|
1243 |
+
'type' => 'button'
|
1244 |
, 'title' => __('Day', 'booking') . ' ' // Title of the button
|
1245 |
, 'hint' => array( 'title' => __('Show day' ,'booking') , 'position' => 'top' ) // Hint
|
1246 |
, 'link' => $bk_admin_url . '&view_days_num=1' // Direct link or skip it
|
1253 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1254 |
, 'attr' => array()
|
1255 |
)
|
1256 |
+
, array(
|
1257 |
+
'type' => 'button'
|
1258 |
, 'title' => __('Week', 'booking') . ' ' // Title of the button
|
1259 |
, 'hint' => array( 'title' => __('Show week' ,'booking') , 'position' => 'top' ) // Hint
|
1260 |
, 'link' => $bk_admin_url . '&view_days_num=7' // Direct link or skip it
|
1267 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1268 |
, 'attr' => array()
|
1269 |
)
|
1270 |
+
, array(
|
1271 |
+
'type' => 'button'
|
1272 |
, 'title' => __('Month', 'booking') . ' ' // Title of the button
|
1273 |
, 'hint' => array( 'title' => __('Show month' ,'booking') , 'position' => 'top' ) // Hint
|
1274 |
, 'link' => $bk_admin_url . '&view_days_num=30' // Direct link or skip it
|
1281 |
, 'mobile_show_text' => true // Show or hide text, when viewing on Mobile devices (small window size).
|
1282 |
, 'attr' => array()
|
1283 |
)
|
1284 |
+
, array(
|
1285 |
+
'type' => 'button'
|
1286 |
, 'title' => __('2 Months', 'booking') . ' ' // Title of the button
|
1287 |
, 'hint' => array( 'title' => __('Show 2 months' ,'booking') , 'position' => 'top' ) // Hint
|
1288 |
, 'link' => $bk_admin_url . '&view_days_num=60' // Direct link or skip it
|
1296 |
, 'attr' => array()
|
1297 |
)
|
1298 |
)
|
1299 |
+
);
|
1300 |
+
|
1301 |
}
|
1302 |
wpbc_bs_button_group( $params );
|
1303 |
|
1309 |
} else {
|
1310 |
console.log('Warning! Booking Calendar. Its seems that you have deactivated loading of Bootstrap JS files at Booking Settings General page in Advanced section.')
|
1311 |
}
|
1312 |
+
</script><?php
|
1313 |
}
|
1314 |
|
1315 |
|
1316 |
/** Navigation Timeline - B u t t o n s */
|
1317 |
function wpbc_toolbar_btn__timeline_navigation() {
|
1318 |
+
|
1319 |
if ((isset($_REQUEST['wh_booking_type'])) && ( strpos($_REQUEST['wh_booking_type'], ',') !== false ) )
|
1320 |
+
$is_show_resources_matrix = true;
|
1321 |
else $is_show_resources_matrix = false;
|
1322 |
|
1323 |
+
|
1324 |
+
if ( isset( $_REQUEST['view_days_num'] ) )
|
1325 |
$view_days_num = intval( $_REQUEST['view_days_num'] );
|
1326 |
else $view_days_num = get_bk_option( 'booking_view_days_num');
|
1327 |
|
1328 |
+
|
1329 |
$bk_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false ), array('scroll_month', 'scroll_day') );
|
1330 |
+
//debuge($_REQUEST, $bk_admin_url);
|
1331 |
+
|
1332 |
// Get Data For buttons
|
1333 |
+
if (! $is_show_resources_matrix) {
|
1334 |
+
|
1335 |
switch ($view_days_num) {
|
1336 |
case '90':
|
1337 |
if (isset($_REQUEST['scroll_day'])) $scroll_day = intval( $_REQUEST['scroll_day'] );
|
1410 |
break;
|
1411 |
|
1412 |
case '30':
|
1413 |
+
case '60':
|
1414 |
case '90': //3 months
|
1415 |
if (! isset($_REQUEST['scroll_month'])) $_REQUEST['scroll_month'] = 0;
|
1416 |
$scroll_month = intval( $_REQUEST['scroll_month'] );
|
1440 |
__('Next month' ,'booking'),
|
1441 |
__('Next 3 months' ,'booking') );
|
1442 |
break;
|
1443 |
+
}
|
1444 |
}
|
1445 |
|
1446 |
+
|
1447 |
+
$params = array(
|
1448 |
'label_for' => 'calendar_overview_navigation' // "For" parameter of button group element
|
1449 |
, 'label' => '' //__('Calendar Navigation', 'booking') // Label above the button group
|
1450 |
, 'style' => '' // CSS Style of entire div element
|
1451 |
, 'items' => array(
|
1452 |
+
array(
|
1453 |
+
'type' => 'button'
|
1454 |
, 'title' => '' // Title of the button
|
1455 |
, 'hint' => array( 'title' => $scroll_titles[0] , 'position' => 'top' ) // Hint
|
1456 |
, 'link' => $bk_admin_url .$scroll_params[0] // Direct link or skip it
|
1463 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1464 |
, 'attr' => array()
|
1465 |
)
|
1466 |
+
, array(
|
1467 |
+
'type' => 'button'
|
1468 |
, 'title' => '' // Title of the button
|
1469 |
, 'hint' => array( 'title' => $scroll_titles[1] , 'position' => 'top' ) // Hint
|
1470 |
, 'link' => $bk_admin_url .$scroll_params[1] // Direct link or skip it
|
1477 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1478 |
, 'attr' => array()
|
1479 |
)
|
1480 |
+
, array(
|
1481 |
+
'type' => 'dropdown'
|
1482 |
, 'id' => 'timeline_navigation_date'
|
1483 |
, 'title' => '' // Title of the button
|
1484 |
, 'hint' => array( 'title' => __('Custom' ,'booking') , 'position' => 'top' ) // Hint
|
1490 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1491 |
, 'attr' => array()
|
1492 |
, 'options' => array(
|
1493 |
+
$scroll_titles[2] => "window.location.href='"
|
1494 |
. wpbc_get_params_in_url( wpbc_get_bookings_url( false )
|
1495 |
+
, array('scroll_month', 'scroll_day', 'scroll_start_date') )
|
1496 |
+
. $scroll_params[2] . "'"
|
1497 |
, 'divider1' => 'divider'
|
1498 |
+
, 'custom' => array( array( 'type' => 'group', 'class' => 'input-group text-group')
|
1499 |
+
, array(
|
1500 |
+
'type' => 'text'
|
1501 |
+
, 'id' => 'calendar_overview_navigation_currentdate'
|
1502 |
+
, 'name' => 'calendar_overview_navigation_currentdate'
|
1503 |
, 'label' => __('Start Date' ,'booking') . ':'
|
1504 |
, 'disabled' => false
|
1505 |
, 'class' => 'wpdevbk-filters-section-calendar'
|
1506 |
, 'style' => ''
|
1507 |
, 'placeholder' => date('Y-m-d')
|
1508 |
+
, 'attr' => array()
|
1509 |
, 'value' => ''
|
1510 |
)
|
1511 |
)
|
1512 |
+
, 'divider2' => 'divider'
|
1513 |
+
, 'buttons' => array( array( 'type' => 'group', 'class' => 'btn-group' ),
|
1514 |
+
array(
|
1515 |
+
'type' => 'button'
|
1516 |
, 'title' => __('Apply' ,'booking') // Title of the button
|
1517 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
1518 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1519 |
, 'action' => "jQuery('#calendar_overview_navigation_container').hide();
|
1520 |
+
window.location.href='"
|
1521 |
. wpbc_get_params_in_url( wpbc_get_bookings_url( false )
|
1522 |
+
, array('scroll_month', 'scroll_day', 'scroll_start_date') )
|
1523 |
. "&scroll_start_date=' + jQuery('#calendar_overview_navigation_currentdate').val();"
|
1524 |
+
|
1525 |
, 'class' => 'button-primary' // button-secondary | button-primary
|
1526 |
, 'icon' => ''
|
1527 |
, 'font_icon' => ''
|
1531 |
, 'attr' => array()
|
1532 |
|
1533 |
)
|
1534 |
+
, array(
|
1535 |
+
'type' => 'button'
|
1536 |
, 'title' => __('Close' ,'booking') // Title of the button
|
1537 |
, 'hint' => '' // , 'hint' => array( 'title' => __('Select status' ,'booking') , 'position' => 'bottom' )
|
1538 |
, 'link' => 'javascript:void(0)' // Direct link or skip it
|
1543 |
, 'icon_position' => 'left' // Position of icon relative to Text: left | right
|
1544 |
, 'style' => '' // Any CSS class here
|
1545 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1546 |
+
, 'attr' => array()
|
1547 |
)
|
1548 |
+
)
|
1549 |
+
)
|
1550 |
+
)
|
1551 |
+
, array(
|
1552 |
+
'type' => 'button'
|
1553 |
, 'title' => '' // Title of the button
|
1554 |
, 'hint' => array( 'title' => $scroll_titles[3] , 'position' => 'top' ) // Hint
|
1555 |
, 'link' => $bk_admin_url .$scroll_params[3] // Direct link or skip it
|
1562 |
, 'mobile_show_text' => false // Show or hide text, when viewing on Mobile devices (small window size).
|
1563 |
, 'attr' => array()
|
1564 |
)
|
1565 |
+
, array(
|
1566 |
+
'type' => 'button'
|
1567 |
, 'title' => '' // Title of the button
|
1568 |
, 'hint' => array( 'title' => $scroll_titles[4] , 'position' => 'top' ) // Hint
|
1569 |
, 'link' => $bk_admin_url .$scroll_params[4] // Direct link or skip it
|
1577 |
, 'attr' => array()
|
1578 |
)
|
1579 |
)
|
1580 |
+
);
|
1581 |
|
1582 |
+
wpbc_bs_button_group( $params );
|
1583 |
}
|
1584 |
|
1585 |
|
1590 |
|
1591 |
/** Genereate URL based on GET parameters */
|
1592 |
function wpbc_get_new_booking_url__base( $skip_parameters = array() ) {
|
1593 |
+
|
1594 |
$link_base = wpbc_get_new_booking_url( true, false );
|
1595 |
+
|
1596 |
$link_params = array();
|
1597 |
+
if ( ( isset( $_GET['booking_type'] ) ) && ( $_GET['booking_type'] > 0 ) ) $link_params['booking_type'] = $_GET['booking_type'];
|
1598 |
+
if ( isset( $_GET['booking_hash'] ) ) $link_params['booking_hash'] = $_GET['booking_hash'];
|
1599 |
+
if ( isset( $_GET['parent_res'] ) ) $link_params['parent_res'] = $_GET['parent_res'];
|
1600 |
if ( isset( $_GET['booking_form'] ) ) $link_params['booking_form'] = $_GET['booking_form'];
|
1601 |
if ( isset( $_GET['calendar_months_count'] ) ) $link_params['calendar_months_count'] = intval( $_GET['calendar_months_count'] );
|
1602 |
if ( isset( $_GET['calendar_months_num_in_1_row'] ) ) $link_params['calendar_months_num_in_1_row'] = intval( $_GET['calendar_months_num_in_1_row'] );
|
1603 |
|
1604 |
+
|
1605 |
foreach ( $link_params as $key => $value ) {
|
1606 |
|
1607 |
if ( ! in_array( $key, $skip_parameters) ) {
|
1608 |
$link_base .= '&' . $key . '=' . $value;
|
1609 |
}
|
1610 |
}
|
1611 |
+
|
1612 |
return $link_base;
|
1613 |
}
|
1614 |
|
1615 |
/** Selection Number of visible months */
|
1616 |
function wpbc_toolbar_btn__calendar_months_number_selection( $user_calendar_options = array() ) {
|
1617 |
+
|
1618 |
$text_label = __('Visible months' ,'booking') .':' ;
|
1619 |
|
1620 |
$form_options = array( 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12 );
|
1624 |
if ( isset( $user_calendar_options[$parameter_name] ) ) $selected_value = intval ( $user_calendar_options[ $parameter_name ] );
|
1625 |
else $selected_value = 1;
|
1626 |
|
1627 |
+
$link_base = wpbc_get_new_booking_url__base( array( $parameter_name ) ) . '&' . $parameter_name . '=' ;
|
1628 |
|
1629 |
$on_change = ''; //'location.href=\'' . $link_base . '\' + this.value;';
|
1630 |
|
1631 |
|
1632 |
+
$params = array(
|
1633 |
'label_for' => $parameter_name // "For" parameter of label element
|
1634 |
, 'label' => '' // Label above the input group
|
1635 |
, 'style' => '' // CSS Style of entire div element
|
1636 |
, 'items' => array(
|
1637 |
+
array(
|
1638 |
+
'type' => 'addon'
|
1639 |
, 'element' => 'text' // text | radio | checkbox
|
1640 |
, 'text' => $text_label
|
1641 |
, 'class' => '' // Any CSS class here
|
1642 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
1643 |
+
)
|
1644 |
+
, array(
|
1645 |
+
'type' => 'select'
|
1646 |
, 'id' => $parameter_name // HTML ID of element
|
1647 |
+
, 'options' => $form_options // Associated array of titles and values
|
1648 |
+
, 'value' => $selected_value // Some Value from optins array that selected by default
|
1649 |
, 'style' => '' // CSS of select element
|
1650 |
, 'class' => '' // CSS Class of select element
|
1651 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1652 |
+
, 'onchange' => $on_change
|
1653 |
)
|
1654 |
)
|
1655 |
+
);
|
1656 |
+
?><div class="control-group wpbc-no-padding" style="width:auto;"><?php
|
1657 |
+
wpbc_bs_input_group( $params );
|
1658 |
+
?></div><?php
|
1659 |
}
|
1660 |
|
1661 |
|
1664 |
|
1665 |
$text_label = __('Number of months in one row' ,'booking') . ':';
|
1666 |
$form_options = array( 0 => __('All', 'booking'), 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12 );
|
1667 |
+
|
1668 |
$parameter_name = 'calendar_months_num_in_1_row';
|
1669 |
|
1670 |
if ( isset( $user_calendar_options[$parameter_name] ) ) $selected_value = intval ( $user_calendar_options[ $parameter_name ] );
|
1671 |
else $selected_value = 0;
|
1672 |
+
|
1673 |
+
$link_base = wpbc_get_new_booking_url__base( array( $parameter_name ) ) . '&' . $parameter_name . '=' ;
|
1674 |
|
1675 |
$on_change = ''; // 'location.href=\'' . $link_base . '\' + this.value;';
|
1676 |
|
1677 |
|
1678 |
+
$params = array(
|
1679 |
'label_for' => $parameter_name // "For" parameter of label element
|
1680 |
, 'label' => '' // Label above the input group
|
1681 |
, 'style' => '' // CSS Style of entire div element
|
1682 |
, 'items' => array(
|
1683 |
+
array(
|
1684 |
+
'type' => 'addon'
|
1685 |
, 'element' => 'text' // text | radio | checkbox
|
1686 |
, 'text' => $text_label
|
1687 |
, 'class' => '' // Any CSS class here
|
1688 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
1689 |
+
)
|
1690 |
+
, array(
|
1691 |
+
'type' => 'select'
|
1692 |
, 'id' => $parameter_name // HTML ID of element
|
1693 |
+
, 'options' => $form_options // Associated array of titles and values
|
1694 |
+
, 'value' => $selected_value // Some Value from optins array that selected by default
|
1695 |
, 'style' => '' // CSS of select element
|
1696 |
, 'class' => '' // CSS Class of select element
|
1697 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1698 |
+
, 'onchange' => $on_change
|
1699 |
)
|
1700 |
)
|
1701 |
+
);
|
1702 |
+
?><div class="control-group wpbc-no-padding"><?php
|
1703 |
+
wpbc_bs_input_group( $params );
|
1704 |
+
?></div><?php
|
1705 |
}
|
1706 |
|
1707 |
|
1708 |
function wpbc_toolbar_btn__calendar_width( $user_calendar_options = array() ){
|
1709 |
+
|
1710 |
$text_label = __('Calendar width' ,'booking') . ':';
|
1711 |
$parameter_name = 'calendar_width';
|
1712 |
+
|
1713 |
if ( isset( $user_calendar_options[$parameter_name] ) ) $selected_value = intval( $user_calendar_options[ $parameter_name ] );
|
1714 |
else $selected_value = '';
|
1715 |
+
|
1716 |
if ( isset( $user_calendar_options[$parameter_name . 'units'] ) ) $selected_value_units = esc_attr( $user_calendar_options[ $parameter_name . 'units' ] );
|
1717 |
else $selected_value_units = '';
|
1718 |
+
|
1719 |
+
$params = array(
|
1720 |
'label_for' => $parameter_name // "For" parameter of label element
|
1721 |
, 'label' => '' // Label above the input group
|
1722 |
, 'style' => '' // CSS Style of entire div element
|
1723 |
, 'items' => array(
|
1724 |
+
array(
|
1725 |
+
'type' => 'addon'
|
1726 |
, 'element' => 'text' // text | radio | checkbox
|
1727 |
, 'text' => $text_label
|
1728 |
, 'class' => '' // Any CSS class here
|
1729 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
1730 |
+
)
|
1731 |
+
, array(
|
1732 |
+
'type' => 'text'
|
1733 |
, 'id' => $parameter_name // HTML ID of element
|
1734 |
+
, 'value' => $selected_value // Some Value from optins array that selected by default
|
1735 |
, 'style' => 'width: 5em;' // CSS of select element
|
1736 |
, 'placeholder' => '100%'
|
1737 |
, 'class' => '' // CSS Class of select element
|
1738 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1739 |
)
|
1740 |
+
, array(
|
1741 |
+
'type' => 'select'
|
1742 |
, 'id' => $parameter_name . 'units' // HTML ID of element
|
1743 |
+
, 'options' => array( 'px' => 'px', 'percent' => '%' ) // Associated array of titles and values
|
1744 |
+
, 'value' => $selected_value_units // Some Value from optins array that selected by default
|
1745 |
, 'style' => 'width: 5em;' // CSS of select element
|
1746 |
, 'class' => '' // CSS Class of select element
|
1747 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1748 |
+
)
|
1749 |
)
|
1750 |
+
);
|
1751 |
+
?><div class="control-group wpbc-no-padding"><?php
|
1752 |
+
wpbc_bs_input_group( $params );
|
1753 |
+
?></div><?php
|
1754 |
}
|
1755 |
+
|
1756 |
function wpbc_toolbar_btn__calendar_cell_height( $user_calendar_options = array() ){
|
1757 |
+
|
1758 |
$text_label = __('Calendar cell height' ,'booking') . ':';
|
1759 |
$parameter_name = 'calendar_cell_height';
|
1760 |
+
|
1761 |
if ( isset( $user_calendar_options[$parameter_name] ) ) $selected_value = intval( $user_calendar_options[ $parameter_name ] );
|
1762 |
else $selected_value = '';
|
1763 |
|
1764 |
if ( isset( $user_calendar_options[$parameter_name . 'units'] ) ) $selected_value_units = esc_attr( $user_calendar_options[ $parameter_name . 'units' ] );
|
1765 |
else $selected_value_units = '';
|
1766 |
+
|
1767 |
+
$params = array(
|
1768 |
'label_for' => $parameter_name // "For" parameter of label element
|
1769 |
, 'label' => '' // Label above the input group
|
1770 |
, 'style' => '' // CSS Style of entire div element
|
1771 |
, 'items' => array(
|
1772 |
+
array(
|
1773 |
+
'type' => 'addon'
|
1774 |
, 'element' => 'text' // text | radio | checkbox
|
1775 |
, 'text' => $text_label
|
1776 |
, 'class' => '' // Any CSS class here
|
1777 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
1778 |
+
)
|
1779 |
+
, array(
|
1780 |
+
'type' => 'text'
|
1781 |
, 'id' => $parameter_name // HTML ID of element
|
1782 |
+
, 'value' => $selected_value // Some Value from optins array that selected by default
|
1783 |
, 'style' => 'width: 5em;' // CSS of select element
|
1784 |
, 'placeholder' => '39px'
|
1785 |
, 'class' => '' // CSS Class of select element
|
1786 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1787 |
)
|
1788 |
+
, array(
|
1789 |
+
'type' => 'select'
|
1790 |
, 'id' => $parameter_name . 'units' // HTML ID of element
|
1791 |
+
, 'options' => array( 'px' => 'px', 'percent' => '%' ) // Associated array of titles and values
|
1792 |
+
, 'value' => $selected_value_units // Some Value from optins array that selected by default
|
1793 |
, 'style' => 'width: 5em;' // CSS of select element
|
1794 |
, 'class' => '' // CSS Class of select element
|
1795 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
1796 |
+
)
|
1797 |
+
|
1798 |
)
|
1799 |
+
);
|
1800 |
+
?><div class="control-group wpbc-no-padding"><?php
|
1801 |
+
wpbc_bs_input_group( $params );
|
1802 |
+
?></div><?php
|
1803 |
}
|
1804 |
|
1805 |
|
1806 |
/** Add New Booking Button*/
|
1807 |
function wpbc_toolbar_btn__calendar_options_save() {
|
1808 |
+
|
1809 |
+
?><div class="control-group wpbc-no-padding"><?php
|
1810 |
+
?><a
|
1811 |
+
class="button button-primary "
|
1812 |
href="javascript:void(0)"
|
1813 |
onclick="javascript:var data_params = {};
|
1814 |
data_params.calendar_months_count = jQuery('#calendar_months_count').val();
|
1821 |
wpbc_save_custom_user_data(<?php echo get_wpbc_current_user_id(); ?>
|
1822 |
, '<?php echo 'add_booking_calendar_options'; ?>'
|
1823 |
, ajax_data_params
|
1824 |
+
, 1
|
1825 |
+
);"
|
1826 |
+
><?php _e('Save Changes' , 'booking') ?></a><?php
|
1827 |
+
?></div><?php
|
1828 |
}
|
1829 |
|
1830 |
|
1835 |
if ( isset( $_GET['booking_type'] ) )
|
1836 |
$bk_type = intval ( $_GET['booking_type'] );
|
1837 |
else $bk_type = 1;
|
1838 |
+
|
1839 |
+
?><a
|
1840 |
+
class="button button-primary wpbc_submit_button"
|
1841 |
href="javascript:void(0)"
|
1842 |
+
onclick="mybooking_submit(
|
1843 |
document.getElementById('booking_form<?php echo $bk_type; ?>' )
|
1844 |
, <?php echo $bk_type; ?>
|
1845 |
+
, '<?php echo wpbc_get_booking_locale(); ?>'
|
1846 |
+
);"
|
1847 |
+
><?php _e('Add booking' , 'booking') ?></a><?php
|
1848 |
}
|
1849 |
|
1850 |
|
1851 |
/** Checkbox - sending emails or not - duplicated button, usually at the bottom of page*/
|
1852 |
function wpbc_toolbar_is_send_emails_btn_duplicated() {
|
1853 |
+
|
1854 |
?>
|
1855 |
<div class="btn-group" style="color:#888;">
|
1856 |
<fieldset>
|
1860 |
<?php if ( get_bk_option('booking_send_emails_off_addbooking') === 'On' ) { } else { //FixIn: 8.4.5.4 ?>
|
1861 |
checked="CHECKED"
|
1862 |
<?php } ?>
|
1863 |
+
id="is_send_email_for_new_booking"
|
1864 |
+
name="is_send_email_for_new_booking"
|
1865 |
+
class="tooltip_top"
|
1866 |
style="margin:0 4px 2px;"
|
1867 |
title="<?php echo esc_js( __( 'Send email notification to customer about this operation', 'booking' ) ); ?>"
|
1868 |
/><?php _e( 'Send email notification to customer about this operation', 'booking' ) ?>
|
1879 |
<?php } ?>
|
1880 |
});
|
1881 |
|
1882 |
+
jQuery( '#is_send_email_for_pending' ).change(function() {
|
1883 |
+
//FixIn: 8.7.9.5
|
1884 |
+
if ( jQuery( '#is_send_email_for_pending' ).is( ':checked' ) ){
|
1885 |
+
document.getElementById( 'is_send_email_for_new_booking' ).checked = true;
|
1886 |
+
} else {
|
1887 |
+
document.getElementById( 'is_send_email_for_new_booking' ).checked = false;
|
1888 |
+
}
|
1889 |
+
});
|
1890 |
</script>
|
1891 |
+
<?php
|
1892 |
}
|
1893 |
|
1894 |
|
1895 |
/**
|
1896 |
* Show Link (button) for adding booking to Google Calendar
|
1897 |
+
*
|
1898 |
* @param int $booking_id
|
1899 |
* @param array $button_attr
|
1900 |
* @param bool $echo
|
1901 |
* @return string
|
1902 |
*/
|
1903 |
function wpbc_btn_add_booking_to_google_calendar( $booking_data, $button_attr = array(), $echo = true ) { //FixIn: 7.1.2.5
|
1904 |
+
|
1905 |
+
//debuge($booking_data);
|
1906 |
if ( ! $echo ) {
|
1907 |
ob_start();
|
1908 |
}
|
1909 |
+
|
1910 |
$defaults = array(
|
1911 |
'title' => __( 'Add to Google Calendar', 'booking' )
|
1912 |
, 'hint' => __( 'Add to Google Calendar', 'booking' )
|
1915 |
, 'is_only_url' => false
|
1916 |
);
|
1917 |
$button_attr = wp_parse_args( $button_attr, $defaults );
|
1918 |
+
|
1919 |
$params = array();
|
1920 |
$params['timezone'] = get_bk_option('booking_gcal_timezone');
|
1921 |
|
1922 |
+
$booking_gcal_events_form_fields = get_bk_option( 'booking_gcal_events_form_fields');
|
1923 |
+
if ( is_serialized( $booking_gcal_events_form_fields ) )
|
1924 |
+
$booking_gcal_events_form_fields = unserialize( $booking_gcal_events_form_fields );
|
1925 |
|
1926 |
/**
|
1927 |
* Array
|
1931 |
[where] => text^
|
1932 |
)
|
1933 |
*/
|
1934 |
+
|
1935 |
+
|
1936 |
// Fields
|
1937 |
$fields = array( 'title' => '', 'description' => '', 'where' => '' );
|
1938 |
|
1945 |
$field_name = $field_name[ ( count( $field_name ) - 1 ) ]; //FixIn: 8.7.7.6
|
1946 |
|
1947 |
if ( (! empty($field_name))
|
1948 |
+
&& (! empty($booking_data['form_data']))
|
1949 |
&& (! empty($booking_data['form_data']['_all_fields_']))
|
1950 |
&& (! empty($booking_data['form_data']['_all_fields_'][ $field_name ]))
|
1951 |
) {
|
1967 |
}
|
1968 |
}
|
1969 |
//debuge($booking_gcal_events_form_fields, $fields,$booking_data['form_data']);
|
1970 |
+
|
1971 |
// Dates.
|
1972 |
+
|
1973 |
$check_in_timestamp = $check_out_timestamp = '';
|
1974 |
if ( ! empty( $booking_data[ 'dates_short' ] ) ) {
|
|
|
1975 |
|
1976 |
+
|
1977 |
+
/* all day events, you can use 20161208/20161209 - note that the old google documentation gets it wrong.
|
1978 |
+
* You must use the following date as the end date for a one day all day event,
|
1979 |
+
* or +1 day to whatever you want the end date to be.
|
1980 |
*/
|
1981 |
+
|
1982 |
$check_in_timestamp = strtotime( $booking_data[ 'dates_short' ][ 0 ], current_time( 'timestamp' ) );
|
1983 |
if ( trim( substr( $booking_data[ 'dates_short' ][ 0 ], 11 ) ) == '00:00:00' ) {
|
1984 |
$check_in_timestamp = date( "Ymd", $check_in_timestamp ); // All day
|
1995 |
$check_out_timestamp = date( "Ymd\THis", $check_out_timestamp );
|
1996 |
//$check_out_timestamp = date( "Ymd\THis\Z", $check_out_timestamp );
|
1997 |
}
|
1998 |
+
|
1999 |
}
|
2000 |
|
2001 |
+
//debuge($check_in_timestamp,$check_out_timestamp, $fields );die;
|
2002 |
//Convert an ISO date/time to a UNIX timestamp
|
2003 |
//function iso_to_ts( $iso ) {
|
2004 |
// sscanf( $iso, "%u-%u-%uT%u:%u:%uZ", $year, $month, $day, $hour, $minute, $second );
|
2005 |
// return mktime( $hour, $minute, $second, $month, $day, $year );
|
2006 |
// 20140127T224000Z
|
2007 |
// date("Ymd\THis\Z", time());
|
2008 |
+
|
2009 |
/**
|
2010 |
action:
|
2011 |
action=TEMPLATE
|
2041 |
Example: sprop=name:Home%20Page
|
2042 |
Format: sprop=website and/or sprop=name:website_name
|
2043 |
*/
|
2044 |
+
|
2045 |
// $link_add2gcal = 'http://www.google.com/calendar/event?action=TEMPLATE';
|
2046 |
// $link_add2gcal .= '&text=' . $fields['title'];
|
2047 |
//FixIn: 8.7.3.10
|
2065 |
if ( $button_attr['is_only_url'] ) {
|
2066 |
echo $link_add2gcal;
|
2067 |
} else {
|
2068 |
+
|
2069 |
+
?><a href="<?php echo $link_add2gcal; ?>" target="_blank" rel="nofollow"
|
2070 |
+
class="tooltip_top <?php echo esc_attr( $button_attr['class'] ) ?>"
|
2071 |
title="<?php echo esc_js( $button_attr['hint'] ); ?>"
|
2072 |
+
><?php
|
2073 |
+
if ( $button_attr['is_show_icon'] ) {
|
2074 |
+
?><i class="glyphicon icon-1x glyphicon-export"></i><?php
|
2075 |
} else {
|
2076 |
echo esc_js( $button_attr['title'] );
|
2077 |
}
|
2078 |
+
?></a><?php
|
2079 |
}
|
2080 |
+
|
2081 |
if ( ! $echo ) {
|
2082 |
+
return ob_get_clean();
|
2083 |
}
|
2084 |
+
|
2085 |
}
|
2086 |
////////////////////////////////////////////////////////////////////////////////
|
2087 |
// Toolbar Other UI elements - General
|
2088 |
////////////////////////////////////////////////////////////////////////////////
|
2089 |
+
|
2090 |
/**
|
2091 |
* Selection elements in toolbar UI selectbox
|
2092 |
+
*
|
2093 |
* @param array $params
|
2094 |
+
*
|
2095 |
* Exmaple:
|
2096 |
wpbc_toolbar_btn__selection_element( array(
|
2097 |
'name' => 'resources_count'
|
2098 |
, 'title' => __('Resources count' ,'booking') . ':'
|
2099 |
+
, 'selected' => 1
|
2100 |
+
, 'options' => array_combine( range(1, 201) ,range(1, 201) )
|
2101 |
+
) ) ;
|
2102 |
|
2103 |
+
*/
|
2104 |
function wpbc_toolbar_btn__selection_element( $params ) {
|
2105 |
+
|
2106 |
+
$defaults = array(
|
2107 |
'name' => 'random_' . rand( 1000, 10000 )
|
2108 |
, 'title' => __('Total', 'booking') . ':'
|
2109 |
+
, 'on_change' => '' //'location.href=\'' . $link_base . '\' + this.value;'; //$link_base = wpbc_get_new_booking_url__base( array( $params['name'] ) ) . '&' . $params['name'] . '=' ;
|
2110 |
, 'options' => array()
|
2111 |
, 'selected' => 0
|
2112 |
);
|
2113 |
$params = wp_parse_args( $params, $defaults );
|
2114 |
+
|
2115 |
+
|
2116 |
+
|
2117 |
|
2118 |
for ( $i = 1; $i < 201; $i++ ) {
|
2119 |
$form_options[ $i ] = $i;
|
2120 |
}
|
2121 |
|
2122 |
+
$params = array(
|
2123 |
'label_for' => $params['name'] // "For" parameter of label element
|
2124 |
, 'label' => '' // Label above the input group
|
2125 |
, 'style' => '' // CSS Style of entire div element
|
2126 |
, 'items' => array(
|
2127 |
+
array(
|
2128 |
+
'type' => 'addon'
|
2129 |
, 'element' => 'text' // text | radio | checkbox
|
2130 |
, 'text' => $params['title']
|
2131 |
, 'class' => '' // Any CSS class here
|
2132 |
, 'style' => 'font-weight:600;' // CSS Style of entire div element
|
2133 |
+
)
|
2134 |
+
, array(
|
2135 |
+
'type' => 'select'
|
2136 |
, 'id' => $params['name'] // HTML ID of element
|
2137 |
, 'name' => $params['name'] // HTML ID of element
|
2138 |
+
, 'options' => $params['options'] // Associated array of titles and values
|
2139 |
+
, 'value' => $params['selected'] // Some Value from optins array that selected by default
|
2140 |
, 'style' => '' // CSS of select element
|
2141 |
, 'class' => '' // CSS Class of select element
|
2142 |
+
, 'attr' => array() // Any additional attributes, if this radio | checkbox element
|
2143 |
, 'onchange' => $params['on_change']
|
2144 |
)
|
2145 |
)
|
2146 |
+
);
|
2147 |
+
?><div class="control-group wpbc-no-padding"><?php
|
2148 |
+
wpbc_bs_input_group( $params );
|
2149 |
+
?></div><?php
|
2150 |
}
|
2151 |
|
2152 |
|
2185 |
|
2186 |
/**
|
2187 |
* Real Search booking data by ID | Title (at top right side of page)
|
2188 |
+
*
|
2189 |
* @param array $params - array of parameters
|
2190 |
* Exmaple:
|
2191 |
+
wpbc_toolbar_search_by_id__top_form( array(
|
2192 |
'search_form_id' => 'wpbc_seasonfilters_search_form'
|
2193 |
, 'search_get_key' => 'wh_search_id'
|
2194 |
, 'is_pseudo' => false
|
2196 |
|
2197 |
*/
|
2198 |
function wpbc_toolbar_search_by_id__top_form( $params ) {
|
2199 |
+
|
2200 |
+
$defaults = array(
|
2201 |
'search_form_id' => 'wpbc_seasonfilters_search_form'
|
2202 |
, 'search_get_key' => 'wh_search_id'
|
2203 |
+
, 'is_pseudo' => false //'location.href=\'' . $link_base . '\' + this.value;'; //$link_base = wpbc_get_new_booking_url__base( array( $params['name'] ) ) . '&' . $params['name'] . '=' ;
|
2204 |
);
|
2205 |
$params = wp_parse_args( $params, $defaults );
|
2206 |
+
|
2207 |
+
|
2208 |
$exclude_params = array(); //array('page_num', 'orderby', 'order'); - if using "only_these_parameters", then this parameter does NOT require
|
2209 |
$only_these_parameters = array( 'page', 'tab', 'subtab', $params[ 'search_get_key' ] ); //FixIn: 8.1.1.11 - added , 'subtab' - ability to search booking resources in sub tab pages in settings
|
2210 |
$wpbc_admin_url = wpbc_get_params_in_url( wpbc_get_bookings_url( false, false ), $exclude_params, $only_these_parameters );
|
2211 |
+
|
2212 |
+
|
2213 |
+
$search_form_value = '';
|
2214 |
if ( isset( $_REQUEST[ $params[ 'search_get_key' ] ] ) ) {
|
2215 |
+
$wh_resource_id = wpbc_clean_digit_or_csd( $_REQUEST[ $params[ 'search_get_key' ] ] ); // '12,0,45,9' or '10'
|
2216 |
$wh_resource_title = wpbc_clean_string_for_form( $_REQUEST[ $params[ 'search_get_key' ] ] ); // Clean string
|
2217 |
if ( ! empty( $wh_resource_id ) ) {
|
2218 |
$search_form_value = $wh_resource_id;
|
2219 |
} else {
|
2220 |
$search_form_value = $wh_resource_title;
|
2221 |
+
}
|
2222 |
+
}
|
2223 |
+
|
2224 |
+
|
2225 |
wpbc_clear_div();
|
2226 |
+
|
2227 |
?>
|
2228 |
<span class="wpdevelop">
|
2229 |
+
|
2230 |
<?php if ( ! $params['is_pseudo'] ) { ?>
|
2231 |
<div style="position: absolute; right: 20px; top: 10px;">
|
2232 |
<form action="<?php echo $wpbc_admin_url; ?>" method="post" id="<?php echo $params[ 'search_form_id' ]; ?>" name="<?php echo $params[ 'search_form_id' ]; ?>" >
|
2233 |
+
<?php
|
2234 |
} else {
|
2235 |
?><div style="float:right;" id="<?php echo $params['search_form_id'] . '_pseudo'; ?>"><?php
|
2236 |
}
|
2237 |
+
|
2238 |
$params_for_element = array( 'label_for' => $params[ 'search_get_key' ] . ( ( $params['is_pseudo'] ) ? '_pseudo' : '' )
|
2239 |
, 'label' => ''//__('Keyword:', 'booking')
|
2240 |
, 'items' => array(
|
2241 |
array( 'type' => 'text'
|
2242 |
, 'id' => $params[ 'search_get_key' ] . ( ( $params['is_pseudo'] ) ? '_pseudo' : '' )
|
2243 |
, 'value' => $search_form_value
|
2244 |
+
, 'placeholder' => __('ID or Title', 'booking')
|
2245 |
+
)
|
2246 |
+
, array(
|
2247 |
'type' => 'button'
|
2248 |
, 'title' => __('Go', 'booking')
|
2249 |
+
, 'class' => 'button-secondary'
|
2250 |
, 'font_icon' => 'glyphicon glyphicon-search'
|
2251 |
, 'icon_position' => 'right'
|
2252 |
+
, 'action' => ( ( ! $params['is_pseudo'] ) ? "jQuery('#". $params[ 'search_form_id' ] ."').submit();"
|
2253 |
: "jQuery('#" . $params[ 'search_get_key' ] . "').val( jQuery('#" . $params[ 'search_get_key' ] . "_pseudo').val() ); jQuery('#". $params[ 'search_form_id' ] ."').submit();" ) //Submit real form at the top of page.
|
2254 |
+
)
|
2255 |
)
|
2256 |
+
);
|
2257 |
+
|
2258 |
?><div class="control-group wpbc-no-padding" ><?php
|
2259 |
+
wpbc_bs_input_group( $params_for_element );
|
2260 |
?></div><?php
|
2261 |
+
|
2262 |
if ( ! $params['is_pseudo'] ) { ?>
|
2263 |
</form>
|
2264 |
<?php } ?>
|
2265 |
<?php wpbc_clear_div(); ?>
|
2266 |
+
|
2267 |
+
<?php
|
2268 |
+
if ( $params['is_pseudo'] ) {
|
2269 |
// Required for opening specific page NUM during saving ////////
|
2270 |
+
?><input type="hidden" value="<?php echo $search_form_value; ?>" name="<?php echo $params[ 'search_get_key' ]; ?>" /><?php
|
2271 |
?><div class="clear" style="height:20px;"></div><?php
|
2272 |
}
|
2273 |
?>
|
2274 |
</div>
|
2275 |
</span>
|
2276 |
+
<?php
|
2277 |
+
|
2278 |
+
if ( $params['is_pseudo'] ) {
|
2279 |
+
|
2280 |
+
// Hide pseudo form, if real search form does not exist
|
2281 |
?>
|
2282 |
<script type="text/javascript">
|
2283 |
jQuery(document).ready(function(){
|
2284 |
if ( jQuery('#<?php echo $params[ 'search_form_id' ]; ?>').length == 0 ) {
|
2285 |
jQuery('#<?php echo $params['search_form_id'] . '_pseudo'; ?>').hide();
|
2286 |
+
}
|
2287 |
});
|
2288 |
</script>
|
2289 |
+
<?php
|
2290 |
}
|
2291 |
}
|
2292 |
|
2293 |
|
2294 |
+
////////////////////////////////////////////////////////////////////////////////
|
2295 |
// M o d a l s
|
2296 |
////////////////////////////////////////////////////////////////////////////////
|
2297 |
|
2298 |
+
/** Start Loyouts - Modal Window structure */
|
2299 |
function wpbc_write_content_for_modals_start_here() {
|
2300 |
+
|
2301 |
?><span id="wpbc_content_for_modals"></span><?php
|
2302 |
}
|
2303 |
+
add_bk_action( 'wpbc_write_content_for_modals', 'wpbc_write_content_for_modals_start_here');
|
2304 |
|
2305 |
|
2306 |
////////////////////////////////////////////////////////////////////////////////
|
2309 |
|
2310 |
/** Load suport JavaScript for "Bookings" page*/
|
2311 |
function wpbc_js_for_bookings_page() {
|
2312 |
+
|
2313 |
$is_use_hints = get_bk_option( 'booking_is_use_hints_at_admin_panel' );
|
2314 |
if ( $is_use_hints == 'On' )
|
2315 |
wpbc_bs_javascript_tooltips(); // JS Tooltips
|
2316 |
|
2317 |
+
wpbc_bs_javascript_popover(); // JS Popover
|
2318 |
+
|
2319 |
wpbc_datepicker_js(); // JS Datepicker
|
2320 |
wpbc_datepicker_css(); // CSS DatePicker
|
2321 |
}
|
2323 |
|
2324 |
/** Datepicker activation JavaScript */
|
2325 |
function wpbc_datepicker_js() {
|
2326 |
+
|
2327 |
?><script type="text/javascript">
|
2328 |
jQuery(document).ready( function(){
|
2329 |
|
2330 |
function applyCSStoDays( date ){
|
2331 |
+
return [true, 'date_available'];
|
2332 |
}
|
2333 |
jQuery('input.wpdevbk-filters-section-calendar').datepick(
|
2334 |
{ beforeShowDay: applyCSStoDays,
|
2341 |
dateFormat: 'yy-mm-dd',
|
2342 |
changeMonth: false,
|
2343 |
changeYear: false,
|
2344 |
+
minDate: null,
|
2345 |
maxDate: null, //'1Y',
|
2346 |
showStatus: false,
|
2347 |
multiSeparator: ', ',
|
2354 |
}
|
2355 |
);
|
2356 |
});
|
2357 |
+
</script><?php
|
2358 |
}
|
2359 |
|
2360 |
|
2392 |
}
|
2393 |
</style>
|
2394 |
<?php
|
2395 |
+
}
|
2396 |
|
2397 |
|
2398 |
/** Sortable Table JavaScript */
|
2399 |
function wpbc_sortable_js() {
|
2400 |
?>
|
2401 |
+
<script type="text/javascript">
|
2402 |
+
// Activate Sortable Functionality
|
2403 |
jQuery( document ).ready(function(){
|
2404 |
|
2405 |
jQuery('.wpbc_input_table tbody th').css('cursor','move');
|
2425 |
});
|
2426 |
</script>
|
2427 |
<?php
|
2428 |
+
|
2429 |
}
|
core/any/css/admin-listing-table.css
CHANGED
@@ -210,7 +210,10 @@
|
|
210 |
|
211 |
/* C U S T O M ****************************************************************/
|
212 |
|
213 |
-
/* New Label */
|
|
|
|
|
|
|
214 |
.wpbc-listing-collumn.new-label {
|
215 |
margin: 5px 0 0 -32px;
|
216 |
position: absolute !important;
|
210 |
|
211 |
/* C U S T O M ****************************************************************/
|
212 |
|
213 |
+
/* New Label //FixIn 8.7.9.6 */
|
214 |
+
.new-label {
|
215 |
+
display: block;
|
216 |
+
}
|
217 |
.wpbc-listing-collumn.new-label {
|
218 |
margin: 5px 0 0 -32px;
|
219 |
position: absolute !important;
|
core/any/js/admin-support.js
CHANGED
@@ -587,8 +587,9 @@ function wpbc_reload_page_with_paramater( url, param, value ) {
|
|
587 |
window.location.href = parser.href;
|
588 |
}
|
589 |
|
|
|
|
|
590 |
|
591 |
-
jQuery(window).load(function(){
|
592 |
|
593 |
// Color Text picker ///////////////////////////////////////////////////////
|
594 |
if ( jQuery('.field-text-color').length > 0 ) {
|
587 |
window.location.href = parser.href;
|
588 |
}
|
589 |
|
590 |
+
// jQuery(window).load(function(){
|
591 |
+
jQuery( window ).on( "load", function (){ //FixIn: 8.7.9.7
|
592 |
|
|
|
593 |
|
594 |
// Color Text picker ///////////////////////////////////////////////////////
|
595 |
if ( jQuery('.field-text-color').length > 0 ) {
|
core/timeline/v2/css/timeline_v2.css
CHANGED
@@ -468,7 +468,7 @@
|
|
468 |
.popover-content .wpbc-popover-content-data .wpbc-popover-booking-data,
|
469 |
.popover-content .wpbc-popover-content-data .wpbc-popover-booking-notes,
|
470 |
.popover-content .wpbc-popover-content-data .booking-dates{
|
471 |
-
flex: 1 1
|
472 |
}
|
473 |
.popover-content .flex-popover-content-data .flex-popover-bars {
|
474 |
display:flex;
|
@@ -477,6 +477,7 @@
|
|
477 |
}
|
478 |
.popover-content .flex-popover-content-data .flex-popover-bars .flex-popover-labels-bar{
|
479 |
flex: 1 1 0;
|
|
|
480 |
}
|
481 |
.popover-content .flex-popover-content-data .flex-popover-bars .flex-popover-cost-bar {
|
482 |
flex: none;
|
468 |
.popover-content .wpbc-popover-content-data .wpbc-popover-booking-data,
|
469 |
.popover-content .wpbc-popover-content-data .wpbc-popover-booking-notes,
|
470 |
.popover-content .wpbc-popover-content-data .booking-dates{
|
471 |
+
flex: 1 1 auto; /* //FixIn: 8.7.9.4 */
|
472 |
}
|
473 |
.popover-content .flex-popover-content-data .flex-popover-bars {
|
474 |
display:flex;
|
477 |
}
|
478 |
.popover-content .flex-popover-content-data .flex-popover-bars .flex-popover-labels-bar{
|
479 |
flex: 1 1 0;
|
480 |
+
clear: both;
|
481 |
}
|
482 |
.popover-content .flex-popover-content-data .flex-popover-bars .flex-popover-cost-bar {
|
483 |
flex: none;
|
core/timeline/v2/wpbc-class-timeline_v2.php
CHANGED
@@ -2804,10 +2804,12 @@ if(1)
|
|
2804 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2805 |
// Booking Data
|
2806 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2807 |
-
|
2808 |
// Booking Data
|
|
|
2809 |
$content_text .= '<div class=\'flex-popover-booking-data\'>' . esc_textarea( $bookings[$bk_id]->form_show ) . '</div>'; //FixIn: 7.1.1.2
|
2810 |
-
|
|
|
2811 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2812 |
// Notes
|
2813 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2804 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2805 |
// Booking Data
|
2806 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2807 |
+
|
2808 |
// Booking Data
|
2809 |
+
$content_text .= '<div class=\'clear\'></div>'; //FixIn: 8.7.9.4
|
2810 |
$content_text .= '<div class=\'flex-popover-booking-data\'>' . esc_textarea( $bookings[$bk_id]->form_show ) . '</div>'; //FixIn: 7.1.1.2
|
2811 |
+
$content_text .= '<div class=\'clear\'></div>'; //FixIn: 8.7.9.4
|
2812 |
+
|
2813 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
2814 |
// Notes
|
2815 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
core/wpbc-activation.php
CHANGED
@@ -676,11 +676,14 @@ function wpbc_booking_activate() {
|
|
676 |
}
|
677 |
// End: 6.1.1.10
|
678 |
|
|
|
679 |
if ( ! wpbc_is_table_exists('bookingdates') ) { // Check if tables not exist yet
|
680 |
$simple_sql = "CREATE TABLE {$wpdb->prefix}bookingdates (
|
|
|
681 |
booking_id bigint(20) unsigned NOT NULL,
|
682 |
booking_date datetime NOT NULL default '0000-00-00 00:00:00',
|
683 |
-
approved bigint(20) unsigned NOT NULL default 0
|
|
|
684 |
) {$charset_collate}";
|
685 |
$wpdb->query( $simple_sql );
|
686 |
|
676 |
}
|
677 |
// End: 6.1.1.10
|
678 |
|
679 |
+
//FixIn: 8.7.9.1
|
680 |
if ( ! wpbc_is_table_exists('bookingdates') ) { // Check if tables not exist yet
|
681 |
$simple_sql = "CREATE TABLE {$wpdb->prefix}bookingdates (
|
682 |
+
booking_dates_id bigint(20) unsigned NOT NULL auto_increment,
|
683 |
booking_id bigint(20) unsigned NOT NULL,
|
684 |
booking_date datetime NOT NULL default '0000-00-00 00:00:00',
|
685 |
+
approved bigint(20) unsigned NOT NULL default 0,
|
686 |
+
PRIMARY KEY (booking_dates_id)
|
687 |
) {$charset_collate}";
|
688 |
$wpdb->query( $simple_sql );
|
689 |
|
core/wpbc-js.php
CHANGED
@@ -179,8 +179,7 @@ function wpbc_js_load_files( $where_to_load ) {
|
|
179 |
wp_enqueue_script( 'wpdevelop-bootstrap', wpbc_plugin_url( '/assets/libs/bootstrap/js/bootstrap.js' ), array( 'wpbc-global-vars' ), '3.3.5.1');
|
180 |
}
|
181 |
|
182 |
-
|
183 |
-
wp_enqueue_script( 'wpbc-migrate', wpbc_plugin_url( '/js/wpbc-migrate.js'), array( 'jquery' ), '1.1' ); //FixIn: 8.4.7.23 //FixIn: 8.3.1.3 //FixIn: 8.2.1.29
|
184 |
|
185 |
// Datepicker
|
186 |
wp_enqueue_script( 'wpbc-datepick', wpbc_plugin_url( '/js/datepick/jquery.datepick.js'), array( 'wpbc-global-vars' ), '1.1');
|
179 |
wp_enqueue_script( 'wpdevelop-bootstrap', wpbc_plugin_url( '/assets/libs/bootstrap/js/bootstrap.js' ), array( 'wpbc-global-vars' ), '3.3.5.1');
|
180 |
}
|
181 |
|
182 |
+
//FixIn: 8.7.9.12
|
|
|
183 |
|
184 |
// Datepicker
|
185 |
wp_enqueue_script( 'wpbc-datepick', wpbc_plugin_url( '/js/datepick/jquery.datepick.js'), array( 'wpbc-global-vars' ), '1.1');
|
js/admin.js
CHANGED
@@ -250,9 +250,9 @@ function approve_unapprove_booking(booking_id, is_approve_or_pending, user_id, w
|
|
250 |
var denyreason = '';
|
251 |
if ( is_send_emeils == 1 ) {
|
252 |
if ( jQuery('#is_send_email_for_pending').length ) {
|
253 |
-
is_send_emeils = jQuery('#is_send_email_for_pending').
|
254 |
-
if (is_send_emeils
|
255 |
-
else
|
256 |
}
|
257 |
if ( jQuery('#denyreason').length )
|
258 |
denyreason = jQuery('#denyreason').val();
|
@@ -337,9 +337,9 @@ function trash__restore_booking( is_trash, booking_id, user_id, wpdev_active_loc
|
|
337 |
var denyreason = '';
|
338 |
if (is_send_emeils == 1) {
|
339 |
if ( jQuery('#is_send_email_for_pending').length ) {
|
340 |
-
is_send_emeils = jQuery('#is_send_email_for_pending').
|
341 |
-
if (is_send_emeils
|
342 |
-
else
|
343 |
}
|
344 |
if ( jQuery('#denyreason').length )
|
345 |
denyreason = jQuery('#denyreason').val();
|
@@ -388,9 +388,9 @@ function delete_booking(booking_id, user_id, wpdev_active_locale, is_send_emeils
|
|
388 |
var denyreason = '';
|
389 |
if (is_send_emeils == 1) {
|
390 |
if ( jQuery('#is_send_email_for_pending').length ) {
|
391 |
-
is_send_emeils = jQuery('#is_send_email_for_pending').
|
392 |
-
if (is_send_emeils
|
393 |
-
else
|
394 |
}
|
395 |
if ( jQuery('#denyreason').length )
|
396 |
denyreason = jQuery('#denyreason').val();
|
250 |
var denyreason = '';
|
251 |
if ( is_send_emeils == 1 ) {
|
252 |
if ( jQuery('#is_send_email_for_pending').length ) {
|
253 |
+
is_send_emeils = jQuery( '#is_send_email_for_pending' ).is( ':checked' ); //FixIn: 8.7.9.5
|
254 |
+
if ( false === is_send_emeils ) { is_send_emeils = 0; }
|
255 |
+
else { is_send_emeils = 1; }
|
256 |
}
|
257 |
if ( jQuery('#denyreason').length )
|
258 |
denyreason = jQuery('#denyreason').val();
|
337 |
var denyreason = '';
|
338 |
if (is_send_emeils == 1) {
|
339 |
if ( jQuery('#is_send_email_for_pending').length ) {
|
340 |
+
is_send_emeils = jQuery( '#is_send_email_for_pending' ).is( ':checked' ); //FixIn: 8.7.9.5
|
341 |
+
if ( false === is_send_emeils ) { is_send_emeils = 0; }
|
342 |
+
else { is_send_emeils = 1; }
|
343 |
}
|
344 |
if ( jQuery('#denyreason').length )
|
345 |
denyreason = jQuery('#denyreason').val();
|
388 |
var denyreason = '';
|
389 |
if (is_send_emeils == 1) {
|
390 |
if ( jQuery('#is_send_email_for_pending').length ) {
|
391 |
+
is_send_emeils = jQuery( '#is_send_email_for_pending' ).is( ':checked' ); //FixIn: 8.7.9.5
|
392 |
+
if ( false === is_send_emeils ) { is_send_emeils = 0; }
|
393 |
+
else { is_send_emeils = 1; }
|
394 |
}
|
395 |
if ( jQuery('#denyreason').length )
|
396 |
denyreason = jQuery('#denyreason').val();
|
js/client.js
CHANGED
@@ -925,12 +925,11 @@ function form_submit_send( bk_type, formdata, captcha_chalange, user_captcha ,wp
|
|
925 |
|
926 |
var is_send_emeils = 1;
|
927 |
if ( jQuery('#is_send_email_for_pending').length ) {
|
928 |
-
is_send_emeils = jQuery('#is_send_email_for_pending').
|
929 |
-
if (is_send_emeils
|
930 |
-
else
|
931 |
}
|
932 |
-
|
933 |
-
|
934 |
if ( document.getElementById('date_booking' + bk_type).value != '' ) //FixIn:6.1.1.3
|
935 |
send_ajax_submit(bk_type,formdata,captcha_chalange,user_captcha,is_send_emeils,my_booking_hash,my_booking_form,wpdev_active_locale ); // Ajax sending request
|
936 |
else {
|
925 |
|
926 |
var is_send_emeils = 1;
|
927 |
if ( jQuery('#is_send_email_for_pending').length ) {
|
928 |
+
is_send_emeils = jQuery( '#is_send_email_for_pending' ).is( ':checked' ); //FixIn: 8.7.9.5
|
929 |
+
if ( false === is_send_emeils ) { is_send_emeils = 0; }
|
930 |
+
else { is_send_emeils = 1; }
|
931 |
}
|
932 |
+
|
|
|
933 |
if ( document.getElementById('date_booking' + bk_type).value != '' ) //FixIn:6.1.1.3
|
934 |
send_ajax_submit(bk_type,formdata,captcha_chalange,user_captcha,is_send_emeils,my_booking_hash,my_booking_form,wpdev_active_locale ); // Ajax sending request
|
935 |
else {
|
js/wpbc-migrate.js
DELETED
@@ -1,83 +0,0 @@
|
|
1 |
-
(function() {
|
2 |
-
|
3 |
-
var matched, browser;
|
4 |
-
|
5 |
-
jQuery.uaMatch = function( ua ) {
|
6 |
-
ua = ua.toLowerCase();
|
7 |
-
|
8 |
-
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
9 |
-
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
10 |
-
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
11 |
-
/(msie)[\s?]([\w.]+)/.exec( ua ) ||
|
12 |
-
/(trident)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
13 |
-
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
14 |
-
[];
|
15 |
-
|
16 |
-
return {
|
17 |
-
browser: match[ 1 ] || "",
|
18 |
-
version: match[ 2 ] || "0"
|
19 |
-
};
|
20 |
-
};
|
21 |
-
|
22 |
-
matched = jQuery.uaMatch( navigator.userAgent );
|
23 |
-
//IE 11+ fix (Trident)
|
24 |
-
matched.browser = matched.browser == 'trident' ? 'msie' : matched.browser;
|
25 |
-
browser = {};
|
26 |
-
|
27 |
-
if ( matched.browser ) {
|
28 |
-
browser[ matched.browser ] = true;
|
29 |
-
browser.version = matched.version;
|
30 |
-
}
|
31 |
-
|
32 |
-
// Chrome is Webkit, but Webkit is also Safari.
|
33 |
-
if ( browser.chrome ) {
|
34 |
-
browser.webkit = true;
|
35 |
-
} else if ( browser.webkit ) {
|
36 |
-
browser.safari = true;
|
37 |
-
}
|
38 |
-
|
39 |
-
jQuery.browser = browser;
|
40 |
-
|
41 |
-
|
42 |
-
/* var matched, browser;
|
43 |
-
|
44 |
-
// Use of jQuery.browser is frowned upon.
|
45 |
-
// More details: http://api.jquery.com/jQuery.browser
|
46 |
-
// jQuery.uaMatch maintained for back-compat
|
47 |
-
jQuery.uaMatch = function( ua ) {
|
48 |
-
ua = ua.toLowerCase();
|
49 |
-
|
50 |
-
var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
|
51 |
-
/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
|
52 |
-
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
|
53 |
-
/(msie) ([\w.]+)/.exec( ua ) ||
|
54 |
-
ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
|
55 |
-
[];
|
56 |
-
|
57 |
-
return {
|
58 |
-
browser: match[ 1 ] || "",
|
59 |
-
version: match[ 2 ] || "0"
|
60 |
-
};
|
61 |
-
};
|
62 |
-
|
63 |
-
matched = jQuery.uaMatch( navigator.userAgent );
|
64 |
-
browser = {};
|
65 |
-
|
66 |
-
if ( matched.browser ) {
|
67 |
-
browser[ matched.browser ] = true;
|
68 |
-
browser.version = matched.version;
|
69 |
-
}
|
70 |
-
|
71 |
-
// Chrome is Webkit, but Webkit is also Safari.
|
72 |
-
if ( browser.chrome ) {
|
73 |
-
browser.webkit = true;
|
74 |
-
} else if ( browser.webkit ) {
|
75 |
-
browser.safari = true;
|
76 |
-
}
|
77 |
-
|
78 |
-
// Set to true to prevent console output; migrateWarnings still maintained
|
79 |
-
//jQuery.migrateMute = true;
|
80 |
-
|
81 |
-
jQuery.browser = browser;
|
82 |
-
*/
|
83 |
-
})();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
languages/booking-nl_NL.mo
CHANGED
Binary file
|
readme.txt
CHANGED
@@ -5,7 +5,7 @@ Tags: booking calendar, booking system, availability calendar, events calendar,
|
|
5 |
Requires at least: 4.0
|
6 |
Requires PHP: 5.2.4
|
7 |
Tested up to: 5.5
|
8 |
-
Stable tag: 8.7.
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
@@ -227,6 +227,22 @@ Please see [Video Guides](https://wpbookingcalendar.com/help/).
|
|
227 |
13. **Time Slots**. Simple configuration of **time slots** selection in booking form.
|
228 |
|
229 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
230 |
= 8.7.8 =
|
231 |
- Changes in **all** versions:
|
232 |
* **Translation** French translation [100% completed] by Walid Chaafi
|
5 |
Requires at least: 4.0
|
6 |
Requires PHP: 5.2.4
|
7 |
Tested up to: 5.5
|
8 |
+
Stable tag: 8.7.9
|
9 |
License: GPLv2 or later
|
10 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
11 |
|
227 |
13. **Time Slots**. Simple configuration of **time slots** selection in booking form.
|
228 |
|
229 |
== Changelog ==
|
230 |
+
= 8.7.9 =
|
231 |
+
- Changes in **all** versions:
|
232 |
+
* **Improvement** Added primary key to booking dates table for correct working at wordpress.com (8.7.9.1)
|
233 |
+
* **Improvement** updated "Chosen" library from 0.9.7 to 1.8.7 (8.7.9.8)
|
234 |
+
* **Improvement** updated "jquery.meio.mask" library from 1.1.3 to 1.1.14 (8.7.9.10)
|
235 |
+
* **Fix**. Issue of incorrectly showing new booking icon (8.7.9.6)
|
236 |
+
* **Fix**. Issue in mobile devices at Timeline of showing the booking details in mouse over tooltip intersected with booking labels (8.7.9.4)
|
237 |
+
* **Fix**. Issue of sending emails, while the checkbox "Emails sending" was unchecked (8.7.9.4)
|
238 |
+
* **Fix**. Showing deprecated message: ../core/any/js/admin-support.js: jQuery.fn.load() is deprecated (8.7.9.7)
|
239 |
+
* **Fix**. Showing deprecated message: ../assets/libs/chosen/chosen.jquery.min.js: jQuery.browser is deprecated (8.7.9.9)
|
240 |
+
* **Fix**. Showing deprecated message: ../inc/js/jquery.meio.mask.min.js: jQuery.browser is deprecated (8.7.9.11)
|
241 |
+
* **Fix**. Showing deprecated message: ../js/wpbc-migrate.js: jQuery.browser is deprecated. Removed the wpbc-migrate script, it's does not require anymore. (8.7.9.12)
|
242 |
+
- Changes in **Personal / Business Small / Business Medium / Business Large / MultiUser** versions:
|
243 |
+
* **Improvement** Replaced stripe library from 6.33.0 to 7.46.1 (8.7.9.2) *(Business Small/Medium/Large, MultiUser)*
|
244 |
+
* **Fix**. Issue of showing error "Unknown-Stripe-Payment" during Stripe payments for the booking resources that belong to "regular users" in Booking Calendar MultiUser version (8.7.9.3) *(MultiUser)*
|
245 |
+
|
246 |
= 8.7.8 =
|
247 |
- Changes in **all** versions:
|
248 |
* **Translation** French translation [100% completed] by Walid Chaafi
|
wpdev-booking.php
CHANGED
@@ -7,7 +7,7 @@ Author: wpdevelop, oplugins
|
|
7 |
Author URI: https://wpbookingcalendar.com/
|
8 |
Text Domain: booking
|
9 |
Domain Path: /languages/
|
10 |
-
Version: 8.7.
|
11 |
*/
|
12 |
|
13 |
/* Copyright 2009 - 2020 www.wpbookingcalendar.com (email: info@wpbookingcalendar.com),
|
@@ -29,7 +29,7 @@ Version: 8.7.8
|
|
29 |
if ( ! defined( 'ABSPATH' ) ) die( '<h3>Direct access to this file do not allow!</h3>' ); // Exit if accessed directly
|
30 |
|
31 |
|
32 |
-
if ( ! defined( 'WP_BK_VERSION_NUM' ) ) { define( 'WP_BK_VERSION_NUM', '8.7.
|
33 |
|
34 |
////////////////////////////////////////////////////////////////////////////////
|
35 |
// PRIMARY URL CONSTANTS
|
7 |
Author URI: https://wpbookingcalendar.com/
|
8 |
Text Domain: booking
|
9 |
Domain Path: /languages/
|
10 |
+
Version: 8.7.9
|
11 |
*/
|
12 |
|
13 |
/* Copyright 2009 - 2020 www.wpbookingcalendar.com (email: info@wpbookingcalendar.com),
|
29 |
if ( ! defined( 'ABSPATH' ) ) die( '<h3>Direct access to this file do not allow!</h3>' ); // Exit if accessed directly
|
30 |
|
31 |
|
32 |
+
if ( ! defined( 'WP_BK_VERSION_NUM' ) ) { define( 'WP_BK_VERSION_NUM', '8.7.9' ); }
|
33 |
|
34 |
////////////////////////////////////////////////////////////////////////////////
|
35 |
// PRIMARY URL CONSTANTS
|