Version Description
- TWEAK: Get coupon description using WC_Coupon::get_description() to respect applicable filters (for example used by Polylang)
- (PRO) FEATURE: Allow customer to remove 'Auto Coupons' from the cart (see settings page)
- (PRO) FEATURE: Filter 'wjecf_get_limit_to_options' to allow adding custom 'Limit to'-options
- (PRO) PERFORMANCE: Free products: Only load js and css when required
- (PRO) FIX: Free products: "update cart"-button not automatically enabled after selecting a free product (in combination with certain themes (e.g. Flatsome)
- (PRO) FIX: Free products: Prevent certain plugins from parsing attribute fields containing [products] as shortcode
- (PRO) FIX: Limit discount to cheapest item failed in WC3.0 in combination with a percent discount
- (PRO) FIX: Custom fields: Accept WC3.0 core fields (e.g. _price)
- (PRO) FIX: PHP Warnings in WJECF_Pro_Admin_Auto_Update
Download this release
Release Info
Developer | josk79 |
Plugin | WooCommerce Extended Coupon Features |
Version | 2.5.4 |
Comparing to | |
See all releases |
Code changes from version 2.5.1 to 2.5.4
- assets/wjecf.css +8 -2
- docs/assets/css/documenter_style.css +417 -417
- docs/assets/images/image_3.png +0 -0
- docs/assets/images/image_4.png +0 -0
- docs/assets/images/image_5.png +0 -0
- docs/assets/images/image_6.png +0 -0
- docs/assets/images/image_7.png +0 -0
- docs/assets/js/google-code-prettify/prettify.css +29 -29
- docs/assets/js/google-code-prettify/prettify.js +28 -28
- docs/assets/js/jquery.js +9252 -9252
- docs/assets/js/script.js +158 -158
- docs/index.html +265 -43
- includes/Abstract_WJECF_Plugin.php +4 -4
- includes/WJECF_AutoCoupon.php +196 -39
- includes/WJECF_Bootstrap.php +1 -0
- includes/WJECF_Controller.php +2 -1
- includes/WJECF_Debug_CLI.php +15 -0
- includes/WJECF_Options.php +1 -1
- includes/WJECF_WC.php +0 -454
- includes/WJECF_Wrap.php +485 -0
- includes/admin/WJECF_Admin.php +1 -1
- includes/admin/WJECF_Admin_Settings.php +7 -4
- languages/woocommerce-jos-autocoupon-es_ES.mo +0 -0
- languages/woocommerce-jos-autocoupon-es_ES.po +461 -294
- languages/woocommerce-jos-autocoupon-nl_NL.mo +0 -0
- languages/woocommerce-jos-autocoupon-nl_NL.po +523 -317
- languages/woocommerce-jos-autocoupon.pot +406 -249
- readme.txt +33 -5
- woocommerce-jos-autocoupon.php +2 -2
assets/wjecf.css
CHANGED
@@ -4,7 +4,7 @@ WJECF columns system
|
|
4 |
|
5 |
ul.wjecf-cols { list-style-type: none;margin:0}
|
6 |
ul.wjecf-cols::after { content:'';display:block;clear:both; } /* clearfix */
|
7 |
-
ul.wjecf-cols > li { float:left;margin-right:3%;margin-left:0; }
|
8 |
|
9 |
ul.wjecf-cols.cols-2 > li { width:48.5%; }
|
10 |
ul.wjecf-cols.cols-3 > li { width:31.3%; }
|
@@ -16,7 +16,13 @@ ul.wjecf-cols.cols-2 > li:nth-child(2n+2),
|
|
16 |
ul.wjecf-cols.cols-3 > li:nth-child(3n+3),
|
17 |
ul.wjecf-cols.cols-4 > li:nth-child(4n+4),
|
18 |
ul.wjecf-cols.cols-5 > li:nth-child(5n+5),
|
19 |
-
ul.wjecf-cols.cols-6 > li:nth-child(6n+6) { margin-right:0!important; }
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
.wjecf-select-free-products ul.wjecf-cols > li > img { width:auto; }
|
22 |
.wjecf-select-free-products ul.wjecf-cols > li input[type="number"] { width:100%; }
|
4 |
|
5 |
ul.wjecf-cols { list-style-type: none;margin:0}
|
6 |
ul.wjecf-cols::after { content:'';display:block;clear:both; } /* clearfix */
|
7 |
+
ul.wjecf-cols > li { float:left;padding:0;position:relative;margin-right:3%;margin-left:0; }
|
8 |
|
9 |
ul.wjecf-cols.cols-2 > li { width:48.5%; }
|
10 |
ul.wjecf-cols.cols-3 > li { width:31.3%; }
|
16 |
ul.wjecf-cols.cols-3 > li:nth-child(3n+3),
|
17 |
ul.wjecf-cols.cols-4 > li:nth-child(4n+4),
|
18 |
ul.wjecf-cols.cols-5 > li:nth-child(5n+5),
|
19 |
+
ul.wjecf-cols.cols-6 > li:nth-child(6n+6) { margin-right:0!important; }
|
20 |
+
|
21 |
+
ul.wjecf-cols.cols-2 > li:nth-child(2n+1),
|
22 |
+
ul.wjecf-cols.cols-3 > li:nth-child(3n+1),
|
23 |
+
ul.wjecf-cols.cols-4 > li:nth-child(4n+1),
|
24 |
+
ul.wjecf-cols.cols-5 > li:nth-child(5n+1),
|
25 |
+
ul.wjecf-cols.cols-6 > li:nth-child(6n+1) { clear:both; }
|
26 |
|
27 |
.wjecf-select-free-products ul.wjecf-cols > li > img { width:auto; }
|
28 |
.wjecf-select-free-products ul.wjecf-cols > li input[type="number"] { width:100%; }
|
docs/assets/css/documenter_style.css
CHANGED
@@ -1,418 +1,418 @@
|
|
1 |
-
/*!
|
2 |
-
* Documenter 2.0
|
3 |
-
* http://rxa.li/documenter
|
4 |
-
*
|
5 |
-
* Copyright 2011, Xaver Birsak
|
6 |
-
* http://revaxarts.com
|
7 |
-
*
|
8 |
-
*/
|
9 |
-
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{
|
10 |
-
margin:0;
|
11 |
-
padding:0;
|
12 |
-
border:0;
|
13 |
-
outline:0;
|
14 |
-
font-weight:inherit;
|
15 |
-
font-style:inherit;
|
16 |
-
font-size:100%;
|
17 |
-
font-family:inherit;
|
18 |
-
vertical-align:baseline;
|
19 |
-
}
|
20 |
-
html {
|
21 |
-
font-size:101%;
|
22 |
-
font-family:Arial,verdana,arial,sans-serif;
|
23 |
-
font-size:12px;
|
24 |
-
-webkit-text-size-adjust:none;
|
25 |
-
color:#6F6F6F;
|
26 |
-
background-color:#efefef;
|
27 |
-
}
|
28 |
-
body{
|
29 |
-
min-height:100%;
|
30 |
-
height:auto;
|
31 |
-
width:100%;
|
32 |
-
}
|
33 |
-
footer, header, section {
|
34 |
-
display:block;
|
35 |
-
}
|
36 |
-
a{ color:#6F6F6F; text-decoration:none; cursor:pointer; }
|
37 |
-
a:hover { text-decoration:underline }
|
38 |
-
p, ul, ol{
|
39 |
-
margin:18px 0;
|
40 |
-
line-height:1.5em;
|
41 |
-
}
|
42 |
-
li{
|
43 |
-
list-style:none;
|
44 |
-
}
|
45 |
-
li.placeholder{
|
46 |
-
height:70px;
|
47 |
-
width:100%;
|
48 |
-
font-size:16px;
|
49 |
-
}
|
50 |
-
hr {
|
51 |
-
display:block;
|
52 |
-
height:0px;
|
53 |
-
line-height:0px;
|
54 |
-
border:0;
|
55 |
-
border-top:1px solid #ddd;
|
56 |
-
border-bottom:1px solid #aaa;
|
57 |
-
margin:16px 0;
|
58 |
-
padding:0;
|
59 |
-
clear:both;
|
60 |
-
float:none;
|
61 |
-
}
|
62 |
-
hr.notop{
|
63 |
-
margin-top:0;
|
64 |
-
}
|
65 |
-
strong{
|
66 |
-
font-weight:700;
|
67 |
-
}
|
68 |
-
#documenter_buttons{
|
69 |
-
position:absolute;
|
70 |
-
right:10px;
|
71 |
-
margin-top:-30px;
|
72 |
-
}
|
73 |
-
.btn{
|
74 |
-
cursor:pointer;
|
75 |
-
width:auto;
|
76 |
-
padding:7px 7px 8px;
|
77 |
-
border-radius:3px;
|
78 |
-
border:1px solid #ccc;
|
79 |
-
}
|
80 |
-
.btn:hover{
|
81 |
-
border:1px solid #B1B4B0;
|
82 |
-
box-shadow:0px 2px 2px rgba(0,0,0,0.1);
|
83 |
-
-moz-box-shadow:0px 2px 2px rgba(0,0,0,0.1);
|
84 |
-
-webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.1);
|
85 |
-
text-decoration:none;
|
86 |
-
}
|
87 |
-
.btn:active{
|
88 |
-
border:1px solid #B1B4B0;
|
89 |
-
box-shadow:inset 0px 2px 2px rgba(0,0,0,0.1);
|
90 |
-
-moz-box-shadow:inset 0px 2px 2px rgba(0,0,0,0.1);
|
91 |
-
-webkit-box-shadow:inset 0px 2px 2px rgba(0,0,0,0.1);
|
92 |
-
background-color:#eee;
|
93 |
-
}
|
94 |
-
|
95 |
-
#documenter_content{
|
96 |
-
position:absolute;
|
97 |
-
right:18px;
|
98 |
-
left:218px;
|
99 |
-
padding-left:10px;
|
100 |
-
padding-bottom:800px;
|
101 |
-
min-height:100%;
|
102 |
-
height:auto;
|
103 |
-
z-index:1;
|
104 |
-
}
|
105 |
-
#documenter_sidebar{
|
106 |
-
-moz-box-shadow:0 0 6px rgba(3,3,3,0.6);
|
107 |
-
-webkit-box-shadow:0 0 6px rgba(3,3,3,0.6);
|
108 |
-
box-shadow:0 0 6px rgba(3,3,3,0.6);
|
109 |
-
position:fixed;
|
110 |
-
left:0;
|
111 |
-
width:200px;
|
112 |
-
height:100%;
|
113 |
-
min-height:100%;
|
114 |
-
z-index:100;
|
115 |
-
}
|
116 |
-
#documenter_sidebar a{
|
117 |
-
position:relative;
|
118 |
-
z-index:100;
|
119 |
-
}
|
120 |
-
img{
|
121 |
-
border:0;
|
122 |
-
}
|
123 |
-
#documenter_copyright{
|
124 |
-
position:absolute;
|
125 |
-
bottom:10px;
|
126 |
-
font-size:10px;
|
127 |
-
right:15px;
|
128 |
-
width:200px;
|
129 |
-
text-align:right;
|
130 |
-
z-index:1
|
131 |
-
}
|
132 |
-
noscript{
|
133 |
-
display:block;
|
134 |
-
position:absolute;
|
135 |
-
top:238px;
|
136 |
-
margin:0 auto;
|
137 |
-
width:800px;
|
138 |
-
bottom:0;
|
139 |
-
z-index:20;
|
140 |
-
}
|
141 |
-
noscript p{
|
142 |
-
width:800px;
|
143 |
-
font-size:20px;
|
144 |
-
padding-top:20px;
|
145 |
-
margin:0 auto;
|
146 |
-
color:#4D4D4D;
|
147 |
-
}
|
148 |
-
.small{
|
149 |
-
font-size:10px;
|
150 |
-
letter-spacing:0;
|
151 |
-
}
|
152 |
-
|
153 |
-
/*----------------------------------------------------------------------*/
|
154 |
-
/* Sidebar
|
155 |
-
/*----------------------------------------------------------------------*/
|
156 |
-
|
157 |
-
#documenter_sidebar #documenter_logo{
|
158 |
-
display:block;
|
159 |
-
height:20%;
|
160 |
-
max-height:200px;
|
161 |
-
min-height:70px;
|
162 |
-
width:200px;
|
163 |
-
background-position:center center;
|
164 |
-
background-repeat:no-repeat;
|
165 |
-
}
|
166 |
-
#documenter_sidebar ul{
|
167 |
-
font-size:12px;
|
168 |
-
font-weight:700;
|
169 |
-
min-height:150px;
|
170 |
-
height:75%;
|
171 |
-
overflow:auto;
|
172 |
-
}
|
173 |
-
|
174 |
-
#documenter_sidebar ul li{
|
175 |
-
text-align:right;
|
176 |
-
padding:0;
|
177 |
-
}
|
178 |
-
#documenter_sidebar ul a{
|
179 |
-
display:block;
|
180 |
-
border-top:1px solid #ddd;
|
181 |
-
border-bottom:1px solid #aaa;
|
182 |
-
padding:6px 15px 7px 0;
|
183 |
-
text-align:right;
|
184 |
-
}
|
185 |
-
#documenter_sidebar ul a:hover,#documenter_sidebar ul a.current{
|
186 |
-
-webkit-text-shadow:none;
|
187 |
-
-moz-text-shadow:none;
|
188 |
-
text-shadow:none;
|
189 |
-
text-decoration:none;
|
190 |
-
}
|
191 |
-
#documenter_sidebar ul li ul{
|
192 |
-
border-top:0;
|
193 |
-
font-size:10px;
|
194 |
-
min-height:10px;
|
195 |
-
height:auto;
|
196 |
-
overflow:auto;
|
197 |
-
margin:0;
|
198 |
-
display:none;
|
199 |
-
}
|
200 |
-
#documenter_sidebar ul li ul li a{
|
201 |
-
display:block;
|
202 |
-
padding:4px 15px 5px 0;
|
203 |
-
text-align:right;
|
204 |
-
}
|
205 |
-
|
206 |
-
/*----------------------------------------------------------------------*/
|
207 |
-
/* Content
|
208 |
-
/*----------------------------------------------------------------------*/
|
209 |
-
|
210 |
-
#documenter_cover{
|
211 |
-
position:relative;
|
212 |
-
height:800px;
|
213 |
-
padding-top:200px !important;
|
214 |
-
}
|
215 |
-
#documenter_cover li{
|
216 |
-
list-style:none !important;
|
217 |
-
margin-left:0 !important;
|
218 |
-
}
|
219 |
-
#documenter_cover p{
|
220 |
-
width:500px;
|
221 |
-
}
|
222 |
-
#documenter_content section{
|
223 |
-
padding-top:70px;
|
224 |
-
}
|
225 |
-
#documenter_content h1{
|
226 |
-
font-size:30px;
|
227 |
-
font-weight:700;
|
228 |
-
}
|
229 |
-
#documenter_content h2{
|
230 |
-
font-size:20px;
|
231 |
-
margin-bottom:18px;
|
232 |
-
font-weight:100;
|
233 |
-
}
|
234 |
-
#documenter_content h3{
|
235 |
-
font-size:26px;
|
236 |
-
margin:18px 0 0;
|
237 |
-
font-weight:100;
|
238 |
-
}
|
239 |
-
#documenter_content h4{
|
240 |
-
font-size:20px;
|
241 |
-
margin:18px 0;
|
242 |
-
font-weight:100;
|
243 |
-
}
|
244 |
-
#documenter_content h5{
|
245 |
-
font-size:16px;
|
246 |
-
margin:18px 0;
|
247 |
-
font-weight:100;
|
248 |
-
}
|
249 |
-
#documenter_content h6{
|
250 |
-
font-size:14px;
|
251 |
-
margin:18px 0;
|
252 |
-
font-weight:100;
|
253 |
-
}
|
254 |
-
#documenter_content p{
|
255 |
-
margin:18px 0;
|
256 |
-
}
|
257 |
-
#documenter_content ol li{
|
258 |
-
list-style:decimal;
|
259 |
-
margin-left:36px;
|
260 |
-
}
|
261 |
-
#documenter_content ul li{
|
262 |
-
list-style:square;
|
263 |
-
margin-left:36px;
|
264 |
-
}
|
265 |
-
#documenter_content dl{
|
266 |
-
}
|
267 |
-
#documenter_content dl dt{
|
268 |
-
padding-top:12px;
|
269 |
-
font-weight:700;
|
270 |
-
font-size:14px;
|
271 |
-
}
|
272 |
-
#documenter_content dl dd{
|
273 |
-
padding-top:3px;
|
274 |
-
margin-left:18px;
|
275 |
-
}
|
276 |
-
#documenter_content table{
|
277 |
-
border-collapse:collapse;
|
278 |
-
}
|
279 |
-
#documenter_content table th{
|
280 |
-
font-weight:700;
|
281 |
-
}
|
282 |
-
#documenter_content table th, #documenter_content table td{
|
283 |
-
padding:3px;
|
284 |
-
text-align:left;
|
285 |
-
}
|
286 |
-
#documenter_content code{
|
287 |
-
font-family:"Courier New", Courier, monospace;
|
288 |
-
font-size:12px;
|
289 |
-
}
|
290 |
-
#documenter_content .warning{
|
291 |
-
padding:10px 10px 10px 30px;
|
292 |
-
border:1px solid #D5D458;
|
293 |
-
background-color:#F0FEB1;
|
294 |
-
background-image:url(img/warning.png);
|
295 |
-
background-repeat:no-repeat;
|
296 |
-
background-position: 8px 11px;
|
297 |
-
}
|
298 |
-
#documenter_content .info{
|
299 |
-
padding:10px 10px 10px 30px;
|
300 |
-
border:1px solid #6AB3FF;
|
301 |
-
background-color:#A3D0FF;
|
302 |
-
background-image:url(img/info.png);
|
303 |
-
background-repeat:no-repeat;
|
304 |
-
background-position: 8px 11px;
|
305 |
-
}
|
306 |
-
#documenter_content div.alert {
|
307 |
-
padding: 8px 35px 8px 14px;
|
308 |
-
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
309 |
-
background-color: #fcf8e3;
|
310 |
-
border: 1px solid #fbeed5;
|
311 |
-
-webkit-border-radius: 4px;
|
312 |
-
-moz-border-radius: 4px;
|
313 |
-
border-radius: 4px;
|
314 |
-
}
|
315 |
-
#documenter_content div.alert-success,#documenter_content div.alert-success div.alert-heading {
|
316 |
-
color: #468847;
|
317 |
-
}
|
318 |
-
#documenter_content div.alert-danger,#documenter_content div.alert-error {
|
319 |
-
background-color: #f2dede;
|
320 |
-
border-color: #eed3d7;
|
321 |
-
}
|
322 |
-
#documenter_content div.alert-danger,
|
323 |
-
#documenter_content div.alert-error,
|
324 |
-
#documenter_content div.alert-danger div.alert-heading,
|
325 |
-
#documenter_content div.alert-error div.alert-heading {
|
326 |
-
color: #b94a48;
|
327 |
-
}
|
328 |
-
#documenter_content div.alert-info {
|
329 |
-
background-color: #d9edf7;
|
330 |
-
border-color: #bce8f1;
|
331 |
-
}
|
332 |
-
#documenter_content div.alert-info,#documenter_content div.alert-info div.alert-heading {
|
333 |
-
color: #3a87ad;
|
334 |
-
}
|
335 |
-
#documenter_content div.alert-block {
|
336 |
-
padding-top: 14px;
|
337 |
-
padding-bottom: 14px;
|
338 |
-
}
|
339 |
-
#documenter_content div.alert-block > p,#documenter_content div.alert-block > ul {
|
340 |
-
margin-bottom: 0;
|
341 |
-
}
|
342 |
-
#documenter_content div.alert-block p + p {
|
343 |
-
margin-top: 5px;
|
344 |
-
}
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
/*----------------------------------------------------------------------*/
|
351 |
-
/* Print Styles
|
352 |
-
/*----------------------------------------------------------------------*/
|
353 |
-
|
354 |
-
@media print {
|
355 |
-
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
|
356 |
-
-ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */
|
357 |
-
a, a:visited { color: #444 !important; text-decoration: underline; }
|
358 |
-
a[href]:after { content: " (" attr(href) ")"; }
|
359 |
-
abbr[title]:after { content: " (" attr(title) ")"; }
|
360 |
-
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
|
361 |
-
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
|
362 |
-
thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
|
363 |
-
tr, img { page-break-inside: avoid; }
|
364 |
-
@page { margin: 0.5cm; }
|
365 |
-
p, h2, h3 { orphans: 3; widows: 3; }
|
366 |
-
h2, h3{ page-break-after: avoid; }
|
367 |
-
hr { border-top:1px solid #000 !important;border-bottom:0 !important; }
|
368 |
-
|
369 |
-
#documenter_sidebar{
|
370 |
-
-moz-box-shadow:none;
|
371 |
-
-webkit-box-shadow:none;
|
372 |
-
box-shadow:none;
|
373 |
-
position:absolute;
|
374 |
-
left:10px;
|
375 |
-
top:0;
|
376 |
-
width:100%;
|
377 |
-
margin-top:500px;
|
378 |
-
}
|
379 |
-
#documenter_sidebar ul:before { content: "Table of Contents"; }
|
380 |
-
|
381 |
-
#documenter_sidebar ul{
|
382 |
-
border:0 !important;
|
383 |
-
}
|
384 |
-
#documenter_sidebar ul li{
|
385 |
-
border:0 !important;
|
386 |
-
text-align:left;
|
387 |
-
}
|
388 |
-
#documenter_sidebar ul li a{
|
389 |
-
border:0 !important;
|
390 |
-
text-align:left;
|
391 |
-
padding:4px;
|
392 |
-
}
|
393 |
-
#documenter_sidebar ul li a:hover{
|
394 |
-
border:0 !important;
|
395 |
-
}
|
396 |
-
#documenter_sidebar #documenter_logo{
|
397 |
-
display:none;
|
398 |
-
}
|
399 |
-
#documenter_sidebar #documenter_copyright{
|
400 |
-
display:none;
|
401 |
-
}
|
402 |
-
#documenter_content{
|
403 |
-
left:10px;
|
404 |
-
}
|
405 |
-
#documenter_cover{
|
406 |
-
margin-bottom:300px;
|
407 |
-
}
|
408 |
-
#documenter_content .warning{
|
409 |
-
background-image:url(img/warning.png) !important;
|
410 |
-
background-repeat:no-repeat !important;
|
411 |
-
background-position: 8px 11px !important;
|
412 |
-
}
|
413 |
-
#documenter_content .info{
|
414 |
-
background-image:url(img/info.png) !important;
|
415 |
-
background-repeat:no-repeat !important;
|
416 |
-
background-position: 8px 11px !important;
|
417 |
-
}
|
418 |
}
|
1 |
+
/*!
|
2 |
+
* Documenter 2.0
|
3 |
+
* http://rxa.li/documenter
|
4 |
+
*
|
5 |
+
* Copyright 2011, Xaver Birsak
|
6 |
+
* http://revaxarts.com
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td{
|
10 |
+
margin:0;
|
11 |
+
padding:0;
|
12 |
+
border:0;
|
13 |
+
outline:0;
|
14 |
+
font-weight:inherit;
|
15 |
+
font-style:inherit;
|
16 |
+
font-size:100%;
|
17 |
+
font-family:inherit;
|
18 |
+
vertical-align:baseline;
|
19 |
+
}
|
20 |
+
html {
|
21 |
+
font-size:101%;
|
22 |
+
font-family:Arial,verdana,arial,sans-serif;
|
23 |
+
font-size:12px;
|
24 |
+
-webkit-text-size-adjust:none;
|
25 |
+
color:#6F6F6F;
|
26 |
+
background-color:#efefef;
|
27 |
+
}
|
28 |
+
body{
|
29 |
+
min-height:100%;
|
30 |
+
height:auto;
|
31 |
+
width:100%;
|
32 |
+
}
|
33 |
+
footer, header, section {
|
34 |
+
display:block;
|
35 |
+
}
|
36 |
+
a{ color:#6F6F6F; text-decoration:none; cursor:pointer; }
|
37 |
+
a:hover { text-decoration:underline }
|
38 |
+
p, ul, ol{
|
39 |
+
margin:18px 0;
|
40 |
+
line-height:1.5em;
|
41 |
+
}
|
42 |
+
li{
|
43 |
+
list-style:none;
|
44 |
+
}
|
45 |
+
li.placeholder{
|
46 |
+
height:70px;
|
47 |
+
width:100%;
|
48 |
+
font-size:16px;
|
49 |
+
}
|
50 |
+
hr {
|
51 |
+
display:block;
|
52 |
+
height:0px;
|
53 |
+
line-height:0px;
|
54 |
+
border:0;
|
55 |
+
border-top:1px solid #ddd;
|
56 |
+
border-bottom:1px solid #aaa;
|
57 |
+
margin:16px 0;
|
58 |
+
padding:0;
|
59 |
+
clear:both;
|
60 |
+
float:none;
|
61 |
+
}
|
62 |
+
hr.notop{
|
63 |
+
margin-top:0;
|
64 |
+
}
|
65 |
+
strong{
|
66 |
+
font-weight:700;
|
67 |
+
}
|
68 |
+
#documenter_buttons{
|
69 |
+
position:absolute;
|
70 |
+
right:10px;
|
71 |
+
margin-top:-30px;
|
72 |
+
}
|
73 |
+
.btn{
|
74 |
+
cursor:pointer;
|
75 |
+
width:auto;
|
76 |
+
padding:7px 7px 8px;
|
77 |
+
border-radius:3px;
|
78 |
+
border:1px solid #ccc;
|
79 |
+
}
|
80 |
+
.btn:hover{
|
81 |
+
border:1px solid #B1B4B0;
|
82 |
+
box-shadow:0px 2px 2px rgba(0,0,0,0.1);
|
83 |
+
-moz-box-shadow:0px 2px 2px rgba(0,0,0,0.1);
|
84 |
+
-webkit-box-shadow:0px 2px 2px rgba(0,0,0,0.1);
|
85 |
+
text-decoration:none;
|
86 |
+
}
|
87 |
+
.btn:active{
|
88 |
+
border:1px solid #B1B4B0;
|
89 |
+
box-shadow:inset 0px 2px 2px rgba(0,0,0,0.1);
|
90 |
+
-moz-box-shadow:inset 0px 2px 2px rgba(0,0,0,0.1);
|
91 |
+
-webkit-box-shadow:inset 0px 2px 2px rgba(0,0,0,0.1);
|
92 |
+
background-color:#eee;
|
93 |
+
}
|
94 |
+
|
95 |
+
#documenter_content{
|
96 |
+
position:absolute;
|
97 |
+
right:18px;
|
98 |
+
left:218px;
|
99 |
+
padding-left:10px;
|
100 |
+
padding-bottom:800px;
|
101 |
+
min-height:100%;
|
102 |
+
height:auto;
|
103 |
+
z-index:1;
|
104 |
+
}
|
105 |
+
#documenter_sidebar{
|
106 |
+
-moz-box-shadow:0 0 6px rgba(3,3,3,0.6);
|
107 |
+
-webkit-box-shadow:0 0 6px rgba(3,3,3,0.6);
|
108 |
+
box-shadow:0 0 6px rgba(3,3,3,0.6);
|
109 |
+
position:fixed;
|
110 |
+
left:0;
|
111 |
+
width:200px;
|
112 |
+
height:100%;
|
113 |
+
min-height:100%;
|
114 |
+
z-index:100;
|
115 |
+
}
|
116 |
+
#documenter_sidebar a{
|
117 |
+
position:relative;
|
118 |
+
z-index:100;
|
119 |
+
}
|
120 |
+
img{
|
121 |
+
border:0;
|
122 |
+
}
|
123 |
+
#documenter_copyright{
|
124 |
+
position:absolute;
|
125 |
+
bottom:10px;
|
126 |
+
font-size:10px;
|
127 |
+
right:15px;
|
128 |
+
width:200px;
|
129 |
+
text-align:right;
|
130 |
+
z-index:1
|
131 |
+
}
|
132 |
+
noscript{
|
133 |
+
display:block;
|
134 |
+
position:absolute;
|
135 |
+
top:238px;
|
136 |
+
margin:0 auto;
|
137 |
+
width:800px;
|
138 |
+
bottom:0;
|
139 |
+
z-index:20;
|
140 |
+
}
|
141 |
+
noscript p{
|
142 |
+
width:800px;
|
143 |
+
font-size:20px;
|
144 |
+
padding-top:20px;
|
145 |
+
margin:0 auto;
|
146 |
+
color:#4D4D4D;
|
147 |
+
}
|
148 |
+
.small{
|
149 |
+
font-size:10px;
|
150 |
+
letter-spacing:0;
|
151 |
+
}
|
152 |
+
|
153 |
+
/*----------------------------------------------------------------------*/
|
154 |
+
/* Sidebar
|
155 |
+
/*----------------------------------------------------------------------*/
|
156 |
+
|
157 |
+
#documenter_sidebar #documenter_logo{
|
158 |
+
display:block;
|
159 |
+
height:20%;
|
160 |
+
max-height:200px;
|
161 |
+
min-height:70px;
|
162 |
+
width:200px;
|
163 |
+
background-position:center center;
|
164 |
+
background-repeat:no-repeat;
|
165 |
+
}
|
166 |
+
#documenter_sidebar ul{
|
167 |
+
font-size:12px;
|
168 |
+
font-weight:700;
|
169 |
+
min-height:150px;
|
170 |
+
height:75%;
|
171 |
+
overflow:auto;
|
172 |
+
}
|
173 |
+
|
174 |
+
#documenter_sidebar ul li{
|
175 |
+
text-align:right;
|
176 |
+
padding:0;
|
177 |
+
}
|
178 |
+
#documenter_sidebar ul a{
|
179 |
+
display:block;
|
180 |
+
border-top:1px solid #ddd;
|
181 |
+
border-bottom:1px solid #aaa;
|
182 |
+
padding:6px 15px 7px 0;
|
183 |
+
text-align:right;
|
184 |
+
}
|
185 |
+
#documenter_sidebar ul a:hover,#documenter_sidebar ul a.current{
|
186 |
+
-webkit-text-shadow:none;
|
187 |
+
-moz-text-shadow:none;
|
188 |
+
text-shadow:none;
|
189 |
+
text-decoration:none;
|
190 |
+
}
|
191 |
+
#documenter_sidebar ul li ul{
|
192 |
+
border-top:0;
|
193 |
+
font-size:10px;
|
194 |
+
min-height:10px;
|
195 |
+
height:auto;
|
196 |
+
overflow:auto;
|
197 |
+
margin:0;
|
198 |
+
display:none;
|
199 |
+
}
|
200 |
+
#documenter_sidebar ul li ul li a{
|
201 |
+
display:block;
|
202 |
+
padding:4px 15px 5px 0;
|
203 |
+
text-align:right;
|
204 |
+
}
|
205 |
+
|
206 |
+
/*----------------------------------------------------------------------*/
|
207 |
+
/* Content
|
208 |
+
/*----------------------------------------------------------------------*/
|
209 |
+
|
210 |
+
#documenter_cover{
|
211 |
+
position:relative;
|
212 |
+
height:800px;
|
213 |
+
padding-top:200px !important;
|
214 |
+
}
|
215 |
+
#documenter_cover li{
|
216 |
+
list-style:none !important;
|
217 |
+
margin-left:0 !important;
|
218 |
+
}
|
219 |
+
#documenter_cover p{
|
220 |
+
width:500px;
|
221 |
+
}
|
222 |
+
#documenter_content section{
|
223 |
+
padding-top:70px;
|
224 |
+
}
|
225 |
+
#documenter_content h1{
|
226 |
+
font-size:30px;
|
227 |
+
font-weight:700;
|
228 |
+
}
|
229 |
+
#documenter_content h2{
|
230 |
+
font-size:20px;
|
231 |
+
margin-bottom:18px;
|
232 |
+
font-weight:100;
|
233 |
+
}
|
234 |
+
#documenter_content h3{
|
235 |
+
font-size:26px;
|
236 |
+
margin:18px 0 0;
|
237 |
+
font-weight:100;
|
238 |
+
}
|
239 |
+
#documenter_content h4{
|
240 |
+
font-size:20px;
|
241 |
+
margin:18px 0;
|
242 |
+
font-weight:100;
|
243 |
+
}
|
244 |
+
#documenter_content h5{
|
245 |
+
font-size:16px;
|
246 |
+
margin:18px 0;
|
247 |
+
font-weight:100;
|
248 |
+
}
|
249 |
+
#documenter_content h6{
|
250 |
+
font-size:14px;
|
251 |
+
margin:18px 0;
|
252 |
+
font-weight:100;
|
253 |
+
}
|
254 |
+
#documenter_content p{
|
255 |
+
margin:18px 0;
|
256 |
+
}
|
257 |
+
#documenter_content ol li{
|
258 |
+
list-style:decimal;
|
259 |
+
margin-left:36px;
|
260 |
+
}
|
261 |
+
#documenter_content ul li{
|
262 |
+
list-style:square;
|
263 |
+
margin-left:36px;
|
264 |
+
}
|
265 |
+
#documenter_content dl{
|
266 |
+
}
|
267 |
+
#documenter_content dl dt{
|
268 |
+
padding-top:12px;
|
269 |
+
font-weight:700;
|
270 |
+
font-size:14px;
|
271 |
+
}
|
272 |
+
#documenter_content dl dd{
|
273 |
+
padding-top:3px;
|
274 |
+
margin-left:18px;
|
275 |
+
}
|
276 |
+
#documenter_content table{
|
277 |
+
border-collapse:collapse;
|
278 |
+
}
|
279 |
+
#documenter_content table th{
|
280 |
+
font-weight:700;
|
281 |
+
}
|
282 |
+
#documenter_content table th, #documenter_content table td{
|
283 |
+
padding:3px;
|
284 |
+
text-align:left;
|
285 |
+
}
|
286 |
+
#documenter_content code{
|
287 |
+
font-family:"Courier New", Courier, monospace;
|
288 |
+
font-size:12px;
|
289 |
+
}
|
290 |
+
#documenter_content .warning{
|
291 |
+
padding:10px 10px 10px 30px;
|
292 |
+
border:1px solid #D5D458;
|
293 |
+
background-color:#F0FEB1;
|
294 |
+
background-image:url(img/warning.png);
|
295 |
+
background-repeat:no-repeat;
|
296 |
+
background-position: 8px 11px;
|
297 |
+
}
|
298 |
+
#documenter_content .info{
|
299 |
+
padding:10px 10px 10px 30px;
|
300 |
+
border:1px solid #6AB3FF;
|
301 |
+
background-color:#A3D0FF;
|
302 |
+
background-image:url(img/info.png);
|
303 |
+
background-repeat:no-repeat;
|
304 |
+
background-position: 8px 11px;
|
305 |
+
}
|
306 |
+
#documenter_content div.alert {
|
307 |
+
padding: 8px 35px 8px 14px;
|
308 |
+
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5);
|
309 |
+
background-color: #fcf8e3;
|
310 |
+
border: 1px solid #fbeed5;
|
311 |
+
-webkit-border-radius: 4px;
|
312 |
+
-moz-border-radius: 4px;
|
313 |
+
border-radius: 4px;
|
314 |
+
}
|
315 |
+
#documenter_content div.alert-success,#documenter_content div.alert-success div.alert-heading {
|
316 |
+
color: #468847;
|
317 |
+
}
|
318 |
+
#documenter_content div.alert-danger,#documenter_content div.alert-error {
|
319 |
+
background-color: #f2dede;
|
320 |
+
border-color: #eed3d7;
|
321 |
+
}
|
322 |
+
#documenter_content div.alert-danger,
|
323 |
+
#documenter_content div.alert-error,
|
324 |
+
#documenter_content div.alert-danger div.alert-heading,
|
325 |
+
#documenter_content div.alert-error div.alert-heading {
|
326 |
+
color: #b94a48;
|
327 |
+
}
|
328 |
+
#documenter_content div.alert-info {
|
329 |
+
background-color: #d9edf7;
|
330 |
+
border-color: #bce8f1;
|
331 |
+
}
|
332 |
+
#documenter_content div.alert-info,#documenter_content div.alert-info div.alert-heading {
|
333 |
+
color: #3a87ad;
|
334 |
+
}
|
335 |
+
#documenter_content div.alert-block {
|
336 |
+
padding-top: 14px;
|
337 |
+
padding-bottom: 14px;
|
338 |
+
}
|
339 |
+
#documenter_content div.alert-block > p,#documenter_content div.alert-block > ul {
|
340 |
+
margin-bottom: 0;
|
341 |
+
}
|
342 |
+
#documenter_content div.alert-block p + p {
|
343 |
+
margin-top: 5px;
|
344 |
+
}
|
345 |
+
|
346 |
+
|
347 |
+
|
348 |
+
|
349 |
+
|
350 |
+
/*----------------------------------------------------------------------*/
|
351 |
+
/* Print Styles
|
352 |
+
/*----------------------------------------------------------------------*/
|
353 |
+
|
354 |
+
@media print {
|
355 |
+
* { background: transparent !important; color: black !important; text-shadow: none !important; filter:none !important;
|
356 |
+
-ms-filter: none !important; } /* Black prints faster: sanbeiji.com/archives/953 */
|
357 |
+
a, a:visited { color: #444 !important; text-decoration: underline; }
|
358 |
+
a[href]:after { content: " (" attr(href) ")"; }
|
359 |
+
abbr[title]:after { content: " (" attr(title) ")"; }
|
360 |
+
.ir a:after, a[href^="javascript:"]:after, a[href^="#"]:after { content: ""; } /* Don't show links for images, or javascript/internal links */
|
361 |
+
pre, blockquote { border: 1px solid #999; page-break-inside: avoid; }
|
362 |
+
thead { display: table-header-group; } /* css-discuss.incutio.com/wiki/Printing_Tables */
|
363 |
+
tr, img { page-break-inside: avoid; }
|
364 |
+
@page { margin: 0.5cm; }
|
365 |
+
p, h2, h3 { orphans: 3; widows: 3; }
|
366 |
+
h2, h3{ page-break-after: avoid; }
|
367 |
+
hr { border-top:1px solid #000 !important;border-bottom:0 !important; }
|
368 |
+
|
369 |
+
#documenter_sidebar{
|
370 |
+
-moz-box-shadow:none;
|
371 |
+
-webkit-box-shadow:none;
|
372 |
+
box-shadow:none;
|
373 |
+
position:absolute;
|
374 |
+
left:10px;
|
375 |
+
top:0;
|
376 |
+
width:100%;
|
377 |
+
margin-top:500px;
|
378 |
+
}
|
379 |
+
#documenter_sidebar ul:before { content: "Table of Contents"; }
|
380 |
+
|
381 |
+
#documenter_sidebar ul{
|
382 |
+
border:0 !important;
|
383 |
+
}
|
384 |
+
#documenter_sidebar ul li{
|
385 |
+
border:0 !important;
|
386 |
+
text-align:left;
|
387 |
+
}
|
388 |
+
#documenter_sidebar ul li a{
|
389 |
+
border:0 !important;
|
390 |
+
text-align:left;
|
391 |
+
padding:4px;
|
392 |
+
}
|
393 |
+
#documenter_sidebar ul li a:hover{
|
394 |
+
border:0 !important;
|
395 |
+
}
|
396 |
+
#documenter_sidebar #documenter_logo{
|
397 |
+
display:none;
|
398 |
+
}
|
399 |
+
#documenter_sidebar #documenter_copyright{
|
400 |
+
display:none;
|
401 |
+
}
|
402 |
+
#documenter_content{
|
403 |
+
left:10px;
|
404 |
+
}
|
405 |
+
#documenter_cover{
|
406 |
+
margin-bottom:300px;
|
407 |
+
}
|
408 |
+
#documenter_content .warning{
|
409 |
+
background-image:url(img/warning.png) !important;
|
410 |
+
background-repeat:no-repeat !important;
|
411 |
+
background-position: 8px 11px !important;
|
412 |
+
}
|
413 |
+
#documenter_content .info{
|
414 |
+
background-image:url(img/info.png) !important;
|
415 |
+
background-repeat:no-repeat !important;
|
416 |
+
background-position: 8px 11px !important;
|
417 |
+
}
|
418 |
}
|
docs/assets/images/image_3.png
CHANGED
Binary file
|
docs/assets/images/image_4.png
CHANGED
Binary file
|
docs/assets/images/image_5.png
CHANGED
Binary file
|
docs/assets/images/image_6.png
CHANGED
Binary file
|
docs/assets/images/image_7.png
CHANGED
Binary file
|
docs/assets/js/google-code-prettify/prettify.css
CHANGED
@@ -1,30 +1,30 @@
|
|
1 |
-
.com { color: #93a1a1; }
|
2 |
-
.lit { color: #195f91; }
|
3 |
-
.pun, .opn, .clo { color: #93a1a1; }
|
4 |
-
.fun { color: #dc322f; }
|
5 |
-
.str, .atv { color: #D14; }
|
6 |
-
.kwd, .linenums .tag { color: #1e347b; }
|
7 |
-
.typ, .atn, .dec, .var { color: teal; }
|
8 |
-
.pln { color: #48484c; }
|
9 |
-
|
10 |
-
.prettyprint {
|
11 |
-
padding: 8px;
|
12 |
-
background-color: #f7f7f9;
|
13 |
-
border: 1px solid #e1e1e8;
|
14 |
-
}
|
15 |
-
.prettyprint.linenums {
|
16 |
-
-webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
|
17 |
-
-moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
|
18 |
-
box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
|
19 |
-
}
|
20 |
-
|
21 |
-
/* Specify class=linenums on a pre to get line numbering */
|
22 |
-
ol.linenums {
|
23 |
-
margin: 0 0 0 33px; /* IE indents via margin-left */
|
24 |
-
}
|
25 |
-
ol.linenums li {
|
26 |
-
padding-left: 12px;
|
27 |
-
color: #bebec5;
|
28 |
-
line-height: 18px;
|
29 |
-
text-shadow: 0 1px 0 #fff;
|
30 |
}
|
1 |
+
.com { color: #93a1a1; }
|
2 |
+
.lit { color: #195f91; }
|
3 |
+
.pun, .opn, .clo { color: #93a1a1; }
|
4 |
+
.fun { color: #dc322f; }
|
5 |
+
.str, .atv { color: #D14; }
|
6 |
+
.kwd, .linenums .tag { color: #1e347b; }
|
7 |
+
.typ, .atn, .dec, .var { color: teal; }
|
8 |
+
.pln { color: #48484c; }
|
9 |
+
|
10 |
+
.prettyprint {
|
11 |
+
padding: 8px;
|
12 |
+
background-color: #f7f7f9;
|
13 |
+
border: 1px solid #e1e1e8;
|
14 |
+
}
|
15 |
+
.prettyprint.linenums {
|
16 |
+
-webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
|
17 |
+
-moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
|
18 |
+
box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
|
19 |
+
}
|
20 |
+
|
21 |
+
/* Specify class=linenums on a pre to get line numbering */
|
22 |
+
ol.linenums {
|
23 |
+
margin: 0 0 0 33px; /* IE indents via margin-left */
|
24 |
+
}
|
25 |
+
ol.linenums li {
|
26 |
+
padding-left: 12px;
|
27 |
+
color: #bebec5;
|
28 |
+
line-height: 18px;
|
29 |
+
text-shadow: 0 1px 0 #fff;
|
30 |
}
|
docs/assets/js/google-code-prettify/prettify.js
CHANGED
@@ -1,28 +1,28 @@
|
|
1 |
-
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
2 |
-
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
|
3 |
-
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
|
4 |
-
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
|
5 |
-
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
|
6 |
-
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
|
7 |
-
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
|
8 |
-
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
|
9 |
-
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
|
10 |
-
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
|
11 |
-
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
|
12 |
-
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
|
13 |
-
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
|
14 |
-
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
|
15 |
-
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
|
16 |
-
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
|
17 |
-
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
|
18 |
-
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
|
19 |
-
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
|
20 |
-
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
|
21 |
-
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
|
22 |
-
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
|
23 |
-
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
|
24 |
-
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
|
25 |
-
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
|
26 |
-
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
|
27 |
-
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
|
28 |
-
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
|
1 |
+
var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
|
2 |
+
(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
|
3 |
+
[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c<i;++c){var j=f[c];if(/\\[bdsw]/i.test(j))a.push(j);else{var j=m(j),d;c+2<i&&"-"===f[c+1]?(d=m(f[c+2]),c+=2):d=j;b.push([j,d]);d<65||j>122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;c<b.length;++c)i=b[c],i[0]<=j[1]+1?j[1]=Math.max(j[1],i[1]):f.push(j=i);b=["["];o&&b.push("^");b.push.apply(b,a);for(c=0;c<
|
4 |
+
f.length;++c)i=f[c],b.push(e(i[0])),i[1]>i[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c<b;++c){var j=f[c];j==="("?++i:"\\"===j.charAt(0)&&(j=+j.substring(1))&&j<=i&&(d[j]=-1)}for(c=1;c<d.length;++c)-1===d[c]&&(d[c]=++t);for(i=c=0;c<b;++c)j=f[c],j==="("?(++i,d[i]===void 0&&(f[c]="(?:")):"\\"===j.charAt(0)&&
|
5 |
+
(j=+j.substring(1))&&j<=i&&(f[c]="\\"+d[i]);for(i=c=0;c<b;++c)"^"===f[c]&&"^"!==f[c+1]&&(f[c]="");if(a.ignoreCase&&s)for(c=0;c<b;++c)j=f[c],a=j.charAt(0),j.length>=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p<d;++p){var g=a[p];if(g.ignoreCase)l=!0;else if(/[a-z]/i.test(g.source.replace(/\\u[\da-f]{4}|\\x[\da-f]{2}|\\[^UXux]/gi,""))){s=!0;l=!1;break}}for(var r=
|
6 |
+
{b:8,t:9,n:10,v:11,f:12,r:13},n=[],p=0,d=a.length;p<d;++p){g=a[p];if(g.global||g.multiline)throw Error(""+g);n.push("(?:"+y(g)+")")}return RegExp(n.join("|"),l?"gi":"g")}function M(a){function m(a){switch(a.nodeType){case 1:if(e.test(a.className))break;for(var g=a.firstChild;g;g=g.nextSibling)m(g);g=a.nodeName;if("BR"===g||"LI"===g)h[s]="\n",t[s<<1]=y++,t[s++<<1|1]=a;break;case 3:case 4:g=a.nodeValue,g.length&&(g=p?g.replace(/\r\n?/g,"\n"):g.replace(/[\t\n\r ]+/g," "),h[s]=g,t[s<<1]=y,y+=g.length,
|
7 |
+
t[s++<<1|1]=a)}}var e=/(?:^|\s)nocode(?:\s|$)/,h=[],y=0,t=[],s=0,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=document.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);m(a);return{a:h.join("").replace(/\n$/,""),c:t}}function B(a,m,e,h){m&&(a={a:m,d:a},e(a),h.push.apply(h,a.e))}function x(a,m){function e(a){for(var l=a.d,p=[l,"pln"],d=0,g=a.a.match(y)||[],r={},n=0,z=g.length;n<z;++n){var f=g[n],b=r[f],o=void 0,c;if(typeof b===
|
8 |
+
"string")c=!1;else{var i=h[f.charAt(0)];if(i)o=f.match(i[1]),b=i[0];else{for(c=0;c<t;++c)if(i=m[c],o=f.match(i[1])){b=i[0];break}o||(b="pln")}if((c=b.length>=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
|
9 |
+
l=[],p={},d=0,g=e.length;d<g;++d){var r=e[d],n=r[3];if(n)for(var k=n.length;--k>=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
|
10 |
+
q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
|
11 |
+
q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
|
12 |
+
"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
|
13 |
+
a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
|
14 |
+
for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g<d.length;++g)e(d[g]);m===(m|0)&&d[0].setAttribute("value",
|
15 |
+
m);var r=s.createElement("OL");r.className="linenums";for(var n=Math.max(0,m-1|0)||0,g=0,z=d.length;g<z;++g)l=d[g],l.className="L"+(g+n)%10,l.firstChild||l.appendChild(s.createTextNode("\xa0")),r.appendChild(l);a.appendChild(r)}function k(a,m){for(var e=m.length;--e>=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*</.test(m)?"default-markup":"default-code";return A[a]}function E(a){var m=
|
16 |
+
a.g;try{var e=M(a.h),h=e.a;a.a=h;a.c=e.c;a.d=0;C(m,h)(a);var k=/\bMSIE\b/.test(navigator.userAgent),m=/\n/g,t=a.a,s=t.length,e=0,l=a.c,p=l.length,h=0,d=a.e,g=d.length,a=0;d[g]=s;var r,n;for(n=r=0;n<g;)d[n]!==d[n+2]?(d[r++]=d[n++],d[r++]=d[n++]):n+=2;g=r;for(n=r=0;n<g;){for(var z=d[n],f=d[n+1],b=n+2;b+2<=g&&d[b+1]===f;)b+=2;d[r++]=z;d[r++]=f;n=b}for(d.length=r;h<p;){var o=l[h+2]||s,c=d[a+2]||s,b=Math.min(o,c),i=l[h+1],j;if(i.nodeType!==1&&(j=t.substring(e,b))){k&&(j=j.replace(m,"\r"));i.nodeValue=
|
17 |
+
j;var u=i.ownerDocument,v=u.createElement("SPAN");v.className=d[a+1];var x=i.parentNode;x.replaceChild(v,i);v.appendChild(i);e<o&&(l[h+1]=i=u.createTextNode(t.substring(b,o)),x.insertBefore(i,v.nextSibling))}e=b;e>=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
|
18 |
+
"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
|
19 |
+
H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
|
20 |
+
J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
|
21 |
+
I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^<?]+/],["dec",/^<!\w[^>]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
|
22 |
+
["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
|
23 |
+
/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
|
24 |
+
["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
|
25 |
+
hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p<h.length&&l.now()<e;p++){var n=h[p],k=n.className;if(k.indexOf("prettyprint")>=0){var k=k.match(g),f,b;if(b=
|
26 |
+
!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p<h.length?setTimeout(m,
|
27 |
+
250):a&&a()}for(var e=[document.getElementsByTagName("pre"),document.getElementsByTagName("code"),document.getElementsByTagName("xmp")],h=[],k=0;k<e.length;++k)for(var t=0,s=e[k].length;t<s;++t)h.push(e[k][t]);var e=q,l=Date;l.now||(l={now:function(){return+new Date}});var p=0,d,g=/\blang(?:uage)?-([\w.]+)(?!\S)/;m()};window.PR={createSimpleLexer:x,registerLangHandler:k,sourceDecorator:u,PR_ATTRIB_NAME:"atn",PR_ATTRIB_VALUE:"atv",PR_COMMENT:"com",PR_DECLARATION:"dec",PR_KEYWORD:"kwd",PR_LITERAL:"lit",
|
28 |
+
PR_NOCODE:"nocode",PR_PLAIN:"pln",PR_PUNCTUATION:"pun",PR_SOURCE:"src",PR_STRING:"str",PR_TAG:"tag",PR_TYPE:"typ"}})();
|
docs/assets/js/jquery.js
CHANGED
@@ -1,9252 +1,9252 @@
|
|
1 |
-
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
2 |
-
(function( window, undefined ) {
|
3 |
-
|
4 |
-
// Use the correct document accordingly with window argument (sandbox)
|
5 |
-
var document = window.document,
|
6 |
-
navigator = window.navigator,
|
7 |
-
location = window.location;
|
8 |
-
var jQuery = (function() {
|
9 |
-
|
10 |
-
// Define a local copy of jQuery
|
11 |
-
var jQuery = function( selector, context ) {
|
12 |
-
// The jQuery object is actually just the init constructor 'enhanced'
|
13 |
-
return new jQuery.fn.init( selector, context, rootjQuery );
|
14 |
-
},
|
15 |
-
|
16 |
-
// Map over jQuery in case of overwrite
|
17 |
-
_jQuery = window.jQuery,
|
18 |
-
|
19 |
-
// Map over the $ in case of overwrite
|
20 |
-
_$ = window.$,
|
21 |
-
|
22 |
-
// A central reference to the root jQuery(document)
|
23 |
-
rootjQuery,
|
24 |
-
|
25 |
-
// A simple way to check for HTML strings or ID strings
|
26 |
-
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
27 |
-
quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
|
28 |
-
|
29 |
-
// Check if a string has a non-whitespace character in it
|
30 |
-
rnotwhite = /\S/,
|
31 |
-
|
32 |
-
// Used for trimming whitespace
|
33 |
-
trimLeft = /^\s+/,
|
34 |
-
trimRight = /\s+$/,
|
35 |
-
|
36 |
-
// Match a standalone tag
|
37 |
-
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
38 |
-
|
39 |
-
// JSON RegExp
|
40 |
-
rvalidchars = /^[\],:{}\s]*$/,
|
41 |
-
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
|
42 |
-
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
43 |
-
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
|
44 |
-
|
45 |
-
// Useragent RegExp
|
46 |
-
rwebkit = /(webkit)[ \/]([\w.]+)/,
|
47 |
-
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
|
48 |
-
rmsie = /(msie) ([\w.]+)/,
|
49 |
-
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
|
50 |
-
|
51 |
-
// Matches dashed string for camelizing
|
52 |
-
rdashAlpha = /-([a-z]|[0-9])/ig,
|
53 |
-
rmsPrefix = /^-ms-/,
|
54 |
-
|
55 |
-
// Used by jQuery.camelCase as callback to replace()
|
56 |
-
fcamelCase = function( all, letter ) {
|
57 |
-
return ( letter + "" ).toUpperCase();
|
58 |
-
},
|
59 |
-
|
60 |
-
// Keep a UserAgent string for use with jQuery.browser
|
61 |
-
userAgent = navigator.userAgent,
|
62 |
-
|
63 |
-
// For matching the engine and version of the browser
|
64 |
-
browserMatch,
|
65 |
-
|
66 |
-
// The deferred used on DOM ready
|
67 |
-
readyList,
|
68 |
-
|
69 |
-
// The ready event handler
|
70 |
-
DOMContentLoaded,
|
71 |
-
|
72 |
-
// Save a reference to some core methods
|
73 |
-
toString = Object.prototype.toString,
|
74 |
-
hasOwn = Object.prototype.hasOwnProperty,
|
75 |
-
push = Array.prototype.push,
|
76 |
-
slice = Array.prototype.slice,
|
77 |
-
trim = String.prototype.trim,
|
78 |
-
indexOf = Array.prototype.indexOf,
|
79 |
-
|
80 |
-
// [[Class]] -> type pairs
|
81 |
-
class2type = {};
|
82 |
-
|
83 |
-
jQuery.fn = jQuery.prototype = {
|
84 |
-
constructor: jQuery,
|
85 |
-
init: function( selector, context, rootjQuery ) {
|
86 |
-
var match, elem, ret, doc;
|
87 |
-
|
88 |
-
// Handle $(""), $(null), or $(undefined)
|
89 |
-
if ( !selector ) {
|
90 |
-
return this;
|
91 |
-
}
|
92 |
-
|
93 |
-
// Handle $(DOMElement)
|
94 |
-
if ( selector.nodeType ) {
|
95 |
-
this.context = this[0] = selector;
|
96 |
-
this.length = 1;
|
97 |
-
return this;
|
98 |
-
}
|
99 |
-
|
100 |
-
// The body element only exists once, optimize finding it
|
101 |
-
if ( selector === "body" && !context && document.body ) {
|
102 |
-
this.context = document;
|
103 |
-
this[0] = document.body;
|
104 |
-
this.selector = selector;
|
105 |
-
this.length = 1;
|
106 |
-
return this;
|
107 |
-
}
|
108 |
-
|
109 |
-
// Handle HTML strings
|
110 |
-
if ( typeof selector === "string" ) {
|
111 |
-
// Are we dealing with HTML string or an ID?
|
112 |
-
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
|
113 |
-
// Assume that strings that start and end with <> are HTML and skip the regex check
|
114 |
-
match = [ null, selector, null ];
|
115 |
-
|
116 |
-
} else {
|
117 |
-
match = quickExpr.exec( selector );
|
118 |
-
}
|
119 |
-
|
120 |
-
// Verify a match, and that no context was specified for #id
|
121 |
-
if ( match && (match[1] || !context) ) {
|
122 |
-
|
123 |
-
// HANDLE: $(html) -> $(array)
|
124 |
-
if ( match[1] ) {
|
125 |
-
context = context instanceof jQuery ? context[0] : context;
|
126 |
-
doc = ( context ? context.ownerDocument || context : document );
|
127 |
-
|
128 |
-
// If a single string is passed in and it's a single tag
|
129 |
-
// just do a createElement and skip the rest
|
130 |
-
ret = rsingleTag.exec( selector );
|
131 |
-
|
132 |
-
if ( ret ) {
|
133 |
-
if ( jQuery.isPlainObject( context ) ) {
|
134 |
-
selector = [ document.createElement( ret[1] ) ];
|
135 |
-
jQuery.fn.attr.call( selector, context, true );
|
136 |
-
|
137 |
-
} else {
|
138 |
-
selector = [ doc.createElement( ret[1] ) ];
|
139 |
-
}
|
140 |
-
|
141 |
-
} else {
|
142 |
-
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
|
143 |
-
selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
|
144 |
-
}
|
145 |
-
|
146 |
-
return jQuery.merge( this, selector );
|
147 |
-
|
148 |
-
// HANDLE: $("#id")
|
149 |
-
} else {
|
150 |
-
elem = document.getElementById( match[2] );
|
151 |
-
|
152 |
-
// Check parentNode to catch when Blackberry 4.6 returns
|
153 |
-
// nodes that are no longer in the document #6963
|
154 |
-
if ( elem && elem.parentNode ) {
|
155 |
-
// Handle the case where IE and Opera return items
|
156 |
-
// by name instead of ID
|
157 |
-
if ( elem.id !== match[2] ) {
|
158 |
-
return rootjQuery.find( selector );
|
159 |
-
}
|
160 |
-
|
161 |
-
// Otherwise, we inject the element directly into the jQuery object
|
162 |
-
this.length = 1;
|
163 |
-
this[0] = elem;
|
164 |
-
}
|
165 |
-
|
166 |
-
this.context = document;
|
167 |
-
this.selector = selector;
|
168 |
-
return this;
|
169 |
-
}
|
170 |
-
|
171 |
-
// HANDLE: $(expr, $(...))
|
172 |
-
} else if ( !context || context.jquery ) {
|
173 |
-
return ( context || rootjQuery ).find( selector );
|
174 |
-
|
175 |
-
// HANDLE: $(expr, context)
|
176 |
-
// (which is just equivalent to: $(context).find(expr)
|
177 |
-
} else {
|
178 |
-
return this.constructor( context ).find( selector );
|
179 |
-
}
|
180 |
-
|
181 |
-
// HANDLE: $(function)
|
182 |
-
// Shortcut for document ready
|
183 |
-
} else if ( jQuery.isFunction( selector ) ) {
|
184 |
-
return rootjQuery.ready( selector );
|
185 |
-
}
|
186 |
-
|
187 |
-
if ( selector.selector !== undefined ) {
|
188 |
-
this.selector = selector.selector;
|
189 |
-
this.context = selector.context;
|
190 |
-
}
|
191 |
-
|
192 |
-
return jQuery.makeArray( selector, this );
|
193 |
-
},
|
194 |
-
|
195 |
-
// Start with an empty selector
|
196 |
-
selector: "",
|
197 |
-
|
198 |
-
// The current version of jQuery being used
|
199 |
-
jquery: "1.7.1",
|
200 |
-
|
201 |
-
// The default length of a jQuery object is 0
|
202 |
-
length: 0,
|
203 |
-
|
204 |
-
// The number of elements contained in the matched element set
|
205 |
-
size: function() {
|
206 |
-
return this.length;
|
207 |
-
},
|
208 |
-
|
209 |
-
toArray: function() {
|
210 |
-
return slice.call( this, 0 );
|
211 |
-
},
|
212 |
-
|
213 |
-
// Get the Nth element in the matched element set OR
|
214 |
-
// Get the whole matched element set as a clean array
|
215 |
-
get: function( num ) {
|
216 |
-
return num == null ?
|
217 |
-
|
218 |
-
// Return a 'clean' array
|
219 |
-
this.toArray() :
|
220 |
-
|
221 |
-
// Return just the object
|
222 |
-
( num < 0 ? this[ this.length + num ] : this[ num ] );
|
223 |
-
},
|
224 |
-
|
225 |
-
// Take an array of elements and push it onto the stack
|
226 |
-
// (returning the new matched element set)
|
227 |
-
pushStack: function( elems, name, selector ) {
|
228 |
-
// Build a new jQuery matched element set
|
229 |
-
var ret = this.constructor();
|
230 |
-
|
231 |
-
if ( jQuery.isArray( elems ) ) {
|
232 |
-
push.apply( ret, elems );
|
233 |
-
|
234 |
-
} else {
|
235 |
-
jQuery.merge( ret, elems );
|
236 |
-
}
|
237 |
-
|
238 |
-
// Add the old object onto the stack (as a reference)
|
239 |
-
ret.prevObject = this;
|
240 |
-
|
241 |
-
ret.context = this.context;
|
242 |
-
|
243 |
-
if ( name === "find" ) {
|
244 |
-
ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
|
245 |
-
} else if ( name ) {
|
246 |
-
ret.selector = this.selector + "." + name + "(" + selector + ")";
|
247 |
-
}
|
248 |
-
|
249 |
-
// Return the newly-formed element set
|
250 |
-
return ret;
|
251 |
-
},
|
252 |
-
|
253 |
-
// Execute a callback for every element in the matched set.
|
254 |
-
// (You can seed the arguments with an array of args, but this is
|
255 |
-
// only used internally.)
|
256 |
-
each: function( callback, args ) {
|
257 |
-
return jQuery.each( this, callback, args );
|
258 |
-
},
|
259 |
-
|
260 |
-
ready: function( fn ) {
|
261 |
-
// Attach the listeners
|
262 |
-
jQuery.bindReady();
|
263 |
-
|
264 |
-
// Add the callback
|
265 |
-
readyList.add( fn );
|
266 |
-
|
267 |
-
return this;
|
268 |
-
},
|
269 |
-
|
270 |
-
eq: function( i ) {
|
271 |
-
i = +i;
|
272 |
-
return i === -1 ?
|
273 |
-
this.slice( i ) :
|
274 |
-
this.slice( i, i + 1 );
|
275 |
-
},
|
276 |
-
|
277 |
-
first: function() {
|
278 |
-
return this.eq( 0 );
|
279 |
-
},
|
280 |
-
|
281 |
-
last: function() {
|
282 |
-
return this.eq( -1 );
|
283 |
-
},
|
284 |
-
|
285 |
-
slice: function() {
|
286 |
-
return this.pushStack( slice.apply( this, arguments ),
|
287 |
-
"slice", slice.call(arguments).join(",") );
|
288 |
-
},
|
289 |
-
|
290 |
-
map: function( callback ) {
|
291 |
-
return this.pushStack( jQuery.map(this, function( elem, i ) {
|
292 |
-
return callback.call( elem, i, elem );
|
293 |
-
}));
|
294 |
-
},
|
295 |
-
|
296 |
-
end: function() {
|
297 |
-
return this.prevObject || this.constructor(null);
|
298 |
-
},
|
299 |
-
|
300 |
-
// For internal use only.
|
301 |
-
// Behaves like an Array's method, not like a jQuery method.
|
302 |
-
push: push,
|
303 |
-
sort: [].sort,
|
304 |
-
splice: [].splice
|
305 |
-
};
|
306 |
-
|
307 |
-
// Give the init function the jQuery prototype for later instantiation
|
308 |
-
jQuery.fn.init.prototype = jQuery.fn;
|
309 |
-
|
310 |
-
jQuery.extend = jQuery.fn.extend = function() {
|
311 |
-
var options, name, src, copy, copyIsArray, clone,
|
312 |
-
target = arguments[0] || {},
|
313 |
-
i = 1,
|
314 |
-
length = arguments.length,
|
315 |
-
deep = false;
|
316 |
-
|
317 |
-
// Handle a deep copy situation
|
318 |
-
if ( typeof target === "boolean" ) {
|
319 |
-
deep = target;
|
320 |
-
target = arguments[1] || {};
|
321 |
-
// skip the boolean and the target
|
322 |
-
i = 2;
|
323 |
-
}
|
324 |
-
|
325 |
-
// Handle case when target is a string or something (possible in deep copy)
|
326 |
-
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
327 |
-
target = {};
|
328 |
-
}
|
329 |
-
|
330 |
-
// extend jQuery itself if only one argument is passed
|
331 |
-
if ( length === i ) {
|
332 |
-
target = this;
|
333 |
-
--i;
|
334 |
-
}
|
335 |
-
|
336 |
-
for ( ; i < length; i++ ) {
|
337 |
-
// Only deal with non-null/undefined values
|
338 |
-
if ( (options = arguments[ i ]) != null ) {
|
339 |
-
// Extend the base object
|
340 |
-
for ( name in options ) {
|
341 |
-
src = target[ name ];
|
342 |
-
copy = options[ name ];
|
343 |
-
|
344 |
-
// Prevent never-ending loop
|
345 |
-
if ( target === copy ) {
|
346 |
-
continue;
|
347 |
-
}
|
348 |
-
|
349 |
-
// Recurse if we're merging plain objects or arrays
|
350 |
-
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
351 |
-
if ( copyIsArray ) {
|
352 |
-
copyIsArray = false;
|
353 |
-
clone = src && jQuery.isArray(src) ? src : [];
|
354 |
-
|
355 |
-
} else {
|
356 |
-
clone = src && jQuery.isPlainObject(src) ? src : {};
|
357 |
-
}
|
358 |
-
|
359 |
-
// Never move original objects, clone them
|
360 |
-
target[ name ] = jQuery.extend( deep, clone, copy );
|
361 |
-
|
362 |
-
// Don't bring in undefined values
|
363 |
-
} else if ( copy !== undefined ) {
|
364 |
-
target[ name ] = copy;
|
365 |
-
}
|
366 |
-
}
|
367 |
-
}
|
368 |
-
}
|
369 |
-
|
370 |
-
// Return the modified object
|
371 |
-
return target;
|
372 |
-
};
|
373 |
-
|
374 |
-
jQuery.extend({
|
375 |
-
noConflict: function( deep ) {
|
376 |
-
if ( window.$ === jQuery ) {
|
377 |
-
window.$ = _$;
|
378 |
-
}
|
379 |
-
|
380 |
-
if ( deep && window.jQuery === jQuery ) {
|
381 |
-
window.jQuery = _jQuery;
|
382 |
-
}
|
383 |
-
|
384 |
-
return jQuery;
|
385 |
-
},
|
386 |
-
|
387 |
-
// Is the DOM ready to be used? Set to true once it occurs.
|
388 |
-
isReady: false,
|
389 |
-
|
390 |
-
// A counter to track how many items to wait for before
|
391 |
-
// the ready event fires. See #6781
|
392 |
-
readyWait: 1,
|
393 |
-
|
394 |
-
// Hold (or release) the ready event
|
395 |
-
holdReady: function( hold ) {
|
396 |
-
if ( hold ) {
|
397 |
-
jQuery.readyWait++;
|
398 |
-
} else {
|
399 |
-
jQuery.ready( true );
|
400 |
-
}
|
401 |
-
},
|
402 |
-
|
403 |
-
// Handle when the DOM is ready
|
404 |
-
ready: function( wait ) {
|
405 |
-
// Either a released hold or an DOMready/load event and not yet ready
|
406 |
-
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
|
407 |
-
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
|
408 |
-
if ( !document.body ) {
|
409 |
-
return setTimeout( jQuery.ready, 1 );
|
410 |
-
}
|
411 |
-
|
412 |
-
// Remember that the DOM is ready
|
413 |
-
jQuery.isReady = true;
|
414 |
-
|
415 |
-
// If a normal DOM Ready event fired, decrement, and wait if need be
|
416 |
-
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
417 |
-
return;
|
418 |
-
}
|
419 |
-
|
420 |
-
// If there are functions bound, to execute
|
421 |
-
readyList.fireWith( document, [ jQuery ] );
|
422 |
-
|
423 |
-
// Trigger any bound ready events
|
424 |
-
if ( jQuery.fn.trigger ) {
|
425 |
-
jQuery( document ).trigger( "ready" ).off( "ready" );
|
426 |
-
}
|
427 |
-
}
|
428 |
-
},
|
429 |
-
|
430 |
-
bindReady: function() {
|
431 |
-
if ( readyList ) {
|
432 |
-
return;
|
433 |
-
}
|
434 |
-
|
435 |
-
readyList = jQuery.Callbacks( "once memory" );
|
436 |
-
|
437 |
-
// Catch cases where $(document).ready() is called after the
|
438 |
-
// browser event has already occurred.
|
439 |
-
if ( document.readyState === "complete" ) {
|
440 |
-
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
441 |
-
return setTimeout( jQuery.ready, 1 );
|
442 |
-
}
|
443 |
-
|
444 |
-
// Mozilla, Opera and webkit nightlies currently support this event
|
445 |
-
if ( document.addEventListener ) {
|
446 |
-
// Use the handy event callback
|
447 |
-
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
448 |
-
|
449 |
-
// A fallback to window.onload, that will always work
|
450 |
-
window.addEventListener( "load", jQuery.ready, false );
|
451 |
-
|
452 |
-
// If IE event model is used
|
453 |
-
} else if ( document.attachEvent ) {
|
454 |
-
// ensure firing before onload,
|
455 |
-
// maybe late but safe also for iframes
|
456 |
-
document.attachEvent( "onreadystatechange", DOMContentLoaded );
|
457 |
-
|
458 |
-
// A fallback to window.onload, that will always work
|
459 |
-
window.attachEvent( "onload", jQuery.ready );
|
460 |
-
|
461 |
-
// If IE and not a frame
|
462 |
-
// continually check to see if the document is ready
|
463 |
-
var toplevel = false;
|
464 |
-
|
465 |
-
try {
|
466 |
-
toplevel = window.frameElement == null;
|
467 |
-
} catch(e) {}
|
468 |
-
|
469 |
-
if ( document.documentElement.doScroll && toplevel ) {
|
470 |
-
doScrollCheck();
|
471 |
-
}
|
472 |
-
}
|
473 |
-
},
|
474 |
-
|
475 |
-
// See test/unit/core.js for details concerning isFunction.
|
476 |
-
// Since version 1.3, DOM methods and functions like alert
|
477 |
-
// aren't supported. They return false on IE (#2968).
|
478 |
-
isFunction: function( obj ) {
|
479 |
-
return jQuery.type(obj) === "function";
|
480 |
-
},
|
481 |
-
|
482 |
-
isArray: Array.isArray || function( obj ) {
|
483 |
-
return jQuery.type(obj) === "array";
|
484 |
-
},
|
485 |
-
|
486 |
-
// A crude way of determining if an object is a window
|
487 |
-
isWindow: function( obj ) {
|
488 |
-
return obj && typeof obj === "object" && "setInterval" in obj;
|
489 |
-
},
|
490 |
-
|
491 |
-
isNumeric: function( obj ) {
|
492 |
-
return !isNaN( parseFloat(obj) ) && isFinite( obj );
|
493 |
-
},
|
494 |
-
|
495 |
-
type: function( obj ) {
|
496 |
-
return obj == null ?
|
497 |
-
String( obj ) :
|
498 |
-
class2type[ toString.call(obj) ] || "object";
|
499 |
-
},
|
500 |
-
|
501 |
-
isPlainObject: function( obj ) {
|
502 |
-
// Must be an Object.
|
503 |
-
// Because of IE, we also have to check the presence of the constructor property.
|
504 |
-
// Make sure that DOM nodes and window objects don't pass through, as well
|
505 |
-
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
506 |
-
return false;
|
507 |
-
}
|
508 |
-
|
509 |
-
try {
|
510 |
-
// Not own constructor property must be Object
|
511 |
-
if ( obj.constructor &&
|
512 |
-
!hasOwn.call(obj, "constructor") &&
|
513 |
-
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
|
514 |
-
return false;
|
515 |
-
}
|
516 |
-
} catch ( e ) {
|
517 |
-
// IE8,9 Will throw exceptions on certain host objects #9897
|
518 |
-
return false;
|
519 |
-
}
|
520 |
-
|
521 |
-
// Own properties are enumerated firstly, so to speed up,
|
522 |
-
// if last one is own, then all properties are own.
|
523 |
-
|
524 |
-
var key;
|
525 |
-
for ( key in obj ) {}
|
526 |
-
|
527 |
-
return key === undefined || hasOwn.call( obj, key );
|
528 |
-
},
|
529 |
-
|
530 |
-
isEmptyObject: function( obj ) {
|
531 |
-
for ( var name in obj ) {
|
532 |
-
return false;
|
533 |
-
}
|
534 |
-
return true;
|
535 |
-
},
|
536 |
-
|
537 |
-
error: function( msg ) {
|
538 |
-
throw new Error( msg );
|
539 |
-
},
|
540 |
-
|
541 |
-
parseJSON: function( data ) {
|
542 |
-
if ( typeof data !== "string" || !data ) {
|
543 |
-
return null;
|
544 |
-
}
|
545 |
-
|
546 |
-
// Make sure leading/trailing whitespace is removed (IE can't handle it)
|
547 |
-
data = jQuery.trim( data );
|
548 |
-
|
549 |
-
// Attempt to parse using the native JSON parser first
|
550 |
-
if ( window.JSON && window.JSON.parse ) {
|
551 |
-
return window.JSON.parse( data );
|
552 |
-
}
|
553 |
-
|
554 |
-
// Make sure the incoming data is actual JSON
|
555 |
-
// Logic borrowed from http://json.org/json2.js
|
556 |
-
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
|
557 |
-
.replace( rvalidtokens, "]" )
|
558 |
-
.replace( rvalidbraces, "")) ) {
|
559 |
-
|
560 |
-
return ( new Function( "return " + data ) )();
|
561 |
-
|
562 |
-
}
|
563 |
-
jQuery.error( "Invalid JSON: " + data );
|
564 |
-
},
|
565 |
-
|
566 |
-
// Cross-browser xml parsing
|
567 |
-
parseXML: function( data ) {
|
568 |
-
var xml, tmp;
|
569 |
-
try {
|
570 |
-
if ( window.DOMParser ) { // Standard
|
571 |
-
tmp = new DOMParser();
|
572 |
-
xml = tmp.parseFromString( data , "text/xml" );
|
573 |
-
} else { // IE
|
574 |
-
xml = new ActiveXObject( "Microsoft.XMLDOM" );
|
575 |
-
xml.async = "false";
|
576 |
-
xml.loadXML( data );
|
577 |
-
}
|
578 |
-
} catch( e ) {
|
579 |
-
xml = undefined;
|
580 |
-
}
|
581 |
-
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
|
582 |
-
jQuery.error( "Invalid XML: " + data );
|
583 |
-
}
|
584 |
-
return xml;
|
585 |
-
},
|
586 |
-
|
587 |
-
noop: function() {},
|
588 |
-
|
589 |
-
// Evaluates a script in a global context
|
590 |
-
// Workarounds based on findings by Jim Driscoll
|
591 |
-
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
|
592 |
-
globalEval: function( data ) {
|
593 |
-
if ( data && rnotwhite.test( data ) ) {
|
594 |
-
// We use execScript on Internet Explorer
|
595 |
-
// We use an anonymous function so that context is window
|
596 |
-
// rather than jQuery in Firefox
|
597 |
-
( window.execScript || function( data ) {
|
598 |
-
window[ "eval" ].call( window, data );
|
599 |
-
} )( data );
|
600 |
-
}
|
601 |
-
},
|
602 |
-
|
603 |
-
// Convert dashed to camelCase; used by the css and data modules
|
604 |
-
// Microsoft forgot to hump their vendor prefix (#9572)
|
605 |
-
camelCase: function( string ) {
|
606 |
-
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
607 |
-
},
|
608 |
-
|
609 |
-
nodeName: function( elem, name ) {
|
610 |
-
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
|
611 |
-
},
|
612 |
-
|
613 |
-
// args is for internal usage only
|
614 |
-
each: function( object, callback, args ) {
|
615 |
-
var name, i = 0,
|
616 |
-
length = object.length,
|
617 |
-
isObj = length === undefined || jQuery.isFunction( object );
|
618 |
-
|
619 |
-
if ( args ) {
|
620 |
-
if ( isObj ) {
|
621 |
-
for ( name in object ) {
|
622 |
-
if ( callback.apply( object[ name ], args ) === false ) {
|
623 |
-
break;
|
624 |
-
}
|
625 |
-
}
|
626 |
-
} else {
|
627 |
-
for ( ; i < length; ) {
|
628 |
-
if ( callback.apply( object[ i++ ], args ) === false ) {
|
629 |
-
break;
|
630 |
-
}
|
631 |
-
}
|
632 |
-
}
|
633 |
-
|
634 |
-
// A special, fast, case for the most common use of each
|
635 |
-
} else {
|
636 |
-
if ( isObj ) {
|
637 |
-
for ( name in object ) {
|
638 |
-
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
|
639 |
-
break;
|
640 |
-
}
|
641 |
-
}
|
642 |
-
} else {
|
643 |
-
for ( ; i < length; ) {
|
644 |
-
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
|
645 |
-
break;
|
646 |
-
}
|
647 |
-
}
|
648 |
-
}
|
649 |
-
}
|
650 |
-
|
651 |
-
return object;
|
652 |
-
},
|
653 |
-
|
654 |
-
// Use native String.trim function wherever possible
|
655 |
-
trim: trim ?
|
656 |
-
function( text ) {
|
657 |
-
return text == null ?
|
658 |
-
"" :
|
659 |
-
trim.call( text );
|
660 |
-
} :
|
661 |
-
|
662 |
-
// Otherwise use our own trimming functionality
|
663 |
-
function( text ) {
|
664 |
-
return text == null ?
|
665 |
-
"" :
|
666 |
-
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
|
667 |
-
},
|
668 |
-
|
669 |
-
// results is for internal usage only
|
670 |
-
makeArray: function( array, results ) {
|
671 |
-
var ret = results || [];
|
672 |
-
|
673 |
-
if ( array != null ) {
|
674 |
-
// The window, strings (and functions) also have 'length'
|
675 |
-
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
|
676 |
-
var type = jQuery.type( array );
|
677 |
-
|
678 |
-
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
|
679 |
-
push.call( ret, array );
|
680 |
-
} else {
|
681 |
-
jQuery.merge( ret, array );
|
682 |
-
}
|
683 |
-
}
|
684 |
-
|
685 |
-
return ret;
|
686 |
-
},
|
687 |
-
|
688 |
-
inArray: function( elem, array, i ) {
|
689 |
-
var len;
|
690 |
-
|
691 |
-
if ( array ) {
|
692 |
-
if ( indexOf ) {
|
693 |
-
return indexOf.call( array, elem, i );
|
694 |
-
}
|
695 |
-
|
696 |
-
len = array.length;
|
697 |
-
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
|
698 |
-
|
699 |
-
for ( ; i < len; i++ ) {
|
700 |
-
// Skip accessing in sparse arrays
|
701 |
-
if ( i in array && array[ i ] === elem ) {
|
702 |
-
return i;
|
703 |
-
}
|
704 |
-
}
|
705 |
-
}
|
706 |
-
|
707 |
-
return -1;
|
708 |
-
},
|
709 |
-
|
710 |
-
merge: function( first, second ) {
|
711 |
-
var i = first.length,
|
712 |
-
j = 0;
|
713 |
-
|
714 |
-
if ( typeof second.length === "number" ) {
|
715 |
-
for ( var l = second.length; j < l; j++ ) {
|
716 |
-
first[ i++ ] = second[ j ];
|
717 |
-
}
|
718 |
-
|
719 |
-
} else {
|
720 |
-
while ( second[j] !== undefined ) {
|
721 |
-
first[ i++ ] = second[ j++ ];
|
722 |
-
}
|
723 |
-
}
|
724 |
-
|
725 |
-
first.length = i;
|
726 |
-
|
727 |
-
return first;
|
728 |
-
},
|
729 |
-
|
730 |
-
grep: function( elems, callback, inv ) {
|
731 |
-
var ret = [], retVal;
|
732 |
-
inv = !!inv;
|
733 |
-
|
734 |
-
// Go through the array, only saving the items
|
735 |
-
// that pass the validator function
|
736 |
-
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
737 |
-
retVal = !!callback( elems[ i ], i );
|
738 |
-
if ( inv !== retVal ) {
|
739 |
-
ret.push( elems[ i ] );
|
740 |
-
}
|
741 |
-
}
|
742 |
-
|
743 |
-
return ret;
|
744 |
-
},
|
745 |
-
|
746 |
-
// arg is for internal usage only
|
747 |
-
map: function( elems, callback, arg ) {
|
748 |
-
var value, key, ret = [],
|
749 |
-
i = 0,
|
750 |
-
length = elems.length,
|
751 |
-
// jquery objects are treated as arrays
|
752 |
-
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
|
753 |
-
|
754 |
-
// Go through the array, translating each of the items to their
|
755 |
-
if ( isArray ) {
|
756 |
-
for ( ; i < length; i++ ) {
|
757 |
-
value = callback( elems[ i ], i, arg );
|
758 |
-
|
759 |
-
if ( value != null ) {
|
760 |
-
ret[ ret.length ] = value;
|
761 |
-
}
|
762 |
-
}
|
763 |
-
|
764 |
-
// Go through every key on the object
|
765 |
-
} else {
|
766 |
-
for ( key in elems ) {
|
767 |
-
value = callback( elems[ key ], key, arg );
|
768 |
-
|
769 |
-
if ( value != null ) {
|
770 |
-
ret[ ret.length ] = value;
|
771 |
-
}
|
772 |
-
}
|
773 |
-
}
|
774 |
-
|
775 |
-
// Flatten any nested arrays
|
776 |
-
return ret.concat.apply( [], ret );
|
777 |
-
},
|
778 |
-
|
779 |
-
// A global GUID counter for objects
|
780 |
-
guid: 1,
|
781 |
-
|
782 |
-
// Bind a function to a context, optionally partially applying any
|
783 |
-
// arguments.
|
784 |
-
proxy: function( fn, context ) {
|
785 |
-
if ( typeof context === "string" ) {
|
786 |
-
var tmp = fn[ context ];
|
787 |
-
context = fn;
|
788 |
-
fn = tmp;
|
789 |
-
}
|
790 |
-
|
791 |
-
// Quick check to determine if target is callable, in the spec
|
792 |
-
// this throws a TypeError, but we will just return undefined.
|
793 |
-
if ( !jQuery.isFunction( fn ) ) {
|
794 |
-
return undefined;
|
795 |
-
}
|
796 |
-
|
797 |
-
// Simulated bind
|
798 |
-
var args = slice.call( arguments, 2 ),
|
799 |
-
proxy = function() {
|
800 |
-
return fn.apply( context, args.concat( slice.call( arguments ) ) );
|
801 |
-
};
|
802 |
-
|
803 |
-
// Set the guid of unique handler to the same of original handler, so it can be removed
|
804 |
-
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
|
805 |
-
|
806 |
-
return proxy;
|
807 |
-
},
|
808 |
-
|
809 |
-
// Mutifunctional method to get and set values to a collection
|
810 |
-
// The value/s can optionally be executed if it's a function
|
811 |
-
access: function( elems, key, value, exec, fn, pass ) {
|
812 |
-
var length = elems.length;
|
813 |
-
|
814 |
-
// Setting many attributes
|
815 |
-
if ( typeof key === "object" ) {
|
816 |
-
for ( var k in key ) {
|
817 |
-
jQuery.access( elems, k, key[k], exec, fn, value );
|
818 |
-
}
|
819 |
-
return elems;
|
820 |
-
}
|
821 |
-
|
822 |
-
// Setting one attribute
|
823 |
-
if ( value !== undefined ) {
|
824 |
-
// Optionally, function values get executed if exec is true
|
825 |
-
exec = !pass && exec && jQuery.isFunction(value);
|
826 |
-
|
827 |
-
for ( var i = 0; i < length; i++ ) {
|
828 |
-
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
|
829 |
-
}
|
830 |
-
|
831 |
-
return elems;
|
832 |
-
}
|
833 |
-
|
834 |
-
// Getting an attribute
|
835 |
-
return length ? fn( elems[0], key ) : undefined;
|
836 |
-
},
|
837 |
-
|
838 |
-
now: function() {
|
839 |
-
return ( new Date() ).getTime();
|
840 |
-
},
|
841 |
-
|
842 |
-
// Use of jQuery.browser is frowned upon.
|
843 |
-
// More details: http://docs.jquery.com/Utilities/jQuery.browser
|
844 |
-
uaMatch: function( ua ) {
|
845 |
-
ua = ua.toLowerCase();
|
846 |
-
|
847 |
-
var match = rwebkit.exec( ua ) ||
|
848 |
-
ropera.exec( ua ) ||
|
849 |
-
rmsie.exec( ua ) ||
|
850 |
-
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
|
851 |
-
[];
|
852 |
-
|
853 |
-
return { browser: match[1] || "", version: match[2] || "0" };
|
854 |
-
},
|
855 |
-
|
856 |
-
sub: function() {
|
857 |
-
function jQuerySub( selector, context ) {
|
858 |
-
return new jQuerySub.fn.init( selector, context );
|
859 |
-
}
|
860 |
-
jQuery.extend( true, jQuerySub, this );
|
861 |
-
jQuerySub.superclass = this;
|
862 |
-
jQuerySub.fn = jQuerySub.prototype = this();
|
863 |
-
jQuerySub.fn.constructor = jQuerySub;
|
864 |
-
jQuerySub.sub = this.sub;
|
865 |
-
jQuerySub.fn.init = function init( selector, context ) {
|
866 |
-
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
|
867 |
-
context = jQuerySub( context );
|
868 |
-
}
|
869 |
-
|
870 |
-
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
871 |
-
};
|
872 |
-
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
873 |
-
var rootjQuerySub = jQuerySub(document);
|
874 |
-
return jQuerySub;
|
875 |
-
},
|
876 |
-
|
877 |
-
browser: {}
|
878 |
-
});
|
879 |
-
|
880 |
-
// Populate the class2type map
|
881 |
-
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
|
882 |
-
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
883 |
-
});
|
884 |
-
|
885 |
-
browserMatch = jQuery.uaMatch( userAgent );
|
886 |
-
if ( browserMatch.browser ) {
|
887 |
-
jQuery.browser[ browserMatch.browser ] = true;
|
888 |
-
jQuery.browser.version = browserMatch.version;
|
889 |
-
}
|
890 |
-
|
891 |
-
// Deprecated, use jQuery.browser.webkit instead
|
892 |
-
if ( jQuery.browser.webkit ) {
|
893 |
-
jQuery.browser.safari = true;
|
894 |
-
}
|
895 |
-
|
896 |
-
// IE doesn't match non-breaking spaces with \s
|
897 |
-
if ( rnotwhite.test( "\xA0" ) ) {
|
898 |
-
trimLeft = /^[\s\xA0]+/;
|
899 |
-
trimRight = /[\s\xA0]+$/;
|
900 |
-
}
|
901 |
-
|
902 |
-
// All jQuery objects should point back to these
|
903 |
-
rootjQuery = jQuery(document);
|
904 |
-
|
905 |
-
// Cleanup functions for the document ready method
|
906 |
-
if ( document.addEventListener ) {
|
907 |
-
DOMContentLoaded = function() {
|
908 |
-
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
909 |
-
jQuery.ready();
|
910 |
-
};
|
911 |
-
|
912 |
-
} else if ( document.attachEvent ) {
|
913 |
-
DOMContentLoaded = function() {
|
914 |
-
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
|
915 |
-
if ( document.readyState === "complete" ) {
|
916 |
-
document.detachEvent( "onreadystatechange", DOMContentLoaded );
|
917 |
-
jQuery.ready();
|
918 |
-
}
|
919 |
-
};
|
920 |
-
}
|
921 |
-
|
922 |
-
// The DOM ready check for Internet Explorer
|
923 |
-
function doScrollCheck() {
|
924 |
-
if ( jQuery.isReady ) {
|
925 |
-
return;
|
926 |
-
}
|
927 |
-
|
928 |
-
try {
|
929 |
-
// If IE is used, use the trick by Diego Perini
|
930 |
-
// http://javascript.nwbox.com/IEContentLoaded/
|
931 |
-
document.documentElement.doScroll("left");
|
932 |
-
} catch(e) {
|
933 |
-
setTimeout( doScrollCheck, 1 );
|
934 |
-
return;
|
935 |
-
}
|
936 |
-
|
937 |
-
// and execute any waiting functions
|
938 |
-
jQuery.ready();
|
939 |
-
}
|
940 |
-
|
941 |
-
return jQuery;
|
942 |
-
|
943 |
-
})();
|
944 |
-
|
945 |
-
|
946 |
-
// String to Object flags format cache
|
947 |
-
var flagsCache = {};
|
948 |
-
|
949 |
-
// Convert String-formatted flags into Object-formatted ones and store in cache
|
950 |
-
function createFlags( flags ) {
|
951 |
-
var object = flagsCache[ flags ] = {},
|
952 |
-
i, length;
|
953 |
-
flags = flags.split( /\s+/ );
|
954 |
-
for ( i = 0, length = flags.length; i < length; i++ ) {
|
955 |
-
object[ flags[i] ] = true;
|
956 |
-
}
|
957 |
-
return object;
|
958 |
-
}
|
959 |
-
|
960 |
-
/*
|
961 |
-
* Create a callback list using the following parameters:
|
962 |
-
*
|
963 |
-
* flags: an optional list of space-separated flags that will change how
|
964 |
-
* the callback list behaves
|
965 |
-
*
|
966 |
-
* By default a callback list will act like an event callback list and can be
|
967 |
-
* "fired" multiple times.
|
968 |
-
*
|
969 |
-
* Possible flags:
|
970 |
-
*
|
971 |
-
* once: will ensure the callback list can only be fired once (like a Deferred)
|
972 |
-
*
|
973 |
-
* memory: will keep track of previous values and will call any callback added
|
974 |
-
* after the list has been fired right away with the latest "memorized"
|
975 |
-
* values (like a Deferred)
|
976 |
-
*
|
977 |
-
* unique: will ensure a callback can only be added once (no duplicate in the list)
|
978 |
-
*
|
979 |
-
* stopOnFalse: interrupt callings when a callback returns false
|
980 |
-
*
|
981 |
-
*/
|
982 |
-
jQuery.Callbacks = function( flags ) {
|
983 |
-
|
984 |
-
// Convert flags from String-formatted to Object-formatted
|
985 |
-
// (we check in cache first)
|
986 |
-
flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
|
987 |
-
|
988 |
-
var // Actual callback list
|
989 |
-
list = [],
|
990 |
-
// Stack of fire calls for repeatable lists
|
991 |
-
stack = [],
|
992 |
-
// Last fire value (for non-forgettable lists)
|
993 |
-
memory,
|
994 |
-
// Flag to know if list is currently firing
|
995 |
-
firing,
|
996 |
-
// First callback to fire (used internally by add and fireWith)
|
997 |
-
firingStart,
|
998 |
-
// End of the loop when firing
|
999 |
-
firingLength,
|
1000 |
-
// Index of currently firing callback (modified by remove if needed)
|
1001 |
-
firingIndex,
|
1002 |
-
// Add one or several callbacks to the list
|
1003 |
-
add = function( args ) {
|
1004 |
-
var i,
|
1005 |
-
length,
|
1006 |
-
elem,
|
1007 |
-
type,
|
1008 |
-
actual;
|
1009 |
-
for ( i = 0, length = args.length; i < length; i++ ) {
|
1010 |
-
elem = args[ i ];
|
1011 |
-
type = jQuery.type( elem );
|
1012 |
-
if ( type === "array" ) {
|
1013 |
-
// Inspect recursively
|
1014 |
-
add( elem );
|
1015 |
-
} else if ( type === "function" ) {
|
1016 |
-
// Add if not in unique mode and callback is not in
|
1017 |
-
if ( !flags.unique || !self.has( elem ) ) {
|
1018 |
-
list.push( elem );
|
1019 |
-
}
|
1020 |
-
}
|
1021 |
-
}
|
1022 |
-
},
|
1023 |
-
// Fire callbacks
|
1024 |
-
fire = function( context, args ) {
|
1025 |
-
args = args || [];
|
1026 |
-
memory = !flags.memory || [ context, args ];
|
1027 |
-
firing = true;
|
1028 |
-
firingIndex = firingStart || 0;
|
1029 |
-
firingStart = 0;
|
1030 |
-
firingLength = list.length;
|
1031 |
-
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
|
1032 |
-
if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
|
1033 |
-
memory = true; // Mark as halted
|
1034 |
-
break;
|
1035 |
-
}
|
1036 |
-
}
|
1037 |
-
firing = false;
|
1038 |
-
if ( list ) {
|
1039 |
-
if ( !flags.once ) {
|
1040 |
-
if ( stack && stack.length ) {
|
1041 |
-
memory = stack.shift();
|
1042 |
-
self.fireWith( memory[ 0 ], memory[ 1 ] );
|
1043 |
-
}
|
1044 |
-
} else if ( memory === true ) {
|
1045 |
-
self.disable();
|
1046 |
-
} else {
|
1047 |
-
list = [];
|
1048 |
-
}
|
1049 |
-
}
|
1050 |
-
},
|
1051 |
-
// Actual Callbacks object
|
1052 |
-
self = {
|
1053 |
-
// Add a callback or a collection of callbacks to the list
|
1054 |
-
add: function() {
|
1055 |
-
if ( list ) {
|
1056 |
-
var length = list.length;
|
1057 |
-
add( arguments );
|
1058 |
-
// Do we need to add the callbacks to the
|
1059 |
-
// current firing batch?
|
1060 |
-
if ( firing ) {
|
1061 |
-
firingLength = list.length;
|
1062 |
-
// With memory, if we're not firing then
|
1063 |
-
// we should call right away, unless previous
|
1064 |
-
// firing was halted (stopOnFalse)
|
1065 |
-
} else if ( memory && memory !== true ) {
|
1066 |
-
firingStart = length;
|
1067 |
-
fire( memory[ 0 ], memory[ 1 ] );
|
1068 |
-
}
|
1069 |
-
}
|
1070 |
-
return this;
|
1071 |
-
},
|
1072 |
-
// Remove a callback from the list
|
1073 |
-
remove: function() {
|
1074 |
-
if ( list ) {
|
1075 |
-
var args = arguments,
|
1076 |
-
argIndex = 0,
|
1077 |
-
argLength = args.length;
|
1078 |
-
for ( ; argIndex < argLength ; argIndex++ ) {
|
1079 |
-
for ( var i = 0; i < list.length; i++ ) {
|
1080 |
-
if ( args[ argIndex ] === list[ i ] ) {
|
1081 |
-
// Handle firingIndex and firingLength
|
1082 |
-
if ( firing ) {
|
1083 |
-
if ( i <= firingLength ) {
|
1084 |
-
firingLength--;
|
1085 |
-
if ( i <= firingIndex ) {
|
1086 |
-
firingIndex--;
|
1087 |
-
}
|
1088 |
-
}
|
1089 |
-
}
|
1090 |
-
// Remove the element
|
1091 |
-
list.splice( i--, 1 );
|
1092 |
-
// If we have some unicity property then
|
1093 |
-
// we only need to do this once
|
1094 |
-
if ( flags.unique ) {
|
1095 |
-
break;
|
1096 |
-
}
|
1097 |
-
}
|
1098 |
-
}
|
1099 |
-
}
|
1100 |
-
}
|
1101 |
-
return this;
|
1102 |
-
},
|
1103 |
-
// Control if a given callback is in the list
|
1104 |
-
has: function( fn ) {
|
1105 |
-
if ( list ) {
|
1106 |
-
var i = 0,
|
1107 |
-
length = list.length;
|
1108 |
-
for ( ; i < length; i++ ) {
|
1109 |
-
if ( fn === list[ i ] ) {
|
1110 |
-
return true;
|
1111 |
-
}
|
1112 |
-
}
|
1113 |
-
}
|
1114 |
-
return false;
|
1115 |
-
},
|
1116 |
-
// Remove all callbacks from the list
|
1117 |
-
empty: function() {
|
1118 |
-
list = [];
|
1119 |
-
return this;
|
1120 |
-
},
|
1121 |
-
// Have the list do nothing anymore
|
1122 |
-
disable: function() {
|
1123 |
-
list = stack = memory = undefined;
|
1124 |
-
return this;
|
1125 |
-
},
|
1126 |
-
// Is it disabled?
|
1127 |
-
disabled: function() {
|
1128 |
-
return !list;
|
1129 |
-
},
|
1130 |
-
// Lock the list in its current state
|
1131 |
-
lock: function() {
|
1132 |
-
stack = undefined;
|
1133 |
-
if ( !memory || memory === true ) {
|
1134 |
-
self.disable();
|
1135 |
-
}
|
1136 |
-
return this;
|
1137 |
-
},
|
1138 |
-
// Is it locked?
|
1139 |
-
locked: function() {
|
1140 |
-
return !stack;
|
1141 |
-
},
|
1142 |
-
// Call all callbacks with the given context and arguments
|
1143 |
-
fireWith: function( context, args ) {
|
1144 |
-
if ( stack ) {
|
1145 |
-
if ( firing ) {
|
1146 |
-
if ( !flags.once ) {
|
1147 |
-
stack.push( [ context, args ] );
|
1148 |
-
}
|
1149 |
-
} else if ( !( flags.once && memory ) ) {
|
1150 |
-
fire( context, args );
|
1151 |
-
}
|
1152 |
-
}
|
1153 |
-
return this;
|
1154 |
-
},
|
1155 |
-
// Call all the callbacks with the given arguments
|
1156 |
-
fire: function() {
|
1157 |
-
self.fireWith( this, arguments );
|
1158 |
-
return this;
|
1159 |
-
},
|
1160 |
-
// To know if the callbacks have already been called at least once
|
1161 |
-
fired: function() {
|
1162 |
-
return !!memory;
|
1163 |
-
}
|
1164 |
-
};
|
1165 |
-
|
1166 |
-
return self;
|
1167 |
-
};
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
var // Static reference to slice
|
1173 |
-
sliceDeferred = [].slice;
|
1174 |
-
|
1175 |
-
jQuery.extend({
|
1176 |
-
|
1177 |
-
Deferred: function( func ) {
|
1178 |
-
var doneList = jQuery.Callbacks( "once memory" ),
|
1179 |
-
failList = jQuery.Callbacks( "once memory" ),
|
1180 |
-
progressList = jQuery.Callbacks( "memory" ),
|
1181 |
-
state = "pending",
|
1182 |
-
lists = {
|
1183 |
-
resolve: doneList,
|
1184 |
-
reject: failList,
|
1185 |
-
notify: progressList
|
1186 |
-
},
|
1187 |
-
promise = {
|
1188 |
-
done: doneList.add,
|
1189 |
-
fail: failList.add,
|
1190 |
-
progress: progressList.add,
|
1191 |
-
|
1192 |
-
state: function() {
|
1193 |
-
return state;
|
1194 |
-
},
|
1195 |
-
|
1196 |
-
// Deprecated
|
1197 |
-
isResolved: doneList.fired,
|
1198 |
-
isRejected: failList.fired,
|
1199 |
-
|
1200 |
-
then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
|
1201 |
-
deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
|
1202 |
-
return this;
|
1203 |
-
},
|
1204 |
-
always: function() {
|
1205 |
-
deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
|
1206 |
-
return this;
|
1207 |
-
},
|
1208 |
-
pipe: function( fnDone, fnFail, fnProgress ) {
|
1209 |
-
return jQuery.Deferred(function( newDefer ) {
|
1210 |
-
jQuery.each( {
|
1211 |
-
done: [ fnDone, "resolve" ],
|
1212 |
-
fail: [ fnFail, "reject" ],
|
1213 |
-
progress: [ fnProgress, "notify" ]
|
1214 |
-
}, function( handler, data ) {
|
1215 |
-
var fn = data[ 0 ],
|
1216 |
-
action = data[ 1 ],
|
1217 |
-
returned;
|
1218 |
-
if ( jQuery.isFunction( fn ) ) {
|
1219 |
-
deferred[ handler ](function() {
|
1220 |
-
returned = fn.apply( this, arguments );
|
1221 |
-
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
1222 |
-
returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
|
1223 |
-
} else {
|
1224 |
-
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
|
1225 |
-
}
|
1226 |
-
});
|
1227 |
-
} else {
|
1228 |
-
deferred[ handler ]( newDefer[ action ] );
|
1229 |
-
}
|
1230 |
-
});
|
1231 |
-
}).promise();
|
1232 |
-
},
|
1233 |
-
// Get a promise for this deferred
|
1234 |
-
// If obj is provided, the promise aspect is added to the object
|
1235 |
-
promise: function( obj ) {
|
1236 |
-
if ( obj == null ) {
|
1237 |
-
obj = promise;
|
1238 |
-
} else {
|
1239 |
-
for ( var key in promise ) {
|
1240 |
-
obj[ key ] = promise[ key ];
|
1241 |
-
}
|
1242 |
-
}
|
1243 |
-
return obj;
|
1244 |
-
}
|
1245 |
-
},
|
1246 |
-
deferred = promise.promise({}),
|
1247 |
-
key;
|
1248 |
-
|
1249 |
-
for ( key in lists ) {
|
1250 |
-
deferred[ key ] = lists[ key ].fire;
|
1251 |
-
deferred[ key + "With" ] = lists[ key ].fireWith;
|
1252 |
-
}
|
1253 |
-
|
1254 |
-
// Handle state
|
1255 |
-
deferred.done( function() {
|
1256 |
-
state = "resolved";
|
1257 |
-
}, failList.disable, progressList.lock ).fail( function() {
|
1258 |
-
state = "rejected";
|
1259 |
-
}, doneList.disable, progressList.lock );
|
1260 |
-
|
1261 |
-
// Call given func if any
|
1262 |
-
if ( func ) {
|
1263 |
-
func.call( deferred, deferred );
|
1264 |
-
}
|
1265 |
-
|
1266 |
-
// All done!
|
1267 |
-
return deferred;
|
1268 |
-
},
|
1269 |
-
|
1270 |
-
// Deferred helper
|
1271 |
-
when: function( firstParam ) {
|
1272 |
-
var args = sliceDeferred.call( arguments, 0 ),
|
1273 |
-
i = 0,
|
1274 |
-
length = args.length,
|
1275 |
-
pValues = new Array( length ),
|
1276 |
-
count = length,
|
1277 |
-
pCount = length,
|
1278 |
-
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
|
1279 |
-
firstParam :
|
1280 |
-
jQuery.Deferred(),
|
1281 |
-
promise = deferred.promise();
|
1282 |
-
function resolveFunc( i ) {
|
1283 |
-
return function( value ) {
|
1284 |
-
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
|
1285 |
-
if ( !( --count ) ) {
|
1286 |
-
deferred.resolveWith( deferred, args );
|
1287 |
-
}
|
1288 |
-
};
|
1289 |
-
}
|
1290 |
-
function progressFunc( i ) {
|
1291 |
-
return function( value ) {
|
1292 |
-
pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
|
1293 |
-
deferred.notifyWith( promise, pValues );
|
1294 |
-
};
|
1295 |
-
}
|
1296 |
-
if ( length > 1 ) {
|
1297 |
-
for ( ; i < length; i++ ) {
|
1298 |
-
if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
|
1299 |
-
args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
|
1300 |
-
} else {
|
1301 |
-
--count;
|
1302 |
-
}
|
1303 |
-
}
|
1304 |
-
if ( !count ) {
|
1305 |
-
deferred.resolveWith( deferred, args );
|
1306 |
-
}
|
1307 |
-
} else if ( deferred !== firstParam ) {
|
1308 |
-
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
|
1309 |
-
}
|
1310 |
-
return promise;
|
1311 |
-
}
|
1312 |
-
});
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
jQuery.support = (function() {
|
1318 |
-
|
1319 |
-
var support,
|
1320 |
-
all,
|
1321 |
-
a,
|
1322 |
-
select,
|
1323 |
-
opt,
|
1324 |
-
input,
|
1325 |
-
marginDiv,
|
1326 |
-
fragment,
|
1327 |
-
tds,
|
1328 |
-
events,
|
1329 |
-
eventName,
|
1330 |
-
i,
|
1331 |
-
isSupported,
|
1332 |
-
div = document.createElement( "div" ),
|
1333 |
-
documentElement = document.documentElement;
|
1334 |
-
|
1335 |
-
// Preliminary tests
|
1336 |
-
div.setAttribute("className", "t");
|
1337 |
-
div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
|
1338 |
-
|
1339 |
-
all = div.getElementsByTagName( "*" );
|
1340 |
-
a = div.getElementsByTagName( "a" )[ 0 ];
|
1341 |
-
|
1342 |
-
// Can't get basic test support
|
1343 |
-
if ( !all || !all.length || !a ) {
|
1344 |
-
return {};
|
1345 |
-
}
|
1346 |
-
|
1347 |
-
// First batch of supports tests
|
1348 |
-
select = document.createElement( "select" );
|
1349 |
-
opt = select.appendChild( document.createElement("option") );
|
1350 |
-
input = div.getElementsByTagName( "input" )[ 0 ];
|
1351 |
-
|
1352 |
-
support = {
|
1353 |
-
// IE strips leading whitespace when .innerHTML is used
|
1354 |
-
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
|
1355 |
-
|
1356 |
-
// Make sure that tbody elements aren't automatically inserted
|
1357 |
-
// IE will insert them into empty tables
|
1358 |
-
tbody: !div.getElementsByTagName("tbody").length,
|
1359 |
-
|
1360 |
-
// Make sure that link elements get serialized correctly by innerHTML
|
1361 |
-
// This requires a wrapper element in IE
|
1362 |
-
htmlSerialize: !!div.getElementsByTagName("link").length,
|
1363 |
-
|
1364 |
-
// Get the style information from getAttribute
|
1365 |
-
// (IE uses .cssText instead)
|
1366 |
-
style: /top/.test( a.getAttribute("style") ),
|
1367 |
-
|
1368 |
-
// Make sure that URLs aren't manipulated
|
1369 |
-
// (IE normalizes it by default)
|
1370 |
-
hrefNormalized: ( a.getAttribute("href") === "/a" ),
|
1371 |
-
|
1372 |
-
// Make sure that element opacity exists
|
1373 |
-
// (IE uses filter instead)
|
1374 |
-
// Use a regex to work around a WebKit issue. See #5145
|
1375 |
-
opacity: /^0.55/.test( a.style.opacity ),
|
1376 |
-
|
1377 |
-
// Verify style float existence
|
1378 |
-
// (IE uses styleFloat instead of cssFloat)
|
1379 |
-
cssFloat: !!a.style.cssFloat,
|
1380 |
-
|
1381 |
-
// Make sure that if no value is specified for a checkbox
|
1382 |
-
// that it defaults to "on".
|
1383 |
-
// (WebKit defaults to "" instead)
|
1384 |
-
checkOn: ( input.value === "on" ),
|
1385 |
-
|
1386 |
-
// Make sure that a selected-by-default option has a working selected property.
|
1387 |
-
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
|
1388 |
-
optSelected: opt.selected,
|
1389 |
-
|
1390 |
-
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
|
1391 |
-
getSetAttribute: div.className !== "t",
|
1392 |
-
|
1393 |
-
// Tests for enctype support on a form(#6743)
|
1394 |
-
enctype: !!document.createElement("form").enctype,
|
1395 |
-
|
1396 |
-
// Makes sure cloning an html5 element does not cause problems
|
1397 |
-
// Where outerHTML is undefined, this still works
|
1398 |
-
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
|
1399 |
-
|
1400 |
-
// Will be defined later
|
1401 |
-
submitBubbles: true,
|
1402 |
-
changeBubbles: true,
|
1403 |
-
focusinBubbles: false,
|
1404 |
-
deleteExpando: true,
|
1405 |
-
noCloneEvent: true,
|
1406 |
-
inlineBlockNeedsLayout: false,
|
1407 |
-
shrinkWrapBlocks: false,
|
1408 |
-
reliableMarginRight: true
|
1409 |
-
};
|
1410 |
-
|
1411 |
-
// Make sure checked status is properly cloned
|
1412 |
-
input.checked = true;
|
1413 |
-
support.noCloneChecked = input.cloneNode( true ).checked;
|
1414 |
-
|
1415 |
-
// Make sure that the options inside disabled selects aren't marked as disabled
|
1416 |
-
// (WebKit marks them as disabled)
|
1417 |
-
select.disabled = true;
|
1418 |
-
support.optDisabled = !opt.disabled;
|
1419 |
-
|
1420 |
-
// Test to see if it's possible to delete an expando from an element
|
1421 |
-
// Fails in Internet Explorer
|
1422 |
-
try {
|
1423 |
-
delete div.test;
|
1424 |
-
} catch( e ) {
|
1425 |
-
support.deleteExpando = false;
|
1426 |
-
}
|
1427 |
-
|
1428 |
-
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
|
1429 |
-
div.attachEvent( "onclick", function() {
|
1430 |
-
// Cloning a node shouldn't copy over any
|
1431 |
-
// bound event handlers (IE does this)
|
1432 |
-
support.noCloneEvent = false;
|
1433 |
-
});
|
1434 |
-
div.cloneNode( true ).fireEvent( "onclick" );
|
1435 |
-
}
|
1436 |
-
|
1437 |
-
// Check if a radio maintains its value
|
1438 |
-
// after being appended to the DOM
|
1439 |
-
input = document.createElement("input");
|
1440 |
-
input.value = "t";
|
1441 |
-
input.setAttribute("type", "radio");
|
1442 |
-
support.radioValue = input.value === "t";
|
1443 |
-
|
1444 |
-
input.setAttribute("checked", "checked");
|
1445 |
-
div.appendChild( input );
|
1446 |
-
fragment = document.createDocumentFragment();
|
1447 |
-
fragment.appendChild( div.lastChild );
|
1448 |
-
|
1449 |
-
// WebKit doesn't clone checked state correctly in fragments
|
1450 |
-
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
1451 |
-
|
1452 |
-
// Check if a disconnected checkbox will retain its checked
|
1453 |
-
// value of true after appended to the DOM (IE6/7)
|
1454 |
-
support.appendChecked = input.checked;
|
1455 |
-
|
1456 |
-
fragment.removeChild( input );
|
1457 |
-
fragment.appendChild( div );
|
1458 |
-
|
1459 |
-
div.innerHTML = "";
|
1460 |
-
|
1461 |
-
// Check if div with explicit width and no margin-right incorrectly
|
1462 |
-
// gets computed margin-right based on width of container. For more
|
1463 |
-
// info see bug #3333
|
1464 |
-
// Fails in WebKit before Feb 2011 nightlies
|
1465 |
-
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
1466 |
-
if ( window.getComputedStyle ) {
|
1467 |
-
marginDiv = document.createElement( "div" );
|
1468 |
-
marginDiv.style.width = "0";
|
1469 |
-
marginDiv.style.marginRight = "0";
|
1470 |
-
div.style.width = "2px";
|
1471 |
-
div.appendChild( marginDiv );
|
1472 |
-
support.reliableMarginRight =
|
1473 |
-
( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
|
1474 |
-
}
|
1475 |
-
|
1476 |
-
// Technique from Juriy Zaytsev
|
1477 |
-
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
|
1478 |
-
// We only care about the case where non-standard event systems
|
1479 |
-
// are used, namely in IE. Short-circuiting here helps us to
|
1480 |
-
// avoid an eval call (in setAttribute) which can cause CSP
|
1481 |
-
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
|
1482 |
-
if ( div.attachEvent ) {
|
1483 |
-
for( i in {
|
1484 |
-
submit: 1,
|
1485 |
-
change: 1,
|
1486 |
-
focusin: 1
|
1487 |
-
}) {
|
1488 |
-
eventName = "on" + i;
|
1489 |
-
isSupported = ( eventName in div );
|
1490 |
-
if ( !isSupported ) {
|
1491 |
-
div.setAttribute( eventName, "return;" );
|
1492 |
-
isSupported = ( typeof div[ eventName ] === "function" );
|
1493 |
-
}
|
1494 |
-
support[ i + "Bubbles" ] = isSupported;
|
1495 |
-
}
|
1496 |
-
}
|
1497 |
-
|
1498 |
-
fragment.removeChild( div );
|
1499 |
-
|
1500 |
-
// Null elements to avoid leaks in IE
|
1501 |
-
fragment = select = opt = marginDiv = div = input = null;
|
1502 |
-
|
1503 |
-
// Run tests that need a body at doc ready
|
1504 |
-
jQuery(function() {
|
1505 |
-
var container, outer, inner, table, td, offsetSupport,
|
1506 |
-
conMarginTop, ptlm, vb, style, html,
|
1507 |
-
body = document.getElementsByTagName("body")[0];
|
1508 |
-
|
1509 |
-
if ( !body ) {
|
1510 |
-
// Return for frameset docs that don't have a body
|
1511 |
-
return;
|
1512 |
-
}
|
1513 |
-
|
1514 |
-
conMarginTop = 1;
|
1515 |
-
ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";
|
1516 |
-
vb = "visibility:hidden;border:0;";
|
1517 |
-
style = "style='" + ptlm + "border:5px solid #000;padding:0;'";
|
1518 |
-
html = "<div " + style + "><div></div></div>" +
|
1519 |
-
"<table " + style + " cellpadding='0' cellspacing='0'>" +
|
1520 |
-
"<tr><td></td></tr></table>";
|
1521 |
-
|
1522 |
-
container = document.createElement("div");
|
1523 |
-
container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
|
1524 |
-
body.insertBefore( container, body.firstChild );
|
1525 |
-
|
1526 |
-
// Construct the test element
|
1527 |
-
div = document.createElement("div");
|
1528 |
-
container.appendChild( div );
|
1529 |
-
|
1530 |
-
// Check if table cells still have offsetWidth/Height when they are set
|
1531 |
-
// to display:none and there are still other visible table cells in a
|
1532 |
-
// table row; if so, offsetWidth/Height are not reliable for use when
|
1533 |
-
// determining if an element has been hidden directly using
|
1534 |
-
// display:none (it is still safe to use offsets if a parent element is
|
1535 |
-
// hidden; don safety goggles and see bug #4512 for more information).
|
1536 |
-
// (only IE 8 fails this test)
|
1537 |
-
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
|
1538 |
-
tds = div.getElementsByTagName( "td" );
|
1539 |
-
isSupported = ( tds[ 0 ].offsetHeight === 0 );
|
1540 |
-
|
1541 |
-
tds[ 0 ].style.display = "";
|
1542 |
-
tds[ 1 ].style.display = "none";
|
1543 |
-
|
1544 |
-
// Check if empty table cells still have offsetWidth/Height
|
1545 |
-
// (IE <= 8 fail this test)
|
1546 |
-
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
|
1547 |
-
|
1548 |
-
// Figure out if the W3C box model works as expected
|
1549 |
-
div.innerHTML = "";
|
1550 |
-
div.style.width = div.style.paddingLeft = "1px";
|
1551 |
-
jQuery.boxModel = support.boxModel = div.offsetWidth === 2;
|
1552 |
-
|
1553 |
-
if ( typeof div.style.zoom !== "undefined" ) {
|
1554 |
-
// Check if natively block-level elements act like inline-block
|
1555 |
-
// elements when setting their display to 'inline' and giving
|
1556 |
-
// them layout
|
1557 |
-
// (IE < 8 does this)
|
1558 |
-
div.style.display = "inline";
|
1559 |
-
div.style.zoom = 1;
|
1560 |
-
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
|
1561 |
-
|
1562 |
-
// Check if elements with layout shrink-wrap their children
|
1563 |
-
// (IE 6 does this)
|
1564 |
-
div.style.display = "";
|
1565 |
-
div.innerHTML = "<div style='width:4px;'></div>";
|
1566 |
-
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
|
1567 |
-
}
|
1568 |
-
|
1569 |
-
div.style.cssText = ptlm + vb;
|
1570 |
-
div.innerHTML = html;
|
1571 |
-
|
1572 |
-
outer = div.firstChild;
|
1573 |
-
inner = outer.firstChild;
|
1574 |
-
td = outer.nextSibling.firstChild.firstChild;
|
1575 |
-
|
1576 |
-
offsetSupport = {
|
1577 |
-
doesNotAddBorder: ( inner.offsetTop !== 5 ),
|
1578 |
-
doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
|
1579 |
-
};
|
1580 |
-
|
1581 |
-
inner.style.position = "fixed";
|
1582 |
-
inner.style.top = "20px";
|
1583 |
-
|
1584 |
-
// safari subtracts parent border width here which is 5px
|
1585 |
-
offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
|
1586 |
-
inner.style.position = inner.style.top = "";
|
1587 |
-
|
1588 |
-
outer.style.overflow = "hidden";
|
1589 |
-
outer.style.position = "relative";
|
1590 |
-
|
1591 |
-
offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
|
1592 |
-
offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
|
1593 |
-
|
1594 |
-
body.removeChild( container );
|
1595 |
-
div = container = null;
|
1596 |
-
|
1597 |
-
jQuery.extend( support, offsetSupport );
|
1598 |
-
});
|
1599 |
-
|
1600 |
-
return support;
|
1601 |
-
})();
|
1602 |
-
|
1603 |
-
|
1604 |
-
|
1605 |
-
|
1606 |
-
var rbrace = /^(?:\{.*\}|\[.*\])$/,
|
1607 |
-
rmultiDash = /([A-Z])/g;
|
1608 |
-
|
1609 |
-
jQuery.extend({
|
1610 |
-
cache: {},
|
1611 |
-
|
1612 |
-
// Please use with caution
|
1613 |
-
uuid: 0,
|
1614 |
-
|
1615 |
-
// Unique for each copy of jQuery on the page
|
1616 |
-
// Non-digits removed to match rinlinejQuery
|
1617 |
-
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
|
1618 |
-
|
1619 |
-
// The following elements throw uncatchable exceptions if you
|
1620 |
-
// attempt to add expando properties to them.
|
1621 |
-
noData: {
|
1622 |
-
"embed": true,
|
1623 |
-
// Ban all objects except for Flash (which handle expandos)
|
1624 |
-
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
|
1625 |
-
"applet": true
|
1626 |
-
},
|
1627 |
-
|
1628 |
-
hasData: function( elem ) {
|
1629 |
-
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
|
1630 |
-
return !!elem && !isEmptyDataObject( elem );
|
1631 |
-
},
|
1632 |
-
|
1633 |
-
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
|
1634 |
-
if ( !jQuery.acceptData( elem ) ) {
|
1635 |
-
return;
|
1636 |
-
}
|
1637 |
-
|
1638 |
-
var privateCache, thisCache, ret,
|
1639 |
-
internalKey = jQuery.expando,
|
1640 |
-
getByName = typeof name === "string",
|
1641 |
-
|
1642 |
-
// We have to handle DOM nodes and JS objects differently because IE6-7
|
1643 |
-
// can't GC object references properly across the DOM-JS boundary
|
1644 |
-
isNode = elem.nodeType,
|
1645 |
-
|
1646 |
-
// Only DOM nodes need the global jQuery cache; JS object data is
|
1647 |
-
// attached directly to the object so GC can occur automatically
|
1648 |
-
cache = isNode ? jQuery.cache : elem,
|
1649 |
-
|
1650 |
-
// Only defining an ID for JS objects if its cache already exists allows
|
1651 |
-
// the code to shortcut on the same path as a DOM node with no cache
|
1652 |
-
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
|
1653 |
-
isEvents = name === "events";
|
1654 |
-
|
1655 |
-
// Avoid doing any more work than we need to when trying to get data on an
|
1656 |
-
// object that has no data at all
|
1657 |
-
if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
|
1658 |
-
return;
|
1659 |
-
}
|
1660 |
-
|
1661 |
-
if ( !id ) {
|
1662 |
-
// Only DOM nodes need a new unique ID for each element since their data
|
1663 |
-
// ends up in the global cache
|
1664 |
-
if ( isNode ) {
|
1665 |
-
elem[ internalKey ] = id = ++jQuery.uuid;
|
1666 |
-
} else {
|
1667 |
-
id = internalKey;
|
1668 |
-
}
|
1669 |
-
}
|
1670 |
-
|
1671 |
-
if ( !cache[ id ] ) {
|
1672 |
-
cache[ id ] = {};
|
1673 |
-
|
1674 |
-
// Avoids exposing jQuery metadata on plain JS objects when the object
|
1675 |
-
// is serialized using JSON.stringify
|
1676 |
-
if ( !isNode ) {
|
1677 |
-
cache[ id ].toJSON = jQuery.noop;
|
1678 |
-
}
|
1679 |
-
}
|
1680 |
-
|
1681 |
-
// An object can be passed to jQuery.data instead of a key/value pair; this gets
|
1682 |
-
// shallow copied over onto the existing cache
|
1683 |
-
if ( typeof name === "object" || typeof name === "function" ) {
|
1684 |
-
if ( pvt ) {
|
1685 |
-
cache[ id ] = jQuery.extend( cache[ id ], name );
|
1686 |
-
} else {
|
1687 |
-
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
|
1688 |
-
}
|
1689 |
-
}
|
1690 |
-
|
1691 |
-
privateCache = thisCache = cache[ id ];
|
1692 |
-
|
1693 |
-
// jQuery data() is stored in a separate object inside the object's internal data
|
1694 |
-
// cache in order to avoid key collisions between internal data and user-defined
|
1695 |
-
// data.
|
1696 |
-
if ( !pvt ) {
|
1697 |
-
if ( !thisCache.data ) {
|
1698 |
-
thisCache.data = {};
|
1699 |
-
}
|
1700 |
-
|
1701 |
-
thisCache = thisCache.data;
|
1702 |
-
}
|
1703 |
-
|
1704 |
-
if ( data !== undefined ) {
|
1705 |
-
thisCache[ jQuery.camelCase( name ) ] = data;
|
1706 |
-
}
|
1707 |
-
|
1708 |
-
// Users should not attempt to inspect the internal events object using jQuery.data,
|
1709 |
-
// it is undocumented and subject to change. But does anyone listen? No.
|
1710 |
-
if ( isEvents && !thisCache[ name ] ) {
|
1711 |
-
return privateCache.events;
|
1712 |
-
}
|
1713 |
-
|
1714 |
-
// Check for both converted-to-camel and non-converted data property names
|
1715 |
-
// If a data property was specified
|
1716 |
-
if ( getByName ) {
|
1717 |
-
|
1718 |
-
// First Try to find as-is property data
|
1719 |
-
ret = thisCache[ name ];
|
1720 |
-
|
1721 |
-
// Test for null|undefined property data
|
1722 |
-
if ( ret == null ) {
|
1723 |
-
|
1724 |
-
// Try to find the camelCased property
|
1725 |
-
ret = thisCache[ jQuery.camelCase( name ) ];
|
1726 |
-
}
|
1727 |
-
} else {
|
1728 |
-
ret = thisCache;
|
1729 |
-
}
|
1730 |
-
|
1731 |
-
return ret;
|
1732 |
-
},
|
1733 |
-
|
1734 |
-
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
|
1735 |
-
if ( !jQuery.acceptData( elem ) ) {
|
1736 |
-
return;
|
1737 |
-
}
|
1738 |
-
|
1739 |
-
var thisCache, i, l,
|
1740 |
-
|
1741 |
-
// Reference to internal data cache key
|
1742 |
-
internalKey = jQuery.expando,
|
1743 |
-
|
1744 |
-
isNode = elem.nodeType,
|
1745 |
-
|
1746 |
-
// See jQuery.data for more information
|
1747 |
-
cache = isNode ? jQuery.cache : elem,
|
1748 |
-
|
1749 |
-
// See jQuery.data for more information
|
1750 |
-
id = isNode ? elem[ internalKey ] : internalKey;
|
1751 |
-
|
1752 |
-
// If there is already no cache entry for this object, there is no
|
1753 |
-
// purpose in continuing
|
1754 |
-
if ( !cache[ id ] ) {
|
1755 |
-
return;
|
1756 |
-
}
|
1757 |
-
|
1758 |
-
if ( name ) {
|
1759 |
-
|
1760 |
-
thisCache = pvt ? cache[ id ] : cache[ id ].data;
|
1761 |
-
|
1762 |
-
if ( thisCache ) {
|
1763 |
-
|
1764 |
-
// Support array or space separated string names for data keys
|
1765 |
-
if ( !jQuery.isArray( name ) ) {
|
1766 |
-
|
1767 |
-
// try the string as a key before any manipulation
|
1768 |
-
if ( name in thisCache ) {
|
1769 |
-
name = [ name ];
|
1770 |
-
} else {
|
1771 |
-
|
1772 |
-
// split the camel cased version by spaces unless a key with the spaces exists
|
1773 |
-
name = jQuery.camelCase( name );
|
1774 |
-
if ( name in thisCache ) {
|
1775 |
-
name = [ name ];
|
1776 |
-
} else {
|
1777 |
-
name = name.split( " " );
|
1778 |
-
}
|
1779 |
-
}
|
1780 |
-
}
|
1781 |
-
|
1782 |
-
for ( i = 0, l = name.length; i < l; i++ ) {
|
1783 |
-
delete thisCache[ name[i] ];
|
1784 |
-
}
|
1785 |
-
|
1786 |
-
// If there is no data left in the cache, we want to continue
|
1787 |
-
// and let the cache object itself get destroyed
|
1788 |
-
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
|
1789 |
-
return;
|
1790 |
-
}
|
1791 |
-
}
|
1792 |
-
}
|
1793 |
-
|
1794 |
-
// See jQuery.data for more information
|
1795 |
-
if ( !pvt ) {
|
1796 |
-
delete cache[ id ].data;
|
1797 |
-
|
1798 |
-
// Don't destroy the parent cache unless the internal data object
|
1799 |
-
// had been the only thing left in it
|
1800 |
-
if ( !isEmptyDataObject(cache[ id ]) ) {
|
1801 |
-
return;
|
1802 |
-
}
|
1803 |
-
}
|
1804 |
-
|
1805 |
-
// Browsers that fail expando deletion also refuse to delete expandos on
|
1806 |
-
// the window, but it will allow it on all other JS objects; other browsers
|
1807 |
-
// don't care
|
1808 |
-
// Ensure that `cache` is not a window object #10080
|
1809 |
-
if ( jQuery.support.deleteExpando || !cache.setInterval ) {
|
1810 |
-
delete cache[ id ];
|
1811 |
-
} else {
|
1812 |
-
cache[ id ] = null;
|
1813 |
-
}
|
1814 |
-
|
1815 |
-
// We destroyed the cache and need to eliminate the expando on the node to avoid
|
1816 |
-
// false lookups in the cache for entries that no longer exist
|
1817 |
-
if ( isNode ) {
|
1818 |
-
// IE does not allow us to delete expando properties from nodes,
|
1819 |
-
// nor does it have a removeAttribute function on Document nodes;
|
1820 |
-
// we must handle all of these cases
|
1821 |
-
if ( jQuery.support.deleteExpando ) {
|
1822 |
-
delete elem[ internalKey ];
|
1823 |
-
} else if ( elem.removeAttribute ) {
|
1824 |
-
elem.removeAttribute( internalKey );
|
1825 |
-
} else {
|
1826 |
-
elem[ internalKey ] = null;
|
1827 |
-
}
|
1828 |
-
}
|
1829 |
-
},
|
1830 |
-
|
1831 |
-
// For internal use only.
|
1832 |
-
_data: function( elem, name, data ) {
|
1833 |
-
return jQuery.data( elem, name, data, true );
|
1834 |
-
},
|
1835 |
-
|
1836 |
-
// A method for determining if a DOM node can handle the data expando
|
1837 |
-
acceptData: function( elem ) {
|
1838 |
-
if ( elem.nodeName ) {
|
1839 |
-
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
|
1840 |
-
|
1841 |
-
if ( match ) {
|
1842 |
-
return !(match === true || elem.getAttribute("classid") !== match);
|
1843 |
-
}
|
1844 |
-
}
|
1845 |
-
|
1846 |
-
return true;
|
1847 |
-
}
|
1848 |
-
});
|
1849 |
-
|
1850 |
-
jQuery.fn.extend({
|
1851 |
-
data: function( key, value ) {
|
1852 |
-
var parts, attr, name,
|
1853 |
-
data = null;
|
1854 |
-
|
1855 |
-
if ( typeof key === "undefined" ) {
|
1856 |
-
if ( this.length ) {
|
1857 |
-
data = jQuery.data( this[0] );
|
1858 |
-
|
1859 |
-
if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
|
1860 |
-
attr = this[0].attributes;
|
1861 |
-
for ( var i = 0, l = attr.length; i < l; i++ ) {
|
1862 |
-
name = attr[i].name;
|
1863 |
-
|
1864 |
-
if ( name.indexOf( "data-" ) === 0 ) {
|
1865 |
-
name = jQuery.camelCase( name.substring(5) );
|
1866 |
-
|
1867 |
-
dataAttr( this[0], name, data[ name ] );
|
1868 |
-
}
|
1869 |
-
}
|
1870 |
-
jQuery._data( this[0], "parsedAttrs", true );
|
1871 |
-
}
|
1872 |
-
}
|
1873 |
-
|
1874 |
-
return data;
|
1875 |
-
|
1876 |
-
} else if ( typeof key === "object" ) {
|
1877 |
-
return this.each(function() {
|
1878 |
-
jQuery.data( this, key );
|
1879 |
-
});
|
1880 |
-
}
|
1881 |
-
|
1882 |
-
parts = key.split(".");
|
1883 |
-
parts[1] = parts[1] ? "." + parts[1] : "";
|
1884 |
-
|
1885 |
-
if ( value === undefined ) {
|
1886 |
-
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
|
1887 |
-
|
1888 |
-
// Try to fetch any internally stored data first
|
1889 |
-
if ( data === undefined && this.length ) {
|
1890 |
-
data = jQuery.data( this[0], key );
|
1891 |
-
data = dataAttr( this[0], key, data );
|
1892 |
-
}
|
1893 |
-
|
1894 |
-
return data === undefined && parts[1] ?
|
1895 |
-
this.data( parts[0] ) :
|
1896 |
-
data;
|
1897 |
-
|
1898 |
-
} else {
|
1899 |
-
return this.each(function() {
|
1900 |
-
var self = jQuery( this ),
|
1901 |
-
args = [ parts[0], value ];
|
1902 |
-
|
1903 |
-
self.triggerHandler( "setData" + parts[1] + "!", args );
|
1904 |
-
jQuery.data( this, key, value );
|
1905 |
-
self.triggerHandler( "changeData" + parts[1] + "!", args );
|
1906 |
-
});
|
1907 |
-
}
|
1908 |
-
},
|
1909 |
-
|
1910 |
-
removeData: function( key ) {
|
1911 |
-
return this.each(function() {
|
1912 |
-
jQuery.removeData( this, key );
|
1913 |
-
});
|
1914 |
-
}
|
1915 |
-
});
|
1916 |
-
|
1917 |
-
function dataAttr( elem, key, data ) {
|
1918 |
-
// If nothing was found internally, try to fetch any
|
1919 |
-
// data from the HTML5 data-* attribute
|
1920 |
-
if ( data === undefined && elem.nodeType === 1 ) {
|
1921 |
-
|
1922 |
-
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
|
1923 |
-
|
1924 |
-
data = elem.getAttribute( name );
|
1925 |
-
|
1926 |
-
if ( typeof data === "string" ) {
|
1927 |
-
try {
|
1928 |
-
data = data === "true" ? true :
|
1929 |
-
data === "false" ? false :
|
1930 |
-
data === "null" ? null :
|
1931 |
-
jQuery.isNumeric( data ) ? parseFloat( data ) :
|
1932 |
-
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
1933 |
-
data;
|
1934 |
-
} catch( e ) {}
|
1935 |
-
|
1936 |
-
// Make sure we set the data so it isn't changed later
|
1937 |
-
jQuery.data( elem, key, data );
|
1938 |
-
|
1939 |
-
} else {
|
1940 |
-
data = undefined;
|
1941 |
-
}
|
1942 |
-
}
|
1943 |
-
|
1944 |
-
return data;
|
1945 |
-
}
|
1946 |
-
|
1947 |
-
// checks a cache object for emptiness
|
1948 |
-
function isEmptyDataObject( obj ) {
|
1949 |
-
for ( var name in obj ) {
|
1950 |
-
|
1951 |
-
// if the public data object is empty, the private is still empty
|
1952 |
-
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
|
1953 |
-
continue;
|
1954 |
-
}
|
1955 |
-
if ( name !== "toJSON" ) {
|
1956 |
-
return false;
|
1957 |
-
}
|
1958 |
-
}
|
1959 |
-
|
1960 |
-
return true;
|
1961 |
-
}
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
function handleQueueMarkDefer( elem, type, src ) {
|
1967 |
-
var deferDataKey = type + "defer",
|
1968 |
-
queueDataKey = type + "queue",
|
1969 |
-
markDataKey = type + "mark",
|
1970 |
-
defer = jQuery._data( elem, deferDataKey );
|
1971 |
-
if ( defer &&
|
1972 |
-
( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
|
1973 |
-
( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
|
1974 |
-
// Give room for hard-coded callbacks to fire first
|
1975 |
-
// and eventually mark/queue something else on the element
|
1976 |
-
setTimeout( function() {
|
1977 |
-
if ( !jQuery._data( elem, queueDataKey ) &&
|
1978 |
-
!jQuery._data( elem, markDataKey ) ) {
|
1979 |
-
jQuery.removeData( elem, deferDataKey, true );
|
1980 |
-
defer.fire();
|
1981 |
-
}
|
1982 |
-
}, 0 );
|
1983 |
-
}
|
1984 |
-
}
|
1985 |
-
|
1986 |
-
jQuery.extend({
|
1987 |
-
|
1988 |
-
_mark: function( elem, type ) {
|
1989 |
-
if ( elem ) {
|
1990 |
-
type = ( type || "fx" ) + "mark";
|
1991 |
-
jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
|
1992 |
-
}
|
1993 |
-
},
|
1994 |
-
|
1995 |
-
_unmark: function( force, elem, type ) {
|
1996 |
-
if ( force !== true ) {
|
1997 |
-
type = elem;
|
1998 |
-
elem = force;
|
1999 |
-
force = false;
|
2000 |
-
}
|
2001 |
-
if ( elem ) {
|
2002 |
-
type = type || "fx";
|
2003 |
-
var key = type + "mark",
|
2004 |
-
count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
|
2005 |
-
if ( count ) {
|
2006 |
-
jQuery._data( elem, key, count );
|
2007 |
-
} else {
|
2008 |
-
jQuery.removeData( elem, key, true );
|
2009 |
-
handleQueueMarkDefer( elem, type, "mark" );
|
2010 |
-
}
|
2011 |
-
}
|
2012 |
-
},
|
2013 |
-
|
2014 |
-
queue: function( elem, type, data ) {
|
2015 |
-
var q;
|
2016 |
-
if ( elem ) {
|
2017 |
-
type = ( type || "fx" ) + "queue";
|
2018 |
-
q = jQuery._data( elem, type );
|
2019 |
-
|
2020 |
-
// Speed up dequeue by getting out quickly if this is just a lookup
|
2021 |
-
if ( data ) {
|
2022 |
-
if ( !q || jQuery.isArray(data) ) {
|
2023 |
-
q = jQuery._data( elem, type, jQuery.makeArray(data) );
|
2024 |
-
} else {
|
2025 |
-
q.push( data );
|
2026 |
-
}
|
2027 |
-
}
|
2028 |
-
return q || [];
|
2029 |
-
}
|
2030 |
-
},
|
2031 |
-
|
2032 |
-
dequeue: function( elem, type ) {
|
2033 |
-
type = type || "fx";
|
2034 |
-
|
2035 |
-
var queue = jQuery.queue( elem, type ),
|
2036 |
-
fn = queue.shift(),
|
2037 |
-
hooks = {};
|
2038 |
-
|
2039 |
-
// If the fx queue is dequeued, always remove the progress sentinel
|
2040 |
-
if ( fn === "inprogress" ) {
|
2041 |
-
fn = queue.shift();
|
2042 |
-
}
|
2043 |
-
|
2044 |
-
if ( fn ) {
|
2045 |
-
// Add a progress sentinel to prevent the fx queue from being
|
2046 |
-
// automatically dequeued
|
2047 |
-
if ( type === "fx" ) {
|
2048 |
-
queue.unshift( "inprogress" );
|
2049 |
-
}
|
2050 |
-
|
2051 |
-
jQuery._data( elem, type + ".run", hooks );
|
2052 |
-
fn.call( elem, function() {
|
2053 |
-
jQuery.dequeue( elem, type );
|
2054 |
-
}, hooks );
|
2055 |
-
}
|
2056 |
-
|
2057 |
-
if ( !queue.length ) {
|
2058 |
-
jQuery.removeData( elem, type + "queue " + type + ".run", true );
|
2059 |
-
handleQueueMarkDefer( elem, type, "queue" );
|
2060 |
-
}
|
2061 |
-
}
|
2062 |
-
});
|
2063 |
-
|
2064 |
-
jQuery.fn.extend({
|
2065 |
-
queue: function( type, data ) {
|
2066 |
-
if ( typeof type !== "string" ) {
|
2067 |
-
data = type;
|
2068 |
-
type = "fx";
|
2069 |
-
}
|
2070 |
-
|
2071 |
-
if ( data === undefined ) {
|
2072 |
-
return jQuery.queue( this[0], type );
|
2073 |
-
}
|
2074 |
-
return this.each(function() {
|
2075 |
-
var queue = jQuery.queue( this, type, data );
|
2076 |
-
|
2077 |
-
if ( type === "fx" && queue[0] !== "inprogress" ) {
|
2078 |
-
jQuery.dequeue( this, type );
|
2079 |
-
}
|
2080 |
-
});
|
2081 |
-
},
|
2082 |
-
dequeue: function( type ) {
|
2083 |
-
return this.each(function() {
|
2084 |
-
jQuery.dequeue( this, type );
|
2085 |
-
});
|
2086 |
-
},
|
2087 |
-
// Based off of the plugin by Clint Helfers, with permission.
|
2088 |
-
// http://blindsignals.com/index.php/2009/07/jquery-delay/
|
2089 |
-
delay: function( time, type ) {
|
2090 |
-
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
|
2091 |
-
type = type || "fx";
|
2092 |
-
|
2093 |
-
return this.queue( type, function( next, hooks ) {
|
2094 |
-
var timeout = setTimeout( next, time );
|
2095 |
-
hooks.stop = function() {
|
2096 |
-
clearTimeout( timeout );
|
2097 |
-
};
|
2098 |
-
});
|
2099 |
-
},
|
2100 |
-
clearQueue: function( type ) {
|
2101 |
-
return this.queue( type || "fx", [] );
|
2102 |
-
},
|
2103 |
-
// Get a promise resolved when queues of a certain type
|
2104 |
-
// are emptied (fx is the type by default)
|
2105 |
-
promise: function( type, object ) {
|
2106 |
-
if ( typeof type !== "string" ) {
|
2107 |
-
object = type;
|
2108 |
-
type = undefined;
|
2109 |
-
}
|
2110 |
-
type = type || "fx";
|
2111 |
-
var defer = jQuery.Deferred(),
|
2112 |
-
elements = this,
|
2113 |
-
i = elements.length,
|
2114 |
-
count = 1,
|
2115 |
-
deferDataKey = type + "defer",
|
2116 |
-
queueDataKey = type + "queue",
|
2117 |
-
markDataKey = type + "mark",
|
2118 |
-
tmp;
|
2119 |
-
function resolve() {
|
2120 |
-
if ( !( --count ) ) {
|
2121 |
-
defer.resolveWith( elements, [ elements ] );
|
2122 |
-
}
|
2123 |
-
}
|
2124 |
-
while( i-- ) {
|
2125 |
-
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
|
2126 |
-
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
|
2127 |
-
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
|
2128 |
-
jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
|
2129 |
-
count++;
|
2130 |
-
tmp.add( resolve );
|
2131 |
-
}
|
2132 |
-
}
|
2133 |
-
resolve();
|
2134 |
-
return defer.promise();
|
2135 |
-
}
|
2136 |
-
});
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
2140 |
-
|
2141 |
-
var rclass = /[\n\t\r]/g,
|
2142 |
-
rspace = /\s+/,
|
2143 |
-
rreturn = /\r/g,
|
2144 |
-
rtype = /^(?:button|input)$/i,
|
2145 |
-
rfocusable = /^(?:button|input|object|select|textarea)$/i,
|
2146 |
-
rclickable = /^a(?:rea)?$/i,
|
2147 |
-
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
|
2148 |
-
getSetAttribute = jQuery.support.getSetAttribute,
|
2149 |
-
nodeHook, boolHook, fixSpecified;
|
2150 |
-
|
2151 |
-
jQuery.fn.extend({
|
2152 |
-
attr: function( name, value ) {
|
2153 |
-
return jQuery.access( this, name, value, true, jQuery.attr );
|
2154 |
-
},
|
2155 |
-
|
2156 |
-
removeAttr: function( name ) {
|
2157 |
-
return this.each(function() {
|
2158 |
-
jQuery.removeAttr( this, name );
|
2159 |
-
});
|
2160 |
-
},
|
2161 |
-
|
2162 |
-
prop: function( name, value ) {
|
2163 |
-
return jQuery.access( this, name, value, true, jQuery.prop );
|
2164 |
-
},
|
2165 |
-
|
2166 |
-
removeProp: function( name ) {
|
2167 |
-
name = jQuery.propFix[ name ] || name;
|
2168 |
-
return this.each(function() {
|
2169 |
-
// try/catch handles cases where IE balks (such as removing a property on window)
|
2170 |
-
try {
|
2171 |
-
this[ name ] = undefined;
|
2172 |
-
delete this[ name ];
|
2173 |
-
} catch( e ) {}
|
2174 |
-
});
|
2175 |
-
},
|
2176 |
-
|
2177 |
-
addClass: function( value ) {
|
2178 |
-
var classNames, i, l, elem,
|
2179 |
-
setClass, c, cl;
|
2180 |
-
|
2181 |
-
if ( jQuery.isFunction( value ) ) {
|
2182 |
-
return this.each(function( j ) {
|
2183 |
-
jQuery( this ).addClass( value.call(this, j, this.className) );
|
2184 |
-
});
|
2185 |
-
}
|
2186 |
-
|
2187 |
-
if ( value && typeof value === "string" ) {
|
2188 |
-
classNames = value.split( rspace );
|
2189 |
-
|
2190 |
-
for ( i = 0, l = this.length; i < l; i++ ) {
|
2191 |
-
elem = this[ i ];
|
2192 |
-
|
2193 |
-
if ( elem.nodeType === 1 ) {
|
2194 |
-
if ( !elem.className && classNames.length === 1 ) {
|
2195 |
-
elem.className = value;
|
2196 |
-
|
2197 |
-
} else {
|
2198 |
-
setClass = " " + elem.className + " ";
|
2199 |
-
|
2200 |
-
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
2201 |
-
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
|
2202 |
-
setClass += classNames[ c ] + " ";
|
2203 |
-
}
|
2204 |
-
}
|
2205 |
-
elem.className = jQuery.trim( setClass );
|
2206 |
-
}
|
2207 |
-
}
|
2208 |
-
}
|
2209 |
-
}
|
2210 |
-
|
2211 |
-
return this;
|
2212 |
-
},
|
2213 |
-
|
2214 |
-
removeClass: function( value ) {
|
2215 |
-
var classNames, i, l, elem, className, c, cl;
|
2216 |
-
|
2217 |
-
if ( jQuery.isFunction( value ) ) {
|
2218 |
-
return this.each(function( j ) {
|
2219 |
-
jQuery( this ).removeClass( value.call(this, j, this.className) );
|
2220 |
-
});
|
2221 |
-
}
|
2222 |
-
|
2223 |
-
if ( (value && typeof value === "string") || value === undefined ) {
|
2224 |
-
classNames = ( value || "" ).split( rspace );
|
2225 |
-
|
2226 |
-
for ( i = 0, l = this.length; i < l; i++ ) {
|
2227 |
-
elem = this[ i ];
|
2228 |
-
|
2229 |
-
if ( elem.nodeType === 1 && elem.className ) {
|
2230 |
-
if ( value ) {
|
2231 |
-
className = (" " + elem.className + " ").replace( rclass, " " );
|
2232 |
-
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
2233 |
-
className = className.replace(" " + classNames[ c ] + " ", " ");
|
2234 |
-
}
|
2235 |
-
elem.className = jQuery.trim( className );
|
2236 |
-
|
2237 |
-
} else {
|
2238 |
-
elem.className = "";
|
2239 |
-
}
|
2240 |
-
}
|
2241 |
-
}
|
2242 |
-
}
|
2243 |
-
|
2244 |
-
return this;
|
2245 |
-
},
|
2246 |
-
|
2247 |
-
toggleClass: function( value, stateVal ) {
|
2248 |
-
var type = typeof value,
|
2249 |
-
isBool = typeof stateVal === "boolean";
|
2250 |
-
|
2251 |
-
if ( jQuery.isFunction( value ) ) {
|
2252 |
-
return this.each(function( i ) {
|
2253 |
-
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
|
2254 |
-
});
|
2255 |
-
}
|
2256 |
-
|
2257 |
-
return this.each(function() {
|
2258 |
-
if ( type === "string" ) {
|
2259 |
-
// toggle individual class names
|
2260 |
-
var className,
|
2261 |
-
i = 0,
|
2262 |
-
self = jQuery( this ),
|
2263 |
-
state = stateVal,
|
2264 |
-
classNames = value.split( rspace );
|
2265 |
-
|
2266 |
-
while ( (className = classNames[ i++ ]) ) {
|
2267 |
-
// check each className given, space seperated list
|
2268 |
-
state = isBool ? state : !self.hasClass( className );
|
2269 |
-
self[ state ? "addClass" : "removeClass" ]( className );
|
2270 |
-
}
|
2271 |
-
|
2272 |
-
} else if ( type === "undefined" || type === "boolean" ) {
|
2273 |
-
if ( this.className ) {
|
2274 |
-
// store className if set
|
2275 |
-
jQuery._data( this, "__className__", this.className );
|
2276 |
-
}
|
2277 |
-
|
2278 |
-
// toggle whole className
|
2279 |
-
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
|
2280 |
-
}
|
2281 |
-
});
|
2282 |
-
},
|
2283 |
-
|
2284 |
-
hasClass: function( selector ) {
|
2285 |
-
var className = " " + selector + " ",
|
2286 |
-
i = 0,
|
2287 |
-
l = this.length;
|
2288 |
-
for ( ; i < l; i++ ) {
|
2289 |
-
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
|
2290 |
-
return true;
|
2291 |
-
}
|
2292 |
-
}
|
2293 |
-
|
2294 |
-
return false;
|
2295 |
-
},
|
2296 |
-
|
2297 |
-
val: function( value ) {
|
2298 |
-
var hooks, ret, isFunction,
|
2299 |
-
elem = this[0];
|
2300 |
-
|
2301 |
-
if ( !arguments.length ) {
|
2302 |
-
if ( elem ) {
|
2303 |
-
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
|
2304 |
-
|
2305 |
-
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
|
2306 |
-
return ret;
|
2307 |
-
}
|
2308 |
-
|
2309 |
-
ret = elem.value;
|
2310 |
-
|
2311 |
-
return typeof ret === "string" ?
|
2312 |
-
// handle most common string cases
|
2313 |
-
ret.replace(rreturn, "") :
|
2314 |
-
// handle cases where value is null/undef or number
|
2315 |
-
ret == null ? "" : ret;
|
2316 |
-
}
|
2317 |
-
|
2318 |
-
return;
|
2319 |
-
}
|
2320 |
-
|
2321 |
-
isFunction = jQuery.isFunction( value );
|
2322 |
-
|
2323 |
-
return this.each(function( i ) {
|
2324 |
-
var self = jQuery(this), val;
|
2325 |
-
|
2326 |
-
if ( this.nodeType !== 1 ) {
|
2327 |
-
return;
|
2328 |
-
}
|
2329 |
-
|
2330 |
-
if ( isFunction ) {
|
2331 |
-
val = value.call( this, i, self.val() );
|
2332 |
-
} else {
|
2333 |
-
val = value;
|
2334 |
-
}
|
2335 |
-
|
2336 |
-
// Treat null/undefined as ""; convert numbers to string
|
2337 |
-
if ( val == null ) {
|
2338 |
-
val = "";
|
2339 |
-
} else if ( typeof val === "number" ) {
|
2340 |
-
val += "";
|
2341 |
-
} else if ( jQuery.isArray( val ) ) {
|
2342 |
-
val = jQuery.map(val, function ( value ) {
|
2343 |
-
return value == null ? "" : value + "";
|
2344 |
-
});
|
2345 |
-
}
|
2346 |
-
|
2347 |
-
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
|
2348 |
-
|
2349 |
-
// If set returns undefined, fall back to normal setting
|
2350 |
-
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
|
2351 |
-
this.value = val;
|
2352 |
-
}
|
2353 |
-
});
|
2354 |
-
}
|
2355 |
-
});
|
2356 |
-
|
2357 |
-
jQuery.extend({
|
2358 |
-
valHooks: {
|
2359 |
-
option: {
|
2360 |
-
get: function( elem ) {
|
2361 |
-
// attributes.value is undefined in Blackberry 4.7 but
|
2362 |
-
// uses .value. See #6932
|
2363 |
-
var val = elem.attributes.value;
|
2364 |
-
return !val || val.specified ? elem.value : elem.text;
|
2365 |
-
}
|
2366 |
-
},
|
2367 |
-
select: {
|
2368 |
-
get: function( elem ) {
|
2369 |
-
var value, i, max, option,
|
2370 |
-
index = elem.selectedIndex,
|
2371 |
-
values = [],
|
2372 |
-
options = elem.options,
|
2373 |
-
one = elem.type === "select-one";
|
2374 |
-
|
2375 |
-
// Nothing was selected
|
2376 |
-
if ( index < 0 ) {
|
2377 |
-
return null;
|
2378 |
-
}
|
2379 |
-
|
2380 |
-
// Loop through all the selected options
|
2381 |
-
i = one ? index : 0;
|
2382 |
-
max = one ? index + 1 : options.length;
|
2383 |
-
for ( ; i < max; i++ ) {
|
2384 |
-
option = options[ i ];
|
2385 |
-
|
2386 |
-
// Don't return options that are disabled or in a disabled optgroup
|
2387 |
-
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
|
2388 |
-
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
|
2389 |
-
|
2390 |
-
// Get the specific value for the option
|
2391 |
-
value = jQuery( option ).val();
|
2392 |
-
|
2393 |
-
// We don't need an array for one selects
|
2394 |
-
if ( one ) {
|
2395 |
-
return value;
|
2396 |
-
}
|
2397 |
-
|
2398 |
-
// Multi-Selects return an array
|
2399 |
-
values.push( value );
|
2400 |
-
}
|
2401 |
-
}
|
2402 |
-
|
2403 |
-
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
|
2404 |
-
if ( one && !values.length && options.length ) {
|
2405 |
-
return jQuery( options[ index ] ).val();
|
2406 |
-
}
|
2407 |
-
|
2408 |
-
return values;
|
2409 |
-
},
|
2410 |
-
|
2411 |
-
set: function( elem, value ) {
|
2412 |
-
var values = jQuery.makeArray( value );
|
2413 |
-
|
2414 |
-
jQuery(elem).find("option").each(function() {
|
2415 |
-
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
|
2416 |
-
});
|
2417 |
-
|
2418 |
-
if ( !values.length ) {
|
2419 |
-
elem.selectedIndex = -1;
|
2420 |
-
}
|
2421 |
-
return values;
|
2422 |
-
}
|
2423 |
-
}
|
2424 |
-
},
|
2425 |
-
|
2426 |
-
attrFn: {
|
2427 |
-
val: true,
|
2428 |
-
css: true,
|
2429 |
-
html: true,
|
2430 |
-
text: true,
|
2431 |
-
data: true,
|
2432 |
-
width: true,
|
2433 |
-
height: true,
|
2434 |
-
offset: true
|
2435 |
-
},
|
2436 |
-
|
2437 |
-
attr: function( elem, name, value, pass ) {
|
2438 |
-
var ret, hooks, notxml,
|
2439 |
-
nType = elem.nodeType;
|
2440 |
-
|
2441 |
-
// don't get/set attributes on text, comment and attribute nodes
|
2442 |
-
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
2443 |
-
return;
|
2444 |
-
}
|
2445 |
-
|
2446 |
-
if ( pass && name in jQuery.attrFn ) {
|
2447 |
-
return jQuery( elem )[ name ]( value );
|
2448 |
-
}
|
2449 |
-
|
2450 |
-
// Fallback to prop when attributes are not supported
|
2451 |
-
if ( typeof elem.getAttribute === "undefined" ) {
|
2452 |
-
return jQuery.prop( elem, name, value );
|
2453 |
-
}
|
2454 |
-
|
2455 |
-
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
2456 |
-
|
2457 |
-
// All attributes are lowercase
|
2458 |
-
// Grab necessary hook if one is defined
|
2459 |
-
if ( notxml ) {
|
2460 |
-
name = name.toLowerCase();
|
2461 |
-
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
|
2462 |
-
}
|
2463 |
-
|
2464 |
-
if ( value !== undefined ) {
|
2465 |
-
|
2466 |
-
if ( value === null ) {
|
2467 |
-
jQuery.removeAttr( elem, name );
|
2468 |
-
return;
|
2469 |
-
|
2470 |
-
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
2471 |
-
return ret;
|
2472 |
-
|
2473 |
-
} else {
|
2474 |
-
elem.setAttribute( name, "" + value );
|
2475 |
-
return value;
|
2476 |
-
}
|
2477 |
-
|
2478 |
-
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
|
2479 |
-
return ret;
|
2480 |
-
|
2481 |
-
} else {
|
2482 |
-
|
2483 |
-
ret = elem.getAttribute( name );
|
2484 |
-
|
2485 |
-
// Non-existent attributes return null, we normalize to undefined
|
2486 |
-
return ret === null ?
|
2487 |
-
undefined :
|
2488 |
-
ret;
|
2489 |
-
}
|
2490 |
-
},
|
2491 |
-
|
2492 |
-
removeAttr: function( elem, value ) {
|
2493 |
-
var propName, attrNames, name, l,
|
2494 |
-
i = 0;
|
2495 |
-
|
2496 |
-
if ( value && elem.nodeType === 1 ) {
|
2497 |
-
attrNames = value.toLowerCase().split( rspace );
|
2498 |
-
l = attrNames.length;
|
2499 |
-
|
2500 |
-
for ( ; i < l; i++ ) {
|
2501 |
-
name = attrNames[ i ];
|
2502 |
-
|
2503 |
-
if ( name ) {
|
2504 |
-
propName = jQuery.propFix[ name ] || name;
|
2505 |
-
|
2506 |
-
// See #9699 for explanation of this approach (setting first, then removal)
|
2507 |
-
jQuery.attr( elem, name, "" );
|
2508 |
-
elem.removeAttribute( getSetAttribute ? name : propName );
|
2509 |
-
|
2510 |
-
// Set corresponding property to false for boolean attributes
|
2511 |
-
if ( rboolean.test( name ) && propName in elem ) {
|
2512 |
-
elem[ propName ] = false;
|
2513 |
-
}
|
2514 |
-
}
|
2515 |
-
}
|
2516 |
-
}
|
2517 |
-
},
|
2518 |
-
|
2519 |
-
attrHooks: {
|
2520 |
-
type: {
|
2521 |
-
set: function( elem, value ) {
|
2522 |
-
// We can't allow the type property to be changed (since it causes problems in IE)
|
2523 |
-
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
|
2524 |
-
jQuery.error( "type property can't be changed" );
|
2525 |
-
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
2526 |
-
// Setting the type on a radio button after the value resets the value in IE6-9
|
2527 |
-
// Reset value to it's default in case type is set after value
|
2528 |
-
// This is for element creation
|
2529 |
-
var val = elem.value;
|
2530 |
-
elem.setAttribute( "type", value );
|
2531 |
-
if ( val ) {
|
2532 |
-
elem.value = val;
|
2533 |
-
}
|
2534 |
-
return value;
|
2535 |
-
}
|
2536 |
-
}
|
2537 |
-
},
|
2538 |
-
// Use the value property for back compat
|
2539 |
-
// Use the nodeHook for button elements in IE6/7 (#1954)
|
2540 |
-
value: {
|
2541 |
-
get: function( elem, name ) {
|
2542 |
-
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
|
2543 |
-
return nodeHook.get( elem, name );
|
2544 |
-
}
|
2545 |
-
return name in elem ?
|
2546 |
-
elem.value :
|
2547 |
-
null;
|
2548 |
-
},
|
2549 |
-
set: function( elem, value, name ) {
|
2550 |
-
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
|
2551 |
-
return nodeHook.set( elem, value, name );
|
2552 |
-
}
|
2553 |
-
// Does not return so that setAttribute is also used
|
2554 |
-
elem.value = value;
|
2555 |
-
}
|
2556 |
-
}
|
2557 |
-
},
|
2558 |
-
|
2559 |
-
propFix: {
|
2560 |
-
tabindex: "tabIndex",
|
2561 |
-
readonly: "readOnly",
|
2562 |
-
"for": "htmlFor",
|
2563 |
-
"class": "className",
|
2564 |
-
maxlength: "maxLength",
|
2565 |
-
cellspacing: "cellSpacing",
|
2566 |
-
cellpadding: "cellPadding",
|
2567 |
-
rowspan: "rowSpan",
|
2568 |
-
colspan: "colSpan",
|
2569 |
-
usemap: "useMap",
|
2570 |
-
frameborder: "frameBorder",
|
2571 |
-
contenteditable: "contentEditable"
|
2572 |
-
},
|
2573 |
-
|
2574 |
-
prop: function( elem, name, value ) {
|
2575 |
-
var ret, hooks, notxml,
|
2576 |
-
nType = elem.nodeType;
|
2577 |
-
|
2578 |
-
// don't get/set properties on text, comment and attribute nodes
|
2579 |
-
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
2580 |
-
return;
|
2581 |
-
}
|
2582 |
-
|
2583 |
-
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
2584 |
-
|
2585 |
-
if ( notxml ) {
|
2586 |
-
// Fix name and attach hooks
|
2587 |
-
name = jQuery.propFix[ name ] || name;
|
2588 |
-
hooks = jQuery.propHooks[ name ];
|
2589 |
-
}
|
2590 |
-
|
2591 |
-
if ( value !== undefined ) {
|
2592 |
-
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
2593 |
-
return ret;
|
2594 |
-
|
2595 |
-
} else {
|
2596 |
-
return ( elem[ name ] = value );
|
2597 |
-
}
|
2598 |
-
|
2599 |
-
} else {
|
2600 |
-
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
|
2601 |
-
return ret;
|
2602 |
-
|
2603 |
-
} else {
|
2604 |
-
return elem[ name ];
|
2605 |
-
}
|
2606 |
-
}
|
2607 |
-
},
|
2608 |
-
|
2609 |
-
propHooks: {
|
2610 |
-
tabIndex: {
|
2611 |
-
get: function( elem ) {
|
2612 |
-
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
|
2613 |
-
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
2614 |
-
var attributeNode = elem.getAttributeNode("tabindex");
|
2615 |
-
|
2616 |
-
return attributeNode && attributeNode.specified ?
|
2617 |
-
parseInt( attributeNode.value, 10 ) :
|
2618 |
-
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
|
2619 |
-
0 :
|
2620 |
-
undefined;
|
2621 |
-
}
|
2622 |
-
}
|
2623 |
-
}
|
2624 |
-
});
|
2625 |
-
|
2626 |
-
// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
|
2627 |
-
jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
|
2628 |
-
|
2629 |
-
// Hook for boolean attributes
|
2630 |
-
boolHook = {
|
2631 |
-
get: function( elem, name ) {
|
2632 |
-
// Align boolean attributes with corresponding properties
|
2633 |
-
// Fall back to attribute presence where some booleans are not supported
|
2634 |
-
var attrNode,
|
2635 |
-
property = jQuery.prop( elem, name );
|
2636 |
-
return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
|
2637 |
-
name.toLowerCase() :
|
2638 |
-
undefined;
|
2639 |
-
},
|
2640 |
-
set: function( elem, value, name ) {
|
2641 |
-
var propName;
|
2642 |
-
if ( value === false ) {
|
2643 |
-
// Remove boolean attributes when set to false
|
2644 |
-
jQuery.removeAttr( elem, name );
|
2645 |
-
} else {
|
2646 |
-
// value is true since we know at this point it's type boolean and not false
|
2647 |
-
// Set boolean attributes to the same name and set the DOM property
|
2648 |
-
propName = jQuery.propFix[ name ] || name;
|
2649 |
-
if ( propName in elem ) {
|
2650 |
-
// Only set the IDL specifically if it already exists on the element
|
2651 |
-
elem[ propName ] = true;
|
2652 |
-
}
|
2653 |
-
|
2654 |
-
elem.setAttribute( name, name.toLowerCase() );
|
2655 |
-
}
|
2656 |
-
return name;
|
2657 |
-
}
|
2658 |
-
};
|
2659 |
-
|
2660 |
-
// IE6/7 do not support getting/setting some attributes with get/setAttribute
|
2661 |
-
if ( !getSetAttribute ) {
|
2662 |
-
|
2663 |
-
fixSpecified = {
|
2664 |
-
name: true,
|
2665 |
-
id: true
|
2666 |
-
};
|
2667 |
-
|
2668 |
-
// Use this for any attribute in IE6/7
|
2669 |
-
// This fixes almost every IE6/7 issue
|
2670 |
-
nodeHook = jQuery.valHooks.button = {
|
2671 |
-
get: function( elem, name ) {
|
2672 |
-
var ret;
|
2673 |
-
ret = elem.getAttributeNode( name );
|
2674 |
-
return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
|
2675 |
-
ret.nodeValue :
|
2676 |
-
undefined;
|
2677 |
-
},
|
2678 |
-
set: function( elem, value, name ) {
|
2679 |
-
// Set the existing or create a new attribute node
|
2680 |
-
var ret = elem.getAttributeNode( name );
|
2681 |
-
if ( !ret ) {
|
2682 |
-
ret = document.createAttribute( name );
|
2683 |
-
elem.setAttributeNode( ret );
|
2684 |
-
}
|
2685 |
-
return ( ret.nodeValue = value + "" );
|
2686 |
-
}
|
2687 |
-
};
|
2688 |
-
|
2689 |
-
// Apply the nodeHook to tabindex
|
2690 |
-
jQuery.attrHooks.tabindex.set = nodeHook.set;
|
2691 |
-
|
2692 |
-
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
|
2693 |
-
// This is for removals
|
2694 |
-
jQuery.each([ "width", "height" ], function( i, name ) {
|
2695 |
-
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
2696 |
-
set: function( elem, value ) {
|
2697 |
-
if ( value === "" ) {
|
2698 |
-
elem.setAttribute( name, "auto" );
|
2699 |
-
return value;
|
2700 |
-
}
|
2701 |
-
}
|
2702 |
-
});
|
2703 |
-
});
|
2704 |
-
|
2705 |
-
// Set contenteditable to false on removals(#10429)
|
2706 |
-
// Setting to empty string throws an error as an invalid value
|
2707 |
-
jQuery.attrHooks.contenteditable = {
|
2708 |
-
get: nodeHook.get,
|
2709 |
-
set: function( elem, value, name ) {
|
2710 |
-
if ( value === "" ) {
|
2711 |
-
value = "false";
|
2712 |
-
}
|
2713 |
-
nodeHook.set( elem, value, name );
|
2714 |
-
}
|
2715 |
-
};
|
2716 |
-
}
|
2717 |
-
|
2718 |
-
|
2719 |
-
// Some attributes require a special call on IE
|
2720 |
-
if ( !jQuery.support.hrefNormalized ) {
|
2721 |
-
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
|
2722 |
-
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
2723 |
-
get: function( elem ) {
|
2724 |
-
var ret = elem.getAttribute( name, 2 );
|
2725 |
-
return ret === null ? undefined : ret;
|
2726 |
-
}
|
2727 |
-
});
|
2728 |
-
});
|
2729 |
-
}
|
2730 |
-
|
2731 |
-
if ( !jQuery.support.style ) {
|
2732 |
-
jQuery.attrHooks.style = {
|
2733 |
-
get: function( elem ) {
|
2734 |
-
// Return undefined in the case of empty string
|
2735 |
-
// Normalize to lowercase since IE uppercases css property names
|
2736 |
-
return elem.style.cssText.toLowerCase() || undefined;
|
2737 |
-
},
|
2738 |
-
set: function( elem, value ) {
|
2739 |
-
return ( elem.style.cssText = "" + value );
|
2740 |
-
}
|
2741 |
-
};
|
2742 |
-
}
|
2743 |
-
|
2744 |
-
// Safari mis-reports the default selected property of an option
|
2745 |
-
// Accessing the parent's selectedIndex property fixes it
|
2746 |
-
if ( !jQuery.support.optSelected ) {
|
2747 |
-
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
|
2748 |
-
get: function( elem ) {
|
2749 |
-
var parent = elem.parentNode;
|
2750 |
-
|
2751 |
-
if ( parent ) {
|
2752 |
-
parent.selectedIndex;
|
2753 |
-
|
2754 |
-
// Make sure that it also works with optgroups, see #5701
|
2755 |
-
if ( parent.parentNode ) {
|
2756 |
-
parent.parentNode.selectedIndex;
|
2757 |
-
}
|
2758 |
-
}
|
2759 |
-
return null;
|
2760 |
-
}
|
2761 |
-
});
|
2762 |
-
}
|
2763 |
-
|
2764 |
-
// IE6/7 call enctype encoding
|
2765 |
-
if ( !jQuery.support.enctype ) {
|
2766 |
-
jQuery.propFix.enctype = "encoding";
|
2767 |
-
}
|
2768 |
-
|
2769 |
-
// Radios and checkboxes getter/setter
|
2770 |
-
if ( !jQuery.support.checkOn ) {
|
2771 |
-
jQuery.each([ "radio", "checkbox" ], function() {
|
2772 |
-
jQuery.valHooks[ this ] = {
|
2773 |
-
get: function( elem ) {
|
2774 |
-
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
|
2775 |
-
return elem.getAttribute("value") === null ? "on" : elem.value;
|
2776 |
-
}
|
2777 |
-
};
|
2778 |
-
});
|
2779 |
-
}
|
2780 |
-
jQuery.each([ "radio", "checkbox" ], function() {
|
2781 |
-
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
|
2782 |
-
set: function( elem, value ) {
|
2783 |
-
if ( jQuery.isArray( value ) ) {
|
2784 |
-
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
|
2785 |
-
}
|
2786 |
-
}
|
2787 |
-
});
|
2788 |
-
});
|
2789 |
-
|
2790 |
-
|
2791 |
-
|
2792 |
-
|
2793 |
-
var rformElems = /^(?:textarea|input|select)$/i,
|
2794 |
-
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
|
2795 |
-
rhoverHack = /\bhover(\.\S+)?\b/,
|
2796 |
-
rkeyEvent = /^key/,
|
2797 |
-
rmouseEvent = /^(?:mouse|contextmenu)|click/,
|
2798 |
-
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
2799 |
-
rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
|
2800 |
-
quickParse = function( selector ) {
|
2801 |
-
var quick = rquickIs.exec( selector );
|
2802 |
-
if ( quick ) {
|
2803 |
-
// 0 1 2 3
|
2804 |
-
// [ _, tag, id, class ]
|
2805 |
-
quick[1] = ( quick[1] || "" ).toLowerCase();
|
2806 |
-
quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
|
2807 |
-
}
|
2808 |
-
return quick;
|
2809 |
-
},
|
2810 |
-
quickIs = function( elem, m ) {
|
2811 |
-
var attrs = elem.attributes || {};
|
2812 |
-
return (
|
2813 |
-
(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
|
2814 |
-
(!m[2] || (attrs.id || {}).value === m[2]) &&
|
2815 |
-
(!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
|
2816 |
-
);
|
2817 |
-
},
|
2818 |
-
hoverHack = function( events ) {
|
2819 |
-
return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
|
2820 |
-
};
|
2821 |
-
|
2822 |
-
/*
|
2823 |
-
* Helper functions for managing events -- not part of the public interface.
|
2824 |
-
* Props to Dean Edwards' addEvent library for many of the ideas.
|
2825 |
-
*/
|
2826 |
-
jQuery.event = {
|
2827 |
-
|
2828 |
-
add: function( elem, types, handler, data, selector ) {
|
2829 |
-
|
2830 |
-
var elemData, eventHandle, events,
|
2831 |
-
t, tns, type, namespaces, handleObj,
|
2832 |
-
handleObjIn, quick, handlers, special;
|
2833 |
-
|
2834 |
-
// Don't attach events to noData or text/comment nodes (allow plain objects tho)
|
2835 |
-
if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
|
2836 |
-
return;
|
2837 |
-
}
|
2838 |
-
|
2839 |
-
// Caller can pass in an object of custom data in lieu of the handler
|
2840 |
-
if ( handler.handler ) {
|
2841 |
-
handleObjIn = handler;
|
2842 |
-
handler = handleObjIn.handler;
|
2843 |
-
}
|
2844 |
-
|
2845 |
-
// Make sure that the handler has a unique ID, used to find/remove it later
|
2846 |
-
if ( !handler.guid ) {
|
2847 |
-
handler.guid = jQuery.guid++;
|
2848 |
-
}
|
2849 |
-
|
2850 |
-
// Init the element's event structure and main handler, if this is the first
|
2851 |
-
events = elemData.events;
|
2852 |
-
if ( !events ) {
|
2853 |
-
elemData.events = events = {};
|
2854 |
-
}
|
2855 |
-
eventHandle = elemData.handle;
|
2856 |
-
if ( !eventHandle ) {
|
2857 |
-
elemData.handle = eventHandle = function( e ) {
|
2858 |
-
// Discard the second event of a jQuery.event.trigger() and
|
2859 |
-
// when an event is called after a page has unloaded
|
2860 |
-
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
|
2861 |
-
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
|
2862 |
-
undefined;
|
2863 |
-
};
|
2864 |
-
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
|
2865 |
-
eventHandle.elem = elem;
|
2866 |
-
}
|
2867 |
-
|
2868 |
-
// Handle multiple events separated by a space
|
2869 |
-
// jQuery(...).bind("mouseover mouseout", fn);
|
2870 |
-
types = jQuery.trim( hoverHack(types) ).split( " " );
|
2871 |
-
for ( t = 0; t < types.length; t++ ) {
|
2872 |
-
|
2873 |
-
tns = rtypenamespace.exec( types[t] ) || [];
|
2874 |
-
type = tns[1];
|
2875 |
-
namespaces = ( tns[2] || "" ).split( "." ).sort();
|
2876 |
-
|
2877 |
-
// If event changes its type, use the special event handlers for the changed type
|
2878 |
-
special = jQuery.event.special[ type ] || {};
|
2879 |
-
|
2880 |
-
// If selector defined, determine special event api type, otherwise given type
|
2881 |
-
type = ( selector ? special.delegateType : special.bindType ) || type;
|
2882 |
-
|
2883 |
-
// Update special based on newly reset type
|
2884 |
-
special = jQuery.event.special[ type ] || {};
|
2885 |
-
|
2886 |
-
// handleObj is passed to all event handlers
|
2887 |
-
handleObj = jQuery.extend({
|
2888 |
-
type: type,
|
2889 |
-
origType: tns[1],
|
2890 |
-
data: data,
|
2891 |
-
handler: handler,
|
2892 |
-
guid: handler.guid,
|
2893 |
-
selector: selector,
|
2894 |
-
quick: quickParse( selector ),
|
2895 |
-
namespace: namespaces.join(".")
|
2896 |
-
}, handleObjIn );
|
2897 |
-
|
2898 |
-
// Init the event handler queue if we're the first
|
2899 |
-
handlers = events[ type ];
|
2900 |
-
if ( !handlers ) {
|
2901 |
-
handlers = events[ type ] = [];
|
2902 |
-
handlers.delegateCount = 0;
|
2903 |
-
|
2904 |
-
// Only use addEventListener/attachEvent if the special events handler returns false
|
2905 |
-
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
|
2906 |
-
// Bind the global event handler to the element
|
2907 |
-
if ( elem.addEventListener ) {
|
2908 |
-
elem.addEventListener( type, eventHandle, false );
|
2909 |
-
|
2910 |
-
} else if ( elem.attachEvent ) {
|
2911 |
-
elem.attachEvent( "on" + type, eventHandle );
|
2912 |
-
}
|
2913 |
-
}
|
2914 |
-
}
|
2915 |
-
|
2916 |
-
if ( special.add ) {
|
2917 |
-
special.add.call( elem, handleObj );
|
2918 |
-
|
2919 |
-
if ( !handleObj.handler.guid ) {
|
2920 |
-
handleObj.handler.guid = handler.guid;
|
2921 |
-
}
|
2922 |
-
}
|
2923 |
-
|
2924 |
-
// Add to the element's handler list, delegates in front
|
2925 |
-
if ( selector ) {
|
2926 |
-
handlers.splice( handlers.delegateCount++, 0, handleObj );
|
2927 |
-
} else {
|
2928 |
-
handlers.push( handleObj );
|
2929 |
-
}
|
2930 |
-
|
2931 |
-
// Keep track of which events have ever been used, for event optimization
|
2932 |
-
jQuery.event.global[ type ] = true;
|
2933 |
-
}
|
2934 |
-
|
2935 |
-
// Nullify elem to prevent memory leaks in IE
|
2936 |
-
elem = null;
|
2937 |
-
},
|
2938 |
-
|
2939 |
-
global: {},
|
2940 |
-
|
2941 |
-
// Detach an event or set of events from an element
|
2942 |
-
remove: function( elem, types, handler, selector, mappedTypes ) {
|
2943 |
-
|
2944 |
-
var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
|
2945 |
-
t, tns, type, origType, namespaces, origCount,
|
2946 |
-
j, events, special, handle, eventType, handleObj;
|
2947 |
-
|
2948 |
-
if ( !elemData || !(events = elemData.events) ) {
|
2949 |
-
return;
|
2950 |
-
}
|
2951 |
-
|
2952 |
-
// Once for each type.namespace in types; type may be omitted
|
2953 |
-
types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
|
2954 |
-
for ( t = 0; t < types.length; t++ ) {
|
2955 |
-
tns = rtypenamespace.exec( types[t] ) || [];
|
2956 |
-
type = origType = tns[1];
|
2957 |
-
namespaces = tns[2];
|
2958 |
-
|
2959 |
-
// Unbind all events (on this namespace, if provided) for the element
|
2960 |
-
if ( !type ) {
|
2961 |
-
for ( type in events ) {
|
2962 |
-
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
|
2963 |
-
}
|
2964 |
-
continue;
|
2965 |
-
}
|
2966 |
-
|
2967 |
-
special = jQuery.event.special[ type ] || {};
|
2968 |
-
type = ( selector? special.delegateType : special.bindType ) || type;
|
2969 |
-
eventType = events[ type ] || [];
|
2970 |
-
origCount = eventType.length;
|
2971 |
-
namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
|
2972 |
-
|
2973 |
-
// Remove matching events
|
2974 |
-
for ( j = 0; j < eventType.length; j++ ) {
|
2975 |
-
handleObj = eventType[ j ];
|
2976 |
-
|
2977 |
-
if ( ( mappedTypes || origType === handleObj.origType ) &&
|
2978 |
-
( !handler || handler.guid === handleObj.guid ) &&
|
2979 |
-
( !namespaces || namespaces.test( handleObj.namespace ) ) &&
|
2980 |
-
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
|
2981 |
-
eventType.splice( j--, 1 );
|
2982 |
-
|
2983 |
-
if ( handleObj.selector ) {
|
2984 |
-
eventType.delegateCount--;
|
2985 |
-
}
|
2986 |
-
if ( special.remove ) {
|
2987 |
-
special.remove.call( elem, handleObj );
|
2988 |
-
}
|
2989 |
-
}
|
2990 |
-
}
|
2991 |
-
|
2992 |
-
// Remove generic event handler if we removed something and no more handlers exist
|
2993 |
-
// (avoids potential for endless recursion during removal of special event handlers)
|
2994 |
-
if ( eventType.length === 0 && origCount !== eventType.length ) {
|
2995 |
-
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
|
2996 |
-
jQuery.removeEvent( elem, type, elemData.handle );
|
2997 |
-
}
|
2998 |
-
|
2999 |
-
delete events[ type ];
|
3000 |
-
}
|
3001 |
-
}
|
3002 |
-
|
3003 |
-
// Remove the expando if it's no longer used
|
3004 |
-
if ( jQuery.isEmptyObject( events ) ) {
|
3005 |
-
handle = elemData.handle;
|
3006 |
-
if ( handle ) {
|
3007 |
-
handle.elem = null;
|
3008 |
-
}
|
3009 |
-
|
3010 |
-
// removeData also checks for emptiness and clears the expando if empty
|
3011 |
-
// so use it instead of delete
|
3012 |
-
jQuery.removeData( elem, [ "events", "handle" ], true );
|
3013 |
-
}
|
3014 |
-
},
|
3015 |
-
|
3016 |
-
// Events that are safe to short-circuit if no handlers are attached.
|
3017 |
-
// Native DOM events should not be added, they may have inline handlers.
|
3018 |
-
customEvent: {
|
3019 |
-
"getData": true,
|
3020 |
-
"setData": true,
|
3021 |
-
"changeData": true
|
3022 |
-
},
|
3023 |
-
|
3024 |
-
trigger: function( event, data, elem, onlyHandlers ) {
|
3025 |
-
// Don't do events on text and comment nodes
|
3026 |
-
if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
|
3027 |
-
return;
|
3028 |
-
}
|
3029 |
-
|
3030 |
-
// Event object or event type
|
3031 |
-
var type = event.type || event,
|
3032 |
-
namespaces = [],
|
3033 |
-
cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
|
3034 |
-
|
3035 |
-
// focus/blur morphs to focusin/out; ensure we're not firing them right now
|
3036 |
-
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
|
3037 |
-
return;
|
3038 |
-
}
|
3039 |
-
|
3040 |
-
if ( type.indexOf( "!" ) >= 0 ) {
|
3041 |
-
// Exclusive events trigger only for the exact event (no namespaces)
|
3042 |
-
type = type.slice(0, -1);
|
3043 |
-
exclusive = true;
|
3044 |
-
}
|
3045 |
-
|
3046 |
-
if ( type.indexOf( "." ) >= 0 ) {
|
3047 |
-
// Namespaced trigger; create a regexp to match event type in handle()
|
3048 |
-
namespaces = type.split(".");
|
3049 |
-
type = namespaces.shift();
|
3050 |
-
namespaces.sort();
|
3051 |
-
}
|
3052 |
-
|
3053 |
-
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
|
3054 |
-
// No jQuery handlers for this event type, and it can't have inline handlers
|
3055 |
-
return;
|
3056 |
-
}
|
3057 |
-
|
3058 |
-
// Caller can pass in an Event, Object, or just an event type string
|
3059 |
-
event = typeof event === "object" ?
|
3060 |
-
// jQuery.Event object
|
3061 |
-
event[ jQuery.expando ] ? event :
|
3062 |
-
// Object literal
|
3063 |
-
new jQuery.Event( type, event ) :
|
3064 |
-
// Just the event type (string)
|
3065 |
-
new jQuery.Event( type );
|
3066 |
-
|
3067 |
-
event.type = type;
|
3068 |
-
event.isTrigger = true;
|
3069 |
-
event.exclusive = exclusive;
|
3070 |
-
event.namespace = namespaces.join( "." );
|
3071 |
-
event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
|
3072 |
-
ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
|
3073 |
-
|
3074 |
-
// Handle a global trigger
|
3075 |
-
if ( !elem ) {
|
3076 |
-
|
3077 |
-
// TODO: Stop taunting the data cache; remove global events and always attach to document
|
3078 |
-
cache = jQuery.cache;
|
3079 |
-
for ( i in cache ) {
|
3080 |
-
if ( cache[ i ].events && cache[ i ].events[ type ] ) {
|
3081 |
-
jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
|
3082 |
-
}
|
3083 |
-
}
|
3084 |
-
return;
|
3085 |
-
}
|
3086 |
-
|
3087 |
-
// Clean up the event in case it is being reused
|
3088 |
-
event.result = undefined;
|
3089 |
-
if ( !event.target ) {
|
3090 |
-
event.target = elem;
|
3091 |
-
}
|
3092 |
-
|
3093 |
-
// Clone any incoming data and prepend the event, creating the handler arg list
|
3094 |
-
data = data != null ? jQuery.makeArray( data ) : [];
|
3095 |
-
data.unshift( event );
|
3096 |
-
|
3097 |
-
// Allow special events to draw outside the lines
|
3098 |
-
special = jQuery.event.special[ type ] || {};
|
3099 |
-
if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
|
3100 |
-
return;
|
3101 |
-
}
|
3102 |
-
|
3103 |
-
// Determine event propagation path in advance, per W3C events spec (#9951)
|
3104 |
-
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
|
3105 |
-
eventPath = [[ elem, special.bindType || type ]];
|
3106 |
-
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
|
3107 |
-
|
3108 |
-
bubbleType = special.delegateType || type;
|
3109 |
-
cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
|
3110 |
-
old = null;
|
3111 |
-
for ( ; cur; cur = cur.parentNode ) {
|
3112 |
-
eventPath.push([ cur, bubbleType ]);
|
3113 |
-
old = cur;
|
3114 |
-
}
|
3115 |
-
|
3116 |
-
// Only add window if we got to document (e.g., not plain obj or detached DOM)
|
3117 |
-
if ( old && old === elem.ownerDocument ) {
|
3118 |
-
eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
|
3119 |
-
}
|
3120 |
-
}
|
3121 |
-
|
3122 |
-
// Fire handlers on the event path
|
3123 |
-
for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
|
3124 |
-
|
3125 |
-
cur = eventPath[i][0];
|
3126 |
-
event.type = eventPath[i][1];
|
3127 |
-
|
3128 |
-
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
|
3129 |
-
if ( handle ) {
|
3130 |
-
handle.apply( cur, data );
|
3131 |
-
}
|
3132 |
-
// Note that this is a bare JS function and not a jQuery handler
|
3133 |
-
handle = ontype && cur[ ontype ];
|
3134 |
-
if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
|
3135 |
-
event.preventDefault();
|
3136 |
-
}
|
3137 |
-
}
|
3138 |
-
event.type = type;
|
3139 |
-
|
3140 |
-
// If nobody prevented the default action, do it now
|
3141 |
-
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
|
3142 |
-
|
3143 |
-
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
|
3144 |
-
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
|
3145 |
-
|
3146 |
-
// Call a native DOM method on the target with the same name name as the event.
|
3147 |
-
// Can't use an .isFunction() check here because IE6/7 fails that test.
|
3148 |
-
// Don't do default actions on window, that's where global variables be (#6170)
|
3149 |
-
// IE<9 dies on focus/blur to hidden element (#1486)
|
3150 |
-
if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
|
3151 |
-
|
3152 |
-
// Don't re-trigger an onFOO event when we call its FOO() method
|
3153 |
-
old = elem[ ontype ];
|
3154 |
-
|
3155 |
-
if ( old ) {
|
3156 |
-
elem[ ontype ] = null;
|
3157 |
-
}
|
3158 |
-
|
3159 |
-
// Prevent re-triggering of the same event, since we already bubbled it above
|
3160 |
-
jQuery.event.triggered = type;
|
3161 |
-
elem[ type ]();
|
3162 |
-
jQuery.event.triggered = undefined;
|
3163 |
-
|
3164 |
-
if ( old ) {
|
3165 |
-
elem[ ontype ] = old;
|
3166 |
-
}
|
3167 |
-
}
|
3168 |
-
}
|
3169 |
-
}
|
3170 |
-
|
3171 |
-
return event.result;
|
3172 |
-
},
|
3173 |
-
|
3174 |
-
dispatch: function( event ) {
|
3175 |
-
|
3176 |
-
// Make a writable jQuery.Event from the native event object
|
3177 |
-
event = jQuery.event.fix( event || window.event );
|
3178 |
-
|
3179 |
-
var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
|
3180 |
-
delegateCount = handlers.delegateCount,
|
3181 |
-
args = [].slice.call( arguments, 0 ),
|
3182 |
-
run_all = !event.exclusive && !event.namespace,
|
3183 |
-
handlerQueue = [],
|
3184 |
-
i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
|
3185 |
-
|
3186 |
-
// Use the fix-ed jQuery.Event rather than the (read-only) native event
|
3187 |
-
args[0] = event;
|
3188 |
-
event.delegateTarget = this;
|
3189 |
-
|
3190 |
-
// Determine handlers that should run if there are delegated events
|
3191 |
-
// Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
|
3192 |
-
if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
|
3193 |
-
|
3194 |
-
// Pregenerate a single jQuery object for reuse with .is()
|
3195 |
-
jqcur = jQuery(this);
|
3196 |
-
jqcur.context = this.ownerDocument || this;
|
3197 |
-
|
3198 |
-
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
|
3199 |
-
selMatch = {};
|
3200 |
-
matches = [];
|
3201 |
-
jqcur[0] = cur;
|
3202 |
-
for ( i = 0; i < delegateCount; i++ ) {
|
3203 |
-
handleObj = handlers[ i ];
|
3204 |
-
sel = handleObj.selector;
|
3205 |
-
|
3206 |
-
if ( selMatch[ sel ] === undefined ) {
|
3207 |
-
selMatch[ sel ] = (
|
3208 |
-
handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
|
3209 |
-
);
|
3210 |
-
}
|
3211 |
-
if ( selMatch[ sel ] ) {
|
3212 |
-
matches.push( handleObj );
|
3213 |
-
}
|
3214 |
-
}
|
3215 |
-
if ( matches.length ) {
|
3216 |
-
handlerQueue.push({ elem: cur, matches: matches });
|
3217 |
-
}
|
3218 |
-
}
|
3219 |
-
}
|
3220 |
-
|
3221 |
-
// Add the remaining (directly-bound) handlers
|
3222 |
-
if ( handlers.length > delegateCount ) {
|
3223 |
-
handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
|
3224 |
-
}
|
3225 |
-
|
3226 |
-
// Run delegates first; they may want to stop propagation beneath us
|
3227 |
-
for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
|
3228 |
-
matched = handlerQueue[ i ];
|
3229 |
-
event.currentTarget = matched.elem;
|
3230 |
-
|
3231 |
-
for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
|
3232 |
-
handleObj = matched.matches[ j ];
|
3233 |
-
|
3234 |
-
// Triggered event must either 1) be non-exclusive and have no namespace, or
|
3235 |
-
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
|
3236 |
-
if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
|
3237 |
-
|
3238 |
-
event.data = handleObj.data;
|
3239 |
-
event.handleObj = handleObj;
|
3240 |
-
|
3241 |
-
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
|
3242 |
-
.apply( matched.elem, args );
|
3243 |
-
|
3244 |
-
if ( ret !== undefined ) {
|
3245 |
-
event.result = ret;
|
3246 |
-
if ( ret === false ) {
|
3247 |
-
event.preventDefault();
|
3248 |
-
event.stopPropagation();
|
3249 |
-
}
|
3250 |
-
}
|
3251 |
-
}
|
3252 |
-
}
|
3253 |
-
}
|
3254 |
-
|
3255 |
-
return event.result;
|
3256 |
-
},
|
3257 |
-
|
3258 |
-
// Includes some event props shared by KeyEvent and MouseEvent
|
3259 |
-
// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
|
3260 |
-
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
|
3261 |
-
|
3262 |
-
fixHooks: {},
|
3263 |
-
|
3264 |
-
keyHooks: {
|
3265 |
-
props: "char charCode key keyCode".split(" "),
|
3266 |
-
filter: function( event, original ) {
|
3267 |
-
|
3268 |
-
// Add which for key events
|
3269 |
-
if ( event.which == null ) {
|
3270 |
-
event.which = original.charCode != null ? original.charCode : original.keyCode;
|
3271 |
-
}
|
3272 |
-
|
3273 |
-
return event;
|
3274 |
-
}
|
3275 |
-
},
|
3276 |
-
|
3277 |
-
mouseHooks: {
|
3278 |
-
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
|
3279 |
-
filter: function( event, original ) {
|
3280 |
-
var eventDoc, doc, body,
|
3281 |
-
button = original.button,
|
3282 |
-
fromElement = original.fromElement;
|
3283 |
-
|
3284 |
-
// Calculate pageX/Y if missing and clientX/Y available
|
3285 |
-
if ( event.pageX == null && original.clientX != null ) {
|
3286 |
-
eventDoc = event.target.ownerDocument || document;
|
3287 |
-
doc = eventDoc.documentElement;
|
3288 |
-
body = eventDoc.body;
|
3289 |
-
|
3290 |
-
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
|
3291 |
-
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
|
3292 |
-
}
|
3293 |
-
|
3294 |
-
// Add relatedTarget, if necessary
|
3295 |
-
if ( !event.relatedTarget && fromElement ) {
|
3296 |
-
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
|
3297 |
-
}
|
3298 |
-
|
3299 |
-
// Add which for click: 1 === left; 2 === middle; 3 === right
|
3300 |
-
// Note: button is not normalized, so don't use it
|
3301 |
-
if ( !event.which && button !== undefined ) {
|
3302 |
-
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
|
3303 |
-
}
|
3304 |
-
|
3305 |
-
return event;
|
3306 |
-
}
|
3307 |
-
},
|
3308 |
-
|
3309 |
-
fix: function( event ) {
|
3310 |
-
if ( event[ jQuery.expando ] ) {
|
3311 |
-
return event;
|
3312 |
-
}
|
3313 |
-
|
3314 |
-
// Create a writable copy of the event object and normalize some properties
|
3315 |
-
var i, prop,
|
3316 |
-
originalEvent = event,
|
3317 |
-
fixHook = jQuery.event.fixHooks[ event.type ] || {},
|
3318 |
-
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
|
3319 |
-
|
3320 |
-
event = jQuery.Event( originalEvent );
|
3321 |
-
|
3322 |
-
for ( i = copy.length; i; ) {
|
3323 |
-
prop = copy[ --i ];
|
3324 |
-
event[ prop ] = originalEvent[ prop ];
|
3325 |
-
}
|
3326 |
-
|
3327 |
-
// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
|
3328 |
-
if ( !event.target ) {
|
3329 |
-
event.target = originalEvent.srcElement || document;
|
3330 |
-
}
|
3331 |
-
|
3332 |
-
// Target should not be a text node (#504, Safari)
|
3333 |
-
if ( event.target.nodeType === 3 ) {
|
3334 |
-
event.target = event.target.parentNode;
|
3335 |
-
}
|
3336 |
-
|
3337 |
-
// For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
|
3338 |
-
if ( event.metaKey === undefined ) {
|
3339 |
-
event.metaKey = event.ctrlKey;
|
3340 |
-
}
|
3341 |
-
|
3342 |
-
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
|
3343 |
-
},
|
3344 |
-
|
3345 |
-
special: {
|
3346 |
-
ready: {
|
3347 |
-
// Make sure the ready event is setup
|
3348 |
-
setup: jQuery.bindReady
|
3349 |
-
},
|
3350 |
-
|
3351 |
-
load: {
|
3352 |
-
// Prevent triggered image.load events from bubbling to window.load
|
3353 |
-
noBubble: true
|
3354 |
-
},
|
3355 |
-
|
3356 |
-
focus: {
|
3357 |
-
delegateType: "focusin"
|
3358 |
-
},
|
3359 |
-
blur: {
|
3360 |
-
delegateType: "focusout"
|
3361 |
-
},
|
3362 |
-
|
3363 |
-
beforeunload: {
|
3364 |
-
setup: function( data, namespaces, eventHandle ) {
|
3365 |
-
// We only want to do this special case on windows
|
3366 |
-
if ( jQuery.isWindow( this ) ) {
|
3367 |
-
this.onbeforeunload = eventHandle;
|
3368 |
-
}
|
3369 |
-
},
|
3370 |
-
|
3371 |
-
teardown: function( namespaces, eventHandle ) {
|
3372 |
-
if ( this.onbeforeunload === eventHandle ) {
|
3373 |
-
this.onbeforeunload = null;
|
3374 |
-
}
|
3375 |
-
}
|
3376 |
-
}
|
3377 |
-
},
|
3378 |
-
|
3379 |
-
simulate: function( type, elem, event, bubble ) {
|
3380 |
-
// Piggyback on a donor event to simulate a different one.
|
3381 |
-
// Fake originalEvent to avoid donor's stopPropagation, but if the
|
3382 |
-
// simulated event prevents default then we do the same on the donor.
|
3383 |
-
var e = jQuery.extend(
|
3384 |
-
new jQuery.Event(),
|
3385 |
-
event,
|
3386 |
-
{ type: type,
|
3387 |
-
isSimulated: true,
|
3388 |
-
originalEvent: {}
|
3389 |
-
}
|
3390 |
-
);
|
3391 |
-
if ( bubble ) {
|
3392 |
-
jQuery.event.trigger( e, null, elem );
|
3393 |
-
} else {
|
3394 |
-
jQuery.event.dispatch.call( elem, e );
|
3395 |
-
}
|
3396 |
-
if ( e.isDefaultPrevented() ) {
|
3397 |
-
event.preventDefault();
|
3398 |
-
}
|
3399 |
-
}
|
3400 |
-
};
|
3401 |
-
|
3402 |
-
// Some plugins are using, but it's undocumented/deprecated and will be removed.
|
3403 |
-
// The 1.7 special event interface should provide all the hooks needed now.
|
3404 |
-
jQuery.event.handle = jQuery.event.dispatch;
|
3405 |
-
|
3406 |
-
jQuery.removeEvent = document.removeEventListener ?
|
3407 |
-
function( elem, type, handle ) {
|
3408 |
-
if ( elem.removeEventListener ) {
|
3409 |
-
elem.removeEventListener( type, handle, false );
|
3410 |
-
}
|
3411 |
-
} :
|
3412 |
-
function( elem, type, handle ) {
|
3413 |
-
if ( elem.detachEvent ) {
|
3414 |
-
elem.detachEvent( "on" + type, handle );
|
3415 |
-
}
|
3416 |
-
};
|
3417 |
-
|
3418 |
-
jQuery.Event = function( src, props ) {
|
3419 |
-
// Allow instantiation without the 'new' keyword
|
3420 |
-
if ( !(this instanceof jQuery.Event) ) {
|
3421 |
-
return new jQuery.Event( src, props );
|
3422 |
-
}
|
3423 |
-
|
3424 |
-
// Event object
|
3425 |
-
if ( src && src.type ) {
|
3426 |
-
this.originalEvent = src;
|
3427 |
-
this.type = src.type;
|
3428 |
-
|
3429 |
-
// Events bubbling up the document may have been marked as prevented
|
3430 |
-
// by a handler lower down the tree; reflect the correct value.
|
3431 |
-
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
|
3432 |
-
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
|
3433 |
-
|
3434 |
-
// Event type
|
3435 |
-
} else {
|
3436 |
-
this.type = src;
|
3437 |
-
}
|
3438 |
-
|
3439 |
-
// Put explicitly provided properties onto the event object
|
3440 |
-
if ( props ) {
|
3441 |
-
jQuery.extend( this, props );
|
3442 |
-
}
|
3443 |
-
|
3444 |
-
// Create a timestamp if incoming event doesn't have one
|
3445 |
-
this.timeStamp = src && src.timeStamp || jQuery.now();
|
3446 |
-
|
3447 |
-
// Mark it as fixed
|
3448 |
-
this[ jQuery.expando ] = true;
|
3449 |
-
};
|
3450 |
-
|
3451 |
-
function returnFalse() {
|
3452 |
-
return false;
|
3453 |
-
}
|
3454 |
-
function returnTrue() {
|
3455 |
-
return true;
|
3456 |
-
}
|
3457 |
-
|
3458 |
-
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
|
3459 |
-
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
|
3460 |
-
jQuery.Event.prototype = {
|
3461 |
-
preventDefault: function() {
|
3462 |
-
this.isDefaultPrevented = returnTrue;
|
3463 |
-
|
3464 |
-
var e = this.originalEvent;
|
3465 |
-
if ( !e ) {
|
3466 |
-
return;
|
3467 |
-
}
|
3468 |
-
|
3469 |
-
// if preventDefault exists run it on the original event
|
3470 |
-
if ( e.preventDefault ) {
|
3471 |
-
e.preventDefault();
|
3472 |
-
|
3473 |
-
// otherwise set the returnValue property of the original event to false (IE)
|
3474 |
-
} else {
|
3475 |
-
e.returnValue = false;
|
3476 |
-
}
|
3477 |
-
},
|
3478 |
-
stopPropagation: function() {
|
3479 |
-
this.isPropagationStopped = returnTrue;
|
3480 |
-
|
3481 |
-
var e = this.originalEvent;
|
3482 |
-
if ( !e ) {
|
3483 |
-
return;
|
3484 |
-
}
|
3485 |
-
// if stopPropagation exists run it on the original event
|
3486 |
-
if ( e.stopPropagation ) {
|
3487 |
-
e.stopPropagation();
|
3488 |
-
}
|
3489 |
-
// otherwise set the cancelBubble property of the original event to true (IE)
|
3490 |
-
e.cancelBubble = true;
|
3491 |
-
},
|
3492 |
-
stopImmediatePropagation: function() {
|
3493 |
-
this.isImmediatePropagationStopped = returnTrue;
|
3494 |
-
this.stopPropagation();
|
3495 |
-
},
|
3496 |
-
isDefaultPrevented: returnFalse,
|
3497 |
-
isPropagationStopped: returnFalse,
|
3498 |
-
isImmediatePropagationStopped: returnFalse
|
3499 |
-
};
|
3500 |
-
|
3501 |
-
// Create mouseenter/leave events using mouseover/out and event-time checks
|
3502 |
-
jQuery.each({
|
3503 |
-
mouseenter: "mouseover",
|
3504 |
-
mouseleave: "mouseout"
|
3505 |
-
}, function( orig, fix ) {
|
3506 |
-
jQuery.event.special[ orig ] = {
|
3507 |
-
delegateType: fix,
|
3508 |
-
bindType: fix,
|
3509 |
-
|
3510 |
-
handle: function( event ) {
|
3511 |
-
var target = this,
|
3512 |
-
related = event.relatedTarget,
|
3513 |
-
handleObj = event.handleObj,
|
3514 |
-
selector = handleObj.selector,
|
3515 |
-
ret;
|
3516 |
-
|
3517 |
-
// For mousenter/leave call the handler if related is outside the target.
|
3518 |
-
// NB: No relatedTarget if the mouse left/entered the browser window
|
3519 |
-
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
|
3520 |
-
event.type = handleObj.origType;
|
3521 |
-
ret = handleObj.handler.apply( this, arguments );
|
3522 |
-
event.type = fix;
|
3523 |
-
}
|
3524 |
-
return ret;
|
3525 |
-
}
|
3526 |
-
};
|
3527 |
-
});
|
3528 |
-
|
3529 |
-
// IE submit delegation
|
3530 |
-
if ( !jQuery.support.submitBubbles ) {
|
3531 |
-
|
3532 |
-
jQuery.event.special.submit = {
|
3533 |
-
setup: function() {
|
3534 |
-
// Only need this for delegated form submit events
|
3535 |
-
if ( jQuery.nodeName( this, "form" ) ) {
|
3536 |
-
return false;
|
3537 |
-
}
|
3538 |
-
|
3539 |
-
// Lazy-add a submit handler when a descendant form may potentially be submitted
|
3540 |
-
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
|
3541 |
-
// Node name check avoids a VML-related crash in IE (#9807)
|
3542 |
-
var elem = e.target,
|
3543 |
-
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
|
3544 |
-
if ( form && !form._submit_attached ) {
|
3545 |
-
jQuery.event.add( form, "submit._submit", function( event ) {
|
3546 |
-
// If form was submitted by the user, bubble the event up the tree
|
3547 |
-
if ( this.parentNode && !event.isTrigger ) {
|
3548 |
-
jQuery.event.simulate( "submit", this.parentNode, event, true );
|
3549 |
-
}
|
3550 |
-
});
|
3551 |
-
form._submit_attached = true;
|
3552 |
-
}
|
3553 |
-
});
|
3554 |
-
// return undefined since we don't need an event listener
|
3555 |
-
},
|
3556 |
-
|
3557 |
-
teardown: function() {
|
3558 |
-
// Only need this for delegated form submit events
|
3559 |
-
if ( jQuery.nodeName( this, "form" ) ) {
|
3560 |
-
return false;
|
3561 |
-
}
|
3562 |
-
|
3563 |
-
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
|
3564 |
-
jQuery.event.remove( this, "._submit" );
|
3565 |
-
}
|
3566 |
-
};
|
3567 |
-
}
|
3568 |
-
|
3569 |
-
// IE change delegation and checkbox/radio fix
|
3570 |
-
if ( !jQuery.support.changeBubbles ) {
|
3571 |
-
|
3572 |
-
jQuery.event.special.change = {
|
3573 |
-
|
3574 |
-
setup: function() {
|
3575 |
-
|
3576 |
-
if ( rformElems.test( this.nodeName ) ) {
|
3577 |
-
// IE doesn't fire change on a check/radio until blur; trigger it on click
|
3578 |
-
// after a propertychange. Eat the blur-change in special.change.handle.
|
3579 |
-
// This still fires onchange a second time for check/radio after blur.
|
3580 |
-
if ( this.type === "checkbox" || this.type === "radio" ) {
|
3581 |
-
jQuery.event.add( this, "propertychange._change", function( event ) {
|
3582 |
-
if ( event.originalEvent.propertyName === "checked" ) {
|
3583 |
-
this._just_changed = true;
|
3584 |
-
}
|
3585 |
-
});
|
3586 |
-
jQuery.event.add( this, "click._change", function( event ) {
|
3587 |
-
if ( this._just_changed && !event.isTrigger ) {
|
3588 |
-
this._just_changed = false;
|
3589 |
-
jQuery.event.simulate( "change", this, event, true );
|
3590 |
-
}
|
3591 |
-
});
|
3592 |
-
}
|
3593 |
-
return false;
|
3594 |
-
}
|
3595 |
-
// Delegated event; lazy-add a change handler on descendant inputs
|
3596 |
-
jQuery.event.add( this, "beforeactivate._change", function( e ) {
|
3597 |
-
var elem = e.target;
|
3598 |
-
|
3599 |
-
if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
|
3600 |
-
jQuery.event.add( elem, "change._change", function( event ) {
|
3601 |
-
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
|
3602 |
-
jQuery.event.simulate( "change", this.parentNode, event, true );
|
3603 |
-
}
|
3604 |
-
});
|
3605 |
-
elem._change_attached = true;
|
3606 |
-
}
|
3607 |
-
});
|
3608 |
-
},
|
3609 |
-
|
3610 |
-
handle: function( event ) {
|
3611 |
-
var elem = event.target;
|
3612 |
-
|
3613 |
-
// Swallow native change events from checkbox/radio, we already triggered them above
|
3614 |
-
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
|
3615 |
-
return event.handleObj.handler.apply( this, arguments );
|
3616 |
-
}
|
3617 |
-
},
|
3618 |
-
|
3619 |
-
teardown: function() {
|
3620 |
-
jQuery.event.remove( this, "._change" );
|
3621 |
-
|
3622 |
-
return rformElems.test( this.nodeName );
|
3623 |
-
}
|
3624 |
-
};
|
3625 |
-
}
|
3626 |
-
|
3627 |
-
// Create "bubbling" focus and blur events
|
3628 |
-
if ( !jQuery.support.focusinBubbles ) {
|
3629 |
-
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
3630 |
-
|
3631 |
-
// Attach a single capturing handler while someone wants focusin/focusout
|
3632 |
-
var attaches = 0,
|
3633 |
-
handler = function( event ) {
|
3634 |
-
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
|
3635 |
-
};
|
3636 |
-
|
3637 |
-
jQuery.event.special[ fix ] = {
|
3638 |
-
setup: function() {
|
3639 |
-
if ( attaches++ === 0 ) {
|
3640 |
-
document.addEventListener( orig, handler, true );
|
3641 |
-
}
|
3642 |
-
},
|
3643 |
-
teardown: function() {
|
3644 |
-
if ( --attaches === 0 ) {
|
3645 |
-
document.removeEventListener( orig, handler, true );
|
3646 |
-
}
|
3647 |
-
}
|
3648 |
-
};
|
3649 |
-
});
|
3650 |
-
}
|
3651 |
-
|
3652 |
-
jQuery.fn.extend({
|
3653 |
-
|
3654 |
-
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
|
3655 |
-
var origFn, type;
|
3656 |
-
|
3657 |
-
// Types can be a map of types/handlers
|
3658 |
-
if ( typeof types === "object" ) {
|
3659 |
-
// ( types-Object, selector, data )
|
3660 |
-
if ( typeof selector !== "string" ) {
|
3661 |
-
// ( types-Object, data )
|
3662 |
-
data = selector;
|
3663 |
-
selector = undefined;
|
3664 |
-
}
|
3665 |
-
for ( type in types ) {
|
3666 |
-
this.on( type, selector, data, types[ type ], one );
|
3667 |
-
}
|
3668 |
-
return this;
|
3669 |
-
}
|
3670 |
-
|
3671 |
-
if ( data == null && fn == null ) {
|
3672 |
-
// ( types, fn )
|
3673 |
-
fn = selector;
|
3674 |
-
data = selector = undefined;
|
3675 |
-
} else if ( fn == null ) {
|
3676 |
-
if ( typeof selector === "string" ) {
|
3677 |
-
// ( types, selector, fn )
|
3678 |
-
fn = data;
|
3679 |
-
data = undefined;
|
3680 |
-
} else {
|
3681 |
-
// ( types, data, fn )
|
3682 |
-
fn = data;
|
3683 |
-
data = selector;
|
3684 |
-
selector = undefined;
|
3685 |
-
}
|
3686 |
-
}
|
3687 |
-
if ( fn === false ) {
|
3688 |
-
fn = returnFalse;
|
3689 |
-
} else if ( !fn ) {
|
3690 |
-
return this;
|
3691 |
-
}
|
3692 |
-
|
3693 |
-
if ( one === 1 ) {
|
3694 |
-
origFn = fn;
|
3695 |
-
fn = function( event ) {
|
3696 |
-
// Can use an empty set, since event contains the info
|
3697 |
-
jQuery().off( event );
|
3698 |
-
return origFn.apply( this, arguments );
|
3699 |
-
};
|
3700 |
-
// Use same guid so caller can remove using origFn
|
3701 |
-
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
|
3702 |
-
}
|
3703 |
-
return this.each( function() {
|
3704 |
-
jQuery.event.add( this, types, fn, data, selector );
|
3705 |
-
});
|
3706 |
-
},
|
3707 |
-
one: function( types, selector, data, fn ) {
|
3708 |
-
return this.on.call( this, types, selector, data, fn, 1 );
|
3709 |
-
},
|
3710 |
-
off: function( types, selector, fn ) {
|
3711 |
-
if ( types && types.preventDefault && types.handleObj ) {
|
3712 |
-
// ( event ) dispatched jQuery.Event
|
3713 |
-
var handleObj = types.handleObj;
|
3714 |
-
jQuery( types.delegateTarget ).off(
|
3715 |
-
handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
|
3716 |
-
handleObj.selector,
|
3717 |
-
handleObj.handler
|
3718 |
-
);
|
3719 |
-
return this;
|
3720 |
-
}
|
3721 |
-
if ( typeof types === "object" ) {
|
3722 |
-
// ( types-object [, selector] )
|
3723 |
-
for ( var type in types ) {
|
3724 |
-
this.off( type, selector, types[ type ] );
|
3725 |
-
}
|
3726 |
-
return this;
|
3727 |
-
}
|
3728 |
-
if ( selector === false || typeof selector === "function" ) {
|
3729 |
-
// ( types [, fn] )
|
3730 |
-
fn = selector;
|
3731 |
-
selector = undefined;
|
3732 |
-
}
|
3733 |
-
if ( fn === false ) {
|
3734 |
-
fn = returnFalse;
|
3735 |
-
}
|
3736 |
-
return this.each(function() {
|
3737 |
-
jQuery.event.remove( this, types, fn, selector );
|
3738 |
-
});
|
3739 |
-
},
|
3740 |
-
|
3741 |
-
bind: function( types, data, fn ) {
|
3742 |
-
return this.on( types, null, data, fn );
|
3743 |
-
},
|
3744 |
-
unbind: function( types, fn ) {
|
3745 |
-
return this.off( types, null, fn );
|
3746 |
-
},
|
3747 |
-
|
3748 |
-
live: function( types, data, fn ) {
|
3749 |
-
jQuery( this.context ).on( types, this.selector, data, fn );
|
3750 |
-
return this;
|
3751 |
-
},
|
3752 |
-
die: function( types, fn ) {
|
3753 |
-
jQuery( this.context ).off( types, this.selector || "**", fn );
|
3754 |
-
return this;
|
3755 |
-
},
|
3756 |
-
|
3757 |
-
delegate: function( selector, types, data, fn ) {
|
3758 |
-
return this.on( types, selector, data, fn );
|
3759 |
-
},
|
3760 |
-
undelegate: function( selector, types, fn ) {
|
3761 |
-
// ( namespace ) or ( selector, types [, fn] )
|
3762 |
-
return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
|
3763 |
-
},
|
3764 |
-
|
3765 |
-
trigger: function( type, data ) {
|
3766 |
-
return this.each(function() {
|
3767 |
-
jQuery.event.trigger( type, data, this );
|
3768 |
-
});
|
3769 |
-
},
|
3770 |
-
triggerHandler: function( type, data ) {
|
3771 |
-
if ( this[0] ) {
|
3772 |
-
return jQuery.event.trigger( type, data, this[0], true );
|
3773 |
-
}
|
3774 |
-
},
|
3775 |
-
|
3776 |
-
toggle: function( fn ) {
|
3777 |
-
// Save reference to arguments for access in closure
|
3778 |
-
var args = arguments,
|
3779 |
-
guid = fn.guid || jQuery.guid++,
|
3780 |
-
i = 0,
|
3781 |
-
toggler = function( event ) {
|
3782 |
-
// Figure out which function to execute
|
3783 |
-
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
|
3784 |
-
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
|
3785 |
-
|
3786 |
-
// Make sure that clicks stop
|
3787 |
-
event.preventDefault();
|
3788 |
-
|
3789 |
-
// and execute the function
|
3790 |
-
return args[ lastToggle ].apply( this, arguments ) || false;
|
3791 |
-
};
|
3792 |
-
|
3793 |
-
// link all the functions, so any of them can unbind this click handler
|
3794 |
-
toggler.guid = guid;
|
3795 |
-
while ( i < args.length ) {
|
3796 |
-
args[ i++ ].guid = guid;
|
3797 |
-
}
|
3798 |
-
|
3799 |
-
return this.click( toggler );
|
3800 |
-
},
|
3801 |
-
|
3802 |
-
hover: function( fnOver, fnOut ) {
|
3803 |
-
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
3804 |
-
}
|
3805 |
-
});
|
3806 |
-
|
3807 |
-
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
|
3808 |
-
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
3809 |
-
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
|
3810 |
-
|
3811 |
-
// Handle event binding
|
3812 |
-
jQuery.fn[ name ] = function( data, fn ) {
|
3813 |
-
if ( fn == null ) {
|
3814 |
-
fn = data;
|
3815 |
-
data = null;
|
3816 |
-
}
|
3817 |
-
|
3818 |
-
return arguments.length > 0 ?
|
3819 |
-
this.on( name, null, data, fn ) :
|
3820 |
-
this.trigger( name );
|
3821 |
-
};
|
3822 |
-
|
3823 |
-
if ( jQuery.attrFn ) {
|
3824 |
-
jQuery.attrFn[ name ] = true;
|
3825 |
-
}
|
3826 |
-
|
3827 |
-
if ( rkeyEvent.test( name ) ) {
|
3828 |
-
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
|
3829 |
-
}
|
3830 |
-
|
3831 |
-
if ( rmouseEvent.test( name ) ) {
|
3832 |
-
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
|
3833 |
-
}
|
3834 |
-
});
|
3835 |
-
|
3836 |
-
|
3837 |
-
|
3838 |
-
/*!
|
3839 |
-
* Sizzle CSS Selector Engine
|
3840 |
-
* Copyright 2012, The Dojo Foundation
|
3841 |
-
* Released under the MIT, BSD, and GPL Licenses.
|
3842 |
-
* More information: http://sizzlejs.com/
|
3843 |
-
*/
|
3844 |
-
(function(){
|
3845 |
-
|
3846 |
-
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
|
3847 |
-
expando = "sizcache" + (Math.random() + '').replace('.', ''),
|
3848 |
-
done = 0,
|
3849 |
-
toString = Object.prototype.toString,
|
3850 |
-
hasDuplicate = false,
|
3851 |
-
baseHasDuplicate = true,
|
3852 |
-
rBackslash = /\\/g,
|
3853 |
-
rReturn = /\r\n/g,
|
3854 |
-
rNonWord = /\W/;
|
3855 |
-
|
3856 |
-
// Here we check if the JavaScript engine is using some sort of
|
3857 |
-
// optimization where it does not always call our comparision
|
3858 |
-
// function. If that is the case, discard the hasDuplicate value.
|
3859 |
-
// Thus far that includes Google Chrome.
|
3860 |
-
[0, 0].sort(function() {
|
3861 |
-
baseHasDuplicate = false;
|
3862 |
-
return 0;
|
3863 |
-
});
|
3864 |
-
|
3865 |
-
var Sizzle = function( selector, context, results, seed ) {
|
3866 |
-
results = results || [];
|
3867 |
-
context = context || document;
|
3868 |
-
|
3869 |
-
var origContext = context;
|
3870 |
-
|
3871 |
-
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
|
3872 |
-
return [];
|
3873 |
-
}
|
3874 |
-
|
3875 |
-
if ( !selector || typeof selector !== "string" ) {
|
3876 |
-
return results;
|
3877 |
-
}
|
3878 |
-
|
3879 |
-
var m, set, checkSet, extra, ret, cur, pop, i,
|
3880 |
-
prune = true,
|
3881 |
-
contextXML = Sizzle.isXML( context ),
|
3882 |
-
parts = [],
|
3883 |
-
soFar = selector;
|
3884 |
-
|
3885 |
-
// Reset the position of the chunker regexp (start from head)
|
3886 |
-
do {
|
3887 |
-
chunker.exec( "" );
|
3888 |
-
m = chunker.exec( soFar );
|
3889 |
-
|
3890 |
-
if ( m ) {
|
3891 |
-
soFar = m[3];
|
3892 |
-
|
3893 |
-
parts.push( m[1] );
|
3894 |
-
|
3895 |
-
if ( m[2] ) {
|
3896 |
-
extra = m[3];
|
3897 |
-
break;
|
3898 |
-
}
|
3899 |
-
}
|
3900 |
-
} while ( m );
|
3901 |
-
|
3902 |
-
if ( parts.length > 1 && origPOS.exec( selector ) ) {
|
3903 |
-
|
3904 |
-
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
|
3905 |
-
set = posProcess( parts[0] + parts[1], context, seed );
|
3906 |
-
|
3907 |
-
} else {
|
3908 |
-
set = Expr.relative[ parts[0] ] ?
|
3909 |
-
[ context ] :
|
3910 |
-
Sizzle( parts.shift(), context );
|
3911 |
-
|
3912 |
-
while ( parts.length ) {
|
3913 |
-
selector = parts.shift();
|
3914 |
-
|
3915 |
-
if ( Expr.relative[ selector ] ) {
|
3916 |
-
selector += parts.shift();
|
3917 |
-
}
|
3918 |
-
|
3919 |
-
set = posProcess( selector, set, seed );
|
3920 |
-
}
|
3921 |
-
}
|
3922 |
-
|
3923 |
-
} else {
|
3924 |
-
// Take a shortcut and set the context if the root selector is an ID
|
3925 |
-
// (but not if it'll be faster if the inner selector is an ID)
|
3926 |
-
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
|
3927 |
-
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
|
3928 |
-
|
3929 |
-
ret = Sizzle.find( parts.shift(), context, contextXML );
|
3930 |
-
context = ret.expr ?
|
3931 |
-
Sizzle.filter( ret.expr, ret.set )[0] :
|
3932 |
-
ret.set[0];
|
3933 |
-
}
|
3934 |
-
|
3935 |
-
if ( context ) {
|
3936 |
-
ret = seed ?
|
3937 |
-
{ expr: parts.pop(), set: makeArray(seed) } :
|
3938 |
-
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
|
3939 |
-
|
3940 |
-
set = ret.expr ?
|
3941 |
-
Sizzle.filter( ret.expr, ret.set ) :
|
3942 |
-
ret.set;
|
3943 |
-
|
3944 |
-
if ( parts.length > 0 ) {
|
3945 |
-
checkSet = makeArray( set );
|
3946 |
-
|
3947 |
-
} else {
|
3948 |
-
prune = false;
|
3949 |
-
}
|
3950 |
-
|
3951 |
-
while ( parts.length ) {
|
3952 |
-
cur = parts.pop();
|
3953 |
-
pop = cur;
|
3954 |
-
|
3955 |
-
if ( !Expr.relative[ cur ] ) {
|
3956 |
-
cur = "";
|
3957 |
-
} else {
|
3958 |
-
pop = parts.pop();
|
3959 |
-
}
|
3960 |
-
|
3961 |
-
if ( pop == null ) {
|
3962 |
-
pop = context;
|
3963 |
-
}
|
3964 |
-
|
3965 |
-
Expr.relative[ cur ]( checkSet, pop, contextXML );
|
3966 |
-
}
|
3967 |
-
|
3968 |
-
} else {
|
3969 |
-
checkSet = parts = [];
|
3970 |
-
}
|
3971 |
-
}
|
3972 |
-
|
3973 |
-
if ( !checkSet ) {
|
3974 |
-
checkSet = set;
|
3975 |
-
}
|
3976 |
-
|
3977 |
-
if ( !checkSet ) {
|
3978 |
-
Sizzle.error( cur || selector );
|
3979 |
-
}
|
3980 |
-
|
3981 |
-
if ( toString.call(checkSet) === "[object Array]" ) {
|
3982 |
-
if ( !prune ) {
|
3983 |
-
results.push.apply( results, checkSet );
|
3984 |
-
|
3985 |
-
} else if ( context && context.nodeType === 1 ) {
|
3986 |
-
for ( i = 0; checkSet[i] != null; i++ ) {
|
3987 |
-
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
|
3988 |
-
results.push( set[i] );
|
3989 |
-
}
|
3990 |
-
}
|
3991 |
-
|
3992 |
-
} else {
|
3993 |
-
for ( i = 0; checkSet[i] != null; i++ ) {
|
3994 |
-
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
|
3995 |
-
results.push( set[i] );
|
3996 |
-
}
|
3997 |
-
}
|
3998 |
-
}
|
3999 |
-
|
4000 |
-
} else {
|
4001 |
-
makeArray( checkSet, results );
|
4002 |
-
}
|
4003 |
-
|
4004 |
-
if ( extra ) {
|
4005 |
-
Sizzle( extra, origContext, results, seed );
|
4006 |
-
Sizzle.uniqueSort( results );
|
4007 |
-
}
|
4008 |
-
|
4009 |
-
return results;
|
4010 |
-
};
|
4011 |
-
|
4012 |
-
Sizzle.uniqueSort = function( results ) {
|
4013 |
-
if ( sortOrder ) {
|
4014 |
-
hasDuplicate = baseHasDuplicate;
|
4015 |
-
results.sort( sortOrder );
|
4016 |
-
|
4017 |
-
if ( hasDuplicate ) {
|
4018 |
-
for ( var i = 1; i < results.length; i++ ) {
|
4019 |
-
if ( results[i] === results[ i - 1 ] ) {
|
4020 |
-
results.splice( i--, 1 );
|
4021 |
-
}
|
4022 |
-
}
|
4023 |
-
}
|
4024 |
-
}
|
4025 |
-
|
4026 |
-
return results;
|
4027 |
-
};
|
4028 |
-
|
4029 |
-
Sizzle.matches = function( expr, set ) {
|
4030 |
-
return Sizzle( expr, null, null, set );
|
4031 |
-
};
|
4032 |
-
|
4033 |
-
Sizzle.matchesSelector = function( node, expr ) {
|
4034 |
-
return Sizzle( expr, null, null, [node] ).length > 0;
|
4035 |
-
};
|
4036 |
-
|
4037 |
-
Sizzle.find = function( expr, context, isXML ) {
|
4038 |
-
var set, i, len, match, type, left;
|
4039 |
-
|
4040 |
-
if ( !expr ) {
|
4041 |
-
return [];
|
4042 |
-
}
|
4043 |
-
|
4044 |
-
for ( i = 0, len = Expr.order.length; i < len; i++ ) {
|
4045 |
-
type = Expr.order[i];
|
4046 |
-
|
4047 |
-
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
|
4048 |
-
left = match[1];
|
4049 |
-
match.splice( 1, 1 );
|
4050 |
-
|
4051 |
-
if ( left.substr( left.length - 1 ) !== "\\" ) {
|
4052 |
-
match[1] = (match[1] || "").replace( rBackslash, "" );
|
4053 |
-
set = Expr.find[ type ]( match, context, isXML );
|
4054 |
-
|
4055 |
-
if ( set != null ) {
|
4056 |
-
expr = expr.replace( Expr.match[ type ], "" );
|
4057 |
-
break;
|
4058 |
-
}
|
4059 |
-
}
|
4060 |
-
}
|
4061 |
-
}
|
4062 |
-
|
4063 |
-
if ( !set ) {
|
4064 |
-
set = typeof context.getElementsByTagName !== "undefined" ?
|
4065 |
-
context.getElementsByTagName( "*" ) :
|
4066 |
-
[];
|
4067 |
-
}
|
4068 |
-
|
4069 |
-
return { set: set, expr: expr };
|
4070 |
-
};
|
4071 |
-
|
4072 |
-
Sizzle.filter = function( expr, set, inplace, not ) {
|
4073 |
-
var match, anyFound,
|
4074 |
-
type, found, item, filter, left,
|
4075 |
-
i, pass,
|
4076 |
-
old = expr,
|
4077 |
-
result = [],
|
4078 |
-
curLoop = set,
|
4079 |
-
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
|
4080 |
-
|
4081 |
-
while ( expr && set.length ) {
|
4082 |
-
for ( type in Expr.filter ) {
|
4083 |
-
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
|
4084 |
-
filter = Expr.filter[ type ];
|
4085 |
-
left = match[1];
|
4086 |
-
|
4087 |
-
anyFound = false;
|
4088 |
-
|
4089 |
-
match.splice(1,1);
|
4090 |
-
|
4091 |
-
if ( left.substr( left.length - 1 ) === "\\" ) {
|
4092 |
-
continue;
|
4093 |
-
}
|
4094 |
-
|
4095 |
-
if ( curLoop === result ) {
|
4096 |
-
result = [];
|
4097 |
-
}
|
4098 |
-
|
4099 |
-
if ( Expr.preFilter[ type ] ) {
|
4100 |
-
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
|
4101 |
-
|
4102 |
-
if ( !match ) {
|
4103 |
-
anyFound = found = true;
|
4104 |
-
|
4105 |
-
} else if ( match === true ) {
|
4106 |
-
continue;
|
4107 |
-
}
|
4108 |
-
}
|
4109 |
-
|
4110 |
-
if ( match ) {
|
4111 |
-
for ( i = 0; (item = curLoop[i]) != null; i++ ) {
|
4112 |
-
if ( item ) {
|
4113 |
-
found = filter( item, match, i, curLoop );
|
4114 |
-
pass = not ^ found;
|
4115 |
-
|
4116 |
-
if ( inplace && found != null ) {
|
4117 |
-
if ( pass ) {
|
4118 |
-
anyFound = true;
|
4119 |
-
|
4120 |
-
} else {
|
4121 |
-
curLoop[i] = false;
|
4122 |
-
}
|
4123 |
-
|
4124 |
-
} else if ( pass ) {
|
4125 |
-
result.push( item );
|
4126 |
-
anyFound = true;
|
4127 |
-
}
|
4128 |
-
}
|
4129 |
-
}
|
4130 |
-
}
|
4131 |
-
|
4132 |
-
if ( found !== undefined ) {
|
4133 |
-
if ( !inplace ) {
|
4134 |
-
curLoop = result;
|
4135 |
-
}
|
4136 |
-
|
4137 |
-
expr = expr.replace( Expr.match[ type ], "" );
|
4138 |
-
|
4139 |
-
if ( !anyFound ) {
|
4140 |
-
return [];
|
4141 |
-
}
|
4142 |
-
|
4143 |
-
break;
|
4144 |
-
}
|
4145 |
-
}
|
4146 |
-
}
|
4147 |
-
|
4148 |
-
// Improper expression
|
4149 |
-
if ( expr === old ) {
|
4150 |
-
if ( anyFound == null ) {
|
4151 |
-
Sizzle.error( expr );
|
4152 |
-
|
4153 |
-
} else {
|
4154 |
-
break;
|
4155 |
-
}
|
4156 |
-
}
|
4157 |
-
|
4158 |
-
old = expr;
|
4159 |
-
}
|
4160 |
-
|
4161 |
-
return curLoop;
|
4162 |
-
};
|
4163 |
-
|
4164 |
-
Sizzle.error = function( msg ) {
|
4165 |
-
throw new Error( "Syntax error, unrecognized expression: " + msg );
|
4166 |
-
};
|
4167 |
-
|
4168 |
-
/**
|
4169 |
-
* Utility function for retreiving the text value of an array of DOM nodes
|
4170 |
-
* @param {Array|Element} elem
|
4171 |
-
*/
|
4172 |
-
var getText = Sizzle.getText = function( elem ) {
|
4173 |
-
var i, node,
|
4174 |
-
nodeType = elem.nodeType,
|
4175 |
-
ret = "";
|
4176 |
-
|
4177 |
-
if ( nodeType ) {
|
4178 |
-
if ( nodeType === 1 || nodeType === 9 ) {
|
4179 |
-
// Use textContent || innerText for elements
|
4180 |
-
if ( typeof elem.textContent === 'string' ) {
|
4181 |
-
return elem.textContent;
|
4182 |
-
} else if ( typeof elem.innerText === 'string' ) {
|
4183 |
-
// Replace IE's carriage returns
|
4184 |
-
return elem.innerText.replace( rReturn, '' );
|
4185 |
-
} else {
|
4186 |
-
// Traverse it's children
|
4187 |
-
for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
|
4188 |
-
ret += getText( elem );
|
4189 |
-
}
|
4190 |
-
}
|
4191 |
-
} else if ( nodeType === 3 || nodeType === 4 ) {
|
4192 |
-
return elem.nodeValue;
|
4193 |
-
}
|
4194 |
-
} else {
|
4195 |
-
|
4196 |
-
// If no nodeType, this is expected to be an array
|
4197 |
-
for ( i = 0; (node = elem[i]); i++ ) {
|
4198 |
-
// Do not traverse comment nodes
|
4199 |
-
if ( node.nodeType !== 8 ) {
|
4200 |
-
ret += getText( node );
|
4201 |
-
}
|
4202 |
-
}
|
4203 |
-
}
|
4204 |
-
return ret;
|
4205 |
-
};
|
4206 |
-
|
4207 |
-
var Expr = Sizzle.selectors = {
|
4208 |
-
order: [ "ID", "NAME", "TAG" ],
|
4209 |
-
|
4210 |
-
match: {
|
4211 |
-
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
|
4212 |
-
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
|
4213 |
-
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
|
4214 |
-
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
|
4215 |
-
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
|
4216 |
-
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
|
4217 |
-
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
|
4218 |
-
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
|
4219 |
-
},
|
4220 |
-
|
4221 |
-
leftMatch: {},
|
4222 |
-
|
4223 |
-
attrMap: {
|
4224 |
-
"class": "className",
|
4225 |
-
"for": "htmlFor"
|
4226 |
-
},
|
4227 |
-
|
4228 |
-
attrHandle: {
|
4229 |
-
href: function( elem ) {
|
4230 |
-
return elem.getAttribute( "href" );
|
4231 |
-
},
|
4232 |
-
type: function( elem ) {
|
4233 |
-
return elem.getAttribute( "type" );
|
4234 |
-
}
|
4235 |
-
},
|
4236 |
-
|
4237 |
-
relative: {
|
4238 |
-
"+": function(checkSet, part){
|
4239 |
-
var isPartStr = typeof part === "string",
|
4240 |
-
isTag = isPartStr && !rNonWord.test( part ),
|
4241 |
-
isPartStrNotTag = isPartStr && !isTag;
|
4242 |
-
|
4243 |
-
if ( isTag ) {
|
4244 |
-
part = part.toLowerCase();
|
4245 |
-
}
|
4246 |
-
|
4247 |
-
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
|
4248 |
-
if ( (elem = checkSet[i]) ) {
|
4249 |
-
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
|
4250 |
-
|
4251 |
-
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
|
4252 |
-
elem || false :
|
4253 |
-
elem === part;
|
4254 |
-
}
|
4255 |
-
}
|
4256 |
-
|
4257 |
-
if ( isPartStrNotTag ) {
|
4258 |
-
Sizzle.filter( part, checkSet, true );
|
4259 |
-
}
|
4260 |
-
},
|
4261 |
-
|
4262 |
-
">": function( checkSet, part ) {
|
4263 |
-
var elem,
|
4264 |
-
isPartStr = typeof part === "string",
|
4265 |
-
i = 0,
|
4266 |
-
l = checkSet.length;
|
4267 |
-
|
4268 |
-
if ( isPartStr && !rNonWord.test( part ) ) {
|
4269 |
-
part = part.toLowerCase();
|
4270 |
-
|
4271 |
-
for ( ; i < l; i++ ) {
|
4272 |
-
elem = checkSet[i];
|
4273 |
-
|
4274 |
-
if ( elem ) {
|
4275 |
-
var parent = elem.parentNode;
|
4276 |
-
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
|
4277 |
-
}
|
4278 |
-
}
|
4279 |
-
|
4280 |
-
} else {
|
4281 |
-
for ( ; i < l; i++ ) {
|
4282 |
-
elem = checkSet[i];
|
4283 |
-
|
4284 |
-
if ( elem ) {
|
4285 |
-
checkSet[i] = isPartStr ?
|
4286 |
-
elem.parentNode :
|
4287 |
-
elem.parentNode === part;
|
4288 |
-
}
|
4289 |
-
}
|
4290 |
-
|
4291 |
-
if ( isPartStr ) {
|
4292 |
-
Sizzle.filter( part, checkSet, true );
|
4293 |
-
}
|
4294 |
-
}
|
4295 |
-
},
|
4296 |
-
|
4297 |
-
"": function(checkSet, part, isXML){
|
4298 |
-
var nodeCheck,
|
4299 |
-
doneName = done++,
|
4300 |
-
checkFn = dirCheck;
|
4301 |
-
|
4302 |
-
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
4303 |
-
part = part.toLowerCase();
|
4304 |
-
nodeCheck = part;
|
4305 |
-
checkFn = dirNodeCheck;
|
4306 |
-
}
|
4307 |
-
|
4308 |
-
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
|
4309 |
-
},
|
4310 |
-
|
4311 |
-
"~": function( checkSet, part, isXML ) {
|
4312 |
-
var nodeCheck,
|
4313 |
-
doneName = done++,
|
4314 |
-
checkFn = dirCheck;
|
4315 |
-
|
4316 |
-
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
4317 |
-
part = part.toLowerCase();
|
4318 |
-
nodeCheck = part;
|
4319 |
-
checkFn = dirNodeCheck;
|
4320 |
-
}
|
4321 |
-
|
4322 |
-
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
|
4323 |
-
}
|
4324 |
-
},
|
4325 |
-
|
4326 |
-
find: {
|
4327 |
-
ID: function( match, context, isXML ) {
|
4328 |
-
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
4329 |
-
var m = context.getElementById(match[1]);
|
4330 |
-
// Check parentNode to catch when Blackberry 4.6 returns
|
4331 |
-
// nodes that are no longer in the document #6963
|
4332 |
-
return m && m.parentNode ? [m] : [];
|
4333 |
-
}
|
4334 |
-
},
|
4335 |
-
|
4336 |
-
NAME: function( match, context ) {
|
4337 |
-
if ( typeof context.getElementsByName !== "undefined" ) {
|
4338 |
-
var ret = [],
|
4339 |
-
results = context.getElementsByName( match[1] );
|
4340 |
-
|
4341 |
-
for ( var i = 0, l = results.length; i < l; i++ ) {
|
4342 |
-
if ( results[i].getAttribute("name") === match[1] ) {
|
4343 |
-
ret.push( results[i] );
|
4344 |
-
}
|
4345 |
-
}
|
4346 |
-
|
4347 |
-
return ret.length === 0 ? null : ret;
|
4348 |
-
}
|
4349 |
-
},
|
4350 |
-
|
4351 |
-
TAG: function( match, context ) {
|
4352 |
-
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
4353 |
-
return context.getElementsByTagName( match[1] );
|
4354 |
-
}
|
4355 |
-
}
|
4356 |
-
},
|
4357 |
-
preFilter: {
|
4358 |
-
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
|
4359 |
-
match = " " + match[1].replace( rBackslash, "" ) + " ";
|
4360 |
-
|
4361 |
-
if ( isXML ) {
|
4362 |
-
return match;
|
4363 |
-
}
|
4364 |
-
|
4365 |
-
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
|
4366 |
-
if ( elem ) {
|
4367 |
-
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
|
4368 |
-
if ( !inplace ) {
|
4369 |
-
result.push( elem );
|
4370 |
-
}
|
4371 |
-
|
4372 |
-
} else if ( inplace ) {
|
4373 |
-
curLoop[i] = false;
|
4374 |
-
}
|
4375 |
-
}
|
4376 |
-
}
|
4377 |
-
|
4378 |
-
return false;
|
4379 |
-
},
|
4380 |
-
|
4381 |
-
ID: function( match ) {
|
4382 |
-
return match[1].replace( rBackslash, "" );
|
4383 |
-
},
|
4384 |
-
|
4385 |
-
TAG: function( match, curLoop ) {
|
4386 |
-
return match[1].replace( rBackslash, "" ).toLowerCase();
|
4387 |
-
},
|
4388 |
-
|
4389 |
-
CHILD: function( match ) {
|
4390 |
-
if ( match[1] === "nth" ) {
|
4391 |
-
if ( !match[2] ) {
|
4392 |
-
Sizzle.error( match[0] );
|
4393 |
-
}
|
4394 |
-
|
4395 |
-
match[2] = match[2].replace(/^\+|\s*/g, '');
|
4396 |
-
|
4397 |
-
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
|
4398 |
-
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
|
4399 |
-
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
|
4400 |
-
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
|
4401 |
-
|
4402 |
-
// calculate the numbers (first)n+(last) including if they are negative
|
4403 |
-
match[2] = (test[1] + (test[2] || 1)) - 0;
|
4404 |
-
match[3] = test[3] - 0;
|
4405 |
-
}
|
4406 |
-
else if ( match[2] ) {
|
4407 |
-
Sizzle.error( match[0] );
|
4408 |
-
}
|
4409 |
-
|
4410 |
-
// TODO: Move to normal caching system
|
4411 |
-
match[0] = done++;
|
4412 |
-
|
4413 |
-
return match;
|
4414 |
-
},
|
4415 |
-
|
4416 |
-
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
|
4417 |
-
var name = match[1] = match[1].replace( rBackslash, "" );
|
4418 |
-
|
4419 |
-
if ( !isXML && Expr.attrMap[name] ) {
|
4420 |
-
match[1] = Expr.attrMap[name];
|
4421 |
-
}
|
4422 |
-
|
4423 |
-
// Handle if an un-quoted value was used
|
4424 |
-
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
|
4425 |
-
|
4426 |
-
if ( match[2] === "~=" ) {
|
4427 |
-
match[4] = " " + match[4] + " ";
|
4428 |
-
}
|
4429 |
-
|
4430 |
-
return match;
|
4431 |
-
},
|
4432 |
-
|
4433 |
-
PSEUDO: function( match, curLoop, inplace, result, not ) {
|
4434 |
-
if ( match[1] === "not" ) {
|
4435 |
-
// If we're dealing with a complex expression, or a simple one
|
4436 |
-
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
|
4437 |
-
match[3] = Sizzle(match[3], null, null, curLoop);
|
4438 |
-
|
4439 |
-
} else {
|
4440 |
-
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
|
4441 |
-
|
4442 |
-
if ( !inplace ) {
|
4443 |
-
result.push.apply( result, ret );
|
4444 |
-
}
|
4445 |
-
|
4446 |
-
return false;
|
4447 |
-
}
|
4448 |
-
|
4449 |
-
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
|
4450 |
-
return true;
|
4451 |
-
}
|
4452 |
-
|
4453 |
-
return match;
|
4454 |
-
},
|
4455 |
-
|
4456 |
-
POS: function( match ) {
|
4457 |
-
match.unshift( true );
|
4458 |
-
|
4459 |
-
return match;
|
4460 |
-
}
|
4461 |
-
},
|
4462 |
-
|
4463 |
-
filters: {
|
4464 |
-
enabled: function( elem ) {
|
4465 |
-
return elem.disabled === false && elem.type !== "hidden";
|
4466 |
-
},
|
4467 |
-
|
4468 |
-
disabled: function( elem ) {
|
4469 |
-
return elem.disabled === true;
|
4470 |
-
},
|
4471 |
-
|
4472 |
-
checked: function( elem ) {
|
4473 |
-
return elem.checked === true;
|
4474 |
-
},
|
4475 |
-
|
4476 |
-
selected: function( elem ) {
|
4477 |
-
// Accessing this property makes selected-by-default
|
4478 |
-
// options in Safari work properly
|
4479 |
-
if ( elem.parentNode ) {
|
4480 |
-
elem.parentNode.selectedIndex;
|
4481 |
-
}
|
4482 |
-
|
4483 |
-
return elem.selected === true;
|
4484 |
-
},
|
4485 |
-
|
4486 |
-
parent: function( elem ) {
|
4487 |
-
return !!elem.firstChild;
|
4488 |
-
},
|
4489 |
-
|
4490 |
-
empty: function( elem ) {
|
4491 |
-
return !elem.firstChild;
|
4492 |
-
},
|
4493 |
-
|
4494 |
-
has: function( elem, i, match ) {
|
4495 |
-
return !!Sizzle( match[3], elem ).length;
|
4496 |
-
},
|
4497 |
-
|
4498 |
-
header: function( elem ) {
|
4499 |
-
return (/h\d/i).test( elem.nodeName );
|
4500 |
-
},
|
4501 |
-
|
4502 |
-
text: function( elem ) {
|
4503 |
-
var attr = elem.getAttribute( "type" ), type = elem.type;
|
4504 |
-
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
|
4505 |
-
// use getAttribute instead to test this case
|
4506 |
-
return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
|
4507 |
-
},
|
4508 |
-
|
4509 |
-
radio: function( elem ) {
|
4510 |
-
return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
|
4511 |
-
},
|
4512 |
-
|
4513 |
-
checkbox: function( elem ) {
|
4514 |
-
return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
|
4515 |
-
},
|
4516 |
-
|
4517 |
-
file: function( elem ) {
|
4518 |
-
return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
|
4519 |
-
},
|
4520 |
-
|
4521 |
-
password: function( elem ) {
|
4522 |
-
return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
|
4523 |
-
},
|
4524 |
-
|
4525 |
-
submit: function( elem ) {
|
4526 |
-
var name = elem.nodeName.toLowerCase();
|
4527 |
-
return (name === "input" || name === "button") && "submit" === elem.type;
|
4528 |
-
},
|
4529 |
-
|
4530 |
-
image: function( elem ) {
|
4531 |
-
return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
|
4532 |
-
},
|
4533 |
-
|
4534 |
-
reset: function( elem ) {
|
4535 |
-
var name = elem.nodeName.toLowerCase();
|
4536 |
-
return (name === "input" || name === "button") && "reset" === elem.type;
|
4537 |
-
},
|
4538 |
-
|
4539 |
-
button: function( elem ) {
|
4540 |
-
var name = elem.nodeName.toLowerCase();
|
4541 |
-
return name === "input" && "button" === elem.type || name === "button";
|
4542 |
-
},
|
4543 |
-
|
4544 |
-
input: function( elem ) {
|
4545 |
-
return (/input|select|textarea|button/i).test( elem.nodeName );
|
4546 |
-
},
|
4547 |
-
|
4548 |
-
focus: function( elem ) {
|
4549 |
-
return elem === elem.ownerDocument.activeElement;
|
4550 |
-
}
|
4551 |
-
},
|
4552 |
-
setFilters: {
|
4553 |
-
first: function( elem, i ) {
|
4554 |
-
return i === 0;
|
4555 |
-
},
|
4556 |
-
|
4557 |
-
last: function( elem, i, match, array ) {
|
4558 |
-
return i === array.length - 1;
|
4559 |
-
},
|
4560 |
-
|
4561 |
-
even: function( elem, i ) {
|
4562 |
-
return i % 2 === 0;
|
4563 |
-
},
|
4564 |
-
|
4565 |
-
odd: function( elem, i ) {
|
4566 |
-
return i % 2 === 1;
|
4567 |
-
},
|
4568 |
-
|
4569 |
-
lt: function( elem, i, match ) {
|
4570 |
-
return i < match[3] - 0;
|
4571 |
-
},
|
4572 |
-
|
4573 |
-
gt: function( elem, i, match ) {
|
4574 |
-
return i > match[3] - 0;
|
4575 |
-
},
|
4576 |
-
|
4577 |
-
nth: function( elem, i, match ) {
|
4578 |
-
return match[3] - 0 === i;
|
4579 |
-
},
|
4580 |
-
|
4581 |
-
eq: function( elem, i, match ) {
|
4582 |
-
return match[3] - 0 === i;
|
4583 |
-
}
|
4584 |
-
},
|
4585 |
-
filter: {
|
4586 |
-
PSEUDO: function( elem, match, i, array ) {
|
4587 |
-
var name = match[1],
|
4588 |
-
filter = Expr.filters[ name ];
|
4589 |
-
|
4590 |
-
if ( filter ) {
|
4591 |
-
return filter( elem, i, match, array );
|
4592 |
-
|
4593 |
-
} else if ( name === "contains" ) {
|
4594 |
-
return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
|
4595 |
-
|
4596 |
-
} else if ( name === "not" ) {
|
4597 |
-
var not = match[3];
|
4598 |
-
|
4599 |
-
for ( var j = 0, l = not.length; j < l; j++ ) {
|
4600 |
-
if ( not[j] === elem ) {
|
4601 |
-
return false;
|
4602 |
-
}
|
4603 |
-
}
|
4604 |
-
|
4605 |
-
return true;
|
4606 |
-
|
4607 |
-
} else {
|
4608 |
-
Sizzle.error( name );
|
4609 |
-
}
|
4610 |
-
},
|
4611 |
-
|
4612 |
-
CHILD: function( elem, match ) {
|
4613 |
-
var first, last,
|
4614 |
-
doneName, parent, cache,
|
4615 |
-
count, diff,
|
4616 |
-
type = match[1],
|
4617 |
-
node = elem;
|
4618 |
-
|
4619 |
-
switch ( type ) {
|
4620 |
-
case "only":
|
4621 |
-
case "first":
|
4622 |
-
while ( (node = node.previousSibling) ) {
|
4623 |
-
if ( node.nodeType === 1 ) {
|
4624 |
-
return false;
|
4625 |
-
}
|
4626 |
-
}
|
4627 |
-
|
4628 |
-
if ( type === "first" ) {
|
4629 |
-
return true;
|
4630 |
-
}
|
4631 |
-
|
4632 |
-
node = elem;
|
4633 |
-
|
4634 |
-
case "last":
|
4635 |
-
while ( (node = node.nextSibling) ) {
|
4636 |
-
if ( node.nodeType === 1 ) {
|
4637 |
-
return false;
|
4638 |
-
}
|
4639 |
-
}
|
4640 |
-
|
4641 |
-
return true;
|
4642 |
-
|
4643 |
-
case "nth":
|
4644 |
-
first = match[2];
|
4645 |
-
last = match[3];
|
4646 |
-
|
4647 |
-
if ( first === 1 && last === 0 ) {
|
4648 |
-
return true;
|
4649 |
-
}
|
4650 |
-
|
4651 |
-
doneName = match[0];
|
4652 |
-
parent = elem.parentNode;
|
4653 |
-
|
4654 |
-
if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
|
4655 |
-
count = 0;
|
4656 |
-
|
4657 |
-
for ( node = parent.firstChild; node; node = node.nextSibling ) {
|
4658 |
-
if ( node.nodeType === 1 ) {
|
4659 |
-
node.nodeIndex = ++count;
|
4660 |
-
}
|
4661 |
-
}
|
4662 |
-
|
4663 |
-
parent[ expando ] = doneName;
|
4664 |
-
}
|
4665 |
-
|
4666 |
-
diff = elem.nodeIndex - last;
|
4667 |
-
|
4668 |
-
if ( first === 0 ) {
|
4669 |
-
return diff === 0;
|
4670 |
-
|
4671 |
-
} else {
|
4672 |
-
return ( diff % first === 0 && diff / first >= 0 );
|
4673 |
-
}
|
4674 |
-
}
|
4675 |
-
},
|
4676 |
-
|
4677 |
-
ID: function( elem, match ) {
|
4678 |
-
return elem.nodeType === 1 && elem.getAttribute("id") === match;
|
4679 |
-
},
|
4680 |
-
|
4681 |
-
TAG: function( elem, match ) {
|
4682 |
-
return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
|
4683 |
-
},
|
4684 |
-
|
4685 |
-
CLASS: function( elem, match ) {
|
4686 |
-
return (" " + (elem.className || elem.getAttribute("class")) + " ")
|
4687 |
-
.indexOf( match ) > -1;
|
4688 |
-
},
|
4689 |
-
|
4690 |
-
ATTR: function( elem, match ) {
|
4691 |
-
var name = match[1],
|
4692 |
-
result = Sizzle.attr ?
|
4693 |
-
Sizzle.attr( elem, name ) :
|
4694 |
-
Expr.attrHandle[ name ] ?
|
4695 |
-
Expr.attrHandle[ name ]( elem ) :
|
4696 |
-
elem[ name ] != null ?
|
4697 |
-
elem[ name ] :
|
4698 |
-
elem.getAttribute( name ),
|
4699 |
-
value = result + "",
|
4700 |
-
type = match[2],
|
4701 |
-
check = match[4];
|
4702 |
-
|
4703 |
-
return result == null ?
|
4704 |
-
type === "!=" :
|
4705 |
-
!type && Sizzle.attr ?
|
4706 |
-
result != null :
|
4707 |
-
type === "=" ?
|
4708 |
-
value === check :
|
4709 |
-
type === "*=" ?
|
4710 |
-
value.indexOf(check) >= 0 :
|
4711 |
-
type === "~=" ?
|
4712 |
-
(" " + value + " ").indexOf(check) >= 0 :
|
4713 |
-
!check ?
|
4714 |
-
value && result !== false :
|
4715 |
-
type === "!=" ?
|
4716 |
-
value !== check :
|
4717 |
-
type === "^=" ?
|
4718 |
-
value.indexOf(check) === 0 :
|
4719 |
-
type === "$=" ?
|
4720 |
-
value.substr(value.length - check.length) === check :
|
4721 |
-
type === "|=" ?
|
4722 |
-
value === check || value.substr(0, check.length + 1) === check + "-" :
|
4723 |
-
false;
|
4724 |
-
},
|
4725 |
-
|
4726 |
-
POS: function( elem, match, i, array ) {
|
4727 |
-
var name = match[2],
|
4728 |
-
filter = Expr.setFilters[ name ];
|
4729 |
-
|
4730 |
-
if ( filter ) {
|
4731 |
-
return filter( elem, i, match, array );
|
4732 |
-
}
|
4733 |
-
}
|
4734 |
-
}
|
4735 |
-
};
|
4736 |
-
|
4737 |
-
var origPOS = Expr.match.POS,
|
4738 |
-
fescape = function(all, num){
|
4739 |
-
return "\\" + (num - 0 + 1);
|
4740 |
-
};
|
4741 |
-
|
4742 |
-
for ( var type in Expr.match ) {
|
4743 |
-
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
|
4744 |
-
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
|
4745 |
-
}
|
4746 |
-
|
4747 |
-
var makeArray = function( array, results ) {
|
4748 |
-
array = Array.prototype.slice.call( array, 0 );
|
4749 |
-
|
4750 |
-
if ( results ) {
|
4751 |
-
results.push.apply( results, array );
|
4752 |
-
return results;
|
4753 |
-
}
|
4754 |
-
|
4755 |
-
return array;
|
4756 |
-
};
|
4757 |
-
|
4758 |
-
// Perform a simple check to determine if the browser is capable of
|
4759 |
-
// converting a NodeList to an array using builtin methods.
|
4760 |
-
// Also verifies that the returned array holds DOM nodes
|
4761 |
-
// (which is not the case in the Blackberry browser)
|
4762 |
-
try {
|
4763 |
-
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
|
4764 |
-
|
4765 |
-
// Provide a fallback method if it does not work
|
4766 |
-
} catch( e ) {
|
4767 |
-
makeArray = function( array, results ) {
|
4768 |
-
var i = 0,
|
4769 |
-
ret = results || [];
|
4770 |
-
|
4771 |
-
if ( toString.call(array) === "[object Array]" ) {
|
4772 |
-
Array.prototype.push.apply( ret, array );
|
4773 |
-
|
4774 |
-
} else {
|
4775 |
-
if ( typeof array.length === "number" ) {
|
4776 |
-
for ( var l = array.length; i < l; i++ ) {
|
4777 |
-
ret.push( array[i] );
|
4778 |
-
}
|
4779 |
-
|
4780 |
-
} else {
|
4781 |
-
for ( ; array[i]; i++ ) {
|
4782 |
-
ret.push( array[i] );
|
4783 |
-
}
|
4784 |
-
}
|
4785 |
-
}
|
4786 |
-
|
4787 |
-
return ret;
|
4788 |
-
};
|
4789 |
-
}
|
4790 |
-
|
4791 |
-
var sortOrder, siblingCheck;
|
4792 |
-
|
4793 |
-
if ( document.documentElement.compareDocumentPosition ) {
|
4794 |
-
sortOrder = function( a, b ) {
|
4795 |
-
if ( a === b ) {
|
4796 |
-
hasDuplicate = true;
|
4797 |
-
return 0;
|
4798 |
-
}
|
4799 |
-
|
4800 |
-
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
|
4801 |
-
return a.compareDocumentPosition ? -1 : 1;
|
4802 |
-
}
|
4803 |
-
|
4804 |
-
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
|
4805 |
-
};
|
4806 |
-
|
4807 |
-
} else {
|
4808 |
-
sortOrder = function( a, b ) {
|
4809 |
-
// The nodes are identical, we can exit early
|
4810 |
-
if ( a === b ) {
|
4811 |
-
hasDuplicate = true;
|
4812 |
-
return 0;
|
4813 |
-
|
4814 |
-
// Fallback to using sourceIndex (in IE) if it's available on both nodes
|
4815 |
-
} else if ( a.sourceIndex && b.sourceIndex ) {
|
4816 |
-
return a.sourceIndex - b.sourceIndex;
|
4817 |
-
}
|
4818 |
-
|
4819 |
-
var al, bl,
|
4820 |
-
ap = [],
|
4821 |
-
bp = [],
|
4822 |
-
aup = a.parentNode,
|
4823 |
-
bup = b.parentNode,
|
4824 |
-
cur = aup;
|
4825 |
-
|
4826 |
-
// If the nodes are siblings (or identical) we can do a quick check
|
4827 |
-
if ( aup === bup ) {
|
4828 |
-
return siblingCheck( a, b );
|
4829 |
-
|
4830 |
-
// If no parents were found then the nodes are disconnected
|
4831 |
-
} else if ( !aup ) {
|
4832 |
-
return -1;
|
4833 |
-
|
4834 |
-
} else if ( !bup ) {
|
4835 |
-
return 1;
|
4836 |
-
}
|
4837 |
-
|
4838 |
-
// Otherwise they're somewhere else in the tree so we need
|
4839 |
-
// to build up a full list of the parentNodes for comparison
|
4840 |
-
while ( cur ) {
|
4841 |
-
ap.unshift( cur );
|
4842 |
-
cur = cur.parentNode;
|
4843 |
-
}
|
4844 |
-
|
4845 |
-
cur = bup;
|
4846 |
-
|
4847 |
-
while ( cur ) {
|
4848 |
-
bp.unshift( cur );
|
4849 |
-
cur = cur.parentNode;
|
4850 |
-
}
|
4851 |
-
|
4852 |
-
al = ap.length;
|
4853 |
-
bl = bp.length;
|
4854 |
-
|
4855 |
-
// Start walking down the tree looking for a discrepancy
|
4856 |
-
for ( var i = 0; i < al && i < bl; i++ ) {
|
4857 |
-
if ( ap[i] !== bp[i] ) {
|
4858 |
-
return siblingCheck( ap[i], bp[i] );
|
4859 |
-
}
|
4860 |
-
}
|
4861 |
-
|
4862 |
-
// We ended someplace up the tree so do a sibling check
|
4863 |
-
return i === al ?
|
4864 |
-
siblingCheck( a, bp[i], -1 ) :
|
4865 |
-
siblingCheck( ap[i], b, 1 );
|
4866 |
-
};
|
4867 |
-
|
4868 |
-
siblingCheck = function( a, b, ret ) {
|
4869 |
-
if ( a === b ) {
|
4870 |
-
return ret;
|
4871 |
-
|
4872 |
-
var cur = a.nextSibling;
|
4873 |
-
}
|
4874 |
-
|
4875 |
-
while ( cur ) {
|
4876 |
-
if ( cur === b ) {
|
4877 |
-
return -1;
|
4878 |
-
}
|
4879 |
-
|
4880 |
-
cur = cur.nextSibling;
|
4881 |
-
}
|
4882 |
-
|
4883 |
-
return 1;
|
4884 |
-
};
|
4885 |
-
}
|
4886 |
-
|
4887 |
-
// Check to see if the browser returns elements by name when
|
4888 |
-
// querying by getElementById (and provide a workaround)
|
4889 |
-
(function(){
|
4890 |
-
// We're going to inject a fake input element with a specified name
|
4891 |
-
var form = document.createElement("div"),
|
4892 |
-
id = "script" + (new Date()).getTime(),
|
4893 |
-
root = document.documentElement;
|
4894 |
-
|
4895 |
-
form.innerHTML = "<a name='" + id + "'/>";
|
4896 |
-
|
4897 |
-
// Inject it into the root element, check its status, and remove it quickly
|
4898 |
-
root.insertBefore( form, root.firstChild );
|
4899 |
-
|
4900 |
-
// The workaround has to do additional checks after a getElementById
|
4901 |
-
// Which slows things down for other browsers (hence the branching)
|
4902 |
-
if ( document.getElementById( id ) ) {
|
4903 |
-
Expr.find.ID = function( match, context, isXML ) {
|
4904 |
-
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
4905 |
-
var m = context.getElementById(match[1]);
|
4906 |
-
|
4907 |
-
return m ?
|
4908 |
-
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
|
4909 |
-
[m] :
|
4910 |
-
undefined :
|
4911 |
-
[];
|
4912 |
-
}
|
4913 |
-
};
|
4914 |
-
|
4915 |
-
Expr.filter.ID = function( elem, match ) {
|
4916 |
-
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
|
4917 |
-
|
4918 |
-
return elem.nodeType === 1 && node && node.nodeValue === match;
|
4919 |
-
};
|
4920 |
-
}
|
4921 |
-
|
4922 |
-
root.removeChild( form );
|
4923 |
-
|
4924 |
-
// release memory in IE
|
4925 |
-
root = form = null;
|
4926 |
-
})();
|
4927 |
-
|
4928 |
-
(function(){
|
4929 |
-
// Check to see if the browser returns only elements
|
4930 |
-
// when doing getElementsByTagName("*")
|
4931 |
-
|
4932 |
-
// Create a fake element
|
4933 |
-
var div = document.createElement("div");
|
4934 |
-
div.appendChild( document.createComment("") );
|
4935 |
-
|
4936 |
-
// Make sure no comments are found
|
4937 |
-
if ( div.getElementsByTagName("*").length > 0 ) {
|
4938 |
-
Expr.find.TAG = function( match, context ) {
|
4939 |
-
var results = context.getElementsByTagName( match[1] );
|
4940 |
-
|
4941 |
-
// Filter out possible comments
|
4942 |
-
if ( match[1] === "*" ) {
|
4943 |
-
var tmp = [];
|
4944 |
-
|
4945 |
-
for ( var i = 0; results[i]; i++ ) {
|
4946 |
-
if ( results[i].nodeType === 1 ) {
|
4947 |
-
tmp.push( results[i] );
|
4948 |
-
}
|
4949 |
-
}
|
4950 |
-
|
4951 |
-
results = tmp;
|
4952 |
-
}
|
4953 |
-
|
4954 |
-
return results;
|
4955 |
-
};
|
4956 |
-
}
|
4957 |
-
|
4958 |
-
// Check to see if an attribute returns normalized href attributes
|
4959 |
-
div.innerHTML = "<a href='#'></a>";
|
4960 |
-
|
4961 |
-
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
|
4962 |
-
div.firstChild.getAttribute("href") !== "#" ) {
|
4963 |
-
|
4964 |
-
Expr.attrHandle.href = function( elem ) {
|
4965 |
-
return elem.getAttribute( "href", 2 );
|
4966 |
-
};
|
4967 |
-
}
|
4968 |
-
|
4969 |
-
// release memory in IE
|
4970 |
-
div = null;
|
4971 |
-
})();
|
4972 |
-
|
4973 |
-
if ( document.querySelectorAll ) {
|
4974 |
-
(function(){
|
4975 |
-
var oldSizzle = Sizzle,
|
4976 |
-
div = document.createElement("div"),
|
4977 |
-
id = "__sizzle__";
|
4978 |
-
|
4979 |
-
div.innerHTML = "<p class='TEST'></p>";
|
4980 |
-
|
4981 |
-
// Safari can't handle uppercase or unicode characters when
|
4982 |
-
// in quirks mode.
|
4983 |
-
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
|
4984 |
-
return;
|
4985 |
-
}
|
4986 |
-
|
4987 |
-
Sizzle = function( query, context, extra, seed ) {
|
4988 |
-
context = context || document;
|
4989 |
-
|
4990 |
-
// Only use querySelectorAll on non-XML documents
|
4991 |
-
// (ID selectors don't work in non-HTML documents)
|
4992 |
-
if ( !seed && !Sizzle.isXML(context) ) {
|
4993 |
-
// See if we find a selector to speed up
|
4994 |
-
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
|
4995 |
-
|
4996 |
-
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
|
4997 |
-
// Speed-up: Sizzle("TAG")
|
4998 |
-
if ( match[1] ) {
|
4999 |
-
return makeArray( context.getElementsByTagName( query ), extra );
|
5000 |
-
|
5001 |
-
// Speed-up: Sizzle(".CLASS")
|
5002 |
-
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
|
5003 |
-
return makeArray( context.getElementsByClassName( match[2] ), extra );
|
5004 |
-
}
|
5005 |
-
}
|
5006 |
-
|
5007 |
-
if ( context.nodeType === 9 ) {
|
5008 |
-
// Speed-up: Sizzle("body")
|
5009 |
-
// The body element only exists once, optimize finding it
|
5010 |
-
if ( query === "body" && context.body ) {
|
5011 |
-
return makeArray( [ context.body ], extra );
|
5012 |
-
|
5013 |
-
// Speed-up: Sizzle("#ID")
|
5014 |
-
} else if ( match && match[3] ) {
|
5015 |
-
var elem = context.getElementById( match[3] );
|
5016 |
-
|
5017 |
-
// Check parentNode to catch when Blackberry 4.6 returns
|
5018 |
-
// nodes that are no longer in the document #6963
|
5019 |
-
if ( elem && elem.parentNode ) {
|
5020 |
-
// Handle the case where IE and Opera return items
|
5021 |
-
// by name instead of ID
|
5022 |
-
if ( elem.id === match[3] ) {
|
5023 |
-
return makeArray( [ elem ], extra );
|
5024 |
-
}
|
5025 |
-
|
5026 |
-
} else {
|
5027 |
-
return makeArray( [], extra );
|
5028 |
-
}
|
5029 |
-
}
|
5030 |
-
|
5031 |
-
try {
|
5032 |
-
return makeArray( context.querySelectorAll(query), extra );
|
5033 |
-
} catch(qsaError) {}
|
5034 |
-
|
5035 |
-
// qSA works strangely on Element-rooted queries
|
5036 |
-
// We can work around this by specifying an extra ID on the root
|
5037 |
-
// and working up from there (Thanks to Andrew Dupont for the technique)
|
5038 |
-
// IE 8 doesn't work on object elements
|
5039 |
-
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
|
5040 |
-
var oldContext = context,
|
5041 |
-
old = context.getAttribute( "id" ),
|
5042 |
-
nid = old || id,
|
5043 |
-
hasParent = context.parentNode,
|
5044 |
-
relativeHierarchySelector = /^\s*[+~]/.test( query );
|
5045 |
-
|
5046 |
-
if ( !old ) {
|
5047 |
-
context.setAttribute( "id", nid );
|
5048 |
-
} else {
|
5049 |
-
nid = nid.replace( /'/g, "\\$&" );
|
5050 |
-
}
|
5051 |
-
if ( relativeHierarchySelector && hasParent ) {
|
5052 |
-
context = context.parentNode;
|
5053 |
-
}
|
5054 |
-
|
5055 |
-
try {
|
5056 |
-
if ( !relativeHierarchySelector || hasParent ) {
|
5057 |
-
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
|
5058 |
-
}
|
5059 |
-
|
5060 |
-
} catch(pseudoError) {
|
5061 |
-
} finally {
|
5062 |
-
if ( !old ) {
|
5063 |
-
oldContext.removeAttribute( "id" );
|
5064 |
-
}
|
5065 |
-
}
|
5066 |
-
}
|
5067 |
-
}
|
5068 |
-
|
5069 |
-
return oldSizzle(query, context, extra, seed);
|
5070 |
-
};
|
5071 |
-
|
5072 |
-
for ( var prop in oldSizzle ) {
|
5073 |
-
Sizzle[ prop ] = oldSizzle[ prop ];
|
5074 |
-
}
|
5075 |
-
|
5076 |
-
// release memory in IE
|
5077 |
-
div = null;
|
5078 |
-
})();
|
5079 |
-
}
|
5080 |
-
|
5081 |
-
(function(){
|
5082 |
-
var html = document.documentElement,
|
5083 |
-
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
|
5084 |
-
|
5085 |
-
if ( matches ) {
|
5086 |
-
// Check to see if it's possible to do matchesSelector
|
5087 |
-
// on a disconnected node (IE 9 fails this)
|
5088 |
-
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
|
5089 |
-
pseudoWorks = false;
|
5090 |
-
|
5091 |
-
try {
|
5092 |
-
// This should fail with an exception
|
5093 |
-
// Gecko does not error, returns false instead
|
5094 |
-
matches.call( document.documentElement, "[test!='']:sizzle" );
|
5095 |
-
|
5096 |
-
} catch( pseudoError ) {
|
5097 |
-
pseudoWorks = true;
|
5098 |
-
}
|
5099 |
-
|
5100 |
-
Sizzle.matchesSelector = function( node, expr ) {
|
5101 |
-
// Make sure that attribute selectors are quoted
|
5102 |
-
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
|
5103 |
-
|
5104 |
-
if ( !Sizzle.isXML( node ) ) {
|
5105 |
-
try {
|
5106 |
-
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
|
5107 |
-
var ret = matches.call( node, expr );
|
5108 |
-
|
5109 |
-
// IE 9's matchesSelector returns false on disconnected nodes
|
5110 |
-
if ( ret || !disconnectedMatch ||
|
5111 |
-
// As well, disconnected nodes are said to be in a document
|
5112 |
-
// fragment in IE 9, so check for that
|
5113 |
-
node.document && node.document.nodeType !== 11 ) {
|
5114 |
-
return ret;
|
5115 |
-
}
|
5116 |
-
}
|
5117 |
-
} catch(e) {}
|
5118 |
-
}
|
5119 |
-
|
5120 |
-
return Sizzle(expr, null, null, [node]).length > 0;
|
5121 |
-
};
|
5122 |
-
}
|
5123 |
-
})();
|
5124 |
-
|
5125 |
-
(function(){
|
5126 |
-
var div = document.createElement("div");
|
5127 |
-
|
5128 |
-
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
|
5129 |
-
|
5130 |
-
// Opera can't find a second classname (in 9.6)
|
5131 |
-
// Also, make sure that getElementsByClassName actually exists
|
5132 |
-
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
|
5133 |
-
return;
|
5134 |
-
}
|
5135 |
-
|
5136 |
-
// Safari caches class attributes, doesn't catch changes (in 3.2)
|
5137 |
-
div.lastChild.className = "e";
|
5138 |
-
|
5139 |
-
if ( div.getElementsByClassName("e").length === 1 ) {
|
5140 |
-
return;
|
5141 |
-
}
|
5142 |
-
|
5143 |
-
Expr.order.splice(1, 0, "CLASS");
|
5144 |
-
Expr.find.CLASS = function( match, context, isXML ) {
|
5145 |
-
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
|
5146 |
-
return context.getElementsByClassName(match[1]);
|
5147 |
-
}
|
5148 |
-
};
|
5149 |
-
|
5150 |
-
// release memory in IE
|
5151 |
-
div = null;
|
5152 |
-
})();
|
5153 |
-
|
5154 |
-
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
5155 |
-
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
5156 |
-
var elem = checkSet[i];
|
5157 |
-
|
5158 |
-
if ( elem ) {
|
5159 |
-
var match = false;
|
5160 |
-
|
5161 |
-
elem = elem[dir];
|
5162 |
-
|
5163 |
-
while ( elem ) {
|
5164 |
-
if ( elem[ expando ] === doneName ) {
|
5165 |
-
match = checkSet[elem.sizset];
|
5166 |
-
break;
|
5167 |
-
}
|
5168 |
-
|
5169 |
-
if ( elem.nodeType === 1 && !isXML ){
|
5170 |
-
elem[ expando ] = doneName;
|
5171 |
-
elem.sizset = i;
|
5172 |
-
}
|
5173 |
-
|
5174 |
-
if ( elem.nodeName.toLowerCase() === cur ) {
|
5175 |
-
match = elem;
|
5176 |
-
break;
|
5177 |
-
}
|
5178 |
-
|
5179 |
-
elem = elem[dir];
|
5180 |
-
}
|
5181 |
-
|
5182 |
-
checkSet[i] = match;
|
5183 |
-
}
|
5184 |
-
}
|
5185 |
-
}
|
5186 |
-
|
5187 |
-
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
5188 |
-
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
5189 |
-
var elem = checkSet[i];
|
5190 |
-
|
5191 |
-
if ( elem ) {
|
5192 |
-
var match = false;
|
5193 |
-
|
5194 |
-
elem = elem[dir];
|
5195 |
-
|
5196 |
-
while ( elem ) {
|
5197 |
-
if ( elem[ expando ] === doneName ) {
|
5198 |
-
match = checkSet[elem.sizset];
|
5199 |
-
break;
|
5200 |
-
}
|
5201 |
-
|
5202 |
-
if ( elem.nodeType === 1 ) {
|
5203 |
-
if ( !isXML ) {
|
5204 |
-
elem[ expando ] = doneName;
|
5205 |
-
elem.sizset = i;
|
5206 |
-
}
|
5207 |
-
|
5208 |
-
if ( typeof cur !== "string" ) {
|
5209 |
-
if ( elem === cur ) {
|
5210 |
-
match = true;
|
5211 |
-
break;
|
5212 |
-
}
|
5213 |
-
|
5214 |
-
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
|
5215 |
-
match = elem;
|
5216 |
-
break;
|
5217 |
-
}
|
5218 |
-
}
|
5219 |
-
|
5220 |
-
elem = elem[dir];
|
5221 |
-
}
|
5222 |
-
|
5223 |
-
checkSet[i] = match;
|
5224 |
-
}
|
5225 |
-
}
|
5226 |
-
}
|
5227 |
-
|
5228 |
-
if ( document.documentElement.contains ) {
|
5229 |
-
Sizzle.contains = function( a, b ) {
|
5230 |
-
return a !== b && (a.contains ? a.contains(b) : true);
|
5231 |
-
};
|
5232 |
-
|
5233 |
-
} else if ( document.documentElement.compareDocumentPosition ) {
|
5234 |
-
Sizzle.contains = function( a, b ) {
|
5235 |
-
return !!(a.compareDocumentPosition(b) & 16);
|
5236 |
-
};
|
5237 |
-
|
5238 |
-
} else {
|
5239 |
-
Sizzle.contains = function() {
|
5240 |
-
return false;
|
5241 |
-
};
|
5242 |
-
}
|
5243 |
-
|
5244 |
-
Sizzle.isXML = function( elem ) {
|
5245 |
-
// documentElement is verified for cases where it doesn't yet exist
|
5246 |
-
// (such as loading iframes in IE - #4833)
|
5247 |
-
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
|
5248 |
-
|
5249 |
-
return documentElement ? documentElement.nodeName !== "HTML" : false;
|
5250 |
-
};
|
5251 |
-
|
5252 |
-
var posProcess = function( selector, context, seed ) {
|
5253 |
-
var match,
|
5254 |
-
tmpSet = [],
|
5255 |
-
later = "",
|
5256 |
-
root = context.nodeType ? [context] : context;
|
5257 |
-
|
5258 |
-
// Position selectors must be done after the filter
|
5259 |
-
// And so must :not(positional) so we move all PSEUDOs to the end
|
5260 |
-
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
|
5261 |
-
later += match[0];
|
5262 |
-
selector = selector.replace( Expr.match.PSEUDO, "" );
|
5263 |
-
}
|
5264 |
-
|
5265 |
-
selector = Expr.relative[selector] ? selector + "*" : selector;
|
5266 |
-
|
5267 |
-
for ( var i = 0, l = root.length; i < l; i++ ) {
|
5268 |
-
Sizzle( selector, root[i], tmpSet, seed );
|
5269 |
-
}
|
5270 |
-
|
5271 |
-
return Sizzle.filter( later, tmpSet );
|
5272 |
-
};
|
5273 |
-
|
5274 |
-
// EXPOSE
|
5275 |
-
// Override sizzle attribute retrieval
|
5276 |
-
Sizzle.attr = jQuery.attr;
|
5277 |
-
Sizzle.selectors.attrMap = {};
|
5278 |
-
jQuery.find = Sizzle;
|
5279 |
-
jQuery.expr = Sizzle.selectors;
|
5280 |
-
jQuery.expr[":"] = jQuery.expr.filters;
|
5281 |
-
jQuery.unique = Sizzle.uniqueSort;
|
5282 |
-
jQuery.text = Sizzle.getText;
|
5283 |
-
jQuery.isXMLDoc = Sizzle.isXML;
|
5284 |
-
jQuery.contains = Sizzle.contains;
|
5285 |
-
|
5286 |
-
|
5287 |
-
})();
|
5288 |
-
|
5289 |
-
|
5290 |
-
var runtil = /Until$/,
|
5291 |
-
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
|
5292 |
-
// Note: This RegExp should be improved, or likely pulled from Sizzle
|
5293 |
-
rmultiselector = /,/,
|
5294 |
-
isSimple = /^.[^:#\[\.,]*$/,
|
5295 |
-
slice = Array.prototype.slice,
|
5296 |
-
POS = jQuery.expr.match.POS,
|
5297 |
-
// methods guaranteed to produce a unique set when starting from a unique set
|
5298 |
-
guaranteedUnique = {
|
5299 |
-
children: true,
|
5300 |
-
contents: true,
|
5301 |
-
next: true,
|
5302 |
-
prev: true
|
5303 |
-
};
|
5304 |
-
|
5305 |
-
jQuery.fn.extend({
|
5306 |
-
find: function( selector ) {
|
5307 |
-
var self = this,
|
5308 |
-
i, l;
|
5309 |
-
|
5310 |
-
if ( typeof selector !== "string" ) {
|
5311 |
-
return jQuery( selector ).filter(function() {
|
5312 |
-
for ( i = 0, l = self.length; i < l; i++ ) {
|
5313 |
-
if ( jQuery.contains( self[ i ], this ) ) {
|
5314 |
-
return true;
|
5315 |
-
}
|
5316 |
-
}
|
5317 |
-
});
|
5318 |
-
}
|
5319 |
-
|
5320 |
-
var ret = this.pushStack( "", "find", selector ),
|
5321 |
-
length, n, r;
|
5322 |
-
|
5323 |
-
for ( i = 0, l = this.length; i < l; i++ ) {
|
5324 |
-
length = ret.length;
|
5325 |
-
jQuery.find( selector, this[i], ret );
|
5326 |
-
|
5327 |
-
if ( i > 0 ) {
|
5328 |
-
// Make sure that the results are unique
|
5329 |
-
for ( n = length; n < ret.length; n++ ) {
|
5330 |
-
for ( r = 0; r < length; r++ ) {
|
5331 |
-
if ( ret[r] === ret[n] ) {
|
5332 |
-
ret.splice(n--, 1);
|
5333 |
-
break;
|
5334 |
-
}
|
5335 |
-
}
|
5336 |
-
}
|
5337 |
-
}
|
5338 |
-
}
|
5339 |
-
|
5340 |
-
return ret;
|
5341 |
-
},
|
5342 |
-
|
5343 |
-
has: function( target ) {
|
5344 |
-
var targets = jQuery( target );
|
5345 |
-
return this.filter(function() {
|
5346 |
-
for ( var i = 0, l = targets.length; i < l; i++ ) {
|
5347 |
-
if ( jQuery.contains( this, targets[i] ) ) {
|
5348 |
-
return true;
|
5349 |
-
}
|
5350 |
-
}
|
5351 |
-
});
|
5352 |
-
},
|
5353 |
-
|
5354 |
-
not: function( selector ) {
|
5355 |
-
return this.pushStack( winnow(this, selector, false), "not", selector);
|
5356 |
-
},
|
5357 |
-
|
5358 |
-
filter: function( selector ) {
|
5359 |
-
return this.pushStack( winnow(this, selector, true), "filter", selector );
|
5360 |
-
},
|
5361 |
-
|
5362 |
-
is: function( selector ) {
|
5363 |
-
return !!selector && (
|
5364 |
-
typeof selector === "string" ?
|
5365 |
-
// If this is a positional selector, check membership in the returned set
|
5366 |
-
// so $("p:first").is("p:last") won't return true for a doc with two "p".
|
5367 |
-
POS.test( selector ) ?
|
5368 |
-
jQuery( selector, this.context ).index( this[0] ) >= 0 :
|
5369 |
-
jQuery.filter( selector, this ).length > 0 :
|
5370 |
-
this.filter( selector ).length > 0 );
|
5371 |
-
},
|
5372 |
-
|
5373 |
-
closest: function( selectors, context ) {
|
5374 |
-
var ret = [], i, l, cur = this[0];
|
5375 |
-
|
5376 |
-
// Array (deprecated as of jQuery 1.7)
|
5377 |
-
if ( jQuery.isArray( selectors ) ) {
|
5378 |
-
var level = 1;
|
5379 |
-
|
5380 |
-
while ( cur && cur.ownerDocument && cur !== context ) {
|
5381 |
-
for ( i = 0; i < selectors.length; i++ ) {
|
5382 |
-
|
5383 |
-
if ( jQuery( cur ).is( selectors[ i ] ) ) {
|
5384 |
-
ret.push({ selector: selectors[ i ], elem: cur, level: level });
|
5385 |
-
}
|
5386 |
-
}
|
5387 |
-
|
5388 |
-
cur = cur.parentNode;
|
5389 |
-
level++;
|
5390 |
-
}
|
5391 |
-
|
5392 |
-
return ret;
|
5393 |
-
}
|
5394 |
-
|
5395 |
-
// String
|
5396 |
-
var pos = POS.test( selectors ) || typeof selectors !== "string" ?
|
5397 |
-
jQuery( selectors, context || this.context ) :
|
5398 |
-
0;
|
5399 |
-
|
5400 |
-
for ( i = 0, l = this.length; i < l; i++ ) {
|
5401 |
-
cur = this[i];
|
5402 |
-
|
5403 |
-
while ( cur ) {
|
5404 |
-
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
|
5405 |
-
ret.push( cur );
|
5406 |
-
break;
|
5407 |
-
|
5408 |
-
} else {
|
5409 |
-
cur = cur.parentNode;
|
5410 |
-
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
|
5411 |
-
break;
|
5412 |
-
}
|
5413 |
-
}
|
5414 |
-
}
|
5415 |
-
}
|
5416 |
-
|
5417 |
-
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
|
5418 |
-
|
5419 |
-
return this.pushStack( ret, "closest", selectors );
|
5420 |
-
},
|
5421 |
-
|
5422 |
-
// Determine the position of an element within
|
5423 |
-
// the matched set of elements
|
5424 |
-
index: function( elem ) {
|
5425 |
-
|
5426 |
-
// No argument, return index in parent
|
5427 |
-
if ( !elem ) {
|
5428 |
-
return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
|
5429 |
-
}
|
5430 |
-
|
5431 |
-
// index in selector
|
5432 |
-
if ( typeof elem === "string" ) {
|
5433 |
-
return jQuery.inArray( this[0], jQuery( elem ) );
|
5434 |
-
}
|
5435 |
-
|
5436 |
-
// Locate the position of the desired element
|
5437 |
-
return jQuery.inArray(
|
5438 |
-
// If it receives a jQuery object, the first element is used
|
5439 |
-
elem.jquery ? elem[0] : elem, this );
|
5440 |
-
},
|
5441 |
-
|
5442 |
-
add: function( selector, context ) {
|
5443 |
-
var set = typeof selector === "string" ?
|
5444 |
-
jQuery( selector, context ) :
|
5445 |
-
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
|
5446 |
-
all = jQuery.merge( this.get(), set );
|
5447 |
-
|
5448 |
-
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
|
5449 |
-
all :
|
5450 |
-
jQuery.unique( all ) );
|
5451 |
-
},
|
5452 |
-
|
5453 |
-
andSelf: function() {
|
5454 |
-
return this.add( this.prevObject );
|
5455 |
-
}
|
5456 |
-
});
|
5457 |
-
|
5458 |
-
// A painfully simple check to see if an element is disconnected
|
5459 |
-
// from a document (should be improved, where feasible).
|
5460 |
-
function isDisconnected( node ) {
|
5461 |
-
return !node || !node.parentNode || node.parentNode.nodeType === 11;
|
5462 |
-
}
|
5463 |
-
|
5464 |
-
jQuery.each({
|
5465 |
-
parent: function( elem ) {
|
5466 |
-
var parent = elem.parentNode;
|
5467 |
-
return parent && parent.nodeType !== 11 ? parent : null;
|
5468 |
-
},
|
5469 |
-
parents: function( elem ) {
|
5470 |
-
return jQuery.dir( elem, "parentNode" );
|
5471 |
-
},
|
5472 |
-
parentsUntil: function( elem, i, until ) {
|
5473 |
-
return jQuery.dir( elem, "parentNode", until );
|
5474 |
-
},
|
5475 |
-
next: function( elem ) {
|
5476 |
-
return jQuery.nth( elem, 2, "nextSibling" );
|
5477 |
-
},
|
5478 |
-
prev: function( elem ) {
|
5479 |
-
return jQuery.nth( elem, 2, "previousSibling" );
|
5480 |
-
},
|
5481 |
-
nextAll: function( elem ) {
|
5482 |
-
return jQuery.dir( elem, "nextSibling" );
|
5483 |
-
},
|
5484 |
-
prevAll: function( elem ) {
|
5485 |
-
return jQuery.dir( elem, "previousSibling" );
|
5486 |
-
},
|
5487 |
-
nextUntil: function( elem, i, until ) {
|
5488 |
-
return jQuery.dir( elem, "nextSibling", until );
|
5489 |
-
},
|
5490 |
-
prevUntil: function( elem, i, until ) {
|
5491 |
-
return jQuery.dir( elem, "previousSibling", until );
|
5492 |
-
},
|
5493 |
-
siblings: function( elem ) {
|
5494 |
-
return jQuery.sibling( elem.parentNode.firstChild, elem );
|
5495 |
-
},
|
5496 |
-
children: function( elem ) {
|
5497 |
-
return jQuery.sibling( elem.firstChild );
|
5498 |
-
},
|
5499 |
-
contents: function( elem ) {
|
5500 |
-
return jQuery.nodeName( elem, "iframe" ) ?
|
5501 |
-
elem.contentDocument || elem.contentWindow.document :
|
5502 |
-
jQuery.makeArray( elem.childNodes );
|
5503 |
-
}
|
5504 |
-
}, function( name, fn ) {
|
5505 |
-
jQuery.fn[ name ] = function( until, selector ) {
|
5506 |
-
var ret = jQuery.map( this, fn, until );
|
5507 |
-
|
5508 |
-
if ( !runtil.test( name ) ) {
|
5509 |
-
selector = until;
|
5510 |
-
}
|
5511 |
-
|
5512 |
-
if ( selector && typeof selector === "string" ) {
|
5513 |
-
ret = jQuery.filter( selector, ret );
|
5514 |
-
}
|
5515 |
-
|
5516 |
-
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
|
5517 |
-
|
5518 |
-
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
|
5519 |
-
ret = ret.reverse();
|
5520 |
-
}
|
5521 |
-
|
5522 |
-
return this.pushStack( ret, name, slice.call( arguments ).join(",") );
|
5523 |
-
};
|
5524 |
-
});
|
5525 |
-
|
5526 |
-
jQuery.extend({
|
5527 |
-
filter: function( expr, elems, not ) {
|
5528 |
-
if ( not ) {
|
5529 |
-
expr = ":not(" + expr + ")";
|
5530 |
-
}
|
5531 |
-
|
5532 |
-
return elems.length === 1 ?
|
5533 |
-
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
|
5534 |
-
jQuery.find.matches(expr, elems);
|
5535 |
-
},
|
5536 |
-
|
5537 |
-
dir: function( elem, dir, until ) {
|
5538 |
-
var matched = [],
|
5539 |
-
cur = elem[ dir ];
|
5540 |
-
|
5541 |
-
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
|
5542 |
-
if ( cur.nodeType === 1 ) {
|
5543 |
-
matched.push( cur );
|
5544 |
-
}
|
5545 |
-
cur = cur[dir];
|
5546 |
-
}
|
5547 |
-
return matched;
|
5548 |
-
},
|
5549 |
-
|
5550 |
-
nth: function( cur, result, dir, elem ) {
|
5551 |
-
result = result || 1;
|
5552 |
-
var num = 0;
|
5553 |
-
|
5554 |
-
for ( ; cur; cur = cur[dir] ) {
|
5555 |
-
if ( cur.nodeType === 1 && ++num === result ) {
|
5556 |
-
break;
|
5557 |
-
}
|
5558 |
-
}
|
5559 |
-
|
5560 |
-
return cur;
|
5561 |
-
},
|
5562 |
-
|
5563 |
-
sibling: function( n, elem ) {
|
5564 |
-
var r = [];
|
5565 |
-
|
5566 |
-
for ( ; n; n = n.nextSibling ) {
|
5567 |
-
if ( n.nodeType === 1 && n !== elem ) {
|
5568 |
-
r.push( n );
|
5569 |
-
}
|
5570 |
-
}
|
5571 |
-
|
5572 |
-
return r;
|
5573 |
-
}
|
5574 |
-
});
|
5575 |
-
|
5576 |
-
// Implement the identical functionality for filter and not
|
5577 |
-
function winnow( elements, qualifier, keep ) {
|
5578 |
-
|
5579 |
-
// Can't pass null or undefined to indexOf in Firefox 4
|
5580 |
-
// Set to 0 to skip string check
|
5581 |
-
qualifier = qualifier || 0;
|
5582 |
-
|
5583 |
-
if ( jQuery.isFunction( qualifier ) ) {
|
5584 |
-
return jQuery.grep(elements, function( elem, i ) {
|
5585 |
-
var retVal = !!qualifier.call( elem, i, elem );
|
5586 |
-
return retVal === keep;
|
5587 |
-
});
|
5588 |
-
|
5589 |
-
} else if ( qualifier.nodeType ) {
|
5590 |
-
return jQuery.grep(elements, function( elem, i ) {
|
5591 |
-
return ( elem === qualifier ) === keep;
|
5592 |
-
});
|
5593 |
-
|
5594 |
-
} else if ( typeof qualifier === "string" ) {
|
5595 |
-
var filtered = jQuery.grep(elements, function( elem ) {
|
5596 |
-
return elem.nodeType === 1;
|
5597 |
-
});
|
5598 |
-
|
5599 |
-
if ( isSimple.test( qualifier ) ) {
|
5600 |
-
return jQuery.filter(qualifier, filtered, !keep);
|
5601 |
-
} else {
|
5602 |
-
qualifier = jQuery.filter( qualifier, filtered );
|
5603 |
-
}
|
5604 |
-
}
|
5605 |
-
|
5606 |
-
return jQuery.grep(elements, function( elem, i ) {
|
5607 |
-
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
|
5608 |
-
});
|
5609 |
-
}
|
5610 |
-
|
5611 |
-
|
5612 |
-
|
5613 |
-
|
5614 |
-
function createSafeFragment( document ) {
|
5615 |
-
var list = nodeNames.split( "|" ),
|
5616 |
-
safeFrag = document.createDocumentFragment();
|
5617 |
-
|
5618 |
-
if ( safeFrag.createElement ) {
|
5619 |
-
while ( list.length ) {
|
5620 |
-
safeFrag.createElement(
|
5621 |
-
list.pop()
|
5622 |
-
);
|
5623 |
-
}
|
5624 |
-
}
|
5625 |
-
return safeFrag;
|
5626 |
-
}
|
5627 |
-
|
5628 |
-
var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" +
|
5629 |
-
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
|
5630 |
-
rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
|
5631 |
-
rleadingWhitespace = /^\s+/,
|
5632 |
-
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
|
5633 |
-
rtagName = /<([\w:]+)/,
|
5634 |
-
rtbody = /<tbody/i,
|
5635 |
-
rhtml = /<|&#?\w+;/,
|
5636 |
-
rnoInnerhtml = /<(?:script|style)/i,
|
5637 |
-
rnocache = /<(?:script|object|embed|option|style)/i,
|
5638 |
-
rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
|
5639 |
-
// checked="checked" or checked
|
5640 |
-
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
5641 |
-
rscriptType = /\/(java|ecma)script/i,
|
5642 |
-
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
|
5643 |
-
wrapMap = {
|
5644 |
-
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
5645 |
-
legend: [ 1, "<fieldset>", "</fieldset>" ],
|
5646 |
-
thead: [ 1, "<table>", "</table>" ],
|
5647 |
-
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
|
5648 |
-
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
|
5649 |
-
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
|
5650 |
-
area: [ 1, "<map>", "</map>" ],
|
5651 |
-
_default: [ 0, "", "" ]
|
5652 |
-
},
|
5653 |
-
safeFragment = createSafeFragment( document );
|
5654 |
-
|
5655 |
-
wrapMap.optgroup = wrapMap.option;
|
5656 |
-
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
5657 |
-
wrapMap.th = wrapMap.td;
|
5658 |
-
|
5659 |
-
// IE can't serialize <link> and <script> tags normally
|
5660 |
-
if ( !jQuery.support.htmlSerialize ) {
|
5661 |
-
wrapMap._default = [ 1, "div<div>", "</div>" ];
|
5662 |
-
}
|
5663 |
-
|
5664 |
-
jQuery.fn.extend({
|
5665 |
-
text: function( text ) {
|
5666 |
-
if ( jQuery.isFunction(text) ) {
|
5667 |
-
return this.each(function(i) {
|
5668 |
-
var self = jQuery( this );
|
5669 |
-
|
5670 |
-
self.text( text.call(this, i, self.text()) );
|
5671 |
-
});
|
5672 |
-
}
|
5673 |
-
|
5674 |
-
if ( typeof text !== "object" && text !== undefined ) {
|
5675 |
-
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
|
5676 |
-
}
|
5677 |
-
|
5678 |
-
return jQuery.text( this );
|
5679 |
-
},
|
5680 |
-
|
5681 |
-
wrapAll: function( html ) {
|
5682 |
-
if ( jQuery.isFunction( html ) ) {
|
5683 |
-
return this.each(function(i) {
|
5684 |
-
jQuery(this).wrapAll( html.call(this, i) );
|
5685 |
-
});
|
5686 |
-
}
|
5687 |
-
|
5688 |
-
if ( this[0] ) {
|
5689 |
-
// The elements to wrap the target around
|
5690 |
-
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
|
5691 |
-
|
5692 |
-
if ( this[0].parentNode ) {
|
5693 |
-
wrap.insertBefore( this[0] );
|
5694 |
-
}
|
5695 |
-
|
5696 |
-
wrap.map(function() {
|
5697 |
-
var elem = this;
|
5698 |
-
|
5699 |
-
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
|
5700 |
-
elem = elem.firstChild;
|
5701 |
-
}
|
5702 |
-
|
5703 |
-
return elem;
|
5704 |
-
}).append( this );
|
5705 |
-
}
|
5706 |
-
|
5707 |
-
return this;
|
5708 |
-
},
|
5709 |
-
|
5710 |
-
wrapInner: function( html ) {
|
5711 |
-
if ( jQuery.isFunction( html ) ) {
|
5712 |
-
return this.each(function(i) {
|
5713 |
-
jQuery(this).wrapInner( html.call(this, i) );
|
5714 |
-
});
|
5715 |
-
}
|
5716 |
-
|
5717 |
-
return this.each(function() {
|
5718 |
-
var self = jQuery( this ),
|
5719 |
-
contents = self.contents();
|
5720 |
-
|
5721 |
-
if ( contents.length ) {
|
5722 |
-
contents.wrapAll( html );
|
5723 |
-
|
5724 |
-
} else {
|
5725 |
-
self.append( html );
|
5726 |
-
}
|
5727 |
-
});
|
5728 |
-
},
|
5729 |
-
|
5730 |
-
wrap: function( html ) {
|
5731 |
-
var isFunction = jQuery.isFunction( html );
|
5732 |
-
|
5733 |
-
return this.each(function(i) {
|
5734 |
-
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
|
5735 |
-
});
|
5736 |
-
},
|
5737 |
-
|
5738 |
-
unwrap: function() {
|
5739 |
-
return this.parent().each(function() {
|
5740 |
-
if ( !jQuery.nodeName( this, "body" ) ) {
|
5741 |
-
jQuery( this ).replaceWith( this.childNodes );
|
5742 |
-
}
|
5743 |
-
}).end();
|
5744 |
-
},
|
5745 |
-
|
5746 |
-
append: function() {
|
5747 |
-
return this.domManip(arguments, true, function( elem ) {
|
5748 |
-
if ( this.nodeType === 1 ) {
|
5749 |
-
this.appendChild( elem );
|
5750 |
-
}
|
5751 |
-
});
|
5752 |
-
},
|
5753 |
-
|
5754 |
-
prepend: function() {
|
5755 |
-
return this.domManip(arguments, true, function( elem ) {
|
5756 |
-
if ( this.nodeType === 1 ) {
|
5757 |
-
this.insertBefore( elem, this.firstChild );
|
5758 |
-
}
|
5759 |
-
});
|
5760 |
-
},
|
5761 |
-
|
5762 |
-
before: function() {
|
5763 |
-
if ( this[0] && this[0].parentNode ) {
|
5764 |
-
return this.domManip(arguments, false, function( elem ) {
|
5765 |
-
this.parentNode.insertBefore( elem, this );
|
5766 |
-
});
|
5767 |
-
} else if ( arguments.length ) {
|
5768 |
-
var set = jQuery.clean( arguments );
|
5769 |
-
set.push.apply( set, this.toArray() );
|
5770 |
-
return this.pushStack( set, "before", arguments );
|
5771 |
-
}
|
5772 |
-
},
|
5773 |
-
|
5774 |
-
after: function() {
|
5775 |
-
if ( this[0] && this[0].parentNode ) {
|
5776 |
-
return this.domManip(arguments, false, function( elem ) {
|
5777 |
-
this.parentNode.insertBefore( elem, this.nextSibling );
|
5778 |
-
});
|
5779 |
-
} else if ( arguments.length ) {
|
5780 |
-
var set = this.pushStack( this, "after", arguments );
|
5781 |
-
set.push.apply( set, jQuery.clean(arguments) );
|
5782 |
-
return set;
|
5783 |
-
}
|
5784 |
-
},
|
5785 |
-
|
5786 |
-
// keepData is for internal use only--do not document
|
5787 |
-
remove: function( selector, keepData ) {
|
5788 |
-
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
|
5789 |
-
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
|
5790 |
-
if ( !keepData && elem.nodeType === 1 ) {
|
5791 |
-
jQuery.cleanData( elem.getElementsByTagName("*") );
|
5792 |
-
jQuery.cleanData( [ elem ] );
|
5793 |
-
}
|
5794 |
-
|
5795 |
-
if ( elem.parentNode ) {
|
5796 |
-
elem.parentNode.removeChild( elem );
|
5797 |
-
}
|
5798 |
-
}
|
5799 |
-
}
|
5800 |
-
|
5801 |
-
return this;
|
5802 |
-
},
|
5803 |
-
|
5804 |
-
empty: function() {
|
5805 |
-
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
|
5806 |
-
// Remove element nodes and prevent memory leaks
|
5807 |
-
if ( elem.nodeType === 1 ) {
|
5808 |
-
jQuery.cleanData( elem.getElementsByTagName("*") );
|
5809 |
-
}
|
5810 |
-
|
5811 |
-
// Remove any remaining nodes
|
5812 |
-
while ( elem.firstChild ) {
|
5813 |
-
elem.removeChild( elem.firstChild );
|
5814 |
-
}
|
5815 |
-
}
|
5816 |
-
|
5817 |
-
return this;
|
5818 |
-
},
|
5819 |
-
|
5820 |
-
clone: function( dataAndEvents, deepDataAndEvents ) {
|
5821 |
-
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
|
5822 |
-
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
|
5823 |
-
|
5824 |
-
return this.map( function () {
|
5825 |
-
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
|
5826 |
-
});
|
5827 |
-
},
|
5828 |
-
|
5829 |
-
html: function( value ) {
|
5830 |
-
if ( value === undefined ) {
|
5831 |
-
return this[0] && this[0].nodeType === 1 ?
|
5832 |
-
this[0].innerHTML.replace(rinlinejQuery, "") :
|
5833 |
-
null;
|
5834 |
-
|
5835 |
-
// See if we can take a shortcut and just use innerHTML
|
5836 |
-
} else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
|
5837 |
-
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
|
5838 |
-
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
|
5839 |
-
|
5840 |
-
value = value.replace(rxhtmlTag, "<$1></$2>");
|
5841 |
-
|
5842 |
-
try {
|
5843 |
-
for ( var i = 0, l = this.length; i < l; i++ ) {
|
5844 |
-
// Remove element nodes and prevent memory leaks
|
5845 |
-
if ( this[i].nodeType === 1 ) {
|
5846 |
-
jQuery.cleanData( this[i].getElementsByTagName("*") );
|
5847 |
-
this[i].innerHTML = value;
|
5848 |
-
}
|
5849 |
-
}
|
5850 |
-
|
5851 |
-
// If using innerHTML throws an exception, use the fallback method
|
5852 |
-
} catch(e) {
|
5853 |
-
this.empty().append( value );
|
5854 |
-
}
|
5855 |
-
|
5856 |
-
} else if ( jQuery.isFunction( value ) ) {
|
5857 |
-
this.each(function(i){
|
5858 |
-
var self = jQuery( this );
|
5859 |
-
|
5860 |
-
self.html( value.call(this, i, self.html()) );
|
5861 |
-
});
|
5862 |
-
|
5863 |
-
} else {
|
5864 |
-
this.empty().append( value );
|
5865 |
-
}
|
5866 |
-
|
5867 |
-
return this;
|
5868 |
-
},
|
5869 |
-
|
5870 |
-
replaceWith: function( value ) {
|
5871 |
-
if ( this[0] && this[0].parentNode ) {
|
5872 |
-
// Make sure that the elements are removed from the DOM before they are inserted
|
5873 |
-
// this can help fix replacing a parent with child elements
|
5874 |
-
if ( jQuery.isFunction( value ) ) {
|
5875 |
-
return this.each(function(i) {
|
5876 |
-
var self = jQuery(this), old = self.html();
|
5877 |
-
self.replaceWith( value.call( this, i, old ) );
|
5878 |
-
});
|
5879 |
-
}
|
5880 |
-
|
5881 |
-
if ( typeof value !== "string" ) {
|
5882 |
-
value = jQuery( value ).detach();
|
5883 |
-
}
|
5884 |
-
|
5885 |
-
return this.each(function() {
|
5886 |
-
var next = this.nextSibling,
|
5887 |
-
parent = this.parentNode;
|
5888 |
-
|
5889 |
-
jQuery( this ).remove();
|
5890 |
-
|
5891 |
-
if ( next ) {
|
5892 |
-
jQuery(next).before( value );
|
5893 |
-
} else {
|
5894 |
-
jQuery(parent).append( value );
|
5895 |
-
}
|
5896 |
-
});
|
5897 |
-
} else {
|
5898 |
-
return this.length ?
|
5899 |
-
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
|
5900 |
-
this;
|
5901 |
-
}
|
5902 |
-
},
|
5903 |
-
|
5904 |
-
detach: function( selector ) {
|
5905 |
-
return this.remove( selector, true );
|
5906 |
-
},
|
5907 |
-
|
5908 |
-
domManip: function( args, table, callback ) {
|
5909 |
-
var results, first, fragment, parent,
|
5910 |
-
value = args[0],
|
5911 |
-
scripts = [];
|
5912 |
-
|
5913 |
-
// We can't cloneNode fragments that contain checked, in WebKit
|
5914 |
-
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
|
5915 |
-
return this.each(function() {
|
5916 |
-
jQuery(this).domManip( args, table, callback, true );
|
5917 |
-
});
|
5918 |
-
}
|
5919 |
-
|
5920 |
-
if ( jQuery.isFunction(value) ) {
|
5921 |
-
return this.each(function(i) {
|
5922 |
-
var self = jQuery(this);
|
5923 |
-
args[0] = value.call(this, i, table ? self.html() : undefined);
|
5924 |
-
self.domManip( args, table, callback );
|
5925 |
-
});
|
5926 |
-
}
|
5927 |
-
|
5928 |
-
if ( this[0] ) {
|
5929 |
-
parent = value && value.parentNode;
|
5930 |
-
|
5931 |
-
// If we're in a fragment, just use that instead of building a new one
|
5932 |
-
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
|
5933 |
-
results = { fragment: parent };
|
5934 |
-
|
5935 |
-
} else {
|
5936 |
-
results = jQuery.buildFragment( args, this, scripts );
|
5937 |
-
}
|
5938 |
-
|
5939 |
-
fragment = results.fragment;
|
5940 |
-
|
5941 |
-
if ( fragment.childNodes.length === 1 ) {
|
5942 |
-
first = fragment = fragment.firstChild;
|
5943 |
-
} else {
|
5944 |
-
first = fragment.firstChild;
|
5945 |
-
}
|
5946 |
-
|
5947 |
-
if ( first ) {
|
5948 |
-
table = table && jQuery.nodeName( first, "tr" );
|
5949 |
-
|
5950 |
-
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
|
5951 |
-
callback.call(
|
5952 |
-
table ?
|
5953 |
-
root(this[i], first) :
|
5954 |
-
this[i],
|
5955 |
-
// Make sure that we do not leak memory by inadvertently discarding
|
5956 |
-
// the original fragment (which might have attached data) instead of
|
5957 |
-
// using it; in addition, use the original fragment object for the last
|
5958 |
-
// item instead of first because it can end up being emptied incorrectly
|
5959 |
-
// in certain situations (Bug #8070).
|
5960 |
-
// Fragments from the fragment cache must always be cloned and never used
|
5961 |
-
// in place.
|
5962 |
-
results.cacheable || ( l > 1 && i < lastIndex ) ?
|
5963 |
-
jQuery.clone( fragment, true, true ) :
|
5964 |
-
fragment
|
5965 |
-
);
|
5966 |
-
}
|
5967 |
-
}
|
5968 |
-
|
5969 |
-
if ( scripts.length ) {
|
5970 |
-
jQuery.each( scripts, evalScript );
|
5971 |
-
}
|
5972 |
-
}
|
5973 |
-
|
5974 |
-
return this;
|
5975 |
-
}
|
5976 |
-
});
|
5977 |
-
|
5978 |
-
function root( elem, cur ) {
|
5979 |
-
return jQuery.nodeName(elem, "table") ?
|
5980 |
-
(elem.getElementsByTagName("tbody")[0] ||
|
5981 |
-
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
|
5982 |
-
elem;
|
5983 |
-
}
|
5984 |
-
|
5985 |
-
function cloneCopyEvent( src, dest ) {
|
5986 |
-
|
5987 |
-
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
|
5988 |
-
return;
|
5989 |
-
}
|
5990 |
-
|
5991 |
-
var type, i, l,
|
5992 |
-
oldData = jQuery._data( src ),
|
5993 |
-
curData = jQuery._data( dest, oldData ),
|
5994 |
-
events = oldData.events;
|
5995 |
-
|
5996 |
-
if ( events ) {
|
5997 |
-
delete curData.handle;
|
5998 |
-
curData.events = {};
|
5999 |
-
|
6000 |
-
for ( type in events ) {
|
6001 |
-
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
6002 |
-
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
|
6003 |
-
}
|
6004 |
-
}
|
6005 |
-
}
|
6006 |
-
|
6007 |
-
// make the cloned public data object a copy from the original
|
6008 |
-
if ( curData.data ) {
|
6009 |
-
curData.data = jQuery.extend( {}, curData.data );
|
6010 |
-
}
|
6011 |
-
}
|
6012 |
-
|
6013 |
-
function cloneFixAttributes( src, dest ) {
|
6014 |
-
var nodeName;
|
6015 |
-
|
6016 |
-
// We do not need to do anything for non-Elements
|
6017 |
-
if ( dest.nodeType !== 1 ) {
|
6018 |
-
return;
|
6019 |
-
}
|
6020 |
-
|
6021 |
-
// clearAttributes removes the attributes, which we don't want,
|
6022 |
-
// but also removes the attachEvent events, which we *do* want
|
6023 |
-
if ( dest.clearAttributes ) {
|
6024 |
-
dest.clearAttributes();
|
6025 |
-
}
|
6026 |
-
|
6027 |
-
// mergeAttributes, in contrast, only merges back on the
|
6028 |
-
// original attributes, not the events
|
6029 |
-
if ( dest.mergeAttributes ) {
|
6030 |
-
dest.mergeAttributes( src );
|
6031 |
-
}
|
6032 |
-
|
6033 |
-
nodeName = dest.nodeName.toLowerCase();
|
6034 |
-
|
6035 |
-
// IE6-8 fail to clone children inside object elements that use
|
6036 |
-
// the proprietary classid attribute value (rather than the type
|
6037 |
-
// attribute) to identify the type of content to display
|
6038 |
-
if ( nodeName === "object" ) {
|
6039 |
-
dest.outerHTML = src.outerHTML;
|
6040 |
-
|
6041 |
-
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
|
6042 |
-
// IE6-8 fails to persist the checked state of a cloned checkbox
|
6043 |
-
// or radio button. Worse, IE6-7 fail to give the cloned element
|
6044 |
-
// a checked appearance if the defaultChecked value isn't also set
|
6045 |
-
if ( src.checked ) {
|
6046 |
-
dest.defaultChecked = dest.checked = src.checked;
|
6047 |
-
}
|
6048 |
-
|
6049 |
-
// IE6-7 get confused and end up setting the value of a cloned
|
6050 |
-
// checkbox/radio button to an empty string instead of "on"
|
6051 |
-
if ( dest.value !== src.value ) {
|
6052 |
-
dest.value = src.value;
|
6053 |
-
}
|
6054 |
-
|
6055 |
-
// IE6-8 fails to return the selected option to the default selected
|
6056 |
-
// state when cloning options
|
6057 |
-
} else if ( nodeName === "option" ) {
|
6058 |
-
dest.selected = src.defaultSelected;
|
6059 |
-
|
6060 |
-
// IE6-8 fails to set the defaultValue to the correct value when
|
6061 |
-
// cloning other types of input fields
|
6062 |
-
} else if ( nodeName === "input" || nodeName === "textarea" ) {
|
6063 |
-
dest.defaultValue = src.defaultValue;
|
6064 |
-
}
|
6065 |
-
|
6066 |
-
// Event data gets referenced instead of copied if the expando
|
6067 |
-
// gets copied too
|
6068 |
-
dest.removeAttribute( jQuery.expando );
|
6069 |
-
}
|
6070 |
-
|
6071 |
-
jQuery.buildFragment = function( args, nodes, scripts ) {
|
6072 |
-
var fragment, cacheable, cacheresults, doc,
|
6073 |
-
first = args[ 0 ];
|
6074 |
-
|
6075 |
-
// nodes may contain either an explicit document object,
|
6076 |
-
// a jQuery collection or context object.
|
6077 |
-
// If nodes[0] contains a valid object to assign to doc
|
6078 |
-
if ( nodes && nodes[0] ) {
|
6079 |
-
doc = nodes[0].ownerDocument || nodes[0];
|
6080 |
-
}
|
6081 |
-
|
6082 |
-
// Ensure that an attr object doesn't incorrectly stand in as a document object
|
6083 |
-
// Chrome and Firefox seem to allow this to occur and will throw exception
|
6084 |
-
// Fixes #8950
|
6085 |
-
if ( !doc.createDocumentFragment ) {
|
6086 |
-
doc = document;
|
6087 |
-
}
|
6088 |
-
|
6089 |
-
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
|
6090 |
-
// Cloning options loses the selected state, so don't cache them
|
6091 |
-
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
|
6092 |
-
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
|
6093 |
-
// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
|
6094 |
-
if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
|
6095 |
-
first.charAt(0) === "<" && !rnocache.test( first ) &&
|
6096 |
-
(jQuery.support.checkClone || !rchecked.test( first )) &&
|
6097 |
-
(jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
|
6098 |
-
|
6099 |
-
cacheable = true;
|
6100 |
-
|
6101 |
-
cacheresults = jQuery.fragments[ first ];
|
6102 |
-
if ( cacheresults && cacheresults !== 1 ) {
|
6103 |
-
fragment = cacheresults;
|
6104 |
-
}
|
6105 |
-
}
|
6106 |
-
|
6107 |
-
if ( !fragment ) {
|
6108 |
-
fragment = doc.createDocumentFragment();
|
6109 |
-
jQuery.clean( args, doc, fragment, scripts );
|
6110 |
-
}
|
6111 |
-
|
6112 |
-
if ( cacheable ) {
|
6113 |
-
jQuery.fragments[ first ] = cacheresults ? fragment : 1;
|
6114 |
-
}
|
6115 |
-
|
6116 |
-
return { fragment: fragment, cacheable: cacheable };
|
6117 |
-
};
|
6118 |
-
|
6119 |
-
jQuery.fragments = {};
|
6120 |
-
|
6121 |
-
jQuery.each({
|
6122 |
-
appendTo: "append",
|
6123 |
-
prependTo: "prepend",
|
6124 |
-
insertBefore: "before",
|
6125 |
-
insertAfter: "after",
|
6126 |
-
replaceAll: "replaceWith"
|
6127 |
-
}, function( name, original ) {
|
6128 |
-
jQuery.fn[ name ] = function( selector ) {
|
6129 |
-
var ret = [],
|
6130 |
-
insert = jQuery( selector ),
|
6131 |
-
parent = this.length === 1 && this[0].parentNode;
|
6132 |
-
|
6133 |
-
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
|
6134 |
-
insert[ original ]( this[0] );
|
6135 |
-
return this;
|
6136 |
-
|
6137 |
-
} else {
|
6138 |
-
for ( var i = 0, l = insert.length; i < l; i++ ) {
|
6139 |
-
var elems = ( i > 0 ? this.clone(true) : this ).get();
|
6140 |
-
jQuery( insert[i] )[ original ]( elems );
|
6141 |
-
ret = ret.concat( elems );
|
6142 |
-
}
|
6143 |
-
|
6144 |
-
return this.pushStack( ret, name, insert.selector );
|
6145 |
-
}
|
6146 |
-
};
|
6147 |
-
});
|
6148 |
-
|
6149 |
-
function getAll( elem ) {
|
6150 |
-
if ( typeof elem.getElementsByTagName !== "undefined" ) {
|
6151 |
-
return elem.getElementsByTagName( "*" );
|
6152 |
-
|
6153 |
-
} else if ( typeof elem.querySelectorAll !== "undefined" ) {
|
6154 |
-
return elem.querySelectorAll( "*" );
|
6155 |
-
|
6156 |
-
} else {
|
6157 |
-
return [];
|
6158 |
-
}
|
6159 |
-
}
|
6160 |
-
|
6161 |
-
// Used in clean, fixes the defaultChecked property
|
6162 |
-
function fixDefaultChecked( elem ) {
|
6163 |
-
if ( elem.type === "checkbox" || elem.type === "radio" ) {
|
6164 |
-
elem.defaultChecked = elem.checked;
|
6165 |
-
}
|
6166 |
-
}
|
6167 |
-
// Finds all inputs and passes them to fixDefaultChecked
|
6168 |
-
function findInputs( elem ) {
|
6169 |
-
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
6170 |
-
if ( nodeName === "input" ) {
|
6171 |
-
fixDefaultChecked( elem );
|
6172 |
-
// Skip scripts, get other children
|
6173 |
-
} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
|
6174 |
-
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
|
6175 |
-
}
|
6176 |
-
}
|
6177 |
-
|
6178 |
-
// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
|
6179 |
-
function shimCloneNode( elem ) {
|
6180 |
-
var div = document.createElement( "div" );
|
6181 |
-
safeFragment.appendChild( div );
|
6182 |
-
|
6183 |
-
div.innerHTML = elem.outerHTML;
|
6184 |
-
return div.firstChild;
|
6185 |
-
}
|
6186 |
-
|
6187 |
-
jQuery.extend({
|
6188 |
-
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
6189 |
-
var srcElements,
|
6190 |
-
destElements,
|
6191 |
-
i,
|
6192 |
-
// IE<=8 does not properly clone detached, unknown element nodes
|
6193 |
-
clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ?
|
6194 |
-
elem.cloneNode( true ) :
|
6195 |
-
shimCloneNode( elem );
|
6196 |
-
|
6197 |
-
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
|
6198 |
-
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
6199 |
-
// IE copies events bound via attachEvent when using cloneNode.
|
6200 |
-
// Calling detachEvent on the clone will also remove the events
|
6201 |
-
// from the original. In order to get around this, we use some
|
6202 |
-
// proprietary methods to clear the events. Thanks to MooTools
|
6203 |
-
// guys for this hotness.
|
6204 |
-
|
6205 |
-
cloneFixAttributes( elem, clone );
|
6206 |
-
|
6207 |
-
// Using Sizzle here is crazy slow, so we use getElementsByTagName instead
|
6208 |
-
srcElements = getAll( elem );
|
6209 |
-
destElements = getAll( clone );
|
6210 |
-
|
6211 |
-
// Weird iteration because IE will replace the length property
|
6212 |
-
// with an element if you are cloning the body and one of the
|
6213 |
-
// elements on the page has a name or id of "length"
|
6214 |
-
for ( i = 0; srcElements[i]; ++i ) {
|
6215 |
-
// Ensure that the destination node is not null; Fixes #9587
|
6216 |
-
if ( destElements[i] ) {
|
6217 |
-
cloneFixAttributes( srcElements[i], destElements[i] );
|
6218 |
-
}
|
6219 |
-
}
|
6220 |
-
}
|
6221 |
-
|
6222 |
-
// Copy the events from the original to the clone
|
6223 |
-
if ( dataAndEvents ) {
|
6224 |
-
cloneCopyEvent( elem, clone );
|
6225 |
-
|
6226 |
-
if ( deepDataAndEvents ) {
|
6227 |
-
srcElements = getAll( elem );
|
6228 |
-
destElements = getAll( clone );
|
6229 |
-
|
6230 |
-
for ( i = 0; srcElements[i]; ++i ) {
|
6231 |
-
cloneCopyEvent( srcElements[i], destElements[i] );
|
6232 |
-
}
|
6233 |
-
}
|
6234 |
-
}
|
6235 |
-
|
6236 |
-
srcElements = destElements = null;
|
6237 |
-
|
6238 |
-
// Return the cloned set
|
6239 |
-
return clone;
|
6240 |
-
},
|
6241 |
-
|
6242 |
-
clean: function( elems, context, fragment, scripts ) {
|
6243 |
-
var checkScriptType;
|
6244 |
-
|
6245 |
-
context = context || document;
|
6246 |
-
|
6247 |
-
// !context.createElement fails in IE with an error but returns typeof 'object'
|
6248 |
-
if ( typeof context.createElement === "undefined" ) {
|
6249 |
-
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
|
6250 |
-
}
|
6251 |
-
|
6252 |
-
var ret = [], j;
|
6253 |
-
|
6254 |
-
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
6255 |
-
if ( typeof elem === "number" ) {
|
6256 |
-
elem += "";
|
6257 |
-
}
|
6258 |
-
|
6259 |
-
if ( !elem ) {
|
6260 |
-
continue;
|
6261 |
-
}
|
6262 |
-
|
6263 |
-
// Convert html string into DOM nodes
|
6264 |
-
if ( typeof elem === "string" ) {
|
6265 |
-
if ( !rhtml.test( elem ) ) {
|
6266 |
-
elem = context.createTextNode( elem );
|
6267 |
-
} else {
|
6268 |
-
// Fix "XHTML"-style tags in all browsers
|
6269 |
-
elem = elem.replace(rxhtmlTag, "<$1></$2>");
|
6270 |
-
|
6271 |
-
// Trim whitespace, otherwise indexOf won't work as expected
|
6272 |
-
var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
|
6273 |
-
wrap = wrapMap[ tag ] || wrapMap._default,
|
6274 |
-
depth = wrap[0],
|
6275 |
-
div = context.createElement("div");
|
6276 |
-
|
6277 |
-
// Append wrapper element to unknown element safe doc fragment
|
6278 |
-
if ( context === document ) {
|
6279 |
-
// Use the fragment we've already created for this document
|
6280 |
-
safeFragment.appendChild( div );
|
6281 |
-
} else {
|
6282 |
-
// Use a fragment created with the owner document
|
6283 |
-
createSafeFragment( context ).appendChild( div );
|
6284 |
-
}
|
6285 |
-
|
6286 |
-
// Go to html and back, then peel off extra wrappers
|
6287 |
-
div.innerHTML = wrap[1] + elem + wrap[2];
|
6288 |
-
|
6289 |
-
// Move to the right depth
|
6290 |
-
while ( depth-- ) {
|
6291 |
-
div = div.lastChild;
|
6292 |
-
}
|
6293 |
-
|
6294 |
-
// Remove IE's autoinserted <tbody> from table fragments
|
6295 |
-
if ( !jQuery.support.tbody ) {
|
6296 |
-
|
6297 |
-
// String was a <table>, *may* have spurious <tbody>
|
6298 |
-
var hasBody = rtbody.test(elem),
|
6299 |
-
tbody = tag === "table" && !hasBody ?
|
6300 |
-
div.firstChild && div.firstChild.childNodes :
|
6301 |
-
|
6302 |
-
// String was a bare <thead> or <tfoot>
|
6303 |
-
wrap[1] === "<table>" && !hasBody ?
|
6304 |
-
div.childNodes :
|
6305 |
-
[];
|
6306 |
-
|
6307 |
-
for ( j = tbody.length - 1; j >= 0 ; --j ) {
|
6308 |
-
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
|
6309 |
-
tbody[ j ].parentNode.removeChild( tbody[ j ] );
|
6310 |
-
}
|
6311 |
-
}
|
6312 |
-
}
|
6313 |
-
|
6314 |
-
// IE completely kills leading whitespace when innerHTML is used
|
6315 |
-
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
|
6316 |
-
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
|
6317 |
-
}
|
6318 |
-
|
6319 |
-
elem = div.childNodes;
|
6320 |
-
}
|
6321 |
-
}
|
6322 |
-
|
6323 |
-
// Resets defaultChecked for any radios and checkboxes
|
6324 |
-
// about to be appended to the DOM in IE 6/7 (#8060)
|
6325 |
-
var len;
|
6326 |
-
if ( !jQuery.support.appendChecked ) {
|
6327 |
-
if ( elem[0] && typeof (len = elem.length) === "number" ) {
|
6328 |
-
for ( j = 0; j < len; j++ ) {
|
6329 |
-
findInputs( elem[j] );
|
6330 |
-
}
|
6331 |
-
} else {
|
6332 |
-
findInputs( elem );
|
6333 |
-
}
|
6334 |
-
}
|
6335 |
-
|
6336 |
-
if ( elem.nodeType ) {
|
6337 |
-
ret.push( elem );
|
6338 |
-
} else {
|
6339 |
-
ret = jQuery.merge( ret, elem );
|
6340 |
-
}
|
6341 |
-
}
|
6342 |
-
|
6343 |
-
if ( fragment ) {
|
6344 |
-
checkScriptType = function( elem ) {
|
6345 |
-
return !elem.type || rscriptType.test( elem.type );
|
6346 |
-
};
|
6347 |
-
for ( i = 0; ret[i]; i++ ) {
|
6348 |
-
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
|
6349 |
-
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
|
6350 |
-
|
6351 |
-
} else {
|
6352 |
-
if ( ret[i].nodeType === 1 ) {
|
6353 |
-
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
|
6354 |
-
|
6355 |
-
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
|
6356 |
-
}
|
6357 |
-
fragment.appendChild( ret[i] );
|
6358 |
-
}
|
6359 |
-
}
|
6360 |
-
}
|
6361 |
-
|
6362 |
-
return ret;
|
6363 |
-
},
|
6364 |
-
|
6365 |
-
cleanData: function( elems ) {
|
6366 |
-
var data, id,
|
6367 |
-
cache = jQuery.cache,
|
6368 |
-
special = jQuery.event.special,
|
6369 |
-
deleteExpando = jQuery.support.deleteExpando;
|
6370 |
-
|
6371 |
-
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
6372 |
-
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
|
6373 |
-
continue;
|
6374 |
-
}
|
6375 |
-
|
6376 |
-
id = elem[ jQuery.expando ];
|
6377 |
-
|
6378 |
-
if ( id ) {
|
6379 |
-
data = cache[ id ];
|
6380 |
-
|
6381 |
-
if ( data && data.events ) {
|
6382 |
-
for ( var type in data.events ) {
|
6383 |
-
if ( special[ type ] ) {
|
6384 |
-
jQuery.event.remove( elem, type );
|
6385 |
-
|
6386 |
-
// This is a shortcut to avoid jQuery.event.remove's overhead
|
6387 |
-
} else {
|
6388 |
-
jQuery.removeEvent( elem, type, data.handle );
|
6389 |
-
}
|
6390 |
-
}
|
6391 |
-
|
6392 |
-
// Null the DOM reference to avoid IE6/7/8 leak (#7054)
|
6393 |
-
if ( data.handle ) {
|
6394 |
-
data.handle.elem = null;
|
6395 |
-
}
|
6396 |
-
}
|
6397 |
-
|
6398 |
-
if ( deleteExpando ) {
|
6399 |
-
delete elem[ jQuery.expando ];
|
6400 |
-
|
6401 |
-
} else if ( elem.removeAttribute ) {
|
6402 |
-
elem.removeAttribute( jQuery.expando );
|
6403 |
-
}
|
6404 |
-
|
6405 |
-
delete cache[ id ];
|
6406 |
-
}
|
6407 |
-
}
|
6408 |
-
}
|
6409 |
-
});
|
6410 |
-
|
6411 |
-
function evalScript( i, elem ) {
|
6412 |
-
if ( elem.src ) {
|
6413 |
-
jQuery.ajax({
|
6414 |
-
url: elem.src,
|
6415 |
-
async: false,
|
6416 |
-
dataType: "script"
|
6417 |
-
});
|
6418 |
-
} else {
|
6419 |
-
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
|
6420 |
-
}
|
6421 |
-
|
6422 |
-
if ( elem.parentNode ) {
|
6423 |
-
elem.parentNode.removeChild( elem );
|
6424 |
-
}
|
6425 |
-
}
|
6426 |
-
|
6427 |
-
|
6428 |
-
|
6429 |
-
|
6430 |
-
var ralpha = /alpha\([^)]*\)/i,
|
6431 |
-
ropacity = /opacity=([^)]*)/,
|
6432 |
-
// fixed for IE9, see #8346
|
6433 |
-
rupper = /([A-Z]|^ms)/g,
|
6434 |
-
rnumpx = /^-?\d+(?:px)?$/i,
|
6435 |
-
rnum = /^-?\d/,
|
6436 |
-
rrelNum = /^([\-+])=([\-+.\de]+)/,
|
6437 |
-
|
6438 |
-
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
6439 |
-
cssWidth = [ "Left", "Right" ],
|
6440 |
-
cssHeight = [ "Top", "Bottom" ],
|
6441 |
-
curCSS,
|
6442 |
-
|
6443 |
-
getComputedStyle,
|
6444 |
-
currentStyle;
|
6445 |
-
|
6446 |
-
jQuery.fn.css = function( name, value ) {
|
6447 |
-
// Setting 'undefined' is a no-op
|
6448 |
-
if ( arguments.length === 2 && value === undefined ) {
|
6449 |
-
return this;
|
6450 |
-
}
|
6451 |
-
|
6452 |
-
return jQuery.access( this, name, value, true, function( elem, name, value ) {
|
6453 |
-
return value !== undefined ?
|
6454 |
-
jQuery.style( elem, name, value ) :
|
6455 |
-
jQuery.css( elem, name );
|
6456 |
-
});
|
6457 |
-
};
|
6458 |
-
|
6459 |
-
jQuery.extend({
|
6460 |
-
// Add in style property hooks for overriding the default
|
6461 |
-
// behavior of getting and setting a style property
|
6462 |
-
cssHooks: {
|
6463 |
-
opacity: {
|
6464 |
-
get: function( elem, computed ) {
|
6465 |
-
if ( computed ) {
|
6466 |
-
// We should always get a number back from opacity
|
6467 |
-
var ret = curCSS( elem, "opacity", "opacity" );
|
6468 |
-
return ret === "" ? "1" : ret;
|
6469 |
-
|
6470 |
-
} else {
|
6471 |
-
return elem.style.opacity;
|
6472 |
-
}
|
6473 |
-
}
|
6474 |
-
}
|
6475 |
-
},
|
6476 |
-
|
6477 |
-
// Exclude the following css properties to add px
|
6478 |
-
cssNumber: {
|
6479 |
-
"fillOpacity": true,
|
6480 |
-
"fontWeight": true,
|
6481 |
-
"lineHeight": true,
|
6482 |
-
"opacity": true,
|
6483 |
-
"orphans": true,
|
6484 |
-
"widows": true,
|
6485 |
-
"zIndex": true,
|
6486 |
-
"zoom": true
|
6487 |
-
},
|
6488 |
-
|
6489 |
-
// Add in properties whose names you wish to fix before
|
6490 |
-
// setting or getting the value
|
6491 |
-
cssProps: {
|
6492 |
-
// normalize float css property
|
6493 |
-
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
|
6494 |
-
},
|
6495 |
-
|
6496 |
-
// Get and set the style property on a DOM Node
|
6497 |
-
style: function( elem, name, value, extra ) {
|
6498 |
-
// Don't set styles on text and comment nodes
|
6499 |
-
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
|
6500 |
-
return;
|
6501 |
-
}
|
6502 |
-
|
6503 |
-
// Make sure that we're working with the right name
|
6504 |
-
var ret, type, origName = jQuery.camelCase( name ),
|
6505 |
-
style = elem.style, hooks = jQuery.cssHooks[ origName ];
|
6506 |
-
|
6507 |
-
name = jQuery.cssProps[ origName ] || origName;
|
6508 |
-
|
6509 |
-
// Check if we're setting a value
|
6510 |
-
if ( value !== undefined ) {
|
6511 |
-
type = typeof value;
|
6512 |
-
|
6513 |
-
// convert relative number strings (+= or -=) to relative numbers. #7345
|
6514 |
-
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
|
6515 |
-
value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
|
6516 |
-
// Fixes bug #9237
|
6517 |
-
type = "number";
|
6518 |
-
}
|
6519 |
-
|
6520 |
-
// Make sure that NaN and null values aren't set. See: #7116
|
6521 |
-
if ( value == null || type === "number" && isNaN( value ) ) {
|
6522 |
-
return;
|
6523 |
-
}
|
6524 |
-
|
6525 |
-
// If a number was passed in, add 'px' to the (except for certain CSS properties)
|
6526 |
-
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
|
6527 |
-
value += "px";
|
6528 |
-
}
|
6529 |
-
|
6530 |
-
// If a hook was provided, use that value, otherwise just set the specified value
|
6531 |
-
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
|
6532 |
-
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
|
6533 |
-
// Fixes bug #5509
|
6534 |
-
try {
|
6535 |
-
style[ name ] = value;
|
6536 |
-
} catch(e) {}
|
6537 |
-
}
|
6538 |
-
|
6539 |
-
} else {
|
6540 |
-
// If a hook was provided get the non-computed value from there
|
6541 |
-
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
|
6542 |
-
return ret;
|
6543 |
-
}
|
6544 |
-
|
6545 |
-
// Otherwise just get the value from the style object
|
6546 |
-
return style[ name ];
|
6547 |
-
}
|
6548 |
-
},
|
6549 |
-
|
6550 |
-
css: function( elem, name, extra ) {
|
6551 |
-
var ret, hooks;
|
6552 |
-
|
6553 |
-
// Make sure that we're working with the right name
|
6554 |
-
name = jQuery.camelCase( name );
|
6555 |
-
hooks = jQuery.cssHooks[ name ];
|
6556 |
-
name = jQuery.cssProps[ name ] || name;
|
6557 |
-
|
6558 |
-
// cssFloat needs a special treatment
|
6559 |
-
if ( name === "cssFloat" ) {
|
6560 |
-
name = "float";
|
6561 |
-
}
|
6562 |
-
|
6563 |
-
// If a hook was provided get the computed value from there
|
6564 |
-
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
|
6565 |
-
return ret;
|
6566 |
-
|
6567 |
-
// Otherwise, if a way to get the computed value exists, use that
|
6568 |
-
} else if ( curCSS ) {
|
6569 |
-
return curCSS( elem, name );
|
6570 |
-
}
|
6571 |
-
},
|
6572 |
-
|
6573 |
-
// A method for quickly swapping in/out CSS properties to get correct calculations
|
6574 |
-
swap: function( elem, options, callback ) {
|
6575 |
-
var old = {};
|
6576 |
-
|
6577 |
-
// Remember the old values, and insert the new ones
|
6578 |
-
for ( var name in options ) {
|
6579 |
-
old[ name ] = elem.style[ name ];
|
6580 |
-
elem.style[ name ] = options[ name ];
|
6581 |
-
}
|
6582 |
-
|
6583 |
-
callback.call( elem );
|
6584 |
-
|
6585 |
-
// Revert the old values
|
6586 |
-
for ( name in options ) {
|
6587 |
-
elem.style[ name ] = old[ name ];
|
6588 |
-
}
|
6589 |
-
}
|
6590 |
-
});
|
6591 |
-
|
6592 |
-
// DEPRECATED, Use jQuery.css() instead
|
6593 |
-
jQuery.curCSS = jQuery.css;
|
6594 |
-
|
6595 |
-
jQuery.each(["height", "width"], function( i, name ) {
|
6596 |
-
jQuery.cssHooks[ name ] = {
|
6597 |
-
get: function( elem, computed, extra ) {
|
6598 |
-
var val;
|
6599 |
-
|
6600 |
-
if ( computed ) {
|
6601 |
-
if ( elem.offsetWidth !== 0 ) {
|
6602 |
-
return getWH( elem, name, extra );
|
6603 |
-
} else {
|
6604 |
-
jQuery.swap( elem, cssShow, function() {
|
6605 |
-
val = getWH( elem, name, extra );
|
6606 |
-
});
|
6607 |
-
}
|
6608 |
-
|
6609 |
-
return val;
|
6610 |
-
}
|
6611 |
-
},
|
6612 |
-
|
6613 |
-
set: function( elem, value ) {
|
6614 |
-
if ( rnumpx.test( value ) ) {
|
6615 |
-
// ignore negative width and height values #1599
|
6616 |
-
value = parseFloat( value );
|
6617 |
-
|
6618 |
-
if ( value >= 0 ) {
|
6619 |
-
return value + "px";
|
6620 |
-
}
|
6621 |
-
|
6622 |
-
} else {
|
6623 |
-
return value;
|
6624 |
-
}
|
6625 |
-
}
|
6626 |
-
};
|
6627 |
-
});
|
6628 |
-
|
6629 |
-
if ( !jQuery.support.opacity ) {
|
6630 |
-
jQuery.cssHooks.opacity = {
|
6631 |
-
get: function( elem, computed ) {
|
6632 |
-
// IE uses filters for opacity
|
6633 |
-
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
|
6634 |
-
( parseFloat( RegExp.$1 ) / 100 ) + "" :
|
6635 |
-
computed ? "1" : "";
|
6636 |
-
},
|
6637 |
-
|
6638 |
-
set: function( elem, value ) {
|
6639 |
-
var style = elem.style,
|
6640 |
-
currentStyle = elem.currentStyle,
|
6641 |
-
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
|
6642 |
-
filter = currentStyle && currentStyle.filter || style.filter || "";
|
6643 |
-
|
6644 |
-
// IE has trouble with opacity if it does not have layout
|
6645 |
-
// Force it by setting the zoom level
|
6646 |
-
style.zoom = 1;
|
6647 |
-
|
6648 |
-
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
|
6649 |
-
if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
|
6650 |
-
|
6651 |
-
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
|
6652 |
-
// if "filter:" is present at all, clearType is disabled, we want to avoid this
|
6653 |
-
// style.removeAttribute is IE Only, but so apparently is this code path...
|
6654 |
-
style.removeAttribute( "filter" );
|
6655 |
-
|
6656 |
-
// if there there is no filter style applied in a css rule, we are done
|
6657 |
-
if ( currentStyle && !currentStyle.filter ) {
|
6658 |
-
return;
|
6659 |
-
}
|
6660 |
-
}
|
6661 |
-
|
6662 |
-
// otherwise, set new filter values
|
6663 |
-
style.filter = ralpha.test( filter ) ?
|
6664 |
-
filter.replace( ralpha, opacity ) :
|
6665 |
-
filter + " " + opacity;
|
6666 |
-
}
|
6667 |
-
};
|
6668 |
-
}
|
6669 |
-
|
6670 |
-
jQuery(function() {
|
6671 |
-
// This hook cannot be added until DOM ready because the support test
|
6672 |
-
// for it is not run until after DOM ready
|
6673 |
-
if ( !jQuery.support.reliableMarginRight ) {
|
6674 |
-
jQuery.cssHooks.marginRight = {
|
6675 |
-
get: function( elem, computed ) {
|
6676 |
-
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
6677 |
-
// Work around by temporarily setting element display to inline-block
|
6678 |
-
var ret;
|
6679 |
-
jQuery.swap( elem, { "display": "inline-block" }, function() {
|
6680 |
-
if ( computed ) {
|
6681 |
-
ret = curCSS( elem, "margin-right", "marginRight" );
|
6682 |
-
} else {
|
6683 |
-
ret = elem.style.marginRight;
|
6684 |
-
}
|
6685 |
-
});
|
6686 |
-
return ret;
|
6687 |
-
}
|
6688 |
-
};
|
6689 |
-
}
|
6690 |
-
});
|
6691 |
-
|
6692 |
-
if ( document.defaultView && document.defaultView.getComputedStyle ) {
|
6693 |
-
getComputedStyle = function( elem, name ) {
|
6694 |
-
var ret, defaultView, computedStyle;
|
6695 |
-
|
6696 |
-
name = name.replace( rupper, "-$1" ).toLowerCase();
|
6697 |
-
|
6698 |
-
if ( (defaultView = elem.ownerDocument.defaultView) &&
|
6699 |
-
(computedStyle = defaultView.getComputedStyle( elem, null )) ) {
|
6700 |
-
ret = computedStyle.getPropertyValue( name );
|
6701 |
-
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
|
6702 |
-
ret = jQuery.style( elem, name );
|
6703 |
-
}
|
6704 |
-
}
|
6705 |
-
|
6706 |
-
return ret;
|
6707 |
-
};
|
6708 |
-
}
|
6709 |
-
|
6710 |
-
if ( document.documentElement.currentStyle ) {
|
6711 |
-
currentStyle = function( elem, name ) {
|
6712 |
-
var left, rsLeft, uncomputed,
|
6713 |
-
ret = elem.currentStyle && elem.currentStyle[ name ],
|
6714 |
-
style = elem.style;
|
6715 |
-
|
6716 |
-
// Avoid setting ret to empty string here
|
6717 |
-
// so we don't default to auto
|
6718 |
-
if ( ret === null && style && (uncomputed = style[ name ]) ) {
|
6719 |
-
ret = uncomputed;
|
6720 |
-
}
|
6721 |
-
|
6722 |
-
// From the awesome hack by Dean Edwards
|
6723 |
-
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
|
6724 |
-
|
6725 |
-
// If we're not dealing with a regular pixel number
|
6726 |
-
// but a number that has a weird ending, we need to convert it to pixels
|
6727 |
-
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
|
6728 |
-
|
6729 |
-
// Remember the original values
|
6730 |
-
left = style.left;
|
6731 |
-
rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
|
6732 |
-
|
6733 |
-
// Put in the new values to get a computed value out
|
6734 |
-
if ( rsLeft ) {
|
6735 |
-
elem.runtimeStyle.left = elem.currentStyle.left;
|
6736 |
-
}
|
6737 |
-
style.left = name === "fontSize" ? "1em" : ( ret || 0 );
|
6738 |
-
ret = style.pixelLeft + "px";
|
6739 |
-
|
6740 |
-
// Revert the changed values
|
6741 |
-
style.left = left;
|
6742 |
-
if ( rsLeft ) {
|
6743 |
-
elem.runtimeStyle.left = rsLeft;
|
6744 |
-
}
|
6745 |
-
}
|
6746 |
-
|
6747 |
-
return ret === "" ? "auto" : ret;
|
6748 |
-
};
|
6749 |
-
}
|
6750 |
-
|
6751 |
-
curCSS = getComputedStyle || currentStyle;
|
6752 |
-
|
6753 |
-
function getWH( elem, name, extra ) {
|
6754 |
-
|
6755 |
-
// Start with offset property
|
6756 |
-
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
6757 |
-
which = name === "width" ? cssWidth : cssHeight,
|
6758 |
-
i = 0,
|
6759 |
-
len = which.length;
|
6760 |
-
|
6761 |
-
if ( val > 0 ) {
|
6762 |
-
if ( extra !== "border" ) {
|
6763 |
-
for ( ; i < len; i++ ) {
|
6764 |
-
if ( !extra ) {
|
6765 |
-
val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
|
6766 |
-
}
|
6767 |
-
if ( extra === "margin" ) {
|
6768 |
-
val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
|
6769 |
-
} else {
|
6770 |
-
val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
|
6771 |
-
}
|
6772 |
-
}
|
6773 |
-
}
|
6774 |
-
|
6775 |
-
return val + "px";
|
6776 |
-
}
|
6777 |
-
|
6778 |
-
// Fall back to computed then uncomputed css if necessary
|
6779 |
-
val = curCSS( elem, name, name );
|
6780 |
-
if ( val < 0 || val == null ) {
|
6781 |
-
val = elem.style[ name ] || 0;
|
6782 |
-
}
|
6783 |
-
// Normalize "", auto, and prepare for extra
|
6784 |
-
val = parseFloat( val ) || 0;
|
6785 |
-
|
6786 |
-
// Add padding, border, margin
|
6787 |
-
if ( extra ) {
|
6788 |
-
for ( ; i < len; i++ ) {
|
6789 |
-
val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
|
6790 |
-
if ( extra !== "padding" ) {
|
6791 |
-
val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
|
6792 |
-
}
|
6793 |
-
if ( extra === "margin" ) {
|
6794 |
-
val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
|
6795 |
-
}
|
6796 |
-
}
|
6797 |
-
}
|
6798 |
-
|
6799 |
-
return val + "px";
|
6800 |
-
}
|
6801 |
-
|
6802 |
-
if ( jQuery.expr && jQuery.expr.filters ) {
|
6803 |
-
jQuery.expr.filters.hidden = function( elem ) {
|
6804 |
-
var width = elem.offsetWidth,
|
6805 |
-
height = elem.offsetHeight;
|
6806 |
-
|
6807 |
-
return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
6808 |
-
};
|
6809 |
-
|
6810 |
-
jQuery.expr.filters.visible = function( elem ) {
|
6811 |
-
return !jQuery.expr.filters.hidden( elem );
|
6812 |
-
};
|
6813 |
-
}
|
6814 |
-
|
6815 |
-
|
6816 |
-
|
6817 |
-
|
6818 |
-
var r20 = /%20/g,
|
6819 |
-
rbracket = /\[\]$/,
|
6820 |
-
rCRLF = /\r?\n/g,
|
6821 |
-
rhash = /#.*$/,
|
6822 |
-
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
6823 |
-
rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
|
6824 |
-
// #7653, #8125, #8152: local protocol detection
|
6825 |
-
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
|
6826 |
-
rnoContent = /^(?:GET|HEAD)$/,
|
6827 |
-
rprotocol = /^\/\//,
|
6828 |
-
rquery = /\?/,
|
6829 |
-
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
6830 |
-
rselectTextarea = /^(?:select|textarea)/i,
|
6831 |
-
rspacesAjax = /\s+/,
|
6832 |
-
rts = /([?&])_=[^&]*/,
|
6833 |
-
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
|
6834 |
-
|
6835 |
-
// Keep a copy of the old load method
|
6836 |
-
_load = jQuery.fn.load,
|
6837 |
-
|
6838 |
-
/* Prefilters
|
6839 |
-
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
|
6840 |
-
* 2) These are called:
|
6841 |
-
* - BEFORE asking for a transport
|
6842 |
-
* - AFTER param serialization (s.data is a string if s.processData is true)
|
6843 |
-
* 3) key is the dataType
|
6844 |
-
* 4) the catchall symbol "*" can be used
|
6845 |
-
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
|
6846 |
-
*/
|
6847 |
-
prefilters = {},
|
6848 |
-
|
6849 |
-
/* Transports bindings
|
6850 |
-
* 1) key is the dataType
|
6851 |
-
* 2) the catchall symbol "*" can be used
|
6852 |
-
* 3) selection will start with transport dataType and THEN go to "*" if needed
|
6853 |
-
*/
|
6854 |
-
transports = {},
|
6855 |
-
|
6856 |
-
// Document location
|
6857 |
-
ajaxLocation,
|
6858 |
-
|
6859 |
-
// Document location segments
|
6860 |
-
ajaxLocParts,
|
6861 |
-
|
6862 |
-
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
6863 |
-
allTypes = ["*/"] + ["*"];
|
6864 |
-
|
6865 |
-
// #8138, IE may throw an exception when accessing
|
6866 |
-
// a field from window.location if document.domain has been set
|
6867 |
-
try {
|
6868 |
-
ajaxLocation = location.href;
|
6869 |
-
} catch( e ) {
|
6870 |
-
// Use the href attribute of an A element
|
6871 |
-
// since IE will modify it given document.location
|
6872 |
-
ajaxLocation = document.createElement( "a" );
|
6873 |
-
ajaxLocation.href = "";
|
6874 |
-
ajaxLocation = ajaxLocation.href;
|
6875 |
-
}
|
6876 |
-
|
6877 |
-
// Segment location into parts
|
6878 |
-
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
|
6879 |
-
|
6880 |
-
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
6881 |
-
function addToPrefiltersOrTransports( structure ) {
|
6882 |
-
|
6883 |
-
// dataTypeExpression is optional and defaults to "*"
|
6884 |
-
return function( dataTypeExpression, func ) {
|
6885 |
-
|
6886 |
-
if ( typeof dataTypeExpression !== "string" ) {
|
6887 |
-
func = dataTypeExpression;
|
6888 |
-
dataTypeExpression = "*";
|
6889 |
-
}
|
6890 |
-
|
6891 |
-
if ( jQuery.isFunction( func ) ) {
|
6892 |
-
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
|
6893 |
-
i = 0,
|
6894 |
-
length = dataTypes.length,
|
6895 |
-
dataType,
|
6896 |
-
list,
|
6897 |
-
placeBefore;
|
6898 |
-
|
6899 |
-
// For each dataType in the dataTypeExpression
|
6900 |
-
for ( ; i < length; i++ ) {
|
6901 |
-
dataType = dataTypes[ i ];
|
6902 |
-
// We control if we're asked to add before
|
6903 |
-
// any existing element
|
6904 |
-
placeBefore = /^\+/.test( dataType );
|
6905 |
-
if ( placeBefore ) {
|
6906 |
-
dataType = dataType.substr( 1 ) || "*";
|
6907 |
-
}
|
6908 |
-
list = structure[ dataType ] = structure[ dataType ] || [];
|
6909 |
-
// then we add to the structure accordingly
|
6910 |
-
list[ placeBefore ? "unshift" : "push" ]( func );
|
6911 |
-
}
|
6912 |
-
}
|
6913 |
-
};
|
6914 |
-
}
|
6915 |
-
|
6916 |
-
// Base inspection function for prefilters and transports
|
6917 |
-
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
|
6918 |
-
dataType /* internal */, inspected /* internal */ ) {
|
6919 |
-
|
6920 |
-
dataType = dataType || options.dataTypes[ 0 ];
|
6921 |
-
inspected = inspected || {};
|
6922 |
-
|
6923 |
-
inspected[ dataType ] = true;
|
6924 |
-
|
6925 |
-
var list = structure[ dataType ],
|
6926 |
-
i = 0,
|
6927 |
-
length = list ? list.length : 0,
|
6928 |
-
executeOnly = ( structure === prefilters ),
|
6929 |
-
selection;
|
6930 |
-
|
6931 |
-
for ( ; i < length && ( executeOnly || !selection ); i++ ) {
|
6932 |
-
selection = list[ i ]( options, originalOptions, jqXHR );
|
6933 |
-
// If we got redirected to another dataType
|
6934 |
-
// we try there if executing only and not done already
|
6935 |
-
if ( typeof selection === "string" ) {
|
6936 |
-
if ( !executeOnly || inspected[ selection ] ) {
|
6937 |
-
selection = undefined;
|
6938 |
-
} else {
|
6939 |
-
options.dataTypes.unshift( selection );
|
6940 |
-
selection = inspectPrefiltersOrTransports(
|
6941 |
-
structure, options, originalOptions, jqXHR, selection, inspected );
|
6942 |
-
}
|
6943 |
-
}
|
6944 |
-
}
|
6945 |
-
// If we're only executing or nothing was selected
|
6946 |
-
// we try the catchall dataType if not done already
|
6947 |
-
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
|
6948 |
-
selection = inspectPrefiltersOrTransports(
|
6949 |
-
structure, options, originalOptions, jqXHR, "*", inspected );
|
6950 |
-
}
|
6951 |
-
// unnecessary when only executing (prefilters)
|
6952 |
-
// but it'll be ignored by the caller in that case
|
6953 |
-
return selection;
|
6954 |
-
}
|
6955 |
-
|
6956 |
-
// A special extend for ajax options
|
6957 |
-
// that takes "flat" options (not to be deep extended)
|
6958 |
-
// Fixes #9887
|
6959 |
-
function ajaxExtend( target, src ) {
|
6960 |
-
var key, deep,
|
6961 |
-
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
6962 |
-
for ( key in src ) {
|
6963 |
-
if ( src[ key ] !== undefined ) {
|
6964 |
-
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
|
6965 |
-
}
|
6966 |
-
}
|
6967 |
-
if ( deep ) {
|
6968 |
-
jQuery.extend( true, target, deep );
|
6969 |
-
}
|
6970 |
-
}
|
6971 |
-
|
6972 |
-
jQuery.fn.extend({
|
6973 |
-
load: function( url, params, callback ) {
|
6974 |
-
if ( typeof url !== "string" && _load ) {
|
6975 |
-
return _load.apply( this, arguments );
|
6976 |
-
|
6977 |
-
// Don't do a request if no elements are being requested
|
6978 |
-
} else if ( !this.length ) {
|
6979 |
-
return this;
|
6980 |
-
}
|
6981 |
-
|
6982 |
-
var off = url.indexOf( " " );
|
6983 |
-
if ( off >= 0 ) {
|
6984 |
-
var selector = url.slice( off, url.length );
|
6985 |
-
url = url.slice( 0, off );
|
6986 |
-
}
|
6987 |
-
|
6988 |
-
// Default to a GET request
|
6989 |
-
var type = "GET";
|
6990 |
-
|
6991 |
-
// If the second parameter was provided
|
6992 |
-
if ( params ) {
|
6993 |
-
// If it's a function
|
6994 |
-
if ( jQuery.isFunction( params ) ) {
|
6995 |
-
// We assume that it's the callback
|
6996 |
-
callback = params;
|
6997 |
-
params = undefined;
|
6998 |
-
|
6999 |
-
// Otherwise, build a param string
|
7000 |
-
} else if ( typeof params === "object" ) {
|
7001 |
-
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
|
7002 |
-
type = "POST";
|
7003 |
-
}
|
7004 |
-
}
|
7005 |
-
|
7006 |
-
var self = this;
|
7007 |
-
|
7008 |
-
// Request the remote document
|
7009 |
-
jQuery.ajax({
|
7010 |
-
url: url,
|
7011 |
-
type: type,
|
7012 |
-
dataType: "html",
|
7013 |
-
data: params,
|
7014 |
-
// Complete callback (responseText is used internally)
|
7015 |
-
complete: function( jqXHR, status, responseText ) {
|
7016 |
-
// Store the response as specified by the jqXHR object
|
7017 |
-
responseText = jqXHR.responseText;
|
7018 |
-
// If successful, inject the HTML into all the matched elements
|
7019 |
-
if ( jqXHR.isResolved() ) {
|
7020 |
-
// #4825: Get the actual response in case
|
7021 |
-
// a dataFilter is present in ajaxSettings
|
7022 |
-
jqXHR.done(function( r ) {
|
7023 |
-
responseText = r;
|
7024 |
-
});
|
7025 |
-
// See if a selector was specified
|
7026 |
-
self.html( selector ?
|
7027 |
-
// Create a dummy div to hold the results
|
7028 |
-
jQuery("<div>")
|
7029 |
-
// inject the contents of the document in, removing the scripts
|
7030 |
-
// to avoid any 'Permission Denied' errors in IE
|
7031 |
-
.append(responseText.replace(rscript, ""))
|
7032 |
-
|
7033 |
-
// Locate the specified elements
|
7034 |
-
.find(selector) :
|
7035 |
-
|
7036 |
-
// If not, just inject the full result
|
7037 |
-
responseText );
|
7038 |
-
}
|
7039 |
-
|
7040 |
-
if ( callback ) {
|
7041 |
-
self.each( callback, [ responseText, status, jqXHR ] );
|
7042 |
-
}
|
7043 |
-
}
|
7044 |
-
});
|
7045 |
-
|
7046 |
-
return this;
|
7047 |
-
},
|
7048 |
-
|
7049 |
-
serialize: function() {
|
7050 |
-
return jQuery.param( this.serializeArray() );
|
7051 |
-
},
|
7052 |
-
|
7053 |
-
serializeArray: function() {
|
7054 |
-
return this.map(function(){
|
7055 |
-
return this.elements ? jQuery.makeArray( this.elements ) : this;
|
7056 |
-
})
|
7057 |
-
.filter(function(){
|
7058 |
-
return this.name && !this.disabled &&
|
7059 |
-
( this.checked || rselectTextarea.test( this.nodeName ) ||
|
7060 |
-
rinput.test( this.type ) );
|
7061 |
-
})
|
7062 |
-
.map(function( i, elem ){
|
7063 |
-
var val = jQuery( this ).val();
|
7064 |
-
|
7065 |
-
return val == null ?
|
7066 |
-
null :
|
7067 |
-
jQuery.isArray( val ) ?
|
7068 |
-
jQuery.map( val, function( val, i ){
|
7069 |
-
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
7070 |
-
}) :
|
7071 |
-
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
7072 |
-
}).get();
|
7073 |
-
}
|
7074 |
-
});
|
7075 |
-
|
7076 |
-
// Attach a bunch of functions for handling common AJAX events
|
7077 |
-
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
|
7078 |
-
jQuery.fn[ o ] = function( f ){
|
7079 |
-
return this.on( o, f );
|
7080 |
-
};
|
7081 |
-
});
|
7082 |
-
|
7083 |
-
jQuery.each( [ "get", "post" ], function( i, method ) {
|
7084 |
-
jQuery[ method ] = function( url, data, callback, type ) {
|
7085 |
-
// shift arguments if data argument was omitted
|
7086 |
-
if ( jQuery.isFunction( data ) ) {
|
7087 |
-
type = type || callback;
|
7088 |
-
callback = data;
|
7089 |
-
data = undefined;
|
7090 |
-
}
|
7091 |
-
|
7092 |
-
return jQuery.ajax({
|
7093 |
-
type: method,
|
7094 |
-
url: url,
|
7095 |
-
data: data,
|
7096 |
-
success: callback,
|
7097 |
-
dataType: type
|
7098 |
-
});
|
7099 |
-
};
|
7100 |
-
});
|
7101 |
-
|
7102 |
-
jQuery.extend({
|
7103 |
-
|
7104 |
-
getScript: function( url, callback ) {
|
7105 |
-
return jQuery.get( url, undefined, callback, "script" );
|
7106 |
-
},
|
7107 |
-
|
7108 |
-
getJSON: function( url, data, callback ) {
|
7109 |
-
return jQuery.get( url, data, callback, "json" );
|
7110 |
-
},
|
7111 |
-
|
7112 |
-
// Creates a full fledged settings object into target
|
7113 |
-
// with both ajaxSettings and settings fields.
|
7114 |
-
// If target is omitted, writes into ajaxSettings.
|
7115 |
-
ajaxSetup: function( target, settings ) {
|
7116 |
-
if ( settings ) {
|
7117 |
-
// Building a settings object
|
7118 |
-
ajaxExtend( target, jQuery.ajaxSettings );
|
7119 |
-
} else {
|
7120 |
-
// Extending ajaxSettings
|
7121 |
-
settings = target;
|
7122 |
-
target = jQuery.ajaxSettings;
|
7123 |
-
}
|
7124 |
-
ajaxExtend( target, settings );
|
7125 |
-
return target;
|
7126 |
-
},
|
7127 |
-
|
7128 |
-
ajaxSettings: {
|
7129 |
-
url: ajaxLocation,
|
7130 |
-
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
|
7131 |
-
global: true,
|
7132 |
-
type: "GET",
|
7133 |
-
contentType: "application/x-www-form-urlencoded",
|
7134 |
-
processData: true,
|
7135 |
-
async: true,
|
7136 |
-
/*
|
7137 |
-
timeout: 0,
|
7138 |
-
data: null,
|
7139 |
-
dataType: null,
|
7140 |
-
username: null,
|
7141 |
-
password: null,
|
7142 |
-
cache: null,
|
7143 |
-
traditional: false,
|
7144 |
-
headers: {},
|
7145 |
-
*/
|
7146 |
-
|
7147 |
-
accepts: {
|
7148 |
-
xml: "application/xml, text/xml",
|
7149 |
-
html: "text/html",
|
7150 |
-
text: "text/plain",
|
7151 |
-
json: "application/json, text/javascript",
|
7152 |
-
"*": allTypes
|
7153 |
-
},
|
7154 |
-
|
7155 |
-
contents: {
|
7156 |
-
xml: /xml/,
|
7157 |
-
html: /html/,
|
7158 |
-
json: /json/
|
7159 |
-
},
|
7160 |
-
|
7161 |
-
responseFields: {
|
7162 |
-
xml: "responseXML",
|
7163 |
-
text: "responseText"
|
7164 |
-
},
|
7165 |
-
|
7166 |
-
// List of data converters
|
7167 |
-
// 1) key format is "source_type destination_type" (a single space in-between)
|
7168 |
-
// 2) the catchall symbol "*" can be used for source_type
|
7169 |
-
converters: {
|
7170 |
-
|
7171 |
-
// Convert anything to text
|
7172 |
-
"* text": window.String,
|
7173 |
-
|
7174 |
-
// Text to html (true = no transformation)
|
7175 |
-
"text html": true,
|
7176 |
-
|
7177 |
-
// Evaluate text as a json expression
|
7178 |
-
"text json": jQuery.parseJSON,
|
7179 |
-
|
7180 |
-
// Parse text as xml
|
7181 |
-
"text xml": jQuery.parseXML
|
7182 |
-
},
|
7183 |
-
|
7184 |
-
// For options that shouldn't be deep extended:
|
7185 |
-
// you can add your own custom options here if
|
7186 |
-
// and when you create one that shouldn't be
|
7187 |
-
// deep extended (see ajaxExtend)
|
7188 |
-
flatOptions: {
|
7189 |
-
context: true,
|
7190 |
-
url: true
|
7191 |
-
}
|
7192 |
-
},
|
7193 |
-
|
7194 |
-
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
|
7195 |
-
ajaxTransport: addToPrefiltersOrTransports( transports ),
|
7196 |
-
|
7197 |
-
// Main method
|
7198 |
-
ajax: function( url, options ) {
|
7199 |
-
|
7200 |
-
// If url is an object, simulate pre-1.5 signature
|
7201 |
-
if ( typeof url === "object" ) {
|
7202 |
-
options = url;
|
7203 |
-
url = undefined;
|
7204 |
-
}
|
7205 |
-
|
7206 |
-
// Force options to be an object
|
7207 |
-
options = options || {};
|
7208 |
-
|
7209 |
-
var // Create the final options object
|
7210 |
-
s = jQuery.ajaxSetup( {}, options ),
|
7211 |
-
// Callbacks context
|
7212 |
-
callbackContext = s.context || s,
|
7213 |
-
// Context for global events
|
7214 |
-
// It's the callbackContext if one was provided in the options
|
7215 |
-
// and if it's a DOM node or a jQuery collection
|
7216 |
-
globalEventContext = callbackContext !== s &&
|
7217 |
-
( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
|
7218 |
-
jQuery( callbackContext ) : jQuery.event,
|
7219 |
-
// Deferreds
|
7220 |
-
deferred = jQuery.Deferred(),
|
7221 |
-
completeDeferred = jQuery.Callbacks( "once memory" ),
|
7222 |
-
// Status-dependent callbacks
|
7223 |
-
statusCode = s.statusCode || {},
|
7224 |
-
// ifModified key
|
7225 |
-
ifModifiedKey,
|
7226 |
-
// Headers (they are sent all at once)
|
7227 |
-
requestHeaders = {},
|
7228 |
-
requestHeadersNames = {},
|
7229 |
-
// Response headers
|
7230 |
-
responseHeadersString,
|
7231 |
-
responseHeaders,
|
7232 |
-
// transport
|
7233 |
-
transport,
|
7234 |
-
// timeout handle
|
7235 |
-
timeoutTimer,
|
7236 |
-
// Cross-domain detection vars
|
7237 |
-
parts,
|
7238 |
-
// The jqXHR state
|
7239 |
-
state = 0,
|
7240 |
-
// To know if global events are to be dispatched
|
7241 |
-
fireGlobals,
|
7242 |
-
// Loop variable
|
7243 |
-
i,
|
7244 |
-
// Fake xhr
|
7245 |
-
jqXHR = {
|
7246 |
-
|
7247 |
-
readyState: 0,
|
7248 |
-
|
7249 |
-
// Caches the header
|
7250 |
-
setRequestHeader: function( name, value ) {
|
7251 |
-
if ( !state ) {
|
7252 |
-
var lname = name.toLowerCase();
|
7253 |
-
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
|
7254 |
-
requestHeaders[ name ] = value;
|
7255 |
-
}
|
7256 |
-
return this;
|
7257 |
-
},
|
7258 |
-
|
7259 |
-
// Raw string
|
7260 |
-
getAllResponseHeaders: function() {
|
7261 |
-
return state === 2 ? responseHeadersString : null;
|
7262 |
-
},
|
7263 |
-
|
7264 |
-
// Builds headers hashtable if needed
|
7265 |
-
getResponseHeader: function( key ) {
|
7266 |
-
var match;
|
7267 |
-
if ( state === 2 ) {
|
7268 |
-
if ( !responseHeaders ) {
|
7269 |
-
responseHeaders = {};
|
7270 |
-
while( ( match = rheaders.exec( responseHeadersString ) ) ) {
|
7271 |
-
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
|
7272 |
-
}
|
7273 |
-
}
|
7274 |
-
match = responseHeaders[ key.toLowerCase() ];
|
7275 |
-
}
|
7276 |
-
return match === undefined ? null : match;
|
7277 |
-
},
|
7278 |
-
|
7279 |
-
// Overrides response content-type header
|
7280 |
-
overrideMimeType: function( type ) {
|
7281 |
-
if ( !state ) {
|
7282 |
-
s.mimeType = type;
|
7283 |
-
}
|
7284 |
-
return this;
|
7285 |
-
},
|
7286 |
-
|
7287 |
-
// Cancel the request
|
7288 |
-
abort: function( statusText ) {
|
7289 |
-
statusText = statusText || "abort";
|
7290 |
-
if ( transport ) {
|
7291 |
-
transport.abort( statusText );
|
7292 |
-
}
|
7293 |
-
done( 0, statusText );
|
7294 |
-
return this;
|
7295 |
-
}
|
7296 |
-
};
|
7297 |
-
|
7298 |
-
// Callback for when everything is done
|
7299 |
-
// It is defined here because jslint complains if it is declared
|
7300 |
-
// at the end of the function (which would be more logical and readable)
|
7301 |
-
function done( status, nativeStatusText, responses, headers ) {
|
7302 |
-
|
7303 |
-
// Called once
|
7304 |
-
if ( state === 2 ) {
|
7305 |
-
return;
|
7306 |
-
}
|
7307 |
-
|
7308 |
-
// State is "done" now
|
7309 |
-
state = 2;
|
7310 |
-
|
7311 |
-
// Clear timeout if it exists
|
7312 |
-
if ( timeoutTimer ) {
|
7313 |
-
clearTimeout( timeoutTimer );
|
7314 |
-
}
|
7315 |
-
|
7316 |
-
// Dereference transport for early garbage collection
|
7317 |
-
// (no matter how long the jqXHR object will be used)
|
7318 |
-
transport = undefined;
|
7319 |
-
|
7320 |
-
// Cache response headers
|
7321 |
-
responseHeadersString = headers || "";
|
7322 |
-
|
7323 |
-
// Set readyState
|
7324 |
-
jqXHR.readyState = status > 0 ? 4 : 0;
|
7325 |
-
|
7326 |
-
var isSuccess,
|
7327 |
-
success,
|
7328 |
-
error,
|
7329 |
-
statusText = nativeStatusText,
|
7330 |
-
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
|
7331 |
-
lastModified,
|
7332 |
-
etag;
|
7333 |
-
|
7334 |
-
// If successful, handle type chaining
|
7335 |
-
if ( status >= 200 && status < 300 || status === 304 ) {
|
7336 |
-
|
7337 |
-
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
7338 |
-
if ( s.ifModified ) {
|
7339 |
-
|
7340 |
-
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
|
7341 |
-
jQuery.lastModified[ ifModifiedKey ] = lastModified;
|
7342 |
-
}
|
7343 |
-
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
|
7344 |
-
jQuery.etag[ ifModifiedKey ] = etag;
|
7345 |
-
}
|
7346 |
-
}
|
7347 |
-
|
7348 |
-
// If not modified
|
7349 |
-
if ( status === 304 ) {
|
7350 |
-
|
7351 |
-
statusText = "notmodified";
|
7352 |
-
isSuccess = true;
|
7353 |
-
|
7354 |
-
// If we have data
|
7355 |
-
} else {
|
7356 |
-
|
7357 |
-
try {
|
7358 |
-
success = ajaxConvert( s, response );
|
7359 |
-
statusText = "success";
|
7360 |
-
isSuccess = true;
|
7361 |
-
} catch(e) {
|
7362 |
-
// We have a parsererror
|
7363 |
-
statusText = "parsererror";
|
7364 |
-
error = e;
|
7365 |
-
}
|
7366 |
-
}
|
7367 |
-
} else {
|
7368 |
-
// We extract error from statusText
|
7369 |
-
// then normalize statusText and status for non-aborts
|
7370 |
-
error = statusText;
|
7371 |
-
if ( !statusText || status ) {
|
7372 |
-
statusText = "error";
|
7373 |
-
if ( status < 0 ) {
|
7374 |
-
status = 0;
|
7375 |
-
}
|
7376 |
-
}
|
7377 |
-
}
|
7378 |
-
|
7379 |
-
// Set data for the fake xhr object
|
7380 |
-
jqXHR.status = status;
|
7381 |
-
jqXHR.statusText = "" + ( nativeStatusText || statusText );
|
7382 |
-
|
7383 |
-
// Success/Error
|
7384 |
-
if ( isSuccess ) {
|
7385 |
-
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
|
7386 |
-
} else {
|
7387 |
-
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
|
7388 |
-
}
|
7389 |
-
|
7390 |
-
// Status-dependent callbacks
|
7391 |
-
jqXHR.statusCode( statusCode );
|
7392 |
-
statusCode = undefined;
|
7393 |
-
|
7394 |
-
if ( fireGlobals ) {
|
7395 |
-
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
|
7396 |
-
[ jqXHR, s, isSuccess ? success : error ] );
|
7397 |
-
}
|
7398 |
-
|
7399 |
-
// Complete
|
7400 |
-
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
|
7401 |
-
|
7402 |
-
if ( fireGlobals ) {
|
7403 |
-
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
|
7404 |
-
// Handle the global AJAX counter
|
7405 |
-
if ( !( --jQuery.active ) ) {
|
7406 |
-
jQuery.event.trigger( "ajaxStop" );
|
7407 |
-
}
|
7408 |
-
}
|
7409 |
-
}
|
7410 |
-
|
7411 |
-
// Attach deferreds
|
7412 |
-
deferred.promise( jqXHR );
|
7413 |
-
jqXHR.success = jqXHR.done;
|
7414 |
-
jqXHR.error = jqXHR.fail;
|
7415 |
-
jqXHR.complete = completeDeferred.add;
|
7416 |
-
|
7417 |
-
// Status-dependent callbacks
|
7418 |
-
jqXHR.statusCode = function( map ) {
|
7419 |
-
if ( map ) {
|
7420 |
-
var tmp;
|
7421 |
-
if ( state < 2 ) {
|
7422 |
-
for ( tmp in map ) {
|
7423 |
-
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
|
7424 |
-
}
|
7425 |
-
} else {
|
7426 |
-
tmp = map[ jqXHR.status ];
|
7427 |
-
jqXHR.then( tmp, tmp );
|
7428 |
-
}
|
7429 |
-
}
|
7430 |
-
return this;
|
7431 |
-
};
|
7432 |
-
|
7433 |
-
// Remove hash character (#7531: and string promotion)
|
7434 |
-
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
|
7435 |
-
// We also use the url parameter if available
|
7436 |
-
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
|
7437 |
-
|
7438 |
-
// Extract dataTypes list
|
7439 |
-
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
|
7440 |
-
|
7441 |
-
// Determine if a cross-domain request is in order
|
7442 |
-
if ( s.crossDomain == null ) {
|
7443 |
-
parts = rurl.exec( s.url.toLowerCase() );
|
7444 |
-
s.crossDomain = !!( parts &&
|
7445 |
-
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
|
7446 |
-
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
|
7447 |
-
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
|
7448 |
-
);
|
7449 |
-
}
|
7450 |
-
|
7451 |
-
// Convert data if not already a string
|
7452 |
-
if ( s.data && s.processData && typeof s.data !== "string" ) {
|
7453 |
-
s.data = jQuery.param( s.data, s.traditional );
|
7454 |
-
}
|
7455 |
-
|
7456 |
-
// Apply prefilters
|
7457 |
-
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
|
7458 |
-
|
7459 |
-
// If request was aborted inside a prefiler, stop there
|
7460 |
-
if ( state === 2 ) {
|
7461 |
-
return false;
|
7462 |
-
}
|
7463 |
-
|
7464 |
-
// We can fire global events as of now if asked to
|
7465 |
-
fireGlobals = s.global;
|
7466 |
-
|
7467 |
-
// Uppercase the type
|
7468 |
-
s.type = s.type.toUpperCase();
|
7469 |
-
|
7470 |
-
// Determine if request has content
|
7471 |
-
s.hasContent = !rnoContent.test( s.type );
|
7472 |
-
|
7473 |
-
// Watch for a new set of requests
|
7474 |
-
if ( fireGlobals && jQuery.active++ === 0 ) {
|
7475 |
-
jQuery.event.trigger( "ajaxStart" );
|
7476 |
-
}
|
7477 |
-
|
7478 |
-
// More options handling for requests with no content
|
7479 |
-
if ( !s.hasContent ) {
|
7480 |
-
|
7481 |
-
// If data is available, append data to url
|
7482 |
-
if ( s.data ) {
|
7483 |
-
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
|
7484 |
-
// #9682: remove data so that it's not used in an eventual retry
|
7485 |
-
delete s.data;
|
7486 |
-
}
|
7487 |
-
|
7488 |
-
// Get ifModifiedKey before adding the anti-cache parameter
|
7489 |
-
ifModifiedKey = s.url;
|
7490 |
-
|
7491 |
-
// Add anti-cache in url if needed
|
7492 |
-
if ( s.cache === false ) {
|
7493 |
-
|
7494 |
-
var ts = jQuery.now(),
|
7495 |
-
// try replacing _= if it is there
|
7496 |
-
ret = s.url.replace( rts, "$1_=" + ts );
|
7497 |
-
|
7498 |
-
// if nothing was replaced, add timestamp to the end
|
7499 |
-
s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
|
7500 |
-
}
|
7501 |
-
}
|
7502 |
-
|
7503 |
-
// Set the correct header, if data is being sent
|
7504 |
-
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
7505 |
-
jqXHR.setRequestHeader( "Content-Type", s.contentType );
|
7506 |
-
}
|
7507 |
-
|
7508 |
-
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
7509 |
-
if ( s.ifModified ) {
|
7510 |
-
ifModifiedKey = ifModifiedKey || s.url;
|
7511 |
-
if ( jQuery.lastModified[ ifModifiedKey ] ) {
|
7512 |
-
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
|
7513 |
-
}
|
7514 |
-
if ( jQuery.etag[ ifModifiedKey ] ) {
|
7515 |
-
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
|
7516 |
-
}
|
7517 |
-
}
|
7518 |
-
|
7519 |
-
// Set the Accepts header for the server, depending on the dataType
|
7520 |
-
jqXHR.setRequestHeader(
|
7521 |
-
"Accept",
|
7522 |
-
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
|
7523 |
-
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
|
7524 |
-
s.accepts[ "*" ]
|
7525 |
-
);
|
7526 |
-
|
7527 |
-
// Check for headers option
|
7528 |
-
for ( i in s.headers ) {
|
7529 |
-
jqXHR.setRequestHeader( i, s.headers[ i ] );
|
7530 |
-
}
|
7531 |
-
|
7532 |
-
// Allow custom headers/mimetypes and early abort
|
7533 |
-
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
7534 |
-
// Abort if not done already
|
7535 |
-
jqXHR.abort();
|
7536 |
-
return false;
|
7537 |
-
|
7538 |
-
}
|
7539 |
-
|
7540 |
-
// Install callbacks on deferreds
|
7541 |
-
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
7542 |
-
jqXHR[ i ]( s[ i ] );
|
7543 |
-
}
|
7544 |
-
|
7545 |
-
// Get transport
|
7546 |
-
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
7547 |
-
|
7548 |
-
// If no transport, we auto-abort
|
7549 |
-
if ( !transport ) {
|
7550 |
-
done( -1, "No Transport" );
|
7551 |
-
} else {
|
7552 |
-
jqXHR.readyState = 1;
|
7553 |
-
// Send global event
|
7554 |
-
if ( fireGlobals ) {
|
7555 |
-
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
|
7556 |
-
}
|
7557 |
-
// Timeout
|
7558 |
-
if ( s.async && s.timeout > 0 ) {
|
7559 |
-
timeoutTimer = setTimeout( function(){
|
7560 |
-
jqXHR.abort( "timeout" );
|
7561 |
-
}, s.timeout );
|
7562 |
-
}
|
7563 |
-
|
7564 |
-
try {
|
7565 |
-
state = 1;
|
7566 |
-
transport.send( requestHeaders, done );
|
7567 |
-
} catch (e) {
|
7568 |
-
// Propagate exception as error if not done
|
7569 |
-
if ( state < 2 ) {
|
7570 |
-
done( -1, e );
|
7571 |
-
// Simply rethrow otherwise
|
7572 |
-
} else {
|
7573 |
-
throw e;
|
7574 |
-
}
|
7575 |
-
}
|
7576 |
-
}
|
7577 |
-
|
7578 |
-
return jqXHR;
|
7579 |
-
},
|
7580 |
-
|
7581 |
-
// Serialize an array of form elements or a set of
|
7582 |
-
// key/values into a query string
|
7583 |
-
param: function( a, traditional ) {
|
7584 |
-
var s = [],
|
7585 |
-
add = function( key, value ) {
|
7586 |
-
// If value is a function, invoke it and return its value
|
7587 |
-
value = jQuery.isFunction( value ) ? value() : value;
|
7588 |
-
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
|
7589 |
-
};
|
7590 |
-
|
7591 |
-
// Set traditional to true for jQuery <= 1.3.2 behavior.
|
7592 |
-
if ( traditional === undefined ) {
|
7593 |
-
traditional = jQuery.ajaxSettings.traditional;
|
7594 |
-
}
|
7595 |
-
|
7596 |
-
// If an array was passed in, assume that it is an array of form elements.
|
7597 |
-
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
7598 |
-
// Serialize the form elements
|
7599 |
-
jQuery.each( a, function() {
|
7600 |
-
add( this.name, this.value );
|
7601 |
-
});
|
7602 |
-
|
7603 |
-
} else {
|
7604 |
-
// If traditional, encode the "old" way (the way 1.3.2 or older
|
7605 |
-
// did it), otherwise encode params recursively.
|
7606 |
-
for ( var prefix in a ) {
|
7607 |
-
buildParams( prefix, a[ prefix ], traditional, add );
|
7608 |
-
}
|
7609 |
-
}
|
7610 |
-
|
7611 |
-
// Return the resulting serialization
|
7612 |
-
return s.join( "&" ).replace( r20, "+" );
|
7613 |
-
}
|
7614 |
-
});
|
7615 |
-
|
7616 |
-
function buildParams( prefix, obj, traditional, add ) {
|
7617 |
-
if ( jQuery.isArray( obj ) ) {
|
7618 |
-
// Serialize array item.
|
7619 |
-
jQuery.each( obj, function( i, v ) {
|
7620 |
-
if ( traditional || rbracket.test( prefix ) ) {
|
7621 |
-
// Treat each array item as a scalar.
|
7622 |
-
add( prefix, v );
|
7623 |
-
|
7624 |
-
} else {
|
7625 |
-
// If array item is non-scalar (array or object), encode its
|
7626 |
-
// numeric index to resolve deserialization ambiguity issues.
|
7627 |
-
// Note that rack (as of 1.0.0) can't currently deserialize
|
7628 |
-
// nested arrays properly, and attempting to do so may cause
|
7629 |
-
// a server error. Possible fixes are to modify rack's
|
7630 |
-
// deserialization algorithm or to provide an option or flag
|
7631 |
-
// to force array serialization to be shallow.
|
7632 |
-
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
|
7633 |
-
}
|
7634 |
-
});
|
7635 |
-
|
7636 |
-
} else if ( !traditional && obj != null && typeof obj === "object" ) {
|
7637 |
-
// Serialize object item.
|
7638 |
-
for ( var name in obj ) {
|
7639 |
-
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
|
7640 |
-
}
|
7641 |
-
|
7642 |
-
} else {
|
7643 |
-
// Serialize scalar item.
|
7644 |
-
add( prefix, obj );
|
7645 |
-
}
|
7646 |
-
}
|
7647 |
-
|
7648 |
-
// This is still on the jQuery object... for now
|
7649 |
-
// Want to move this to jQuery.ajax some day
|
7650 |
-
jQuery.extend({
|
7651 |
-
|
7652 |
-
// Counter for holding the number of active queries
|
7653 |
-
active: 0,
|
7654 |
-
|
7655 |
-
// Last-Modified header cache for next request
|
7656 |
-
lastModified: {},
|
7657 |
-
etag: {}
|
7658 |
-
|
7659 |
-
});
|
7660 |
-
|
7661 |
-
/* Handles responses to an ajax request:
|
7662 |
-
* - sets all responseXXX fields accordingly
|
7663 |
-
* - finds the right dataType (mediates between content-type and expected dataType)
|
7664 |
-
* - returns the corresponding response
|
7665 |
-
*/
|
7666 |
-
function ajaxHandleResponses( s, jqXHR, responses ) {
|
7667 |
-
|
7668 |
-
var contents = s.contents,
|
7669 |
-
dataTypes = s.dataTypes,
|
7670 |
-
responseFields = s.responseFields,
|
7671 |
-
ct,
|
7672 |
-
type,
|
7673 |
-
finalDataType,
|
7674 |
-
firstDataType;
|
7675 |
-
|
7676 |
-
// Fill responseXXX fields
|
7677 |
-
for ( type in responseFields ) {
|
7678 |
-
if ( type in responses ) {
|
7679 |
-
jqXHR[ responseFields[type] ] = responses[ type ];
|
7680 |
-
}
|
7681 |
-
}
|
7682 |
-
|
7683 |
-
// Remove auto dataType and get content-type in the process
|
7684 |
-
while( dataTypes[ 0 ] === "*" ) {
|
7685 |
-
dataTypes.shift();
|
7686 |
-
if ( ct === undefined ) {
|
7687 |
-
ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
|
7688 |
-
}
|
7689 |
-
}
|
7690 |
-
|
7691 |
-
// Check if we're dealing with a known content-type
|
7692 |
-
if ( ct ) {
|
7693 |
-
for ( type in contents ) {
|
7694 |
-
if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
7695 |
-
dataTypes.unshift( type );
|
7696 |
-
break;
|
7697 |
-
}
|
7698 |
-
}
|
7699 |
-
}
|
7700 |
-
|
7701 |
-
// Check to see if we have a response for the expected dataType
|
7702 |
-
if ( dataTypes[ 0 ] in responses ) {
|
7703 |
-
finalDataType = dataTypes[ 0 ];
|
7704 |
-
} else {
|
7705 |
-
// Try convertible dataTypes
|
7706 |
-
for ( type in responses ) {
|
7707 |
-
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
|
7708 |
-
finalDataType = type;
|
7709 |
-
break;
|
7710 |
-
}
|
7711 |
-
if ( !firstDataType ) {
|
7712 |
-
firstDataType = type;
|
7713 |
-
}
|
7714 |
-
}
|
7715 |
-
// Or just use first one
|
7716 |
-
finalDataType = finalDataType || firstDataType;
|
7717 |
-
}
|
7718 |
-
|
7719 |
-
// If we found a dataType
|
7720 |
-
// We add the dataType to the list if needed
|
7721 |
-
// and return the corresponding response
|
7722 |
-
if ( finalDataType ) {
|
7723 |
-
if ( finalDataType !== dataTypes[ 0 ] ) {
|
7724 |
-
dataTypes.unshift( finalDataType );
|
7725 |
-
}
|
7726 |
-
return responses[ finalDataType ];
|
7727 |
-
}
|
7728 |
-
}
|
7729 |
-
|
7730 |
-
// Chain conversions given the request and the original response
|
7731 |
-
function ajaxConvert( s, response ) {
|
7732 |
-
|
7733 |
-
// Apply the dataFilter if provided
|
7734 |
-
if ( s.dataFilter ) {
|
7735 |
-
response = s.dataFilter( response, s.dataType );
|
7736 |
-
}
|
7737 |
-
|
7738 |
-
var dataTypes = s.dataTypes,
|
7739 |
-
converters = {},
|
7740 |
-
i,
|
7741 |
-
key,
|
7742 |
-
length = dataTypes.length,
|
7743 |
-
tmp,
|
7744 |
-
// Current and previous dataTypes
|
7745 |
-
current = dataTypes[ 0 ],
|
7746 |
-
prev,
|
7747 |
-
// Conversion expression
|
7748 |
-
conversion,
|
7749 |
-
// Conversion function
|
7750 |
-
conv,
|
7751 |
-
// Conversion functions (transitive conversion)
|
7752 |
-
conv1,
|
7753 |
-
conv2;
|
7754 |
-
|
7755 |
-
// For each dataType in the chain
|
7756 |
-
for ( i = 1; i < length; i++ ) {
|
7757 |
-
|
7758 |
-
// Create converters map
|
7759 |
-
// with lowercased keys
|
7760 |
-
if ( i === 1 ) {
|
7761 |
-
for ( key in s.converters ) {
|
7762 |
-
if ( typeof key === "string" ) {
|
7763 |
-
converters[ key.toLowerCase() ] = s.converters[ key ];
|
7764 |
-
}
|
7765 |
-
}
|
7766 |
-
}
|
7767 |
-
|
7768 |
-
// Get the dataTypes
|
7769 |
-
prev = current;
|
7770 |
-
current = dataTypes[ i ];
|
7771 |
-
|
7772 |
-
// If current is auto dataType, update it to prev
|
7773 |
-
if ( current === "*" ) {
|
7774 |
-
current = prev;
|
7775 |
-
// If no auto and dataTypes are actually different
|
7776 |
-
} else if ( prev !== "*" && prev !== current ) {
|
7777 |
-
|
7778 |
-
// Get the converter
|
7779 |
-
conversion = prev + " " + current;
|
7780 |
-
conv = converters[ conversion ] || converters[ "* " + current ];
|
7781 |
-
|
7782 |
-
// If there is no direct converter, search transitively
|
7783 |
-
if ( !conv ) {
|
7784 |
-
conv2 = undefined;
|
7785 |
-
for ( conv1 in converters ) {
|
7786 |
-
tmp = conv1.split( " " );
|
7787 |
-
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
|
7788 |
-
conv2 = converters[ tmp[1] + " " + current ];
|
7789 |
-
if ( conv2 ) {
|
7790 |
-
conv1 = converters[ conv1 ];
|
7791 |
-
if ( conv1 === true ) {
|
7792 |
-
conv = conv2;
|
7793 |
-
} else if ( conv2 === true ) {
|
7794 |
-
conv = conv1;
|
7795 |
-
}
|
7796 |
-
break;
|
7797 |
-
}
|
7798 |
-
}
|
7799 |
-
}
|
7800 |
-
}
|
7801 |
-
// If we found no converter, dispatch an error
|
7802 |
-
if ( !( conv || conv2 ) ) {
|
7803 |
-
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
|
7804 |
-
}
|
7805 |
-
// If found converter is not an equivalence
|
7806 |
-
if ( conv !== true ) {
|
7807 |
-
// Convert with 1 or 2 converters accordingly
|
7808 |
-
response = conv ? conv( response ) : conv2( conv1(response) );
|
7809 |
-
}
|
7810 |
-
}
|
7811 |
-
}
|
7812 |
-
return response;
|
7813 |
-
}
|
7814 |
-
|
7815 |
-
|
7816 |
-
|
7817 |
-
|
7818 |
-
var jsc = jQuery.now(),
|
7819 |
-
jsre = /(\=)\?(&|$)|\?\?/i;
|
7820 |
-
|
7821 |
-
// Default jsonp settings
|
7822 |
-
jQuery.ajaxSetup({
|
7823 |
-
jsonp: "callback",
|
7824 |
-
jsonpCallback: function() {
|
7825 |
-
return jQuery.expando + "_" + ( jsc++ );
|
7826 |
-
}
|
7827 |
-
});
|
7828 |
-
|
7829 |
-
// Detect, normalize options and install callbacks for jsonp requests
|
7830 |
-
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
7831 |
-
|
7832 |
-
var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
|
7833 |
-
( typeof s.data === "string" );
|
7834 |
-
|
7835 |
-
if ( s.dataTypes[ 0 ] === "jsonp" ||
|
7836 |
-
s.jsonp !== false && ( jsre.test( s.url ) ||
|
7837 |
-
inspectData && jsre.test( s.data ) ) ) {
|
7838 |
-
|
7839 |
-
var responseContainer,
|
7840 |
-
jsonpCallback = s.jsonpCallback =
|
7841 |
-
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
|
7842 |
-
previous = window[ jsonpCallback ],
|
7843 |
-
url = s.url,
|
7844 |
-
data = s.data,
|
7845 |
-
replace = "$1" + jsonpCallback + "$2";
|
7846 |
-
|
7847 |
-
if ( s.jsonp !== false ) {
|
7848 |
-
url = url.replace( jsre, replace );
|
7849 |
-
if ( s.url === url ) {
|
7850 |
-
if ( inspectData ) {
|
7851 |
-
data = data.replace( jsre, replace );
|
7852 |
-
}
|
7853 |
-
if ( s.data === data ) {
|
7854 |
-
// Add callback manually
|
7855 |
-
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
|
7856 |
-
}
|
7857 |
-
}
|
7858 |
-
}
|
7859 |
-
|
7860 |
-
s.url = url;
|
7861 |
-
s.data = data;
|
7862 |
-
|
7863 |
-
// Install callback
|
7864 |
-
window[ jsonpCallback ] = function( response ) {
|
7865 |
-
responseContainer = [ response ];
|
7866 |
-
};
|
7867 |
-
|
7868 |
-
// Clean-up function
|
7869 |
-
jqXHR.always(function() {
|
7870 |
-
// Set callback back to previous value
|
7871 |
-
window[ jsonpCallback ] = previous;
|
7872 |
-
// Call if it was a function and we have a response
|
7873 |
-
if ( responseContainer && jQuery.isFunction( previous ) ) {
|
7874 |
-
window[ jsonpCallback ]( responseContainer[ 0 ] );
|
7875 |
-
}
|
7876 |
-
});
|
7877 |
-
|
7878 |
-
// Use data converter to retrieve json after script execution
|
7879 |
-
s.converters["script json"] = function() {
|
7880 |
-
if ( !responseContainer ) {
|
7881 |
-
jQuery.error( jsonpCallback + " was not called" );
|
7882 |
-
}
|
7883 |
-
return responseContainer[ 0 ];
|
7884 |
-
};
|
7885 |
-
|
7886 |
-
// force json dataType
|
7887 |
-
s.dataTypes[ 0 ] = "json";
|
7888 |
-
|
7889 |
-
// Delegate to script
|
7890 |
-
return "script";
|
7891 |
-
}
|
7892 |
-
});
|
7893 |
-
|
7894 |
-
|
7895 |
-
|
7896 |
-
|
7897 |
-
// Install script dataType
|
7898 |
-
jQuery.ajaxSetup({
|
7899 |
-
accepts: {
|
7900 |
-
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
|
7901 |
-
},
|
7902 |
-
contents: {
|
7903 |
-
script: /javascript|ecmascript/
|
7904 |
-
},
|
7905 |
-
converters: {
|
7906 |
-
"text script": function( text ) {
|
7907 |
-
jQuery.globalEval( text );
|
7908 |
-
return text;
|
7909 |
-
}
|
7910 |
-
}
|
7911 |
-
});
|
7912 |
-
|
7913 |
-
// Handle cache's special case and global
|
7914 |
-
jQuery.ajaxPrefilter( "script", function( s ) {
|
7915 |
-
if ( s.cache === undefined ) {
|
7916 |
-
s.cache = false;
|
7917 |
-
}
|
7918 |
-
if ( s.crossDomain ) {
|
7919 |
-
s.type = "GET";
|
7920 |
-
s.global = false;
|
7921 |
-
}
|
7922 |
-
});
|
7923 |
-
|
7924 |
-
// Bind script tag hack transport
|
7925 |
-
jQuery.ajaxTransport( "script", function(s) {
|
7926 |
-
|
7927 |
-
// This transport only deals with cross domain requests
|
7928 |
-
if ( s.crossDomain ) {
|
7929 |
-
|
7930 |
-
var script,
|
7931 |
-
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
|
7932 |
-
|
7933 |
-
return {
|
7934 |
-
|
7935 |
-
send: function( _, callback ) {
|
7936 |
-
|
7937 |
-
script = document.createElement( "script" );
|
7938 |
-
|
7939 |
-
script.async = "async";
|
7940 |
-
|
7941 |
-
if ( s.scriptCharset ) {
|
7942 |
-
script.charset = s.scriptCharset;
|
7943 |
-
}
|
7944 |
-
|
7945 |
-
script.src = s.url;
|
7946 |
-
|
7947 |
-
// Attach handlers for all browsers
|
7948 |
-
script.onload = script.onreadystatechange = function( _, isAbort ) {
|
7949 |
-
|
7950 |
-
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
|
7951 |
-
|
7952 |
-
// Handle memory leak in IE
|
7953 |
-
script.onload = script.onreadystatechange = null;
|
7954 |
-
|
7955 |
-
// Remove the script
|
7956 |
-
if ( head && script.parentNode ) {
|
7957 |
-
head.removeChild( script );
|
7958 |
-
}
|
7959 |
-
|
7960 |
-
// Dereference the script
|
7961 |
-
script = undefined;
|
7962 |
-
|
7963 |
-
// Callback if not abort
|
7964 |
-
if ( !isAbort ) {
|
7965 |
-
callback( 200, "success" );
|
7966 |
-
}
|
7967 |
-
}
|
7968 |
-
};
|
7969 |
-
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
|
7970 |
-
// This arises when a base node is used (#2709 and #4378).
|
7971 |
-
head.insertBefore( script, head.firstChild );
|
7972 |
-
},
|
7973 |
-
|
7974 |
-
abort: function() {
|
7975 |
-
if ( script ) {
|
7976 |
-
script.onload( 0, 1 );
|
7977 |
-
}
|
7978 |
-
}
|
7979 |
-
};
|
7980 |
-
}
|
7981 |
-
});
|
7982 |
-
|
7983 |
-
|
7984 |
-
|
7985 |
-
|
7986 |
-
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
|
7987 |
-
xhrOnUnloadAbort = window.ActiveXObject ? function() {
|
7988 |
-
// Abort all pending requests
|
7989 |
-
for ( var key in xhrCallbacks ) {
|
7990 |
-
xhrCallbacks[ key ]( 0, 1 );
|
7991 |
-
}
|
7992 |
-
} : false,
|
7993 |
-
xhrId = 0,
|
7994 |
-
xhrCallbacks;
|
7995 |
-
|
7996 |
-
// Functions to create xhrs
|
7997 |
-
function createStandardXHR() {
|
7998 |
-
try {
|
7999 |
-
return new window.XMLHttpRequest();
|
8000 |
-
} catch( e ) {}
|
8001 |
-
}
|
8002 |
-
|
8003 |
-
function createActiveXHR() {
|
8004 |
-
try {
|
8005 |
-
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
|
8006 |
-
} catch( e ) {}
|
8007 |
-
}
|
8008 |
-
|
8009 |
-
// Create the request object
|
8010 |
-
// (This is still attached to ajaxSettings for backward compatibility)
|
8011 |
-
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
|
8012 |
-
/* Microsoft failed to properly
|
8013 |
-
* implement the XMLHttpRequest in IE7 (can't request local files),
|
8014 |
-
* so we use the ActiveXObject when it is available
|
8015 |
-
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
|
8016 |
-
* we need a fallback.
|
8017 |
-
*/
|
8018 |
-
function() {
|
8019 |
-
return !this.isLocal && createStandardXHR() || createActiveXHR();
|
8020 |
-
} :
|
8021 |
-
// For all other browsers, use the standard XMLHttpRequest object
|
8022 |
-
createStandardXHR;
|
8023 |
-
|
8024 |
-
// Determine support properties
|
8025 |
-
(function( xhr ) {
|
8026 |
-
jQuery.extend( jQuery.support, {
|
8027 |
-
ajax: !!xhr,
|
8028 |
-
cors: !!xhr && ( "withCredentials" in xhr )
|
8029 |
-
});
|
8030 |
-
})( jQuery.ajaxSettings.xhr() );
|
8031 |
-
|
8032 |
-
// Create transport if the browser can provide an xhr
|
8033 |
-
if ( jQuery.support.ajax ) {
|
8034 |
-
|
8035 |
-
jQuery.ajaxTransport(function( s ) {
|
8036 |
-
// Cross domain only allowed if supported through XMLHttpRequest
|
8037 |
-
if ( !s.crossDomain || jQuery.support.cors ) {
|
8038 |
-
|
8039 |
-
var callback;
|
8040 |
-
|
8041 |
-
return {
|
8042 |
-
send: function( headers, complete ) {
|
8043 |
-
|
8044 |
-
// Get a new xhr
|
8045 |
-
var xhr = s.xhr(),
|
8046 |
-
handle,
|
8047 |
-
i;
|
8048 |
-
|
8049 |
-
// Open the socket
|
8050 |
-
// Passing null username, generates a login popup on Opera (#2865)
|
8051 |
-
if ( s.username ) {
|
8052 |
-
xhr.open( s.type, s.url, s.async, s.username, s.password );
|
8053 |
-
} else {
|
8054 |
-
xhr.open( s.type, s.url, s.async );
|
8055 |
-
}
|
8056 |
-
|
8057 |
-
// Apply custom fields if provided
|
8058 |
-
if ( s.xhrFields ) {
|
8059 |
-
for ( i in s.xhrFields ) {
|
8060 |
-
xhr[ i ] = s.xhrFields[ i ];
|
8061 |
-
}
|
8062 |
-
}
|
8063 |
-
|
8064 |
-
// Override mime type if needed
|
8065 |
-
if ( s.mimeType && xhr.overrideMimeType ) {
|
8066 |
-
xhr.overrideMimeType( s.mimeType );
|
8067 |
-
}
|
8068 |
-
|
8069 |
-
// X-Requested-With header
|
8070 |
-
// For cross-domain requests, seeing as conditions for a preflight are
|
8071 |
-
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
8072 |
-
// (it can always be set on a per-request basis or even using ajaxSetup)
|
8073 |
-
// For same-domain requests, won't change header if already provided.
|
8074 |
-
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
|
8075 |
-
headers[ "X-Requested-With" ] = "XMLHttpRequest";
|
8076 |
-
}
|
8077 |
-
|
8078 |
-
// Need an extra try/catch for cross domain requests in Firefox 3
|
8079 |
-
try {
|
8080 |
-
for ( i in headers ) {
|
8081 |
-
xhr.setRequestHeader( i, headers[ i ] );
|
8082 |
-
}
|
8083 |
-
} catch( _ ) {}
|
8084 |
-
|
8085 |
-
// Do send the request
|
8086 |
-
// This may raise an exception which is actually
|
8087 |
-
// handled in jQuery.ajax (so no try/catch here)
|
8088 |
-
xhr.send( ( s.hasContent && s.data ) || null );
|
8089 |
-
|
8090 |
-
// Listener
|
8091 |
-
callback = function( _, isAbort ) {
|
8092 |
-
|
8093 |
-
var status,
|
8094 |
-
statusText,
|
8095 |
-
responseHeaders,
|
8096 |
-
responses,
|
8097 |
-
xml;
|
8098 |
-
|
8099 |
-
// Firefox throws exceptions when accessing properties
|
8100 |
-
// of an xhr when a network error occured
|
8101 |
-
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
|
8102 |
-
try {
|
8103 |
-
|
8104 |
-
// Was never called and is aborted or complete
|
8105 |
-
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
|
8106 |
-
|
8107 |
-
// Only called once
|
8108 |
-
callback = undefined;
|
8109 |
-
|
8110 |
-
// Do not keep as active anymore
|
8111 |
-
if ( handle ) {
|
8112 |
-
xhr.onreadystatechange = jQuery.noop;
|
8113 |
-
if ( xhrOnUnloadAbort ) {
|
8114 |
-
delete xhrCallbacks[ handle ];
|
8115 |
-
}
|
8116 |
-
}
|
8117 |
-
|
8118 |
-
// If it's an abort
|
8119 |
-
if ( isAbort ) {
|
8120 |
-
// Abort it manually if needed
|
8121 |
-
if ( xhr.readyState !== 4 ) {
|
8122 |
-
xhr.abort();
|
8123 |
-
}
|
8124 |
-
} else {
|
8125 |
-
status = xhr.status;
|
8126 |
-
responseHeaders = xhr.getAllResponseHeaders();
|
8127 |
-
responses = {};
|
8128 |
-
xml = xhr.responseXML;
|
8129 |
-
|
8130 |
-
// Construct response list
|
8131 |
-
if ( xml && xml.documentElement /* #4958 */ ) {
|
8132 |
-
responses.xml = xml;
|
8133 |
-
}
|
8134 |
-
responses.text = xhr.responseText;
|
8135 |
-
|
8136 |
-
// Firefox throws an exception when accessing
|
8137 |
-
// statusText for faulty cross-domain requests
|
8138 |
-
try {
|
8139 |
-
statusText = xhr.statusText;
|
8140 |
-
} catch( e ) {
|
8141 |
-
// We normalize with Webkit giving an empty statusText
|
8142 |
-
statusText = "";
|
8143 |
-
}
|
8144 |
-
|
8145 |
-
// Filter status for non standard behaviors
|
8146 |
-
|
8147 |
-
// If the request is local and we have data: assume a success
|
8148 |
-
// (success with no data won't get notified, that's the best we
|
8149 |
-
// can do given current implementations)
|
8150 |
-
if ( !status && s.isLocal && !s.crossDomain ) {
|
8151 |
-
status = responses.text ? 200 : 404;
|
8152 |
-
// IE - #1450: sometimes returns 1223 when it should be 204
|
8153 |
-
} else if ( status === 1223 ) {
|
8154 |
-
status = 204;
|
8155 |
-
}
|
8156 |
-
}
|
8157 |
-
}
|
8158 |
-
} catch( firefoxAccessException ) {
|
8159 |
-
if ( !isAbort ) {
|
8160 |
-
complete( -1, firefoxAccessException );
|
8161 |
-
}
|
8162 |
-
}
|
8163 |
-
|
8164 |
-
// Call complete if needed
|
8165 |
-
if ( responses ) {
|
8166 |
-
complete( status, statusText, responses, responseHeaders );
|
8167 |
-
}
|
8168 |
-
};
|
8169 |
-
|
8170 |
-
// if we're in sync mode or it's in cache
|
8171 |
-
// and has been retrieved directly (IE6 & IE7)
|
8172 |
-
// we need to manually fire the callback
|
8173 |
-
if ( !s.async || xhr.readyState === 4 ) {
|
8174 |
-
callback();
|
8175 |
-
} else {
|
8176 |
-
handle = ++xhrId;
|
8177 |
-
if ( xhrOnUnloadAbort ) {
|
8178 |
-
// Create the active xhrs callbacks list if needed
|
8179 |
-
// and attach the unload handler
|
8180 |
-
if ( !xhrCallbacks ) {
|
8181 |
-
xhrCallbacks = {};
|
8182 |
-
jQuery( window ).unload( xhrOnUnloadAbort );
|
8183 |
-
}
|
8184 |
-
// Add to list of active xhrs callbacks
|
8185 |
-
xhrCallbacks[ handle ] = callback;
|
8186 |
-
}
|
8187 |
-
xhr.onreadystatechange = callback;
|
8188 |
-
}
|
8189 |
-
},
|
8190 |
-
|
8191 |
-
abort: function() {
|
8192 |
-
if ( callback ) {
|
8193 |
-
callback(0,1);
|
8194 |
-
}
|
8195 |
-
}
|
8196 |
-
};
|
8197 |
-
}
|
8198 |
-
});
|
8199 |
-
}
|
8200 |
-
|
8201 |
-
|
8202 |
-
|
8203 |
-
|
8204 |
-
var elemdisplay = {},
|
8205 |
-
iframe, iframeDoc,
|
8206 |
-
rfxtypes = /^(?:toggle|show|hide)$/,
|
8207 |
-
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
|
8208 |
-
timerId,
|
8209 |
-
fxAttrs = [
|
8210 |
-
// height animations
|
8211 |
-
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
|
8212 |
-
// width animations
|
8213 |
-
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
|
8214 |
-
// opacity animations
|
8215 |
-
[ "opacity" ]
|
8216 |
-
],
|
8217 |
-
fxNow;
|
8218 |
-
|
8219 |
-
jQuery.fn.extend({
|
8220 |
-
show: function( speed, easing, callback ) {
|
8221 |
-
var elem, display;
|
8222 |
-
|
8223 |
-
if ( speed || speed === 0 ) {
|
8224 |
-
return this.animate( genFx("show", 3), speed, easing, callback );
|
8225 |
-
|
8226 |
-
} else {
|
8227 |
-
for ( var i = 0, j = this.length; i < j; i++ ) {
|
8228 |
-
elem = this[ i ];
|
8229 |
-
|
8230 |
-
if ( elem.style ) {
|
8231 |
-
display = elem.style.display;
|
8232 |
-
|
8233 |
-
// Reset the inline display of this element to learn if it is
|
8234 |
-
// being hidden by cascaded rules or not
|
8235 |
-
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
|
8236 |
-
display = elem.style.display = "";
|
8237 |
-
}
|
8238 |
-
|
8239 |
-
// Set elements which have been overridden with display: none
|
8240 |
-
// in a stylesheet to whatever the default browser style is
|
8241 |
-
// for such an element
|
8242 |
-
if ( display === "" && jQuery.css(elem, "display") === "none" ) {
|
8243 |
-
jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
|
8244 |
-
}
|
8245 |
-
}
|
8246 |
-
}
|
8247 |
-
|
8248 |
-
// Set the display of most of the elements in a second loop
|
8249 |
-
// to avoid the constant reflow
|
8250 |
-
for ( i = 0; i < j; i++ ) {
|
8251 |
-
elem = this[ i ];
|
8252 |
-
|
8253 |
-
if ( elem.style ) {
|
8254 |
-
display = elem.style.display;
|
8255 |
-
|
8256 |
-
if ( display === "" || display === "none" ) {
|
8257 |
-
elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
|
8258 |
-
}
|
8259 |
-
}
|
8260 |
-
}
|
8261 |
-
|
8262 |
-
return this;
|
8263 |
-
}
|
8264 |
-
},
|
8265 |
-
|
8266 |
-
hide: function( speed, easing, callback ) {
|
8267 |
-
if ( speed || speed === 0 ) {
|
8268 |
-
return this.animate( genFx("hide", 3), speed, easing, callback);
|
8269 |
-
|
8270 |
-
} else {
|
8271 |
-
var elem, display,
|
8272 |
-
i = 0,
|
8273 |
-
j = this.length;
|
8274 |
-
|
8275 |
-
for ( ; i < j; i++ ) {
|
8276 |
-
elem = this[i];
|
8277 |
-
if ( elem.style ) {
|
8278 |
-
display = jQuery.css( elem, "display" );
|
8279 |
-
|
8280 |
-
if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
|
8281 |
-
jQuery._data( elem, "olddisplay", display );
|
8282 |
-
}
|
8283 |
-
}
|
8284 |
-
}
|
8285 |
-
|
8286 |
-
// Set the display of the elements in a second loop
|
8287 |
-
// to avoid the constant reflow
|
8288 |
-
for ( i = 0; i < j; i++ ) {
|
8289 |
-
if ( this[i].style ) {
|
8290 |
-
this[i].style.display = "none";
|
8291 |
-
}
|
8292 |
-
}
|
8293 |
-
|
8294 |
-
return this;
|
8295 |
-
}
|
8296 |
-
},
|
8297 |
-
|
8298 |
-
// Save the old toggle function
|
8299 |
-
_toggle: jQuery.fn.toggle,
|
8300 |
-
|
8301 |
-
toggle: function( fn, fn2, callback ) {
|
8302 |
-
var bool = typeof fn === "boolean";
|
8303 |
-
|
8304 |
-
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
|
8305 |
-
this._toggle.apply( this, arguments );
|
8306 |
-
|
8307 |
-
} else if ( fn == null || bool ) {
|
8308 |
-
this.each(function() {
|
8309 |
-
var state = bool ? fn : jQuery(this).is(":hidden");
|
8310 |
-
jQuery(this)[ state ? "show" : "hide" ]();
|
8311 |
-
});
|
8312 |
-
|
8313 |
-
} else {
|
8314 |
-
this.animate(genFx("toggle", 3), fn, fn2, callback);
|
8315 |
-
}
|
8316 |
-
|
8317 |
-
return this;
|
8318 |
-
},
|
8319 |
-
|
8320 |
-
fadeTo: function( speed, to, easing, callback ) {
|
8321 |
-
return this.filter(":hidden").css("opacity", 0).show().end()
|
8322 |
-
.animate({opacity: to}, speed, easing, callback);
|
8323 |
-
},
|
8324 |
-
|
8325 |
-
animate: function( prop, speed, easing, callback ) {
|
8326 |
-
var optall = jQuery.speed( speed, easing, callback );
|
8327 |
-
|
8328 |
-
if ( jQuery.isEmptyObject( prop ) ) {
|
8329 |
-
return this.each( optall.complete, [ false ] );
|
8330 |
-
}
|
8331 |
-
|
8332 |
-
// Do not change referenced properties as per-property easing will be lost
|
8333 |
-
prop = jQuery.extend( {}, prop );
|
8334 |
-
|
8335 |
-
function doAnimation() {
|
8336 |
-
// XXX 'this' does not always have a nodeName when running the
|
8337 |
-
// test suite
|
8338 |
-
|
8339 |
-
if ( optall.queue === false ) {
|
8340 |
-
jQuery._mark( this );
|
8341 |
-
}
|
8342 |
-
|
8343 |
-
var opt = jQuery.extend( {}, optall ),
|
8344 |
-
isElement = this.nodeType === 1,
|
8345 |
-
hidden = isElement && jQuery(this).is(":hidden"),
|
8346 |
-
name, val, p, e,
|
8347 |
-
parts, start, end, unit,
|
8348 |
-
method;
|
8349 |
-
|
8350 |
-
// will store per property easing and be used to determine when an animation is complete
|
8351 |
-
opt.animatedProperties = {};
|
8352 |
-
|
8353 |
-
for ( p in prop ) {
|
8354 |
-
|
8355 |
-
// property name normalization
|
8356 |
-
name = jQuery.camelCase( p );
|
8357 |
-
if ( p !== name ) {
|
8358 |
-
prop[ name ] = prop[ p ];
|
8359 |
-
delete prop[ p ];
|
8360 |
-
}
|
8361 |
-
|
8362 |
-
val = prop[ name ];
|
8363 |
-
|
8364 |
-
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
|
8365 |
-
if ( jQuery.isArray( val ) ) {
|
8366 |
-
opt.animatedProperties[ name ] = val[ 1 ];
|
8367 |
-
val = prop[ name ] = val[ 0 ];
|
8368 |
-
} else {
|
8369 |
-
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
|
8370 |
-
}
|
8371 |
-
|
8372 |
-
if ( val === "hide" && hidden || val === "show" && !hidden ) {
|
8373 |
-
return opt.complete.call( this );
|
8374 |
-
}
|
8375 |
-
|
8376 |
-
if ( isElement && ( name === "height" || name === "width" ) ) {
|
8377 |
-
// Make sure that nothing sneaks out
|
8378 |
-
// Record all 3 overflow attributes because IE does not
|
8379 |
-
// change the overflow attribute when overflowX and
|
8380 |
-
// overflowY are set to the same value
|
8381 |
-
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
|
8382 |
-
|
8383 |
-
// Set display property to inline-block for height/width
|
8384 |
-
// animations on inline elements that are having width/height animated
|
8385 |
-
if ( jQuery.css( this, "display" ) === "inline" &&
|
8386 |
-
jQuery.css( this, "float" ) === "none" ) {
|
8387 |
-
|
8388 |
-
// inline-level elements accept inline-block;
|
8389 |
-
// block-level elements need to be inline with layout
|
8390 |
-
if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
|
8391 |
-
this.style.display = "inline-block";
|
8392 |
-
|
8393 |
-
} else {
|
8394 |
-
this.style.zoom = 1;
|
8395 |
-
}
|
8396 |
-
}
|
8397 |
-
}
|
8398 |
-
}
|
8399 |
-
|
8400 |
-
if ( opt.overflow != null ) {
|
8401 |
-
this.style.overflow = "hidden";
|
8402 |
-
}
|
8403 |
-
|
8404 |
-
for ( p in prop ) {
|
8405 |
-
e = new jQuery.fx( this, opt, p );
|
8406 |
-
val = prop[ p ];
|
8407 |
-
|
8408 |
-
if ( rfxtypes.test( val ) ) {
|
8409 |
-
|
8410 |
-
// Tracks whether to show or hide based on private
|
8411 |
-
// data attached to the element
|
8412 |
-
method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
|
8413 |
-
if ( method ) {
|
8414 |
-
jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
|
8415 |
-
e[ method ]();
|
8416 |
-
} else {
|
8417 |
-
e[ val ]();
|
8418 |
-
}
|
8419 |
-
|
8420 |
-
} else {
|
8421 |
-
parts = rfxnum.exec( val );
|
8422 |
-
start = e.cur();
|
8423 |
-
|
8424 |
-
if ( parts ) {
|
8425 |
-
end = parseFloat( parts[2] );
|
8426 |
-
unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
|
8427 |
-
|
8428 |
-
// We need to compute starting value
|
8429 |
-
if ( unit !== "px" ) {
|
8430 |
-
jQuery.style( this, p, (end || 1) + unit);
|
8431 |
-
start = ( (end || 1) / e.cur() ) * start;
|
8432 |
-
jQuery.style( this, p, start + unit);
|
8433 |
-
}
|
8434 |
-
|
8435 |
-
// If a +=/-= token was provided, we're doing a relative animation
|
8436 |
-
if ( parts[1] ) {
|
8437 |
-
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
|
8438 |
-
}
|
8439 |
-
|
8440 |
-
e.custom( start, end, unit );
|
8441 |
-
|
8442 |
-
} else {
|
8443 |
-
e.custom( start, val, "" );
|
8444 |
-
}
|
8445 |
-
}
|
8446 |
-
}
|
8447 |
-
|
8448 |
-
// For JS strict compliance
|
8449 |
-
return true;
|
8450 |
-
}
|
8451 |
-
|
8452 |
-
return optall.queue === false ?
|
8453 |
-
this.each( doAnimation ) :
|
8454 |
-
this.queue( optall.queue, doAnimation );
|
8455 |
-
},
|
8456 |
-
|
8457 |
-
stop: function( type, clearQueue, gotoEnd ) {
|
8458 |
-
if ( typeof type !== "string" ) {
|
8459 |
-
gotoEnd = clearQueue;
|
8460 |
-
clearQueue = type;
|
8461 |
-
type = undefined;
|
8462 |
-
}
|
8463 |
-
if ( clearQueue && type !== false ) {
|
8464 |
-
this.queue( type || "fx", [] );
|
8465 |
-
}
|
8466 |
-
|
8467 |
-
return this.each(function() {
|
8468 |
-
var index,
|
8469 |
-
hadTimers = false,
|
8470 |
-
timers = jQuery.timers,
|
8471 |
-
data = jQuery._data( this );
|
8472 |
-
|
8473 |
-
// clear marker counters if we know they won't be
|
8474 |
-
if ( !gotoEnd ) {
|
8475 |
-
jQuery._unmark( true, this );
|
8476 |
-
}
|
8477 |
-
|
8478 |
-
function stopQueue( elem, data, index ) {
|
8479 |
-
var hooks = data[ index ];
|
8480 |
-
jQuery.removeData( elem, index, true );
|
8481 |
-
hooks.stop( gotoEnd );
|
8482 |
-
}
|
8483 |
-
|
8484 |
-
if ( type == null ) {
|
8485 |
-
for ( index in data ) {
|
8486 |
-
if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
|
8487 |
-
stopQueue( this, data, index );
|
8488 |
-
}
|
8489 |
-
}
|
8490 |
-
} else if ( data[ index = type + ".run" ] && data[ index ].stop ){
|
8491 |
-
stopQueue( this, data, index );
|
8492 |
-
}
|
8493 |
-
|
8494 |
-
for ( index = timers.length; index--; ) {
|
8495 |
-
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
|
8496 |
-
if ( gotoEnd ) {
|
8497 |
-
|
8498 |
-
// force the next step to be the last
|
8499 |
-
timers[ index ]( true );
|
8500 |
-
} else {
|
8501 |
-
timers[ index ].saveState();
|
8502 |
-
}
|
8503 |
-
hadTimers = true;
|
8504 |
-
timers.splice( index, 1 );
|
8505 |
-
}
|
8506 |
-
}
|
8507 |
-
|
8508 |
-
// start the next in the queue if the last step wasn't forced
|
8509 |
-
// timers currently will call their complete callbacks, which will dequeue
|
8510 |
-
// but only if they were gotoEnd
|
8511 |
-
if ( !( gotoEnd && hadTimers ) ) {
|
8512 |
-
jQuery.dequeue( this, type );
|
8513 |
-
}
|
8514 |
-
});
|
8515 |
-
}
|
8516 |
-
|
8517 |
-
});
|
8518 |
-
|
8519 |
-
// Animations created synchronously will run synchronously
|
8520 |
-
function createFxNow() {
|
8521 |
-
setTimeout( clearFxNow, 0 );
|
8522 |
-
return ( fxNow = jQuery.now() );
|
8523 |
-
}
|
8524 |
-
|
8525 |
-
function clearFxNow() {
|
8526 |
-
fxNow = undefined;
|
8527 |
-
}
|
8528 |
-
|
8529 |
-
// Generate parameters to create a standard animation
|
8530 |
-
function genFx( type, num ) {
|
8531 |
-
var obj = {};
|
8532 |
-
|
8533 |
-
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
|
8534 |
-
obj[ this ] = type;
|
8535 |
-
});
|
8536 |
-
|
8537 |
-
return obj;
|
8538 |
-
}
|
8539 |
-
|
8540 |
-
// Generate shortcuts for custom animations
|
8541 |
-
jQuery.each({
|
8542 |
-
slideDown: genFx( "show", 1 ),
|
8543 |
-
slideUp: genFx( "hide", 1 ),
|
8544 |
-
slideToggle: genFx( "toggle", 1 ),
|
8545 |
-
fadeIn: { opacity: "show" },
|
8546 |
-
fadeOut: { opacity: "hide" },
|
8547 |
-
fadeToggle: { opacity: "toggle" }
|
8548 |
-
}, function( name, props ) {
|
8549 |
-
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
8550 |
-
return this.animate( props, speed, easing, callback );
|
8551 |
-
};
|
8552 |
-
});
|
8553 |
-
|
8554 |
-
jQuery.extend({
|
8555 |
-
speed: function( speed, easing, fn ) {
|
8556 |
-
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
|
8557 |
-
complete: fn || !fn && easing ||
|
8558 |
-
jQuery.isFunction( speed ) && speed,
|
8559 |
-
duration: speed,
|
8560 |
-
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
|
8561 |
-
};
|
8562 |
-
|
8563 |
-
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
|
8564 |
-
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
|
8565 |
-
|
8566 |
-
// normalize opt.queue - true/undefined/null -> "fx"
|
8567 |
-
if ( opt.queue == null || opt.queue === true ) {
|
8568 |
-
opt.queue = "fx";
|
8569 |
-
}
|
8570 |
-
|
8571 |
-
// Queueing
|
8572 |
-
opt.old = opt.complete;
|
8573 |
-
|
8574 |
-
opt.complete = function( noUnmark ) {
|
8575 |
-
if ( jQuery.isFunction( opt.old ) ) {
|
8576 |
-
opt.old.call( this );
|
8577 |
-
}
|
8578 |
-
|
8579 |
-
if ( opt.queue ) {
|
8580 |
-
jQuery.dequeue( this, opt.queue );
|
8581 |
-
} else if ( noUnmark !== false ) {
|
8582 |
-
jQuery._unmark( this );
|
8583 |
-
}
|
8584 |
-
};
|
8585 |
-
|
8586 |
-
return opt;
|
8587 |
-
},
|
8588 |
-
|
8589 |
-
easing: {
|
8590 |
-
linear: function( p, n, firstNum, diff ) {
|
8591 |
-
return firstNum + diff * p;
|
8592 |
-
},
|
8593 |
-
swing: function( p, n, firstNum, diff ) {
|
8594 |
-
return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
|
8595 |
-
}
|
8596 |
-
},
|
8597 |
-
|
8598 |
-
timers: [],
|
8599 |
-
|
8600 |
-
fx: function( elem, options, prop ) {
|
8601 |
-
this.options = options;
|
8602 |
-
this.elem = elem;
|
8603 |
-
this.prop = prop;
|
8604 |
-
|
8605 |
-
options.orig = options.orig || {};
|
8606 |
-
}
|
8607 |
-
|
8608 |
-
});
|
8609 |
-
|
8610 |
-
jQuery.fx.prototype = {
|
8611 |
-
// Simple function for setting a style value
|
8612 |
-
update: function() {
|
8613 |
-
if ( this.options.step ) {
|
8614 |
-
this.options.step.call( this.elem, this.now, this );
|
8615 |
-
}
|
8616 |
-
|
8617 |
-
( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
|
8618 |
-
},
|
8619 |
-
|
8620 |
-
// Get the current size
|
8621 |
-
cur: function() {
|
8622 |
-
if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
|
8623 |
-
return this.elem[ this.prop ];
|
8624 |
-
}
|
8625 |
-
|
8626 |
-
var parsed,
|
8627 |
-
r = jQuery.css( this.elem, this.prop );
|
8628 |
-
// Empty strings, null, undefined and "auto" are converted to 0,
|
8629 |
-
// complex values such as "rotate(1rad)" are returned as is,
|
8630 |
-
// simple values such as "10px" are parsed to Float.
|
8631 |
-
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
|
8632 |
-
},
|
8633 |
-
|
8634 |
-
// Start an animation from one number to another
|
8635 |
-
custom: function( from, to, unit ) {
|
8636 |
-
var self = this,
|
8637 |
-
fx = jQuery.fx;
|
8638 |
-
|
8639 |
-
this.startTime = fxNow || createFxNow();
|
8640 |
-
this.end = to;
|
8641 |
-
this.now = this.start = from;
|
8642 |
-
this.pos = this.state = 0;
|
8643 |
-
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
|
8644 |
-
|
8645 |
-
function t( gotoEnd ) {
|
8646 |
-
return self.step( gotoEnd );
|
8647 |
-
}
|
8648 |
-
|
8649 |
-
t.queue = this.options.queue;
|
8650 |
-
t.elem = this.elem;
|
8651 |
-
t.saveState = function() {
|
8652 |
-
if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
|
8653 |
-
jQuery._data( self.elem, "fxshow" + self.prop, self.start );
|
8654 |
-
}
|
8655 |
-
};
|
8656 |
-
|
8657 |
-
if ( t() && jQuery.timers.push(t) && !timerId ) {
|
8658 |
-
timerId = setInterval( fx.tick, fx.interval );
|
8659 |
-
}
|
8660 |
-
},
|
8661 |
-
|
8662 |
-
// Simple 'show' function
|
8663 |
-
show: function() {
|
8664 |
-
var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
|
8665 |
-
|
8666 |
-
// Remember where we started, so that we can go back to it later
|
8667 |
-
this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
|
8668 |
-
this.options.show = true;
|
8669 |
-
|
8670 |
-
// Begin the animation
|
8671 |
-
// Make sure that we start at a small width/height to avoid any flash of content
|
8672 |
-
if ( dataShow !== undefined ) {
|
8673 |
-
// This show is picking up where a previous hide or show left off
|
8674 |
-
this.custom( this.cur(), dataShow );
|
8675 |
-
} else {
|
8676 |
-
this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
|
8677 |
-
}
|
8678 |
-
|
8679 |
-
// Start by showing the element
|
8680 |
-
jQuery( this.elem ).show();
|
8681 |
-
},
|
8682 |
-
|
8683 |
-
// Simple 'hide' function
|
8684 |
-
hide: function() {
|
8685 |
-
// Remember where we started, so that we can go back to it later
|
8686 |
-
this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
|
8687 |
-
this.options.hide = true;
|
8688 |
-
|
8689 |
-
// Begin the animation
|
8690 |
-
this.custom( this.cur(), 0 );
|
8691 |
-
},
|
8692 |
-
|
8693 |
-
// Each step of an animation
|
8694 |
-
step: function( gotoEnd ) {
|
8695 |
-
var p, n, complete,
|
8696 |
-
t = fxNow || createFxNow(),
|
8697 |
-
done = true,
|
8698 |
-
elem = this.elem,
|
8699 |
-
options = this.options;
|
8700 |
-
|
8701 |
-
if ( gotoEnd || t >= options.duration + this.startTime ) {
|
8702 |
-
this.now = this.end;
|
8703 |
-
this.pos = this.state = 1;
|
8704 |
-
this.update();
|
8705 |
-
|
8706 |
-
options.animatedProperties[ this.prop ] = true;
|
8707 |
-
|
8708 |
-
for ( p in options.animatedProperties ) {
|
8709 |
-
if ( options.animatedProperties[ p ] !== true ) {
|
8710 |
-
done = false;
|
8711 |
-
}
|
8712 |
-
}
|
8713 |
-
|
8714 |
-
if ( done ) {
|
8715 |
-
// Reset the overflow
|
8716 |
-
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
|
8717 |
-
|
8718 |
-
jQuery.each( [ "", "X", "Y" ], function( index, value ) {
|
8719 |
-
elem.style[ "overflow" + value ] = options.overflow[ index ];
|
8720 |
-
});
|
8721 |
-
}
|
8722 |
-
|
8723 |
-
// Hide the element if the "hide" operation was done
|
8724 |
-
if ( options.hide ) {
|
8725 |
-
jQuery( elem ).hide();
|
8726 |
-
}
|
8727 |
-
|
8728 |
-
// Reset the properties, if the item has been hidden or shown
|
8729 |
-
if ( options.hide || options.show ) {
|
8730 |
-
for ( p in options.animatedProperties ) {
|
8731 |
-
jQuery.style( elem, p, options.orig[ p ] );
|
8732 |
-
jQuery.removeData( elem, "fxshow" + p, true );
|
8733 |
-
// Toggle data is no longer needed
|
8734 |
-
jQuery.removeData( elem, "toggle" + p, true );
|
8735 |
-
}
|
8736 |
-
}
|
8737 |
-
|
8738 |
-
// Execute the complete function
|
8739 |
-
// in the event that the complete function throws an exception
|
8740 |
-
// we must ensure it won't be called twice. #5684
|
8741 |
-
|
8742 |
-
complete = options.complete;
|
8743 |
-
if ( complete ) {
|
8744 |
-
|
8745 |
-
options.complete = false;
|
8746 |
-
complete.call( elem );
|
8747 |
-
}
|
8748 |
-
}
|
8749 |
-
|
8750 |
-
return false;
|
8751 |
-
|
8752 |
-
} else {
|
8753 |
-
// classical easing cannot be used with an Infinity duration
|
8754 |
-
if ( options.duration == Infinity ) {
|
8755 |
-
this.now = t;
|
8756 |
-
} else {
|
8757 |
-
n = t - this.startTime;
|
8758 |
-
this.state = n / options.duration;
|
8759 |
-
|
8760 |
-
// Perform the easing function, defaults to swing
|
8761 |
-
this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
|
8762 |
-
this.now = this.start + ( (this.end - this.start) * this.pos );
|
8763 |
-
}
|
8764 |
-
// Perform the next step of the animation
|
8765 |
-
this.update();
|
8766 |
-
}
|
8767 |
-
|
8768 |
-
return true;
|
8769 |
-
}
|
8770 |
-
};
|
8771 |
-
|
8772 |
-
jQuery.extend( jQuery.fx, {
|
8773 |
-
tick: function() {
|
8774 |
-
var timer,
|
8775 |
-
timers = jQuery.timers,
|
8776 |
-
i = 0;
|
8777 |
-
|
8778 |
-
for ( ; i < timers.length; i++ ) {
|
8779 |
-
timer = timers[ i ];
|
8780 |
-
// Checks the timer has not already been removed
|
8781 |
-
if ( !timer() && timers[ i ] === timer ) {
|
8782 |
-
timers.splice( i--, 1 );
|
8783 |
-
}
|
8784 |
-
}
|
8785 |
-
|
8786 |
-
if ( !timers.length ) {
|
8787 |
-
jQuery.fx.stop();
|
8788 |
-
}
|
8789 |
-
},
|
8790 |
-
|
8791 |
-
interval: 13,
|
8792 |
-
|
8793 |
-
stop: function() {
|
8794 |
-
clearInterval( timerId );
|
8795 |
-
timerId = null;
|
8796 |
-
},
|
8797 |
-
|
8798 |
-
speeds: {
|
8799 |
-
slow: 600,
|
8800 |
-
fast: 200,
|
8801 |
-
// Default speed
|
8802 |
-
_default: 400
|
8803 |
-
},
|
8804 |
-
|
8805 |
-
step: {
|
8806 |
-
opacity: function( fx ) {
|
8807 |
-
jQuery.style( fx.elem, "opacity", fx.now );
|
8808 |
-
},
|
8809 |
-
|
8810 |
-
_default: function( fx ) {
|
8811 |
-
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
|
8812 |
-
fx.elem.style[ fx.prop ] = fx.now + fx.unit;
|
8813 |
-
} else {
|
8814 |
-
fx.elem[ fx.prop ] = fx.now;
|
8815 |
-
}
|
8816 |
-
}
|
8817 |
-
}
|
8818 |
-
});
|
8819 |
-
|
8820 |
-
// Adds width/height step functions
|
8821 |
-
// Do not set anything below 0
|
8822 |
-
jQuery.each([ "width", "height" ], function( i, prop ) {
|
8823 |
-
jQuery.fx.step[ prop ] = function( fx ) {
|
8824 |
-
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
|
8825 |
-
};
|
8826 |
-
});
|
8827 |
-
|
8828 |
-
if ( jQuery.expr && jQuery.expr.filters ) {
|
8829 |
-
jQuery.expr.filters.animated = function( elem ) {
|
8830 |
-
return jQuery.grep(jQuery.timers, function( fn ) {
|
8831 |
-
return elem === fn.elem;
|
8832 |
-
}).length;
|
8833 |
-
};
|
8834 |
-
}
|
8835 |
-
|
8836 |
-
// Try to restore the default display value of an element
|
8837 |
-
function defaultDisplay( nodeName ) {
|
8838 |
-
|
8839 |
-
if ( !elemdisplay[ nodeName ] ) {
|
8840 |
-
|
8841 |
-
var body = document.body,
|
8842 |
-
elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
|
8843 |
-
display = elem.css( "display" );
|
8844 |
-
elem.remove();
|
8845 |
-
|
8846 |
-
// If the simple way fails,
|
8847 |
-
// get element's real default display by attaching it to a temp iframe
|
8848 |
-
if ( display === "none" || display === "" ) {
|
8849 |
-
// No iframe to use yet, so create it
|
8850 |
-
if ( !iframe ) {
|
8851 |
-
iframe = document.createElement( "iframe" );
|
8852 |
-
iframe.frameBorder = iframe.width = iframe.height = 0;
|
8853 |
-
}
|
8854 |
-
|
8855 |
-
body.appendChild( iframe );
|
8856 |
-
|
8857 |
-
// Create a cacheable copy of the iframe document on first call.
|
8858 |
-
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
|
8859 |
-
// document to it; WebKit & Firefox won't allow reusing the iframe document.
|
8860 |
-
if ( !iframeDoc || !iframe.createElement ) {
|
8861 |
-
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
|
8862 |
-
iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
|
8863 |
-
iframeDoc.close();
|
8864 |
-
}
|
8865 |
-
|
8866 |
-
elem = iframeDoc.createElement( nodeName );
|
8867 |
-
|
8868 |
-
iframeDoc.body.appendChild( elem );
|
8869 |
-
|
8870 |
-
display = jQuery.css( elem, "display" );
|
8871 |
-
body.removeChild( iframe );
|
8872 |
-
}
|
8873 |
-
|
8874 |
-
// Store the correct default display
|
8875 |
-
elemdisplay[ nodeName ] = display;
|
8876 |
-
}
|
8877 |
-
|
8878 |
-
return elemdisplay[ nodeName ];
|
8879 |
-
}
|
8880 |
-
|
8881 |
-
|
8882 |
-
|
8883 |
-
|
8884 |
-
var rtable = /^t(?:able|d|h)$/i,
|
8885 |
-
rroot = /^(?:body|html)$/i;
|
8886 |
-
|
8887 |
-
if ( "getBoundingClientRect" in document.documentElement ) {
|
8888 |
-
jQuery.fn.offset = function( options ) {
|
8889 |
-
var elem = this[0], box;
|
8890 |
-
|
8891 |
-
if ( options ) {
|
8892 |
-
return this.each(function( i ) {
|
8893 |
-
jQuery.offset.setOffset( this, options, i );
|
8894 |
-
});
|
8895 |
-
}
|
8896 |
-
|
8897 |
-
if ( !elem || !elem.ownerDocument ) {
|
8898 |
-
return null;
|
8899 |
-
}
|
8900 |
-
|
8901 |
-
if ( elem === elem.ownerDocument.body ) {
|
8902 |
-
return jQuery.offset.bodyOffset( elem );
|
8903 |
-
}
|
8904 |
-
|
8905 |
-
try {
|
8906 |
-
box = elem.getBoundingClientRect();
|
8907 |
-
} catch(e) {}
|
8908 |
-
|
8909 |
-
var doc = elem.ownerDocument,
|
8910 |
-
docElem = doc.documentElement;
|
8911 |
-
|
8912 |
-
// Make sure we're not dealing with a disconnected DOM node
|
8913 |
-
if ( !box || !jQuery.contains( docElem, elem ) ) {
|
8914 |
-
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
|
8915 |
-
}
|
8916 |
-
|
8917 |
-
var body = doc.body,
|
8918 |
-
win = getWindow(doc),
|
8919 |
-
clientTop = docElem.clientTop || body.clientTop || 0,
|
8920 |
-
clientLeft = docElem.clientLeft || body.clientLeft || 0,
|
8921 |
-
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
|
8922 |
-
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
|
8923 |
-
top = box.top + scrollTop - clientTop,
|
8924 |
-
left = box.left + scrollLeft - clientLeft;
|
8925 |
-
|
8926 |
-
return { top: top, left: left };
|
8927 |
-
};
|
8928 |
-
|
8929 |
-
} else {
|
8930 |
-
jQuery.fn.offset = function( options ) {
|
8931 |
-
var elem = this[0];
|
8932 |
-
|
8933 |
-
if ( options ) {
|
8934 |
-
return this.each(function( i ) {
|
8935 |
-
jQuery.offset.setOffset( this, options, i );
|
8936 |
-
});
|
8937 |
-
}
|
8938 |
-
|
8939 |
-
if ( !elem || !elem.ownerDocument ) {
|
8940 |
-
return null;
|
8941 |
-
}
|
8942 |
-
|
8943 |
-
if ( elem === elem.ownerDocument.body ) {
|
8944 |
-
return jQuery.offset.bodyOffset( elem );
|
8945 |
-
}
|
8946 |
-
|
8947 |
-
var computedStyle,
|
8948 |
-
offsetParent = elem.offsetParent,
|
8949 |
-
prevOffsetParent = elem,
|
8950 |
-
doc = elem.ownerDocument,
|
8951 |
-
docElem = doc.documentElement,
|
8952 |
-
body = doc.body,
|
8953 |
-
defaultView = doc.defaultView,
|
8954 |
-
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
|
8955 |
-
top = elem.offsetTop,
|
8956 |
-
left = elem.offsetLeft;
|
8957 |
-
|
8958 |
-
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
|
8959 |
-
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
|
8960 |
-
break;
|
8961 |
-
}
|
8962 |
-
|
8963 |
-
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
|
8964 |
-
top -= elem.scrollTop;
|
8965 |
-
left -= elem.scrollLeft;
|
8966 |
-
|
8967 |
-
if ( elem === offsetParent ) {
|
8968 |
-
top += elem.offsetTop;
|
8969 |
-
left += elem.offsetLeft;
|
8970 |
-
|
8971 |
-
if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
|
8972 |
-
top += parseFloat( computedStyle.borderTopWidth ) || 0;
|
8973 |
-
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
|
8974 |
-
}
|
8975 |
-
|
8976 |
-
prevOffsetParent = offsetParent;
|
8977 |
-
offsetParent = elem.offsetParent;
|
8978 |
-
}
|
8979 |
-
|
8980 |
-
if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
|
8981 |
-
top += parseFloat( computedStyle.borderTopWidth ) || 0;
|
8982 |
-
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
|
8983 |
-
}
|
8984 |
-
|
8985 |
-
prevComputedStyle = computedStyle;
|
8986 |
-
}
|
8987 |
-
|
8988 |
-
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
|
8989 |
-
top += body.offsetTop;
|
8990 |
-
left += body.offsetLeft;
|
8991 |
-
}
|
8992 |
-
|
8993 |
-
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
|
8994 |
-
top += Math.max( docElem.scrollTop, body.scrollTop );
|
8995 |
-
left += Math.max( docElem.scrollLeft, body.scrollLeft );
|
8996 |
-
}
|
8997 |
-
|
8998 |
-
return { top: top, left: left };
|
8999 |
-
};
|
9000 |
-
}
|
9001 |
-
|
9002 |
-
jQuery.offset = {
|
9003 |
-
|
9004 |
-
bodyOffset: function( body ) {
|
9005 |
-
var top = body.offsetTop,
|
9006 |
-
left = body.offsetLeft;
|
9007 |
-
|
9008 |
-
if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
|
9009 |
-
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
|
9010 |
-
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
|
9011 |
-
}
|
9012 |
-
|
9013 |
-
return { top: top, left: left };
|
9014 |
-
},
|
9015 |
-
|
9016 |
-
setOffset: function( elem, options, i ) {
|
9017 |
-
var position = jQuery.css( elem, "position" );
|
9018 |
-
|
9019 |
-
// set position first, in-case top/left are set even on static elem
|
9020 |
-
if ( position === "static" ) {
|
9021 |
-
elem.style.position = "relative";
|
9022 |
-
}
|
9023 |
-
|
9024 |
-
var curElem = jQuery( elem ),
|
9025 |
-
curOffset = curElem.offset(),
|
9026 |
-
curCSSTop = jQuery.css( elem, "top" ),
|
9027 |
-
curCSSLeft = jQuery.css( elem, "left" ),
|
9028 |
-
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
|
9029 |
-
props = {}, curPosition = {}, curTop, curLeft;
|
9030 |
-
|
9031 |
-
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
9032 |
-
if ( calculatePosition ) {
|
9033 |
-
curPosition = curElem.position();
|
9034 |
-
curTop = curPosition.top;
|
9035 |
-
curLeft = curPosition.left;
|
9036 |
-
} else {
|
9037 |
-
curTop = parseFloat( curCSSTop ) || 0;
|
9038 |
-
curLeft = parseFloat( curCSSLeft ) || 0;
|
9039 |
-
}
|
9040 |
-
|
9041 |
-
if ( jQuery.isFunction( options ) ) {
|
9042 |
-
options = options.call( elem, i, curOffset );
|
9043 |
-
}
|
9044 |
-
|
9045 |
-
if ( options.top != null ) {
|
9046 |
-
props.top = ( options.top - curOffset.top ) + curTop;
|
9047 |
-
}
|
9048 |
-
if ( options.left != null ) {
|
9049 |
-
props.left = ( options.left - curOffset.left ) + curLeft;
|
9050 |
-
}
|
9051 |
-
|
9052 |
-
if ( "using" in options ) {
|
9053 |
-
options.using.call( elem, props );
|
9054 |
-
} else {
|
9055 |
-
curElem.css( props );
|
9056 |
-
}
|
9057 |
-
}
|
9058 |
-
};
|
9059 |
-
|
9060 |
-
|
9061 |
-
jQuery.fn.extend({
|
9062 |
-
|
9063 |
-
position: function() {
|
9064 |
-
if ( !this[0] ) {
|
9065 |
-
return null;
|
9066 |
-
}
|
9067 |
-
|
9068 |
-
var elem = this[0],
|
9069 |
-
|
9070 |
-
// Get *real* offsetParent
|
9071 |
-
offsetParent = this.offsetParent(),
|
9072 |
-
|
9073 |
-
// Get correct offsets
|
9074 |
-
offset = this.offset(),
|
9075 |
-
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
|
9076 |
-
|
9077 |
-
// Subtract element margins
|
9078 |
-
// note: when an element has margin: auto the offsetLeft and marginLeft
|
9079 |
-
// are the same in Safari causing offset.left to incorrectly be 0
|
9080 |
-
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
|
9081 |
-
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
|
9082 |
-
|
9083 |
-
// Add offsetParent borders
|
9084 |
-
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
|
9085 |
-
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
|
9086 |
-
|
9087 |
-
// Subtract the two offsets
|
9088 |
-
return {
|
9089 |
-
top: offset.top - parentOffset.top,
|
9090 |
-
left: offset.left - parentOffset.left
|
9091 |
-
};
|
9092 |
-
},
|
9093 |
-
|
9094 |
-
offsetParent: function() {
|
9095 |
-
return this.map(function() {
|
9096 |
-
var offsetParent = this.offsetParent || document.body;
|
9097 |
-
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
|
9098 |
-
offsetParent = offsetParent.offsetParent;
|
9099 |
-
}
|
9100 |
-
return offsetParent;
|
9101 |
-
});
|
9102 |
-
}
|
9103 |
-
});
|
9104 |
-
|
9105 |
-
|
9106 |
-
// Create scrollLeft and scrollTop methods
|
9107 |
-
jQuery.each( ["Left", "Top"], function( i, name ) {
|
9108 |
-
var method = "scroll" + name;
|
9109 |
-
|
9110 |
-
jQuery.fn[ method ] = function( val ) {
|
9111 |
-
var elem, win;
|
9112 |
-
|
9113 |
-
if ( val === undefined ) {
|
9114 |
-
elem = this[ 0 ];
|
9115 |
-
|
9116 |
-
if ( !elem ) {
|
9117 |
-
return null;
|
9118 |
-
}
|
9119 |
-
|
9120 |
-
win = getWindow( elem );
|
9121 |
-
|
9122 |
-
// Return the scroll offset
|
9123 |
-
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
|
9124 |
-
jQuery.support.boxModel && win.document.documentElement[ method ] ||
|
9125 |
-
win.document.body[ method ] :
|
9126 |
-
elem[ method ];
|
9127 |
-
}
|
9128 |
-
|
9129 |
-
// Set the scroll offset
|
9130 |
-
return this.each(function() {
|
9131 |
-
win = getWindow( this );
|
9132 |
-
|
9133 |
-
if ( win ) {
|
9134 |
-
win.scrollTo(
|
9135 |
-
!i ? val : jQuery( win ).scrollLeft(),
|
9136 |
-
i ? val : jQuery( win ).scrollTop()
|
9137 |
-
);
|
9138 |
-
|
9139 |
-
} else {
|
9140 |
-
this[ method ] = val;
|
9141 |
-
}
|
9142 |
-
});
|
9143 |
-
};
|
9144 |
-
});
|
9145 |
-
|
9146 |
-
function getWindow( elem ) {
|
9147 |
-
return jQuery.isWindow( elem ) ?
|
9148 |
-
elem :
|
9149 |
-
elem.nodeType === 9 ?
|
9150 |
-
elem.defaultView || elem.parentWindow :
|
9151 |
-
false;
|
9152 |
-
}
|
9153 |
-
|
9154 |
-
|
9155 |
-
|
9156 |
-
|
9157 |
-
// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
|
9158 |
-
jQuery.each([ "Height", "Width" ], function( i, name ) {
|
9159 |
-
|
9160 |
-
var type = name.toLowerCase();
|
9161 |
-
|
9162 |
-
// innerHeight and innerWidth
|
9163 |
-
jQuery.fn[ "inner" + name ] = function() {
|
9164 |
-
var elem = this[0];
|
9165 |
-
return elem ?
|
9166 |
-
elem.style ?
|
9167 |
-
parseFloat( jQuery.css( elem, type, "padding" ) ) :
|
9168 |
-
this[ type ]() :
|
9169 |
-
null;
|
9170 |
-
};
|
9171 |
-
|
9172 |
-
// outerHeight and outerWidth
|
9173 |
-
jQuery.fn[ "outer" + name ] = function( margin ) {
|
9174 |
-
var elem = this[0];
|
9175 |
-
return elem ?
|
9176 |
-
elem.style ?
|
9177 |
-
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
|
9178 |
-
this[ type ]() :
|
9179 |
-
null;
|
9180 |
-
};
|
9181 |
-
|
9182 |
-
jQuery.fn[ type ] = function( size ) {
|
9183 |
-
// Get window width or height
|
9184 |
-
var elem = this[0];
|
9185 |
-
if ( !elem ) {
|
9186 |
-
return size == null ? null : this;
|
9187 |
-
}
|
9188 |
-
|
9189 |
-
if ( jQuery.isFunction( size ) ) {
|
9190 |
-
return this.each(function( i ) {
|
9191 |
-
var self = jQuery( this );
|
9192 |
-
self[ type ]( size.call( this, i, self[ type ]() ) );
|
9193 |
-
});
|
9194 |
-
}
|
9195 |
-
|
9196 |
-
if ( jQuery.isWindow( elem ) ) {
|
9197 |
-
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
|
9198 |
-
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
|
9199 |
-
var docElemProp = elem.document.documentElement[ "client" + name ],
|
9200 |
-
body = elem.document.body;
|
9201 |
-
return elem.document.compatMode === "CSS1Compat" && docElemProp ||
|
9202 |
-
body && body[ "client" + name ] || docElemProp;
|
9203 |
-
|
9204 |
-
// Get document width or height
|
9205 |
-
} else if ( elem.nodeType === 9 ) {
|
9206 |
-
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
|
9207 |
-
return Math.max(
|
9208 |
-
elem.documentElement["client" + name],
|
9209 |
-
elem.body["scroll" + name], elem.documentElement["scroll" + name],
|
9210 |
-
elem.body["offset" + name], elem.documentElement["offset" + name]
|
9211 |
-
);
|
9212 |
-
|
9213 |
-
// Get or set width or height on the element
|
9214 |
-
} else if ( size === undefined ) {
|
9215 |
-
var orig = jQuery.css( elem, type ),
|
9216 |
-
ret = parseFloat( orig );
|
9217 |
-
|
9218 |
-
return jQuery.isNumeric( ret ) ? ret : orig;
|
9219 |
-
|
9220 |
-
// Set the width or height on the element (default to pixels if value is unitless)
|
9221 |
-
} else {
|
9222 |
-
return this.css( type, typeof size === "string" ? size : size + "px" );
|
9223 |
-
}
|
9224 |
-
};
|
9225 |
-
|
9226 |
-
});
|
9227 |
-
|
9228 |
-
|
9229 |
-
|
9230 |
-
|
9231 |
-
// Expose jQuery to the global object
|
9232 |
-
window.jQuery = window.$ = jQuery;
|
9233 |
-
|
9234 |
-
// Expose jQuery as an AMD module, but only for AMD loaders that
|
9235 |
-
// understand the issues with loading multiple versions of jQuery
|
9236 |
-
// in a page that all might call define(). The loader will indicate
|
9237 |
-
// they have special allowances for multiple jQuery versions by
|
9238 |
-
// specifying define.amd.jQuery = true. Register as a named module,
|
9239 |
-
// since jQuery can be concatenated with other files that may use define,
|
9240 |
-
// but not use a proper concatenation script that understands anonymous
|
9241 |
-
// AMD modules. A named AMD is safest and most robust way to register.
|
9242 |
-
// Lowercase jquery is used because AMD module names are derived from
|
9243 |
-
// file names, and jQuery is normally delivered in a lowercase file name.
|
9244 |
-
// Do this after creating the global so that if an AMD module wants to call
|
9245 |
-
// noConflict to hide this version of jQuery, it will work.
|
9246 |
-
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
|
9247 |
-
define( "jquery", [], function () { return jQuery; } );
|
9248 |
-
}
|
9249 |
-
|
9250 |
-
|
9251 |
-
|
9252 |
-
})( window );
|
1 |
+
/*! jQuery v1.7.1 jquery.com | jquery.org/license */
|
2 |
+
(function( window, undefined ) {
|
3 |
+
|
4 |
+
// Use the correct document accordingly with window argument (sandbox)
|
5 |
+
var document = window.document,
|
6 |
+
navigator = window.navigator,
|
7 |
+
location = window.location;
|
8 |
+
var jQuery = (function() {
|
9 |
+
|
10 |
+
// Define a local copy of jQuery
|
11 |
+
var jQuery = function( selector, context ) {
|
12 |
+
// The jQuery object is actually just the init constructor 'enhanced'
|
13 |
+
return new jQuery.fn.init( selector, context, rootjQuery );
|
14 |
+
},
|
15 |
+
|
16 |
+
// Map over jQuery in case of overwrite
|
17 |
+
_jQuery = window.jQuery,
|
18 |
+
|
19 |
+
// Map over the $ in case of overwrite
|
20 |
+
_$ = window.$,
|
21 |
+
|
22 |
+
// A central reference to the root jQuery(document)
|
23 |
+
rootjQuery,
|
24 |
+
|
25 |
+
// A simple way to check for HTML strings or ID strings
|
26 |
+
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
27 |
+
quickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
|
28 |
+
|
29 |
+
// Check if a string has a non-whitespace character in it
|
30 |
+
rnotwhite = /\S/,
|
31 |
+
|
32 |
+
// Used for trimming whitespace
|
33 |
+
trimLeft = /^\s+/,
|
34 |
+
trimRight = /\s+$/,
|
35 |
+
|
36 |
+
// Match a standalone tag
|
37 |
+
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
|
38 |
+
|
39 |
+
// JSON RegExp
|
40 |
+
rvalidchars = /^[\],:{}\s]*$/,
|
41 |
+
rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
|
42 |
+
rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
|
43 |
+
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
|
44 |
+
|
45 |
+
// Useragent RegExp
|
46 |
+
rwebkit = /(webkit)[ \/]([\w.]+)/,
|
47 |
+
ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
|
48 |
+
rmsie = /(msie) ([\w.]+)/,
|
49 |
+
rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
|
50 |
+
|
51 |
+
// Matches dashed string for camelizing
|
52 |
+
rdashAlpha = /-([a-z]|[0-9])/ig,
|
53 |
+
rmsPrefix = /^-ms-/,
|
54 |
+
|
55 |
+
// Used by jQuery.camelCase as callback to replace()
|
56 |
+
fcamelCase = function( all, letter ) {
|
57 |
+
return ( letter + "" ).toUpperCase();
|
58 |
+
},
|
59 |
+
|
60 |
+
// Keep a UserAgent string for use with jQuery.browser
|
61 |
+
userAgent = navigator.userAgent,
|
62 |
+
|
63 |
+
// For matching the engine and version of the browser
|
64 |
+
browserMatch,
|
65 |
+
|
66 |
+
// The deferred used on DOM ready
|
67 |
+
readyList,
|
68 |
+
|
69 |
+
// The ready event handler
|
70 |
+
DOMContentLoaded,
|
71 |
+
|
72 |
+
// Save a reference to some core methods
|
73 |
+
toString = Object.prototype.toString,
|
74 |
+
hasOwn = Object.prototype.hasOwnProperty,
|
75 |
+
push = Array.prototype.push,
|
76 |
+
slice = Array.prototype.slice,
|
77 |
+
trim = String.prototype.trim,
|
78 |
+
indexOf = Array.prototype.indexOf,
|
79 |
+
|
80 |
+
// [[Class]] -> type pairs
|
81 |
+
class2type = {};
|
82 |
+
|
83 |
+
jQuery.fn = jQuery.prototype = {
|
84 |
+
constructor: jQuery,
|
85 |
+
init: function( selector, context, rootjQuery ) {
|
86 |
+
var match, elem, ret, doc;
|
87 |
+
|
88 |
+
// Handle $(""), $(null), or $(undefined)
|
89 |
+
if ( !selector ) {
|
90 |
+
return this;
|
91 |
+
}
|
92 |
+
|
93 |
+
// Handle $(DOMElement)
|
94 |
+
if ( selector.nodeType ) {
|
95 |
+
this.context = this[0] = selector;
|
96 |
+
this.length = 1;
|
97 |
+
return this;
|
98 |
+
}
|
99 |
+
|
100 |
+
// The body element only exists once, optimize finding it
|
101 |
+
if ( selector === "body" && !context && document.body ) {
|
102 |
+
this.context = document;
|
103 |
+
this[0] = document.body;
|
104 |
+
this.selector = selector;
|
105 |
+
this.length = 1;
|
106 |
+
return this;
|
107 |
+
}
|
108 |
+
|
109 |
+
// Handle HTML strings
|
110 |
+
if ( typeof selector === "string" ) {
|
111 |
+
// Are we dealing with HTML string or an ID?
|
112 |
+
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
|
113 |
+
// Assume that strings that start and end with <> are HTML and skip the regex check
|
114 |
+
match = [ null, selector, null ];
|
115 |
+
|
116 |
+
} else {
|
117 |
+
match = quickExpr.exec( selector );
|
118 |
+
}
|
119 |
+
|
120 |
+
// Verify a match, and that no context was specified for #id
|
121 |
+
if ( match && (match[1] || !context) ) {
|
122 |
+
|
123 |
+
// HANDLE: $(html) -> $(array)
|
124 |
+
if ( match[1] ) {
|
125 |
+
context = context instanceof jQuery ? context[0] : context;
|
126 |
+
doc = ( context ? context.ownerDocument || context : document );
|
127 |
+
|
128 |
+
// If a single string is passed in and it's a single tag
|
129 |
+
// just do a createElement and skip the rest
|
130 |
+
ret = rsingleTag.exec( selector );
|
131 |
+
|
132 |
+
if ( ret ) {
|
133 |
+
if ( jQuery.isPlainObject( context ) ) {
|
134 |
+
selector = [ document.createElement( ret[1] ) ];
|
135 |
+
jQuery.fn.attr.call( selector, context, true );
|
136 |
+
|
137 |
+
} else {
|
138 |
+
selector = [ doc.createElement( ret[1] ) ];
|
139 |
+
}
|
140 |
+
|
141 |
+
} else {
|
142 |
+
ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
|
143 |
+
selector = ( ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment ).childNodes;
|
144 |
+
}
|
145 |
+
|
146 |
+
return jQuery.merge( this, selector );
|
147 |
+
|
148 |
+
// HANDLE: $("#id")
|
149 |
+
} else {
|
150 |
+
elem = document.getElementById( match[2] );
|
151 |
+
|
152 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
153 |
+
// nodes that are no longer in the document #6963
|
154 |
+
if ( elem && elem.parentNode ) {
|
155 |
+
// Handle the case where IE and Opera return items
|
156 |
+
// by name instead of ID
|
157 |
+
if ( elem.id !== match[2] ) {
|
158 |
+
return rootjQuery.find( selector );
|
159 |
+
}
|
160 |
+
|
161 |
+
// Otherwise, we inject the element directly into the jQuery object
|
162 |
+
this.length = 1;
|
163 |
+
this[0] = elem;
|
164 |
+
}
|
165 |
+
|
166 |
+
this.context = document;
|
167 |
+
this.selector = selector;
|
168 |
+
return this;
|
169 |
+
}
|
170 |
+
|
171 |
+
// HANDLE: $(expr, $(...))
|
172 |
+
} else if ( !context || context.jquery ) {
|
173 |
+
return ( context || rootjQuery ).find( selector );
|
174 |
+
|
175 |
+
// HANDLE: $(expr, context)
|
176 |
+
// (which is just equivalent to: $(context).find(expr)
|
177 |
+
} else {
|
178 |
+
return this.constructor( context ).find( selector );
|
179 |
+
}
|
180 |
+
|
181 |
+
// HANDLE: $(function)
|
182 |
+
// Shortcut for document ready
|
183 |
+
} else if ( jQuery.isFunction( selector ) ) {
|
184 |
+
return rootjQuery.ready( selector );
|
185 |
+
}
|
186 |
+
|
187 |
+
if ( selector.selector !== undefined ) {
|
188 |
+
this.selector = selector.selector;
|
189 |
+
this.context = selector.context;
|
190 |
+
}
|
191 |
+
|
192 |
+
return jQuery.makeArray( selector, this );
|
193 |
+
},
|
194 |
+
|
195 |
+
// Start with an empty selector
|
196 |
+
selector: "",
|
197 |
+
|
198 |
+
// The current version of jQuery being used
|
199 |
+
jquery: "1.7.1",
|
200 |
+
|
201 |
+
// The default length of a jQuery object is 0
|
202 |
+
length: 0,
|
203 |
+
|
204 |
+
// The number of elements contained in the matched element set
|
205 |
+
size: function() {
|
206 |
+
return this.length;
|
207 |
+
},
|
208 |
+
|
209 |
+
toArray: function() {
|
210 |
+
return slice.call( this, 0 );
|
211 |
+
},
|
212 |
+
|
213 |
+
// Get the Nth element in the matched element set OR
|
214 |
+
// Get the whole matched element set as a clean array
|
215 |
+
get: function( num ) {
|
216 |
+
return num == null ?
|
217 |
+
|
218 |
+
// Return a 'clean' array
|
219 |
+
this.toArray() :
|
220 |
+
|
221 |
+
// Return just the object
|
222 |
+
( num < 0 ? this[ this.length + num ] : this[ num ] );
|
223 |
+
},
|
224 |
+
|
225 |
+
// Take an array of elements and push it onto the stack
|
226 |
+
// (returning the new matched element set)
|
227 |
+
pushStack: function( elems, name, selector ) {
|
228 |
+
// Build a new jQuery matched element set
|
229 |
+
var ret = this.constructor();
|
230 |
+
|
231 |
+
if ( jQuery.isArray( elems ) ) {
|
232 |
+
push.apply( ret, elems );
|
233 |
+
|
234 |
+
} else {
|
235 |
+
jQuery.merge( ret, elems );
|
236 |
+
}
|
237 |
+
|
238 |
+
// Add the old object onto the stack (as a reference)
|
239 |
+
ret.prevObject = this;
|
240 |
+
|
241 |
+
ret.context = this.context;
|
242 |
+
|
243 |
+
if ( name === "find" ) {
|
244 |
+
ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
|
245 |
+
} else if ( name ) {
|
246 |
+
ret.selector = this.selector + "." + name + "(" + selector + ")";
|
247 |
+
}
|
248 |
+
|
249 |
+
// Return the newly-formed element set
|
250 |
+
return ret;
|
251 |
+
},
|
252 |
+
|
253 |
+
// Execute a callback for every element in the matched set.
|
254 |
+
// (You can seed the arguments with an array of args, but this is
|
255 |
+
// only used internally.)
|
256 |
+
each: function( callback, args ) {
|
257 |
+
return jQuery.each( this, callback, args );
|
258 |
+
},
|
259 |
+
|
260 |
+
ready: function( fn ) {
|
261 |
+
// Attach the listeners
|
262 |
+
jQuery.bindReady();
|
263 |
+
|
264 |
+
// Add the callback
|
265 |
+
readyList.add( fn );
|
266 |
+
|
267 |
+
return this;
|
268 |
+
},
|
269 |
+
|
270 |
+
eq: function( i ) {
|
271 |
+
i = +i;
|
272 |
+
return i === -1 ?
|
273 |
+
this.slice( i ) :
|
274 |
+
this.slice( i, i + 1 );
|
275 |
+
},
|
276 |
+
|
277 |
+
first: function() {
|
278 |
+
return this.eq( 0 );
|
279 |
+
},
|
280 |
+
|
281 |
+
last: function() {
|
282 |
+
return this.eq( -1 );
|
283 |
+
},
|
284 |
+
|
285 |
+
slice: function() {
|
286 |
+
return this.pushStack( slice.apply( this, arguments ),
|
287 |
+
"slice", slice.call(arguments).join(",") );
|
288 |
+
},
|
289 |
+
|
290 |
+
map: function( callback ) {
|
291 |
+
return this.pushStack( jQuery.map(this, function( elem, i ) {
|
292 |
+
return callback.call( elem, i, elem );
|
293 |
+
}));
|
294 |
+
},
|
295 |
+
|
296 |
+
end: function() {
|
297 |
+
return this.prevObject || this.constructor(null);
|
298 |
+
},
|
299 |
+
|
300 |
+
// For internal use only.
|
301 |
+
// Behaves like an Array's method, not like a jQuery method.
|
302 |
+
push: push,
|
303 |
+
sort: [].sort,
|
304 |
+
splice: [].splice
|
305 |
+
};
|
306 |
+
|
307 |
+
// Give the init function the jQuery prototype for later instantiation
|
308 |
+
jQuery.fn.init.prototype = jQuery.fn;
|
309 |
+
|
310 |
+
jQuery.extend = jQuery.fn.extend = function() {
|
311 |
+
var options, name, src, copy, copyIsArray, clone,
|
312 |
+
target = arguments[0] || {},
|
313 |
+
i = 1,
|
314 |
+
length = arguments.length,
|
315 |
+
deep = false;
|
316 |
+
|
317 |
+
// Handle a deep copy situation
|
318 |
+
if ( typeof target === "boolean" ) {
|
319 |
+
deep = target;
|
320 |
+
target = arguments[1] || {};
|
321 |
+
// skip the boolean and the target
|
322 |
+
i = 2;
|
323 |
+
}
|
324 |
+
|
325 |
+
// Handle case when target is a string or something (possible in deep copy)
|
326 |
+
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
327 |
+
target = {};
|
328 |
+
}
|
329 |
+
|
330 |
+
// extend jQuery itself if only one argument is passed
|
331 |
+
if ( length === i ) {
|
332 |
+
target = this;
|
333 |
+
--i;
|
334 |
+
}
|
335 |
+
|
336 |
+
for ( ; i < length; i++ ) {
|
337 |
+
// Only deal with non-null/undefined values
|
338 |
+
if ( (options = arguments[ i ]) != null ) {
|
339 |
+
// Extend the base object
|
340 |
+
for ( name in options ) {
|
341 |
+
src = target[ name ];
|
342 |
+
copy = options[ name ];
|
343 |
+
|
344 |
+
// Prevent never-ending loop
|
345 |
+
if ( target === copy ) {
|
346 |
+
continue;
|
347 |
+
}
|
348 |
+
|
349 |
+
// Recurse if we're merging plain objects or arrays
|
350 |
+
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
351 |
+
if ( copyIsArray ) {
|
352 |
+
copyIsArray = false;
|
353 |
+
clone = src && jQuery.isArray(src) ? src : [];
|
354 |
+
|
355 |
+
} else {
|
356 |
+
clone = src && jQuery.isPlainObject(src) ? src : {};
|
357 |
+
}
|
358 |
+
|
359 |
+
// Never move original objects, clone them
|
360 |
+
target[ name ] = jQuery.extend( deep, clone, copy );
|
361 |
+
|
362 |
+
// Don't bring in undefined values
|
363 |
+
} else if ( copy !== undefined ) {
|
364 |
+
target[ name ] = copy;
|
365 |
+
}
|
366 |
+
}
|
367 |
+
}
|
368 |
+
}
|
369 |
+
|
370 |
+
// Return the modified object
|
371 |
+
return target;
|
372 |
+
};
|
373 |
+
|
374 |
+
jQuery.extend({
|
375 |
+
noConflict: function( deep ) {
|
376 |
+
if ( window.$ === jQuery ) {
|
377 |
+
window.$ = _$;
|
378 |
+
}
|
379 |
+
|
380 |
+
if ( deep && window.jQuery === jQuery ) {
|
381 |
+
window.jQuery = _jQuery;
|
382 |
+
}
|
383 |
+
|
384 |
+
return jQuery;
|
385 |
+
},
|
386 |
+
|
387 |
+
// Is the DOM ready to be used? Set to true once it occurs.
|
388 |
+
isReady: false,
|
389 |
+
|
390 |
+
// A counter to track how many items to wait for before
|
391 |
+
// the ready event fires. See #6781
|
392 |
+
readyWait: 1,
|
393 |
+
|
394 |
+
// Hold (or release) the ready event
|
395 |
+
holdReady: function( hold ) {
|
396 |
+
if ( hold ) {
|
397 |
+
jQuery.readyWait++;
|
398 |
+
} else {
|
399 |
+
jQuery.ready( true );
|
400 |
+
}
|
401 |
+
},
|
402 |
+
|
403 |
+
// Handle when the DOM is ready
|
404 |
+
ready: function( wait ) {
|
405 |
+
// Either a released hold or an DOMready/load event and not yet ready
|
406 |
+
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
|
407 |
+
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
|
408 |
+
if ( !document.body ) {
|
409 |
+
return setTimeout( jQuery.ready, 1 );
|
410 |
+
}
|
411 |
+
|
412 |
+
// Remember that the DOM is ready
|
413 |
+
jQuery.isReady = true;
|
414 |
+
|
415 |
+
// If a normal DOM Ready event fired, decrement, and wait if need be
|
416 |
+
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
417 |
+
return;
|
418 |
+
}
|
419 |
+
|
420 |
+
// If there are functions bound, to execute
|
421 |
+
readyList.fireWith( document, [ jQuery ] );
|
422 |
+
|
423 |
+
// Trigger any bound ready events
|
424 |
+
if ( jQuery.fn.trigger ) {
|
425 |
+
jQuery( document ).trigger( "ready" ).off( "ready" );
|
426 |
+
}
|
427 |
+
}
|
428 |
+
},
|
429 |
+
|
430 |
+
bindReady: function() {
|
431 |
+
if ( readyList ) {
|
432 |
+
return;
|
433 |
+
}
|
434 |
+
|
435 |
+
readyList = jQuery.Callbacks( "once memory" );
|
436 |
+
|
437 |
+
// Catch cases where $(document).ready() is called after the
|
438 |
+
// browser event has already occurred.
|
439 |
+
if ( document.readyState === "complete" ) {
|
440 |
+
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
441 |
+
return setTimeout( jQuery.ready, 1 );
|
442 |
+
}
|
443 |
+
|
444 |
+
// Mozilla, Opera and webkit nightlies currently support this event
|
445 |
+
if ( document.addEventListener ) {
|
446 |
+
// Use the handy event callback
|
447 |
+
document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
448 |
+
|
449 |
+
// A fallback to window.onload, that will always work
|
450 |
+
window.addEventListener( "load", jQuery.ready, false );
|
451 |
+
|
452 |
+
// If IE event model is used
|
453 |
+
} else if ( document.attachEvent ) {
|
454 |
+
// ensure firing before onload,
|
455 |
+
// maybe late but safe also for iframes
|
456 |
+
document.attachEvent( "onreadystatechange", DOMContentLoaded );
|
457 |
+
|
458 |
+
// A fallback to window.onload, that will always work
|
459 |
+
window.attachEvent( "onload", jQuery.ready );
|
460 |
+
|
461 |
+
// If IE and not a frame
|
462 |
+
// continually check to see if the document is ready
|
463 |
+
var toplevel = false;
|
464 |
+
|
465 |
+
try {
|
466 |
+
toplevel = window.frameElement == null;
|
467 |
+
} catch(e) {}
|
468 |
+
|
469 |
+
if ( document.documentElement.doScroll && toplevel ) {
|
470 |
+
doScrollCheck();
|
471 |
+
}
|
472 |
+
}
|
473 |
+
},
|
474 |
+
|
475 |
+
// See test/unit/core.js for details concerning isFunction.
|
476 |
+
// Since version 1.3, DOM methods and functions like alert
|
477 |
+
// aren't supported. They return false on IE (#2968).
|
478 |
+
isFunction: function( obj ) {
|
479 |
+
return jQuery.type(obj) === "function";
|
480 |
+
},
|
481 |
+
|
482 |
+
isArray: Array.isArray || function( obj ) {
|
483 |
+
return jQuery.type(obj) === "array";
|
484 |
+
},
|
485 |
+
|
486 |
+
// A crude way of determining if an object is a window
|
487 |
+
isWindow: function( obj ) {
|
488 |
+
return obj && typeof obj === "object" && "setInterval" in obj;
|
489 |
+
},
|
490 |
+
|
491 |
+
isNumeric: function( obj ) {
|
492 |
+
return !isNaN( parseFloat(obj) ) && isFinite( obj );
|
493 |
+
},
|
494 |
+
|
495 |
+
type: function( obj ) {
|
496 |
+
return obj == null ?
|
497 |
+
String( obj ) :
|
498 |
+
class2type[ toString.call(obj) ] || "object";
|
499 |
+
},
|
500 |
+
|
501 |
+
isPlainObject: function( obj ) {
|
502 |
+
// Must be an Object.
|
503 |
+
// Because of IE, we also have to check the presence of the constructor property.
|
504 |
+
// Make sure that DOM nodes and window objects don't pass through, as well
|
505 |
+
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
506 |
+
return false;
|
507 |
+
}
|
508 |
+
|
509 |
+
try {
|
510 |
+
// Not own constructor property must be Object
|
511 |
+
if ( obj.constructor &&
|
512 |
+
!hasOwn.call(obj, "constructor") &&
|
513 |
+
!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
|
514 |
+
return false;
|
515 |
+
}
|
516 |
+
} catch ( e ) {
|
517 |
+
// IE8,9 Will throw exceptions on certain host objects #9897
|
518 |
+
return false;
|
519 |
+
}
|
520 |
+
|
521 |
+
// Own properties are enumerated firstly, so to speed up,
|
522 |
+
// if last one is own, then all properties are own.
|
523 |
+
|
524 |
+
var key;
|
525 |
+
for ( key in obj ) {}
|
526 |
+
|
527 |
+
return key === undefined || hasOwn.call( obj, key );
|
528 |
+
},
|
529 |
+
|
530 |
+
isEmptyObject: function( obj ) {
|
531 |
+
for ( var name in obj ) {
|
532 |
+
return false;
|
533 |
+
}
|
534 |
+
return true;
|
535 |
+
},
|
536 |
+
|
537 |
+
error: function( msg ) {
|
538 |
+
throw new Error( msg );
|
539 |
+
},
|
540 |
+
|
541 |
+
parseJSON: function( data ) {
|
542 |
+
if ( typeof data !== "string" || !data ) {
|
543 |
+
return null;
|
544 |
+
}
|
545 |
+
|
546 |
+
// Make sure leading/trailing whitespace is removed (IE can't handle it)
|
547 |
+
data = jQuery.trim( data );
|
548 |
+
|
549 |
+
// Attempt to parse using the native JSON parser first
|
550 |
+
if ( window.JSON && window.JSON.parse ) {
|
551 |
+
return window.JSON.parse( data );
|
552 |
+
}
|
553 |
+
|
554 |
+
// Make sure the incoming data is actual JSON
|
555 |
+
// Logic borrowed from http://json.org/json2.js
|
556 |
+
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
|
557 |
+
.replace( rvalidtokens, "]" )
|
558 |
+
.replace( rvalidbraces, "")) ) {
|
559 |
+
|
560 |
+
return ( new Function( "return " + data ) )();
|
561 |
+
|
562 |
+
}
|
563 |
+
jQuery.error( "Invalid JSON: " + data );
|
564 |
+
},
|
565 |
+
|
566 |
+
// Cross-browser xml parsing
|
567 |
+
parseXML: function( data ) {
|
568 |
+
var xml, tmp;
|
569 |
+
try {
|
570 |
+
if ( window.DOMParser ) { // Standard
|
571 |
+
tmp = new DOMParser();
|
572 |
+
xml = tmp.parseFromString( data , "text/xml" );
|
573 |
+
} else { // IE
|
574 |
+
xml = new ActiveXObject( "Microsoft.XMLDOM" );
|
575 |
+
xml.async = "false";
|
576 |
+
xml.loadXML( data );
|
577 |
+
}
|
578 |
+
} catch( e ) {
|
579 |
+
xml = undefined;
|
580 |
+
}
|
581 |
+
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
|
582 |
+
jQuery.error( "Invalid XML: " + data );
|
583 |
+
}
|
584 |
+
return xml;
|
585 |
+
},
|
586 |
+
|
587 |
+
noop: function() {},
|
588 |
+
|
589 |
+
// Evaluates a script in a global context
|
590 |
+
// Workarounds based on findings by Jim Driscoll
|
591 |
+
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
|
592 |
+
globalEval: function( data ) {
|
593 |
+
if ( data && rnotwhite.test( data ) ) {
|
594 |
+
// We use execScript on Internet Explorer
|
595 |
+
// We use an anonymous function so that context is window
|
596 |
+
// rather than jQuery in Firefox
|
597 |
+
( window.execScript || function( data ) {
|
598 |
+
window[ "eval" ].call( window, data );
|
599 |
+
} )( data );
|
600 |
+
}
|
601 |
+
},
|
602 |
+
|
603 |
+
// Convert dashed to camelCase; used by the css and data modules
|
604 |
+
// Microsoft forgot to hump their vendor prefix (#9572)
|
605 |
+
camelCase: function( string ) {
|
606 |
+
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
607 |
+
},
|
608 |
+
|
609 |
+
nodeName: function( elem, name ) {
|
610 |
+
return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase();
|
611 |
+
},
|
612 |
+
|
613 |
+
// args is for internal usage only
|
614 |
+
each: function( object, callback, args ) {
|
615 |
+
var name, i = 0,
|
616 |
+
length = object.length,
|
617 |
+
isObj = length === undefined || jQuery.isFunction( object );
|
618 |
+
|
619 |
+
if ( args ) {
|
620 |
+
if ( isObj ) {
|
621 |
+
for ( name in object ) {
|
622 |
+
if ( callback.apply( object[ name ], args ) === false ) {
|
623 |
+
break;
|
624 |
+
}
|
625 |
+
}
|
626 |
+
} else {
|
627 |
+
for ( ; i < length; ) {
|
628 |
+
if ( callback.apply( object[ i++ ], args ) === false ) {
|
629 |
+
break;
|
630 |
+
}
|
631 |
+
}
|
632 |
+
}
|
633 |
+
|
634 |
+
// A special, fast, case for the most common use of each
|
635 |
+
} else {
|
636 |
+
if ( isObj ) {
|
637 |
+
for ( name in object ) {
|
638 |
+
if ( callback.call( object[ name ], name, object[ name ] ) === false ) {
|
639 |
+
break;
|
640 |
+
}
|
641 |
+
}
|
642 |
+
} else {
|
643 |
+
for ( ; i < length; ) {
|
644 |
+
if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
|
645 |
+
break;
|
646 |
+
}
|
647 |
+
}
|
648 |
+
}
|
649 |
+
}
|
650 |
+
|
651 |
+
return object;
|
652 |
+
},
|
653 |
+
|
654 |
+
// Use native String.trim function wherever possible
|
655 |
+
trim: trim ?
|
656 |
+
function( text ) {
|
657 |
+
return text == null ?
|
658 |
+
"" :
|
659 |
+
trim.call( text );
|
660 |
+
} :
|
661 |
+
|
662 |
+
// Otherwise use our own trimming functionality
|
663 |
+
function( text ) {
|
664 |
+
return text == null ?
|
665 |
+
"" :
|
666 |
+
text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
|
667 |
+
},
|
668 |
+
|
669 |
+
// results is for internal usage only
|
670 |
+
makeArray: function( array, results ) {
|
671 |
+
var ret = results || [];
|
672 |
+
|
673 |
+
if ( array != null ) {
|
674 |
+
// The window, strings (and functions) also have 'length'
|
675 |
+
// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
|
676 |
+
var type = jQuery.type( array );
|
677 |
+
|
678 |
+
if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
|
679 |
+
push.call( ret, array );
|
680 |
+
} else {
|
681 |
+
jQuery.merge( ret, array );
|
682 |
+
}
|
683 |
+
}
|
684 |
+
|
685 |
+
return ret;
|
686 |
+
},
|
687 |
+
|
688 |
+
inArray: function( elem, array, i ) {
|
689 |
+
var len;
|
690 |
+
|
691 |
+
if ( array ) {
|
692 |
+
if ( indexOf ) {
|
693 |
+
return indexOf.call( array, elem, i );
|
694 |
+
}
|
695 |
+
|
696 |
+
len = array.length;
|
697 |
+
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
|
698 |
+
|
699 |
+
for ( ; i < len; i++ ) {
|
700 |
+
// Skip accessing in sparse arrays
|
701 |
+
if ( i in array && array[ i ] === elem ) {
|
702 |
+
return i;
|
703 |
+
}
|
704 |
+
}
|
705 |
+
}
|
706 |
+
|
707 |
+
return -1;
|
708 |
+
},
|
709 |
+
|
710 |
+
merge: function( first, second ) {
|
711 |
+
var i = first.length,
|
712 |
+
j = 0;
|
713 |
+
|
714 |
+
if ( typeof second.length === "number" ) {
|
715 |
+
for ( var l = second.length; j < l; j++ ) {
|
716 |
+
first[ i++ ] = second[ j ];
|
717 |
+
}
|
718 |
+
|
719 |
+
} else {
|
720 |
+
while ( second[j] !== undefined ) {
|
721 |
+
first[ i++ ] = second[ j++ ];
|
722 |
+
}
|
723 |
+
}
|
724 |
+
|
725 |
+
first.length = i;
|
726 |
+
|
727 |
+
return first;
|
728 |
+
},
|
729 |
+
|
730 |
+
grep: function( elems, callback, inv ) {
|
731 |
+
var ret = [], retVal;
|
732 |
+
inv = !!inv;
|
733 |
+
|
734 |
+
// Go through the array, only saving the items
|
735 |
+
// that pass the validator function
|
736 |
+
for ( var i = 0, length = elems.length; i < length; i++ ) {
|
737 |
+
retVal = !!callback( elems[ i ], i );
|
738 |
+
if ( inv !== retVal ) {
|
739 |
+
ret.push( elems[ i ] );
|
740 |
+
}
|
741 |
+
}
|
742 |
+
|
743 |
+
return ret;
|
744 |
+
},
|
745 |
+
|
746 |
+
// arg is for internal usage only
|
747 |
+
map: function( elems, callback, arg ) {
|
748 |
+
var value, key, ret = [],
|
749 |
+
i = 0,
|
750 |
+
length = elems.length,
|
751 |
+
// jquery objects are treated as arrays
|
752 |
+
isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
|
753 |
+
|
754 |
+
// Go through the array, translating each of the items to their
|
755 |
+
if ( isArray ) {
|
756 |
+
for ( ; i < length; i++ ) {
|
757 |
+
value = callback( elems[ i ], i, arg );
|
758 |
+
|
759 |
+
if ( value != null ) {
|
760 |
+
ret[ ret.length ] = value;
|
761 |
+
}
|
762 |
+
}
|
763 |
+
|
764 |
+
// Go through every key on the object
|
765 |
+
} else {
|
766 |
+
for ( key in elems ) {
|
767 |
+
value = callback( elems[ key ], key, arg );
|
768 |
+
|
769 |
+
if ( value != null ) {
|
770 |
+
ret[ ret.length ] = value;
|
771 |
+
}
|
772 |
+
}
|
773 |
+
}
|
774 |
+
|
775 |
+
// Flatten any nested arrays
|
776 |
+
return ret.concat.apply( [], ret );
|
777 |
+
},
|
778 |
+
|
779 |
+
// A global GUID counter for objects
|
780 |
+
guid: 1,
|
781 |
+
|
782 |
+
// Bind a function to a context, optionally partially applying any
|
783 |
+
// arguments.
|
784 |
+
proxy: function( fn, context ) {
|
785 |
+
if ( typeof context === "string" ) {
|
786 |
+
var tmp = fn[ context ];
|
787 |
+
context = fn;
|
788 |
+
fn = tmp;
|
789 |
+
}
|
790 |
+
|
791 |
+
// Quick check to determine if target is callable, in the spec
|
792 |
+
// this throws a TypeError, but we will just return undefined.
|
793 |
+
if ( !jQuery.isFunction( fn ) ) {
|
794 |
+
return undefined;
|
795 |
+
}
|
796 |
+
|
797 |
+
// Simulated bind
|
798 |
+
var args = slice.call( arguments, 2 ),
|
799 |
+
proxy = function() {
|
800 |
+
return fn.apply( context, args.concat( slice.call( arguments ) ) );
|
801 |
+
};
|
802 |
+
|
803 |
+
// Set the guid of unique handler to the same of original handler, so it can be removed
|
804 |
+
proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
|
805 |
+
|
806 |
+
return proxy;
|
807 |
+
},
|
808 |
+
|
809 |
+
// Mutifunctional method to get and set values to a collection
|
810 |
+
// The value/s can optionally be executed if it's a function
|
811 |
+
access: function( elems, key, value, exec, fn, pass ) {
|
812 |
+
var length = elems.length;
|
813 |
+
|
814 |
+
// Setting many attributes
|
815 |
+
if ( typeof key === "object" ) {
|
816 |
+
for ( var k in key ) {
|
817 |
+
jQuery.access( elems, k, key[k], exec, fn, value );
|
818 |
+
}
|
819 |
+
return elems;
|
820 |
+
}
|
821 |
+
|
822 |
+
// Setting one attribute
|
823 |
+
if ( value !== undefined ) {
|
824 |
+
// Optionally, function values get executed if exec is true
|
825 |
+
exec = !pass && exec && jQuery.isFunction(value);
|
826 |
+
|
827 |
+
for ( var i = 0; i < length; i++ ) {
|
828 |
+
fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
|
829 |
+
}
|
830 |
+
|
831 |
+
return elems;
|
832 |
+
}
|
833 |
+
|
834 |
+
// Getting an attribute
|
835 |
+
return length ? fn( elems[0], key ) : undefined;
|
836 |
+
},
|
837 |
+
|
838 |
+
now: function() {
|
839 |
+
return ( new Date() ).getTime();
|
840 |
+
},
|
841 |
+
|
842 |
+
// Use of jQuery.browser is frowned upon.
|
843 |
+
// More details: http://docs.jquery.com/Utilities/jQuery.browser
|
844 |
+
uaMatch: function( ua ) {
|
845 |
+
ua = ua.toLowerCase();
|
846 |
+
|
847 |
+
var match = rwebkit.exec( ua ) ||
|
848 |
+
ropera.exec( ua ) ||
|
849 |
+
rmsie.exec( ua ) ||
|
850 |
+
ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
|
851 |
+
[];
|
852 |
+
|
853 |
+
return { browser: match[1] || "", version: match[2] || "0" };
|
854 |
+
},
|
855 |
+
|
856 |
+
sub: function() {
|
857 |
+
function jQuerySub( selector, context ) {
|
858 |
+
return new jQuerySub.fn.init( selector, context );
|
859 |
+
}
|
860 |
+
jQuery.extend( true, jQuerySub, this );
|
861 |
+
jQuerySub.superclass = this;
|
862 |
+
jQuerySub.fn = jQuerySub.prototype = this();
|
863 |
+
jQuerySub.fn.constructor = jQuerySub;
|
864 |
+
jQuerySub.sub = this.sub;
|
865 |
+
jQuerySub.fn.init = function init( selector, context ) {
|
866 |
+
if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
|
867 |
+
context = jQuerySub( context );
|
868 |
+
}
|
869 |
+
|
870 |
+
return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
|
871 |
+
};
|
872 |
+
jQuerySub.fn.init.prototype = jQuerySub.fn;
|
873 |
+
var rootjQuerySub = jQuerySub(document);
|
874 |
+
return jQuerySub;
|
875 |
+
},
|
876 |
+
|
877 |
+
browser: {}
|
878 |
+
});
|
879 |
+
|
880 |
+
// Populate the class2type map
|
881 |
+
jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
|
882 |
+
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
883 |
+
});
|
884 |
+
|
885 |
+
browserMatch = jQuery.uaMatch( userAgent );
|
886 |
+
if ( browserMatch.browser ) {
|
887 |
+
jQuery.browser[ browserMatch.browser ] = true;
|
888 |
+
jQuery.browser.version = browserMatch.version;
|
889 |
+
}
|
890 |
+
|
891 |
+
// Deprecated, use jQuery.browser.webkit instead
|
892 |
+
if ( jQuery.browser.webkit ) {
|
893 |
+
jQuery.browser.safari = true;
|
894 |
+
}
|
895 |
+
|
896 |
+
// IE doesn't match non-breaking spaces with \s
|
897 |
+
if ( rnotwhite.test( "\xA0" ) ) {
|
898 |
+
trimLeft = /^[\s\xA0]+/;
|
899 |
+
trimRight = /[\s\xA0]+$/;
|
900 |
+
}
|
901 |
+
|
902 |
+
// All jQuery objects should point back to these
|
903 |
+
rootjQuery = jQuery(document);
|
904 |
+
|
905 |
+
// Cleanup functions for the document ready method
|
906 |
+
if ( document.addEventListener ) {
|
907 |
+
DOMContentLoaded = function() {
|
908 |
+
document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
|
909 |
+
jQuery.ready();
|
910 |
+
};
|
911 |
+
|
912 |
+
} else if ( document.attachEvent ) {
|
913 |
+
DOMContentLoaded = function() {
|
914 |
+
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
|
915 |
+
if ( document.readyState === "complete" ) {
|
916 |
+
document.detachEvent( "onreadystatechange", DOMContentLoaded );
|
917 |
+
jQuery.ready();
|
918 |
+
}
|
919 |
+
};
|
920 |
+
}
|
921 |
+
|
922 |
+
// The DOM ready check for Internet Explorer
|
923 |
+
function doScrollCheck() {
|
924 |
+
if ( jQuery.isReady ) {
|
925 |
+
return;
|
926 |
+
}
|
927 |
+
|
928 |
+
try {
|
929 |
+
// If IE is used, use the trick by Diego Perini
|
930 |
+
// http://javascript.nwbox.com/IEContentLoaded/
|
931 |
+
document.documentElement.doScroll("left");
|
932 |
+
} catch(e) {
|
933 |
+
setTimeout( doScrollCheck, 1 );
|
934 |
+
return;
|
935 |
+
}
|
936 |
+
|
937 |
+
// and execute any waiting functions
|
938 |
+
jQuery.ready();
|
939 |
+
}
|
940 |
+
|
941 |
+
return jQuery;
|
942 |
+
|
943 |
+
})();
|
944 |
+
|
945 |
+
|
946 |
+
// String to Object flags format cache
|
947 |
+
var flagsCache = {};
|
948 |
+
|
949 |
+
// Convert String-formatted flags into Object-formatted ones and store in cache
|
950 |
+
function createFlags( flags ) {
|
951 |
+
var object = flagsCache[ flags ] = {},
|
952 |
+
i, length;
|
953 |
+
flags = flags.split( /\s+/ );
|
954 |
+
for ( i = 0, length = flags.length; i < length; i++ ) {
|
955 |
+
object[ flags[i] ] = true;
|
956 |
+
}
|
957 |
+
return object;
|
958 |
+
}
|
959 |
+
|
960 |
+
/*
|
961 |
+
* Create a callback list using the following parameters:
|
962 |
+
*
|
963 |
+
* flags: an optional list of space-separated flags that will change how
|
964 |
+
* the callback list behaves
|
965 |
+
*
|
966 |
+
* By default a callback list will act like an event callback list and can be
|
967 |
+
* "fired" multiple times.
|
968 |
+
*
|
969 |
+
* Possible flags:
|
970 |
+
*
|
971 |
+
* once: will ensure the callback list can only be fired once (like a Deferred)
|
972 |
+
*
|
973 |
+
* memory: will keep track of previous values and will call any callback added
|
974 |
+
* after the list has been fired right away with the latest "memorized"
|
975 |
+
* values (like a Deferred)
|
976 |
+
*
|
977 |
+
* unique: will ensure a callback can only be added once (no duplicate in the list)
|
978 |
+
*
|
979 |
+
* stopOnFalse: interrupt callings when a callback returns false
|
980 |
+
*
|
981 |
+
*/
|
982 |
+
jQuery.Callbacks = function( flags ) {
|
983 |
+
|
984 |
+
// Convert flags from String-formatted to Object-formatted
|
985 |
+
// (we check in cache first)
|
986 |
+
flags = flags ? ( flagsCache[ flags ] || createFlags( flags ) ) : {};
|
987 |
+
|
988 |
+
var // Actual callback list
|
989 |
+
list = [],
|
990 |
+
// Stack of fire calls for repeatable lists
|
991 |
+
stack = [],
|
992 |
+
// Last fire value (for non-forgettable lists)
|
993 |
+
memory,
|
994 |
+
// Flag to know if list is currently firing
|
995 |
+
firing,
|
996 |
+
// First callback to fire (used internally by add and fireWith)
|
997 |
+
firingStart,
|
998 |
+
// End of the loop when firing
|
999 |
+
firingLength,
|
1000 |
+
// Index of currently firing callback (modified by remove if needed)
|
1001 |
+
firingIndex,
|
1002 |
+
// Add one or several callbacks to the list
|
1003 |
+
add = function( args ) {
|
1004 |
+
var i,
|
1005 |
+
length,
|
1006 |
+
elem,
|
1007 |
+
type,
|
1008 |
+
actual;
|
1009 |
+
for ( i = 0, length = args.length; i < length; i++ ) {
|
1010 |
+
elem = args[ i ];
|
1011 |
+
type = jQuery.type( elem );
|
1012 |
+
if ( type === "array" ) {
|
1013 |
+
// Inspect recursively
|
1014 |
+
add( elem );
|
1015 |
+
} else if ( type === "function" ) {
|
1016 |
+
// Add if not in unique mode and callback is not in
|
1017 |
+
if ( !flags.unique || !self.has( elem ) ) {
|
1018 |
+
list.push( elem );
|
1019 |
+
}
|
1020 |
+
}
|
1021 |
+
}
|
1022 |
+
},
|
1023 |
+
// Fire callbacks
|
1024 |
+
fire = function( context, args ) {
|
1025 |
+
args = args || [];
|
1026 |
+
memory = !flags.memory || [ context, args ];
|
1027 |
+
firing = true;
|
1028 |
+
firingIndex = firingStart || 0;
|
1029 |
+
firingStart = 0;
|
1030 |
+
firingLength = list.length;
|
1031 |
+
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
|
1032 |
+
if ( list[ firingIndex ].apply( context, args ) === false && flags.stopOnFalse ) {
|
1033 |
+
memory = true; // Mark as halted
|
1034 |
+
break;
|
1035 |
+
}
|
1036 |
+
}
|
1037 |
+
firing = false;
|
1038 |
+
if ( list ) {
|
1039 |
+
if ( !flags.once ) {
|
1040 |
+
if ( stack && stack.length ) {
|
1041 |
+
memory = stack.shift();
|
1042 |
+
self.fireWith( memory[ 0 ], memory[ 1 ] );
|
1043 |
+
}
|
1044 |
+
} else if ( memory === true ) {
|
1045 |
+
self.disable();
|
1046 |
+
} else {
|
1047 |
+
list = [];
|
1048 |
+
}
|
1049 |
+
}
|
1050 |
+
},
|
1051 |
+
// Actual Callbacks object
|
1052 |
+
self = {
|
1053 |
+
// Add a callback or a collection of callbacks to the list
|
1054 |
+
add: function() {
|
1055 |
+
if ( list ) {
|
1056 |
+
var length = list.length;
|
1057 |
+
add( arguments );
|
1058 |
+
// Do we need to add the callbacks to the
|
1059 |
+
// current firing batch?
|
1060 |
+
if ( firing ) {
|
1061 |
+
firingLength = list.length;
|
1062 |
+
// With memory, if we're not firing then
|
1063 |
+
// we should call right away, unless previous
|
1064 |
+
// firing was halted (stopOnFalse)
|
1065 |
+
} else if ( memory && memory !== true ) {
|
1066 |
+
firingStart = length;
|
1067 |
+
fire( memory[ 0 ], memory[ 1 ] );
|
1068 |
+
}
|
1069 |
+
}
|
1070 |
+
return this;
|
1071 |
+
},
|
1072 |
+
// Remove a callback from the list
|
1073 |
+
remove: function() {
|
1074 |
+
if ( list ) {
|
1075 |
+
var args = arguments,
|
1076 |
+
argIndex = 0,
|
1077 |
+
argLength = args.length;
|
1078 |
+
for ( ; argIndex < argLength ; argIndex++ ) {
|
1079 |
+
for ( var i = 0; i < list.length; i++ ) {
|
1080 |
+
if ( args[ argIndex ] === list[ i ] ) {
|
1081 |
+
// Handle firingIndex and firingLength
|
1082 |
+
if ( firing ) {
|
1083 |
+
if ( i <= firingLength ) {
|
1084 |
+
firingLength--;
|
1085 |
+
if ( i <= firingIndex ) {
|
1086 |
+
firingIndex--;
|
1087 |
+
}
|
1088 |
+
}
|
1089 |
+
}
|
1090 |
+
// Remove the element
|
1091 |
+
list.splice( i--, 1 );
|
1092 |
+
// If we have some unicity property then
|
1093 |
+
// we only need to do this once
|
1094 |
+
if ( flags.unique ) {
|
1095 |
+
break;
|
1096 |
+
}
|
1097 |
+
}
|
1098 |
+
}
|
1099 |
+
}
|
1100 |
+
}
|
1101 |
+
return this;
|
1102 |
+
},
|
1103 |
+
// Control if a given callback is in the list
|
1104 |
+
has: function( fn ) {
|
1105 |
+
if ( list ) {
|
1106 |
+
var i = 0,
|
1107 |
+
length = list.length;
|
1108 |
+
for ( ; i < length; i++ ) {
|
1109 |
+
if ( fn === list[ i ] ) {
|
1110 |
+
return true;
|
1111 |
+
}
|
1112 |
+
}
|
1113 |
+
}
|
1114 |
+
return false;
|
1115 |
+
},
|
1116 |
+
// Remove all callbacks from the list
|
1117 |
+
empty: function() {
|
1118 |
+
list = [];
|
1119 |
+
return this;
|
1120 |
+
},
|
1121 |
+
// Have the list do nothing anymore
|
1122 |
+
disable: function() {
|
1123 |
+
list = stack = memory = undefined;
|
1124 |
+
return this;
|
1125 |
+
},
|
1126 |
+
// Is it disabled?
|
1127 |
+
disabled: function() {
|
1128 |
+
return !list;
|
1129 |
+
},
|
1130 |
+
// Lock the list in its current state
|
1131 |
+
lock: function() {
|
1132 |
+
stack = undefined;
|
1133 |
+
if ( !memory || memory === true ) {
|
1134 |
+
self.disable();
|
1135 |
+
}
|
1136 |
+
return this;
|
1137 |
+
},
|
1138 |
+
// Is it locked?
|
1139 |
+
locked: function() {
|
1140 |
+
return !stack;
|
1141 |
+
},
|
1142 |
+
// Call all callbacks with the given context and arguments
|
1143 |
+
fireWith: function( context, args ) {
|
1144 |
+
if ( stack ) {
|
1145 |
+
if ( firing ) {
|
1146 |
+
if ( !flags.once ) {
|
1147 |
+
stack.push( [ context, args ] );
|
1148 |
+
}
|
1149 |
+
} else if ( !( flags.once && memory ) ) {
|
1150 |
+
fire( context, args );
|
1151 |
+
}
|
1152 |
+
}
|
1153 |
+
return this;
|
1154 |
+
},
|
1155 |
+
// Call all the callbacks with the given arguments
|
1156 |
+
fire: function() {
|
1157 |
+
self.fireWith( this, arguments );
|
1158 |
+
return this;
|
1159 |
+
},
|
1160 |
+
// To know if the callbacks have already been called at least once
|
1161 |
+
fired: function() {
|
1162 |
+
return !!memory;
|
1163 |
+
}
|
1164 |
+
};
|
1165 |
+
|
1166 |
+
return self;
|
1167 |
+
};
|
1168 |
+
|
1169 |
+
|
1170 |
+
|
1171 |
+
|
1172 |
+
var // Static reference to slice
|
1173 |
+
sliceDeferred = [].slice;
|
1174 |
+
|
1175 |
+
jQuery.extend({
|
1176 |
+
|
1177 |
+
Deferred: function( func ) {
|
1178 |
+
var doneList = jQuery.Callbacks( "once memory" ),
|
1179 |
+
failList = jQuery.Callbacks( "once memory" ),
|
1180 |
+
progressList = jQuery.Callbacks( "memory" ),
|
1181 |
+
state = "pending",
|
1182 |
+
lists = {
|
1183 |
+
resolve: doneList,
|
1184 |
+
reject: failList,
|
1185 |
+
notify: progressList
|
1186 |
+
},
|
1187 |
+
promise = {
|
1188 |
+
done: doneList.add,
|
1189 |
+
fail: failList.add,
|
1190 |
+
progress: progressList.add,
|
1191 |
+
|
1192 |
+
state: function() {
|
1193 |
+
return state;
|
1194 |
+
},
|
1195 |
+
|
1196 |
+
// Deprecated
|
1197 |
+
isResolved: doneList.fired,
|
1198 |
+
isRejected: failList.fired,
|
1199 |
+
|
1200 |
+
then: function( doneCallbacks, failCallbacks, progressCallbacks ) {
|
1201 |
+
deferred.done( doneCallbacks ).fail( failCallbacks ).progress( progressCallbacks );
|
1202 |
+
return this;
|
1203 |
+
},
|
1204 |
+
always: function() {
|
1205 |
+
deferred.done.apply( deferred, arguments ).fail.apply( deferred, arguments );
|
1206 |
+
return this;
|
1207 |
+
},
|
1208 |
+
pipe: function( fnDone, fnFail, fnProgress ) {
|
1209 |
+
return jQuery.Deferred(function( newDefer ) {
|
1210 |
+
jQuery.each( {
|
1211 |
+
done: [ fnDone, "resolve" ],
|
1212 |
+
fail: [ fnFail, "reject" ],
|
1213 |
+
progress: [ fnProgress, "notify" ]
|
1214 |
+
}, function( handler, data ) {
|
1215 |
+
var fn = data[ 0 ],
|
1216 |
+
action = data[ 1 ],
|
1217 |
+
returned;
|
1218 |
+
if ( jQuery.isFunction( fn ) ) {
|
1219 |
+
deferred[ handler ](function() {
|
1220 |
+
returned = fn.apply( this, arguments );
|
1221 |
+
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
1222 |
+
returned.promise().then( newDefer.resolve, newDefer.reject, newDefer.notify );
|
1223 |
+
} else {
|
1224 |
+
newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
|
1225 |
+
}
|
1226 |
+
});
|
1227 |
+
} else {
|
1228 |
+
deferred[ handler ]( newDefer[ action ] );
|
1229 |
+
}
|
1230 |
+
});
|
1231 |
+
}).promise();
|
1232 |
+
},
|
1233 |
+
// Get a promise for this deferred
|
1234 |
+
// If obj is provided, the promise aspect is added to the object
|
1235 |
+
promise: function( obj ) {
|
1236 |
+
if ( obj == null ) {
|
1237 |
+
obj = promise;
|
1238 |
+
} else {
|
1239 |
+
for ( var key in promise ) {
|
1240 |
+
obj[ key ] = promise[ key ];
|
1241 |
+
}
|
1242 |
+
}
|
1243 |
+
return obj;
|
1244 |
+
}
|
1245 |
+
},
|
1246 |
+
deferred = promise.promise({}),
|
1247 |
+
key;
|
1248 |
+
|
1249 |
+
for ( key in lists ) {
|
1250 |
+
deferred[ key ] = lists[ key ].fire;
|
1251 |
+
deferred[ key + "With" ] = lists[ key ].fireWith;
|
1252 |
+
}
|
1253 |
+
|
1254 |
+
// Handle state
|
1255 |
+
deferred.done( function() {
|
1256 |
+
state = "resolved";
|
1257 |
+
}, failList.disable, progressList.lock ).fail( function() {
|
1258 |
+
state = "rejected";
|
1259 |
+
}, doneList.disable, progressList.lock );
|
1260 |
+
|
1261 |
+
// Call given func if any
|
1262 |
+
if ( func ) {
|
1263 |
+
func.call( deferred, deferred );
|
1264 |
+
}
|
1265 |
+
|
1266 |
+
// All done!
|
1267 |
+
return deferred;
|
1268 |
+
},
|
1269 |
+
|
1270 |
+
// Deferred helper
|
1271 |
+
when: function( firstParam ) {
|
1272 |
+
var args = sliceDeferred.call( arguments, 0 ),
|
1273 |
+
i = 0,
|
1274 |
+
length = args.length,
|
1275 |
+
pValues = new Array( length ),
|
1276 |
+
count = length,
|
1277 |
+
pCount = length,
|
1278 |
+
deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
|
1279 |
+
firstParam :
|
1280 |
+
jQuery.Deferred(),
|
1281 |
+
promise = deferred.promise();
|
1282 |
+
function resolveFunc( i ) {
|
1283 |
+
return function( value ) {
|
1284 |
+
args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
|
1285 |
+
if ( !( --count ) ) {
|
1286 |
+
deferred.resolveWith( deferred, args );
|
1287 |
+
}
|
1288 |
+
};
|
1289 |
+
}
|
1290 |
+
function progressFunc( i ) {
|
1291 |
+
return function( value ) {
|
1292 |
+
pValues[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
|
1293 |
+
deferred.notifyWith( promise, pValues );
|
1294 |
+
};
|
1295 |
+
}
|
1296 |
+
if ( length > 1 ) {
|
1297 |
+
for ( ; i < length; i++ ) {
|
1298 |
+
if ( args[ i ] && args[ i ].promise && jQuery.isFunction( args[ i ].promise ) ) {
|
1299 |
+
args[ i ].promise().then( resolveFunc(i), deferred.reject, progressFunc(i) );
|
1300 |
+
} else {
|
1301 |
+
--count;
|
1302 |
+
}
|
1303 |
+
}
|
1304 |
+
if ( !count ) {
|
1305 |
+
deferred.resolveWith( deferred, args );
|
1306 |
+
}
|
1307 |
+
} else if ( deferred !== firstParam ) {
|
1308 |
+
deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
|
1309 |
+
}
|
1310 |
+
return promise;
|
1311 |
+
}
|
1312 |
+
});
|
1313 |
+
|
1314 |
+
|
1315 |
+
|
1316 |
+
|
1317 |
+
jQuery.support = (function() {
|
1318 |
+
|
1319 |
+
var support,
|
1320 |
+
all,
|
1321 |
+
a,
|
1322 |
+
select,
|
1323 |
+
opt,
|
1324 |
+
input,
|
1325 |
+
marginDiv,
|
1326 |
+
fragment,
|
1327 |
+
tds,
|
1328 |
+
events,
|
1329 |
+
eventName,
|
1330 |
+
i,
|
1331 |
+
isSupported,
|
1332 |
+
div = document.createElement( "div" ),
|
1333 |
+
documentElement = document.documentElement;
|
1334 |
+
|
1335 |
+
// Preliminary tests
|
1336 |
+
div.setAttribute("className", "t");
|
1337 |
+
div.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
|
1338 |
+
|
1339 |
+
all = div.getElementsByTagName( "*" );
|
1340 |
+
a = div.getElementsByTagName( "a" )[ 0 ];
|
1341 |
+
|
1342 |
+
// Can't get basic test support
|
1343 |
+
if ( !all || !all.length || !a ) {
|
1344 |
+
return {};
|
1345 |
+
}
|
1346 |
+
|
1347 |
+
// First batch of supports tests
|
1348 |
+
select = document.createElement( "select" );
|
1349 |
+
opt = select.appendChild( document.createElement("option") );
|
1350 |
+
input = div.getElementsByTagName( "input" )[ 0 ];
|
1351 |
+
|
1352 |
+
support = {
|
1353 |
+
// IE strips leading whitespace when .innerHTML is used
|
1354 |
+
leadingWhitespace: ( div.firstChild.nodeType === 3 ),
|
1355 |
+
|
1356 |
+
// Make sure that tbody elements aren't automatically inserted
|
1357 |
+
// IE will insert them into empty tables
|
1358 |
+
tbody: !div.getElementsByTagName("tbody").length,
|
1359 |
+
|
1360 |
+
// Make sure that link elements get serialized correctly by innerHTML
|
1361 |
+
// This requires a wrapper element in IE
|
1362 |
+
htmlSerialize: !!div.getElementsByTagName("link").length,
|
1363 |
+
|
1364 |
+
// Get the style information from getAttribute
|
1365 |
+
// (IE uses .cssText instead)
|
1366 |
+
style: /top/.test( a.getAttribute("style") ),
|
1367 |
+
|
1368 |
+
// Make sure that URLs aren't manipulated
|
1369 |
+
// (IE normalizes it by default)
|
1370 |
+
hrefNormalized: ( a.getAttribute("href") === "/a" ),
|
1371 |
+
|
1372 |
+
// Make sure that element opacity exists
|
1373 |
+
// (IE uses filter instead)
|
1374 |
+
// Use a regex to work around a WebKit issue. See #5145
|
1375 |
+
opacity: /^0.55/.test( a.style.opacity ),
|
1376 |
+
|
1377 |
+
// Verify style float existence
|
1378 |
+
// (IE uses styleFloat instead of cssFloat)
|
1379 |
+
cssFloat: !!a.style.cssFloat,
|
1380 |
+
|
1381 |
+
// Make sure that if no value is specified for a checkbox
|
1382 |
+
// that it defaults to "on".
|
1383 |
+
// (WebKit defaults to "" instead)
|
1384 |
+
checkOn: ( input.value === "on" ),
|
1385 |
+
|
1386 |
+
// Make sure that a selected-by-default option has a working selected property.
|
1387 |
+
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
|
1388 |
+
optSelected: opt.selected,
|
1389 |
+
|
1390 |
+
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
|
1391 |
+
getSetAttribute: div.className !== "t",
|
1392 |
+
|
1393 |
+
// Tests for enctype support on a form(#6743)
|
1394 |
+
enctype: !!document.createElement("form").enctype,
|
1395 |
+
|
1396 |
+
// Makes sure cloning an html5 element does not cause problems
|
1397 |
+
// Where outerHTML is undefined, this still works
|
1398 |
+
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
|
1399 |
+
|
1400 |
+
// Will be defined later
|
1401 |
+
submitBubbles: true,
|
1402 |
+
changeBubbles: true,
|
1403 |
+
focusinBubbles: false,
|
1404 |
+
deleteExpando: true,
|
1405 |
+
noCloneEvent: true,
|
1406 |
+
inlineBlockNeedsLayout: false,
|
1407 |
+
shrinkWrapBlocks: false,
|
1408 |
+
reliableMarginRight: true
|
1409 |
+
};
|
1410 |
+
|
1411 |
+
// Make sure checked status is properly cloned
|
1412 |
+
input.checked = true;
|
1413 |
+
support.noCloneChecked = input.cloneNode( true ).checked;
|
1414 |
+
|
1415 |
+
// Make sure that the options inside disabled selects aren't marked as disabled
|
1416 |
+
// (WebKit marks them as disabled)
|
1417 |
+
select.disabled = true;
|
1418 |
+
support.optDisabled = !opt.disabled;
|
1419 |
+
|
1420 |
+
// Test to see if it's possible to delete an expando from an element
|
1421 |
+
// Fails in Internet Explorer
|
1422 |
+
try {
|
1423 |
+
delete div.test;
|
1424 |
+
} catch( e ) {
|
1425 |
+
support.deleteExpando = false;
|
1426 |
+
}
|
1427 |
+
|
1428 |
+
if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
|
1429 |
+
div.attachEvent( "onclick", function() {
|
1430 |
+
// Cloning a node shouldn't copy over any
|
1431 |
+
// bound event handlers (IE does this)
|
1432 |
+
support.noCloneEvent = false;
|
1433 |
+
});
|
1434 |
+
div.cloneNode( true ).fireEvent( "onclick" );
|
1435 |
+
}
|
1436 |
+
|
1437 |
+
// Check if a radio maintains its value
|
1438 |
+
// after being appended to the DOM
|
1439 |
+
input = document.createElement("input");
|
1440 |
+
input.value = "t";
|
1441 |
+
input.setAttribute("type", "radio");
|
1442 |
+
support.radioValue = input.value === "t";
|
1443 |
+
|
1444 |
+
input.setAttribute("checked", "checked");
|
1445 |
+
div.appendChild( input );
|
1446 |
+
fragment = document.createDocumentFragment();
|
1447 |
+
fragment.appendChild( div.lastChild );
|
1448 |
+
|
1449 |
+
// WebKit doesn't clone checked state correctly in fragments
|
1450 |
+
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
1451 |
+
|
1452 |
+
// Check if a disconnected checkbox will retain its checked
|
1453 |
+
// value of true after appended to the DOM (IE6/7)
|
1454 |
+
support.appendChecked = input.checked;
|
1455 |
+
|
1456 |
+
fragment.removeChild( input );
|
1457 |
+
fragment.appendChild( div );
|
1458 |
+
|
1459 |
+
div.innerHTML = "";
|
1460 |
+
|
1461 |
+
// Check if div with explicit width and no margin-right incorrectly
|
1462 |
+
// gets computed margin-right based on width of container. For more
|
1463 |
+
// info see bug #3333
|
1464 |
+
// Fails in WebKit before Feb 2011 nightlies
|
1465 |
+
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
1466 |
+
if ( window.getComputedStyle ) {
|
1467 |
+
marginDiv = document.createElement( "div" );
|
1468 |
+
marginDiv.style.width = "0";
|
1469 |
+
marginDiv.style.marginRight = "0";
|
1470 |
+
div.style.width = "2px";
|
1471 |
+
div.appendChild( marginDiv );
|
1472 |
+
support.reliableMarginRight =
|
1473 |
+
( parseInt( ( window.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
|
1474 |
+
}
|
1475 |
+
|
1476 |
+
// Technique from Juriy Zaytsev
|
1477 |
+
// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
|
1478 |
+
// We only care about the case where non-standard event systems
|
1479 |
+
// are used, namely in IE. Short-circuiting here helps us to
|
1480 |
+
// avoid an eval call (in setAttribute) which can cause CSP
|
1481 |
+
// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
|
1482 |
+
if ( div.attachEvent ) {
|
1483 |
+
for( i in {
|
1484 |
+
submit: 1,
|
1485 |
+
change: 1,
|
1486 |
+
focusin: 1
|
1487 |
+
}) {
|
1488 |
+
eventName = "on" + i;
|
1489 |
+
isSupported = ( eventName in div );
|
1490 |
+
if ( !isSupported ) {
|
1491 |
+
div.setAttribute( eventName, "return;" );
|
1492 |
+
isSupported = ( typeof div[ eventName ] === "function" );
|
1493 |
+
}
|
1494 |
+
support[ i + "Bubbles" ] = isSupported;
|
1495 |
+
}
|
1496 |
+
}
|
1497 |
+
|
1498 |
+
fragment.removeChild( div );
|
1499 |
+
|
1500 |
+
// Null elements to avoid leaks in IE
|
1501 |
+
fragment = select = opt = marginDiv = div = input = null;
|
1502 |
+
|
1503 |
+
// Run tests that need a body at doc ready
|
1504 |
+
jQuery(function() {
|
1505 |
+
var container, outer, inner, table, td, offsetSupport,
|
1506 |
+
conMarginTop, ptlm, vb, style, html,
|
1507 |
+
body = document.getElementsByTagName("body")[0];
|
1508 |
+
|
1509 |
+
if ( !body ) {
|
1510 |
+
// Return for frameset docs that don't have a body
|
1511 |
+
return;
|
1512 |
+
}
|
1513 |
+
|
1514 |
+
conMarginTop = 1;
|
1515 |
+
ptlm = "position:absolute;top:0;left:0;width:1px;height:1px;margin:0;";
|
1516 |
+
vb = "visibility:hidden;border:0;";
|
1517 |
+
style = "style='" + ptlm + "border:5px solid #000;padding:0;'";
|
1518 |
+
html = "<div " + style + "><div></div></div>" +
|
1519 |
+
"<table " + style + " cellpadding='0' cellspacing='0'>" +
|
1520 |
+
"<tr><td></td></tr></table>";
|
1521 |
+
|
1522 |
+
container = document.createElement("div");
|
1523 |
+
container.style.cssText = vb + "width:0;height:0;position:static;top:0;margin-top:" + conMarginTop + "px";
|
1524 |
+
body.insertBefore( container, body.firstChild );
|
1525 |
+
|
1526 |
+
// Construct the test element
|
1527 |
+
div = document.createElement("div");
|
1528 |
+
container.appendChild( div );
|
1529 |
+
|
1530 |
+
// Check if table cells still have offsetWidth/Height when they are set
|
1531 |
+
// to display:none and there are still other visible table cells in a
|
1532 |
+
// table row; if so, offsetWidth/Height are not reliable for use when
|
1533 |
+
// determining if an element has been hidden directly using
|
1534 |
+
// display:none (it is still safe to use offsets if a parent element is
|
1535 |
+
// hidden; don safety goggles and see bug #4512 for more information).
|
1536 |
+
// (only IE 8 fails this test)
|
1537 |
+
div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
|
1538 |
+
tds = div.getElementsByTagName( "td" );
|
1539 |
+
isSupported = ( tds[ 0 ].offsetHeight === 0 );
|
1540 |
+
|
1541 |
+
tds[ 0 ].style.display = "";
|
1542 |
+
tds[ 1 ].style.display = "none";
|
1543 |
+
|
1544 |
+
// Check if empty table cells still have offsetWidth/Height
|
1545 |
+
// (IE <= 8 fail this test)
|
1546 |
+
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
|
1547 |
+
|
1548 |
+
// Figure out if the W3C box model works as expected
|
1549 |
+
div.innerHTML = "";
|
1550 |
+
div.style.width = div.style.paddingLeft = "1px";
|
1551 |
+
jQuery.boxModel = support.boxModel = div.offsetWidth === 2;
|
1552 |
+
|
1553 |
+
if ( typeof div.style.zoom !== "undefined" ) {
|
1554 |
+
// Check if natively block-level elements act like inline-block
|
1555 |
+
// elements when setting their display to 'inline' and giving
|
1556 |
+
// them layout
|
1557 |
+
// (IE < 8 does this)
|
1558 |
+
div.style.display = "inline";
|
1559 |
+
div.style.zoom = 1;
|
1560 |
+
support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
|
1561 |
+
|
1562 |
+
// Check if elements with layout shrink-wrap their children
|
1563 |
+
// (IE 6 does this)
|
1564 |
+
div.style.display = "";
|
1565 |
+
div.innerHTML = "<div style='width:4px;'></div>";
|
1566 |
+
support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
|
1567 |
+
}
|
1568 |
+
|
1569 |
+
div.style.cssText = ptlm + vb;
|
1570 |
+
div.innerHTML = html;
|
1571 |
+
|
1572 |
+
outer = div.firstChild;
|
1573 |
+
inner = outer.firstChild;
|
1574 |
+
td = outer.nextSibling.firstChild.firstChild;
|
1575 |
+
|
1576 |
+
offsetSupport = {
|
1577 |
+
doesNotAddBorder: ( inner.offsetTop !== 5 ),
|
1578 |
+
doesAddBorderForTableAndCells: ( td.offsetTop === 5 )
|
1579 |
+
};
|
1580 |
+
|
1581 |
+
inner.style.position = "fixed";
|
1582 |
+
inner.style.top = "20px";
|
1583 |
+
|
1584 |
+
// safari subtracts parent border width here which is 5px
|
1585 |
+
offsetSupport.fixedPosition = ( inner.offsetTop === 20 || inner.offsetTop === 15 );
|
1586 |
+
inner.style.position = inner.style.top = "";
|
1587 |
+
|
1588 |
+
outer.style.overflow = "hidden";
|
1589 |
+
outer.style.position = "relative";
|
1590 |
+
|
1591 |
+
offsetSupport.subtractsBorderForOverflowNotVisible = ( inner.offsetTop === -5 );
|
1592 |
+
offsetSupport.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== conMarginTop );
|
1593 |
+
|
1594 |
+
body.removeChild( container );
|
1595 |
+
div = container = null;
|
1596 |
+
|
1597 |
+
jQuery.extend( support, offsetSupport );
|
1598 |
+
});
|
1599 |
+
|
1600 |
+
return support;
|
1601 |
+
})();
|
1602 |
+
|
1603 |
+
|
1604 |
+
|
1605 |
+
|
1606 |
+
var rbrace = /^(?:\{.*\}|\[.*\])$/,
|
1607 |
+
rmultiDash = /([A-Z])/g;
|
1608 |
+
|
1609 |
+
jQuery.extend({
|
1610 |
+
cache: {},
|
1611 |
+
|
1612 |
+
// Please use with caution
|
1613 |
+
uuid: 0,
|
1614 |
+
|
1615 |
+
// Unique for each copy of jQuery on the page
|
1616 |
+
// Non-digits removed to match rinlinejQuery
|
1617 |
+
expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
|
1618 |
+
|
1619 |
+
// The following elements throw uncatchable exceptions if you
|
1620 |
+
// attempt to add expando properties to them.
|
1621 |
+
noData: {
|
1622 |
+
"embed": true,
|
1623 |
+
// Ban all objects except for Flash (which handle expandos)
|
1624 |
+
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
|
1625 |
+
"applet": true
|
1626 |
+
},
|
1627 |
+
|
1628 |
+
hasData: function( elem ) {
|
1629 |
+
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
|
1630 |
+
return !!elem && !isEmptyDataObject( elem );
|
1631 |
+
},
|
1632 |
+
|
1633 |
+
data: function( elem, name, data, pvt /* Internal Use Only */ ) {
|
1634 |
+
if ( !jQuery.acceptData( elem ) ) {
|
1635 |
+
return;
|
1636 |
+
}
|
1637 |
+
|
1638 |
+
var privateCache, thisCache, ret,
|
1639 |
+
internalKey = jQuery.expando,
|
1640 |
+
getByName = typeof name === "string",
|
1641 |
+
|
1642 |
+
// We have to handle DOM nodes and JS objects differently because IE6-7
|
1643 |
+
// can't GC object references properly across the DOM-JS boundary
|
1644 |
+
isNode = elem.nodeType,
|
1645 |
+
|
1646 |
+
// Only DOM nodes need the global jQuery cache; JS object data is
|
1647 |
+
// attached directly to the object so GC can occur automatically
|
1648 |
+
cache = isNode ? jQuery.cache : elem,
|
1649 |
+
|
1650 |
+
// Only defining an ID for JS objects if its cache already exists allows
|
1651 |
+
// the code to shortcut on the same path as a DOM node with no cache
|
1652 |
+
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey,
|
1653 |
+
isEvents = name === "events";
|
1654 |
+
|
1655 |
+
// Avoid doing any more work than we need to when trying to get data on an
|
1656 |
+
// object that has no data at all
|
1657 |
+
if ( (!id || !cache[id] || (!isEvents && !pvt && !cache[id].data)) && getByName && data === undefined ) {
|
1658 |
+
return;
|
1659 |
+
}
|
1660 |
+
|
1661 |
+
if ( !id ) {
|
1662 |
+
// Only DOM nodes need a new unique ID for each element since their data
|
1663 |
+
// ends up in the global cache
|
1664 |
+
if ( isNode ) {
|
1665 |
+
elem[ internalKey ] = id = ++jQuery.uuid;
|
1666 |
+
} else {
|
1667 |
+
id = internalKey;
|
1668 |
+
}
|
1669 |
+
}
|
1670 |
+
|
1671 |
+
if ( !cache[ id ] ) {
|
1672 |
+
cache[ id ] = {};
|
1673 |
+
|
1674 |
+
// Avoids exposing jQuery metadata on plain JS objects when the object
|
1675 |
+
// is serialized using JSON.stringify
|
1676 |
+
if ( !isNode ) {
|
1677 |
+
cache[ id ].toJSON = jQuery.noop;
|
1678 |
+
}
|
1679 |
+
}
|
1680 |
+
|
1681 |
+
// An object can be passed to jQuery.data instead of a key/value pair; this gets
|
1682 |
+
// shallow copied over onto the existing cache
|
1683 |
+
if ( typeof name === "object" || typeof name === "function" ) {
|
1684 |
+
if ( pvt ) {
|
1685 |
+
cache[ id ] = jQuery.extend( cache[ id ], name );
|
1686 |
+
} else {
|
1687 |
+
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
|
1688 |
+
}
|
1689 |
+
}
|
1690 |
+
|
1691 |
+
privateCache = thisCache = cache[ id ];
|
1692 |
+
|
1693 |
+
// jQuery data() is stored in a separate object inside the object's internal data
|
1694 |
+
// cache in order to avoid key collisions between internal data and user-defined
|
1695 |
+
// data.
|
1696 |
+
if ( !pvt ) {
|
1697 |
+
if ( !thisCache.data ) {
|
1698 |
+
thisCache.data = {};
|
1699 |
+
}
|
1700 |
+
|
1701 |
+
thisCache = thisCache.data;
|
1702 |
+
}
|
1703 |
+
|
1704 |
+
if ( data !== undefined ) {
|
1705 |
+
thisCache[ jQuery.camelCase( name ) ] = data;
|
1706 |
+
}
|
1707 |
+
|
1708 |
+
// Users should not attempt to inspect the internal events object using jQuery.data,
|
1709 |
+
// it is undocumented and subject to change. But does anyone listen? No.
|
1710 |
+
if ( isEvents && !thisCache[ name ] ) {
|
1711 |
+
return privateCache.events;
|
1712 |
+
}
|
1713 |
+
|
1714 |
+
// Check for both converted-to-camel and non-converted data property names
|
1715 |
+
// If a data property was specified
|
1716 |
+
if ( getByName ) {
|
1717 |
+
|
1718 |
+
// First Try to find as-is property data
|
1719 |
+
ret = thisCache[ name ];
|
1720 |
+
|
1721 |
+
// Test for null|undefined property data
|
1722 |
+
if ( ret == null ) {
|
1723 |
+
|
1724 |
+
// Try to find the camelCased property
|
1725 |
+
ret = thisCache[ jQuery.camelCase( name ) ];
|
1726 |
+
}
|
1727 |
+
} else {
|
1728 |
+
ret = thisCache;
|
1729 |
+
}
|
1730 |
+
|
1731 |
+
return ret;
|
1732 |
+
},
|
1733 |
+
|
1734 |
+
removeData: function( elem, name, pvt /* Internal Use Only */ ) {
|
1735 |
+
if ( !jQuery.acceptData( elem ) ) {
|
1736 |
+
return;
|
1737 |
+
}
|
1738 |
+
|
1739 |
+
var thisCache, i, l,
|
1740 |
+
|
1741 |
+
// Reference to internal data cache key
|
1742 |
+
internalKey = jQuery.expando,
|
1743 |
+
|
1744 |
+
isNode = elem.nodeType,
|
1745 |
+
|
1746 |
+
// See jQuery.data for more information
|
1747 |
+
cache = isNode ? jQuery.cache : elem,
|
1748 |
+
|
1749 |
+
// See jQuery.data for more information
|
1750 |
+
id = isNode ? elem[ internalKey ] : internalKey;
|
1751 |
+
|
1752 |
+
// If there is already no cache entry for this object, there is no
|
1753 |
+
// purpose in continuing
|
1754 |
+
if ( !cache[ id ] ) {
|
1755 |
+
return;
|
1756 |
+
}
|
1757 |
+
|
1758 |
+
if ( name ) {
|
1759 |
+
|
1760 |
+
thisCache = pvt ? cache[ id ] : cache[ id ].data;
|
1761 |
+
|
1762 |
+
if ( thisCache ) {
|
1763 |
+
|
1764 |
+
// Support array or space separated string names for data keys
|
1765 |
+
if ( !jQuery.isArray( name ) ) {
|
1766 |
+
|
1767 |
+
// try the string as a key before any manipulation
|
1768 |
+
if ( name in thisCache ) {
|
1769 |
+
name = [ name ];
|
1770 |
+
} else {
|
1771 |
+
|
1772 |
+
// split the camel cased version by spaces unless a key with the spaces exists
|
1773 |
+
name = jQuery.camelCase( name );
|
1774 |
+
if ( name in thisCache ) {
|
1775 |
+
name = [ name ];
|
1776 |
+
} else {
|
1777 |
+
name = name.split( " " );
|
1778 |
+
}
|
1779 |
+
}
|
1780 |
+
}
|
1781 |
+
|
1782 |
+
for ( i = 0, l = name.length; i < l; i++ ) {
|
1783 |
+
delete thisCache[ name[i] ];
|
1784 |
+
}
|
1785 |
+
|
1786 |
+
// If there is no data left in the cache, we want to continue
|
1787 |
+
// and let the cache object itself get destroyed
|
1788 |
+
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
|
1789 |
+
return;
|
1790 |
+
}
|
1791 |
+
}
|
1792 |
+
}
|
1793 |
+
|
1794 |
+
// See jQuery.data for more information
|
1795 |
+
if ( !pvt ) {
|
1796 |
+
delete cache[ id ].data;
|
1797 |
+
|
1798 |
+
// Don't destroy the parent cache unless the internal data object
|
1799 |
+
// had been the only thing left in it
|
1800 |
+
if ( !isEmptyDataObject(cache[ id ]) ) {
|
1801 |
+
return;
|
1802 |
+
}
|
1803 |
+
}
|
1804 |
+
|
1805 |
+
// Browsers that fail expando deletion also refuse to delete expandos on
|
1806 |
+
// the window, but it will allow it on all other JS objects; other browsers
|
1807 |
+
// don't care
|
1808 |
+
// Ensure that `cache` is not a window object #10080
|
1809 |
+
if ( jQuery.support.deleteExpando || !cache.setInterval ) {
|
1810 |
+
delete cache[ id ];
|
1811 |
+
} else {
|
1812 |
+
cache[ id ] = null;
|
1813 |
+
}
|
1814 |
+
|
1815 |
+
// We destroyed the cache and need to eliminate the expando on the node to avoid
|
1816 |
+
// false lookups in the cache for entries that no longer exist
|
1817 |
+
if ( isNode ) {
|
1818 |
+
// IE does not allow us to delete expando properties from nodes,
|
1819 |
+
// nor does it have a removeAttribute function on Document nodes;
|
1820 |
+
// we must handle all of these cases
|
1821 |
+
if ( jQuery.support.deleteExpando ) {
|
1822 |
+
delete elem[ internalKey ];
|
1823 |
+
} else if ( elem.removeAttribute ) {
|
1824 |
+
elem.removeAttribute( internalKey );
|
1825 |
+
} else {
|
1826 |
+
elem[ internalKey ] = null;
|
1827 |
+
}
|
1828 |
+
}
|
1829 |
+
},
|
1830 |
+
|
1831 |
+
// For internal use only.
|
1832 |
+
_data: function( elem, name, data ) {
|
1833 |
+
return jQuery.data( elem, name, data, true );
|
1834 |
+
},
|
1835 |
+
|
1836 |
+
// A method for determining if a DOM node can handle the data expando
|
1837 |
+
acceptData: function( elem ) {
|
1838 |
+
if ( elem.nodeName ) {
|
1839 |
+
var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
|
1840 |
+
|
1841 |
+
if ( match ) {
|
1842 |
+
return !(match === true || elem.getAttribute("classid") !== match);
|
1843 |
+
}
|
1844 |
+
}
|
1845 |
+
|
1846 |
+
return true;
|
1847 |
+
}
|
1848 |
+
});
|
1849 |
+
|
1850 |
+
jQuery.fn.extend({
|
1851 |
+
data: function( key, value ) {
|
1852 |
+
var parts, attr, name,
|
1853 |
+
data = null;
|
1854 |
+
|
1855 |
+
if ( typeof key === "undefined" ) {
|
1856 |
+
if ( this.length ) {
|
1857 |
+
data = jQuery.data( this[0] );
|
1858 |
+
|
1859 |
+
if ( this[0].nodeType === 1 && !jQuery._data( this[0], "parsedAttrs" ) ) {
|
1860 |
+
attr = this[0].attributes;
|
1861 |
+
for ( var i = 0, l = attr.length; i < l; i++ ) {
|
1862 |
+
name = attr[i].name;
|
1863 |
+
|
1864 |
+
if ( name.indexOf( "data-" ) === 0 ) {
|
1865 |
+
name = jQuery.camelCase( name.substring(5) );
|
1866 |
+
|
1867 |
+
dataAttr( this[0], name, data[ name ] );
|
1868 |
+
}
|
1869 |
+
}
|
1870 |
+
jQuery._data( this[0], "parsedAttrs", true );
|
1871 |
+
}
|
1872 |
+
}
|
1873 |
+
|
1874 |
+
return data;
|
1875 |
+
|
1876 |
+
} else if ( typeof key === "object" ) {
|
1877 |
+
return this.each(function() {
|
1878 |
+
jQuery.data( this, key );
|
1879 |
+
});
|
1880 |
+
}
|
1881 |
+
|
1882 |
+
parts = key.split(".");
|
1883 |
+
parts[1] = parts[1] ? "." + parts[1] : "";
|
1884 |
+
|
1885 |
+
if ( value === undefined ) {
|
1886 |
+
data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
|
1887 |
+
|
1888 |
+
// Try to fetch any internally stored data first
|
1889 |
+
if ( data === undefined && this.length ) {
|
1890 |
+
data = jQuery.data( this[0], key );
|
1891 |
+
data = dataAttr( this[0], key, data );
|
1892 |
+
}
|
1893 |
+
|
1894 |
+
return data === undefined && parts[1] ?
|
1895 |
+
this.data( parts[0] ) :
|
1896 |
+
data;
|
1897 |
+
|
1898 |
+
} else {
|
1899 |
+
return this.each(function() {
|
1900 |
+
var self = jQuery( this ),
|
1901 |
+
args = [ parts[0], value ];
|
1902 |
+
|
1903 |
+
self.triggerHandler( "setData" + parts[1] + "!", args );
|
1904 |
+
jQuery.data( this, key, value );
|
1905 |
+
self.triggerHandler( "changeData" + parts[1] + "!", args );
|
1906 |
+
});
|
1907 |
+
}
|
1908 |
+
},
|
1909 |
+
|
1910 |
+
removeData: function( key ) {
|
1911 |
+
return this.each(function() {
|
1912 |
+
jQuery.removeData( this, key );
|
1913 |
+
});
|
1914 |
+
}
|
1915 |
+
});
|
1916 |
+
|
1917 |
+
function dataAttr( elem, key, data ) {
|
1918 |
+
// If nothing was found internally, try to fetch any
|
1919 |
+
// data from the HTML5 data-* attribute
|
1920 |
+
if ( data === undefined && elem.nodeType === 1 ) {
|
1921 |
+
|
1922 |
+
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
|
1923 |
+
|
1924 |
+
data = elem.getAttribute( name );
|
1925 |
+
|
1926 |
+
if ( typeof data === "string" ) {
|
1927 |
+
try {
|
1928 |
+
data = data === "true" ? true :
|
1929 |
+
data === "false" ? false :
|
1930 |
+
data === "null" ? null :
|
1931 |
+
jQuery.isNumeric( data ) ? parseFloat( data ) :
|
1932 |
+
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
1933 |
+
data;
|
1934 |
+
} catch( e ) {}
|
1935 |
+
|
1936 |
+
// Make sure we set the data so it isn't changed later
|
1937 |
+
jQuery.data( elem, key, data );
|
1938 |
+
|
1939 |
+
} else {
|
1940 |
+
data = undefined;
|
1941 |
+
}
|
1942 |
+
}
|
1943 |
+
|
1944 |
+
return data;
|
1945 |
+
}
|
1946 |
+
|
1947 |
+
// checks a cache object for emptiness
|
1948 |
+
function isEmptyDataObject( obj ) {
|
1949 |
+
for ( var name in obj ) {
|
1950 |
+
|
1951 |
+
// if the public data object is empty, the private is still empty
|
1952 |
+
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
|
1953 |
+
continue;
|
1954 |
+
}
|
1955 |
+
if ( name !== "toJSON" ) {
|
1956 |
+
return false;
|
1957 |
+
}
|
1958 |
+
}
|
1959 |
+
|
1960 |
+
return true;
|
1961 |
+
}
|
1962 |
+
|
1963 |
+
|
1964 |
+
|
1965 |
+
|
1966 |
+
function handleQueueMarkDefer( elem, type, src ) {
|
1967 |
+
var deferDataKey = type + "defer",
|
1968 |
+
queueDataKey = type + "queue",
|
1969 |
+
markDataKey = type + "mark",
|
1970 |
+
defer = jQuery._data( elem, deferDataKey );
|
1971 |
+
if ( defer &&
|
1972 |
+
( src === "queue" || !jQuery._data(elem, queueDataKey) ) &&
|
1973 |
+
( src === "mark" || !jQuery._data(elem, markDataKey) ) ) {
|
1974 |
+
// Give room for hard-coded callbacks to fire first
|
1975 |
+
// and eventually mark/queue something else on the element
|
1976 |
+
setTimeout( function() {
|
1977 |
+
if ( !jQuery._data( elem, queueDataKey ) &&
|
1978 |
+
!jQuery._data( elem, markDataKey ) ) {
|
1979 |
+
jQuery.removeData( elem, deferDataKey, true );
|
1980 |
+
defer.fire();
|
1981 |
+
}
|
1982 |
+
}, 0 );
|
1983 |
+
}
|
1984 |
+
}
|
1985 |
+
|
1986 |
+
jQuery.extend({
|
1987 |
+
|
1988 |
+
_mark: function( elem, type ) {
|
1989 |
+
if ( elem ) {
|
1990 |
+
type = ( type || "fx" ) + "mark";
|
1991 |
+
jQuery._data( elem, type, (jQuery._data( elem, type ) || 0) + 1 );
|
1992 |
+
}
|
1993 |
+
},
|
1994 |
+
|
1995 |
+
_unmark: function( force, elem, type ) {
|
1996 |
+
if ( force !== true ) {
|
1997 |
+
type = elem;
|
1998 |
+
elem = force;
|
1999 |
+
force = false;
|
2000 |
+
}
|
2001 |
+
if ( elem ) {
|
2002 |
+
type = type || "fx";
|
2003 |
+
var key = type + "mark",
|
2004 |
+
count = force ? 0 : ( (jQuery._data( elem, key ) || 1) - 1 );
|
2005 |
+
if ( count ) {
|
2006 |
+
jQuery._data( elem, key, count );
|
2007 |
+
} else {
|
2008 |
+
jQuery.removeData( elem, key, true );
|
2009 |
+
handleQueueMarkDefer( elem, type, "mark" );
|
2010 |
+
}
|
2011 |
+
}
|
2012 |
+
},
|
2013 |
+
|
2014 |
+
queue: function( elem, type, data ) {
|
2015 |
+
var q;
|
2016 |
+
if ( elem ) {
|
2017 |
+
type = ( type || "fx" ) + "queue";
|
2018 |
+
q = jQuery._data( elem, type );
|
2019 |
+
|
2020 |
+
// Speed up dequeue by getting out quickly if this is just a lookup
|
2021 |
+
if ( data ) {
|
2022 |
+
if ( !q || jQuery.isArray(data) ) {
|
2023 |
+
q = jQuery._data( elem, type, jQuery.makeArray(data) );
|
2024 |
+
} else {
|
2025 |
+
q.push( data );
|
2026 |
+
}
|
2027 |
+
}
|
2028 |
+
return q || [];
|
2029 |
+
}
|
2030 |
+
},
|
2031 |
+
|
2032 |
+
dequeue: function( elem, type ) {
|
2033 |
+
type = type || "fx";
|
2034 |
+
|
2035 |
+
var queue = jQuery.queue( elem, type ),
|
2036 |
+
fn = queue.shift(),
|
2037 |
+
hooks = {};
|
2038 |
+
|
2039 |
+
// If the fx queue is dequeued, always remove the progress sentinel
|
2040 |
+
if ( fn === "inprogress" ) {
|
2041 |
+
fn = queue.shift();
|
2042 |
+
}
|
2043 |
+
|
2044 |
+
if ( fn ) {
|
2045 |
+
// Add a progress sentinel to prevent the fx queue from being
|
2046 |
+
// automatically dequeued
|
2047 |
+
if ( type === "fx" ) {
|
2048 |
+
queue.unshift( "inprogress" );
|
2049 |
+
}
|
2050 |
+
|
2051 |
+
jQuery._data( elem, type + ".run", hooks );
|
2052 |
+
fn.call( elem, function() {
|
2053 |
+
jQuery.dequeue( elem, type );
|
2054 |
+
}, hooks );
|
2055 |
+
}
|
2056 |
+
|
2057 |
+
if ( !queue.length ) {
|
2058 |
+
jQuery.removeData( elem, type + "queue " + type + ".run", true );
|
2059 |
+
handleQueueMarkDefer( elem, type, "queue" );
|
2060 |
+
}
|
2061 |
+
}
|
2062 |
+
});
|
2063 |
+
|
2064 |
+
jQuery.fn.extend({
|
2065 |
+
queue: function( type, data ) {
|
2066 |
+
if ( typeof type !== "string" ) {
|
2067 |
+
data = type;
|
2068 |
+
type = "fx";
|
2069 |
+
}
|
2070 |
+
|
2071 |
+
if ( data === undefined ) {
|
2072 |
+
return jQuery.queue( this[0], type );
|
2073 |
+
}
|
2074 |
+
return this.each(function() {
|
2075 |
+
var queue = jQuery.queue( this, type, data );
|
2076 |
+
|
2077 |
+
if ( type === "fx" && queue[0] !== "inprogress" ) {
|
2078 |
+
jQuery.dequeue( this, type );
|
2079 |
+
}
|
2080 |
+
});
|
2081 |
+
},
|
2082 |
+
dequeue: function( type ) {
|
2083 |
+
return this.each(function() {
|
2084 |
+
jQuery.dequeue( this, type );
|
2085 |
+
});
|
2086 |
+
},
|
2087 |
+
// Based off of the plugin by Clint Helfers, with permission.
|
2088 |
+
// http://blindsignals.com/index.php/2009/07/jquery-delay/
|
2089 |
+
delay: function( time, type ) {
|
2090 |
+
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
|
2091 |
+
type = type || "fx";
|
2092 |
+
|
2093 |
+
return this.queue( type, function( next, hooks ) {
|
2094 |
+
var timeout = setTimeout( next, time );
|
2095 |
+
hooks.stop = function() {
|
2096 |
+
clearTimeout( timeout );
|
2097 |
+
};
|
2098 |
+
});
|
2099 |
+
},
|
2100 |
+
clearQueue: function( type ) {
|
2101 |
+
return this.queue( type || "fx", [] );
|
2102 |
+
},
|
2103 |
+
// Get a promise resolved when queues of a certain type
|
2104 |
+
// are emptied (fx is the type by default)
|
2105 |
+
promise: function( type, object ) {
|
2106 |
+
if ( typeof type !== "string" ) {
|
2107 |
+
object = type;
|
2108 |
+
type = undefined;
|
2109 |
+
}
|
2110 |
+
type = type || "fx";
|
2111 |
+
var defer = jQuery.Deferred(),
|
2112 |
+
elements = this,
|
2113 |
+
i = elements.length,
|
2114 |
+
count = 1,
|
2115 |
+
deferDataKey = type + "defer",
|
2116 |
+
queueDataKey = type + "queue",
|
2117 |
+
markDataKey = type + "mark",
|
2118 |
+
tmp;
|
2119 |
+
function resolve() {
|
2120 |
+
if ( !( --count ) ) {
|
2121 |
+
defer.resolveWith( elements, [ elements ] );
|
2122 |
+
}
|
2123 |
+
}
|
2124 |
+
while( i-- ) {
|
2125 |
+
if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
|
2126 |
+
( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
|
2127 |
+
jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
|
2128 |
+
jQuery.data( elements[ i ], deferDataKey, jQuery.Callbacks( "once memory" ), true ) )) {
|
2129 |
+
count++;
|
2130 |
+
tmp.add( resolve );
|
2131 |
+
}
|
2132 |
+
}
|
2133 |
+
resolve();
|
2134 |
+
return defer.promise();
|
2135 |
+
}
|
2136 |
+
});
|
2137 |
+
|
2138 |
+
|
2139 |
+
|
2140 |
+
|
2141 |
+
var rclass = /[\n\t\r]/g,
|
2142 |
+
rspace = /\s+/,
|
2143 |
+
rreturn = /\r/g,
|
2144 |
+
rtype = /^(?:button|input)$/i,
|
2145 |
+
rfocusable = /^(?:button|input|object|select|textarea)$/i,
|
2146 |
+
rclickable = /^a(?:rea)?$/i,
|
2147 |
+
rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
|
2148 |
+
getSetAttribute = jQuery.support.getSetAttribute,
|
2149 |
+
nodeHook, boolHook, fixSpecified;
|
2150 |
+
|
2151 |
+
jQuery.fn.extend({
|
2152 |
+
attr: function( name, value ) {
|
2153 |
+
return jQuery.access( this, name, value, true, jQuery.attr );
|
2154 |
+
},
|
2155 |
+
|
2156 |
+
removeAttr: function( name ) {
|
2157 |
+
return this.each(function() {
|
2158 |
+
jQuery.removeAttr( this, name );
|
2159 |
+
});
|
2160 |
+
},
|
2161 |
+
|
2162 |
+
prop: function( name, value ) {
|
2163 |
+
return jQuery.access( this, name, value, true, jQuery.prop );
|
2164 |
+
},
|
2165 |
+
|
2166 |
+
removeProp: function( name ) {
|
2167 |
+
name = jQuery.propFix[ name ] || name;
|
2168 |
+
return this.each(function() {
|
2169 |
+
// try/catch handles cases where IE balks (such as removing a property on window)
|
2170 |
+
try {
|
2171 |
+
this[ name ] = undefined;
|
2172 |
+
delete this[ name ];
|
2173 |
+
} catch( e ) {}
|
2174 |
+
});
|
2175 |
+
},
|
2176 |
+
|
2177 |
+
addClass: function( value ) {
|
2178 |
+
var classNames, i, l, elem,
|
2179 |
+
setClass, c, cl;
|
2180 |
+
|
2181 |
+
if ( jQuery.isFunction( value ) ) {
|
2182 |
+
return this.each(function( j ) {
|
2183 |
+
jQuery( this ).addClass( value.call(this, j, this.className) );
|
2184 |
+
});
|
2185 |
+
}
|
2186 |
+
|
2187 |
+
if ( value && typeof value === "string" ) {
|
2188 |
+
classNames = value.split( rspace );
|
2189 |
+
|
2190 |
+
for ( i = 0, l = this.length; i < l; i++ ) {
|
2191 |
+
elem = this[ i ];
|
2192 |
+
|
2193 |
+
if ( elem.nodeType === 1 ) {
|
2194 |
+
if ( !elem.className && classNames.length === 1 ) {
|
2195 |
+
elem.className = value;
|
2196 |
+
|
2197 |
+
} else {
|
2198 |
+
setClass = " " + elem.className + " ";
|
2199 |
+
|
2200 |
+
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
2201 |
+
if ( !~setClass.indexOf( " " + classNames[ c ] + " " ) ) {
|
2202 |
+
setClass += classNames[ c ] + " ";
|
2203 |
+
}
|
2204 |
+
}
|
2205 |
+
elem.className = jQuery.trim( setClass );
|
2206 |
+
}
|
2207 |
+
}
|
2208 |
+
}
|
2209 |
+
}
|
2210 |
+
|
2211 |
+
return this;
|
2212 |
+
},
|
2213 |
+
|
2214 |
+
removeClass: function( value ) {
|
2215 |
+
var classNames, i, l, elem, className, c, cl;
|
2216 |
+
|
2217 |
+
if ( jQuery.isFunction( value ) ) {
|
2218 |
+
return this.each(function( j ) {
|
2219 |
+
jQuery( this ).removeClass( value.call(this, j, this.className) );
|
2220 |
+
});
|
2221 |
+
}
|
2222 |
+
|
2223 |
+
if ( (value && typeof value === "string") || value === undefined ) {
|
2224 |
+
classNames = ( value || "" ).split( rspace );
|
2225 |
+
|
2226 |
+
for ( i = 0, l = this.length; i < l; i++ ) {
|
2227 |
+
elem = this[ i ];
|
2228 |
+
|
2229 |
+
if ( elem.nodeType === 1 && elem.className ) {
|
2230 |
+
if ( value ) {
|
2231 |
+
className = (" " + elem.className + " ").replace( rclass, " " );
|
2232 |
+
for ( c = 0, cl = classNames.length; c < cl; c++ ) {
|
2233 |
+
className = className.replace(" " + classNames[ c ] + " ", " ");
|
2234 |
+
}
|
2235 |
+
elem.className = jQuery.trim( className );
|
2236 |
+
|
2237 |
+
} else {
|
2238 |
+
elem.className = "";
|
2239 |
+
}
|
2240 |
+
}
|
2241 |
+
}
|
2242 |
+
}
|
2243 |
+
|
2244 |
+
return this;
|
2245 |
+
},
|
2246 |
+
|
2247 |
+
toggleClass: function( value, stateVal ) {
|
2248 |
+
var type = typeof value,
|
2249 |
+
isBool = typeof stateVal === "boolean";
|
2250 |
+
|
2251 |
+
if ( jQuery.isFunction( value ) ) {
|
2252 |
+
return this.each(function( i ) {
|
2253 |
+
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
|
2254 |
+
});
|
2255 |
+
}
|
2256 |
+
|
2257 |
+
return this.each(function() {
|
2258 |
+
if ( type === "string" ) {
|
2259 |
+
// toggle individual class names
|
2260 |
+
var className,
|
2261 |
+
i = 0,
|
2262 |
+
self = jQuery( this ),
|
2263 |
+
state = stateVal,
|
2264 |
+
classNames = value.split( rspace );
|
2265 |
+
|
2266 |
+
while ( (className = classNames[ i++ ]) ) {
|
2267 |
+
// check each className given, space seperated list
|
2268 |
+
state = isBool ? state : !self.hasClass( className );
|
2269 |
+
self[ state ? "addClass" : "removeClass" ]( className );
|
2270 |
+
}
|
2271 |
+
|
2272 |
+
} else if ( type === "undefined" || type === "boolean" ) {
|
2273 |
+
if ( this.className ) {
|
2274 |
+
// store className if set
|
2275 |
+
jQuery._data( this, "__className__", this.className );
|
2276 |
+
}
|
2277 |
+
|
2278 |
+
// toggle whole className
|
2279 |
+
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
|
2280 |
+
}
|
2281 |
+
});
|
2282 |
+
},
|
2283 |
+
|
2284 |
+
hasClass: function( selector ) {
|
2285 |
+
var className = " " + selector + " ",
|
2286 |
+
i = 0,
|
2287 |
+
l = this.length;
|
2288 |
+
for ( ; i < l; i++ ) {
|
2289 |
+
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
|
2290 |
+
return true;
|
2291 |
+
}
|
2292 |
+
}
|
2293 |
+
|
2294 |
+
return false;
|
2295 |
+
},
|
2296 |
+
|
2297 |
+
val: function( value ) {
|
2298 |
+
var hooks, ret, isFunction,
|
2299 |
+
elem = this[0];
|
2300 |
+
|
2301 |
+
if ( !arguments.length ) {
|
2302 |
+
if ( elem ) {
|
2303 |
+
hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
|
2304 |
+
|
2305 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
|
2306 |
+
return ret;
|
2307 |
+
}
|
2308 |
+
|
2309 |
+
ret = elem.value;
|
2310 |
+
|
2311 |
+
return typeof ret === "string" ?
|
2312 |
+
// handle most common string cases
|
2313 |
+
ret.replace(rreturn, "") :
|
2314 |
+
// handle cases where value is null/undef or number
|
2315 |
+
ret == null ? "" : ret;
|
2316 |
+
}
|
2317 |
+
|
2318 |
+
return;
|
2319 |
+
}
|
2320 |
+
|
2321 |
+
isFunction = jQuery.isFunction( value );
|
2322 |
+
|
2323 |
+
return this.each(function( i ) {
|
2324 |
+
var self = jQuery(this), val;
|
2325 |
+
|
2326 |
+
if ( this.nodeType !== 1 ) {
|
2327 |
+
return;
|
2328 |
+
}
|
2329 |
+
|
2330 |
+
if ( isFunction ) {
|
2331 |
+
val = value.call( this, i, self.val() );
|
2332 |
+
} else {
|
2333 |
+
val = value;
|
2334 |
+
}
|
2335 |
+
|
2336 |
+
// Treat null/undefined as ""; convert numbers to string
|
2337 |
+
if ( val == null ) {
|
2338 |
+
val = "";
|
2339 |
+
} else if ( typeof val === "number" ) {
|
2340 |
+
val += "";
|
2341 |
+
} else if ( jQuery.isArray( val ) ) {
|
2342 |
+
val = jQuery.map(val, function ( value ) {
|
2343 |
+
return value == null ? "" : value + "";
|
2344 |
+
});
|
2345 |
+
}
|
2346 |
+
|
2347 |
+
hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
|
2348 |
+
|
2349 |
+
// If set returns undefined, fall back to normal setting
|
2350 |
+
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
|
2351 |
+
this.value = val;
|
2352 |
+
}
|
2353 |
+
});
|
2354 |
+
}
|
2355 |
+
});
|
2356 |
+
|
2357 |
+
jQuery.extend({
|
2358 |
+
valHooks: {
|
2359 |
+
option: {
|
2360 |
+
get: function( elem ) {
|
2361 |
+
// attributes.value is undefined in Blackberry 4.7 but
|
2362 |
+
// uses .value. See #6932
|
2363 |
+
var val = elem.attributes.value;
|
2364 |
+
return !val || val.specified ? elem.value : elem.text;
|
2365 |
+
}
|
2366 |
+
},
|
2367 |
+
select: {
|
2368 |
+
get: function( elem ) {
|
2369 |
+
var value, i, max, option,
|
2370 |
+
index = elem.selectedIndex,
|
2371 |
+
values = [],
|
2372 |
+
options = elem.options,
|
2373 |
+
one = elem.type === "select-one";
|
2374 |
+
|
2375 |
+
// Nothing was selected
|
2376 |
+
if ( index < 0 ) {
|
2377 |
+
return null;
|
2378 |
+
}
|
2379 |
+
|
2380 |
+
// Loop through all the selected options
|
2381 |
+
i = one ? index : 0;
|
2382 |
+
max = one ? index + 1 : options.length;
|
2383 |
+
for ( ; i < max; i++ ) {
|
2384 |
+
option = options[ i ];
|
2385 |
+
|
2386 |
+
// Don't return options that are disabled or in a disabled optgroup
|
2387 |
+
if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) &&
|
2388 |
+
(!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
|
2389 |
+
|
2390 |
+
// Get the specific value for the option
|
2391 |
+
value = jQuery( option ).val();
|
2392 |
+
|
2393 |
+
// We don't need an array for one selects
|
2394 |
+
if ( one ) {
|
2395 |
+
return value;
|
2396 |
+
}
|
2397 |
+
|
2398 |
+
// Multi-Selects return an array
|
2399 |
+
values.push( value );
|
2400 |
+
}
|
2401 |
+
}
|
2402 |
+
|
2403 |
+
// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
|
2404 |
+
if ( one && !values.length && options.length ) {
|
2405 |
+
return jQuery( options[ index ] ).val();
|
2406 |
+
}
|
2407 |
+
|
2408 |
+
return values;
|
2409 |
+
},
|
2410 |
+
|
2411 |
+
set: function( elem, value ) {
|
2412 |
+
var values = jQuery.makeArray( value );
|
2413 |
+
|
2414 |
+
jQuery(elem).find("option").each(function() {
|
2415 |
+
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
|
2416 |
+
});
|
2417 |
+
|
2418 |
+
if ( !values.length ) {
|
2419 |
+
elem.selectedIndex = -1;
|
2420 |
+
}
|
2421 |
+
return values;
|
2422 |
+
}
|
2423 |
+
}
|
2424 |
+
},
|
2425 |
+
|
2426 |
+
attrFn: {
|
2427 |
+
val: true,
|
2428 |
+
css: true,
|
2429 |
+
html: true,
|
2430 |
+
text: true,
|
2431 |
+
data: true,
|
2432 |
+
width: true,
|
2433 |
+
height: true,
|
2434 |
+
offset: true
|
2435 |
+
},
|
2436 |
+
|
2437 |
+
attr: function( elem, name, value, pass ) {
|
2438 |
+
var ret, hooks, notxml,
|
2439 |
+
nType = elem.nodeType;
|
2440 |
+
|
2441 |
+
// don't get/set attributes on text, comment and attribute nodes
|
2442 |
+
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
2443 |
+
return;
|
2444 |
+
}
|
2445 |
+
|
2446 |
+
if ( pass && name in jQuery.attrFn ) {
|
2447 |
+
return jQuery( elem )[ name ]( value );
|
2448 |
+
}
|
2449 |
+
|
2450 |
+
// Fallback to prop when attributes are not supported
|
2451 |
+
if ( typeof elem.getAttribute === "undefined" ) {
|
2452 |
+
return jQuery.prop( elem, name, value );
|
2453 |
+
}
|
2454 |
+
|
2455 |
+
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
2456 |
+
|
2457 |
+
// All attributes are lowercase
|
2458 |
+
// Grab necessary hook if one is defined
|
2459 |
+
if ( notxml ) {
|
2460 |
+
name = name.toLowerCase();
|
2461 |
+
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
|
2462 |
+
}
|
2463 |
+
|
2464 |
+
if ( value !== undefined ) {
|
2465 |
+
|
2466 |
+
if ( value === null ) {
|
2467 |
+
jQuery.removeAttr( elem, name );
|
2468 |
+
return;
|
2469 |
+
|
2470 |
+
} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
2471 |
+
return ret;
|
2472 |
+
|
2473 |
+
} else {
|
2474 |
+
elem.setAttribute( name, "" + value );
|
2475 |
+
return value;
|
2476 |
+
}
|
2477 |
+
|
2478 |
+
} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
|
2479 |
+
return ret;
|
2480 |
+
|
2481 |
+
} else {
|
2482 |
+
|
2483 |
+
ret = elem.getAttribute( name );
|
2484 |
+
|
2485 |
+
// Non-existent attributes return null, we normalize to undefined
|
2486 |
+
return ret === null ?
|
2487 |
+
undefined :
|
2488 |
+
ret;
|
2489 |
+
}
|
2490 |
+
},
|
2491 |
+
|
2492 |
+
removeAttr: function( elem, value ) {
|
2493 |
+
var propName, attrNames, name, l,
|
2494 |
+
i = 0;
|
2495 |
+
|
2496 |
+
if ( value && elem.nodeType === 1 ) {
|
2497 |
+
attrNames = value.toLowerCase().split( rspace );
|
2498 |
+
l = attrNames.length;
|
2499 |
+
|
2500 |
+
for ( ; i < l; i++ ) {
|
2501 |
+
name = attrNames[ i ];
|
2502 |
+
|
2503 |
+
if ( name ) {
|
2504 |
+
propName = jQuery.propFix[ name ] || name;
|
2505 |
+
|
2506 |
+
// See #9699 for explanation of this approach (setting first, then removal)
|
2507 |
+
jQuery.attr( elem, name, "" );
|
2508 |
+
elem.removeAttribute( getSetAttribute ? name : propName );
|
2509 |
+
|
2510 |
+
// Set corresponding property to false for boolean attributes
|
2511 |
+
if ( rboolean.test( name ) && propName in elem ) {
|
2512 |
+
elem[ propName ] = false;
|
2513 |
+
}
|
2514 |
+
}
|
2515 |
+
}
|
2516 |
+
}
|
2517 |
+
},
|
2518 |
+
|
2519 |
+
attrHooks: {
|
2520 |
+
type: {
|
2521 |
+
set: function( elem, value ) {
|
2522 |
+
// We can't allow the type property to be changed (since it causes problems in IE)
|
2523 |
+
if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
|
2524 |
+
jQuery.error( "type property can't be changed" );
|
2525 |
+
} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
2526 |
+
// Setting the type on a radio button after the value resets the value in IE6-9
|
2527 |
+
// Reset value to it's default in case type is set after value
|
2528 |
+
// This is for element creation
|
2529 |
+
var val = elem.value;
|
2530 |
+
elem.setAttribute( "type", value );
|
2531 |
+
if ( val ) {
|
2532 |
+
elem.value = val;
|
2533 |
+
}
|
2534 |
+
return value;
|
2535 |
+
}
|
2536 |
+
}
|
2537 |
+
},
|
2538 |
+
// Use the value property for back compat
|
2539 |
+
// Use the nodeHook for button elements in IE6/7 (#1954)
|
2540 |
+
value: {
|
2541 |
+
get: function( elem, name ) {
|
2542 |
+
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
|
2543 |
+
return nodeHook.get( elem, name );
|
2544 |
+
}
|
2545 |
+
return name in elem ?
|
2546 |
+
elem.value :
|
2547 |
+
null;
|
2548 |
+
},
|
2549 |
+
set: function( elem, value, name ) {
|
2550 |
+
if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
|
2551 |
+
return nodeHook.set( elem, value, name );
|
2552 |
+
}
|
2553 |
+
// Does not return so that setAttribute is also used
|
2554 |
+
elem.value = value;
|
2555 |
+
}
|
2556 |
+
}
|
2557 |
+
},
|
2558 |
+
|
2559 |
+
propFix: {
|
2560 |
+
tabindex: "tabIndex",
|
2561 |
+
readonly: "readOnly",
|
2562 |
+
"for": "htmlFor",
|
2563 |
+
"class": "className",
|
2564 |
+
maxlength: "maxLength",
|
2565 |
+
cellspacing: "cellSpacing",
|
2566 |
+
cellpadding: "cellPadding",
|
2567 |
+
rowspan: "rowSpan",
|
2568 |
+
colspan: "colSpan",
|
2569 |
+
usemap: "useMap",
|
2570 |
+
frameborder: "frameBorder",
|
2571 |
+
contenteditable: "contentEditable"
|
2572 |
+
},
|
2573 |
+
|
2574 |
+
prop: function( elem, name, value ) {
|
2575 |
+
var ret, hooks, notxml,
|
2576 |
+
nType = elem.nodeType;
|
2577 |
+
|
2578 |
+
// don't get/set properties on text, comment and attribute nodes
|
2579 |
+
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
2580 |
+
return;
|
2581 |
+
}
|
2582 |
+
|
2583 |
+
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
2584 |
+
|
2585 |
+
if ( notxml ) {
|
2586 |
+
// Fix name and attach hooks
|
2587 |
+
name = jQuery.propFix[ name ] || name;
|
2588 |
+
hooks = jQuery.propHooks[ name ];
|
2589 |
+
}
|
2590 |
+
|
2591 |
+
if ( value !== undefined ) {
|
2592 |
+
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
2593 |
+
return ret;
|
2594 |
+
|
2595 |
+
} else {
|
2596 |
+
return ( elem[ name ] = value );
|
2597 |
+
}
|
2598 |
+
|
2599 |
+
} else {
|
2600 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
|
2601 |
+
return ret;
|
2602 |
+
|
2603 |
+
} else {
|
2604 |
+
return elem[ name ];
|
2605 |
+
}
|
2606 |
+
}
|
2607 |
+
},
|
2608 |
+
|
2609 |
+
propHooks: {
|
2610 |
+
tabIndex: {
|
2611 |
+
get: function( elem ) {
|
2612 |
+
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
|
2613 |
+
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
2614 |
+
var attributeNode = elem.getAttributeNode("tabindex");
|
2615 |
+
|
2616 |
+
return attributeNode && attributeNode.specified ?
|
2617 |
+
parseInt( attributeNode.value, 10 ) :
|
2618 |
+
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
|
2619 |
+
0 :
|
2620 |
+
undefined;
|
2621 |
+
}
|
2622 |
+
}
|
2623 |
+
}
|
2624 |
+
});
|
2625 |
+
|
2626 |
+
// Add the tabIndex propHook to attrHooks for back-compat (different case is intentional)
|
2627 |
+
jQuery.attrHooks.tabindex = jQuery.propHooks.tabIndex;
|
2628 |
+
|
2629 |
+
// Hook for boolean attributes
|
2630 |
+
boolHook = {
|
2631 |
+
get: function( elem, name ) {
|
2632 |
+
// Align boolean attributes with corresponding properties
|
2633 |
+
// Fall back to attribute presence where some booleans are not supported
|
2634 |
+
var attrNode,
|
2635 |
+
property = jQuery.prop( elem, name );
|
2636 |
+
return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
|
2637 |
+
name.toLowerCase() :
|
2638 |
+
undefined;
|
2639 |
+
},
|
2640 |
+
set: function( elem, value, name ) {
|
2641 |
+
var propName;
|
2642 |
+
if ( value === false ) {
|
2643 |
+
// Remove boolean attributes when set to false
|
2644 |
+
jQuery.removeAttr( elem, name );
|
2645 |
+
} else {
|
2646 |
+
// value is true since we know at this point it's type boolean and not false
|
2647 |
+
// Set boolean attributes to the same name and set the DOM property
|
2648 |
+
propName = jQuery.propFix[ name ] || name;
|
2649 |
+
if ( propName in elem ) {
|
2650 |
+
// Only set the IDL specifically if it already exists on the element
|
2651 |
+
elem[ propName ] = true;
|
2652 |
+
}
|
2653 |
+
|
2654 |
+
elem.setAttribute( name, name.toLowerCase() );
|
2655 |
+
}
|
2656 |
+
return name;
|
2657 |
+
}
|
2658 |
+
};
|
2659 |
+
|
2660 |
+
// IE6/7 do not support getting/setting some attributes with get/setAttribute
|
2661 |
+
if ( !getSetAttribute ) {
|
2662 |
+
|
2663 |
+
fixSpecified = {
|
2664 |
+
name: true,
|
2665 |
+
id: true
|
2666 |
+
};
|
2667 |
+
|
2668 |
+
// Use this for any attribute in IE6/7
|
2669 |
+
// This fixes almost every IE6/7 issue
|
2670 |
+
nodeHook = jQuery.valHooks.button = {
|
2671 |
+
get: function( elem, name ) {
|
2672 |
+
var ret;
|
2673 |
+
ret = elem.getAttributeNode( name );
|
2674 |
+
return ret && ( fixSpecified[ name ] ? ret.nodeValue !== "" : ret.specified ) ?
|
2675 |
+
ret.nodeValue :
|
2676 |
+
undefined;
|
2677 |
+
},
|
2678 |
+
set: function( elem, value, name ) {
|
2679 |
+
// Set the existing or create a new attribute node
|
2680 |
+
var ret = elem.getAttributeNode( name );
|
2681 |
+
if ( !ret ) {
|
2682 |
+
ret = document.createAttribute( name );
|
2683 |
+
elem.setAttributeNode( ret );
|
2684 |
+
}
|
2685 |
+
return ( ret.nodeValue = value + "" );
|
2686 |
+
}
|
2687 |
+
};
|
2688 |
+
|
2689 |
+
// Apply the nodeHook to tabindex
|
2690 |
+
jQuery.attrHooks.tabindex.set = nodeHook.set;
|
2691 |
+
|
2692 |
+
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
|
2693 |
+
// This is for removals
|
2694 |
+
jQuery.each([ "width", "height" ], function( i, name ) {
|
2695 |
+
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
2696 |
+
set: function( elem, value ) {
|
2697 |
+
if ( value === "" ) {
|
2698 |
+
elem.setAttribute( name, "auto" );
|
2699 |
+
return value;
|
2700 |
+
}
|
2701 |
+
}
|
2702 |
+
});
|
2703 |
+
});
|
2704 |
+
|
2705 |
+
// Set contenteditable to false on removals(#10429)
|
2706 |
+
// Setting to empty string throws an error as an invalid value
|
2707 |
+
jQuery.attrHooks.contenteditable = {
|
2708 |
+
get: nodeHook.get,
|
2709 |
+
set: function( elem, value, name ) {
|
2710 |
+
if ( value === "" ) {
|
2711 |
+
value = "false";
|
2712 |
+
}
|
2713 |
+
nodeHook.set( elem, value, name );
|
2714 |
+
}
|
2715 |
+
};
|
2716 |
+
}
|
2717 |
+
|
2718 |
+
|
2719 |
+
// Some attributes require a special call on IE
|
2720 |
+
if ( !jQuery.support.hrefNormalized ) {
|
2721 |
+
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
|
2722 |
+
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
2723 |
+
get: function( elem ) {
|
2724 |
+
var ret = elem.getAttribute( name, 2 );
|
2725 |
+
return ret === null ? undefined : ret;
|
2726 |
+
}
|
2727 |
+
});
|
2728 |
+
});
|
2729 |
+
}
|
2730 |
+
|
2731 |
+
if ( !jQuery.support.style ) {
|
2732 |
+
jQuery.attrHooks.style = {
|
2733 |
+
get: function( elem ) {
|
2734 |
+
// Return undefined in the case of empty string
|
2735 |
+
// Normalize to lowercase since IE uppercases css property names
|
2736 |
+
return elem.style.cssText.toLowerCase() || undefined;
|
2737 |
+
},
|
2738 |
+
set: function( elem, value ) {
|
2739 |
+
return ( elem.style.cssText = "" + value );
|
2740 |
+
}
|
2741 |
+
};
|
2742 |
+
}
|
2743 |
+
|
2744 |
+
// Safari mis-reports the default selected property of an option
|
2745 |
+
// Accessing the parent's selectedIndex property fixes it
|
2746 |
+
if ( !jQuery.support.optSelected ) {
|
2747 |
+
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
|
2748 |
+
get: function( elem ) {
|
2749 |
+
var parent = elem.parentNode;
|
2750 |
+
|
2751 |
+
if ( parent ) {
|
2752 |
+
parent.selectedIndex;
|
2753 |
+
|
2754 |
+
// Make sure that it also works with optgroups, see #5701
|
2755 |
+
if ( parent.parentNode ) {
|
2756 |
+
parent.parentNode.selectedIndex;
|
2757 |
+
}
|
2758 |
+
}
|
2759 |
+
return null;
|
2760 |
+
}
|
2761 |
+
});
|
2762 |
+
}
|
2763 |
+
|
2764 |
+
// IE6/7 call enctype encoding
|
2765 |
+
if ( !jQuery.support.enctype ) {
|
2766 |
+
jQuery.propFix.enctype = "encoding";
|
2767 |
+
}
|
2768 |
+
|
2769 |
+
// Radios and checkboxes getter/setter
|
2770 |
+
if ( !jQuery.support.checkOn ) {
|
2771 |
+
jQuery.each([ "radio", "checkbox" ], function() {
|
2772 |
+
jQuery.valHooks[ this ] = {
|
2773 |
+
get: function( elem ) {
|
2774 |
+
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
|
2775 |
+
return elem.getAttribute("value") === null ? "on" : elem.value;
|
2776 |
+
}
|
2777 |
+
};
|
2778 |
+
});
|
2779 |
+
}
|
2780 |
+
jQuery.each([ "radio", "checkbox" ], function() {
|
2781 |
+
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
|
2782 |
+
set: function( elem, value ) {
|
2783 |
+
if ( jQuery.isArray( value ) ) {
|
2784 |
+
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
|
2785 |
+
}
|
2786 |
+
}
|
2787 |
+
});
|
2788 |
+
});
|
2789 |
+
|
2790 |
+
|
2791 |
+
|
2792 |
+
|
2793 |
+
var rformElems = /^(?:textarea|input|select)$/i,
|
2794 |
+
rtypenamespace = /^([^\.]*)?(?:\.(.+))?$/,
|
2795 |
+
rhoverHack = /\bhover(\.\S+)?\b/,
|
2796 |
+
rkeyEvent = /^key/,
|
2797 |
+
rmouseEvent = /^(?:mouse|contextmenu)|click/,
|
2798 |
+
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
2799 |
+
rquickIs = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
|
2800 |
+
quickParse = function( selector ) {
|
2801 |
+
var quick = rquickIs.exec( selector );
|
2802 |
+
if ( quick ) {
|
2803 |
+
// 0 1 2 3
|
2804 |
+
// [ _, tag, id, class ]
|
2805 |
+
quick[1] = ( quick[1] || "" ).toLowerCase();
|
2806 |
+
quick[3] = quick[3] && new RegExp( "(?:^|\\s)" + quick[3] + "(?:\\s|$)" );
|
2807 |
+
}
|
2808 |
+
return quick;
|
2809 |
+
},
|
2810 |
+
quickIs = function( elem, m ) {
|
2811 |
+
var attrs = elem.attributes || {};
|
2812 |
+
return (
|
2813 |
+
(!m[1] || elem.nodeName.toLowerCase() === m[1]) &&
|
2814 |
+
(!m[2] || (attrs.id || {}).value === m[2]) &&
|
2815 |
+
(!m[3] || m[3].test( (attrs[ "class" ] || {}).value ))
|
2816 |
+
);
|
2817 |
+
},
|
2818 |
+
hoverHack = function( events ) {
|
2819 |
+
return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
|
2820 |
+
};
|
2821 |
+
|
2822 |
+
/*
|
2823 |
+
* Helper functions for managing events -- not part of the public interface.
|
2824 |
+
* Props to Dean Edwards' addEvent library for many of the ideas.
|
2825 |
+
*/
|
2826 |
+
jQuery.event = {
|
2827 |
+
|
2828 |
+
add: function( elem, types, handler, data, selector ) {
|
2829 |
+
|
2830 |
+
var elemData, eventHandle, events,
|
2831 |
+
t, tns, type, namespaces, handleObj,
|
2832 |
+
handleObjIn, quick, handlers, special;
|
2833 |
+
|
2834 |
+
// Don't attach events to noData or text/comment nodes (allow plain objects tho)
|
2835 |
+
if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
|
2836 |
+
return;
|
2837 |
+
}
|
2838 |
+
|
2839 |
+
// Caller can pass in an object of custom data in lieu of the handler
|
2840 |
+
if ( handler.handler ) {
|
2841 |
+
handleObjIn = handler;
|
2842 |
+
handler = handleObjIn.handler;
|
2843 |
+
}
|
2844 |
+
|
2845 |
+
// Make sure that the handler has a unique ID, used to find/remove it later
|
2846 |
+
if ( !handler.guid ) {
|
2847 |
+
handler.guid = jQuery.guid++;
|
2848 |
+
}
|
2849 |
+
|
2850 |
+
// Init the element's event structure and main handler, if this is the first
|
2851 |
+
events = elemData.events;
|
2852 |
+
if ( !events ) {
|
2853 |
+
elemData.events = events = {};
|
2854 |
+
}
|
2855 |
+
eventHandle = elemData.handle;
|
2856 |
+
if ( !eventHandle ) {
|
2857 |
+
elemData.handle = eventHandle = function( e ) {
|
2858 |
+
// Discard the second event of a jQuery.event.trigger() and
|
2859 |
+
// when an event is called after a page has unloaded
|
2860 |
+
return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
|
2861 |
+
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
|
2862 |
+
undefined;
|
2863 |
+
};
|
2864 |
+
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
|
2865 |
+
eventHandle.elem = elem;
|
2866 |
+
}
|
2867 |
+
|
2868 |
+
// Handle multiple events separated by a space
|
2869 |
+
// jQuery(...).bind("mouseover mouseout", fn);
|
2870 |
+
types = jQuery.trim( hoverHack(types) ).split( " " );
|
2871 |
+
for ( t = 0; t < types.length; t++ ) {
|
2872 |
+
|
2873 |
+
tns = rtypenamespace.exec( types[t] ) || [];
|
2874 |
+
type = tns[1];
|
2875 |
+
namespaces = ( tns[2] || "" ).split( "." ).sort();
|
2876 |
+
|
2877 |
+
// If event changes its type, use the special event handlers for the changed type
|
2878 |
+
special = jQuery.event.special[ type ] || {};
|
2879 |
+
|
2880 |
+
// If selector defined, determine special event api type, otherwise given type
|
2881 |
+
type = ( selector ? special.delegateType : special.bindType ) || type;
|
2882 |
+
|
2883 |
+
// Update special based on newly reset type
|
2884 |
+
special = jQuery.event.special[ type ] || {};
|
2885 |
+
|
2886 |
+
// handleObj is passed to all event handlers
|
2887 |
+
handleObj = jQuery.extend({
|
2888 |
+
type: type,
|
2889 |
+
origType: tns[1],
|
2890 |
+
data: data,
|
2891 |
+
handler: handler,
|
2892 |
+
guid: handler.guid,
|
2893 |
+
selector: selector,
|
2894 |
+
quick: quickParse( selector ),
|
2895 |
+
namespace: namespaces.join(".")
|
2896 |
+
}, handleObjIn );
|
2897 |
+
|
2898 |
+
// Init the event handler queue if we're the first
|
2899 |
+
handlers = events[ type ];
|
2900 |
+
if ( !handlers ) {
|
2901 |
+
handlers = events[ type ] = [];
|
2902 |
+
handlers.delegateCount = 0;
|
2903 |
+
|
2904 |
+
// Only use addEventListener/attachEvent if the special events handler returns false
|
2905 |
+
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
|
2906 |
+
// Bind the global event handler to the element
|
2907 |
+
if ( elem.addEventListener ) {
|
2908 |
+
elem.addEventListener( type, eventHandle, false );
|
2909 |
+
|
2910 |
+
} else if ( elem.attachEvent ) {
|
2911 |
+
elem.attachEvent( "on" + type, eventHandle );
|
2912 |
+
}
|
2913 |
+
}
|
2914 |
+
}
|
2915 |
+
|
2916 |
+
if ( special.add ) {
|
2917 |
+
special.add.call( elem, handleObj );
|
2918 |
+
|
2919 |
+
if ( !handleObj.handler.guid ) {
|
2920 |
+
handleObj.handler.guid = handler.guid;
|
2921 |
+
}
|
2922 |
+
}
|
2923 |
+
|
2924 |
+
// Add to the element's handler list, delegates in front
|
2925 |
+
if ( selector ) {
|
2926 |
+
handlers.splice( handlers.delegateCount++, 0, handleObj );
|
2927 |
+
} else {
|
2928 |
+
handlers.push( handleObj );
|
2929 |
+
}
|
2930 |
+
|
2931 |
+
// Keep track of which events have ever been used, for event optimization
|
2932 |
+
jQuery.event.global[ type ] = true;
|
2933 |
+
}
|
2934 |
+
|
2935 |
+
// Nullify elem to prevent memory leaks in IE
|
2936 |
+
elem = null;
|
2937 |
+
},
|
2938 |
+
|
2939 |
+
global: {},
|
2940 |
+
|
2941 |
+
// Detach an event or set of events from an element
|
2942 |
+
remove: function( elem, types, handler, selector, mappedTypes ) {
|
2943 |
+
|
2944 |
+
var elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
|
2945 |
+
t, tns, type, origType, namespaces, origCount,
|
2946 |
+
j, events, special, handle, eventType, handleObj;
|
2947 |
+
|
2948 |
+
if ( !elemData || !(events = elemData.events) ) {
|
2949 |
+
return;
|
2950 |
+
}
|
2951 |
+
|
2952 |
+
// Once for each type.namespace in types; type may be omitted
|
2953 |
+
types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
|
2954 |
+
for ( t = 0; t < types.length; t++ ) {
|
2955 |
+
tns = rtypenamespace.exec( types[t] ) || [];
|
2956 |
+
type = origType = tns[1];
|
2957 |
+
namespaces = tns[2];
|
2958 |
+
|
2959 |
+
// Unbind all events (on this namespace, if provided) for the element
|
2960 |
+
if ( !type ) {
|
2961 |
+
for ( type in events ) {
|
2962 |
+
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
|
2963 |
+
}
|
2964 |
+
continue;
|
2965 |
+
}
|
2966 |
+
|
2967 |
+
special = jQuery.event.special[ type ] || {};
|
2968 |
+
type = ( selector? special.delegateType : special.bindType ) || type;
|
2969 |
+
eventType = events[ type ] || [];
|
2970 |
+
origCount = eventType.length;
|
2971 |
+
namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
|
2972 |
+
|
2973 |
+
// Remove matching events
|
2974 |
+
for ( j = 0; j < eventType.length; j++ ) {
|
2975 |
+
handleObj = eventType[ j ];
|
2976 |
+
|
2977 |
+
if ( ( mappedTypes || origType === handleObj.origType ) &&
|
2978 |
+
( !handler || handler.guid === handleObj.guid ) &&
|
2979 |
+
( !namespaces || namespaces.test( handleObj.namespace ) ) &&
|
2980 |
+
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
|
2981 |
+
eventType.splice( j--, 1 );
|
2982 |
+
|
2983 |
+
if ( handleObj.selector ) {
|
2984 |
+
eventType.delegateCount--;
|
2985 |
+
}
|
2986 |
+
if ( special.remove ) {
|
2987 |
+
special.remove.call( elem, handleObj );
|
2988 |
+
}
|
2989 |
+
}
|
2990 |
+
}
|
2991 |
+
|
2992 |
+
// Remove generic event handler if we removed something and no more handlers exist
|
2993 |
+
// (avoids potential for endless recursion during removal of special event handlers)
|
2994 |
+
if ( eventType.length === 0 && origCount !== eventType.length ) {
|
2995 |
+
if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
|
2996 |
+
jQuery.removeEvent( elem, type, elemData.handle );
|
2997 |
+
}
|
2998 |
+
|
2999 |
+
delete events[ type ];
|
3000 |
+
}
|
3001 |
+
}
|
3002 |
+
|
3003 |
+
// Remove the expando if it's no longer used
|
3004 |
+
if ( jQuery.isEmptyObject( events ) ) {
|
3005 |
+
handle = elemData.handle;
|
3006 |
+
if ( handle ) {
|
3007 |
+
handle.elem = null;
|
3008 |
+
}
|
3009 |
+
|
3010 |
+
// removeData also checks for emptiness and clears the expando if empty
|
3011 |
+
// so use it instead of delete
|
3012 |
+
jQuery.removeData( elem, [ "events", "handle" ], true );
|
3013 |
+
}
|
3014 |
+
},
|
3015 |
+
|
3016 |
+
// Events that are safe to short-circuit if no handlers are attached.
|
3017 |
+
// Native DOM events should not be added, they may have inline handlers.
|
3018 |
+
customEvent: {
|
3019 |
+
"getData": true,
|
3020 |
+
"setData": true,
|
3021 |
+
"changeData": true
|
3022 |
+
},
|
3023 |
+
|
3024 |
+
trigger: function( event, data, elem, onlyHandlers ) {
|
3025 |
+
// Don't do events on text and comment nodes
|
3026 |
+
if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
|
3027 |
+
return;
|
3028 |
+
}
|
3029 |
+
|
3030 |
+
// Event object or event type
|
3031 |
+
var type = event.type || event,
|
3032 |
+
namespaces = [],
|
3033 |
+
cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType;
|
3034 |
+
|
3035 |
+
// focus/blur morphs to focusin/out; ensure we're not firing them right now
|
3036 |
+
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
|
3037 |
+
return;
|
3038 |
+
}
|
3039 |
+
|
3040 |
+
if ( type.indexOf( "!" ) >= 0 ) {
|
3041 |
+
// Exclusive events trigger only for the exact event (no namespaces)
|
3042 |
+
type = type.slice(0, -1);
|
3043 |
+
exclusive = true;
|
3044 |
+
}
|
3045 |
+
|
3046 |
+
if ( type.indexOf( "." ) >= 0 ) {
|
3047 |
+
// Namespaced trigger; create a regexp to match event type in handle()
|
3048 |
+
namespaces = type.split(".");
|
3049 |
+
type = namespaces.shift();
|
3050 |
+
namespaces.sort();
|
3051 |
+
}
|
3052 |
+
|
3053 |
+
if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
|
3054 |
+
// No jQuery handlers for this event type, and it can't have inline handlers
|
3055 |
+
return;
|
3056 |
+
}
|
3057 |
+
|
3058 |
+
// Caller can pass in an Event, Object, or just an event type string
|
3059 |
+
event = typeof event === "object" ?
|
3060 |
+
// jQuery.Event object
|
3061 |
+
event[ jQuery.expando ] ? event :
|
3062 |
+
// Object literal
|
3063 |
+
new jQuery.Event( type, event ) :
|
3064 |
+
// Just the event type (string)
|
3065 |
+
new jQuery.Event( type );
|
3066 |
+
|
3067 |
+
event.type = type;
|
3068 |
+
event.isTrigger = true;
|
3069 |
+
event.exclusive = exclusive;
|
3070 |
+
event.namespace = namespaces.join( "." );
|
3071 |
+
event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)") : null;
|
3072 |
+
ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
|
3073 |
+
|
3074 |
+
// Handle a global trigger
|
3075 |
+
if ( !elem ) {
|
3076 |
+
|
3077 |
+
// TODO: Stop taunting the data cache; remove global events and always attach to document
|
3078 |
+
cache = jQuery.cache;
|
3079 |
+
for ( i in cache ) {
|
3080 |
+
if ( cache[ i ].events && cache[ i ].events[ type ] ) {
|
3081 |
+
jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
|
3082 |
+
}
|
3083 |
+
}
|
3084 |
+
return;
|
3085 |
+
}
|
3086 |
+
|
3087 |
+
// Clean up the event in case it is being reused
|
3088 |
+
event.result = undefined;
|
3089 |
+
if ( !event.target ) {
|
3090 |
+
event.target = elem;
|
3091 |
+
}
|
3092 |
+
|
3093 |
+
// Clone any incoming data and prepend the event, creating the handler arg list
|
3094 |
+
data = data != null ? jQuery.makeArray( data ) : [];
|
3095 |
+
data.unshift( event );
|
3096 |
+
|
3097 |
+
// Allow special events to draw outside the lines
|
3098 |
+
special = jQuery.event.special[ type ] || {};
|
3099 |
+
if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
|
3100 |
+
return;
|
3101 |
+
}
|
3102 |
+
|
3103 |
+
// Determine event propagation path in advance, per W3C events spec (#9951)
|
3104 |
+
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
|
3105 |
+
eventPath = [[ elem, special.bindType || type ]];
|
3106 |
+
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
|
3107 |
+
|
3108 |
+
bubbleType = special.delegateType || type;
|
3109 |
+
cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
|
3110 |
+
old = null;
|
3111 |
+
for ( ; cur; cur = cur.parentNode ) {
|
3112 |
+
eventPath.push([ cur, bubbleType ]);
|
3113 |
+
old = cur;
|
3114 |
+
}
|
3115 |
+
|
3116 |
+
// Only add window if we got to document (e.g., not plain obj or detached DOM)
|
3117 |
+
if ( old && old === elem.ownerDocument ) {
|
3118 |
+
eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
|
3119 |
+
}
|
3120 |
+
}
|
3121 |
+
|
3122 |
+
// Fire handlers on the event path
|
3123 |
+
for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
|
3124 |
+
|
3125 |
+
cur = eventPath[i][0];
|
3126 |
+
event.type = eventPath[i][1];
|
3127 |
+
|
3128 |
+
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
|
3129 |
+
if ( handle ) {
|
3130 |
+
handle.apply( cur, data );
|
3131 |
+
}
|
3132 |
+
// Note that this is a bare JS function and not a jQuery handler
|
3133 |
+
handle = ontype && cur[ ontype ];
|
3134 |
+
if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
|
3135 |
+
event.preventDefault();
|
3136 |
+
}
|
3137 |
+
}
|
3138 |
+
event.type = type;
|
3139 |
+
|
3140 |
+
// If nobody prevented the default action, do it now
|
3141 |
+
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
|
3142 |
+
|
3143 |
+
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
|
3144 |
+
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
|
3145 |
+
|
3146 |
+
// Call a native DOM method on the target with the same name name as the event.
|
3147 |
+
// Can't use an .isFunction() check here because IE6/7 fails that test.
|
3148 |
+
// Don't do default actions on window, that's where global variables be (#6170)
|
3149 |
+
// IE<9 dies on focus/blur to hidden element (#1486)
|
3150 |
+
if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
|
3151 |
+
|
3152 |
+
// Don't re-trigger an onFOO event when we call its FOO() method
|
3153 |
+
old = elem[ ontype ];
|
3154 |
+
|
3155 |
+
if ( old ) {
|
3156 |
+
elem[ ontype ] = null;
|
3157 |
+
}
|
3158 |
+
|
3159 |
+
// Prevent re-triggering of the same event, since we already bubbled it above
|
3160 |
+
jQuery.event.triggered = type;
|
3161 |
+
elem[ type ]();
|
3162 |
+
jQuery.event.triggered = undefined;
|
3163 |
+
|
3164 |
+
if ( old ) {
|
3165 |
+
elem[ ontype ] = old;
|
3166 |
+
}
|
3167 |
+
}
|
3168 |
+
}
|
3169 |
+
}
|
3170 |
+
|
3171 |
+
return event.result;
|
3172 |
+
},
|
3173 |
+
|
3174 |
+
dispatch: function( event ) {
|
3175 |
+
|
3176 |
+
// Make a writable jQuery.Event from the native event object
|
3177 |
+
event = jQuery.event.fix( event || window.event );
|
3178 |
+
|
3179 |
+
var handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
|
3180 |
+
delegateCount = handlers.delegateCount,
|
3181 |
+
args = [].slice.call( arguments, 0 ),
|
3182 |
+
run_all = !event.exclusive && !event.namespace,
|
3183 |
+
handlerQueue = [],
|
3184 |
+
i, j, cur, jqcur, ret, selMatch, matched, matches, handleObj, sel, related;
|
3185 |
+
|
3186 |
+
// Use the fix-ed jQuery.Event rather than the (read-only) native event
|
3187 |
+
args[0] = event;
|
3188 |
+
event.delegateTarget = this;
|
3189 |
+
|
3190 |
+
// Determine handlers that should run if there are delegated events
|
3191 |
+
// Avoid disabled elements in IE (#6911) and non-left-click bubbling in Firefox (#3861)
|
3192 |
+
if ( delegateCount && !event.target.disabled && !(event.button && event.type === "click") ) {
|
3193 |
+
|
3194 |
+
// Pregenerate a single jQuery object for reuse with .is()
|
3195 |
+
jqcur = jQuery(this);
|
3196 |
+
jqcur.context = this.ownerDocument || this;
|
3197 |
+
|
3198 |
+
for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
|
3199 |
+
selMatch = {};
|
3200 |
+
matches = [];
|
3201 |
+
jqcur[0] = cur;
|
3202 |
+
for ( i = 0; i < delegateCount; i++ ) {
|
3203 |
+
handleObj = handlers[ i ];
|
3204 |
+
sel = handleObj.selector;
|
3205 |
+
|
3206 |
+
if ( selMatch[ sel ] === undefined ) {
|
3207 |
+
selMatch[ sel ] = (
|
3208 |
+
handleObj.quick ? quickIs( cur, handleObj.quick ) : jqcur.is( sel )
|
3209 |
+
);
|
3210 |
+
}
|
3211 |
+
if ( selMatch[ sel ] ) {
|
3212 |
+
matches.push( handleObj );
|
3213 |
+
}
|
3214 |
+
}
|
3215 |
+
if ( matches.length ) {
|
3216 |
+
handlerQueue.push({ elem: cur, matches: matches });
|
3217 |
+
}
|
3218 |
+
}
|
3219 |
+
}
|
3220 |
+
|
3221 |
+
// Add the remaining (directly-bound) handlers
|
3222 |
+
if ( handlers.length > delegateCount ) {
|
3223 |
+
handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
|
3224 |
+
}
|
3225 |
+
|
3226 |
+
// Run delegates first; they may want to stop propagation beneath us
|
3227 |
+
for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
|
3228 |
+
matched = handlerQueue[ i ];
|
3229 |
+
event.currentTarget = matched.elem;
|
3230 |
+
|
3231 |
+
for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
|
3232 |
+
handleObj = matched.matches[ j ];
|
3233 |
+
|
3234 |
+
// Triggered event must either 1) be non-exclusive and have no namespace, or
|
3235 |
+
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
|
3236 |
+
if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
|
3237 |
+
|
3238 |
+
event.data = handleObj.data;
|
3239 |
+
event.handleObj = handleObj;
|
3240 |
+
|
3241 |
+
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
|
3242 |
+
.apply( matched.elem, args );
|
3243 |
+
|
3244 |
+
if ( ret !== undefined ) {
|
3245 |
+
event.result = ret;
|
3246 |
+
if ( ret === false ) {
|
3247 |
+
event.preventDefault();
|
3248 |
+
event.stopPropagation();
|
3249 |
+
}
|
3250 |
+
}
|
3251 |
+
}
|
3252 |
+
}
|
3253 |
+
}
|
3254 |
+
|
3255 |
+
return event.result;
|
3256 |
+
},
|
3257 |
+
|
3258 |
+
// Includes some event props shared by KeyEvent and MouseEvent
|
3259 |
+
// *** attrChange attrName relatedNode srcElement are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
|
3260 |
+
props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
|
3261 |
+
|
3262 |
+
fixHooks: {},
|
3263 |
+
|
3264 |
+
keyHooks: {
|
3265 |
+
props: "char charCode key keyCode".split(" "),
|
3266 |
+
filter: function( event, original ) {
|
3267 |
+
|
3268 |
+
// Add which for key events
|
3269 |
+
if ( event.which == null ) {
|
3270 |
+
event.which = original.charCode != null ? original.charCode : original.keyCode;
|
3271 |
+
}
|
3272 |
+
|
3273 |
+
return event;
|
3274 |
+
}
|
3275 |
+
},
|
3276 |
+
|
3277 |
+
mouseHooks: {
|
3278 |
+
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
|
3279 |
+
filter: function( event, original ) {
|
3280 |
+
var eventDoc, doc, body,
|
3281 |
+
button = original.button,
|
3282 |
+
fromElement = original.fromElement;
|
3283 |
+
|
3284 |
+
// Calculate pageX/Y if missing and clientX/Y available
|
3285 |
+
if ( event.pageX == null && original.clientX != null ) {
|
3286 |
+
eventDoc = event.target.ownerDocument || document;
|
3287 |
+
doc = eventDoc.documentElement;
|
3288 |
+
body = eventDoc.body;
|
3289 |
+
|
3290 |
+
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
|
3291 |
+
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
|
3292 |
+
}
|
3293 |
+
|
3294 |
+
// Add relatedTarget, if necessary
|
3295 |
+
if ( !event.relatedTarget && fromElement ) {
|
3296 |
+
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
|
3297 |
+
}
|
3298 |
+
|
3299 |
+
// Add which for click: 1 === left; 2 === middle; 3 === right
|
3300 |
+
// Note: button is not normalized, so don't use it
|
3301 |
+
if ( !event.which && button !== undefined ) {
|
3302 |
+
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
|
3303 |
+
}
|
3304 |
+
|
3305 |
+
return event;
|
3306 |
+
}
|
3307 |
+
},
|
3308 |
+
|
3309 |
+
fix: function( event ) {
|
3310 |
+
if ( event[ jQuery.expando ] ) {
|
3311 |
+
return event;
|
3312 |
+
}
|
3313 |
+
|
3314 |
+
// Create a writable copy of the event object and normalize some properties
|
3315 |
+
var i, prop,
|
3316 |
+
originalEvent = event,
|
3317 |
+
fixHook = jQuery.event.fixHooks[ event.type ] || {},
|
3318 |
+
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
|
3319 |
+
|
3320 |
+
event = jQuery.Event( originalEvent );
|
3321 |
+
|
3322 |
+
for ( i = copy.length; i; ) {
|
3323 |
+
prop = copy[ --i ];
|
3324 |
+
event[ prop ] = originalEvent[ prop ];
|
3325 |
+
}
|
3326 |
+
|
3327 |
+
// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
|
3328 |
+
if ( !event.target ) {
|
3329 |
+
event.target = originalEvent.srcElement || document;
|
3330 |
+
}
|
3331 |
+
|
3332 |
+
// Target should not be a text node (#504, Safari)
|
3333 |
+
if ( event.target.nodeType === 3 ) {
|
3334 |
+
event.target = event.target.parentNode;
|
3335 |
+
}
|
3336 |
+
|
3337 |
+
// For mouse/key events; add metaKey if it's not there (#3368, IE6/7/8)
|
3338 |
+
if ( event.metaKey === undefined ) {
|
3339 |
+
event.metaKey = event.ctrlKey;
|
3340 |
+
}
|
3341 |
+
|
3342 |
+
return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
|
3343 |
+
},
|
3344 |
+
|
3345 |
+
special: {
|
3346 |
+
ready: {
|
3347 |
+
// Make sure the ready event is setup
|
3348 |
+
setup: jQuery.bindReady
|
3349 |
+
},
|
3350 |
+
|
3351 |
+
load: {
|
3352 |
+
// Prevent triggered image.load events from bubbling to window.load
|
3353 |
+
noBubble: true
|
3354 |
+
},
|
3355 |
+
|
3356 |
+
focus: {
|
3357 |
+
delegateType: "focusin"
|
3358 |
+
},
|
3359 |
+
blur: {
|
3360 |
+
delegateType: "focusout"
|
3361 |
+
},
|
3362 |
+
|
3363 |
+
beforeunload: {
|
3364 |
+
setup: function( data, namespaces, eventHandle ) {
|
3365 |
+
// We only want to do this special case on windows
|
3366 |
+
if ( jQuery.isWindow( this ) ) {
|
3367 |
+
this.onbeforeunload = eventHandle;
|
3368 |
+
}
|
3369 |
+
},
|
3370 |
+
|
3371 |
+
teardown: function( namespaces, eventHandle ) {
|
3372 |
+
if ( this.onbeforeunload === eventHandle ) {
|
3373 |
+
this.onbeforeunload = null;
|
3374 |
+
}
|
3375 |
+
}
|
3376 |
+
}
|
3377 |
+
},
|
3378 |
+
|
3379 |
+
simulate: function( type, elem, event, bubble ) {
|
3380 |
+
// Piggyback on a donor event to simulate a different one.
|
3381 |
+
// Fake originalEvent to avoid donor's stopPropagation, but if the
|
3382 |
+
// simulated event prevents default then we do the same on the donor.
|
3383 |
+
var e = jQuery.extend(
|
3384 |
+
new jQuery.Event(),
|
3385 |
+
event,
|
3386 |
+
{ type: type,
|
3387 |
+
isSimulated: true,
|
3388 |
+
originalEvent: {}
|
3389 |
+
}
|
3390 |
+
);
|
3391 |
+
if ( bubble ) {
|
3392 |
+
jQuery.event.trigger( e, null, elem );
|
3393 |
+
} else {
|
3394 |
+
jQuery.event.dispatch.call( elem, e );
|
3395 |
+
}
|
3396 |
+
if ( e.isDefaultPrevented() ) {
|
3397 |
+
event.preventDefault();
|
3398 |
+
}
|
3399 |
+
}
|
3400 |
+
};
|
3401 |
+
|
3402 |
+
// Some plugins are using, but it's undocumented/deprecated and will be removed.
|
3403 |
+
// The 1.7 special event interface should provide all the hooks needed now.
|
3404 |
+
jQuery.event.handle = jQuery.event.dispatch;
|
3405 |
+
|
3406 |
+
jQuery.removeEvent = document.removeEventListener ?
|
3407 |
+
function( elem, type, handle ) {
|
3408 |
+
if ( elem.removeEventListener ) {
|
3409 |
+
elem.removeEventListener( type, handle, false );
|
3410 |
+
}
|
3411 |
+
} :
|
3412 |
+
function( elem, type, handle ) {
|
3413 |
+
if ( elem.detachEvent ) {
|
3414 |
+
elem.detachEvent( "on" + type, handle );
|
3415 |
+
}
|
3416 |
+
};
|
3417 |
+
|
3418 |
+
jQuery.Event = function( src, props ) {
|
3419 |
+
// Allow instantiation without the 'new' keyword
|
3420 |
+
if ( !(this instanceof jQuery.Event) ) {
|
3421 |
+
return new jQuery.Event( src, props );
|
3422 |
+
}
|
3423 |
+
|
3424 |
+
// Event object
|
3425 |
+
if ( src && src.type ) {
|
3426 |
+
this.originalEvent = src;
|
3427 |
+
this.type = src.type;
|
3428 |
+
|
3429 |
+
// Events bubbling up the document may have been marked as prevented
|
3430 |
+
// by a handler lower down the tree; reflect the correct value.
|
3431 |
+
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
|
3432 |
+
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
|
3433 |
+
|
3434 |
+
// Event type
|
3435 |
+
} else {
|
3436 |
+
this.type = src;
|
3437 |
+
}
|
3438 |
+
|
3439 |
+
// Put explicitly provided properties onto the event object
|
3440 |
+
if ( props ) {
|
3441 |
+
jQuery.extend( this, props );
|
3442 |
+
}
|
3443 |
+
|
3444 |
+
// Create a timestamp if incoming event doesn't have one
|
3445 |
+
this.timeStamp = src && src.timeStamp || jQuery.now();
|
3446 |
+
|
3447 |
+
// Mark it as fixed
|
3448 |
+
this[ jQuery.expando ] = true;
|
3449 |
+
};
|
3450 |
+
|
3451 |
+
function returnFalse() {
|
3452 |
+
return false;
|
3453 |
+
}
|
3454 |
+
function returnTrue() {
|
3455 |
+
return true;
|
3456 |
+
}
|
3457 |
+
|
3458 |
+
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
|
3459 |
+
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
|
3460 |
+
jQuery.Event.prototype = {
|
3461 |
+
preventDefault: function() {
|
3462 |
+
this.isDefaultPrevented = returnTrue;
|
3463 |
+
|
3464 |
+
var e = this.originalEvent;
|
3465 |
+
if ( !e ) {
|
3466 |
+
return;
|
3467 |
+
}
|
3468 |
+
|
3469 |
+
// if preventDefault exists run it on the original event
|
3470 |
+
if ( e.preventDefault ) {
|
3471 |
+
e.preventDefault();
|
3472 |
+
|
3473 |
+
// otherwise set the returnValue property of the original event to false (IE)
|
3474 |
+
} else {
|
3475 |
+
e.returnValue = false;
|
3476 |
+
}
|
3477 |
+
},
|
3478 |
+
stopPropagation: function() {
|
3479 |
+
this.isPropagationStopped = returnTrue;
|
3480 |
+
|
3481 |
+
var e = this.originalEvent;
|
3482 |
+
if ( !e ) {
|
3483 |
+
return;
|
3484 |
+
}
|
3485 |
+
// if stopPropagation exists run it on the original event
|
3486 |
+
if ( e.stopPropagation ) {
|
3487 |
+
e.stopPropagation();
|
3488 |
+
}
|
3489 |
+
// otherwise set the cancelBubble property of the original event to true (IE)
|
3490 |
+
e.cancelBubble = true;
|
3491 |
+
},
|
3492 |
+
stopImmediatePropagation: function() {
|
3493 |
+
this.isImmediatePropagationStopped = returnTrue;
|
3494 |
+
this.stopPropagation();
|
3495 |
+
},
|
3496 |
+
isDefaultPrevented: returnFalse,
|
3497 |
+
isPropagationStopped: returnFalse,
|
3498 |
+
isImmediatePropagationStopped: returnFalse
|
3499 |
+
};
|
3500 |
+
|
3501 |
+
// Create mouseenter/leave events using mouseover/out and event-time checks
|
3502 |
+
jQuery.each({
|
3503 |
+
mouseenter: "mouseover",
|
3504 |
+
mouseleave: "mouseout"
|
3505 |
+
}, function( orig, fix ) {
|
3506 |
+
jQuery.event.special[ orig ] = {
|
3507 |
+
delegateType: fix,
|
3508 |
+
bindType: fix,
|
3509 |
+
|
3510 |
+
handle: function( event ) {
|
3511 |
+
var target = this,
|
3512 |
+
related = event.relatedTarget,
|
3513 |
+
handleObj = event.handleObj,
|
3514 |
+
selector = handleObj.selector,
|
3515 |
+
ret;
|
3516 |
+
|
3517 |
+
// For mousenter/leave call the handler if related is outside the target.
|
3518 |
+
// NB: No relatedTarget if the mouse left/entered the browser window
|
3519 |
+
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
|
3520 |
+
event.type = handleObj.origType;
|
3521 |
+
ret = handleObj.handler.apply( this, arguments );
|
3522 |
+
event.type = fix;
|
3523 |
+
}
|
3524 |
+
return ret;
|
3525 |
+
}
|
3526 |
+
};
|
3527 |
+
});
|
3528 |
+
|
3529 |
+
// IE submit delegation
|
3530 |
+
if ( !jQuery.support.submitBubbles ) {
|
3531 |
+
|
3532 |
+
jQuery.event.special.submit = {
|
3533 |
+
setup: function() {
|
3534 |
+
// Only need this for delegated form submit events
|
3535 |
+
if ( jQuery.nodeName( this, "form" ) ) {
|
3536 |
+
return false;
|
3537 |
+
}
|
3538 |
+
|
3539 |
+
// Lazy-add a submit handler when a descendant form may potentially be submitted
|
3540 |
+
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
|
3541 |
+
// Node name check avoids a VML-related crash in IE (#9807)
|
3542 |
+
var elem = e.target,
|
3543 |
+
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
|
3544 |
+
if ( form && !form._submit_attached ) {
|
3545 |
+
jQuery.event.add( form, "submit._submit", function( event ) {
|
3546 |
+
// If form was submitted by the user, bubble the event up the tree
|
3547 |
+
if ( this.parentNode && !event.isTrigger ) {
|
3548 |
+
jQuery.event.simulate( "submit", this.parentNode, event, true );
|
3549 |
+
}
|
3550 |
+
});
|
3551 |
+
form._submit_attached = true;
|
3552 |
+
}
|
3553 |
+
});
|
3554 |
+
// return undefined since we don't need an event listener
|
3555 |
+
},
|
3556 |
+
|
3557 |
+
teardown: function() {
|
3558 |
+
// Only need this for delegated form submit events
|
3559 |
+
if ( jQuery.nodeName( this, "form" ) ) {
|
3560 |
+
return false;
|
3561 |
+
}
|
3562 |
+
|
3563 |
+
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
|
3564 |
+
jQuery.event.remove( this, "._submit" );
|
3565 |
+
}
|
3566 |
+
};
|
3567 |
+
}
|
3568 |
+
|
3569 |
+
// IE change delegation and checkbox/radio fix
|
3570 |
+
if ( !jQuery.support.changeBubbles ) {
|
3571 |
+
|
3572 |
+
jQuery.event.special.change = {
|
3573 |
+
|
3574 |
+
setup: function() {
|
3575 |
+
|
3576 |
+
if ( rformElems.test( this.nodeName ) ) {
|
3577 |
+
// IE doesn't fire change on a check/radio until blur; trigger it on click
|
3578 |
+
// after a propertychange. Eat the blur-change in special.change.handle.
|
3579 |
+
// This still fires onchange a second time for check/radio after blur.
|
3580 |
+
if ( this.type === "checkbox" || this.type === "radio" ) {
|
3581 |
+
jQuery.event.add( this, "propertychange._change", function( event ) {
|
3582 |
+
if ( event.originalEvent.propertyName === "checked" ) {
|
3583 |
+
this._just_changed = true;
|
3584 |
+
}
|
3585 |
+
});
|
3586 |
+
jQuery.event.add( this, "click._change", function( event ) {
|
3587 |
+
if ( this._just_changed && !event.isTrigger ) {
|
3588 |
+
this._just_changed = false;
|
3589 |
+
jQuery.event.simulate( "change", this, event, true );
|
3590 |
+
}
|
3591 |
+
});
|
3592 |
+
}
|
3593 |
+
return false;
|
3594 |
+
}
|
3595 |
+
// Delegated event; lazy-add a change handler on descendant inputs
|
3596 |
+
jQuery.event.add( this, "beforeactivate._change", function( e ) {
|
3597 |
+
var elem = e.target;
|
3598 |
+
|
3599 |
+
if ( rformElems.test( elem.nodeName ) && !elem._change_attached ) {
|
3600 |
+
jQuery.event.add( elem, "change._change", function( event ) {
|
3601 |
+
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
|
3602 |
+
jQuery.event.simulate( "change", this.parentNode, event, true );
|
3603 |
+
}
|
3604 |
+
});
|
3605 |
+
elem._change_attached = true;
|
3606 |
+
}
|
3607 |
+
});
|
3608 |
+
},
|
3609 |
+
|
3610 |
+
handle: function( event ) {
|
3611 |
+
var elem = event.target;
|
3612 |
+
|
3613 |
+
// Swallow native change events from checkbox/radio, we already triggered them above
|
3614 |
+
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
|
3615 |
+
return event.handleObj.handler.apply( this, arguments );
|
3616 |
+
}
|
3617 |
+
},
|
3618 |
+
|
3619 |
+
teardown: function() {
|
3620 |
+
jQuery.event.remove( this, "._change" );
|
3621 |
+
|
3622 |
+
return rformElems.test( this.nodeName );
|
3623 |
+
}
|
3624 |
+
};
|
3625 |
+
}
|
3626 |
+
|
3627 |
+
// Create "bubbling" focus and blur events
|
3628 |
+
if ( !jQuery.support.focusinBubbles ) {
|
3629 |
+
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
3630 |
+
|
3631 |
+
// Attach a single capturing handler while someone wants focusin/focusout
|
3632 |
+
var attaches = 0,
|
3633 |
+
handler = function( event ) {
|
3634 |
+
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
|
3635 |
+
};
|
3636 |
+
|
3637 |
+
jQuery.event.special[ fix ] = {
|
3638 |
+
setup: function() {
|
3639 |
+
if ( attaches++ === 0 ) {
|
3640 |
+
document.addEventListener( orig, handler, true );
|
3641 |
+
}
|
3642 |
+
},
|
3643 |
+
teardown: function() {
|
3644 |
+
if ( --attaches === 0 ) {
|
3645 |
+
document.removeEventListener( orig, handler, true );
|
3646 |
+
}
|
3647 |
+
}
|
3648 |
+
};
|
3649 |
+
});
|
3650 |
+
}
|
3651 |
+
|
3652 |
+
jQuery.fn.extend({
|
3653 |
+
|
3654 |
+
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
|
3655 |
+
var origFn, type;
|
3656 |
+
|
3657 |
+
// Types can be a map of types/handlers
|
3658 |
+
if ( typeof types === "object" ) {
|
3659 |
+
// ( types-Object, selector, data )
|
3660 |
+
if ( typeof selector !== "string" ) {
|
3661 |
+
// ( types-Object, data )
|
3662 |
+
data = selector;
|
3663 |
+
selector = undefined;
|
3664 |
+
}
|
3665 |
+
for ( type in types ) {
|
3666 |
+
this.on( type, selector, data, types[ type ], one );
|
3667 |
+
}
|
3668 |
+
return this;
|
3669 |
+
}
|
3670 |
+
|
3671 |
+
if ( data == null && fn == null ) {
|
3672 |
+
// ( types, fn )
|
3673 |
+
fn = selector;
|
3674 |
+
data = selector = undefined;
|
3675 |
+
} else if ( fn == null ) {
|
3676 |
+
if ( typeof selector === "string" ) {
|
3677 |
+
// ( types, selector, fn )
|
3678 |
+
fn = data;
|
3679 |
+
data = undefined;
|
3680 |
+
} else {
|
3681 |
+
// ( types, data, fn )
|
3682 |
+
fn = data;
|
3683 |
+
data = selector;
|
3684 |
+
selector = undefined;
|
3685 |
+
}
|
3686 |
+
}
|
3687 |
+
if ( fn === false ) {
|
3688 |
+
fn = returnFalse;
|
3689 |
+
} else if ( !fn ) {
|
3690 |
+
return this;
|
3691 |
+
}
|
3692 |
+
|
3693 |
+
if ( one === 1 ) {
|
3694 |
+
origFn = fn;
|
3695 |
+
fn = function( event ) {
|
3696 |
+
// Can use an empty set, since event contains the info
|
3697 |
+
jQuery().off( event );
|
3698 |
+
return origFn.apply( this, arguments );
|
3699 |
+
};
|
3700 |
+
// Use same guid so caller can remove using origFn
|
3701 |
+
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
|
3702 |
+
}
|
3703 |
+
return this.each( function() {
|
3704 |
+
jQuery.event.add( this, types, fn, data, selector );
|
3705 |
+
});
|
3706 |
+
},
|
3707 |
+
one: function( types, selector, data, fn ) {
|
3708 |
+
return this.on.call( this, types, selector, data, fn, 1 );
|
3709 |
+
},
|
3710 |
+
off: function( types, selector, fn ) {
|
3711 |
+
if ( types && types.preventDefault && types.handleObj ) {
|
3712 |
+
// ( event ) dispatched jQuery.Event
|
3713 |
+
var handleObj = types.handleObj;
|
3714 |
+
jQuery( types.delegateTarget ).off(
|
3715 |
+
handleObj.namespace? handleObj.type + "." + handleObj.namespace : handleObj.type,
|
3716 |
+
handleObj.selector,
|
3717 |
+
handleObj.handler
|
3718 |
+
);
|
3719 |
+
return this;
|
3720 |
+
}
|
3721 |
+
if ( typeof types === "object" ) {
|
3722 |
+
// ( types-object [, selector] )
|
3723 |
+
for ( var type in types ) {
|
3724 |
+
this.off( type, selector, types[ type ] );
|
3725 |
+
}
|
3726 |
+
return this;
|
3727 |
+
}
|
3728 |
+
if ( selector === false || typeof selector === "function" ) {
|
3729 |
+
// ( types [, fn] )
|
3730 |
+
fn = selector;
|
3731 |
+
selector = undefined;
|
3732 |
+
}
|
3733 |
+
if ( fn === false ) {
|
3734 |
+
fn = returnFalse;
|
3735 |
+
}
|
3736 |
+
return this.each(function() {
|
3737 |
+
jQuery.event.remove( this, types, fn, selector );
|
3738 |
+
});
|
3739 |
+
},
|
3740 |
+
|
3741 |
+
bind: function( types, data, fn ) {
|
3742 |
+
return this.on( types, null, data, fn );
|
3743 |
+
},
|
3744 |
+
unbind: function( types, fn ) {
|
3745 |
+
return this.off( types, null, fn );
|
3746 |
+
},
|
3747 |
+
|
3748 |
+
live: function( types, data, fn ) {
|
3749 |
+
jQuery( this.context ).on( types, this.selector, data, fn );
|
3750 |
+
return this;
|
3751 |
+
},
|
3752 |
+
die: function( types, fn ) {
|
3753 |
+
jQuery( this.context ).off( types, this.selector || "**", fn );
|
3754 |
+
return this;
|
3755 |
+
},
|
3756 |
+
|
3757 |
+
delegate: function( selector, types, data, fn ) {
|
3758 |
+
return this.on( types, selector, data, fn );
|
3759 |
+
},
|
3760 |
+
undelegate: function( selector, types, fn ) {
|
3761 |
+
// ( namespace ) or ( selector, types [, fn] )
|
3762 |
+
return arguments.length == 1? this.off( selector, "**" ) : this.off( types, selector, fn );
|
3763 |
+
},
|
3764 |
+
|
3765 |
+
trigger: function( type, data ) {
|
3766 |
+
return this.each(function() {
|
3767 |
+
jQuery.event.trigger( type, data, this );
|
3768 |
+
});
|
3769 |
+
},
|
3770 |
+
triggerHandler: function( type, data ) {
|
3771 |
+
if ( this[0] ) {
|
3772 |
+
return jQuery.event.trigger( type, data, this[0], true );
|
3773 |
+
}
|
3774 |
+
},
|
3775 |
+
|
3776 |
+
toggle: function( fn ) {
|
3777 |
+
// Save reference to arguments for access in closure
|
3778 |
+
var args = arguments,
|
3779 |
+
guid = fn.guid || jQuery.guid++,
|
3780 |
+
i = 0,
|
3781 |
+
toggler = function( event ) {
|
3782 |
+
// Figure out which function to execute
|
3783 |
+
var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
|
3784 |
+
jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
|
3785 |
+
|
3786 |
+
// Make sure that clicks stop
|
3787 |
+
event.preventDefault();
|
3788 |
+
|
3789 |
+
// and execute the function
|
3790 |
+
return args[ lastToggle ].apply( this, arguments ) || false;
|
3791 |
+
};
|
3792 |
+
|
3793 |
+
// link all the functions, so any of them can unbind this click handler
|
3794 |
+
toggler.guid = guid;
|
3795 |
+
while ( i < args.length ) {
|
3796 |
+
args[ i++ ].guid = guid;
|
3797 |
+
}
|
3798 |
+
|
3799 |
+
return this.click( toggler );
|
3800 |
+
},
|
3801 |
+
|
3802 |
+
hover: function( fnOver, fnOut ) {
|
3803 |
+
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
3804 |
+
}
|
3805 |
+
});
|
3806 |
+
|
3807 |
+
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
|
3808 |
+
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
3809 |
+
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
|
3810 |
+
|
3811 |
+
// Handle event binding
|
3812 |
+
jQuery.fn[ name ] = function( data, fn ) {
|
3813 |
+
if ( fn == null ) {
|
3814 |
+
fn = data;
|
3815 |
+
data = null;
|
3816 |
+
}
|
3817 |
+
|
3818 |
+
return arguments.length > 0 ?
|
3819 |
+
this.on( name, null, data, fn ) :
|
3820 |
+
this.trigger( name );
|
3821 |
+
};
|
3822 |
+
|
3823 |
+
if ( jQuery.attrFn ) {
|
3824 |
+
jQuery.attrFn[ name ] = true;
|
3825 |
+
}
|
3826 |
+
|
3827 |
+
if ( rkeyEvent.test( name ) ) {
|
3828 |
+
jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
|
3829 |
+
}
|
3830 |
+
|
3831 |
+
if ( rmouseEvent.test( name ) ) {
|
3832 |
+
jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
|
3833 |
+
}
|
3834 |
+
});
|
3835 |
+
|
3836 |
+
|
3837 |
+
|
3838 |
+
/*!
|
3839 |
+
* Sizzle CSS Selector Engine
|
3840 |
+
* Copyright 2012, The Dojo Foundation
|
3841 |
+
* Released under the MIT, BSD, and GPL Licenses.
|
3842 |
+
* More information: http://sizzlejs.com/
|
3843 |
+
*/
|
3844 |
+
(function(){
|
3845 |
+
|
3846 |
+
var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
|
3847 |
+
expando = "sizcache" + (Math.random() + '').replace('.', ''),
|
3848 |
+
done = 0,
|
3849 |
+
toString = Object.prototype.toString,
|
3850 |
+
hasDuplicate = false,
|
3851 |
+
baseHasDuplicate = true,
|
3852 |
+
rBackslash = /\\/g,
|
3853 |
+
rReturn = /\r\n/g,
|
3854 |
+
rNonWord = /\W/;
|
3855 |
+
|
3856 |
+
// Here we check if the JavaScript engine is using some sort of
|
3857 |
+
// optimization where it does not always call our comparision
|
3858 |
+
// function. If that is the case, discard the hasDuplicate value.
|
3859 |
+
// Thus far that includes Google Chrome.
|
3860 |
+
[0, 0].sort(function() {
|
3861 |
+
baseHasDuplicate = false;
|
3862 |
+
return 0;
|
3863 |
+
});
|
3864 |
+
|
3865 |
+
var Sizzle = function( selector, context, results, seed ) {
|
3866 |
+
results = results || [];
|
3867 |
+
context = context || document;
|
3868 |
+
|
3869 |
+
var origContext = context;
|
3870 |
+
|
3871 |
+
if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
|
3872 |
+
return [];
|
3873 |
+
}
|
3874 |
+
|
3875 |
+
if ( !selector || typeof selector !== "string" ) {
|
3876 |
+
return results;
|
3877 |
+
}
|
3878 |
+
|
3879 |
+
var m, set, checkSet, extra, ret, cur, pop, i,
|
3880 |
+
prune = true,
|
3881 |
+
contextXML = Sizzle.isXML( context ),
|
3882 |
+
parts = [],
|
3883 |
+
soFar = selector;
|
3884 |
+
|
3885 |
+
// Reset the position of the chunker regexp (start from head)
|
3886 |
+
do {
|
3887 |
+
chunker.exec( "" );
|
3888 |
+
m = chunker.exec( soFar );
|
3889 |
+
|
3890 |
+
if ( m ) {
|
3891 |
+
soFar = m[3];
|
3892 |
+
|
3893 |
+
parts.push( m[1] );
|
3894 |
+
|
3895 |
+
if ( m[2] ) {
|
3896 |
+
extra = m[3];
|
3897 |
+
break;
|
3898 |
+
}
|
3899 |
+
}
|
3900 |
+
} while ( m );
|
3901 |
+
|
3902 |
+
if ( parts.length > 1 && origPOS.exec( selector ) ) {
|
3903 |
+
|
3904 |
+
if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
|
3905 |
+
set = posProcess( parts[0] + parts[1], context, seed );
|
3906 |
+
|
3907 |
+
} else {
|
3908 |
+
set = Expr.relative[ parts[0] ] ?
|
3909 |
+
[ context ] :
|
3910 |
+
Sizzle( parts.shift(), context );
|
3911 |
+
|
3912 |
+
while ( parts.length ) {
|
3913 |
+
selector = parts.shift();
|
3914 |
+
|
3915 |
+
if ( Expr.relative[ selector ] ) {
|
3916 |
+
selector += parts.shift();
|
3917 |
+
}
|
3918 |
+
|
3919 |
+
set = posProcess( selector, set, seed );
|
3920 |
+
}
|
3921 |
+
}
|
3922 |
+
|
3923 |
+
} else {
|
3924 |
+
// Take a shortcut and set the context if the root selector is an ID
|
3925 |
+
// (but not if it'll be faster if the inner selector is an ID)
|
3926 |
+
if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
|
3927 |
+
Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
|
3928 |
+
|
3929 |
+
ret = Sizzle.find( parts.shift(), context, contextXML );
|
3930 |
+
context = ret.expr ?
|
3931 |
+
Sizzle.filter( ret.expr, ret.set )[0] :
|
3932 |
+
ret.set[0];
|
3933 |
+
}
|
3934 |
+
|
3935 |
+
if ( context ) {
|
3936 |
+
ret = seed ?
|
3937 |
+
{ expr: parts.pop(), set: makeArray(seed) } :
|
3938 |
+
Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
|
3939 |
+
|
3940 |
+
set = ret.expr ?
|
3941 |
+
Sizzle.filter( ret.expr, ret.set ) :
|
3942 |
+
ret.set;
|
3943 |
+
|
3944 |
+
if ( parts.length > 0 ) {
|
3945 |
+
checkSet = makeArray( set );
|
3946 |
+
|
3947 |
+
} else {
|
3948 |
+
prune = false;
|
3949 |
+
}
|
3950 |
+
|
3951 |
+
while ( parts.length ) {
|
3952 |
+
cur = parts.pop();
|
3953 |
+
pop = cur;
|
3954 |
+
|
3955 |
+
if ( !Expr.relative[ cur ] ) {
|
3956 |
+
cur = "";
|
3957 |
+
} else {
|
3958 |
+
pop = parts.pop();
|
3959 |
+
}
|
3960 |
+
|
3961 |
+
if ( pop == null ) {
|
3962 |
+
pop = context;
|
3963 |
+
}
|
3964 |
+
|
3965 |
+
Expr.relative[ cur ]( checkSet, pop, contextXML );
|
3966 |
+
}
|
3967 |
+
|
3968 |
+
} else {
|
3969 |
+
checkSet = parts = [];
|
3970 |
+
}
|
3971 |
+
}
|
3972 |
+
|
3973 |
+
if ( !checkSet ) {
|
3974 |
+
checkSet = set;
|
3975 |
+
}
|
3976 |
+
|
3977 |
+
if ( !checkSet ) {
|
3978 |
+
Sizzle.error( cur || selector );
|
3979 |
+
}
|
3980 |
+
|
3981 |
+
if ( toString.call(checkSet) === "[object Array]" ) {
|
3982 |
+
if ( !prune ) {
|
3983 |
+
results.push.apply( results, checkSet );
|
3984 |
+
|
3985 |
+
} else if ( context && context.nodeType === 1 ) {
|
3986 |
+
for ( i = 0; checkSet[i] != null; i++ ) {
|
3987 |
+
if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
|
3988 |
+
results.push( set[i] );
|
3989 |
+
}
|
3990 |
+
}
|
3991 |
+
|
3992 |
+
} else {
|
3993 |
+
for ( i = 0; checkSet[i] != null; i++ ) {
|
3994 |
+
if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
|
3995 |
+
results.push( set[i] );
|
3996 |
+
}
|
3997 |
+
}
|
3998 |
+
}
|
3999 |
+
|
4000 |
+
} else {
|
4001 |
+
makeArray( checkSet, results );
|
4002 |
+
}
|
4003 |
+
|
4004 |
+
if ( extra ) {
|
4005 |
+
Sizzle( extra, origContext, results, seed );
|
4006 |
+
Sizzle.uniqueSort( results );
|
4007 |
+
}
|
4008 |
+
|
4009 |
+
return results;
|
4010 |
+
};
|
4011 |
+
|
4012 |
+
Sizzle.uniqueSort = function( results ) {
|
4013 |
+
if ( sortOrder ) {
|
4014 |
+
hasDuplicate = baseHasDuplicate;
|
4015 |
+
results.sort( sortOrder );
|
4016 |
+
|
4017 |
+
if ( hasDuplicate ) {
|
4018 |
+
for ( var i = 1; i < results.length; i++ ) {
|
4019 |
+
if ( results[i] === results[ i - 1 ] ) {
|
4020 |
+
results.splice( i--, 1 );
|
4021 |
+
}
|
4022 |
+
}
|
4023 |
+
}
|
4024 |
+
}
|
4025 |
+
|
4026 |
+
return results;
|
4027 |
+
};
|
4028 |
+
|
4029 |
+
Sizzle.matches = function( expr, set ) {
|
4030 |
+
return Sizzle( expr, null, null, set );
|
4031 |
+
};
|
4032 |
+
|
4033 |
+
Sizzle.matchesSelector = function( node, expr ) {
|
4034 |
+
return Sizzle( expr, null, null, [node] ).length > 0;
|
4035 |
+
};
|
4036 |
+
|
4037 |
+
Sizzle.find = function( expr, context, isXML ) {
|
4038 |
+
var set, i, len, match, type, left;
|
4039 |
+
|
4040 |
+
if ( !expr ) {
|
4041 |
+
return [];
|
4042 |
+
}
|
4043 |
+
|
4044 |
+
for ( i = 0, len = Expr.order.length; i < len; i++ ) {
|
4045 |
+
type = Expr.order[i];
|
4046 |
+
|
4047 |
+
if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
|
4048 |
+
left = match[1];
|
4049 |
+
match.splice( 1, 1 );
|
4050 |
+
|
4051 |
+
if ( left.substr( left.length - 1 ) !== "\\" ) {
|
4052 |
+
match[1] = (match[1] || "").replace( rBackslash, "" );
|
4053 |
+
set = Expr.find[ type ]( match, context, isXML );
|
4054 |
+
|
4055 |
+
if ( set != null ) {
|
4056 |
+
expr = expr.replace( Expr.match[ type ], "" );
|
4057 |
+
break;
|
4058 |
+
}
|
4059 |
+
}
|
4060 |
+
}
|
4061 |
+
}
|
4062 |
+
|
4063 |
+
if ( !set ) {
|
4064 |
+
set = typeof context.getElementsByTagName !== "undefined" ?
|
4065 |
+
context.getElementsByTagName( "*" ) :
|
4066 |
+
[];
|
4067 |
+
}
|
4068 |
+
|
4069 |
+
return { set: set, expr: expr };
|
4070 |
+
};
|
4071 |
+
|
4072 |
+
Sizzle.filter = function( expr, set, inplace, not ) {
|
4073 |
+
var match, anyFound,
|
4074 |
+
type, found, item, filter, left,
|
4075 |
+
i, pass,
|
4076 |
+
old = expr,
|
4077 |
+
result = [],
|
4078 |
+
curLoop = set,
|
4079 |
+
isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
|
4080 |
+
|
4081 |
+
while ( expr && set.length ) {
|
4082 |
+
for ( type in Expr.filter ) {
|
4083 |
+
if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
|
4084 |
+
filter = Expr.filter[ type ];
|
4085 |
+
left = match[1];
|
4086 |
+
|
4087 |
+
anyFound = false;
|
4088 |
+
|
4089 |
+
match.splice(1,1);
|
4090 |
+
|
4091 |
+
if ( left.substr( left.length - 1 ) === "\\" ) {
|
4092 |
+
continue;
|
4093 |
+
}
|
4094 |
+
|
4095 |
+
if ( curLoop === result ) {
|
4096 |
+
result = [];
|
4097 |
+
}
|
4098 |
+
|
4099 |
+
if ( Expr.preFilter[ type ] ) {
|
4100 |
+
match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
|
4101 |
+
|
4102 |
+
if ( !match ) {
|
4103 |
+
anyFound = found = true;
|
4104 |
+
|
4105 |
+
} else if ( match === true ) {
|
4106 |
+
continue;
|
4107 |
+
}
|
4108 |
+
}
|
4109 |
+
|
4110 |
+
if ( match ) {
|
4111 |
+
for ( i = 0; (item = curLoop[i]) != null; i++ ) {
|
4112 |
+
if ( item ) {
|
4113 |
+
found = filter( item, match, i, curLoop );
|
4114 |
+
pass = not ^ found;
|
4115 |
+
|
4116 |
+
if ( inplace && found != null ) {
|
4117 |
+
if ( pass ) {
|
4118 |
+
anyFound = true;
|
4119 |
+
|
4120 |
+
} else {
|
4121 |
+
curLoop[i] = false;
|
4122 |
+
}
|
4123 |
+
|
4124 |
+
} else if ( pass ) {
|
4125 |
+
result.push( item );
|
4126 |
+
anyFound = true;
|
4127 |
+
}
|
4128 |
+
}
|
4129 |
+
}
|
4130 |
+
}
|
4131 |
+
|
4132 |
+
if ( found !== undefined ) {
|
4133 |
+
if ( !inplace ) {
|
4134 |
+
curLoop = result;
|
4135 |
+
}
|
4136 |
+
|
4137 |
+
expr = expr.replace( Expr.match[ type ], "" );
|
4138 |
+
|
4139 |
+
if ( !anyFound ) {
|
4140 |
+
return [];
|
4141 |
+
}
|
4142 |
+
|
4143 |
+
break;
|
4144 |
+
}
|
4145 |
+
}
|
4146 |
+
}
|
4147 |
+
|
4148 |
+
// Improper expression
|
4149 |
+
if ( expr === old ) {
|
4150 |
+
if ( anyFound == null ) {
|
4151 |
+
Sizzle.error( expr );
|
4152 |
+
|
4153 |
+
} else {
|
4154 |
+
break;
|
4155 |
+
}
|
4156 |
+
}
|
4157 |
+
|
4158 |
+
old = expr;
|
4159 |
+
}
|
4160 |
+
|
4161 |
+
return curLoop;
|
4162 |
+
};
|
4163 |
+
|
4164 |
+
Sizzle.error = function( msg ) {
|
4165 |
+
throw new Error( "Syntax error, unrecognized expression: " + msg );
|
4166 |
+
};
|
4167 |
+
|
4168 |
+
/**
|
4169 |
+
* Utility function for retreiving the text value of an array of DOM nodes
|
4170 |
+
* @param {Array|Element} elem
|
4171 |
+
*/
|
4172 |
+
var getText = Sizzle.getText = function( elem ) {
|
4173 |
+
var i, node,
|
4174 |
+
nodeType = elem.nodeType,
|
4175 |
+
ret = "";
|
4176 |
+
|
4177 |
+
if ( nodeType ) {
|
4178 |
+
if ( nodeType === 1 || nodeType === 9 ) {
|
4179 |
+
// Use textContent || innerText for elements
|
4180 |
+
if ( typeof elem.textContent === 'string' ) {
|
4181 |
+
return elem.textContent;
|
4182 |
+
} else if ( typeof elem.innerText === 'string' ) {
|
4183 |
+
// Replace IE's carriage returns
|
4184 |
+
return elem.innerText.replace( rReturn, '' );
|
4185 |
+
} else {
|
4186 |
+
// Traverse it's children
|
4187 |
+
for ( elem = elem.firstChild; elem; elem = elem.nextSibling) {
|
4188 |
+
ret += getText( elem );
|
4189 |
+
}
|
4190 |
+
}
|
4191 |
+
} else if ( nodeType === 3 || nodeType === 4 ) {
|
4192 |
+
return elem.nodeValue;
|
4193 |
+
}
|
4194 |
+
} else {
|
4195 |
+
|
4196 |
+
// If no nodeType, this is expected to be an array
|
4197 |
+
for ( i = 0; (node = elem[i]); i++ ) {
|
4198 |
+
// Do not traverse comment nodes
|
4199 |
+
if ( node.nodeType !== 8 ) {
|
4200 |
+
ret += getText( node );
|
4201 |
+
}
|
4202 |
+
}
|
4203 |
+
}
|
4204 |
+
return ret;
|
4205 |
+
};
|
4206 |
+
|
4207 |
+
var Expr = Sizzle.selectors = {
|
4208 |
+
order: [ "ID", "NAME", "TAG" ],
|
4209 |
+
|
4210 |
+
match: {
|
4211 |
+
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
|
4212 |
+
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
|
4213 |
+
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
|
4214 |
+
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
|
4215 |
+
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
|
4216 |
+
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
|
4217 |
+
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
|
4218 |
+
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
|
4219 |
+
},
|
4220 |
+
|
4221 |
+
leftMatch: {},
|
4222 |
+
|
4223 |
+
attrMap: {
|
4224 |
+
"class": "className",
|
4225 |
+
"for": "htmlFor"
|
4226 |
+
},
|
4227 |
+
|
4228 |
+
attrHandle: {
|
4229 |
+
href: function( elem ) {
|
4230 |
+
return elem.getAttribute( "href" );
|
4231 |
+
},
|
4232 |
+
type: function( elem ) {
|
4233 |
+
return elem.getAttribute( "type" );
|
4234 |
+
}
|
4235 |
+
},
|
4236 |
+
|
4237 |
+
relative: {
|
4238 |
+
"+": function(checkSet, part){
|
4239 |
+
var isPartStr = typeof part === "string",
|
4240 |
+
isTag = isPartStr && !rNonWord.test( part ),
|
4241 |
+
isPartStrNotTag = isPartStr && !isTag;
|
4242 |
+
|
4243 |
+
if ( isTag ) {
|
4244 |
+
part = part.toLowerCase();
|
4245 |
+
}
|
4246 |
+
|
4247 |
+
for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) {
|
4248 |
+
if ( (elem = checkSet[i]) ) {
|
4249 |
+
while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {}
|
4250 |
+
|
4251 |
+
checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ?
|
4252 |
+
elem || false :
|
4253 |
+
elem === part;
|
4254 |
+
}
|
4255 |
+
}
|
4256 |
+
|
4257 |
+
if ( isPartStrNotTag ) {
|
4258 |
+
Sizzle.filter( part, checkSet, true );
|
4259 |
+
}
|
4260 |
+
},
|
4261 |
+
|
4262 |
+
">": function( checkSet, part ) {
|
4263 |
+
var elem,
|
4264 |
+
isPartStr = typeof part === "string",
|
4265 |
+
i = 0,
|
4266 |
+
l = checkSet.length;
|
4267 |
+
|
4268 |
+
if ( isPartStr && !rNonWord.test( part ) ) {
|
4269 |
+
part = part.toLowerCase();
|
4270 |
+
|
4271 |
+
for ( ; i < l; i++ ) {
|
4272 |
+
elem = checkSet[i];
|
4273 |
+
|
4274 |
+
if ( elem ) {
|
4275 |
+
var parent = elem.parentNode;
|
4276 |
+
checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false;
|
4277 |
+
}
|
4278 |
+
}
|
4279 |
+
|
4280 |
+
} else {
|
4281 |
+
for ( ; i < l; i++ ) {
|
4282 |
+
elem = checkSet[i];
|
4283 |
+
|
4284 |
+
if ( elem ) {
|
4285 |
+
checkSet[i] = isPartStr ?
|
4286 |
+
elem.parentNode :
|
4287 |
+
elem.parentNode === part;
|
4288 |
+
}
|
4289 |
+
}
|
4290 |
+
|
4291 |
+
if ( isPartStr ) {
|
4292 |
+
Sizzle.filter( part, checkSet, true );
|
4293 |
+
}
|
4294 |
+
}
|
4295 |
+
},
|
4296 |
+
|
4297 |
+
"": function(checkSet, part, isXML){
|
4298 |
+
var nodeCheck,
|
4299 |
+
doneName = done++,
|
4300 |
+
checkFn = dirCheck;
|
4301 |
+
|
4302 |
+
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
4303 |
+
part = part.toLowerCase();
|
4304 |
+
nodeCheck = part;
|
4305 |
+
checkFn = dirNodeCheck;
|
4306 |
+
}
|
4307 |
+
|
4308 |
+
checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
|
4309 |
+
},
|
4310 |
+
|
4311 |
+
"~": function( checkSet, part, isXML ) {
|
4312 |
+
var nodeCheck,
|
4313 |
+
doneName = done++,
|
4314 |
+
checkFn = dirCheck;
|
4315 |
+
|
4316 |
+
if ( typeof part === "string" && !rNonWord.test( part ) ) {
|
4317 |
+
part = part.toLowerCase();
|
4318 |
+
nodeCheck = part;
|
4319 |
+
checkFn = dirNodeCheck;
|
4320 |
+
}
|
4321 |
+
|
4322 |
+
checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
|
4323 |
+
}
|
4324 |
+
},
|
4325 |
+
|
4326 |
+
find: {
|
4327 |
+
ID: function( match, context, isXML ) {
|
4328 |
+
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
4329 |
+
var m = context.getElementById(match[1]);
|
4330 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
4331 |
+
// nodes that are no longer in the document #6963
|
4332 |
+
return m && m.parentNode ? [m] : [];
|
4333 |
+
}
|
4334 |
+
},
|
4335 |
+
|
4336 |
+
NAME: function( match, context ) {
|
4337 |
+
if ( typeof context.getElementsByName !== "undefined" ) {
|
4338 |
+
var ret = [],
|
4339 |
+
results = context.getElementsByName( match[1] );
|
4340 |
+
|
4341 |
+
for ( var i = 0, l = results.length; i < l; i++ ) {
|
4342 |
+
if ( results[i].getAttribute("name") === match[1] ) {
|
4343 |
+
ret.push( results[i] );
|
4344 |
+
}
|
4345 |
+
}
|
4346 |
+
|
4347 |
+
return ret.length === 0 ? null : ret;
|
4348 |
+
}
|
4349 |
+
},
|
4350 |
+
|
4351 |
+
TAG: function( match, context ) {
|
4352 |
+
if ( typeof context.getElementsByTagName !== "undefined" ) {
|
4353 |
+
return context.getElementsByTagName( match[1] );
|
4354 |
+
}
|
4355 |
+
}
|
4356 |
+
},
|
4357 |
+
preFilter: {
|
4358 |
+
CLASS: function( match, curLoop, inplace, result, not, isXML ) {
|
4359 |
+
match = " " + match[1].replace( rBackslash, "" ) + " ";
|
4360 |
+
|
4361 |
+
if ( isXML ) {
|
4362 |
+
return match;
|
4363 |
+
}
|
4364 |
+
|
4365 |
+
for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
|
4366 |
+
if ( elem ) {
|
4367 |
+
if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
|
4368 |
+
if ( !inplace ) {
|
4369 |
+
result.push( elem );
|
4370 |
+
}
|
4371 |
+
|
4372 |
+
} else if ( inplace ) {
|
4373 |
+
curLoop[i] = false;
|
4374 |
+
}
|
4375 |
+
}
|
4376 |
+
}
|
4377 |
+
|
4378 |
+
return false;
|
4379 |
+
},
|
4380 |
+
|
4381 |
+
ID: function( match ) {
|
4382 |
+
return match[1].replace( rBackslash, "" );
|
4383 |
+
},
|
4384 |
+
|
4385 |
+
TAG: function( match, curLoop ) {
|
4386 |
+
return match[1].replace( rBackslash, "" ).toLowerCase();
|
4387 |
+
},
|
4388 |
+
|
4389 |
+
CHILD: function( match ) {
|
4390 |
+
if ( match[1] === "nth" ) {
|
4391 |
+
if ( !match[2] ) {
|
4392 |
+
Sizzle.error( match[0] );
|
4393 |
+
}
|
4394 |
+
|
4395 |
+
match[2] = match[2].replace(/^\+|\s*/g, '');
|
4396 |
+
|
4397 |
+
// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
|
4398 |
+
var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
|
4399 |
+
match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
|
4400 |
+
!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
|
4401 |
+
|
4402 |
+
// calculate the numbers (first)n+(last) including if they are negative
|
4403 |
+
match[2] = (test[1] + (test[2] || 1)) - 0;
|
4404 |
+
match[3] = test[3] - 0;
|
4405 |
+
}
|
4406 |
+
else if ( match[2] ) {
|
4407 |
+
Sizzle.error( match[0] );
|
4408 |
+
}
|
4409 |
+
|
4410 |
+
// TODO: Move to normal caching system
|
4411 |
+
match[0] = done++;
|
4412 |
+
|
4413 |
+
return match;
|
4414 |
+
},
|
4415 |
+
|
4416 |
+
ATTR: function( match, curLoop, inplace, result, not, isXML ) {
|
4417 |
+
var name = match[1] = match[1].replace( rBackslash, "" );
|
4418 |
+
|
4419 |
+
if ( !isXML && Expr.attrMap[name] ) {
|
4420 |
+
match[1] = Expr.attrMap[name];
|
4421 |
+
}
|
4422 |
+
|
4423 |
+
// Handle if an un-quoted value was used
|
4424 |
+
match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
|
4425 |
+
|
4426 |
+
if ( match[2] === "~=" ) {
|
4427 |
+
match[4] = " " + match[4] + " ";
|
4428 |
+
}
|
4429 |
+
|
4430 |
+
return match;
|
4431 |
+
},
|
4432 |
+
|
4433 |
+
PSEUDO: function( match, curLoop, inplace, result, not ) {
|
4434 |
+
if ( match[1] === "not" ) {
|
4435 |
+
// If we're dealing with a complex expression, or a simple one
|
4436 |
+
if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
|
4437 |
+
match[3] = Sizzle(match[3], null, null, curLoop);
|
4438 |
+
|
4439 |
+
} else {
|
4440 |
+
var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
|
4441 |
+
|
4442 |
+
if ( !inplace ) {
|
4443 |
+
result.push.apply( result, ret );
|
4444 |
+
}
|
4445 |
+
|
4446 |
+
return false;
|
4447 |
+
}
|
4448 |
+
|
4449 |
+
} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
|
4450 |
+
return true;
|
4451 |
+
}
|
4452 |
+
|
4453 |
+
return match;
|
4454 |
+
},
|
4455 |
+
|
4456 |
+
POS: function( match ) {
|
4457 |
+
match.unshift( true );
|
4458 |
+
|
4459 |
+
return match;
|
4460 |
+
}
|
4461 |
+
},
|
4462 |
+
|
4463 |
+
filters: {
|
4464 |
+
enabled: function( elem ) {
|
4465 |
+
return elem.disabled === false && elem.type !== "hidden";
|
4466 |
+
},
|
4467 |
+
|
4468 |
+
disabled: function( elem ) {
|
4469 |
+
return elem.disabled === true;
|
4470 |
+
},
|
4471 |
+
|
4472 |
+
checked: function( elem ) {
|
4473 |
+
return elem.checked === true;
|
4474 |
+
},
|
4475 |
+
|
4476 |
+
selected: function( elem ) {
|
4477 |
+
// Accessing this property makes selected-by-default
|
4478 |
+
// options in Safari work properly
|
4479 |
+
if ( elem.parentNode ) {
|
4480 |
+
elem.parentNode.selectedIndex;
|
4481 |
+
}
|
4482 |
+
|
4483 |
+
return elem.selected === true;
|
4484 |
+
},
|
4485 |
+
|
4486 |
+
parent: function( elem ) {
|
4487 |
+
return !!elem.firstChild;
|
4488 |
+
},
|
4489 |
+
|
4490 |
+
empty: function( elem ) {
|
4491 |
+
return !elem.firstChild;
|
4492 |
+
},
|
4493 |
+
|
4494 |
+
has: function( elem, i, match ) {
|
4495 |
+
return !!Sizzle( match[3], elem ).length;
|
4496 |
+
},
|
4497 |
+
|
4498 |
+
header: function( elem ) {
|
4499 |
+
return (/h\d/i).test( elem.nodeName );
|
4500 |
+
},
|
4501 |
+
|
4502 |
+
text: function( elem ) {
|
4503 |
+
var attr = elem.getAttribute( "type" ), type = elem.type;
|
4504 |
+
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
|
4505 |
+
// use getAttribute instead to test this case
|
4506 |
+
return elem.nodeName.toLowerCase() === "input" && "text" === type && ( attr === type || attr === null );
|
4507 |
+
},
|
4508 |
+
|
4509 |
+
radio: function( elem ) {
|
4510 |
+
return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
|
4511 |
+
},
|
4512 |
+
|
4513 |
+
checkbox: function( elem ) {
|
4514 |
+
return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
|
4515 |
+
},
|
4516 |
+
|
4517 |
+
file: function( elem ) {
|
4518 |
+
return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
|
4519 |
+
},
|
4520 |
+
|
4521 |
+
password: function( elem ) {
|
4522 |
+
return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
|
4523 |
+
},
|
4524 |
+
|
4525 |
+
submit: function( elem ) {
|
4526 |
+
var name = elem.nodeName.toLowerCase();
|
4527 |
+
return (name === "input" || name === "button") && "submit" === elem.type;
|
4528 |
+
},
|
4529 |
+
|
4530 |
+
image: function( elem ) {
|
4531 |
+
return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
|
4532 |
+
},
|
4533 |
+
|
4534 |
+
reset: function( elem ) {
|
4535 |
+
var name = elem.nodeName.toLowerCase();
|
4536 |
+
return (name === "input" || name === "button") && "reset" === elem.type;
|
4537 |
+
},
|
4538 |
+
|
4539 |
+
button: function( elem ) {
|
4540 |
+
var name = elem.nodeName.toLowerCase();
|
4541 |
+
return name === "input" && "button" === elem.type || name === "button";
|
4542 |
+
},
|
4543 |
+
|
4544 |
+
input: function( elem ) {
|
4545 |
+
return (/input|select|textarea|button/i).test( elem.nodeName );
|
4546 |
+
},
|
4547 |
+
|
4548 |
+
focus: function( elem ) {
|
4549 |
+
return elem === elem.ownerDocument.activeElement;
|
4550 |
+
}
|
4551 |
+
},
|
4552 |
+
setFilters: {
|
4553 |
+
first: function( elem, i ) {
|
4554 |
+
return i === 0;
|
4555 |
+
},
|
4556 |
+
|
4557 |
+
last: function( elem, i, match, array ) {
|
4558 |
+
return i === array.length - 1;
|
4559 |
+
},
|
4560 |
+
|
4561 |
+
even: function( elem, i ) {
|
4562 |
+
return i % 2 === 0;
|
4563 |
+
},
|
4564 |
+
|
4565 |
+
odd: function( elem, i ) {
|
4566 |
+
return i % 2 === 1;
|
4567 |
+
},
|
4568 |
+
|
4569 |
+
lt: function( elem, i, match ) {
|
4570 |
+
return i < match[3] - 0;
|
4571 |
+
},
|
4572 |
+
|
4573 |
+
gt: function( elem, i, match ) {
|
4574 |
+
return i > match[3] - 0;
|
4575 |
+
},
|
4576 |
+
|
4577 |
+
nth: function( elem, i, match ) {
|
4578 |
+
return match[3] - 0 === i;
|
4579 |
+
},
|
4580 |
+
|
4581 |
+
eq: function( elem, i, match ) {
|
4582 |
+
return match[3] - 0 === i;
|
4583 |
+
}
|
4584 |
+
},
|
4585 |
+
filter: {
|
4586 |
+
PSEUDO: function( elem, match, i, array ) {
|
4587 |
+
var name = match[1],
|
4588 |
+
filter = Expr.filters[ name ];
|
4589 |
+
|
4590 |
+
if ( filter ) {
|
4591 |
+
return filter( elem, i, match, array );
|
4592 |
+
|
4593 |
+
} else if ( name === "contains" ) {
|
4594 |
+
return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
|
4595 |
+
|
4596 |
+
} else if ( name === "not" ) {
|
4597 |
+
var not = match[3];
|
4598 |
+
|
4599 |
+
for ( var j = 0, l = not.length; j < l; j++ ) {
|
4600 |
+
if ( not[j] === elem ) {
|
4601 |
+
return false;
|
4602 |
+
}
|
4603 |
+
}
|
4604 |
+
|
4605 |
+
return true;
|
4606 |
+
|
4607 |
+
} else {
|
4608 |
+
Sizzle.error( name );
|
4609 |
+
}
|
4610 |
+
},
|
4611 |
+
|
4612 |
+
CHILD: function( elem, match ) {
|
4613 |
+
var first, last,
|
4614 |
+
doneName, parent, cache,
|
4615 |
+
count, diff,
|
4616 |
+
type = match[1],
|
4617 |
+
node = elem;
|
4618 |
+
|
4619 |
+
switch ( type ) {
|
4620 |
+
case "only":
|
4621 |
+
case "first":
|
4622 |
+
while ( (node = node.previousSibling) ) {
|
4623 |
+
if ( node.nodeType === 1 ) {
|
4624 |
+
return false;
|
4625 |
+
}
|
4626 |
+
}
|
4627 |
+
|
4628 |
+
if ( type === "first" ) {
|
4629 |
+
return true;
|
4630 |
+
}
|
4631 |
+
|
4632 |
+
node = elem;
|
4633 |
+
|
4634 |
+
case "last":
|
4635 |
+
while ( (node = node.nextSibling) ) {
|
4636 |
+
if ( node.nodeType === 1 ) {
|
4637 |
+
return false;
|
4638 |
+
}
|
4639 |
+
}
|
4640 |
+
|
4641 |
+
return true;
|
4642 |
+
|
4643 |
+
case "nth":
|
4644 |
+
first = match[2];
|
4645 |
+
last = match[3];
|
4646 |
+
|
4647 |
+
if ( first === 1 && last === 0 ) {
|
4648 |
+
return true;
|
4649 |
+
}
|
4650 |
+
|
4651 |
+
doneName = match[0];
|
4652 |
+
parent = elem.parentNode;
|
4653 |
+
|
4654 |
+
if ( parent && (parent[ expando ] !== doneName || !elem.nodeIndex) ) {
|
4655 |
+
count = 0;
|
4656 |
+
|
4657 |
+
for ( node = parent.firstChild; node; node = node.nextSibling ) {
|
4658 |
+
if ( node.nodeType === 1 ) {
|
4659 |
+
node.nodeIndex = ++count;
|
4660 |
+
}
|
4661 |
+
}
|
4662 |
+
|
4663 |
+
parent[ expando ] = doneName;
|
4664 |
+
}
|
4665 |
+
|
4666 |
+
diff = elem.nodeIndex - last;
|
4667 |
+
|
4668 |
+
if ( first === 0 ) {
|
4669 |
+
return diff === 0;
|
4670 |
+
|
4671 |
+
} else {
|
4672 |
+
return ( diff % first === 0 && diff / first >= 0 );
|
4673 |
+
}
|
4674 |
+
}
|
4675 |
+
},
|
4676 |
+
|
4677 |
+
ID: function( elem, match ) {
|
4678 |
+
return elem.nodeType === 1 && elem.getAttribute("id") === match;
|
4679 |
+
},
|
4680 |
+
|
4681 |
+
TAG: function( elem, match ) {
|
4682 |
+
return (match === "*" && elem.nodeType === 1) || !!elem.nodeName && elem.nodeName.toLowerCase() === match;
|
4683 |
+
},
|
4684 |
+
|
4685 |
+
CLASS: function( elem, match ) {
|
4686 |
+
return (" " + (elem.className || elem.getAttribute("class")) + " ")
|
4687 |
+
.indexOf( match ) > -1;
|
4688 |
+
},
|
4689 |
+
|
4690 |
+
ATTR: function( elem, match ) {
|
4691 |
+
var name = match[1],
|
4692 |
+
result = Sizzle.attr ?
|
4693 |
+
Sizzle.attr( elem, name ) :
|
4694 |
+
Expr.attrHandle[ name ] ?
|
4695 |
+
Expr.attrHandle[ name ]( elem ) :
|
4696 |
+
elem[ name ] != null ?
|
4697 |
+
elem[ name ] :
|
4698 |
+
elem.getAttribute( name ),
|
4699 |
+
value = result + "",
|
4700 |
+
type = match[2],
|
4701 |
+
check = match[4];
|
4702 |
+
|
4703 |
+
return result == null ?
|
4704 |
+
type === "!=" :
|
4705 |
+
!type && Sizzle.attr ?
|
4706 |
+
result != null :
|
4707 |
+
type === "=" ?
|
4708 |
+
value === check :
|
4709 |
+
type === "*=" ?
|
4710 |
+
value.indexOf(check) >= 0 :
|
4711 |
+
type === "~=" ?
|
4712 |
+
(" " + value + " ").indexOf(check) >= 0 :
|
4713 |
+
!check ?
|
4714 |
+
value && result !== false :
|
4715 |
+
type === "!=" ?
|
4716 |
+
value !== check :
|
4717 |
+
type === "^=" ?
|
4718 |
+
value.indexOf(check) === 0 :
|
4719 |
+
type === "$=" ?
|
4720 |
+
value.substr(value.length - check.length) === check :
|
4721 |
+
type === "|=" ?
|
4722 |
+
value === check || value.substr(0, check.length + 1) === check + "-" :
|
4723 |
+
false;
|
4724 |
+
},
|
4725 |
+
|
4726 |
+
POS: function( elem, match, i, array ) {
|
4727 |
+
var name = match[2],
|
4728 |
+
filter = Expr.setFilters[ name ];
|
4729 |
+
|
4730 |
+
if ( filter ) {
|
4731 |
+
return filter( elem, i, match, array );
|
4732 |
+
}
|
4733 |
+
}
|
4734 |
+
}
|
4735 |
+
};
|
4736 |
+
|
4737 |
+
var origPOS = Expr.match.POS,
|
4738 |
+
fescape = function(all, num){
|
4739 |
+
return "\\" + (num - 0 + 1);
|
4740 |
+
};
|
4741 |
+
|
4742 |
+
for ( var type in Expr.match ) {
|
4743 |
+
Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
|
4744 |
+
Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
|
4745 |
+
}
|
4746 |
+
|
4747 |
+
var makeArray = function( array, results ) {
|
4748 |
+
array = Array.prototype.slice.call( array, 0 );
|
4749 |
+
|
4750 |
+
if ( results ) {
|
4751 |
+
results.push.apply( results, array );
|
4752 |
+
return results;
|
4753 |
+
}
|
4754 |
+
|
4755 |
+
return array;
|
4756 |
+
};
|
4757 |
+
|
4758 |
+
// Perform a simple check to determine if the browser is capable of
|
4759 |
+
// converting a NodeList to an array using builtin methods.
|
4760 |
+
// Also verifies that the returned array holds DOM nodes
|
4761 |
+
// (which is not the case in the Blackberry browser)
|
4762 |
+
try {
|
4763 |
+
Array.prototype.slice.call( document.documentElement.childNodes, 0 )[0].nodeType;
|
4764 |
+
|
4765 |
+
// Provide a fallback method if it does not work
|
4766 |
+
} catch( e ) {
|
4767 |
+
makeArray = function( array, results ) {
|
4768 |
+
var i = 0,
|
4769 |
+
ret = results || [];
|
4770 |
+
|
4771 |
+
if ( toString.call(array) === "[object Array]" ) {
|
4772 |
+
Array.prototype.push.apply( ret, array );
|
4773 |
+
|
4774 |
+
} else {
|
4775 |
+
if ( typeof array.length === "number" ) {
|
4776 |
+
for ( var l = array.length; i < l; i++ ) {
|
4777 |
+
ret.push( array[i] );
|
4778 |
+
}
|
4779 |
+
|
4780 |
+
} else {
|
4781 |
+
for ( ; array[i]; i++ ) {
|
4782 |
+
ret.push( array[i] );
|
4783 |
+
}
|
4784 |
+
}
|
4785 |
+
}
|
4786 |
+
|
4787 |
+
return ret;
|
4788 |
+
};
|
4789 |
+
}
|
4790 |
+
|
4791 |
+
var sortOrder, siblingCheck;
|
4792 |
+
|
4793 |
+
if ( document.documentElement.compareDocumentPosition ) {
|
4794 |
+
sortOrder = function( a, b ) {
|
4795 |
+
if ( a === b ) {
|
4796 |
+
hasDuplicate = true;
|
4797 |
+
return 0;
|
4798 |
+
}
|
4799 |
+
|
4800 |
+
if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
|
4801 |
+
return a.compareDocumentPosition ? -1 : 1;
|
4802 |
+
}
|
4803 |
+
|
4804 |
+
return a.compareDocumentPosition(b) & 4 ? -1 : 1;
|
4805 |
+
};
|
4806 |
+
|
4807 |
+
} else {
|
4808 |
+
sortOrder = function( a, b ) {
|
4809 |
+
// The nodes are identical, we can exit early
|
4810 |
+
if ( a === b ) {
|
4811 |
+
hasDuplicate = true;
|
4812 |
+
return 0;
|
4813 |
+
|
4814 |
+
// Fallback to using sourceIndex (in IE) if it's available on both nodes
|
4815 |
+
} else if ( a.sourceIndex && b.sourceIndex ) {
|
4816 |
+
return a.sourceIndex - b.sourceIndex;
|
4817 |
+
}
|
4818 |
+
|
4819 |
+
var al, bl,
|
4820 |
+
ap = [],
|
4821 |
+
bp = [],
|
4822 |
+
aup = a.parentNode,
|
4823 |
+
bup = b.parentNode,
|
4824 |
+
cur = aup;
|
4825 |
+
|
4826 |
+
// If the nodes are siblings (or identical) we can do a quick check
|
4827 |
+
if ( aup === bup ) {
|
4828 |
+
return siblingCheck( a, b );
|
4829 |
+
|
4830 |
+
// If no parents were found then the nodes are disconnected
|
4831 |
+
} else if ( !aup ) {
|
4832 |
+
return -1;
|
4833 |
+
|
4834 |
+
} else if ( !bup ) {
|
4835 |
+
return 1;
|
4836 |
+
}
|
4837 |
+
|
4838 |
+
// Otherwise they're somewhere else in the tree so we need
|
4839 |
+
// to build up a full list of the parentNodes for comparison
|
4840 |
+
while ( cur ) {
|
4841 |
+
ap.unshift( cur );
|
4842 |
+
cur = cur.parentNode;
|
4843 |
+
}
|
4844 |
+
|
4845 |
+
cur = bup;
|
4846 |
+
|
4847 |
+
while ( cur ) {
|
4848 |
+
bp.unshift( cur );
|
4849 |
+
cur = cur.parentNode;
|
4850 |
+
}
|
4851 |
+
|
4852 |
+
al = ap.length;
|
4853 |
+
bl = bp.length;
|
4854 |
+
|
4855 |
+
// Start walking down the tree looking for a discrepancy
|
4856 |
+
for ( var i = 0; i < al && i < bl; i++ ) {
|
4857 |
+
if ( ap[i] !== bp[i] ) {
|
4858 |
+
return siblingCheck( ap[i], bp[i] );
|
4859 |
+
}
|
4860 |
+
}
|
4861 |
+
|
4862 |
+
// We ended someplace up the tree so do a sibling check
|
4863 |
+
return i === al ?
|
4864 |
+
siblingCheck( a, bp[i], -1 ) :
|
4865 |
+
siblingCheck( ap[i], b, 1 );
|
4866 |
+
};
|
4867 |
+
|
4868 |
+
siblingCheck = function( a, b, ret ) {
|
4869 |
+
if ( a === b ) {
|
4870 |
+
return ret;
|
4871 |
+
|
4872 |
+
var cur = a.nextSibling;
|
4873 |
+
}
|
4874 |
+
|
4875 |
+
while ( cur ) {
|
4876 |
+
if ( cur === b ) {
|
4877 |
+
return -1;
|
4878 |
+
}
|
4879 |
+
|
4880 |
+
cur = cur.nextSibling;
|
4881 |
+
}
|
4882 |
+
|
4883 |
+
return 1;
|
4884 |
+
};
|
4885 |
+
}
|
4886 |
+
|
4887 |
+
// Check to see if the browser returns elements by name when
|
4888 |
+
// querying by getElementById (and provide a workaround)
|
4889 |
+
(function(){
|
4890 |
+
// We're going to inject a fake input element with a specified name
|
4891 |
+
var form = document.createElement("div"),
|
4892 |
+
id = "script" + (new Date()).getTime(),
|
4893 |
+
root = document.documentElement;
|
4894 |
+
|
4895 |
+
form.innerHTML = "<a name='" + id + "'/>";
|
4896 |
+
|
4897 |
+
// Inject it into the root element, check its status, and remove it quickly
|
4898 |
+
root.insertBefore( form, root.firstChild );
|
4899 |
+
|
4900 |
+
// The workaround has to do additional checks after a getElementById
|
4901 |
+
// Which slows things down for other browsers (hence the branching)
|
4902 |
+
if ( document.getElementById( id ) ) {
|
4903 |
+
Expr.find.ID = function( match, context, isXML ) {
|
4904 |
+
if ( typeof context.getElementById !== "undefined" && !isXML ) {
|
4905 |
+
var m = context.getElementById(match[1]);
|
4906 |
+
|
4907 |
+
return m ?
|
4908 |
+
m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
|
4909 |
+
[m] :
|
4910 |
+
undefined :
|
4911 |
+
[];
|
4912 |
+
}
|
4913 |
+
};
|
4914 |
+
|
4915 |
+
Expr.filter.ID = function( elem, match ) {
|
4916 |
+
var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
|
4917 |
+
|
4918 |
+
return elem.nodeType === 1 && node && node.nodeValue === match;
|
4919 |
+
};
|
4920 |
+
}
|
4921 |
+
|
4922 |
+
root.removeChild( form );
|
4923 |
+
|
4924 |
+
// release memory in IE
|
4925 |
+
root = form = null;
|
4926 |
+
})();
|
4927 |
+
|
4928 |
+
(function(){
|
4929 |
+
// Check to see if the browser returns only elements
|
4930 |
+
// when doing getElementsByTagName("*")
|
4931 |
+
|
4932 |
+
// Create a fake element
|
4933 |
+
var div = document.createElement("div");
|
4934 |
+
div.appendChild( document.createComment("") );
|
4935 |
+
|
4936 |
+
// Make sure no comments are found
|
4937 |
+
if ( div.getElementsByTagName("*").length > 0 ) {
|
4938 |
+
Expr.find.TAG = function( match, context ) {
|
4939 |
+
var results = context.getElementsByTagName( match[1] );
|
4940 |
+
|
4941 |
+
// Filter out possible comments
|
4942 |
+
if ( match[1] === "*" ) {
|
4943 |
+
var tmp = [];
|
4944 |
+
|
4945 |
+
for ( var i = 0; results[i]; i++ ) {
|
4946 |
+
if ( results[i].nodeType === 1 ) {
|
4947 |
+
tmp.push( results[i] );
|
4948 |
+
}
|
4949 |
+
}
|
4950 |
+
|
4951 |
+
results = tmp;
|
4952 |
+
}
|
4953 |
+
|
4954 |
+
return results;
|
4955 |
+
};
|
4956 |
+
}
|
4957 |
+
|
4958 |
+
// Check to see if an attribute returns normalized href attributes
|
4959 |
+
div.innerHTML = "<a href='#'></a>";
|
4960 |
+
|
4961 |
+
if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
|
4962 |
+
div.firstChild.getAttribute("href") !== "#" ) {
|
4963 |
+
|
4964 |
+
Expr.attrHandle.href = function( elem ) {
|
4965 |
+
return elem.getAttribute( "href", 2 );
|
4966 |
+
};
|
4967 |
+
}
|
4968 |
+
|
4969 |
+
// release memory in IE
|
4970 |
+
div = null;
|
4971 |
+
})();
|
4972 |
+
|
4973 |
+
if ( document.querySelectorAll ) {
|
4974 |
+
(function(){
|
4975 |
+
var oldSizzle = Sizzle,
|
4976 |
+
div = document.createElement("div"),
|
4977 |
+
id = "__sizzle__";
|
4978 |
+
|
4979 |
+
div.innerHTML = "<p class='TEST'></p>";
|
4980 |
+
|
4981 |
+
// Safari can't handle uppercase or unicode characters when
|
4982 |
+
// in quirks mode.
|
4983 |
+
if ( div.querySelectorAll && div.querySelectorAll(".TEST").length === 0 ) {
|
4984 |
+
return;
|
4985 |
+
}
|
4986 |
+
|
4987 |
+
Sizzle = function( query, context, extra, seed ) {
|
4988 |
+
context = context || document;
|
4989 |
+
|
4990 |
+
// Only use querySelectorAll on non-XML documents
|
4991 |
+
// (ID selectors don't work in non-HTML documents)
|
4992 |
+
if ( !seed && !Sizzle.isXML(context) ) {
|
4993 |
+
// See if we find a selector to speed up
|
4994 |
+
var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
|
4995 |
+
|
4996 |
+
if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
|
4997 |
+
// Speed-up: Sizzle("TAG")
|
4998 |
+
if ( match[1] ) {
|
4999 |
+
return makeArray( context.getElementsByTagName( query ), extra );
|
5000 |
+
|
5001 |
+
// Speed-up: Sizzle(".CLASS")
|
5002 |
+
} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
|
5003 |
+
return makeArray( context.getElementsByClassName( match[2] ), extra );
|
5004 |
+
}
|
5005 |
+
}
|
5006 |
+
|
5007 |
+
if ( context.nodeType === 9 ) {
|
5008 |
+
// Speed-up: Sizzle("body")
|
5009 |
+
// The body element only exists once, optimize finding it
|
5010 |
+
if ( query === "body" && context.body ) {
|
5011 |
+
return makeArray( [ context.body ], extra );
|
5012 |
+
|
5013 |
+
// Speed-up: Sizzle("#ID")
|
5014 |
+
} else if ( match && match[3] ) {
|
5015 |
+
var elem = context.getElementById( match[3] );
|
5016 |
+
|
5017 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
5018 |
+
// nodes that are no longer in the document #6963
|
5019 |
+
if ( elem && elem.parentNode ) {
|
5020 |
+
// Handle the case where IE and Opera return items
|
5021 |
+
// by name instead of ID
|
5022 |
+
if ( elem.id === match[3] ) {
|
5023 |
+
return makeArray( [ elem ], extra );
|
5024 |
+
}
|
5025 |
+
|
5026 |
+
} else {
|
5027 |
+
return makeArray( [], extra );
|
5028 |
+
}
|
5029 |
+
}
|
5030 |
+
|
5031 |
+
try {
|
5032 |
+
return makeArray( context.querySelectorAll(query), extra );
|
5033 |
+
} catch(qsaError) {}
|
5034 |
+
|
5035 |
+
// qSA works strangely on Element-rooted queries
|
5036 |
+
// We can work around this by specifying an extra ID on the root
|
5037 |
+
// and working up from there (Thanks to Andrew Dupont for the technique)
|
5038 |
+
// IE 8 doesn't work on object elements
|
5039 |
+
} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
|
5040 |
+
var oldContext = context,
|
5041 |
+
old = context.getAttribute( "id" ),
|
5042 |
+
nid = old || id,
|
5043 |
+
hasParent = context.parentNode,
|
5044 |
+
relativeHierarchySelector = /^\s*[+~]/.test( query );
|
5045 |
+
|
5046 |
+
if ( !old ) {
|
5047 |
+
context.setAttribute( "id", nid );
|
5048 |
+
} else {
|
5049 |
+
nid = nid.replace( /'/g, "\\$&" );
|
5050 |
+
}
|
5051 |
+
if ( relativeHierarchySelector && hasParent ) {
|
5052 |
+
context = context.parentNode;
|
5053 |
+
}
|
5054 |
+
|
5055 |
+
try {
|
5056 |
+
if ( !relativeHierarchySelector || hasParent ) {
|
5057 |
+
return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
|
5058 |
+
}
|
5059 |
+
|
5060 |
+
} catch(pseudoError) {
|
5061 |
+
} finally {
|
5062 |
+
if ( !old ) {
|
5063 |
+
oldContext.removeAttribute( "id" );
|
5064 |
+
}
|
5065 |
+
}
|
5066 |
+
}
|
5067 |
+
}
|
5068 |
+
|
5069 |
+
return oldSizzle(query, context, extra, seed);
|
5070 |
+
};
|
5071 |
+
|
5072 |
+
for ( var prop in oldSizzle ) {
|
5073 |
+
Sizzle[ prop ] = oldSizzle[ prop ];
|
5074 |
+
}
|
5075 |
+
|
5076 |
+
// release memory in IE
|
5077 |
+
div = null;
|
5078 |
+
})();
|
5079 |
+
}
|
5080 |
+
|
5081 |
+
(function(){
|
5082 |
+
var html = document.documentElement,
|
5083 |
+
matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
|
5084 |
+
|
5085 |
+
if ( matches ) {
|
5086 |
+
// Check to see if it's possible to do matchesSelector
|
5087 |
+
// on a disconnected node (IE 9 fails this)
|
5088 |
+
var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
|
5089 |
+
pseudoWorks = false;
|
5090 |
+
|
5091 |
+
try {
|
5092 |
+
// This should fail with an exception
|
5093 |
+
// Gecko does not error, returns false instead
|
5094 |
+
matches.call( document.documentElement, "[test!='']:sizzle" );
|
5095 |
+
|
5096 |
+
} catch( pseudoError ) {
|
5097 |
+
pseudoWorks = true;
|
5098 |
+
}
|
5099 |
+
|
5100 |
+
Sizzle.matchesSelector = function( node, expr ) {
|
5101 |
+
// Make sure that attribute selectors are quoted
|
5102 |
+
expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
|
5103 |
+
|
5104 |
+
if ( !Sizzle.isXML( node ) ) {
|
5105 |
+
try {
|
5106 |
+
if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
|
5107 |
+
var ret = matches.call( node, expr );
|
5108 |
+
|
5109 |
+
// IE 9's matchesSelector returns false on disconnected nodes
|
5110 |
+
if ( ret || !disconnectedMatch ||
|
5111 |
+
// As well, disconnected nodes are said to be in a document
|
5112 |
+
// fragment in IE 9, so check for that
|
5113 |
+
node.document && node.document.nodeType !== 11 ) {
|
5114 |
+
return ret;
|
5115 |
+
}
|
5116 |
+
}
|
5117 |
+
} catch(e) {}
|
5118 |
+
}
|
5119 |
+
|
5120 |
+
return Sizzle(expr, null, null, [node]).length > 0;
|
5121 |
+
};
|
5122 |
+
}
|
5123 |
+
})();
|
5124 |
+
|
5125 |
+
(function(){
|
5126 |
+
var div = document.createElement("div");
|
5127 |
+
|
5128 |
+
div.innerHTML = "<div class='test e'></div><div class='test'></div>";
|
5129 |
+
|
5130 |
+
// Opera can't find a second classname (in 9.6)
|
5131 |
+
// Also, make sure that getElementsByClassName actually exists
|
5132 |
+
if ( !div.getElementsByClassName || div.getElementsByClassName("e").length === 0 ) {
|
5133 |
+
return;
|
5134 |
+
}
|
5135 |
+
|
5136 |
+
// Safari caches class attributes, doesn't catch changes (in 3.2)
|
5137 |
+
div.lastChild.className = "e";
|
5138 |
+
|
5139 |
+
if ( div.getElementsByClassName("e").length === 1 ) {
|
5140 |
+
return;
|
5141 |
+
}
|
5142 |
+
|
5143 |
+
Expr.order.splice(1, 0, "CLASS");
|
5144 |
+
Expr.find.CLASS = function( match, context, isXML ) {
|
5145 |
+
if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
|
5146 |
+
return context.getElementsByClassName(match[1]);
|
5147 |
+
}
|
5148 |
+
};
|
5149 |
+
|
5150 |
+
// release memory in IE
|
5151 |
+
div = null;
|
5152 |
+
})();
|
5153 |
+
|
5154 |
+
function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
5155 |
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
5156 |
+
var elem = checkSet[i];
|
5157 |
+
|
5158 |
+
if ( elem ) {
|
5159 |
+
var match = false;
|
5160 |
+
|
5161 |
+
elem = elem[dir];
|
5162 |
+
|
5163 |
+
while ( elem ) {
|
5164 |
+
if ( elem[ expando ] === doneName ) {
|
5165 |
+
match = checkSet[elem.sizset];
|
5166 |
+
break;
|
5167 |
+
}
|
5168 |
+
|
5169 |
+
if ( elem.nodeType === 1 && !isXML ){
|
5170 |
+
elem[ expando ] = doneName;
|
5171 |
+
elem.sizset = i;
|
5172 |
+
}
|
5173 |
+
|
5174 |
+
if ( elem.nodeName.toLowerCase() === cur ) {
|
5175 |
+
match = elem;
|
5176 |
+
break;
|
5177 |
+
}
|
5178 |
+
|
5179 |
+
elem = elem[dir];
|
5180 |
+
}
|
5181 |
+
|
5182 |
+
checkSet[i] = match;
|
5183 |
+
}
|
5184 |
+
}
|
5185 |
+
}
|
5186 |
+
|
5187 |
+
function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
|
5188 |
+
for ( var i = 0, l = checkSet.length; i < l; i++ ) {
|
5189 |
+
var elem = checkSet[i];
|
5190 |
+
|
5191 |
+
if ( elem ) {
|
5192 |
+
var match = false;
|
5193 |
+
|
5194 |
+
elem = elem[dir];
|
5195 |
+
|
5196 |
+
while ( elem ) {
|
5197 |
+
if ( elem[ expando ] === doneName ) {
|
5198 |
+
match = checkSet[elem.sizset];
|
5199 |
+
break;
|
5200 |
+
}
|
5201 |
+
|
5202 |
+
if ( elem.nodeType === 1 ) {
|
5203 |
+
if ( !isXML ) {
|
5204 |
+
elem[ expando ] = doneName;
|
5205 |
+
elem.sizset = i;
|
5206 |
+
}
|
5207 |
+
|
5208 |
+
if ( typeof cur !== "string" ) {
|
5209 |
+
if ( elem === cur ) {
|
5210 |
+
match = true;
|
5211 |
+
break;
|
5212 |
+
}
|
5213 |
+
|
5214 |
+
} else if ( Sizzle.filter( cur, [elem] ).length > 0 ) {
|
5215 |
+
match = elem;
|
5216 |
+
break;
|
5217 |
+
}
|
5218 |
+
}
|
5219 |
+
|
5220 |
+
elem = elem[dir];
|
5221 |
+
}
|
5222 |
+
|
5223 |
+
checkSet[i] = match;
|
5224 |
+
}
|
5225 |
+
}
|
5226 |
+
}
|
5227 |
+
|
5228 |
+
if ( document.documentElement.contains ) {
|
5229 |
+
Sizzle.contains = function( a, b ) {
|
5230 |
+
return a !== b && (a.contains ? a.contains(b) : true);
|
5231 |
+
};
|
5232 |
+
|
5233 |
+
} else if ( document.documentElement.compareDocumentPosition ) {
|
5234 |
+
Sizzle.contains = function( a, b ) {
|
5235 |
+
return !!(a.compareDocumentPosition(b) & 16);
|
5236 |
+
};
|
5237 |
+
|
5238 |
+
} else {
|
5239 |
+
Sizzle.contains = function() {
|
5240 |
+
return false;
|
5241 |
+
};
|
5242 |
+
}
|
5243 |
+
|
5244 |
+
Sizzle.isXML = function( elem ) {
|
5245 |
+
// documentElement is verified for cases where it doesn't yet exist
|
5246 |
+
// (such as loading iframes in IE - #4833)
|
5247 |
+
var documentElement = (elem ? elem.ownerDocument || elem : 0).documentElement;
|
5248 |
+
|
5249 |
+
return documentElement ? documentElement.nodeName !== "HTML" : false;
|
5250 |
+
};
|
5251 |
+
|
5252 |
+
var posProcess = function( selector, context, seed ) {
|
5253 |
+
var match,
|
5254 |
+
tmpSet = [],
|
5255 |
+
later = "",
|
5256 |
+
root = context.nodeType ? [context] : context;
|
5257 |
+
|
5258 |
+
// Position selectors must be done after the filter
|
5259 |
+
// And so must :not(positional) so we move all PSEUDOs to the end
|
5260 |
+
while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
|
5261 |
+
later += match[0];
|
5262 |
+
selector = selector.replace( Expr.match.PSEUDO, "" );
|
5263 |
+
}
|
5264 |
+
|
5265 |
+
selector = Expr.relative[selector] ? selector + "*" : selector;
|
5266 |
+
|
5267 |
+
for ( var i = 0, l = root.length; i < l; i++ ) {
|
5268 |
+
Sizzle( selector, root[i], tmpSet, seed );
|
5269 |
+
}
|
5270 |
+
|
5271 |
+
return Sizzle.filter( later, tmpSet );
|
5272 |
+
};
|
5273 |
+
|
5274 |
+
// EXPOSE
|
5275 |
+
// Override sizzle attribute retrieval
|
5276 |
+
Sizzle.attr = jQuery.attr;
|
5277 |
+
Sizzle.selectors.attrMap = {};
|
5278 |
+
jQuery.find = Sizzle;
|
5279 |
+
jQuery.expr = Sizzle.selectors;
|
5280 |
+
jQuery.expr[":"] = jQuery.expr.filters;
|
5281 |
+
jQuery.unique = Sizzle.uniqueSort;
|
5282 |
+
jQuery.text = Sizzle.getText;
|
5283 |
+
jQuery.isXMLDoc = Sizzle.isXML;
|
5284 |
+
jQuery.contains = Sizzle.contains;
|
5285 |
+
|
5286 |
+
|
5287 |
+
})();
|
5288 |
+
|
5289 |
+
|
5290 |
+
var runtil = /Until$/,
|
5291 |
+
rparentsprev = /^(?:parents|prevUntil|prevAll)/,
|
5292 |
+
// Note: This RegExp should be improved, or likely pulled from Sizzle
|
5293 |
+
rmultiselector = /,/,
|
5294 |
+
isSimple = /^.[^:#\[\.,]*$/,
|
5295 |
+
slice = Array.prototype.slice,
|
5296 |
+
POS = jQuery.expr.match.POS,
|
5297 |
+
// methods guaranteed to produce a unique set when starting from a unique set
|
5298 |
+
guaranteedUnique = {
|
5299 |
+
children: true,
|
5300 |
+
contents: true,
|
5301 |
+
next: true,
|
5302 |
+
prev: true
|
5303 |
+
};
|
5304 |
+
|
5305 |
+
jQuery.fn.extend({
|
5306 |
+
find: function( selector ) {
|
5307 |
+
var self = this,
|
5308 |
+
i, l;
|
5309 |
+
|
5310 |
+
if ( typeof selector !== "string" ) {
|
5311 |
+
return jQuery( selector ).filter(function() {
|
5312 |
+
for ( i = 0, l = self.length; i < l; i++ ) {
|
5313 |
+
if ( jQuery.contains( self[ i ], this ) ) {
|
5314 |
+
return true;
|
5315 |
+
}
|
5316 |
+
}
|
5317 |
+
});
|
5318 |
+
}
|
5319 |
+
|
5320 |
+
var ret = this.pushStack( "", "find", selector ),
|
5321 |
+
length, n, r;
|
5322 |
+
|
5323 |
+
for ( i = 0, l = this.length; i < l; i++ ) {
|
5324 |
+
length = ret.length;
|
5325 |
+
jQuery.find( selector, this[i], ret );
|
5326 |
+
|
5327 |
+
if ( i > 0 ) {
|
5328 |
+
// Make sure that the results are unique
|
5329 |
+
for ( n = length; n < ret.length; n++ ) {
|
5330 |
+
for ( r = 0; r < length; r++ ) {
|
5331 |
+
if ( ret[r] === ret[n] ) {
|
5332 |
+
ret.splice(n--, 1);
|
5333 |
+
break;
|
5334 |
+
}
|
5335 |
+
}
|
5336 |
+
}
|
5337 |
+
}
|
5338 |
+
}
|
5339 |
+
|
5340 |
+
return ret;
|
5341 |
+
},
|
5342 |
+
|
5343 |
+
has: function( target ) {
|
5344 |
+
var targets = jQuery( target );
|
5345 |
+
return this.filter(function() {
|
5346 |
+
for ( var i = 0, l = targets.length; i < l; i++ ) {
|
5347 |
+
if ( jQuery.contains( this, targets[i] ) ) {
|
5348 |
+
return true;
|
5349 |
+
}
|
5350 |
+
}
|
5351 |
+
});
|
5352 |
+
},
|
5353 |
+
|
5354 |
+
not: function( selector ) {
|
5355 |
+
return this.pushStack( winnow(this, selector, false), "not", selector);
|
5356 |
+
},
|
5357 |
+
|
5358 |
+
filter: function( selector ) {
|
5359 |
+
return this.pushStack( winnow(this, selector, true), "filter", selector );
|
5360 |
+
},
|
5361 |
+
|
5362 |
+
is: function( selector ) {
|
5363 |
+
return !!selector && (
|
5364 |
+
typeof selector === "string" ?
|
5365 |
+
// If this is a positional selector, check membership in the returned set
|
5366 |
+
// so $("p:first").is("p:last") won't return true for a doc with two "p".
|
5367 |
+
POS.test( selector ) ?
|
5368 |
+
jQuery( selector, this.context ).index( this[0] ) >= 0 :
|
5369 |
+
jQuery.filter( selector, this ).length > 0 :
|
5370 |
+
this.filter( selector ).length > 0 );
|
5371 |
+
},
|
5372 |
+
|
5373 |
+
closest: function( selectors, context ) {
|
5374 |
+
var ret = [], i, l, cur = this[0];
|
5375 |
+
|
5376 |
+
// Array (deprecated as of jQuery 1.7)
|
5377 |
+
if ( jQuery.isArray( selectors ) ) {
|
5378 |
+
var level = 1;
|
5379 |
+
|
5380 |
+
while ( cur && cur.ownerDocument && cur !== context ) {
|
5381 |
+
for ( i = 0; i < selectors.length; i++ ) {
|
5382 |
+
|
5383 |
+
if ( jQuery( cur ).is( selectors[ i ] ) ) {
|
5384 |
+
ret.push({ selector: selectors[ i ], elem: cur, level: level });
|
5385 |
+
}
|
5386 |
+
}
|
5387 |
+
|
5388 |
+
cur = cur.parentNode;
|
5389 |
+
level++;
|
5390 |
+
}
|
5391 |
+
|
5392 |
+
return ret;
|
5393 |
+
}
|
5394 |
+
|
5395 |
+
// String
|
5396 |
+
var pos = POS.test( selectors ) || typeof selectors !== "string" ?
|
5397 |
+
jQuery( selectors, context || this.context ) :
|
5398 |
+
0;
|
5399 |
+
|
5400 |
+
for ( i = 0, l = this.length; i < l; i++ ) {
|
5401 |
+
cur = this[i];
|
5402 |
+
|
5403 |
+
while ( cur ) {
|
5404 |
+
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
|
5405 |
+
ret.push( cur );
|
5406 |
+
break;
|
5407 |
+
|
5408 |
+
} else {
|
5409 |
+
cur = cur.parentNode;
|
5410 |
+
if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
|
5411 |
+
break;
|
5412 |
+
}
|
5413 |
+
}
|
5414 |
+
}
|
5415 |
+
}
|
5416 |
+
|
5417 |
+
ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
|
5418 |
+
|
5419 |
+
return this.pushStack( ret, "closest", selectors );
|
5420 |
+
},
|
5421 |
+
|
5422 |
+
// Determine the position of an element within
|
5423 |
+
// the matched set of elements
|
5424 |
+
index: function( elem ) {
|
5425 |
+
|
5426 |
+
// No argument, return index in parent
|
5427 |
+
if ( !elem ) {
|
5428 |
+
return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
|
5429 |
+
}
|
5430 |
+
|
5431 |
+
// index in selector
|
5432 |
+
if ( typeof elem === "string" ) {
|
5433 |
+
return jQuery.inArray( this[0], jQuery( elem ) );
|
5434 |
+
}
|
5435 |
+
|
5436 |
+
// Locate the position of the desired element
|
5437 |
+
return jQuery.inArray(
|
5438 |
+
// If it receives a jQuery object, the first element is used
|
5439 |
+
elem.jquery ? elem[0] : elem, this );
|
5440 |
+
},
|
5441 |
+
|
5442 |
+
add: function( selector, context ) {
|
5443 |
+
var set = typeof selector === "string" ?
|
5444 |
+
jQuery( selector, context ) :
|
5445 |
+
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
|
5446 |
+
all = jQuery.merge( this.get(), set );
|
5447 |
+
|
5448 |
+
return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
|
5449 |
+
all :
|
5450 |
+
jQuery.unique( all ) );
|
5451 |
+
},
|
5452 |
+
|
5453 |
+
andSelf: function() {
|
5454 |
+
return this.add( this.prevObject );
|
5455 |
+
}
|
5456 |
+
});
|
5457 |
+
|
5458 |
+
// A painfully simple check to see if an element is disconnected
|
5459 |
+
// from a document (should be improved, where feasible).
|
5460 |
+
function isDisconnected( node ) {
|
5461 |
+
return !node || !node.parentNode || node.parentNode.nodeType === 11;
|
5462 |
+
}
|
5463 |
+
|
5464 |
+
jQuery.each({
|
5465 |
+
parent: function( elem ) {
|
5466 |
+
var parent = elem.parentNode;
|
5467 |
+
return parent && parent.nodeType !== 11 ? parent : null;
|
5468 |
+
},
|
5469 |
+
parents: function( elem ) {
|
5470 |
+
return jQuery.dir( elem, "parentNode" );
|
5471 |
+
},
|
5472 |
+
parentsUntil: function( elem, i, until ) {
|
5473 |
+
return jQuery.dir( elem, "parentNode", until );
|
5474 |
+
},
|
5475 |
+
next: function( elem ) {
|
5476 |
+
return jQuery.nth( elem, 2, "nextSibling" );
|
5477 |
+
},
|
5478 |
+
prev: function( elem ) {
|
5479 |
+
return jQuery.nth( elem, 2, "previousSibling" );
|
5480 |
+
},
|
5481 |
+
nextAll: function( elem ) {
|
5482 |
+
return jQuery.dir( elem, "nextSibling" );
|
5483 |
+
},
|
5484 |
+
prevAll: function( elem ) {
|
5485 |
+
return jQuery.dir( elem, "previousSibling" );
|
5486 |
+
},
|
5487 |
+
nextUntil: function( elem, i, until ) {
|
5488 |
+
return jQuery.dir( elem, "nextSibling", until );
|
5489 |
+
},
|
5490 |
+
prevUntil: function( elem, i, until ) {
|
5491 |
+
return jQuery.dir( elem, "previousSibling", until );
|
5492 |
+
},
|
5493 |
+
siblings: function( elem ) {
|
5494 |
+
return jQuery.sibling( elem.parentNode.firstChild, elem );
|
5495 |
+
},
|
5496 |
+
children: function( elem ) {
|
5497 |
+
return jQuery.sibling( elem.firstChild );
|
5498 |
+
},
|
5499 |
+
contents: function( elem ) {
|
5500 |
+
return jQuery.nodeName( elem, "iframe" ) ?
|
5501 |
+
elem.contentDocument || elem.contentWindow.document :
|
5502 |
+
jQuery.makeArray( elem.childNodes );
|
5503 |
+
}
|
5504 |
+
}, function( name, fn ) {
|
5505 |
+
jQuery.fn[ name ] = function( until, selector ) {
|
5506 |
+
var ret = jQuery.map( this, fn, until );
|
5507 |
+
|
5508 |
+
if ( !runtil.test( name ) ) {
|
5509 |
+
selector = until;
|
5510 |
+
}
|
5511 |
+
|
5512 |
+
if ( selector && typeof selector === "string" ) {
|
5513 |
+
ret = jQuery.filter( selector, ret );
|
5514 |
+
}
|
5515 |
+
|
5516 |
+
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
|
5517 |
+
|
5518 |
+
if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
|
5519 |
+
ret = ret.reverse();
|
5520 |
+
}
|
5521 |
+
|
5522 |
+
return this.pushStack( ret, name, slice.call( arguments ).join(",") );
|
5523 |
+
};
|
5524 |
+
});
|
5525 |
+
|
5526 |
+
jQuery.extend({
|
5527 |
+
filter: function( expr, elems, not ) {
|
5528 |
+
if ( not ) {
|
5529 |
+
expr = ":not(" + expr + ")";
|
5530 |
+
}
|
5531 |
+
|
5532 |
+
return elems.length === 1 ?
|
5533 |
+
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
|
5534 |
+
jQuery.find.matches(expr, elems);
|
5535 |
+
},
|
5536 |
+
|
5537 |
+
dir: function( elem, dir, until ) {
|
5538 |
+
var matched = [],
|
5539 |
+
cur = elem[ dir ];
|
5540 |
+
|
5541 |
+
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
|
5542 |
+
if ( cur.nodeType === 1 ) {
|
5543 |
+
matched.push( cur );
|
5544 |
+
}
|
5545 |
+
cur = cur[dir];
|
5546 |
+
}
|
5547 |
+
return matched;
|
5548 |
+
},
|
5549 |
+
|
5550 |
+
nth: function( cur, result, dir, elem ) {
|
5551 |
+
result = result || 1;
|
5552 |
+
var num = 0;
|
5553 |
+
|
5554 |
+
for ( ; cur; cur = cur[dir] ) {
|
5555 |
+
if ( cur.nodeType === 1 && ++num === result ) {
|
5556 |
+
break;
|
5557 |
+
}
|
5558 |
+
}
|
5559 |
+
|
5560 |
+
return cur;
|
5561 |
+
},
|
5562 |
+
|
5563 |
+
sibling: function( n, elem ) {
|
5564 |
+
var r = [];
|
5565 |
+
|
5566 |
+
for ( ; n; n = n.nextSibling ) {
|
5567 |
+
if ( n.nodeType === 1 && n !== elem ) {
|
5568 |
+
r.push( n );
|
5569 |
+
}
|
5570 |
+
}
|
5571 |
+
|
5572 |
+
return r;
|
5573 |
+
}
|
5574 |
+
});
|
5575 |
+
|
5576 |
+
// Implement the identical functionality for filter and not
|
5577 |
+
function winnow( elements, qualifier, keep ) {
|
5578 |
+
|
5579 |
+
// Can't pass null or undefined to indexOf in Firefox 4
|
5580 |
+
// Set to 0 to skip string check
|
5581 |
+
qualifier = qualifier || 0;
|
5582 |
+
|
5583 |
+
if ( jQuery.isFunction( qualifier ) ) {
|
5584 |
+
return jQuery.grep(elements, function( elem, i ) {
|
5585 |
+
var retVal = !!qualifier.call( elem, i, elem );
|
5586 |
+
return retVal === keep;
|
5587 |
+
});
|
5588 |
+
|
5589 |
+
} else if ( qualifier.nodeType ) {
|
5590 |
+
return jQuery.grep(elements, function( elem, i ) {
|
5591 |
+
return ( elem === qualifier ) === keep;
|
5592 |
+
});
|
5593 |
+
|
5594 |
+
} else if ( typeof qualifier === "string" ) {
|
5595 |
+
var filtered = jQuery.grep(elements, function( elem ) {
|
5596 |
+
return elem.nodeType === 1;
|
5597 |
+
});
|
5598 |
+
|
5599 |
+
if ( isSimple.test( qualifier ) ) {
|
5600 |
+
return jQuery.filter(qualifier, filtered, !keep);
|
5601 |
+
} else {
|
5602 |
+
qualifier = jQuery.filter( qualifier, filtered );
|
5603 |
+
}
|
5604 |
+
}
|
5605 |
+
|
5606 |
+
return jQuery.grep(elements, function( elem, i ) {
|
5607 |
+
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
|
5608 |
+
});
|
5609 |
+
}
|
5610 |
+
|
5611 |
+
|
5612 |
+
|
5613 |
+
|
5614 |
+
function createSafeFragment( document ) {
|
5615 |
+
var list = nodeNames.split( "|" ),
|
5616 |
+
safeFrag = document.createDocumentFragment();
|
5617 |
+
|
5618 |
+
if ( safeFrag.createElement ) {
|
5619 |
+
while ( list.length ) {
|
5620 |
+
safeFrag.createElement(
|
5621 |
+
list.pop()
|
5622 |
+
);
|
5623 |
+
}
|
5624 |
+
}
|
5625 |
+
return safeFrag;
|
5626 |
+
}
|
5627 |
+
|
5628 |
+
var nodeNames = "abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|" +
|
5629 |
+
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
|
5630 |
+
rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
|
5631 |
+
rleadingWhitespace = /^\s+/,
|
5632 |
+
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
|
5633 |
+
rtagName = /<([\w:]+)/,
|
5634 |
+
rtbody = /<tbody/i,
|
5635 |
+
rhtml = /<|&#?\w+;/,
|
5636 |
+
rnoInnerhtml = /<(?:script|style)/i,
|
5637 |
+
rnocache = /<(?:script|object|embed|option|style)/i,
|
5638 |
+
rnoshimcache = new RegExp("<(?:" + nodeNames + ")", "i"),
|
5639 |
+
// checked="checked" or checked
|
5640 |
+
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
5641 |
+
rscriptType = /\/(java|ecma)script/i,
|
5642 |
+
rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
|
5643 |
+
wrapMap = {
|
5644 |
+
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
5645 |
+
legend: [ 1, "<fieldset>", "</fieldset>" ],
|
5646 |
+
thead: [ 1, "<table>", "</table>" ],
|
5647 |
+
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
|
5648 |
+
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
|
5649 |
+
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
|
5650 |
+
area: [ 1, "<map>", "</map>" ],
|
5651 |
+
_default: [ 0, "", "" ]
|
5652 |
+
},
|
5653 |
+
safeFragment = createSafeFragment( document );
|
5654 |
+
|
5655 |
+
wrapMap.optgroup = wrapMap.option;
|
5656 |
+
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
5657 |
+
wrapMap.th = wrapMap.td;
|
5658 |
+
|
5659 |
+
// IE can't serialize <link> and <script> tags normally
|
5660 |
+
if ( !jQuery.support.htmlSerialize ) {
|
5661 |
+
wrapMap._default = [ 1, "div<div>", "</div>" ];
|
5662 |
+
}
|
5663 |
+
|
5664 |
+
jQuery.fn.extend({
|
5665 |
+
text: function( text ) {
|
5666 |
+
if ( jQuery.isFunction(text) ) {
|
5667 |
+
return this.each(function(i) {
|
5668 |
+
var self = jQuery( this );
|
5669 |
+
|
5670 |
+
self.text( text.call(this, i, self.text()) );
|
5671 |
+
});
|
5672 |
+
}
|
5673 |
+
|
5674 |
+
if ( typeof text !== "object" && text !== undefined ) {
|
5675 |
+
return this.empty().append( (this[0] && this[0].ownerDocument || document).createTextNode( text ) );
|
5676 |
+
}
|
5677 |
+
|
5678 |
+
return jQuery.text( this );
|
5679 |
+
},
|
5680 |
+
|
5681 |
+
wrapAll: function( html ) {
|
5682 |
+
if ( jQuery.isFunction( html ) ) {
|
5683 |
+
return this.each(function(i) {
|
5684 |
+
jQuery(this).wrapAll( html.call(this, i) );
|
5685 |
+
});
|
5686 |
+
}
|
5687 |
+
|
5688 |
+
if ( this[0] ) {
|
5689 |
+
// The elements to wrap the target around
|
5690 |
+
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
|
5691 |
+
|
5692 |
+
if ( this[0].parentNode ) {
|
5693 |
+
wrap.insertBefore( this[0] );
|
5694 |
+
}
|
5695 |
+
|
5696 |
+
wrap.map(function() {
|
5697 |
+
var elem = this;
|
5698 |
+
|
5699 |
+
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
|
5700 |
+
elem = elem.firstChild;
|
5701 |
+
}
|
5702 |
+
|
5703 |
+
return elem;
|
5704 |
+
}).append( this );
|
5705 |
+
}
|
5706 |
+
|
5707 |
+
return this;
|
5708 |
+
},
|
5709 |
+
|
5710 |
+
wrapInner: function( html ) {
|
5711 |
+
if ( jQuery.isFunction( html ) ) {
|
5712 |
+
return this.each(function(i) {
|
5713 |
+
jQuery(this).wrapInner( html.call(this, i) );
|
5714 |
+
});
|
5715 |
+
}
|
5716 |
+
|
5717 |
+
return this.each(function() {
|
5718 |
+
var self = jQuery( this ),
|
5719 |
+
contents = self.contents();
|
5720 |
+
|
5721 |
+
if ( contents.length ) {
|
5722 |
+
contents.wrapAll( html );
|
5723 |
+
|
5724 |
+
} else {
|
5725 |
+
self.append( html );
|
5726 |
+
}
|
5727 |
+
});
|
5728 |
+
},
|
5729 |
+
|
5730 |
+
wrap: function( html ) {
|
5731 |
+
var isFunction = jQuery.isFunction( html );
|
5732 |
+
|
5733 |
+
return this.each(function(i) {
|
5734 |
+
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
|
5735 |
+
});
|
5736 |
+
},
|
5737 |
+
|
5738 |
+
unwrap: function() {
|
5739 |
+
return this.parent().each(function() {
|
5740 |
+
if ( !jQuery.nodeName( this, "body" ) ) {
|
5741 |
+
jQuery( this ).replaceWith( this.childNodes );
|
5742 |
+
}
|
5743 |
+
}).end();
|
5744 |
+
},
|
5745 |
+
|
5746 |
+
append: function() {
|
5747 |
+
return this.domManip(arguments, true, function( elem ) {
|
5748 |
+
if ( this.nodeType === 1 ) {
|
5749 |
+
this.appendChild( elem );
|
5750 |
+
}
|
5751 |
+
});
|
5752 |
+
},
|
5753 |
+
|
5754 |
+
prepend: function() {
|
5755 |
+
return this.domManip(arguments, true, function( elem ) {
|
5756 |
+
if ( this.nodeType === 1 ) {
|
5757 |
+
this.insertBefore( elem, this.firstChild );
|
5758 |
+
}
|
5759 |
+
});
|
5760 |
+
},
|
5761 |
+
|
5762 |
+
before: function() {
|
5763 |
+
if ( this[0] && this[0].parentNode ) {
|
5764 |
+
return this.domManip(arguments, false, function( elem ) {
|
5765 |
+
this.parentNode.insertBefore( elem, this );
|
5766 |
+
});
|
5767 |
+
} else if ( arguments.length ) {
|
5768 |
+
var set = jQuery.clean( arguments );
|
5769 |
+
set.push.apply( set, this.toArray() );
|
5770 |
+
return this.pushStack( set, "before", arguments );
|
5771 |
+
}
|
5772 |
+
},
|
5773 |
+
|
5774 |
+
after: function() {
|
5775 |
+
if ( this[0] && this[0].parentNode ) {
|
5776 |
+
return this.domManip(arguments, false, function( elem ) {
|
5777 |
+
this.parentNode.insertBefore( elem, this.nextSibling );
|
5778 |
+
});
|
5779 |
+
} else if ( arguments.length ) {
|
5780 |
+
var set = this.pushStack( this, "after", arguments );
|
5781 |
+
set.push.apply( set, jQuery.clean(arguments) );
|
5782 |
+
return set;
|
5783 |
+
}
|
5784 |
+
},
|
5785 |
+
|
5786 |
+
// keepData is for internal use only--do not document
|
5787 |
+
remove: function( selector, keepData ) {
|
5788 |
+
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
|
5789 |
+
if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
|
5790 |
+
if ( !keepData && elem.nodeType === 1 ) {
|
5791 |
+
jQuery.cleanData( elem.getElementsByTagName("*") );
|
5792 |
+
jQuery.cleanData( [ elem ] );
|
5793 |
+
}
|
5794 |
+
|
5795 |
+
if ( elem.parentNode ) {
|
5796 |
+
elem.parentNode.removeChild( elem );
|
5797 |
+
}
|
5798 |
+
}
|
5799 |
+
}
|
5800 |
+
|
5801 |
+
return this;
|
5802 |
+
},
|
5803 |
+
|
5804 |
+
empty: function() {
|
5805 |
+
for ( var i = 0, elem; (elem = this[i]) != null; i++ ) {
|
5806 |
+
// Remove element nodes and prevent memory leaks
|
5807 |
+
if ( elem.nodeType === 1 ) {
|
5808 |
+
jQuery.cleanData( elem.getElementsByTagName("*") );
|
5809 |
+
}
|
5810 |
+
|
5811 |
+
// Remove any remaining nodes
|
5812 |
+
while ( elem.firstChild ) {
|
5813 |
+
elem.removeChild( elem.firstChild );
|
5814 |
+
}
|
5815 |
+
}
|
5816 |
+
|
5817 |
+
return this;
|
5818 |
+
},
|
5819 |
+
|
5820 |
+
clone: function( dataAndEvents, deepDataAndEvents ) {
|
5821 |
+
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
|
5822 |
+
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
|
5823 |
+
|
5824 |
+
return this.map( function () {
|
5825 |
+
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
|
5826 |
+
});
|
5827 |
+
},
|
5828 |
+
|
5829 |
+
html: function( value ) {
|
5830 |
+
if ( value === undefined ) {
|
5831 |
+
return this[0] && this[0].nodeType === 1 ?
|
5832 |
+
this[0].innerHTML.replace(rinlinejQuery, "") :
|
5833 |
+
null;
|
5834 |
+
|
5835 |
+
// See if we can take a shortcut and just use innerHTML
|
5836 |
+
} else if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
|
5837 |
+
(jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value )) &&
|
5838 |
+
!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
|
5839 |
+
|
5840 |
+
value = value.replace(rxhtmlTag, "<$1></$2>");
|
5841 |
+
|
5842 |
+
try {
|
5843 |
+
for ( var i = 0, l = this.length; i < l; i++ ) {
|
5844 |
+
// Remove element nodes and prevent memory leaks
|
5845 |
+
if ( this[i].nodeType === 1 ) {
|
5846 |
+
jQuery.cleanData( this[i].getElementsByTagName("*") );
|
5847 |
+
this[i].innerHTML = value;
|
5848 |
+
}
|
5849 |
+
}
|
5850 |
+
|
5851 |
+
// If using innerHTML throws an exception, use the fallback method
|
5852 |
+
} catch(e) {
|
5853 |
+
this.empty().append( value );
|
5854 |
+
}
|
5855 |
+
|
5856 |
+
} else if ( jQuery.isFunction( value ) ) {
|
5857 |
+
this.each(function(i){
|
5858 |
+
var self = jQuery( this );
|
5859 |
+
|
5860 |
+
self.html( value.call(this, i, self.html()) );
|
5861 |
+
});
|
5862 |
+
|
5863 |
+
} else {
|
5864 |
+
this.empty().append( value );
|
5865 |
+
}
|
5866 |
+
|
5867 |
+
return this;
|
5868 |
+
},
|
5869 |
+
|
5870 |
+
replaceWith: function( value ) {
|
5871 |
+
if ( this[0] && this[0].parentNode ) {
|
5872 |
+
// Make sure that the elements are removed from the DOM before they are inserted
|
5873 |
+
// this can help fix replacing a parent with child elements
|
5874 |
+
if ( jQuery.isFunction( value ) ) {
|
5875 |
+
return this.each(function(i) {
|
5876 |
+
var self = jQuery(this), old = self.html();
|
5877 |
+
self.replaceWith( value.call( this, i, old ) );
|
5878 |
+
});
|
5879 |
+
}
|
5880 |
+
|
5881 |
+
if ( typeof value !== "string" ) {
|
5882 |
+
value = jQuery( value ).detach();
|
5883 |
+
}
|
5884 |
+
|
5885 |
+
return this.each(function() {
|
5886 |
+
var next = this.nextSibling,
|
5887 |
+
parent = this.parentNode;
|
5888 |
+
|
5889 |
+
jQuery( this ).remove();
|
5890 |
+
|
5891 |
+
if ( next ) {
|
5892 |
+
jQuery(next).before( value );
|
5893 |
+
} else {
|
5894 |
+
jQuery(parent).append( value );
|
5895 |
+
}
|
5896 |
+
});
|
5897 |
+
} else {
|
5898 |
+
return this.length ?
|
5899 |
+
this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
|
5900 |
+
this;
|
5901 |
+
}
|
5902 |
+
},
|
5903 |
+
|
5904 |
+
detach: function( selector ) {
|
5905 |
+
return this.remove( selector, true );
|
5906 |
+
},
|
5907 |
+
|
5908 |
+
domManip: function( args, table, callback ) {
|
5909 |
+
var results, first, fragment, parent,
|
5910 |
+
value = args[0],
|
5911 |
+
scripts = [];
|
5912 |
+
|
5913 |
+
// We can't cloneNode fragments that contain checked, in WebKit
|
5914 |
+
if ( !jQuery.support.checkClone && arguments.length === 3 && typeof value === "string" && rchecked.test( value ) ) {
|
5915 |
+
return this.each(function() {
|
5916 |
+
jQuery(this).domManip( args, table, callback, true );
|
5917 |
+
});
|
5918 |
+
}
|
5919 |
+
|
5920 |
+
if ( jQuery.isFunction(value) ) {
|
5921 |
+
return this.each(function(i) {
|
5922 |
+
var self = jQuery(this);
|
5923 |
+
args[0] = value.call(this, i, table ? self.html() : undefined);
|
5924 |
+
self.domManip( args, table, callback );
|
5925 |
+
});
|
5926 |
+
}
|
5927 |
+
|
5928 |
+
if ( this[0] ) {
|
5929 |
+
parent = value && value.parentNode;
|
5930 |
+
|
5931 |
+
// If we're in a fragment, just use that instead of building a new one
|
5932 |
+
if ( jQuery.support.parentNode && parent && parent.nodeType === 11 && parent.childNodes.length === this.length ) {
|
5933 |
+
results = { fragment: parent };
|
5934 |
+
|
5935 |
+
} else {
|
5936 |
+
results = jQuery.buildFragment( args, this, scripts );
|
5937 |
+
}
|
5938 |
+
|
5939 |
+
fragment = results.fragment;
|
5940 |
+
|
5941 |
+
if ( fragment.childNodes.length === 1 ) {
|
5942 |
+
first = fragment = fragment.firstChild;
|
5943 |
+
} else {
|
5944 |
+
first = fragment.firstChild;
|
5945 |
+
}
|
5946 |
+
|
5947 |
+
if ( first ) {
|
5948 |
+
table = table && jQuery.nodeName( first, "tr" );
|
5949 |
+
|
5950 |
+
for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
|
5951 |
+
callback.call(
|
5952 |
+
table ?
|
5953 |
+
root(this[i], first) :
|
5954 |
+
this[i],
|
5955 |
+
// Make sure that we do not leak memory by inadvertently discarding
|
5956 |
+
// the original fragment (which might have attached data) instead of
|
5957 |
+
// using it; in addition, use the original fragment object for the last
|
5958 |
+
// item instead of first because it can end up being emptied incorrectly
|
5959 |
+
// in certain situations (Bug #8070).
|
5960 |
+
// Fragments from the fragment cache must always be cloned and never used
|
5961 |
+
// in place.
|
5962 |
+
results.cacheable || ( l > 1 && i < lastIndex ) ?
|
5963 |
+
jQuery.clone( fragment, true, true ) :
|
5964 |
+
fragment
|
5965 |
+
);
|
5966 |
+
}
|
5967 |
+
}
|
5968 |
+
|
5969 |
+
if ( scripts.length ) {
|
5970 |
+
jQuery.each( scripts, evalScript );
|
5971 |
+
}
|
5972 |
+
}
|
5973 |
+
|
5974 |
+
return this;
|
5975 |
+
}
|
5976 |
+
});
|
5977 |
+
|
5978 |
+
function root( elem, cur ) {
|
5979 |
+
return jQuery.nodeName(elem, "table") ?
|
5980 |
+
(elem.getElementsByTagName("tbody")[0] ||
|
5981 |
+
elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
|
5982 |
+
elem;
|
5983 |
+
}
|
5984 |
+
|
5985 |
+
function cloneCopyEvent( src, dest ) {
|
5986 |
+
|
5987 |
+
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
|
5988 |
+
return;
|
5989 |
+
}
|
5990 |
+
|
5991 |
+
var type, i, l,
|
5992 |
+
oldData = jQuery._data( src ),
|
5993 |
+
curData = jQuery._data( dest, oldData ),
|
5994 |
+
events = oldData.events;
|
5995 |
+
|
5996 |
+
if ( events ) {
|
5997 |
+
delete curData.handle;
|
5998 |
+
curData.events = {};
|
5999 |
+
|
6000 |
+
for ( type in events ) {
|
6001 |
+
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
6002 |
+
jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
|
6003 |
+
}
|
6004 |
+
}
|
6005 |
+
}
|
6006 |
+
|
6007 |
+
// make the cloned public data object a copy from the original
|
6008 |
+
if ( curData.data ) {
|
6009 |
+
curData.data = jQuery.extend( {}, curData.data );
|
6010 |
+
}
|
6011 |
+
}
|
6012 |
+
|
6013 |
+
function cloneFixAttributes( src, dest ) {
|
6014 |
+
var nodeName;
|
6015 |
+
|
6016 |
+
// We do not need to do anything for non-Elements
|
6017 |
+
if ( dest.nodeType !== 1 ) {
|
6018 |
+
return;
|
6019 |
+
}
|
6020 |
+
|
6021 |
+
// clearAttributes removes the attributes, which we don't want,
|
6022 |
+
// but also removes the attachEvent events, which we *do* want
|
6023 |
+
if ( dest.clearAttributes ) {
|
6024 |
+
dest.clearAttributes();
|
6025 |
+
}
|
6026 |
+
|
6027 |
+
// mergeAttributes, in contrast, only merges back on the
|
6028 |
+
// original attributes, not the events
|
6029 |
+
if ( dest.mergeAttributes ) {
|
6030 |
+
dest.mergeAttributes( src );
|
6031 |
+
}
|
6032 |
+
|
6033 |
+
nodeName = dest.nodeName.toLowerCase();
|
6034 |
+
|
6035 |
+
// IE6-8 fail to clone children inside object elements that use
|
6036 |
+
// the proprietary classid attribute value (rather than the type
|
6037 |
+
// attribute) to identify the type of content to display
|
6038 |
+
if ( nodeName === "object" ) {
|
6039 |
+
dest.outerHTML = src.outerHTML;
|
6040 |
+
|
6041 |
+
} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
|
6042 |
+
// IE6-8 fails to persist the checked state of a cloned checkbox
|
6043 |
+
// or radio button. Worse, IE6-7 fail to give the cloned element
|
6044 |
+
// a checked appearance if the defaultChecked value isn't also set
|
6045 |
+
if ( src.checked ) {
|
6046 |
+
dest.defaultChecked = dest.checked = src.checked;
|
6047 |
+
}
|
6048 |
+
|
6049 |
+
// IE6-7 get confused and end up setting the value of a cloned
|
6050 |
+
// checkbox/radio button to an empty string instead of "on"
|
6051 |
+
if ( dest.value !== src.value ) {
|
6052 |
+
dest.value = src.value;
|
6053 |
+
}
|
6054 |
+
|
6055 |
+
// IE6-8 fails to return the selected option to the default selected
|
6056 |
+
// state when cloning options
|
6057 |
+
} else if ( nodeName === "option" ) {
|
6058 |
+
dest.selected = src.defaultSelected;
|
6059 |
+
|
6060 |
+
// IE6-8 fails to set the defaultValue to the correct value when
|
6061 |
+
// cloning other types of input fields
|
6062 |
+
} else if ( nodeName === "input" || nodeName === "textarea" ) {
|
6063 |
+
dest.defaultValue = src.defaultValue;
|
6064 |
+
}
|
6065 |
+
|
6066 |
+
// Event data gets referenced instead of copied if the expando
|
6067 |
+
// gets copied too
|
6068 |
+
dest.removeAttribute( jQuery.expando );
|
6069 |
+
}
|
6070 |
+
|
6071 |
+
jQuery.buildFragment = function( args, nodes, scripts ) {
|
6072 |
+
var fragment, cacheable, cacheresults, doc,
|
6073 |
+
first = args[ 0 ];
|
6074 |
+
|
6075 |
+
// nodes may contain either an explicit document object,
|
6076 |
+
// a jQuery collection or context object.
|
6077 |
+
// If nodes[0] contains a valid object to assign to doc
|
6078 |
+
if ( nodes && nodes[0] ) {
|
6079 |
+
doc = nodes[0].ownerDocument || nodes[0];
|
6080 |
+
}
|
6081 |
+
|
6082 |
+
// Ensure that an attr object doesn't incorrectly stand in as a document object
|
6083 |
+
// Chrome and Firefox seem to allow this to occur and will throw exception
|
6084 |
+
// Fixes #8950
|
6085 |
+
if ( !doc.createDocumentFragment ) {
|
6086 |
+
doc = document;
|
6087 |
+
}
|
6088 |
+
|
6089 |
+
// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
|
6090 |
+
// Cloning options loses the selected state, so don't cache them
|
6091 |
+
// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
|
6092 |
+
// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
|
6093 |
+
// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
|
6094 |
+
if ( args.length === 1 && typeof first === "string" && first.length < 512 && doc === document &&
|
6095 |
+
first.charAt(0) === "<" && !rnocache.test( first ) &&
|
6096 |
+
(jQuery.support.checkClone || !rchecked.test( first )) &&
|
6097 |
+
(jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
|
6098 |
+
|
6099 |
+
cacheable = true;
|
6100 |
+
|
6101 |
+
cacheresults = jQuery.fragments[ first ];
|
6102 |
+
if ( cacheresults && cacheresults !== 1 ) {
|
6103 |
+
fragment = cacheresults;
|
6104 |
+
}
|
6105 |
+
}
|
6106 |
+
|
6107 |
+
if ( !fragment ) {
|
6108 |
+
fragment = doc.createDocumentFragment();
|
6109 |
+
jQuery.clean( args, doc, fragment, scripts );
|
6110 |
+
}
|
6111 |
+
|
6112 |
+
if ( cacheable ) {
|
6113 |
+
jQuery.fragments[ first ] = cacheresults ? fragment : 1;
|
6114 |
+
}
|
6115 |
+
|
6116 |
+
return { fragment: fragment, cacheable: cacheable };
|
6117 |
+
};
|
6118 |
+
|
6119 |
+
jQuery.fragments = {};
|
6120 |
+
|
6121 |
+
jQuery.each({
|
6122 |
+
appendTo: "append",
|
6123 |
+
prependTo: "prepend",
|
6124 |
+
insertBefore: "before",
|
6125 |
+
insertAfter: "after",
|
6126 |
+
replaceAll: "replaceWith"
|
6127 |
+
}, function( name, original ) {
|
6128 |
+
jQuery.fn[ name ] = function( selector ) {
|
6129 |
+
var ret = [],
|
6130 |
+
insert = jQuery( selector ),
|
6131 |
+
parent = this.length === 1 && this[0].parentNode;
|
6132 |
+
|
6133 |
+
if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
|
6134 |
+
insert[ original ]( this[0] );
|
6135 |
+
return this;
|
6136 |
+
|
6137 |
+
} else {
|
6138 |
+
for ( var i = 0, l = insert.length; i < l; i++ ) {
|
6139 |
+
var elems = ( i > 0 ? this.clone(true) : this ).get();
|
6140 |
+
jQuery( insert[i] )[ original ]( elems );
|
6141 |
+
ret = ret.concat( elems );
|
6142 |
+
}
|
6143 |
+
|
6144 |
+
return this.pushStack( ret, name, insert.selector );
|
6145 |
+
}
|
6146 |
+
};
|
6147 |
+
});
|
6148 |
+
|
6149 |
+
function getAll( elem ) {
|
6150 |
+
if ( typeof elem.getElementsByTagName !== "undefined" ) {
|
6151 |
+
return elem.getElementsByTagName( "*" );
|
6152 |
+
|
6153 |
+
} else if ( typeof elem.querySelectorAll !== "undefined" ) {
|
6154 |
+
return elem.querySelectorAll( "*" );
|
6155 |
+
|
6156 |
+
} else {
|
6157 |
+
return [];
|
6158 |
+
}
|
6159 |
+
}
|
6160 |
+
|
6161 |
+
// Used in clean, fixes the defaultChecked property
|
6162 |
+
function fixDefaultChecked( elem ) {
|
6163 |
+
if ( elem.type === "checkbox" || elem.type === "radio" ) {
|
6164 |
+
elem.defaultChecked = elem.checked;
|
6165 |
+
}
|
6166 |
+
}
|
6167 |
+
// Finds all inputs and passes them to fixDefaultChecked
|
6168 |
+
function findInputs( elem ) {
|
6169 |
+
var nodeName = ( elem.nodeName || "" ).toLowerCase();
|
6170 |
+
if ( nodeName === "input" ) {
|
6171 |
+
fixDefaultChecked( elem );
|
6172 |
+
// Skip scripts, get other children
|
6173 |
+
} else if ( nodeName !== "script" && typeof elem.getElementsByTagName !== "undefined" ) {
|
6174 |
+
jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
|
6175 |
+
}
|
6176 |
+
}
|
6177 |
+
|
6178 |
+
// Derived From: http://www.iecss.com/shimprove/javascript/shimprove.1-0-1.js
|
6179 |
+
function shimCloneNode( elem ) {
|
6180 |
+
var div = document.createElement( "div" );
|
6181 |
+
safeFragment.appendChild( div );
|
6182 |
+
|
6183 |
+
div.innerHTML = elem.outerHTML;
|
6184 |
+
return div.firstChild;
|
6185 |
+
}
|
6186 |
+
|
6187 |
+
jQuery.extend({
|
6188 |
+
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
6189 |
+
var srcElements,
|
6190 |
+
destElements,
|
6191 |
+
i,
|
6192 |
+
// IE<=8 does not properly clone detached, unknown element nodes
|
6193 |
+
clone = jQuery.support.html5Clone || !rnoshimcache.test( "<" + elem.nodeName ) ?
|
6194 |
+
elem.cloneNode( true ) :
|
6195 |
+
shimCloneNode( elem );
|
6196 |
+
|
6197 |
+
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
|
6198 |
+
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
6199 |
+
// IE copies events bound via attachEvent when using cloneNode.
|
6200 |
+
// Calling detachEvent on the clone will also remove the events
|
6201 |
+
// from the original. In order to get around this, we use some
|
6202 |
+
// proprietary methods to clear the events. Thanks to MooTools
|
6203 |
+
// guys for this hotness.
|
6204 |
+
|
6205 |
+
cloneFixAttributes( elem, clone );
|
6206 |
+
|
6207 |
+
// Using Sizzle here is crazy slow, so we use getElementsByTagName instead
|
6208 |
+
srcElements = getAll( elem );
|
6209 |
+
destElements = getAll( clone );
|
6210 |
+
|
6211 |
+
// Weird iteration because IE will replace the length property
|
6212 |
+
// with an element if you are cloning the body and one of the
|
6213 |
+
// elements on the page has a name or id of "length"
|
6214 |
+
for ( i = 0; srcElements[i]; ++i ) {
|
6215 |
+
// Ensure that the destination node is not null; Fixes #9587
|
6216 |
+
if ( destElements[i] ) {
|
6217 |
+
cloneFixAttributes( srcElements[i], destElements[i] );
|
6218 |
+
}
|
6219 |
+
}
|
6220 |
+
}
|
6221 |
+
|
6222 |
+
// Copy the events from the original to the clone
|
6223 |
+
if ( dataAndEvents ) {
|
6224 |
+
cloneCopyEvent( elem, clone );
|
6225 |
+
|
6226 |
+
if ( deepDataAndEvents ) {
|
6227 |
+
srcElements = getAll( elem );
|
6228 |
+
destElements = getAll( clone );
|
6229 |
+
|
6230 |
+
for ( i = 0; srcElements[i]; ++i ) {
|
6231 |
+
cloneCopyEvent( srcElements[i], destElements[i] );
|
6232 |
+
}
|
6233 |
+
}
|
6234 |
+
}
|
6235 |
+
|
6236 |
+
srcElements = destElements = null;
|
6237 |
+
|
6238 |
+
// Return the cloned set
|
6239 |
+
return clone;
|
6240 |
+
},
|
6241 |
+
|
6242 |
+
clean: function( elems, context, fragment, scripts ) {
|
6243 |
+
var checkScriptType;
|
6244 |
+
|
6245 |
+
context = context || document;
|
6246 |
+
|
6247 |
+
// !context.createElement fails in IE with an error but returns typeof 'object'
|
6248 |
+
if ( typeof context.createElement === "undefined" ) {
|
6249 |
+
context = context.ownerDocument || context[0] && context[0].ownerDocument || document;
|
6250 |
+
}
|
6251 |
+
|
6252 |
+
var ret = [], j;
|
6253 |
+
|
6254 |
+
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
6255 |
+
if ( typeof elem === "number" ) {
|
6256 |
+
elem += "";
|
6257 |
+
}
|
6258 |
+
|
6259 |
+
if ( !elem ) {
|
6260 |
+
continue;
|
6261 |
+
}
|
6262 |
+
|
6263 |
+
// Convert html string into DOM nodes
|
6264 |
+
if ( typeof elem === "string" ) {
|
6265 |
+
if ( !rhtml.test( elem ) ) {
|
6266 |
+
elem = context.createTextNode( elem );
|
6267 |
+
} else {
|
6268 |
+
// Fix "XHTML"-style tags in all browsers
|
6269 |
+
elem = elem.replace(rxhtmlTag, "<$1></$2>");
|
6270 |
+
|
6271 |
+
// Trim whitespace, otherwise indexOf won't work as expected
|
6272 |
+
var tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase(),
|
6273 |
+
wrap = wrapMap[ tag ] || wrapMap._default,
|
6274 |
+
depth = wrap[0],
|
6275 |
+
div = context.createElement("div");
|
6276 |
+
|
6277 |
+
// Append wrapper element to unknown element safe doc fragment
|
6278 |
+
if ( context === document ) {
|
6279 |
+
// Use the fragment we've already created for this document
|
6280 |
+
safeFragment.appendChild( div );
|
6281 |
+
} else {
|
6282 |
+
// Use a fragment created with the owner document
|
6283 |
+
createSafeFragment( context ).appendChild( div );
|
6284 |
+
}
|
6285 |
+
|
6286 |
+
// Go to html and back, then peel off extra wrappers
|
6287 |
+
div.innerHTML = wrap[1] + elem + wrap[2];
|
6288 |
+
|
6289 |
+
// Move to the right depth
|
6290 |
+
while ( depth-- ) {
|
6291 |
+
div = div.lastChild;
|
6292 |
+
}
|
6293 |
+
|
6294 |
+
// Remove IE's autoinserted <tbody> from table fragments
|
6295 |
+
if ( !jQuery.support.tbody ) {
|
6296 |
+
|
6297 |
+
// String was a <table>, *may* have spurious <tbody>
|
6298 |
+
var hasBody = rtbody.test(elem),
|
6299 |
+
tbody = tag === "table" && !hasBody ?
|
6300 |
+
div.firstChild && div.firstChild.childNodes :
|
6301 |
+
|
6302 |
+
// String was a bare <thead> or <tfoot>
|
6303 |
+
wrap[1] === "<table>" && !hasBody ?
|
6304 |
+
div.childNodes :
|
6305 |
+
[];
|
6306 |
+
|
6307 |
+
for ( j = tbody.length - 1; j >= 0 ; --j ) {
|
6308 |
+
if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
|
6309 |
+
tbody[ j ].parentNode.removeChild( tbody[ j ] );
|
6310 |
+
}
|
6311 |
+
}
|
6312 |
+
}
|
6313 |
+
|
6314 |
+
// IE completely kills leading whitespace when innerHTML is used
|
6315 |
+
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
|
6316 |
+
div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
|
6317 |
+
}
|
6318 |
+
|
6319 |
+
elem = div.childNodes;
|
6320 |
+
}
|
6321 |
+
}
|
6322 |
+
|
6323 |
+
// Resets defaultChecked for any radios and checkboxes
|
6324 |
+
// about to be appended to the DOM in IE 6/7 (#8060)
|
6325 |
+
var len;
|
6326 |
+
if ( !jQuery.support.appendChecked ) {
|
6327 |
+
if ( elem[0] && typeof (len = elem.length) === "number" ) {
|
6328 |
+
for ( j = 0; j < len; j++ ) {
|
6329 |
+
findInputs( elem[j] );
|
6330 |
+
}
|
6331 |
+
} else {
|
6332 |
+
findInputs( elem );
|
6333 |
+
}
|
6334 |
+
}
|
6335 |
+
|
6336 |
+
if ( elem.nodeType ) {
|
6337 |
+
ret.push( elem );
|
6338 |
+
} else {
|
6339 |
+
ret = jQuery.merge( ret, elem );
|
6340 |
+
}
|
6341 |
+
}
|
6342 |
+
|
6343 |
+
if ( fragment ) {
|
6344 |
+
checkScriptType = function( elem ) {
|
6345 |
+
return !elem.type || rscriptType.test( elem.type );
|
6346 |
+
};
|
6347 |
+
for ( i = 0; ret[i]; i++ ) {
|
6348 |
+
if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
|
6349 |
+
scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
|
6350 |
+
|
6351 |
+
} else {
|
6352 |
+
if ( ret[i].nodeType === 1 ) {
|
6353 |
+
var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
|
6354 |
+
|
6355 |
+
ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
|
6356 |
+
}
|
6357 |
+
fragment.appendChild( ret[i] );
|
6358 |
+
}
|
6359 |
+
}
|
6360 |
+
}
|
6361 |
+
|
6362 |
+
return ret;
|
6363 |
+
},
|
6364 |
+
|
6365 |
+
cleanData: function( elems ) {
|
6366 |
+
var data, id,
|
6367 |
+
cache = jQuery.cache,
|
6368 |
+
special = jQuery.event.special,
|
6369 |
+
deleteExpando = jQuery.support.deleteExpando;
|
6370 |
+
|
6371 |
+
for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
|
6372 |
+
if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
|
6373 |
+
continue;
|
6374 |
+
}
|
6375 |
+
|
6376 |
+
id = elem[ jQuery.expando ];
|
6377 |
+
|
6378 |
+
if ( id ) {
|
6379 |
+
data = cache[ id ];
|
6380 |
+
|
6381 |
+
if ( data && data.events ) {
|
6382 |
+
for ( var type in data.events ) {
|
6383 |
+
if ( special[ type ] ) {
|
6384 |
+
jQuery.event.remove( elem, type );
|
6385 |
+
|
6386 |
+
// This is a shortcut to avoid jQuery.event.remove's overhead
|
6387 |
+
} else {
|
6388 |
+
jQuery.removeEvent( elem, type, data.handle );
|
6389 |
+
}
|
6390 |
+
}
|
6391 |
+
|
6392 |
+
// Null the DOM reference to avoid IE6/7/8 leak (#7054)
|
6393 |
+
if ( data.handle ) {
|
6394 |
+
data.handle.elem = null;
|
6395 |
+
}
|
6396 |
+
}
|
6397 |
+
|
6398 |
+
if ( deleteExpando ) {
|
6399 |
+
delete elem[ jQuery.expando ];
|
6400 |
+
|
6401 |
+
} else if ( elem.removeAttribute ) {
|
6402 |
+
elem.removeAttribute( jQuery.expando );
|
6403 |
+
}
|
6404 |
+
|
6405 |
+
delete cache[ id ];
|
6406 |
+
}
|
6407 |
+
}
|
6408 |
+
}
|
6409 |
+
});
|
6410 |
+
|
6411 |
+
function evalScript( i, elem ) {
|
6412 |
+
if ( elem.src ) {
|
6413 |
+
jQuery.ajax({
|
6414 |
+
url: elem.src,
|
6415 |
+
async: false,
|
6416 |
+
dataType: "script"
|
6417 |
+
});
|
6418 |
+
} else {
|
6419 |
+
jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
|
6420 |
+
}
|
6421 |
+
|
6422 |
+
if ( elem.parentNode ) {
|
6423 |
+
elem.parentNode.removeChild( elem );
|
6424 |
+
}
|
6425 |
+
}
|
6426 |
+
|
6427 |
+
|
6428 |
+
|
6429 |
+
|
6430 |
+
var ralpha = /alpha\([^)]*\)/i,
|
6431 |
+
ropacity = /opacity=([^)]*)/,
|
6432 |
+
// fixed for IE9, see #8346
|
6433 |
+
rupper = /([A-Z]|^ms)/g,
|
6434 |
+
rnumpx = /^-?\d+(?:px)?$/i,
|
6435 |
+
rnum = /^-?\d/,
|
6436 |
+
rrelNum = /^([\-+])=([\-+.\de]+)/,
|
6437 |
+
|
6438 |
+
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
6439 |
+
cssWidth = [ "Left", "Right" ],
|
6440 |
+
cssHeight = [ "Top", "Bottom" ],
|
6441 |
+
curCSS,
|
6442 |
+
|
6443 |
+
getComputedStyle,
|
6444 |
+
currentStyle;
|
6445 |
+
|
6446 |
+
jQuery.fn.css = function( name, value ) {
|
6447 |
+
// Setting 'undefined' is a no-op
|
6448 |
+
if ( arguments.length === 2 && value === undefined ) {
|
6449 |
+
return this;
|
6450 |
+
}
|
6451 |
+
|
6452 |
+
return jQuery.access( this, name, value, true, function( elem, name, value ) {
|
6453 |
+
return value !== undefined ?
|
6454 |
+
jQuery.style( elem, name, value ) :
|
6455 |
+
jQuery.css( elem, name );
|
6456 |
+
});
|
6457 |
+
};
|
6458 |
+
|
6459 |
+
jQuery.extend({
|
6460 |
+
// Add in style property hooks for overriding the default
|
6461 |
+
// behavior of getting and setting a style property
|
6462 |
+
cssHooks: {
|
6463 |
+
opacity: {
|
6464 |
+
get: function( elem, computed ) {
|
6465 |
+
if ( computed ) {
|
6466 |
+
// We should always get a number back from opacity
|
6467 |
+
var ret = curCSS( elem, "opacity", "opacity" );
|
6468 |
+
return ret === "" ? "1" : ret;
|
6469 |
+
|
6470 |
+
} else {
|
6471 |
+
return elem.style.opacity;
|
6472 |
+
}
|
6473 |
+
}
|
6474 |
+
}
|
6475 |
+
},
|
6476 |
+
|
6477 |
+
// Exclude the following css properties to add px
|
6478 |
+
cssNumber: {
|
6479 |
+
"fillOpacity": true,
|
6480 |
+
"fontWeight": true,
|
6481 |
+
"lineHeight": true,
|
6482 |
+
"opacity": true,
|
6483 |
+
"orphans": true,
|
6484 |
+
"widows": true,
|
6485 |
+
"zIndex": true,
|
6486 |
+
"zoom": true
|
6487 |
+
},
|
6488 |
+
|
6489 |
+
// Add in properties whose names you wish to fix before
|
6490 |
+
// setting or getting the value
|
6491 |
+
cssProps: {
|
6492 |
+
// normalize float css property
|
6493 |
+
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
|
6494 |
+
},
|
6495 |
+
|
6496 |
+
// Get and set the style property on a DOM Node
|
6497 |
+
style: function( elem, name, value, extra ) {
|
6498 |
+
// Don't set styles on text and comment nodes
|
6499 |
+
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
|
6500 |
+
return;
|
6501 |
+
}
|
6502 |
+
|
6503 |
+
// Make sure that we're working with the right name
|
6504 |
+
var ret, type, origName = jQuery.camelCase( name ),
|
6505 |
+
style = elem.style, hooks = jQuery.cssHooks[ origName ];
|
6506 |
+
|
6507 |
+
name = jQuery.cssProps[ origName ] || origName;
|
6508 |
+
|
6509 |
+
// Check if we're setting a value
|
6510 |
+
if ( value !== undefined ) {
|
6511 |
+
type = typeof value;
|
6512 |
+
|
6513 |
+
// convert relative number strings (+= or -=) to relative numbers. #7345
|
6514 |
+
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
|
6515 |
+
value = ( +( ret[1] + 1) * +ret[2] ) + parseFloat( jQuery.css( elem, name ) );
|
6516 |
+
// Fixes bug #9237
|
6517 |
+
type = "number";
|
6518 |
+
}
|
6519 |
+
|
6520 |
+
// Make sure that NaN and null values aren't set. See: #7116
|
6521 |
+
if ( value == null || type === "number" && isNaN( value ) ) {
|
6522 |
+
return;
|
6523 |
+
}
|
6524 |
+
|
6525 |
+
// If a number was passed in, add 'px' to the (except for certain CSS properties)
|
6526 |
+
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
|
6527 |
+
value += "px";
|
6528 |
+
}
|
6529 |
+
|
6530 |
+
// If a hook was provided, use that value, otherwise just set the specified value
|
6531 |
+
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value )) !== undefined ) {
|
6532 |
+
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
|
6533 |
+
// Fixes bug #5509
|
6534 |
+
try {
|
6535 |
+
style[ name ] = value;
|
6536 |
+
} catch(e) {}
|
6537 |
+
}
|
6538 |
+
|
6539 |
+
} else {
|
6540 |
+
// If a hook was provided get the non-computed value from there
|
6541 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
|
6542 |
+
return ret;
|
6543 |
+
}
|
6544 |
+
|
6545 |
+
// Otherwise just get the value from the style object
|
6546 |
+
return style[ name ];
|
6547 |
+
}
|
6548 |
+
},
|
6549 |
+
|
6550 |
+
css: function( elem, name, extra ) {
|
6551 |
+
var ret, hooks;
|
6552 |
+
|
6553 |
+
// Make sure that we're working with the right name
|
6554 |
+
name = jQuery.camelCase( name );
|
6555 |
+
hooks = jQuery.cssHooks[ name ];
|
6556 |
+
name = jQuery.cssProps[ name ] || name;
|
6557 |
+
|
6558 |
+
// cssFloat needs a special treatment
|
6559 |
+
if ( name === "cssFloat" ) {
|
6560 |
+
name = "float";
|
6561 |
+
}
|
6562 |
+
|
6563 |
+
// If a hook was provided get the computed value from there
|
6564 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
|
6565 |
+
return ret;
|
6566 |
+
|
6567 |
+
// Otherwise, if a way to get the computed value exists, use that
|
6568 |
+
} else if ( curCSS ) {
|
6569 |
+
return curCSS( elem, name );
|
6570 |
+
}
|
6571 |
+
},
|
6572 |
+
|
6573 |
+
// A method for quickly swapping in/out CSS properties to get correct calculations
|
6574 |
+
swap: function( elem, options, callback ) {
|
6575 |
+
var old = {};
|
6576 |
+
|
6577 |
+
// Remember the old values, and insert the new ones
|
6578 |
+
for ( var name in options ) {
|
6579 |
+
old[ name ] = elem.style[ name ];
|
6580 |
+
elem.style[ name ] = options[ name ];
|
6581 |
+
}
|
6582 |
+
|
6583 |
+
callback.call( elem );
|
6584 |
+
|
6585 |
+
// Revert the old values
|
6586 |
+
for ( name in options ) {
|
6587 |
+
elem.style[ name ] = old[ name ];
|
6588 |
+
}
|
6589 |
+
}
|
6590 |
+
});
|
6591 |
+
|
6592 |
+
// DEPRECATED, Use jQuery.css() instead
|
6593 |
+
jQuery.curCSS = jQuery.css;
|
6594 |
+
|
6595 |
+
jQuery.each(["height", "width"], function( i, name ) {
|
6596 |
+
jQuery.cssHooks[ name ] = {
|
6597 |
+
get: function( elem, computed, extra ) {
|
6598 |
+
var val;
|
6599 |
+
|
6600 |
+
if ( computed ) {
|
6601 |
+
if ( elem.offsetWidth !== 0 ) {
|
6602 |
+
return getWH( elem, name, extra );
|
6603 |
+
} else {
|
6604 |
+
jQuery.swap( elem, cssShow, function() {
|
6605 |
+
val = getWH( elem, name, extra );
|
6606 |
+
});
|
6607 |
+
}
|
6608 |
+
|
6609 |
+
return val;
|
6610 |
+
}
|
6611 |
+
},
|
6612 |
+
|
6613 |
+
set: function( elem, value ) {
|
6614 |
+
if ( rnumpx.test( value ) ) {
|
6615 |
+
// ignore negative width and height values #1599
|
6616 |
+
value = parseFloat( value );
|
6617 |
+
|
6618 |
+
if ( value >= 0 ) {
|
6619 |
+
return value + "px";
|
6620 |
+
}
|
6621 |
+
|
6622 |
+
} else {
|
6623 |
+
return value;
|
6624 |
+
}
|
6625 |
+
}
|
6626 |
+
};
|
6627 |
+
});
|
6628 |
+
|
6629 |
+
if ( !jQuery.support.opacity ) {
|
6630 |
+
jQuery.cssHooks.opacity = {
|
6631 |
+
get: function( elem, computed ) {
|
6632 |
+
// IE uses filters for opacity
|
6633 |
+
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
|
6634 |
+
( parseFloat( RegExp.$1 ) / 100 ) + "" :
|
6635 |
+
computed ? "1" : "";
|
6636 |
+
},
|
6637 |
+
|
6638 |
+
set: function( elem, value ) {
|
6639 |
+
var style = elem.style,
|
6640 |
+
currentStyle = elem.currentStyle,
|
6641 |
+
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
|
6642 |
+
filter = currentStyle && currentStyle.filter || style.filter || "";
|
6643 |
+
|
6644 |
+
// IE has trouble with opacity if it does not have layout
|
6645 |
+
// Force it by setting the zoom level
|
6646 |
+
style.zoom = 1;
|
6647 |
+
|
6648 |
+
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
|
6649 |
+
if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" ) {
|
6650 |
+
|
6651 |
+
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
|
6652 |
+
// if "filter:" is present at all, clearType is disabled, we want to avoid this
|
6653 |
+
// style.removeAttribute is IE Only, but so apparently is this code path...
|
6654 |
+
style.removeAttribute( "filter" );
|
6655 |
+
|
6656 |
+
// if there there is no filter style applied in a css rule, we are done
|
6657 |
+
if ( currentStyle && !currentStyle.filter ) {
|
6658 |
+
return;
|
6659 |
+
}
|
6660 |
+
}
|
6661 |
+
|
6662 |
+
// otherwise, set new filter values
|
6663 |
+
style.filter = ralpha.test( filter ) ?
|
6664 |
+
filter.replace( ralpha, opacity ) :
|
6665 |
+
filter + " " + opacity;
|
6666 |
+
}
|
6667 |
+
};
|
6668 |
+
}
|
6669 |
+
|
6670 |
+
jQuery(function() {
|
6671 |
+
// This hook cannot be added until DOM ready because the support test
|
6672 |
+
// for it is not run until after DOM ready
|
6673 |
+
if ( !jQuery.support.reliableMarginRight ) {
|
6674 |
+
jQuery.cssHooks.marginRight = {
|
6675 |
+
get: function( elem, computed ) {
|
6676 |
+
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
6677 |
+
// Work around by temporarily setting element display to inline-block
|
6678 |
+
var ret;
|
6679 |
+
jQuery.swap( elem, { "display": "inline-block" }, function() {
|
6680 |
+
if ( computed ) {
|
6681 |
+
ret = curCSS( elem, "margin-right", "marginRight" );
|
6682 |
+
} else {
|
6683 |
+
ret = elem.style.marginRight;
|
6684 |
+
}
|
6685 |
+
});
|
6686 |
+
return ret;
|
6687 |
+
}
|
6688 |
+
};
|
6689 |
+
}
|
6690 |
+
});
|
6691 |
+
|
6692 |
+
if ( document.defaultView && document.defaultView.getComputedStyle ) {
|
6693 |
+
getComputedStyle = function( elem, name ) {
|
6694 |
+
var ret, defaultView, computedStyle;
|
6695 |
+
|
6696 |
+
name = name.replace( rupper, "-$1" ).toLowerCase();
|
6697 |
+
|
6698 |
+
if ( (defaultView = elem.ownerDocument.defaultView) &&
|
6699 |
+
(computedStyle = defaultView.getComputedStyle( elem, null )) ) {
|
6700 |
+
ret = computedStyle.getPropertyValue( name );
|
6701 |
+
if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
|
6702 |
+
ret = jQuery.style( elem, name );
|
6703 |
+
}
|
6704 |
+
}
|
6705 |
+
|
6706 |
+
return ret;
|
6707 |
+
};
|
6708 |
+
}
|
6709 |
+
|
6710 |
+
if ( document.documentElement.currentStyle ) {
|
6711 |
+
currentStyle = function( elem, name ) {
|
6712 |
+
var left, rsLeft, uncomputed,
|
6713 |
+
ret = elem.currentStyle && elem.currentStyle[ name ],
|
6714 |
+
style = elem.style;
|
6715 |
+
|
6716 |
+
// Avoid setting ret to empty string here
|
6717 |
+
// so we don't default to auto
|
6718 |
+
if ( ret === null && style && (uncomputed = style[ name ]) ) {
|
6719 |
+
ret = uncomputed;
|
6720 |
+
}
|
6721 |
+
|
6722 |
+
// From the awesome hack by Dean Edwards
|
6723 |
+
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
|
6724 |
+
|
6725 |
+
// If we're not dealing with a regular pixel number
|
6726 |
+
// but a number that has a weird ending, we need to convert it to pixels
|
6727 |
+
if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
|
6728 |
+
|
6729 |
+
// Remember the original values
|
6730 |
+
left = style.left;
|
6731 |
+
rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
|
6732 |
+
|
6733 |
+
// Put in the new values to get a computed value out
|
6734 |
+
if ( rsLeft ) {
|
6735 |
+
elem.runtimeStyle.left = elem.currentStyle.left;
|
6736 |
+
}
|
6737 |
+
style.left = name === "fontSize" ? "1em" : ( ret || 0 );
|
6738 |
+
ret = style.pixelLeft + "px";
|
6739 |
+
|
6740 |
+
// Revert the changed values
|
6741 |
+
style.left = left;
|
6742 |
+
if ( rsLeft ) {
|
6743 |
+
elem.runtimeStyle.left = rsLeft;
|
6744 |
+
}
|
6745 |
+
}
|
6746 |
+
|
6747 |
+
return ret === "" ? "auto" : ret;
|
6748 |
+
};
|
6749 |
+
}
|
6750 |
+
|
6751 |
+
curCSS = getComputedStyle || currentStyle;
|
6752 |
+
|
6753 |
+
function getWH( elem, name, extra ) {
|
6754 |
+
|
6755 |
+
// Start with offset property
|
6756 |
+
var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
6757 |
+
which = name === "width" ? cssWidth : cssHeight,
|
6758 |
+
i = 0,
|
6759 |
+
len = which.length;
|
6760 |
+
|
6761 |
+
if ( val > 0 ) {
|
6762 |
+
if ( extra !== "border" ) {
|
6763 |
+
for ( ; i < len; i++ ) {
|
6764 |
+
if ( !extra ) {
|
6765 |
+
val -= parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
|
6766 |
+
}
|
6767 |
+
if ( extra === "margin" ) {
|
6768 |
+
val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
|
6769 |
+
} else {
|
6770 |
+
val -= parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
|
6771 |
+
}
|
6772 |
+
}
|
6773 |
+
}
|
6774 |
+
|
6775 |
+
return val + "px";
|
6776 |
+
}
|
6777 |
+
|
6778 |
+
// Fall back to computed then uncomputed css if necessary
|
6779 |
+
val = curCSS( elem, name, name );
|
6780 |
+
if ( val < 0 || val == null ) {
|
6781 |
+
val = elem.style[ name ] || 0;
|
6782 |
+
}
|
6783 |
+
// Normalize "", auto, and prepare for extra
|
6784 |
+
val = parseFloat( val ) || 0;
|
6785 |
+
|
6786 |
+
// Add padding, border, margin
|
6787 |
+
if ( extra ) {
|
6788 |
+
for ( ; i < len; i++ ) {
|
6789 |
+
val += parseFloat( jQuery.css( elem, "padding" + which[ i ] ) ) || 0;
|
6790 |
+
if ( extra !== "padding" ) {
|
6791 |
+
val += parseFloat( jQuery.css( elem, "border" + which[ i ] + "Width" ) ) || 0;
|
6792 |
+
}
|
6793 |
+
if ( extra === "margin" ) {
|
6794 |
+
val += parseFloat( jQuery.css( elem, extra + which[ i ] ) ) || 0;
|
6795 |
+
}
|
6796 |
+
}
|
6797 |
+
}
|
6798 |
+
|
6799 |
+
return val + "px";
|
6800 |
+
}
|
6801 |
+
|
6802 |
+
if ( jQuery.expr && jQuery.expr.filters ) {
|
6803 |
+
jQuery.expr.filters.hidden = function( elem ) {
|
6804 |
+
var width = elem.offsetWidth,
|
6805 |
+
height = elem.offsetHeight;
|
6806 |
+
|
6807 |
+
return ( width === 0 && height === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
6808 |
+
};
|
6809 |
+
|
6810 |
+
jQuery.expr.filters.visible = function( elem ) {
|
6811 |
+
return !jQuery.expr.filters.hidden( elem );
|
6812 |
+
};
|
6813 |
+
}
|
6814 |
+
|
6815 |
+
|
6816 |
+
|
6817 |
+
|
6818 |
+
var r20 = /%20/g,
|
6819 |
+
rbracket = /\[\]$/,
|
6820 |
+
rCRLF = /\r?\n/g,
|
6821 |
+
rhash = /#.*$/,
|
6822 |
+
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
6823 |
+
rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
|
6824 |
+
// #7653, #8125, #8152: local protocol detection
|
6825 |
+
rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
|
6826 |
+
rnoContent = /^(?:GET|HEAD)$/,
|
6827 |
+
rprotocol = /^\/\//,
|
6828 |
+
rquery = /\?/,
|
6829 |
+
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
6830 |
+
rselectTextarea = /^(?:select|textarea)/i,
|
6831 |
+
rspacesAjax = /\s+/,
|
6832 |
+
rts = /([?&])_=[^&]*/,
|
6833 |
+
rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
|
6834 |
+
|
6835 |
+
// Keep a copy of the old load method
|
6836 |
+
_load = jQuery.fn.load,
|
6837 |
+
|
6838 |
+
/* Prefilters
|
6839 |
+
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
|
6840 |
+
* 2) These are called:
|
6841 |
+
* - BEFORE asking for a transport
|
6842 |
+
* - AFTER param serialization (s.data is a string if s.processData is true)
|
6843 |
+
* 3) key is the dataType
|
6844 |
+
* 4) the catchall symbol "*" can be used
|
6845 |
+
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
|
6846 |
+
*/
|
6847 |
+
prefilters = {},
|
6848 |
+
|
6849 |
+
/* Transports bindings
|
6850 |
+
* 1) key is the dataType
|
6851 |
+
* 2) the catchall symbol "*" can be used
|
6852 |
+
* 3) selection will start with transport dataType and THEN go to "*" if needed
|
6853 |
+
*/
|
6854 |
+
transports = {},
|
6855 |
+
|
6856 |
+
// Document location
|
6857 |
+
ajaxLocation,
|
6858 |
+
|
6859 |
+
// Document location segments
|
6860 |
+
ajaxLocParts,
|
6861 |
+
|
6862 |
+
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
6863 |
+
allTypes = ["*/"] + ["*"];
|
6864 |
+
|
6865 |
+
// #8138, IE may throw an exception when accessing
|
6866 |
+
// a field from window.location if document.domain has been set
|
6867 |
+
try {
|
6868 |
+
ajaxLocation = location.href;
|
6869 |
+
} catch( e ) {
|
6870 |
+
// Use the href attribute of an A element
|
6871 |
+
// since IE will modify it given document.location
|
6872 |
+
ajaxLocation = document.createElement( "a" );
|
6873 |
+
ajaxLocation.href = "";
|
6874 |
+
ajaxLocation = ajaxLocation.href;
|
6875 |
+
}
|
6876 |
+
|
6877 |
+
// Segment location into parts
|
6878 |
+
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
|
6879 |
+
|
6880 |
+
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
6881 |
+
function addToPrefiltersOrTransports( structure ) {
|
6882 |
+
|
6883 |
+
// dataTypeExpression is optional and defaults to "*"
|
6884 |
+
return function( dataTypeExpression, func ) {
|
6885 |
+
|
6886 |
+
if ( typeof dataTypeExpression !== "string" ) {
|
6887 |
+
func = dataTypeExpression;
|
6888 |
+
dataTypeExpression = "*";
|
6889 |
+
}
|
6890 |
+
|
6891 |
+
if ( jQuery.isFunction( func ) ) {
|
6892 |
+
var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
|
6893 |
+
i = 0,
|
6894 |
+
length = dataTypes.length,
|
6895 |
+
dataType,
|
6896 |
+
list,
|
6897 |
+
placeBefore;
|
6898 |
+
|
6899 |
+
// For each dataType in the dataTypeExpression
|
6900 |
+
for ( ; i < length; i++ ) {
|
6901 |
+
dataType = dataTypes[ i ];
|
6902 |
+
// We control if we're asked to add before
|
6903 |
+
// any existing element
|
6904 |
+
placeBefore = /^\+/.test( dataType );
|
6905 |
+
if ( placeBefore ) {
|
6906 |
+
dataType = dataType.substr( 1 ) || "*";
|
6907 |
+
}
|
6908 |
+
list = structure[ dataType ] = structure[ dataType ] || [];
|
6909 |
+
// then we add to the structure accordingly
|
6910 |
+
list[ placeBefore ? "unshift" : "push" ]( func );
|
6911 |
+
}
|
6912 |
+
}
|
6913 |
+
};
|
6914 |
+
}
|
6915 |
+
|
6916 |
+
// Base inspection function for prefilters and transports
|
6917 |
+
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
|
6918 |
+
dataType /* internal */, inspected /* internal */ ) {
|
6919 |
+
|
6920 |
+
dataType = dataType || options.dataTypes[ 0 ];
|
6921 |
+
inspected = inspected || {};
|
6922 |
+
|
6923 |
+
inspected[ dataType ] = true;
|
6924 |
+
|
6925 |
+
var list = structure[ dataType ],
|
6926 |
+
i = 0,
|
6927 |
+
length = list ? list.length : 0,
|
6928 |
+
executeOnly = ( structure === prefilters ),
|
6929 |
+
selection;
|
6930 |
+
|
6931 |
+
for ( ; i < length && ( executeOnly || !selection ); i++ ) {
|
6932 |
+
selection = list[ i ]( options, originalOptions, jqXHR );
|
6933 |
+
// If we got redirected to another dataType
|
6934 |
+
// we try there if executing only and not done already
|
6935 |
+
if ( typeof selection === "string" ) {
|
6936 |
+
if ( !executeOnly || inspected[ selection ] ) {
|
6937 |
+
selection = undefined;
|
6938 |
+
} else {
|
6939 |
+
options.dataTypes.unshift( selection );
|
6940 |
+
selection = inspectPrefiltersOrTransports(
|
6941 |
+
structure, options, originalOptions, jqXHR, selection, inspected );
|
6942 |
+
}
|
6943 |
+
}
|
6944 |
+
}
|
6945 |
+
// If we're only executing or nothing was selected
|
6946 |
+
// we try the catchall dataType if not done already
|
6947 |
+
if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
|
6948 |
+
selection = inspectPrefiltersOrTransports(
|
6949 |
+
structure, options, originalOptions, jqXHR, "*", inspected );
|
6950 |
+
}
|
6951 |
+
// unnecessary when only executing (prefilters)
|
6952 |
+
// but it'll be ignored by the caller in that case
|
6953 |
+
return selection;
|
6954 |
+
}
|
6955 |
+
|
6956 |
+
// A special extend for ajax options
|
6957 |
+
// that takes "flat" options (not to be deep extended)
|
6958 |
+
// Fixes #9887
|
6959 |
+
function ajaxExtend( target, src ) {
|
6960 |
+
var key, deep,
|
6961 |
+
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
6962 |
+
for ( key in src ) {
|
6963 |
+
if ( src[ key ] !== undefined ) {
|
6964 |
+
( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
|
6965 |
+
}
|
6966 |
+
}
|
6967 |
+
if ( deep ) {
|
6968 |
+
jQuery.extend( true, target, deep );
|
6969 |
+
}
|
6970 |
+
}
|
6971 |
+
|
6972 |
+
jQuery.fn.extend({
|
6973 |
+
load: function( url, params, callback ) {
|
6974 |
+
if ( typeof url !== "string" && _load ) {
|
6975 |
+
return _load.apply( this, arguments );
|
6976 |
+
|
6977 |
+
// Don't do a request if no elements are being requested
|
6978 |
+
} else if ( !this.length ) {
|
6979 |
+
return this;
|
6980 |
+
}
|
6981 |
+
|
6982 |
+
var off = url.indexOf( " " );
|
6983 |
+
if ( off >= 0 ) {
|
6984 |
+
var selector = url.slice( off, url.length );
|
6985 |
+
url = url.slice( 0, off );
|
6986 |
+
}
|
6987 |
+
|
6988 |
+
// Default to a GET request
|
6989 |
+
var type = "GET";
|
6990 |
+
|
6991 |
+
// If the second parameter was provided
|
6992 |
+
if ( params ) {
|
6993 |
+
// If it's a function
|
6994 |
+
if ( jQuery.isFunction( params ) ) {
|
6995 |
+
// We assume that it's the callback
|
6996 |
+
callback = params;
|
6997 |
+
params = undefined;
|
6998 |
+
|
6999 |
+
// Otherwise, build a param string
|
7000 |
+
} else if ( typeof params === "object" ) {
|
7001 |
+
params = jQuery.param( params, jQuery.ajaxSettings.traditional );
|
7002 |
+
type = "POST";
|
7003 |
+
}
|
7004 |
+
}
|
7005 |
+
|
7006 |
+
var self = this;
|
7007 |
+
|
7008 |
+
// Request the remote document
|
7009 |
+
jQuery.ajax({
|
7010 |
+
url: url,
|
7011 |
+
type: type,
|
7012 |
+
dataType: "html",
|
7013 |
+
data: params,
|
7014 |
+
// Complete callback (responseText is used internally)
|
7015 |
+
complete: function( jqXHR, status, responseText ) {
|
7016 |
+
// Store the response as specified by the jqXHR object
|
7017 |
+
responseText = jqXHR.responseText;
|
7018 |
+
// If successful, inject the HTML into all the matched elements
|
7019 |
+
if ( jqXHR.isResolved() ) {
|
7020 |
+
// #4825: Get the actual response in case
|
7021 |
+
// a dataFilter is present in ajaxSettings
|
7022 |
+
jqXHR.done(function( r ) {
|
7023 |
+
responseText = r;
|
7024 |
+
});
|
7025 |
+
// See if a selector was specified
|
7026 |
+
self.html( selector ?
|
7027 |
+
// Create a dummy div to hold the results
|
7028 |
+
jQuery("<div>")
|
7029 |
+
// inject the contents of the document in, removing the scripts
|
7030 |
+
// to avoid any 'Permission Denied' errors in IE
|
7031 |
+
.append(responseText.replace(rscript, ""))
|
7032 |
+
|
7033 |
+
// Locate the specified elements
|
7034 |
+
.find(selector) :
|
7035 |
+
|
7036 |
+
// If not, just inject the full result
|
7037 |
+
responseText );
|
7038 |
+
}
|
7039 |
+
|
7040 |
+
if ( callback ) {
|
7041 |
+
self.each( callback, [ responseText, status, jqXHR ] );
|
7042 |
+
}
|
7043 |
+
}
|
7044 |
+
});
|
7045 |
+
|
7046 |
+
return this;
|
7047 |
+
},
|
7048 |
+
|
7049 |
+
serialize: function() {
|
7050 |
+
return jQuery.param( this.serializeArray() );
|
7051 |
+
},
|
7052 |
+
|
7053 |
+
serializeArray: function() {
|
7054 |
+
return this.map(function(){
|
7055 |
+
return this.elements ? jQuery.makeArray( this.elements ) : this;
|
7056 |
+
})
|
7057 |
+
.filter(function(){
|
7058 |
+
return this.name && !this.disabled &&
|
7059 |
+
( this.checked || rselectTextarea.test( this.nodeName ) ||
|
7060 |
+
rinput.test( this.type ) );
|
7061 |
+
})
|
7062 |
+
.map(function( i, elem ){
|
7063 |
+
var val = jQuery( this ).val();
|
7064 |
+
|
7065 |
+
return val == null ?
|
7066 |
+
null :
|
7067 |
+
jQuery.isArray( val ) ?
|
7068 |
+
jQuery.map( val, function( val, i ){
|
7069 |
+
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
7070 |
+
}) :
|
7071 |
+
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
7072 |
+
}).get();
|
7073 |
+
}
|
7074 |
+
});
|
7075 |
+
|
7076 |
+
// Attach a bunch of functions for handling common AJAX events
|
7077 |
+
jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
|
7078 |
+
jQuery.fn[ o ] = function( f ){
|
7079 |
+
return this.on( o, f );
|
7080 |
+
};
|
7081 |
+
});
|
7082 |
+
|
7083 |
+
jQuery.each( [ "get", "post" ], function( i, method ) {
|
7084 |
+
jQuery[ method ] = function( url, data, callback, type ) {
|
7085 |
+
// shift arguments if data argument was omitted
|
7086 |
+
if ( jQuery.isFunction( data ) ) {
|
7087 |
+
type = type || callback;
|
7088 |
+
callback = data;
|
7089 |
+
data = undefined;
|
7090 |
+
}
|
7091 |
+
|
7092 |
+
return jQuery.ajax({
|
7093 |
+
type: method,
|
7094 |
+
url: url,
|
7095 |
+
data: data,
|
7096 |
+
success: callback,
|
7097 |
+
dataType: type
|
7098 |
+
});
|
7099 |
+
};
|
7100 |
+
});
|
7101 |
+
|
7102 |
+
jQuery.extend({
|
7103 |
+
|
7104 |
+
getScript: function( url, callback ) {
|
7105 |
+
return jQuery.get( url, undefined, callback, "script" );
|
7106 |
+
},
|
7107 |
+
|
7108 |
+
getJSON: function( url, data, callback ) {
|
7109 |
+
return jQuery.get( url, data, callback, "json" );
|
7110 |
+
},
|
7111 |
+
|
7112 |
+
// Creates a full fledged settings object into target
|
7113 |
+
// with both ajaxSettings and settings fields.
|
7114 |
+
// If target is omitted, writes into ajaxSettings.
|
7115 |
+
ajaxSetup: function( target, settings ) {
|
7116 |
+
if ( settings ) {
|
7117 |
+
// Building a settings object
|
7118 |
+
ajaxExtend( target, jQuery.ajaxSettings );
|
7119 |
+
} else {
|
7120 |
+
// Extending ajaxSettings
|
7121 |
+
settings = target;
|
7122 |
+
target = jQuery.ajaxSettings;
|
7123 |
+
}
|
7124 |
+
ajaxExtend( target, settings );
|
7125 |
+
return target;
|
7126 |
+
},
|
7127 |
+
|
7128 |
+
ajaxSettings: {
|
7129 |
+
url: ajaxLocation,
|
7130 |
+
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
|
7131 |
+
global: true,
|
7132 |
+
type: "GET",
|
7133 |
+
contentType: "application/x-www-form-urlencoded",
|
7134 |
+
processData: true,
|
7135 |
+
async: true,
|
7136 |
+
/*
|
7137 |
+
timeout: 0,
|
7138 |
+
data: null,
|
7139 |
+
dataType: null,
|
7140 |
+
username: null,
|
7141 |
+
password: null,
|
7142 |
+
cache: null,
|
7143 |
+
traditional: false,
|
7144 |
+
headers: {},
|
7145 |
+
*/
|
7146 |
+
|
7147 |
+
accepts: {
|
7148 |
+
xml: "application/xml, text/xml",
|
7149 |
+
html: "text/html",
|
7150 |
+
text: "text/plain",
|
7151 |
+
json: "application/json, text/javascript",
|
7152 |
+
"*": allTypes
|
7153 |
+
},
|
7154 |
+
|
7155 |
+
contents: {
|
7156 |
+
xml: /xml/,
|
7157 |
+
html: /html/,
|
7158 |
+
json: /json/
|
7159 |
+
},
|
7160 |
+
|
7161 |
+
responseFields: {
|
7162 |
+
xml: "responseXML",
|
7163 |
+
text: "responseText"
|
7164 |
+
},
|
7165 |
+
|
7166 |
+
// List of data converters
|
7167 |
+
// 1) key format is "source_type destination_type" (a single space in-between)
|
7168 |
+
// 2) the catchall symbol "*" can be used for source_type
|
7169 |
+
converters: {
|
7170 |
+
|
7171 |
+
// Convert anything to text
|
7172 |
+
"* text": window.String,
|
7173 |
+
|
7174 |
+
// Text to html (true = no transformation)
|
7175 |
+
"text html": true,
|
7176 |
+
|
7177 |
+
// Evaluate text as a json expression
|
7178 |
+
"text json": jQuery.parseJSON,
|
7179 |
+
|
7180 |
+
// Parse text as xml
|
7181 |
+
"text xml": jQuery.parseXML
|
7182 |
+
},
|
7183 |
+
|
7184 |
+
// For options that shouldn't be deep extended:
|
7185 |
+
// you can add your own custom options here if
|
7186 |
+
// and when you create one that shouldn't be
|
7187 |
+
// deep extended (see ajaxExtend)
|
7188 |
+
flatOptions: {
|
7189 |
+
context: true,
|
7190 |
+
url: true
|
7191 |
+
}
|
7192 |
+
},
|
7193 |
+
|
7194 |
+
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
|
7195 |
+
ajaxTransport: addToPrefiltersOrTransports( transports ),
|
7196 |
+
|
7197 |
+
// Main method
|
7198 |
+
ajax: function( url, options ) {
|
7199 |
+
|
7200 |
+
// If url is an object, simulate pre-1.5 signature
|
7201 |
+
if ( typeof url === "object" ) {
|
7202 |
+
options = url;
|
7203 |
+
url = undefined;
|
7204 |
+
}
|
7205 |
+
|
7206 |
+
// Force options to be an object
|
7207 |
+
options = options || {};
|
7208 |
+
|
7209 |
+
var // Create the final options object
|
7210 |
+
s = jQuery.ajaxSetup( {}, options ),
|
7211 |
+
// Callbacks context
|
7212 |
+
callbackContext = s.context || s,
|
7213 |
+
// Context for global events
|
7214 |
+
// It's the callbackContext if one was provided in the options
|
7215 |
+
// and if it's a DOM node or a jQuery collection
|
7216 |
+
globalEventContext = callbackContext !== s &&
|
7217 |
+
( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
|
7218 |
+
jQuery( callbackContext ) : jQuery.event,
|
7219 |
+
// Deferreds
|
7220 |
+
deferred = jQuery.Deferred(),
|
7221 |
+
completeDeferred = jQuery.Callbacks( "once memory" ),
|
7222 |
+
// Status-dependent callbacks
|
7223 |
+
statusCode = s.statusCode || {},
|
7224 |
+
// ifModified key
|
7225 |
+
ifModifiedKey,
|
7226 |
+
// Headers (they are sent all at once)
|
7227 |
+
requestHeaders = {},
|
7228 |
+
requestHeadersNames = {},
|
7229 |
+
// Response headers
|
7230 |
+
responseHeadersString,
|
7231 |
+
responseHeaders,
|
7232 |
+
// transport
|
7233 |
+
transport,
|
7234 |
+
// timeout handle
|
7235 |
+
timeoutTimer,
|
7236 |
+
// Cross-domain detection vars
|
7237 |
+
parts,
|
7238 |
+
// The jqXHR state
|
7239 |
+
state = 0,
|
7240 |
+
// To know if global events are to be dispatched
|
7241 |
+
fireGlobals,
|
7242 |
+
// Loop variable
|
7243 |
+
i,
|
7244 |
+
// Fake xhr
|
7245 |
+
jqXHR = {
|
7246 |
+
|
7247 |
+
readyState: 0,
|
7248 |
+
|
7249 |
+
// Caches the header
|
7250 |
+
setRequestHeader: function( name, value ) {
|
7251 |
+
if ( !state ) {
|
7252 |
+
var lname = name.toLowerCase();
|
7253 |
+
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
|
7254 |
+
requestHeaders[ name ] = value;
|
7255 |
+
}
|
7256 |
+
return this;
|
7257 |
+
},
|
7258 |
+
|
7259 |
+
// Raw string
|
7260 |
+
getAllResponseHeaders: function() {
|
7261 |
+
return state === 2 ? responseHeadersString : null;
|
7262 |
+
},
|
7263 |
+
|
7264 |
+
// Builds headers hashtable if needed
|
7265 |
+
getResponseHeader: function( key ) {
|
7266 |
+
var match;
|
7267 |
+
if ( state === 2 ) {
|
7268 |
+
if ( !responseHeaders ) {
|
7269 |
+
responseHeaders = {};
|
7270 |
+
while( ( match = rheaders.exec( responseHeadersString ) ) ) {
|
7271 |
+
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
|
7272 |
+
}
|
7273 |
+
}
|
7274 |
+
match = responseHeaders[ key.toLowerCase() ];
|
7275 |
+
}
|
7276 |
+
return match === undefined ? null : match;
|
7277 |
+
},
|
7278 |
+
|
7279 |
+
// Overrides response content-type header
|
7280 |
+
overrideMimeType: function( type ) {
|
7281 |
+
if ( !state ) {
|
7282 |
+
s.mimeType = type;
|
7283 |
+
}
|
7284 |
+
return this;
|
7285 |
+
},
|
7286 |
+
|
7287 |
+
// Cancel the request
|
7288 |
+
abort: function( statusText ) {
|
7289 |
+
statusText = statusText || "abort";
|
7290 |
+
if ( transport ) {
|
7291 |
+
transport.abort( statusText );
|
7292 |
+
}
|
7293 |
+
done( 0, statusText );
|
7294 |
+
return this;
|
7295 |
+
}
|
7296 |
+
};
|
7297 |
+
|
7298 |
+
// Callback for when everything is done
|
7299 |
+
// It is defined here because jslint complains if it is declared
|
7300 |
+
// at the end of the function (which would be more logical and readable)
|
7301 |
+
function done( status, nativeStatusText, responses, headers ) {
|
7302 |
+
|
7303 |
+
// Called once
|
7304 |
+
if ( state === 2 ) {
|
7305 |
+
return;
|
7306 |
+
}
|
7307 |
+
|
7308 |
+
// State is "done" now
|
7309 |
+
state = 2;
|
7310 |
+
|
7311 |
+
// Clear timeout if it exists
|
7312 |
+
if ( timeoutTimer ) {
|
7313 |
+
clearTimeout( timeoutTimer );
|
7314 |
+
}
|
7315 |
+
|
7316 |
+
// Dereference transport for early garbage collection
|
7317 |
+
// (no matter how long the jqXHR object will be used)
|
7318 |
+
transport = undefined;
|
7319 |
+
|
7320 |
+
// Cache response headers
|
7321 |
+
responseHeadersString = headers || "";
|
7322 |
+
|
7323 |
+
// Set readyState
|
7324 |
+
jqXHR.readyState = status > 0 ? 4 : 0;
|
7325 |
+
|
7326 |
+
var isSuccess,
|
7327 |
+
success,
|
7328 |
+
error,
|
7329 |
+
statusText = nativeStatusText,
|
7330 |
+
response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
|
7331 |
+
lastModified,
|
7332 |
+
etag;
|
7333 |
+
|
7334 |
+
// If successful, handle type chaining
|
7335 |
+
if ( status >= 200 && status < 300 || status === 304 ) {
|
7336 |
+
|
7337 |
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
7338 |
+
if ( s.ifModified ) {
|
7339 |
+
|
7340 |
+
if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
|
7341 |
+
jQuery.lastModified[ ifModifiedKey ] = lastModified;
|
7342 |
+
}
|
7343 |
+
if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
|
7344 |
+
jQuery.etag[ ifModifiedKey ] = etag;
|
7345 |
+
}
|
7346 |
+
}
|
7347 |
+
|
7348 |
+
// If not modified
|
7349 |
+
if ( status === 304 ) {
|
7350 |
+
|
7351 |
+
statusText = "notmodified";
|
7352 |
+
isSuccess = true;
|
7353 |
+
|
7354 |
+
// If we have data
|
7355 |
+
} else {
|
7356 |
+
|
7357 |
+
try {
|
7358 |
+
success = ajaxConvert( s, response );
|
7359 |
+
statusText = "success";
|
7360 |
+
isSuccess = true;
|
7361 |
+
} catch(e) {
|
7362 |
+
// We have a parsererror
|
7363 |
+
statusText = "parsererror";
|
7364 |
+
error = e;
|
7365 |
+
}
|
7366 |
+
}
|
7367 |
+
} else {
|
7368 |
+
// We extract error from statusText
|
7369 |
+
// then normalize statusText and status for non-aborts
|
7370 |
+
error = statusText;
|
7371 |
+
if ( !statusText || status ) {
|
7372 |
+
statusText = "error";
|
7373 |
+
if ( status < 0 ) {
|
7374 |
+
status = 0;
|
7375 |
+
}
|
7376 |
+
}
|
7377 |
+
}
|
7378 |
+
|
7379 |
+
// Set data for the fake xhr object
|
7380 |
+
jqXHR.status = status;
|
7381 |
+
jqXHR.statusText = "" + ( nativeStatusText || statusText );
|
7382 |
+
|
7383 |
+
// Success/Error
|
7384 |
+
if ( isSuccess ) {
|
7385 |
+
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
|
7386 |
+
} else {
|
7387 |
+
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
|
7388 |
+
}
|
7389 |
+
|
7390 |
+
// Status-dependent callbacks
|
7391 |
+
jqXHR.statusCode( statusCode );
|
7392 |
+
statusCode = undefined;
|
7393 |
+
|
7394 |
+
if ( fireGlobals ) {
|
7395 |
+
globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
|
7396 |
+
[ jqXHR, s, isSuccess ? success : error ] );
|
7397 |
+
}
|
7398 |
+
|
7399 |
+
// Complete
|
7400 |
+
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
|
7401 |
+
|
7402 |
+
if ( fireGlobals ) {
|
7403 |
+
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
|
7404 |
+
// Handle the global AJAX counter
|
7405 |
+
if ( !( --jQuery.active ) ) {
|
7406 |
+
jQuery.event.trigger( "ajaxStop" );
|
7407 |
+
}
|
7408 |
+
}
|
7409 |
+
}
|
7410 |
+
|
7411 |
+
// Attach deferreds
|
7412 |
+
deferred.promise( jqXHR );
|
7413 |
+
jqXHR.success = jqXHR.done;
|
7414 |
+
jqXHR.error = jqXHR.fail;
|
7415 |
+
jqXHR.complete = completeDeferred.add;
|
7416 |
+
|
7417 |
+
// Status-dependent callbacks
|
7418 |
+
jqXHR.statusCode = function( map ) {
|
7419 |
+
if ( map ) {
|
7420 |
+
var tmp;
|
7421 |
+
if ( state < 2 ) {
|
7422 |
+
for ( tmp in map ) {
|
7423 |
+
statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
|
7424 |
+
}
|
7425 |
+
} else {
|
7426 |
+
tmp = map[ jqXHR.status ];
|
7427 |
+
jqXHR.then( tmp, tmp );
|
7428 |
+
}
|
7429 |
+
}
|
7430 |
+
return this;
|
7431 |
+
};
|
7432 |
+
|
7433 |
+
// Remove hash character (#7531: and string promotion)
|
7434 |
+
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
|
7435 |
+
// We also use the url parameter if available
|
7436 |
+
s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
|
7437 |
+
|
7438 |
+
// Extract dataTypes list
|
7439 |
+
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( rspacesAjax );
|
7440 |
+
|
7441 |
+
// Determine if a cross-domain request is in order
|
7442 |
+
if ( s.crossDomain == null ) {
|
7443 |
+
parts = rurl.exec( s.url.toLowerCase() );
|
7444 |
+
s.crossDomain = !!( parts &&
|
7445 |
+
( parts[ 1 ] != ajaxLocParts[ 1 ] || parts[ 2 ] != ajaxLocParts[ 2 ] ||
|
7446 |
+
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
|
7447 |
+
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
|
7448 |
+
);
|
7449 |
+
}
|
7450 |
+
|
7451 |
+
// Convert data if not already a string
|
7452 |
+
if ( s.data && s.processData && typeof s.data !== "string" ) {
|
7453 |
+
s.data = jQuery.param( s.data, s.traditional );
|
7454 |
+
}
|
7455 |
+
|
7456 |
+
// Apply prefilters
|
7457 |
+
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
|
7458 |
+
|
7459 |
+
// If request was aborted inside a prefiler, stop there
|
7460 |
+
if ( state === 2 ) {
|
7461 |
+
return false;
|
7462 |
+
}
|
7463 |
+
|
7464 |
+
// We can fire global events as of now if asked to
|
7465 |
+
fireGlobals = s.global;
|
7466 |
+
|
7467 |
+
// Uppercase the type
|
7468 |
+
s.type = s.type.toUpperCase();
|
7469 |
+
|
7470 |
+
// Determine if request has content
|
7471 |
+
s.hasContent = !rnoContent.test( s.type );
|
7472 |
+
|
7473 |
+
// Watch for a new set of requests
|
7474 |
+
if ( fireGlobals && jQuery.active++ === 0 ) {
|
7475 |
+
jQuery.event.trigger( "ajaxStart" );
|
7476 |
+
}
|
7477 |
+
|
7478 |
+
// More options handling for requests with no content
|
7479 |
+
if ( !s.hasContent ) {
|
7480 |
+
|
7481 |
+
// If data is available, append data to url
|
7482 |
+
if ( s.data ) {
|
7483 |
+
s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
|
7484 |
+
// #9682: remove data so that it's not used in an eventual retry
|
7485 |
+
delete s.data;
|
7486 |
+
}
|
7487 |
+
|
7488 |
+
// Get ifModifiedKey before adding the anti-cache parameter
|
7489 |
+
ifModifiedKey = s.url;
|
7490 |
+
|
7491 |
+
// Add anti-cache in url if needed
|
7492 |
+
if ( s.cache === false ) {
|
7493 |
+
|
7494 |
+
var ts = jQuery.now(),
|
7495 |
+
// try replacing _= if it is there
|
7496 |
+
ret = s.url.replace( rts, "$1_=" + ts );
|
7497 |
+
|
7498 |
+
// if nothing was replaced, add timestamp to the end
|
7499 |
+
s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
|
7500 |
+
}
|
7501 |
+
}
|
7502 |
+
|
7503 |
+
// Set the correct header, if data is being sent
|
7504 |
+
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
7505 |
+
jqXHR.setRequestHeader( "Content-Type", s.contentType );
|
7506 |
+
}
|
7507 |
+
|
7508 |
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
7509 |
+
if ( s.ifModified ) {
|
7510 |
+
ifModifiedKey = ifModifiedKey || s.url;
|
7511 |
+
if ( jQuery.lastModified[ ifModifiedKey ] ) {
|
7512 |
+
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
|
7513 |
+
}
|
7514 |
+
if ( jQuery.etag[ ifModifiedKey ] ) {
|
7515 |
+
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
|
7516 |
+
}
|
7517 |
+
}
|
7518 |
+
|
7519 |
+
// Set the Accepts header for the server, depending on the dataType
|
7520 |
+
jqXHR.setRequestHeader(
|
7521 |
+
"Accept",
|
7522 |
+
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
|
7523 |
+
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
|
7524 |
+
s.accepts[ "*" ]
|
7525 |
+
);
|
7526 |
+
|
7527 |
+
// Check for headers option
|
7528 |
+
for ( i in s.headers ) {
|
7529 |
+
jqXHR.setRequestHeader( i, s.headers[ i ] );
|
7530 |
+
}
|
7531 |
+
|
7532 |
+
// Allow custom headers/mimetypes and early abort
|
7533 |
+
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
7534 |
+
// Abort if not done already
|
7535 |
+
jqXHR.abort();
|
7536 |
+
return false;
|
7537 |
+
|
7538 |
+
}
|
7539 |
+
|
7540 |
+
// Install callbacks on deferreds
|
7541 |
+
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
7542 |
+
jqXHR[ i ]( s[ i ] );
|
7543 |
+
}
|
7544 |
+
|
7545 |
+
// Get transport
|
7546 |
+
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
7547 |
+
|
7548 |
+
// If no transport, we auto-abort
|
7549 |
+
if ( !transport ) {
|
7550 |
+
done( -1, "No Transport" );
|
7551 |
+
} else {
|
7552 |
+
jqXHR.readyState = 1;
|
7553 |
+
// Send global event
|
7554 |
+
if ( fireGlobals ) {
|
7555 |
+
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
|
7556 |
+
}
|
7557 |
+
// Timeout
|
7558 |
+
if ( s.async && s.timeout > 0 ) {
|
7559 |
+
timeoutTimer = setTimeout( function(){
|
7560 |
+
jqXHR.abort( "timeout" );
|
7561 |
+
}, s.timeout );
|
7562 |
+
}
|
7563 |
+
|
7564 |
+
try {
|
7565 |
+
state = 1;
|
7566 |
+
transport.send( requestHeaders, done );
|
7567 |
+
} catch (e) {
|
7568 |
+
// Propagate exception as error if not done
|
7569 |
+
if ( state < 2 ) {
|
7570 |
+
done( -1, e );
|
7571 |
+
// Simply rethrow otherwise
|
7572 |
+
} else {
|
7573 |
+
throw e;
|
7574 |
+
}
|
7575 |
+
}
|
7576 |
+
}
|
7577 |
+
|
7578 |
+
return jqXHR;
|
7579 |
+
},
|
7580 |
+
|
7581 |
+
// Serialize an array of form elements or a set of
|
7582 |
+
// key/values into a query string
|
7583 |
+
param: function( a, traditional ) {
|
7584 |
+
var s = [],
|
7585 |
+
add = function( key, value ) {
|
7586 |
+
// If value is a function, invoke it and return its value
|
7587 |
+
value = jQuery.isFunction( value ) ? value() : value;
|
7588 |
+
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
|
7589 |
+
};
|
7590 |
+
|
7591 |
+
// Set traditional to true for jQuery <= 1.3.2 behavior.
|
7592 |
+
if ( traditional === undefined ) {
|
7593 |
+
traditional = jQuery.ajaxSettings.traditional;
|
7594 |
+
}
|
7595 |
+
|
7596 |
+
// If an array was passed in, assume that it is an array of form elements.
|
7597 |
+
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
7598 |
+
// Serialize the form elements
|
7599 |
+
jQuery.each( a, function() {
|
7600 |
+
add( this.name, this.value );
|
7601 |
+
});
|
7602 |
+
|
7603 |
+
} else {
|
7604 |
+
// If traditional, encode the "old" way (the way 1.3.2 or older
|
7605 |
+
// did it), otherwise encode params recursively.
|
7606 |
+
for ( var prefix in a ) {
|
7607 |
+
buildParams( prefix, a[ prefix ], traditional, add );
|
7608 |
+
}
|
7609 |
+
}
|
7610 |
+
|
7611 |
+
// Return the resulting serialization
|
7612 |
+
return s.join( "&" ).replace( r20, "+" );
|
7613 |
+
}
|
7614 |
+
});
|
7615 |
+
|
7616 |
+
function buildParams( prefix, obj, traditional, add ) {
|
7617 |
+
if ( jQuery.isArray( obj ) ) {
|
7618 |
+
// Serialize array item.
|
7619 |
+
jQuery.each( obj, function( i, v ) {
|
7620 |
+
if ( traditional || rbracket.test( prefix ) ) {
|
7621 |
+
// Treat each array item as a scalar.
|
7622 |
+
add( prefix, v );
|
7623 |
+
|
7624 |
+
} else {
|
7625 |
+
// If array item is non-scalar (array or object), encode its
|
7626 |
+
// numeric index to resolve deserialization ambiguity issues.
|
7627 |
+
// Note that rack (as of 1.0.0) can't currently deserialize
|
7628 |
+
// nested arrays properly, and attempting to do so may cause
|
7629 |
+
// a server error. Possible fixes are to modify rack's
|
7630 |
+
// deserialization algorithm or to provide an option or flag
|
7631 |
+
// to force array serialization to be shallow.
|
7632 |
+
buildParams( prefix + "[" + ( typeof v === "object" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
|
7633 |
+
}
|
7634 |
+
});
|
7635 |
+
|
7636 |
+
} else if ( !traditional && obj != null && typeof obj === "object" ) {
|
7637 |
+
// Serialize object item.
|
7638 |
+
for ( var name in obj ) {
|
7639 |
+
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
|
7640 |
+
}
|
7641 |
+
|
7642 |
+
} else {
|
7643 |
+
// Serialize scalar item.
|
7644 |
+
add( prefix, obj );
|
7645 |
+
}
|
7646 |
+
}
|
7647 |
+
|
7648 |
+
// This is still on the jQuery object... for now
|
7649 |
+
// Want to move this to jQuery.ajax some day
|
7650 |
+
jQuery.extend({
|
7651 |
+
|
7652 |
+
// Counter for holding the number of active queries
|
7653 |
+
active: 0,
|
7654 |
+
|
7655 |
+
// Last-Modified header cache for next request
|
7656 |
+
lastModified: {},
|
7657 |
+
etag: {}
|
7658 |
+
|
7659 |
+
});
|
7660 |
+
|
7661 |
+
/* Handles responses to an ajax request:
|
7662 |
+
* - sets all responseXXX fields accordingly
|
7663 |
+
* - finds the right dataType (mediates between content-type and expected dataType)
|
7664 |
+
* - returns the corresponding response
|
7665 |
+
*/
|
7666 |
+
function ajaxHandleResponses( s, jqXHR, responses ) {
|
7667 |
+
|
7668 |
+
var contents = s.contents,
|
7669 |
+
dataTypes = s.dataTypes,
|
7670 |
+
responseFields = s.responseFields,
|
7671 |
+
ct,
|
7672 |
+
type,
|
7673 |
+
finalDataType,
|
7674 |
+
firstDataType;
|
7675 |
+
|
7676 |
+
// Fill responseXXX fields
|
7677 |
+
for ( type in responseFields ) {
|
7678 |
+
if ( type in responses ) {
|
7679 |
+
jqXHR[ responseFields[type] ] = responses[ type ];
|
7680 |
+
}
|
7681 |
+
}
|
7682 |
+
|
7683 |
+
// Remove auto dataType and get content-type in the process
|
7684 |
+
while( dataTypes[ 0 ] === "*" ) {
|
7685 |
+
dataTypes.shift();
|
7686 |
+
if ( ct === undefined ) {
|
7687 |
+
ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
|
7688 |
+
}
|
7689 |
+
}
|
7690 |
+
|
7691 |
+
// Check if we're dealing with a known content-type
|
7692 |
+
if ( ct ) {
|
7693 |
+
for ( type in contents ) {
|
7694 |
+
if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
7695 |
+
dataTypes.unshift( type );
|
7696 |
+
break;
|
7697 |
+
}
|
7698 |
+
}
|
7699 |
+
}
|
7700 |
+
|
7701 |
+
// Check to see if we have a response for the expected dataType
|
7702 |
+
if ( dataTypes[ 0 ] in responses ) {
|
7703 |
+
finalDataType = dataTypes[ 0 ];
|
7704 |
+
} else {
|
7705 |
+
// Try convertible dataTypes
|
7706 |
+
for ( type in responses ) {
|
7707 |
+
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
|
7708 |
+
finalDataType = type;
|
7709 |
+
break;
|
7710 |
+
}
|
7711 |
+
if ( !firstDataType ) {
|
7712 |
+
firstDataType = type;
|
7713 |
+
}
|
7714 |
+
}
|
7715 |
+
// Or just use first one
|
7716 |
+
finalDataType = finalDataType || firstDataType;
|
7717 |
+
}
|
7718 |
+
|
7719 |
+
// If we found a dataType
|
7720 |
+
// We add the dataType to the list if needed
|
7721 |
+
// and return the corresponding response
|
7722 |
+
if ( finalDataType ) {
|
7723 |
+
if ( finalDataType !== dataTypes[ 0 ] ) {
|
7724 |
+
dataTypes.unshift( finalDataType );
|
7725 |
+
}
|
7726 |
+
return responses[ finalDataType ];
|
7727 |
+
}
|
7728 |
+
}
|
7729 |
+
|
7730 |
+
// Chain conversions given the request and the original response
|
7731 |
+
function ajaxConvert( s, response ) {
|
7732 |
+
|
7733 |
+
// Apply the dataFilter if provided
|
7734 |
+
if ( s.dataFilter ) {
|
7735 |
+
response = s.dataFilter( response, s.dataType );
|
7736 |
+
}
|
7737 |
+
|
7738 |
+
var dataTypes = s.dataTypes,
|
7739 |
+
converters = {},
|
7740 |
+
i,
|
7741 |
+
key,
|
7742 |
+
length = dataTypes.length,
|
7743 |
+
tmp,
|
7744 |
+
// Current and previous dataTypes
|
7745 |
+
current = dataTypes[ 0 ],
|
7746 |
+
prev,
|
7747 |
+
// Conversion expression
|
7748 |
+
conversion,
|
7749 |
+
// Conversion function
|
7750 |
+
conv,
|
7751 |
+
// Conversion functions (transitive conversion)
|
7752 |
+
conv1,
|
7753 |
+
conv2;
|
7754 |
+
|
7755 |
+
// For each dataType in the chain
|
7756 |
+
for ( i = 1; i < length; i++ ) {
|
7757 |
+
|
7758 |
+
// Create converters map
|
7759 |
+
// with lowercased keys
|
7760 |
+
if ( i === 1 ) {
|
7761 |
+
for ( key in s.converters ) {
|
7762 |
+
if ( typeof key === "string" ) {
|
7763 |
+
converters[ key.toLowerCase() ] = s.converters[ key ];
|
7764 |
+
}
|
7765 |
+
}
|
7766 |
+
}
|
7767 |
+
|
7768 |
+
// Get the dataTypes
|
7769 |
+
prev = current;
|
7770 |
+
current = dataTypes[ i ];
|
7771 |
+
|
7772 |
+
// If current is auto dataType, update it to prev
|
7773 |
+
if ( current === "*" ) {
|
7774 |
+
current = prev;
|
7775 |
+
// If no auto and dataTypes are actually different
|
7776 |
+
} else if ( prev !== "*" && prev !== current ) {
|
7777 |
+
|
7778 |
+
// Get the converter
|
7779 |
+
conversion = prev + " " + current;
|
7780 |
+
conv = converters[ conversion ] || converters[ "* " + current ];
|
7781 |
+
|
7782 |
+
// If there is no direct converter, search transitively
|
7783 |
+
if ( !conv ) {
|
7784 |
+
conv2 = undefined;
|
7785 |
+
for ( conv1 in converters ) {
|
7786 |
+
tmp = conv1.split( " " );
|
7787 |
+
if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
|
7788 |
+
conv2 = converters[ tmp[1] + " " + current ];
|
7789 |
+
if ( conv2 ) {
|
7790 |
+
conv1 = converters[ conv1 ];
|
7791 |
+
if ( conv1 === true ) {
|
7792 |
+
conv = conv2;
|
7793 |
+
} else if ( conv2 === true ) {
|
7794 |
+
conv = conv1;
|
7795 |
+
}
|
7796 |
+
break;
|
7797 |
+
}
|
7798 |
+
}
|
7799 |
+
}
|
7800 |
+
}
|
7801 |
+
// If we found no converter, dispatch an error
|
7802 |
+
if ( !( conv || conv2 ) ) {
|
7803 |
+
jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
|
7804 |
+
}
|
7805 |
+
// If found converter is not an equivalence
|
7806 |
+
if ( conv !== true ) {
|
7807 |
+
// Convert with 1 or 2 converters accordingly
|
7808 |
+
response = conv ? conv( response ) : conv2( conv1(response) );
|
7809 |
+
}
|
7810 |
+
}
|
7811 |
+
}
|
7812 |
+
return response;
|
7813 |
+
}
|
7814 |
+
|
7815 |
+
|
7816 |
+
|
7817 |
+
|
7818 |
+
var jsc = jQuery.now(),
|
7819 |
+
jsre = /(\=)\?(&|$)|\?\?/i;
|
7820 |
+
|
7821 |
+
// Default jsonp settings
|
7822 |
+
jQuery.ajaxSetup({
|
7823 |
+
jsonp: "callback",
|
7824 |
+
jsonpCallback: function() {
|
7825 |
+
return jQuery.expando + "_" + ( jsc++ );
|
7826 |
+
}
|
7827 |
+
});
|
7828 |
+
|
7829 |
+
// Detect, normalize options and install callbacks for jsonp requests
|
7830 |
+
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
7831 |
+
|
7832 |
+
var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
|
7833 |
+
( typeof s.data === "string" );
|
7834 |
+
|
7835 |
+
if ( s.dataTypes[ 0 ] === "jsonp" ||
|
7836 |
+
s.jsonp !== false && ( jsre.test( s.url ) ||
|
7837 |
+
inspectData && jsre.test( s.data ) ) ) {
|
7838 |
+
|
7839 |
+
var responseContainer,
|
7840 |
+
jsonpCallback = s.jsonpCallback =
|
7841 |
+
jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
|
7842 |
+
previous = window[ jsonpCallback ],
|
7843 |
+
url = s.url,
|
7844 |
+
data = s.data,
|
7845 |
+
replace = "$1" + jsonpCallback + "$2";
|
7846 |
+
|
7847 |
+
if ( s.jsonp !== false ) {
|
7848 |
+
url = url.replace( jsre, replace );
|
7849 |
+
if ( s.url === url ) {
|
7850 |
+
if ( inspectData ) {
|
7851 |
+
data = data.replace( jsre, replace );
|
7852 |
+
}
|
7853 |
+
if ( s.data === data ) {
|
7854 |
+
// Add callback manually
|
7855 |
+
url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
|
7856 |
+
}
|
7857 |
+
}
|
7858 |
+
}
|
7859 |
+
|
7860 |
+
s.url = url;
|
7861 |
+
s.data = data;
|
7862 |
+
|
7863 |
+
// Install callback
|
7864 |
+
window[ jsonpCallback ] = function( response ) {
|
7865 |
+
responseContainer = [ response ];
|
7866 |
+
};
|
7867 |
+
|
7868 |
+
// Clean-up function
|
7869 |
+
jqXHR.always(function() {
|
7870 |
+
// Set callback back to previous value
|
7871 |
+
window[ jsonpCallback ] = previous;
|
7872 |
+
// Call if it was a function and we have a response
|
7873 |
+
if ( responseContainer && jQuery.isFunction( previous ) ) {
|
7874 |
+
window[ jsonpCallback ]( responseContainer[ 0 ] );
|
7875 |
+
}
|
7876 |
+
});
|
7877 |
+
|
7878 |
+
// Use data converter to retrieve json after script execution
|
7879 |
+
s.converters["script json"] = function() {
|
7880 |
+
if ( !responseContainer ) {
|
7881 |
+
jQuery.error( jsonpCallback + " was not called" );
|
7882 |
+
}
|
7883 |
+
return responseContainer[ 0 ];
|
7884 |
+
};
|
7885 |
+
|
7886 |
+
// force json dataType
|
7887 |
+
s.dataTypes[ 0 ] = "json";
|
7888 |
+
|
7889 |
+
// Delegate to script
|
7890 |
+
return "script";
|
7891 |
+
}
|
7892 |
+
});
|
7893 |
+
|
7894 |
+
|
7895 |
+
|
7896 |
+
|
7897 |
+
// Install script dataType
|
7898 |
+
jQuery.ajaxSetup({
|
7899 |
+
accepts: {
|
7900 |
+
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
|
7901 |
+
},
|
7902 |
+
contents: {
|
7903 |
+
script: /javascript|ecmascript/
|
7904 |
+
},
|
7905 |
+
converters: {
|
7906 |
+
"text script": function( text ) {
|
7907 |
+
jQuery.globalEval( text );
|
7908 |
+
return text;
|
7909 |
+
}
|
7910 |
+
}
|
7911 |
+
});
|
7912 |
+
|
7913 |
+
// Handle cache's special case and global
|
7914 |
+
jQuery.ajaxPrefilter( "script", function( s ) {
|
7915 |
+
if ( s.cache === undefined ) {
|
7916 |
+
s.cache = false;
|
7917 |
+
}
|
7918 |
+
if ( s.crossDomain ) {
|
7919 |
+
s.type = "GET";
|
7920 |
+
s.global = false;
|
7921 |
+
}
|
7922 |
+
});
|
7923 |
+
|
7924 |
+
// Bind script tag hack transport
|
7925 |
+
jQuery.ajaxTransport( "script", function(s) {
|
7926 |
+
|
7927 |
+
// This transport only deals with cross domain requests
|
7928 |
+
if ( s.crossDomain ) {
|
7929 |
+
|
7930 |
+
var script,
|
7931 |
+
head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
|
7932 |
+
|
7933 |
+
return {
|
7934 |
+
|
7935 |
+
send: function( _, callback ) {
|
7936 |
+
|
7937 |
+
script = document.createElement( "script" );
|
7938 |
+
|
7939 |
+
script.async = "async";
|
7940 |
+
|
7941 |
+
if ( s.scriptCharset ) {
|
7942 |
+
script.charset = s.scriptCharset;
|
7943 |
+
}
|
7944 |
+
|
7945 |
+
script.src = s.url;
|
7946 |
+
|
7947 |
+
// Attach handlers for all browsers
|
7948 |
+
script.onload = script.onreadystatechange = function( _, isAbort ) {
|
7949 |
+
|
7950 |
+
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
|
7951 |
+
|
7952 |
+
// Handle memory leak in IE
|
7953 |
+
script.onload = script.onreadystatechange = null;
|
7954 |
+
|
7955 |
+
// Remove the script
|
7956 |
+
if ( head && script.parentNode ) {
|
7957 |
+
head.removeChild( script );
|
7958 |
+
}
|
7959 |
+
|
7960 |
+
// Dereference the script
|
7961 |
+
script = undefined;
|
7962 |
+
|
7963 |
+
// Callback if not abort
|
7964 |
+
if ( !isAbort ) {
|
7965 |
+
callback( 200, "success" );
|
7966 |
+
}
|
7967 |
+
}
|
7968 |
+
};
|
7969 |
+
// Use insertBefore instead of appendChild to circumvent an IE6 bug.
|
7970 |
+
// This arises when a base node is used (#2709 and #4378).
|
7971 |
+
head.insertBefore( script, head.firstChild );
|
7972 |
+
},
|
7973 |
+
|
7974 |
+
abort: function() {
|
7975 |
+
if ( script ) {
|
7976 |
+
script.onload( 0, 1 );
|
7977 |
+
}
|
7978 |
+
}
|
7979 |
+
};
|
7980 |
+
}
|
7981 |
+
});
|
7982 |
+
|
7983 |
+
|
7984 |
+
|
7985 |
+
|
7986 |
+
var // #5280: Internet Explorer will keep connections alive if we don't abort on unload
|
7987 |
+
xhrOnUnloadAbort = window.ActiveXObject ? function() {
|
7988 |
+
// Abort all pending requests
|
7989 |
+
for ( var key in xhrCallbacks ) {
|
7990 |
+
xhrCallbacks[ key ]( 0, 1 );
|
7991 |
+
}
|
7992 |
+
} : false,
|
7993 |
+
xhrId = 0,
|
7994 |
+
xhrCallbacks;
|
7995 |
+
|
7996 |
+
// Functions to create xhrs
|
7997 |
+
function createStandardXHR() {
|
7998 |
+
try {
|
7999 |
+
return new window.XMLHttpRequest();
|
8000 |
+
} catch( e ) {}
|
8001 |
+
}
|
8002 |
+
|
8003 |
+
function createActiveXHR() {
|
8004 |
+
try {
|
8005 |
+
return new window.ActiveXObject( "Microsoft.XMLHTTP" );
|
8006 |
+
} catch( e ) {}
|
8007 |
+
}
|
8008 |
+
|
8009 |
+
// Create the request object
|
8010 |
+
// (This is still attached to ajaxSettings for backward compatibility)
|
8011 |
+
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
|
8012 |
+
/* Microsoft failed to properly
|
8013 |
+
* implement the XMLHttpRequest in IE7 (can't request local files),
|
8014 |
+
* so we use the ActiveXObject when it is available
|
8015 |
+
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
|
8016 |
+
* we need a fallback.
|
8017 |
+
*/
|
8018 |
+
function() {
|
8019 |
+
return !this.isLocal && createStandardXHR() || createActiveXHR();
|
8020 |
+
} :
|
8021 |
+
// For all other browsers, use the standard XMLHttpRequest object
|
8022 |
+
createStandardXHR;
|
8023 |
+
|
8024 |
+
// Determine support properties
|
8025 |
+
(function( xhr ) {
|
8026 |
+
jQuery.extend( jQuery.support, {
|
8027 |
+
ajax: !!xhr,
|
8028 |
+
cors: !!xhr && ( "withCredentials" in xhr )
|
8029 |
+
});
|
8030 |
+
})( jQuery.ajaxSettings.xhr() );
|
8031 |
+
|
8032 |
+
// Create transport if the browser can provide an xhr
|
8033 |
+
if ( jQuery.support.ajax ) {
|
8034 |
+
|
8035 |
+
jQuery.ajaxTransport(function( s ) {
|
8036 |
+
// Cross domain only allowed if supported through XMLHttpRequest
|
8037 |
+
if ( !s.crossDomain || jQuery.support.cors ) {
|
8038 |
+
|
8039 |
+
var callback;
|
8040 |
+
|
8041 |
+
return {
|
8042 |
+
send: function( headers, complete ) {
|
8043 |
+
|
8044 |
+
// Get a new xhr
|
8045 |
+
var xhr = s.xhr(),
|
8046 |
+
handle,
|
8047 |
+
i;
|
8048 |
+
|
8049 |
+
// Open the socket
|
8050 |
+
// Passing null username, generates a login popup on Opera (#2865)
|
8051 |
+
if ( s.username ) {
|
8052 |
+
xhr.open( s.type, s.url, s.async, s.username, s.password );
|
8053 |
+
} else {
|
8054 |
+
xhr.open( s.type, s.url, s.async );
|
8055 |
+
}
|
8056 |
+
|
8057 |
+
// Apply custom fields if provided
|
8058 |
+
if ( s.xhrFields ) {
|
8059 |
+
for ( i in s.xhrFields ) {
|
8060 |
+
xhr[ i ] = s.xhrFields[ i ];
|
8061 |
+
}
|
8062 |
+
}
|
8063 |
+
|
8064 |
+
// Override mime type if needed
|
8065 |
+
if ( s.mimeType && xhr.overrideMimeType ) {
|
8066 |
+
xhr.overrideMimeType( s.mimeType );
|
8067 |
+
}
|
8068 |
+
|
8069 |
+
// X-Requested-With header
|
8070 |
+
// For cross-domain requests, seeing as conditions for a preflight are
|
8071 |
+
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
8072 |
+
// (it can always be set on a per-request basis or even using ajaxSetup)
|
8073 |
+
// For same-domain requests, won't change header if already provided.
|
8074 |
+
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
|
8075 |
+
headers[ "X-Requested-With" ] = "XMLHttpRequest";
|
8076 |
+
}
|
8077 |
+
|
8078 |
+
// Need an extra try/catch for cross domain requests in Firefox 3
|
8079 |
+
try {
|
8080 |
+
for ( i in headers ) {
|
8081 |
+
xhr.setRequestHeader( i, headers[ i ] );
|
8082 |
+
}
|
8083 |
+
} catch( _ ) {}
|
8084 |
+
|
8085 |
+
// Do send the request
|
8086 |
+
// This may raise an exception which is actually
|
8087 |
+
// handled in jQuery.ajax (so no try/catch here)
|
8088 |
+
xhr.send( ( s.hasContent && s.data ) || null );
|
8089 |
+
|
8090 |
+
// Listener
|
8091 |
+
callback = function( _, isAbort ) {
|
8092 |
+
|
8093 |
+
var status,
|
8094 |
+
statusText,
|
8095 |
+
responseHeaders,
|
8096 |
+
responses,
|
8097 |
+
xml;
|
8098 |
+
|
8099 |
+
// Firefox throws exceptions when accessing properties
|
8100 |
+
// of an xhr when a network error occured
|
8101 |
+
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
|
8102 |
+
try {
|
8103 |
+
|
8104 |
+
// Was never called and is aborted or complete
|
8105 |
+
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
|
8106 |
+
|
8107 |
+
// Only called once
|
8108 |
+
callback = undefined;
|
8109 |
+
|
8110 |
+
// Do not keep as active anymore
|
8111 |
+
if ( handle ) {
|
8112 |
+
xhr.onreadystatechange = jQuery.noop;
|
8113 |
+
if ( xhrOnUnloadAbort ) {
|
8114 |
+
delete xhrCallbacks[ handle ];
|
8115 |
+
}
|
8116 |
+
}
|
8117 |
+
|
8118 |
+
// If it's an abort
|
8119 |
+
if ( isAbort ) {
|
8120 |
+
// Abort it manually if needed
|
8121 |
+
if ( xhr.readyState !== 4 ) {
|
8122 |
+
xhr.abort();
|
8123 |
+
}
|
8124 |
+
} else {
|
8125 |
+
status = xhr.status;
|
8126 |
+
responseHeaders = xhr.getAllResponseHeaders();
|
8127 |
+
responses = {};
|
8128 |
+
xml = xhr.responseXML;
|
8129 |
+
|
8130 |
+
// Construct response list
|
8131 |
+
if ( xml && xml.documentElement /* #4958 */ ) {
|
8132 |
+
responses.xml = xml;
|
8133 |
+
}
|
8134 |
+
responses.text = xhr.responseText;
|
8135 |
+
|
8136 |
+
// Firefox throws an exception when accessing
|
8137 |
+
// statusText for faulty cross-domain requests
|
8138 |
+
try {
|
8139 |
+
statusText = xhr.statusText;
|
8140 |
+
} catch( e ) {
|
8141 |
+
// We normalize with Webkit giving an empty statusText
|
8142 |
+
statusText = "";
|
8143 |
+
}
|
8144 |
+
|
8145 |
+
// Filter status for non standard behaviors
|
8146 |
+
|
8147 |
+
// If the request is local and we have data: assume a success
|
8148 |
+
// (success with no data won't get notified, that's the best we
|
8149 |
+
// can do given current implementations)
|
8150 |
+
if ( !status && s.isLocal && !s.crossDomain ) {
|
8151 |
+
status = responses.text ? 200 : 404;
|
8152 |
+
// IE - #1450: sometimes returns 1223 when it should be 204
|
8153 |
+
} else if ( status === 1223 ) {
|
8154 |
+
status = 204;
|
8155 |
+
}
|
8156 |
+
}
|
8157 |
+
}
|
8158 |
+
} catch( firefoxAccessException ) {
|
8159 |
+
if ( !isAbort ) {
|
8160 |
+
complete( -1, firefoxAccessException );
|
8161 |
+
}
|
8162 |
+
}
|
8163 |
+
|
8164 |
+
// Call complete if needed
|
8165 |
+
if ( responses ) {
|
8166 |
+
complete( status, statusText, responses, responseHeaders );
|
8167 |
+
}
|
8168 |
+
};
|
8169 |
+
|
8170 |
+
// if we're in sync mode or it's in cache
|
8171 |
+
// and has been retrieved directly (IE6 & IE7)
|
8172 |
+
// we need to manually fire the callback
|
8173 |
+
if ( !s.async || xhr.readyState === 4 ) {
|
8174 |
+
callback();
|
8175 |
+
} else {
|
8176 |
+
handle = ++xhrId;
|
8177 |
+
if ( xhrOnUnloadAbort ) {
|
8178 |
+
// Create the active xhrs callbacks list if needed
|
8179 |
+
// and attach the unload handler
|
8180 |
+
if ( !xhrCallbacks ) {
|
8181 |
+
xhrCallbacks = {};
|
8182 |
+
jQuery( window ).unload( xhrOnUnloadAbort );
|
8183 |
+
}
|
8184 |
+
// Add to list of active xhrs callbacks
|
8185 |
+
xhrCallbacks[ handle ] = callback;
|
8186 |
+
}
|
8187 |
+
xhr.onreadystatechange = callback;
|
8188 |
+
}
|
8189 |
+
},
|
8190 |
+
|
8191 |
+
abort: function() {
|
8192 |
+
if ( callback ) {
|
8193 |
+
callback(0,1);
|
8194 |
+
}
|
8195 |
+
}
|
8196 |
+
};
|
8197 |
+
}
|
8198 |
+
});
|
8199 |
+
}
|
8200 |
+
|
8201 |
+
|
8202 |
+
|
8203 |
+
|
8204 |
+
var elemdisplay = {},
|
8205 |
+
iframe, iframeDoc,
|
8206 |
+
rfxtypes = /^(?:toggle|show|hide)$/,
|
8207 |
+
rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
|
8208 |
+
timerId,
|
8209 |
+
fxAttrs = [
|
8210 |
+
// height animations
|
8211 |
+
[ "height", "marginTop", "marginBottom", "paddingTop", "paddingBottom" ],
|
8212 |
+
// width animations
|
8213 |
+
[ "width", "marginLeft", "marginRight", "paddingLeft", "paddingRight" ],
|
8214 |
+
// opacity animations
|
8215 |
+
[ "opacity" ]
|
8216 |
+
],
|
8217 |
+
fxNow;
|
8218 |
+
|
8219 |
+
jQuery.fn.extend({
|
8220 |
+
show: function( speed, easing, callback ) {
|
8221 |
+
var elem, display;
|
8222 |
+
|
8223 |
+
if ( speed || speed === 0 ) {
|
8224 |
+
return this.animate( genFx("show", 3), speed, easing, callback );
|
8225 |
+
|
8226 |
+
} else {
|
8227 |
+
for ( var i = 0, j = this.length; i < j; i++ ) {
|
8228 |
+
elem = this[ i ];
|
8229 |
+
|
8230 |
+
if ( elem.style ) {
|
8231 |
+
display = elem.style.display;
|
8232 |
+
|
8233 |
+
// Reset the inline display of this element to learn if it is
|
8234 |
+
// being hidden by cascaded rules or not
|
8235 |
+
if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
|
8236 |
+
display = elem.style.display = "";
|
8237 |
+
}
|
8238 |
+
|
8239 |
+
// Set elements which have been overridden with display: none
|
8240 |
+
// in a stylesheet to whatever the default browser style is
|
8241 |
+
// for such an element
|
8242 |
+
if ( display === "" && jQuery.css(elem, "display") === "none" ) {
|
8243 |
+
jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
|
8244 |
+
}
|
8245 |
+
}
|
8246 |
+
}
|
8247 |
+
|
8248 |
+
// Set the display of most of the elements in a second loop
|
8249 |
+
// to avoid the constant reflow
|
8250 |
+
for ( i = 0; i < j; i++ ) {
|
8251 |
+
elem = this[ i ];
|
8252 |
+
|
8253 |
+
if ( elem.style ) {
|
8254 |
+
display = elem.style.display;
|
8255 |
+
|
8256 |
+
if ( display === "" || display === "none" ) {
|
8257 |
+
elem.style.display = jQuery._data( elem, "olddisplay" ) || "";
|
8258 |
+
}
|
8259 |
+
}
|
8260 |
+
}
|
8261 |
+
|
8262 |
+
return this;
|
8263 |
+
}
|
8264 |
+
},
|
8265 |
+
|
8266 |
+
hide: function( speed, easing, callback ) {
|
8267 |
+
if ( speed || speed === 0 ) {
|
8268 |
+
return this.animate( genFx("hide", 3), speed, easing, callback);
|
8269 |
+
|
8270 |
+
} else {
|
8271 |
+
var elem, display,
|
8272 |
+
i = 0,
|
8273 |
+
j = this.length;
|
8274 |
+
|
8275 |
+
for ( ; i < j; i++ ) {
|
8276 |
+
elem = this[i];
|
8277 |
+
if ( elem.style ) {
|
8278 |
+
display = jQuery.css( elem, "display" );
|
8279 |
+
|
8280 |
+
if ( display !== "none" && !jQuery._data( elem, "olddisplay" ) ) {
|
8281 |
+
jQuery._data( elem, "olddisplay", display );
|
8282 |
+
}
|
8283 |
+
}
|
8284 |
+
}
|
8285 |
+
|
8286 |
+
// Set the display of the elements in a second loop
|
8287 |
+
// to avoid the constant reflow
|
8288 |
+
for ( i = 0; i < j; i++ ) {
|
8289 |
+
if ( this[i].style ) {
|
8290 |
+
this[i].style.display = "none";
|
8291 |
+
}
|
8292 |
+
}
|
8293 |
+
|
8294 |
+
return this;
|
8295 |
+
}
|
8296 |
+
},
|
8297 |
+
|
8298 |
+
// Save the old toggle function
|
8299 |
+
_toggle: jQuery.fn.toggle,
|
8300 |
+
|
8301 |
+
toggle: function( fn, fn2, callback ) {
|
8302 |
+
var bool = typeof fn === "boolean";
|
8303 |
+
|
8304 |
+
if ( jQuery.isFunction(fn) && jQuery.isFunction(fn2) ) {
|
8305 |
+
this._toggle.apply( this, arguments );
|
8306 |
+
|
8307 |
+
} else if ( fn == null || bool ) {
|
8308 |
+
this.each(function() {
|
8309 |
+
var state = bool ? fn : jQuery(this).is(":hidden");
|
8310 |
+
jQuery(this)[ state ? "show" : "hide" ]();
|
8311 |
+
});
|
8312 |
+
|
8313 |
+
} else {
|
8314 |
+
this.animate(genFx("toggle", 3), fn, fn2, callback);
|
8315 |
+
}
|
8316 |
+
|
8317 |
+
return this;
|
8318 |
+
},
|
8319 |
+
|
8320 |
+
fadeTo: function( speed, to, easing, callback ) {
|
8321 |
+
return this.filter(":hidden").css("opacity", 0).show().end()
|
8322 |
+
.animate({opacity: to}, speed, easing, callback);
|
8323 |
+
},
|
8324 |
+
|
8325 |
+
animate: function( prop, speed, easing, callback ) {
|
8326 |
+
var optall = jQuery.speed( speed, easing, callback );
|
8327 |
+
|
8328 |
+
if ( jQuery.isEmptyObject( prop ) ) {
|
8329 |
+
return this.each( optall.complete, [ false ] );
|
8330 |
+
}
|
8331 |
+
|
8332 |
+
// Do not change referenced properties as per-property easing will be lost
|
8333 |
+
prop = jQuery.extend( {}, prop );
|
8334 |
+
|
8335 |
+
function doAnimation() {
|
8336 |
+
// XXX 'this' does not always have a nodeName when running the
|
8337 |
+
// test suite
|
8338 |
+
|
8339 |
+
if ( optall.queue === false ) {
|
8340 |
+
jQuery._mark( this );
|
8341 |
+
}
|
8342 |
+
|
8343 |
+
var opt = jQuery.extend( {}, optall ),
|
8344 |
+
isElement = this.nodeType === 1,
|
8345 |
+
hidden = isElement && jQuery(this).is(":hidden"),
|
8346 |
+
name, val, p, e,
|
8347 |
+
parts, start, end, unit,
|
8348 |
+
method;
|
8349 |
+
|
8350 |
+
// will store per property easing and be used to determine when an animation is complete
|
8351 |
+
opt.animatedProperties = {};
|
8352 |
+
|
8353 |
+
for ( p in prop ) {
|
8354 |
+
|
8355 |
+
// property name normalization
|
8356 |
+
name = jQuery.camelCase( p );
|
8357 |
+
if ( p !== name ) {
|
8358 |
+
prop[ name ] = prop[ p ];
|
8359 |
+
delete prop[ p ];
|
8360 |
+
}
|
8361 |
+
|
8362 |
+
val = prop[ name ];
|
8363 |
+
|
8364 |
+
// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
|
8365 |
+
if ( jQuery.isArray( val ) ) {
|
8366 |
+
opt.animatedProperties[ name ] = val[ 1 ];
|
8367 |
+
val = prop[ name ] = val[ 0 ];
|
8368 |
+
} else {
|
8369 |
+
opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
|
8370 |
+
}
|
8371 |
+
|
8372 |
+
if ( val === "hide" && hidden || val === "show" && !hidden ) {
|
8373 |
+
return opt.complete.call( this );
|
8374 |
+
}
|
8375 |
+
|
8376 |
+
if ( isElement && ( name === "height" || name === "width" ) ) {
|
8377 |
+
// Make sure that nothing sneaks out
|
8378 |
+
// Record all 3 overflow attributes because IE does not
|
8379 |
+
// change the overflow attribute when overflowX and
|
8380 |
+
// overflowY are set to the same value
|
8381 |
+
opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
|
8382 |
+
|
8383 |
+
// Set display property to inline-block for height/width
|
8384 |
+
// animations on inline elements that are having width/height animated
|
8385 |
+
if ( jQuery.css( this, "display" ) === "inline" &&
|
8386 |
+
jQuery.css( this, "float" ) === "none" ) {
|
8387 |
+
|
8388 |
+
// inline-level elements accept inline-block;
|
8389 |
+
// block-level elements need to be inline with layout
|
8390 |
+
if ( !jQuery.support.inlineBlockNeedsLayout || defaultDisplay( this.nodeName ) === "inline" ) {
|
8391 |
+
this.style.display = "inline-block";
|
8392 |
+
|
8393 |
+
} else {
|
8394 |
+
this.style.zoom = 1;
|
8395 |
+
}
|
8396 |
+
}
|
8397 |
+
}
|
8398 |
+
}
|
8399 |
+
|
8400 |
+
if ( opt.overflow != null ) {
|
8401 |
+
this.style.overflow = "hidden";
|
8402 |
+
}
|
8403 |
+
|
8404 |
+
for ( p in prop ) {
|
8405 |
+
e = new jQuery.fx( this, opt, p );
|
8406 |
+
val = prop[ p ];
|
8407 |
+
|
8408 |
+
if ( rfxtypes.test( val ) ) {
|
8409 |
+
|
8410 |
+
// Tracks whether to show or hide based on private
|
8411 |
+
// data attached to the element
|
8412 |
+
method = jQuery._data( this, "toggle" + p ) || ( val === "toggle" ? hidden ? "show" : "hide" : 0 );
|
8413 |
+
if ( method ) {
|
8414 |
+
jQuery._data( this, "toggle" + p, method === "show" ? "hide" : "show" );
|
8415 |
+
e[ method ]();
|
8416 |
+
} else {
|
8417 |
+
e[ val ]();
|
8418 |
+
}
|
8419 |
+
|
8420 |
+
} else {
|
8421 |
+
parts = rfxnum.exec( val );
|
8422 |
+
start = e.cur();
|
8423 |
+
|
8424 |
+
if ( parts ) {
|
8425 |
+
end = parseFloat( parts[2] );
|
8426 |
+
unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
|
8427 |
+
|
8428 |
+
// We need to compute starting value
|
8429 |
+
if ( unit !== "px" ) {
|
8430 |
+
jQuery.style( this, p, (end || 1) + unit);
|
8431 |
+
start = ( (end || 1) / e.cur() ) * start;
|
8432 |
+
jQuery.style( this, p, start + unit);
|
8433 |
+
}
|
8434 |
+
|
8435 |
+
// If a +=/-= token was provided, we're doing a relative animation
|
8436 |
+
if ( parts[1] ) {
|
8437 |
+
end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
|
8438 |
+
}
|
8439 |
+
|
8440 |
+
e.custom( start, end, unit );
|
8441 |
+
|
8442 |
+
} else {
|
8443 |
+
e.custom( start, val, "" );
|
8444 |
+
}
|
8445 |
+
}
|
8446 |
+
}
|
8447 |
+
|
8448 |
+
// For JS strict compliance
|
8449 |
+
return true;
|
8450 |
+
}
|
8451 |
+
|
8452 |
+
return optall.queue === false ?
|
8453 |
+
this.each( doAnimation ) :
|
8454 |
+
this.queue( optall.queue, doAnimation );
|
8455 |
+
},
|
8456 |
+
|
8457 |
+
stop: function( type, clearQueue, gotoEnd ) {
|
8458 |
+
if ( typeof type !== "string" ) {
|
8459 |
+
gotoEnd = clearQueue;
|
8460 |
+
clearQueue = type;
|
8461 |
+
type = undefined;
|
8462 |
+
}
|
8463 |
+
if ( clearQueue && type !== false ) {
|
8464 |
+
this.queue( type || "fx", [] );
|
8465 |
+
}
|
8466 |
+
|
8467 |
+
return this.each(function() {
|
8468 |
+
var index,
|
8469 |
+
hadTimers = false,
|
8470 |
+
timers = jQuery.timers,
|
8471 |
+
data = jQuery._data( this );
|
8472 |
+
|
8473 |
+
// clear marker counters if we know they won't be
|
8474 |
+
if ( !gotoEnd ) {
|
8475 |
+
jQuery._unmark( true, this );
|
8476 |
+
}
|
8477 |
+
|
8478 |
+
function stopQueue( elem, data, index ) {
|
8479 |
+
var hooks = data[ index ];
|
8480 |
+
jQuery.removeData( elem, index, true );
|
8481 |
+
hooks.stop( gotoEnd );
|
8482 |
+
}
|
8483 |
+
|
8484 |
+
if ( type == null ) {
|
8485 |
+
for ( index in data ) {
|
8486 |
+
if ( data[ index ] && data[ index ].stop && index.indexOf(".run") === index.length - 4 ) {
|
8487 |
+
stopQueue( this, data, index );
|
8488 |
+
}
|
8489 |
+
}
|
8490 |
+
} else if ( data[ index = type + ".run" ] && data[ index ].stop ){
|
8491 |
+
stopQueue( this, data, index );
|
8492 |
+
}
|
8493 |
+
|
8494 |
+
for ( index = timers.length; index--; ) {
|
8495 |
+
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
|
8496 |
+
if ( gotoEnd ) {
|
8497 |
+
|
8498 |
+
// force the next step to be the last
|
8499 |
+
timers[ index ]( true );
|
8500 |
+
} else {
|
8501 |
+
timers[ index ].saveState();
|
8502 |
+
}
|
8503 |
+
hadTimers = true;
|
8504 |
+
timers.splice( index, 1 );
|
8505 |
+
}
|
8506 |
+
}
|
8507 |
+
|
8508 |
+
// start the next in the queue if the last step wasn't forced
|
8509 |
+
// timers currently will call their complete callbacks, which will dequeue
|
8510 |
+
// but only if they were gotoEnd
|
8511 |
+
if ( !( gotoEnd && hadTimers ) ) {
|
8512 |
+
jQuery.dequeue( this, type );
|
8513 |
+
}
|
8514 |
+
});
|
8515 |
+
}
|
8516 |
+
|
8517 |
+
});
|
8518 |
+
|
8519 |
+
// Animations created synchronously will run synchronously
|
8520 |
+
function createFxNow() {
|
8521 |
+
setTimeout( clearFxNow, 0 );
|
8522 |
+
return ( fxNow = jQuery.now() );
|
8523 |
+
}
|
8524 |
+
|
8525 |
+
function clearFxNow() {
|
8526 |
+
fxNow = undefined;
|
8527 |
+
}
|
8528 |
+
|
8529 |
+
// Generate parameters to create a standard animation
|
8530 |
+
function genFx( type, num ) {
|
8531 |
+
var obj = {};
|
8532 |
+
|
8533 |
+
jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice( 0, num )), function() {
|
8534 |
+
obj[ this ] = type;
|
8535 |
+
});
|
8536 |
+
|
8537 |
+
return obj;
|
8538 |
+
}
|
8539 |
+
|
8540 |
+
// Generate shortcuts for custom animations
|
8541 |
+
jQuery.each({
|
8542 |
+
slideDown: genFx( "show", 1 ),
|
8543 |
+
slideUp: genFx( "hide", 1 ),
|
8544 |
+
slideToggle: genFx( "toggle", 1 ),
|
8545 |
+
fadeIn: { opacity: "show" },
|
8546 |
+
fadeOut: { opacity: "hide" },
|
8547 |
+
fadeToggle: { opacity: "toggle" }
|
8548 |
+
}, function( name, props ) {
|
8549 |
+
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
8550 |
+
return this.animate( props, speed, easing, callback );
|
8551 |
+
};
|
8552 |
+
});
|
8553 |
+
|
8554 |
+
jQuery.extend({
|
8555 |
+
speed: function( speed, easing, fn ) {
|
8556 |
+
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
|
8557 |
+
complete: fn || !fn && easing ||
|
8558 |
+
jQuery.isFunction( speed ) && speed,
|
8559 |
+
duration: speed,
|
8560 |
+
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
|
8561 |
+
};
|
8562 |
+
|
8563 |
+
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
|
8564 |
+
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
|
8565 |
+
|
8566 |
+
// normalize opt.queue - true/undefined/null -> "fx"
|
8567 |
+
if ( opt.queue == null || opt.queue === true ) {
|
8568 |
+
opt.queue = "fx";
|
8569 |
+
}
|
8570 |
+
|
8571 |
+
// Queueing
|
8572 |
+
opt.old = opt.complete;
|
8573 |
+
|
8574 |
+
opt.complete = function( noUnmark ) {
|
8575 |
+
if ( jQuery.isFunction( opt.old ) ) {
|
8576 |
+
opt.old.call( this );
|
8577 |
+
}
|
8578 |
+
|
8579 |
+
if ( opt.queue ) {
|
8580 |
+
jQuery.dequeue( this, opt.queue );
|
8581 |
+
} else if ( noUnmark !== false ) {
|
8582 |
+
jQuery._unmark( this );
|
8583 |
+
}
|
8584 |
+
};
|
8585 |
+
|
8586 |
+
return opt;
|
8587 |
+
},
|
8588 |
+
|
8589 |
+
easing: {
|
8590 |
+
linear: function( p, n, firstNum, diff ) {
|
8591 |
+
return firstNum + diff * p;
|
8592 |
+
},
|
8593 |
+
swing: function( p, n, firstNum, diff ) {
|
8594 |
+
return ( ( -Math.cos( p*Math.PI ) / 2 ) + 0.5 ) * diff + firstNum;
|
8595 |
+
}
|
8596 |
+
},
|
8597 |
+
|
8598 |
+
timers: [],
|
8599 |
+
|
8600 |
+
fx: function( elem, options, prop ) {
|
8601 |
+
this.options = options;
|
8602 |
+
this.elem = elem;
|
8603 |
+
this.prop = prop;
|
8604 |
+
|
8605 |
+
options.orig = options.orig || {};
|
8606 |
+
}
|
8607 |
+
|
8608 |
+
});
|
8609 |
+
|
8610 |
+
jQuery.fx.prototype = {
|
8611 |
+
// Simple function for setting a style value
|
8612 |
+
update: function() {
|
8613 |
+
if ( this.options.step ) {
|
8614 |
+
this.options.step.call( this.elem, this.now, this );
|
8615 |
+
}
|
8616 |
+
|
8617 |
+
( jQuery.fx.step[ this.prop ] || jQuery.fx.step._default )( this );
|
8618 |
+
},
|
8619 |
+
|
8620 |
+
// Get the current size
|
8621 |
+
cur: function() {
|
8622 |
+
if ( this.elem[ this.prop ] != null && (!this.elem.style || this.elem.style[ this.prop ] == null) ) {
|
8623 |
+
return this.elem[ this.prop ];
|
8624 |
+
}
|
8625 |
+
|
8626 |
+
var parsed,
|
8627 |
+
r = jQuery.css( this.elem, this.prop );
|
8628 |
+
// Empty strings, null, undefined and "auto" are converted to 0,
|
8629 |
+
// complex values such as "rotate(1rad)" are returned as is,
|
8630 |
+
// simple values such as "10px" are parsed to Float.
|
8631 |
+
return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
|
8632 |
+
},
|
8633 |
+
|
8634 |
+
// Start an animation from one number to another
|
8635 |
+
custom: function( from, to, unit ) {
|
8636 |
+
var self = this,
|
8637 |
+
fx = jQuery.fx;
|
8638 |
+
|
8639 |
+
this.startTime = fxNow || createFxNow();
|
8640 |
+
this.end = to;
|
8641 |
+
this.now = this.start = from;
|
8642 |
+
this.pos = this.state = 0;
|
8643 |
+
this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
|
8644 |
+
|
8645 |
+
function t( gotoEnd ) {
|
8646 |
+
return self.step( gotoEnd );
|
8647 |
+
}
|
8648 |
+
|
8649 |
+
t.queue = this.options.queue;
|
8650 |
+
t.elem = this.elem;
|
8651 |
+
t.saveState = function() {
|
8652 |
+
if ( self.options.hide && jQuery._data( self.elem, "fxshow" + self.prop ) === undefined ) {
|
8653 |
+
jQuery._data( self.elem, "fxshow" + self.prop, self.start );
|
8654 |
+
}
|
8655 |
+
};
|
8656 |
+
|
8657 |
+
if ( t() && jQuery.timers.push(t) && !timerId ) {
|
8658 |
+
timerId = setInterval( fx.tick, fx.interval );
|
8659 |
+
}
|
8660 |
+
},
|
8661 |
+
|
8662 |
+
// Simple 'show' function
|
8663 |
+
show: function() {
|
8664 |
+
var dataShow = jQuery._data( this.elem, "fxshow" + this.prop );
|
8665 |
+
|
8666 |
+
// Remember where we started, so that we can go back to it later
|
8667 |
+
this.options.orig[ this.prop ] = dataShow || jQuery.style( this.elem, this.prop );
|
8668 |
+
this.options.show = true;
|
8669 |
+
|
8670 |
+
// Begin the animation
|
8671 |
+
// Make sure that we start at a small width/height to avoid any flash of content
|
8672 |
+
if ( dataShow !== undefined ) {
|
8673 |
+
// This show is picking up where a previous hide or show left off
|
8674 |
+
this.custom( this.cur(), dataShow );
|
8675 |
+
} else {
|
8676 |
+
this.custom( this.prop === "width" || this.prop === "height" ? 1 : 0, this.cur() );
|
8677 |
+
}
|
8678 |
+
|
8679 |
+
// Start by showing the element
|
8680 |
+
jQuery( this.elem ).show();
|
8681 |
+
},
|
8682 |
+
|
8683 |
+
// Simple 'hide' function
|
8684 |
+
hide: function() {
|
8685 |
+
// Remember where we started, so that we can go back to it later
|
8686 |
+
this.options.orig[ this.prop ] = jQuery._data( this.elem, "fxshow" + this.prop ) || jQuery.style( this.elem, this.prop );
|
8687 |
+
this.options.hide = true;
|
8688 |
+
|
8689 |
+
// Begin the animation
|
8690 |
+
this.custom( this.cur(), 0 );
|
8691 |
+
},
|
8692 |
+
|
8693 |
+
// Each step of an animation
|
8694 |
+
step: function( gotoEnd ) {
|
8695 |
+
var p, n, complete,
|
8696 |
+
t = fxNow || createFxNow(),
|
8697 |
+
done = true,
|
8698 |
+
elem = this.elem,
|
8699 |
+
options = this.options;
|
8700 |
+
|
8701 |
+
if ( gotoEnd || t >= options.duration + this.startTime ) {
|
8702 |
+
this.now = this.end;
|
8703 |
+
this.pos = this.state = 1;
|
8704 |
+
this.update();
|
8705 |
+
|
8706 |
+
options.animatedProperties[ this.prop ] = true;
|
8707 |
+
|
8708 |
+
for ( p in options.animatedProperties ) {
|
8709 |
+
if ( options.animatedProperties[ p ] !== true ) {
|
8710 |
+
done = false;
|
8711 |
+
}
|
8712 |
+
}
|
8713 |
+
|
8714 |
+
if ( done ) {
|
8715 |
+
// Reset the overflow
|
8716 |
+
if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
|
8717 |
+
|
8718 |
+
jQuery.each( [ "", "X", "Y" ], function( index, value ) {
|
8719 |
+
elem.style[ "overflow" + value ] = options.overflow[ index ];
|
8720 |
+
});
|
8721 |
+
}
|
8722 |
+
|
8723 |
+
// Hide the element if the "hide" operation was done
|
8724 |
+
if ( options.hide ) {
|
8725 |
+
jQuery( elem ).hide();
|
8726 |
+
}
|
8727 |
+
|
8728 |
+
// Reset the properties, if the item has been hidden or shown
|
8729 |
+
if ( options.hide || options.show ) {
|
8730 |
+
for ( p in options.animatedProperties ) {
|
8731 |
+
jQuery.style( elem, p, options.orig[ p ] );
|
8732 |
+
jQuery.removeData( elem, "fxshow" + p, true );
|
8733 |
+
// Toggle data is no longer needed
|
8734 |
+
jQuery.removeData( elem, "toggle" + p, true );
|
8735 |
+
}
|
8736 |
+
}
|
8737 |
+
|
8738 |
+
// Execute the complete function
|
8739 |
+
// in the event that the complete function throws an exception
|
8740 |
+
// we must ensure it won't be called twice. #5684
|
8741 |
+
|
8742 |
+
complete = options.complete;
|
8743 |
+
if ( complete ) {
|
8744 |
+
|
8745 |
+
options.complete = false;
|
8746 |
+
complete.call( elem );
|
8747 |
+
}
|
8748 |
+
}
|
8749 |
+
|
8750 |
+
return false;
|
8751 |
+
|
8752 |
+
} else {
|
8753 |
+
// classical easing cannot be used with an Infinity duration
|
8754 |
+
if ( options.duration == Infinity ) {
|
8755 |
+
this.now = t;
|
8756 |
+
} else {
|
8757 |
+
n = t - this.startTime;
|
8758 |
+
this.state = n / options.duration;
|
8759 |
+
|
8760 |
+
// Perform the easing function, defaults to swing
|
8761 |
+
this.pos = jQuery.easing[ options.animatedProperties[this.prop] ]( this.state, n, 0, 1, options.duration );
|
8762 |
+
this.now = this.start + ( (this.end - this.start) * this.pos );
|
8763 |
+
}
|
8764 |
+
// Perform the next step of the animation
|
8765 |
+
this.update();
|
8766 |
+
}
|
8767 |
+
|
8768 |
+
return true;
|
8769 |
+
}
|
8770 |
+
};
|
8771 |
+
|
8772 |
+
jQuery.extend( jQuery.fx, {
|
8773 |
+
tick: function() {
|
8774 |
+
var timer,
|
8775 |
+
timers = jQuery.timers,
|
8776 |
+
i = 0;
|
8777 |
+
|
8778 |
+
for ( ; i < timers.length; i++ ) {
|
8779 |
+
timer = timers[ i ];
|
8780 |
+
// Checks the timer has not already been removed
|
8781 |
+
if ( !timer() && timers[ i ] === timer ) {
|
8782 |
+
timers.splice( i--, 1 );
|
8783 |
+
}
|
8784 |
+
}
|
8785 |
+
|
8786 |
+
if ( !timers.length ) {
|
8787 |
+
jQuery.fx.stop();
|
8788 |
+
}
|
8789 |
+
},
|
8790 |
+
|
8791 |
+
interval: 13,
|
8792 |
+
|
8793 |
+
stop: function() {
|
8794 |
+
clearInterval( timerId );
|
8795 |
+
timerId = null;
|
8796 |
+
},
|
8797 |
+
|
8798 |
+
speeds: {
|
8799 |
+
slow: 600,
|
8800 |
+
fast: 200,
|
8801 |
+
// Default speed
|
8802 |
+
_default: 400
|
8803 |
+
},
|
8804 |
+
|
8805 |
+
step: {
|
8806 |
+
opacity: function( fx ) {
|
8807 |
+
jQuery.style( fx.elem, "opacity", fx.now );
|
8808 |
+
},
|
8809 |
+
|
8810 |
+
_default: function( fx ) {
|
8811 |
+
if ( fx.elem.style && fx.elem.style[ fx.prop ] != null ) {
|
8812 |
+
fx.elem.style[ fx.prop ] = fx.now + fx.unit;
|
8813 |
+
} else {
|
8814 |
+
fx.elem[ fx.prop ] = fx.now;
|
8815 |
+
}
|
8816 |
+
}
|
8817 |
+
}
|
8818 |
+
});
|
8819 |
+
|
8820 |
+
// Adds width/height step functions
|
8821 |
+
// Do not set anything below 0
|
8822 |
+
jQuery.each([ "width", "height" ], function( i, prop ) {
|
8823 |
+
jQuery.fx.step[ prop ] = function( fx ) {
|
8824 |
+
jQuery.style( fx.elem, prop, Math.max(0, fx.now) + fx.unit );
|
8825 |
+
};
|
8826 |
+
});
|
8827 |
+
|
8828 |
+
if ( jQuery.expr && jQuery.expr.filters ) {
|
8829 |
+
jQuery.expr.filters.animated = function( elem ) {
|
8830 |
+
return jQuery.grep(jQuery.timers, function( fn ) {
|
8831 |
+
return elem === fn.elem;
|
8832 |
+
}).length;
|
8833 |
+
};
|
8834 |
+
}
|
8835 |
+
|
8836 |
+
// Try to restore the default display value of an element
|
8837 |
+
function defaultDisplay( nodeName ) {
|
8838 |
+
|
8839 |
+
if ( !elemdisplay[ nodeName ] ) {
|
8840 |
+
|
8841 |
+
var body = document.body,
|
8842 |
+
elem = jQuery( "<" + nodeName + ">" ).appendTo( body ),
|
8843 |
+
display = elem.css( "display" );
|
8844 |
+
elem.remove();
|
8845 |
+
|
8846 |
+
// If the simple way fails,
|
8847 |
+
// get element's real default display by attaching it to a temp iframe
|
8848 |
+
if ( display === "none" || display === "" ) {
|
8849 |
+
// No iframe to use yet, so create it
|
8850 |
+
if ( !iframe ) {
|
8851 |
+
iframe = document.createElement( "iframe" );
|
8852 |
+
iframe.frameBorder = iframe.width = iframe.height = 0;
|
8853 |
+
}
|
8854 |
+
|
8855 |
+
body.appendChild( iframe );
|
8856 |
+
|
8857 |
+
// Create a cacheable copy of the iframe document on first call.
|
8858 |
+
// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
|
8859 |
+
// document to it; WebKit & Firefox won't allow reusing the iframe document.
|
8860 |
+
if ( !iframeDoc || !iframe.createElement ) {
|
8861 |
+
iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
|
8862 |
+
iframeDoc.write( ( document.compatMode === "CSS1Compat" ? "<!doctype html>" : "" ) + "<html><body>" );
|
8863 |
+
iframeDoc.close();
|
8864 |
+
}
|
8865 |
+
|
8866 |
+
elem = iframeDoc.createElement( nodeName );
|
8867 |
+
|
8868 |
+
iframeDoc.body.appendChild( elem );
|
8869 |
+
|
8870 |
+
display = jQuery.css( elem, "display" );
|
8871 |
+
body.removeChild( iframe );
|
8872 |
+
}
|
8873 |
+
|
8874 |
+
// Store the correct default display
|
8875 |
+
elemdisplay[ nodeName ] = display;
|
8876 |
+
}
|
8877 |
+
|
8878 |
+
return elemdisplay[ nodeName ];
|
8879 |
+
}
|
8880 |
+
|
8881 |
+
|
8882 |
+
|
8883 |
+
|
8884 |
+
var rtable = /^t(?:able|d|h)$/i,
|
8885 |
+
rroot = /^(?:body|html)$/i;
|
8886 |
+
|
8887 |
+
if ( "getBoundingClientRect" in document.documentElement ) {
|
8888 |
+
jQuery.fn.offset = function( options ) {
|
8889 |
+
var elem = this[0], box;
|
8890 |
+
|
8891 |
+
if ( options ) {
|
8892 |
+
return this.each(function( i ) {
|
8893 |
+
jQuery.offset.setOffset( this, options, i );
|
8894 |
+
});
|
8895 |
+
}
|
8896 |
+
|
8897 |
+
if ( !elem || !elem.ownerDocument ) {
|
8898 |
+
return null;
|
8899 |
+
}
|
8900 |
+
|
8901 |
+
if ( elem === elem.ownerDocument.body ) {
|
8902 |
+
return jQuery.offset.bodyOffset( elem );
|
8903 |
+
}
|
8904 |
+
|
8905 |
+
try {
|
8906 |
+
box = elem.getBoundingClientRect();
|
8907 |
+
} catch(e) {}
|
8908 |
+
|
8909 |
+
var doc = elem.ownerDocument,
|
8910 |
+
docElem = doc.documentElement;
|
8911 |
+
|
8912 |
+
// Make sure we're not dealing with a disconnected DOM node
|
8913 |
+
if ( !box || !jQuery.contains( docElem, elem ) ) {
|
8914 |
+
return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
|
8915 |
+
}
|
8916 |
+
|
8917 |
+
var body = doc.body,
|
8918 |
+
win = getWindow(doc),
|
8919 |
+
clientTop = docElem.clientTop || body.clientTop || 0,
|
8920 |
+
clientLeft = docElem.clientLeft || body.clientLeft || 0,
|
8921 |
+
scrollTop = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop || body.scrollTop,
|
8922 |
+
scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
|
8923 |
+
top = box.top + scrollTop - clientTop,
|
8924 |
+
left = box.left + scrollLeft - clientLeft;
|
8925 |
+
|
8926 |
+
return { top: top, left: left };
|
8927 |
+
};
|
8928 |
+
|
8929 |
+
} else {
|
8930 |
+
jQuery.fn.offset = function( options ) {
|
8931 |
+
var elem = this[0];
|
8932 |
+
|
8933 |
+
if ( options ) {
|
8934 |
+
return this.each(function( i ) {
|
8935 |
+
jQuery.offset.setOffset( this, options, i );
|
8936 |
+
});
|
8937 |
+
}
|
8938 |
+
|
8939 |
+
if ( !elem || !elem.ownerDocument ) {
|
8940 |
+
return null;
|
8941 |
+
}
|
8942 |
+
|
8943 |
+
if ( elem === elem.ownerDocument.body ) {
|
8944 |
+
return jQuery.offset.bodyOffset( elem );
|
8945 |
+
}
|
8946 |
+
|
8947 |
+
var computedStyle,
|
8948 |
+
offsetParent = elem.offsetParent,
|
8949 |
+
prevOffsetParent = elem,
|
8950 |
+
doc = elem.ownerDocument,
|
8951 |
+
docElem = doc.documentElement,
|
8952 |
+
body = doc.body,
|
8953 |
+
defaultView = doc.defaultView,
|
8954 |
+
prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
|
8955 |
+
top = elem.offsetTop,
|
8956 |
+
left = elem.offsetLeft;
|
8957 |
+
|
8958 |
+
while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
|
8959 |
+
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
|
8960 |
+
break;
|
8961 |
+
}
|
8962 |
+
|
8963 |
+
computedStyle = defaultView ? defaultView.getComputedStyle(elem, null) : elem.currentStyle;
|
8964 |
+
top -= elem.scrollTop;
|
8965 |
+
left -= elem.scrollLeft;
|
8966 |
+
|
8967 |
+
if ( elem === offsetParent ) {
|
8968 |
+
top += elem.offsetTop;
|
8969 |
+
left += elem.offsetLeft;
|
8970 |
+
|
8971 |
+
if ( jQuery.support.doesNotAddBorder && !(jQuery.support.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
|
8972 |
+
top += parseFloat( computedStyle.borderTopWidth ) || 0;
|
8973 |
+
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
|
8974 |
+
}
|
8975 |
+
|
8976 |
+
prevOffsetParent = offsetParent;
|
8977 |
+
offsetParent = elem.offsetParent;
|
8978 |
+
}
|
8979 |
+
|
8980 |
+
if ( jQuery.support.subtractsBorderForOverflowNotVisible && computedStyle.overflow !== "visible" ) {
|
8981 |
+
top += parseFloat( computedStyle.borderTopWidth ) || 0;
|
8982 |
+
left += parseFloat( computedStyle.borderLeftWidth ) || 0;
|
8983 |
+
}
|
8984 |
+
|
8985 |
+
prevComputedStyle = computedStyle;
|
8986 |
+
}
|
8987 |
+
|
8988 |
+
if ( prevComputedStyle.position === "relative" || prevComputedStyle.position === "static" ) {
|
8989 |
+
top += body.offsetTop;
|
8990 |
+
left += body.offsetLeft;
|
8991 |
+
}
|
8992 |
+
|
8993 |
+
if ( jQuery.support.fixedPosition && prevComputedStyle.position === "fixed" ) {
|
8994 |
+
top += Math.max( docElem.scrollTop, body.scrollTop );
|
8995 |
+
left += Math.max( docElem.scrollLeft, body.scrollLeft );
|
8996 |
+
}
|
8997 |
+
|
8998 |
+
return { top: top, left: left };
|
8999 |
+
};
|
9000 |
+
}
|
9001 |
+
|
9002 |
+
jQuery.offset = {
|
9003 |
+
|
9004 |
+
bodyOffset: function( body ) {
|
9005 |
+
var top = body.offsetTop,
|
9006 |
+
left = body.offsetLeft;
|
9007 |
+
|
9008 |
+
if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
|
9009 |
+
top += parseFloat( jQuery.css(body, "marginTop") ) || 0;
|
9010 |
+
left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
|
9011 |
+
}
|
9012 |
+
|
9013 |
+
return { top: top, left: left };
|
9014 |
+
},
|
9015 |
+
|
9016 |
+
setOffset: function( elem, options, i ) {
|
9017 |
+
var position = jQuery.css( elem, "position" );
|
9018 |
+
|
9019 |
+
// set position first, in-case top/left are set even on static elem
|
9020 |
+
if ( position === "static" ) {
|
9021 |
+
elem.style.position = "relative";
|
9022 |
+
}
|
9023 |
+
|
9024 |
+
var curElem = jQuery( elem ),
|
9025 |
+
curOffset = curElem.offset(),
|
9026 |
+
curCSSTop = jQuery.css( elem, "top" ),
|
9027 |
+
curCSSLeft = jQuery.css( elem, "left" ),
|
9028 |
+
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
|
9029 |
+
props = {}, curPosition = {}, curTop, curLeft;
|
9030 |
+
|
9031 |
+
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
9032 |
+
if ( calculatePosition ) {
|
9033 |
+
curPosition = curElem.position();
|
9034 |
+
curTop = curPosition.top;
|
9035 |
+
curLeft = curPosition.left;
|
9036 |
+
} else {
|
9037 |
+
curTop = parseFloat( curCSSTop ) || 0;
|
9038 |
+
curLeft = parseFloat( curCSSLeft ) || 0;
|
9039 |
+
}
|
9040 |
+
|
9041 |
+
if ( jQuery.isFunction( options ) ) {
|
9042 |
+
options = options.call( elem, i, curOffset );
|
9043 |
+
}
|
9044 |
+
|
9045 |
+
if ( options.top != null ) {
|
9046 |
+
props.top = ( options.top - curOffset.top ) + curTop;
|
9047 |
+
}
|
9048 |
+
if ( options.left != null ) {
|
9049 |
+
props.left = ( options.left - curOffset.left ) + curLeft;
|
9050 |
+
}
|
9051 |
+
|
9052 |
+
if ( "using" in options ) {
|
9053 |
+
options.using.call( elem, props );
|
9054 |
+
} else {
|
9055 |
+
curElem.css( props );
|
9056 |
+
}
|
9057 |
+
}
|
9058 |
+
};
|
9059 |
+
|
9060 |
+
|
9061 |
+
jQuery.fn.extend({
|
9062 |
+
|
9063 |
+
position: function() {
|
9064 |
+
if ( !this[0] ) {
|
9065 |
+
return null;
|
9066 |
+
}
|
9067 |
+
|
9068 |
+
var elem = this[0],
|
9069 |
+
|
9070 |
+
// Get *real* offsetParent
|
9071 |
+
offsetParent = this.offsetParent(),
|
9072 |
+
|
9073 |
+
// Get correct offsets
|
9074 |
+
offset = this.offset(),
|
9075 |
+
parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
|
9076 |
+
|
9077 |
+
// Subtract element margins
|
9078 |
+
// note: when an element has margin: auto the offsetLeft and marginLeft
|
9079 |
+
// are the same in Safari causing offset.left to incorrectly be 0
|
9080 |
+
offset.top -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
|
9081 |
+
offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
|
9082 |
+
|
9083 |
+
// Add offsetParent borders
|
9084 |
+
parentOffset.top += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
|
9085 |
+
parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
|
9086 |
+
|
9087 |
+
// Subtract the two offsets
|
9088 |
+
return {
|
9089 |
+
top: offset.top - parentOffset.top,
|
9090 |
+
left: offset.left - parentOffset.left
|
9091 |
+
};
|
9092 |
+
},
|
9093 |
+
|
9094 |
+
offsetParent: function() {
|
9095 |
+
return this.map(function() {
|
9096 |
+
var offsetParent = this.offsetParent || document.body;
|
9097 |
+
while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
|
9098 |
+
offsetParent = offsetParent.offsetParent;
|
9099 |
+
}
|
9100 |
+
return offsetParent;
|
9101 |
+
});
|
9102 |
+
}
|
9103 |
+
});
|
9104 |
+
|
9105 |
+
|
9106 |
+
// Create scrollLeft and scrollTop methods
|
9107 |
+
jQuery.each( ["Left", "Top"], function( i, name ) {
|
9108 |
+
var method = "scroll" + name;
|
9109 |
+
|
9110 |
+
jQuery.fn[ method ] = function( val ) {
|
9111 |
+
var elem, win;
|
9112 |
+
|
9113 |
+
if ( val === undefined ) {
|
9114 |
+
elem = this[ 0 ];
|
9115 |
+
|
9116 |
+
if ( !elem ) {
|
9117 |
+
return null;
|
9118 |
+
}
|
9119 |
+
|
9120 |
+
win = getWindow( elem );
|
9121 |
+
|
9122 |
+
// Return the scroll offset
|
9123 |
+
return win ? ("pageXOffset" in win) ? win[ i ? "pageYOffset" : "pageXOffset" ] :
|
9124 |
+
jQuery.support.boxModel && win.document.documentElement[ method ] ||
|
9125 |
+
win.document.body[ method ] :
|
9126 |
+
elem[ method ];
|
9127 |
+
}
|
9128 |
+
|
9129 |
+
// Set the scroll offset
|
9130 |
+
return this.each(function() {
|
9131 |
+
win = getWindow( this );
|
9132 |
+
|
9133 |
+
if ( win ) {
|
9134 |
+
win.scrollTo(
|
9135 |
+
!i ? val : jQuery( win ).scrollLeft(),
|
9136 |
+
i ? val : jQuery( win ).scrollTop()
|
9137 |
+
);
|
9138 |
+
|
9139 |
+
} else {
|
9140 |
+
this[ method ] = val;
|
9141 |
+
}
|
9142 |
+
});
|
9143 |
+
};
|
9144 |
+
});
|
9145 |
+
|
9146 |
+
function getWindow( elem ) {
|
9147 |
+
return jQuery.isWindow( elem ) ?
|
9148 |
+
elem :
|
9149 |
+
elem.nodeType === 9 ?
|
9150 |
+
elem.defaultView || elem.parentWindow :
|
9151 |
+
false;
|
9152 |
+
}
|
9153 |
+
|
9154 |
+
|
9155 |
+
|
9156 |
+
|
9157 |
+
// Create width, height, innerHeight, innerWidth, outerHeight and outerWidth methods
|
9158 |
+
jQuery.each([ "Height", "Width" ], function( i, name ) {
|
9159 |
+
|
9160 |
+
var type = name.toLowerCase();
|
9161 |
+
|
9162 |
+
// innerHeight and innerWidth
|
9163 |
+
jQuery.fn[ "inner" + name ] = function() {
|
9164 |
+
var elem = this[0];
|
9165 |
+
return elem ?
|
9166 |
+
elem.style ?
|
9167 |
+
parseFloat( jQuery.css( elem, type, "padding" ) ) :
|
9168 |
+
this[ type ]() :
|
9169 |
+
null;
|
9170 |
+
};
|
9171 |
+
|
9172 |
+
// outerHeight and outerWidth
|
9173 |
+
jQuery.fn[ "outer" + name ] = function( margin ) {
|
9174 |
+
var elem = this[0];
|
9175 |
+
return elem ?
|
9176 |
+
elem.style ?
|
9177 |
+
parseFloat( jQuery.css( elem, type, margin ? "margin" : "border" ) ) :
|
9178 |
+
this[ type ]() :
|
9179 |
+
null;
|
9180 |
+
};
|
9181 |
+
|
9182 |
+
jQuery.fn[ type ] = function( size ) {
|
9183 |
+
// Get window width or height
|
9184 |
+
var elem = this[0];
|
9185 |
+
if ( !elem ) {
|
9186 |
+
return size == null ? null : this;
|
9187 |
+
}
|
9188 |
+
|
9189 |
+
if ( jQuery.isFunction( size ) ) {
|
9190 |
+
return this.each(function( i ) {
|
9191 |
+
var self = jQuery( this );
|
9192 |
+
self[ type ]( size.call( this, i, self[ type ]() ) );
|
9193 |
+
});
|
9194 |
+
}
|
9195 |
+
|
9196 |
+
if ( jQuery.isWindow( elem ) ) {
|
9197 |
+
// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
|
9198 |
+
// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
|
9199 |
+
var docElemProp = elem.document.documentElement[ "client" + name ],
|
9200 |
+
body = elem.document.body;
|
9201 |
+
return elem.document.compatMode === "CSS1Compat" && docElemProp ||
|
9202 |
+
body && body[ "client" + name ] || docElemProp;
|
9203 |
+
|
9204 |
+
// Get document width or height
|
9205 |
+
} else if ( elem.nodeType === 9 ) {
|
9206 |
+
// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
|
9207 |
+
return Math.max(
|
9208 |
+
elem.documentElement["client" + name],
|
9209 |
+
elem.body["scroll" + name], elem.documentElement["scroll" + name],
|
9210 |
+
elem.body["offset" + name], elem.documentElement["offset" + name]
|
9211 |
+
);
|
9212 |
+
|
9213 |
+
// Get or set width or height on the element
|
9214 |
+
} else if ( size === undefined ) {
|
9215 |
+
var orig = jQuery.css( elem, type ),
|
9216 |
+
ret = parseFloat( orig );
|
9217 |
+
|
9218 |
+
return jQuery.isNumeric( ret ) ? ret : orig;
|
9219 |
+
|
9220 |
+
// Set the width or height on the element (default to pixels if value is unitless)
|
9221 |
+
} else {
|
9222 |
+
return this.css( type, typeof size === "string" ? size : size + "px" );
|
9223 |
+
}
|
9224 |
+
};
|
9225 |
+
|
9226 |
+
});
|
9227 |
+
|
9228 |
+
|
9229 |
+
|
9230 |
+
|
9231 |
+
// Expose jQuery to the global object
|
9232 |
+
window.jQuery = window.$ = jQuery;
|
9233 |
+
|
9234 |
+
// Expose jQuery as an AMD module, but only for AMD loaders that
|
9235 |
+
// understand the issues with loading multiple versions of jQuery
|
9236 |
+
// in a page that all might call define(). The loader will indicate
|
9237 |
+
// they have special allowances for multiple jQuery versions by
|
9238 |
+
// specifying define.amd.jQuery = true. Register as a named module,
|
9239 |
+
// since jQuery can be concatenated with other files that may use define,
|
9240 |
+
// but not use a proper concatenation script that understands anonymous
|
9241 |
+
// AMD modules. A named AMD is safest and most robust way to register.
|
9242 |
+
// Lowercase jquery is used because AMD module names are derived from
|
9243 |
+
// file names, and jQuery is normally delivered in a lowercase file name.
|
9244 |
+
// Do this after creating the global so that if an AMD module wants to call
|
9245 |
+
// noConflict to hide this version of jQuery, it will work.
|
9246 |
+
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
|
9247 |
+
define( "jquery", [], function () { return jQuery; } );
|
9248 |
+
}
|
9249 |
+
|
9250 |
+
|
9251 |
+
|
9252 |
+
})( window );
|
docs/assets/js/script.js
CHANGED
@@ -1,159 +1,159 @@
|
|
1 |
-
/*!
|
2 |
-
* Documenter 2.0
|
3 |
-
* http://rxa.li/documenter
|
4 |
-
*
|
5 |
-
* Copyright 2011, Xaver Birsak
|
6 |
-
* http://revaxarts.com
|
7 |
-
*
|
8 |
-
*/
|
9 |
-
|
10 |
-
$(document).ready(function() {
|
11 |
-
var timeout,
|
12 |
-
sections = new Array(),
|
13 |
-
sectionscount = 0,
|
14 |
-
win = $(window),
|
15 |
-
sidebar = $('#documenter_sidebar'),
|
16 |
-
nav = $('#documenter_nav'),
|
17 |
-
logo = $('#documenter_logo'),
|
18 |
-
navanchors = nav.find('a'),
|
19 |
-
timeoffset = 50,
|
20 |
-
hash = location.hash || null;
|
21 |
-
iDeviceNotOS4 = (navigator.userAgent.match(/iphone|ipod|ipad/i) && !navigator.userAgent.match(/OS 5/i)) || false,
|
22 |
-
badIE = $('html').prop('class').match(/ie(6|7|8)/)|| false;
|
23 |
-
|
24 |
-
//handle external links (new window)
|
25 |
-
$('a[href^=http]').bind('click',function(){
|
26 |
-
window.open($(this).attr('href'));
|
27 |
-
return false;
|
28 |
-
});
|
29 |
-
|
30 |
-
//IE 8 and lower doesn't like the smooth pagescroll
|
31 |
-
if(!badIE){
|
32 |
-
window.scroll(0,0);
|
33 |
-
|
34 |
-
$('a[href^=#]').bind('click touchstart',function(){
|
35 |
-
hash = $(this).attr('href');
|
36 |
-
$.scrollTo.window().queue([]).stop();
|
37 |
-
goTo(hash);
|
38 |
-
return false;
|
39 |
-
});
|
40 |
-
|
41 |
-
//if a hash is set => go to it
|
42 |
-
if(hash){
|
43 |
-
setTimeout(function(){
|
44 |
-
goTo(hash);
|
45 |
-
},500);
|
46 |
-
}
|
47 |
-
}
|
48 |
-
|
49 |
-
|
50 |
-
//We need the position of each section until the full page with all images is loaded
|
51 |
-
win.bind('load',function(){
|
52 |
-
|
53 |
-
var sectionselector = 'section';
|
54 |
-
|
55 |
-
//Documentation has subcategories
|
56 |
-
if(nav.find('ol').length){
|
57 |
-
sectionselector = 'section, h4';
|
58 |
-
}
|
59 |
-
//saving some information
|
60 |
-
$(sectionselector).each(function(i,e){
|
61 |
-
var _this = $(this);
|
62 |
-
var p = {
|
63 |
-
id: this.id,
|
64 |
-
pos: _this.offset().top
|
65 |
-
};
|
66 |
-
sections.push(p);
|
67 |
-
});
|
68 |
-
|
69 |
-
|
70 |
-
//iPhone, iPod and iPad don't trigger the scroll event
|
71 |
-
if(iDeviceNotOS4){
|
72 |
-
nav.find('a').bind('click',function(){
|
73 |
-
setTimeout(function(){
|
74 |
-
win.trigger('scroll');
|
75 |
-
},duration);
|
76 |
-
|
77 |
-
});
|
78 |
-
//scroll to top
|
79 |
-
window.scroll(0,0);
|
80 |
-
}
|
81 |
-
|
82 |
-
//how many sections
|
83 |
-
sectionscount = sections.length;
|
84 |
-
|
85 |
-
//bind the handler to the scroll event
|
86 |
-
win.bind('scroll',function(event){
|
87 |
-
clearInterval(timeout);
|
88 |
-
//should occur with a delay
|
89 |
-
timeout = setTimeout(function(){
|
90 |
-
//get the position from the very top in all browsers
|
91 |
-
pos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
|
92 |
-
|
93 |
-
//iDeviceNotOS4s don't know the fixed property so we fake it
|
94 |
-
if(iDeviceNotOS4){
|
95 |
-
sidebar.css({height:document.height});
|
96 |
-
logo.css({'margin-top':pos});
|
97 |
-
}
|
98 |
-
//activate Nav element at the current position
|
99 |
-
activateNav(pos);
|
100 |
-
},timeoffset);
|
101 |
-
}).trigger('scroll');
|
102 |
-
|
103 |
-
});
|
104 |
-
|
105 |
-
//the function is called when the hash changes
|
106 |
-
function hashchange(){
|
107 |
-
goTo(location.hash, false);
|
108 |
-
}
|
109 |
-
|
110 |
-
//scroll to a section and set the hash
|
111 |
-
function goTo(hash,changehash){
|
112 |
-
win.unbind('hashchange', hashchange);
|
113 |
-
hash = hash.replace(/!\//,'');
|
114 |
-
win.stop().scrollTo(hash,duration,{
|
115 |
-
easing:easing,
|
116 |
-
axis:'y'
|
117 |
-
});
|
118 |
-
if(changehash !== false){
|
119 |
-
var l = location;
|
120 |
-
location.href = (l.protocol+'//'+l.host+l.pathname+'#!/'+hash.substr(1));
|
121 |
-
}
|
122 |
-
win.bind('hashchange', hashchange);
|
123 |
-
}
|
124 |
-
|
125 |
-
|
126 |
-
//activate current nav element
|
127 |
-
function activateNav(pos){
|
128 |
-
var offset = 100,
|
129 |
-
current, next, parent, isSub, hasSub;
|
130 |
-
win.unbind('hashchange', hashchange);
|
131 |
-
for(var i=sectionscount;i>0;i--){
|
132 |
-
if(sections[i-1].pos <= pos+offset){
|
133 |
-
navanchors.removeClass('current');
|
134 |
-
current = navanchors.eq(i-1);
|
135 |
-
current.addClass('current');
|
136 |
-
|
137 |
-
parent = current.parent().parent();
|
138 |
-
next = current.next();
|
139 |
-
|
140 |
-
hasSub = next.is('ul');
|
141 |
-
isSub = !parent.is('#documenter_nav');
|
142 |
-
|
143 |
-
nav.find('ol:visible').not(parent).slideUp('fast');
|
144 |
-
if(isSub){
|
145 |
-
parent.prev().addClass('current');
|
146 |
-
parent.stop().slideDown('fast');
|
147 |
-
}else if(hasSub){
|
148 |
-
next.stop().slideDown('fast');
|
149 |
-
}
|
150 |
-
win.bind('hashchange', hashchange);
|
151 |
-
break;
|
152 |
-
};
|
153 |
-
}
|
154 |
-
}
|
155 |
-
|
156 |
-
// make code pretty
|
157 |
-
window.prettyPrint && prettyPrint();
|
158 |
-
|
159 |
});
|
1 |
+
/*!
|
2 |
+
* Documenter 2.0
|
3 |
+
* http://rxa.li/documenter
|
4 |
+
*
|
5 |
+
* Copyright 2011, Xaver Birsak
|
6 |
+
* http://revaxarts.com
|
7 |
+
*
|
8 |
+
*/
|
9 |
+
|
10 |
+
$(document).ready(function() {
|
11 |
+
var timeout,
|
12 |
+
sections = new Array(),
|
13 |
+
sectionscount = 0,
|
14 |
+
win = $(window),
|
15 |
+
sidebar = $('#documenter_sidebar'),
|
16 |
+
nav = $('#documenter_nav'),
|
17 |
+
logo = $('#documenter_logo'),
|
18 |
+
navanchors = nav.find('a'),
|
19 |
+
timeoffset = 50,
|
20 |
+
hash = location.hash || null;
|
21 |
+
iDeviceNotOS4 = (navigator.userAgent.match(/iphone|ipod|ipad/i) && !navigator.userAgent.match(/OS 5/i)) || false,
|
22 |
+
badIE = $('html').prop('class').match(/ie(6|7|8)/)|| false;
|
23 |
+
|
24 |
+
//handle external links (new window)
|
25 |
+
$('a[href^=http]').bind('click',function(){
|
26 |
+
window.open($(this).attr('href'));
|
27 |
+
return false;
|
28 |
+
});
|
29 |
+
|
30 |
+
//IE 8 and lower doesn't like the smooth pagescroll
|
31 |
+
if(!badIE){
|
32 |
+
window.scroll(0,0);
|
33 |
+
|
34 |
+
$('a[href^=#]').bind('click touchstart',function(){
|
35 |
+
hash = $(this).attr('href');
|
36 |
+
$.scrollTo.window().queue([]).stop();
|
37 |
+
goTo(hash);
|
38 |
+
return false;
|
39 |
+
});
|
40 |
+
|
41 |
+
//if a hash is set => go to it
|
42 |
+
if(hash){
|
43 |
+
setTimeout(function(){
|
44 |
+
goTo(hash);
|
45 |
+
},500);
|
46 |
+
}
|
47 |
+
}
|
48 |
+
|
49 |
+
|
50 |
+
//We need the position of each section until the full page with all images is loaded
|
51 |
+
win.bind('load',function(){
|
52 |
+
|
53 |
+
var sectionselector = 'section';
|
54 |
+
|
55 |
+
//Documentation has subcategories
|
56 |
+
if(nav.find('ol').length){
|
57 |
+
sectionselector = 'section, h4';
|
58 |
+
}
|
59 |
+
//saving some information
|
60 |
+
$(sectionselector).each(function(i,e){
|
61 |
+
var _this = $(this);
|
62 |
+
var p = {
|
63 |
+
id: this.id,
|
64 |
+
pos: _this.offset().top
|
65 |
+
};
|
66 |
+
sections.push(p);
|
67 |
+
});
|
68 |
+
|
69 |
+
|
70 |
+
//iPhone, iPod and iPad don't trigger the scroll event
|
71 |
+
if(iDeviceNotOS4){
|
72 |
+
nav.find('a').bind('click',function(){
|
73 |
+
setTimeout(function(){
|
74 |
+
win.trigger('scroll');
|
75 |
+
},duration);
|
76 |
+
|
77 |
+
});
|
78 |
+
//scroll to top
|
79 |
+
window.scroll(0,0);
|
80 |
+
}
|
81 |
+
|
82 |
+
//how many sections
|
83 |
+
sectionscount = sections.length;
|
84 |
+
|
85 |
+
//bind the handler to the scroll event
|
86 |
+
win.bind('scroll',function(event){
|
87 |
+
clearInterval(timeout);
|
88 |
+
//should occur with a delay
|
89 |
+
timeout = setTimeout(function(){
|
90 |
+
//get the position from the very top in all browsers
|
91 |
+
pos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop;
|
92 |
+
|
93 |
+
//iDeviceNotOS4s don't know the fixed property so we fake it
|
94 |
+
if(iDeviceNotOS4){
|
95 |
+
sidebar.css({height:document.height});
|
96 |
+
logo.css({'margin-top':pos});
|
97 |
+
}
|
98 |
+
//activate Nav element at the current position
|
99 |
+
activateNav(pos);
|
100 |
+
},timeoffset);
|
101 |
+
}).trigger('scroll');
|
102 |
+
|
103 |
+
});
|
104 |
+
|
105 |
+
//the function is called when the hash changes
|
106 |
+
function hashchange(){
|
107 |
+
goTo(location.hash, false);
|
108 |
+
}
|
109 |
+
|
110 |
+
//scroll to a section and set the hash
|
111 |
+
function goTo(hash,changehash){
|
112 |
+
win.unbind('hashchange', hashchange);
|
113 |
+
hash = hash.replace(/!\//,'');
|
114 |
+
win.stop().scrollTo(hash,duration,{
|
115 |
+
easing:easing,
|
116 |
+
axis:'y'
|
117 |
+
});
|
118 |
+
if(changehash !== false){
|
119 |
+
var l = location;
|
120 |
+
location.href = (l.protocol+'//'+l.host+l.pathname+'#!/'+hash.substr(1));
|
121 |
+
}
|
122 |
+
win.bind('hashchange', hashchange);
|
123 |
+
}
|
124 |
+
|
125 |
+
|
126 |
+
//activate current nav element
|
127 |
+
function activateNav(pos){
|
128 |
+
var offset = 100,
|
129 |
+
current, next, parent, isSub, hasSub;
|
130 |
+
win.unbind('hashchange', hashchange);
|
131 |
+
for(var i=sectionscount;i>0;i--){
|
132 |
+
if(sections[i-1].pos <= pos+offset){
|
133 |
+
navanchors.removeClass('current');
|
134 |
+
current = navanchors.eq(i-1);
|
135 |
+
current.addClass('current');
|
136 |
+
|
137 |
+
parent = current.parent().parent();
|
138 |
+
next = current.next();
|
139 |
+
|
140 |
+
hasSub = next.is('ul');
|
141 |
+
isSub = !parent.is('#documenter_nav');
|
142 |
+
|
143 |
+
nav.find('ol:visible').not(parent).slideUp('fast');
|
144 |
+
if(isSub){
|
145 |
+
parent.prev().addClass('current');
|
146 |
+
parent.stop().slideDown('fast');
|
147 |
+
}else if(hasSub){
|
148 |
+
next.stop().slideDown('fast');
|
149 |
+
}
|
150 |
+
win.bind('hashchange', hashchange);
|
151 |
+
break;
|
152 |
+
};
|
153 |
+
}
|
154 |
+
}
|
155 |
+
|
156 |
+
// make code pretty
|
157 |
+
window.prettyPrint && prettyPrint();
|
158 |
+
|
159 |
});
|
docs/index.html
CHANGED
@@ -13,7 +13,7 @@
|
|
13 |
<meta name="author" content="Soft79">
|
14 |
<meta name="copyright" content="Soft79">
|
15 |
<meta name="generator" content="Documenter v2.0 http://rxa.li/documenter">
|
16 |
-
<meta name="date" content="
|
17 |
|
18 |
<link rel="stylesheet" href="assets/css/documenter_style.css" media="all">
|
19 |
<link rel="stylesheet" href="assets/js/google-code-prettify/prettify.css" media="screen">
|
@@ -75,15 +75,18 @@
|
|
75 |
<li><a class="current" href="#documenter_cover">Start</a></li>
|
76 |
|
77 |
<li><a href="#features" title="Features">Features</a></li>
|
78 |
-
<li><a href="#
|
79 |
<li><a href="#free_products" title="Free products">Free products</a></li>
|
80 |
<li><a href="#checkout" title="Checkout">Checkout</a></li>
|
81 |
<li><a href="#auto_coupon" title="Auto coupon">Auto coupon</a></li>
|
|
|
82 |
<li><a href="#coupon_by_url" title="Coupon by URL">Coupon by URL</a></li>
|
|
|
|
|
83 |
<li><a href="#where_to_buy" title="Where to buy">Where to buy</a></li>
|
84 |
|
85 |
</ul>
|
86 |
-
<div id="documenter_copyright">Copyright Soft79
|
87 |
made with the <a href="http://rxa.li/documenter">Documenter v2.0</a>
|
88 |
</div>
|
89 |
</div>
|
@@ -97,7 +100,7 @@
|
|
97 |
<hr>
|
98 |
<ul>
|
99 |
<li>created: 07/05/2014</li>
|
100 |
-
<li>latest update:
|
101 |
<li>by: Soft79</li>
|
102 |
<li><a href=""></a></li>
|
103 |
|
@@ -143,52 +146,45 @@
|
|
143 |
<p>
|
144 |
</p>
|
145 |
<p>
|
146 |
-
The
|
147 |
<p>
|
148 |
-
<img alt="Screenshot: Extended features tabs" src="assets/images/
|
149 |
<p>
|
150 |
</p>
|
151 |
</section>
|
152 |
-
<section id="
|
153 |
-
<div class="page-header"><h3>
|
154 |
-
<p>
|
155 |
-
<
|
156 |
-
<p>
|
157 |
-
|
158 |
-
<p>
|
159 |
-
|
160 |
-
<
|
161 |
-
<
|
162 |
-
|
163 |
-
<h4 id="
|
164 |
-
<p>
|
165 |
-
|
166 |
-
<h4 id="
|
167 |
-
<p>
|
168 |
-
|
169 |
-
<
|
170 |
-
<p>
|
171 |
-
The coupon will only validate if the total value of the products matching the product or category restrictions (on the '<em>Usage Restriction</em>'-tab in the cart is within this range. If no product or category restriction is entered, the total value of all of the products in the cart will be used.</p>
|
172 |
-
<p>
|
173 |
-
<strong>Please note</strong>: The difference between this option and the 'minimum/maximum spend' on the 'General'-tab is that on the general tab the subtotal of <em>all</em> of the items in the cart is compared.</p>
|
174 |
-
<h4 id="product_restrictions_discount_on_cart_with_excluded_products_pro_version_only_">Discount on cart with excluded products (PRO Version Only)</h4>
|
175 |
-
<p>
|
176 |
-
This option is only visible if the discount type is <em>Cart Discount</em> or <em>Cart % Discount</em>.</p>
|
177 |
-
<p>
|
178 |
-
By default, When the coupon is setup as a 'Cart Discount' it will never validate a coupon when an excluded product is in the cart (this is how WooCommerce Coupons work). By checking this box the coupon will still validate when an excluded product is in the cart. Useful for cart discounts based on a subtotal of matching products, but having some products or categories excluded.</p>
|
179 |
-
<p>
|
180 |
-
<img alt="Screenshot: Excluded products" src="assets/images/image_3.png" style="width: 761px; height: 181px;"></p>
|
181 |
</section>
|
182 |
<section id="free_products">
|
183 |
<div class="page-header"><h3>Free products</h3><hr class="notop"></div>
|
184 |
<p>
|
185 |
<strong>(PRO Version Only)</strong></p>
|
186 |
<p>
|
187 |
-
|
188 |
<p>
|
189 |
-
|
190 |
<p>
|
191 |
-
|
|
|
|
|
|
|
|
|
192 |
<p>
|
193 |
If you wish to change the look-and-feel of the product selection you must create a subdirectory <strong>woocommerce-auto-added-coupons-pro</strong> in your themes directory and copy and edit the files <strong>templates/cart/select-free-product.php</strong> and <strong>templates/checkout/select-free-product.php</strong> in here.</p>
|
194 |
<p>
|
@@ -201,7 +197,7 @@
|
|
201 |
<p>
|
202 |
</p>
|
203 |
<p>
|
204 |
-
<img alt="Screenshot: Free product in cart" src="assets/images/
|
205 |
</section>
|
206 |
<section id="checkout">
|
207 |
<div class="page-header"><h3>Checkout</h3><hr class="notop"></div>
|
@@ -226,15 +222,20 @@
|
|
226 |
</section>
|
227 |
<section id="auto_coupon">
|
228 |
<div class="page-header"><h3>Auto coupon</h3><hr class="notop"></div>
|
|
|
229 |
<p> You can convert a coupon into a discount rule simply by ticking the "Auto coupon" checkbox on the '<em>miscellaneous</em>'-tab. When using this option it is <u>important to enter a description for the coupon</u>, as this will be presented to the customer.</p>
|
230 |
<p> When this option is activated, the discount will automatically be applied to the cart when it's conditions are met and the description will be presented to the customer and on the cart page. Once the conditions are no longer met, for example when the customer removes an item from the cart, the discount will be removed from the cart.</p>
|
231 |
<h4 id="auto_coupon_apply_silently">Apply silently</h4>
|
232 |
<p> When this box is checked, no 'Discount applied' notice will be presented when the coupon is applied.</p>
|
233 |
<p> </p>
|
234 |
-
|
235 |
-
<
|
236 |
-
<
|
237 |
-
<p>
|
|
|
|
|
|
|
|
|
238 |
</section>
|
239 |
<section id="coupon_by_url">
|
240 |
<div class="page-header"><h3>Coupon by URL</h3><hr class="notop"></div>
|
@@ -246,6 +247,227 @@ http://www.your-store.nl/cart/?add-to-cart=4321&quantity=3&apply_coupon=
|
|
246 |
<p> </p>
|
247 |
<p> If the customer opens the url when the conditions of the coupon are not yet met or the cart is empty the coupon won't be applied yet, instead the following message will be displayed: <em>Coupon will be applied once it's conditions are met</em>. Once the conditions of the coupon are met it will be applied automatically.</p>
|
248 |
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
249 |
<section id="where_to_buy">
|
250 |
<div class="page-header"><h3>Where to buy</h3><hr class="notop"></div>
|
251 |
<p> Want to increase your conversion? Then purchase this plugin and start offering special deals to your customers right away!</p>
|
13 |
<meta name="author" content="Soft79">
|
14 |
<meta name="copyright" content="Soft79">
|
15 |
<meta name="generator" content="Documenter v2.0 http://rxa.li/documenter">
|
16 |
+
<meta name="date" content="2017-09-22T00:00:00+02:00">
|
17 |
|
18 |
<link rel="stylesheet" href="assets/css/documenter_style.css" media="all">
|
19 |
<link rel="stylesheet" href="assets/js/google-code-prettify/prettify.css" media="screen">
|
75 |
<li><a class="current" href="#documenter_cover">Start</a></li>
|
76 |
|
77 |
<li><a href="#features" title="Features">Features</a></li>
|
78 |
+
<li><a href="#additional_usage_restrictions" title="Additional usage restrictions">Additional usage restrictions</a></li>
|
79 |
<li><a href="#free_products" title="Free products">Free products</a></li>
|
80 |
<li><a href="#checkout" title="Checkout">Checkout</a></li>
|
81 |
<li><a href="#auto_coupon" title="Auto coupon">Auto coupon</a></li>
|
82 |
+
<li><a href="#allow_applying_when_invalid" title="Allow applying when invalid">Allow applying when invalid</a></li>
|
83 |
<li><a href="#coupon_by_url" title="Coupon by URL">Coupon by URL</a></li>
|
84 |
+
<li><a href="#automatic_updates" title="Automatic updates">Automatic updates</a></li>
|
85 |
+
<li><a href="#api" title="API">API</a></li>
|
86 |
<li><a href="#where_to_buy" title="Where to buy">Where to buy</a></li>
|
87 |
|
88 |
</ul>
|
89 |
+
<div id="documenter_copyright">Copyright Soft79 2017<br>
|
90 |
made with the <a href="http://rxa.li/documenter">Documenter v2.0</a>
|
91 |
</div>
|
92 |
</div>
|
100 |
<hr>
|
101 |
<ul>
|
102 |
<li>created: 07/05/2014</li>
|
103 |
+
<li>latest update: 09/22/2017</li>
|
104 |
<li>by: Soft79</li>
|
105 |
<li><a href=""></a></li>
|
106 |
|
146 |
<p>
|
147 |
</p>
|
148 |
<p>
|
149 |
+
The following three tabs will be added when the plugin is enabled:</p>
|
150 |
<p>
|
151 |
+
<img alt="Screenshot: Extended features tabs" src="assets/images/image_5.png"></p>
|
152 |
<p>
|
153 |
</p>
|
154 |
</section>
|
155 |
+
<section id="additional_usage_restrictions">
|
156 |
+
<div class="page-header"><h3>Additional usage restrictions</h3><hr class="notop"></div>
|
157 |
+
<p> <strong>WooCommerce Extended Coupon Features</strong> adds extra features to the '<em>Usage restriction</em>'-tab of the coupon edit page. Here extra rules can be configured that work in combination with the <em>Products</em>, <em>Exclude products</em>, <em>Product categories</em> and <em>Exclude categories</em> rules. </p>
|
158 |
+
<p> <img alt="Usage restriction tab" src="assets/images/image_7.png"></p>
|
159 |
+
<p> </p>
|
160 |
+
<h4 id="additional_usage_restrictions_and_products_not_or_">AND Products (not OR)</h4>
|
161 |
+
<p> By default a coupon validates if only one of the selected products is in the cart. Check this box if ALL of the products entered on the '<em>Usage Restriction</em>'-tab must be in the cart to validate the coupon. The word 'OR' or 'AND' is displayed next to the 'Products'-field on the '<em>Usage Restriction</em>'-tab for clarification.</p>
|
162 |
+
<h4 id="additional_usage_restrictions_and_categories_not_or_">AND Categories (not OR)</h4>
|
163 |
+
<p> By default a coupon validates if a product from any of the selected categories is in the cart. Check this box if products from ALL of the categories entered on the '<em>Usage Restriction</em>'-tab must be in the cart to validate the coupon. The word 'OR' or 'AND' is displayed next to the 'Products'-field on the '<em>Usage Restriction</em>'-tab for clarification.</p>
|
164 |
+
<h4 id="additional_usage_restrictions_minimum_maximum_quantity_of_matching_products">Minimum/maximum quantity of matching products</h4>
|
165 |
+
<p> The coupon will only validate if the number of products matching the product or category restrictions (on the '<em>Usage Restriction</em>'-tab in the cart is within this range. If no product or category restriction is entered, the total quantity of all of the products in the cart will be used.</p>
|
166 |
+
<h4 id="additional_usage_restrictions_minimum_maximum_subtotal_of_matching_products">Minimum/maximum subtotal of matching products</h4>
|
167 |
+
<p> The coupon will only validate if the total value of the products matching the product or category restrictions (on the '<em>Usage Restriction</em>'-tab in the cart is within this range. If no product or category restriction is entered, the total value of all of the products in the cart will be used.</p>
|
168 |
+
<p> <strong>Please note</strong>: The difference between this option and the 'minimum/maximum spend' on the 'General'-tab is that on the general tab the subtotal of <em>all</em> of the items in the cart is compared.</p>
|
169 |
+
<h4 id="additional_usage_restrictions_discount_on_cart_with_excluded_products_pro_version_only_">Discount on cart with excluded products (PRO Version Only)</h4>
|
170 |
+
<p> This option is only visible if the discount type is <em>Cart Discount</em> or <em>Cart % Discount</em>.</p>
|
171 |
+
<p> By default, When the coupon is setup as a 'Cart Discount' it will never validate a coupon when an excluded product is in the cart (this is how WooCommerce Coupons work). By checking this box the coupon will still validate when an excluded product is in the cart. Useful for cart discounts based on a subtotal of matching products, but having some products or categories excluded.</p>
|
172 |
+
<p> </p>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
173 |
</section>
|
174 |
<section id="free_products">
|
175 |
<div class="page-header"><h3>Free products</h3><hr class="notop"></div>
|
176 |
<p>
|
177 |
<strong>(PRO Version Only)</strong></p>
|
178 |
<p>
|
179 |
+
On the 'Products'-tab </p>
|
180 |
<p>
|
181 |
+
In the '<em>Free products</em>'-field on the '<em>Free products</em>'-tab you can enter one or more products that will automatically be added to the cart when the coupon is applied. The product will automatically be removed when the coupon is no longer valid.</p>
|
182 |
<p>
|
183 |
+
If you tick the '<em>select one</em>'-checkbox, the customer must choose one (or more) of the selected products on the cart or checkout page. The customer can also choose the desired variations of a variable product. You can also edit the message that is displayed.</p>
|
184 |
+
<p>
|
185 |
+
</p>
|
186 |
+
<p>
|
187 |
+
<img alt="Choose a free gift" src="assets/images/image_8.png"></p>
|
188 |
<p>
|
189 |
If you wish to change the look-and-feel of the product selection you must create a subdirectory <strong>woocommerce-auto-added-coupons-pro</strong> in your themes directory and copy and edit the files <strong>templates/cart/select-free-product.php</strong> and <strong>templates/checkout/select-free-product.php</strong> in here.</p>
|
190 |
<p>
|
197 |
<p>
|
198 |
</p>
|
199 |
<p>
|
200 |
+
<img alt="Screenshot: Free product in cart" src="assets/images/image_2.png" style="width: 738px; height: 632px;"></p>
|
201 |
</section>
|
202 |
<section id="checkout">
|
203 |
<div class="page-header"><h3>Checkout</h3><hr class="notop"></div>
|
222 |
</section>
|
223 |
<section id="auto_coupon">
|
224 |
<div class="page-header"><h3>Auto coupon</h3><hr class="notop"></div>
|
225 |
+
<p> <img alt="Screenshot - Configuring an 'auto coupon'" src="assets/images/image_6.png"></p>
|
226 |
<p> You can convert a coupon into a discount rule simply by ticking the "Auto coupon" checkbox on the '<em>miscellaneous</em>'-tab. When using this option it is <u>important to enter a description for the coupon</u>, as this will be presented to the customer.</p>
|
227 |
<p> When this option is activated, the discount will automatically be applied to the cart when it's conditions are met and the description will be presented to the customer and on the cart page. Once the conditions are no longer met, for example when the customer removes an item from the cart, the discount will be removed from the cart.</p>
|
228 |
<h4 id="auto_coupon_apply_silently">Apply silently</h4>
|
229 |
<p> When this box is checked, no 'Discount applied' notice will be presented when the coupon is applied.</p>
|
230 |
<p> </p>
|
231 |
+
</section>
|
232 |
+
<section id="allow_applying_when_invalid">
|
233 |
+
<div class="page-header"><h3>Allow applying when invalid</h3><hr class="notop"></div>
|
234 |
+
<p> <strong>(PRO Version Only)</strong></p>
|
235 |
+
<div>
|
236 |
+
<img alt="Allow invalid coupons" src="assets/images/image_3.png"></div>
|
237 |
+
<p> When the box '<em>Allow applying when invalid</em>' is ticked, a customer can always add the coupon to the cart, but will be presented with a message that the discount will only apply when the conditions are met.</p>
|
238 |
+
<p> NOTE: This option is not available for 'Auto coupons'.</p>
|
239 |
</section>
|
240 |
<section id="coupon_by_url">
|
241 |
<div class="page-header"><h3>Coupon by URL</h3><hr class="notop"></div>
|
247 |
<p> </p>
|
248 |
<p> If the customer opens the url when the conditions of the coupon are not yet met or the cart is empty the coupon won't be applied yet, instead the following message will be displayed: <em>Coupon will be applied once it's conditions are met</em>. Once the conditions of the coupon are met it will be applied automatically.</p>
|
249 |
</section>
|
250 |
+
<section id="automatic_updates">
|
251 |
+
<div class="page-header"><h3>Automatic updates</h3><hr class="notop"></div>
|
252 |
+
<p> <strong>(PRO Version Only)</strong></p>
|
253 |
+
<div>
|
254 |
+
To receive automatic updates, you need to enter the licence key.</div>
|
255 |
+
<p> <strong><u>NOTE:</u> This is only possible if you purchased the plugin at soft79.nl.</strong></p>
|
256 |
+
<p> </p>
|
257 |
+
<p> Go to: <strong>wp-admin</strong> > <strong>Settings</strong> > <strong>WooCommerce Extended Coupon Features</strong></p>
|
258 |
+
<p> <img alt="Licence settings" src="assets/images/image_4.png"></p>
|
259 |
+
<p> Enter the domain and licence key. The licence will be automatically activated.</p>
|
260 |
+
<p> To deactivate a licence key for a domain (e.g. to move it to a different domain) just empty the fields and save the settings. The licence will automatically be deactivated for the domain and can be used on a different domain.</p>
|
261 |
+
<p> You can also manage you licence activations from your <a href="https://www.soft79.nl/my-account/">account page</a> at soft79.nl.</p>
|
262 |
+
</section>
|
263 |
+
<section id="api">
|
264 |
+
<div class="page-header"><h3>API</h3><hr class="notop"></div>
|
265 |
+
<h4 id="api_create_mini_plugins_for_extended_coupon_features">Create mini-plugins for Extended Coupon Features</h4>
|
266 |
+
<p> You can further extend functionality of WooCommerce Extended Coupon Features by creating your own mini-plugins.</p>
|
267 |
+
<ol>
|
268 |
+
<li> <p> Hook into the <em>wjecf_init_plugins</em>-action.<span style="color: rgb(68, 68, 68); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;"> (Using this hook guarantees that the WooCommerce and WooCommerce Extended Coupon Features plugins are loaded)</span></p>
|
269 |
+
</li>
|
270 |
+
<li> <p> Here, create a class that extends <em>Abstract_WJECF_Plugin.</em></p>
|
271 |
+
</li>
|
272 |
+
<li> <p> <span style="color: rgb(68, 68, 68); font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;">Create a constructor, where you setup the plugin data by calling </span><em>$this->set_plugin_data</em></p>
|
273 |
+
</li>
|
274 |
+
<li> <p> Create a function <em>init_hook()</em>, where you setup your plugin and define frontend hooks.</p>
|
275 |
+
</li>
|
276 |
+
<li> <p> Create a function <em>init_admin_hook()</em>, where you setup your plugin for admin usage and define admin hooks.</p>
|
277 |
+
</li>
|
278 |
+
<li> <p> (Version 2.5.1+ only) Create a a function <em>admin_coupon_meta_fields( $coupon )</em>, and have it return an array <em>[ 'field_name' => 'sanitation', ... ]</em> .<br>
|
279 |
+
<br>
|
280 |
+
Upon saving a coupon, these fields will be automatically read from $_POST and sanitized with the given sanition method, e.g. 'int', 'int[]', 'yesno', 'decimal', 'clean' or even a callback: [ 'callback' => callback ] and saved to the current coupon. For versions prior to 2.5.1, you need to handle <em>process_shop_coupon_meta </em>yourself.</p>
|
281 |
+
</li>
|
282 |
+
<li> <p> Load the class by calling <em>WJECF()->add_plugin( 'NameOfYourClass');</em></p>
|
283 |
+
</li>
|
284 |
+
</ol>
|
285 |
+
<div>
|
286 |
+
<div>
|
287 |
+
Example:</div>
|
288 |
+
<div>
|
289 |
+
</div>
|
290 |
+
<div>
|
291 |
+
<pre class="prettyprint lang-php linenums">
|
292 |
+
<?php
|
293 |
+
/**
|
294 |
+
Plugin Name: WJECF Example plugin - Allow a coupon on certain weekdays only
|
295 |
+
Description: An example on how to extend WooCommerce Extended Coupon Features
|
296 |
+
Author: Soft79
|
297 |
+
Version: 1.0
|
298 |
+
Author URI: http://www.soft79.nl/
|
299 |
+
*/
|
300 |
+
|
301 |
+
add_action( 'wjecf_init_plugins', 'setup_my_wjecf_example_plugin' );
|
302 |
+
|
303 |
+
function setup_my_wjecf_example_plugin() {
|
304 |
+
|
305 |
+
class WJECF_Plugin_Example extends Abstract_WJECF_Plugin {
|
306 |
+
|
307 |
+
//This is the meta-key where the weekday will be saved
|
308 |
+
//HINT: Prepend it with _wjecf_<your plugin name> to avoid naming conflicts
|
309 |
+
const META_KEY_WEEKDAY = '_wjecf_example_plugin_weekday';
|
310 |
+
|
311 |
+
/**
|
312 |
+
* In the constructor you can supply general information about your WJECF-plugin.
|
313 |
+
*/
|
314 |
+
public function __construct() {
|
315 |
+
$this->set_plugin_data( array(
|
316 |
+
'description' => __( 'WJECF Example plugin - Accept a coupon on certain weekdays only.', 'your-text-domain' ),
|
317 |
+
'dependencies' => array(),
|
318 |
+
'minimal_wjecf_version' => '2.5.1',
|
319 |
+
'can_be_disabled' => true
|
320 |
+
) );
|
321 |
+
}
|
322 |
+
|
323 |
+
//FRONTEND
|
324 |
+
|
325 |
+
/**
|
326 |
+
* This function is called when WooCommerce and all other plugins are loaded.
|
327 |
+
* Here you can setup frontend hooks.
|
328 |
+
*/
|
329 |
+
|
330 |
+
public function init_hook() {
|
331 |
+
add_action( 'woocommerce_coupon_is_valid', array( $this, 'filter_woocommerce_coupon_is_valid' ), 10, 2 );
|
332 |
+
}
|
333 |
+
|
334 |
+
|
335 |
+
/**
|
336 |
+
* Invalidates the coupon if the weekday is not ok
|
337 |
+
* @param bool $valid
|
338 |
+
* @param WC_Coupon $coupon
|
339 |
+
* @return bool False if invalid
|
340 |
+
*/
|
341 |
+
|
342 |
+
public function filter_woocommerce_coupon_is_valid( $valid, $coupon ) {
|
343 |
+
if ( is_callable( array( $coupon, 'get_meta' ) ) ) {
|
344 |
+
//WC3.0+
|
345 |
+
$coupon_weekday = $coupon->get_meta( self::META_KEY_WEEKDAY );
|
346 |
+
} else {
|
347 |
+
//Older WC versions
|
348 |
+
$coupon_weekday = get_post_meta( $coupon->id, self::META_KEY_WEEKDAY, true );
|
349 |
+
}
|
350 |
+
|
351 |
+
//Not valid if the weekday differs
|
352 |
+
if ( is_numeric( $coupon_weekday ) && date('w') != $coupon_weekday ) {
|
353 |
+
return false;
|
354 |
+
}
|
355 |
+
|
356 |
+
return $valid;
|
357 |
+
}
|
358 |
+
|
359 |
+
//ADMIN
|
360 |
+
|
361 |
+
/**
|
362 |
+
* This function is called when WooCommerce and all other plugins are loaded and we are on the admin section of WordPress.
|
363 |
+
* Here you can setup admin hooks.
|
364 |
+
*/
|
365 |
+
public function init_admin_hook() {
|
366 |
+
add_action( 'woocommerce_coupon_options_usage_restriction', array( $this, 'action_woocommerce_coupon_options_usage_restriction' ), 9999 ); //9999 is at the bottom of the tab
|
367 |
+
}
|
368 |
+
|
369 |
+
/**
|
370 |
+
* Automatically called at the process_shop_coupon_meta action (WJECF 2.5.1+ only).
|
371 |
+
*
|
372 |
+
* Returns an array [ meta_key => sanitizion_rule, ... ] with the meta fields that must be saved if the user clicks 'Update' on the coupon admin page. *
|
373 |
+
* Valid sanitizion rules are: 'html', 'clean', 'yesno', 'decimal', 'int', 'int[]' (array of ints), 'int,' (comma separated ints)
|
374 |
+
*
|
375 |
+
* $_POST[meta_key] will be sanitized and automatically saved.
|
376 |
+
*
|
377 |
+
* @since 2.5.1
|
378 |
+
* @param WC_Coupon $coupon The coupon that will be saved
|
379 |
+
* @return array An array with [ key => sanitizion_rule, ... ]
|
380 |
+
*/
|
381 |
+
public function admin_coupon_meta_fields( $coupon ) {
|
382 |
+
return array( self::META_KEY_WEEKDAY => 'int' );
|
383 |
+
}
|
384 |
+
|
385 |
+
/**
|
386 |
+
* This is called when the usage restrictions tab is rendered.
|
387 |
+
*/
|
388 |
+
public function action_woocommerce_coupon_options_usage_restriction() {
|
389 |
+
woocommerce_wp_select(
|
390 |
+
array(
|
391 |
+
'id' => self::META_KEY_WEEKDAY,
|
392 |
+
'label' => __( 'Weekday', 'woocommerce-jos-autocoupon' ),
|
393 |
+
'options' => array(
|
394 |
+
'' => '(Always valid)',
|
395 |
+
0 => 'Sunday',
|
396 |
+
1 => 'Monday',
|
397 |
+
2 => 'Tuesday',
|
398 |
+
3 => 'Wednesday',
|
399 |
+
4 => 'Thursday',
|
400 |
+
5 => 'Friday',
|
401 |
+
6 => 'Saturday'
|
402 |
+
),
|
403 |
+
'description' => __( 'Coupon is only valid on this weekday.', 'your-text-domain' ),
|
404 |
+
'desc_tip' => true
|
405 |
+
)
|
406 |
+
);
|
407 |
+
}
|
408 |
+
}
|
409 |
+
|
410 |
+
//Loads the plugin!
|
411 |
+
WJECF()->add_plugin( 'WJECF_Plugin_Example' );
|
412 |
+
}
|
413 |
+
</pre>
|
414 |
+
</div>
|
415 |
+
</div>
|
416 |
+
<p> </p>
|
417 |
+
<h4 id="api_api_functions">API Functions</h4>
|
418 |
+
<p> The API functions are in WJECF_Pro_Api.php and can be called using WJECF_API()->function_name() .</p>
|
419 |
+
<p> Documentation is not yet available, but see wjecf-pro-api-example.php for reference.</p>
|
420 |
+
<p> </p>
|
421 |
+
<h4 id="api_hooks_of_woocommerce_extended_coupon_features">Hooks of WooCommerce Extended Coupon Features</h4>
|
422 |
+
<div>
|
423 |
+
These filters are called by WooCommerce Extended Coupon Features:</div>
|
424 |
+
<div>
|
425 |
+
</div>
|
426 |
+
<div>
|
427 |
+
<div>
|
428 |
+
apply_filters( 'wjecf_bogo_product_amount_for_coupon', $qty, $coupon )</div>
|
429 |
+
<div>
|
430 |
+
apply_filters( 'wjecf_set_free_product_amount_in_cart', $quantity, $product )</div>
|
431 |
+
<div>
|
432 |
+
apply_filters( 'wjecf_free_product_amount_for_coupon', $coupon_qty, $coupon )</div>
|
433 |
+
<div>
|
434 |
+
apply_filters( 'wjecf_free_cart_item_price', __('Free!', 'woocommerce'), $price_html, $cart_item, $cart_item_key )</div>
|
435 |
+
<div>
|
436 |
+
apply_filters( 'wjecf_free_cart_item_subtotal', __('Free!', 'woocommerce'), $price_html, $cart_item, $cart_item_key )</div>
|
437 |
+
<div>
|
438 |
+
apply_filters( 'wjecf_coupon_can_be_applied', $can_be_applied, $coupon )</div>
|
439 |
+
<div>
|
440 |
+
apply_filters( 'wjecf_coupon_has_a_value', $has_a_value, $coupon )</div>
|
441 |
+
<div>
|
442 |
+
</div>
|
443 |
+
</div>
|
444 |
+
<div>
|
445 |
+
<div>
|
446 |
+
These actions are called by WooCommerce Extended Coupon Features:</div>
|
447 |
+
<div>
|
448 |
+
</div>
|
449 |
+
</div>
|
450 |
+
<div>
|
451 |
+
<div>
|
452 |
+
do_action( 'wjecf_coupon_metabox_checkout', $thepostid, $post );</div>
|
453 |
+
<div>
|
454 |
+
do_action( 'wjecf_coupon_metabox_customer', $thepostid, $post );</div>
|
455 |
+
<div>
|
456 |
+
do_action( 'wjecf_woocommerce_coupon_options_extended_features', $thepostid, $post );</div>
|
457 |
+
<div>
|
458 |
+
do_action( 'wjecf_coupon_metabox_misc', $thepostid, $post );</div>
|
459 |
+
<div>
|
460 |
+
do_action( 'wjecf_coupon_metabox_products', $thepostid, $post );</div>
|
461 |
+
<div>
|
462 |
+
do_action( 'wjecf_coupon_metabox_free_products', $thepostid, $post );</div>
|
463 |
+
<div>
|
464 |
+
do_action( 'wjecf_init_plugins');</div>
|
465 |
+
<div>
|
466 |
+
do_action( 'wjecf_assert_coupon_is_valid', $coupon );</div>
|
467 |
+
</div>
|
468 |
+
<div>
|
469 |
+
</div>
|
470 |
+
</section>
|
471 |
<section id="where_to_buy">
|
472 |
<div class="page-header"><h3>Where to buy</h3><hr class="notop"></div>
|
473 |
<p> Want to increase your conversion? Then purchase this plugin and start offering special deals to your customers right away!</p>
|
includes/Abstract_WJECF_Plugin.php
CHANGED
@@ -9,8 +9,8 @@ abstract class Abstract_WJECF_Plugin {
|
|
9 |
public function init_admin_hook() {}
|
10 |
|
11 |
/**
|
12 |
-
* Returns an array with the meta_keys for this plugin and the
|
13 |
-
* Instead of a
|
14 |
*
|
15 |
* e.g. [
|
16 |
* '_wjecf_some_comma_separated_ints' => 'int,',
|
@@ -61,7 +61,7 @@ abstract class Abstract_WJECF_Plugin {
|
|
61 |
protected function log( $level, $message = null ) {
|
62 |
//Backwards compatibility; $level was introduced in 2.4.4
|
63 |
if ( is_null( $message ) ) {
|
64 |
-
$message =
|
65 |
$level = 'debug';
|
66 |
}
|
67 |
WJECF()->log( $level, $message, 1 );
|
@@ -122,4 +122,4 @@ abstract class Abstract_WJECF_Plugin {
|
|
122 |
return ! in_array( $this->get_plugin_class_name(), WJECF()->get_option('disabled_plugins') );
|
123 |
}
|
124 |
|
125 |
-
}
|
9 |
public function init_admin_hook() {}
|
10 |
|
11 |
/**
|
12 |
+
* Returns an array with the meta_keys for this plugin and the sanitation to apply.
|
13 |
+
* Instead of a sanitation a callback can be supplied; which must return the meta value to save to the database
|
14 |
*
|
15 |
* e.g. [
|
16 |
* '_wjecf_some_comma_separated_ints' => 'int,',
|
61 |
protected function log( $level, $message = null ) {
|
62 |
//Backwards compatibility; $level was introduced in 2.4.4
|
63 |
if ( is_null( $message ) ) {
|
64 |
+
$message = $level;
|
65 |
$level = 'debug';
|
66 |
}
|
67 |
WJECF()->log( $level, $message, 1 );
|
122 |
return ! in_array( $this->get_plugin_class_name(), WJECF()->get_option('disabled_plugins') );
|
123 |
}
|
124 |
|
125 |
+
}
|
includes/WJECF_AutoCoupon.php
CHANGED
@@ -4,10 +4,9 @@ defined('ABSPATH') or die();
|
|
4 |
|
5 |
class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
6 |
|
7 |
-
|
8 |
-
|
9 |
-
private $_user_emails = null;
|
10 |
-
|
11 |
protected $_executed_coupon_by_url = false;
|
12 |
|
13 |
public function __construct() {
|
@@ -46,6 +45,15 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
46 |
//Get cart should not be called before the wp_loaded action nor the add_to_cart_action (class-wc-form-handler)
|
47 |
add_action( 'wp_loaded', array( &$this, 'coupon_by_url' ), 90 ); //Coupon through url
|
48 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
}
|
50 |
|
51 |
/* ADMIN HOOKS */
|
@@ -68,6 +76,67 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
68 |
|
69 |
add_filter( 'views_edit-shop_coupon', array( $this, 'admin_views_edit_coupon' ) );
|
70 |
add_filter( 'request', array( $this, 'admin_request_query' ) );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
71 |
}
|
72 |
|
73 |
/**
|
@@ -101,7 +170,7 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
101 |
$class = ( isset( $wp_query->query['meta_key'] ) && $wp_query->query['meta_key'] == '_wjecf_is_auto_coupon' ) ? 'current' : '';
|
102 |
$query_string = remove_query_arg(array( 'wjecf_is_auto_coupon' ));
|
103 |
$query_string = add_query_arg( 'wjecf_is_auto_coupon', '1', $query_string );
|
104 |
-
$views['wjecf_is_auto_coupon'] = '<a href="' . esc_url( $query_string ) . '" class="' . esc_attr( $class ) . '">' . __( 'Auto coupons', 'woocommerce' ) . '</a>';
|
105 |
|
106 |
return $views;
|
107 |
}
|
@@ -252,29 +321,29 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
252 |
}
|
253 |
}
|
254 |
|
255 |
-
/**
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
*/
|
261 |
function coupon_label( $originaltext, $coupon ) {
|
262 |
|
263 |
if ( $this->is_auto_coupon($coupon) ) {
|
264 |
-
return
|
265 |
} else {
|
266 |
return $originaltext;
|
267 |
}
|
268 |
}
|
269 |
|
270 |
-
/**
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
*/
|
276 |
function coupon_html( $originaltext, $coupon ) {
|
277 |
-
if ( $this->is_auto_coupon($coupon) ) {
|
278 |
$value = array();
|
279 |
|
280 |
if ( $amount = WC()->cart->get_coupon_discount_amount( WJECF_Wrap( $coupon )->get_code(), WC()->cart->display_cart_ex_tax ) ) {
|
@@ -289,12 +358,11 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
289 |
$value[] = __( 'Free shipping coupon', 'woocommerce' );
|
290 |
}
|
291 |
|
292 |
-
return implode(', ', array_filter($value)); //Remove empty array elements
|
293 |
} else {
|
294 |
return $originaltext;
|
295 |
}
|
296 |
-
}
|
297 |
-
|
298 |
|
299 |
function remove_unmatched_autocoupons( $valid_coupon_codes = null ) {
|
300 |
if ( $valid_coupon_codes === null ) {
|
@@ -313,7 +381,9 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
313 |
$coupon_code = WJECF_Wrap( $coupon )->get_code();
|
314 |
if ( WC()->cart->has_discount( $coupon_code ) && ! in_array( $coupon_code, $valid_coupon_codes ) ) {
|
315 |
$this->log( 'debug', sprintf( "Removing %s", $coupon_code ) );
|
|
|
316 |
WC()->cart->remove_coupon( $coupon_code );
|
|
|
317 |
$calc_needed = true;
|
318 |
}
|
319 |
}
|
@@ -321,10 +391,99 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
321 |
}
|
322 |
|
323 |
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
328 |
function update_matched_autocoupons() {
|
329 |
|
330 |
$this->log( 'debug', "()" );
|
@@ -359,7 +518,7 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
359 |
if ( $apply_silently ) {
|
360 |
$new_succss_msg = ''; // no message
|
361 |
} else {
|
362 |
-
$coupon_excerpt =
|
363 |
$new_succss_msg = sprintf(
|
364 |
__("Discount applied: %s", 'woocommerce-jos-autocoupon'),
|
365 |
__( empty( $coupon_excerpt ) ? $coupon_code : $coupon_excerpt, 'woocommerce-jos-autocoupon')
|
@@ -385,7 +544,14 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
385 |
|
386 |
private function get_valid_auto_coupons( ) {
|
387 |
$valid_coupons = array();
|
388 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
if ( $this->coupon_can_be_applied( $coupon ) && $this->coupon_has_a_value( $coupon ) ) {
|
390 |
$valid_coupons[] = $coupon;
|
391 |
}
|
@@ -453,7 +619,7 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
453 |
* @param WC_Coupon $coupon The coupon data
|
454 |
* @return bool true if it is an "Auto coupon"
|
455 |
*/
|
456 |
-
public function is_auto_coupon($coupon) {
|
457 |
return WJECF_Wrap( $coupon )->get_meta( '_wjecf_is_auto_coupon' ) == 'yes';
|
458 |
}
|
459 |
|
@@ -468,15 +634,6 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
468 |
}
|
469 |
|
470 |
|
471 |
-
/**
|
472 |
-
* Get the coupon excerpt (description)
|
473 |
-
* @param WC_Coupon $coupon The coupon data
|
474 |
-
* @return string The excerpt (translated)
|
475 |
-
*/
|
476 |
-
private function coupon_excerpt($coupon) {
|
477 |
-
$my_post = get_post( WJECF_Wrap( $coupon )->get_id() );
|
478 |
-
return __( $my_post->post_excerpt, 'woocommerce-jos-autocoupon' );
|
479 |
-
}
|
480 |
|
481 |
/**
|
482 |
* Get a list of the users' known email addresses
|
@@ -551,7 +708,7 @@ class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
|
551 |
}
|
552 |
|
553 |
/**
|
554 |
-
* Get
|
555 |
* @return array All auto coupon codes
|
556 |
*/
|
557 |
public function get_all_auto_coupons() {
|
4 |
|
5 |
class WJECF_AutoCoupon extends Abstract_WJECF_Plugin {
|
6 |
|
7 |
+
protected $options = null; // WJECF_Options object
|
8 |
+
private $_autocoupons = null;
|
9 |
+
private $_user_emails = null;
|
|
|
10 |
protected $_executed_coupon_by_url = false;
|
11 |
|
12 |
public function __construct() {
|
45 |
//Get cart should not be called before the wp_loaded action nor the add_to_cart_action (class-wc-form-handler)
|
46 |
add_action( 'wp_loaded', array( &$this, 'coupon_by_url' ), 90 ); //Coupon through url
|
47 |
}
|
48 |
+
|
49 |
+
/**
|
50 |
+
* Mark removed autocoupons to prevent them from being automatically applied again
|
51 |
+
* (PRO Only)
|
52 |
+
* @since 2.5.4
|
53 |
+
*/
|
54 |
+
add_action( 'woocommerce_applied_coupon', array( $this, 'action_applied_coupon' ), 10, 1 );
|
55 |
+
add_action( 'woocommerce_removed_coupon', array( $this, 'action_removed_coupon' ), 10, 1 );
|
56 |
+
add_action( 'woocommerce_cart_emptied', array( $this, 'action_cart_emptied' ), 10, 0 );
|
57 |
}
|
58 |
|
59 |
/* ADMIN HOOKS */
|
76 |
|
77 |
add_filter( 'views_edit-shop_coupon', array( $this, 'admin_views_edit_coupon' ) );
|
78 |
add_filter( 'request', array( $this, 'admin_request_query' ) );
|
79 |
+
|
80 |
+
add_action( 'wjecf_admin_before_settings', array( $this, 'wjecf_admin_before_settings' ), 20 );
|
81 |
+
add_filter( 'wjecf_admin_validate_settings', array( $this, 'wjecf_admin_validate_settings' ), 10, 2 );
|
82 |
+
}
|
83 |
+
|
84 |
+
public function wjecf_admin_before_settings() {
|
85 |
+
$page = WJECF_Admin_Settings::SETTINGS_PAGE;
|
86 |
+
|
87 |
+
if ( WJECF()->is_pro() ) {
|
88 |
+
add_settings_section(
|
89 |
+
WJECF_Admin_Settings::DOM_PREFIX . 'section_autocoupon',
|
90 |
+
__( 'Auto coupons', 'woocommerce-jos-autocoupon' ),
|
91 |
+
array( $this, 'render_section' ),
|
92 |
+
$page
|
93 |
+
);
|
94 |
+
|
95 |
+
add_settings_field(
|
96 |
+
WJECF_Admin_Settings::DOM_PREFIX . 'autocoupon_allow_remove',
|
97 |
+
__( 'Allow remove \'Auto Coupons\'', 'woocommerce-jos-autocoupon' ),
|
98 |
+
array( $this, 'render_setting_allow_remove_auto_coupon' ),
|
99 |
+
$page,
|
100 |
+
WJECF_Admin_Settings::DOM_PREFIX . 'section_autocoupon'
|
101 |
+
);
|
102 |
+
}
|
103 |
+
}
|
104 |
+
|
105 |
+
public function render_section( $section ) {
|
106 |
+
switch ( $section['id'] ) {
|
107 |
+
case WJECF_Admin_Settings::DOM_PREFIX . 'section_autocoupon':
|
108 |
+
//$body = ".....";
|
109 |
+
//printf( '<p>%s</p>', $body );
|
110 |
+
break;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
|
114 |
+
public function render_setting_allow_remove_auto_coupon() {
|
115 |
+
$option_name = 'autocoupon_allow_remove';
|
116 |
+
$args = array(
|
117 |
+
'type' => 'checkbox',
|
118 |
+
'id' => WJECF_Admin_Settings::DOM_PREFIX . $option_name,
|
119 |
+
'name' => sprintf( "%s[%s]", WJECF_Admin_Settings::OPTION_NAME, $option_name ),
|
120 |
+
'value' => WJECF()->get_option( $option_name, false ) ? 'yes' : 'no'
|
121 |
+
);
|
122 |
+
|
123 |
+
WJECF_Admin_Html::render_input( $args );
|
124 |
+
WJECF_Admin_Html::render_tag(
|
125 |
+
'label',
|
126 |
+
array( "for" => esc_attr( $args['id'] ) ),
|
127 |
+
__( 'Enabled', 'woocommerce' )
|
128 |
+
);
|
129 |
+
WJECF_Admin_Html::render_tag(
|
130 |
+
'p',
|
131 |
+
array( 'class' => 'description'),
|
132 |
+
__( 'Check this box to allow the customer to remove \'Auto Coupons\' from the cart.', 'woocommerce-jos-autocoupon' )
|
133 |
+
);
|
134 |
+
|
135 |
+
}
|
136 |
+
|
137 |
+
public function wjecf_admin_validate_settings( $options, $input ) {
|
138 |
+
$options['autocoupon_allow_remove'] = isset( $input['autocoupon_allow_remove'] ) && $input['autocoupon_allow_remove'] === 'yes';
|
139 |
+
return $options;
|
140 |
}
|
141 |
|
142 |
/**
|
170 |
$class = ( isset( $wp_query->query['meta_key'] ) && $wp_query->query['meta_key'] == '_wjecf_is_auto_coupon' ) ? 'current' : '';
|
171 |
$query_string = remove_query_arg(array( 'wjecf_is_auto_coupon' ));
|
172 |
$query_string = add_query_arg( 'wjecf_is_auto_coupon', '1', $query_string );
|
173 |
+
$views['wjecf_is_auto_coupon'] = '<a href="' . esc_url( $query_string ) . '" class="' . esc_attr( $class ) . '">' . __( 'Auto coupons', 'woocommerce-jos-autocoupon' ) . '</a>';
|
174 |
|
175 |
return $views;
|
176 |
}
|
321 |
}
|
322 |
}
|
323 |
|
324 |
+
/**
|
325 |
+
* Overwrite the html created by wc_cart_totals_coupon_label() so a descriptive text will be shown for the discount.
|
326 |
+
* @param string $originaltext The default text created by wc_cart_totals_coupon_label()
|
327 |
+
* @param WC_Coupon $coupon The coupon data
|
328 |
+
* @return string The overwritten text
|
329 |
+
*/
|
330 |
function coupon_label( $originaltext, $coupon ) {
|
331 |
|
332 |
if ( $this->is_auto_coupon($coupon) ) {
|
333 |
+
return WJECF_Wrap( $coupon )->get_description();
|
334 |
} else {
|
335 |
return $originaltext;
|
336 |
}
|
337 |
}
|
338 |
|
339 |
+
/**
|
340 |
+
* Overwrite the html created by wc_cart_totals_coupon_html(). This function is required to remove the "Remove" link.
|
341 |
+
* @param string $originaltext The html created by wc_cart_totals_coupon_html()
|
342 |
+
* @param WC_Coupon $coupon The coupon data
|
343 |
+
* @return string The overwritten html
|
344 |
+
*/
|
345 |
function coupon_html( $originaltext, $coupon ) {
|
346 |
+
if ( $this->is_auto_coupon( $coupon ) && ! $this->get_option_autocoupon_allow_remove() ) {
|
347 |
$value = array();
|
348 |
|
349 |
if ( $amount = WC()->cart->get_coupon_discount_amount( WJECF_Wrap( $coupon )->get_code(), WC()->cart->display_cart_ex_tax ) ) {
|
358 |
$value[] = __( 'Free shipping coupon', 'woocommerce' );
|
359 |
}
|
360 |
|
361 |
+
return implode( ', ', array_filter($value) ); //Remove empty array elements
|
362 |
} else {
|
363 |
return $originaltext;
|
364 |
}
|
365 |
+
}
|
|
|
366 |
|
367 |
function remove_unmatched_autocoupons( $valid_coupon_codes = null ) {
|
368 |
if ( $valid_coupon_codes === null ) {
|
381 |
$coupon_code = WJECF_Wrap( $coupon )->get_code();
|
382 |
if ( WC()->cart->has_discount( $coupon_code ) && ! in_array( $coupon_code, $valid_coupon_codes ) ) {
|
383 |
$this->log( 'debug', sprintf( "Removing %s", $coupon_code ) );
|
384 |
+
$this->ignore_removal[$coupon_code] = $coupon_code;
|
385 |
WC()->cart->remove_coupon( $coupon_code );
|
386 |
+
unset( $this->ignore_removal[$coupon_code] );
|
387 |
$calc_needed = true;
|
388 |
}
|
389 |
}
|
391 |
}
|
392 |
|
393 |
|
394 |
+
// ============ BEGIN wjecf_autocoupon_removed_coupons =======================
|
395 |
+
|
396 |
+
// When a custom clicks the [remove]-button of an auto coupon, the coupon will not be applied automatically anymore...
|
397 |
+
// After that the coupon can only be applied manually by entering the coupon code.
|
398 |
+
|
399 |
+
//Will ignore the remove_coupon action for the given keys
|
400 |
+
private $ignore_removal = array( /* coupon_code => coupon_code */ );
|
401 |
+
|
402 |
+
/**
|
403 |
+
* Remove the coupon from session 'wjecf_autocoupon_removed_coupons'
|
404 |
+
* @since 2.5.4
|
405 |
+
*/
|
406 |
+
function action_applied_coupon( $coupon_code ) {
|
407 |
+
if ( ! $this->is_auto_coupon( $coupon_code ) || ! $this->get_option_autocoupon_allow_remove() ) {
|
408 |
+
return;
|
409 |
+
}
|
410 |
+
|
411 |
+
$removed_autocoupon_codes = $this->get_removed_autocoupon_codes();
|
412 |
+
if ( ! isset( $removed_autocoupon_codes[$coupon_code] ) ) {
|
413 |
+
return;
|
414 |
+
}
|
415 |
+
|
416 |
+
unset( $removed_autocoupon_codes[$coupon_code] ) ;
|
417 |
+
$this->set_removed_autocoupon_codes( $removed_autocoupon_codes );
|
418 |
+
}
|
419 |
+
|
420 |
+
/**
|
421 |
+
* Add the coupon to session 'wjecf_autocoupon_removed_coupons'
|
422 |
+
*
|
423 |
+
* @since 2.5.4
|
424 |
+
*/
|
425 |
+
function action_removed_coupon( $coupon_code ) {
|
426 |
+
if ( ! $this->is_auto_coupon( $coupon_code ) || ! $this->get_option_autocoupon_allow_remove() ) {
|
427 |
+
return;
|
428 |
+
}
|
429 |
+
//Ignore, because the auto-coupon was removed automatically (not manually by the customer)
|
430 |
+
if ( isset( $this->ignore_removal[$coupon_code] ) ) {
|
431 |
+
return;
|
432 |
+
}
|
433 |
+
|
434 |
+
$removed_autocoupon_codes = $this->get_removed_autocoupon_codes();
|
435 |
+
$removed_autocoupon_codes[$coupon_code] = $coupon_code;
|
436 |
+
$this->set_removed_autocoupon_codes( $removed_autocoupon_codes );
|
437 |
+
}
|
438 |
+
|
439 |
+
/**
|
440 |
+
* Remove 'wjecf_autocoupon_removed_coupons' from the session when cart is emptied
|
441 |
+
*
|
442 |
+
* @since 2.5.4
|
443 |
+
*/
|
444 |
+
function action_cart_emptied() {
|
445 |
+
$this->set_removed_autocoupon_codes( null );
|
446 |
+
}
|
447 |
+
|
448 |
+
/**
|
449 |
+
* Get the removed auto coupon-codes from the session
|
450 |
+
*
|
451 |
+
* @since 2.5.4
|
452 |
+
* @return array The queued coupon codes
|
453 |
+
*/
|
454 |
+
private function get_removed_autocoupon_codes( ) {
|
455 |
+
$coupon_codes = WC()->session->get( 'wjecf_autocoupon_removed_coupons' , array() );
|
456 |
+
return $coupon_codes;
|
457 |
+
}
|
458 |
+
|
459 |
+
/**
|
460 |
+
* Save the removed auto coupon-codes in the session
|
461 |
+
*
|
462 |
+
* @since 2.5.4
|
463 |
+
* @param array $coupon_codes
|
464 |
+
* @return void
|
465 |
+
*/
|
466 |
+
private function set_removed_autocoupon_codes( $coupon_codes ) {
|
467 |
+
WC()->session->set( 'wjecf_autocoupon_removed_coupons' , $coupon_codes );
|
468 |
+
}
|
469 |
+
|
470 |
+
/**
|
471 |
+
* Reads the option 'autocoupon_allow_remove'
|
472 |
+
*
|
473 |
+
* @since 2.5.4
|
474 |
+
* @return bool
|
475 |
+
*/
|
476 |
+
private function get_option_autocoupon_allow_remove() {
|
477 |
+
return WJECF()->is_pro() && WJECF()->get_option( 'autocoupon_allow_remove', false );
|
478 |
+
}
|
479 |
+
|
480 |
+
// ============ END wjecf_autocoupon_removed_coupons =======================
|
481 |
+
|
482 |
+
|
483 |
+
/**
|
484 |
+
* Apply matched autocoupons and remove unmatched autocoupons.
|
485 |
+
* @return void
|
486 |
+
*/
|
487 |
function update_matched_autocoupons() {
|
488 |
|
489 |
$this->log( 'debug', "()" );
|
518 |
if ( $apply_silently ) {
|
519 |
$new_succss_msg = ''; // no message
|
520 |
} else {
|
521 |
+
$coupon_excerpt = WJECF_Wrap( $coupon )->get_description();
|
522 |
$new_succss_msg = sprintf(
|
523 |
__("Discount applied: %s", 'woocommerce-jos-autocoupon'),
|
524 |
__( empty( $coupon_excerpt ) ? $coupon_code : $coupon_excerpt, 'woocommerce-jos-autocoupon')
|
544 |
|
545 |
private function get_valid_auto_coupons( ) {
|
546 |
$valid_coupons = array();
|
547 |
+
|
548 |
+
//Array will only have values if option autocoupon_allow_remove == true
|
549 |
+
$removed_autocoupon_codes = $this->get_option_autocoupon_allow_remove() ? $this->get_removed_autocoupon_codes() : array();
|
550 |
+
|
551 |
+
foreach ( $this->get_all_auto_coupons() as $coupon_code => $coupon ) {
|
552 |
+
if ( isset( $removed_autocoupon_codes[ $coupon_code ] ) ) {
|
553 |
+
continue;
|
554 |
+
}
|
555 |
if ( $this->coupon_can_be_applied( $coupon ) && $this->coupon_has_a_value( $coupon ) ) {
|
556 |
$valid_coupons[] = $coupon;
|
557 |
}
|
619 |
* @param WC_Coupon $coupon The coupon data
|
620 |
* @return bool true if it is an "Auto coupon"
|
621 |
*/
|
622 |
+
public function is_auto_coupon( $coupon ) {
|
623 |
return WJECF_Wrap( $coupon )->get_meta( '_wjecf_is_auto_coupon' ) == 'yes';
|
624 |
}
|
625 |
|
634 |
}
|
635 |
|
636 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
637 |
|
638 |
/**
|
639 |
* Get a list of the users' known email addresses
|
708 |
}
|
709 |
|
710 |
/**
|
711 |
+
* Get an array of all auto coupons [ $coupon_code => $coupon ]
|
712 |
* @return array All auto coupon codes
|
713 |
*/
|
714 |
public function get_all_auto_coupons() {
|
includes/WJECF_Bootstrap.php
CHANGED
@@ -20,6 +20,7 @@ class WJECF_Bootstrap {
|
|
20 |
$this->require_once_php( 'WJECF_Controller' );
|
21 |
$pro = $this->try_include_php( 'pro/WJECF_Pro_Controller' );
|
22 |
$this->require_once_php( 'WJECF_WC' );
|
|
|
23 |
|
24 |
$this->require_once_php( 'admin/WJECF_Admin_Html' );
|
25 |
$this->add_plugin('admin/WJECF_Admin');
|
20 |
$this->require_once_php( 'WJECF_Controller' );
|
21 |
$pro = $this->try_include_php( 'pro/WJECF_Pro_Controller' );
|
22 |
$this->require_once_php( 'WJECF_WC' );
|
23 |
+
$this->require_once_php( 'WJECF_Wrap' );
|
24 |
|
25 |
$this->require_once_php( 'admin/WJECF_Admin_Html' );
|
26 |
$this->add_plugin('admin/WJECF_Admin');
|
includes/WJECF_Controller.php
CHANGED
@@ -40,7 +40,8 @@ class WJECF_Controller {
|
|
40 |
array(
|
41 |
'db_version' => 0, // integer
|
42 |
'debug_mode' => false, // true or false
|
43 |
-
'disabled_plugins' => array() // e.g. [ 'WJECF_AutoCoupon' ]
|
|
|
44 |
)
|
45 |
);
|
46 |
}
|
40 |
array(
|
41 |
'db_version' => 0, // integer
|
42 |
'debug_mode' => false, // true or false
|
43 |
+
'disabled_plugins' => array(), // e.g. [ 'WJECF_AutoCoupon' ]
|
44 |
+
'autocoupon_allow_remove' => false
|
45 |
)
|
46 |
);
|
47 |
}
|
includes/WJECF_Debug_CLI.php
CHANGED
@@ -174,6 +174,21 @@ class WJECF_Debug_CLI extends WP_CLI_Command {
|
|
174 |
$this->assert_same( $results, sprintf('Same product id %s', current( $results ) ) );
|
175 |
}
|
176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
177 |
|
178 |
|
179 |
}
|
174 |
$this->assert_same( $results, sprintf('Same product id %s', current( $results ) ) );
|
175 |
}
|
176 |
|
177 |
+
$meta_keys = array( 'total_sales', '_price', '__non_existing__');
|
178 |
+
foreach( $meta_keys as $meta_key ) {
|
179 |
+
for($i=1; $i>=0; $i--) {
|
180 |
+
$single = $i>0;
|
181 |
+
|
182 |
+
$results = array();
|
183 |
+
$results['new'] = $wrap_new->get_field( $meta_key, $single );
|
184 |
+
$results['legacy'] = $wrap_leg->get_field( $meta_key, $single );
|
185 |
+
$results['old'] = get_post_meta( $wrap_new->get_product_or_variation_id(), $meta_key, $single );
|
186 |
+
$this->assert_same( $results, sprintf('%s: Same value %s. %s', $meta_key, $single ? 'single' : 'multi', $this->dd( current( $results ) ) ) );
|
187 |
+
|
188 |
+
}
|
189 |
+
}
|
190 |
+
|
191 |
+
|
192 |
|
193 |
|
194 |
}
|
includes/WJECF_Options.php
CHANGED
@@ -50,7 +50,7 @@ class WJECF_Options {
|
|
50 |
*/
|
51 |
protected function load_options() {
|
52 |
$options = get_option( $this->option_name );
|
53 |
-
if (
|
54 |
$this->options = $this->defaults;
|
55 |
} else {
|
56 |
$this->options = array_merge( $this->defaults, $options );
|
50 |
*/
|
51 |
protected function load_options() {
|
52 |
$options = get_option( $this->option_name );
|
53 |
+
if ( ! is_array( $options ) || empty ( $options ) ) {
|
54 |
$this->options = $this->defaults;
|
55 |
} else {
|
56 |
$this->options = array_merge( $this->defaults, $options );
|
includes/WJECF_WC.php
CHANGED
@@ -325,457 +325,3 @@ class WJECF_WC {
|
|
325 |
}
|
326 |
protected static $_instance = null;
|
327 |
}
|
328 |
-
|
329 |
-
|
330 |
-
class WJECF_Wrap {
|
331 |
-
protected $object = null;
|
332 |
-
|
333 |
-
public function __construct( $object ) {
|
334 |
-
$this->object = $object;
|
335 |
-
//error_log('Wrapping ' . get_class( $object ) );
|
336 |
-
}
|
337 |
-
|
338 |
-
public $use_wc27 = true;
|
339 |
-
public function get_id() {
|
340 |
-
//Since WC 2.7
|
341 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_id' ) ) ) {
|
342 |
-
return $this->object->get_id();
|
343 |
-
}
|
344 |
-
return $this->object->id;
|
345 |
-
}
|
346 |
-
|
347 |
-
public function holds( $object ) {
|
348 |
-
return $object === $this->object;
|
349 |
-
}
|
350 |
-
|
351 |
-
/**
|
352 |
-
* Get Meta Data by Key.
|
353 |
-
*
|
354 |
-
* If no value found:
|
355 |
-
* If $single is true, an empty string is returned.
|
356 |
-
* If $single is false, an empty array is returned.
|
357 |
-
*
|
358 |
-
* @since 2.4.0
|
359 |
-
* @param string $key
|
360 |
-
* @param bool $single return first found meta, or all
|
361 |
-
* @return mixed
|
362 |
-
*/
|
363 |
-
public final function get_meta( $meta_key, $single = true ) {
|
364 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_meta' ) ) ) {
|
365 |
-
return $this->get_meta_wc27( $meta_key, $single );
|
366 |
-
}
|
367 |
-
|
368 |
-
return $this->get_meta_legacy( $meta_key, $single );
|
369 |
-
}
|
370 |
-
|
371 |
-
protected function get_meta_wc27( $meta_key, $single = true ) {
|
372 |
-
$values = $this->object->get_meta( $meta_key, $single );
|
373 |
-
if ($single) {
|
374 |
-
return $values; //it's just one, dispite the plural in the name!
|
375 |
-
}
|
376 |
-
|
377 |
-
if ( $values === '' ) {
|
378 |
-
return array(); //get_meta returns empty string if meta does not exist
|
379 |
-
}
|
380 |
-
|
381 |
-
return wp_list_pluck( array_values( $values ), 'value' ); //when not using array_values; the index might not start with 0
|
382 |
-
}
|
383 |
-
|
384 |
-
protected function get_meta_legacy( $meta_key, $single = true ) {
|
385 |
-
throw new Exception( sprintf( '%s::get_meta_legacy not implemented', get_class( $this ) ) );
|
386 |
-
}
|
387 |
-
|
388 |
-
/**
|
389 |
-
* Update single meta data item by meta key.
|
390 |
-
* Call save() if the values must to be persisted.
|
391 |
-
* @since 2.4.0
|
392 |
-
* @param string $meta_key
|
393 |
-
* @param mixed $value The value; use null to clear
|
394 |
-
*/
|
395 |
-
public final function set_meta( $meta_key, $value ) {
|
396 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'update_meta_data' ) ) ) {
|
397 |
-
if ( $value === null ) {
|
398 |
-
$this->object->delete_meta_data( $meta_key );
|
399 |
-
} else {
|
400 |
-
$this->object->update_meta_data( $meta_key, $value );
|
401 |
-
}
|
402 |
-
return;
|
403 |
-
}
|
404 |
-
|
405 |
-
$this->set_meta_legacy( $meta_key, $value );
|
406 |
-
}
|
407 |
-
|
408 |
-
protected function set_meta_legacy( $meta_key, $value ) {
|
409 |
-
throw new Exception( sprintf( '%s::set_meta_legacy not implemented', get_class( $this ) ) );
|
410 |
-
}
|
411 |
-
|
412 |
-
}
|
413 |
-
|
414 |
-
/**
|
415 |
-
* Wrap a data object ( Coupons and products were converted to WC_Data since WC 2.7.0 )
|
416 |
-
*/
|
417 |
-
class WJECF_Wrap_Coupon extends WJECF_Wrap {
|
418 |
-
|
419 |
-
public function exists() {
|
420 |
-
return $this->get_id() > 0;
|
421 |
-
}
|
422 |
-
|
423 |
-
public function get_code() {
|
424 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_code' ) ) ) {
|
425 |
-
return $this->object->get_code();
|
426 |
-
}
|
427 |
-
|
428 |
-
return $this->object->code;
|
429 |
-
}
|
430 |
-
|
431 |
-
public function get_amount() {
|
432 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_amount' ) ) ) {
|
433 |
-
return $this->object->get_amount();
|
434 |
-
}
|
435 |
-
|
436 |
-
return $this->object->coupon_amount;
|
437 |
-
}
|
438 |
-
|
439 |
-
public function get_individual_use() {
|
440 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_individual_use' ) ) ) {
|
441 |
-
return $this->object->get_individual_use();
|
442 |
-
}
|
443 |
-
|
444 |
-
return $this->object->individual_use == 'yes';
|
445 |
-
}
|
446 |
-
|
447 |
-
public function get_limit_usage_to_x_items() {
|
448 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_limit_usage_to_x_items' ) ) ) {
|
449 |
-
return $this->object->get_limit_usage_to_x_items();
|
450 |
-
}
|
451 |
-
|
452 |
-
return $this->object->limit_usage_to_x_items;
|
453 |
-
}
|
454 |
-
|
455 |
-
public function set_limit_usage_to_x_items( $limit_usage_to_x_items ) {
|
456 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_limit_usage_to_x_items' ) ) ) {
|
457 |
-
$this->object->set_limit_usage_to_x_items( $limit_usage_to_x_items );
|
458 |
-
} else {
|
459 |
-
$this->object->limit_usage_to_x_items = $limit_usage_to_x_items;
|
460 |
-
}
|
461 |
-
}
|
462 |
-
|
463 |
-
public function get_discount_type() {
|
464 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_discount_type' ) ) ) {
|
465 |
-
return $this->object->get_discount_type();
|
466 |
-
}
|
467 |
-
|
468 |
-
return $this->object->discount_type;
|
469 |
-
}
|
470 |
-
|
471 |
-
public function set_discount_type( $discount_type ) {
|
472 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_discount_type' ) ) ) {
|
473 |
-
$this->object->set_discount_type( $discount_type );
|
474 |
-
} else {
|
475 |
-
$this->object->discount_type = $discount_type;
|
476 |
-
$this->object->type = $discount_type;
|
477 |
-
}
|
478 |
-
}
|
479 |
-
|
480 |
-
|
481 |
-
public function get_email_restrictions() {
|
482 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_email_restrictions' ) ) ) {
|
483 |
-
return $this->object->get_email_restrictions();
|
484 |
-
}
|
485 |
-
|
486 |
-
return $this->object->customer_email;
|
487 |
-
}
|
488 |
-
|
489 |
-
public function get_product_ids() {
|
490 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_product_ids' ) ) ) {
|
491 |
-
return $this->object->get_product_ids();
|
492 |
-
}
|
493 |
-
|
494 |
-
return $this->object->product_ids;
|
495 |
-
}
|
496 |
-
|
497 |
-
public function get_free_shipping() {
|
498 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_free_shipping' ) ) ) {
|
499 |
-
return $this->object->get_free_shipping();
|
500 |
-
}
|
501 |
-
|
502 |
-
return $this->object->enable_free_shipping();
|
503 |
-
}
|
504 |
-
|
505 |
-
public function get_product_categories() {
|
506 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_product_categories' ) ) ) {
|
507 |
-
return $this->object->get_product_categories();
|
508 |
-
}
|
509 |
-
|
510 |
-
return $this->object->product_categories;
|
511 |
-
}
|
512 |
-
|
513 |
-
public function get_minimum_amount() {
|
514 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_minimum_amount' ) ) ) {
|
515 |
-
return $this->object->get_minimum_amount();
|
516 |
-
}
|
517 |
-
|
518 |
-
return $this->object->minimum_amount;
|
519 |
-
}
|
520 |
-
|
521 |
-
/**
|
522 |
-
* Set the product IDs this coupon cannot be used with.
|
523 |
-
* @since 2.4.2 (For WC3.0)
|
524 |
-
* @param array $excluded_product_ids
|
525 |
-
* @throws WC_Data_Exception
|
526 |
-
*/
|
527 |
-
public function set_excluded_product_ids( $excluded_product_ids ) {
|
528 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_excluded_product_ids' ) ) ) {
|
529 |
-
$this->object->set_excluded_product_ids( $excluded_product_ids );
|
530 |
-
} else {
|
531 |
-
//NOTE: Prior to WC2.7 it was called exclude_ instead of excluded_
|
532 |
-
$this->object->exclude_product_ids = $excluded_product_ids;
|
533 |
-
}
|
534 |
-
}
|
535 |
-
|
536 |
-
/**
|
537 |
-
* Set the product category IDs this coupon cannot be used with.
|
538 |
-
* @since 2.4.2 (For WC3.0)
|
539 |
-
* @param array $excluded_product_categories
|
540 |
-
* @throws WC_Data_Exception
|
541 |
-
*/
|
542 |
-
public function set_excluded_product_categories( $excluded_product_categories ) {
|
543 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_excluded_product_categories' ) ) ) {
|
544 |
-
$this->object->set_excluded_product_categories( $excluded_product_categories );
|
545 |
-
} else {
|
546 |
-
//NOTE: Prior to WC2.7 it was called exclude_ instead of excluded_
|
547 |
-
$this->object->exclude_product_categories = $excluded_product_categories;
|
548 |
-
}
|
549 |
-
}
|
550 |
-
|
551 |
-
/**
|
552 |
-
* Set if this coupon should excluded sale items or not.
|
553 |
-
* @since 2.4.2 (For WC3.0)
|
554 |
-
* @param bool $exclude_sale_items
|
555 |
-
* @throws WC_Data_Exception
|
556 |
-
*/
|
557 |
-
public function set_exclude_sale_items( $exclude_sale_items ) {
|
558 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_exclude_sale_items' ) ) ) {
|
559 |
-
$this->object->set_exclude_sale_items( $exclude_sale_items );
|
560 |
-
} else {
|
561 |
-
//NOTE: Prior to WC2.7 it was yes/no instead of boolean
|
562 |
-
$this->object->exclude_sale_items = $exclude_sale_items ? 'yes' : 'no';
|
563 |
-
}
|
564 |
-
}
|
565 |
-
|
566 |
-
/**
|
567 |
-
* Check the type of the coupon
|
568 |
-
* @param string|array $type The type(s) we want to check for
|
569 |
-
* @return bool True if the coupon is of the type
|
570 |
-
*/
|
571 |
-
public function is_type( $type ) {
|
572 |
-
//Backwards compatibility 2.2.11
|
573 |
-
if ( method_exists( $this->object, 'is_type' ) ) {
|
574 |
-
return $this->object->is_type( $type );
|
575 |
-
}
|
576 |
-
|
577 |
-
return ( $this->object->discount_type == $type || ( is_array( $type ) && in_array( $this->object->discount_type, $type ) ) ) ? true : false;
|
578 |
-
}
|
579 |
-
|
580 |
-
protected function set_meta_legacy( $meta_key, $value ) {
|
581 |
-
$this->maybe_get_custom_fields();
|
582 |
-
//WJECF()->log('...setting legacy meta ' . $meta_key );
|
583 |
-
$this->legacy_custom_fields[ $meta_key ] = array( $value );
|
584 |
-
$this->legacy_unsaved_keys[] = $meta_key;
|
585 |
-
}
|
586 |
-
|
587 |
-
/**
|
588 |
-
* Save the metadata
|
589 |
-
* @return id of this object
|
590 |
-
*/
|
591 |
-
public function save() {
|
592 |
-
//WJECF()->log('Saving ' . $this->get_id() );
|
593 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'save' ) ) ) {
|
594 |
-
return $this->object->save();
|
595 |
-
}
|
596 |
-
|
597 |
-
//Save the unsaved...
|
598 |
-
foreach( $this->legacy_unsaved_keys as $meta_key ) {
|
599 |
-
//WJECF()->log('...saving legacy meta ' . $meta_key );
|
600 |
-
$value = reset( $this->legacy_custom_fields[ $meta_key ] );
|
601 |
-
if ( $value === null ) {
|
602 |
-
delete_post_meta( $this->get_id(), $meta_key );
|
603 |
-
} else {
|
604 |
-
update_post_meta( $this->get_id(), $meta_key, $value );
|
605 |
-
}
|
606 |
-
}
|
607 |
-
$this->legacy_unsaved_keys = array();
|
608 |
-
|
609 |
-
return $this->get_id();
|
610 |
-
}
|
611 |
-
|
612 |
-
protected $legacy_custom_fields = null; // [ 'meta_key' => [ array_of_values ] ]
|
613 |
-
protected $legacy_unsaved_keys = array();
|
614 |
-
|
615 |
-
protected function maybe_get_custom_fields() {
|
616 |
-
//Read custom fields if not yet done
|
617 |
-
if ( is_null( $this->legacy_custom_fields ) ) {
|
618 |
-
$this->legacy_custom_fields = $this->object->coupon_custom_fields;
|
619 |
-
}
|
620 |
-
}
|
621 |
-
|
622 |
-
protected function get_meta_legacy( $meta_key, $single = true ) {
|
623 |
-
//Read custom fields if not yet done
|
624 |
-
$this->maybe_get_custom_fields();
|
625 |
-
|
626 |
-
if ( isset( $this->legacy_custom_fields[ $meta_key ] ) ) {
|
627 |
-
$values = $this->legacy_custom_fields[ $meta_key ];
|
628 |
-
//WP_CLI::log( "LEGACY:" . print_r( $values, true ));
|
629 |
-
if ($single) {
|
630 |
-
return maybe_unserialize( reset( $values ) ); //reset yields the first
|
631 |
-
}
|
632 |
-
$values = array_map( 'maybe_unserialize', $values );
|
633 |
-
return $values;
|
634 |
-
}
|
635 |
-
|
636 |
-
return $single ? '' : array();
|
637 |
-
}
|
638 |
-
|
639 |
-
}
|
640 |
-
|
641 |
-
class WJECF_Wrap_Product extends WJECF_Wrap {
|
642 |
-
|
643 |
-
protected $legacy_custom_fields = null; // [ 'meta_key' => [ array_of_values ] ]
|
644 |
-
protected $legacy_unsaved_keys = array();
|
645 |
-
|
646 |
-
protected function get_meta_legacy( $meta_key, $single = true ) {
|
647 |
-
if ( isset( $this->legacy_custom_fields[ $meta_key ] ) ) {
|
648 |
-
$values = $this->legacy_custom_fields[ $meta_key ];
|
649 |
-
//WP_CLI::log( "LEGACY:" . print_r( $values, true ));
|
650 |
-
if ($single) {
|
651 |
-
return maybe_unserialize( reset( $values ) ); //reset yields the first
|
652 |
-
}
|
653 |
-
$values = array_map( 'maybe_unserialize', $values );
|
654 |
-
return $values;
|
655 |
-
}
|
656 |
-
|
657 |
-
return $single ? '' : array();
|
658 |
-
}
|
659 |
-
|
660 |
-
public function set_meta_legacy( $meta_key, $value ) {
|
661 |
-
$this->legacy_custom_fields[ $meta_key ] = array( 0 => $value );
|
662 |
-
$this->legacy_unsaved_keys[] = $meta_key;
|
663 |
-
}
|
664 |
-
|
665 |
-
private function is_variation() {
|
666 |
-
return $this->object instanceof WC_Product_Variation;
|
667 |
-
}
|
668 |
-
|
669 |
-
/**
|
670 |
-
* Retrieve the id of the product or the variation id if it's a variant.
|
671 |
-
*
|
672 |
-
* (2.4.0: Moved from WJECF_Controller to WJECF_WC)
|
673 |
-
*
|
674 |
-
* @param WC_Product $product
|
675 |
-
* @return int|bool The variation or product id. False if not a valid product
|
676 |
-
*/
|
677 |
-
public function get_product_or_variation_id() {
|
678 |
-
if ( $this->is_variation() ) {
|
679 |
-
return $this->get_variation_id();
|
680 |
-
} elseif ( $this->object instanceof WC_Product ) {
|
681 |
-
return $this->get_id();
|
682 |
-
} else {
|
683 |
-
return false;
|
684 |
-
}
|
685 |
-
}
|
686 |
-
|
687 |
-
/**
|
688 |
-
* Retrieve the id of the parent product if it's a variation; otherwise retrieve this products id
|
689 |
-
*
|
690 |
-
* (2.4.0: Moved from WJECF_Controller to WJECF_WC)
|
691 |
-
*
|
692 |
-
* @param WC_Product $product
|
693 |
-
* @return int|bool The product id. False if this product is not a variation
|
694 |
-
*/
|
695 |
-
public function get_variable_product_id() {
|
696 |
-
if ( ! $this->is_variation() ) {
|
697 |
-
return false;
|
698 |
-
}
|
699 |
-
|
700 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_parent_id' ) ) ) {
|
701 |
-
return $this->object->get_parent_id();
|
702 |
-
} else {
|
703 |
-
return wp_get_post_parent_id( $this->object->variation_id );
|
704 |
-
}
|
705 |
-
}
|
706 |
-
|
707 |
-
/**
|
708 |
-
* Get current variation id
|
709 |
-
* @return int|bool False if this is not a variation
|
710 |
-
*/
|
711 |
-
protected function get_variation_id() {
|
712 |
-
if ( ! $this->is_variation() ) {
|
713 |
-
return false;
|
714 |
-
}
|
715 |
-
|
716 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_id' ) ) ) {
|
717 |
-
//WP_CLI::log( "get_variation_id:WC27 " . get_class( $this->object ) );
|
718 |
-
return $this->object->get_id();
|
719 |
-
} elseif ( $this->use_wc27 && is_callable( array( $this->object, 'get_variation_id' ) ) ) {
|
720 |
-
//WP_CLI::log( "get_variation_id:LEGACY " . get_class( $this->object ) );
|
721 |
-
return $this->object->get_variation_id();
|
722 |
-
}
|
723 |
-
//WP_CLI::log( "get_variation_id:VERY OLD " . get_class( $this->object ) );
|
724 |
-
return $this->object->variation_id;
|
725 |
-
}
|
726 |
-
|
727 |
-
|
728 |
-
public function get_name() {
|
729 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_name' ) ) ) {
|
730 |
-
return $this->object->get_name();
|
731 |
-
} else {
|
732 |
-
return $this->object->post->post_title;
|
733 |
-
}
|
734 |
-
}
|
735 |
-
|
736 |
-
public function get_description() {
|
737 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_description' ) ) ) {
|
738 |
-
return $this->object->get_description();
|
739 |
-
} else {
|
740 |
-
return $this->object->post->post_content;
|
741 |
-
}
|
742 |
-
}
|
743 |
-
|
744 |
-
public function get_short_description() {
|
745 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_short_description' ) ) ) {
|
746 |
-
return $this->object->get_short_description();
|
747 |
-
} else {
|
748 |
-
return $this->object->post->post_excerpt;
|
749 |
-
}
|
750 |
-
}
|
751 |
-
|
752 |
-
public function get_tag_ids() {
|
753 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_tag_ids' ) ) ) {
|
754 |
-
return $this->object->get_tag_ids();
|
755 |
-
} else {
|
756 |
-
return $this->legacy_get_term_ids( 'product_tag' );
|
757 |
-
}
|
758 |
-
}
|
759 |
-
|
760 |
-
protected function legacy_get_term_ids( $taxonomy ) {
|
761 |
-
$terms = get_the_terms( $this->get_id(), $taxonomy );
|
762 |
-
if ( false === $terms || is_wp_error( $terms ) ) {
|
763 |
-
return array();
|
764 |
-
}
|
765 |
-
return wp_list_pluck( $terms, 'term_id' );
|
766 |
-
}
|
767 |
-
|
768 |
-
/**
|
769 |
-
* If set, get the default attributes for a variable product.
|
770 |
-
*
|
771 |
-
* @param string $attribute_name
|
772 |
-
* @return string
|
773 |
-
*/
|
774 |
-
public function get_variation_default_attribute( $attribute_name ) {
|
775 |
-
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_variation_default_attribute' ) ) ) {
|
776 |
-
return $this->object->get_variation_default_attribute( $attribute_name );
|
777 |
-
}
|
778 |
-
return '';
|
779 |
-
}
|
780 |
-
|
781 |
-
}
|
325 |
}
|
326 |
protected static $_instance = null;
|
327 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/WJECF_Wrap.php
ADDED
@@ -0,0 +1,485 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
defined('ABSPATH') or die();
|
4 |
+
|
5 |
+
/**
|
6 |
+
* Wrapper for WC objects. Helps to maintain compatibility between both WC2 and WC3
|
7 |
+
*/
|
8 |
+
class WJECF_Wrap {
|
9 |
+
protected $object = null;
|
10 |
+
|
11 |
+
public function __construct( $object ) {
|
12 |
+
$this->object = $object;
|
13 |
+
//error_log('Wrapping ' . get_class( $object ) );
|
14 |
+
}
|
15 |
+
|
16 |
+
public $use_wc27 = true;
|
17 |
+
public function get_id() {
|
18 |
+
//Since WC 2.7
|
19 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_id' ) ) ) {
|
20 |
+
return $this->object->get_id();
|
21 |
+
}
|
22 |
+
return $this->object->id;
|
23 |
+
}
|
24 |
+
|
25 |
+
public function holds( $object ) {
|
26 |
+
return $object === $this->object;
|
27 |
+
}
|
28 |
+
|
29 |
+
/**
|
30 |
+
* Get Meta Data by Key.
|
31 |
+
*
|
32 |
+
* If no value found:
|
33 |
+
* If $single is true, an empty string is returned.
|
34 |
+
* If $single is false, an empty array is returned.
|
35 |
+
*
|
36 |
+
* @since 2.4.0
|
37 |
+
* @param string $key
|
38 |
+
* @param bool $single return first found meta, or all
|
39 |
+
* @return mixed
|
40 |
+
*/
|
41 |
+
public final function get_meta( $meta_key, $single = true ) {
|
42 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_meta' ) ) ) {
|
43 |
+
return $this->get_meta_wc27( $meta_key, $single );
|
44 |
+
}
|
45 |
+
|
46 |
+
return $this->get_meta_legacy( $meta_key, $single );
|
47 |
+
}
|
48 |
+
|
49 |
+
protected function get_meta_wc27( $meta_key, $single = true ) {
|
50 |
+
$values = $this->object->get_meta( $meta_key, $single );
|
51 |
+
if ($single) {
|
52 |
+
return $values; //it's just one, dispite the plural in the name!
|
53 |
+
}
|
54 |
+
|
55 |
+
if ( $values === '' ) {
|
56 |
+
return array(); //get_meta returns empty string if meta does not exist
|
57 |
+
}
|
58 |
+
|
59 |
+
return wp_list_pluck( array_values( $values ), 'value' ); //when not using array_values; the index might not start with 0
|
60 |
+
}
|
61 |
+
|
62 |
+
protected function get_meta_legacy( $meta_key, $single = true ) {
|
63 |
+
throw new Exception( sprintf( '%s::get_meta_legacy not implemented', get_class( $this ) ) );
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Update single meta data item by meta key.
|
68 |
+
* Call save() if the values must to be persisted.
|
69 |
+
* @since 2.4.0
|
70 |
+
* @param string $meta_key
|
71 |
+
* @param mixed $value The value; use null to clear
|
72 |
+
*/
|
73 |
+
public final function set_meta( $meta_key, $value ) {
|
74 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'update_meta_data' ) ) ) {
|
75 |
+
if ( $value === null ) {
|
76 |
+
$this->object->delete_meta_data( $meta_key );
|
77 |
+
} else {
|
78 |
+
$this->object->update_meta_data( $meta_key, $value );
|
79 |
+
}
|
80 |
+
return;
|
81 |
+
}
|
82 |
+
|
83 |
+
$this->set_meta_legacy( $meta_key, $value );
|
84 |
+
}
|
85 |
+
|
86 |
+
protected function set_meta_legacy( $meta_key, $value ) {
|
87 |
+
throw new Exception( sprintf( '%s::set_meta_legacy not implemented', get_class( $this ) ) );
|
88 |
+
}
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
/**
|
93 |
+
* Wrap a data object ( Coupons and products were converted to WC_Data since WC 2.7.0 )
|
94 |
+
*/
|
95 |
+
class WJECF_Wrap_Coupon extends WJECF_Wrap {
|
96 |
+
|
97 |
+
public function exists() {
|
98 |
+
return $this->get_id() > 0;
|
99 |
+
}
|
100 |
+
|
101 |
+
public function get_code() {
|
102 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_code' ) ) ) {
|
103 |
+
return $this->object->get_code();
|
104 |
+
}
|
105 |
+
|
106 |
+
return $this->object->code;
|
107 |
+
}
|
108 |
+
|
109 |
+
public function get_description() {
|
110 |
+
if ( false && $this->use_wc27 && is_callable( array( $this->object, 'get_description' ) ) ) {
|
111 |
+
return $this->object->get_description();
|
112 |
+
}
|
113 |
+
|
114 |
+
$post = get_post( $this->get_id() );
|
115 |
+
return $post->post_excerpt;
|
116 |
+
}
|
117 |
+
|
118 |
+
public function get_amount() {
|
119 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_amount' ) ) ) {
|
120 |
+
return $this->object->get_amount();
|
121 |
+
}
|
122 |
+
|
123 |
+
return $this->object->coupon_amount;
|
124 |
+
}
|
125 |
+
|
126 |
+
public function get_individual_use() {
|
127 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_individual_use' ) ) ) {
|
128 |
+
return $this->object->get_individual_use();
|
129 |
+
}
|
130 |
+
|
131 |
+
return $this->object->individual_use == 'yes';
|
132 |
+
}
|
133 |
+
|
134 |
+
public function get_limit_usage_to_x_items() {
|
135 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_limit_usage_to_x_items' ) ) ) {
|
136 |
+
return $this->object->get_limit_usage_to_x_items();
|
137 |
+
}
|
138 |
+
|
139 |
+
return $this->object->limit_usage_to_x_items;
|
140 |
+
}
|
141 |
+
|
142 |
+
public function set_limit_usage_to_x_items( $limit_usage_to_x_items ) {
|
143 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_limit_usage_to_x_items' ) ) ) {
|
144 |
+
$this->object->set_limit_usage_to_x_items( $limit_usage_to_x_items );
|
145 |
+
} else {
|
146 |
+
$this->object->limit_usage_to_x_items = $limit_usage_to_x_items;
|
147 |
+
}
|
148 |
+
}
|
149 |
+
|
150 |
+
public function get_discount_type() {
|
151 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_discount_type' ) ) ) {
|
152 |
+
return $this->object->get_discount_type();
|
153 |
+
}
|
154 |
+
|
155 |
+
return $this->object->discount_type;
|
156 |
+
}
|
157 |
+
|
158 |
+
public function set_discount_type( $discount_type ) {
|
159 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_discount_type' ) ) ) {
|
160 |
+
$this->object->set_discount_type( $discount_type );
|
161 |
+
} else {
|
162 |
+
$this->object->discount_type = $discount_type;
|
163 |
+
$this->object->type = $discount_type;
|
164 |
+
}
|
165 |
+
}
|
166 |
+
|
167 |
+
|
168 |
+
public function get_email_restrictions() {
|
169 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_email_restrictions' ) ) ) {
|
170 |
+
return $this->object->get_email_restrictions();
|
171 |
+
}
|
172 |
+
|
173 |
+
return $this->object->customer_email;
|
174 |
+
}
|
175 |
+
|
176 |
+
public function get_product_ids() {
|
177 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_product_ids' ) ) ) {
|
178 |
+
return $this->object->get_product_ids();
|
179 |
+
}
|
180 |
+
|
181 |
+
return $this->object->product_ids;
|
182 |
+
}
|
183 |
+
|
184 |
+
public function get_free_shipping() {
|
185 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_free_shipping' ) ) ) {
|
186 |
+
return $this->object->get_free_shipping();
|
187 |
+
}
|
188 |
+
|
189 |
+
return $this->object->enable_free_shipping();
|
190 |
+
}
|
191 |
+
|
192 |
+
public function get_product_categories() {
|
193 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_product_categories' ) ) ) {
|
194 |
+
return $this->object->get_product_categories();
|
195 |
+
}
|
196 |
+
|
197 |
+
return $this->object->product_categories;
|
198 |
+
}
|
199 |
+
|
200 |
+
public function get_minimum_amount() {
|
201 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_minimum_amount' ) ) ) {
|
202 |
+
return $this->object->get_minimum_amount();
|
203 |
+
}
|
204 |
+
|
205 |
+
return $this->object->minimum_amount;
|
206 |
+
}
|
207 |
+
|
208 |
+
/**
|
209 |
+
* Set the product IDs this coupon cannot be used with.
|
210 |
+
* @since 2.4.2 (For WC3.0)
|
211 |
+
* @param array $excluded_product_ids
|
212 |
+
* @throws WC_Data_Exception
|
213 |
+
*/
|
214 |
+
public function set_excluded_product_ids( $excluded_product_ids ) {
|
215 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_excluded_product_ids' ) ) ) {
|
216 |
+
$this->object->set_excluded_product_ids( $excluded_product_ids );
|
217 |
+
} else {
|
218 |
+
//NOTE: Prior to WC2.7 it was called exclude_ instead of excluded_
|
219 |
+
$this->object->exclude_product_ids = $excluded_product_ids;
|
220 |
+
}
|
221 |
+
}
|
222 |
+
|
223 |
+
/**
|
224 |
+
* Set the product category IDs this coupon cannot be used with.
|
225 |
+
* @since 2.4.2 (For WC3.0)
|
226 |
+
* @param array $excluded_product_categories
|
227 |
+
* @throws WC_Data_Exception
|
228 |
+
*/
|
229 |
+
public function set_excluded_product_categories( $excluded_product_categories ) {
|
230 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_excluded_product_categories' ) ) ) {
|
231 |
+
$this->object->set_excluded_product_categories( $excluded_product_categories );
|
232 |
+
} else {
|
233 |
+
//NOTE: Prior to WC2.7 it was called exclude_ instead of excluded_
|
234 |
+
$this->object->exclude_product_categories = $excluded_product_categories;
|
235 |
+
}
|
236 |
+
}
|
237 |
+
|
238 |
+
/**
|
239 |
+
* Set if this coupon should excluded sale items or not.
|
240 |
+
* @since 2.4.2 (For WC3.0)
|
241 |
+
* @param bool $exclude_sale_items
|
242 |
+
* @throws WC_Data_Exception
|
243 |
+
*/
|
244 |
+
public function set_exclude_sale_items( $exclude_sale_items ) {
|
245 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'set_exclude_sale_items' ) ) ) {
|
246 |
+
$this->object->set_exclude_sale_items( $exclude_sale_items );
|
247 |
+
} else {
|
248 |
+
//NOTE: Prior to WC2.7 it was yes/no instead of boolean
|
249 |
+
$this->object->exclude_sale_items = $exclude_sale_items ? 'yes' : 'no';
|
250 |
+
}
|
251 |
+
}
|
252 |
+
|
253 |
+
/**
|
254 |
+
* Check the type of the coupon
|
255 |
+
* @param string|array $type The type(s) we want to check for
|
256 |
+
* @return bool True if the coupon is of the type
|
257 |
+
*/
|
258 |
+
public function is_type( $type ) {
|
259 |
+
//Backwards compatibility 2.2.11
|
260 |
+
if ( method_exists( $this->object, 'is_type' ) ) {
|
261 |
+
return $this->object->is_type( $type );
|
262 |
+
}
|
263 |
+
|
264 |
+
return ( $this->object->discount_type == $type || ( is_array( $type ) && in_array( $this->object->discount_type, $type ) ) ) ? true : false;
|
265 |
+
}
|
266 |
+
|
267 |
+
protected function set_meta_legacy( $meta_key, $value ) {
|
268 |
+
$this->maybe_get_custom_fields();
|
269 |
+
//WJECF()->log('...setting legacy meta ' . $meta_key );
|
270 |
+
$this->legacy_custom_fields[ $meta_key ] = array( $value );
|
271 |
+
$this->legacy_unsaved_keys[] = $meta_key;
|
272 |
+
}
|
273 |
+
|
274 |
+
/**
|
275 |
+
* Save the metadata
|
276 |
+
* @return id of this object
|
277 |
+
*/
|
278 |
+
public function save() {
|
279 |
+
//WJECF()->log('Saving ' . $this->get_id() );
|
280 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'save' ) ) ) {
|
281 |
+
return $this->object->save();
|
282 |
+
}
|
283 |
+
|
284 |
+
//Save the unsaved...
|
285 |
+
foreach( $this->legacy_unsaved_keys as $meta_key ) {
|
286 |
+
//WJECF()->log('...saving legacy meta ' . $meta_key );
|
287 |
+
$value = reset( $this->legacy_custom_fields[ $meta_key ] );
|
288 |
+
if ( $value === null ) {
|
289 |
+
delete_post_meta( $this->get_id(), $meta_key );
|
290 |
+
} else {
|
291 |
+
update_post_meta( $this->get_id(), $meta_key, $value );
|
292 |
+
}
|
293 |
+
}
|
294 |
+
$this->legacy_unsaved_keys = array();
|
295 |
+
|
296 |
+
return $this->get_id();
|
297 |
+
}
|
298 |
+
|
299 |
+
protected $legacy_custom_fields = null; // [ 'meta_key' => [ array_of_values ] ]
|
300 |
+
protected $legacy_unsaved_keys = array();
|
301 |
+
|
302 |
+
protected function maybe_get_custom_fields() {
|
303 |
+
//Read custom fields if not yet done
|
304 |
+
if ( is_null( $this->legacy_custom_fields ) ) {
|
305 |
+
$this->legacy_custom_fields = $this->object->coupon_custom_fields;
|
306 |
+
}
|
307 |
+
}
|
308 |
+
|
309 |
+
protected function get_meta_legacy( $meta_key, $single = true ) {
|
310 |
+
//Read custom fields if not yet done
|
311 |
+
$this->maybe_get_custom_fields();
|
312 |
+
|
313 |
+
if ( isset( $this->legacy_custom_fields[ $meta_key ] ) ) {
|
314 |
+
$values = $this->legacy_custom_fields[ $meta_key ];
|
315 |
+
//WP_CLI::log( "LEGACY:" . print_r( $values, true ));
|
316 |
+
if ($single) {
|
317 |
+
return maybe_unserialize( reset( $values ) ); //reset yields the first
|
318 |
+
}
|
319 |
+
$values = array_map( 'maybe_unserialize', $values );
|
320 |
+
return $values;
|
321 |
+
}
|
322 |
+
|
323 |
+
return $single ? '' : array();
|
324 |
+
}
|
325 |
+
|
326 |
+
}
|
327 |
+
|
328 |
+
class WJECF_Wrap_Product extends WJECF_Wrap {
|
329 |
+
|
330 |
+
protected $legacy_custom_fields = null; // [ 'meta_key' => [ array_of_values ] ]
|
331 |
+
protected $legacy_unsaved_keys = array();
|
332 |
+
|
333 |
+
protected function get_meta_legacy( $meta_key, $single = true ) {
|
334 |
+
if ( isset( $this->legacy_custom_fields[ $meta_key ] ) ) {
|
335 |
+
$values = $this->legacy_custom_fields[ $meta_key ];
|
336 |
+
//WP_CLI::log( "LEGACY:" . print_r( $values, true ));
|
337 |
+
if ($single) {
|
338 |
+
return maybe_unserialize( reset( $values ) ); //reset yields the first
|
339 |
+
}
|
340 |
+
$values = array_map( 'maybe_unserialize', $values );
|
341 |
+
return $values;
|
342 |
+
}
|
343 |
+
|
344 |
+
return get_post_meta( $this->get_product_or_variation_id(), $field_name, $single );
|
345 |
+
}
|
346 |
+
|
347 |
+
public function set_meta_legacy( $meta_key, $value ) {
|
348 |
+
$this->legacy_custom_fields[ $meta_key ] = array( 0 => $value );
|
349 |
+
$this->legacy_unsaved_keys[] = $meta_key;
|
350 |
+
}
|
351 |
+
|
352 |
+
/**
|
353 |
+
* Combines get_meta or get_prop (in legacy WC those were the same thing, in WC3.0+ there is a difference)
|
354 |
+
* @param string $field_name
|
355 |
+
* @param bool $single
|
356 |
+
* @return
|
357 |
+
*/
|
358 |
+
public function get_field($field_name, $single = true) {
|
359 |
+
if ( $this->use_wc27 ) {
|
360 |
+
$values = $this->get_meta($field_name, $single);
|
361 |
+
if ( ! empty( $values ) ) return $values;
|
362 |
+
|
363 |
+
if ( is_callable( array( $this->object, 'get_prop' ) ) ) {
|
364 |
+
$value = $this->object->get_prop($field_name);
|
365 |
+
if ( ! empty( $value ) ) return $single ? $value : array( $value );
|
366 |
+
}
|
367 |
+
}
|
368 |
+
|
369 |
+
return get_post_meta( $this->get_product_or_variation_id(), $field_name, $single );
|
370 |
+
}
|
371 |
+
|
372 |
+
private function is_variation() {
|
373 |
+
return $this->object instanceof WC_Product_Variation;
|
374 |
+
}
|
375 |
+
|
376 |
+
/**
|
377 |
+
* Retrieve the id of the product or the variation id if it's a variant.
|
378 |
+
*
|
379 |
+
* (2.4.0: Moved from WJECF_Controller to WJECF_WC)
|
380 |
+
*
|
381 |
+
* @param WC_Product $product
|
382 |
+
* @return int|bool The variation or product id. False if not a valid product
|
383 |
+
*/
|
384 |
+
public function get_product_or_variation_id() {
|
385 |
+
if ( $this->is_variation() ) {
|
386 |
+
return $this->get_variation_id();
|
387 |
+
} elseif ( $this->object instanceof WC_Product ) {
|
388 |
+
return $this->get_id();
|
389 |
+
} else {
|
390 |
+
return false;
|
391 |
+
}
|
392 |
+
}
|
393 |
+
|
394 |
+
/**
|
395 |
+
* Retrieve the id of the parent product if it's a variation; otherwise retrieve this products id
|
396 |
+
*
|
397 |
+
* (2.4.0: Moved from WJECF_Controller to WJECF_WC)
|
398 |
+
*
|
399 |
+
* @param WC_Product $product
|
400 |
+
* @return int|bool The product id. False if this product is not a variation
|
401 |
+
*/
|
402 |
+
public function get_variable_product_id() {
|
403 |
+
if ( ! $this->is_variation() ) {
|
404 |
+
return false;
|
405 |
+
}
|
406 |
+
|
407 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_parent_id' ) ) ) {
|
408 |
+
return $this->object->get_parent_id();
|
409 |
+
} else {
|
410 |
+
return wp_get_post_parent_id( $this->object->variation_id );
|
411 |
+
}
|
412 |
+
}
|
413 |
+
|
414 |
+
/**
|
415 |
+
* Get current variation id
|
416 |
+
* @return int|bool False if this is not a variation
|
417 |
+
*/
|
418 |
+
protected function get_variation_id() {
|
419 |
+
if ( ! $this->is_variation() ) {
|
420 |
+
return false;
|
421 |
+
}
|
422 |
+
|
423 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_id' ) ) ) {
|
424 |
+
return $this->object->get_id();
|
425 |
+
} elseif ( $this->use_wc27 && is_callable( array( $this->object, 'get_variation_id' ) ) ) {
|
426 |
+
return $this->object->get_variation_id();
|
427 |
+
}
|
428 |
+
return $this->object->variation_id;
|
429 |
+
}
|
430 |
+
|
431 |
+
|
432 |
+
public function get_name() {
|
433 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_name' ) ) ) {
|
434 |
+
return $this->object->get_name();
|
435 |
+
} else {
|
436 |
+
return $this->object->post->post_title;
|
437 |
+
}
|
438 |
+
}
|
439 |
+
|
440 |
+
public function get_description() {
|
441 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_description' ) ) ) {
|
442 |
+
return $this->object->get_description();
|
443 |
+
} else {
|
444 |
+
return $this->object->post->post_content;
|
445 |
+
}
|
446 |
+
}
|
447 |
+
|
448 |
+
public function get_short_description() {
|
449 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_short_description' ) ) ) {
|
450 |
+
return $this->object->get_short_description();
|
451 |
+
} else {
|
452 |
+
return $this->object->post->post_excerpt;
|
453 |
+
}
|
454 |
+
}
|
455 |
+
|
456 |
+
public function get_tag_ids() {
|
457 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_tag_ids' ) ) ) {
|
458 |
+
return $this->object->get_tag_ids();
|
459 |
+
} else {
|
460 |
+
return $this->legacy_get_term_ids( 'product_tag' );
|
461 |
+
}
|
462 |
+
}
|
463 |
+
|
464 |
+
protected function legacy_get_term_ids( $taxonomy ) {
|
465 |
+
$terms = get_the_terms( $this->get_id(), $taxonomy );
|
466 |
+
if ( false === $terms || is_wp_error( $terms ) ) {
|
467 |
+
return array();
|
468 |
+
}
|
469 |
+
return wp_list_pluck( $terms, 'term_id' );
|
470 |
+
}
|
471 |
+
|
472 |
+
/**
|
473 |
+
* If set, get the default attributes for a variable product.
|
474 |
+
*
|
475 |
+
* @param string $attribute_name
|
476 |
+
* @return string
|
477 |
+
*/
|
478 |
+
public function get_variation_default_attribute( $attribute_name ) {
|
479 |
+
if ( $this->use_wc27 && is_callable( array( $this->object, 'get_variation_default_attribute' ) ) ) {
|
480 |
+
return $this->object->get_variation_default_attribute( $attribute_name );
|
481 |
+
}
|
482 |
+
return '';
|
483 |
+
}
|
484 |
+
|
485 |
+
}
|
includes/admin/WJECF_Admin.php
CHANGED
@@ -137,7 +137,7 @@ if ( ! class_exists('WJECF_Admin') ) {
|
|
137 |
}
|
138 |
|
139 |
public function admin_coupon_data_footer() {
|
140 |
-
$documentation_url =
|
141 |
if ( ! WJECF()->is_pro() ) {
|
142 |
$documentation_url = 'http://www.soft79.nl/documentation/wjecf';
|
143 |
?>
|
137 |
}
|
138 |
|
139 |
public function admin_coupon_data_footer() {
|
140 |
+
$documentation_url = WJECF()->plugin_url( 'docs/index.html' );
|
141 |
if ( ! WJECF()->is_pro() ) {
|
142 |
$documentation_url = 'http://www.soft79.nl/documentation/wjecf';
|
143 |
?>
|
includes/admin/WJECF_Admin_Settings.php
CHANGED
@@ -48,6 +48,8 @@ class WJECF_Admin_Settings extends Abstract_WJECF_Plugin {
|
|
48 |
|
49 |
register_setting( self::SETTINGS_PAGE, self::OPTION_NAME, array( $this, 'validate_settings' ) );
|
50 |
|
|
|
|
|
51 |
// Section DEBUG
|
52 |
add_settings_section(
|
53 |
self::DOM_PREFIX . 'section_debug',
|
@@ -91,6 +93,9 @@ class WJECF_Admin_Settings extends Abstract_WJECF_Plugin {
|
|
91 |
);
|
92 |
}
|
93 |
}
|
|
|
|
|
|
|
94 |
|
95 |
|
96 |
}
|
@@ -100,7 +105,7 @@ class WJECF_Admin_Settings extends Abstract_WJECF_Plugin {
|
|
100 |
$options = WJECF()->get_options();
|
101 |
|
102 |
//disabled_plugins
|
103 |
-
if ( is_array( $input['disabled_plugins'] ) ) {
|
104 |
foreach( $input['disabled_plugins'] as $class_name => $disabled ) {
|
105 |
|
106 |
$plugin = WJECF()->get_plugin( $class_name );
|
@@ -127,21 +132,19 @@ class WJECF_Admin_Settings extends Abstract_WJECF_Plugin {
|
|
127 |
//debug_mode
|
128 |
$options['debug_mode'] = isset( $input['debug_mode'] ) && $input['debug_mode'] === 'yes';
|
129 |
|
|
|
130 |
return $options;
|
131 |
|
132 |
}
|
133 |
|
134 |
public function render_section( $section ) {
|
135 |
switch ( $section['id'] ) {
|
136 |
-
|
137 |
case self::DOM_PREFIX . 'section_debug':
|
138 |
$body = __( 'When debug mode is enabled, extensive logging will be active and WJECF Plugins can be enabled/disabled. If there are compatibility issues with WooCommerce plugins, you can try disabling WJECF Plugins. Please don\'t keep debug mode enabled on a production environment when it is not necessary. Log can be found <a href="%s">here</a>.' , 'woocommerce-jos-autocoupon' );
|
139 |
$body = sprintf( $body, admin_url( 'admin.php?page=wc-status&tab=logs' ) );
|
140 |
printf( '<p>%s</p>', $body );
|
141 |
break;
|
142 |
-
|
143 |
}
|
144 |
-
|
145 |
}
|
146 |
|
147 |
/**
|
48 |
|
49 |
register_setting( self::SETTINGS_PAGE, self::OPTION_NAME, array( $this, 'validate_settings' ) );
|
50 |
|
51 |
+
do_action( 'wjecf_admin_before_settings' );
|
52 |
+
|
53 |
// Section DEBUG
|
54 |
add_settings_section(
|
55 |
self::DOM_PREFIX . 'section_debug',
|
93 |
);
|
94 |
}
|
95 |
}
|
96 |
+
|
97 |
+
do_action( 'wjecf_admin_after_settings' );
|
98 |
+
|
99 |
|
100 |
|
101 |
}
|
105 |
$options = WJECF()->get_options();
|
106 |
|
107 |
//disabled_plugins
|
108 |
+
if ( isset( $input['disabled_plugins'] ) && is_array( $input['disabled_plugins'] ) ) {
|
109 |
foreach( $input['disabled_plugins'] as $class_name => $disabled ) {
|
110 |
|
111 |
$plugin = WJECF()->get_plugin( $class_name );
|
132 |
//debug_mode
|
133 |
$options['debug_mode'] = isset( $input['debug_mode'] ) && $input['debug_mode'] === 'yes';
|
134 |
|
135 |
+
$options = apply_filters( 'wjecf_admin_validate_settings', $options, $input );
|
136 |
return $options;
|
137 |
|
138 |
}
|
139 |
|
140 |
public function render_section( $section ) {
|
141 |
switch ( $section['id'] ) {
|
|
|
142 |
case self::DOM_PREFIX . 'section_debug':
|
143 |
$body = __( 'When debug mode is enabled, extensive logging will be active and WJECF Plugins can be enabled/disabled. If there are compatibility issues with WooCommerce plugins, you can try disabling WJECF Plugins. Please don\'t keep debug mode enabled on a production environment when it is not necessary. Log can be found <a href="%s">here</a>.' , 'woocommerce-jos-autocoupon' );
|
144 |
$body = sprintf( $body, admin_url( 'admin.php?page=wc-status&tab=logs' ) );
|
145 |
printf( '<p>%s</p>', $body );
|
146 |
break;
|
|
|
147 |
}
|
|
|
148 |
}
|
149 |
|
150 |
/**
|
languages/woocommerce-jos-autocoupon-es_ES.mo
CHANGED
Binary file
|
languages/woocommerce-jos-autocoupon-es_ES.po
CHANGED
@@ -5,34 +5,166 @@ msgstr ""
|
|
5 |
"Project-Id-Version: WooCommerce Extended Coupon Features\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-"
|
7 |
"added-coupons\n"
|
8 |
-
"POT-Creation-Date:
|
9 |
-
"PO-Revision-Date:
|
10 |
"Last-Translator: \n"
|
11 |
"Language-Team: \n"
|
12 |
"Language: es_ES\n"
|
13 |
"MIME-Version: 1.0\n"
|
14 |
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
"X-Generator: Poedit
|
17 |
"X-Poedit-KeywordsList: __;_e\n"
|
18 |
"X-Poedit-Basepath: ..\n"
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
"X-Poedit-SearchPathExcluded-0: docs\n"
|
21 |
|
22 |
-
#: includes/
|
|
|
23 |
msgid ""
|
24 |
-
"
|
25 |
-
"
|
26 |
-
"newer version."
|
27 |
msgstr ""
|
|
|
|
|
28 |
|
29 |
-
#: includes/
|
30 |
msgid ""
|
31 |
-
"
|
32 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
msgstr ""
|
34 |
|
35 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
36 |
msgid ""
|
37 |
"<strong>WooCommerce Extended Coupon Features:</strong> You are using an old "
|
38 |
"version of WooCommerce. Updating of WooCommerce is recommended as using an "
|
@@ -40,154 +172,150 @@ msgid ""
|
|
40 |
"plugins."
|
41 |
msgstr ""
|
42 |
|
43 |
-
#: includes/admin/
|
44 |
msgid "(AND)"
|
45 |
msgstr "(TODOS)"
|
46 |
|
47 |
-
#: includes/admin/
|
48 |
msgid "(OR)"
|
49 |
msgstr "(UNO)"
|
50 |
|
51 |
-
#: includes/admin/
|
52 |
-
msgid "Products"
|
53 |
-
msgstr "Productos"
|
54 |
-
|
55 |
-
#: includes/admin/wjecf-admin.php:132 includes/admin/wjecf-admin.php:276
|
56 |
msgid "Checkout"
|
57 |
msgstr "Tramitar"
|
58 |
|
59 |
-
#: includes/admin/
|
60 |
msgid "Miscellaneous"
|
61 |
msgstr "Diversos"
|
62 |
|
63 |
-
#: includes/admin/
|
64 |
msgid "Do you find WooCommerce Extended Coupon Features useful?"
|
65 |
msgstr "Le gusta WooCommerce Extended Coupon Features?"
|
66 |
|
67 |
-
#: includes/admin/
|
68 |
msgid "Express your gratitude"
|
69 |
msgstr "Exprese su gratitud"
|
70 |
|
71 |
-
#: includes/admin/
|
72 |
msgid "Donate to the developer"
|
73 |
msgstr "Hacer una donación"
|
74 |
|
75 |
-
#: includes/admin/
|
76 |
msgid "Documentation"
|
77 |
msgstr "Documentación"
|
78 |
|
79 |
-
#: includes/admin/
|
80 |
msgid "WooCommerce Extended Coupon Features Documentation"
|
81 |
msgstr "Documentación de WooCommerce Extended Coupon Features"
|
82 |
|
83 |
-
#: includes/admin/
|
84 |
msgid "Matching products"
|
85 |
msgstr "Productos conformes"
|
86 |
|
87 |
-
#: includes/admin/
|
88 |
msgid "Products Operator"
|
89 |
msgstr ""
|
90 |
|
91 |
-
#: includes/admin/
|
92 |
-
#: includes/
|
93 |
msgid "OR"
|
94 |
msgstr "UNO"
|
95 |
|
96 |
-
#: includes/admin/
|
97 |
-
#: includes/
|
98 |
msgid "AND"
|
99 |
msgstr "TODOS"
|
100 |
|
101 |
-
#: includes/admin/
|
102 |
msgid ""
|
103 |
"Use AND if ALL of the products must be in the cart to use this coupon "
|
104 |
"(instead of only one of the products)."
|
105 |
msgstr ""
|
106 |
|
107 |
-
#: includes/admin/
|
108 |
msgid "Categories Operator"
|
109 |
msgstr ""
|
110 |
|
111 |
-
#: includes/admin/
|
112 |
msgid ""
|
113 |
"Use AND if products from ALL of the categories must be in the cart to use "
|
114 |
"this coupon (instead of only one from one of the categories)."
|
115 |
msgstr ""
|
116 |
|
117 |
-
#: includes/admin/
|
118 |
msgid "Minimum quantity of matching products"
|
119 |
-
msgstr "Cantidad mínima de productos conformes
|
120 |
|
121 |
-
#: includes/admin/
|
122 |
msgid "No minimum"
|
123 |
msgstr "Sin mínimo"
|
124 |
|
125 |
-
#: includes/admin/
|
126 |
msgid ""
|
127 |
"Minimum quantity of the products that match the given product or category "
|
128 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
129 |
"restrictions are specified, the total number of products is used."
|
130 |
msgstr "Cantidad mínima de productos conformes (vea 'Restricción de uso')."
|
131 |
|
132 |
-
#: includes/admin/
|
133 |
msgid "Maximum quantity of matching products"
|
134 |
-
msgstr "Cantidad máxima de productos conformes
|
135 |
|
136 |
-
#: includes/admin/
|
137 |
msgid "No maximum"
|
138 |
msgstr "Sin máximo"
|
139 |
|
140 |
-
#: includes/admin/
|
141 |
msgid ""
|
142 |
"Maximum quantity of the products that match the given product or category "
|
143 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
144 |
"restrictions are specified, the total number of products is used."
|
145 |
msgstr "Cantidad máxima de productos conformes (vea 'Restricción de uso')."
|
146 |
|
147 |
-
#: includes/admin/
|
148 |
msgid "Minimum subtotal of matching products"
|
149 |
-
msgstr "Subtotal mínimo de productos conformes
|
150 |
|
151 |
-
#: includes/admin/
|
152 |
msgid ""
|
153 |
"Minimum price subtotal of the products that match the given product or "
|
154 |
"category restrictions (see tab 'usage restriction')."
|
155 |
msgstr "Subtotal mínimo de productos conformes (vea 'Restricción de uso')."
|
156 |
|
157 |
-
#: includes/admin/
|
158 |
msgid "Maximum subtotal of matching products"
|
159 |
-
msgstr "Subtotal máximo de productos conformes
|
160 |
|
161 |
-
#: includes/admin/
|
162 |
msgid ""
|
163 |
"Maximum price subtotal of the products that match the given product or "
|
164 |
"category restrictions (see tab 'usage restriction')."
|
165 |
msgstr "Subtotal máximo de productos conformes (vea 'Restricción de uso')."
|
166 |
|
167 |
-
#: includes/admin/
|
168 |
msgid "Shipping methods"
|
169 |
msgstr "Métodos de envío"
|
170 |
|
171 |
-
#: includes/admin/
|
172 |
msgid "Any shipping method"
|
173 |
msgstr "Métodos de envío"
|
174 |
|
175 |
-
#: includes/admin/
|
176 |
msgid ""
|
177 |
"One of these shipping methods must be selected in order for this coupon to "
|
178 |
"be valid."
|
179 |
msgstr ""
|
180 |
"Uno de estos métodos de pago tiene que ser seleccionado para usar este cupón."
|
181 |
|
182 |
-
#: includes/admin/
|
183 |
msgid "Payment methods"
|
184 |
msgstr "Métodos de pago"
|
185 |
|
186 |
-
#: includes/admin/
|
187 |
msgid "Any payment method"
|
188 |
msgstr "Métodos de pago"
|
189 |
|
190 |
-
#: includes/admin/
|
191 |
msgid ""
|
192 |
"One of these payment methods must be selected in order for this coupon to be "
|
193 |
"valid."
|
@@ -195,11 +323,11 @@ msgstr ""
|
|
195 |
"Uno de estos métodos de envío tiene que ser seleccionado para usar este "
|
196 |
"cupón."
|
197 |
|
198 |
-
#: includes/admin/
|
199 |
msgid "Customer restrictions"
|
200 |
msgstr "Restricción de clientes"
|
201 |
|
202 |
-
#: includes/admin/
|
203 |
msgid ""
|
204 |
"If both a customer and a role restriction are supplied, matching either one "
|
205 |
"of them will suffice."
|
@@ -207,344 +335,210 @@ msgstr ""
|
|
207 |
"Si se ha introducido tanto una restricción de cliente como una restricción "
|
208 |
"de perfil, sí coincide uno de ellos será suficiente."
|
209 |
|
210 |
-
#: includes/admin/
|
211 |
msgid "Allowed Customers"
|
212 |
msgstr "Clientes"
|
213 |
|
214 |
-
#: includes/admin/
|
215 |
-
msgid "Any customer"
|
216 |
-
msgstr "Clientes"
|
217 |
-
|
218 |
-
#: includes/admin/wjecf-admin.php:337
|
219 |
msgid "Only these customers may use this coupon."
|
220 |
msgstr "Solo estos clientes pueden usar este cupón."
|
221 |
|
222 |
-
#: includes/admin/
|
223 |
msgid "Allowed User Roles"
|
224 |
msgstr "Perfiles del cliente"
|
225 |
|
226 |
-
#: includes/admin/
|
227 |
msgid "Any role"
|
228 |
msgstr "Perfiles del cliente"
|
229 |
|
230 |
-
#: includes/admin/
|
231 |
msgid "Only these User Roles may use this coupon."
|
232 |
msgstr "Solo clientes con este perfil pueden usar este cupón."
|
233 |
|
234 |
-
#: includes/admin/
|
235 |
msgid "Disallowed User Roles"
|
236 |
msgstr "Perfiles del cliente excluidos"
|
237 |
|
238 |
-
#: includes/admin/
|
239 |
msgid "These User Roles will be specifically excluded from using this coupon."
|
240 |
msgstr "Clientes con este perfil no pueden usar este cupón."
|
241 |
|
242 |
-
#: includes/admin/
|
243 |
-
msgid "
|
|
|
244 |
msgstr ""
|
245 |
|
246 |
-
#: includes/admin/
|
247 |
-
|
248 |
-
|
249 |
-
|
|
|
|
|
250 |
|
251 |
-
#: includes/admin/
|
252 |
msgid ""
|
253 |
-
"
|
254 |
-
"
|
255 |
-
"0 until minimum spend is reached."
|
256 |
msgstr ""
|
257 |
|
258 |
-
#: includes/admin/
|
259 |
#, php-format
|
260 |
msgid "%s (Default)"
|
261 |
msgstr "%s (predeterminado)"
|
262 |
|
263 |
-
#: includes/admin/
|
|
|
264 |
msgid "Search for a product…"
|
265 |
-
msgstr "Buscar producto
|
266 |
|
267 |
-
#: includes/
|
268 |
-
|
269 |
-
|
270 |
-
msgstr "Aplicar cupón automaticamente"
|
271 |
-
|
272 |
-
#: includes/wjecf-autocoupon.php:63
|
273 |
-
msgid "Individual use"
|
274 |
-
msgstr "Uso individual"
|
275 |
-
|
276 |
-
#: includes/wjecf-autocoupon.php:83 includes/wjecf-autocoupon.php:91
|
277 |
-
msgid "Yes"
|
278 |
-
msgstr "Sí"
|
279 |
-
|
280 |
-
#: includes/wjecf-autocoupon.php:83 includes/wjecf-autocoupon.php:91
|
281 |
-
msgid "No"
|
282 |
-
msgstr "No"
|
283 |
-
|
284 |
-
#: includes/wjecf-autocoupon.php:102
|
285 |
-
msgid "Auto coupons"
|
286 |
-
msgstr "Cupones autom."
|
287 |
|
288 |
-
#: includes/
|
289 |
-
msgid ""
|
290 |
-
"Automatically add the coupon to the cart if the restrictions are met. Please "
|
291 |
-
"enter a description when you check this box, the description will be shown "
|
292 |
-
"in the customer's cart if the coupon is applied."
|
293 |
msgstr ""
|
294 |
-
"Aplicar el cupón automaticamente al carrito de compras cuando los requisitos "
|
295 |
-
"sean cumplidos. Por favor ingrese una descripción, ya que este será mostrado "
|
296 |
-
"al cliente cuando el cupón esté aplicado."
|
297 |
-
|
298 |
-
#: includes/wjecf-autocoupon.php:146
|
299 |
-
msgid "Priority"
|
300 |
-
msgstr "Prioridad"
|
301 |
|
302 |
-
#: includes/
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
#: includes/wjecf-autocoupon.php:148
|
307 |
-
msgid ""
|
308 |
-
"When 'individual use' is checked, auto coupons with a higher value will have "
|
309 |
-
"priority over other auto coupons."
|
310 |
msgstr ""
|
311 |
-
"Al activar 'uso individual', cupones automáticos con mayor prioridad tendrán "
|
312 |
-
"preferencia sobre los otros cupones."
|
313 |
-
|
314 |
-
#: includes/wjecf-autocoupon.php:158
|
315 |
-
msgid "Apply silently"
|
316 |
-
msgstr "Aplicar sin mensaje"
|
317 |
-
|
318 |
-
#: includes/wjecf-autocoupon.php:159
|
319 |
-
msgid "Don't display a message when this coupon is automatically applied."
|
320 |
-
msgstr "No mostrar mensaje cuando el cupon esté aplicado automaticamente."
|
321 |
-
|
322 |
-
#: includes/wjecf-autocoupon.php:287
|
323 |
-
msgid "Free shipping coupon"
|
324 |
-
msgstr "Cupón para envío gratis"
|
325 |
-
|
326 |
-
#: includes/wjecf-autocoupon.php:364
|
327 |
-
#, php-format
|
328 |
-
msgid "Discount applied: %s"
|
329 |
-
msgstr "Descuento aplicado: %s"
|
330 |
-
|
331 |
-
#: includes/wjecf-controller.php:191
|
332 |
-
#, php-format
|
333 |
-
msgid "The minimum subtotal of the matching products for this coupon is %s."
|
334 |
-
msgstr "El subtotal mínimo de los productos conformes para este cupón es %s."
|
335 |
-
|
336 |
-
#: includes/wjecf-controller.php:195
|
337 |
-
#, php-format
|
338 |
-
msgid "The maximum subtotal of the matching products for this coupon is %s."
|
339 |
-
msgstr "El subtotal máximo de los productos conformes para este cupón es %s."
|
340 |
-
|
341 |
-
#: includes/wjecf-controller.php:199
|
342 |
-
#, php-format
|
343 |
-
msgid "The minimum quantity of matching products for this coupon is %s."
|
344 |
-
msgstr "La cantidad mínima de productos conformes para este cupón es %s."
|
345 |
|
346 |
-
#: includes/
|
347 |
-
|
348 |
-
|
349 |
-
msgstr "La cantidad máxima de productos conformes para este cupón es %s."
|
350 |
|
351 |
-
#: includes/
|
352 |
-
msgid "
|
353 |
-
msgstr "
|
354 |
|
355 |
-
#: includes/
|
356 |
-
msgid "
|
357 |
-
msgstr "
|
358 |
|
359 |
-
#: includes/
|
360 |
#, php-format
|
361 |
-
msgid "
|
362 |
-
|
|
|
|
|
|
|
|
|
|
|
363 |
|
364 |
-
#: includes/
|
365 |
msgid "Discount on cart with excluded products"
|
366 |
msgstr "Descuento en carrito con productos excluidos"
|
367 |
|
368 |
-
#: includes/
|
369 |
msgid "Allow discount on cart with excluded items"
|
370 |
msgstr "Permitir descuento en carrito con productos excluidos"
|
371 |
|
372 |
-
#: includes/
|
373 |
msgid ""
|
374 |
"Check this box to allow a 'Cart Discount' coupon to be applied even when "
|
375 |
"excluded items are in the cart (see tab 'usage restriction')."
|
376 |
msgstr ""
|
377 |
|
378 |
-
#: includes/
|
379 |
-
msgid "Limit discount to"
|
380 |
-
msgstr "Limitar descuento a"
|
381 |
-
|
382 |
-
#: includes/wjecf-pro-controller.php:78
|
383 |
msgid ""
|
384 |
-
"
|
385 |
-
"
|
386 |
msgstr ""
|
387 |
|
388 |
-
#: includes/
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
#: includes/wjecf-pro-controller.php:86
|
393 |
-
msgid "One item per order line"
|
394 |
-
msgstr "Un producto por linea"
|
395 |
|
396 |
-
#: includes/
|
397 |
-
msgid "
|
398 |
-
|
|
|
|
|
|
|
399 |
|
400 |
-
#: includes/
|
401 |
-
msgid "
|
402 |
-
msgstr "
|
403 |
|
404 |
-
#: includes/
|
405 |
msgid ""
|
406 |
-
"
|
407 |
-
"
|
408 |
msgstr ""
|
409 |
|
410 |
-
#: includes/
|
|
|
411 |
#, php-format
|
412 |
msgid "Coupon '%s' will be applied when it's conditions are met."
|
413 |
msgstr ""
|
414 |
"Cupón '%s' se aplicará automaticamente cuando cumpla con los requisitos."
|
415 |
|
416 |
-
#: includes/
|
417 |
#, php-format
|
418 |
msgid "Coupon '%s' applied."
|
419 |
msgstr "Cupon '%s' aplicado."
|
420 |
|
421 |
-
#: includes/
|
422 |
-
msgid "
|
423 |
-
msgstr ""
|
424 |
-
|
425 |
-
#: includes/wjecf-pro-evalmath.php:736
|
426 |
-
msgid "cannot assign to constant '{$a}'"
|
427 |
-
msgstr ""
|
428 |
-
|
429 |
-
#: includes/wjecf-pro-evalmath.php:737
|
430 |
-
msgid "cannot assign to readonly '{$a}'"
|
431 |
-
msgstr ""
|
432 |
-
|
433 |
-
#: includes/wjecf-pro-evalmath.php:738
|
434 |
-
msgid "cannot redefine built-in function '{$a}()'"
|
435 |
-
msgstr ""
|
436 |
-
|
437 |
-
#: includes/wjecf-pro-evalmath.php:739
|
438 |
-
msgid "division by zero"
|
439 |
msgstr ""
|
440 |
|
441 |
-
#: includes/
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
#:
|
446 |
-
msgid "illegal character '{$a}'"
|
447 |
-
msgstr ""
|
448 |
-
|
449 |
-
#: includes/wjecf-pro-evalmath.php:742
|
450 |
-
msgid "illegal character '_'"
|
451 |
-
msgstr ""
|
452 |
-
|
453 |
-
#: includes/wjecf-pro-evalmath.php:743
|
454 |
-
msgid "expecting operator, implicit multiplication not allowed."
|
455 |
-
msgstr ""
|
456 |
-
|
457 |
-
#: includes/wjecf-pro-evalmath.php:744
|
458 |
-
msgid "internal error"
|
459 |
-
msgstr ""
|
460 |
-
|
461 |
-
#: includes/wjecf-pro-evalmath.php:745
|
462 |
-
msgid "operator '{$a}' lacks operand"
|
463 |
-
msgstr ""
|
464 |
-
|
465 |
-
#: includes/wjecf-pro-evalmath.php:746
|
466 |
-
msgid "undefined variable '{$a}'"
|
467 |
-
msgstr ""
|
468 |
-
|
469 |
-
#: includes/wjecf-pro-evalmath.php:747
|
470 |
-
msgid "undefined variable '{$a}' in function definition"
|
471 |
-
msgstr ""
|
472 |
-
|
473 |
-
#: includes/wjecf-pro-evalmath.php:748
|
474 |
-
msgid "unexpected closing bracket"
|
475 |
-
msgstr ""
|
476 |
-
|
477 |
-
#: includes/wjecf-pro-evalmath.php:749
|
478 |
-
msgid "unexpected comma"
|
479 |
-
msgstr ""
|
480 |
-
|
481 |
-
#: includes/wjecf-pro-evalmath.php:750
|
482 |
-
msgid "unexpected operator '{$a}'"
|
483 |
-
msgstr ""
|
484 |
-
|
485 |
-
#: includes/wjecf-pro-evalmath.php:751
|
486 |
-
msgid ""
|
487 |
-
"wrong number of arguments for function '{$a->function}()' ({$a->given} "
|
488 |
-
"given, {$a->expected} expected)"
|
489 |
-
msgstr ""
|
490 |
-
|
491 |
-
#: includes/wjecf-pro-free-products.php:196
|
492 |
-
msgid "Please select your free gift."
|
493 |
-
msgstr "Elije tu regalo."
|
494 |
-
|
495 |
-
#: includes/wjecf-pro-free-products.php:460
|
496 |
-
#: includes/wjecf-pro-free-products.php:470
|
497 |
-
msgid "Free!"
|
498 |
-
msgstr "Gratis!"
|
499 |
-
|
500 |
-
#: includes/wjecf-pro-free-products.php:535
|
501 |
-
#: includes/wjecf-pro-free-products.php:558
|
502 |
-
#: includes/wjecf-pro-free-products.php:564
|
503 |
msgid "Free products"
|
504 |
msgstr "Productos gratis"
|
505 |
|
506 |
-
#: includes/
|
507 |
msgid ""
|
508 |
"Free products that will be added to the cart when this coupon is applied."
|
509 |
msgstr "Productos gratuitos que serán aumentado al carrito."
|
510 |
|
511 |
-
#: includes/
|
512 |
msgid "Select one"
|
513 |
msgstr "Elejir uno"
|
514 |
|
515 |
-
#: includes/
|
516 |
msgid "Check this box if the customer must choose from the free products."
|
517 |
msgstr ""
|
518 |
"Marque esta casilla si el cliente tiene que escojer uno de los productos "
|
519 |
"gratuitos."
|
520 |
|
521 |
-
#: includes/
|
522 |
msgid "'Select your gift'-message"
|
523 |
msgstr "Mensaje 'Elije tu regalo'"
|
524 |
|
525 |
-
#: includes/
|
526 |
msgid "Please choose your free gift:"
|
527 |
msgstr "Elije tu regalo:"
|
528 |
|
529 |
-
#: includes/
|
530 |
msgid "This message is displayed when the customer must choose a free product."
|
531 |
msgstr ""
|
532 |
|
533 |
-
#: includes/
|
534 |
msgid "Allow multiplication of the free products"
|
535 |
msgstr "Multiplicar los productos gratuitos"
|
536 |
|
537 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
538 |
msgid ""
|
539 |
"The amount of free products is multiplied every time the minimum spend, "
|
540 |
"subtotal or quantity is reached."
|
541 |
msgstr ""
|
542 |
|
543 |
-
#: includes/
|
544 |
msgid "BOGO matching products"
|
545 |
msgstr "1+1 gratis para los productos conformes"
|
546 |
|
547 |
-
#: includes/
|
548 |
msgid ""
|
549 |
"Buy one or more of any of the matching products (see 'Usage Restriction'-"
|
550 |
"tab) and get one free. Check 'Allow multiplication' to get one free item for "
|
@@ -554,29 +548,93 @@ msgstr ""
|
|
554 |
"gratis. Marque la casilla 'multiplicar los productos gratuitos' para "
|
555 |
"multiplicar con la cantidad de productos conformes en el carritos de compras."
|
556 |
|
557 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
558 |
msgid "Custom Fields Operator"
|
559 |
msgstr ""
|
560 |
|
561 |
-
#: includes/
|
562 |
msgid ""
|
563 |
"Use AND if all of the custom fields must be in the cart to use this coupon "
|
564 |
"(instead of only one of the custom fields)."
|
565 |
msgstr ""
|
566 |
|
567 |
-
#: includes/
|
568 |
msgid "Custom Fields"
|
569 |
msgstr ""
|
570 |
|
571 |
-
#: includes/
|
572 |
msgid "Name"
|
573 |
msgstr "Nombre"
|
574 |
|
575 |
-
#: includes/
|
576 |
msgid "Value"
|
577 |
msgstr "Valor"
|
578 |
|
579 |
-
#: includes/
|
580 |
msgid ""
|
581 |
"If multiple lines are entered, only one of them needs to match. A whole word "
|
582 |
"case insensitive match is executed by default and % can be used as wildcard. "
|
@@ -588,16 +646,125 @@ msgid ""
|
|
588 |
"'/^rock$/i' matches 'Rock' but not 'Rock the house'"
|
589 |
msgstr ""
|
590 |
|
591 |
-
#: includes/
|
592 |
msgid "— Select —"
|
593 |
msgstr "— Escoge —"
|
594 |
|
595 |
-
#:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
596 |
msgid ""
|
597 |
-
"
|
598 |
-
"
|
|
|
|
|
|
|
|
|
|
|
599 |
msgstr ""
|
600 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
#~ msgid "AND Products (not OR)"
|
602 |
#~ msgstr "TODOS los productos"
|
603 |
|
5 |
"Project-Id-Version: WooCommerce Extended Coupon Features\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-"
|
7 |
"added-coupons\n"
|
8 |
+
"POT-Creation-Date: 2017-09-23 22:21+0200\n"
|
9 |
+
"PO-Revision-Date: 2017-09-23 22:22+0200\n"
|
10 |
"Last-Translator: \n"
|
11 |
"Language-Team: \n"
|
12 |
"Language: es_ES\n"
|
13 |
"MIME-Version: 1.0\n"
|
14 |
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
"X-Generator: Poedit 2.0.1\n"
|
17 |
"X-Poedit-KeywordsList: __;_e\n"
|
18 |
"X-Poedit-Basepath: ..\n"
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
"X-Poedit-SearchPathExcluded-0: docs\n"
|
21 |
|
22 |
+
#: includes/Abstract_WJECF_Plugin.php:49
|
23 |
+
#, php-format
|
24 |
msgid ""
|
25 |
+
"WooCommerce Extended Coupon Features version %s is required. You have "
|
26 |
+
"version %s"
|
|
|
27 |
msgstr ""
|
28 |
+
"Se requiere versión %s de WooCommerce Extended Coupon Features. Usted tiene "
|
29 |
+
"versión %s."
|
30 |
|
31 |
+
#: includes/WJECF_AutoCoupon.php:14
|
32 |
msgid ""
|
33 |
+
"Allow coupons to be automatically applied to the cart when restrictions are "
|
34 |
+
"met or by url."
|
35 |
+
msgstr ""
|
36 |
+
|
37 |
+
#: includes/WJECF_AutoCoupon.php:67 includes/WJECF_AutoCoupon.php:201
|
38 |
+
#: includes/WJECF_AutoCoupon.php:208
|
39 |
+
msgid "Auto coupon"
|
40 |
+
msgstr "Aplicar cupón automaticamente"
|
41 |
+
|
42 |
+
#: includes/WJECF_AutoCoupon.php:72
|
43 |
+
msgid "Individual use"
|
44 |
+
msgstr "Uso individual"
|
45 |
+
|
46 |
+
#: includes/WJECF_AutoCoupon.php:90 includes/WJECF_AutoCoupon.php:173
|
47 |
+
msgid "Auto coupons"
|
48 |
+
msgstr "Cupones autom."
|
49 |
+
|
50 |
+
#: includes/WJECF_AutoCoupon.php:97
|
51 |
+
msgid "Allow remove 'Auto Coupons'"
|
52 |
+
msgstr ""
|
53 |
+
|
54 |
+
#: includes/WJECF_AutoCoupon.php:127
|
55 |
+
#: includes/admin/WJECF_Admin_Settings.php:190
|
56 |
+
#: includes/admin/WJECF_Admin_Settings.php:227
|
57 |
+
msgid "Enabled"
|
58 |
+
msgstr ""
|
59 |
+
|
60 |
+
#: includes/WJECF_AutoCoupon.php:132
|
61 |
+
msgid ""
|
62 |
+
"Check this box to allow the customer to remove 'Auto Coupons' from the cart."
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: includes/WJECF_AutoCoupon.php:154 includes/WJECF_AutoCoupon.php:162
|
66 |
+
msgid "Yes"
|
67 |
+
msgstr "Sí"
|
68 |
+
|
69 |
+
#: includes/WJECF_AutoCoupon.php:154 includes/WJECF_AutoCoupon.php:162
|
70 |
+
msgid "No"
|
71 |
+
msgstr "No"
|
72 |
+
|
73 |
+
#: includes/WJECF_AutoCoupon.php:209
|
74 |
+
msgid ""
|
75 |
+
"Automatically add the coupon to the cart if the restrictions are met. Please "
|
76 |
+
"enter a description when you check this box, the description will be shown "
|
77 |
+
"in the customer's cart if the coupon is applied."
|
78 |
+
msgstr ""
|
79 |
+
"Aplicar el cupón automaticamente al carrito de compras cuando los requisitos "
|
80 |
+
"sean cumplidos. Por favor ingrese una descripción, ya que este será mostrado "
|
81 |
+
"al cliente cuando el cupón esté aplicado."
|
82 |
+
|
83 |
+
#: includes/WJECF_AutoCoupon.php:217
|
84 |
+
msgid "Priority"
|
85 |
+
msgstr "Prioridad"
|
86 |
+
|
87 |
+
#: includes/WJECF_AutoCoupon.php:218
|
88 |
+
msgid "No priority"
|
89 |
+
msgstr "Sin prioridad"
|
90 |
+
|
91 |
+
#: includes/WJECF_AutoCoupon.php:219
|
92 |
+
msgid ""
|
93 |
+
"When 'individual use' is checked, auto coupons with a higher value will have "
|
94 |
+
"priority over other auto coupons."
|
95 |
+
msgstr ""
|
96 |
+
"Al activar 'uso individual', cupones automáticos con mayor prioridad tendrán "
|
97 |
+
"preferencia sobre los otros cupones."
|
98 |
+
|
99 |
+
#: includes/WJECF_AutoCoupon.php:229
|
100 |
+
msgid "Apply silently"
|
101 |
+
msgstr "Aplicar sin mensaje"
|
102 |
+
|
103 |
+
#: includes/WJECF_AutoCoupon.php:230
|
104 |
+
msgid "Don't display a message when this coupon is automatically applied."
|
105 |
+
msgstr "No mostrar mensaje cuando el cupon esté aplicado automaticamente."
|
106 |
+
|
107 |
+
#: includes/WJECF_AutoCoupon.php:358
|
108 |
+
msgid "Free shipping coupon"
|
109 |
+
msgstr "Cupón para envío gratis"
|
110 |
+
|
111 |
+
#: includes/WJECF_AutoCoupon.php:523
|
112 |
+
#, php-format
|
113 |
+
msgid "Discount applied: %s"
|
114 |
+
msgstr "Descuento aplicado: %s"
|
115 |
+
|
116 |
+
#: includes/WJECF_Controller.php:227
|
117 |
+
msgid ""
|
118 |
+
"WooCommerce Extended Coupon Features is disabled because WooCommerce could "
|
119 |
+
"not be detected."
|
120 |
+
msgstr ""
|
121 |
+
|
122 |
+
#: includes/WJECF_Controller.php:266
|
123 |
+
#, php-format
|
124 |
+
msgid "The minimum subtotal of the matching products for this coupon is %s."
|
125 |
+
msgstr "El subtotal mínimo de los productos conformes para este cupón es %s."
|
126 |
+
|
127 |
+
#: includes/WJECF_Controller.php:270
|
128 |
+
#, php-format
|
129 |
+
msgid "The maximum subtotal of the matching products for this coupon is %s."
|
130 |
+
msgstr "El subtotal máximo de los productos conformes para este cupón es %s."
|
131 |
+
|
132 |
+
#: includes/WJECF_Controller.php:274
|
133 |
+
#, php-format
|
134 |
+
msgid "The minimum quantity of matching products for this coupon is %s."
|
135 |
+
msgstr "La cantidad mínima de productos conformes para este cupón es %s."
|
136 |
+
|
137 |
+
#: includes/WJECF_Controller.php:278
|
138 |
+
#, php-format
|
139 |
+
msgid "The maximum quantity of matching products for this coupon is %s."
|
140 |
+
msgstr "La cantidad máxima de productos conformes para este cupón es %s."
|
141 |
+
|
142 |
+
#: includes/WJECF_Controller.php:281
|
143 |
+
msgid "The coupon is not valid for the currently selected shipping method."
|
144 |
+
msgstr "El cupón no es válido para este método de envío."
|
145 |
+
|
146 |
+
#: includes/WJECF_Controller.php:284
|
147 |
+
msgid "The coupon is not valid for the currently selected payment method."
|
148 |
+
msgstr "El cupón no es válido para este método de pago."
|
149 |
+
|
150 |
+
#: includes/WJECF_Controller.php:287
|
151 |
+
#, php-format
|
152 |
+
msgid "Sorry, it seems the coupon \"%s\" is not yours."
|
153 |
+
msgstr "Lo sentimos, parece que el cupón \"%s\" no es tuyo."
|
154 |
+
|
155 |
+
#: includes/WJECF_WC.php:129
|
156 |
+
msgid "Choose an option"
|
157 |
msgstr ""
|
158 |
|
159 |
+
#: includes/WJECF_WPML.php:12
|
160 |
+
msgid "Compatiblity with WPML."
|
161 |
+
msgstr ""
|
162 |
+
|
163 |
+
#: includes/admin/WJECF_Admin.php:11
|
164 |
+
msgid "Admin interface of WooCommerce Extended Coupon Features."
|
165 |
+
msgstr ""
|
166 |
+
|
167 |
+
#: includes/admin/WJECF_Admin.php:22
|
168 |
msgid ""
|
169 |
"<strong>WooCommerce Extended Coupon Features:</strong> You are using an old "
|
170 |
"version of WooCommerce. Updating of WooCommerce is recommended as using an "
|
172 |
"plugins."
|
173 |
msgstr ""
|
174 |
|
175 |
+
#: includes/admin/WJECF_Admin.php:92
|
176 |
msgid "(AND)"
|
177 |
msgstr "(TODOS)"
|
178 |
|
179 |
+
#: includes/admin/WJECF_Admin.php:93
|
180 |
msgid "(OR)"
|
181 |
msgstr "(UNO)"
|
182 |
|
183 |
+
#: includes/admin/WJECF_Admin.php:102 includes/admin/WJECF_Admin.php:245
|
|
|
|
|
|
|
|
|
184 |
msgid "Checkout"
|
185 |
msgstr "Tramitar"
|
186 |
|
187 |
+
#: includes/admin/WJECF_Admin.php:108
|
188 |
msgid "Miscellaneous"
|
189 |
msgstr "Diversos"
|
190 |
|
191 |
+
#: includes/admin/WJECF_Admin.php:144
|
192 |
msgid "Do you find WooCommerce Extended Coupon Features useful?"
|
193 |
msgstr "Le gusta WooCommerce Extended Coupon Features?"
|
194 |
|
195 |
+
#: includes/admin/WJECF_Admin.php:146
|
196 |
msgid "Express your gratitude"
|
197 |
msgstr "Exprese su gratitud"
|
198 |
|
199 |
+
#: includes/admin/WJECF_Admin.php:150
|
200 |
msgid "Donate to the developer"
|
201 |
msgstr "Hacer una donación"
|
202 |
|
203 |
+
#: includes/admin/WJECF_Admin.php:157
|
204 |
msgid "Documentation"
|
205 |
msgstr "Documentación"
|
206 |
|
207 |
+
#: includes/admin/WJECF_Admin.php:159
|
208 |
msgid "WooCommerce Extended Coupon Features Documentation"
|
209 |
msgstr "Documentación de WooCommerce Extended Coupon Features"
|
210 |
|
211 |
+
#: includes/admin/WJECF_Admin.php:173
|
212 |
msgid "Matching products"
|
213 |
msgstr "Productos conformes"
|
214 |
|
215 |
+
#: includes/admin/WJECF_Admin.php:178
|
216 |
msgid "Products Operator"
|
217 |
msgstr ""
|
218 |
|
219 |
+
#: includes/admin/WJECF_Admin.php:179 includes/admin/WJECF_Admin.php:192
|
220 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:233
|
221 |
msgid "OR"
|
222 |
msgstr "UNO"
|
223 |
|
224 |
+
#: includes/admin/WJECF_Admin.php:179 includes/admin/WJECF_Admin.php:192
|
225 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:233
|
226 |
msgid "AND"
|
227 |
msgstr "TODOS"
|
228 |
|
229 |
+
#: includes/admin/WJECF_Admin.php:183
|
230 |
msgid ""
|
231 |
"Use AND if ALL of the products must be in the cart to use this coupon "
|
232 |
"(instead of only one of the products)."
|
233 |
msgstr ""
|
234 |
|
235 |
+
#: includes/admin/WJECF_Admin.php:191
|
236 |
msgid "Categories Operator"
|
237 |
msgstr ""
|
238 |
|
239 |
+
#: includes/admin/WJECF_Admin.php:196
|
240 |
msgid ""
|
241 |
"Use AND if products from ALL of the categories must be in the cart to use "
|
242 |
"this coupon (instead of only one from one of the categories)."
|
243 |
msgstr ""
|
244 |
|
245 |
+
#: includes/admin/WJECF_Admin.php:205
|
246 |
msgid "Minimum quantity of matching products"
|
247 |
+
msgstr "Cantidad mínima de productos conformes"
|
248 |
|
249 |
+
#: includes/admin/WJECF_Admin.php:206 includes/admin/WJECF_Admin.php:226
|
250 |
msgid "No minimum"
|
251 |
msgstr "Sin mínimo"
|
252 |
|
253 |
+
#: includes/admin/WJECF_Admin.php:207
|
254 |
msgid ""
|
255 |
"Minimum quantity of the products that match the given product or category "
|
256 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
257 |
"restrictions are specified, the total number of products is used."
|
258 |
msgstr "Cantidad mínima de productos conformes (vea 'Restricción de uso')."
|
259 |
|
260 |
+
#: includes/admin/WJECF_Admin.php:215
|
261 |
msgid "Maximum quantity of matching products"
|
262 |
+
msgstr "Cantidad máxima de productos conformes"
|
263 |
|
264 |
+
#: includes/admin/WJECF_Admin.php:216 includes/admin/WJECF_Admin.php:236
|
265 |
msgid "No maximum"
|
266 |
msgstr "Sin máximo"
|
267 |
|
268 |
+
#: includes/admin/WJECF_Admin.php:217
|
269 |
msgid ""
|
270 |
"Maximum quantity of the products that match the given product or category "
|
271 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
272 |
"restrictions are specified, the total number of products is used."
|
273 |
msgstr "Cantidad máxima de productos conformes (vea 'Restricción de uso')."
|
274 |
|
275 |
+
#: includes/admin/WJECF_Admin.php:225
|
276 |
msgid "Minimum subtotal of matching products"
|
277 |
+
msgstr "Subtotal mínimo de productos conformes"
|
278 |
|
279 |
+
#: includes/admin/WJECF_Admin.php:227
|
280 |
msgid ""
|
281 |
"Minimum price subtotal of the products that match the given product or "
|
282 |
"category restrictions (see tab 'usage restriction')."
|
283 |
msgstr "Subtotal mínimo de productos conformes (vea 'Restricción de uso')."
|
284 |
|
285 |
+
#: includes/admin/WJECF_Admin.php:235
|
286 |
msgid "Maximum subtotal of matching products"
|
287 |
+
msgstr "Subtotal máximo de productos conformes"
|
288 |
|
289 |
+
#: includes/admin/WJECF_Admin.php:237
|
290 |
msgid ""
|
291 |
"Maximum price subtotal of the products that match the given product or "
|
292 |
"category restrictions (see tab 'usage restriction')."
|
293 |
msgstr "Subtotal máximo de productos conformes (vea 'Restricción de uso')."
|
294 |
|
295 |
+
#: includes/admin/WJECF_Admin.php:250
|
296 |
msgid "Shipping methods"
|
297 |
msgstr "Métodos de envío"
|
298 |
|
299 |
+
#: includes/admin/WJECF_Admin.php:251
|
300 |
msgid "Any shipping method"
|
301 |
msgstr "Métodos de envío"
|
302 |
|
303 |
+
#: includes/admin/WJECF_Admin.php:260
|
304 |
msgid ""
|
305 |
"One of these shipping methods must be selected in order for this coupon to "
|
306 |
"be valid."
|
307 |
msgstr ""
|
308 |
"Uno de estos métodos de pago tiene que ser seleccionado para usar este cupón."
|
309 |
|
310 |
+
#: includes/admin/WJECF_Admin.php:267
|
311 |
msgid "Payment methods"
|
312 |
msgstr "Métodos de pago"
|
313 |
|
314 |
+
#: includes/admin/WJECF_Admin.php:268
|
315 |
msgid "Any payment method"
|
316 |
msgstr "Métodos de pago"
|
317 |
|
318 |
+
#: includes/admin/WJECF_Admin.php:279
|
319 |
msgid ""
|
320 |
"One of these payment methods must be selected in order for this coupon to be "
|
321 |
"valid."
|
323 |
"Uno de estos métodos de envío tiene que ser seleccionado para usar este "
|
324 |
"cupón."
|
325 |
|
326 |
+
#: includes/admin/WJECF_Admin.php:288
|
327 |
msgid "Customer restrictions"
|
328 |
msgstr "Restricción de clientes"
|
329 |
|
330 |
+
#: includes/admin/WJECF_Admin.php:289
|
331 |
msgid ""
|
332 |
"If both a customer and a role restriction are supplied, matching either one "
|
333 |
"of them will suffice."
|
335 |
"Si se ha introducido tanto una restricción de cliente como una restricción "
|
336 |
"de perfil, sí coincide uno de ellos será suficiente."
|
337 |
|
338 |
+
#: includes/admin/WJECF_Admin.php:294
|
339 |
msgid "Allowed Customers"
|
340 |
msgstr "Clientes"
|
341 |
|
342 |
+
#: includes/admin/WJECF_Admin.php:298
|
|
|
|
|
|
|
|
|
343 |
msgid "Only these customers may use this coupon."
|
344 |
msgstr "Solo estos clientes pueden usar este cupón."
|
345 |
|
346 |
+
#: includes/admin/WJECF_Admin.php:306
|
347 |
msgid "Allowed User Roles"
|
348 |
msgstr "Perfiles del cliente"
|
349 |
|
350 |
+
#: includes/admin/WJECF_Admin.php:307 includes/admin/WJECF_Admin.php:329
|
351 |
msgid "Any role"
|
352 |
msgstr "Perfiles del cliente"
|
353 |
|
354 |
+
#: includes/admin/WJECF_Admin.php:321
|
355 |
msgid "Only these User Roles may use this coupon."
|
356 |
msgstr "Solo clientes con este perfil pueden usar este cupón."
|
357 |
|
358 |
+
#: includes/admin/WJECF_Admin.php:328
|
359 |
msgid "Disallowed User Roles"
|
360 |
msgstr "Perfiles del cliente excluidos"
|
361 |
|
362 |
+
#: includes/admin/WJECF_Admin.php:342
|
363 |
msgid "These User Roles will be specifically excluded from using this coupon."
|
364 |
msgstr "Clientes con este perfil no pueden usar este cupón."
|
365 |
|
366 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:7
|
367 |
+
msgid ""
|
368 |
+
"Automatically update data when a new version of this plugin is installed."
|
369 |
msgstr ""
|
370 |
|
371 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:49
|
372 |
+
msgid ""
|
373 |
+
"<strong>WooCommerce Extended Coupon Features:</strong> Please note, you're "
|
374 |
+
"using an older version of this plugin, while the data was upgraded to a "
|
375 |
+
"newer version."
|
376 |
+
msgstr ""
|
377 |
|
378 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:58
|
379 |
msgid ""
|
380 |
+
"<strong>WooCommerce Extended Coupon Features:</strong> Data succesfully "
|
381 |
+
"upgraded to the newest version."
|
|
|
382 |
msgstr ""
|
383 |
|
384 |
+
#: includes/admin/WJECF_Admin_Html.php:28
|
385 |
#, php-format
|
386 |
msgid "%s (Default)"
|
387 |
msgstr "%s (predeterminado)"
|
388 |
|
389 |
+
#: includes/admin/WJECF_Admin_Html.php:42
|
390 |
+
#: includes/admin/WJECF_Admin_Html.php:90
|
391 |
msgid "Search for a product…"
|
392 |
+
msgstr "Buscar producto…"
|
393 |
|
394 |
+
#: includes/admin/WJECF_Admin_Html.php:184
|
395 |
+
msgid "Any customer"
|
396 |
+
msgstr "Clientes"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
397 |
|
398 |
+
#: includes/admin/WJECF_Admin_Settings.php:16
|
399 |
+
msgid "Settings page of WooCommerce Extended Coupon Features."
|
|
|
|
|
|
|
400 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
401 |
|
402 |
+
#: includes/admin/WJECF_Admin_Settings.php:29
|
403 |
+
#: includes/admin/WJECF_Admin_Settings.php:34
|
404 |
+
msgid "WooCommerce Extended Coupon Features"
|
|
|
|
|
|
|
|
|
|
|
405 |
msgstr ""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
406 |
|
407 |
+
#: includes/admin/WJECF_Admin_Settings.php:56
|
408 |
+
msgid "Advanced settings"
|
409 |
+
msgstr ""
|
|
|
410 |
|
411 |
+
#: includes/admin/WJECF_Admin_Settings.php:63
|
412 |
+
msgid "Debug mode"
|
413 |
+
msgstr ""
|
414 |
|
415 |
+
#: includes/admin/WJECF_Admin_Settings.php:89
|
416 |
+
msgid "Disabled plugins"
|
417 |
+
msgstr ""
|
418 |
|
419 |
+
#: includes/admin/WJECF_Admin_Settings.php:143
|
420 |
#, php-format
|
421 |
+
msgid ""
|
422 |
+
"When debug mode is enabled, extensive logging will be active and WJECF "
|
423 |
+
"Plugins can be enabled/disabled. If there are compatibility issues with "
|
424 |
+
"WooCommerce plugins, you can try disabling WJECF Plugins. Please don't keep "
|
425 |
+
"debug mode enabled on a production environment when it is not necessary. Log "
|
426 |
+
"can be found <a href=\"%s\">here</a>."
|
427 |
+
msgstr ""
|
428 |
|
429 |
+
#: includes/pro/WJECF_Pro_Controller.php:68
|
430 |
msgid "Discount on cart with excluded products"
|
431 |
msgstr "Descuento en carrito con productos excluidos"
|
432 |
|
433 |
+
#: includes/pro/WJECF_Pro_Controller.php:74
|
434 |
msgid "Allow discount on cart with excluded items"
|
435 |
msgstr "Permitir descuento en carrito con productos excluidos"
|
436 |
|
437 |
+
#: includes/pro/WJECF_Pro_Controller.php:75
|
438 |
msgid ""
|
439 |
"Check this box to allow a 'Cart Discount' coupon to be applied even when "
|
440 |
"excluded items are in the cart (see tab 'usage restriction')."
|
441 |
msgstr ""
|
442 |
|
443 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:9
|
|
|
|
|
|
|
|
|
444 |
msgid ""
|
445 |
+
"Allow coupons that are invalid upon application to be applied to the cart "
|
446 |
+
"once they become valid."
|
447 |
msgstr ""
|
448 |
|
449 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:31
|
450 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:39
|
451 |
+
msgid "Allow applying when invalid"
|
452 |
+
msgstr ""
|
|
|
|
|
|
|
453 |
|
454 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:40
|
455 |
+
msgid ""
|
456 |
+
"When the customer attempts to apply the coupon while it's conditions are not "
|
457 |
+
"met, a message will be displayed. Once the conditions are met it will be "
|
458 |
+
"applied automatically."
|
459 |
+
msgstr ""
|
460 |
|
461 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:46
|
462 |
+
msgid "Message"
|
463 |
+
msgstr "Mensaje"
|
464 |
|
465 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:47
|
466 |
msgid ""
|
467 |
+
"This message will be displayed when the customer applies a coupon while it "
|
468 |
+
"is not yet valid."
|
469 |
msgstr ""
|
470 |
|
471 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:48
|
472 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:125
|
473 |
#, php-format
|
474 |
msgid "Coupon '%s' will be applied when it's conditions are met."
|
475 |
msgstr ""
|
476 |
"Cupón '%s' se aplicará automaticamente cuando cumpla con los requisitos."
|
477 |
|
478 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:188
|
479 |
#, php-format
|
480 |
msgid "Coupon '%s' applied."
|
481 |
msgstr "Cupon '%s' aplicado."
|
482 |
|
483 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products.php:12
|
484 |
+
msgid "Allow free products to be added to the cart."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
485 |
msgstr ""
|
486 |
|
487 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:19
|
488 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:36
|
489 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:81
|
490 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:87
|
491 |
+
#: templates/cart/select-free-product.php:36
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
492 |
msgid "Free products"
|
493 |
msgstr "Productos gratis"
|
494 |
|
495 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:89
|
496 |
msgid ""
|
497 |
"Free products that will be added to the cart when this coupon is applied."
|
498 |
msgstr "Productos gratuitos que serán aumentado al carrito."
|
499 |
|
500 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:96
|
501 |
msgid "Select one"
|
502 |
msgstr "Elejir uno"
|
503 |
|
504 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:97
|
505 |
msgid "Check this box if the customer must choose from the free products."
|
506 |
msgstr ""
|
507 |
"Marque esta casilla si el cliente tiene que escojer uno de los productos "
|
508 |
"gratuitos."
|
509 |
|
510 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:105
|
511 |
msgid "'Select your gift'-message"
|
512 |
msgstr "Mensaje 'Elije tu regalo'"
|
513 |
|
514 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:106
|
515 |
msgid "Please choose your free gift:"
|
516 |
msgstr "Elije tu regalo:"
|
517 |
|
518 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:107
|
519 |
msgid "This message is displayed when the customer must choose a free product."
|
520 |
msgstr ""
|
521 |
|
522 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:116
|
523 |
msgid "Allow multiplication of the free products"
|
524 |
msgstr "Multiplicar los productos gratuitos"
|
525 |
|
526 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:117
|
527 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:125
|
528 |
+
msgid "EXPERIMENTAL: "
|
529 |
+
msgstr "EXPERIMENTAL: "
|
530 |
+
|
531 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:117
|
532 |
msgid ""
|
533 |
"The amount of free products is multiplied every time the minimum spend, "
|
534 |
"subtotal or quantity is reached."
|
535 |
msgstr ""
|
536 |
|
537 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:124
|
538 |
msgid "BOGO matching products"
|
539 |
msgstr "1+1 gratis para los productos conformes"
|
540 |
|
541 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:126
|
542 |
msgid ""
|
543 |
"Buy one or more of any of the matching products (see 'Usage Restriction'-"
|
544 |
"tab) and get one free. Check 'Allow multiplication' to get one free item for "
|
548 |
"gratis. Marque la casilla 'multiplicar los productos gratuitos' para "
|
549 |
"multiplicar con la cantidad de productos conformes en el carritos de compras."
|
550 |
|
551 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:86
|
552 |
+
#, php-format
|
553 |
+
msgid ""
|
554 |
+
"Sorry, we do not have enough \"%1$s\" in stock (%2$s in stock). Please "
|
555 |
+
"review your selection."
|
556 |
+
msgstr ""
|
557 |
+
"Lo sentimos, no tenemos suficiente \"%1$s\" disponible (%2$s disponible). "
|
558 |
+
"Por favor revise su selección."
|
559 |
+
|
560 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:92
|
561 |
+
#, php-format
|
562 |
+
msgid "Please choose a variation of \"%s\"."
|
563 |
+
msgstr "Escoja una variación de \"%s\"."
|
564 |
+
|
565 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:102
|
566 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:112
|
567 |
+
msgid "Free!"
|
568 |
+
msgstr "Gratis!"
|
569 |
+
|
570 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:30
|
571 |
+
msgid "Limit discount to only certain products in the cart."
|
572 |
+
msgstr ""
|
573 |
+
|
574 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:264
|
575 |
+
msgid "(default)"
|
576 |
+
msgstr "(por defecto)"
|
577 |
+
|
578 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:268
|
579 |
+
msgid "One item per order line"
|
580 |
+
msgstr "Un producto por linea"
|
581 |
+
|
582 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:272
|
583 |
+
msgid "Lowest priced product (single item)"
|
584 |
+
msgstr "Producto con el menor precio (un producto)"
|
585 |
+
|
586 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:276
|
587 |
+
msgid "Lowest priced order line (all items)"
|
588 |
+
msgstr "Linea con el menor precio (todos los productos)"
|
589 |
+
|
590 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:280
|
591 |
+
msgid "Every nth item. n = min qty of matching products (or 2 if not supplied)"
|
592 |
+
msgstr ""
|
593 |
+
|
594 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:397
|
595 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:410
|
596 |
+
msgid "Limit discount to"
|
597 |
+
msgstr "Limitar descuento a"
|
598 |
+
|
599 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:398
|
600 |
+
msgid ""
|
601 |
+
"Here you can exclude certain products from being discounted (Only applies to "
|
602 |
+
"Cart % Discount, Product Discount, Product % Discount)"
|
603 |
+
msgstr ""
|
604 |
+
|
605 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:412
|
606 |
+
msgid ""
|
607 |
+
"Please note that when the discount type is 'Product discount' (see 'General'-"
|
608 |
+
"tab), the discount will only be applied to <em>matching</em> products."
|
609 |
+
msgstr ""
|
610 |
+
|
611 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:12
|
612 |
+
msgid "Advanced matching queries for products."
|
613 |
+
msgstr ""
|
614 |
+
|
615 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:232
|
616 |
msgid "Custom Fields Operator"
|
617 |
msgstr ""
|
618 |
|
619 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:236
|
620 |
msgid ""
|
621 |
"Use AND if all of the custom fields must be in the cart to use this coupon "
|
622 |
"(instead of only one of the custom fields)."
|
623 |
msgstr ""
|
624 |
|
625 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:242
|
626 |
msgid "Custom Fields"
|
627 |
msgstr ""
|
628 |
|
629 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:248
|
630 |
msgid "Name"
|
631 |
msgstr "Nombre"
|
632 |
|
633 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:249
|
634 |
msgid "Value"
|
635 |
msgstr "Valor"
|
636 |
|
637 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:252
|
638 |
msgid ""
|
639 |
"If multiple lines are entered, only one of them needs to match. A whole word "
|
640 |
"case insensitive match is executed by default and % can be used as wildcard. "
|
646 |
"'/^rock$/i' matches 'Rock' but not 'Rock the house'"
|
647 |
msgstr ""
|
648 |
|
649 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:275
|
650 |
msgid "— Select —"
|
651 |
msgstr "— Escoge —"
|
652 |
|
653 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:23
|
654 |
+
msgid "Automatically upgrade this plugin when a new version is available."
|
655 |
+
msgstr ""
|
656 |
+
|
657 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:49
|
658 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:64
|
659 |
+
msgid "Licence key"
|
660 |
+
msgstr ""
|
661 |
+
|
662 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:56
|
663 |
+
msgid "Domain"
|
664 |
+
msgstr ""
|
665 |
+
|
666 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:75
|
667 |
msgid ""
|
668 |
+
"A valid licence key will allow you to update the plugin from the WordPress "
|
669 |
+
"admin area."
|
670 |
+
msgstr ""
|
671 |
+
|
672 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:76
|
673 |
+
#, php-format
|
674 |
+
msgid "You can manage your licences at your account page at %s."
|
675 |
msgstr ""
|
676 |
|
677 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:77
|
678 |
+
msgid "This option is not available if you purchased from Envato market."
|
679 |
+
msgstr ""
|
680 |
+
|
681 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:120
|
682 |
+
msgid "The domain of your store. e.g. www.mystore.com."
|
683 |
+
msgstr ""
|
684 |
+
|
685 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:228
|
686 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:324
|
687 |
+
msgid "Licence key is not valid."
|
688 |
+
msgstr ""
|
689 |
+
|
690 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:230
|
691 |
+
#, php-format
|
692 |
+
msgid ""
|
693 |
+
"You will not receive automatic updates. Please enter a valid licence key <a "
|
694 |
+
"href=\"%s\">here</a>."
|
695 |
+
msgstr ""
|
696 |
+
|
697 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:254
|
698 |
+
#, php-format
|
699 |
+
msgid "Licence for domain %s succesfully deactivated."
|
700 |
+
msgstr ""
|
701 |
+
|
702 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:259
|
703 |
+
msgid "Failed deactivating licence. "
|
704 |
+
msgstr ""
|
705 |
+
|
706 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:263
|
707 |
+
#, php-format
|
708 |
+
msgid "Failed deactivating licence. Invalid response from server: %s"
|
709 |
+
msgstr ""
|
710 |
+
|
711 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:282
|
712 |
+
msgid "No licence key entered."
|
713 |
+
msgstr ""
|
714 |
+
|
715 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:285
|
716 |
+
msgid "No valid domain entered."
|
717 |
+
msgstr ""
|
718 |
+
|
719 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:292
|
720 |
+
#, php-format
|
721 |
+
msgid "Could not validate the licence. Invalid response from server: %s"
|
722 |
+
msgstr ""
|
723 |
+
|
724 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:305
|
725 |
+
#, php-format
|
726 |
+
msgid "Could not activate the licence. Invalid response from server: %s"
|
727 |
+
msgstr ""
|
728 |
+
|
729 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:318
|
730 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:367
|
731 |
+
msgid "Licence key is valid."
|
732 |
+
msgstr ""
|
733 |
+
|
734 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:351
|
735 |
+
msgid "Invalid licence key."
|
736 |
+
msgstr ""
|
737 |
+
|
738 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:354
|
739 |
+
msgid "Licence Key does not match this product."
|
740 |
+
msgstr ""
|
741 |
+
|
742 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:357
|
743 |
+
msgid "Licence is not active."
|
744 |
+
msgstr ""
|
745 |
+
|
746 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:360
|
747 |
+
msgid "Licence key is unassigned."
|
748 |
+
msgstr ""
|
749 |
+
|
750 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:363
|
751 |
+
msgid "Licence key not active for current domain."
|
752 |
+
msgstr ""
|
753 |
+
|
754 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:435
|
755 |
+
msgid "An Unexpected HTTP Error occurred during the API request."
|
756 |
+
msgstr ""
|
757 |
+
|
758 |
+
#: templates/coupon-select-free-product.php:69
|
759 |
+
msgid "You can select one free product."
|
760 |
+
msgstr "Puede escojer un producto gratis."
|
761 |
+
|
762 |
+
#~ msgid "Products"
|
763 |
+
#~ msgstr "Productos"
|
764 |
+
|
765 |
+
#~ msgid "Please select your free gift."
|
766 |
+
#~ msgstr "Elije tu regalo."
|
767 |
+
|
768 |
#~ msgid "AND Products (not OR)"
|
769 |
#~ msgstr "TODOS los productos"
|
770 |
|
languages/woocommerce-jos-autocoupon-nl_NL.mo
CHANGED
Binary file
|
languages/woocommerce-jos-autocoupon-nl_NL.po
CHANGED
@@ -5,39 +5,179 @@ msgstr ""
|
|
5 |
"Project-Id-Version: WooCommerce Extended Coupon Features\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-"
|
7 |
"added-coupons\n"
|
8 |
-
"POT-Creation-Date:
|
9 |
-
"PO-Revision-Date:
|
10 |
"Last-Translator: \n"
|
11 |
"Language-Team: \n"
|
12 |
"Language: nl_NL\n"
|
13 |
"MIME-Version: 1.0\n"
|
14 |
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
"Content-Transfer-Encoding: 8bit\n"
|
16 |
-
"X-Generator: Poedit
|
17 |
"X-Poedit-KeywordsList: __;_e\n"
|
18 |
"X-Poedit-Basepath: ..\n"
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
"X-Poedit-SearchPathExcluded-0: docs\n"
|
21 |
|
22 |
-
#: includes/
|
|
|
23 |
msgid ""
|
24 |
-
"
|
25 |
-
"
|
26 |
-
"newer version."
|
27 |
msgstr ""
|
28 |
-
"
|
29 |
-
"oudere versie van deze plugin, terwijl de data is opgewaardeerd naar een "
|
30 |
-
"nieuwere versie."
|
31 |
|
32 |
-
#: includes/
|
33 |
msgid ""
|
34 |
-
"
|
35 |
-
"
|
36 |
msgstr ""
|
37 |
-
"
|
38 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39 |
|
40 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41 |
msgid ""
|
42 |
"<strong>WooCommerce Extended Coupon Features:</strong> You are using an old "
|
43 |
"version of WooCommerce. Updating of WooCommerce is recommended as using an "
|
@@ -49,65 +189,61 @@ msgstr ""
|
|
49 |
"aangeraden omdat het gebruik van een oude versie met moderne plugins "
|
50 |
"onverwachte resultaten met zich mee kan brengen."
|
51 |
|
52 |
-
#: includes/admin/
|
53 |
msgid "(AND)"
|
54 |
msgstr "(ALLE)"
|
55 |
|
56 |
-
#: includes/admin/
|
57 |
msgid "(OR)"
|
58 |
msgstr "(OF)"
|
59 |
|
60 |
-
#: includes/admin/
|
61 |
-
msgid "Products"
|
62 |
-
msgstr "Producten"
|
63 |
-
|
64 |
-
#: includes/admin/wjecf-admin.php:132 includes/admin/wjecf-admin.php:276
|
65 |
msgid "Checkout"
|
66 |
msgstr "Afrekenen"
|
67 |
|
68 |
-
#: includes/admin/
|
69 |
msgid "Miscellaneous"
|
70 |
msgstr "Diversen"
|
71 |
|
72 |
-
#: includes/admin/
|
73 |
msgid "Do you find WooCommerce Extended Coupon Features useful?"
|
74 |
msgstr "Vindt u WooCommerce Extended Coupon Features handig?"
|
75 |
|
76 |
-
#: includes/admin/
|
77 |
msgid "Express your gratitude"
|
78 |
msgstr "Toon uw waardering"
|
79 |
|
80 |
-
#: includes/admin/
|
81 |
msgid "Donate to the developer"
|
82 |
msgstr "Doneer aan de ontwikkelaar"
|
83 |
|
84 |
-
#: includes/admin/
|
85 |
msgid "Documentation"
|
86 |
msgstr "Documentatie"
|
87 |
|
88 |
-
#: includes/admin/
|
89 |
msgid "WooCommerce Extended Coupon Features Documentation"
|
90 |
msgstr "WooCommerce Extended Coupon Features Documentatie"
|
91 |
|
92 |
-
#: includes/admin/
|
93 |
msgid "Matching products"
|
94 |
msgstr "Overeenkomende producten"
|
95 |
|
96 |
-
#: includes/admin/
|
97 |
msgid "Products Operator"
|
98 |
msgstr "Producten operator"
|
99 |
|
100 |
-
#: includes/admin/
|
101 |
-
#: includes/
|
102 |
msgid "OR"
|
103 |
msgstr "OF"
|
104 |
|
105 |
-
#: includes/admin/
|
106 |
-
#: includes/
|
107 |
msgid "AND"
|
108 |
msgstr "ALLE"
|
109 |
|
110 |
-
#: includes/admin/
|
111 |
msgid ""
|
112 |
"Use AND if ALL of the products must be in the cart to use this coupon "
|
113 |
"(instead of only one of the products)."
|
@@ -115,11 +251,11 @@ msgstr ""
|
|
115 |
"Gebruik ALLE als alle producten in het winkelwagentje moeten zitten (in "
|
116 |
"plaats van één producten)."
|
117 |
|
118 |
-
#: includes/admin/
|
119 |
msgid "Categories Operator"
|
120 |
msgstr "Categorieën Operator"
|
121 |
|
122 |
-
#: includes/admin/
|
123 |
msgid ""
|
124 |
"Use AND if products from ALL of the categories must be in the cart to use "
|
125 |
"this coupon (instead of only one from one of the categories)."
|
@@ -128,15 +264,15 @@ msgstr ""
|
|
128 |
"winkelwagentje moeten zitten (in plaats van een product van één van de "
|
129 |
"categorieën)."
|
130 |
|
131 |
-
#: includes/admin/
|
132 |
msgid "Minimum quantity of matching products"
|
133 |
msgstr "Minimum aantal overeengekomen producten"
|
134 |
|
135 |
-
#: includes/admin/
|
136 |
msgid "No minimum"
|
137 |
msgstr "Geen minimum"
|
138 |
|
139 |
-
#: includes/admin/
|
140 |
msgid ""
|
141 |
"Minimum quantity of the products that match the given product or category "
|
142 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
@@ -146,15 +282,15 @@ msgstr ""
|
|
146 |
"(zie tab 'gebruiksbeperkingen'). Als geen product- of categorierestrictie is "
|
147 |
"opgegeven worden alle producten in de winkelwagen geteld."
|
148 |
|
149 |
-
#: includes/admin/
|
150 |
msgid "Maximum quantity of matching products"
|
151 |
msgstr "Maximum aantal overeengekomen producten"
|
152 |
|
153 |
-
#: includes/admin/
|
154 |
msgid "No maximum"
|
155 |
msgstr "Geen maximum"
|
156 |
|
157 |
-
#: includes/admin/
|
158 |
msgid ""
|
159 |
"Maximum quantity of the products that match the given product or category "
|
160 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
@@ -164,11 +300,11 @@ msgstr ""
|
|
164 |
"(zie tab 'gebruiksbeperkingen'). Als geen product- of categorierestrictie is "
|
165 |
"opgegeven worden alle producten in de winkelwagen geteld."
|
166 |
|
167 |
-
#: includes/admin/
|
168 |
msgid "Minimum subtotal of matching products"
|
169 |
msgstr "Minimum subtotaal overeengekomen producten"
|
170 |
|
171 |
-
#: includes/admin/
|
172 |
msgid ""
|
173 |
"Minimum price subtotal of the products that match the given product or "
|
174 |
"category restrictions (see tab 'usage restriction')."
|
@@ -178,11 +314,11 @@ msgstr ""
|
|
178 |
"product- of categorierestrictie is opgegeven wordt het subtotaal van alle "
|
179 |
"producten in de winkelwagen opgeteld."
|
180 |
|
181 |
-
#: includes/admin/
|
182 |
msgid "Maximum subtotal of matching products"
|
183 |
msgstr "Maximum subtotaal overeengekomen producten"
|
184 |
|
185 |
-
#: includes/admin/
|
186 |
msgid ""
|
187 |
"Maximum price subtotal of the products that match the given product or "
|
188 |
"category restrictions (see tab 'usage restriction')."
|
@@ -192,15 +328,15 @@ msgstr ""
|
|
192 |
"product- of categorierestrictie is opgegeven wordt het subtotaal van alle "
|
193 |
"producten in de winkelwagen opgeteld."
|
194 |
|
195 |
-
#: includes/admin/
|
196 |
msgid "Shipping methods"
|
197 |
msgstr "Verzendmethoden"
|
198 |
|
199 |
-
#: includes/admin/
|
200 |
msgid "Any shipping method"
|
201 |
msgstr "Verzendmethoden"
|
202 |
|
203 |
-
#: includes/admin/
|
204 |
msgid ""
|
205 |
"One of these shipping methods must be selected in order for this coupon to "
|
206 |
"be valid."
|
@@ -208,15 +344,15 @@ msgstr ""
|
|
208 |
"Een van deze verzendmethoden moet gekozen zijn om deze kortingsbon te kunnen "
|
209 |
"gebruiken."
|
210 |
|
211 |
-
#: includes/admin/
|
212 |
msgid "Payment methods"
|
213 |
msgstr "Betaalmethoden"
|
214 |
|
215 |
-
#: includes/admin/
|
216 |
msgid "Any payment method"
|
217 |
msgstr "Betaalmethoden"
|
218 |
|
219 |
-
#: includes/admin/
|
220 |
msgid ""
|
221 |
"One of these payment methods must be selected in order for this coupon to be "
|
222 |
"valid."
|
@@ -224,11 +360,11 @@ msgstr ""
|
|
224 |
"Een van deze betaalmethoden moet gekozen zijn om deze kortingsbon te kunnen "
|
225 |
"gebruiken."
|
226 |
|
227 |
-
#: includes/admin/
|
228 |
msgid "Customer restrictions"
|
229 |
msgstr "Klantbeperkingen"
|
230 |
|
231 |
-
#: includes/admin/
|
232 |
msgid ""
|
233 |
"If both a customer and a role restriction are supplied, matching either one "
|
234 |
"of them will suffice."
|
@@ -236,180 +372,117 @@ msgstr ""
|
|
236 |
"Als zowel een klant- als klantrolrestrictie is opgegeven hoeft slechts aan "
|
237 |
"één van de restricties worden voldaan."
|
238 |
|
239 |
-
#: includes/admin/
|
240 |
msgid "Allowed Customers"
|
241 |
msgstr "Toegestane klanten"
|
242 |
|
243 |
-
#: includes/admin/
|
244 |
-
msgid "Any customer"
|
245 |
-
msgstr "Klanten"
|
246 |
-
|
247 |
-
#: includes/admin/wjecf-admin.php:337
|
248 |
msgid "Only these customers may use this coupon."
|
249 |
msgstr "Alleen deze klanten kunnen deze kortingsbon gebruiken."
|
250 |
|
251 |
-
#: includes/admin/
|
252 |
msgid "Allowed User Roles"
|
253 |
msgstr "Toegestane klantrollen"
|
254 |
|
255 |
-
#: includes/admin/
|
256 |
msgid "Any role"
|
257 |
msgstr "Klantrollen"
|
258 |
|
259 |
-
#: includes/admin/
|
260 |
msgid "Only these User Roles may use this coupon."
|
261 |
msgstr "Alleen deze klantrollen kunnen deze kortingsbon gebruiken."
|
262 |
|
263 |
-
#: includes/admin/
|
264 |
msgid "Disallowed User Roles"
|
265 |
msgstr "Uitgesloten klantrollen"
|
266 |
|
267 |
-
#: includes/admin/
|
268 |
msgid "These User Roles will be specifically excluded from using this coupon."
|
269 |
msgstr "Deze klantrollen zijn uitgesloten om deze kortingsbon te gebruiken."
|
270 |
|
271 |
-
#: includes/admin/
|
272 |
-
msgid "
|
273 |
-
|
|
|
|
|
|
|
274 |
|
275 |
-
#: includes/admin/
|
276 |
-
|
277 |
-
|
278 |
-
|
|
|
|
|
|
|
|
|
|
|
279 |
|
280 |
-
#: includes/admin/
|
281 |
msgid ""
|
282 |
-
"
|
283 |
-
"
|
284 |
-
"0 until minimum spend is reached."
|
285 |
msgstr ""
|
286 |
-
"
|
287 |
-
"
|
288 |
-
"minimale besteding is bereikt."
|
289 |
|
290 |
-
#: includes/admin/
|
291 |
#, php-format
|
292 |
msgid "%s (Default)"
|
293 |
msgstr "%s (standaard)"
|
294 |
|
295 |
-
#: includes/admin/
|
|
|
296 |
msgid "Search for a product…"
|
297 |
msgstr "Zoek een product..."
|
298 |
|
299 |
-
#: includes/
|
300 |
-
|
301 |
-
|
302 |
-
msgstr "Automatisch toepassen"
|
303 |
-
|
304 |
-
#: includes/wjecf-autocoupon.php:63
|
305 |
-
msgid "Individual use"
|
306 |
-
msgstr "Individueel gebruik"
|
307 |
-
|
308 |
-
#: includes/wjecf-autocoupon.php:83 includes/wjecf-autocoupon.php:91
|
309 |
-
msgid "Yes"
|
310 |
-
msgstr "Ja"
|
311 |
-
|
312 |
-
#: includes/wjecf-autocoupon.php:83 includes/wjecf-autocoupon.php:91
|
313 |
-
msgid "No"
|
314 |
-
msgstr "Nee"
|
315 |
-
|
316 |
-
#: includes/wjecf-autocoupon.php:102
|
317 |
-
msgid "Auto coupons"
|
318 |
-
msgstr "Auto coupons"
|
319 |
-
|
320 |
-
#: includes/wjecf-autocoupon.php:138
|
321 |
-
msgid ""
|
322 |
-
"Automatically add the coupon to the cart if the restrictions are met. Please "
|
323 |
-
"enter a description when you check this box, the description will be shown "
|
324 |
-
"in the customer's cart if the coupon is applied."
|
325 |
-
msgstr ""
|
326 |
-
"Voeg de kortingsbon automatisch toe aan het winkelwagentje als aan alle "
|
327 |
-
"voorwaarden wordt voldaan. Vult u a.u.b. een omschrijving in als u deze "
|
328 |
-
"optie aanvinkt, de omschrijving zal aan de klant worden getoond wanneer de "
|
329 |
-
"kortingsbon wordt toegevoegd."
|
330 |
-
|
331 |
-
#: includes/wjecf-autocoupon.php:146
|
332 |
-
msgid "Priority"
|
333 |
-
msgstr "Prioriteit"
|
334 |
-
|
335 |
-
#: includes/wjecf-autocoupon.php:147
|
336 |
-
msgid "No priority"
|
337 |
-
msgstr "Geen prioriteit"
|
338 |
-
|
339 |
-
#: includes/wjecf-autocoupon.php:148
|
340 |
-
msgid ""
|
341 |
-
"When 'individual use' is checked, auto coupons with a higher value will have "
|
342 |
-
"priority over other auto coupons."
|
343 |
-
msgstr ""
|
344 |
-
"Wanneer 'individueel gebruik' is aangevinkt, zullen auto coupons met een "
|
345 |
-
"hogere prioriteit voorrang krijgen boven andere auto coupons."
|
346 |
-
|
347 |
-
#: includes/wjecf-autocoupon.php:158
|
348 |
-
msgid "Apply silently"
|
349 |
-
msgstr "Toepassen zonder melding"
|
350 |
-
|
351 |
-
#: includes/wjecf-autocoupon.php:159
|
352 |
-
msgid "Don't display a message when this coupon is automatically applied."
|
353 |
-
msgstr ""
|
354 |
-
"Geen melding weergeven wanneer deze kortingsbon automatisch wordt toegepast."
|
355 |
-
|
356 |
-
#: includes/wjecf-autocoupon.php:287
|
357 |
-
msgid "Free shipping coupon"
|
358 |
-
msgstr "Gratis verzending kortingsbon"
|
359 |
-
|
360 |
-
#: includes/wjecf-autocoupon.php:364
|
361 |
-
#, php-format
|
362 |
-
msgid "Discount applied: %s"
|
363 |
-
msgstr "Korting toegepast: %s"
|
364 |
-
|
365 |
-
#: includes/wjecf-controller.php:191
|
366 |
-
#, php-format
|
367 |
-
msgid "The minimum subtotal of the matching products for this coupon is %s."
|
368 |
-
msgstr ""
|
369 |
-
"Het minimale subtotaal van overeengekomen producten voor deze kortingsbon is "
|
370 |
-
"%s."
|
371 |
|
372 |
-
#: includes/
|
373 |
-
|
374 |
-
|
375 |
-
msgstr ""
|
376 |
-
"Het maximale subtotaal van overeengekomen producten voor deze kortingsbon is "
|
377 |
-
"%s."
|
378 |
|
379 |
-
#: includes/
|
380 |
-
|
381 |
-
msgid "
|
382 |
-
msgstr ""
|
383 |
-
"Het minimale aantal overeengekomen producten voor deze kortingsbon is %s."
|
384 |
|
385 |
-
#: includes/
|
386 |
-
|
387 |
-
|
388 |
-
msgstr ""
|
389 |
-
"Het maximale aantal overeengekomen producten voor deze kortingsbon is %s."
|
390 |
|
391 |
-
#: includes/
|
392 |
-
msgid "
|
393 |
-
msgstr "
|
394 |
|
395 |
-
#: includes/
|
396 |
-
msgid "
|
397 |
-
msgstr "
|
398 |
|
399 |
-
#: includes/
|
400 |
#, php-format
|
401 |
-
msgid "
|
402 |
-
|
403 |
-
|
404 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
405 |
msgid "Discount on cart with excluded products"
|
406 |
msgstr "Korting op winkelwagen met uitgesloten producten"
|
407 |
|
408 |
-
#: includes/
|
409 |
msgid "Allow discount on cart with excluded items"
|
410 |
msgstr "Korting toestaan op winkelwagen met uitgesloten producten"
|
411 |
|
412 |
-
#: includes/
|
413 |
msgid ""
|
414 |
"Check this box to allow a 'Cart Discount' coupon to be applied even when "
|
415 |
"excluded items are in the cart (see tab 'usage restriction')."
|
@@ -418,173 +491,105 @@ msgstr ""
|
|
418 |
"uitgesloten producten in de winkelwagen aanwezig zijn (zie tab "
|
419 |
"'gebruiksbeperking')."
|
420 |
|
421 |
-
#: includes/
|
422 |
-
msgid "Limit discount to"
|
423 |
-
msgstr "Beperk korting tot"
|
424 |
-
|
425 |
-
#: includes/wjecf-pro-controller.php:78
|
426 |
msgid ""
|
427 |
-
"
|
428 |
-
"
|
429 |
msgstr ""
|
430 |
-
"
|
431 |
-
"
|
|
|
432 |
|
433 |
-
#: includes/
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
#: includes/wjecf-pro-controller.php:86
|
438 |
-
msgid "One item per order line"
|
439 |
-
msgstr "Eén item per orderregel"
|
440 |
|
441 |
-
#: includes/
|
442 |
-
msgid "
|
443 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
444 |
|
445 |
-
#: includes/
|
446 |
-
msgid "
|
447 |
-
msgstr "
|
448 |
|
449 |
-
#: includes/
|
450 |
msgid ""
|
451 |
-
"
|
452 |
-
"
|
453 |
msgstr ""
|
454 |
-
"
|
455 |
-
"is
|
456 |
-
"producten."
|
457 |
|
458 |
-
#: includes/
|
|
|
459 |
#, php-format
|
460 |
msgid "Coupon '%s' will be applied when it's conditions are met."
|
461 |
msgstr ""
|
462 |
"Coupon '%s' zal automatisch worden toegepast wanneer aan de voorwaarden "
|
463 |
"wordt voldaan."
|
464 |
|
465 |
-
#: includes/
|
466 |
#, php-format
|
467 |
msgid "Coupon '%s' applied."
|
468 |
msgstr "Coupon '%s' toegepast."
|
469 |
|
470 |
-
#: includes/
|
471 |
-
msgid "
|
472 |
-
msgstr "
|
473 |
-
|
474 |
-
#: includes/wjecf-pro-evalmath.php:736
|
475 |
-
msgid "cannot assign to constant '{$a}'"
|
476 |
-
msgstr ""
|
477 |
-
|
478 |
-
#: includes/wjecf-pro-evalmath.php:737
|
479 |
-
msgid "cannot assign to readonly '{$a}'"
|
480 |
-
msgstr ""
|
481 |
-
|
482 |
-
#: includes/wjecf-pro-evalmath.php:738
|
483 |
-
msgid "cannot redefine built-in function '{$a}()'"
|
484 |
-
msgstr ""
|
485 |
-
|
486 |
-
#: includes/wjecf-pro-evalmath.php:739
|
487 |
-
msgid "division by zero"
|
488 |
-
msgstr ""
|
489 |
-
|
490 |
-
#: includes/wjecf-pro-evalmath.php:740
|
491 |
-
msgid "expecting a closing bracket"
|
492 |
-
msgstr ""
|
493 |
-
|
494 |
-
#: includes/wjecf-pro-evalmath.php:741
|
495 |
-
msgid "illegal character '{$a}'"
|
496 |
-
msgstr ""
|
497 |
-
|
498 |
-
#: includes/wjecf-pro-evalmath.php:742
|
499 |
-
msgid "illegal character '_'"
|
500 |
-
msgstr ""
|
501 |
-
|
502 |
-
#: includes/wjecf-pro-evalmath.php:743
|
503 |
-
msgid "expecting operator, implicit multiplication not allowed."
|
504 |
-
msgstr ""
|
505 |
-
|
506 |
-
#: includes/wjecf-pro-evalmath.php:744
|
507 |
-
msgid "internal error"
|
508 |
-
msgstr ""
|
509 |
|
510 |
-
#: includes/
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
#:
|
515 |
-
msgid "undefined variable '{$a}'"
|
516 |
-
msgstr ""
|
517 |
-
|
518 |
-
#: includes/wjecf-pro-evalmath.php:747
|
519 |
-
msgid "undefined variable '{$a}' in function definition"
|
520 |
-
msgstr ""
|
521 |
-
|
522 |
-
#: includes/wjecf-pro-evalmath.php:748
|
523 |
-
msgid "unexpected closing bracket"
|
524 |
-
msgstr ""
|
525 |
-
|
526 |
-
#: includes/wjecf-pro-evalmath.php:749
|
527 |
-
msgid "unexpected comma"
|
528 |
-
msgstr ""
|
529 |
-
|
530 |
-
#: includes/wjecf-pro-evalmath.php:750
|
531 |
-
msgid "unexpected operator '{$a}'"
|
532 |
-
msgstr ""
|
533 |
-
|
534 |
-
#: includes/wjecf-pro-evalmath.php:751
|
535 |
-
msgid ""
|
536 |
-
"wrong number of arguments for function '{$a->function}()' ({$a->given} "
|
537 |
-
"given, {$a->expected} expected)"
|
538 |
-
msgstr ""
|
539 |
-
|
540 |
-
#: includes/wjecf-pro-free-products.php:196
|
541 |
-
msgid "Please select your free gift."
|
542 |
-
msgstr "Kies een gratis artikel."
|
543 |
-
|
544 |
-
#: includes/wjecf-pro-free-products.php:460
|
545 |
-
#: includes/wjecf-pro-free-products.php:470
|
546 |
-
msgid "Free!"
|
547 |
-
msgstr "Gratis!"
|
548 |
-
|
549 |
-
#: includes/wjecf-pro-free-products.php:535
|
550 |
-
#: includes/wjecf-pro-free-products.php:558
|
551 |
-
#: includes/wjecf-pro-free-products.php:564
|
552 |
msgid "Free products"
|
553 |
msgstr "Gratis producten"
|
554 |
|
555 |
-
#: includes/
|
556 |
msgid ""
|
557 |
"Free products that will be added to the cart when this coupon is applied."
|
558 |
msgstr ""
|
559 |
"Gratis producten welke aan de winkelwagen worden toegevoegd als de coupon is "
|
560 |
"toegepast."
|
561 |
|
562 |
-
#: includes/
|
563 |
msgid "Select one"
|
564 |
msgstr "Kies één"
|
565 |
|
566 |
-
#: includes/
|
567 |
msgid "Check this box if the customer must choose from the free products."
|
568 |
msgstr "Aanvinken als de klant één van de gratis producten moet kiezen."
|
569 |
|
570 |
-
#: includes/
|
571 |
msgid "'Select your gift'-message"
|
572 |
msgstr "'Kies uw gratis product'-boodschap"
|
573 |
|
574 |
-
#: includes/
|
575 |
msgid "Please choose your free gift:"
|
576 |
msgstr "Kies uw gratis product:"
|
577 |
|
578 |
-
#: includes/
|
579 |
msgid "This message is displayed when the customer must choose a free product."
|
580 |
msgstr ""
|
581 |
"Deze melding wordt getoond wanneer de klant een gratis product moet kiezen."
|
582 |
|
583 |
-
#: includes/
|
584 |
msgid "Allow multiplication of the free products"
|
585 |
msgstr "Vermenigvuldigen gratis producten toestaan"
|
586 |
|
587 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
588 |
msgid ""
|
589 |
"The amount of free products is multiplied every time the minimum spend, "
|
590 |
"subtotal or quantity is reached."
|
@@ -592,11 +597,11 @@ msgstr ""
|
|
592 |
"Het aantal van de gratis producten wordt vermenigvuldigd met het totale "
|
593 |
"aantal keer dat minimale besteding, subtotaal of aantal is bereikt."
|
594 |
|
595 |
-
#: includes/
|
596 |
msgid "BOGO matching products"
|
597 |
msgstr "1+1 gratis voor overeengekomen producten"
|
598 |
|
599 |
-
#: includes/
|
600 |
msgid ""
|
601 |
"Buy one or more of any of the matching products (see 'Usage Restriction'-"
|
602 |
"tab) and get one free. Check 'Allow multiplication' to get one free item for "
|
@@ -606,11 +611,81 @@ msgstr ""
|
|
606 |
"Gebruik 'vermenigvuldigen toestaan' om een gratis artikel voor elk "
|
607 |
"overeenkomend artikel te krijgen."
|
608 |
|
609 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
610 |
msgid "Custom Fields Operator"
|
611 |
msgstr "Extra velden Operator"
|
612 |
|
613 |
-
#: includes/
|
614 |
msgid ""
|
615 |
"Use AND if all of the custom fields must be in the cart to use this coupon "
|
616 |
"(instead of only one of the custom fields)."
|
@@ -618,19 +693,19 @@ msgstr ""
|
|
618 |
"Gebruik ALLE als alle extra velden in het winkelwagentje moeten zitten (in "
|
619 |
"plaats van één van de extra velden)."
|
620 |
|
621 |
-
#: includes/
|
622 |
msgid "Custom Fields"
|
623 |
msgstr "Extra velden"
|
624 |
|
625 |
-
#: includes/
|
626 |
msgid "Name"
|
627 |
msgstr "Naam"
|
628 |
|
629 |
-
#: includes/
|
630 |
msgid "Value"
|
631 |
msgstr "Waarde"
|
632 |
|
633 |
-
#: includes/
|
634 |
msgid ""
|
635 |
"If multiple lines are entered, only one of them needs to match. A whole word "
|
636 |
"case insensitive match is executed by default and % can be used as wildcard. "
|
@@ -652,17 +727,148 @@ msgstr ""
|
|
652 |
"'roc%' accepteert 'Rock' en ook 'Rock the house', maar niet 'Bedrock'\n"
|
653 |
"'/^rock$/i' accepteert 'Rock' maar niet 'Rock the house'"
|
654 |
|
655 |
-
#: includes/
|
656 |
msgid "— Select —"
|
657 |
msgstr "— Selecteer —"
|
658 |
|
659 |
-
#:
|
660 |
msgid ""
|
661 |
-
"
|
662 |
-
"not be detected."
|
663 |
msgstr ""
|
664 |
-
"
|
665 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
666 |
|
667 |
#~ msgid "AND Products (not OR)"
|
668 |
#~ msgstr "ALLE Producten (niet OF)"
|
5 |
"Project-Id-Version: WooCommerce Extended Coupon Features\n"
|
6 |
"Report-Msgid-Bugs-To: http://wordpress.org/support/plugin/woocommerce-auto-"
|
7 |
"added-coupons\n"
|
8 |
+
"POT-Creation-Date: 2017-09-23 22:17+0200\n"
|
9 |
+
"PO-Revision-Date: 2017-09-23 22:21+0200\n"
|
10 |
"Last-Translator: \n"
|
11 |
"Language-Team: \n"
|
12 |
"Language: nl_NL\n"
|
13 |
"MIME-Version: 1.0\n"
|
14 |
"Content-Type: text/plain; charset=UTF-8\n"
|
15 |
"Content-Transfer-Encoding: 8bit\n"
|
16 |
+
"X-Generator: Poedit 2.0.1\n"
|
17 |
"X-Poedit-KeywordsList: __;_e\n"
|
18 |
"X-Poedit-Basepath: ..\n"
|
19 |
"X-Poedit-SearchPath-0: .\n"
|
20 |
"X-Poedit-SearchPathExcluded-0: docs\n"
|
21 |
|
22 |
+
#: includes/Abstract_WJECF_Plugin.php:49
|
23 |
+
#, php-format
|
24 |
msgid ""
|
25 |
+
"WooCommerce Extended Coupon Features version %s is required. You have "
|
26 |
+
"version %s"
|
|
|
27 |
msgstr ""
|
28 |
+
"WooCommerce Extended Coupon Features versie %s is vereist. Huidige versie: %s"
|
|
|
|
|
29 |
|
30 |
+
#: includes/WJECF_AutoCoupon.php:14
|
31 |
msgid ""
|
32 |
+
"Allow coupons to be automatically applied to the cart when restrictions are "
|
33 |
+
"met or by url."
|
34 |
msgstr ""
|
35 |
+
"Toestaan om coupons automatisch aan de winkelwagen toe te wijzen wanneer aan "
|
36 |
+
"de voorwaarden wordt voldaan of met een url."
|
37 |
+
|
38 |
+
#: includes/WJECF_AutoCoupon.php:67 includes/WJECF_AutoCoupon.php:201
|
39 |
+
#: includes/WJECF_AutoCoupon.php:208
|
40 |
+
msgid "Auto coupon"
|
41 |
+
msgstr "Automatisch toepassen"
|
42 |
+
|
43 |
+
#: includes/WJECF_AutoCoupon.php:72
|
44 |
+
msgid "Individual use"
|
45 |
+
msgstr "Individueel gebruik"
|
46 |
+
|
47 |
+
#: includes/WJECF_AutoCoupon.php:90 includes/WJECF_AutoCoupon.php:173
|
48 |
+
msgid "Auto coupons"
|
49 |
+
msgstr "Auto coupons"
|
50 |
+
|
51 |
+
#: includes/WJECF_AutoCoupon.php:97
|
52 |
+
msgid "Allow remove 'Auto Coupons'"
|
53 |
+
msgstr "Verwijderen toestaan van 'Auto Coupons'"
|
54 |
+
|
55 |
+
#: includes/WJECF_AutoCoupon.php:127
|
56 |
+
#: includes/admin/WJECF_Admin_Settings.php:190
|
57 |
+
#: includes/admin/WJECF_Admin_Settings.php:227
|
58 |
+
msgid "Enabled"
|
59 |
+
msgstr "Ingeschakeld"
|
60 |
+
|
61 |
+
#: includes/WJECF_AutoCoupon.php:132
|
62 |
+
msgid ""
|
63 |
+
"Check this box to allow the customer to remove 'Auto Coupons' from the cart."
|
64 |
+
msgstr ""
|
65 |
+
"Aanvinken om toe te staan dat de klant 'Auto Coupons' uit de winkelwagen mag "
|
66 |
+
"verwijderen."
|
67 |
+
|
68 |
+
#: includes/WJECF_AutoCoupon.php:154 includes/WJECF_AutoCoupon.php:162
|
69 |
+
msgid "Yes"
|
70 |
+
msgstr "Ja"
|
71 |
+
|
72 |
+
#: includes/WJECF_AutoCoupon.php:154 includes/WJECF_AutoCoupon.php:162
|
73 |
+
msgid "No"
|
74 |
+
msgstr "Nee"
|
75 |
+
|
76 |
+
#: includes/WJECF_AutoCoupon.php:209
|
77 |
+
msgid ""
|
78 |
+
"Automatically add the coupon to the cart if the restrictions are met. Please "
|
79 |
+
"enter a description when you check this box, the description will be shown "
|
80 |
+
"in the customer's cart if the coupon is applied."
|
81 |
+
msgstr ""
|
82 |
+
"Voeg de kortingsbon automatisch toe aan het winkelwagentje als aan alle "
|
83 |
+
"voorwaarden wordt voldaan. Vult u a.u.b. een omschrijving in als u deze "
|
84 |
+
"optie aanvinkt, de omschrijving zal aan de klant worden getoond wanneer de "
|
85 |
+
"kortingsbon wordt toegevoegd."
|
86 |
+
|
87 |
+
#: includes/WJECF_AutoCoupon.php:217
|
88 |
+
msgid "Priority"
|
89 |
+
msgstr "Prioriteit"
|
90 |
+
|
91 |
+
#: includes/WJECF_AutoCoupon.php:218
|
92 |
+
msgid "No priority"
|
93 |
+
msgstr "Geen prioriteit"
|
94 |
+
|
95 |
+
#: includes/WJECF_AutoCoupon.php:219
|
96 |
+
msgid ""
|
97 |
+
"When 'individual use' is checked, auto coupons with a higher value will have "
|
98 |
+
"priority over other auto coupons."
|
99 |
+
msgstr ""
|
100 |
+
"Wanneer 'individueel gebruik' is aangevinkt, zullen auto coupons met een "
|
101 |
+
"hogere prioriteit voorrang krijgen boven andere auto coupons."
|
102 |
+
|
103 |
+
#: includes/WJECF_AutoCoupon.php:229
|
104 |
+
msgid "Apply silently"
|
105 |
+
msgstr "Toepassen zonder melding"
|
106 |
+
|
107 |
+
#: includes/WJECF_AutoCoupon.php:230
|
108 |
+
msgid "Don't display a message when this coupon is automatically applied."
|
109 |
+
msgstr ""
|
110 |
+
"Geen melding weergeven wanneer deze kortingsbon automatisch wordt toegepast."
|
111 |
+
|
112 |
+
#: includes/WJECF_AutoCoupon.php:358
|
113 |
+
msgid "Free shipping coupon"
|
114 |
+
msgstr "Gratis verzending kortingsbon"
|
115 |
+
|
116 |
+
#: includes/WJECF_AutoCoupon.php:523
|
117 |
+
#, php-format
|
118 |
+
msgid "Discount applied: %s"
|
119 |
+
msgstr "Korting toegepast: %s"
|
120 |
+
|
121 |
+
#: includes/WJECF_Controller.php:227
|
122 |
+
msgid ""
|
123 |
+
"WooCommerce Extended Coupon Features is disabled because WooCommerce could "
|
124 |
+
"not be detected."
|
125 |
+
msgstr ""
|
126 |
+
"WooCommerce Extended Coupon Features is uitgeschakeld omdat WooCommerce niet "
|
127 |
+
"kon worden gedetecteerd."
|
128 |
+
|
129 |
+
#: includes/WJECF_Controller.php:266
|
130 |
+
#, php-format
|
131 |
+
msgid "The minimum subtotal of the matching products for this coupon is %s."
|
132 |
+
msgstr ""
|
133 |
+
"Het minimale subtotaal van overeengekomen producten voor deze kortingsbon is "
|
134 |
+
"%s."
|
135 |
+
|
136 |
+
#: includes/WJECF_Controller.php:270
|
137 |
+
#, php-format
|
138 |
+
msgid "The maximum subtotal of the matching products for this coupon is %s."
|
139 |
+
msgstr ""
|
140 |
+
"Het maximale subtotaal van overeengekomen producten voor deze kortingsbon is "
|
141 |
+
"%s."
|
142 |
+
|
143 |
+
#: includes/WJECF_Controller.php:274
|
144 |
+
#, php-format
|
145 |
+
msgid "The minimum quantity of matching products for this coupon is %s."
|
146 |
+
msgstr ""
|
147 |
+
"Het minimale aantal overeengekomen producten voor deze kortingsbon is %s."
|
148 |
+
|
149 |
+
#: includes/WJECF_Controller.php:278
|
150 |
+
#, php-format
|
151 |
+
msgid "The maximum quantity of matching products for this coupon is %s."
|
152 |
+
msgstr ""
|
153 |
+
"Het maximale aantal overeengekomen producten voor deze kortingsbon is %s."
|
154 |
+
|
155 |
+
#: includes/WJECF_Controller.php:281
|
156 |
+
msgid "The coupon is not valid for the currently selected shipping method."
|
157 |
+
msgstr "De kortingsbon is niet geldig voor de gekozen verzendmethode."
|
158 |
+
|
159 |
+
#: includes/WJECF_Controller.php:284
|
160 |
+
msgid "The coupon is not valid for the currently selected payment method."
|
161 |
+
msgstr "De kortingsbon is niet geldig voor de gekozen betaalmethode."
|
162 |
|
163 |
+
#: includes/WJECF_Controller.php:287
|
164 |
+
#, php-format
|
165 |
+
msgid "Sorry, it seems the coupon \"%s\" is not yours."
|
166 |
+
msgstr "Sorry, het lijkt erop dat kortingsbon \"%s\" niet van u is."
|
167 |
+
|
168 |
+
#: includes/WJECF_WC.php:129
|
169 |
+
msgid "Choose an option"
|
170 |
+
msgstr "Kies een optie"
|
171 |
+
|
172 |
+
#: includes/WJECF_WPML.php:12
|
173 |
+
msgid "Compatiblity with WPML."
|
174 |
+
msgstr "Compatibiliteit met WPML"
|
175 |
+
|
176 |
+
#: includes/admin/WJECF_Admin.php:11
|
177 |
+
msgid "Admin interface of WooCommerce Extended Coupon Features."
|
178 |
+
msgstr "Admin-interface van WooCommerce Extended Coupon Features."
|
179 |
+
|
180 |
+
#: includes/admin/WJECF_Admin.php:22
|
181 |
msgid ""
|
182 |
"<strong>WooCommerce Extended Coupon Features:</strong> You are using an old "
|
183 |
"version of WooCommerce. Updating of WooCommerce is recommended as using an "
|
189 |
"aangeraden omdat het gebruik van een oude versie met moderne plugins "
|
190 |
"onverwachte resultaten met zich mee kan brengen."
|
191 |
|
192 |
+
#: includes/admin/WJECF_Admin.php:92
|
193 |
msgid "(AND)"
|
194 |
msgstr "(ALLE)"
|
195 |
|
196 |
+
#: includes/admin/WJECF_Admin.php:93
|
197 |
msgid "(OR)"
|
198 |
msgstr "(OF)"
|
199 |
|
200 |
+
#: includes/admin/WJECF_Admin.php:102 includes/admin/WJECF_Admin.php:245
|
|
|
|
|
|
|
|
|
201 |
msgid "Checkout"
|
202 |
msgstr "Afrekenen"
|
203 |
|
204 |
+
#: includes/admin/WJECF_Admin.php:108
|
205 |
msgid "Miscellaneous"
|
206 |
msgstr "Diversen"
|
207 |
|
208 |
+
#: includes/admin/WJECF_Admin.php:144
|
209 |
msgid "Do you find WooCommerce Extended Coupon Features useful?"
|
210 |
msgstr "Vindt u WooCommerce Extended Coupon Features handig?"
|
211 |
|
212 |
+
#: includes/admin/WJECF_Admin.php:146
|
213 |
msgid "Express your gratitude"
|
214 |
msgstr "Toon uw waardering"
|
215 |
|
216 |
+
#: includes/admin/WJECF_Admin.php:150
|
217 |
msgid "Donate to the developer"
|
218 |
msgstr "Doneer aan de ontwikkelaar"
|
219 |
|
220 |
+
#: includes/admin/WJECF_Admin.php:157
|
221 |
msgid "Documentation"
|
222 |
msgstr "Documentatie"
|
223 |
|
224 |
+
#: includes/admin/WJECF_Admin.php:159
|
225 |
msgid "WooCommerce Extended Coupon Features Documentation"
|
226 |
msgstr "WooCommerce Extended Coupon Features Documentatie"
|
227 |
|
228 |
+
#: includes/admin/WJECF_Admin.php:173
|
229 |
msgid "Matching products"
|
230 |
msgstr "Overeenkomende producten"
|
231 |
|
232 |
+
#: includes/admin/WJECF_Admin.php:178
|
233 |
msgid "Products Operator"
|
234 |
msgstr "Producten operator"
|
235 |
|
236 |
+
#: includes/admin/WJECF_Admin.php:179 includes/admin/WJECF_Admin.php:192
|
237 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:233
|
238 |
msgid "OR"
|
239 |
msgstr "OF"
|
240 |
|
241 |
+
#: includes/admin/WJECF_Admin.php:179 includes/admin/WJECF_Admin.php:192
|
242 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:233
|
243 |
msgid "AND"
|
244 |
msgstr "ALLE"
|
245 |
|
246 |
+
#: includes/admin/WJECF_Admin.php:183
|
247 |
msgid ""
|
248 |
"Use AND if ALL of the products must be in the cart to use this coupon "
|
249 |
"(instead of only one of the products)."
|
251 |
"Gebruik ALLE als alle producten in het winkelwagentje moeten zitten (in "
|
252 |
"plaats van één producten)."
|
253 |
|
254 |
+
#: includes/admin/WJECF_Admin.php:191
|
255 |
msgid "Categories Operator"
|
256 |
msgstr "Categorieën Operator"
|
257 |
|
258 |
+
#: includes/admin/WJECF_Admin.php:196
|
259 |
msgid ""
|
260 |
"Use AND if products from ALL of the categories must be in the cart to use "
|
261 |
"this coupon (instead of only one from one of the categories)."
|
264 |
"winkelwagentje moeten zitten (in plaats van een product van één van de "
|
265 |
"categorieën)."
|
266 |
|
267 |
+
#: includes/admin/WJECF_Admin.php:205
|
268 |
msgid "Minimum quantity of matching products"
|
269 |
msgstr "Minimum aantal overeengekomen producten"
|
270 |
|
271 |
+
#: includes/admin/WJECF_Admin.php:206 includes/admin/WJECF_Admin.php:226
|
272 |
msgid "No minimum"
|
273 |
msgstr "Geen minimum"
|
274 |
|
275 |
+
#: includes/admin/WJECF_Admin.php:207
|
276 |
msgid ""
|
277 |
"Minimum quantity of the products that match the given product or category "
|
278 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
282 |
"(zie tab 'gebruiksbeperkingen'). Als geen product- of categorierestrictie is "
|
283 |
"opgegeven worden alle producten in de winkelwagen geteld."
|
284 |
|
285 |
+
#: includes/admin/WJECF_Admin.php:215
|
286 |
msgid "Maximum quantity of matching products"
|
287 |
msgstr "Maximum aantal overeengekomen producten"
|
288 |
|
289 |
+
#: includes/admin/WJECF_Admin.php:216 includes/admin/WJECF_Admin.php:236
|
290 |
msgid "No maximum"
|
291 |
msgstr "Geen maximum"
|
292 |
|
293 |
+
#: includes/admin/WJECF_Admin.php:217
|
294 |
msgid ""
|
295 |
"Maximum quantity of the products that match the given product or category "
|
296 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
300 |
"(zie tab 'gebruiksbeperkingen'). Als geen product- of categorierestrictie is "
|
301 |
"opgegeven worden alle producten in de winkelwagen geteld."
|
302 |
|
303 |
+
#: includes/admin/WJECF_Admin.php:225
|
304 |
msgid "Minimum subtotal of matching products"
|
305 |
msgstr "Minimum subtotaal overeengekomen producten"
|
306 |
|
307 |
+
#: includes/admin/WJECF_Admin.php:227
|
308 |
msgid ""
|
309 |
"Minimum price subtotal of the products that match the given product or "
|
310 |
"category restrictions (see tab 'usage restriction')."
|
314 |
"product- of categorierestrictie is opgegeven wordt het subtotaal van alle "
|
315 |
"producten in de winkelwagen opgeteld."
|
316 |
|
317 |
+
#: includes/admin/WJECF_Admin.php:235
|
318 |
msgid "Maximum subtotal of matching products"
|
319 |
msgstr "Maximum subtotaal overeengekomen producten"
|
320 |
|
321 |
+
#: includes/admin/WJECF_Admin.php:237
|
322 |
msgid ""
|
323 |
"Maximum price subtotal of the products that match the given product or "
|
324 |
"category restrictions (see tab 'usage restriction')."
|
328 |
"product- of categorierestrictie is opgegeven wordt het subtotaal van alle "
|
329 |
"producten in de winkelwagen opgeteld."
|
330 |
|
331 |
+
#: includes/admin/WJECF_Admin.php:250
|
332 |
msgid "Shipping methods"
|
333 |
msgstr "Verzendmethoden"
|
334 |
|
335 |
+
#: includes/admin/WJECF_Admin.php:251
|
336 |
msgid "Any shipping method"
|
337 |
msgstr "Verzendmethoden"
|
338 |
|
339 |
+
#: includes/admin/WJECF_Admin.php:260
|
340 |
msgid ""
|
341 |
"One of these shipping methods must be selected in order for this coupon to "
|
342 |
"be valid."
|
344 |
"Een van deze verzendmethoden moet gekozen zijn om deze kortingsbon te kunnen "
|
345 |
"gebruiken."
|
346 |
|
347 |
+
#: includes/admin/WJECF_Admin.php:267
|
348 |
msgid "Payment methods"
|
349 |
msgstr "Betaalmethoden"
|
350 |
|
351 |
+
#: includes/admin/WJECF_Admin.php:268
|
352 |
msgid "Any payment method"
|
353 |
msgstr "Betaalmethoden"
|
354 |
|
355 |
+
#: includes/admin/WJECF_Admin.php:279
|
356 |
msgid ""
|
357 |
"One of these payment methods must be selected in order for this coupon to be "
|
358 |
"valid."
|
360 |
"Een van deze betaalmethoden moet gekozen zijn om deze kortingsbon te kunnen "
|
361 |
"gebruiken."
|
362 |
|
363 |
+
#: includes/admin/WJECF_Admin.php:288
|
364 |
msgid "Customer restrictions"
|
365 |
msgstr "Klantbeperkingen"
|
366 |
|
367 |
+
#: includes/admin/WJECF_Admin.php:289
|
368 |
msgid ""
|
369 |
"If both a customer and a role restriction are supplied, matching either one "
|
370 |
"of them will suffice."
|
372 |
"Als zowel een klant- als klantrolrestrictie is opgegeven hoeft slechts aan "
|
373 |
"één van de restricties worden voldaan."
|
374 |
|
375 |
+
#: includes/admin/WJECF_Admin.php:294
|
376 |
msgid "Allowed Customers"
|
377 |
msgstr "Toegestane klanten"
|
378 |
|
379 |
+
#: includes/admin/WJECF_Admin.php:298
|
|
|
|
|
|
|
|
|
380 |
msgid "Only these customers may use this coupon."
|
381 |
msgstr "Alleen deze klanten kunnen deze kortingsbon gebruiken."
|
382 |
|
383 |
+
#: includes/admin/WJECF_Admin.php:306
|
384 |
msgid "Allowed User Roles"
|
385 |
msgstr "Toegestane klantrollen"
|
386 |
|
387 |
+
#: includes/admin/WJECF_Admin.php:307 includes/admin/WJECF_Admin.php:329
|
388 |
msgid "Any role"
|
389 |
msgstr "Klantrollen"
|
390 |
|
391 |
+
#: includes/admin/WJECF_Admin.php:321
|
392 |
msgid "Only these User Roles may use this coupon."
|
393 |
msgstr "Alleen deze klantrollen kunnen deze kortingsbon gebruiken."
|
394 |
|
395 |
+
#: includes/admin/WJECF_Admin.php:328
|
396 |
msgid "Disallowed User Roles"
|
397 |
msgstr "Uitgesloten klantrollen"
|
398 |
|
399 |
+
#: includes/admin/WJECF_Admin.php:342
|
400 |
msgid "These User Roles will be specifically excluded from using this coupon."
|
401 |
msgstr "Deze klantrollen zijn uitgesloten om deze kortingsbon te gebruiken."
|
402 |
|
403 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:7
|
404 |
+
msgid ""
|
405 |
+
"Automatically update data when a new version of this plugin is installed."
|
406 |
+
msgstr ""
|
407 |
+
"Automatisch updaten van data wanneer een nieuwe versie van de plugin is "
|
408 |
+
"geïnstalleerd."
|
409 |
|
410 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:49
|
411 |
+
msgid ""
|
412 |
+
"<strong>WooCommerce Extended Coupon Features:</strong> Please note, you're "
|
413 |
+
"using an older version of this plugin, while the data was upgraded to a "
|
414 |
+
"newer version."
|
415 |
+
msgstr ""
|
416 |
+
"<strong>WooCommerce Extended Coupon Features:</strong> Je gebruikt een "
|
417 |
+
"oudere versie van deze plugin, terwijl de data is opgewaardeerd naar een "
|
418 |
+
"nieuwere versie."
|
419 |
|
420 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:58
|
421 |
msgid ""
|
422 |
+
"<strong>WooCommerce Extended Coupon Features:</strong> Data succesfully "
|
423 |
+
"upgraded to the newest version."
|
|
|
424 |
msgstr ""
|
425 |
+
"<strong>WooCommerce Extended Coupon Features:</strong> Gegevens "
|
426 |
+
"opgewaardeerd naar de nieuwste versie."
|
|
|
427 |
|
428 |
+
#: includes/admin/WJECF_Admin_Html.php:28
|
429 |
#, php-format
|
430 |
msgid "%s (Default)"
|
431 |
msgstr "%s (standaard)"
|
432 |
|
433 |
+
#: includes/admin/WJECF_Admin_Html.php:42
|
434 |
+
#: includes/admin/WJECF_Admin_Html.php:90
|
435 |
msgid "Search for a product…"
|
436 |
msgstr "Zoek een product..."
|
437 |
|
438 |
+
#: includes/admin/WJECF_Admin_Html.php:184
|
439 |
+
msgid "Any customer"
|
440 |
+
msgstr "Klanten"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
441 |
|
442 |
+
#: includes/admin/WJECF_Admin_Settings.php:16
|
443 |
+
msgid "Settings page of WooCommerce Extended Coupon Features."
|
444 |
+
msgstr "Instellingen-pagina van WooCommerce Extended Coupon Features."
|
|
|
|
|
|
|
445 |
|
446 |
+
#: includes/admin/WJECF_Admin_Settings.php:29
|
447 |
+
#: includes/admin/WJECF_Admin_Settings.php:34
|
448 |
+
msgid "WooCommerce Extended Coupon Features"
|
449 |
+
msgstr "WooCommerce Extended Coupon Features"
|
|
|
450 |
|
451 |
+
#: includes/admin/WJECF_Admin_Settings.php:56
|
452 |
+
msgid "Advanced settings"
|
453 |
+
msgstr "Geavanceerde instellingen"
|
|
|
|
|
454 |
|
455 |
+
#: includes/admin/WJECF_Admin_Settings.php:63
|
456 |
+
msgid "Debug mode"
|
457 |
+
msgstr "Debug mode"
|
458 |
|
459 |
+
#: includes/admin/WJECF_Admin_Settings.php:89
|
460 |
+
msgid "Disabled plugins"
|
461 |
+
msgstr "Uitgeschakelde plugins"
|
462 |
|
463 |
+
#: includes/admin/WJECF_Admin_Settings.php:143
|
464 |
#, php-format
|
465 |
+
msgid ""
|
466 |
+
"When debug mode is enabled, extensive logging will be active and WJECF "
|
467 |
+
"Plugins can be enabled/disabled. If there are compatibility issues with "
|
468 |
+
"WooCommerce plugins, you can try disabling WJECF Plugins. Please don't keep "
|
469 |
+
"debug mode enabled on a production environment when it is not necessary. Log "
|
470 |
+
"can be found <a href=\"%s\">here</a>."
|
471 |
+
msgstr ""
|
472 |
+
"Wanneer debug mode is ingeschakeld is uitgebreide logging actief en kunnen "
|
473 |
+
"WJECF Plugins worden in- of uitgeschakeld. Zo kunt u eventuele "
|
474 |
+
"compatibiliteitsproblemen met andere WooCommerce plugins mogelijk oplossen. "
|
475 |
+
"<a href=\"%s\">hier</a> kan de log worden geraadpleegd."
|
476 |
+
|
477 |
+
#: includes/pro/WJECF_Pro_Controller.php:68
|
478 |
msgid "Discount on cart with excluded products"
|
479 |
msgstr "Korting op winkelwagen met uitgesloten producten"
|
480 |
|
481 |
+
#: includes/pro/WJECF_Pro_Controller.php:74
|
482 |
msgid "Allow discount on cart with excluded items"
|
483 |
msgstr "Korting toestaan op winkelwagen met uitgesloten producten"
|
484 |
|
485 |
+
#: includes/pro/WJECF_Pro_Controller.php:75
|
486 |
msgid ""
|
487 |
"Check this box to allow a 'Cart Discount' coupon to be applied even when "
|
488 |
"excluded items are in the cart (see tab 'usage restriction')."
|
491 |
"uitgesloten producten in de winkelwagen aanwezig zijn (zie tab "
|
492 |
"'gebruiksbeperking')."
|
493 |
|
494 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:9
|
|
|
|
|
|
|
|
|
495 |
msgid ""
|
496 |
+
"Allow coupons that are invalid upon application to be applied to the cart "
|
497 |
+
"once they become valid."
|
498 |
msgstr ""
|
499 |
+
"Toestaan dat een coupon aan de winkelwagen wordt toegevoegd terwijl nog niet "
|
500 |
+
"aan de voorwaarden wordt voldaan. De korting wordt pas toegewezen wanneer "
|
501 |
+
"aan de voorwaarden wordt voldaan."
|
502 |
|
503 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:31
|
504 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:39
|
505 |
+
msgid "Allow applying when invalid"
|
506 |
+
msgstr "Ongeldige coupons toestaan"
|
|
|
|
|
|
|
507 |
|
508 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:40
|
509 |
+
msgid ""
|
510 |
+
"When the customer attempts to apply the coupon while it's conditions are not "
|
511 |
+
"met, a message will be displayed. Once the conditions are met it will be "
|
512 |
+
"applied automatically."
|
513 |
+
msgstr ""
|
514 |
+
"Wanneer de klant een coupon welke nog niet geldig is aan de winkelwagen "
|
515 |
+
"toevoegd, wordt een boodschap wordt getoond. Wanneer aan de voorwaarden "
|
516 |
+
"wordt voldaan wordt de coupon toegewezen."
|
517 |
|
518 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:46
|
519 |
+
msgid "Message"
|
520 |
+
msgstr "Boodschap"
|
521 |
|
522 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:47
|
523 |
msgid ""
|
524 |
+
"This message will be displayed when the customer applies a coupon while it "
|
525 |
+
"is not yet valid."
|
526 |
msgstr ""
|
527 |
+
"Deze boodschap wordt getoond wanneer de klant een coupon welke nog niet "
|
528 |
+
"geldig is aan de winkelwagen toevoegd."
|
|
|
529 |
|
530 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:48
|
531 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:125
|
532 |
#, php-format
|
533 |
msgid "Coupon '%s' will be applied when it's conditions are met."
|
534 |
msgstr ""
|
535 |
"Coupon '%s' zal automatisch worden toegepast wanneer aan de voorwaarden "
|
536 |
"wordt voldaan."
|
537 |
|
538 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:188
|
539 |
#, php-format
|
540 |
msgid "Coupon '%s' applied."
|
541 |
msgstr "Coupon '%s' toegepast."
|
542 |
|
543 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products.php:12
|
544 |
+
msgid "Allow free products to be added to the cart."
|
545 |
+
msgstr "Toestaan dat gratis producten aan de winkelwagen worden toegevoegd."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
546 |
|
547 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:19
|
548 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:36
|
549 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:81
|
550 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:87
|
551 |
+
#: templates/cart/select-free-product.php:36
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
552 |
msgid "Free products"
|
553 |
msgstr "Gratis producten"
|
554 |
|
555 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:89
|
556 |
msgid ""
|
557 |
"Free products that will be added to the cart when this coupon is applied."
|
558 |
msgstr ""
|
559 |
"Gratis producten welke aan de winkelwagen worden toegevoegd als de coupon is "
|
560 |
"toegepast."
|
561 |
|
562 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:96
|
563 |
msgid "Select one"
|
564 |
msgstr "Kies één"
|
565 |
|
566 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:97
|
567 |
msgid "Check this box if the customer must choose from the free products."
|
568 |
msgstr "Aanvinken als de klant één van de gratis producten moet kiezen."
|
569 |
|
570 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:105
|
571 |
msgid "'Select your gift'-message"
|
572 |
msgstr "'Kies uw gratis product'-boodschap"
|
573 |
|
574 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:106
|
575 |
msgid "Please choose your free gift:"
|
576 |
msgstr "Kies uw gratis product:"
|
577 |
|
578 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:107
|
579 |
msgid "This message is displayed when the customer must choose a free product."
|
580 |
msgstr ""
|
581 |
"Deze melding wordt getoond wanneer de klant een gratis product moet kiezen."
|
582 |
|
583 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:116
|
584 |
msgid "Allow multiplication of the free products"
|
585 |
msgstr "Vermenigvuldigen gratis producten toestaan"
|
586 |
|
587 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:117
|
588 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:125
|
589 |
+
msgid "EXPERIMENTAL: "
|
590 |
+
msgstr "EXPERIMENTEEL:"
|
591 |
+
|
592 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:117
|
593 |
msgid ""
|
594 |
"The amount of free products is multiplied every time the minimum spend, "
|
595 |
"subtotal or quantity is reached."
|
597 |
"Het aantal van de gratis producten wordt vermenigvuldigd met het totale "
|
598 |
"aantal keer dat minimale besteding, subtotaal of aantal is bereikt."
|
599 |
|
600 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:124
|
601 |
msgid "BOGO matching products"
|
602 |
msgstr "1+1 gratis voor overeengekomen producten"
|
603 |
|
604 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:126
|
605 |
msgid ""
|
606 |
"Buy one or more of any of the matching products (see 'Usage Restriction'-"
|
607 |
"tab) and get one free. Check 'Allow multiplication' to get one free item for "
|
611 |
"Gebruik 'vermenigvuldigen toestaan' om een gratis artikel voor elk "
|
612 |
"overeenkomend artikel te krijgen."
|
613 |
|
614 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:86
|
615 |
+
#, php-format
|
616 |
+
msgid ""
|
617 |
+
"Sorry, we do not have enough \"%1$s\" in stock (%2$s in stock). Please "
|
618 |
+
"review your selection."
|
619 |
+
msgstr ""
|
620 |
+
"Helaas, we hebben niet voldoende \"%1$s\" op voorraad (%2$s op voorraad). "
|
621 |
+
"Maak s.v.p. een andere keuze."
|
622 |
+
|
623 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:92
|
624 |
+
#, php-format
|
625 |
+
msgid "Please choose a variation of \"%s\"."
|
626 |
+
msgstr "Kies s.v.p. een variatie van \"%s\"."
|
627 |
+
|
628 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:102
|
629 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:112
|
630 |
+
msgid "Free!"
|
631 |
+
msgstr "Gratis!"
|
632 |
+
|
633 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:30
|
634 |
+
msgid "Limit discount to only certain products in the cart."
|
635 |
+
msgstr "Limiteer korting tot bepaalde producten in de winkelwagen."
|
636 |
+
|
637 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:264
|
638 |
+
msgid "(default)"
|
639 |
+
msgstr "(standaard)"
|
640 |
+
|
641 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:268
|
642 |
+
msgid "One item per order line"
|
643 |
+
msgstr "Eén item per orderregel"
|
644 |
+
|
645 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:272
|
646 |
+
msgid "Lowest priced product (single item)"
|
647 |
+
msgstr "Laagst geprijsde product (één item)"
|
648 |
+
|
649 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:276
|
650 |
+
msgid "Lowest priced order line (all items)"
|
651 |
+
msgstr "Laagst geprijsde orderregel (alle items)"
|
652 |
+
|
653 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:280
|
654 |
+
msgid "Every nth item. n = min qty of matching products (or 2 if not supplied)"
|
655 |
+
msgstr ""
|
656 |
+
"Ieder n-de item. n = minimum aantal overeengekomen producten (standaard: 2)"
|
657 |
+
|
658 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:397
|
659 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:410
|
660 |
+
msgid "Limit discount to"
|
661 |
+
msgstr "Beperk korting tot"
|
662 |
+
|
663 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:398
|
664 |
+
msgid ""
|
665 |
+
"Here you can exclude certain products from being discounted (Only applies to "
|
666 |
+
"Cart % Discount, Product Discount, Product % Discount)"
|
667 |
+
msgstr ""
|
668 |
+
"Hier kun je producten uitsluiten van korting (Geldt alleen voor Winkelwagen "
|
669 |
+
"% korting, Product korting, Product % korting)"
|
670 |
+
|
671 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:412
|
672 |
+
msgid ""
|
673 |
+
"Please note that when the discount type is 'Product discount' (see 'General'-"
|
674 |
+
"tab), the discount will only be applied to <em>matching</em> products."
|
675 |
+
msgstr ""
|
676 |
+
"Let op dat wanneer het type korting 'Product korting' (zie tab 'Algemeen') "
|
677 |
+
"is gekozen, de korting alleen zal worden toegepast op overeengekomen "
|
678 |
+
"producten."
|
679 |
+
|
680 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:12
|
681 |
+
msgid "Advanced matching queries for products."
|
682 |
+
msgstr ""
|
683 |
+
|
684 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:232
|
685 |
msgid "Custom Fields Operator"
|
686 |
msgstr "Extra velden Operator"
|
687 |
|
688 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:236
|
689 |
msgid ""
|
690 |
"Use AND if all of the custom fields must be in the cart to use this coupon "
|
691 |
"(instead of only one of the custom fields)."
|
693 |
"Gebruik ALLE als alle extra velden in het winkelwagentje moeten zitten (in "
|
694 |
"plaats van één van de extra velden)."
|
695 |
|
696 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:242
|
697 |
msgid "Custom Fields"
|
698 |
msgstr "Extra velden"
|
699 |
|
700 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:248
|
701 |
msgid "Name"
|
702 |
msgstr "Naam"
|
703 |
|
704 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:249
|
705 |
msgid "Value"
|
706 |
msgstr "Waarde"
|
707 |
|
708 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:252
|
709 |
msgid ""
|
710 |
"If multiple lines are entered, only one of them needs to match. A whole word "
|
711 |
"case insensitive match is executed by default and % can be used as wildcard. "
|
727 |
"'roc%' accepteert 'Rock' en ook 'Rock the house', maar niet 'Bedrock'\n"
|
728 |
"'/^rock$/i' accepteert 'Rock' maar niet 'Rock the house'"
|
729 |
|
730 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:275
|
731 |
msgid "— Select —"
|
732 |
msgstr "— Selecteer —"
|
733 |
|
734 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:22
|
735 |
msgid ""
|
736 |
+
"Automatically upgrade data when a new version of this plugin is installed."
|
|
|
737 |
msgstr ""
|
738 |
+
"Automatisch updaten wanneer een nieuwe versie van deze plugin beschikbaar is."
|
739 |
+
|
740 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:48
|
741 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:63
|
742 |
+
msgid "Licence key"
|
743 |
+
msgstr "Licentiecode"
|
744 |
+
|
745 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:55
|
746 |
+
msgid "Domain"
|
747 |
+
msgstr "Domein"
|
748 |
+
|
749 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:74
|
750 |
+
msgid ""
|
751 |
+
"A valid licence key will allow you to update the plugin from the WordPress "
|
752 |
+
"admin area."
|
753 |
+
msgstr "Een geldige licentiecode activeert automatische updates van de plugin."
|
754 |
+
|
755 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:75
|
756 |
+
#, php-format
|
757 |
+
msgid "You can manage your licences at your account page at %s."
|
758 |
+
msgstr "Je kunt je licenties beheren op %s."
|
759 |
+
|
760 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:76
|
761 |
+
msgid "This option is not available if you purchased from Envato market."
|
762 |
+
msgstr "Deze optie is niet beschikbaar voor aankopen van Envato market."
|
763 |
+
|
764 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:119
|
765 |
+
msgid "The domain of your store. e.g. www.mystore.com."
|
766 |
+
msgstr "Het domein van de webwinkel. Bijvoorbeeld www.ditismijnwebwinkel.nl."
|
767 |
+
|
768 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:227
|
769 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:323
|
770 |
+
msgid "Licence key is not valid."
|
771 |
+
msgstr "Ongeldige licentiecode."
|
772 |
+
|
773 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:229
|
774 |
+
#, php-format
|
775 |
+
msgid ""
|
776 |
+
"You will not receive automatic updates. Please enter a valid licence key <a "
|
777 |
+
"href=\"%s\">here</a>."
|
778 |
+
msgstr ""
|
779 |
+
"Je zult geen automatische updates ontvangen. Vul s.v.p. <a href=\"%s\">hier</"
|
780 |
+
"a> een juiste licentiecode in."
|
781 |
+
|
782 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:253
|
783 |
+
#, php-format
|
784 |
+
msgid "Licence for domain %s succesfully deactivated."
|
785 |
+
msgstr "Licentie voor domein %s succesvol geactiveerd."
|
786 |
+
|
787 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:258
|
788 |
+
msgid "Failed deactivating licence. "
|
789 |
+
msgstr "Deactiveren van de licentie is niet gelukt. "
|
790 |
+
|
791 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:262
|
792 |
+
#, php-format
|
793 |
+
msgid "Failed deactivating licence. Invalid response from server: %s"
|
794 |
+
msgstr ""
|
795 |
+
"Deactiveren van de licentie is niet gelukt. Ongeldig antwoord van de server: "
|
796 |
+
"%s"
|
797 |
+
|
798 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:281
|
799 |
+
msgid "No licence key entered."
|
800 |
+
msgstr "Geen licentiecode ingevoerd."
|
801 |
+
|
802 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:284
|
803 |
+
msgid "No valid domain entered."
|
804 |
+
msgstr "Geen geldig domein ingevoerd."
|
805 |
+
|
806 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:291
|
807 |
+
#, php-format
|
808 |
+
msgid "Could not validate the licence. Invalid response from server: %s"
|
809 |
+
msgstr "Kom de licentie niet valideren. Ongeldig antwoord van de server: %s"
|
810 |
+
|
811 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:304
|
812 |
+
#, php-format
|
813 |
+
msgid "Could not activate the licence. Invalid response from server: %s"
|
814 |
+
msgstr "Kom de licentie niet activeren. Ongeldig antwoord van de server: %s"
|
815 |
+
|
816 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:317
|
817 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:366
|
818 |
+
msgid "Licence key is valid."
|
819 |
+
msgstr "Licentie is geldig."
|
820 |
+
|
821 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:350
|
822 |
+
msgid "Invalid licence key."
|
823 |
+
msgstr "Ongeldige licentiecode."
|
824 |
+
|
825 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:353
|
826 |
+
msgid "Licence Key does not match this product."
|
827 |
+
msgstr "Licentiecode is niet van dit product."
|
828 |
+
|
829 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:356
|
830 |
+
msgid "Licence is not active."
|
831 |
+
msgstr "Licentie is niet actief."
|
832 |
+
|
833 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:359
|
834 |
+
msgid "Licence key is unassigned."
|
835 |
+
msgstr "Licentie is niet toegewezen."
|
836 |
+
|
837 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:362
|
838 |
+
msgid "Licence key not active for current domain."
|
839 |
+
msgstr "Licentie is niet actief voor dit domein."
|
840 |
+
|
841 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:434
|
842 |
+
msgid "An Unexpected HTTP Error occurred during the API request."
|
843 |
+
msgstr "Onverwachte HTTP Error tijdens de API-request."
|
844 |
+
|
845 |
+
#: templates/coupon-select-free-product.php:69
|
846 |
+
msgid "You can select one free product."
|
847 |
+
msgstr "Je kunt een gratis product uitkiezen."
|
848 |
+
|
849 |
+
#~ msgid "an unexpected error occured"
|
850 |
+
#~ msgstr "er heeft een onbekende fout opgetreden"
|
851 |
+
|
852 |
+
#~ msgid "License key"
|
853 |
+
#~ msgstr "Licentiecode"
|
854 |
+
|
855 |
+
#~ msgid "Products"
|
856 |
+
#~ msgstr "Producten"
|
857 |
+
|
858 |
+
#~ msgid "Allow when minimum spend not reached"
|
859 |
+
#~ msgstr "Toestaan wanneer minimale besteding nog niet is behaald."
|
860 |
+
|
861 |
+
#~ msgid ""
|
862 |
+
#~ "Check this box to allow the coupon to be in the cart even when minimum "
|
863 |
+
#~ "spend (see tab 'usage restriction') is not reached. Value of the discount "
|
864 |
+
#~ "will be 0 until minimum spend is reached."
|
865 |
+
#~ msgstr ""
|
866 |
+
#~ "Aanvinken als de coupon in de winkelwagen mag zitten zelfs als minimale "
|
867 |
+
#~ "besteding nog niet is gehaald. De coupon zal een waarde van 0 hebben tot "
|
868 |
+
#~ "de minimale besteding is bereikt."
|
869 |
+
|
870 |
+
#~ msgid "Please select your free gift."
|
871 |
+
#~ msgstr "Kies een gratis artikel."
|
872 |
|
873 |
#~ msgid "AND Products (not OR)"
|
874 |
#~ msgstr "ALLE Producten (niet OF)"
|
languages/woocommerce-jos-autocoupon.pot
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: WooCommerce Extended Coupon Features 2.00\n"
|
5 |
-
"POT-Creation-Date:
|
6 |
"PO-Revision-Date: 2015-05-09 18:12+0100\n"
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: Jos Koenis\n"
|
@@ -10,27 +10,152 @@ msgstr ""
|
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
-
"X-Generator: Poedit
|
14 |
-
"X-Poedit-KeywordsList: __;_e\n"
|
15 |
"X-Poedit-Basepath: ..\n"
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
"X-Poedit-SearchPathExcluded-0: docs\n"
|
19 |
|
20 |
-
#: includes/
|
|
|
21 |
msgid ""
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"newer version."
|
25 |
msgstr ""
|
26 |
|
27 |
-
#: includes/
|
28 |
msgid ""
|
29 |
-
"
|
30 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31 |
msgstr ""
|
32 |
|
33 |
-
#: includes/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34 |
msgid ""
|
35 |
"<strong>WooCommerce Extended Coupon Features:</strong> You are using an old "
|
36 |
"version of WooCommerce. Updating of WooCommerce is recommended as using an "
|
@@ -38,544 +163,576 @@ msgid ""
|
|
38 |
"plugins."
|
39 |
msgstr ""
|
40 |
|
41 |
-
#: includes/admin/
|
42 |
msgid "(AND)"
|
43 |
msgstr ""
|
44 |
|
45 |
-
#: includes/admin/
|
46 |
msgid "(OR)"
|
47 |
msgstr ""
|
48 |
|
49 |
-
#: includes/admin/
|
50 |
-
msgid "Products"
|
51 |
-
msgstr ""
|
52 |
-
|
53 |
-
#: includes/admin/wjecf-admin.php:132 includes/admin/wjecf-admin.php:276
|
54 |
msgid "Checkout"
|
55 |
msgstr ""
|
56 |
|
57 |
-
#: includes/admin/
|
58 |
msgid "Miscellaneous"
|
59 |
msgstr ""
|
60 |
|
61 |
-
#: includes/admin/
|
62 |
msgid "Do you find WooCommerce Extended Coupon Features useful?"
|
63 |
msgstr ""
|
64 |
|
65 |
-
#: includes/admin/
|
66 |
msgid "Express your gratitude"
|
67 |
msgstr ""
|
68 |
|
69 |
-
#: includes/admin/
|
70 |
msgid "Donate to the developer"
|
71 |
msgstr ""
|
72 |
|
73 |
-
#: includes/admin/
|
74 |
msgid "Documentation"
|
75 |
msgstr ""
|
76 |
|
77 |
-
#: includes/admin/
|
78 |
msgid "WooCommerce Extended Coupon Features Documentation"
|
79 |
msgstr ""
|
80 |
|
81 |
-
#: includes/admin/
|
82 |
msgid "Matching products"
|
83 |
msgstr ""
|
84 |
|
85 |
-
#: includes/admin/
|
86 |
msgid "Products Operator"
|
87 |
msgstr ""
|
88 |
|
89 |
-
#: includes/admin/
|
90 |
-
#: includes/
|
91 |
msgid "OR"
|
92 |
msgstr ""
|
93 |
|
94 |
-
#: includes/admin/
|
95 |
-
#: includes/
|
96 |
msgid "AND"
|
97 |
msgstr ""
|
98 |
|
99 |
-
#: includes/admin/
|
100 |
msgid ""
|
101 |
"Use AND if ALL of the products must be in the cart to use this coupon "
|
102 |
"(instead of only one of the products)."
|
103 |
msgstr ""
|
104 |
|
105 |
-
#: includes/admin/
|
106 |
msgid "Categories Operator"
|
107 |
msgstr ""
|
108 |
|
109 |
-
#: includes/admin/
|
110 |
msgid ""
|
111 |
"Use AND if products from ALL of the categories must be in the cart to use "
|
112 |
"this coupon (instead of only one from one of the categories)."
|
113 |
msgstr ""
|
114 |
|
115 |
-
#: includes/admin/
|
116 |
msgid "Minimum quantity of matching products"
|
117 |
msgstr ""
|
118 |
|
119 |
-
#: includes/admin/
|
120 |
msgid "No minimum"
|
121 |
msgstr ""
|
122 |
|
123 |
-
#: includes/admin/
|
124 |
msgid ""
|
125 |
"Minimum quantity of the products that match the given product or category "
|
126 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
127 |
"restrictions are specified, the total number of products is used."
|
128 |
msgstr ""
|
129 |
|
130 |
-
#: includes/admin/
|
131 |
msgid "Maximum quantity of matching products"
|
132 |
msgstr ""
|
133 |
|
134 |
-
#: includes/admin/
|
135 |
msgid "No maximum"
|
136 |
msgstr ""
|
137 |
|
138 |
-
#: includes/admin/
|
139 |
msgid ""
|
140 |
"Maximum quantity of the products that match the given product or category "
|
141 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
142 |
"restrictions are specified, the total number of products is used."
|
143 |
msgstr ""
|
144 |
|
145 |
-
#: includes/admin/
|
146 |
msgid "Minimum subtotal of matching products"
|
147 |
msgstr ""
|
148 |
|
149 |
-
#: includes/admin/
|
150 |
msgid ""
|
151 |
"Minimum price subtotal of the products that match the given product or "
|
152 |
"category restrictions (see tab 'usage restriction')."
|
153 |
msgstr ""
|
154 |
|
155 |
-
#: includes/admin/
|
156 |
msgid "Maximum subtotal of matching products"
|
157 |
msgstr ""
|
158 |
|
159 |
-
#: includes/admin/
|
160 |
msgid ""
|
161 |
"Maximum price subtotal of the products that match the given product or "
|
162 |
"category restrictions (see tab 'usage restriction')."
|
163 |
msgstr ""
|
164 |
|
165 |
-
#: includes/admin/
|
166 |
msgid "Shipping methods"
|
167 |
msgstr ""
|
168 |
|
169 |
-
#: includes/admin/
|
170 |
msgid "Any shipping method"
|
171 |
msgstr ""
|
172 |
|
173 |
-
#: includes/admin/
|
174 |
msgid ""
|
175 |
"One of these shipping methods must be selected in order for this coupon to "
|
176 |
"be valid."
|
177 |
msgstr ""
|
178 |
|
179 |
-
#: includes/admin/
|
180 |
msgid "Payment methods"
|
181 |
msgstr ""
|
182 |
|
183 |
-
#: includes/admin/
|
184 |
msgid "Any payment method"
|
185 |
msgstr ""
|
186 |
|
187 |
-
#: includes/admin/
|
188 |
msgid ""
|
189 |
"One of these payment methods must be selected in order for this coupon to be "
|
190 |
"valid."
|
191 |
msgstr ""
|
192 |
|
193 |
-
#: includes/admin/
|
194 |
msgid "Customer restrictions"
|
195 |
msgstr ""
|
196 |
|
197 |
-
#: includes/admin/
|
198 |
msgid ""
|
199 |
"If both a customer and a role restriction are supplied, matching either one "
|
200 |
"of them will suffice."
|
201 |
msgstr ""
|
202 |
|
203 |
-
#: includes/admin/
|
204 |
msgid "Allowed Customers"
|
205 |
msgstr ""
|
206 |
|
207 |
-
#: includes/admin/
|
208 |
-
msgid "Any customer"
|
209 |
-
msgstr ""
|
210 |
-
|
211 |
-
#: includes/admin/wjecf-admin.php:337
|
212 |
msgid "Only these customers may use this coupon."
|
213 |
msgstr ""
|
214 |
|
215 |
-
#: includes/admin/
|
216 |
msgid "Allowed User Roles"
|
217 |
msgstr ""
|
218 |
|
219 |
-
#: includes/admin/
|
220 |
msgid "Any role"
|
221 |
msgstr ""
|
222 |
|
223 |
-
#: includes/admin/
|
224 |
msgid "Only these User Roles may use this coupon."
|
225 |
msgstr ""
|
226 |
|
227 |
-
#: includes/admin/
|
228 |
msgid "Disallowed User Roles"
|
229 |
msgstr ""
|
230 |
|
231 |
-
#: includes/admin/
|
232 |
msgid "These User Roles will be specifically excluded from using this coupon."
|
233 |
msgstr ""
|
234 |
|
235 |
-
#: includes/admin/
|
236 |
-
msgid "
|
|
|
237 |
msgstr ""
|
238 |
|
239 |
-
#: includes/admin/
|
240 |
-
|
241 |
-
|
|
|
|
|
242 |
msgstr ""
|
243 |
|
244 |
-
#: includes/admin/
|
245 |
msgid ""
|
246 |
-
"
|
247 |
-
"
|
248 |
-
"0 until minimum spend is reached."
|
249 |
msgstr ""
|
250 |
|
251 |
-
#: includes/admin/
|
252 |
#, php-format
|
253 |
msgid "%s (Default)"
|
254 |
msgstr ""
|
255 |
|
256 |
-
#: includes/admin/
|
|
|
257 |
msgid "Search for a product…"
|
258 |
msgstr ""
|
259 |
|
260 |
-
#: includes/
|
261 |
-
|
262 |
-
msgid "Auto coupon"
|
263 |
msgstr ""
|
264 |
|
265 |
-
#: includes/
|
266 |
-
msgid "
|
267 |
msgstr ""
|
268 |
|
269 |
-
#: includes/
|
270 |
-
|
|
|
271 |
msgstr ""
|
272 |
|
273 |
-
#: includes/
|
274 |
-
msgid "
|
275 |
msgstr ""
|
276 |
|
277 |
-
#: includes/
|
278 |
-
msgid "
|
|
|
|
|
|
|
|
|
279 |
msgstr ""
|
280 |
|
281 |
-
#: includes/
|
|
|
282 |
msgid ""
|
283 |
-
"
|
284 |
-
"
|
285 |
-
"
|
|
|
|
|
286 |
msgstr ""
|
287 |
|
288 |
-
#: includes/
|
289 |
-
msgid "
|
290 |
msgstr ""
|
291 |
|
292 |
-
#: includes/
|
293 |
-
msgid "
|
294 |
msgstr ""
|
295 |
|
296 |
-
#: includes/
|
297 |
msgid ""
|
298 |
-
"
|
299 |
-
"
|
300 |
msgstr ""
|
301 |
|
302 |
-
#: includes/
|
303 |
-
msgid "
|
|
|
|
|
304 |
msgstr ""
|
305 |
|
306 |
-
#: includes/
|
307 |
-
|
|
|
308 |
msgstr ""
|
309 |
|
310 |
-
#: includes/
|
311 |
-
msgid "
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
#, php-format
|
316 |
-
msgid "Discount applied: %s"
|
317 |
msgstr ""
|
318 |
|
319 |
-
#: includes/
|
320 |
-
|
321 |
-
msgid "The minimum subtotal of the matching products for this coupon is %s."
|
322 |
msgstr ""
|
323 |
|
324 |
-
#: includes/
|
325 |
-
|
326 |
-
|
|
|
327 |
msgstr ""
|
328 |
|
329 |
-
#: includes/
|
|
|
330 |
#, php-format
|
331 |
-
msgid "
|
332 |
msgstr ""
|
333 |
|
334 |
-
#: includes/
|
335 |
#, php-format
|
336 |
-
msgid "
|
337 |
msgstr ""
|
338 |
|
339 |
-
#: includes/
|
340 |
-
msgid "
|
341 |
msgstr ""
|
342 |
|
343 |
-
#: includes/
|
344 |
-
|
|
|
|
|
|
|
|
|
345 |
msgstr ""
|
346 |
|
347 |
-
#: includes/
|
348 |
-
|
349 |
-
|
350 |
msgstr ""
|
351 |
|
352 |
-
#: includes/
|
353 |
-
msgid "
|
354 |
msgstr ""
|
355 |
|
356 |
-
#: includes/
|
357 |
-
msgid "
|
358 |
msgstr ""
|
359 |
|
360 |
-
#: includes/
|
361 |
-
msgid ""
|
362 |
-
"Check this box to allow a 'Cart Discount' coupon to be applied even when "
|
363 |
-
"excluded items are in the cart (see tab 'usage restriction')."
|
364 |
msgstr ""
|
365 |
|
366 |
-
#: includes/
|
367 |
-
msgid "
|
368 |
msgstr ""
|
369 |
|
370 |
-
#: includes/
|
371 |
-
msgid ""
|
372 |
-
"Here you can exclude certain products from being discounted (Only applies to "
|
373 |
-
"Cart % Discount, Product Discount, Product % Discount)"
|
374 |
msgstr ""
|
375 |
|
376 |
-
#: includes/
|
377 |
-
msgid "
|
378 |
msgstr ""
|
379 |
|
380 |
-
#: includes/
|
381 |
-
|
|
|
382 |
msgstr ""
|
383 |
|
384 |
-
#: includes/
|
385 |
-
msgid "
|
|
|
|
|
386 |
msgstr ""
|
387 |
|
388 |
-
#: includes/
|
389 |
-
msgid "
|
390 |
msgstr ""
|
391 |
|
392 |
-
#: includes/
|
393 |
msgid ""
|
394 |
-
"
|
395 |
-
"tab)
|
|
|
396 |
msgstr ""
|
397 |
|
398 |
-
#: includes/
|
399 |
#, php-format
|
400 |
-
msgid "
|
|
|
|
|
401 |
msgstr ""
|
402 |
|
403 |
-
#: includes/
|
404 |
#, php-format
|
405 |
-
msgid "
|
406 |
msgstr ""
|
407 |
|
408 |
-
#: includes/
|
409 |
-
|
|
|
410 |
msgstr ""
|
411 |
|
412 |
-
#: includes/
|
413 |
-
msgid "
|
414 |
msgstr ""
|
415 |
|
416 |
-
#: includes/
|
417 |
-
msgid "
|
418 |
msgstr ""
|
419 |
|
420 |
-
#: includes/
|
421 |
-
msgid "
|
422 |
msgstr ""
|
423 |
|
424 |
-
#: includes/
|
425 |
-
msgid "
|
426 |
msgstr ""
|
427 |
|
428 |
-
#: includes/
|
429 |
-
msgid "
|
430 |
msgstr ""
|
431 |
|
432 |
-
#: includes/
|
433 |
-
msgid "
|
434 |
msgstr ""
|
435 |
|
436 |
-
#: includes/
|
437 |
-
|
|
|
438 |
msgstr ""
|
439 |
|
440 |
-
#: includes/
|
441 |
-
msgid "
|
|
|
|
|
442 |
msgstr ""
|
443 |
|
444 |
-
#: includes/
|
445 |
-
msgid "
|
|
|
|
|
446 |
msgstr ""
|
447 |
|
448 |
-
#: includes/
|
449 |
-
msgid "
|
450 |
msgstr ""
|
451 |
|
452 |
-
#: includes/
|
453 |
-
msgid "
|
454 |
msgstr ""
|
455 |
|
456 |
-
#: includes/
|
457 |
-
msgid "
|
|
|
|
|
458 |
msgstr ""
|
459 |
|
460 |
-
#: includes/
|
461 |
-
msgid "
|
462 |
msgstr ""
|
463 |
|
464 |
-
#: includes/
|
465 |
-
msgid "
|
466 |
msgstr ""
|
467 |
|
468 |
-
#: includes/
|
469 |
-
msgid "
|
470 |
msgstr ""
|
471 |
|
472 |
-
#: includes/
|
473 |
msgid ""
|
474 |
-
"
|
475 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
476 |
msgstr ""
|
477 |
|
478 |
-
#: includes/
|
479 |
-
msgid "
|
480 |
msgstr ""
|
481 |
|
482 |
-
#: includes/
|
483 |
-
|
484 |
-
msgid "Free!"
|
485 |
msgstr ""
|
486 |
|
487 |
-
#: includes/
|
488 |
-
#: includes/
|
489 |
-
|
490 |
-
msgid "Free products"
|
491 |
msgstr ""
|
492 |
|
493 |
-
#: includes/
|
|
|
|
|
|
|
|
|
494 |
msgid ""
|
495 |
-
"
|
|
|
496 |
msgstr ""
|
497 |
|
498 |
-
#: includes/
|
499 |
-
|
|
|
500 |
msgstr ""
|
501 |
|
502 |
-
#: includes/
|
503 |
-
msgid "
|
504 |
msgstr ""
|
505 |
|
506 |
-
#: includes/
|
507 |
-
msgid "
|
508 |
msgstr ""
|
509 |
|
510 |
-
#: includes/
|
511 |
-
|
|
|
512 |
msgstr ""
|
513 |
|
514 |
-
#: includes/
|
515 |
-
|
|
|
|
|
|
|
516 |
msgstr ""
|
517 |
|
518 |
-
#: includes/
|
519 |
-
|
|
|
520 |
msgstr ""
|
521 |
|
522 |
-
#: includes/
|
523 |
-
msgid ""
|
524 |
-
"The amount of free products is multiplied every time the minimum spend, "
|
525 |
-
"subtotal or quantity is reached."
|
526 |
msgstr ""
|
527 |
|
528 |
-
#: includes/
|
529 |
-
|
|
|
530 |
msgstr ""
|
531 |
|
532 |
-
#: includes/
|
533 |
-
msgid ""
|
534 |
-
"Buy one or more of any of the matching products (see 'Usage Restriction'-"
|
535 |
-
"tab) and get one free. Check 'Allow multiplication' to get one free item for "
|
536 |
-
"every matching item in the cart."
|
537 |
msgstr ""
|
538 |
|
539 |
-
#: includes/
|
540 |
-
msgid "
|
541 |
msgstr ""
|
542 |
|
543 |
-
#: includes/
|
544 |
-
|
545 |
-
"
|
546 |
-
"(instead of only one of the custom fields)."
|
547 |
msgstr ""
|
548 |
|
549 |
-
#: includes/
|
550 |
-
|
|
|
551 |
msgstr ""
|
552 |
|
553 |
-
#: includes/
|
554 |
-
|
|
|
555 |
msgstr ""
|
556 |
|
557 |
-
#: includes/
|
558 |
-
msgid "
|
559 |
msgstr ""
|
560 |
|
561 |
-
#: includes/
|
562 |
-
msgid ""
|
563 |
-
"If multiple lines are entered, only one of them needs to match. A whole word "
|
564 |
-
"case insensitive match is executed by default and % can be used as wildcard. "
|
565 |
-
"If a line starts with a forward slash (/) it is treated as a regular "
|
566 |
-
"expression. NOTE: Regular expression matches are case sensitive by default; "
|
567 |
-
"append flag i to the regular expression for a case insensitive match. \n"
|
568 |
-
"Examples:\n"
|
569 |
-
"'roc%' matches 'Rock' and also 'Rock the house', but not 'Bedrock'\n"
|
570 |
-
"'/^rock$/i' matches 'Rock' but not 'Rock the house'"
|
571 |
msgstr ""
|
572 |
|
573 |
-
#: includes/
|
574 |
-
msgid "
|
575 |
msgstr ""
|
576 |
|
577 |
-
#:
|
578 |
-
msgid ""
|
579 |
-
|
580 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
581 |
msgstr ""
|
2 |
msgid ""
|
3 |
msgstr ""
|
4 |
"Project-Id-Version: WooCommerce Extended Coupon Features 2.00\n"
|
5 |
+
"POT-Creation-Date: 2017-09-23 22:20+0200\n"
|
6 |
"PO-Revision-Date: 2015-05-09 18:12+0100\n"
|
7 |
"Last-Translator: \n"
|
8 |
"Language-Team: Jos Koenis\n"
|
10 |
"MIME-Version: 1.0\n"
|
11 |
"Content-Type: text/plain; charset=UTF-8\n"
|
12 |
"Content-Transfer-Encoding: 8bit\n"
|
13 |
+
"X-Generator: Poedit 2.0.1\n"
|
14 |
+
"X-Poedit-KeywordsList: __;_e;_n\n"
|
15 |
"X-Poedit-Basepath: ..\n"
|
16 |
"X-Poedit-SourceCharset: UTF-8\n"
|
17 |
"X-Poedit-SearchPath-0: .\n"
|
18 |
"X-Poedit-SearchPathExcluded-0: docs\n"
|
19 |
|
20 |
+
#: includes/Abstract_WJECF_Plugin.php:49
|
21 |
+
#, php-format
|
22 |
msgid ""
|
23 |
+
"WooCommerce Extended Coupon Features version %s is required. You have "
|
24 |
+
"version %s"
|
|
|
25 |
msgstr ""
|
26 |
|
27 |
+
#: includes/WJECF_AutoCoupon.php:14
|
28 |
msgid ""
|
29 |
+
"Allow coupons to be automatically applied to the cart when restrictions are "
|
30 |
+
"met or by url."
|
31 |
+
msgstr ""
|
32 |
+
|
33 |
+
#: includes/WJECF_AutoCoupon.php:67 includes/WJECF_AutoCoupon.php:201
|
34 |
+
#: includes/WJECF_AutoCoupon.php:208
|
35 |
+
msgid "Auto coupon"
|
36 |
+
msgstr ""
|
37 |
+
|
38 |
+
#: includes/WJECF_AutoCoupon.php:72
|
39 |
+
msgid "Individual use"
|
40 |
+
msgstr ""
|
41 |
+
|
42 |
+
#: includes/WJECF_AutoCoupon.php:90 includes/WJECF_AutoCoupon.php:173
|
43 |
+
msgid "Auto coupons"
|
44 |
+
msgstr ""
|
45 |
+
|
46 |
+
#: includes/WJECF_AutoCoupon.php:97
|
47 |
+
msgid "Allow remove 'Auto Coupons'"
|
48 |
msgstr ""
|
49 |
|
50 |
+
#: includes/WJECF_AutoCoupon.php:127
|
51 |
+
#: includes/admin/WJECF_Admin_Settings.php:190
|
52 |
+
#: includes/admin/WJECF_Admin_Settings.php:227
|
53 |
+
msgid "Enabled"
|
54 |
+
msgstr ""
|
55 |
+
|
56 |
+
#: includes/WJECF_AutoCoupon.php:132
|
57 |
+
msgid ""
|
58 |
+
"Check this box to allow the customer to remove 'Auto Coupons' from the cart."
|
59 |
+
msgstr ""
|
60 |
+
|
61 |
+
#: includes/WJECF_AutoCoupon.php:154 includes/WJECF_AutoCoupon.php:162
|
62 |
+
msgid "Yes"
|
63 |
+
msgstr ""
|
64 |
+
|
65 |
+
#: includes/WJECF_AutoCoupon.php:154 includes/WJECF_AutoCoupon.php:162
|
66 |
+
msgid "No"
|
67 |
+
msgstr ""
|
68 |
+
|
69 |
+
#: includes/WJECF_AutoCoupon.php:209
|
70 |
+
msgid ""
|
71 |
+
"Automatically add the coupon to the cart if the restrictions are met. Please "
|
72 |
+
"enter a description when you check this box, the description will be shown "
|
73 |
+
"in the customer's cart if the coupon is applied."
|
74 |
+
msgstr ""
|
75 |
+
|
76 |
+
#: includes/WJECF_AutoCoupon.php:217
|
77 |
+
msgid "Priority"
|
78 |
+
msgstr ""
|
79 |
+
|
80 |
+
#: includes/WJECF_AutoCoupon.php:218
|
81 |
+
msgid "No priority"
|
82 |
+
msgstr ""
|
83 |
+
|
84 |
+
#: includes/WJECF_AutoCoupon.php:219
|
85 |
+
msgid ""
|
86 |
+
"When 'individual use' is checked, auto coupons with a higher value will have "
|
87 |
+
"priority over other auto coupons."
|
88 |
+
msgstr ""
|
89 |
+
|
90 |
+
#: includes/WJECF_AutoCoupon.php:229
|
91 |
+
msgid "Apply silently"
|
92 |
+
msgstr ""
|
93 |
+
|
94 |
+
#: includes/WJECF_AutoCoupon.php:230
|
95 |
+
msgid "Don't display a message when this coupon is automatically applied."
|
96 |
+
msgstr ""
|
97 |
+
|
98 |
+
#: includes/WJECF_AutoCoupon.php:358
|
99 |
+
msgid "Free shipping coupon"
|
100 |
+
msgstr ""
|
101 |
+
|
102 |
+
#: includes/WJECF_AutoCoupon.php:523
|
103 |
+
#, php-format
|
104 |
+
msgid "Discount applied: %s"
|
105 |
+
msgstr ""
|
106 |
+
|
107 |
+
#: includes/WJECF_Controller.php:227
|
108 |
+
msgid ""
|
109 |
+
"WooCommerce Extended Coupon Features is disabled because WooCommerce could "
|
110 |
+
"not be detected."
|
111 |
+
msgstr ""
|
112 |
+
|
113 |
+
#: includes/WJECF_Controller.php:266
|
114 |
+
#, php-format
|
115 |
+
msgid "The minimum subtotal of the matching products for this coupon is %s."
|
116 |
+
msgstr ""
|
117 |
+
|
118 |
+
#: includes/WJECF_Controller.php:270
|
119 |
+
#, php-format
|
120 |
+
msgid "The maximum subtotal of the matching products for this coupon is %s."
|
121 |
+
msgstr ""
|
122 |
+
|
123 |
+
#: includes/WJECF_Controller.php:274
|
124 |
+
#, php-format
|
125 |
+
msgid "The minimum quantity of matching products for this coupon is %s."
|
126 |
+
msgstr ""
|
127 |
+
|
128 |
+
#: includes/WJECF_Controller.php:278
|
129 |
+
#, php-format
|
130 |
+
msgid "The maximum quantity of matching products for this coupon is %s."
|
131 |
+
msgstr ""
|
132 |
+
|
133 |
+
#: includes/WJECF_Controller.php:281
|
134 |
+
msgid "The coupon is not valid for the currently selected shipping method."
|
135 |
+
msgstr ""
|
136 |
+
|
137 |
+
#: includes/WJECF_Controller.php:284
|
138 |
+
msgid "The coupon is not valid for the currently selected payment method."
|
139 |
+
msgstr ""
|
140 |
+
|
141 |
+
#: includes/WJECF_Controller.php:287
|
142 |
+
#, php-format
|
143 |
+
msgid "Sorry, it seems the coupon \"%s\" is not yours."
|
144 |
+
msgstr ""
|
145 |
+
|
146 |
+
#: includes/WJECF_WC.php:129
|
147 |
+
msgid "Choose an option"
|
148 |
+
msgstr ""
|
149 |
+
|
150 |
+
#: includes/WJECF_WPML.php:12
|
151 |
+
msgid "Compatiblity with WPML."
|
152 |
+
msgstr ""
|
153 |
+
|
154 |
+
#: includes/admin/WJECF_Admin.php:11
|
155 |
+
msgid "Admin interface of WooCommerce Extended Coupon Features."
|
156 |
+
msgstr ""
|
157 |
+
|
158 |
+
#: includes/admin/WJECF_Admin.php:22
|
159 |
msgid ""
|
160 |
"<strong>WooCommerce Extended Coupon Features:</strong> You are using an old "
|
161 |
"version of WooCommerce. Updating of WooCommerce is recommended as using an "
|
163 |
"plugins."
|
164 |
msgstr ""
|
165 |
|
166 |
+
#: includes/admin/WJECF_Admin.php:92
|
167 |
msgid "(AND)"
|
168 |
msgstr ""
|
169 |
|
170 |
+
#: includes/admin/WJECF_Admin.php:93
|
171 |
msgid "(OR)"
|
172 |
msgstr ""
|
173 |
|
174 |
+
#: includes/admin/WJECF_Admin.php:102 includes/admin/WJECF_Admin.php:245
|
|
|
|
|
|
|
|
|
175 |
msgid "Checkout"
|
176 |
msgstr ""
|
177 |
|
178 |
+
#: includes/admin/WJECF_Admin.php:108
|
179 |
msgid "Miscellaneous"
|
180 |
msgstr ""
|
181 |
|
182 |
+
#: includes/admin/WJECF_Admin.php:144
|
183 |
msgid "Do you find WooCommerce Extended Coupon Features useful?"
|
184 |
msgstr ""
|
185 |
|
186 |
+
#: includes/admin/WJECF_Admin.php:146
|
187 |
msgid "Express your gratitude"
|
188 |
msgstr ""
|
189 |
|
190 |
+
#: includes/admin/WJECF_Admin.php:150
|
191 |
msgid "Donate to the developer"
|
192 |
msgstr ""
|
193 |
|
194 |
+
#: includes/admin/WJECF_Admin.php:157
|
195 |
msgid "Documentation"
|
196 |
msgstr ""
|
197 |
|
198 |
+
#: includes/admin/WJECF_Admin.php:159
|
199 |
msgid "WooCommerce Extended Coupon Features Documentation"
|
200 |
msgstr ""
|
201 |
|
202 |
+
#: includes/admin/WJECF_Admin.php:173
|
203 |
msgid "Matching products"
|
204 |
msgstr ""
|
205 |
|
206 |
+
#: includes/admin/WJECF_Admin.php:178
|
207 |
msgid "Products Operator"
|
208 |
msgstr ""
|
209 |
|
210 |
+
#: includes/admin/WJECF_Admin.php:179 includes/admin/WJECF_Admin.php:192
|
211 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:233
|
212 |
msgid "OR"
|
213 |
msgstr ""
|
214 |
|
215 |
+
#: includes/admin/WJECF_Admin.php:179 includes/admin/WJECF_Admin.php:192
|
216 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:233
|
217 |
msgid "AND"
|
218 |
msgstr ""
|
219 |
|
220 |
+
#: includes/admin/WJECF_Admin.php:183
|
221 |
msgid ""
|
222 |
"Use AND if ALL of the products must be in the cart to use this coupon "
|
223 |
"(instead of only one of the products)."
|
224 |
msgstr ""
|
225 |
|
226 |
+
#: includes/admin/WJECF_Admin.php:191
|
227 |
msgid "Categories Operator"
|
228 |
msgstr ""
|
229 |
|
230 |
+
#: includes/admin/WJECF_Admin.php:196
|
231 |
msgid ""
|
232 |
"Use AND if products from ALL of the categories must be in the cart to use "
|
233 |
"this coupon (instead of only one from one of the categories)."
|
234 |
msgstr ""
|
235 |
|
236 |
+
#: includes/admin/WJECF_Admin.php:205
|
237 |
msgid "Minimum quantity of matching products"
|
238 |
msgstr ""
|
239 |
|
240 |
+
#: includes/admin/WJECF_Admin.php:206 includes/admin/WJECF_Admin.php:226
|
241 |
msgid "No minimum"
|
242 |
msgstr ""
|
243 |
|
244 |
+
#: includes/admin/WJECF_Admin.php:207
|
245 |
msgid ""
|
246 |
"Minimum quantity of the products that match the given product or category "
|
247 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
248 |
"restrictions are specified, the total number of products is used."
|
249 |
msgstr ""
|
250 |
|
251 |
+
#: includes/admin/WJECF_Admin.php:215
|
252 |
msgid "Maximum quantity of matching products"
|
253 |
msgstr ""
|
254 |
|
255 |
+
#: includes/admin/WJECF_Admin.php:216 includes/admin/WJECF_Admin.php:236
|
256 |
msgid "No maximum"
|
257 |
msgstr ""
|
258 |
|
259 |
+
#: includes/admin/WJECF_Admin.php:217
|
260 |
msgid ""
|
261 |
"Maximum quantity of the products that match the given product or category "
|
262 |
"restrictions (see tab 'usage restriction'). If no product or category "
|
263 |
"restrictions are specified, the total number of products is used."
|
264 |
msgstr ""
|
265 |
|
266 |
+
#: includes/admin/WJECF_Admin.php:225
|
267 |
msgid "Minimum subtotal of matching products"
|
268 |
msgstr ""
|
269 |
|
270 |
+
#: includes/admin/WJECF_Admin.php:227
|
271 |
msgid ""
|
272 |
"Minimum price subtotal of the products that match the given product or "
|
273 |
"category restrictions (see tab 'usage restriction')."
|
274 |
msgstr ""
|
275 |
|
276 |
+
#: includes/admin/WJECF_Admin.php:235
|
277 |
msgid "Maximum subtotal of matching products"
|
278 |
msgstr ""
|
279 |
|
280 |
+
#: includes/admin/WJECF_Admin.php:237
|
281 |
msgid ""
|
282 |
"Maximum price subtotal of the products that match the given product or "
|
283 |
"category restrictions (see tab 'usage restriction')."
|
284 |
msgstr ""
|
285 |
|
286 |
+
#: includes/admin/WJECF_Admin.php:250
|
287 |
msgid "Shipping methods"
|
288 |
msgstr ""
|
289 |
|
290 |
+
#: includes/admin/WJECF_Admin.php:251
|
291 |
msgid "Any shipping method"
|
292 |
msgstr ""
|
293 |
|
294 |
+
#: includes/admin/WJECF_Admin.php:260
|
295 |
msgid ""
|
296 |
"One of these shipping methods must be selected in order for this coupon to "
|
297 |
"be valid."
|
298 |
msgstr ""
|
299 |
|
300 |
+
#: includes/admin/WJECF_Admin.php:267
|
301 |
msgid "Payment methods"
|
302 |
msgstr ""
|
303 |
|
304 |
+
#: includes/admin/WJECF_Admin.php:268
|
305 |
msgid "Any payment method"
|
306 |
msgstr ""
|
307 |
|
308 |
+
#: includes/admin/WJECF_Admin.php:279
|
309 |
msgid ""
|
310 |
"One of these payment methods must be selected in order for this coupon to be "
|
311 |
"valid."
|
312 |
msgstr ""
|
313 |
|
314 |
+
#: includes/admin/WJECF_Admin.php:288
|
315 |
msgid "Customer restrictions"
|
316 |
msgstr ""
|
317 |
|
318 |
+
#: includes/admin/WJECF_Admin.php:289
|
319 |
msgid ""
|
320 |
"If both a customer and a role restriction are supplied, matching either one "
|
321 |
"of them will suffice."
|
322 |
msgstr ""
|
323 |
|
324 |
+
#: includes/admin/WJECF_Admin.php:294
|
325 |
msgid "Allowed Customers"
|
326 |
msgstr ""
|
327 |
|
328 |
+
#: includes/admin/WJECF_Admin.php:298
|
|
|
|
|
|
|
|
|
329 |
msgid "Only these customers may use this coupon."
|
330 |
msgstr ""
|
331 |
|
332 |
+
#: includes/admin/WJECF_Admin.php:306
|
333 |
msgid "Allowed User Roles"
|
334 |
msgstr ""
|
335 |
|
336 |
+
#: includes/admin/WJECF_Admin.php:307 includes/admin/WJECF_Admin.php:329
|
337 |
msgid "Any role"
|
338 |
msgstr ""
|
339 |
|
340 |
+
#: includes/admin/WJECF_Admin.php:321
|
341 |
msgid "Only these User Roles may use this coupon."
|
342 |
msgstr ""
|
343 |
|
344 |
+
#: includes/admin/WJECF_Admin.php:328
|
345 |
msgid "Disallowed User Roles"
|
346 |
msgstr ""
|
347 |
|
348 |
+
#: includes/admin/WJECF_Admin.php:342
|
349 |
msgid "These User Roles will be specifically excluded from using this coupon."
|
350 |
msgstr ""
|
351 |
|
352 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:7
|
353 |
+
msgid ""
|
354 |
+
"Automatically update data when a new version of this plugin is installed."
|
355 |
msgstr ""
|
356 |
|
357 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:49
|
358 |
+
msgid ""
|
359 |
+
"<strong>WooCommerce Extended Coupon Features:</strong> Please note, you're "
|
360 |
+
"using an older version of this plugin, while the data was upgraded to a "
|
361 |
+
"newer version."
|
362 |
msgstr ""
|
363 |
|
364 |
+
#: includes/admin/WJECF_Admin_Data_Update.php:58
|
365 |
msgid ""
|
366 |
+
"<strong>WooCommerce Extended Coupon Features:</strong> Data succesfully "
|
367 |
+
"upgraded to the newest version."
|
|
|
368 |
msgstr ""
|
369 |
|
370 |
+
#: includes/admin/WJECF_Admin_Html.php:28
|
371 |
#, php-format
|
372 |
msgid "%s (Default)"
|
373 |
msgstr ""
|
374 |
|
375 |
+
#: includes/admin/WJECF_Admin_Html.php:42
|
376 |
+
#: includes/admin/WJECF_Admin_Html.php:90
|
377 |
msgid "Search for a product…"
|
378 |
msgstr ""
|
379 |
|
380 |
+
#: includes/admin/WJECF_Admin_Html.php:184
|
381 |
+
msgid "Any customer"
|
|
|
382 |
msgstr ""
|
383 |
|
384 |
+
#: includes/admin/WJECF_Admin_Settings.php:16
|
385 |
+
msgid "Settings page of WooCommerce Extended Coupon Features."
|
386 |
msgstr ""
|
387 |
|
388 |
+
#: includes/admin/WJECF_Admin_Settings.php:29
|
389 |
+
#: includes/admin/WJECF_Admin_Settings.php:34
|
390 |
+
msgid "WooCommerce Extended Coupon Features"
|
391 |
msgstr ""
|
392 |
|
393 |
+
#: includes/admin/WJECF_Admin_Settings.php:56
|
394 |
+
msgid "Advanced settings"
|
395 |
msgstr ""
|
396 |
|
397 |
+
#: includes/admin/WJECF_Admin_Settings.php:63
|
398 |
+
msgid "Debug mode"
|
399 |
+
msgstr ""
|
400 |
+
|
401 |
+
#: includes/admin/WJECF_Admin_Settings.php:89
|
402 |
+
msgid "Disabled plugins"
|
403 |
msgstr ""
|
404 |
|
405 |
+
#: includes/admin/WJECF_Admin_Settings.php:143
|
406 |
+
#, php-format
|
407 |
msgid ""
|
408 |
+
"When debug mode is enabled, extensive logging will be active and WJECF "
|
409 |
+
"Plugins can be enabled/disabled. If there are compatibility issues with "
|
410 |
+
"WooCommerce plugins, you can try disabling WJECF Plugins. Please don't keep "
|
411 |
+
"debug mode enabled on a production environment when it is not necessary. Log "
|
412 |
+
"can be found <a href=\"%s\">here</a>."
|
413 |
msgstr ""
|
414 |
|
415 |
+
#: includes/pro/WJECF_Pro_Controller.php:68
|
416 |
+
msgid "Discount on cart with excluded products"
|
417 |
msgstr ""
|
418 |
|
419 |
+
#: includes/pro/WJECF_Pro_Controller.php:74
|
420 |
+
msgid "Allow discount on cart with excluded items"
|
421 |
msgstr ""
|
422 |
|
423 |
+
#: includes/pro/WJECF_Pro_Controller.php:75
|
424 |
msgid ""
|
425 |
+
"Check this box to allow a 'Cart Discount' coupon to be applied even when "
|
426 |
+
"excluded items are in the cart (see tab 'usage restriction')."
|
427 |
msgstr ""
|
428 |
|
429 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:9
|
430 |
+
msgid ""
|
431 |
+
"Allow coupons that are invalid upon application to be applied to the cart "
|
432 |
+
"once they become valid."
|
433 |
msgstr ""
|
434 |
|
435 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:31
|
436 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:39
|
437 |
+
msgid "Allow applying when invalid"
|
438 |
msgstr ""
|
439 |
|
440 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:40
|
441 |
+
msgid ""
|
442 |
+
"When the customer attempts to apply the coupon while it's conditions are not "
|
443 |
+
"met, a message will be displayed. Once the conditions are met it will be "
|
444 |
+
"applied automatically."
|
|
|
|
|
445 |
msgstr ""
|
446 |
|
447 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:46
|
448 |
+
msgid "Message"
|
|
|
449 |
msgstr ""
|
450 |
|
451 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:47
|
452 |
+
msgid ""
|
453 |
+
"This message will be displayed when the customer applies a coupon while it "
|
454 |
+
"is not yet valid."
|
455 |
msgstr ""
|
456 |
|
457 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:48
|
458 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:125
|
459 |
#, php-format
|
460 |
+
msgid "Coupon '%s' will be applied when it's conditions are met."
|
461 |
msgstr ""
|
462 |
|
463 |
+
#: includes/pro/WJECF_Pro_Coupon_Queueing.php:188
|
464 |
#, php-format
|
465 |
+
msgid "Coupon '%s' applied."
|
466 |
msgstr ""
|
467 |
|
468 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products.php:12
|
469 |
+
msgid "Allow free products to be added to the cart."
|
470 |
msgstr ""
|
471 |
|
472 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:19
|
473 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:36
|
474 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:81
|
475 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:87
|
476 |
+
#: templates/cart/select-free-product.php:36
|
477 |
+
msgid "Free products"
|
478 |
msgstr ""
|
479 |
|
480 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:89
|
481 |
+
msgid ""
|
482 |
+
"Free products that will be added to the cart when this coupon is applied."
|
483 |
msgstr ""
|
484 |
|
485 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:96
|
486 |
+
msgid "Select one"
|
487 |
msgstr ""
|
488 |
|
489 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:97
|
490 |
+
msgid "Check this box if the customer must choose from the free products."
|
491 |
msgstr ""
|
492 |
|
493 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:105
|
494 |
+
msgid "'Select your gift'-message"
|
|
|
|
|
495 |
msgstr ""
|
496 |
|
497 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:106
|
498 |
+
msgid "Please choose your free gift:"
|
499 |
msgstr ""
|
500 |
|
501 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:107
|
502 |
+
msgid "This message is displayed when the customer must choose a free product."
|
|
|
|
|
503 |
msgstr ""
|
504 |
|
505 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:116
|
506 |
+
msgid "Allow multiplication of the free products"
|
507 |
msgstr ""
|
508 |
|
509 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:117
|
510 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:125
|
511 |
+
msgid "EXPERIMENTAL: "
|
512 |
msgstr ""
|
513 |
|
514 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:117
|
515 |
+
msgid ""
|
516 |
+
"The amount of free products is multiplied every time the minimum spend, "
|
517 |
+
"subtotal or quantity is reached."
|
518 |
msgstr ""
|
519 |
|
520 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:124
|
521 |
+
msgid "BOGO matching products"
|
522 |
msgstr ""
|
523 |
|
524 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Admin.php:126
|
525 |
msgid ""
|
526 |
+
"Buy one or more of any of the matching products (see 'Usage Restriction'-"
|
527 |
+
"tab) and get one free. Check 'Allow multiplication' to get one free item for "
|
528 |
+
"every matching item in the cart."
|
529 |
msgstr ""
|
530 |
|
531 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:86
|
532 |
#, php-format
|
533 |
+
msgid ""
|
534 |
+
"Sorry, we do not have enough \"%1$s\" in stock (%2$s in stock). Please "
|
535 |
+
"review your selection."
|
536 |
msgstr ""
|
537 |
|
538 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:92
|
539 |
#, php-format
|
540 |
+
msgid "Please choose a variation of \"%s\"."
|
541 |
msgstr ""
|
542 |
|
543 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:102
|
544 |
+
#: includes/pro/WJECF_Pro_Free_Products/WJECF_Pro_Free_Products_Template.php:112
|
545 |
+
msgid "Free!"
|
546 |
msgstr ""
|
547 |
|
548 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:30
|
549 |
+
msgid "Limit discount to only certain products in the cart."
|
550 |
msgstr ""
|
551 |
|
552 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:264
|
553 |
+
msgid "(default)"
|
554 |
msgstr ""
|
555 |
|
556 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:268
|
557 |
+
msgid "One item per order line"
|
558 |
msgstr ""
|
559 |
|
560 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:272
|
561 |
+
msgid "Lowest priced product (single item)"
|
562 |
msgstr ""
|
563 |
|
564 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:276
|
565 |
+
msgid "Lowest priced order line (all items)"
|
566 |
msgstr ""
|
567 |
|
568 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:280
|
569 |
+
msgid "Every nth item. n = min qty of matching products (or 2 if not supplied)"
|
570 |
msgstr ""
|
571 |
|
572 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:397
|
573 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:410
|
574 |
+
msgid "Limit discount to"
|
575 |
msgstr ""
|
576 |
|
577 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:398
|
578 |
+
msgid ""
|
579 |
+
"Here you can exclude certain products from being discounted (Only applies to "
|
580 |
+
"Cart % Discount, Product Discount, Product % Discount)"
|
581 |
msgstr ""
|
582 |
|
583 |
+
#: includes/pro/WJECF_Pro_Limit_Discount_Quantities.php:412
|
584 |
+
msgid ""
|
585 |
+
"Please note that when the discount type is 'Product discount' (see 'General'-"
|
586 |
+
"tab), the discount will only be applied to <em>matching</em> products."
|
587 |
msgstr ""
|
588 |
|
589 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:12
|
590 |
+
msgid "Advanced matching queries for products."
|
591 |
msgstr ""
|
592 |
|
593 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:232
|
594 |
+
msgid "Custom Fields Operator"
|
595 |
msgstr ""
|
596 |
|
597 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:236
|
598 |
+
msgid ""
|
599 |
+
"Use AND if all of the custom fields must be in the cart to use this coupon "
|
600 |
+
"(instead of only one of the custom fields)."
|
601 |
msgstr ""
|
602 |
|
603 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:242
|
604 |
+
msgid "Custom Fields"
|
605 |
msgstr ""
|
606 |
|
607 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:248
|
608 |
+
msgid "Name"
|
609 |
msgstr ""
|
610 |
|
611 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:249
|
612 |
+
msgid "Value"
|
613 |
msgstr ""
|
614 |
|
615 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:252
|
616 |
msgid ""
|
617 |
+
"If multiple lines are entered, only one of them needs to match. A whole word "
|
618 |
+
"case insensitive match is executed by default and % can be used as wildcard. "
|
619 |
+
"If a line starts with a forward slash (/) it is treated as a regular "
|
620 |
+
"expression. NOTE: Regular expression matches are case sensitive by default; "
|
621 |
+
"append flag i to the regular expression for a case insensitive match. \n"
|
622 |
+
"Examples:\n"
|
623 |
+
"'roc%' matches 'Rock' and also 'Rock the house', but not 'Bedrock'\n"
|
624 |
+
"'/^rock$/i' matches 'Rock' but not 'Rock the house'"
|
625 |
msgstr ""
|
626 |
|
627 |
+
#: includes/pro/WJECF_Pro_Product_Filter.php:275
|
628 |
+
msgid "— Select —"
|
629 |
msgstr ""
|
630 |
|
631 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:23
|
632 |
+
msgid "Automatically upgrade this plugin when a new version is available."
|
|
|
633 |
msgstr ""
|
634 |
|
635 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:49
|
636 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:64
|
637 |
+
msgid "Licence key"
|
|
|
638 |
msgstr ""
|
639 |
|
640 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:56
|
641 |
+
msgid "Domain"
|
642 |
+
msgstr ""
|
643 |
+
|
644 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:75
|
645 |
msgid ""
|
646 |
+
"A valid licence key will allow you to update the plugin from the WordPress "
|
647 |
+
"admin area."
|
648 |
msgstr ""
|
649 |
|
650 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:76
|
651 |
+
#, php-format
|
652 |
+
msgid "You can manage your licences at your account page at %s."
|
653 |
msgstr ""
|
654 |
|
655 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:77
|
656 |
+
msgid "This option is not available if you purchased from Envato market."
|
657 |
msgstr ""
|
658 |
|
659 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:120
|
660 |
+
msgid "The domain of your store. e.g. www.mystore.com."
|
661 |
msgstr ""
|
662 |
|
663 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:228
|
664 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:324
|
665 |
+
msgid "Licence key is not valid."
|
666 |
msgstr ""
|
667 |
|
668 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:230
|
669 |
+
#, php-format
|
670 |
+
msgid ""
|
671 |
+
"You will not receive automatic updates. Please enter a valid licence key <a "
|
672 |
+
"href=\"%s\">here</a>."
|
673 |
msgstr ""
|
674 |
|
675 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:254
|
676 |
+
#, php-format
|
677 |
+
msgid "Licence for domain %s succesfully deactivated."
|
678 |
msgstr ""
|
679 |
|
680 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:259
|
681 |
+
msgid "Failed deactivating licence. "
|
|
|
|
|
682 |
msgstr ""
|
683 |
|
684 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:263
|
685 |
+
#, php-format
|
686 |
+
msgid "Failed deactivating licence. Invalid response from server: %s"
|
687 |
msgstr ""
|
688 |
|
689 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:282
|
690 |
+
msgid "No licence key entered."
|
|
|
|
|
|
|
691 |
msgstr ""
|
692 |
|
693 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:285
|
694 |
+
msgid "No valid domain entered."
|
695 |
msgstr ""
|
696 |
|
697 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:292
|
698 |
+
#, php-format
|
699 |
+
msgid "Could not validate the licence. Invalid response from server: %s"
|
|
|
700 |
msgstr ""
|
701 |
|
702 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:305
|
703 |
+
#, php-format
|
704 |
+
msgid "Could not activate the licence. Invalid response from server: %s"
|
705 |
msgstr ""
|
706 |
|
707 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:318
|
708 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:367
|
709 |
+
msgid "Licence key is valid."
|
710 |
msgstr ""
|
711 |
|
712 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:351
|
713 |
+
msgid "Invalid licence key."
|
714 |
msgstr ""
|
715 |
|
716 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:354
|
717 |
+
msgid "Licence Key does not match this product."
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
718 |
msgstr ""
|
719 |
|
720 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:357
|
721 |
+
msgid "Licence is not active."
|
722 |
msgstr ""
|
723 |
|
724 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:360
|
725 |
+
msgid "Licence key is unassigned."
|
726 |
+
msgstr ""
|
727 |
+
|
728 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:363
|
729 |
+
msgid "Licence key not active for current domain."
|
730 |
+
msgstr ""
|
731 |
+
|
732 |
+
#: includes/pro/admin/WJECF_Pro_Admin_Auto_Update.php:435
|
733 |
+
msgid "An Unexpected HTTP Error occurred during the API request."
|
734 |
+
msgstr ""
|
735 |
+
|
736 |
+
#: templates/coupon-select-free-product.php:69
|
737 |
+
msgid "You can select one free product."
|
738 |
msgstr ""
|
readme.txt
CHANGED
@@ -2,9 +2,9 @@
|
|
2 |
Contributors: josk79
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQBCS2QHRY&lc=NL&item_name=Jos%20Koenis&item_number=wordpress%2dplugin¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
4 |
Tags: woocommerce, coupons, discount
|
5 |
-
Requires at least: 4.
|
6 |
-
Tested up to: 4.
|
7 |
-
Stable tag: 2.5.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -15,7 +15,7 @@ Additional functionality for WooCommerce Coupons: Allow discounts to be automati
|
|
15 |
"WooCommerce Extended Coupon Features" adds functionality to the WooCommerce coupons and allows for automatic discount rules.
|
16 |
Very easy to use, the functionality is conveniently integrated to the WooCommerce Edit Coupon panel.
|
17 |
|
18 |
-
Compatible with WooCommerce 3.
|
19 |
|
20 |
Full documentation is available at [www.soft79.nl](http://www.soft79.nl/documentation/wjecf).
|
21 |
|
@@ -106,9 +106,37 @@ Sure! [This](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQ
|
|
106 |
|
107 |
== Changelog ==
|
108 |
|
109 |
-
= 2.5.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
110 |
* (PRO) FEATURE: Free product selection using checkboxes / numeric inputs
|
111 |
* (PRO) FIX: Free product selection fails if coupon code contains a space
|
|
|
|
|
|
|
|
|
112 |
* FIX: Draft settings not being saved
|
113 |
* FIX: PHP < 5.5 compatibility
|
114 |
* FIX: Abstract_WJECF_Plugin log function
|
2 |
Contributors: josk79
|
3 |
Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=5T9XQBCS2QHRY&lc=NL&item_name=Jos%20Koenis&item_number=wordpress%2dplugin¤cy_code=EUR&bn=PP%2dDonationsBF%3abtn_donateCC_LG%2egif%3aNonHosted
|
4 |
Tags: woocommerce, coupons, discount
|
5 |
+
Requires at least: 4.6
|
6 |
+
Tested up to: 4.8.2
|
7 |
+
Stable tag: 2.5.4
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
15 |
"WooCommerce Extended Coupon Features" adds functionality to the WooCommerce coupons and allows for automatic discount rules.
|
16 |
Very easy to use, the functionality is conveniently integrated to the WooCommerce Edit Coupon panel.
|
17 |
|
18 |
+
Compatible with WooCommerce 3.2.0. Backwards compatible with older WooCommerce versions (2.6.0 confirmed).
|
19 |
|
20 |
Full documentation is available at [www.soft79.nl](http://www.soft79.nl/documentation/wjecf).
|
21 |
|
106 |
|
107 |
== Changelog ==
|
108 |
|
109 |
+
= 2.5.4 =
|
110 |
+
* TWEAK: Get coupon description using WC_Coupon::get_description() to respect applicable filters (for example used by Polylang)
|
111 |
+
* (PRO) FEATURE: Allow customer to remove 'Auto Coupons' from the cart (see settings page)
|
112 |
+
* (PRO) FEATURE: Filter 'wjecf_get_limit_to_options' to allow adding custom 'Limit to'-options
|
113 |
+
* (PRO) PERFORMANCE: Free products: Only load js and css when required
|
114 |
+
* (PRO) FIX: Free products: "update cart"-button not automatically enabled after selecting a free product (in combination with certain themes (e.g. Flatsome)
|
115 |
+
* (PRO) FIX: Free products: Prevent certain plugins from parsing attribute fields containing [products] as shortcode
|
116 |
+
* (PRO) FIX: Limit discount to cheapest item failed in WC3.0 in combination with a percent discount
|
117 |
+
* (PRO) FIX: Custom fields: Accept WC3.0 core fields (e.g. _price)
|
118 |
+
* (PRO) FIX: PHP Warnings in WJECF_Pro_Admin_Auto_Update
|
119 |
+
|
120 |
+
= 2.5.3 =
|
121 |
+
* (PRO) FIX: Free products: Free product selection always visible on checkout-page
|
122 |
+
* (PRO) FIX: Free products: JS error when using IE / Safari
|
123 |
+
* (PRO) FIX: Free products: Cart contents was not updated when applying a coupon
|
124 |
+
* (PRO) FIX: Free products: wjecf_free_product_amount_for_coupon not called for $max_quantity variable in the template
|
125 |
+
|
126 |
+
= 2.5.2.2 =
|
127 |
+
* (PRO) FIX: Documentation url
|
128 |
+
* (PRO) FIX: Forgot to raise version number, causing a permanent 'An update is available'
|
129 |
+
|
130 |
+
= 2.5.2.1 =
|
131 |
+
* (PRO) FIX: Duplicate products at free product selection
|
132 |
+
|
133 |
+
= 2.5.2 =
|
134 |
* (PRO) FEATURE: Free product selection using checkboxes / numeric inputs
|
135 |
* (PRO) FIX: Free product selection fails if coupon code contains a space
|
136 |
+
* (PRO) FIX: CSS for column system used by the free product selection
|
137 |
+
* DOCUMENTATION: Added the API part to the documentation (work in progress)
|
138 |
+
|
139 |
+
= 2.5.1 =
|
140 |
* FIX: Draft settings not being saved
|
141 |
* FIX: PHP < 5.5 compatibility
|
142 |
* FIX: Abstract_WJECF_Plugin log function
|
woocommerce-jos-autocoupon.php
CHANGED
@@ -3,12 +3,12 @@
|
|
3 |
* Plugin Name: WooCommerce Extended Coupon Features
|
4 |
* Plugin URI: http://www.soft79.nl
|
5 |
* Description: Additional functionality for WooCommerce Coupons: Apply certain coupons automatically, allow applying coupons via an url, etc...
|
6 |
-
* Version: 2.5.
|
7 |
* Author: Soft79
|
8 |
* License: GPL2
|
9 |
*/
|
10 |
|
11 |
-
if ( ! defined('WJECF_VERSION') ) define ('WJECF_VERSION', '2.5.
|
12 |
|
13 |
// Changelog: see readme.txt
|
14 |
|
3 |
* Plugin Name: WooCommerce Extended Coupon Features
|
4 |
* Plugin URI: http://www.soft79.nl
|
5 |
* Description: Additional functionality for WooCommerce Coupons: Apply certain coupons automatically, allow applying coupons via an url, etc...
|
6 |
+
* Version: 2.5.4
|
7 |
* Author: Soft79
|
8 |
* License: GPL2
|
9 |
*/
|
10 |
|
11 |
+
if ( ! defined('WJECF_VERSION') ) define ('WJECF_VERSION', '2.5.4');
|
12 |
|
13 |
// Changelog: see readme.txt
|
14 |
|