Version Description
Added - Article type
Added compatibility with WooThemes Plugins and themes
Added - New Media Manager for uploading images in metabox
Download this release
Release Info
Developer | brainstormforce |
Plugin | All In One Schema Rich Snippets |
Version | 1.1.1 |
Comparing to | |
See all releases |
Code changes from version 1.1.0 to 1.1.1
- admin/css/admin.css +9 -8
- admin/css/style.css +201 -682
- admin/images/sidebar.jpg +0 -0
- admin/index.php +68 -70
- admin/js/jquery.easytabs.min.js +14 -12
- admin/js/jquery.hashchange.min.js +10 -8
- css/jquery.rating.css +0 -19
- css/rating.css +0 -13
- css/star@2x.png +0 -0
- css/style.css +3 -5
- functions.php +58 -372
- images/1star@2x.png +0 -0
- images/gray@2x.png +0 -0
- images/gray@4x.png +0 -0
- index.php +24 -6
- init.php +0 -528
- js/cmb.js +130 -200
- js/cp-script.min.js +144 -0
- js/jquery.js +8082 -9597
- js/media.js +26 -0
- js/retina.js +2 -2
- js/toggle.js +107 -99
- meta-boxes.php +610 -576
- readme.txt +1 -29
- settings.php +123 -111
admin/css/admin.css
CHANGED
@@ -1,9 +1,10 @@
|
|
1 |
-
|
2 |
-
.
|
3 |
-
.tab
|
4 |
-
.tab a
|
5 |
-
.tab
|
6 |
-
.tab
|
7 |
-
.tab.active
|
8 |
-
.tab
|
|
|
9 |
.panel-container { margin-bottom: 10px; border-top:1px solid #999; padding: 10px; margin-top: -6px;}
|
1 |
+
html{ display:block !important;}
|
2 |
+
.etabs { margin: 0; padding: 0; }
|
3 |
+
.tab { display: inline-block; zoom:1; *display:inline; background: #fff; border: solid 1px #999; border-bottom: none; -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; font-weight:bold; }
|
4 |
+
.tab a { font-size: 14px; line-height: 2em; display: block; padding: 0 10px; outline: none; text-decoration:none; color:rgb(175, 175, 175); }
|
5 |
+
.tab a:hover { text-decoration: none; color:#C00; }
|
6 |
+
.tab.active { background: #fff; padding-top: 6px; position: relative; top: 1px; border-color: #666; }
|
7 |
+
.tab a.active { font-weight: bold; text-decoration:none; color:#333; }
|
8 |
+
.tab.active a:hover { text-decoration: none; color:#C00; }
|
9 |
+
.tab-container { background: #fff; padding: 10px; -moz-border-radius: 0 4px 4px 4px; -webkit-border-radius: 0 4px 4px 4px; }
|
10 |
.panel-container { margin-bottom: 10px; border-top:1px solid #999; padding: 10px; margin-top: -6px;}
|
admin/css/style.css
CHANGED
@@ -1,683 +1,202 @@
|
|
1 |
-
/**
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
table.bsf_metabox
|
10 |
-
|
11 |
-
table.bsf_metabox
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
table.bsf_metabox
|
18 |
-
|
19 |
-
table.bsf_metabox
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
table.bsf_metabox input
|
26 |
-
|
27 |
-
table.bsf_metabox
|
28 |
-
|
29 |
-
table.bsf_metabox
|
30 |
-
|
31 |
-
table.bsf_metabox
|
32 |
-
|
33 |
-
table.bsf_metabox
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
table.bsf_metabox
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
.
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
.
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
.bsf_element .ui-
|
126 |
-
|
127 |
-
.bsf_element .ui-
|
128 |
-
|
129 |
-
.bsf_element .ui-
|
130 |
-
|
131 |
-
.bsf_element .ui-
|
132 |
-
|
133 |
-
.bsf_element .ui-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
.bsf_element .ui-
|
138 |
-
|
139 |
-
.bsf_element .ui-
|
140 |
-
|
141 |
-
.bsf_element .ui-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
.bsf_element .ui-state-highlight .ui-icon {background-image: url(images/ui-icons_2e83ff_256x240.png); }
|
204 |
-
|
205 |
-
.bsf_element .ui-state-error .ui-icon, .bsf_element .ui-state-error-text .ui-icon {background-image: url(images/ui-icons_cd0a0a_256x240.png); }
|
206 |
-
|
207 |
-
.bsf_element .ui-icon-carat-1-n { background-position: 0 0; }
|
208 |
-
|
209 |
-
.bsf_element .ui-icon-carat-1-ne { background-position: -16px 0; }
|
210 |
-
|
211 |
-
.bsf_element .ui-icon-carat-1-e { background-position: -32px 0; }
|
212 |
-
|
213 |
-
.bsf_element .ui-icon-carat-1-se { background-position: -48px 0; }
|
214 |
-
|
215 |
-
.bsf_element .ui-icon-carat-1-s { background-position: -64px 0; }
|
216 |
-
|
217 |
-
.bsf_element .ui-icon-carat-1-sw { background-position: -80px 0; }
|
218 |
-
|
219 |
-
.bsf_element .ui-icon-carat-1-w { background-position: -96px 0; }
|
220 |
-
|
221 |
-
.bsf_element .ui-icon-carat-1-nw { background-position: -112px 0; }
|
222 |
-
|
223 |
-
.bsf_element .ui-icon-carat-2-n-s { background-position: -128px 0; }
|
224 |
-
|
225 |
-
.bsf_element .ui-icon-carat-2-e-w { background-position: -144px 0; }
|
226 |
-
|
227 |
-
.bsf_element .ui-icon-triangle-1-n { background-position: 0 -16px; }
|
228 |
-
|
229 |
-
.bsf_element .ui-icon-triangle-1-ne { background-position: -16px -16px; }
|
230 |
-
|
231 |
-
.bsf_element .ui-icon-triangle-1-e { background-position: -32px -16px; }
|
232 |
-
|
233 |
-
.bsf_element .ui-icon-triangle-1-se { background-position: -48px -16px; }
|
234 |
-
|
235 |
-
.bsf_element .ui-icon-triangle-1-s { background-position: -64px -16px; }
|
236 |
-
|
237 |
-
.bsf_element .ui-icon-triangle-1-sw { background-position: -80px -16px; }
|
238 |
-
|
239 |
-
.bsf_element .ui-icon-triangle-1-w { background-position: -96px -16px; }
|
240 |
-
|
241 |
-
.bsf_element .ui-icon-triangle-1-nw { background-position: -112px -16px; }
|
242 |
-
|
243 |
-
.bsf_element .ui-icon-triangle-2-n-s { background-position: -128px -16px; }
|
244 |
-
|
245 |
-
.bsf_element .ui-icon-triangle-2-e-w { background-position: -144px -16px; }
|
246 |
-
|
247 |
-
.bsf_element .ui-icon-arrow-1-n { background-position: 0 -32px; }
|
248 |
-
|
249 |
-
.bsf_element .ui-icon-arrow-1-ne { background-position: -16px -32px; }
|
250 |
-
|
251 |
-
.bsf_element .ui-icon-arrow-1-e { background-position: -32px -32px; }
|
252 |
-
|
253 |
-
.bsf_element .ui-icon-arrow-1-se { background-position: -48px -32px; }
|
254 |
-
|
255 |
-
.bsf_element .ui-icon-arrow-1-s { background-position: -64px -32px; }
|
256 |
-
|
257 |
-
.bsf_element .ui-icon-arrow-1-sw { background-position: -80px -32px; }
|
258 |
-
|
259 |
-
.bsf_element .ui-icon-arrow-1-w { background-position: -96px -32px; }
|
260 |
-
|
261 |
-
.bsf_element .ui-icon-arrow-1-nw { background-position: -112px -32px; }
|
262 |
-
|
263 |
-
.bsf_element .ui-icon-arrow-2-n-s { background-position: -128px -32px; }
|
264 |
-
|
265 |
-
.bsf_element .ui-icon-arrow-2-ne-sw { background-position: -144px -32px; }
|
266 |
-
|
267 |
-
.bsf_element .ui-icon-arrow-2-e-w { background-position: -160px -32px; }
|
268 |
-
|
269 |
-
.bsf_element .ui-icon-arrow-2-se-nw { background-position: -176px -32px; }
|
270 |
-
|
271 |
-
.bsf_element .ui-icon-arrowstop-1-n { background-position: -192px -32px; }
|
272 |
-
|
273 |
-
.bsf_element .ui-icon-arrowstop-1-e { background-position: -208px -32px; }
|
274 |
-
|
275 |
-
.bsf_element .ui-icon-arrowstop-1-s { background-position: -224px -32px; }
|
276 |
-
|
277 |
-
.bsf_element .ui-icon-arrowstop-1-w { background-position: -240px -32px; }
|
278 |
-
|
279 |
-
.bsf_element .ui-icon-arrowthick-1-n { background-position: 0 -48px; }
|
280 |
-
|
281 |
-
.bsf_element .ui-icon-arrowthick-1-ne { background-position: -16px -48px; }
|
282 |
-
|
283 |
-
.bsf_element .ui-icon-arrowthick-1-e { background-position: -32px -48px; }
|
284 |
-
|
285 |
-
.bsf_element .ui-icon-arrowthick-1-se { background-position: -48px -48px; }
|
286 |
-
|
287 |
-
.bsf_element .ui-icon-arrowthick-1-s { background-position: -64px -48px; }
|
288 |
-
|
289 |
-
.bsf_element .ui-icon-arrowthick-1-sw { background-position: -80px -48px; }
|
290 |
-
|
291 |
-
.bsf_element .ui-icon-arrowthick-1-w { background-position: -96px -48px; }
|
292 |
-
|
293 |
-
.bsf_element .ui-icon-arrowthick-1-nw { background-position: -112px -48px; }
|
294 |
-
|
295 |
-
.bsf_element .ui-icon-arrowthick-2-n-s { background-position: -128px -48px; }
|
296 |
-
|
297 |
-
.bsf_element .ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; }
|
298 |
-
|
299 |
-
.bsf_element .ui-icon-arrowthick-2-e-w { background-position: -160px -48px; }
|
300 |
-
|
301 |
-
.bsf_element .ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; }
|
302 |
-
|
303 |
-
.bsf_element .ui-icon-arrowthickstop-1-n { background-position: -192px -48px; }
|
304 |
-
|
305 |
-
.bsf_element .ui-icon-arrowthickstop-1-e { background-position: -208px -48px; }
|
306 |
-
|
307 |
-
.bsf_element .ui-icon-arrowthickstop-1-s { background-position: -224px -48px; }
|
308 |
-
|
309 |
-
.bsf_element .ui-icon-arrowthickstop-1-w { background-position: -240px -48px; }
|
310 |
-
|
311 |
-
.bsf_element .ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; }
|
312 |
-
|
313 |
-
.bsf_element .ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; }
|
314 |
-
|
315 |
-
.bsf_element .ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; }
|
316 |
-
|
317 |
-
.bsf_element .ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; }
|
318 |
-
|
319 |
-
.bsf_element .ui-icon-arrowreturn-1-w { background-position: -64px -64px; }
|
320 |
-
|
321 |
-
.bsf_element .ui-icon-arrowreturn-1-n { background-position: -80px -64px; }
|
322 |
-
|
323 |
-
.bsf_element .ui-icon-arrowreturn-1-e { background-position: -96px -64px; }
|
324 |
-
|
325 |
-
.bsf_element .ui-icon-arrowreturn-1-s { background-position: -112px -64px; }
|
326 |
-
|
327 |
-
.bsf_element .ui-icon-arrowrefresh-1-w { background-position: -128px -64px; }
|
328 |
-
|
329 |
-
.bsf_element .ui-icon-arrowrefresh-1-n { background-position: -144px -64px; }
|
330 |
-
|
331 |
-
.bsf_element .ui-icon-arrowrefresh-1-e { background-position: -160px -64px; }
|
332 |
-
|
333 |
-
.bsf_element .ui-icon-arrowrefresh-1-s { background-position: -176px -64px; }
|
334 |
-
|
335 |
-
.bsf_element .ui-icon-arrow-4 { background-position: 0 -80px; }
|
336 |
-
|
337 |
-
.bsf_element .ui-icon-arrow-4-diag { background-position: -16px -80px; }
|
338 |
-
|
339 |
-
.bsf_element .ui-icon-extlink { background-position: -32px -80px; }
|
340 |
-
|
341 |
-
.bsf_element .ui-icon-newwin { background-position: -48px -80px; }
|
342 |
-
|
343 |
-
.bsf_element .ui-icon-refresh { background-position: -64px -80px; }
|
344 |
-
|
345 |
-
.bsf_element .ui-icon-shuffle { background-position: -80px -80px; }
|
346 |
-
|
347 |
-
.bsf_element .ui-icon-transfer-e-w { background-position: -96px -80px; }
|
348 |
-
|
349 |
-
.bsf_element .ui-icon-transferthick-e-w { background-position: -112px -80px; }
|
350 |
-
|
351 |
-
.bsf_element .ui-icon-folder-collapsed { background-position: 0 -96px; }
|
352 |
-
|
353 |
-
.bsf_element .ui-icon-folder-open { background-position: -16px -96px; }
|
354 |
-
|
355 |
-
.bsf_element .ui-icon-document { background-position: -32px -96px; }
|
356 |
-
|
357 |
-
.bsf_element .ui-icon-document-b { background-position: -48px -96px; }
|
358 |
-
|
359 |
-
.bsf_element .ui-icon-note { background-position: -64px -96px; }
|
360 |
-
|
361 |
-
.bsf_element .ui-icon-mail-closed { background-position: -80px -96px; }
|
362 |
-
|
363 |
-
.bsf_element .ui-icon-mail-open { background-position: -96px -96px; }
|
364 |
-
|
365 |
-
.bsf_element .ui-icon-suitcase { background-position: -112px -96px; }
|
366 |
-
|
367 |
-
.bsf_element .ui-icon-comment { background-position: -128px -96px; }
|
368 |
-
|
369 |
-
.bsf_element .ui-icon-person { background-position: -144px -96px; }
|
370 |
-
|
371 |
-
.bsf_element .ui-icon-print { background-position: -160px -96px; }
|
372 |
-
|
373 |
-
.bsf_element .ui-icon-trash { background-position: -176px -96px; }
|
374 |
-
|
375 |
-
.bsf_element .ui-icon-locked { background-position: -192px -96px; }
|
376 |
-
|
377 |
-
.bsf_element .ui-icon-unlocked { background-position: -208px -96px; }
|
378 |
-
|
379 |
-
.bsf_element .ui-icon-bookmark { background-position: -224px -96px; }
|
380 |
-
|
381 |
-
.bsf_element .ui-icon-tag { background-position: -240px -96px; }
|
382 |
-
|
383 |
-
.bsf_element .ui-icon-home { background-position: 0 -112px; }
|
384 |
-
|
385 |
-
.bsf_element .ui-icon-flag { background-position: -16px -112px; }
|
386 |
-
|
387 |
-
.bsf_element .ui-icon-calendar { background-position: -32px -112px; }
|
388 |
-
|
389 |
-
.bsf_element .ui-icon-cart { background-position: -48px -112px; }
|
390 |
-
|
391 |
-
.bsf_element .ui-icon-pencil { background-position: -64px -112px; }
|
392 |
-
|
393 |
-
.bsf_element .ui-icon-clock { background-position: -80px -112px; }
|
394 |
-
|
395 |
-
.bsf_element .ui-icon-disk { background-position: -96px -112px; }
|
396 |
-
|
397 |
-
.bsf_element .ui-icon-calculator { background-position: -112px -112px; }
|
398 |
-
|
399 |
-
.bsf_element .ui-icon-zoomin { background-position: -128px -112px; }
|
400 |
-
|
401 |
-
.bsf_element .ui-icon-zoomout { background-position: -144px -112px; }
|
402 |
-
|
403 |
-
.bsf_element .ui-icon-search { background-position: -160px -112px; }
|
404 |
-
|
405 |
-
.bsf_element .ui-icon-wrench { background-position: -176px -112px; }
|
406 |
-
|
407 |
-
.bsf_element .ui-icon-gear { background-position: -192px -112px; }
|
408 |
-
|
409 |
-
.bsf_element .ui-icon-heart { background-position: -208px -112px; }
|
410 |
-
|
411 |
-
.bsf_element .ui-icon-star { background-position: -224px -112px; }
|
412 |
-
|
413 |
-
.bsf_element .ui-icon-link { background-position: -240px -112px; }
|
414 |
-
|
415 |
-
.bsf_element .ui-icon-cancel { background-position: 0 -128px; }
|
416 |
-
|
417 |
-
.bsf_element .ui-icon-plus { background-position: -16px -128px; }
|
418 |
-
|
419 |
-
.bsf_element .ui-icon-plusthick { background-position: -32px -128px; }
|
420 |
-
|
421 |
-
.bsf_element .ui-icon-minus { background-position: -48px -128px; }
|
422 |
-
|
423 |
-
.bsf_element .ui-icon-minusthick { background-position: -64px -128px; }
|
424 |
-
|
425 |
-
.bsf_element .ui-icon-close { background-position: -80px -128px; }
|
426 |
-
|
427 |
-
.bsf_element .ui-icon-closethick { background-position: -96px -128px; }
|
428 |
-
|
429 |
-
.bsf_element .ui-icon-key { background-position: -112px -128px; }
|
430 |
-
|
431 |
-
.bsf_element .ui-icon-lightbulb { background-position: -128px -128px; }
|
432 |
-
|
433 |
-
.bsf_element .ui-icon-scissors { background-position: -144px -128px; }
|
434 |
-
|
435 |
-
.bsf_element .ui-icon-clipboard { background-position: -160px -128px; }
|
436 |
-
|
437 |
-
.bsf_element .ui-icon-copy { background-position: -176px -128px; }
|
438 |
-
|
439 |
-
.bsf_element .ui-icon-contact { background-position: -192px -128px; }
|
440 |
-
|
441 |
-
.bsf_element .ui-icon-image { background-position: -208px -128px; }
|
442 |
-
|
443 |
-
.bsf_element .ui-icon-video { background-position: -224px -128px; }
|
444 |
-
|
445 |
-
.bsf_element .ui-icon-script { background-position: -240px -128px; }
|
446 |
-
|
447 |
-
.bsf_element .ui-icon-alert { background-position: 0 -144px; }
|
448 |
-
|
449 |
-
.bsf_element .ui-icon-info { background-position: -16px -144px; }
|
450 |
-
|
451 |
-
.bsf_element .ui-icon-notice { background-position: -32px -144px; }
|
452 |
-
|
453 |
-
.bsf_element .ui-icon-help { background-position: -48px -144px; }
|
454 |
-
|
455 |
-
.bsf_element .ui-icon-check { background-position: -64px -144px; }
|
456 |
-
|
457 |
-
.bsf_element .ui-icon-bullet { background-position: -80px -144px; }
|
458 |
-
|
459 |
-
.bsf_element .ui-icon-radio-off { background-position: -96px -144px; }
|
460 |
-
|
461 |
-
.bsf_element .ui-icon-radio-on { background-position: -112px -144px; }
|
462 |
-
|
463 |
-
.bsf_element .ui-icon-pin-w { background-position: -128px -144px; }
|
464 |
-
|
465 |
-
.bsf_element .ui-icon-pin-s { background-position: -144px -144px; }
|
466 |
-
|
467 |
-
.bsf_element .ui-icon-play { background-position: 0 -160px; }
|
468 |
-
|
469 |
-
.bsf_element .ui-icon-pause { background-position: -16px -160px; }
|
470 |
-
|
471 |
-
.bsf_element .ui-icon-seek-next { background-position: -32px -160px; }
|
472 |
-
|
473 |
-
.bsf_element .ui-icon-seek-prev { background-position: -48px -160px; }
|
474 |
-
|
475 |
-
.bsf_element .ui-icon-seek-end { background-position: -64px -160px; }
|
476 |
-
|
477 |
-
.bsf_element .ui-icon-seek-start { background-position: -80px -160px; }
|
478 |
-
|
479 |
-
.bsf_element .ui-icon-seek-first { background-position: -80px -160px; }
|
480 |
-
|
481 |
-
.bsf_element .ui-icon-stop { background-position: -96px -160px; }
|
482 |
-
|
483 |
-
.bsf_element .ui-icon-eject { background-position: -112px -160px; }
|
484 |
-
|
485 |
-
.bsf_element .ui-icon-volume-off { background-position: -128px -160px; }
|
486 |
-
|
487 |
-
.bsf_element .ui-icon-volume-on { background-position: -144px -160px; }
|
488 |
-
|
489 |
-
.bsf_element .ui-icon-power { background-position: 0 -176px; }
|
490 |
-
|
491 |
-
.bsf_element .ui-icon-signal-diag { background-position: -16px -176px; }
|
492 |
-
|
493 |
-
.bsf_element .ui-icon-signal { background-position: -32px -176px; }
|
494 |
-
|
495 |
-
.bsf_element .ui-icon-battery-0 { background-position: -48px -176px; }
|
496 |
-
|
497 |
-
.bsf_element .ui-icon-battery-1 { background-position: -64px -176px; }
|
498 |
-
|
499 |
-
.bsf_element .ui-icon-battery-2 { background-position: -80px -176px; }
|
500 |
-
|
501 |
-
.bsf_element .ui-icon-battery-3 { background-position: -96px -176px; }
|
502 |
-
|
503 |
-
.bsf_element .ui-icon-circle-plus { background-position: 0 -192px; }
|
504 |
-
|
505 |
-
.bsf_element .ui-icon-circle-minus { background-position: -16px -192px; }
|
506 |
-
|
507 |
-
.bsf_element .ui-icon-circle-close { background-position: -32px -192px; }
|
508 |
-
|
509 |
-
.bsf_element .ui-icon-circle-triangle-e { background-position: -48px -192px; }
|
510 |
-
|
511 |
-
.bsf_element .ui-icon-circle-triangle-s { background-position: -64px -192px; }
|
512 |
-
|
513 |
-
.bsf_element .ui-icon-circle-triangle-w { background-position: -80px -192px; }
|
514 |
-
|
515 |
-
.bsf_element .ui-icon-circle-triangle-n { background-position: -96px -192px; }
|
516 |
-
|
517 |
-
.bsf_element .ui-icon-circle-arrow-e { background-position: -112px -192px; }
|
518 |
-
|
519 |
-
.bsf_element .ui-icon-circle-arrow-s { background-position: -128px -192px; }
|
520 |
-
|
521 |
-
.bsf_element .ui-icon-circle-arrow-w { background-position: -144px -192px; }
|
522 |
-
|
523 |
-
.bsf_element .ui-icon-circle-arrow-n { background-position: -160px -192px; }
|
524 |
-
|
525 |
-
.bsf_element .ui-icon-circle-zoomin { background-position: -176px -192px; }
|
526 |
-
|
527 |
-
.bsf_element .ui-icon-circle-zoomout { background-position: -192px -192px; }
|
528 |
-
|
529 |
-
.bsf_element .ui-icon-circle-check { background-position: -208px -192px; }
|
530 |
-
|
531 |
-
.bsf_element .ui-icon-circlesmall-plus { background-position: 0 -208px; }
|
532 |
-
|
533 |
-
.bsf_element .ui-icon-circlesmall-minus { background-position: -16px -208px; }
|
534 |
-
|
535 |
-
.bsf_element .ui-icon-circlesmall-close { background-position: -32px -208px; }
|
536 |
-
|
537 |
-
.bsf_element .ui-icon-squaresmall-plus { background-position: -48px -208px; }
|
538 |
-
|
539 |
-
.bsf_element .ui-icon-squaresmall-minus { background-position: -64px -208px; }
|
540 |
-
|
541 |
-
.bsf_element .ui-icon-squaresmall-close { background-position: -80px -208px; }
|
542 |
-
|
543 |
-
.bsf_element .ui-icon-grip-dotted-vertical { background-position: 0 -224px; }
|
544 |
-
|
545 |
-
.bsf_element .ui-icon-grip-dotted-horizontal { background-position: -16px -224px; }
|
546 |
-
|
547 |
-
.bsf_element .ui-icon-grip-solid-vertical { background-position: -32px -224px; }
|
548 |
-
|
549 |
-
.bsf_element .ui-icon-grip-solid-horizontal { background-position: -48px -224px; }
|
550 |
-
|
551 |
-
.bsf_element .ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; }
|
552 |
-
|
553 |
-
.bsf_element .ui-icon-grip-diagonal-se { background-position: -80px -224px; }
|
554 |
-
|
555 |
-
.bsf_element .ui-corner-all, .bsf_element .ui-corner-top, .bsf_element .ui-corner-left, .bsf_element .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
556 |
-
|
557 |
-
.bsf_element .ui-corner-all, .bsf_element .ui-corner-top, .bsf_element .ui-corner-right, .bsf_element .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
558 |
-
|
559 |
-
.bsf_element .ui-corner-all, .bsf_element .ui-corner-bottom, .bsf_element .ui-corner-left, .bsf_element .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
560 |
-
|
561 |
-
.bsf_element .ui-corner-all, .bsf_element .ui-corner-bottom, .bsf_element .ui-corner-right, .bsf_element .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
562 |
-
|
563 |
-
.bsf_element .ui-widget-overlay { background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
|
564 |
-
|
565 |
-
.bsf_element .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
|
566 |
-
|
567 |
-
.bsf_element .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
568 |
-
|
569 |
-
.bsf_element .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
570 |
-
|
571 |
-
.bsf_element .ui-datepicker .ui-datepicker-prev, .bsf_element .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
572 |
-
|
573 |
-
.bsf_element .ui-datepicker .ui-datepicker-prev-hover, .bsf_element .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
574 |
-
|
575 |
-
.bsf_element .ui-datepicker .ui-datepicker-prev { left:2px; }
|
576 |
-
|
577 |
-
.bsf_element .ui-datepicker .ui-datepicker-next { right:2px; }
|
578 |
-
|
579 |
-
.bsf_element .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
580 |
-
|
581 |
-
.bsf_element .ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
582 |
-
|
583 |
-
.bsf_element .ui-datepicker .ui-datepicker-prev span, .bsf_element .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
584 |
-
|
585 |
-
.bsf_element .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
586 |
-
|
587 |
-
.bsf_element .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
588 |
-
|
589 |
-
.bsf_element .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
590 |
-
|
591 |
-
.bsf_element .ui-datepicker select.ui-datepicker-month,
|
592 |
-
|
593 |
-
.bsf_element .ui-datepicker select.ui-datepicker-year { width: 49%;}
|
594 |
-
|
595 |
-
.bsf_element .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
596 |
-
|
597 |
-
.bsf_element .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
598 |
-
|
599 |
-
.bsf_element .ui-datepicker td { border: 0; padding: 1px; }
|
600 |
-
|
601 |
-
.bsf_element .ui-datepicker td span, .bsf_element .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
602 |
-
|
603 |
-
.bsf_element .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
604 |
-
|
605 |
-
.bsf_element .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
606 |
-
|
607 |
-
.bsf_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
608 |
-
|
609 |
-
.bsf_element .ui-datepicker.ui-datepicker-multi { width:auto; }
|
610 |
-
|
611 |
-
.bsf_element .ui-datepicker-multi .ui-datepicker-group { float:left; }
|
612 |
-
|
613 |
-
.bsf_element .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
614 |
-
|
615 |
-
.bsf_element .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
616 |
-
|
617 |
-
.bsf_element .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
618 |
-
|
619 |
-
.bsf_element .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
620 |
-
|
621 |
-
.bsf_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
622 |
-
|
623 |
-
.bsf_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
624 |
-
|
625 |
-
.bsf_element .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
626 |
-
|
627 |
-
.bsf_element .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
628 |
-
|
629 |
-
.bsf_element .ui-datepicker-rtl { direction: rtl; }
|
630 |
-
|
631 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
632 |
-
|
633 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
634 |
-
|
635 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
636 |
-
|
637 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
638 |
-
|
639 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
640 |
-
|
641 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
642 |
-
|
643 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
644 |
-
|
645 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
646 |
-
|
647 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
648 |
-
|
649 |
-
.bsf_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
650 |
-
|
651 |
-
.bsf_element .ui-datepicker-cover {
|
652 |
-
|
653 |
-
display: none; /*sorry for IE5*/
|
654 |
-
|
655 |
-
display/**/: block; /*sorry for IE5*/
|
656 |
-
|
657 |
-
position: absolute; /*must have*/
|
658 |
-
|
659 |
-
z-index: -1; /*must have*/
|
660 |
-
|
661 |
-
filter: mask(); /*must have*/
|
662 |
-
|
663 |
-
top: -4px; /*must have*/
|
664 |
-
|
665 |
-
left: -4px; /*must have*/
|
666 |
-
|
667 |
-
width: 200px; /*must have*/
|
668 |
-
|
669 |
-
height: 200px; /*must have*/
|
670 |
-
|
671 |
-
}
|
672 |
-
.required {
|
673 |
-
color: #F00;
|
674 |
-
font-size: 11px;
|
675 |
-
margin-left: -12px;
|
676 |
-
}
|
677 |
-
.select_full {
|
678 |
-
width: 94%;
|
679 |
-
}
|
680 |
-
.bsf_textarea_small {
|
681 |
-
width: 94%;
|
682 |
-
height: 110px;
|
683 |
}
|
1 |
+
/**
|
2 |
+
* Metabox Styling
|
3 |
+
*/
|
4 |
+
table.bsf_metabox td, table.bsf_metabox th { border-bottom: 0px solid #E9E9E9; padding-top:5px; padding-right: 12px;}
|
5 |
+
table.bsf_metabox th { text-align: right; font-weight:bold;}
|
6 |
+
table.bsf_metabox th label { margin-top:5px; display:block;}
|
7 |
+
p.bsf_metabox_description { color: #AAA; font-style: italic; margin: 2px 0 !important;}
|
8 |
+
span.bsf_metabox_description { color: #AAA; font-style: italic;}
|
9 |
+
table.bsf_metabox input, table.bsf_metabox textarea { font-size:12px; padding: 5px; }
|
10 |
+
table.bsf_metabox input[type=text], table.bsf_metabox textarea { width: 97%; }
|
11 |
+
table.bsf_metabox textarea.bsf_textarea_code { font-family: Consolas,Monaco,monospace; line-height: 16px; }
|
12 |
+
table.bsf_metabox input.bsf_text_small { width: 100px; margin-right: 15px;}
|
13 |
+
table.bsf_metabox input.bsf_timepicker { width: 100px; margin-right: 15px;}
|
14 |
+
table.bsf_metabox input.bsf_text_money { width: 90px; margin-right: 15px;}
|
15 |
+
table.bsf_metabox input.bsf_text_medium { width: 230px; margin-right: 15px;}
|
16 |
+
table.bsf_metabox input.bsf_upload_file { width: 65%; }
|
17 |
+
table.bsf_metabox li { font-size:12px; margin: 1px 0 5px 0; line-height: 16px; }
|
18 |
+
table.bsf_metabox ul { padding-top:5px; margin: 0; }
|
19 |
+
table.bsf_metabox select { font-size:12px; margin-top: 3px;}
|
20 |
+
table.bsf_metabox input:focus, table.bsf_metabox textarea:focus { background: #fffff8;}
|
21 |
+
.bsf_metabox_title { margin: 0 0 5px 0; padding: 5px 0 0 0; font: italic 24px/35px Georgia,"Times New Roman","Bitstream Charter",Times,serif;}
|
22 |
+
.bsf_radio_inline { padding: 4px 0 0 0;}
|
23 |
+
.bsf_radio_inline_option {display: inline; padding-right: 18px;}
|
24 |
+
table.bsf_metabox input[type="radio"] { margin: 0 5px 0 0; padding: 0;}
|
25 |
+
table.bsf_metabox input[type="checkbox"] { margin: 0 5px 0 0; padding: 0;}
|
26 |
+
table.bsf_metabox .mceLayout {border:1px solid #DFDFDF !important;}
|
27 |
+
table.bsf_metabox .mceIframeContainer {background:#FFF;}
|
28 |
+
table.bsf_metabox .meta_mce {width:97%;}
|
29 |
+
table.bsf_metabox .meta_mce textarea {width:100%;}
|
30 |
+
table.bsf_metabox .bsf_media_status { margin: 10px 0 0 0;}
|
31 |
+
table.bsf_metabox .bsf_media_status .img_status, table.bsf_metabox .bsf_media_status .embed_status { position: relative; }
|
32 |
+
table.bsf_metabox .bsf_media_status .img_status img, table.bsf_metabox .bsf_media_status .embed_status { border:1px solid #DFDFDF; background: #FAFAFA; max-width:350px; padding: 5px; -moz-border-radius: 2px; border-radius: 2px;}
|
33 |
+
table.bsf_metabox .bsf_media_status .embed_status { float: left; max-width:800px;}
|
34 |
+
table.bsf_metabox .bsf_media_status .img_status .bsf_remove_file_button, table.bsf_metabox .bsf_media_status .embed_status .bsf_remove_file_button { text-indent: -9999px; width: 16px; height: 16px; position: absolute; top: -5px; left: -5px;}
|
35 |
+
/* Sidebar placement adjustments */
|
36 |
+
.inner-sidebar table.bsf_metabox input[type=text], table.bsf_metabox textarea { width: 95%; }
|
37 |
+
.inner-sidebar table.bsf_metabox .bsf_media_status .img_status img, .inner-sidebar table.bsf_metabox .bsf_media_status .embed_status img { width: 90%; }
|
38 |
+
.postbox table.bsf_metabox .cmb-spinner { float: left; }
|
39 |
+
/**
|
40 |
+
* Color picker
|
41 |
+
*/
|
42 |
+
table.bsf_metabox .wp-color-result, table.bsf_metabox .wp-picker-input-wrap { vertical-align: middle; }
|
43 |
+
table.bsf_metabox .wp-color-result, table.bsf_metabox .wp-picker-container { margin: 0 10px 0 0; width: 80px; height: 22px; display: block; box-shadow: none;}
|
44 |
+
/**
|
45 |
+
* Timepicker
|
46 |
+
*/
|
47 |
+
div.time-picker { position: absolute; height: 191px; width:6em; /* needed for IE */overflow: auto; background: #fff; border: 1px solid #aaa; z-index: 99; margin: 0;}
|
48 |
+
div.time-picker-12hours { width:8em; /* needed for IE */}
|
49 |
+
div.time-picker ul { list-style-type: none; margin: 0; padding: 0; }
|
50 |
+
div.time-picker li { cursor: pointer; height: 10px; font: 12px/1 Helvetica, Arial, sans-serif; padding: 4px 3px; }
|
51 |
+
div.time-picker li.selected { background: #0063CE; color: #fff; }
|
52 |
+
/**
|
53 |
+
* jQuery UI CSS Framework 1.8.16
|
54 |
+
*
|
55 |
+
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
|
56 |
+
* Dual licensed under the MIT or GPL Version 2 licenses.
|
57 |
+
* http://jquery.org/license
|
58 |
+
*
|
59 |
+
* http://docs.jquery.com/UI/Theming/API
|
60 |
+
*/
|
61 |
+
.bsf_element .ui-helper-hidden { display: none; }
|
62 |
+
.bsf_element .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
|
63 |
+
.bsf_element .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
|
64 |
+
.bsf_element .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
|
65 |
+
.bsf_element .ui-helper-clearfix { display: inline-block; }
|
66 |
+
* html .ui-helper-clearfix { height:1%; }
|
67 |
+
.bsf_element .ui-helper-clearfix { display:block; }
|
68 |
+
.bsf_element .ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); }
|
69 |
+
.bsf_element .ui-state-disabled { cursor: default !important; }
|
70 |
+
.bsf_element .ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; }
|
71 |
+
.bsf_element .ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
|
72 |
+
.bsf_element .ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; }
|
73 |
+
.bsf_element .ui-widget .ui-widget { font-size: 1em; }
|
74 |
+
.bsf_element .ui-widget input, .bsf_element .ui-widget select, .bsf_element .ui-widget textarea, .bsf_element .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
|
75 |
+
.bsf_element .ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff 50% 50% repeat-x; color: #222222; }
|
76 |
+
.bsf_element .ui-widget-content a { color: #222222; }
|
77 |
+
.bsf_element .ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc; color: #222222; font-weight: bold; }
|
78 |
+
.bsf_element .ui-widget-header a { color: #222222; }
|
79 |
+
.bsf_element .ui-state-default, .bsf_element .ui-widget-content .ui-state-default, .bsf_element .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6; font-weight: normal; color: #555555; }
|
80 |
+
.bsf_element .ui-state-default a, .bsf_element .ui-state-default a:link, .bsf_element .ui-state-default a:visited { color: #555555; text-decoration: none; }
|
81 |
+
.bsf_element .ui-state-hover, .bsf_element .ui-widget-content .ui-state-hover, .bsf_element .ui-widget-header .ui-state-hover, .bsf_element .ui-state-focus, .bsf_element .ui-widget-content .ui-state-focus, .bsf_element .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada; font-weight: normal; color: #212121; }
|
82 |
+
.bsf_element .ui-state-hover a, .bsf_element .ui-state-hover a:hover { color: #212121; text-decoration: none; }
|
83 |
+
.bsf_element .ui-state-active, .bsf_element .ui-widget-content .ui-state-active, .bsf_element .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff; font-weight: normal; color: #212121; }
|
84 |
+
.bsf_element .ui-state-active a, .bsf_element .ui-state-active a:link, .bsf_element .ui-state-active a:visited { color: #212121; text-decoration: none; }
|
85 |
+
.bsf_element .ui-widget :active { outline: none; }
|
86 |
+
.bsf_element .ui-state-highlight, .bsf_element .ui-widget-content .ui-state-highlight, .bsf_element .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee; color: #363636; }
|
87 |
+
.bsf_element .ui-state-highlight a, .bsf_element .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; }
|
88 |
+
.bsf_element .ui-state-error, .bsf_element .ui-widget-content .ui-state-error, .bsf_element .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec; color: #cd0a0a; }
|
89 |
+
.bsf_element .ui-state-error a, .bsf_element .ui-widget-content .ui-state-error a, .bsf_element .ui-widget-header .ui-state-error a { color: #cd0a0a; }
|
90 |
+
.bsf_element .ui-state-error-text, .bsf_element .ui-widget-content .ui-state-error-text, .bsf_element .ui-widget-header .ui-state-error-text { color: #cd0a0a; }
|
91 |
+
.bsf_element .ui-priority-primary, .bsf_element .ui-widget-content .ui-priority-primary, .bsf_element .ui-widget-header .ui-priority-primary { font-weight: bold; }
|
92 |
+
.bsf_element .ui-priority-secondary, .bsf_element .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; }
|
93 |
+
.bsf_element .ui-state-disabled, .bsf_element .ui-widget-content .ui-state-disabled, .bsf_element .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; }
|
94 |
+
.bsf_element .ui-corner-all, .bsf_element .ui-corner-top, .bsf_element .ui-corner-left, .bsf_element .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; }
|
95 |
+
.bsf_element .ui-corner-all, .bsf_element .ui-corner-top, .bsf_element .ui-corner-right, .bsf_element .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; }
|
96 |
+
.bsf_element .ui-corner-all, .bsf_element .ui-corner-bottom, .bsf_element .ui-corner-left, .bsf_element .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; }
|
97 |
+
.bsf_element .ui-corner-all, .bsf_element .ui-corner-bottom, .bsf_element .ui-corner-right, .bsf_element .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; }
|
98 |
+
.bsf_element .ui-widget-overlay { background: #aaaaaa; opacity: .30;filter:Alpha(Opacity=30); }
|
99 |
+
.bsf_element .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }
|
100 |
+
.bsf_element .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
|
101 |
+
.bsf_element .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
|
102 |
+
.bsf_element .ui-datepicker .ui-datepicker-prev, .bsf_element .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
|
103 |
+
.bsf_element .ui-datepicker .ui-datepicker-prev-hover, .bsf_element .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
|
104 |
+
.bsf_element .ui-datepicker .ui-datepicker-prev { left:2px; }
|
105 |
+
.bsf_element .ui-datepicker .ui-datepicker-next { right:2px; }
|
106 |
+
.bsf_element .ui-datepicker .ui-datepicker-prev-hover { left:1px; }
|
107 |
+
.bsf_element .ui-datepicker .ui-datepicker-next-hover { right:1px; }
|
108 |
+
.bsf_element .ui-datepicker .ui-datepicker-prev span, .bsf_element .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; }
|
109 |
+
.bsf_element .ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; }
|
110 |
+
.bsf_element .ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; }
|
111 |
+
.bsf_element .ui-datepicker select.ui-datepicker-month-year {width: 100%;}
|
112 |
+
.bsf_element .ui-datepicker select.ui-datepicker-month,
|
113 |
+
.bsf_element .ui-datepicker select.ui-datepicker-year { width: 49%;}
|
114 |
+
.bsf_element .ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; }
|
115 |
+
.bsf_element .ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; }
|
116 |
+
.bsf_element .ui-datepicker td { border: 0; padding: 1px; }
|
117 |
+
.bsf_element .ui-datepicker td span, .bsf_element .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; }
|
118 |
+
.bsf_element .ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; }
|
119 |
+
.bsf_element .ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; }
|
120 |
+
.bsf_element .ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; }
|
121 |
+
.bsf_element .ui-datepicker.ui-datepicker-multi { width:auto; }
|
122 |
+
.bsf_element .ui-datepicker-multi .ui-datepicker-group { float:left; }
|
123 |
+
.bsf_element .ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; }
|
124 |
+
.bsf_element .ui-datepicker-multi-2 .ui-datepicker-group { width:50%; }
|
125 |
+
.bsf_element .ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; }
|
126 |
+
.bsf_element .ui-datepicker-multi-4 .ui-datepicker-group { width:25%; }
|
127 |
+
.bsf_element .ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; }
|
128 |
+
.bsf_element .ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; }
|
129 |
+
.bsf_element .ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; }
|
130 |
+
.bsf_element .ui-datepicker-row-break { clear:both; width:100%; font-size:0em; }
|
131 |
+
.bsf_element .ui-datepicker-rtl { direction: rtl; }
|
132 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; }
|
133 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; }
|
134 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; }
|
135 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; }
|
136 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; }
|
137 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; }
|
138 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; }
|
139 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-group { float:right; }
|
140 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
141 |
+
.bsf_element .ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; }
|
142 |
+
.bsf_element .ui-datepicker-cover {
|
143 |
+
display: none; /*sorry for IE5*/
|
144 |
+
display/**/: block; /*sorry for IE5*/
|
145 |
+
position: absolute; /*must have*/
|
146 |
+
z-index: -1; /*must have*/
|
147 |
+
filter: mask(); /*must have*/
|
148 |
+
top: -4px; /*must have*/
|
149 |
+
left: -4px; /*must have*/
|
150 |
+
width: 200px; /*must have*/
|
151 |
+
height: 200px; /*must have*/
|
152 |
+
}
|
153 |
+
.required {
|
154 |
+
color: #F00;
|
155 |
+
font-size: 11px;
|
156 |
+
margin-left: -12px;
|
157 |
+
}
|
158 |
+
.select_full {
|
159 |
+
width: 94%;
|
160 |
+
}
|
161 |
+
.bsf_textarea_small {
|
162 |
+
width: 94%;
|
163 |
+
height: 110px;
|
164 |
+
}
|
165 |
+
.img_status>img {
|
166 |
+
max-width: 180px !important;
|
167 |
+
}
|
168 |
+
/**/
|
169 |
+
.iris-picker.iris-border {
|
170 |
+
z-index: 9999;
|
171 |
+
}
|
172 |
+
.button.button-small.wp-picker-clear {
|
173 |
+
z-index: 9999;
|
174 |
+
float: left;
|
175 |
+
line-height: 1.5em;
|
176 |
+
padding: 2px 10px !important;
|
177 |
+
height: 27px;
|
178 |
+
}
|
179 |
+
.wp-color-picker {
|
180 |
+
z-index: 9999;
|
181 |
+
float: left;
|
182 |
+
width: 80px !important;
|
183 |
+
}
|
184 |
+
.wp-picker-input-wrap {
|
185 |
+
z-index: 9999;
|
186 |
+
width: 160px;
|
187 |
+
}
|
188 |
+
.wp-picker-input-wrap {
|
189 |
+
z-index: 99999;
|
190 |
+
position: relative;
|
191 |
+
top: -27px;
|
192 |
+
left: 120px;
|
193 |
+
}
|
194 |
+
.wp-picker-holder {
|
195 |
+
position: relative;
|
196 |
+
z-index: 9999;
|
197 |
+
top: -29px;
|
198 |
+
right: 0;
|
199 |
+
}
|
200 |
+
.bsf_media_status>img {
|
201 |
+
width: 180px !important;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
202 |
}
|
admin/images/sidebar.jpg
DELETED
Binary file
|
admin/index.php
CHANGED
@@ -6,36 +6,23 @@ if ( is_admin() )
|
|
6 |
add_action( 'admin_footer', 'add_footer_script' );
|
7 |
}
|
8 |
//enqueues the scripts and styles in admin dashboard
|
9 |
-
|
10 |
function bsf_admin_styles() {
|
11 |
-
|
12 |
// wp_enqueue_style( 'ui_style' );
|
13 |
-
|
14 |
wp_enqueue_style( 'star_style' );
|
15 |
-
|
16 |
wp_enqueue_style( 'meta_style' );
|
17 |
-
|
18 |
wp_enqueue_script( 'bsf_jquery' );
|
19 |
-
|
20 |
wp_enqueue_script( 'bsf_jquery_ui' );
|
21 |
-
|
22 |
wp_enqueue_script( 'bsf_jquery_star' );
|
23 |
-
|
24 |
/// wp_enqueue_script( 'postbox' );
|
25 |
-
|
26 |
}
|
27 |
function add_the_script() {
|
28 |
wp_enqueue_script('postbox');
|
29 |
wp_enqueue_style( 'admin_style' );
|
30 |
}
|
31 |
add_action('admin_print_scripts', 'add_the_script');
|
32 |
-
|
33 |
//The Main Admin Dashboard for Rich Snippets Plugin
|
34 |
-
|
35 |
function rich_snippet_dashboard() {
|
36 |
-
|
37 |
$plugins_url = plugins_url();
|
38 |
-
|
39 |
$args_review = get_option('bsf_review');
|
40 |
$args_event = get_option('bsf_event');
|
41 |
$args_person = get_option('bsf_person');
|
@@ -43,26 +30,18 @@ function rich_snippet_dashboard() {
|
|
43 |
$args_recipe = get_option('bsf_recipe');
|
44 |
$args_soft = get_option('bsf_software');
|
45 |
$args_video = get_option('bsf_video');
|
|
|
46 |
$args_color = get_option('bsf_custom');
|
47 |
-
|
48 |
echo '<div class="wrap">';
|
49 |
-
|
50 |
echo '<div id="star-icons-32" class="icon32"></div><h2>'.__("All in One Schema.org Rich Snippets - Dashboard","rich-snippets").'</h2>';
|
51 |
-
|
52 |
echo '<div class="clear"></div><div id="tab-container" class="tab-container">';
|
53 |
-
|
54 |
echo '<ul class="etabs">
|
55 |
-
|
56 |
<li class="tab"><a href="#tab-1">'.__("Configuration","rich-snippets").'</a></li>
|
57 |
-
|
58 |
<li class="tab"><a href="#tab-4">'.__("Customization","rich-snippets").'</a></li>
|
59 |
-
|
60 |
<li class="tab"><a href="#tab-2">'.__(" How to Use?","rich-snippets").'</a></li>
|
61 |
-
|
62 |
<li class="tab"><a href="#tab-3">'.__("FAQs","rich-snippets").'</a></li>
|
63 |
|
64 |
</ul>
|
65 |
-
|
66 |
<div class="clear"></div>
|
67 |
<div class="panel-container">
|
68 |
<div id="tab-1">
|
@@ -103,7 +82,6 @@ function rich_snippet_dashboard() {
|
|
103 |
<td></td>
|
104 |
<td><input type="submit" class="button-primary" name="item_submit" value="'.__("Update ").'"/> <a class="button-primary" href="?page=rich_snippet_dashboard&action=reset&options=review">'.__('Reset ','rich-snippets').'</a></td>
|
105 |
</tr>
|
106 |
-
|
107 |
</tbody>
|
108 |
</table>
|
109 |
</form>
|
@@ -215,10 +193,6 @@ function rich_snippet_dashboard() {
|
|
215 |
<td align="right"><strong><label>'.__("Author Rating :","rich-snippets").'</label></strong></td>
|
216 |
<td><input class="bsf_text_medium" type="text" name="product_rating" value="'.$args_product["product_rating"].'"/></td>
|
217 |
</tr>
|
218 |
-
<tr>
|
219 |
-
<td align="right"><strong><label>'.__("Your Rating :","rich-snippets").'</label></strong></td>
|
220 |
-
<td><input class="bsf_text_medium" type="text" name="product_rating" value="'.$args_product["product_rating"].'"/></td>
|
221 |
-
</tr>
|
222 |
<tr>
|
223 |
<td align="right"><strong><label>'.__("Brand Name :","rich-snippets").'</label></strong></td>
|
224 |
<td><input class="bsf_text_medium" type="text" name="product_brand" value="'.$args_product["product_brand"].'"/></td>
|
@@ -286,7 +260,7 @@ function rich_snippet_dashboard() {
|
|
286 |
<tr>
|
287 |
<td align="right"><strong><label>'.__("Average Rating:","rich-snippets").'</label></strong></td>
|
288 |
<td><input class="bsf_text_medium" type="text" name="recipe_rating" value="'.$args_recipe["recipe_rating"].'"/></td>
|
289 |
-
</tr>
|
290 |
<tr><td colspan="2"></td></tr>
|
291 |
<tr>
|
292 |
<td></td>
|
@@ -342,6 +316,8 @@ function rich_snippet_dashboard() {
|
|
342 |
</div>
|
343 |
</div>
|
344 |
</div>
|
|
|
|
|
345 |
<div class="postbox closed">
|
346 |
<div class="handlediv" title="Click to toggle"><br></div>
|
347 |
<h3 class="hndle"><span>'.__("Video","rich-snippets").'</span></h3>
|
@@ -382,6 +358,47 @@ function rich_snippet_dashboard() {
|
|
382 |
</div>
|
383 |
</div>
|
384 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
385 |
|
386 |
</div>
|
387 |
</div>
|
@@ -433,10 +450,8 @@ function rich_snippet_dashboard() {
|
|
433 |
<p>'.__("We understand you don't like the content that gets displayed on your page / post. However as per the strong recommendation of Google, the MicroData should be clearly visible to the user.","rich-snippets").'</p>
|
434 |
<p>'.__("Here is a reference link of what Google says. <a href='https://sites.google.com/site/webmasterhelpforum/en/faq-rich-snippets#display'> https://sites.google.com/site/webmasterhelpforum/en/faq-rich-snippets#display</a>","rich-snippets").'</p>
|
435 |
<p> '.__("If you don't like the default design the content box created by plugin, you can always <a href='?page=rich_snippet_dashboard#tab-4'> customise it </a> or edit CSS located <a target='_blank' title='Click here to edit the css' href='plugin-editor.php?file=all-in-one-schemaorg-rich-snippets/css/style.css&plugin=all-in-one-schemaorg-rich-snippets/index.php'> here </a>or request professional service at $25", "rich-snippets").' </p>
|
436 |
-
|
437 |
<li><strong>'.__(" How does this plugin work with other plugins like WordPress SEO, wooCommerce, etc?","rich-snippets").'</strong></li>
|
438 |
<p>'.__('Well, the plugin works perfectly with most of the other plugins as the only thing "All in One Schema.org Rich Snippets" does is - it give you power to add Rich Snippets MicroData in your pages and posts easily. <br><br>If you find any it conflicting with any other plugin, please do not hesitate to report an issue.','rich-snippets').'</p>
|
439 |
-
|
440 |
<li><strong>'.__("How much time does it take to show up rich snippets for my search results? My search results are still not coming up with rich snippets.","rich-snippets").'</strong></li>
|
441 |
<p>'.__("Most probably rich snippets are displayed in for you search results as soon as search engines crawl the MicroData the plugin has created. However it's totally upto search engines to display rich snippets for your search result (which mostly depends on your website authority)","rich-snippets").'</p>
|
442 |
<p>'.__("If rich snippets are not appearing in your search results yet, most probably they will start appearing soon as Google / other search engines finds your website more authoritative.","rich-snippets").'</p>
|
@@ -448,10 +463,8 @@ function rich_snippet_dashboard() {
|
|
448 |
<li> '.__('Code the new feature if you are a developer and submit your code. If we include this feature in our releases, credits will be given to you.', 'rich-snippets').' </li>
|
449 |
<li> '.__(' Offer a sponsorship to get this feature done for all plugin users OR request a professional customisation service.', 'rich-snippets').' </li>
|
450 |
</ol>
|
451 |
-
|
452 |
<li><strong>'.__("Is Google Authorship part of your plugin as well?","rich-snippets").'</strong></li>
|
453 |
<p>'.__("Unfortunately, not at the moment. Though this is definitely in our roadmap and the development will complete soon. Stay tuned!","rich-snippets").'</p>
|
454 |
-
|
455 |
</ol>
|
456 |
</div>
|
457 |
</div>
|
@@ -477,23 +490,23 @@ function rich_snippet_dashboard() {
|
|
477 |
<table class="bsf_metabox">
|
478 |
<tr>
|
479 |
<th> <label for="snippet_box_bg"> '.__('Box Background ', 'rich-snippets').' </label> </th>
|
480 |
-
<td> <input type="text" name="snippet_box_bg" id="snippet_box_bg" value="'.$args_color["snippet_box_bg"].'" class="
|
481 |
</tr>
|
482 |
<tr>
|
483 |
<th> <label for="snippet_title_bg"> '.__('Title Background', 'rich-snippets').' </label> </th>
|
484 |
-
<td> <input type="text" name="snippet_title_bg" id="snippet_title_bg" value="'.$args_color["snippet_title_bg"].'" class="
|
485 |
</tr>
|
486 |
<tr>
|
487 |
<th> <label for="snippet_border"> '.__('Border Color', 'rich-snippets').' </label> </th>
|
488 |
-
<td> <input type="text" name="snippet_border" id="snippet_border" value="'.$args_color["snippet_border"].'" class="
|
489 |
</tr>
|
490 |
<tr>
|
491 |
<th> <label for="snippet_title_color"> '.__('Title Color', 'rich-snippets').' </label> </th>
|
492 |
-
<td> <input type="text" name="snippet_title_color" id="snippet_title_color" value="'.$args_color["snippet_title_color"].'" class="
|
493 |
</tr>
|
494 |
<tr>
|
495 |
<th> <label for="snippet_box_color"> '.__('Snippet Text Color', 'rich-snippets').' </label> </th>
|
496 |
-
<td> <input type="text" name="snippet_box_color" id="snippet_box_color" value="'.$args_color["snippet_box_color"].'" class="
|
497 |
</tr>
|
498 |
<tr>
|
499 |
<td></td>
|
@@ -516,9 +529,7 @@ function rich_snippet_dashboard() {
|
|
516 |
|
517 |
</div>
|
518 |
</div> ';
|
519 |
-
|
520 |
echo '
|
521 |
-
|
522 |
<script src="'.plugins_url('/all-in-one-schemaorg-rich-snippets/admin/js/jquery.easytabs.min.js').'"></script>
|
523 |
<script src="'.plugins_url('/all-in-one-schemaorg-rich-snippets/admin/js/jquery.hashchange.min.js').'"></script>
|
524 |
<script language="javascript">
|
@@ -534,16 +545,13 @@ function rich_snippet_dashboard() {
|
|
534 |
jQuery("#postbox-container-9").css("width","35%");
|
535 |
jQuery("#postbox-container-10").css("width","35%");
|
536 |
jQuery("#postbox-container-11").css({"width":"63%","padding-right":"2%"});
|
537 |
-
|
538 |
jQuery(".postbox h3").click( function() {
|
539 |
jQuery(jQuery(this).parent().get(0)).toggleClass("closed");
|
540 |
});
|
541 |
-
|
542 |
jQuery(".handlediv").click( function() {
|
543 |
jQuery(jQuery(this).parent().get(0)).toggleClass("closed");
|
544 |
});
|
545 |
</script>';
|
546 |
-
|
547 |
}
|
548 |
// Update options
|
549 |
if(isset($_POST['item_submit']))
|
@@ -558,7 +566,6 @@ if(isset($_POST['item_submit']))
|
|
558 |
$status = update_option('bsf_review',$args);
|
559 |
displayStatus($status);
|
560 |
}
|
561 |
-
|
562 |
if(isset($_POST['event_submit']))
|
563 |
{
|
564 |
foreach(array('snippet_title','event_title','event_location','start_time','end_time') as $option)
|
@@ -571,7 +578,6 @@ if(isset($_POST['event_submit']))
|
|
571 |
$status = update_option('bsf_event',$args);
|
572 |
displayStatus($status);
|
573 |
}
|
574 |
-
|
575 |
if(isset($_POST['person_submit']))
|
576 |
{
|
577 |
foreach(array('snippet_title','person_name','person_nickname','person_job_title','person_website','person_company','person_address') as $option)
|
@@ -584,7 +590,6 @@ if(isset($_POST['person_submit']))
|
|
584 |
$status = update_option('bsf_person',$args);
|
585 |
displayStatus($status);
|
586 |
}
|
587 |
-
|
588 |
if(isset($_POST['product_submit']))
|
589 |
{
|
590 |
foreach(array('snippet_title','product_rating','product_brand','product_name','product_agr','product_price','product_avail') as $option)
|
@@ -597,7 +602,6 @@ if(isset($_POST['product_submit']))
|
|
597 |
$status = update_option('bsf_product',$args);
|
598 |
displayStatus($status);
|
599 |
}
|
600 |
-
|
601 |
if(isset($_POST['recipe_submit']))
|
602 |
{
|
603 |
foreach(array('snippet_title','recipe_name','recipe_pub','recipe_prep','recipe_cook','recipe_time','recipe_rating') as $option)
|
@@ -610,7 +614,6 @@ if(isset($_POST['recipe_submit']))
|
|
610 |
$status = update_option('bsf_recipe',$args);
|
611 |
displayStatus($status);
|
612 |
}
|
613 |
-
|
614 |
if(isset($_POST['software_submit']))
|
615 |
{
|
616 |
foreach(array('snippet_title','software_rating','software_price','software_name','software_os','software_website') as $option)
|
@@ -623,7 +626,6 @@ if(isset($_POST['software_submit']))
|
|
623 |
$status = update_option('bsf_software',$args);
|
624 |
displayStatus($status);
|
625 |
}
|
626 |
-
|
627 |
if(isset($_POST['video_submit']))
|
628 |
{
|
629 |
foreach(array('snippet_title','video_title','video_desc','video_time','video_date') as $option)
|
@@ -636,9 +638,19 @@ if(isset($_POST['video_submit']))
|
|
636 |
$status = update_option('bsf_video',$args);
|
637 |
displayStatus($status);
|
638 |
}
|
639 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
640 |
function displayStatus($status) {
|
641 |
-
|
642 |
if($status)
|
643 |
{
|
644 |
echo '<div class="updated"><p>' . __('Success! Your changes were successfully saved!', 'rich-snippets') . '</p></div>';
|
@@ -648,72 +660,60 @@ function displayStatus($status) {
|
|
648 |
echo '<div class="error"><p>' . __('Sorry, Your changes are not saved!', 'rich-snippets') . '</p></div>';
|
649 |
}
|
650 |
}
|
651 |
-
|
652 |
if(isset($_GET['action']))
|
653 |
{
|
654 |
if($_GET['action'] == 'reset')
|
655 |
{
|
656 |
$option_to_reset = $_GET['options'];
|
657 |
-
|
658 |
if($option_to_reset == 'review')
|
659 |
delete_option('bsf_review');
|
660 |
-
|
661 |
if($option_to_reset == 'event')
|
662 |
delete_option('bsf_event');
|
663 |
-
|
664 |
if($option_to_reset == 'person')
|
665 |
delete_option('bsf_person');
|
666 |
|
667 |
if($option_to_reset == 'product')
|
668 |
delete_option('bsf_product');
|
669 |
-
|
670 |
if($option_to_reset == 'recipe')
|
671 |
delete_option('bsf_recipe');
|
672 |
-
|
673 |
if($option_to_reset == 'software')
|
674 |
delete_option('bsf_software');
|
675 |
-
|
676 |
if($option_to_reset == 'video')
|
677 |
delete_option('bsf_video');
|
678 |
-
|
|
|
|
|
|
|
679 |
if($option_to_reset == 'color')
|
680 |
delete_option('bsf_custom');
|
681 |
|
682 |
bsf_reset_options($option_to_reset);
|
683 |
}
|
684 |
}
|
685 |
-
|
686 |
function bsf_reset_options($option_to_reset)
|
687 |
{
|
688 |
require_once(dirname(__FILE__) .'/../settings.php');
|
689 |
-
|
690 |
if($option_to_reset == 'review')
|
691 |
add_review_option();
|
692 |
-
|
693 |
if($option_to_reset == 'event')
|
694 |
add_event_option();
|
695 |
-
|
696 |
if($option_to_reset == 'person')
|
697 |
add_person_option();
|
698 |
-
|
699 |
if($option_to_reset == 'product')
|
700 |
add_product_option();
|
701 |
-
|
702 |
if($option_to_reset == 'recipe')
|
703 |
add_recipe_option();
|
704 |
-
|
705 |
if($option_to_reset == 'software')
|
706 |
add_software_option();
|
707 |
-
|
708 |
if($option_to_reset == 'video')
|
709 |
add_video_option();
|
710 |
-
|
|
|
711 |
if($option_to_reset == 'color')
|
712 |
add_color_option();
|
713 |
|
714 |
header("location:?page=rich_snippet_dashboard");
|
715 |
}
|
716 |
-
|
717 |
function add_footer_script()
|
718 |
{?>
|
719 |
<script type="text/javascript">
|
@@ -728,7 +728,6 @@ function add_footer_script()
|
|
728 |
}
|
729 |
);
|
730 |
});
|
731 |
-
|
732 |
jQuery("#submit_request_1").click(function()
|
733 |
{
|
734 |
var data = jQuery("#support_form_1").serialize();
|
@@ -775,7 +774,6 @@ function add_footer_script()
|
|
775 |
});
|
776 |
</script>
|
777 |
<?php }
|
778 |
-
|
779 |
function get_support($n)
|
780 |
{
|
781 |
$html = '
|
6 |
add_action( 'admin_footer', 'add_footer_script' );
|
7 |
}
|
8 |
//enqueues the scripts and styles in admin dashboard
|
|
|
9 |
function bsf_admin_styles() {
|
|
|
10 |
// wp_enqueue_style( 'ui_style' );
|
|
|
11 |
wp_enqueue_style( 'star_style' );
|
|
|
12 |
wp_enqueue_style( 'meta_style' );
|
|
|
13 |
wp_enqueue_script( 'bsf_jquery' );
|
|
|
14 |
wp_enqueue_script( 'bsf_jquery_ui' );
|
|
|
15 |
wp_enqueue_script( 'bsf_jquery_star' );
|
|
|
16 |
/// wp_enqueue_script( 'postbox' );
|
|
|
17 |
}
|
18 |
function add_the_script() {
|
19 |
wp_enqueue_script('postbox');
|
20 |
wp_enqueue_style( 'admin_style' );
|
21 |
}
|
22 |
add_action('admin_print_scripts', 'add_the_script');
|
|
|
23 |
//The Main Admin Dashboard for Rich Snippets Plugin
|
|
|
24 |
function rich_snippet_dashboard() {
|
|
|
25 |
$plugins_url = plugins_url();
|
|
|
26 |
$args_review = get_option('bsf_review');
|
27 |
$args_event = get_option('bsf_event');
|
28 |
$args_person = get_option('bsf_person');
|
30 |
$args_recipe = get_option('bsf_recipe');
|
31 |
$args_soft = get_option('bsf_software');
|
32 |
$args_video = get_option('bsf_video');
|
33 |
+
$args_article = get_option('bsf_article');
|
34 |
$args_color = get_option('bsf_custom');
|
|
|
35 |
echo '<div class="wrap">';
|
|
|
36 |
echo '<div id="star-icons-32" class="icon32"></div><h2>'.__("All in One Schema.org Rich Snippets - Dashboard","rich-snippets").'</h2>';
|
|
|
37 |
echo '<div class="clear"></div><div id="tab-container" class="tab-container">';
|
|
|
38 |
echo '<ul class="etabs">
|
|
|
39 |
<li class="tab"><a href="#tab-1">'.__("Configuration","rich-snippets").'</a></li>
|
|
|
40 |
<li class="tab"><a href="#tab-4">'.__("Customization","rich-snippets").'</a></li>
|
|
|
41 |
<li class="tab"><a href="#tab-2">'.__(" How to Use?","rich-snippets").'</a></li>
|
|
|
42 |
<li class="tab"><a href="#tab-3">'.__("FAQs","rich-snippets").'</a></li>
|
43 |
|
44 |
</ul>
|
|
|
45 |
<div class="clear"></div>
|
46 |
<div class="panel-container">
|
47 |
<div id="tab-1">
|
82 |
<td></td>
|
83 |
<td><input type="submit" class="button-primary" name="item_submit" value="'.__("Update ").'"/> <a class="button-primary" href="?page=rich_snippet_dashboard&action=reset&options=review">'.__('Reset ','rich-snippets').'</a></td>
|
84 |
</tr>
|
|
|
85 |
</tbody>
|
86 |
</table>
|
87 |
</form>
|
193 |
<td align="right"><strong><label>'.__("Author Rating :","rich-snippets").'</label></strong></td>
|
194 |
<td><input class="bsf_text_medium" type="text" name="product_rating" value="'.$args_product["product_rating"].'"/></td>
|
195 |
</tr>
|
|
|
|
|
|
|
|
|
196 |
<tr>
|
197 |
<td align="right"><strong><label>'.__("Brand Name :","rich-snippets").'</label></strong></td>
|
198 |
<td><input class="bsf_text_medium" type="text" name="product_brand" value="'.$args_product["product_brand"].'"/></td>
|
260 |
<tr>
|
261 |
<td align="right"><strong><label>'.__("Average Rating:","rich-snippets").'</label></strong></td>
|
262 |
<td><input class="bsf_text_medium" type="text" name="recipe_rating" value="'.$args_recipe["recipe_rating"].'"/></td>
|
263 |
+
</tr>
|
264 |
<tr><td colspan="2"></td></tr>
|
265 |
<tr>
|
266 |
<td></td>
|
316 |
</div>
|
317 |
</div>
|
318 |
</div>
|
319 |
+
|
320 |
+
|
321 |
<div class="postbox closed">
|
322 |
<div class="handlediv" title="Click to toggle"><br></div>
|
323 |
<h3 class="hndle"><span>'.__("Video","rich-snippets").'</span></h3>
|
358 |
</div>
|
359 |
</div>
|
360 |
</div>
|
361 |
+
<div class="postbox closed">
|
362 |
+
<div class="handlediv" title="Click to toggle"><br></div>
|
363 |
+
<h3 class="hndle"><span>'.__("Article","rich-snippets").'</span></h3>
|
364 |
+
<div class="inside">
|
365 |
+
<div class="table">
|
366 |
+
<p>'.__("Strings to be displayed on frontend for <strong>Article Rich Snippets —</strong>","rich-snippets").'</p>
|
367 |
+
<form id="bsf_article_form" method="post">
|
368 |
+
<table class="bsf_metabox">
|
369 |
+
<tbody>
|
370 |
+
<tr>
|
371 |
+
<td align="right"><strong><label>'.__("Rich Snippet Title :","rich-snippets").'</label></strong></td>
|
372 |
+
<td><input class="bsf_text_medium" type="text" name="snippet_title" value="'.$args_article["snippet_title"].'"/></td>
|
373 |
+
</tr>
|
374 |
+
<tr>
|
375 |
+
<td align="right"><strong><label>'.__("Article Name :","rich-snippets").'</label></strong></td>
|
376 |
+
<td><input class="bsf_text_medium" type="text" name="article_name" value="'.$args_article["article_name"].'"/></td>
|
377 |
+
</tr>
|
378 |
+
<tr>
|
379 |
+
<td align="right"><strong><label>'.__("Author :","rich-snippets").'</label></strong></td>
|
380 |
+
<td><input class="bsf_text_medium" type="text" name="article_author" value="'.$args_article["article_author"].'"/></td>
|
381 |
+
</tr>
|
382 |
+
<tr>
|
383 |
+
<td align="right"><strong><label>'.__("Description :","rich-snippets").'</label></strong></td>
|
384 |
+
<td><input class="bsf_text_medium" type="text" name="article_desc" value="'.$args_article["article_desc"].'"/></td>
|
385 |
+
</tr>
|
386 |
+
<tr>
|
387 |
+
<td align="right"><strong><label>'.__("Image :","rich-snippets").'</label></strong></td>
|
388 |
+
<td><input class="bsf_text_medium" type="text" name="article_image" value="'.$args_article["article_image"].'"/></td>
|
389 |
+
</tr>
|
390 |
+
<tr><td colspan="2"></td></tr>
|
391 |
+
<tr>
|
392 |
+
<td></td>
|
393 |
+
<td><input type="submit" class="button-primary" name="article_submit" value="'.__("Update ").'"/> <a class="button-primary" href="?page=rich_snippet_dashboard&action=reset&options=article">'.__('Reset ','rich-snippets').'</a></td>
|
394 |
+
</tr>
|
395 |
+
</tbody>
|
396 |
+
</table>
|
397 |
+
</form>
|
398 |
+
</div>
|
399 |
+
</div>
|
400 |
+
</div>
|
401 |
+
<!-- Post blox -->
|
402 |
|
403 |
</div>
|
404 |
</div>
|
450 |
<p>'.__("We understand you don't like the content that gets displayed on your page / post. However as per the strong recommendation of Google, the MicroData should be clearly visible to the user.","rich-snippets").'</p>
|
451 |
<p>'.__("Here is a reference link of what Google says. <a href='https://sites.google.com/site/webmasterhelpforum/en/faq-rich-snippets#display'> https://sites.google.com/site/webmasterhelpforum/en/faq-rich-snippets#display</a>","rich-snippets").'</p>
|
452 |
<p> '.__("If you don't like the default design the content box created by plugin, you can always <a href='?page=rich_snippet_dashboard#tab-4'> customise it </a> or edit CSS located <a target='_blank' title='Click here to edit the css' href='plugin-editor.php?file=all-in-one-schemaorg-rich-snippets/css/style.css&plugin=all-in-one-schemaorg-rich-snippets/index.php'> here </a>or request professional service at $25", "rich-snippets").' </p>
|
|
|
453 |
<li><strong>'.__(" How does this plugin work with other plugins like WordPress SEO, wooCommerce, etc?","rich-snippets").'</strong></li>
|
454 |
<p>'.__('Well, the plugin works perfectly with most of the other plugins as the only thing "All in One Schema.org Rich Snippets" does is - it give you power to add Rich Snippets MicroData in your pages and posts easily. <br><br>If you find any it conflicting with any other plugin, please do not hesitate to report an issue.','rich-snippets').'</p>
|
|
|
455 |
<li><strong>'.__("How much time does it take to show up rich snippets for my search results? My search results are still not coming up with rich snippets.","rich-snippets").'</strong></li>
|
456 |
<p>'.__("Most probably rich snippets are displayed in for you search results as soon as search engines crawl the MicroData the plugin has created. However it's totally upto search engines to display rich snippets for your search result (which mostly depends on your website authority)","rich-snippets").'</p>
|
457 |
<p>'.__("If rich snippets are not appearing in your search results yet, most probably they will start appearing soon as Google / other search engines finds your website more authoritative.","rich-snippets").'</p>
|
463 |
<li> '.__('Code the new feature if you are a developer and submit your code. If we include this feature in our releases, credits will be given to you.', 'rich-snippets').' </li>
|
464 |
<li> '.__(' Offer a sponsorship to get this feature done for all plugin users OR request a professional customisation service.', 'rich-snippets').' </li>
|
465 |
</ol>
|
|
|
466 |
<li><strong>'.__("Is Google Authorship part of your plugin as well?","rich-snippets").'</strong></li>
|
467 |
<p>'.__("Unfortunately, not at the moment. Though this is definitely in our roadmap and the development will complete soon. Stay tuned!","rich-snippets").'</p>
|
|
|
468 |
</ol>
|
469 |
</div>
|
470 |
</div>
|
490 |
<table class="bsf_metabox">
|
491 |
<tr>
|
492 |
<th> <label for="snippet_box_bg"> '.__('Box Background ', 'rich-snippets').' </label> </th>
|
493 |
+
<td> <input type="text" name="snippet_box_bg" id="snippet_box_bg" value="'.$args_color["snippet_box_bg"].'" class="snippet_box_bg" /> </td>
|
494 |
</tr>
|
495 |
<tr>
|
496 |
<th> <label for="snippet_title_bg"> '.__('Title Background', 'rich-snippets').' </label> </th>
|
497 |
+
<td> <input type="text" name="snippet_title_bg" id="snippet_title_bg" value="'.$args_color["snippet_title_bg"].'" class="snippet_title_bg" /> </td>
|
498 |
</tr>
|
499 |
<tr>
|
500 |
<th> <label for="snippet_border"> '.__('Border Color', 'rich-snippets').' </label> </th>
|
501 |
+
<td> <input type="text" name="snippet_border" id="snippet_border" value="'.$args_color["snippet_border"].'" class="snippet_border" /> </td>
|
502 |
</tr>
|
503 |
<tr>
|
504 |
<th> <label for="snippet_title_color"> '.__('Title Color', 'rich-snippets').' </label> </th>
|
505 |
+
<td> <input type="text" name="snippet_title_color" id="snippet_title_color" value="'.$args_color["snippet_title_color"].'" class="snippet_title_color" /> </td>
|
506 |
</tr>
|
507 |
<tr>
|
508 |
<th> <label for="snippet_box_color"> '.__('Snippet Text Color', 'rich-snippets').' </label> </th>
|
509 |
+
<td> <input type="text" name="snippet_box_color" id="snippet_box_color" value="'.$args_color["snippet_box_color"].'" class="snippet_box_color" /> </td>
|
510 |
</tr>
|
511 |
<tr>
|
512 |
<td></td>
|
529 |
|
530 |
</div>
|
531 |
</div> ';
|
|
|
532 |
echo '
|
|
|
533 |
<script src="'.plugins_url('/all-in-one-schemaorg-rich-snippets/admin/js/jquery.easytabs.min.js').'"></script>
|
534 |
<script src="'.plugins_url('/all-in-one-schemaorg-rich-snippets/admin/js/jquery.hashchange.min.js').'"></script>
|
535 |
<script language="javascript">
|
545 |
jQuery("#postbox-container-9").css("width","35%");
|
546 |
jQuery("#postbox-container-10").css("width","35%");
|
547 |
jQuery("#postbox-container-11").css({"width":"63%","padding-right":"2%"});
|
|
|
548 |
jQuery(".postbox h3").click( function() {
|
549 |
jQuery(jQuery(this).parent().get(0)).toggleClass("closed");
|
550 |
});
|
|
|
551 |
jQuery(".handlediv").click( function() {
|
552 |
jQuery(jQuery(this).parent().get(0)).toggleClass("closed");
|
553 |
});
|
554 |
</script>';
|
|
|
555 |
}
|
556 |
// Update options
|
557 |
if(isset($_POST['item_submit']))
|
566 |
$status = update_option('bsf_review',$args);
|
567 |
displayStatus($status);
|
568 |
}
|
|
|
569 |
if(isset($_POST['event_submit']))
|
570 |
{
|
571 |
foreach(array('snippet_title','event_title','event_location','start_time','end_time') as $option)
|
578 |
$status = update_option('bsf_event',$args);
|
579 |
displayStatus($status);
|
580 |
}
|
|
|
581 |
if(isset($_POST['person_submit']))
|
582 |
{
|
583 |
foreach(array('snippet_title','person_name','person_nickname','person_job_title','person_website','person_company','person_address') as $option)
|
590 |
$status = update_option('bsf_person',$args);
|
591 |
displayStatus($status);
|
592 |
}
|
|
|
593 |
if(isset($_POST['product_submit']))
|
594 |
{
|
595 |
foreach(array('snippet_title','product_rating','product_brand','product_name','product_agr','product_price','product_avail') as $option)
|
602 |
$status = update_option('bsf_product',$args);
|
603 |
displayStatus($status);
|
604 |
}
|
|
|
605 |
if(isset($_POST['recipe_submit']))
|
606 |
{
|
607 |
foreach(array('snippet_title','recipe_name','recipe_pub','recipe_prep','recipe_cook','recipe_time','recipe_rating') as $option)
|
614 |
$status = update_option('bsf_recipe',$args);
|
615 |
displayStatus($status);
|
616 |
}
|
|
|
617 |
if(isset($_POST['software_submit']))
|
618 |
{
|
619 |
foreach(array('snippet_title','software_rating','software_price','software_name','software_os','software_website') as $option)
|
626 |
$status = update_option('bsf_software',$args);
|
627 |
displayStatus($status);
|
628 |
}
|
|
|
629 |
if(isset($_POST['video_submit']))
|
630 |
{
|
631 |
foreach(array('snippet_title','video_title','video_desc','video_time','video_date') as $option)
|
638 |
$status = update_option('bsf_video',$args);
|
639 |
displayStatus($status);
|
640 |
}
|
641 |
+
if(isset($_POST['article_submit']))
|
642 |
+
{
|
643 |
+
foreach(array('snippet_title','article_name','article_author','article_desc','article_image') as $option)
|
644 |
+
{
|
645 |
+
if(isset($_POST[$option]))
|
646 |
+
{
|
647 |
+
$args[$option] = $_POST[$option];
|
648 |
+
}
|
649 |
+
}
|
650 |
+
$status = update_option('bsf_article',$args);
|
651 |
+
displayStatus($status);
|
652 |
+
}
|
653 |
function displayStatus($status) {
|
|
|
654 |
if($status)
|
655 |
{
|
656 |
echo '<div class="updated"><p>' . __('Success! Your changes were successfully saved!', 'rich-snippets') . '</p></div>';
|
660 |
echo '<div class="error"><p>' . __('Sorry, Your changes are not saved!', 'rich-snippets') . '</p></div>';
|
661 |
}
|
662 |
}
|
|
|
663 |
if(isset($_GET['action']))
|
664 |
{
|
665 |
if($_GET['action'] == 'reset')
|
666 |
{
|
667 |
$option_to_reset = $_GET['options'];
|
|
|
668 |
if($option_to_reset == 'review')
|
669 |
delete_option('bsf_review');
|
|
|
670 |
if($option_to_reset == 'event')
|
671 |
delete_option('bsf_event');
|
|
|
672 |
if($option_to_reset == 'person')
|
673 |
delete_option('bsf_person');
|
674 |
|
675 |
if($option_to_reset == 'product')
|
676 |
delete_option('bsf_product');
|
|
|
677 |
if($option_to_reset == 'recipe')
|
678 |
delete_option('bsf_recipe');
|
|
|
679 |
if($option_to_reset == 'software')
|
680 |
delete_option('bsf_software');
|
|
|
681 |
if($option_to_reset == 'video')
|
682 |
delete_option('bsf_video');
|
683 |
+
|
684 |
+
if($option_to_reset == 'article')
|
685 |
+
delete_option('bsf_article');
|
686 |
+
|
687 |
if($option_to_reset == 'color')
|
688 |
delete_option('bsf_custom');
|
689 |
|
690 |
bsf_reset_options($option_to_reset);
|
691 |
}
|
692 |
}
|
|
|
693 |
function bsf_reset_options($option_to_reset)
|
694 |
{
|
695 |
require_once(dirname(__FILE__) .'/../settings.php');
|
|
|
696 |
if($option_to_reset == 'review')
|
697 |
add_review_option();
|
|
|
698 |
if($option_to_reset == 'event')
|
699 |
add_event_option();
|
|
|
700 |
if($option_to_reset == 'person')
|
701 |
add_person_option();
|
|
|
702 |
if($option_to_reset == 'product')
|
703 |
add_product_option();
|
|
|
704 |
if($option_to_reset == 'recipe')
|
705 |
add_recipe_option();
|
|
|
706 |
if($option_to_reset == 'software')
|
707 |
add_software_option();
|
|
|
708 |
if($option_to_reset == 'video')
|
709 |
add_video_option();
|
710 |
+
if($option_to_reset == 'article')
|
711 |
+
add_article_option();
|
712 |
if($option_to_reset == 'color')
|
713 |
add_color_option();
|
714 |
|
715 |
header("location:?page=rich_snippet_dashboard");
|
716 |
}
|
|
|
717 |
function add_footer_script()
|
718 |
{?>
|
719 |
<script type="text/javascript">
|
728 |
}
|
729 |
);
|
730 |
});
|
|
|
731 |
jQuery("#submit_request_1").click(function()
|
732 |
{
|
733 |
var data = jQuery("#support_form_1").serialize();
|
774 |
});
|
775 |
</script>
|
776 |
<?php }
|
|
|
777 |
function get_support($n)
|
778 |
{
|
779 |
$html = '
|
admin/js/jquery.easytabs.min.js
CHANGED
@@ -1,12 +1,14 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery EasyTabs plugin 3.1.1
|
3 |
-
*
|
4 |
-
* Copyright (c) 2010-2011 Steve Schwartz (JangoSteve)
|
5 |
-
*
|
6 |
-
* Dual licensed under the MIT and GPL licenses:
|
7 |
-
* http://www.opensource.org/licenses/mit-license.php
|
8 |
-
* http://www.gnu.org/licenses/gpl.html
|
9 |
-
*
|
10 |
-
* Date: Tue Jan 26 16:30:00 2012 -0500
|
11 |
-
*/
|
12 |
-
(function(a){a.easytabs=function(j,e){var f=this,q=a(j),i={animate:true,panelActiveClass:"active",tabActiveClass:"active",defaultTab:"li:first-child",animationSpeed:"normal",tabs:"> ul > li",updateHash:true,cycle:false,collapsible:false,collapsedClass:"collapsed",collapsedByDefault:true,uiTabs:false,transitionIn:"fadeIn",transitionOut:"fadeOut",transitionInEasing:"swing",transitionOutEasing:"swing",transitionCollapse:"slideUp",transitionUncollapse:"slideDown",transitionCollapseEasing:"swing",transitionUncollapseEasing:"swing",containerClass:"",tabsClass:"",tabClass:"",panelClass:"",cache:true,panelContext:q},h,l,v,m,d,t={fast:200,normal:400,slow:600},r;f.init=function(){f.settings=r=a.extend({},i,e);if(r.uiTabs){r.tabActiveClass="ui-tabs-selected";r.containerClass="ui-tabs ui-widget ui-widget-content ui-corner-all";r.tabsClass="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all";r.tabClass="ui-state-default ui-corner-top";r.panelClass="ui-tabs-panel ui-widget-content ui-corner-bottom"}if(r.collapsible&&e.defaultTab!==undefined&&e.collpasedByDefault===undefined){r.collapsedByDefault=false}if(typeof(r.animationSpeed)==="string"){r.animationSpeed=t[r.animationSpeed]}a("a.anchor").remove().prependTo("body");q.data("easytabs",{});f.setTransitions();f.getTabs();b();g();w();n();c();q.attr("data-easytabs",true)};f.setTransitions=function(){v=(r.animate)?{show:r.transitionIn,hide:r.transitionOut,speed:r.animationSpeed,collapse:r.transitionCollapse,uncollapse:r.transitionUncollapse,halfSpeed:r.animationSpeed/2}:{show:"show",hide:"hide",speed:0,collapse:"hide",uncollapse:"show",halfSpeed:0}};f.getTabs=function(){var x;f.tabs=q.find(r.tabs),f.panels=a(),f.tabs.each(function(){var A=a(this),z=A.children("a"),y=A.children("a").data("target");A.data("easytabs",{});if(y!==undefined&&y!==null){A.data("easytabs").ajax=z.attr("href")}else{y=z.attr("href")}y=y.match(/#([^\?]+)/)[0].substr(1);x=r.panelContext.find("#"+y);if(x.length){x.data("easytabs",{position:x.css("position"),visibility:x.css("visibility")});x.not(r.panelActiveClass).hide();f.panels=f.panels.add(x);A.data("easytabs").panel=x}else{f.tabs=f.tabs.not(A)}})};f.selectTab=function(x,C){var y=window.location,B=y.hash.match(/^[^\?]*/)[0],z=x.parent().data("easytabs").panel,A=x.parent().data("easytabs").ajax;if(r.collapsible&&!d&&(x.hasClass(r.tabActiveClass)||x.hasClass(r.collapsedClass))){f.toggleTabCollapse(x,z,A,C)}else{if(!x.hasClass(r.tabActiveClass)||!z.hasClass(r.panelActiveClass)){o(x,z,A,C)}else{if(!r.cache){o(x,z,A,C)}}}};f.toggleTabCollapse=function(x,y,z,A){f.panels.stop(true,true);if(u(q,"easytabs:before",[x,y,r])){f.tabs.filter("."+r.tabActiveClass).removeClass(r.tabActiveClass).children().removeClass(r.tabActiveClass);if(x.hasClass(r.collapsedClass)){if(z&&(!r.cache||!x.parent().data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[x,y]);y.load(z,function(C,B,D){x.parent().data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[x,y,C,B,D])})}x.parent().removeClass(r.collapsedClass).addClass(r.tabActiveClass).children().removeClass(r.collapsedClass).addClass(r.tabActiveClass);y.addClass(r.panelActiveClass)[v.uncollapse](v.speed,r.transitionUncollapseEasing,function(){q.trigger("easytabs:midTransition",[x,y,r]);if(typeof A=="function"){A()}})}else{x.addClass(r.collapsedClass).parent().addClass(r.collapsedClass);y.removeClass(r.panelActiveClass)[v.collapse](v.speed,r.transitionCollapseEasing,function(){q.trigger("easytabs:midTransition",[x,y,r]);if(typeof A=="function"){A()}})}}};f.matchTab=function(x){return f.tabs.find("[href='"+x+"'],[data-target='"+x+"']").first()};f.matchInPanel=function(x){return(x?f.panels.filter(":has("+x+")").first():[])};f.selectTabFromHashChange=function(){var y=window.location.hash.match(/^[^\?]*/)[0],x=f.matchTab(y),z;if(r.updateHash){if(x.length){d=true;f.selectTab(x)}else{z=f.matchInPanel(y);if(z.length){y="#"+z.attr("id");x=f.matchTab(y);d=true;f.selectTab(x)}else{if(!h.hasClass(r.tabActiveClass)&&!r.cycle){if(y===""||f.matchTab(m).length||q.closest(y).length){d=true;f.selectTab(l)}}}}}};f.cycleTabs=function(x){if(r.cycle){x=x%f.tabs.length;$tab=a(f.tabs[x]).children("a").first();d=true;f.selectTab($tab,function(){setTimeout(function(){f.cycleTabs(x+1)},r.cycle)})}};f.publicMethods={select:function(x){var y;if((y=f.tabs.filter(x)).length===0){if((y=f.tabs.find("a[href='"+x+"']")).length===0){if((y=f.tabs.find("a"+x)).length===0){if((y=f.tabs.find("[data-target='"+x+"']")).length===0){if((y=f.tabs.find("a[href$='"+x+"']")).length===0){a.error("Tab '"+x+"' does not exist in tab set")}}}}}else{y=y.children("a").first()}f.selectTab(y)}};var u=function(A,x,z){var y=a.Event(x);A.trigger(y,z);return y.result!==false};var b=function(){q.addClass(r.containerClass);f.tabs.parent().addClass(r.tabsClass);f.tabs.addClass(r.tabClass);f.panels.addClass(r.panelClass)};var g=function(){var y=window.location.hash.match(/^[^\?]*/)[0],x=f.matchTab(y).parent(),z;if(x.length===1){h=x;r.cycle=false}else{z=f.matchInPanel(y);if(z.length){y="#"+z.attr("id");h=f.matchTab(y).parent()}else{h=f.tabs.parent().find(r.defaultTab);if(h.length===0){a.error("The specified default tab ('"+r.defaultTab+"') could not be found in the tab set.")}}}l=h.children("a").first();p(x)};var p=function(z){var y,x;if(r.collapsible&&z.length===0&&r.collapsedByDefault){h.addClass(r.collapsedClass).children().addClass(r.collapsedClass)}else{y=a(h.data("easytabs").panel);x=h.data("easytabs").ajax;if(x&&(!r.cache||!h.data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[l,y]);y.load(x,function(B,A,C){h.data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[l,y,B,A,C])})}h.data("easytabs").panel.show().addClass(r.panelActiveClass);h.addClass(r.tabActiveClass).children().addClass(r.tabActiveClass)}};var w=function(){f.tabs.children("a").bind("click.easytabs",function(x){r.cycle=false;d=false;f.selectTab(a(this));x.preventDefault()})};var o=function(z,D,E,H){f.panels.stop(true,true);if(u(q,"easytabs:before",[z,D,r])){var A=f.panels.filter(":visible"),y=D.parent(),F,x,C,G,B=window.location.hash.match(/^[^\?]*/)[0];if(r.animate){F=s(D);x=A.length?k(A):0;C=F-x}m=B;G=function(){q.trigger("easytabs:midTransition",[z,D,r]);if(r.animate&&r.transitionIn=="fadeIn"){if(C<0){y.animate({height:y.height()+C},v.halfSpeed).css({"min-height":""})}}if(r.updateHash&&!d){window.location.hash="#"+D.attr("id")}else{d=false}D[v.show](v.speed,r.transitionInEasing,function(){y.css({height:"","min-height":""});q.trigger("easytabs:after",[z,D,r]);if(typeof H=="function"){H()}})};if(E&&(!r.cache||!z.parent().data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[z,D]);D.load(E,function(J,I,K){z.parent().data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[z,D,J,I,K])})}if(r.animate&&r.transitionOut=="fadeOut"){if(C>0){y.animate({height:(y.height()+C)},v.halfSpeed)}else{y.css({"min-height":y.height()})}}f.tabs.filter("."+r.tabActiveClass).removeClass(r.tabActiveClass).children().removeClass(r.tabActiveClass);f.tabs.filter("."+r.collapsedClass).removeClass(r.collapsedClass).children().removeClass(r.collapsedClass);z.parent().addClass(r.tabActiveClass).children().addClass(r.tabActiveClass);f.panels.filter("."+r.panelActiveClass).removeClass(r.panelActiveClass);D.addClass(r.panelActiveClass);if(A.length){A[v.hide](v.speed,r.transitionOutEasing,G)}else{D[v.uncollapse](v.speed,r.transitionUncollapseEasing,G)}}};var s=function(y){if(y.data("easytabs")&&y.data("easytabs").lastHeight){return y.data("easytabs").lastHeight}var z=y.css("display"),x=y.wrap(a("<div>",{position:"absolute",visibility:"hidden",overflow:"hidden"})).css({position:"relative",visibility:"hidden",display:"block"}).outerHeight();y.unwrap();y.css({position:y.data("easytabs").position,visibility:y.data("easytabs").visibility,display:z});y.data("easytabs").lastHeight=x;return x};var k=function(y){var x=y.outerHeight();if(y.data("easytabs")){y.data("easytabs").lastHeight=x}else{y.data("easytabs",{lastHeight:x})}return x};var n=function(){if(typeof a(window).hashchange==="function"){a(window).hashchange(function(){f.selectTabFromHashChange()})}else{if(a.address&&typeof a.address.change==="function"){a.address.change(function(){f.selectTabFromHashChange()})}}};var c=function(){var x;if(r.cycle){x=f.tabs.index(h);setTimeout(function(){f.cycleTabs(x+1)},r.cycle)}};f.init()};a.fn.easytabs=function(c){var b=arguments;return this.each(function(){var e=a(this),d=e.data("easytabs");if(undefined===d){d=new a.easytabs(this,c);e.data("easytabs",d)}if(d.publicMethods[c]){return d.publicMethods[c](Array.prototype.slice.call(b,1))}})}})(jQuery);
|
|
|
|
1 |
+
/*
|
2 |
+
* jQuery EasyTabs plugin 3.1.1
|
3 |
+
*
|
4 |
+
* Copyright (c) 2010-2011 Steve Schwartz (JangoSteve)
|
5 |
+
*
|
6 |
+
* Dual licensed under the MIT and GPL licenses:
|
7 |
+
* http://www.opensource.org/licenses/mit-license.php
|
8 |
+
* http://www.gnu.org/licenses/gpl.html
|
9 |
+
*
|
10 |
+
* Date: Tue Jan 26 16:30:00 2012 -0500
|
11 |
+
*/
|
12 |
+
(function(a){a.easytabs=function(j,e){var f=this,q=a(j),i={animate:true,panelActiveClass:"active",tabActiveClass:"active",defaultTab:"li:first-child",animationSpeed:"normal",tabs:"> ul > li",updateHash:true,cycle:false,collapsible:false,collapsedClass:"collapsed",collapsedByDefault:true,uiTabs:false,transitionIn:"fadeIn",transitionOut:"fadeOut",transitionInEasing:"swing",transitionOutEasing:"swing",transitionCollapse:"slideUp",transitionUncollapse:"slideDown",transitionCollapseEasing:"swing",transitionUncollapseEasing:"swing",containerClass:"",tabsClass:"",tabClass:"",panelClass:"",cache:true,panelContext:q},h,l,v,m,d,t={fast:200,normal:400,slow:600},r;f.init=function(){f.settings=r=a.extend({},i,e);if(r.uiTabs){r.tabActiveClass="ui-tabs-selected";r.containerClass="ui-tabs ui-widget ui-widget-content ui-corner-all";r.tabsClass="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all";r.tabClass="ui-state-default ui-corner-top";r.panelClass="ui-tabs-panel ui-widget-content ui-corner-bottom"}if(r.collapsible&&e.defaultTab!==undefined&&e.collpasedByDefault===undefined){r.collapsedByDefault=false}if(typeof(r.animationSpeed)==="string"){r.animationSpeed=t[r.animationSpeed]}a("a.anchor").remove().prependTo("body");q.data("easytabs",{});f.setTransitions();f.getTabs();b();g();w();n();c();q.attr("data-easytabs",true)};f.setTransitions=function(){v=(r.animate)?{show:r.transitionIn,hide:r.transitionOut,speed:r.animationSpeed,collapse:r.transitionCollapse,uncollapse:r.transitionUncollapse,halfSpeed:r.animationSpeed/2}:{show:"show",hide:"hide",speed:0,collapse:"hide",uncollapse:"show",halfSpeed:0}};f.getTabs=function(){var x;f.tabs=q.find(r.tabs),f.panels=a(),f.tabs.each(function(){var A=a(this),z=A.children("a"),y=A.children("a").data("target");A.data("easytabs",{});if(y!==undefined&&y!==null){A.data("easytabs").ajax=z.attr("href")}else{y=z.attr("href")}y=y.match(/#([^\?]+)/)[0].substr(1);x=r.panelContext.find("#"+y);if(x.length){x.data("easytabs",{position:x.css("position"),visibility:x.css("visibility")});x.not(r.panelActiveClass).hide();f.panels=f.panels.add(x);A.data("easytabs").panel=x}else{f.tabs=f.tabs.not(A)}})};f.selectTab=function(x,C){var y=window.location,B=y.hash.match(/^[^\?]*/)[0],z=x.parent().data("easytabs").panel,A=x.parent().data("easytabs").ajax;if(r.collapsible&&!d&&(x.hasClass(r.tabActiveClass)||x.hasClass(r.collapsedClass))){f.toggleTabCollapse(x,z,A,C)}else{if(!x.hasClass(r.tabActiveClass)||!z.hasClass(r.panelActiveClass)){o(x,z,A,C)}else{if(!r.cache){o(x,z,A,C)}}}};f.toggleTabCollapse=function(x,y,z,A){f.panels.stop(true,true);if(u(q,"easytabs:before",[x,y,r])){f.tabs.filter("."+r.tabActiveClass).removeClass(r.tabActiveClass).children().removeClass(r.tabActiveClass);if(x.hasClass(r.collapsedClass)){if(z&&(!r.cache||!x.parent().data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[x,y]);y.load(z,function(C,B,D){x.parent().data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[x,y,C,B,D])})}x.parent().removeClass(r.collapsedClass).addClass(r.tabActiveClass).children().removeClass(r.collapsedClass).addClass(r.tabActiveClass);y.addClass(r.panelActiveClass)[v.uncollapse](v.speed,r.transitionUncollapseEasing,function(){q.trigger("easytabs:midTransition",[x,y,r]);if(typeof A=="function"){A()}})}else{x.addClass(r.collapsedClass).parent().addClass(r.collapsedClass);y.removeClass(r.panelActiveClass)[v.collapse](v.speed,r.transitionCollapseEasing,function(){q.trigger("easytabs:midTransition",[x,y,r]);if(typeof A=="function"){A()}})}}};f.matchTab=function(x){return f.tabs.find("[href='"+x+"'],[data-target='"+x+"']").first()};f.matchInPanel=function(x){return(x?f.panels.filter(":has("+x+")").first():[])};f.selectTabFromHashChange=function(){var y=window.location.hash.match(/^[^\?]*/)[0],x=f.matchTab(y),z;if(r.updateHash){if(x.length){d=true;f.selectTab(x)}else{z=f.matchInPanel(y);if(z.length){y="#"+z.attr("id");x=f.matchTab(y);d=true;f.selectTab(x)}else{if(!h.hasClass(r.tabActiveClass)&&!r.cycle){if(y===""||f.matchTab(m).length||q.closest(y).length){d=true;f.selectTab(l)}}}}}};f.cycleTabs=function(x){if(r.cycle){x=x%f.tabs.length;$tab=a(f.tabs[x]).children("a").first();d=true;f.selectTab($tab,function(){setTimeout(function(){f.cycleTabs(x+1)},r.cycle)})}};f.publicMethods={select:function(x){var y;if((y=f.tabs.filter(x)).length===0){if((y=f.tabs.find("a[href='"+x+"']")).length===0){if((y=f.tabs.find("a"+x)).length===0){if((y=f.tabs.find("[data-target='"+x+"']")).length===0){if((y=f.tabs.find("a[href$='"+x+"']")).length===0){a.error("Tab '"+x+"' does not exist in tab set")}}}}}else{y=y.children("a").first()}f.selectTab(y)}};var u=function(A,x,z){var y=a.Event(x);A.trigger(y,z);return y.result!==false};var b=function(){q.addClass(r.containerClass);f.tabs.parent().addClass(r.tabsClass);f.tabs.addClass(r.tabClass);f.panels.addClass(r.panelClass)};var g=function(){var y=window.location.hash.match(/^[^\?]*/)[0],x=f.matchTab(y).parent(),z;if(x.length===1){h=x;r.cycle=false}else{z=f.matchInPanel(y);if(z.length){y="#"+z.attr("id");h=f.matchTab(y).parent()}else{h=f.tabs.parent().find(r.defaultTab);if(h.length===0){a.error("The specified default tab ('"+r.defaultTab+"') could not be found in the tab set.")}}}l=h.children("a").first();p(x)};var p=function(z){var y,x;if(r.collapsible&&z.length===0&&r.collapsedByDefault){h.addClass(r.collapsedClass).children().addClass(r.collapsedClass)}else{y=a(h.data("easytabs").panel);x=h.data("easytabs").ajax;if(x&&(!r.cache||!h.data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[l,y]);y.load(x,function(B,A,C){h.data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[l,y,B,A,C])})}h.data("easytabs").panel.show().addClass(r.panelActiveClass);h.addClass(r.tabActiveClass).children().addClass(r.tabActiveClass)}};var w=function(){f.tabs.children("a").bind("click.easytabs",function(x){r.cycle=false;d=false;f.selectTab(a(this));x.preventDefault()})};var o=function(z,D,E,H){f.panels.stop(true,true);if(u(q,"easytabs:before",[z,D,r])){var A=f.panels.filter(":visible"),y=D.parent(),F,x,C,G,B=window.location.hash.match(/^[^\?]*/)[0];if(r.animate){F=s(D);x=A.length?k(A):0;C=F-x}m=B;G=function(){q.trigger("easytabs:midTransition",[z,D,r]);if(r.animate&&r.transitionIn=="fadeIn"){if(C<0){y.animate({height:y.height()+C},v.halfSpeed).css({"min-height":""})}}if(r.updateHash&&!d){window.location.hash="#"+D.attr("id")}else{d=false}D[v.show](v.speed,r.transitionInEasing,function(){y.css({height:"","min-height":""});q.trigger("easytabs:after",[z,D,r]);if(typeof H=="function"){H()}})};if(E&&(!r.cache||!z.parent().data("easytabs").cached)){q.trigger("easytabs:ajax:beforeSend",[z,D]);D.load(E,function(J,I,K){z.parent().data("easytabs").cached=true;q.trigger("easytabs:ajax:complete",[z,D,J,I,K])})}if(r.animate&&r.transitionOut=="fadeOut"){if(C>0){y.animate({height:(y.height()+C)},v.halfSpeed)}else{y.css({"min-height":y.height()})}}f.tabs.filter("."+r.tabActiveClass).removeClass(r.tabActiveClass).children().removeClass(r.tabActiveClass);f.tabs.filter("."+r.collapsedClass).removeClass(r.collapsedClass).children().removeClass(r.collapsedClass);z.parent().addClass(r.tabActiveClass).children().addClass(r.tabActiveClass);f.panels.filter("."+r.panelActiveClass).removeClass(r.panelActiveClass);D.addClass(r.panelActiveClass);if(A.length){A[v.hide](v.speed,r.transitionOutEasing,G)}else{D[v.uncollapse](v.speed,r.transitionUncollapseEasing,G)}}};var s=function(y){if(y.data("easytabs")&&y.data("easytabs").lastHeight){return y.data("easytabs").lastHeight}var z=y.css("display"),x=y.wrap(a("<div>",{position:"absolute",visibility:"hidden",overflow:"hidden"})).css({position:"relative",visibility:"hidden",display:"block"}).outerHeight();y.unwrap();y.css({position:y.data("easytabs").position,visibility:y.data("easytabs").visibility,display:z});y.data("easytabs").lastHeight=x;return x};var k=function(y){var x=y.outerHeight();if(y.data("easytabs")){y.data("easytabs").lastHeight=x}else{y.data("easytabs",{lastHeight:x})}return x};var n=function(){if(typeof a(window).hashchange==="function"){a(window).hashchange(function(){f.selectTabFromHashChange()})}else{if(a.address&&typeof a.address.change==="function"){a.address.change(function(){f.selectTabFromHashChange()})}}};var c=function(){var x;if(r.cycle){x=f.tabs.index(h);setTimeout(function(){f.cycleTabs(x+1)},r.cycle)}};f.init()};a.fn.easytabs=function(c){var b=arguments;return this.each(function(){var e=a(this),d=e.data("easytabs");if(undefined===d){d=new a.easytabs(this,c);e.data("easytabs",d)}if(d.publicMethods[c]){return d.publicMethods[c](Array.prototype.slice.call(b,1))}})}})(jQuery);
|
13 |
+
|
14 |
+
|
admin/js/jquery.hashchange.min.js
CHANGED
@@ -1,9 +1,11 @@
|
|
1 |
-
/*
|
2 |
-
* jQuery hashchange event - v1.3 - 7/21/2010
|
3 |
-
* http://benalman.com/projects/jquery-hashchange-plugin/
|
4 |
-
*
|
5 |
-
* Copyright (c) 2010 "Cowboy" Ben Alman
|
6 |
-
* Dual licensed under the MIT and GPL licenses.
|
7 |
-
* http://benalman.com/about/license/
|
8 |
-
*/
|
|
|
|
|
9 |
(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
|
1 |
+
/*
|
2 |
+
* jQuery hashchange event - v1.3 - 7/21/2010
|
3 |
+
* http://benalman.com/projects/jquery-hashchange-plugin/
|
4 |
+
*
|
5 |
+
* Copyright (c) 2010 "Cowboy" Ben Alman
|
6 |
+
* Dual licensed under the MIT and GPL licenses.
|
7 |
+
* http://benalman.com/about/license/
|
8 |
+
*/
|
9 |
+
|
10 |
+
|
11 |
(function($,e,b){var c="hashchange",h=document,f,g=$.event.special,i=h.documentMode,d="on"+c in e&&(i===b||i>7);function a(j){j=j||location.href;return"#"+j.replace(/^[^#]*#?(.*)$/,"$1")}$.fn[c]=function(j){return j?this.bind(c,j):this.trigger(c)};$.fn[c].delay=50;g[c]=$.extend(g[c],{setup:function(){if(d){return false}$(f.start)},teardown:function(){if(d){return false}$(f.stop)}});f=(function(){var j={},p,m=a(),k=function(q){return q},l=k,o=k;j.start=function(){p||n()};j.stop=function(){p&&clearTimeout(p);p=b};function n(){var r=a(),q=o(m);if(r!==m){l(m=r,q);$(e).trigger(c)}else{if(q!==m){location.href=location.href.replace(/#.*/,"")+q}}p=setTimeout(n,$.fn[c].delay)}$.browser.msie&&!d&&(function(){var q,r;j.start=function(){if(!q){r=$.fn[c].src;r=r&&r+a();q=$('<iframe tabindex="-1" title="empty"/>').hide().one("load",function(){r||l(a());n()}).attr("src",r||"javascript:0").insertAfter("body")[0].contentWindow;h.onpropertychange=function(){try{if(event.propertyName==="title"){q.document.title=h.title}}catch(s){}}}};j.stop=k;o=function(){return a(q.location.href)};l=function(v,s){var u=q.document,t=$.fn[c].domain;if(v!==s){u.title=h.title;u.open();t&&u.write('<script>document.domain="'+t+'"<\/script>');u.close();q.location.hash=v}}})();return j})()})(jQuery,this);
|
css/jquery.rating.css
CHANGED
@@ -1,37 +1,18 @@
|
|
1 |
/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
|
2 |
-
|
3 |
div.rating-cancel,div.star-rating{float:left;width:17px;height:17px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
|
4 |
-
|
5 |
div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
|
6 |
-
|
7 |
div.star-rating,div.star-rating a{background:url(star.png) no-repeat 0 0px}
|
8 |
-
|
9 |
div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 -38px;border:0}
|
10 |
-
|
11 |
div.star-rating-on a{background-position:0 0px!important}
|
12 |
-
|
13 |
div.star-rating-hover a{background-position:0 -18px}
|
14 |
-
|
15 |
div.rating-cancel a:hover{background-position:0 -16px}
|
16 |
/* Read Only CSS */
|
17 |
-
|
18 |
div.star-rating-readonly a{cursor:default !important}
|
19 |
-
|
20 |
/* Partial Star CSS */
|
21 |
-
|
22 |
div.star-rating{background:transparent!important;overflow:hidden!important}
|
23 |
-
|
24 |
/* END jQuery.Rating Plugin CSS */
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
#tabs {
|
29 |
-
|
30 |
width:60%;
|
31 |
-
|
32 |
float:left;
|
33 |
-
|
34 |
margin-right:10px;
|
35 |
-
|
36 |
}
|
37 |
-
|
1 |
/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
|
|
|
2 |
div.rating-cancel,div.star-rating{float:left;width:17px;height:17px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
|
|
|
3 |
div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
|
|
|
4 |
div.star-rating,div.star-rating a{background:url(star.png) no-repeat 0 0px}
|
|
|
5 |
div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 -38px;border:0}
|
|
|
6 |
div.star-rating-on a{background-position:0 0px!important}
|
|
|
7 |
div.star-rating-hover a{background-position:0 -18px}
|
|
|
8 |
div.rating-cancel a:hover{background-position:0 -16px}
|
9 |
/* Read Only CSS */
|
|
|
10 |
div.star-rating-readonly a{cursor:default !important}
|
|
|
11 |
/* Partial Star CSS */
|
|
|
12 |
div.star-rating{background:transparent!important;overflow:hidden!important}
|
|
|
13 |
/* END jQuery.Rating Plugin CSS */
|
|
|
|
|
|
|
14 |
#tabs {
|
|
|
15 |
width:60%;
|
|
|
16 |
float:left;
|
|
|
17 |
margin-right:10px;
|
|
|
18 |
}
|
|
css/rating.css
CHANGED
@@ -1,27 +1,14 @@
|
|
1 |
/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
|
2 |
-
|
3 |
div.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
|
4 |
-
|
5 |
div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
|
6 |
-
|
7 |
div.star-rating,div.star-rating a{background:url(star.png) no-repeat 0 0px}
|
8 |
-
|
9 |
div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}
|
10 |
-
|
11 |
div.star-rating-on a{background-position:0 -16px!important}
|
12 |
-
|
13 |
div.star-rating-hover a{background-position:0 -32px}
|
14 |
-
|
15 |
/* Read Only CSS */
|
16 |
-
|
17 |
div.star-rating-readonly a{cursor:default !important}
|
18 |
-
|
19 |
/* Partial Star CSS */
|
20 |
-
|
21 |
div.star-rating{background:transparent!important;overflow:hidden!important}
|
22 |
-
|
23 |
div.star-block{float: left; width: 100%; margin-bottom: 15px}
|
24 |
-
|
25 |
p#star-block{float: left; width: 100%; margin-bottom: 10px}
|
26 |
-
|
27 |
/* END jQuery.Rating Plugin CSS */
|
1 |
/* jQuery.Rating Plugin CSS - http://www.fyneworks.com/jquery/star-rating/ */
|
|
|
2 |
div.rating-cancel,div.star-rating{float:left;width:17px;height:15px;text-indent:-999em;cursor:pointer;display:block;background:transparent;overflow:hidden}
|
|
|
3 |
div.rating-cancel,div.rating-cancel a{background:url(delete.gif) no-repeat 0 -16px}
|
|
|
4 |
div.star-rating,div.star-rating a{background:url(star.png) no-repeat 0 0px}
|
|
|
5 |
div.rating-cancel a,div.star-rating a{display:block;width:16px;height:100%;background-position:0 0px;border:0}
|
|
|
6 |
div.star-rating-on a{background-position:0 -16px!important}
|
|
|
7 |
div.star-rating-hover a{background-position:0 -32px}
|
|
|
8 |
/* Read Only CSS */
|
|
|
9 |
div.star-rating-readonly a{cursor:default !important}
|
|
|
10 |
/* Partial Star CSS */
|
|
|
11 |
div.star-rating{background:transparent!important;overflow:hidden!important}
|
|
|
12 |
div.star-block{float: left; width: 100%; margin-bottom: 15px}
|
|
|
13 |
p#star-block{float: left; width: 100%; margin-bottom: 10px}
|
|
|
14 |
/* END jQuery.Rating Plugin CSS */
|
css/star@2x.png
DELETED
Binary file
|
css/style.css
CHANGED
@@ -127,7 +127,9 @@ display: block;
|
|
127 |
}
|
128 |
.star-img img {
|
129 |
box-shadow: none;
|
130 |
-
margin: -2px
|
|
|
|
|
131 |
}
|
132 |
.snippet-label-img {
|
133 |
width: 37%;
|
@@ -171,20 +173,16 @@ display: block;
|
|
171 |
clear: both;
|
172 |
}
|
173 |
}
|
174 |
-
|
175 |
@media (max-width: 650px)
|
176 |
{
|
177 |
|
178 |
}
|
179 |
@media (max-width: 480px)
|
180 |
{
|
181 |
-
|
182 |
}
|
183 |
@media (max-width: 450px)
|
184 |
{
|
185 |
-
|
186 |
}
|
187 |
@media (max-width: 320px)
|
188 |
{
|
189 |
-
|
190 |
}
|
127 |
}
|
128 |
.star-img img {
|
129 |
box-shadow: none;
|
130 |
+
margin: -2px 2px;
|
131 |
+
border: none !important;
|
132 |
+
padding: 0 !important;
|
133 |
}
|
134 |
.snippet-label-img {
|
135 |
width: 37%;
|
173 |
clear: both;
|
174 |
}
|
175 |
}
|
|
|
176 |
@media (max-width: 650px)
|
177 |
{
|
178 |
|
179 |
}
|
180 |
@media (max-width: 480px)
|
181 |
{
|
|
|
182 |
}
|
183 |
@media (max-width: 450px)
|
184 |
{
|
|
|
185 |
}
|
186 |
@media (max-width: 320px)
|
187 |
{
|
|
|
188 |
}
|
functions.php
CHANGED
@@ -4,97 +4,66 @@
|
|
4 |
*
|
5 |
*/
|
6 |
//add_filter( 'bsf_meta_boxes', 'bsf_review_metaboxes' );
|
7 |
-
|
8 |
/**
|
9 |
* Define the metabox and field configurations.
|
10 |
*
|
11 |
* @param array $meta_boxes
|
12 |
* @return array
|
13 |
*/
|
14 |
-
|
15 |
add_action( 'init', 'bsf_initialize_bsf_meta_boxes', 9999 );
|
16 |
-
|
17 |
// Register an action for submitting rating
|
18 |
-
|
19 |
add_action( 'wp_ajax_nopriv_bsf_submit_rating', 'bsf_add_rating' );
|
20 |
add_action( 'wp_ajax_bsf_submit_rating', 'bsf_add_rating' );
|
21 |
-
|
22 |
// Register an action for updating rating
|
23 |
-
|
24 |
add_action( 'wp_ajax_nopriv_bsf_update_rating', 'bsf_update_rating' );
|
25 |
add_action( 'wp_ajax_bsf_update_rating', 'bsf_update_rating' );
|
26 |
-
|
27 |
// Include the Ajax library on the front end
|
28 |
add_action( 'wp_head', 'add_ajax_library' );
|
29 |
-
|
30 |
/**
|
31 |
* Initialize the metabox class.
|
32 |
*/
|
33 |
-
|
34 |
function bsf_initialize_bsf_meta_boxes() {
|
35 |
if ( ! class_exists( 'bsf_Meta_Box' ) )
|
36 |
require_once 'init.php';
|
37 |
}
|
38 |
-
|
39 |
//Function to display the rich snippet output below the content
|
40 |
function display_rich_snippet($content) {
|
41 |
-
|
42 |
global $post;
|
43 |
|
44 |
$args_color = get_option('bsf_custom');
|
45 |
-
|
46 |
$id = $post->ID;
|
47 |
-
|
48 |
$type = get_post_meta($id, '_bsf_post_type', true);
|
49 |
-
|
50 |
if($type == '1')
|
51 |
-
|
52 |
{
|
53 |
-
|
54 |
global $post;
|
55 |
|
56 |
$args_review = get_option('bsf_review');
|
57 |
-
|
58 |
-
// echo $post->ID;
|
59 |
-
|
60 |
$review = $content;
|
61 |
-
|
62 |
$review .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
63 |
|
64 |
if($args_review['review_title'] != "")
|
65 |
$review .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_review['review_title'].'</div>';
|
66 |
-
|
67 |
$review .= '<div class="snippet-markup" itemscope itemtype="http://data-vocabulary.org/Review">';
|
68 |
-
|
69 |
$item = get_post_meta( $post->ID, '_bsf_item_name', true );
|
70 |
-
|
71 |
$rating = get_post_meta( $post->ID, '_bsf_rating', true );
|
72 |
-
|
73 |
-
// $desc = get_post_meta( $post->ID, '_bsf_item_desc', true );
|
74 |
-
|
75 |
$reviewer = get_post_meta( $post->ID, '_bsf_item_reviewer', true);
|
76 |
-
|
77 |
$post_date = get_the_date('Y-m-d');
|
78 |
-
|
79 |
if(trim($reviewer) != "")
|
80 |
{
|
81 |
if($args_review['item_reviewer'] != "")
|
82 |
$review .= "<div class='snippet-label'>".$args_review['item_reviewer']."</div>";
|
83 |
-
|
84 |
$review .= " <div class='snippet-data'><span itemprop='reviewer'>".$reviewer."</span></div>";
|
85 |
}
|
86 |
if(isset($args_review['review_date']))
|
87 |
{
|
88 |
if( $args_review['review_date'] != "")
|
89 |
$review .= "<div class='snippet-label'>".$args_review['review_date'] ."</div>";
|
90 |
-
|
91 |
$review .= "<div class='snippet-data'> <time itemprop='dtreviewed' datetime='".$post_date."'>".$post_date."</time></div>";
|
92 |
}
|
93 |
if(trim($item) != "")
|
94 |
{
|
95 |
if( $args_review['item_name'] != "")
|
96 |
$review .= "<div class='snippet-label'>".$args_review['item_name']."</div>";
|
97 |
-
|
98 |
$review .= "<div class='snippet-data'> <span itemprop='itemreviewed'>".$item."</span></div>";
|
99 |
}
|
100 |
if(trim($rating) != "")
|
@@ -113,28 +82,15 @@ function display_rich_snippet($content) {
|
|
113 |
$review .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
|
114 |
}
|
115 |
$review .= '</span></div>';
|
116 |
-
|
117 |
}
|
118 |
-
/* if(trim($desc) != "")
|
119 |
-
{
|
120 |
-
if( $args_review['item_description'] != "")
|
121 |
-
$review .= "<div class='snippet-label'>".$args_review['item_description']."</div>";
|
122 |
-
|
123 |
-
$review .= "<div class='snippet-data'> <span itemprop='summary'>".$desc."</span></div>";
|
124 |
-
}*/
|
125 |
$review .= "</div>
|
126 |
</div><div style='clear:both;'></div>";
|
127 |
|
128 |
return ( is_single() || is_page() ) ? $review : $content;
|
129 |
-
|
130 |
}
|
131 |
-
|
132 |
else if($type == '2')
|
133 |
-
|
134 |
{
|
135 |
-
|
136 |
global $post;
|
137 |
-
|
138 |
$args_event = get_option('bsf_event');
|
139 |
|
140 |
$event = $content;
|
@@ -143,31 +99,17 @@ function display_rich_snippet($content) {
|
|
143 |
|
144 |
if($args_event['snippet_title'] != "")
|
145 |
$event .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_event['snippet_title'].'</div>';
|
146 |
-
|
147 |
$event .= '<div itemscope itemtype="http://data-vocabulary.org/Event">';
|
148 |
-
|
149 |
$event_title = get_post_meta( $post->ID, '_bsf_event_title', true );
|
150 |
-
|
151 |
$event_org = get_post_meta( $post->ID, '_bsf_event_organization', true );
|
152 |
-
|
153 |
$event_street = get_post_meta( $post->ID, '_bsf_event_street', true );
|
154 |
-
|
155 |
$event_local = get_post_meta( $post->ID, '_bsf_event_local', true );
|
156 |
-
|
157 |
$event_region = get_post_meta( $post->ID, '_bsf_event_region', true );
|
158 |
-
|
159 |
-
// $event_desc = get_post_meta( $post->ID, '_bsf_event_desc', true );
|
160 |
-
|
161 |
$event_start_date = get_post_meta( $post->ID, '_bsf_event_start_date', true );
|
162 |
-
|
163 |
$event_end_date = get_post_meta( $post->ID, '_bsf_event_end_date', true );
|
164 |
-
|
165 |
$event_geo_latitude = get_post_meta( $post->ID, '_bsf_event_geo_latitude', true );
|
166 |
-
|
167 |
$event_geo_longitude = get_post_meta( $post->ID, '_bsf_event_geo_longitude', true );
|
168 |
-
|
169 |
$event_photo = get_post_meta( $post->ID, '_bsf_event_photo', true );
|
170 |
-
|
171 |
if(trim($event_photo) != "")
|
172 |
{
|
173 |
$event .= '<div class="snippet-image"><img width="180" itemprop="photo" src="'.$event_photo.'"></div>';
|
@@ -186,44 +128,30 @@ function display_rich_snippet($content) {
|
|
186 |
{
|
187 |
if( $args_event['event_title'])
|
188 |
$event .= '<div class="snippet-label-img">'.$args_event['event_title'].'</div>';
|
189 |
-
|
190 |
$event .=' <div class="snippet-data-img"><span itemprop="summary">'.$event_title.'</span></div><div class="snippet-clear"></div>';
|
191 |
}
|
192 |
if(trim($event_org) != "")
|
193 |
{
|
194 |
if( $args_event['event_location'] != "")
|
195 |
$event .= '<div class="snippet-label-img">'.$args_event['event_location'].'</div>';
|
196 |
-
|
197 |
$event .=' <div class="snippet-data-img">
|
198 |
<span itemprop="location" itemscope itemtype="http://data-vocabulary.org/Organization">
|
199 |
-
|
200 |
<span itemprop="name">'.$event_org.'</span>,';
|
201 |
}
|
202 |
if(trim($event_street) != "")
|
203 |
-
|
204 |
$event .= '<span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
|
205 |
-
|
206 |
<span itemprop="street-address">'.$event_street.'</span>,';
|
207 |
-
|
208 |
if(trim($event_local) != "")
|
209 |
-
|
210 |
$event .= '<span itemprop="locality">'.$event_local.'</span>,';
|
211 |
-
|
212 |
if(trim($event_region) != "")
|
213 |
-
|
214 |
$event .= '<span itemprop="region">'.$event_region.'</span>';
|
215 |
-
|
216 |
$event .= '</span>';
|
217 |
-
|
218 |
$event .= ' <span itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">';
|
219 |
-
|
220 |
if(trim($event_geo_latitude) != "")
|
221 |
$event .= '<meta itemprop="latitude" content="'.$event_geo_latitude.'" />';
|
222 |
-
|
223 |
if(trim($event_geo_longitude) != "")
|
224 |
|
225 |
$event .= '<meta itemprop="longitude" content="'.$event_geo_longitude.'" />';
|
226 |
-
|
227 |
$event .= '</span>
|
228 |
</span>
|
229 |
</div><div class="snippet-clear"></div>';
|
@@ -238,118 +166,63 @@ function display_rich_snippet($content) {
|
|
238 |
{
|
239 |
if( $args_event['end_time'] != "")
|
240 |
$event .= '<div class="snippet-label-img">'.$args_event['end_time'].'</div>';
|
241 |
-
|
242 |
$event .= ' <div class="snippet-data-img"> <span itemprop="endDate" datetime="'.$event_end_date.'T00:00-00:00">'.$event_end_date.'</span></div><div class="snippet-clear"></div>';
|
243 |
}
|
244 |
$event .= '</div>
|
245 |
</div></div><div class="snippet-clear"></div>';
|
246 |
-
|
247 |
return ( is_single() || is_page() ) ? $event : $content;
|
248 |
-
|
249 |
}
|
250 |
-
|
251 |
else if($type == '4')
|
252 |
-
|
253 |
{
|
254 |
-
|
255 |
global $post;
|
256 |
-
|
257 |
$organization = $content;
|
258 |
-
|
259 |
$organization .= '<div class="snippet-title">Organization Brief :</div>';
|
260 |
-
|
261 |
$organization .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Organization">';
|
262 |
-
|
263 |
$org_name = get_post_meta( $post->ID,'_bsf_organization_name', true );
|
264 |
-
|
265 |
$org_url = get_post_meta( $post->ID,'_bsf_organization_url', true );
|
266 |
-
|
267 |
$org_tel = get_post_meta( $post->ID,'_bsf_organization_tel', true );
|
268 |
-
|
269 |
$org_street = get_post_meta( $post->ID,'_bsf_organization_street', true );
|
270 |
-
|
271 |
$org_local = get_post_meta( $post->ID,'_bsf_organization_local', true );
|
272 |
-
|
273 |
$org_region = get_post_meta( $post->ID,'_bsf_organization_region', true );
|
274 |
-
|
275 |
$org_zip = get_post_meta( $post->ID,'_bsf_organization_zip', true );
|
276 |
-
|
277 |
$org_country = get_post_meta( $post->ID,'_bsf_organization_country', true );
|
278 |
-
|
279 |
$org_latitude = get_post_meta( $post->ID,'_bsf_organization_latitude', true );
|
280 |
-
|
281 |
$org_longitude = get_post_meta( $post->ID,'_bsf_organization_longitude', true );
|
282 |
-
|
283 |
if(trim($org_name) != "")
|
284 |
-
|
285 |
$organization .= 'Organization Name : <span property="v:name">'.$org_name.'</span></div>';
|
286 |
-
|
287 |
if(trim($org_url) != "")
|
288 |
-
|
289 |
$organization .= 'Website : <a href="'.$org_url.'" rel="v:url">'.$org_url.'</a></div>';
|
290 |
-
|
291 |
if(trim($org_tel) != "")
|
292 |
-
|
293 |
$organization .= 'Telephone No. : <span property="v:tel">'.$org_tel.'</span></div>';
|
294 |
-
|
295 |
if(trim($org_street) != "")
|
296 |
-
|
297 |
$organization .= 'Address :
|
298 |
-
|
299 |
<span rel="v:address">
|
300 |
-
|
301 |
<span typeof="v:Address">
|
302 |
-
|
303 |
<span property="v:street-address">'.$org_street.'</span>';
|
304 |
-
|
305 |
if(trim($org_local) != "")
|
306 |
-
|
307 |
$organization .= '<span property="v:locality">'.$org_local.'</span>';
|
308 |
-
|
309 |
if(trim($org_region) != "")
|
310 |
-
|
311 |
$organization .= '<span property="v:region">'.$org_region.'</span>';
|
312 |
-
|
313 |
if(trim($org_zip) != "")
|
314 |
-
|
315 |
$organization .= '<span property="v:postal-code">'.$org_zip.'</span>';
|
316 |
-
|
317 |
if(trim($org_country) != "")
|
318 |
-
|
319 |
$organization .= '<span property="v:country-name">'.$org_country.'</span>
|
320 |
-
|
321 |
</span>
|
322 |
-
|
323 |
</span>';
|
324 |
-
|
325 |
if(trim($org_latitude) != "")
|
326 |
-
|
327 |
$organization .= 'GEO Location :
|
328 |
-
|
329 |
<span rel="v:geo">
|
330 |
-
|
331 |
<span typeof="v:Geo">
|
332 |
-
|
333 |
<span property="v:latitude" content="'.$org_latitude.'">'.$org_latitude.'</span> - ';
|
334 |
-
|
335 |
if(trim($org_longitude) != "")
|
336 |
-
|
337 |
$organization .= '<span property="v:longitude" content="'.$org_longitude.'">'.$org_longitude.'</span>
|
338 |
-
|
339 |
</span>
|
340 |
-
|
341 |
</span>';
|
342 |
-
|
343 |
$organization .= '</div><div style="clear:both;"></div>';
|
344 |
-
|
345 |
return ( is_single() || is_page() ) ? $organization : $content;
|
346 |
-
|
347 |
}
|
348 |
-
|
349 |
else if($type == '5')
|
350 |
-
|
351 |
{
|
352 |
-
|
353 |
global $post;
|
354 |
|
355 |
$args_person = get_option('bsf_person');
|
@@ -360,25 +233,15 @@ function display_rich_snippet($content) {
|
|
360 |
|
361 |
if($args_person['snippet_title'] != "")
|
362 |
$people .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_person['snippet_title'].'</div>';
|
363 |
-
|
364 |
$people .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Person">';
|
365 |
-
|
366 |
$people_fn = get_post_meta( $post->ID, '_bsf_people_fn', true );
|
367 |
-
|
368 |
$people_nickname = get_post_meta( $post->ID, '_bsf_people_nickname', true );
|
369 |
-
|
370 |
$people_photo = get_post_meta( $post->ID, '_bsf_people_photo', true );
|
371 |
-
|
372 |
$people_job_title = get_post_meta( $post->ID, '_bsf_people_job_title', true );
|
373 |
-
|
374 |
$people_website = get_post_meta( $post->ID, '_bsf_people_website', true );
|
375 |
-
|
376 |
$people_company = get_post_meta( $post->ID, '_bsf_people_company', true );
|
377 |
-
|
378 |
$people_local = get_post_meta( $post->ID, '_bsf_people_local', true );
|
379 |
-
|
380 |
$people_region = get_post_meta( $post->ID, '_bsf_people_region', true );
|
381 |
-
|
382 |
if(trim($people_photo) != "")
|
383 |
{
|
384 |
$people .= '<div class="snippet-image"><img width="180" src="'.$people_photo.'" rel="v:photo" /></div>';
|
@@ -403,109 +266,70 @@ function display_rich_snippet($content) {
|
|
403 |
{
|
404 |
if($args_person['person_nickname'] != "")
|
405 |
$people .= '<div class="snippet-label-img">'.$args_person['person_nickname'].'</div> ';
|
406 |
-
|
407 |
$people .= '<div class="snippet-data-img"> (<span property="v:nickname">'.$people_nickname.'</span>)</div><div class="snippet-clear"></div>';
|
408 |
}
|
409 |
if(trim($people_website) != "")
|
410 |
{
|
411 |
if($args_person['person_website'] != "")
|
412 |
$people .= '<div class="snippet-label-img">'.$args_person['person_website'].'</div> ';
|
413 |
-
|
414 |
$people .= '<div class="snippet-data-img"> <a href="'.$people_website.'" rel="v:url">'.$people_website.'</a></div><div class="snippet-clear"></div>';
|
415 |
}
|
416 |
if(trim($people_job_title) != "")
|
417 |
{
|
418 |
if($args_person['person_job_title'] != "")
|
419 |
$people .= '<div class="snippet-label-img">'.$args_person['person_job_title'].'</div> ';
|
420 |
-
|
421 |
$people .= '<div class="snippet-data-img"> <span property="v:title">'.$people_job_title.'</span></div><div class="snippet-clear"></div>';
|
422 |
}
|
423 |
if(trim($people_company) != "")
|
424 |
{
|
425 |
if($args_person['person_company'] != "")
|
426 |
$people .= '<div class="snippet-label-img">'.$args_person['person_company'].'</div> ';
|
427 |
-
|
428 |
$people .= '<div class="snippet-data-img"> <span property="v:affiliation">'.$people_company.'</span></div><div class="snippet-clear"></div>';
|
429 |
}
|
430 |
if(trim($people_local) != "")
|
431 |
{
|
432 |
if($args_person['person_address'] != "")
|
433 |
$people .= '<div class="snippet-label-img">'.$args_person['person_address'].'</div> ';
|
434 |
-
|
435 |
$people .= '<div class="snippet-data-img"> <span rel="v:address">
|
436 |
-
|
437 |
<span typeof="v:Address">
|
438 |
-
|
439 |
<span property="v:locality">'.$people_local.'</span>,';
|
440 |
}
|
441 |
if(trim($people_region) != "")
|
442 |
-
|
443 |
$people .= '<span property="v:region">'.$people_region.'</span>
|
444 |
-
|
445 |
</span>
|
446 |
-
|
447 |
</span></div><div class="snippet-clear"></div>';
|
448 |
-
|
449 |
$people .= '</div>
|
450 |
</div></div><div class="snippet-clear"></div>';
|
451 |
-
|
452 |
return ( is_single() || is_page() ) ? $people : $content;
|
453 |
-
|
454 |
}
|
455 |
-
|
456 |
else if($type == '6')
|
457 |
-
|
458 |
{
|
459 |
-
|
460 |
global $post;
|
461 |
-
|
462 |
$args_product = get_option('bsf_product');
|
463 |
-
|
464 |
$product = $content;
|
465 |
-
|
466 |
$product .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
467 |
-
|
468 |
if($args_product['snippet_title'] != "")
|
469 |
$product .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_product['snippet_title'];
|
470 |
-
|
471 |
$product .= bsf_do_rating();
|
472 |
|
473 |
$product .= '</div>';
|
474 |
-
|
475 |
$product .= '<div itemscope itemtype="http://data-vocabulary.org/Product">';
|
476 |
-
|
477 |
$product_rating = get_post_meta( $post->ID, '_bsf_product_rating', true);
|
478 |
-
|
479 |
$product_brand = get_post_meta( $post->ID, '_bsf_product_brand', true);
|
480 |
-
|
481 |
$product_name = get_post_meta( $post->ID, '_bsf_product_name', true);
|
482 |
-
|
483 |
$product_image = get_post_meta($post->ID, '_bsf_product_image', true);
|
484 |
-
|
485 |
$product_cat = get_post_meta($post->ID, '_bsf_product_cat', true);
|
486 |
-
|
487 |
$product_price = get_post_meta($post->ID, '_bsf_product_price', true);
|
488 |
-
|
489 |
$product_cur = get_post_meta($post->ID, '_bsf_product_cur', true);
|
490 |
-
|
491 |
$product_status = get_post_meta($post->ID, '_bsf_product_status', true);
|
492 |
-
|
493 |
if(trim($product_status) == "out_of_stock")
|
494 |
-
|
495 |
$availability = "Out of Stock";
|
496 |
-
|
497 |
else if(trim($product_status) == "in_stock")
|
498 |
-
|
499 |
$availability = "Available in Stock";
|
500 |
-
|
501 |
else if(trim($product_status) == "instore_only")
|
502 |
-
|
503 |
$availability = "Available in Store Only";
|
504 |
-
|
505 |
else if(trim($product_status) == "preorder")
|
506 |
-
|
507 |
$availability = "Pre-Order Only";
|
508 |
-
|
509 |
if(trim($product_image) != "")
|
510 |
{
|
511 |
$product .= '<div class="snippet-image"><img width="180" src="'.$product_image.'" itemprop="image" /></div>';
|
@@ -523,7 +347,6 @@ function display_rich_snippet($content) {
|
|
523 |
{
|
524 |
if($args_product['product_brand'] != "")
|
525 |
$product .= '<div class="snippet-label-img">'.$args_product['product_rating'].'</div>';
|
526 |
-
|
527 |
$product .= '<div class="snippet-data-img"><span class="star-img">';
|
528 |
for($i = 1; $i<=$product_rating; $i++)
|
529 |
{
|
@@ -534,10 +357,8 @@ function display_rich_snippet($content) {
|
|
534 |
if($j)
|
535 |
$product .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
|
536 |
}
|
537 |
-
|
538 |
$product .= '</span></div><div class="snippet-clear"></div>';
|
539 |
}
|
540 |
-
|
541 |
$product .= '<span itemprop="review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
|
542 |
if($args_product['product_agr'] != "")
|
543 |
{
|
@@ -546,53 +367,40 @@ function display_rich_snippet($content) {
|
|
546 |
$product .= '<div class="snippet-data-img">';
|
547 |
$product .= '<span itemprop="rating">'.average_rating().'</span>';
|
548 |
$product .= ' based on <span class="rating-count" itemprop="count">'.rating_count().'</span> reviews </span></div><div class="snippet-clear"></div>';
|
549 |
-
|
550 |
if(trim($product_brand) != "")
|
551 |
{
|
552 |
if($args_product['product_brand'] != "")
|
553 |
$product .= '<div class="snippet-label-img">'.$args_product['product_brand'].'</div>';
|
554 |
-
|
555 |
$product .= ' <div class="snippet-data-img"> <span itemprop="brand">'.$product_brand.'</span></div><div class="snippet-clear"></div>';
|
556 |
}
|
557 |
if(trim($product_name) != "")
|
558 |
{
|
559 |
if($args_product['product_name'] != "")
|
560 |
$product .= '<div class="snippet-label-img">'.$args_product['product_name'].'</div>';
|
561 |
-
|
562 |
$product .= ' <div class="snippet-data-img"> <span itemprop="name">'.$product_name.'</span></div><div class="snippet-clear"></div>';
|
563 |
}
|
564 |
if(trim($product_price) != "")
|
565 |
{
|
566 |
if($args_product['product_price'] != "")
|
567 |
$product .= '<div class="snippet-label-img">'.$args_product['product_price'].'</div>';
|
568 |
-
|
569 |
$product .= '<div class="snippet-data-img"> <span itemprop="offerDetails" itemscope itemtype="http://data-vocabulary.org/Offer">
|
570 |
-
|
571 |
<meta itemprop="currency" content="'.$product_cur.'" /><span itemprop="price">'.$product_cur.' '.$product_price.'</span></div><div class="snippet-clear"></div>';
|
572 |
}
|
573 |
if(trim($product_status) != "")
|
574 |
{
|
575 |
if($args_product['product_avail'] != "")
|
576 |
$product .= '<div class="snippet-label-img">'.$args_product['product_avail'].'</div>';
|
577 |
-
|
578 |
$product .= ' <div class="snippet-data-img"> <span itemprop="availability" content="'.$product_status.'">'.$availability.'</span></span></div><div class="snippet-clear"></div>';
|
579 |
}
|
580 |
-
|
581 |
$product .= '</div>
|
582 |
</div></div><div class="snippet-clear"></div>';
|
583 |
|
584 |
// $product .= getPostLikeLink($post->ID);
|
585 |
-
|
586 |
return ( is_single() || is_page() ) ? $product : $content;
|
587 |
-
|
588 |
}
|
589 |
-
|
590 |
else if($type == '7')
|
591 |
-
|
592 |
{
|
593 |
-
|
594 |
global $post;
|
595 |
-
|
596 |
$recipe = $content;
|
597 |
|
598 |
$recipe .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
@@ -605,27 +413,16 @@ function display_rich_snippet($content) {
|
|
605 |
$recipe .= bsf_do_rating();
|
606 |
}
|
607 |
$recipe .= '</div>';
|
608 |
-
|
609 |
$recipe .= '<div itemscope itemtype="http://data-vocabulary.org/Recipe">';
|
610 |
-
|
611 |
$recipes_name = get_post_meta( $post->ID, '_bsf_recipes_name', true );
|
612 |
-
|
613 |
$recipes_preptime = get_post_meta( $post->ID, '_bsf_recipes_preptime', true );
|
614 |
-
|
615 |
$recipes_cooktime = get_post_meta( $post->ID, '_bsf_recipes_cooktime', true );
|
616 |
-
|
617 |
$recipes_totaltime = get_post_meta( $post->ID, '_bsf_recipes_totaltime', true );
|
618 |
-
|
619 |
$recipes_photo = get_post_meta( $post->ID, '_bsf_recipes_photo', true );
|
620 |
-
|
621 |
$recipes_desc = get_post_meta( $post->ID, '_bsf_recipes_desc', true );
|
622 |
-
|
623 |
$recipes_ingredient = get_post_meta( $post->ID, '_bsf_recipes_ingredient', true );
|
624 |
-
|
625 |
$count = rating_count();
|
626 |
-
|
627 |
$agregate = average_rating();
|
628 |
-
|
629 |
if(trim($recipes_photo) != "")
|
630 |
{
|
631 |
$recipe .= '<div class="snippet-image"><img width="180" itemprop="photo" src="'.$recipes_photo.'"/></div>';
|
@@ -647,46 +444,26 @@ function display_rich_snippet($content) {
|
|
647 |
$recipe .= '<div class="snippet-data-img"><span itemprop="name">'.$recipes_name.'</span></div><div class="snippet-clear"></div>';
|
648 |
}
|
649 |
$recipe .= '<div class="snippet-label-img">Published on : </div><div class="snippet-data-img"><time datetime="'.get_the_date('Y-m-d').'" itemprop="published">'.get_the_date('Y-m-d').'</time></div><div class="snippet-clear"></div>';
|
650 |
-
|
651 |
if(trim($recipes_preptime) != "")
|
652 |
{
|
653 |
if($args_recipe['recipe_prep'] != "")
|
654 |
$recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_prep'].'</div>';
|
655 |
-
|
656 |
$recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_preptime.'" itemprop="prepTime">'.$recipes_preptime.'</time></div><div class="snippet-clear"></div>';
|
657 |
}
|
658 |
if(trim($recipes_cooktime) != "")
|
659 |
{
|
660 |
if($args_recipe['recipe_cook'] != "")
|
661 |
$recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_cook'].'</div>';
|
662 |
-
|
663 |
$recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_cooktime.'" itemprop="cookTime">'.$recipes_cooktime.'</span></div><div class="snippet-clear"></div> ';
|
664 |
}
|
665 |
if(trim($recipes_totaltime) != "")
|
666 |
{
|
667 |
if($args_recipe['recipe_time'] != "")
|
668 |
$recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_time'].'</div>';
|
669 |
-
|
670 |
$recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_totaltime.'" itemprop="totalTime">'.$recipes_totaltime.'</span></div><div class="snippet-clear"></div>';
|
671 |
}
|
672 |
-
/* if(trim($recipes_ingredient) != "")
|
673 |
-
{
|
674 |
-
if($args_recipe['recipe_ingred'] != "")
|
675 |
-
$recipe .= '<div class="snippet-label">'.$args_recipe['recipe_ingred'].'</div>';
|
676 |
-
|
677 |
-
$recipe .= '<div class="snippet-data-img"> <pre>'.$recipes_ingredient.'</pre></div>';
|
678 |
-
}
|
679 |
-
if(trim($recipes_desc) != "")
|
680 |
-
{
|
681 |
-
if($args_recipe['recipe_summary'] != "")
|
682 |
-
$recipe .= '<div class="snippet-label">'.$args_recipe['recipe_summary'].'</div>';
|
683 |
-
|
684 |
-
$recipe .= '<div class="snippet-data-img"> <span itemprop="summary">'.$recipes_desc.'</span></div>';
|
685 |
-
}
|
686 |
-
*/
|
687 |
if($args_recipe['recipe_rating'] != "")
|
688 |
$recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_rating'].'</div>';
|
689 |
-
|
690 |
$recipe .= ' <div class="snippet-data-img"> <span itemprop="review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate"><span itemprop="rating" class="rating-value">'.$agregate.'</span><span class="star-img">';
|
691 |
for($i = 1; $i<=$agregate; $i++)
|
692 |
{
|
@@ -697,49 +474,29 @@ function display_rich_snippet($content) {
|
|
697 |
if($j)
|
698 |
$recipe .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
|
699 |
}
|
700 |
-
|
701 |
$recipe .= '</span> Based on <span itemprop="count"><strong>'.$count.'</strong> </span> Review(s)</span></div><div class="snippet-clear"></div>';
|
702 |
-
|
703 |
$recipe .= '</div>
|
704 |
</div></div><div class="snippet-clear"></div>';
|
705 |
-
|
706 |
return ( is_single() || is_page() ) ? $recipe : $content;
|
707 |
-
|
708 |
}
|
709 |
-
|
710 |
else if($type == '8')
|
711 |
-
|
712 |
{
|
713 |
-
|
714 |
global $post;
|
715 |
-
|
716 |
$args_soft = get_option('bsf_software');
|
717 |
-
|
718 |
$software = $content;
|
719 |
|
720 |
$software .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
721 |
-
|
722 |
if($args_soft['snippet_title'] != "" )
|
723 |
$software .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_soft['snippet_title'].'</div>';
|
724 |
-
|
725 |
$software .= '<div itemscope itemtype="http://schema.org/SoftwareApplication">';
|
726 |
-
|
727 |
$software_rating = get_post_meta( $post->ID, '_bsf_software_rating', true);
|
728 |
-
|
729 |
$software_name = get_post_meta( $post->ID, '_bsf_software_name', true );
|
730 |
-
|
731 |
$software_desc = get_post_meta( $post->ID, '_bsf_software_desc', true );
|
732 |
-
|
733 |
$software_landing = get_post_meta( $post->ID, '_bsf_software_landing', true );
|
734 |
-
|
735 |
$software_image = get_post_meta( $post->ID, '_bsf_software_image', true );
|
736 |
-
|
737 |
$software_price = get_post_meta( $post->ID, '_bsf_software_price', true );
|
738 |
-
|
739 |
$software_cur = get_post_meta($post->ID, '_bsf_software_cur', true);
|
740 |
-
|
741 |
$software_os = get_post_meta( $post->ID, '_bsf_software_os', true );
|
742 |
-
|
743 |
if(trim($software_image) != "")
|
744 |
{
|
745 |
$software .= '<div class="snippet-image"><img width="180" src="'.$software_image.'" itemprop="image" /></div>';
|
@@ -757,7 +514,6 @@ function display_rich_snippet($content) {
|
|
757 |
{
|
758 |
if($args_soft['software_rating'] != "")
|
759 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_rating'].'</div>';
|
760 |
-
|
761 |
$software .= '<div class="snippet-data-img"> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span itemprop="ratingValue" class="rating-value">'.$software_rating.'</span></div><span class="star-img">';
|
762 |
for($i = 1; $i<=$software_rating; $i++)
|
763 |
{
|
@@ -775,25 +531,19 @@ function display_rich_snippet($content) {
|
|
775 |
{
|
776 |
if($args_soft['software_name'] != "")
|
777 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_name'].'</div>';
|
778 |
-
|
779 |
$software .= ' <div class="snippet-data-img"> <span itemprop="name">'.$software_name.'</span></div><div class="snippet-clear"></div>';
|
780 |
}
|
781 |
if(trim($software_os) != "")
|
782 |
{
|
783 |
if($args_soft['software_os'] != "")
|
784 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_os'].'</div>';
|
785 |
-
|
786 |
$software .= ' <div class="snippet-data-img"> <span itemprop="operatingSystems">'.$software_os.'</span></div><div class="snippet-clear"></div>';
|
787 |
}
|
788 |
if(trim($software_price) != "")
|
789 |
{
|
790 |
if($args_soft['software_price'] != "")
|
791 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_price'].'</div>';
|
792 |
-
|
793 |
-
// $software .= '<div class="snippet-data-img"> <div itemprop="offers" itemscope itemtype="http://schema.org/Offer"><span itemprop="price">'.$software_price.'</span></div></div>';
|
794 |
-
|
795 |
$software .= '<div class="snippet-data-img"> <span itemprop="offers" itemscope itemtype="http://data-vocabulary.org/Offer">
|
796 |
-
|
797 |
<meta itemprop="priceCurrency" content="'.$software_cur.'" />'.$software_cur.' <span itemprop="price"> '.$software_price.'</span></div><div class="snippet-clear"></div>';
|
798 |
|
799 |
}
|
@@ -801,52 +551,35 @@ function display_rich_snippet($content) {
|
|
801 |
{
|
802 |
if($args_soft['software_desc'] != "")
|
803 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_desc'].'</div>';
|
804 |
-
|
805 |
$software .= ' <div class="snippet-data-img"> <span itemprop="description">'.$software_desc.'</span></div><div class="snippet-clear"></div>';
|
806 |
}
|
807 |
if(trim($software_landing) != "")
|
808 |
{
|
809 |
if($args_soft['software_website'] != "")
|
810 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_website'].'</div>';
|
811 |
-
|
812 |
$software .= '<div class="snippet-data-img"> <a itemprop="url" href="'.$software_landing.'">'.$software_landing.'</a></div><div class="snippet-clear"></div>';
|
813 |
}
|
814 |
$software .= '</div>
|
815 |
</div></div><div class="snippet-clear"></div>';
|
816 |
-
|
817 |
return ( is_single() || is_page() ) ? $software : $content;
|
818 |
-
|
819 |
}
|
820 |
-
|
821 |
else if($type == '9')
|
822 |
-
|
823 |
{
|
824 |
-
|
825 |
global $post;
|
826 |
-
|
827 |
$args_video = get_option('bsf_video');
|
828 |
-
|
829 |
$video = $content;
|
830 |
|
831 |
$video .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
832 |
|
833 |
if($args_video['snippet_title'] != "" )
|
834 |
$video .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_video['snippet_title'].'</div>';
|
835 |
-
|
836 |
$video .= '<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">';
|
837 |
-
|
838 |
$video_title = get_post_meta( $post->ID, '_bsf_video_title', true );
|
839 |
-
|
840 |
$video_desc = get_post_meta( $post->ID, '_bsf_video_desc', true );
|
841 |
-
|
842 |
$video_thumb = get_post_meta( $post->ID, '_bsf_video_thumb', true );
|
843 |
-
|
844 |
$video_url = get_post_meta( $post->ID, '_bsf_video_url', true );
|
845 |
-
|
846 |
$video_duration = get_post_meta( $post->ID, '_bsf_video_duration', true );
|
847 |
-
|
848 |
$video_date = get_post_meta( $post->ID, '_bsf_video_date', true );
|
849 |
-
|
850 |
if(trim($video_url) != "")
|
851 |
{
|
852 |
$video .= '<div class="snippet-image"><a itemprop="url" href="'.$video_url.'"><img width="180" src="'.$video_thumb.'"></a></div>';
|
@@ -871,53 +604,89 @@ function display_rich_snippet($content) {
|
|
871 |
{
|
872 |
if($args_video['video_desc'] != "" )
|
873 |
$video .= '<div class="snippet-label-img">'.$args_video['video_desc'].'</div>';
|
874 |
-
|
875 |
$video .= '<div class="snippet-data-img"> <p itemprop="description">'.$video_desc.'</p></div><div class="snippet-clear"></div>';
|
876 |
}
|
877 |
if(trim($video_thumb) != "")
|
878 |
-
|
879 |
$video .= '<meta itemprop="thumbnail" content="'.$video_thumb.'">';
|
880 |
-
|
881 |
if(trim($video_duration) != "")
|
882 |
-
|
883 |
$video .= '<meta itemprop="duration" content="'.$video_duration.'">';
|
884 |
-
|
885 |
if(trim($video_date) != "")
|
886 |
-
|
887 |
$video .= '<meta itemprop="uploaddate" content="'.$video_date.'">';
|
888 |
-
|
889 |
$video .= '</div>
|
890 |
</div></div><div class="snippet-clear"></div>';
|
891 |
-
|
892 |
return ( is_single() || is_page() ) ? $video : $content;
|
893 |
-
|
894 |
-
|
895 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
896 |
return $content;
|
897 |
-
|
898 |
}
|
899 |
-
|
900 |
}
|
901 |
-
|
902 |
//Filter the content and return with rich snippet output
|
903 |
add_filter('the_content','display_rich_snippet');
|
904 |
-
|
905 |
require_once('meta-boxes.php');
|
906 |
-
|
907 |
function enque() {
|
908 |
-
|
909 |
wp_enqueue_style('rating_style', plugin_dir_url(__FILE__) . 'css/jquery.rating.css');
|
910 |
-
|
911 |
wp_enqueue_script('jquery');
|
912 |
-
|
913 |
wp_enqueue_script('jquery_rating', plugin_dir_url(__FILE__) . 'js/jquery.rating.min.js', array('jquery'));
|
914 |
|
915 |
wp_enqueue_script('ratina_js', plugin_dir_url(__FILE__) . 'js/retina.js', array('jquery'));
|
916 |
-
|
917 |
}
|
918 |
-
|
919 |
add_action('wp_enqueue_scripts', 'enque');
|
920 |
-
|
921 |
function get_the_ip() {
|
922 |
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
|
923 |
return $_SERVER["HTTP_X_FORWARDED_FOR"];
|
@@ -929,39 +698,17 @@ function get_the_ip() {
|
|
929 |
return $_SERVER["REMOTE_ADDR"];
|
930 |
}
|
931 |
}
|
932 |
-
|
933 |
function average_rating() {
|
934 |
-
|
935 |
// global $wpdb;
|
936 |
-
|
937 |
global $post;
|
938 |
|
939 |
$data = get_post_meta($post->ID, 'post-rating', false);
|
940 |
-
|
941 |
$post_id = $post->ID;
|
942 |
-
|
943 |
-
/* $ratings = $wpdb->get_results("
|
944 |
-
|
945 |
-
SELECT $wpdb->commentmeta.meta_value
|
946 |
-
|
947 |
-
FROM $wpdb->commentmeta
|
948 |
-
|
949 |
-
INNER JOIN $wpdb->comments on $wpdb->comments.comment_id=$wpdb->commentmeta.comment_id
|
950 |
-
|
951 |
-
WHERE $wpdb->commentmeta.meta_key='rating'
|
952 |
-
|
953 |
-
AND $wpdb->comments.comment_post_id=$post_id
|
954 |
-
|
955 |
-
AND $wpdb->comments.comment_approved =1
|
956 |
-
|
957 |
-
");
|
958 |
-
*/
|
959 |
if( !empty($data) )
|
960 |
{
|
961 |
$counter = 0;
|
962 |
|
963 |
$average_rating = 0;
|
964 |
-
|
965 |
foreach($data as $d)
|
966 |
{
|
967 |
$rating = $d['user_rating'];
|
@@ -971,38 +718,29 @@ function average_rating() {
|
|
971 |
$counter++;
|
972 |
|
973 |
}
|
974 |
-
|
975 |
//round the average to the nearast 1/2 point
|
976 |
-
|
977 |
return (round(($average_rating/$counter)*2,0)/2);
|
978 |
|
979 |
} else {
|
980 |
-
|
981 |
//no ratings
|
982 |
-
|
983 |
return 'no rating';
|
984 |
}
|
985 |
}
|
986 |
-
|
987 |
function rating_count()
|
988 |
{
|
989 |
global $post;
|
990 |
|
991 |
$data = get_post_meta($post->ID, 'post-rating', false);
|
992 |
-
|
993 |
return count($data);
|
994 |
-
|
995 |
}
|
996 |
function bsf_do_rating()
|
997 |
{
|
998 |
global $post;
|
999 |
-
|
1000 |
$ip = get_the_ip();
|
1001 |
|
1002 |
$ip_array = array();
|
1003 |
|
1004 |
$data = get_post_meta($post->ID, 'post-rating', false);
|
1005 |
-
|
1006 |
if( !empty($data))
|
1007 |
{
|
1008 |
foreach($data as $d)
|
@@ -1018,18 +756,6 @@ function bsf_do_rating()
|
|
1018 |
$rating = get_previous_rating($ip, $data);
|
1019 |
|
1020 |
$stars = bsf_display_rating($rating);
|
1021 |
-
/* $stars = '<span class="ratings">Your rating: <span class="star-img">';
|
1022 |
-
for($i = 1; $i<=$rating; $i++)
|
1023 |
-
{
|
1024 |
-
$stars .= '<img src="'.plugin_dir_url(__FILE__) .'images/1star.png">';
|
1025 |
-
}
|
1026 |
-
for($j = 0; $j<=5-$rating; $j++)
|
1027 |
-
{
|
1028 |
-
if($j)
|
1029 |
-
$stars .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
|
1030 |
-
}
|
1031 |
-
$stars .= '</span></span>';
|
1032 |
-
*/
|
1033 |
return $stars;
|
1034 |
}
|
1035 |
}
|
@@ -1037,7 +763,6 @@ function bsf_do_rating()
|
|
1037 |
{
|
1038 |
return display_rating();
|
1039 |
}
|
1040 |
-
|
1041 |
}
|
1042 |
function get_previous_rating($needle, $haystack, $strict = false) {
|
1043 |
foreach ($haystack as $item) {
|
@@ -1045,7 +770,6 @@ function get_previous_rating($needle, $haystack, $strict = false) {
|
|
1045 |
return $item['user_rating'];
|
1046 |
}
|
1047 |
}
|
1048 |
-
|
1049 |
return false;
|
1050 |
}
|
1051 |
function add_ajax_library() {
|
@@ -1056,7 +780,6 @@ function add_ajax_library() {
|
|
1056 |
|
1057 |
echo $html;
|
1058 |
}
|
1059 |
-
|
1060 |
function bsf_add_rating()
|
1061 |
{
|
1062 |
// ob_clean();
|
@@ -1073,7 +796,6 @@ function bsf_add_rating()
|
|
1073 |
$user_rating = array('post_id' => $postid, 'user_ip' => $ip, 'user_rating' => $stars);
|
1074 |
|
1075 |
echo false == add_post_meta($postid, 'post-rating', $user_rating) ? 'Error adding your rating' : 'Ratings added successfully !';
|
1076 |
-
|
1077 |
die();
|
1078 |
}
|
1079 |
function bsf_update_rating()
|
@@ -1093,38 +815,22 @@ function bsf_update_rating()
|
|
1093 |
$user_rating = array('post_id' => $postid, 'user_ip' => $ip, 'user_rating' => $stars);
|
1094 |
|
1095 |
echo false == update_post_meta($postid, 'post-rating', $user_rating, $prev_data) ? 'Error updating your rating' : 'Ratings updated successfully !';
|
1096 |
-
|
1097 |
die();
|
1098 |
}
|
1099 |
-
|
1100 |
function display_rating() {
|
1101 |
|
1102 |
global $post;
|
1103 |
-
|
1104 |
$rating = '<span class="ratings"><div class="star-blocks">';
|
1105 |
-
|
1106 |
$rating .= '<form name="rating" method="post" action="'. get_permalink() .'" id="bsf-rating" onsubmit="return false;">';
|
1107 |
-
|
1108 |
$rating .= '<input type="radio" name="star-review" class="star star-1" value="1"/>';
|
1109 |
-
|
1110 |
$rating .= '<input type="radio" name="star-review" class="star star-2" value="2"/>';
|
1111 |
-
|
1112 |
$rating .= '<input type="radio" name="star-review" class="star star-3" value="3"/>';
|
1113 |
-
|
1114 |
$rating .= '<input type="radio" name="star-review" class="star star-4" value="4"/>';
|
1115 |
-
|
1116 |
$rating .= '<input type="radio" name="star-review" class="star star-5" value="5"/>';
|
1117 |
-
|
1118 |
$rating .= '<input type="hidden" name="ip" value="'.get_the_ip().'" />';
|
1119 |
-
|
1120 |
$rating .= '<input type="hidden" name="post_id" value="'.$post->ID.'" />';
|
1121 |
-
|
1122 |
-
// $rating .= '<input id="submit_rating" type="submit" name="submit" value="Submit" />';
|
1123 |
-
|
1124 |
$rating .= '</form>';
|
1125 |
-
|
1126 |
$rating .= '</div></span>';
|
1127 |
-
|
1128 |
$script = '<script type="text/javascript">
|
1129 |
jQuery("#bsf-rating").click(function()
|
1130 |
{
|
@@ -1140,40 +846,23 @@ function display_rating() {
|
|
1140 |
});
|
1141 |
</script>
|
1142 |
';
|
1143 |
-
|
1144 |
$rating .= $script;
|
1145 |
-
|
1146 |
return $rating;
|
1147 |
-
|
1148 |
}
|
1149 |
function bsf_display_rating($n) {
|
1150 |
|
1151 |
global $post;
|
1152 |
-
|
1153 |
$rating = '<span class="ratings"><div class="star-blocks">';
|
1154 |
-
|
1155 |
$rating .= '<form name="rating" method="post" action="'. get_permalink() .'" id="bsf-rating" onsubmit="return false;">';
|
1156 |
-
|
1157 |
$rating .= '<input type="radio" name="star-review" class="star star-1" value="1" '; $n == 1 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
1158 |
-
|
1159 |
$rating .= '<input type="radio" name="star-review" class="star star-2" value="2" '; $n == 2 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
1160 |
-
|
1161 |
$rating .= '<input type="radio" name="star-review" class="star star-3" value="3" '; $n == 3 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
1162 |
-
|
1163 |
$rating .= '<input type="radio" name="star-review" class="star star-4" value="4" '; $n == 4 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
1164 |
-
|
1165 |
$rating .= '<input type="radio" name="star-review" class="star star-5" value="5" '; $n == 5 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
1166 |
-
|
1167 |
$rating .= '<input type="hidden" name="ip" value="'.get_the_ip().'" />';
|
1168 |
-
|
1169 |
$rating .= '<input type="hidden" name="post_id" value="'.$post->ID.'" />';
|
1170 |
-
|
1171 |
-
// $rating .= '<input id="submit_rating" type="submit" name="submit" value="Submit" />';
|
1172 |
-
|
1173 |
$rating .= '</form>';
|
1174 |
-
|
1175 |
$rating .= '</div></span>';
|
1176 |
-
|
1177 |
$script = '<script type="text/javascript">
|
1178 |
jQuery("#bsf-rating").click(function()
|
1179 |
{
|
@@ -1189,9 +878,6 @@ function bsf_display_rating($n) {
|
|
1189 |
});
|
1190 |
</script>
|
1191 |
';
|
1192 |
-
|
1193 |
$rating .= $script;
|
1194 |
-
|
1195 |
return $rating;
|
1196 |
-
|
1197 |
}
|
4 |
*
|
5 |
*/
|
6 |
//add_filter( 'bsf_meta_boxes', 'bsf_review_metaboxes' );
|
|
|
7 |
/**
|
8 |
* Define the metabox and field configurations.
|
9 |
*
|
10 |
* @param array $meta_boxes
|
11 |
* @return array
|
12 |
*/
|
|
|
13 |
add_action( 'init', 'bsf_initialize_bsf_meta_boxes', 9999 );
|
|
|
14 |
// Register an action for submitting rating
|
|
|
15 |
add_action( 'wp_ajax_nopriv_bsf_submit_rating', 'bsf_add_rating' );
|
16 |
add_action( 'wp_ajax_bsf_submit_rating', 'bsf_add_rating' );
|
|
|
17 |
// Register an action for updating rating
|
|
|
18 |
add_action( 'wp_ajax_nopriv_bsf_update_rating', 'bsf_update_rating' );
|
19 |
add_action( 'wp_ajax_bsf_update_rating', 'bsf_update_rating' );
|
|
|
20 |
// Include the Ajax library on the front end
|
21 |
add_action( 'wp_head', 'add_ajax_library' );
|
|
|
22 |
/**
|
23 |
* Initialize the metabox class.
|
24 |
*/
|
|
|
25 |
function bsf_initialize_bsf_meta_boxes() {
|
26 |
if ( ! class_exists( 'bsf_Meta_Box' ) )
|
27 |
require_once 'init.php';
|
28 |
}
|
|
|
29 |
//Function to display the rich snippet output below the content
|
30 |
function display_rich_snippet($content) {
|
|
|
31 |
global $post;
|
32 |
|
33 |
$args_color = get_option('bsf_custom');
|
|
|
34 |
$id = $post->ID;
|
|
|
35 |
$type = get_post_meta($id, '_bsf_post_type', true);
|
|
|
36 |
if($type == '1')
|
|
|
37 |
{
|
|
|
38 |
global $post;
|
39 |
|
40 |
$args_review = get_option('bsf_review');
|
|
|
|
|
|
|
41 |
$review = $content;
|
|
|
42 |
$review .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
43 |
|
44 |
if($args_review['review_title'] != "")
|
45 |
$review .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_review['review_title'].'</div>';
|
|
|
46 |
$review .= '<div class="snippet-markup" itemscope itemtype="http://data-vocabulary.org/Review">';
|
|
|
47 |
$item = get_post_meta( $post->ID, '_bsf_item_name', true );
|
|
|
48 |
$rating = get_post_meta( $post->ID, '_bsf_rating', true );
|
|
|
|
|
|
|
49 |
$reviewer = get_post_meta( $post->ID, '_bsf_item_reviewer', true);
|
|
|
50 |
$post_date = get_the_date('Y-m-d');
|
|
|
51 |
if(trim($reviewer) != "")
|
52 |
{
|
53 |
if($args_review['item_reviewer'] != "")
|
54 |
$review .= "<div class='snippet-label'>".$args_review['item_reviewer']."</div>";
|
|
|
55 |
$review .= " <div class='snippet-data'><span itemprop='reviewer'>".$reviewer."</span></div>";
|
56 |
}
|
57 |
if(isset($args_review['review_date']))
|
58 |
{
|
59 |
if( $args_review['review_date'] != "")
|
60 |
$review .= "<div class='snippet-label'>".$args_review['review_date'] ."</div>";
|
|
|
61 |
$review .= "<div class='snippet-data'> <time itemprop='dtreviewed' datetime='".$post_date."'>".$post_date."</time></div>";
|
62 |
}
|
63 |
if(trim($item) != "")
|
64 |
{
|
65 |
if( $args_review['item_name'] != "")
|
66 |
$review .= "<div class='snippet-label'>".$args_review['item_name']."</div>";
|
|
|
67 |
$review .= "<div class='snippet-data'> <span itemprop='itemreviewed'>".$item."</span></div>";
|
68 |
}
|
69 |
if(trim($rating) != "")
|
82 |
$review .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
|
83 |
}
|
84 |
$review .= '</span></div>';
|
|
|
85 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
86 |
$review .= "</div>
|
87 |
</div><div style='clear:both;'></div>";
|
88 |
|
89 |
return ( is_single() || is_page() ) ? $review : $content;
|
|
|
90 |
}
|
|
|
91 |
else if($type == '2')
|
|
|
92 |
{
|
|
|
93 |
global $post;
|
|
|
94 |
$args_event = get_option('bsf_event');
|
95 |
|
96 |
$event = $content;
|
99 |
|
100 |
if($args_event['snippet_title'] != "")
|
101 |
$event .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_event['snippet_title'].'</div>';
|
|
|
102 |
$event .= '<div itemscope itemtype="http://data-vocabulary.org/Event">';
|
|
|
103 |
$event_title = get_post_meta( $post->ID, '_bsf_event_title', true );
|
|
|
104 |
$event_org = get_post_meta( $post->ID, '_bsf_event_organization', true );
|
|
|
105 |
$event_street = get_post_meta( $post->ID, '_bsf_event_street', true );
|
|
|
106 |
$event_local = get_post_meta( $post->ID, '_bsf_event_local', true );
|
|
|
107 |
$event_region = get_post_meta( $post->ID, '_bsf_event_region', true );
|
|
|
|
|
|
|
108 |
$event_start_date = get_post_meta( $post->ID, '_bsf_event_start_date', true );
|
|
|
109 |
$event_end_date = get_post_meta( $post->ID, '_bsf_event_end_date', true );
|
|
|
110 |
$event_geo_latitude = get_post_meta( $post->ID, '_bsf_event_geo_latitude', true );
|
|
|
111 |
$event_geo_longitude = get_post_meta( $post->ID, '_bsf_event_geo_longitude', true );
|
|
|
112 |
$event_photo = get_post_meta( $post->ID, '_bsf_event_photo', true );
|
|
|
113 |
if(trim($event_photo) != "")
|
114 |
{
|
115 |
$event .= '<div class="snippet-image"><img width="180" itemprop="photo" src="'.$event_photo.'"></div>';
|
128 |
{
|
129 |
if( $args_event['event_title'])
|
130 |
$event .= '<div class="snippet-label-img">'.$args_event['event_title'].'</div>';
|
|
|
131 |
$event .=' <div class="snippet-data-img"><span itemprop="summary">'.$event_title.'</span></div><div class="snippet-clear"></div>';
|
132 |
}
|
133 |
if(trim($event_org) != "")
|
134 |
{
|
135 |
if( $args_event['event_location'] != "")
|
136 |
$event .= '<div class="snippet-label-img">'.$args_event['event_location'].'</div>';
|
|
|
137 |
$event .=' <div class="snippet-data-img">
|
138 |
<span itemprop="location" itemscope itemtype="http://data-vocabulary.org/Organization">
|
|
|
139 |
<span itemprop="name">'.$event_org.'</span>,';
|
140 |
}
|
141 |
if(trim($event_street) != "")
|
|
|
142 |
$event .= '<span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">
|
|
|
143 |
<span itemprop="street-address">'.$event_street.'</span>,';
|
|
|
144 |
if(trim($event_local) != "")
|
|
|
145 |
$event .= '<span itemprop="locality">'.$event_local.'</span>,';
|
|
|
146 |
if(trim($event_region) != "")
|
|
|
147 |
$event .= '<span itemprop="region">'.$event_region.'</span>';
|
|
|
148 |
$event .= '</span>';
|
|
|
149 |
$event .= ' <span itemprop="geo" itemscope itemtype="http://data-vocabulary.org/Geo">';
|
|
|
150 |
if(trim($event_geo_latitude) != "")
|
151 |
$event .= '<meta itemprop="latitude" content="'.$event_geo_latitude.'" />';
|
|
|
152 |
if(trim($event_geo_longitude) != "")
|
153 |
|
154 |
$event .= '<meta itemprop="longitude" content="'.$event_geo_longitude.'" />';
|
|
|
155 |
$event .= '</span>
|
156 |
</span>
|
157 |
</div><div class="snippet-clear"></div>';
|
166 |
{
|
167 |
if( $args_event['end_time'] != "")
|
168 |
$event .= '<div class="snippet-label-img">'.$args_event['end_time'].'</div>';
|
|
|
169 |
$event .= ' <div class="snippet-data-img"> <span itemprop="endDate" datetime="'.$event_end_date.'T00:00-00:00">'.$event_end_date.'</span></div><div class="snippet-clear"></div>';
|
170 |
}
|
171 |
$event .= '</div>
|
172 |
</div></div><div class="snippet-clear"></div>';
|
|
|
173 |
return ( is_single() || is_page() ) ? $event : $content;
|
|
|
174 |
}
|
|
|
175 |
else if($type == '4')
|
|
|
176 |
{
|
|
|
177 |
global $post;
|
|
|
178 |
$organization = $content;
|
|
|
179 |
$organization .= '<div class="snippet-title">Organization Brief :</div>';
|
|
|
180 |
$organization .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Organization">';
|
|
|
181 |
$org_name = get_post_meta( $post->ID,'_bsf_organization_name', true );
|
|
|
182 |
$org_url = get_post_meta( $post->ID,'_bsf_organization_url', true );
|
|
|
183 |
$org_tel = get_post_meta( $post->ID,'_bsf_organization_tel', true );
|
|
|
184 |
$org_street = get_post_meta( $post->ID,'_bsf_organization_street', true );
|
|
|
185 |
$org_local = get_post_meta( $post->ID,'_bsf_organization_local', true );
|
|
|
186 |
$org_region = get_post_meta( $post->ID,'_bsf_organization_region', true );
|
|
|
187 |
$org_zip = get_post_meta( $post->ID,'_bsf_organization_zip', true );
|
|
|
188 |
$org_country = get_post_meta( $post->ID,'_bsf_organization_country', true );
|
|
|
189 |
$org_latitude = get_post_meta( $post->ID,'_bsf_organization_latitude', true );
|
|
|
190 |
$org_longitude = get_post_meta( $post->ID,'_bsf_organization_longitude', true );
|
|
|
191 |
if(trim($org_name) != "")
|
|
|
192 |
$organization .= 'Organization Name : <span property="v:name">'.$org_name.'</span></div>';
|
|
|
193 |
if(trim($org_url) != "")
|
|
|
194 |
$organization .= 'Website : <a href="'.$org_url.'" rel="v:url">'.$org_url.'</a></div>';
|
|
|
195 |
if(trim($org_tel) != "")
|
|
|
196 |
$organization .= 'Telephone No. : <span property="v:tel">'.$org_tel.'</span></div>';
|
|
|
197 |
if(trim($org_street) != "")
|
|
|
198 |
$organization .= 'Address :
|
|
|
199 |
<span rel="v:address">
|
|
|
200 |
<span typeof="v:Address">
|
|
|
201 |
<span property="v:street-address">'.$org_street.'</span>';
|
|
|
202 |
if(trim($org_local) != "")
|
|
|
203 |
$organization .= '<span property="v:locality">'.$org_local.'</span>';
|
|
|
204 |
if(trim($org_region) != "")
|
|
|
205 |
$organization .= '<span property="v:region">'.$org_region.'</span>';
|
|
|
206 |
if(trim($org_zip) != "")
|
|
|
207 |
$organization .= '<span property="v:postal-code">'.$org_zip.'</span>';
|
|
|
208 |
if(trim($org_country) != "")
|
|
|
209 |
$organization .= '<span property="v:country-name">'.$org_country.'</span>
|
|
|
210 |
</span>
|
|
|
211 |
</span>';
|
|
|
212 |
if(trim($org_latitude) != "")
|
|
|
213 |
$organization .= 'GEO Location :
|
|
|
214 |
<span rel="v:geo">
|
|
|
215 |
<span typeof="v:Geo">
|
|
|
216 |
<span property="v:latitude" content="'.$org_latitude.'">'.$org_latitude.'</span> - ';
|
|
|
217 |
if(trim($org_longitude) != "")
|
|
|
218 |
$organization .= '<span property="v:longitude" content="'.$org_longitude.'">'.$org_longitude.'</span>
|
|
|
219 |
</span>
|
|
|
220 |
</span>';
|
|
|
221 |
$organization .= '</div><div style="clear:both;"></div>';
|
|
|
222 |
return ( is_single() || is_page() ) ? $organization : $content;
|
|
|
223 |
}
|
|
|
224 |
else if($type == '5')
|
|
|
225 |
{
|
|
|
226 |
global $post;
|
227 |
|
228 |
$args_person = get_option('bsf_person');
|
233 |
|
234 |
if($args_person['snippet_title'] != "")
|
235 |
$people .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_person['snippet_title'].'</div>';
|
|
|
236 |
$people .= '<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Person">';
|
|
|
237 |
$people_fn = get_post_meta( $post->ID, '_bsf_people_fn', true );
|
|
|
238 |
$people_nickname = get_post_meta( $post->ID, '_bsf_people_nickname', true );
|
|
|
239 |
$people_photo = get_post_meta( $post->ID, '_bsf_people_photo', true );
|
|
|
240 |
$people_job_title = get_post_meta( $post->ID, '_bsf_people_job_title', true );
|
|
|
241 |
$people_website = get_post_meta( $post->ID, '_bsf_people_website', true );
|
|
|
242 |
$people_company = get_post_meta( $post->ID, '_bsf_people_company', true );
|
|
|
243 |
$people_local = get_post_meta( $post->ID, '_bsf_people_local', true );
|
|
|
244 |
$people_region = get_post_meta( $post->ID, '_bsf_people_region', true );
|
|
|
245 |
if(trim($people_photo) != "")
|
246 |
{
|
247 |
$people .= '<div class="snippet-image"><img width="180" src="'.$people_photo.'" rel="v:photo" /></div>';
|
266 |
{
|
267 |
if($args_person['person_nickname'] != "")
|
268 |
$people .= '<div class="snippet-label-img">'.$args_person['person_nickname'].'</div> ';
|
|
|
269 |
$people .= '<div class="snippet-data-img"> (<span property="v:nickname">'.$people_nickname.'</span>)</div><div class="snippet-clear"></div>';
|
270 |
}
|
271 |
if(trim($people_website) != "")
|
272 |
{
|
273 |
if($args_person['person_website'] != "")
|
274 |
$people .= '<div class="snippet-label-img">'.$args_person['person_website'].'</div> ';
|
|
|
275 |
$people .= '<div class="snippet-data-img"> <a href="'.$people_website.'" rel="v:url">'.$people_website.'</a></div><div class="snippet-clear"></div>';
|
276 |
}
|
277 |
if(trim($people_job_title) != "")
|
278 |
{
|
279 |
if($args_person['person_job_title'] != "")
|
280 |
$people .= '<div class="snippet-label-img">'.$args_person['person_job_title'].'</div> ';
|
|
|
281 |
$people .= '<div class="snippet-data-img"> <span property="v:title">'.$people_job_title.'</span></div><div class="snippet-clear"></div>';
|
282 |
}
|
283 |
if(trim($people_company) != "")
|
284 |
{
|
285 |
if($args_person['person_company'] != "")
|
286 |
$people .= '<div class="snippet-label-img">'.$args_person['person_company'].'</div> ';
|
|
|
287 |
$people .= '<div class="snippet-data-img"> <span property="v:affiliation">'.$people_company.'</span></div><div class="snippet-clear"></div>';
|
288 |
}
|
289 |
if(trim($people_local) != "")
|
290 |
{
|
291 |
if($args_person['person_address'] != "")
|
292 |
$people .= '<div class="snippet-label-img">'.$args_person['person_address'].'</div> ';
|
|
|
293 |
$people .= '<div class="snippet-data-img"> <span rel="v:address">
|
|
|
294 |
<span typeof="v:Address">
|
|
|
295 |
<span property="v:locality">'.$people_local.'</span>,';
|
296 |
}
|
297 |
if(trim($people_region) != "")
|
|
|
298 |
$people .= '<span property="v:region">'.$people_region.'</span>
|
|
|
299 |
</span>
|
|
|
300 |
</span></div><div class="snippet-clear"></div>';
|
|
|
301 |
$people .= '</div>
|
302 |
</div></div><div class="snippet-clear"></div>';
|
|
|
303 |
return ( is_single() || is_page() ) ? $people : $content;
|
|
|
304 |
}
|
|
|
305 |
else if($type == '6')
|
|
|
306 |
{
|
|
|
307 |
global $post;
|
|
|
308 |
$args_product = get_option('bsf_product');
|
|
|
309 |
$product = $content;
|
|
|
310 |
$product .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
|
|
311 |
if($args_product['snippet_title'] != "")
|
312 |
$product .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_product['snippet_title'];
|
|
|
313 |
$product .= bsf_do_rating();
|
314 |
|
315 |
$product .= '</div>';
|
|
|
316 |
$product .= '<div itemscope itemtype="http://data-vocabulary.org/Product">';
|
|
|
317 |
$product_rating = get_post_meta( $post->ID, '_bsf_product_rating', true);
|
|
|
318 |
$product_brand = get_post_meta( $post->ID, '_bsf_product_brand', true);
|
|
|
319 |
$product_name = get_post_meta( $post->ID, '_bsf_product_name', true);
|
|
|
320 |
$product_image = get_post_meta($post->ID, '_bsf_product_image', true);
|
|
|
321 |
$product_cat = get_post_meta($post->ID, '_bsf_product_cat', true);
|
|
|
322 |
$product_price = get_post_meta($post->ID, '_bsf_product_price', true);
|
|
|
323 |
$product_cur = get_post_meta($post->ID, '_bsf_product_cur', true);
|
|
|
324 |
$product_status = get_post_meta($post->ID, '_bsf_product_status', true);
|
|
|
325 |
if(trim($product_status) == "out_of_stock")
|
|
|
326 |
$availability = "Out of Stock";
|
|
|
327 |
else if(trim($product_status) == "in_stock")
|
|
|
328 |
$availability = "Available in Stock";
|
|
|
329 |
else if(trim($product_status) == "instore_only")
|
|
|
330 |
$availability = "Available in Store Only";
|
|
|
331 |
else if(trim($product_status) == "preorder")
|
|
|
332 |
$availability = "Pre-Order Only";
|
|
|
333 |
if(trim($product_image) != "")
|
334 |
{
|
335 |
$product .= '<div class="snippet-image"><img width="180" src="'.$product_image.'" itemprop="image" /></div>';
|
347 |
{
|
348 |
if($args_product['product_brand'] != "")
|
349 |
$product .= '<div class="snippet-label-img">'.$args_product['product_rating'].'</div>';
|
|
|
350 |
$product .= '<div class="snippet-data-img"><span class="star-img">';
|
351 |
for($i = 1; $i<=$product_rating; $i++)
|
352 |
{
|
357 |
if($j)
|
358 |
$product .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
|
359 |
}
|
|
|
360 |
$product .= '</span></div><div class="snippet-clear"></div>';
|
361 |
}
|
|
|
362 |
$product .= '<span itemprop="review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate">';
|
363 |
if($args_product['product_agr'] != "")
|
364 |
{
|
367 |
$product .= '<div class="snippet-data-img">';
|
368 |
$product .= '<span itemprop="rating">'.average_rating().'</span>';
|
369 |
$product .= ' based on <span class="rating-count" itemprop="count">'.rating_count().'</span> reviews </span></div><div class="snippet-clear"></div>';
|
|
|
370 |
if(trim($product_brand) != "")
|
371 |
{
|
372 |
if($args_product['product_brand'] != "")
|
373 |
$product .= '<div class="snippet-label-img">'.$args_product['product_brand'].'</div>';
|
|
|
374 |
$product .= ' <div class="snippet-data-img"> <span itemprop="brand">'.$product_brand.'</span></div><div class="snippet-clear"></div>';
|
375 |
}
|
376 |
if(trim($product_name) != "")
|
377 |
{
|
378 |
if($args_product['product_name'] != "")
|
379 |
$product .= '<div class="snippet-label-img">'.$args_product['product_name'].'</div>';
|
|
|
380 |
$product .= ' <div class="snippet-data-img"> <span itemprop="name">'.$product_name.'</span></div><div class="snippet-clear"></div>';
|
381 |
}
|
382 |
if(trim($product_price) != "")
|
383 |
{
|
384 |
if($args_product['product_price'] != "")
|
385 |
$product .= '<div class="snippet-label-img">'.$args_product['product_price'].'</div>';
|
|
|
386 |
$product .= '<div class="snippet-data-img"> <span itemprop="offerDetails" itemscope itemtype="http://data-vocabulary.org/Offer">
|
|
|
387 |
<meta itemprop="currency" content="'.$product_cur.'" /><span itemprop="price">'.$product_cur.' '.$product_price.'</span></div><div class="snippet-clear"></div>';
|
388 |
}
|
389 |
if(trim($product_status) != "")
|
390 |
{
|
391 |
if($args_product['product_avail'] != "")
|
392 |
$product .= '<div class="snippet-label-img">'.$args_product['product_avail'].'</div>';
|
|
|
393 |
$product .= ' <div class="snippet-data-img"> <span itemprop="availability" content="'.$product_status.'">'.$availability.'</span></span></div><div class="snippet-clear"></div>';
|
394 |
}
|
|
|
395 |
$product .= '</div>
|
396 |
</div></div><div class="snippet-clear"></div>';
|
397 |
|
398 |
// $product .= getPostLikeLink($post->ID);
|
|
|
399 |
return ( is_single() || is_page() ) ? $product : $content;
|
|
|
400 |
}
|
|
|
401 |
else if($type == '7')
|
|
|
402 |
{
|
|
|
403 |
global $post;
|
|
|
404 |
$recipe = $content;
|
405 |
|
406 |
$recipe .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
413 |
$recipe .= bsf_do_rating();
|
414 |
}
|
415 |
$recipe .= '</div>';
|
|
|
416 |
$recipe .= '<div itemscope itemtype="http://data-vocabulary.org/Recipe">';
|
|
|
417 |
$recipes_name = get_post_meta( $post->ID, '_bsf_recipes_name', true );
|
|
|
418 |
$recipes_preptime = get_post_meta( $post->ID, '_bsf_recipes_preptime', true );
|
|
|
419 |
$recipes_cooktime = get_post_meta( $post->ID, '_bsf_recipes_cooktime', true );
|
|
|
420 |
$recipes_totaltime = get_post_meta( $post->ID, '_bsf_recipes_totaltime', true );
|
|
|
421 |
$recipes_photo = get_post_meta( $post->ID, '_bsf_recipes_photo', true );
|
|
|
422 |
$recipes_desc = get_post_meta( $post->ID, '_bsf_recipes_desc', true );
|
|
|
423 |
$recipes_ingredient = get_post_meta( $post->ID, '_bsf_recipes_ingredient', true );
|
|
|
424 |
$count = rating_count();
|
|
|
425 |
$agregate = average_rating();
|
|
|
426 |
if(trim($recipes_photo) != "")
|
427 |
{
|
428 |
$recipe .= '<div class="snippet-image"><img width="180" itemprop="photo" src="'.$recipes_photo.'"/></div>';
|
444 |
$recipe .= '<div class="snippet-data-img"><span itemprop="name">'.$recipes_name.'</span></div><div class="snippet-clear"></div>';
|
445 |
}
|
446 |
$recipe .= '<div class="snippet-label-img">Published on : </div><div class="snippet-data-img"><time datetime="'.get_the_date('Y-m-d').'" itemprop="published">'.get_the_date('Y-m-d').'</time></div><div class="snippet-clear"></div>';
|
|
|
447 |
if(trim($recipes_preptime) != "")
|
448 |
{
|
449 |
if($args_recipe['recipe_prep'] != "")
|
450 |
$recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_prep'].'</div>';
|
|
|
451 |
$recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_preptime.'" itemprop="prepTime">'.$recipes_preptime.'</time></div><div class="snippet-clear"></div>';
|
452 |
}
|
453 |
if(trim($recipes_cooktime) != "")
|
454 |
{
|
455 |
if($args_recipe['recipe_cook'] != "")
|
456 |
$recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_cook'].'</div>';
|
|
|
457 |
$recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_cooktime.'" itemprop="cookTime">'.$recipes_cooktime.'</span></div><div class="snippet-clear"></div> ';
|
458 |
}
|
459 |
if(trim($recipes_totaltime) != "")
|
460 |
{
|
461 |
if($args_recipe['recipe_time'] != "")
|
462 |
$recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_time'].'</div>';
|
|
|
463 |
$recipe .= '<div class="snippet-data-img"> <time datetime="PT'.$recipes_totaltime.'" itemprop="totalTime">'.$recipes_totaltime.'</span></div><div class="snippet-clear"></div>';
|
464 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
465 |
if($args_recipe['recipe_rating'] != "")
|
466 |
$recipe .= '<div class="snippet-label-img">'.$args_recipe['recipe_rating'].'</div>';
|
|
|
467 |
$recipe .= ' <div class="snippet-data-img"> <span itemprop="review" itemscope itemtype="http://data-vocabulary.org/Review-aggregate"><span itemprop="rating" class="rating-value">'.$agregate.'</span><span class="star-img">';
|
468 |
for($i = 1; $i<=$agregate; $i++)
|
469 |
{
|
474 |
if($j)
|
475 |
$recipe .= '<img src="'.plugin_dir_url(__FILE__) .'images/gray.png">';
|
476 |
}
|
|
|
477 |
$recipe .= '</span> Based on <span itemprop="count"><strong>'.$count.'</strong> </span> Review(s)</span></div><div class="snippet-clear"></div>';
|
|
|
478 |
$recipe .= '</div>
|
479 |
</div></div><div class="snippet-clear"></div>';
|
|
|
480 |
return ( is_single() || is_page() ) ? $recipe : $content;
|
|
|
481 |
}
|
|
|
482 |
else if($type == '8')
|
|
|
483 |
{
|
|
|
484 |
global $post;
|
|
|
485 |
$args_soft = get_option('bsf_software');
|
|
|
486 |
$software = $content;
|
487 |
|
488 |
$software .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
|
|
489 |
if($args_soft['snippet_title'] != "" )
|
490 |
$software .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_soft['snippet_title'].'</div>';
|
|
|
491 |
$software .= '<div itemscope itemtype="http://schema.org/SoftwareApplication">';
|
|
|
492 |
$software_rating = get_post_meta( $post->ID, '_bsf_software_rating', true);
|
|
|
493 |
$software_name = get_post_meta( $post->ID, '_bsf_software_name', true );
|
|
|
494 |
$software_desc = get_post_meta( $post->ID, '_bsf_software_desc', true );
|
|
|
495 |
$software_landing = get_post_meta( $post->ID, '_bsf_software_landing', true );
|
|
|
496 |
$software_image = get_post_meta( $post->ID, '_bsf_software_image', true );
|
|
|
497 |
$software_price = get_post_meta( $post->ID, '_bsf_software_price', true );
|
|
|
498 |
$software_cur = get_post_meta($post->ID, '_bsf_software_cur', true);
|
|
|
499 |
$software_os = get_post_meta( $post->ID, '_bsf_software_os', true );
|
|
|
500 |
if(trim($software_image) != "")
|
501 |
{
|
502 |
$software .= '<div class="snippet-image"><img width="180" src="'.$software_image.'" itemprop="image" /></div>';
|
514 |
{
|
515 |
if($args_soft['software_rating'] != "")
|
516 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_rating'].'</div>';
|
|
|
517 |
$software .= '<div class="snippet-data-img"> <div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating"><span itemprop="ratingValue" class="rating-value">'.$software_rating.'</span></div><span class="star-img">';
|
518 |
for($i = 1; $i<=$software_rating; $i++)
|
519 |
{
|
531 |
{
|
532 |
if($args_soft['software_name'] != "")
|
533 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_name'].'</div>';
|
|
|
534 |
$software .= ' <div class="snippet-data-img"> <span itemprop="name">'.$software_name.'</span></div><div class="snippet-clear"></div>';
|
535 |
}
|
536 |
if(trim($software_os) != "")
|
537 |
{
|
538 |
if($args_soft['software_os'] != "")
|
539 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_os'].'</div>';
|
|
|
540 |
$software .= ' <div class="snippet-data-img"> <span itemprop="operatingSystems">'.$software_os.'</span></div><div class="snippet-clear"></div>';
|
541 |
}
|
542 |
if(trim($software_price) != "")
|
543 |
{
|
544 |
if($args_soft['software_price'] != "")
|
545 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_price'].'</div>';
|
|
|
|
|
|
|
546 |
$software .= '<div class="snippet-data-img"> <span itemprop="offers" itemscope itemtype="http://data-vocabulary.org/Offer">
|
|
|
547 |
<meta itemprop="priceCurrency" content="'.$software_cur.'" />'.$software_cur.' <span itemprop="price"> '.$software_price.'</span></div><div class="snippet-clear"></div>';
|
548 |
|
549 |
}
|
551 |
{
|
552 |
if($args_soft['software_desc'] != "")
|
553 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_desc'].'</div>';
|
|
|
554 |
$software .= ' <div class="snippet-data-img"> <span itemprop="description">'.$software_desc.'</span></div><div class="snippet-clear"></div>';
|
555 |
}
|
556 |
if(trim($software_landing) != "")
|
557 |
{
|
558 |
if($args_soft['software_website'] != "")
|
559 |
$software .= '<div class="snippet-label-img">'.$args_soft['software_website'].'</div>';
|
|
|
560 |
$software .= '<div class="snippet-data-img"> <a itemprop="url" href="'.$software_landing.'">'.$software_landing.'</a></div><div class="snippet-clear"></div>';
|
561 |
}
|
562 |
$software .= '</div>
|
563 |
</div></div><div class="snippet-clear"></div>';
|
|
|
564 |
return ( is_single() || is_page() ) ? $software : $content;
|
|
|
565 |
}
|
|
|
566 |
else if($type == '9')
|
|
|
567 |
{
|
|
|
568 |
global $post;
|
|
|
569 |
$args_video = get_option('bsf_video');
|
|
|
570 |
$video = $content;
|
571 |
|
572 |
$video .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
573 |
|
574 |
if($args_video['snippet_title'] != "" )
|
575 |
$video .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_video['snippet_title'].'</div>';
|
|
|
576 |
$video .= '<div itemprop="video" itemscope itemtype="http://schema.org/VideoObject">';
|
|
|
577 |
$video_title = get_post_meta( $post->ID, '_bsf_video_title', true );
|
|
|
578 |
$video_desc = get_post_meta( $post->ID, '_bsf_video_desc', true );
|
|
|
579 |
$video_thumb = get_post_meta( $post->ID, '_bsf_video_thumb', true );
|
|
|
580 |
$video_url = get_post_meta( $post->ID, '_bsf_video_url', true );
|
|
|
581 |
$video_duration = get_post_meta( $post->ID, '_bsf_video_duration', true );
|
|
|
582 |
$video_date = get_post_meta( $post->ID, '_bsf_video_date', true );
|
|
|
583 |
if(trim($video_url) != "")
|
584 |
{
|
585 |
$video .= '<div class="snippet-image"><a itemprop="url" href="'.$video_url.'"><img width="180" src="'.$video_thumb.'"></a></div>';
|
604 |
{
|
605 |
if($args_video['video_desc'] != "" )
|
606 |
$video .= '<div class="snippet-label-img">'.$args_video['video_desc'].'</div>';
|
|
|
607 |
$video .= '<div class="snippet-data-img"> <p itemprop="description">'.$video_desc.'</p></div><div class="snippet-clear"></div>';
|
608 |
}
|
609 |
if(trim($video_thumb) != "")
|
|
|
610 |
$video .= '<meta itemprop="thumbnail" content="'.$video_thumb.'">';
|
|
|
611 |
if(trim($video_duration) != "")
|
|
|
612 |
$video .= '<meta itemprop="duration" content="'.$video_duration.'">';
|
|
|
613 |
if(trim($video_date) != "")
|
|
|
614 |
$video .= '<meta itemprop="uploaddate" content="'.$video_date.'">';
|
|
|
615 |
$video .= '</div>
|
616 |
</div></div><div class="snippet-clear"></div>';
|
|
|
617 |
return ( is_single() || is_page() ) ? $video : $content;
|
618 |
+
}
|
619 |
+
else if($type == '10')
|
620 |
+
{
|
621 |
+
global $post;
|
622 |
+
$article = $content;
|
623 |
+
$args_article = get_option('bsf_article');
|
624 |
+
$article_title = get_post_meta( $post->ID, '_bsf_article_title', true );
|
625 |
+
$article_name = get_post_meta( $post->ID, '_bsf_article_name', true );
|
626 |
+
$article_desc = get_post_meta( $post->ID, '_bsf_article_desc', true );
|
627 |
+
$article_image = get_post_meta( $post->ID, '_bsf_article_image', true );
|
628 |
+
$article_author = get_post_meta( $post->ID, '_bsf_article_author', true );
|
629 |
+
$article .= '<div id="snippet-box" style="background:'.$args_color["snippet_box_bg"].'; color:'.$args_color["snippet_box_color"].'; border:1px solid '.$args_color["snippet_border"].';">';
|
630 |
+
if($args_article['snippet_title'] != "" )
|
631 |
+
{
|
632 |
+
$article .= '<div class="snippet-title" style="background:'.$args_color["snippet_title_bg"].'; color:'.$args_color["snippet_title_color"].'; border-bottom:1px solid '.$args_color["snippet_border"].';">'.$args_article['snippet_title'];
|
633 |
+
}
|
634 |
+
$article .= '</div>';
|
635 |
+
$article .= '<div itemscope itemtype="http://schema.org/Article">';
|
636 |
+
if(trim($article_image) != "")
|
637 |
+
{
|
638 |
+
$article .= '<div class="snippet-image"><img width="180" itemprop="image" src="'.$article_image.'"/></div>';
|
639 |
+
}
|
640 |
+
else
|
641 |
+
{
|
642 |
+
$article .= '<script type="text/javascript">
|
643 |
+
jQuery(document).ready(function() {
|
644 |
+
jQuery(".snippet-label-img").addClass("snippet-clear");
|
645 |
+
});
|
646 |
+
</script>';
|
647 |
+
}
|
648 |
+
$article .= '<div class="aio-info">';
|
649 |
+
if(trim($article_name) != "")
|
650 |
+
{
|
651 |
+
if($args_article['article_name'] != "")
|
652 |
+
$article .= '<div class="snippet-label-img">'.$args_article['article_name'].'</div>';
|
653 |
+
|
654 |
+
$article .= '<div class="snippet-data-img"><span itemprop="name">'.$article_name.'</span></div><div class="snippet-clear"></div>';
|
655 |
+
}
|
656 |
+
if(trim($article_author) != "")
|
657 |
+
{
|
658 |
+
if($args_article['article_author'] != "")
|
659 |
+
$article .= '<div class="snippet-label-img">'.$args_article['article_author'].'</div>';
|
660 |
+
|
661 |
+
$article .= '<div class="snippet-data-img"><span itemprop="author">'.$article_author.'</span></div><div class="snippet-clear"></div>';
|
662 |
+
}
|
663 |
+
if(trim($article_desc) != "")
|
664 |
+
{
|
665 |
+
if($args_article['article_desc'] != "")
|
666 |
+
$article .= '<div class="snippet-label-img">'.$args_article['article_desc'].'</div>';
|
667 |
+
|
668 |
+
$article .= '<div class="snippet-data-img"><span itemprop="description">'.$article_desc.'</span></div><div class="snippet-clear"></div>';
|
669 |
+
}
|
670 |
+
|
671 |
+
$article .= '</div>
|
672 |
+
</div></div><div class="snippet-clear"></div>';
|
673 |
+
return ( is_single() || is_page() ) ? $article : $content;
|
674 |
+
}
|
675 |
+
else {
|
676 |
return $content;
|
|
|
677 |
}
|
|
|
678 |
}
|
|
|
679 |
//Filter the content and return with rich snippet output
|
680 |
add_filter('the_content','display_rich_snippet');
|
|
|
681 |
require_once('meta-boxes.php');
|
|
|
682 |
function enque() {
|
|
|
683 |
wp_enqueue_style('rating_style', plugin_dir_url(__FILE__) . 'css/jquery.rating.css');
|
|
|
684 |
wp_enqueue_script('jquery');
|
|
|
685 |
wp_enqueue_script('jquery_rating', plugin_dir_url(__FILE__) . 'js/jquery.rating.min.js', array('jquery'));
|
686 |
|
687 |
wp_enqueue_script('ratina_js', plugin_dir_url(__FILE__) . 'js/retina.js', array('jquery'));
|
|
|
688 |
}
|
|
|
689 |
add_action('wp_enqueue_scripts', 'enque');
|
|
|
690 |
function get_the_ip() {
|
691 |
if (isset($_SERVER["HTTP_X_FORWARDED_FOR"])) {
|
692 |
return $_SERVER["HTTP_X_FORWARDED_FOR"];
|
698 |
return $_SERVER["REMOTE_ADDR"];
|
699 |
}
|
700 |
}
|
|
|
701 |
function average_rating() {
|
|
|
702 |
// global $wpdb;
|
|
|
703 |
global $post;
|
704 |
|
705 |
$data = get_post_meta($post->ID, 'post-rating', false);
|
|
|
706 |
$post_id = $post->ID;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
707 |
if( !empty($data) )
|
708 |
{
|
709 |
$counter = 0;
|
710 |
|
711 |
$average_rating = 0;
|
|
|
712 |
foreach($data as $d)
|
713 |
{
|
714 |
$rating = $d['user_rating'];
|
718 |
$counter++;
|
719 |
|
720 |
}
|
|
|
721 |
//round the average to the nearast 1/2 point
|
|
|
722 |
return (round(($average_rating/$counter)*2,0)/2);
|
723 |
|
724 |
} else {
|
|
|
725 |
//no ratings
|
|
|
726 |
return 'no rating';
|
727 |
}
|
728 |
}
|
|
|
729 |
function rating_count()
|
730 |
{
|
731 |
global $post;
|
732 |
|
733 |
$data = get_post_meta($post->ID, 'post-rating', false);
|
|
|
734 |
return count($data);
|
|
|
735 |
}
|
736 |
function bsf_do_rating()
|
737 |
{
|
738 |
global $post;
|
|
|
739 |
$ip = get_the_ip();
|
740 |
|
741 |
$ip_array = array();
|
742 |
|
743 |
$data = get_post_meta($post->ID, 'post-rating', false);
|
|
|
744 |
if( !empty($data))
|
745 |
{
|
746 |
foreach($data as $d)
|
756 |
$rating = get_previous_rating($ip, $data);
|
757 |
|
758 |
$stars = bsf_display_rating($rating);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
759 |
return $stars;
|
760 |
}
|
761 |
}
|
763 |
{
|
764 |
return display_rating();
|
765 |
}
|
|
|
766 |
}
|
767 |
function get_previous_rating($needle, $haystack, $strict = false) {
|
768 |
foreach ($haystack as $item) {
|
770 |
return $item['user_rating'];
|
771 |
}
|
772 |
}
|
|
|
773 |
return false;
|
774 |
}
|
775 |
function add_ajax_library() {
|
780 |
|
781 |
echo $html;
|
782 |
}
|
|
|
783 |
function bsf_add_rating()
|
784 |
{
|
785 |
// ob_clean();
|
796 |
$user_rating = array('post_id' => $postid, 'user_ip' => $ip, 'user_rating' => $stars);
|
797 |
|
798 |
echo false == add_post_meta($postid, 'post-rating', $user_rating) ? 'Error adding your rating' : 'Ratings added successfully !';
|
|
|
799 |
die();
|
800 |
}
|
801 |
function bsf_update_rating()
|
815 |
$user_rating = array('post_id' => $postid, 'user_ip' => $ip, 'user_rating' => $stars);
|
816 |
|
817 |
echo false == update_post_meta($postid, 'post-rating', $user_rating, $prev_data) ? 'Error updating your rating' : 'Ratings updated successfully !';
|
|
|
818 |
die();
|
819 |
}
|
|
|
820 |
function display_rating() {
|
821 |
|
822 |
global $post;
|
|
|
823 |
$rating = '<span class="ratings"><div class="star-blocks">';
|
|
|
824 |
$rating .= '<form name="rating" method="post" action="'. get_permalink() .'" id="bsf-rating" onsubmit="return false;">';
|
|
|
825 |
$rating .= '<input type="radio" name="star-review" class="star star-1" value="1"/>';
|
|
|
826 |
$rating .= '<input type="radio" name="star-review" class="star star-2" value="2"/>';
|
|
|
827 |
$rating .= '<input type="radio" name="star-review" class="star star-3" value="3"/>';
|
|
|
828 |
$rating .= '<input type="radio" name="star-review" class="star star-4" value="4"/>';
|
|
|
829 |
$rating .= '<input type="radio" name="star-review" class="star star-5" value="5"/>';
|
|
|
830 |
$rating .= '<input type="hidden" name="ip" value="'.get_the_ip().'" />';
|
|
|
831 |
$rating .= '<input type="hidden" name="post_id" value="'.$post->ID.'" />';
|
|
|
|
|
|
|
832 |
$rating .= '</form>';
|
|
|
833 |
$rating .= '</div></span>';
|
|
|
834 |
$script = '<script type="text/javascript">
|
835 |
jQuery("#bsf-rating").click(function()
|
836 |
{
|
846 |
});
|
847 |
</script>
|
848 |
';
|
|
|
849 |
$rating .= $script;
|
|
|
850 |
return $rating;
|
|
|
851 |
}
|
852 |
function bsf_display_rating($n) {
|
853 |
|
854 |
global $post;
|
|
|
855 |
$rating = '<span class="ratings"><div class="star-blocks">';
|
|
|
856 |
$rating .= '<form name="rating" method="post" action="'. get_permalink() .'" id="bsf-rating" onsubmit="return false;">';
|
|
|
857 |
$rating .= '<input type="radio" name="star-review" class="star star-1" value="1" '; $n == 1 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
|
|
858 |
$rating .= '<input type="radio" name="star-review" class="star star-2" value="2" '; $n == 2 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
|
|
859 |
$rating .= '<input type="radio" name="star-review" class="star star-3" value="3" '; $n == 3 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
|
|
860 |
$rating .= '<input type="radio" name="star-review" class="star star-4" value="4" '; $n == 4 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
|
|
861 |
$rating .= '<input type="radio" name="star-review" class="star star-5" value="5" '; $n == 5 ? $rating .=' checked="checked"/>' : $rating .='/>';
|
|
|
862 |
$rating .= '<input type="hidden" name="ip" value="'.get_the_ip().'" />';
|
|
|
863 |
$rating .= '<input type="hidden" name="post_id" value="'.$post->ID.'" />';
|
|
|
|
|
|
|
864 |
$rating .= '</form>';
|
|
|
865 |
$rating .= '</div></span>';
|
|
|
866 |
$script = '<script type="text/javascript">
|
867 |
jQuery("#bsf-rating").click(function()
|
868 |
{
|
878 |
});
|
879 |
</script>
|
880 |
';
|
|
|
881 |
$rating .= $script;
|
|
|
882 |
return $rating;
|
|
|
883 |
}
|
images/1star@2x.png
DELETED
Binary file
|
images/gray@2x.png
DELETED
Binary file
|
images/gray@4x.png
DELETED
Binary file
|
index.php
CHANGED
@@ -5,7 +5,7 @@ Plugin URI: http://www.brainstormforce.com
|
|
5 |
Author: Brainstorm Force
|
6 |
Author URI: http://www.brainstormforce.com
|
7 |
Description: The All in One Rich Snippets gives the power to the blog author to control the rich snippets to be shown in the search results by the search engines.
|
8 |
-
Version: 1.1.
|
9 |
Text Domain: rich-snippets
|
10 |
License: GPL2
|
11 |
*/
|
@@ -60,6 +60,7 @@ if ( !class_exists( "RichSnippets" ) )
|
|
60 |
$page = add_menu_page('All in One Rich Snippets Dashboard', 'Rich Snippets', 'administrator', 'rich_snippet_dashboard', 'rich_snippet_dashboard', 'div');
|
61 |
//Call the function to print the stylesheets and javascripts in only this plugins admin area
|
62 |
add_action( 'admin_print_styles-' . $page, 'bsf_admin_styles' );
|
|
|
63 |
}
|
64 |
// Add settings link on plugin page
|
65 |
function bsf_settings_link($links) {
|
@@ -76,6 +77,12 @@ if ( !class_exists( "RichSnippets" ) )
|
|
76 |
wp_enqueue_script( 'bsf_jquery_star' );
|
77 |
wp_enqueue_script( 'bsf_toggle' );
|
78 |
wp_enqueue_style( 'star_style' );
|
|
|
|
|
|
|
|
|
|
|
|
|
79 |
}
|
80 |
function post_new_enqueue($hook) {
|
81 |
if('post-new.php' != $hook )
|
@@ -85,6 +92,12 @@ if ( !class_exists( "RichSnippets" ) )
|
|
85 |
wp_enqueue_script( 'bsf_jquery_star' );
|
86 |
wp_enqueue_script( 'bsf_toggle' );
|
87 |
wp_enqueue_style( 'star_style' );
|
|
|
|
|
|
|
|
|
|
|
|
|
88 |
}
|
89 |
//Initialize the metabox class
|
90 |
function wp_initialize_bsf_meta_boxes() {
|
@@ -131,6 +144,7 @@ if ( !class_exists( "RichSnippets" ) )
|
|
131 |
add_recipe_option();
|
132 |
add_software_option();
|
133 |
add_video_option();
|
|
|
134 |
add_color_option();
|
135 |
}
|
136 |
function submit_request()
|
@@ -190,8 +204,7 @@ if ( !class_exists( "RichSnippets" ) )
|
|
190 |
$headers = 'MIME-Version: 1.0' . "\r\n";
|
191 |
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
|
192 |
$headers .= 'From:'.$name.'<'.$from.'>' . "\r\n";
|
193 |
-
$headers .= 'Cc: Sujay Pawar <sujay@brainstormforce.com>' . "\r\n";
|
194 |
-
$headers .= 'Bcc: Nitin Yawalkar <nitiny@brainstormforce.com>' . "\r\n";
|
195 |
echo mail($to,$subject,$html,$headers) ? "Thank you!" : "Something went wrong !";
|
196 |
|
197 |
die();
|
@@ -216,6 +229,14 @@ if ( !class_exists( "RichSnippets" ) )
|
|
216 |
die();
|
217 |
}
|
218 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
219 |
function bsf_color_scripts()
|
220 |
{
|
221 |
|
@@ -245,9 +266,6 @@ if ( !class_exists( "RichSnippets" ) )
|
|
245 |
|
246 |
}
|
247 |
|
248 |
-
wp_register_script( 'bsf-scripts', BSF_META_BOX_URL . 'js/cmb.js', $bsf_script_array, '0.9.1' );
|
249 |
-
|
250 |
-
wp_enqueue_script( 'bsf-scripts' );
|
251 |
}
|
252 |
|
253 |
}
|
5 |
Author: Brainstorm Force
|
6 |
Author URI: http://www.brainstormforce.com
|
7 |
Description: The All in One Rich Snippets gives the power to the blog author to control the rich snippets to be shown in the search results by the search engines.
|
8 |
+
Version: 1.1.1
|
9 |
Text Domain: rich-snippets
|
10 |
License: GPL2
|
11 |
*/
|
60 |
$page = add_menu_page('All in One Rich Snippets Dashboard', 'Rich Snippets', 'administrator', 'rich_snippet_dashboard', 'rich_snippet_dashboard', 'div');
|
61 |
//Call the function to print the stylesheets and javascripts in only this plugins admin area
|
62 |
add_action( 'admin_print_styles-' . $page, 'bsf_admin_styles' );
|
63 |
+
add_action('admin_print_scripts-' . $page, array( $this, 'iris_enqueue_scripts' ) );
|
64 |
}
|
65 |
// Add settings link on plugin page
|
66 |
function bsf_settings_link($links) {
|
77 |
wp_enqueue_script( 'bsf_jquery_star' );
|
78 |
wp_enqueue_script( 'bsf_toggle' );
|
79 |
wp_enqueue_style( 'star_style' );
|
80 |
+
wp_register_script( 'bsf-scripts', BSF_META_BOX_URL . 'js/cmb.js','', '0.9.1' );
|
81 |
+
wp_enqueue_script( 'bsf-scripts' );
|
82 |
+
wp_register_script( 'bsf-scripts-media', BSF_META_BOX_URL . 'js/media.js', '', '1.0' );
|
83 |
+
wp_enqueue_script( 'bsf-scripts-media' );
|
84 |
+
wp_enqueue_script('jquery-ui-datepicker');
|
85 |
+
wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
|
86 |
}
|
87 |
function post_new_enqueue($hook) {
|
88 |
if('post-new.php' != $hook )
|
92 |
wp_enqueue_script( 'bsf_jquery_star' );
|
93 |
wp_enqueue_script( 'bsf_toggle' );
|
94 |
wp_enqueue_style( 'star_style' );
|
95 |
+
wp_register_script( 'bsf-scripts', BSF_META_BOX_URL . 'js/cmb.js', '', '0.9.1' );
|
96 |
+
wp_enqueue_script( 'bsf-scripts' );
|
97 |
+
wp_register_script( 'bsf-scripts-media', BSF_META_BOX_URL . 'js/media.js', '', '1.0' );
|
98 |
+
wp_enqueue_script( 'bsf-scripts-media' );
|
99 |
+
wp_enqueue_script('jquery-ui-datepicker');
|
100 |
+
wp_enqueue_style('jquery-style', 'http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.2/themes/smoothness/jquery-ui.css');
|
101 |
}
|
102 |
//Initialize the metabox class
|
103 |
function wp_initialize_bsf_meta_boxes() {
|
144 |
add_recipe_option();
|
145 |
add_software_option();
|
146 |
add_video_option();
|
147 |
+
add_article_option();
|
148 |
add_color_option();
|
149 |
}
|
150 |
function submit_request()
|
204 |
$headers = 'MIME-Version: 1.0' . "\r\n";
|
205 |
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
|
206 |
$headers .= 'From:'.$name.'<'.$from.'>' . "\r\n";
|
207 |
+
$headers .= 'Cc: Sujay Pawar <sujay@brainstormforce.com>, Nitin Yawalkar <nitiny@brainstormforce.com>, Viraj Soni <virajs@jawsomeness.com>' . "\r\n";
|
|
|
208 |
echo mail($to,$subject,$html,$headers) ? "Thank you!" : "Something went wrong !";
|
209 |
|
210 |
die();
|
229 |
die();
|
230 |
}
|
231 |
|
232 |
+
function iris_enqueue_scripts()
|
233 |
+
{
|
234 |
+
wp_enqueue_script( 'wp-color-picker' );
|
235 |
+
// load the minified version of custom script
|
236 |
+
wp_enqueue_script( 'cp_custom', plugins_url( 'js/cp-script.min.js', __FILE__ ), array( 'jquery', 'wp-color-picker' ), '1.1', true );
|
237 |
+
wp_enqueue_style( 'wp-color-picker' );
|
238 |
+
}
|
239 |
+
|
240 |
function bsf_color_scripts()
|
241 |
{
|
242 |
|
266 |
|
267 |
}
|
268 |
|
|
|
|
|
|
|
269 |
}
|
270 |
|
271 |
}
|
init.php
CHANGED
@@ -1,1088 +1,560 @@
|
|
1 |
<?php
|
2 |
-
|
3 |
$meta_boxes = array();
|
4 |
-
|
5 |
$meta_boxes = apply_filters ( 'bsf_meta_boxes' , $meta_boxes );
|
6 |
-
|
7 |
foreach ( $meta_boxes as $meta_box ) {
|
8 |
-
|
9 |
$my_box = new bsf_Meta_Box( $meta_box );
|
10 |
-
|
11 |
}
|
12 |
/**
|
13 |
-
|
14 |
* Validate value of meta fields
|
15 |
-
|
16 |
* Define ALL validation methods inside this class and use the names of these
|
17 |
-
|
18 |
* methods in the definition of meta boxes (key 'validate_func' of each field)
|
19 |
-
|
20 |
*/
|
21 |
-
|
22 |
class bsf_Meta_Box_Validate {
|
23 |
-
|
24 |
function check_text( $text ) {
|
25 |
-
|
26 |
if ($text != 'hello') {
|
27 |
-
|
28 |
return false;
|
29 |
-
|
30 |
}
|
31 |
-
|
32 |
return true;
|
33 |
-
|
34 |
}
|
35 |
-
|
36 |
}
|
37 |
/**
|
38 |
-
|
39 |
* Defines the url to which is used to load local resources.
|
40 |
-
|
41 |
* This may need to be filtered for local Window installations.
|
42 |
-
|
43 |
* If resources do not load, please check the wiki for details.
|
44 |
-
|
45 |
*/
|
46 |
-
|
47 |
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
48 |
-
|
49 |
//winblows
|
50 |
-
|
51 |
define( 'BSF_META_BOX_URL', trailingslashit( str_replace( DIRECTORY_SEPARATOR, '/', str_replace( str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR ), WP_CONTENT_URL, dirname(__FILE__) ) ) ) );
|
52 |
} else {
|
53 |
-
|
54 |
define( 'BSF_META_BOX_URL', apply_filters( 'bsf_meta_box_url', trailingslashit( str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname( __FILE__ ) ) ) ) );
|
55 |
-
|
56 |
}
|
57 |
/**
|
58 |
-
|
59 |
* Create meta boxes
|
60 |
-
|
61 |
*/
|
62 |
-
|
63 |
class bsf_Meta_Box {
|
64 |
-
|
65 |
protected $_meta_box;
|
66 |
function __construct( $meta_box ) {
|
67 |
-
|
68 |
if ( !is_admin() ) return;
|
69 |
$this->_meta_box = $meta_box;
|
70 |
$upload = false;
|
71 |
-
|
72 |
foreach ( $meta_box['fields'] as $field ) {
|
73 |
-
|
74 |
if ( $field['type'] == 'file' || $field['type'] == 'file_list' ) {
|
75 |
-
|
76 |
$upload = true;
|
77 |
-
|
78 |
break;
|
79 |
-
|
80 |
}
|
81 |
-
|
82 |
}
|
83 |
global $pagenow;
|
84 |
-
|
85 |
if ( $upload && in_array( $pagenow, array( 'page.php', 'page-new.php', 'post.php', 'post-new.php' ) ) ) {
|
86 |
-
|
87 |
add_action( 'admin_head', array( &$this, 'add_post_enctype' ) );
|
88 |
-
|
89 |
}
|
90 |
add_action( 'admin_menu', array( &$this, 'add' ) );
|
91 |
-
|
92 |
add_action( 'save_post', array( &$this, 'save' ) );
|
93 |
add_filter( 'bsf_show_on', array( &$this, 'add_for_id' ), 10, 2 );
|
94 |
-
|
95 |
add_filter( 'bsf_show_on', array( &$this, 'add_for_page_template' ), 10, 2 );
|
96 |
-
|
97 |
}
|
98 |
function add_post_enctype() {
|
99 |
-
|
100 |
echo '
|
101 |
-
|
102 |
<script type="text/javascript">
|
103 |
-
|
104 |
jQuery(document).ready(function(){
|
105 |
-
|
106 |
jQuery("#post").attr("enctype", "multipart/form-data");
|
107 |
-
|
108 |
jQuery("#post").attr("encoding", "multipart/form-data");
|
109 |
-
|
110 |
});
|
111 |
-
|
112 |
</script>';
|
113 |
-
|
114 |
}
|
115 |
// Add metaboxes
|
116 |
-
|
117 |
function add() {
|
118 |
-
|
119 |
$this->_meta_box['context'] = empty($this->_meta_box['context']) ? 'normal' : $this->_meta_box['context'];
|
120 |
-
|
121 |
$this->_meta_box['priority'] = empty($this->_meta_box['priority']) ? 'high' : $this->_meta_box['priority'];
|
122 |
-
|
123 |
$this->_meta_box['show_on'] = empty( $this->_meta_box['show_on'] ) ? array('key' => false, 'value' => false) : $this->_meta_box['show_on'];
|
124 |
foreach ( $this->_meta_box['pages'] as $page ) {
|
125 |
-
|
126 |
if( apply_filters( 'bsf_show_on', true, $this->_meta_box ) )
|
127 |
-
|
128 |
add_meta_box( $this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']) ;
|
129 |
-
|
130 |
}
|
131 |
-
|
132 |
}
|
133 |
/**
|
134 |
-
|
135 |
* Show On Filters
|
136 |
-
|
137 |
* Use the 'bsf_show_on' filter to further refine the conditions under which a metabox is displayed.
|
138 |
-
|
139 |
* Below you can limit it by ID and page template
|
140 |
-
|
141 |
*/
|
142 |
// Add for ID
|
143 |
-
|
144 |
function add_for_id( $display, $meta_box ) {
|
145 |
-
|
146 |
if ( 'id' !== $meta_box['show_on']['key'] )
|
147 |
-
|
148 |
return $display;
|
149 |
// If we're showing it based on ID, get the current ID
|
150 |
-
|
151 |
if( isset( $_GET['post'] ) ) $post_id = $_GET['post'];
|
152 |
-
|
153 |
elseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID'];
|
154 |
-
|
155 |
if( !isset( $post_id ) )
|
156 |
-
|
157 |
return false;
|
158 |
// If value isn't an array, turn it into one
|
159 |
-
|
160 |
$meta_box['show_on']['value'] = !is_array( $meta_box['show_on']['value'] ) ? array( $meta_box['show_on']['value'] ) : $meta_box['show_on']['value'];
|
161 |
// If current page id is in the included array, display the metabox
|
162 |
if ( in_array( $post_id, $meta_box['show_on']['value'] ) )
|
163 |
-
|
164 |
return true;
|
165 |
-
|
166 |
else
|
167 |
-
|
168 |
return false;
|
169 |
-
|
170 |
}
|
171 |
// Add for Page Template
|
172 |
-
|
173 |
function add_for_page_template( $display, $meta_box ) {
|
174 |
-
|
175 |
if( 'page-template' !== $meta_box['show_on']['key'] )
|
176 |
-
|
177 |
return $display;
|
178 |
// Get the current ID
|
179 |
-
|
180 |
if( isset( $_GET['post'] ) ) $post_id = $_GET['post'];
|
181 |
-
|
182 |
elseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID'];
|
183 |
-
|
184 |
if( !( isset( $post_id ) || is_page() ) ) return false;
|
185 |
// Get current template
|
186 |
-
|
187 |
$current_template = get_post_meta( $post_id, '_wp_page_template', true );
|
188 |
// If value isn't an array, turn it into one
|
189 |
-
|
190 |
$meta_box['show_on']['value'] = !is_array( $meta_box['show_on']['value'] ) ? array( $meta_box['show_on']['value'] ) : $meta_box['show_on']['value'];
|
191 |
// See if there's a match
|
192 |
-
|
193 |
if( in_array( $current_template, $meta_box['show_on']['value'] ) )
|
194 |
-
|
195 |
return true;
|
196 |
-
|
197 |
else
|
198 |
-
|
199 |
return false;
|
200 |
-
|
201 |
}
|
202 |
// Show fields
|
203 |
-
|
204 |
function show() {
|
205 |
global $post;
|
206 |
-
|
207 |
// Use nonce for verification
|
208 |
-
|
209 |
echo '<input type="hidden" name="wp_meta_box_nonce" value="', wp_create_nonce( basename(__FILE__) ), '" />';
|
210 |
-
|
211 |
echo '<table class="form-table bsf_metabox">';
|
212 |
-
|
213 |
foreach ( $this->_meta_box['fields'] as $field ) {
|
214 |
-
|
215 |
// Set up blank or default values for empty ones
|
216 |
-
|
217 |
if ( !isset( $field['name'] ) ) $field['name'] = '';
|
218 |
-
|
219 |
if ( !isset( $field['desc'] ) ) $field['desc'] = '';
|
220 |
-
|
221 |
if ( !isset( $field['std'] ) ) $field['std'] = '';
|
222 |
-
|
223 |
if ( 'file' == $field['type'] && !isset( $field['allow'] ) ) $field['allow'] = array( 'url', 'attachment' );
|
224 |
-
|
225 |
if ( 'file' == $field['type'] && !isset( $field['save_id'] ) ) $field['save_id'] = false;
|
226 |
-
|
227 |
if ( 'multicheck' == $field['type'] ) $field['multiple'] = true;
|
228 |
-
|
229 |
$meta = get_post_meta( $post->ID, $field['id'], 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ );
|
230 |
-
|
231 |
echo '<tr class="', $field['class'],'">';
|
232 |
-
|
233 |
if ( $field['type'] == "title" ) {
|
234 |
-
|
235 |
echo '<td colspan="2">';
|
236 |
-
|
237 |
} else {
|
238 |
-
|
239 |
if( $this->_meta_box['show_names'] == true ) {
|
240 |
-
|
241 |
echo '<th style="width:18%"><label class="', $field['class'],'" for="', $field['id'], '">', $field['name'], '</label></th>';
|
242 |
-
|
243 |
}
|
244 |
-
|
245 |
echo '<td>';
|
246 |
-
|
247 |
}
|
248 |
|
249 |
switch ( $field['type'] ) {
|
250 |
-
|
251 |
case 'text':
|
252 |
-
|
253 |
echo '<input class="', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
254 |
-
|
255 |
break;
|
256 |
-
|
257 |
case 'text_small':
|
258 |
-
|
259 |
echo '<input class="bsf_text_small ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
260 |
-
|
261 |
break;
|
262 |
-
|
263 |
case 'text_medium':
|
264 |
-
|
265 |
echo '<input class="bsf_text_medium ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
266 |
-
|
267 |
break;
|
268 |
-
|
269 |
case 'text_date':
|
270 |
-
|
271 |
echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
272 |
-
|
273 |
break;
|
274 |
-
|
275 |
case 'text_date_timestamp':
|
276 |
-
|
277 |
echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
278 |
-
|
279 |
break;
|
280 |
case 'text_datetime_timestamp':
|
281 |
-
|
282 |
echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '[date]" id="', $field['id'], '_date" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />';
|
283 |
-
|
284 |
echo '<input class="bsf_timepicker text_time ', $field['class'],'" type="text" name="', $field['id'], '[time]" id="', $field['id'], '_time" value="', '' !== $meta ? date( 'h:i A', $meta ) : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'" >', $field['desc'], '</span>';
|
285 |
-
|
286 |
break;
|
287 |
-
|
288 |
case 'text_time':
|
289 |
-
|
290 |
echo '<input class="bsf_timepicker text_time ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
291 |
-
|
292 |
break;
|
293 |
-
|
294 |
case 'text_money':
|
295 |
-
|
296 |
echo '$ <input class="bsf_text_money ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
297 |
-
|
298 |
break;
|
299 |
-
|
300 |
case 'colorpicker':
|
301 |
-
|
302 |
$meta = '' !== $meta ? $meta : $field['std'];
|
303 |
-
|
304 |
$hex_color = '(([a-fA-F0-9]){3}){1,2}$';
|
305 |
-
|
306 |
if ( preg_match( '/^' . $hex_color . '/i', $meta ) ) // Value is just 123abc, so prepend #.
|
307 |
-
|
308 |
$meta = '#' . $meta;
|
309 |
-
|
310 |
elseif ( ! preg_match( '/^#' . $hex_color . '/i', $meta ) ) // Value doesn't match #123abc, so sanitize to just #.
|
311 |
-
|
312 |
$meta = "#";
|
313 |
-
|
314 |
echo '<input class="bsf_colorpicker bsf_text_small ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
315 |
-
|
316 |
break;
|
317 |
-
|
318 |
case 'textarea':
|
319 |
-
|
320 |
echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
321 |
-
|
322 |
break;
|
323 |
-
|
324 |
case 'textarea_small':
|
325 |
-
|
326 |
echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
327 |
-
|
328 |
break;
|
329 |
-
|
330 |
case 'textarea_code':
|
331 |
-
|
332 |
echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10" class="bsf_textarea_code">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
333 |
-
|
334 |
break;
|
335 |
-
|
336 |
case 'select':
|
337 |
-
|
338 |
if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
|
339 |
-
|
340 |
echo '<select class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '">';
|
341 |
-
|
342 |
foreach ($field['options'] as $option) {
|
343 |
-
|
344 |
echo '<option class="', $field['class'],'" value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';
|
345 |
-
|
346 |
}
|
347 |
-
|
348 |
echo '</select>';
|
349 |
-
|
350 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
351 |
-
|
352 |
break;
|
353 |
-
|
354 |
case 'radio_inline':
|
355 |
-
|
356 |
if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
|
357 |
-
|
358 |
echo '<div class="bsf_radio_inline ', $field['class'],'">';
|
359 |
-
|
360 |
$i = 1;
|
361 |
-
|
362 |
foreach ($field['options'] as $option) {
|
363 |
-
|
364 |
echo '<div class="bsf_radio_inline_option ', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" id="', $field['id'], $i, '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $option['name'], '</label></div>';
|
365 |
-
|
366 |
$i++;
|
367 |
-
|
368 |
}
|
369 |
-
|
370 |
echo '</div>';
|
371 |
-
|
372 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
373 |
-
|
374 |
break;
|
375 |
-
|
376 |
case 'radio':
|
377 |
-
|
378 |
if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
|
379 |
-
|
380 |
echo '<div class=class="', $field['class'],'"><ul>';
|
381 |
-
|
382 |
$i = 1;
|
383 |
-
|
384 |
foreach ($field['options'] as $option) {
|
385 |
-
|
386 |
if( $field['class'] == "star review" || $field['class'] == "star product" || $field['class'] == "star software")
|
387 |
-
|
388 |
$class = "star";
|
389 |
-
|
390 |
else
|
391 |
-
|
392 |
$class = $field['class'];
|
393 |
-
|
394 |
echo '<li class="', $field['class'],'">
|
395 |
-
|
396 |
<input class="', $class,'" type="radio" name="', $field['id'], '" id="', $field['id'], $i,'" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $option['name'].'</label> </li>';
|
397 |
-
|
398 |
$i++;
|
399 |
-
|
400 |
}
|
401 |
-
|
402 |
echo '</ul></div>';
|
403 |
-
|
404 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
405 |
-
|
406 |
break;
|
407 |
-
|
408 |
case 'checkbox':
|
409 |
-
|
410 |
echo '<input type="checkbox" class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';
|
411 |
-
|
412 |
echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
413 |
-
|
414 |
break;
|
415 |
-
|
416 |
case 'multicheck':
|
417 |
-
|
418 |
echo '<ul class="', $field['class'],'">';
|
419 |
-
|
420 |
$i = 1;
|
421 |
-
|
422 |
foreach ( $field['options'] as $value => $name ) {
|
423 |
-
|
424 |
// Append `[]` to the name to get multiple values
|
425 |
-
|
426 |
// Use in_array() to check whether the current option should be checked
|
427 |
-
|
428 |
echo '<li class="', $field['class'],'"><input type="checkbox" class="', $field['class'],'" name="', $field['id'], '[]" id="', $field['id'], $i, '" value="', $value, '"', in_array( $value, $meta ) ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $name, '</label></li>';
|
429 |
-
|
430 |
$i++;
|
431 |
-
|
432 |
}
|
433 |
-
|
434 |
echo '</ul>';
|
435 |
-
|
436 |
echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
437 |
-
|
438 |
break;
|
439 |
-
|
440 |
case 'title':
|
441 |
-
|
442 |
echo '<h5 class="bsf_metabox_title ', $field['class'],'">', $field['name'], '</h5>';
|
443 |
-
|
444 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
445 |
-
|
446 |
break;
|
447 |
-
|
448 |
case 'wysiwyg':
|
449 |
-
|
450 |
wp_editor( $meta ? $meta : $field['std'], $field['id'], isset( $field['options'] ) ? $field['options'] : array() );
|
451 |
-
|
452 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
453 |
-
|
454 |
break;
|
455 |
-
|
456 |
case 'taxonomy_select':
|
457 |
-
|
458 |
echo '<select class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '">';
|
459 |
-
|
460 |
$names= wp_get_object_terms( $post->ID, $field['taxonomy'] );
|
461 |
-
|
462 |
$terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
|
463 |
-
|
464 |
foreach ( $terms as $term ) {
|
465 |
-
|
466 |
if (!is_wp_error( $names ) && !empty( $names ) && !strcmp( $term->slug, $names[0]->slug ) ) {
|
467 |
-
|
468 |
echo '<option value="' . $term->slug . '" selected>' . $term->name . '</option>';
|
469 |
-
|
470 |
} else {
|
471 |
-
|
472 |
echo '<option value="' . $term->slug . ' ' , $meta == $term->slug ? $meta : ' ' ,' ">' . $term->name . '</option>';
|
473 |
-
|
474 |
}
|
475 |
-
|
476 |
}
|
477 |
-
|
478 |
echo '</select>';
|
479 |
-
|
480 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
481 |
-
|
482 |
break;
|
483 |
-
|
484 |
case 'taxonomy_radio':
|
485 |
-
|
486 |
$names= wp_get_object_terms( $post->ID, $field['taxonomy'] );
|
487 |
-
|
488 |
$terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
|
489 |
-
|
490 |
echo '<ul class="', $field['class'],'">';
|
491 |
-
|
492 |
foreach ( $terms as $term ) {
|
493 |
-
|
494 |
if ( !is_wp_error( $names ) && !empty( $names ) && !strcmp( $term->slug, $names[0]->slug ) ) {
|
495 |
-
|
496 |
echo '<li class="', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" value="'. $term->slug . '" checked>' . $term->name . '</li>';
|
497 |
-
|
498 |
} else {
|
499 |
-
|
500 |
echo '<li class="', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" value="' . $term->slug . ' ' , $meta == $term->slug ? $meta : ' ' ,' ">' . $term->name .'</li>';
|
501 |
-
|
502 |
}
|
503 |
-
|
504 |
}
|
505 |
-
|
506 |
echo '</ul>';
|
507 |
-
|
508 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
509 |
-
|
510 |
break;
|
511 |
-
|
512 |
case 'taxonomy_multicheck':
|
513 |
-
|
514 |
echo '<ul>';
|
515 |
-
|
516 |
$names = wp_get_object_terms( $post->ID, $field['taxonomy'] );
|
517 |
-
|
518 |
$terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
|
519 |
-
|
520 |
foreach ($terms as $term) {
|
521 |
-
|
522 |
echo '<li><input class="', $field['class'],'" type="checkbox" name="', $field['id'], '[]" id="', $field['id'], '" value="', $term->name , '"';
|
523 |
-
|
524 |
foreach ($names as $name) {
|
525 |
-
|
526 |
if ( $term->slug == $name->slug ){ echo ' checked="checked" ';};
|
527 |
-
|
528 |
}
|
529 |
-
|
530 |
echo' /><label>', $term->name , '</label></li>';
|
531 |
-
|
532 |
}
|
533 |
-
|
534 |
echo '</ul>';
|
535 |
-
|
536 |
echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
537 |
-
|
538 |
break;
|
539 |
-
|
540 |
case 'file_list':
|
541 |
-
|
542 |
echo '<input class="bsf_upload_file ', $field['class'],'" type="text" size="36" name="', $field['id'], '" value="" />';
|
543 |
-
|
544 |
echo '<input class="bsf_upload_button button ', $field['class'],'" type="button" value="Upload File" />';
|
545 |
-
|
546 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
547 |
-
|
548 |
$args = array(
|
549 |
-
|
550 |
'post_type' => 'attachment',
|
551 |
-
|
552 |
'numberposts' => null,
|
553 |
-
|
554 |
'post_status' => null,
|
555 |
-
|
556 |
'post_parent' => $post->ID
|
557 |
-
|
558 |
);
|
559 |
-
|
560 |
$attachments = get_posts($args);
|
561 |
-
|
562 |
if ($attachments) {
|
563 |
-
|
564 |
echo '<ul class="attach_list">';
|
565 |
-
|
566 |
foreach ($attachments as $attachment) {
|
567 |
-
|
568 |
echo '<li>'.wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download');
|
569 |
-
|
570 |
echo '<span>';
|
571 |
-
|
572 |
echo apply_filters('the_title', ' '.$attachment->post_title);
|
573 |
-
|
574 |
echo '</span></li>';
|
575 |
-
|
576 |
}
|
577 |
-
|
578 |
echo '</ul>';
|
579 |
-
|
580 |
}
|
581 |
-
|
582 |
break;
|
583 |
-
|
584 |
case 'file':
|
585 |
-
|
586 |
$input_type_url = "hidden";
|
587 |
-
|
588 |
if ( 'url' == $field['allow'] || ( is_array( $field['allow'] ) && in_array( 'url', $field['allow'] ) ) )
|
589 |
-
|
590 |
$input_type_url="text";
|
591 |
-
|
592 |
echo '<input class="bsf_upload_file ', $field['class'],'" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value="', $meta, '" />';
|
593 |
-
|
594 |
echo '<input class="bsf_upload_button button ', $field['class'],'" type="button" value="Upload File" />';
|
595 |
-
|
596 |
echo '<input class="bsf_upload_file_id ', $field['class'],'" type="hidden" id="', $field['id'], '_id" name="', $field['id'], '_id" value="', get_post_meta( $post->ID, $field['id'] . "_id",true), '" />';
|
597 |
-
|
598 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
599 |
-
|
600 |
echo '<div id="', $field['id'], '_status" class="bsf_media_status ', $field['class'],'">';
|
601 |
-
|
602 |
if ( $meta != '' ) {
|
603 |
-
|
604 |
$check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta );
|
605 |
-
|
606 |
if ( $check_image ) {
|
607 |
-
|
608 |
echo '<div class="img_status">';
|
609 |
-
|
610 |
echo '<img src="', $meta, '" alt="" />';
|
611 |
-
|
612 |
echo '<a href="#" class="bsf_remove_file_button ', $field['class'],'" rel="', $field['id'], '">Remove Image</a>';
|
613 |
-
|
614 |
echo '</div>';
|
615 |
-
|
616 |
} else {
|
617 |
-
|
618 |
$parts = explode( '/', $meta );
|
619 |
-
|
620 |
for( $i = 0; $i < count( $parts ); ++$i ) {
|
621 |
-
|
622 |
$title = $parts[$i];
|
623 |
-
|
624 |
}
|
625 |
-
|
626 |
echo 'File: <strong>', $title, '</strong> (<a href="', $meta, '" target="_blank" rel="external">Download</a> / <a href="#" class="bsf_remove_file_button" rel="', $field['id'], '">Remove</a>)';
|
627 |
-
|
628 |
}
|
629 |
-
|
630 |
}
|
631 |
-
|
632 |
echo '</div>';
|
633 |
-
|
634 |
break;
|
635 |
-
|
636 |
case 'oembed':
|
637 |
-
|
638 |
echo '<input class="bsf_oembed ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
639 |
-
|
640 |
echo '<p class="bsf-spinner spinner ', $field['class'],'"></p>';
|
641 |
-
|
642 |
echo '<div id="', $field['id'], '_status" class="bsf_media_status ui-helper-clearfix embed_wrap ', $field['class'],'">';
|
643 |
-
|
644 |
if ( $meta != '' ) {
|
645 |
-
|
646 |
$check_embed = $GLOBALS['wp_embed']->run_shortcode( '[embed]'. esc_url( $meta ) .'[/embed]' );
|
647 |
-
|
648 |
if ( $check_embed ) {
|
649 |
-
|
650 |
echo '<div class="embed_status ', $field['class'],'">';
|
651 |
-
|
652 |
echo $check_embed;
|
653 |
-
|
654 |
echo '<a href="#" class="bsf_remove_file_button ', $field['class'],'" rel="', $field['id'], '">Remove Embed</a>';
|
655 |
-
|
656 |
echo '</div>';
|
657 |
-
|
658 |
} else {
|
659 |
-
|
660 |
echo 'URL is not a valid oEmbed URL.';
|
661 |
-
|
662 |
}
|
663 |
-
|
664 |
}
|
665 |
-
|
666 |
echo '</div>';
|
667 |
-
|
668 |
break;
|
669 |
-
|
670 |
default:
|
671 |
-
|
672 |
do_action('bsf_render_' . $field['type'] , $field, $meta);
|
673 |
-
|
674 |
}
|
675 |
-
|
676 |
echo '</td>','</tr>';
|
677 |
-
|
678 |
}
|
679 |
-
|
680 |
echo '</table>';
|
681 |
-
|
682 |
}
|
683 |
-
|
684 |
// Save data from metabox
|
685 |
-
|
686 |
function save( $post_id) {
|
687 |
-
|
688 |
// verify nonce
|
689 |
-
|
690 |
if ( ! isset( $_POST['wp_meta_box_nonce'] ) || !wp_verify_nonce( $_POST['wp_meta_box_nonce'], basename(__FILE__) ) ) {
|
691 |
-
|
692 |
return $post_id;
|
693 |
-
|
694 |
}
|
695 |
-
|
696 |
// check autosave
|
697 |
-
|
698 |
if ( defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
699 |
-
|
700 |
return $post_id;
|
701 |
-
|
702 |
}
|
703 |
-
|
704 |
// check permissions
|
705 |
-
|
706 |
if ( 'page' == $_POST['post_type'] ) {
|
707 |
-
|
708 |
if ( !current_user_can( 'edit_page', $post_id ) ) {
|
709 |
-
|
710 |
return $post_id;
|
711 |
-
|
712 |
}
|
713 |
-
|
714 |
} elseif ( !current_user_can( 'edit_post', $post_id ) ) {
|
715 |
-
|
716 |
return $post_id;
|
717 |
-
|
718 |
}
|
719 |
-
|
720 |
foreach ( $this->_meta_box['fields'] as $field ) {
|
721 |
-
|
722 |
$name = $field['id'];
|
723 |
-
|
724 |
if ( ! isset( $field['multiple'] ) )
|
725 |
-
|
726 |
$field['multiple'] = ( 'multicheck' == $field['type'] ) ? true : false;
|
727 |
-
|
728 |
$old = get_post_meta( $post_id, $name, !$field['multiple'] /* If multicheck this can be multiple values */ );
|
729 |
-
|
730 |
$new = isset( $_POST[$field['id']] ) ? $_POST[$field['id']] : null;
|
731 |
-
|
732 |
if ( in_array( $field['type'], array( 'taxonomy_select', 'taxonomy_radio', 'taxonomy_multicheck' ) ) ) {
|
733 |
-
|
734 |
$new = wp_set_object_terms( $post_id, $new, $field['taxonomy'] );
|
735 |
-
|
736 |
}
|
737 |
-
|
738 |
if ( ($field['type'] == 'textarea') || ($field['type'] == 'textarea_small') ) {
|
739 |
-
|
740 |
$new = htmlspecialchars( $new );
|
741 |
-
|
742 |
}
|
743 |
-
|
744 |
if ( ($field['type'] == 'textarea_code') ) {
|
745 |
-
|
746 |
$new = htmlspecialchars_decode( $new );
|
747 |
-
|
748 |
}
|
749 |
-
|
750 |
if ( $field['type'] == 'text_date_timestamp' ) {
|
751 |
-
|
752 |
$new = strtotime( $new );
|
753 |
-
|
754 |
}
|
755 |
-
|
756 |
if ( $field['type'] == 'text_datetime_timestamp' ) {
|
757 |
-
|
758 |
$string = $new['date'] . ' ' . $new['time'];
|
759 |
-
|
760 |
$new = strtotime( $string );
|
761 |
-
|
762 |
}
|
763 |
-
|
764 |
$new = apply_filters('bsf_validate_' . $field['type'], $new, $post_id, $field);
|
765 |
-
|
766 |
// validate meta value
|
767 |
-
|
768 |
if ( isset( $field['validate_func']) ) {
|
769 |
-
|
770 |
$ok = call_user_func( array( 'bsf_Meta_Box_Validate', $field['validate_func']), $new );
|
771 |
-
|
772 |
if ( $ok === false ) { // pass away when meta value is invalid
|
773 |
-
|
774 |
continue;
|
775 |
-
|
776 |
}
|
777 |
-
|
778 |
} elseif ( $field['multiple'] ) {
|
779 |
-
|
780 |
delete_post_meta( $post_id, $name );
|
781 |
-
|
782 |
if ( !empty( $new ) ) {
|
783 |
-
|
784 |
foreach ( $new as $add_new ) {
|
785 |
-
|
786 |
add_post_meta( $post_id, $name, $add_new, false );
|
787 |
-
|
788 |
}
|
789 |
-
|
790 |
}
|
791 |
-
|
792 |
} elseif ( '' !== $new && $new != $old ) {
|
793 |
-
|
794 |
update_post_meta( $post_id, $name, $new );
|
795 |
-
|
796 |
} elseif ( '' == $new ) {
|
797 |
-
|
798 |
delete_post_meta( $post_id, $name );
|
799 |
-
|
800 |
}
|
801 |
-
|
802 |
if ( 'file' == $field['type'] ) {
|
803 |
-
|
804 |
$name = $field['id'] . "_id";
|
805 |
-
|
806 |
$old = get_post_meta( $post_id, $name, !$field['multiple'] /* If multicheck this can be multiple values */ );
|
807 |
-
|
808 |
if ( isset( $field['save_id'] ) && $field['save_id'] ) {
|
809 |
-
|
810 |
$new = isset( $_POST[$name] ) ? $_POST[$name] : null;
|
811 |
-
|
812 |
} else {
|
813 |
-
|
814 |
$new = "";
|
815 |
-
|
816 |
}
|
817 |
-
|
818 |
if ( $new && $new != $old ) {
|
819 |
-
|
820 |
update_post_meta( $post_id, $name, $new );
|
821 |
-
|
822 |
} elseif ( '' == $new && $old ) {
|
823 |
-
|
824 |
delete_post_meta( $post_id, $name, $old );
|
825 |
-
|
826 |
}
|
827 |
-
|
828 |
}
|
829 |
-
|
830 |
}
|
831 |
-
|
832 |
}
|
833 |
-
|
834 |
}
|
835 |
-
|
836 |
/**
|
837 |
-
|
838 |
* Adding scripts and styles
|
839 |
-
|
840 |
*/
|
841 |
-
|
842 |
function bsf_scripts( $hook ) {
|
843 |
-
|
844 |
global $wp_version;
|
845 |
-
|
846 |
// only enqueue our scripts/styles on the proper pages
|
847 |
-
|
848 |
if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php') {
|
849 |
-
|
850 |
// scripts required for cmb
|
851 |
-
|
852 |
$bsf_script_array = array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'media-upload', 'thickbox' );
|
853 |
-
|
854 |
// styles required for cmb
|
855 |
-
|
856 |
$bsf_style_array = array( 'thickbox' );
|
857 |
-
|
858 |
// if we're 3.5 or later, user wp-color-picker
|
859 |
-
|
860 |
if ( 3.5 <= $wp_version ) {
|
861 |
-
|
862 |
$bsf_script_array[] = 'wp-color-picker';
|
863 |
-
|
864 |
$bsf_style_array[] = 'wp-color-picker';
|
865 |
-
|
866 |
} else {
|
867 |
-
|
868 |
// otherwise use the older 'farbtastic'
|
869 |
-
|
870 |
$bsf_script_array[] = 'farbtastic';
|
871 |
-
|
872 |
$bsf_style_array[] = 'farbtastic';
|
873 |
-
|
874 |
}
|
875 |
-
|
876 |
wp_register_script( 'bsf-timepicker', BSF_META_BOX_URL . 'js/jquery.timePicker.min.js' );
|
877 |
-
|
878 |
wp_register_script( 'bsf-scripts', BSF_META_BOX_URL . 'js/cmb.js', $bsf_script_array, '0.9.1' );
|
879 |
-
|
880 |
wp_localize_script( 'bsf-scripts', 'bsf_ajax_data', array( 'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ), 'post_id' => get_the_ID() ) );
|
881 |
-
|
882 |
wp_enqueue_script( 'bsf-timepicker' );
|
883 |
-
|
884 |
wp_enqueue_script( 'bsf-scripts' );
|
885 |
-
|
886 |
wp_register_style( 'bsf-styles', BSF_META_BOX_URL . 'admin/css/style.css', $bsf_style_array );
|
887 |
-
|
888 |
wp_enqueue_style( 'bsf-styles' );
|
889 |
-
|
890 |
}
|
891 |
-
|
892 |
}
|
893 |
-
|
894 |
add_action( 'admin_enqueue_scripts', 'bsf_scripts', 10 );
|
895 |
-
|
896 |
function bsf_editor_footer_scripts() { ?>
|
897 |
-
|
898 |
<?php
|
899 |
-
|
900 |
if ( isset( $_GET['bsf_force_send'] ) && 'true' == $_GET['bsf_force_send'] ) {
|
901 |
-
|
902 |
$label = $_GET['bsf_send_label'];
|
903 |
-
|
904 |
if ( empty( $label ) ) $label="Select File";
|
905 |
-
|
906 |
?>
|
907 |
-
|
908 |
<script type="text/javascript">
|
909 |
-
|
910 |
jQuery(function($) {
|
911 |
-
|
912 |
$('td.savesend input').val('<?php echo $label; ?>');
|
913 |
-
|
914 |
});
|
915 |
-
|
916 |
</script>
|
917 |
-
|
918 |
<?php
|
919 |
-
|
920 |
}
|
921 |
}
|
922 |
-
|
923 |
add_action( 'admin_print_footer_scripts', 'bsf_editor_footer_scripts', 99 );
|
924 |
-
|
925 |
// Force 'Insert into Post' button from Media Library
|
926 |
-
|
927 |
add_filter( 'get_media_item_args', 'bsf_force_send' );
|
928 |
-
|
929 |
function bsf_force_send( $args ) {
|
930 |
-
|
931 |
// if the Gallery tab is opened from a custom meta box field, add Insert Into Post button
|
932 |
-
|
933 |
if ( isset( $_GET['bsf_force_send'] ) && 'true' == $_GET['bsf_force_send'] )
|
934 |
-
|
935 |
$args['send'] = true;
|
936 |
-
|
937 |
// if the From Computer tab is opened AT ALL, add Insert Into Post button after an image is uploaded
|
938 |
-
|
939 |
if ( isset( $_POST['attachment_id'] ) && '' != $_POST["attachment_id"] ) {
|
940 |
-
|
941 |
$args['send'] = true;
|
942 |
-
|
943 |
// TO DO: Are there any conditions in which we don't want the Insert Into Post
|
944 |
-
|
945 |
// button added? For example, if a post type supports thumbnails, does not support
|
946 |
-
|
947 |
// the editor, and does not have any cmb file inputs? If so, here's the first
|
948 |
-
|
949 |
// bits of code needed to check all that.
|
950 |
-
|
951 |
// $attachment_ancestors = get_post_ancestors( $_POST["attachment_id"] );
|
952 |
-
|
953 |
// $attachment_parent_post_type = get_post_type( $attachment_ancestors[0] );
|
954 |
-
|
955 |
// $post_type_object = get_post_type_object( $attachment_parent_post_type );
|
956 |
-
|
957 |
}
|
958 |
-
|
959 |
// change the label of the button on the From Computer tab
|
960 |
-
|
961 |
if ( isset( $_POST['attachment_id'] ) && '' != $_POST["attachment_id"] ) {
|
962 |
-
|
963 |
echo '
|
964 |
-
|
965 |
<script type="text/javascript">
|
966 |
-
|
967 |
function cmbGetParameterByNameInline(name) {
|
968 |
-
|
969 |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
970 |
-
|
971 |
var regexS = "[\\?&]" + name + "=([^&#]*)";
|
972 |
-
|
973 |
var regex = new RegExp(regexS);
|
974 |
-
|
975 |
var results = regex.exec(window.location.href);
|
976 |
-
|
977 |
if(results == null)
|
978 |
-
|
979 |
return "";
|
980 |
-
|
981 |
else
|
982 |
-
|
983 |
return decodeURIComponent(results[1].replace(/\+/g, " "));
|
984 |
-
|
985 |
}
|
986 |
-
|
987 |
jQuery(function($) {
|
988 |
-
|
989 |
if (cmbGetParameterByNameInline("bsf_force_send")=="true") {
|
990 |
-
|
991 |
var bsf_send_label = cmbGetParameterByNameInline("bsf_send_label");
|
992 |
-
|
993 |
$("td.savesend input").val(bsf_send_label);
|
994 |
-
|
995 |
}
|
996 |
-
|
997 |
});
|
998 |
-
|
999 |
</script>
|
1000 |
-
|
1001 |
';
|
1002 |
-
|
1003 |
}
|
1004 |
-
|
1005 |
return $args;
|
1006 |
-
|
1007 |
}
|
1008 |
-
|
1009 |
add_action( 'wp_ajax_bsf_oembed_handler', 'bsf_oembed_ajax_results' );
|
1010 |
-
|
1011 |
/**
|
1012 |
-
|
1013 |
* Handles our oEmbed ajax request
|
1014 |
-
|
1015 |
*/
|
1016 |
-
|
1017 |
function bsf_oembed_ajax_results() {
|
1018 |
-
|
1019 |
// verify our nonce
|
1020 |
-
|
1021 |
if ( ! ( isset( $_REQUEST['bsf_ajax_nonce'], $_REQUEST['oembed_url'] ) && wp_verify_nonce( $_REQUEST['bsf_ajax_nonce'], 'ajax_nonce' ) ) )
|
1022 |
-
|
1023 |
die();
|
1024 |
-
|
1025 |
// sanitize our search string
|
1026 |
-
|
1027 |
$oembed_string = sanitize_text_field( $_REQUEST['oembed_url'] );
|
1028 |
-
|
1029 |
if ( empty( $oembed_string ) ) {
|
1030 |
-
|
1031 |
$return = '<p class="ui-state-error-text">'. __( 'Please Try Again', 'cmb' ) .'</p>';
|
1032 |
-
|
1033 |
$found = 'not found';
|
1034 |
-
|
1035 |
} else {
|
1036 |
-
|
1037 |
global $wp_embed;
|
1038 |
-
|
1039 |
$oembed_url = esc_url( $oembed_string );
|
1040 |
-
|
1041 |
// Post ID is needed to check for embeds
|
1042 |
-
|
1043 |
if ( isset( $_REQUEST['post_id'] ) )
|
1044 |
-
|
1045 |
$GLOBALS['post'] = get_post( $_REQUEST['post_id'] );
|
1046 |
-
|
1047 |
// ping WordPress for an embed
|
1048 |
-
|
1049 |
$check_embed = $wp_embed->run_shortcode( '[embed]'. $oembed_url .'[/embed]' );
|
1050 |
-
|
1051 |
// fallback that WordPress creates when no oEmbed was found
|
1052 |
-
|
1053 |
$fallback = $wp_embed->maybe_make_link( $oembed_url );
|
1054 |
-
|
1055 |
if ( $check_embed && $check_embed != $fallback ) {
|
1056 |
-
|
1057 |
// Embed data
|
1058 |
-
|
1059 |
$return = '<div class="embed_status">'. $check_embed .'<a href="#" class="bsf_remove_file_button" rel="'. $_REQUEST['field_id'] .'">'. __( 'Remove Embed', 'cmb' ) .'</a></div>';
|
1060 |
-
|
1061 |
// set our response id
|
1062 |
-
|
1063 |
$found = 'found';
|
1064 |
-
|
1065 |
} else {
|
1066 |
-
|
1067 |
// error info when no oEmbeds were found
|
1068 |
-
|
1069 |
$return = '<p class="ui-state-error-text">'.sprintf( __( 'No oEmbed Results Found for %s. View more info at', 'cmb' ), $fallback ) .' <a href="http://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>.</p>';
|
1070 |
-
|
1071 |
// set our response id
|
1072 |
-
|
1073 |
$found = 'not found';
|
1074 |
-
|
1075 |
}
|
1076 |
-
|
1077 |
}
|
1078 |
-
|
1079 |
// send back our encoded data
|
1080 |
-
|
1081 |
echo json_encode( array( 'result' => $return, 'id' => $found ) );
|
1082 |
-
|
1083 |
die();
|
1084 |
-
|
1085 |
}
|
1086 |
-
|
1087 |
// End. That's it, folks! //
|
1088 |
?>
|
1 |
<?php
|
|
|
2 |
$meta_boxes = array();
|
|
|
3 |
$meta_boxes = apply_filters ( 'bsf_meta_boxes' , $meta_boxes );
|
|
|
4 |
foreach ( $meta_boxes as $meta_box ) {
|
|
|
5 |
$my_box = new bsf_Meta_Box( $meta_box );
|
|
|
6 |
}
|
7 |
/**
|
|
|
8 |
* Validate value of meta fields
|
|
|
9 |
* Define ALL validation methods inside this class and use the names of these
|
|
|
10 |
* methods in the definition of meta boxes (key 'validate_func' of each field)
|
|
|
11 |
*/
|
|
|
12 |
class bsf_Meta_Box_Validate {
|
|
|
13 |
function check_text( $text ) {
|
|
|
14 |
if ($text != 'hello') {
|
|
|
15 |
return false;
|
|
|
16 |
}
|
|
|
17 |
return true;
|
|
|
18 |
}
|
|
|
19 |
}
|
20 |
/**
|
|
|
21 |
* Defines the url to which is used to load local resources.
|
|
|
22 |
* This may need to be filtered for local Window installations.
|
|
|
23 |
* If resources do not load, please check the wiki for details.
|
|
|
24 |
*/
|
|
|
25 |
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
|
|
26 |
//winblows
|
|
|
27 |
define( 'BSF_META_BOX_URL', trailingslashit( str_replace( DIRECTORY_SEPARATOR, '/', str_replace( str_replace( '/', DIRECTORY_SEPARATOR, WP_CONTENT_DIR ), WP_CONTENT_URL, dirname(__FILE__) ) ) ) );
|
28 |
} else {
|
|
|
29 |
define( 'BSF_META_BOX_URL', apply_filters( 'bsf_meta_box_url', trailingslashit( str_replace( WP_CONTENT_DIR, WP_CONTENT_URL, dirname( __FILE__ ) ) ) ) );
|
|
|
30 |
}
|
31 |
/**
|
|
|
32 |
* Create meta boxes
|
|
|
33 |
*/
|
|
|
34 |
class bsf_Meta_Box {
|
|
|
35 |
protected $_meta_box;
|
36 |
function __construct( $meta_box ) {
|
|
|
37 |
if ( !is_admin() ) return;
|
38 |
$this->_meta_box = $meta_box;
|
39 |
$upload = false;
|
|
|
40 |
foreach ( $meta_box['fields'] as $field ) {
|
|
|
41 |
if ( $field['type'] == 'file' || $field['type'] == 'file_list' ) {
|
|
|
42 |
$upload = true;
|
|
|
43 |
break;
|
|
|
44 |
}
|
|
|
45 |
}
|
46 |
global $pagenow;
|
|
|
47 |
if ( $upload && in_array( $pagenow, array( 'page.php', 'page-new.php', 'post.php', 'post-new.php' ) ) ) {
|
|
|
48 |
add_action( 'admin_head', array( &$this, 'add_post_enctype' ) );
|
|
|
49 |
}
|
50 |
add_action( 'admin_menu', array( &$this, 'add' ) );
|
|
|
51 |
add_action( 'save_post', array( &$this, 'save' ) );
|
52 |
add_filter( 'bsf_show_on', array( &$this, 'add_for_id' ), 10, 2 );
|
|
|
53 |
add_filter( 'bsf_show_on', array( &$this, 'add_for_page_template' ), 10, 2 );
|
|
|
54 |
}
|
55 |
function add_post_enctype() {
|
|
|
56 |
echo '
|
|
|
57 |
<script type="text/javascript">
|
|
|
58 |
jQuery(document).ready(function(){
|
|
|
59 |
jQuery("#post").attr("enctype", "multipart/form-data");
|
|
|
60 |
jQuery("#post").attr("encoding", "multipart/form-data");
|
|
|
61 |
});
|
|
|
62 |
</script>';
|
|
|
63 |
}
|
64 |
// Add metaboxes
|
|
|
65 |
function add() {
|
|
|
66 |
$this->_meta_box['context'] = empty($this->_meta_box['context']) ? 'normal' : $this->_meta_box['context'];
|
|
|
67 |
$this->_meta_box['priority'] = empty($this->_meta_box['priority']) ? 'high' : $this->_meta_box['priority'];
|
|
|
68 |
$this->_meta_box['show_on'] = empty( $this->_meta_box['show_on'] ) ? array('key' => false, 'value' => false) : $this->_meta_box['show_on'];
|
69 |
foreach ( $this->_meta_box['pages'] as $page ) {
|
|
|
70 |
if( apply_filters( 'bsf_show_on', true, $this->_meta_box ) )
|
|
|
71 |
add_meta_box( $this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']) ;
|
|
|
72 |
}
|
|
|
73 |
}
|
74 |
/**
|
|
|
75 |
* Show On Filters
|
|
|
76 |
* Use the 'bsf_show_on' filter to further refine the conditions under which a metabox is displayed.
|
|
|
77 |
* Below you can limit it by ID and page template
|
|
|
78 |
*/
|
79 |
// Add for ID
|
|
|
80 |
function add_for_id( $display, $meta_box ) {
|
|
|
81 |
if ( 'id' !== $meta_box['show_on']['key'] )
|
|
|
82 |
return $display;
|
83 |
// If we're showing it based on ID, get the current ID
|
|
|
84 |
if( isset( $_GET['post'] ) ) $post_id = $_GET['post'];
|
|
|
85 |
elseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID'];
|
|
|
86 |
if( !isset( $post_id ) )
|
|
|
87 |
return false;
|
88 |
// If value isn't an array, turn it into one
|
|
|
89 |
$meta_box['show_on']['value'] = !is_array( $meta_box['show_on']['value'] ) ? array( $meta_box['show_on']['value'] ) : $meta_box['show_on']['value'];
|
90 |
// If current page id is in the included array, display the metabox
|
91 |
if ( in_array( $post_id, $meta_box['show_on']['value'] ) )
|
|
|
92 |
return true;
|
|
|
93 |
else
|
|
|
94 |
return false;
|
|
|
95 |
}
|
96 |
// Add for Page Template
|
|
|
97 |
function add_for_page_template( $display, $meta_box ) {
|
|
|
98 |
if( 'page-template' !== $meta_box['show_on']['key'] )
|
|
|
99 |
return $display;
|
100 |
// Get the current ID
|
|
|
101 |
if( isset( $_GET['post'] ) ) $post_id = $_GET['post'];
|
|
|
102 |
elseif( isset( $_POST['post_ID'] ) ) $post_id = $_POST['post_ID'];
|
|
|
103 |
if( !( isset( $post_id ) || is_page() ) ) return false;
|
104 |
// Get current template
|
|
|
105 |
$current_template = get_post_meta( $post_id, '_wp_page_template', true );
|
106 |
// If value isn't an array, turn it into one
|
|
|
107 |
$meta_box['show_on']['value'] = !is_array( $meta_box['show_on']['value'] ) ? array( $meta_box['show_on']['value'] ) : $meta_box['show_on']['value'];
|
108 |
// See if there's a match
|
|
|
109 |
if( in_array( $current_template, $meta_box['show_on']['value'] ) )
|
|
|
110 |
return true;
|
|
|
111 |
else
|
|
|
112 |
return false;
|
|
|
113 |
}
|
114 |
// Show fields
|
|
|
115 |
function show() {
|
116 |
global $post;
|
|
|
117 |
// Use nonce for verification
|
|
|
118 |
echo '<input type="hidden" name="wp_meta_box_nonce" value="', wp_create_nonce( basename(__FILE__) ), '" />';
|
|
|
119 |
echo '<table class="form-table bsf_metabox">';
|
|
|
120 |
foreach ( $this->_meta_box['fields'] as $field ) {
|
|
|
121 |
// Set up blank or default values for empty ones
|
|
|
122 |
if ( !isset( $field['name'] ) ) $field['name'] = '';
|
|
|
123 |
if ( !isset( $field['desc'] ) ) $field['desc'] = '';
|
|
|
124 |
if ( !isset( $field['std'] ) ) $field['std'] = '';
|
|
|
125 |
if ( 'file' == $field['type'] && !isset( $field['allow'] ) ) $field['allow'] = array( 'url', 'attachment' );
|
|
|
126 |
if ( 'file' == $field['type'] && !isset( $field['save_id'] ) ) $field['save_id'] = false;
|
|
|
127 |
if ( 'multicheck' == $field['type'] ) $field['multiple'] = true;
|
|
|
128 |
$meta = get_post_meta( $post->ID, $field['id'], 'multicheck' != $field['type'] /* If multicheck this can be multiple values */ );
|
|
|
129 |
echo '<tr class="', $field['class'],'">';
|
|
|
130 |
if ( $field['type'] == "title" ) {
|
|
|
131 |
echo '<td colspan="2">';
|
|
|
132 |
} else {
|
|
|
133 |
if( $this->_meta_box['show_names'] == true ) {
|
|
|
134 |
echo '<th style="width:18%"><label class="', $field['class'],'" for="', $field['id'], '">', $field['name'], '</label></th>';
|
|
|
135 |
}
|
|
|
136 |
echo '<td>';
|
|
|
137 |
}
|
138 |
|
139 |
switch ( $field['type'] ) {
|
|
|
140 |
case 'text':
|
|
|
141 |
echo '<input class="', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
142 |
break;
|
|
|
143 |
case 'text_small':
|
|
|
144 |
echo '<input class="bsf_text_small ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
145 |
break;
|
|
|
146 |
case 'text_medium':
|
|
|
147 |
echo '<input class="bsf_text_medium ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
148 |
break;
|
|
|
149 |
case 'text_date':
|
|
|
150 |
echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
151 |
break;
|
|
|
152 |
case 'text_date_timestamp':
|
|
|
153 |
echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
154 |
break;
|
155 |
case 'text_datetime_timestamp':
|
|
|
156 |
echo '<input class="bsf_text_small bsf_datepicker ', $field['class'],'" type="text" name="', $field['id'], '[date]" id="', $field['id'], '_date" value="', '' !== $meta ? date( 'm\/d\/Y', $meta ) : $field['std'], '" />';
|
|
|
157 |
echo '<input class="bsf_timepicker text_time ', $field['class'],'" type="text" name="', $field['id'], '[time]" id="', $field['id'], '_time" value="', '' !== $meta ? date( 'h:i A', $meta ) : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'" >', $field['desc'], '</span>';
|
|
|
158 |
break;
|
|
|
159 |
case 'text_time':
|
|
|
160 |
echo '<input class="bsf_timepicker text_time ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
161 |
break;
|
|
|
162 |
case 'text_money':
|
|
|
163 |
echo '$ <input class="bsf_text_money ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
164 |
break;
|
|
|
165 |
case 'colorpicker':
|
|
|
166 |
$meta = '' !== $meta ? $meta : $field['std'];
|
|
|
167 |
$hex_color = '(([a-fA-F0-9]){3}){1,2}$';
|
|
|
168 |
if ( preg_match( '/^' . $hex_color . '/i', $meta ) ) // Value is just 123abc, so prepend #.
|
|
|
169 |
$meta = '#' . $meta;
|
|
|
170 |
elseif ( ! preg_match( '/^#' . $hex_color . '/i', $meta ) ) // Value doesn't match #123abc, so sanitize to just #.
|
|
|
171 |
$meta = "#";
|
|
|
172 |
echo '<input class="bsf_colorpicker bsf_text_small ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', $meta, '" /><span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
173 |
break;
|
|
|
174 |
case 'textarea':
|
|
|
175 |
echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
176 |
break;
|
|
|
177 |
case 'textarea_small':
|
|
|
178 |
echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="4">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
179 |
break;
|
|
|
180 |
case 'textarea_code':
|
|
|
181 |
echo '<textarea class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '" cols="60" rows="10" class="bsf_textarea_code">', '' !== $meta ? $meta : $field['std'], '</textarea>','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
182 |
break;
|
|
|
183 |
case 'select':
|
|
|
184 |
if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
|
|
|
185 |
echo '<select class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '">';
|
|
|
186 |
foreach ($field['options'] as $option) {
|
|
|
187 |
echo '<option class="', $field['class'],'" value="', $option['value'], '"', $meta == $option['value'] ? ' selected="selected"' : '', '>', $option['name'], '</option>';
|
|
|
188 |
}
|
|
|
189 |
echo '</select>';
|
|
|
190 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
191 |
break;
|
|
|
192 |
case 'radio_inline':
|
|
|
193 |
if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
|
|
|
194 |
echo '<div class="bsf_radio_inline ', $field['class'],'">';
|
|
|
195 |
$i = 1;
|
|
|
196 |
foreach ($field['options'] as $option) {
|
|
|
197 |
echo '<div class="bsf_radio_inline_option ', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" id="', $field['id'], $i, '" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $option['name'], '</label></div>';
|
|
|
198 |
$i++;
|
|
|
199 |
}
|
|
|
200 |
echo '</div>';
|
|
|
201 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
202 |
break;
|
|
|
203 |
case 'radio':
|
|
|
204 |
if( empty( $meta ) && !empty( $field['std'] ) ) $meta = $field['std'];
|
|
|
205 |
echo '<div class=class="', $field['class'],'"><ul>';
|
|
|
206 |
$i = 1;
|
|
|
207 |
foreach ($field['options'] as $option) {
|
|
|
208 |
if( $field['class'] == "star review" || $field['class'] == "star product" || $field['class'] == "star software")
|
|
|
209 |
$class = "star";
|
|
|
210 |
else
|
|
|
211 |
$class = $field['class'];
|
|
|
212 |
echo '<li class="', $field['class'],'">
|
|
|
213 |
<input class="', $class,'" type="radio" name="', $field['id'], '" id="', $field['id'], $i,'" value="', $option['value'], '"', $meta == $option['value'] ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $option['name'].'</label> </li>';
|
|
|
214 |
$i++;
|
|
|
215 |
}
|
|
|
216 |
echo '</ul></div>';
|
|
|
217 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
218 |
break;
|
|
|
219 |
case 'checkbox':
|
|
|
220 |
echo '<input type="checkbox" class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '"', $meta ? ' checked="checked"' : '', ' />';
|
|
|
221 |
echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
222 |
break;
|
|
|
223 |
case 'multicheck':
|
|
|
224 |
echo '<ul class="', $field['class'],'">';
|
|
|
225 |
$i = 1;
|
|
|
226 |
foreach ( $field['options'] as $value => $name ) {
|
|
|
227 |
// Append `[]` to the name to get multiple values
|
|
|
228 |
// Use in_array() to check whether the current option should be checked
|
|
|
229 |
echo '<li class="', $field['class'],'"><input type="checkbox" class="', $field['class'],'" name="', $field['id'], '[]" id="', $field['id'], $i, '" value="', $value, '"', in_array( $value, $meta ) ? ' checked="checked"' : '', ' /><label class="', $field['class'],'" for="', $field['id'], $i, '">', $name, '</label></li>';
|
|
|
230 |
$i++;
|
|
|
231 |
}
|
|
|
232 |
echo '</ul>';
|
|
|
233 |
echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
234 |
break;
|
|
|
235 |
case 'title':
|
|
|
236 |
echo '<h5 class="bsf_metabox_title ', $field['class'],'">', $field['name'], '</h5>';
|
|
|
237 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
238 |
break;
|
|
|
239 |
case 'wysiwyg':
|
|
|
240 |
wp_editor( $meta ? $meta : $field['std'], $field['id'], isset( $field['options'] ) ? $field['options'] : array() );
|
|
|
241 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
242 |
break;
|
|
|
243 |
case 'taxonomy_select':
|
|
|
244 |
echo '<select class="', $field['class'],'" name="', $field['id'], '" id="', $field['id'], '">';
|
|
|
245 |
$names= wp_get_object_terms( $post->ID, $field['taxonomy'] );
|
|
|
246 |
$terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
|
|
|
247 |
foreach ( $terms as $term ) {
|
|
|
248 |
if (!is_wp_error( $names ) && !empty( $names ) && !strcmp( $term->slug, $names[0]->slug ) ) {
|
|
|
249 |
echo '<option value="' . $term->slug . '" selected>' . $term->name . '</option>';
|
|
|
250 |
} else {
|
|
|
251 |
echo '<option value="' . $term->slug . ' ' , $meta == $term->slug ? $meta : ' ' ,' ">' . $term->name . '</option>';
|
|
|
252 |
}
|
|
|
253 |
}
|
|
|
254 |
echo '</select>';
|
|
|
255 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
256 |
break;
|
|
|
257 |
case 'taxonomy_radio':
|
|
|
258 |
$names= wp_get_object_terms( $post->ID, $field['taxonomy'] );
|
|
|
259 |
$terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
|
|
|
260 |
echo '<ul class="', $field['class'],'">';
|
|
|
261 |
foreach ( $terms as $term ) {
|
|
|
262 |
if ( !is_wp_error( $names ) && !empty( $names ) && !strcmp( $term->slug, $names[0]->slug ) ) {
|
|
|
263 |
echo '<li class="', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" value="'. $term->slug . '" checked>' . $term->name . '</li>';
|
|
|
264 |
} else {
|
|
|
265 |
echo '<li class="', $field['class'],'"><input class="', $field['class'],'" type="radio" name="', $field['id'], '" value="' . $term->slug . ' ' , $meta == $term->slug ? $meta : ' ' ,' ">' . $term->name .'</li>';
|
|
|
266 |
}
|
|
|
267 |
}
|
|
|
268 |
echo '</ul>';
|
|
|
269 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
270 |
break;
|
|
|
271 |
case 'taxonomy_multicheck':
|
|
|
272 |
echo '<ul>';
|
|
|
273 |
$names = wp_get_object_terms( $post->ID, $field['taxonomy'] );
|
|
|
274 |
$terms = get_terms( $field['taxonomy'], 'hide_empty=0' );
|
|
|
275 |
foreach ($terms as $term) {
|
|
|
276 |
echo '<li><input class="', $field['class'],'" type="checkbox" name="', $field['id'], '[]" id="', $field['id'], '" value="', $term->name , '"';
|
|
|
277 |
foreach ($names as $name) {
|
|
|
278 |
if ( $term->slug == $name->slug ){ echo ' checked="checked" ';};
|
|
|
279 |
}
|
|
|
280 |
echo' /><label>', $term->name , '</label></li>';
|
|
|
281 |
}
|
|
|
282 |
echo '</ul>';
|
|
|
283 |
echo '<span class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</span>';
|
|
|
284 |
break;
|
|
|
285 |
case 'file_list':
|
|
|
286 |
echo '<input class="bsf_upload_file ', $field['class'],'" type="text" size="36" name="', $field['id'], '" value="" />';
|
|
|
287 |
echo '<input class="bsf_upload_button button ', $field['class'],'" type="button" value="Upload File" />';
|
|
|
288 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
289 |
$args = array(
|
|
|
290 |
'post_type' => 'attachment',
|
|
|
291 |
'numberposts' => null,
|
|
|
292 |
'post_status' => null,
|
|
|
293 |
'post_parent' => $post->ID
|
|
|
294 |
);
|
|
|
295 |
$attachments = get_posts($args);
|
|
|
296 |
if ($attachments) {
|
|
|
297 |
echo '<ul class="attach_list">';
|
|
|
298 |
foreach ($attachments as $attachment) {
|
|
|
299 |
echo '<li>'.wp_get_attachment_link($attachment->ID, 'thumbnail', 0, 0, 'Download');
|
|
|
300 |
echo '<span>';
|
|
|
301 |
echo apply_filters('the_title', ' '.$attachment->post_title);
|
|
|
302 |
echo '</span></li>';
|
|
|
303 |
}
|
|
|
304 |
echo '</ul>';
|
|
|
305 |
}
|
|
|
306 |
break;
|
|
|
307 |
case 'file':
|
|
|
308 |
$input_type_url = "hidden";
|
|
|
309 |
if ( 'url' == $field['allow'] || ( is_array( $field['allow'] ) && in_array( 'url', $field['allow'] ) ) )
|
|
|
310 |
$input_type_url="text";
|
|
|
311 |
echo '<input class="bsf_upload_file ', $field['class'],'" type="' . $input_type_url . '" size="45" id="', $field['id'], '" name="', $field['id'], '" value="', $meta, '" />';
|
|
|
312 |
echo '<input class="bsf_upload_button button ', $field['class'],'" type="button" value="Upload File" />';
|
|
|
313 |
echo '<input class="bsf_upload_file_id ', $field['class'],'" type="hidden" id="', $field['id'], '_id" name="', $field['id'], '_id" value="', get_post_meta( $post->ID, $field['id'] . "_id",true), '" />';
|
|
|
314 |
echo '<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
315 |
echo '<div id="', $field['id'], '_status" class="bsf_media_status ', $field['class'],'">';
|
|
|
316 |
if ( $meta != '' ) {
|
|
|
317 |
$check_image = preg_match( '/(^.*\.jpg|jpeg|png|gif|ico*)/i', $meta );
|
|
|
318 |
if ( $check_image ) {
|
|
|
319 |
echo '<div class="img_status">';
|
|
|
320 |
echo '<img src="', $meta, '" alt="" />';
|
|
|
321 |
echo '<a href="#" class="bsf_remove_file_button ', $field['class'],'" rel="', $field['id'], '">Remove Image</a>';
|
|
|
322 |
echo '</div>';
|
|
|
323 |
} else {
|
|
|
324 |
$parts = explode( '/', $meta );
|
|
|
325 |
for( $i = 0; $i < count( $parts ); ++$i ) {
|
|
|
326 |
$title = $parts[$i];
|
|
|
327 |
}
|
|
|
328 |
echo 'File: <strong>', $title, '</strong> (<a href="', $meta, '" target="_blank" rel="external">Download</a> / <a href="#" class="bsf_remove_file_button" rel="', $field['id'], '">Remove</a>)';
|
|
|
329 |
}
|
|
|
330 |
}
|
|
|
331 |
echo '</div>';
|
|
|
332 |
break;
|
|
|
333 |
case 'oembed':
|
|
|
334 |
echo '<input class="bsf_oembed ', $field['class'],'" type="text" name="', $field['id'], '" id="', $field['id'], '" value="', '' !== $meta ? $meta : $field['std'], '" />','<p class="bsf_metabox_description ', $field['class'],'">', $field['desc'], '</p>';
|
|
|
335 |
echo '<p class="bsf-spinner spinner ', $field['class'],'"></p>';
|
|
|
336 |
echo '<div id="', $field['id'], '_status" class="bsf_media_status ui-helper-clearfix embed_wrap ', $field['class'],'">';
|
|
|
337 |
if ( $meta != '' ) {
|
|
|
338 |
$check_embed = $GLOBALS['wp_embed']->run_shortcode( '[embed]'. esc_url( $meta ) .'[/embed]' );
|
|
|
339 |
if ( $check_embed ) {
|
|
|
340 |
echo '<div class="embed_status ', $field['class'],'">';
|
|
|
341 |
echo $check_embed;
|
|
|
342 |
echo '<a href="#" class="bsf_remove_file_button ', $field['class'],'" rel="', $field['id'], '">Remove Embed</a>';
|
|
|
343 |
echo '</div>';
|
|
|
344 |
} else {
|
|
|
345 |
echo 'URL is not a valid oEmbed URL.';
|
|
|
346 |
}
|
|
|
347 |
}
|
|
|
348 |
echo '</div>';
|
|
|
349 |
break;
|
|
|
350 |
default:
|
|
|
351 |
do_action('bsf_render_' . $field['type'] , $field, $meta);
|
|
|
352 |
}
|
|
|
353 |
echo '</td>','</tr>';
|
|
|
354 |
}
|
|
|
355 |
echo '</table>';
|
|
|
356 |
}
|
|
|
357 |
// Save data from metabox
|
|
|
358 |
function save( $post_id) {
|
|
|
359 |
// verify nonce
|
|
|
360 |
if ( ! isset( $_POST['wp_meta_box_nonce'] ) || !wp_verify_nonce( $_POST['wp_meta_box_nonce'], basename(__FILE__) ) ) {
|
|
|
361 |
return $post_id;
|
|
|
362 |
}
|
|
|
363 |
// check autosave
|
|
|
364 |
if ( defined('DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
|
|
365 |
return $post_id;
|
|
|
366 |
}
|
|
|
367 |
// check permissions
|
|
|
368 |
if ( 'page' == $_POST['post_type'] ) {
|
|
|
369 |
if ( !current_user_can( 'edit_page', $post_id ) ) {
|
|
|
370 |
return $post_id;
|
|
|
371 |
}
|
|
|
372 |
} elseif ( !current_user_can( 'edit_post', $post_id ) ) {
|
|
|
373 |
return $post_id;
|
|
|
374 |
}
|
|
|
375 |
foreach ( $this->_meta_box['fields'] as $field ) {
|
|
|
376 |
$name = $field['id'];
|
|
|
377 |
if ( ! isset( $field['multiple'] ) )
|
|
|
378 |
$field['multiple'] = ( 'multicheck' == $field['type'] ) ? true : false;
|
|
|
379 |
$old = get_post_meta( $post_id, $name, !$field['multiple'] /* If multicheck this can be multiple values */ );
|
|
|
380 |
$new = isset( $_POST[$field['id']] ) ? $_POST[$field['id']] : null;
|
|
|
381 |
if ( in_array( $field['type'], array( 'taxonomy_select', 'taxonomy_radio', 'taxonomy_multicheck' ) ) ) {
|
|
|
382 |
$new = wp_set_object_terms( $post_id, $new, $field['taxonomy'] );
|
|
|
383 |
}
|
|
|
384 |
if ( ($field['type'] == 'textarea') || ($field['type'] == 'textarea_small') ) {
|
|
|
385 |
$new = htmlspecialchars( $new );
|
|
|
386 |
}
|
|
|
387 |
if ( ($field['type'] == 'textarea_code') ) {
|
|
|
388 |
$new = htmlspecialchars_decode( $new );
|
|
|
389 |
}
|
|
|
390 |
if ( $field['type'] == 'text_date_timestamp' ) {
|
|
|
391 |
$new = strtotime( $new );
|
|
|
392 |
}
|
|
|
393 |
if ( $field['type'] == 'text_datetime_timestamp' ) {
|
|
|
394 |
$string = $new['date'] . ' ' . $new['time'];
|
|
|
395 |
$new = strtotime( $string );
|
|
|
396 |
}
|
|
|
397 |
$new = apply_filters('bsf_validate_' . $field['type'], $new, $post_id, $field);
|
|
|
398 |
// validate meta value
|
|
|
399 |
if ( isset( $field['validate_func']) ) {
|
|
|
400 |
$ok = call_user_func( array( 'bsf_Meta_Box_Validate', $field['validate_func']), $new );
|
|
|
401 |
if ( $ok === false ) { // pass away when meta value is invalid
|
|
|
402 |
continue;
|
|
|
403 |
}
|
|
|
404 |
} elseif ( $field['multiple'] ) {
|
|
|
405 |
delete_post_meta( $post_id, $name );
|
|
|
406 |
if ( !empty( $new ) ) {
|
|
|
407 |
foreach ( $new as $add_new ) {
|
|
|
408 |
add_post_meta( $post_id, $name, $add_new, false );
|
|
|
409 |
}
|
|
|
410 |
}
|
|
|
411 |
} elseif ( '' !== $new && $new != $old ) {
|
|
|
412 |
update_post_meta( $post_id, $name, $new );
|
|
|
413 |
} elseif ( '' == $new ) {
|
|
|
414 |
delete_post_meta( $post_id, $name );
|
|
|
415 |
}
|
|
|
416 |
if ( 'file' == $field['type'] ) {
|
|
|
417 |
$name = $field['id'] . "_id";
|
|
|
418 |
$old = get_post_meta( $post_id, $name, !$field['multiple'] /* If multicheck this can be multiple values */ );
|
|
|
419 |
if ( isset( $field['save_id'] ) && $field['save_id'] ) {
|
|
|
420 |
$new = isset( $_POST[$name] ) ? $_POST[$name] : null;
|
|
|
421 |
} else {
|
|
|
422 |
$new = "";
|
|
|
423 |
}
|
|
|
424 |
if ( $new && $new != $old ) {
|
|
|
425 |
update_post_meta( $post_id, $name, $new );
|
|
|
426 |
} elseif ( '' == $new && $old ) {
|
|
|
427 |
delete_post_meta( $post_id, $name, $old );
|
|
|
428 |
}
|
|
|
429 |
}
|
|
|
430 |
}
|
|
|
431 |
}
|
|
|
432 |
}
|
|
|
433 |
/**
|
|
|
434 |
* Adding scripts and styles
|
|
|
435 |
*/
|
|
|
436 |
function bsf_scripts( $hook ) {
|
|
|
437 |
global $wp_version;
|
|
|
438 |
// only enqueue our scripts/styles on the proper pages
|
|
|
439 |
if ( $hook == 'post.php' || $hook == 'post-new.php' || $hook == 'page-new.php' || $hook == 'page.php') {
|
|
|
440 |
// scripts required for cmb
|
|
|
441 |
$bsf_script_array = array( 'jquery', 'jquery-ui-core', 'jquery-ui-datepicker', 'media-upload', 'thickbox' );
|
|
|
442 |
// styles required for cmb
|
|
|
443 |
$bsf_style_array = array( 'thickbox' );
|
|
|
444 |
// if we're 3.5 or later, user wp-color-picker
|
|
|
445 |
if ( 3.5 <= $wp_version ) {
|
|
|
446 |
$bsf_script_array[] = 'wp-color-picker';
|
|
|
447 |
$bsf_style_array[] = 'wp-color-picker';
|
|
|
448 |
} else {
|
|
|
449 |
// otherwise use the older 'farbtastic'
|
|
|
450 |
$bsf_script_array[] = 'farbtastic';
|
|
|
451 |
$bsf_style_array[] = 'farbtastic';
|
|
|
452 |
}
|
|
|
453 |
wp_register_script( 'bsf-timepicker', BSF_META_BOX_URL . 'js/jquery.timePicker.min.js' );
|
|
|
454 |
wp_register_script( 'bsf-scripts', BSF_META_BOX_URL . 'js/cmb.js', $bsf_script_array, '0.9.1' );
|
|
|
455 |
wp_localize_script( 'bsf-scripts', 'bsf_ajax_data', array( 'ajax_nonce' => wp_create_nonce( 'ajax_nonce' ), 'post_id' => get_the_ID() ) );
|
|
|
456 |
wp_enqueue_script( 'bsf-timepicker' );
|
|
|
457 |
wp_enqueue_script( 'bsf-scripts' );
|
|
|
458 |
wp_register_style( 'bsf-styles', BSF_META_BOX_URL . 'admin/css/style.css', $bsf_style_array );
|
|
|
459 |
wp_enqueue_style( 'bsf-styles' );
|
|
|
460 |
}
|
|
|
461 |
}
|
|
|
462 |
add_action( 'admin_enqueue_scripts', 'bsf_scripts', 10 );
|
|
|
463 |
function bsf_editor_footer_scripts() { ?>
|
|
|
464 |
<?php
|
|
|
465 |
if ( isset( $_GET['bsf_force_send'] ) && 'true' == $_GET['bsf_force_send'] ) {
|
|
|
466 |
$label = $_GET['bsf_send_label'];
|
|
|
467 |
if ( empty( $label ) ) $label="Select File";
|
|
|
468 |
?>
|
|
|
469 |
<script type="text/javascript">
|
|
|
470 |
jQuery(function($) {
|
|
|
471 |
$('td.savesend input').val('<?php echo $label; ?>');
|
|
|
472 |
});
|
|
|
473 |
</script>
|
|
|
474 |
<?php
|
|
|
475 |
}
|
476 |
}
|
|
|
477 |
add_action( 'admin_print_footer_scripts', 'bsf_editor_footer_scripts', 99 );
|
|
|
478 |
// Force 'Insert into Post' button from Media Library
|
|
|
479 |
add_filter( 'get_media_item_args', 'bsf_force_send' );
|
|
|
480 |
function bsf_force_send( $args ) {
|
|
|
481 |
// if the Gallery tab is opened from a custom meta box field, add Insert Into Post button
|
|
|
482 |
if ( isset( $_GET['bsf_force_send'] ) && 'true' == $_GET['bsf_force_send'] )
|
|
|
483 |
$args['send'] = true;
|
|
|
484 |
// if the From Computer tab is opened AT ALL, add Insert Into Post button after an image is uploaded
|
|
|
485 |
if ( isset( $_POST['attachment_id'] ) && '' != $_POST["attachment_id"] ) {
|
|
|
486 |
$args['send'] = true;
|
|
|
487 |
// TO DO: Are there any conditions in which we don't want the Insert Into Post
|
|
|
488 |
// button added? For example, if a post type supports thumbnails, does not support
|
|
|
489 |
// the editor, and does not have any cmb file inputs? If so, here's the first
|
|
|
490 |
// bits of code needed to check all that.
|
|
|
491 |
// $attachment_ancestors = get_post_ancestors( $_POST["attachment_id"] );
|
|
|
492 |
// $attachment_parent_post_type = get_post_type( $attachment_ancestors[0] );
|
|
|
493 |
// $post_type_object = get_post_type_object( $attachment_parent_post_type );
|
|
|
494 |
}
|
|
|
495 |
// change the label of the button on the From Computer tab
|
|
|
496 |
if ( isset( $_POST['attachment_id'] ) && '' != $_POST["attachment_id"] ) {
|
|
|
497 |
echo '
|
|
|
498 |
<script type="text/javascript">
|
|
|
499 |
function cmbGetParameterByNameInline(name) {
|
|
|
500 |
name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
|
|
|
501 |
var regexS = "[\\?&]" + name + "=([^&#]*)";
|
|
|
502 |
var regex = new RegExp(regexS);
|
|
|
503 |
var results = regex.exec(window.location.href);
|
|
|
504 |
if(results == null)
|
|
|
505 |
return "";
|
|
|
506 |
else
|
|
|
507 |
return decodeURIComponent(results[1].replace(/\+/g, " "));
|
|
|
508 |
}
|
|
|
509 |
jQuery(function($) {
|
|
|
510 |
if (cmbGetParameterByNameInline("bsf_force_send")=="true") {
|
|
|
511 |
var bsf_send_label = cmbGetParameterByNameInline("bsf_send_label");
|
|
|
512 |
$("td.savesend input").val(bsf_send_label);
|
|
|
513 |
}
|
|
|
514 |
});
|
|
|
515 |
</script>
|
|
|
516 |
';
|
|
|
517 |
}
|
|
|
518 |
return $args;
|
|
|
519 |
}
|
|
|
520 |
add_action( 'wp_ajax_bsf_oembed_handler', 'bsf_oembed_ajax_results' );
|
|
|
521 |
/**
|
|
|
522 |
* Handles our oEmbed ajax request
|
|
|
523 |
*/
|
|
|
524 |
function bsf_oembed_ajax_results() {
|
|
|
525 |
// verify our nonce
|
|
|
526 |
if ( ! ( isset( $_REQUEST['bsf_ajax_nonce'], $_REQUEST['oembed_url'] ) && wp_verify_nonce( $_REQUEST['bsf_ajax_nonce'], 'ajax_nonce' ) ) )
|
|
|
527 |
die();
|
|
|
528 |
// sanitize our search string
|
|
|
529 |
$oembed_string = sanitize_text_field( $_REQUEST['oembed_url'] );
|
|
|
530 |
if ( empty( $oembed_string ) ) {
|
|
|
531 |
$return = '<p class="ui-state-error-text">'. __( 'Please Try Again', 'cmb' ) .'</p>';
|
|
|
532 |
$found = 'not found';
|
|
|
533 |
} else {
|
|
|
534 |
global $wp_embed;
|
|
|
535 |
$oembed_url = esc_url( $oembed_string );
|
|
|
536 |
// Post ID is needed to check for embeds
|
|
|
537 |
if ( isset( $_REQUEST['post_id'] ) )
|
|
|
538 |
$GLOBALS['post'] = get_post( $_REQUEST['post_id'] );
|
|
|
539 |
// ping WordPress for an embed
|
|
|
540 |
$check_embed = $wp_embed->run_shortcode( '[embed]'. $oembed_url .'[/embed]' );
|
|
|
541 |
// fallback that WordPress creates when no oEmbed was found
|
|
|
542 |
$fallback = $wp_embed->maybe_make_link( $oembed_url );
|
|
|
543 |
if ( $check_embed && $check_embed != $fallback ) {
|
|
|
544 |
// Embed data
|
|
|
545 |
$return = '<div class="embed_status">'. $check_embed .'<a href="#" class="bsf_remove_file_button" rel="'. $_REQUEST['field_id'] .'">'. __( 'Remove Embed', 'cmb' ) .'</a></div>';
|
|
|
546 |
// set our response id
|
|
|
547 |
$found = 'found';
|
|
|
548 |
} else {
|
|
|
549 |
// error info when no oEmbeds were found
|
|
|
550 |
$return = '<p class="ui-state-error-text">'.sprintf( __( 'No oEmbed Results Found for %s. View more info at', 'cmb' ), $fallback ) .' <a href="http://codex.wordpress.org/Embeds" target="_blank">codex.wordpress.org/Embeds</a>.</p>';
|
|
|
551 |
// set our response id
|
|
|
552 |
$found = 'not found';
|
|
|
553 |
}
|
|
|
554 |
}
|
|
|
555 |
// send back our encoded data
|
|
|
556 |
echo json_encode( array( 'result' => $return, 'id' => $found ) );
|
|
|
557 |
die();
|
|
|
558 |
}
|
|
|
559 |
// End. That's it, folks! //
|
560 |
?>
|
js/cmb.js
CHANGED
@@ -1,200 +1,130 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
*
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
var pasteitem = jQuery(this);
|
132 |
-
// paste event is fired before the value is filled, so wait a bit
|
133 |
-
setTimeout(function () {
|
134 |
-
// fire our ajax function
|
135 |
-
doCMBajax(pasteitem, 'paste');
|
136 |
-
}, 100);
|
137 |
-
}).blur(function () {
|
138 |
-
// when leaving the input
|
139 |
-
setTimeout(function () {
|
140 |
-
// if it's been 2 seconds, hide our spinner
|
141 |
-
jQuery('.postbox table.bsf_metabox .cmb-spinner').hide();
|
142 |
-
}, 2000);
|
143 |
-
});
|
144 |
-
|
145 |
-
// ajax when typing
|
146 |
-
jQuery('.bsf_metabox').on('keyup', '.bsf_oembed', function (event) {
|
147 |
-
// fire our ajax function
|
148 |
-
doCMBajax(jQuery(this), event);
|
149 |
-
});
|
150 |
-
|
151 |
-
// function for running our ajax
|
152 |
-
function doCMBajax(obj, e) {
|
153 |
-
// get typed value
|
154 |
-
var oembed_url = obj.val();
|
155 |
-
// only proceed if the field contains more than 6 characters
|
156 |
-
if (oembed_url.length < 6)
|
157 |
-
return;
|
158 |
-
|
159 |
-
// only proceed if the user has pasted, pressed a number, letter, or whitelisted characters
|
160 |
-
if (e === 'paste' || e.which <= 90 && e.which >= 48 || e.which >= 96 && e.which <= 111 || e.which == 8 || e.which == 9 || e.which == 187 || e.which == 190) {
|
161 |
-
|
162 |
-
// get field id
|
163 |
-
var field_id = obj.attr('id');
|
164 |
-
// get our inputs context for pinpointing
|
165 |
-
var context = obj.parents('.bsf_metabox tr td');
|
166 |
-
// show our spinner
|
167 |
-
jQuery('.cmb-spinner', context).show();
|
168 |
-
// clear out previous results
|
169 |
-
jQuery('.embed_wrap', context).html('');
|
170 |
-
// and run our ajax function
|
171 |
-
setTimeout(function () {
|
172 |
-
// if they haven't typed in 500 ms
|
173 |
-
if (jQuery('.bsf_oembed:focus').val() == oembed_url) {
|
174 |
-
jQuery.ajax({
|
175 |
-
type : 'post',
|
176 |
-
dataType : 'json',
|
177 |
-
url : window.ajaxurl,
|
178 |
-
data : {
|
179 |
-
'action': 'bsf_oembed_handler',
|
180 |
-
'oembed_url': oembed_url,
|
181 |
-
'field_id': field_id,
|
182 |
-
'post_id': window.bsf_ajax_data.post_id,
|
183 |
-
'bsf_ajax_nonce': window.bsf_ajax_data.ajax_nonce
|
184 |
-
},
|
185 |
-
success: function (response) {
|
186 |
-
// if we have a response id
|
187 |
-
if (typeof response.id !== 'undefined') {
|
188 |
-
// hide our spinner
|
189 |
-
jQuery('.cmb-spinner', context).hide();
|
190 |
-
// and populate our results from ajax response
|
191 |
-
jQuery('.embed_wrap', context).html(response.result);
|
192 |
-
}
|
193 |
-
}
|
194 |
-
});
|
195 |
-
}
|
196 |
-
}, 500);
|
197 |
-
}
|
198 |
-
}
|
199 |
-
|
200 |
-
});
|
1 |
+
/**
|
2 |
+
* Controls the behaviours of custom metabox fields.
|
3 |
+
*
|
4 |
+
* @author Andrew Norcross
|
5 |
+
* @author Jared Atchison
|
6 |
+
* @author Bill Erickson
|
7 |
+
* @see https://github.com/jaredatch/Custom-Metaboxes-and-Fields-for-WordPress
|
8 |
+
*/
|
9 |
+
/*jslint browser: true, devel: true, indent: 4, maxerr: 50, sub: true */
|
10 |
+
/*global jQuery, tb_show, tb_remove */
|
11 |
+
/**
|
12 |
+
* Defines the CMBMeta object namespace to prevent conflict with other plugins using similar javascript
|
13 |
+
*
|
14 |
+
*/
|
15 |
+
(function ($) {
|
16 |
+
'use strict';
|
17 |
+
var CMBMeta;
|
18 |
+
CMBMeta = {
|
19 |
+
/**
|
20 |
+
* Initialize timepicker (this will be moved inline in a future release)
|
21 |
+
*/
|
22 |
+
TimePicker: function () {
|
23 |
+
$('.bsf_timepicker').each(function () {
|
24 |
+
$('#' + $(this).attr('id')).timePicker({
|
25 |
+
startTime: "07:00",
|
26 |
+
endTime: "22:00",
|
27 |
+
show24Hours: false,
|
28 |
+
separator: ':',
|
29 |
+
step: 30
|
30 |
+
});
|
31 |
+
});
|
32 |
+
},
|
33 |
+
/**
|
34 |
+
* Initialize jQuery UI datepicker (this will be moved inline in a future release)
|
35 |
+
*/
|
36 |
+
DatePicker: function () {
|
37 |
+
$('.bsf_datepicker').each(function () {
|
38 |
+
$('#' + jQuery(this).attr('id')).datepicker();
|
39 |
+
//$('#_bsf_event_start_date').datepicker();
|
40 |
+
// $('#' + jQuery(this).attr('id')).datepicker({ dateFormat: 'yy-mm-dd' });
|
41 |
+
// For more options see http://jqueryui.com/demos/datepicker/#option-dateFormat
|
42 |
+
});
|
43 |
+
// Wrap date picker in class to narrow the scope of jQuery UI CSS and prevent conflicts
|
44 |
+
$("#ui-datepicker-div").wrap('<div class="bsf_element" />');
|
45 |
+
}, // End DatePicker
|
46 |
+
/**
|
47 |
+
* Initialize color picker
|
48 |
+
*/
|
49 |
+
ColorPicker: function () {
|
50 |
+
$('input:text.bsf_colorpicker').each(function (i) {
|
51 |
+
$(this).after('<div id="picker-' + i + '" style="z-index: 1000; background: #EEE; border: 1px solid #CCC; position: absolute; display: block;"></div>');
|
52 |
+
$('#picker-' + i).hide().farbtastic($(this));
|
53 |
+
})
|
54 |
+
.focus(function () {
|
55 |
+
$(this).next().show();
|
56 |
+
})
|
57 |
+
.blur(function () {
|
58 |
+
$(this).next().hide();
|
59 |
+
});
|
60 |
+
}, // End ColorPicker
|
61 |
+
/**
|
62 |
+
* File and image upload handling
|
63 |
+
*/
|
64 |
+
FileUpload: function () {
|
65 |
+
var formfield;
|
66 |
+
$('.bsf_upload_file').change(function () {
|
67 |
+
formfield = $(this).attr('name');
|
68 |
+
$('#' + formfield + '_id').val("");
|
69 |
+
});
|
70 |
+
$('.bsf_upload_button').live('click', function () {
|
71 |
+
var buttonLabel;
|
72 |
+
formfield = $(this).prev('input').attr('name');
|
73 |
+
buttonLabel = 'Use as ' + $('label[for=' + formfield + ']').text();
|
74 |
+
tb_show('', 'media-upload.php?post_id=' + $('#post_ID').val() + '&type=file&bsf_force_send=true&bsf_send_label=' + buttonLabel + '&TB_iframe=true');
|
75 |
+
return false;
|
76 |
+
});
|
77 |
+
$('.bsf_remove_file_button').live('click', function () {
|
78 |
+
formfield = $(this).attr('rel');
|
79 |
+
$('input#' + formfield).val('');
|
80 |
+
$('input#' + formfield + '_id').val('');
|
81 |
+
$(this).parent().remove();
|
82 |
+
return false;
|
83 |
+
});
|
84 |
+
window.bsf_original_send_to_editor = window.send_to_editor;
|
85 |
+
window.send_to_editor = function (html) {
|
86 |
+
var itemurl, itemclass, itemClassBits, itemid, htmlBits, itemtitle,
|
87 |
+
image, uploadStatus = true;
|
88 |
+
if (formfield) {
|
89 |
+
if ($(html).html(html).find('img').length > 0) {
|
90 |
+
itemurl = $(html).html(html).find('img').attr('src'); // Use the URL to the size selected.
|
91 |
+
itemclass = $(html).html(html).find('img').attr('class'); // Extract the ID from the returned class name.
|
92 |
+
itemClassBits = itemclass.split(" ");
|
93 |
+
itemid = itemClassBits[itemClassBits.length - 1];
|
94 |
+
itemid = itemid.replace('wp-image-', '');
|
95 |
+
} else {
|
96 |
+
// It's not an image. Get the URL to the file instead.
|
97 |
+
htmlBits = html.split("'"); // jQuery seems to strip out XHTML when assigning the string to an object. Use alternate method.
|
98 |
+
itemurl = htmlBits[1]; // Use the URL to the file.
|
99 |
+
itemtitle = htmlBits[2];
|
100 |
+
itemtitle = itemtitle.replace('>', '');
|
101 |
+
itemtitle = itemtitle.replace('</a>', '');
|
102 |
+
itemid = ""; // TO DO: Get ID for non-image attachments.
|
103 |
+
}
|
104 |
+
image = /(jpe?g|png|gif|ico)$/gi;
|
105 |
+
if (itemurl.match(image)) {
|
106 |
+
uploadStatus = '<div class="img_status"><img src="' + itemurl + '" alt="" /><a href="#" class="bsf_remove_file_button" rel="' + formfield + '">Remove Image</a></div>';
|
107 |
+
} else {
|
108 |
+
// No output preview if it's not an image
|
109 |
+
// Standard generic output if it's not an image.
|
110 |
+
html = '<a href="' + itemurl + '" target="_blank" rel="external">View File</a>';
|
111 |
+
uploadStatus = '<div class="no_image"><span class="file_link">' + html + '</span> <a href="#" class="bsf_remove_file_button" rel="' + formfield + '">Remove</a></div>';
|
112 |
+
}
|
113 |
+
$('#' + formfield).val(itemurl);
|
114 |
+
$('#' + formfield + '_id').val(itemid);
|
115 |
+
$('#' + formfield).siblings('.bsf_upload_status').slideDown().html(uploadStatus);
|
116 |
+
tb_remove();
|
117 |
+
} else {
|
118 |
+
window.bsf_original_send_to_editor(html);
|
119 |
+
}
|
120 |
+
formfield = '';
|
121 |
+
};
|
122 |
+
} // End FileUpload
|
123 |
+
}; //End CMBMeta object
|
124 |
+
$(document).ready(function () {
|
125 |
+
CMBMeta.TimePicker();
|
126 |
+
CMBMeta.DatePicker();
|
127 |
+
CMBMeta.ColorPicker();
|
128 |
+
// CMBMeta.FileUpload();
|
129 |
+
});
|
130 |
+
}(jQuery));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/cp-script.min.js
ADDED
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var $mbas12 = jQuery.noConflict();
|
2 |
+
// Snippet Box BG Color
|
3 |
+
(function ($mbas12) {
|
4 |
+
"use strict";
|
5 |
+
function pickColor(color) {
|
6 |
+
$mbas12(".snippet_box_bg").val(color);
|
7 |
+
}
|
8 |
+
function toggle_text() {
|
9 |
+
var BoxBG = $mbas12(".snippet_box_bg");
|
10 |
+
if ("" === BoxBG.val().replace("#", "")) {
|
11 |
+
BoxBG.val(default_color);
|
12 |
+
pickColor(default_color);
|
13 |
+
} else pickColor(BoxBG.val());
|
14 |
+
}
|
15 |
+
var default_color = "F5F5F5";
|
16 |
+
$mbas12(document).ready(function () {
|
17 |
+
var BoxBG = $mbas12(".snippet_box_bg");
|
18 |
+
BoxBG.wpColorPicker({
|
19 |
+
change: function (event, ui) {
|
20 |
+
pickColor(BoxBG.wpColorPicker("color"));
|
21 |
+
},
|
22 |
+
clear: function () {
|
23 |
+
pickColor("");
|
24 |
+
}
|
25 |
+
});
|
26 |
+
$mbas12(".snippet_box_bg").click(toggle_text);
|
27 |
+
toggle_text();
|
28 |
+
});
|
29 |
+
})($mbas12);
|
30 |
+
|
31 |
+
// Snippet Title BG color
|
32 |
+
(function ($mbas12) {
|
33 |
+
"use strict";
|
34 |
+
function pickColor(color) {
|
35 |
+
$mbas12(".snippet_title_bg").val(color);
|
36 |
+
}
|
37 |
+
function toggle_text() {
|
38 |
+
var TitleBG = $mbas12(".snippet_title_bg");
|
39 |
+
if ("" === TitleBG.val().replace("#", "")) {
|
40 |
+
TitleBG.val(default_color);
|
41 |
+
pickColor(default_color);
|
42 |
+
} else pickColor(TitleBG.val());
|
43 |
+
}
|
44 |
+
var default_color = "E4E4E4";
|
45 |
+
$mbas12(document).ready(function () {
|
46 |
+
var TitleBG = $mbas12(".snippet_title_bg");
|
47 |
+
TitleBG.wpColorPicker({
|
48 |
+
change: function (event, ui) {
|
49 |
+
pickColor(TitleBG.wpColorPicker("color"));
|
50 |
+
},
|
51 |
+
clear: function () {
|
52 |
+
pickColor("");
|
53 |
+
}
|
54 |
+
});
|
55 |
+
$mbas12(".snippet_title_bg").click(toggle_text);
|
56 |
+
toggle_text();
|
57 |
+
});
|
58 |
+
})($mbas12);
|
59 |
+
|
60 |
+
// Snippet Border color
|
61 |
+
(function ($mbas12) {
|
62 |
+
"use strict";
|
63 |
+
function pickColor(color) {
|
64 |
+
$mbas12(".snippet_border").val(color);
|
65 |
+
}
|
66 |
+
function toggle_text() {
|
67 |
+
var SnippetBorder = $mbas12(".snippet_border");
|
68 |
+
if ("" === SnippetBorder.val().replace("#", "")) {
|
69 |
+
SnippetBorder.val(default_color);
|
70 |
+
pickColor(default_color);
|
71 |
+
} else pickColor(SnippetBorder.val());
|
72 |
+
}
|
73 |
+
var default_color = "ACACAC";
|
74 |
+
$mbas12(document).ready(function () {
|
75 |
+
var SnippetBorder = $mbas12(".snippet_border");
|
76 |
+
SnippetBorder.wpColorPicker({
|
77 |
+
change: function (event, ui) {
|
78 |
+
pickColor(SnippetBorder.wpColorPicker("color"));
|
79 |
+
},
|
80 |
+
clear: function () {
|
81 |
+
pickColor("");
|
82 |
+
}
|
83 |
+
});
|
84 |
+
$mbas12(".snippet_border").click(toggle_text);
|
85 |
+
toggle_text();
|
86 |
+
});
|
87 |
+
})($mbas12);
|
88 |
+
// Snippet title color
|
89 |
+
(function ($mbas12) {
|
90 |
+
"use strict";
|
91 |
+
function pickColor(color) {
|
92 |
+
$mbas12(".snippet_title_color").val(color);
|
93 |
+
}
|
94 |
+
function toggle_text() {
|
95 |
+
var TitleColor = $mbas12(".snippet_title_color");
|
96 |
+
if ("" === TitleColor.val().replace("#", "")) {
|
97 |
+
TitleColor.val(default_color);
|
98 |
+
pickColor(default_color);
|
99 |
+
} else pickColor(TitleColor.val());
|
100 |
+
}
|
101 |
+
var default_color = "333333";
|
102 |
+
$mbas12(document).ready(function () {
|
103 |
+
var TitleColor = $mbas12(".snippet_title_color");
|
104 |
+
TitleColor.wpColorPicker({
|
105 |
+
change: function (event, ui) {
|
106 |
+
pickColor(TitleColor.wpColorPicker("color"));
|
107 |
+
},
|
108 |
+
clear: function () {
|
109 |
+
pickColor("");
|
110 |
+
}
|
111 |
+
});
|
112 |
+
$mbas12(".snippet_title_color").click(toggle_text);
|
113 |
+
toggle_text();
|
114 |
+
});
|
115 |
+
})($mbas12);
|
116 |
+
|
117 |
+
// Snippet text color
|
118 |
+
(function ($mbas12) {
|
119 |
+
"use strict";
|
120 |
+
function pickColor(color) {
|
121 |
+
$mbas12(".snippet_box_color").val(color);
|
122 |
+
}
|
123 |
+
function toggle_text() {
|
124 |
+
var BoxColor = $mbas12(".snippet_box_color");
|
125 |
+
if ("" === BoxColor.val().replace("#", "")) {
|
126 |
+
BoxColor.val(default_color);
|
127 |
+
pickColor(default_color);
|
128 |
+
} else pickColor(BoxColor.val());
|
129 |
+
}
|
130 |
+
var default_color = "333333";
|
131 |
+
$mbas12(document).ready(function () {
|
132 |
+
var BoxColor = $mbas12(".snippet_box_color");
|
133 |
+
BoxColor.wpColorPicker({
|
134 |
+
change: function (event, ui) {
|
135 |
+
pickColor(BoxColor.wpColorPicker("color"));
|
136 |
+
},
|
137 |
+
clear: function () {
|
138 |
+
pickColor("");
|
139 |
+
}
|
140 |
+
});
|
141 |
+
$mbas12(".snippet_box_color").click(toggle_text);
|
142 |
+
toggle_text();
|
143 |
+
});
|
144 |
+
})($mbas12);
|
js/jquery.js
CHANGED
@@ -1,9597 +1,8082 @@
|
|
1 |
-
/*!
|
2 |
-
* jQuery JavaScript Library v1.9.1
|
3 |
-
* http://jquery.com/
|
4 |
-
*
|
5 |
-
* Includes Sizzle.js
|
6 |
-
* http://sizzlejs.com/
|
7 |
-
*
|
8 |
-
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
|
9 |
-
* Released under the MIT license
|
10 |
-
* http://jquery.org/license
|
11 |
-
*
|
12 |
-
* Date: 2013-2-4
|
13 |
-
*/
|
14 |
-
(function( window, undefined ) {
|
15 |
-
|
16 |
-
//
|
17 |
-
//
|
18 |
-
//
|
19 |
-
//
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
//
|
26 |
-
|
27 |
-
|
28 |
-
//
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
//
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
//
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
}
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
-
|
121 |
-
|
122 |
-
|
123 |
-
|
124 |
-
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
-
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
|
230 |
-
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
return
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
//
|
263 |
-
|
264 |
-
}
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
|
278 |
-
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
|
297 |
-
|
298 |
-
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
//
|
316 |
-
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
-
--
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
-
|
356 |
-
|
357 |
-
|
358 |
-
|
359 |
-
|
360 |
-
|
361 |
-
|
362 |
-
|
363 |
-
|
364 |
-
|
365 |
-
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
-
|
373 |
-
|
374 |
-
|
375 |
-
|
376 |
-
|
377 |
-
|
378 |
-
|
379 |
-
|
380 |
-
}
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
-
|
393 |
-
|
394 |
-
|
395 |
-
|
396 |
-
|
397 |
-
|
398 |
-
|
399 |
-
|
400 |
-
|
401 |
-
|
402 |
-
|
403 |
-
|
404 |
-
|
405 |
-
|
406 |
-
|
407 |
-
|
408 |
-
|
409 |
-
|
410 |
-
|
411 |
-
|
412 |
-
|
413 |
-
|
414 |
-
|
415 |
-
if (
|
416 |
-
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
-
|
421 |
-
|
422 |
-
|
423 |
-
|
424 |
-
|
425 |
-
|
426 |
-
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
},
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
if ( !
|
474 |
-
|
475 |
-
}
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
//
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
return
|
496 |
-
},
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
529 |
-
|
530 |
-
|
531 |
-
|
532 |
-
|
533 |
-
|
534 |
-
|
535 |
-
|
536 |
-
|
537 |
-
|
538 |
-
|
539 |
-
|
540 |
-
|
541 |
-
|
542 |
-
|
543 |
-
|
544 |
-
|
545 |
-
return
|
546 |
-
|
547 |
-
|
548 |
-
|
549 |
-
|
550 |
-
|
551 |
-
|
552 |
-
|
553 |
-
|
554 |
-
|
555 |
-
|
556 |
-
|
557 |
-
|
558 |
-
|
559 |
-
|
560 |
-
|
561 |
-
|
562 |
-
|
563 |
-
|
564 |
-
|
565 |
-
|
566 |
-
|
567 |
-
|
568 |
-
|
569 |
-
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
577 |
-
|
578 |
-
|
579 |
-
|
580 |
-
|
581 |
-
|
582 |
-
|
583 |
-
|
584 |
-
|
585 |
-
|
586 |
-
|
587 |
-
|
588 |
-
|
589 |
-
|
590 |
-
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
601 |
-
|
602 |
-
|
603 |
-
|
604 |
-
|
605 |
-
|
606 |
-
|
607 |
-
|
608 |
-
|
609 |
-
|
610 |
-
|
611 |
-
|
612 |
-
|
613 |
-
|
614 |
-
|
615 |
-
|
616 |
-
|
617 |
-
|
618 |
-
|
619 |
-
|
620 |
-
|
621 |
-
|
622 |
-
|
623 |
-
|
624 |
-
|
625 |
-
|
626 |
-
|
627 |
-
|
628 |
-
|
629 |
-
|
630 |
-
|
631 |
-
|
632 |
-
|
633 |
-
|
634 |
-
|
635 |
-
|
636 |
-
|
637 |
-
|
638 |
-
|
639 |
-
|
640 |
-
|
641 |
-
|
642 |
-
|
643 |
-
|
644 |
-
|
645 |
-
|
646 |
-
|
647 |
-
|
648 |
-
|
649 |
-
|
650 |
-
|
651 |
-
|
652 |
-
|
653 |
-
|
654 |
-
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
|
791 |
-
|
792 |
-
|
793 |
-
}
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
//
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
839 |
-
|
840 |
-
|
841 |
-
|
842 |
-
|
843 |
-
|
844 |
-
|
845 |
-
|
846 |
-
|
847 |
-
|
848 |
-
|
849 |
-
|
850 |
-
|
851 |
-
|
852 |
-
|
853 |
-
|
854 |
-
|
855 |
-
|
856 |
-
|
857 |
-
|
858 |
-
|
859 |
-
|
860 |
-
|
861 |
-
|
862 |
-
|
863 |
-
|
864 |
-
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
|
871 |
-
|
872 |
-
|
873 |
-
|
874 |
-
|
875 |
-
|
876 |
-
|
877 |
-
|
878 |
-
|
879 |
-
|
880 |
-
|
881 |
-
|
882 |
-
|
883 |
-
|
884 |
-
|
885 |
-
|
886 |
-
|
887 |
-
|
888 |
-
|
889 |
-
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
916 |
-
|
917 |
-
|
918 |
-
|
919 |
-
|
920 |
-
|
921 |
-
if
|
922 |
-
|
923 |
-
|
924 |
-
|
925 |
-
|
926 |
-
|
927 |
-
|
928 |
-
|
929 |
-
|
930 |
-
|
931 |
-
|
932 |
-
|
933 |
-
|
934 |
-
|
935 |
-
|
936 |
-
|
937 |
-
|
938 |
-
|
939 |
-
|
940 |
-
|
941 |
-
|
942 |
-
|
943 |
-
|
944 |
-
|
945 |
-
|
946 |
-
|
947 |
-
|
948 |
-
|
949 |
-
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
957 |
-
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
965 |
-
|
966 |
-
|
967 |
-
|
968 |
-
|
969 |
-
|
970 |
-
//
|
971 |
-
|
972 |
-
|
973 |
-
|
974 |
-
|
975 |
-
|
976 |
-
|
977 |
-
|
978 |
-
|
979 |
-
|
980 |
-
|
981 |
-
|
982 |
-
|
983 |
-
|
984 |
-
|
985 |
-
|
986 |
-
|
987 |
-
|
988 |
-
|
989 |
-
|
990 |
-
|
991 |
-
|
992 |
-
|
993 |
-
|
994 |
-
|
995 |
-
|
996 |
-
|
997 |
-
|
998 |
-
|
999 |
-
|
1000 |
-
|
1001 |
-
|
1002 |
-
|
1003 |
-
|
1004 |
-
|
1005 |
-
|
1006 |
-
|
1007 |
-
|
1008 |
-
|
1009 |
-
|
1010 |
-
|
1011 |
-
|
1012 |
-
|
1013 |
-
|
1014 |
-
|
1015 |
-
|
1016 |
-
|
1017 |
-
|
1018 |
-
|
1019 |
-
|
1020 |
-
|
1021 |
-
|
1022 |
-
|
1023 |
-
|
1024 |
-
|
1025 |
-
list
|
1026 |
-
|
1027 |
-
|
1028 |
-
|
1029 |
-
|
1030 |
-
|
1031 |
-
|
1032 |
-
|
1033 |
-
|
1034 |
-
|
1035 |
-
|
1036 |
-
|
1037 |
-
|
1038 |
-
|
1039 |
-
|
1040 |
-
|
1041 |
-
|
1042 |
-
|
1043 |
-
|
1044 |
-
|
1045 |
-
|
1046 |
-
|
1047 |
-
|
1048 |
-
|
1049 |
-
|
1050 |
-
|
1051 |
-
|
1052 |
-
|
1053 |
-
|
1054 |
-
|
1055 |
-
|
1056 |
-
|
1057 |
-
|
1058 |
-
|
1059 |
-
|
1060 |
-
|
1061 |
-
|
1062 |
-
|
1063 |
-
|
1064 |
-
|
1065 |
-
|
1066 |
-
|
1067 |
-
|
1068 |
-
|
1069 |
-
|
1070 |
-
|
1071 |
-
|
1072 |
-
|
1073 |
-
|
1074 |
-
|
1075 |
-
|
1076 |
-
|
1077 |
-
|
1078 |
-
|
1079 |
-
|
1080 |
-
|
1081 |
-
|
1082 |
-
|
1083 |
-
|
1084 |
-
|
1085 |
-
|
1086 |
-
|
1087 |
-
|
1088 |
-
|
1089 |
-
|
1090 |
-
|
1091 |
-
|
1092 |
-
|
1093 |
-
|
1094 |
-
|
1095 |
-
|
1096 |
-
|
1097 |
-
|
1098 |
-
|
1099 |
-
|
1100 |
-
|
1101 |
-
|
1102 |
-
|
1103 |
-
|
1104 |
-
|
1105 |
-
|
1106 |
-
|
1107 |
-
|
1108 |
-
|
1109 |
-
|
1110 |
-
|
1111 |
-
|
1112 |
-
|
1113 |
-
|
1114 |
-
|
1115 |
-
|
1116 |
-
|
1117 |
-
|
1118 |
-
|
1119 |
-
|
1120 |
-
|
1121 |
-
|
1122 |
-
|
1123 |
-
|
1124 |
-
|
1125 |
-
|
1126 |
-
|
1127 |
-
|
1128 |
-
|
1129 |
-
|
1130 |
-
|
1131 |
-
|
1132 |
-
|
1133 |
-
|
1134 |
-
|
1135 |
-
|
1136 |
-
|
1137 |
-
|
1138 |
-
|
1139 |
-
|
1140 |
-
|
1141 |
-
|
1142 |
-
|
1143 |
-
|
1144 |
-
|
1145 |
-
|
1146 |
-
|
1147 |
-
|
1148 |
-
|
1149 |
-
|
1150 |
-
|
1151 |
-
|
1152 |
-
|
1153 |
-
|
1154 |
-
|
1155 |
-
|
1156 |
-
|
1157 |
-
|
1158 |
-
|
1159 |
-
|
1160 |
-
|
1161 |
-
|
1162 |
-
|
1163 |
-
|
1164 |
-
|
1165 |
-
|
1166 |
-
|
1167 |
-
|
1168 |
-
|
1169 |
-
|
1170 |
-
|
1171 |
-
|
1172 |
-
|
1173 |
-
|
1174 |
-
|
1175 |
-
|
1176 |
-
|
1177 |
-
|
1178 |
-
|
1179 |
-
|
1180 |
-
|
1181 |
-
|
1182 |
-
|
1183 |
-
|
1184 |
-
|
1185 |
-
|
1186 |
-
|
1187 |
-
|
1188 |
-
|
1189 |
-
|
1190 |
-
|
1191 |
-
|
1192 |
-
|
1193 |
-
|
1194 |
-
|
1195 |
-
|
1196 |
-
|
1197 |
-
|
1198 |
-
|
1199 |
-
|
1200 |
-
|
1201 |
-
|
1202 |
-
|
1203 |
-
|
1204 |
-
|
1205 |
-
|
1206 |
-
|
1207 |
-
|
1208 |
-
|
1209 |
-
|
1210 |
-
|
1211 |
-
|
1212 |
-
|
1213 |
-
|
1214 |
-
|
1215 |
-
|
1216 |
-
|
1217 |
-
|
1218 |
-
|
1219 |
-
|
1220 |
-
|
1221 |
-
|
1222 |
-
|
1223 |
-
|
1224 |
-
|
1225 |
-
|
1226 |
-
|
1227 |
-
|
1228 |
-
|
1229 |
-
|
1230 |
-
|
1231 |
-
|
1232 |
-
|
1233 |
-
|
1234 |
-
|
1235 |
-
|
1236 |
-
|
1237 |
-
|
1238 |
-
|
1239 |
-
|
1240 |
-
|
1241 |
-
|
1242 |
-
|
1243 |
-
|
1244 |
-
|
1245 |
-
|
1246 |
-
//
|
1247 |
-
if (
|
1248 |
-
|
1249 |
-
|
1250 |
-
|
1251 |
-
|
1252 |
-
|
1253 |
-
|
1254 |
-
|
1255 |
-
|
1256 |
-
|
1257 |
-
|
1258 |
-
|
1259 |
-
|
1260 |
-
|
1261 |
-
|
1262 |
-
|
1263 |
-
|
1264 |
-
//
|
1265 |
-
|
1266 |
-
|
1267 |
-
|
1268 |
-
|
1269 |
-
|
1270 |
-
|
1271 |
-
|
1272 |
-
|
1273 |
-
|
1274 |
-
|
1275 |
-
|
1276 |
-
|
1277 |
-
|
1278 |
-
|
1279 |
-
|
1280 |
-
|
1281 |
-
|
1282 |
-
|
1283 |
-
|
1284 |
-
|
1285 |
-
|
1286 |
-
|
1287 |
-
|
1288 |
-
|
1289 |
-
|
1290 |
-
|
1291 |
-
|
1292 |
-
|
1293 |
-
|
1294 |
-
|
1295 |
-
|
1296 |
-
|
1297 |
-
|
1298 |
-
|
1299 |
-
//
|
1300 |
-
|
1301 |
-
|
1302 |
-
|
1303 |
-
|
1304 |
-
|
1305 |
-
|
1306 |
-
|
1307 |
-
|
1308 |
-
|
1309 |
-
|
1310 |
-
|
1311 |
-
|
1312 |
-
|
1313 |
-
|
1314 |
-
|
1315 |
-
|
1316 |
-
|
1317 |
-
|
1318 |
-
|
1319 |
-
|
1320 |
-
|
1321 |
-
|
1322 |
-
|
1323 |
-
|
1324 |
-
|
1325 |
-
|
1326 |
-
|
1327 |
-
|
1328 |
-
|
1329 |
-
|
1330 |
-
|
1331 |
-
|
1332 |
-
|
1333 |
-
|
1334 |
-
|
1335 |
-
|
1336 |
-
|
1337 |
-
|
1338 |
-
|
1339 |
-
|
1340 |
-
|
1341 |
-
|
1342 |
-
|
1343 |
-
|
1344 |
-
|
1345 |
-
|
1346 |
-
|
1347 |
-
|
1348 |
-
|
1349 |
-
|
1350 |
-
|
1351 |
-
|
1352 |
-
|
1353 |
-
|
1354 |
-
|
1355 |
-
//
|
1356 |
-
|
1357 |
-
|
1358 |
-
|
1359 |
-
|
1360 |
-
|
1361 |
-
|
1362 |
-
|
1363 |
-
|
1364 |
-
|
1365 |
-
|
1366 |
-
|
1367 |
-
|
1368 |
-
|
1369 |
-
|
1370 |
-
|
1371 |
-
|
1372 |
-
|
1373 |
-
//
|
1374 |
-
|
1375 |
-
|
1376 |
-
|
1377 |
-
|
1378 |
-
|
1379 |
-
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
-
|
1391 |
-
|
1392 |
-
|
1393 |
-
|
1394 |
-
|
1395 |
-
|
1396 |
-
|
1397 |
-
|
1398 |
-
|
1399 |
-
|
1400 |
-
|
1401 |
-
|
1402 |
-
|
1403 |
-
|
1404 |
-
|
1405 |
-
|
1406 |
-
|
1407 |
-
|
1408 |
-
|
1409 |
-
|
1410 |
-
|
1411 |
-
|
1412 |
-
|
1413 |
-
|
1414 |
-
|
1415 |
-
|
1416 |
-
|
1417 |
-
|
1418 |
-
|
1419 |
-
|
1420 |
-
|
1421 |
-
|
1422 |
-
|
1423 |
-
|
1424 |
-
|
1425 |
-
|
1426 |
-
|
1427 |
-
|
1428 |
-
|
1429 |
-
|
1430 |
-
|
1431 |
-
|
1432 |
-
//
|
1433 |
-
|
1434 |
-
|
1435 |
-
|
1436 |
-
|
1437 |
-
|
1438 |
-
|
1439 |
-
|
1440 |
-
|
1441 |
-
|
1442 |
-
//
|
1443 |
-
|
1444 |
-
|
1445 |
-
|
1446 |
-
|
1447 |
-
|
1448 |
-
|
1449 |
-
|
1450 |
-
|
1451 |
-
|
1452 |
-
|
1453 |
-
|
1454 |
-
|
1455 |
-
|
1456 |
-
|
1457 |
-
|
1458 |
-
|
1459 |
-
|
1460 |
-
|
1461 |
-
|
1462 |
-
|
1463 |
-
|
1464 |
-
|
1465 |
-
|
1466 |
-
|
1467 |
-
|
1468 |
-
|
1469 |
-
//
|
1470 |
-
|
1471 |
-
|
1472 |
-
|
1473 |
-
|
1474 |
-
//
|
1475 |
-
|
1476 |
-
|
1477 |
-
|
1478 |
-
|
1479 |
-
|
1480 |
-
|
1481 |
-
|
1482 |
-
|
1483 |
-
|
1484 |
-
//
|
1485 |
-
|
1486 |
-
|
1487 |
-
|
1488 |
-
|
1489 |
-
|
1490 |
-
|
1491 |
-
|
1492 |
-
|
1493 |
-
|
1494 |
-
|
1495 |
-
|
1496 |
-
|
1497 |
-
|
1498 |
-
|
1499 |
-
|
1500 |
-
|
1501 |
-
|
1502 |
-
|
1503 |
-
|
1504 |
-
|
1505 |
-
|
1506 |
-
|
1507 |
-
|
1508 |
-
|
1509 |
-
|
1510 |
-
|
1511 |
-
|
1512 |
-
|
1513 |
-
|
1514 |
-
|
1515 |
-
|
1516 |
-
|
1517 |
-
|
1518 |
-
|
1519 |
-
|
1520 |
-
|
1521 |
-
|
1522 |
-
|
1523 |
-
|
1524 |
-
|
1525 |
-
|
1526 |
-
|
1527 |
-
|
1528 |
-
|
1529 |
-
|
1530 |
-
|
1531 |
-
|
1532 |
-
|
1533 |
-
|
1534 |
-
|
1535 |
-
|
1536 |
-
|
1537 |
-
|
1538 |
-
|
1539 |
-
|
1540 |
-
|
1541 |
-
|
1542 |
-
|
1543 |
-
|
1544 |
-
|
1545 |
-
|
1546 |
-
|
1547 |
-
|
1548 |
-
|
1549 |
-
|
1550 |
-
|
1551 |
-
|
1552 |
-
|
1553 |
-
|
1554 |
-
|
1555 |
-
|
1556 |
-
|
1557 |
-
|
1558 |
-
|
1559 |
-
|
1560 |
-
|
1561 |
-
|
1562 |
-
|
1563 |
-
|
1564 |
-
|
1565 |
-
|
1566 |
-
|
1567 |
-
|
1568 |
-
|
1569 |
-
|
1570 |
-
|
1571 |
-
|
1572 |
-
|
1573 |
-
|
1574 |
-
|
1575 |
-
|
1576 |
-
|
1577 |
-
|
1578 |
-
|
1579 |
-
|
1580 |
-
|
1581 |
-
|
1582 |
-
|
1583 |
-
|
1584 |
-
|
1585 |
-
|
1586 |
-
|
1587 |
-
|
1588 |
-
|
1589 |
-
|
1590 |
-
|
1591 |
-
|
1592 |
-
|
1593 |
-
|
1594 |
-
|
1595 |
-
|
1596 |
-
|
1597 |
-
|
1598 |
-
|
1599 |
-
|
1600 |
-
|
1601 |
-
|
1602 |
-
|
1603 |
-
}
|
1604 |
-
|
1605 |
-
|
1606 |
-
|
1607 |
-
|
1608 |
-
|
1609 |
-
|
1610 |
-
|
1611 |
-
|
1612 |
-
|
1613 |
-
|
1614 |
-
|
1615 |
-
|
1616 |
-
}
|
1617 |
-
|
1618 |
-
|
1619 |
-
|
1620 |
-
|
1621 |
-
|
1622 |
-
|
1623 |
-
|
1624 |
-
|
1625 |
-
|
1626 |
-
|
1627 |
-
|
1628 |
-
|
1629 |
-
|
1630 |
-
|
1631 |
-
|
1632 |
-
|
1633 |
-
|
1634 |
-
|
1635 |
-
|
1636 |
-
|
1637 |
-
|
1638 |
-
|
1639 |
-
|
1640 |
-
}
|
1641 |
-
|
1642 |
-
|
1643 |
-
|
1644 |
-
|
1645 |
-
|
1646 |
-
|
1647 |
-
|
1648 |
-
|
1649 |
-
|
1650 |
-
|
1651 |
-
|
1652 |
-
|
1653 |
-
|
1654 |
-
|
1655 |
-
|
1656 |
-
|
1657 |
-
|
1658 |
-
|
1659 |
-
|
1660 |
-
|
1661 |
-
|
1662 |
-
|
1663 |
-
|
1664 |
-
|
1665 |
-
|
1666 |
-
|
1667 |
-
|
1668 |
-
|
1669 |
-
|
1670 |
-
|
1671 |
-
|
1672 |
-
|
1673 |
-
|
1674 |
-
|
1675 |
-
|
1676 |
-
|
1677 |
-
|
1678 |
-
|
1679 |
-
|
1680 |
-
|
1681 |
-
|
1682 |
-
|
1683 |
-
|
1684 |
-
|
1685 |
-
|
1686 |
-
|
1687 |
-
|
1688 |
-
|
1689 |
-
|
1690 |
-
|
1691 |
-
|
1692 |
-
|
1693 |
-
|
1694 |
-
|
1695 |
-
|
1696 |
-
|
1697 |
-
|
1698 |
-
|
1699 |
-
|
1700 |
-
|
1701 |
-
|
1702 |
-
|
1703 |
-
|
1704 |
-
|
1705 |
-
|
1706 |
-
|
1707 |
-
|
1708 |
-
|
1709 |
-
|
1710 |
-
|
1711 |
-
|
1712 |
-
|
1713 |
-
|
1714 |
-
|
1715 |
-
|
1716 |
-
|
1717 |
-
|
1718 |
-
|
1719 |
-
|
1720 |
-
|
1721 |
-
|
1722 |
-
|
1723 |
-
|
1724 |
-
|
1725 |
-
|
1726 |
-
|
1727 |
-
|
1728 |
-
|
1729 |
-
|
1730 |
-
}
|
1731 |
-
|
1732 |
-
|
1733 |
-
|
1734 |
-
|
1735 |
-
|
1736 |
-
|
1737 |
-
|
1738 |
-
|
1739 |
-
|
1740 |
-
|
1741 |
-
|
1742 |
-
|
1743 |
-
|
1744 |
-
|
1745 |
-
|
1746 |
-
|
1747 |
-
|
1748 |
-
|
1749 |
-
|
1750 |
-
|
1751 |
-
|
1752 |
-
|
1753 |
-
|
1754 |
-
|
1755 |
-
|
1756 |
-
|
1757 |
-
|
1758 |
-
|
1759 |
-
|
1760 |
-
|
1761 |
-
|
1762 |
-
|
1763 |
-
|
1764 |
-
|
1765 |
-
|
1766 |
-
|
1767 |
-
|
1768 |
-
|
1769 |
-
|
1770 |
-
|
1771 |
-
|
1772 |
-
|
1773 |
-
|
1774 |
-
|
1775 |
-
|
1776 |
-
|
1777 |
-
|
1778 |
-
|
1779 |
-
|
1780 |
-
|
1781 |
-
|
1782 |
-
}
|
1783 |
-
|
1784 |
-
|
1785 |
-
|
1786 |
-
|
1787 |
-
|
1788 |
-
|
1789 |
-
|
1790 |
-
|
1791 |
-
|
1792 |
-
|
1793 |
-
|
1794 |
-
|
1795 |
-
|
1796 |
-
|
1797 |
-
|
1798 |
-
|
1799 |
-
|
1800 |
-
|
1801 |
-
|
1802 |
-
|
1803 |
-
|
1804 |
-
|
1805 |
-
|
1806 |
-
|
1807 |
-
|
1808 |
-
|
1809 |
-
|
1810 |
-
|
1811 |
-
|
1812 |
-
|
1813 |
-
|
1814 |
-
|
1815 |
-
|
1816 |
-
|
1817 |
-
jQuery.
|
1818 |
-
}
|
1819 |
-
}
|
1820 |
-
|
1821 |
-
|
1822 |
-
|
1823 |
-
|
1824 |
-
|
1825 |
-
|
1826 |
-
|
1827 |
-
|
1828 |
-
|
1829 |
-
|
1830 |
-
|
1831 |
-
|
1832 |
-
|
1833 |
-
|
1834 |
-
|
1835 |
-
|
1836 |
-
|
1837 |
-
|
1838 |
-
|
1839 |
-
|
1840 |
-
|
1841 |
-
|
1842 |
-
|
1843 |
-
|
1844 |
-
|
1845 |
-
|
1846 |
-
|
1847 |
-
|
1848 |
-
|
1849 |
-
|
1850 |
-
|
1851 |
-
|
1852 |
-
|
1853 |
-
|
1854 |
-
|
1855 |
-
|
1856 |
-
|
1857 |
-
|
1858 |
-
|
1859 |
-
}
|
1860 |
-
|
1861 |
-
|
1862 |
-
|
1863 |
-
|
1864 |
-
|
1865 |
-
|
1866 |
-
|
1867 |
-
|
1868 |
-
|
1869 |
-
|
1870 |
-
}
|
1871 |
-
|
1872 |
-
|
1873 |
-
|
1874 |
-
|
1875 |
-
|
1876 |
-
|
1877 |
-
|
1878 |
-
|
1879 |
-
|
1880 |
-
|
1881 |
-
|
1882 |
-
|
1883 |
-
|
1884 |
-
|
1885 |
-
|
1886 |
-
|
1887 |
-
|
1888 |
-
|
1889 |
-
|
1890 |
-
|
1891 |
-
|
1892 |
-
|
1893 |
-
|
1894 |
-
|
1895 |
-
|
1896 |
-
|
1897 |
-
|
1898 |
-
|
1899 |
-
|
1900 |
-
|
1901 |
-
|
1902 |
-
|
1903 |
-
|
1904 |
-
|
1905 |
-
|
1906 |
-
|
1907 |
-
|
1908 |
-
|
1909 |
-
|
1910 |
-
|
1911 |
-
|
1912 |
-
|
1913 |
-
|
1914 |
-
|
1915 |
-
|
1916 |
-
|
1917 |
-
|
1918 |
-
|
1919 |
-
|
1920 |
-
|
1921 |
-
|
1922 |
-
|
1923 |
-
|
1924 |
-
|
1925 |
-
|
1926 |
-
|
1927 |
-
|
1928 |
-
|
1929 |
-
|
1930 |
-
|
1931 |
-
|
1932 |
-
|
1933 |
-
|
1934 |
-
|
1935 |
-
|
1936 |
-
|
1937 |
-
|
1938 |
-
|
1939 |
-
|
1940 |
-
|
1941 |
-
|
1942 |
-
|
1943 |
-
|
1944 |
-
|
1945 |
-
|
1946 |
-
|
1947 |
-
|
1948 |
-
|
1949 |
-
|
1950 |
-
|
1951 |
-
|
1952 |
-
|
1953 |
-
|
1954 |
-
})
|
1955 |
-
|
1956 |
-
|
1957 |
-
|
1958 |
-
|
1959 |
-
|
1960 |
-
if (
|
1961 |
-
|
1962 |
-
|
1963 |
-
|
1964 |
-
|
1965 |
-
|
1966 |
-
|
1967 |
-
|
1968 |
-
|
1969 |
-
|
1970 |
-
|
1971 |
-
|
1972 |
-
|
1973 |
-
|
1974 |
-
|
1975 |
-
|
1976 |
-
|
1977 |
-
|
1978 |
-
|
1979 |
-
|
1980 |
-
|
1981 |
-
|
1982 |
-
|
1983 |
-
|
1984 |
-
|
1985 |
-
|
1986 |
-
|
1987 |
-
|
1988 |
-
|
1989 |
-
|
1990 |
-
|
1991 |
-
|
1992 |
-
|
1993 |
-
|
1994 |
-
|
1995 |
-
|
1996 |
-
|
1997 |
-
|
1998 |
-
|
1999 |
-
|
2000 |
-
|
2001 |
-
|
2002 |
-
|
2003 |
-
|
2004 |
-
|
2005 |
-
|
2006 |
-
|
2007 |
-
|
2008 |
-
|
2009 |
-
|
2010 |
-
|
2011 |
-
|
2012 |
-
|
2013 |
-
|
2014 |
-
|
2015 |
-
|
2016 |
-
|
2017 |
-
|
2018 |
-
|
2019 |
-
|
2020 |
-
|
2021 |
-
|
2022 |
-
|
2023 |
-
|
2024 |
-
|
2025 |
-
|
2026 |
-
|
2027 |
-
|
2028 |
-
|
2029 |
-
|
2030 |
-
|
2031 |
-
|
2032 |
-
|
2033 |
-
|
2034 |
-
|
2035 |
-
|
2036 |
-
|
2037 |
-
|
2038 |
-
|
2039 |
-
|
2040 |
-
|
2041 |
-
|
2042 |
-
|
2043 |
-
|
2044 |
-
|
2045 |
-
|
2046 |
-
|
2047 |
-
|
2048 |
-
|
2049 |
-
|
2050 |
-
|
2051 |
-
|
2052 |
-
|
2053 |
-
|
2054 |
-
|
2055 |
-
|
2056 |
-
|
2057 |
-
|
2058 |
-
|
2059 |
-
|
2060 |
-
|
2061 |
-
|
2062 |
-
|
2063 |
-
|
2064 |
-
|
2065 |
-
|
2066 |
-
|
2067 |
-
}
|
2068 |
-
}
|
2069 |
-
}
|
2070 |
-
|
2071 |
-
|
2072 |
-
|
2073 |
-
|
2074 |
-
|
2075 |
-
|
2076 |
-
|
2077 |
-
|
2078 |
-
|
2079 |
-
|
2080 |
-
|
2081 |
-
|
2082 |
-
|
2083 |
-
|
2084 |
-
|
2085 |
-
|
2086 |
-
|
2087 |
-
|
2088 |
-
elem
|
2089 |
-
|
2090 |
-
|
2091 |
-
|
2092 |
-
|
2093 |
-
|
2094 |
-
|
2095 |
-
|
2096 |
-
|
2097 |
-
|
2098 |
-
|
2099 |
-
|
2100 |
-
|
2101 |
-
|
2102 |
-
|
2103 |
-
|
2104 |
-
|
2105 |
-
|
2106 |
-
|
2107 |
-
|
2108 |
-
|
2109 |
-
|
2110 |
-
|
2111 |
-
|
2112 |
-
|
2113 |
-
|
2114 |
-
|
2115 |
-
|
2116 |
-
|
2117 |
-
|
2118 |
-
|
2119 |
-
|
2120 |
-
|
2121 |
-
|
2122 |
-
|
2123 |
-
|
2124 |
-
|
2125 |
-
|
2126 |
-
|
2127 |
-
|
2128 |
-
|
2129 |
-
|
2130 |
-
|
2131 |
-
|
2132 |
-
|
2133 |
-
|
2134 |
-
|
2135 |
-
|
2136 |
-
|
2137 |
-
|
2138 |
-
|
2139 |
-
|
2140 |
-
|
2141 |
-
|
2142 |
-
|
2143 |
-
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
|
2151 |
-
|
2152 |
-
|
2153 |
-
|
2154 |
-
|
2155 |
-
|
2156 |
-
|
2157 |
-
|
2158 |
-
|
2159 |
-
|
2160 |
-
|
2161 |
-
|
2162 |
-
|
2163 |
-
|
2164 |
-
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
|
2173 |
-
|
2174 |
-
|
2175 |
-
|
2176 |
-
|
2177 |
-
|
2178 |
-
|
2179 |
-
|
2180 |
-
|
2181 |
-
|
2182 |
-
|
2183 |
-
|
2184 |
-
|
2185 |
-
|
2186 |
-
|
2187 |
-
|
2188 |
-
|
2189 |
-
|
2190 |
-
|
2191 |
-
|
2192 |
-
|
2193 |
-
|
2194 |
-
|
2195 |
-
|
2196 |
-
|
2197 |
-
|
2198 |
-
|
2199 |
-
|
2200 |
-
|
2201 |
-
|
2202 |
-
|
2203 |
-
|
2204 |
-
elem =
|
2205 |
-
|
2206 |
-
|
2207 |
-
|
2208 |
-
|
2209 |
-
|
2210 |
-
|
2211 |
-
|
2212 |
-
|
2213 |
-
|
2214 |
-
|
2215 |
-
|
2216 |
-
|
2217 |
-
|
2218 |
-
|
2219 |
-
|
2220 |
-
|
2221 |
-
|
2222 |
-
|
2223 |
-
|
2224 |
-
|
2225 |
-
|
2226 |
-
|
2227 |
-
|
2228 |
-
|
2229 |
-
|
2230 |
-
|
2231 |
-
|
2232 |
-
|
2233 |
-
|
2234 |
-
|
2235 |
-
|
2236 |
-
|
2237 |
-
|
2238 |
-
|
2239 |
-
|
2240 |
-
|
2241 |
-
|
2242 |
-
|
2243 |
-
if (
|
2244 |
-
|
2245 |
-
}
|
2246 |
-
|
2247 |
-
|
2248 |
-
|
2249 |
-
|
2250 |
-
|
2251 |
-
|
2252 |
-
|
2253 |
-
|
2254 |
-
|
2255 |
-
|
2256 |
-
|
2257 |
-
|
2258 |
-
|
2259 |
-
|
2260 |
-
|
2261 |
-
|
2262 |
-
|
2263 |
-
|
2264 |
-
|
2265 |
-
|
2266 |
-
|
2267 |
-
|
2268 |
-
|
2269 |
-
|
2270 |
-
|
2271 |
-
|
2272 |
-
|
2273 |
-
|
2274 |
-
|
2275 |
-
|
2276 |
-
|
2277 |
-
|
2278 |
-
|
2279 |
-
|
2280 |
-
|
2281 |
-
|
2282 |
-
|
2283 |
-
|
2284 |
-
|
2285 |
-
|
2286 |
-
|
2287 |
-
|
2288 |
-
|
2289 |
-
|
2290 |
-
|
2291 |
-
|
2292 |
-
|
2293 |
-
|
2294 |
-
|
2295 |
-
|
2296 |
-
|
2297 |
-
|
2298 |
-
|
2299 |
-
|
2300 |
-
|
2301 |
-
|
2302 |
-
|
2303 |
-
|
2304 |
-
|
2305 |
-
|
2306 |
-
|
2307 |
-
|
2308 |
-
|
2309 |
-
}
|
2310 |
-
|
2311 |
-
|
2312 |
-
|
2313 |
-
|
2314 |
-
|
2315 |
-
|
2316 |
-
|
2317 |
-
|
2318 |
-
|
2319 |
-
|
2320 |
-
|
2321 |
-
|
2322 |
-
|
2323 |
-
|
2324 |
-
|
2325 |
-
|
2326 |
-
|
2327 |
-
|
2328 |
-
|
2329 |
-
|
2330 |
-
|
2331 |
-
|
2332 |
-
|
2333 |
-
|
2334 |
-
|
2335 |
-
|
2336 |
-
|
2337 |
-
|
2338 |
-
|
2339 |
-
|
2340 |
-
|
2341 |
-
|
2342 |
-
|
2343 |
-
|
2344 |
-
|
2345 |
-
|
2346 |
-
|
2347 |
-
|
2348 |
-
|
2349 |
-
|
2350 |
-
|
2351 |
-
|
2352 |
-
|
2353 |
-
|
2354 |
-
|
2355 |
-
|
2356 |
-
|
2357 |
-
|
2358 |
-
|
2359 |
-
|
2360 |
-
|
2361 |
-
|
2362 |
-
|
2363 |
-
|
2364 |
-
|
2365 |
-
|
2366 |
-
|
2367 |
-
|
2368 |
-
|
2369 |
-
|
2370 |
-
|
2371 |
-
|
2372 |
-
|
2373 |
-
|
2374 |
-
|
2375 |
-
|
2376 |
-
|
2377 |
-
|
2378 |
-
|
2379 |
-
|
2380 |
-
|
2381 |
-
|
2382 |
-
|
2383 |
-
|
2384 |
-
|
2385 |
-
|
2386 |
-
|
2387 |
-
|
2388 |
-
|
2389 |
-
|
2390 |
-
|
2391 |
-
|
2392 |
-
|
2393 |
-
|
2394 |
-
|
2395 |
-
|
2396 |
-
}
|
2397 |
-
|
2398 |
-
|
2399 |
-
|
2400 |
-
|
2401 |
-
|
2402 |
-
|
2403 |
-
|
2404 |
-
|
2405 |
-
|
2406 |
-
|
2407 |
-
|
2408 |
-
|
2409 |
-
|
2410 |
-
|
2411 |
-
|
2412 |
-
|
2413 |
-
|
2414 |
-
|
2415 |
-
|
2416 |
-
|
2417 |
-
|
2418 |
-
|
2419 |
-
|
2420 |
-
|
2421 |
-
|
2422 |
-
|
2423 |
-
|
2424 |
-
|
2425 |
-
|
2426 |
-
|
2427 |
-
|
2428 |
-
|
2429 |
-
|
2430 |
-
|
2431 |
-
|
2432 |
-
|
2433 |
-
|
2434 |
-
|
2435 |
-
|
2436 |
-
|
2437 |
-
|
2438 |
-
|
2439 |
-
|
2440 |
-
|
2441 |
-
|
2442 |
-
|
2443 |
-
|
2444 |
-
|
2445 |
-
|
2446 |
-
|
2447 |
-
|
2448 |
-
|
2449 |
-
|
2450 |
-
|
2451 |
-
|
2452 |
-
|
2453 |
-
|
2454 |
-
|
2455 |
-
|
2456 |
-
|
2457 |
-
|
2458 |
-
|
2459 |
-
|
2460 |
-
|
2461 |
-
|
2462 |
-
|
2463 |
-
|
2464 |
-
|
2465 |
-
|
2466 |
-
|
2467 |
-
|
2468 |
-
if (
|
2469 |
-
|
2470 |
-
|
2471 |
-
|
2472 |
-
|
2473 |
-
|
2474 |
-
|
2475 |
-
|
2476 |
-
|
2477 |
-
|
2478 |
-
|
2479 |
-
|
2480 |
-
|
2481 |
-
|
2482 |
-
|
2483 |
-
|
2484 |
-
|
2485 |
-
|
2486 |
-
|
2487 |
-
|
2488 |
-
|
2489 |
-
|
2490 |
-
|
2491 |
-
|
2492 |
-
|
2493 |
-
|
2494 |
-
|
2495 |
-
|
2496 |
-
|
2497 |
-
|
2498 |
-
|
2499 |
-
|
2500 |
-
|
2501 |
-
|
2502 |
-
|
2503 |
-
|
2504 |
-
|
2505 |
-
|
2506 |
-
|
2507 |
-
|
2508 |
-
|
2509 |
-
|
2510 |
-
|
2511 |
-
|
2512 |
-
|
2513 |
-
|
2514 |
-
|
2515 |
-
|
2516 |
-
|
2517 |
-
|
2518 |
-
|
2519 |
-
|
2520 |
-
|
2521 |
-
|
2522 |
-
|
2523 |
-
|
2524 |
-
|
2525 |
-
|
2526 |
-
|
2527 |
-
|
2528 |
-
|
2529 |
-
|
2530 |
-
|
2531 |
-
|
2532 |
-
|
2533 |
-
|
2534 |
-
|
2535 |
-
};
|
2536 |
-
|
2537 |
-
|
2538 |
-
|
2539 |
-
|
2540 |
-
|
2541 |
-
|
2542 |
-
|
2543 |
-
|
2544 |
-
|
2545 |
-
|
2546 |
-
|
2547 |
-
|
2548 |
-
|
2549 |
-
|
2550 |
-
|
2551 |
-
//
|
2552 |
-
|
2553 |
-
|
2554 |
-
|
2555 |
-
|
2556 |
-
|
2557 |
-
|
2558 |
-
|
2559 |
-
|
2560 |
-
|
2561 |
-
|
2562 |
-
|
2563 |
-
|
2564 |
-
|
2565 |
-
|
2566 |
-
|
2567 |
-
|
2568 |
-
|
2569 |
-
|
2570 |
-
|
2571 |
-
|
2572 |
-
|
2573 |
-
|
2574 |
-
|
2575 |
-
|
2576 |
-
|
2577 |
-
|
2578 |
-
|
2579 |
-
|
2580 |
-
|
2581 |
-
|
2582 |
-
|
2583 |
-
|
2584 |
-
|
2585 |
-
|
2586 |
-
|
2587 |
-
|
2588 |
-
|
2589 |
-
|
2590 |
-
|
2591 |
-
|
2592 |
-
|
2593 |
-
|
2594 |
-
|
2595 |
-
|
2596 |
-
|
2597 |
-
|
2598 |
-
|
2599 |
-
|
2600 |
-
|
2601 |
-
|
2602 |
-
|
2603 |
-
|
2604 |
-
|
2605 |
-
|
2606 |
-
|
2607 |
-
|
2608 |
-
|
2609 |
-
|
2610 |
-
|
2611 |
-
}
|
2612 |
-
|
2613 |
-
|
2614 |
-
|
2615 |
-
|
2616 |
-
//
|
2617 |
-
|
2618 |
-
|
2619 |
-
|
2620 |
-
|
2621 |
-
|
2622 |
-
|
2623 |
-
|
2624 |
-
|
2625 |
-
|
2626 |
-
|
2627 |
-
|
2628 |
-
|
2629 |
-
|
2630 |
-
|
2631 |
-
|
2632 |
-
|
2633 |
-
}
|
2634 |
-
|
2635 |
-
|
2636 |
-
|
2637 |
-
|
2638 |
-
|
2639 |
-
|
2640 |
-
|
2641 |
-
|
2642 |
-
|
2643 |
-
|
2644 |
-
|
2645 |
-
|
2646 |
-
|
2647 |
-
|
2648 |
-
}
|
2649 |
-
|
2650 |
-
|
2651 |
-
|
2652 |
-
|
2653 |
-
|
2654 |
-
|
2655 |
-
|
2656 |
-
|
2657 |
-
|
2658 |
-
|
2659 |
-
|
2660 |
-
|
2661 |
-
|
2662 |
-
|
2663 |
-
|
2664 |
-
|
2665 |
-
|
2666 |
-
|
2667 |
-
|
2668 |
-
|
2669 |
-
|
2670 |
-
|
2671 |
-
|
2672 |
-
|
2673 |
-
|
2674 |
-
|
2675 |
-
|
2676 |
-
//
|
2677 |
-
if ( !
|
2678 |
-
|
2679 |
-
|
2680 |
-
|
2681 |
-
|
2682 |
-
|
2683 |
-
|
2684 |
-
|
2685 |
-
|
2686 |
-
}
|
2687 |
-
|
2688 |
-
|
2689 |
-
|
2690 |
-
|
2691 |
-
|
2692 |
-
|
2693 |
-
|
2694 |
-
|
2695 |
-
|
2696 |
-
|
2697 |
-
|
2698 |
-
|
2699 |
-
|
2700 |
-
|
2701 |
-
|
2702 |
-
|
2703 |
-
|
2704 |
-
|
2705 |
-
|
2706 |
-
|
2707 |
-
|
2708 |
-
|
2709 |
-
|
2710 |
-
|
2711 |
-
|
2712 |
-
|
2713 |
-
|
2714 |
-
|
2715 |
-
|
2716 |
-
|
2717 |
-
|
2718 |
-
|
2719 |
-
|
2720 |
-
|
2721 |
-
|
2722 |
-
|
2723 |
-
|
2724 |
-
|
2725 |
-
|
2726 |
-
|
2727 |
-
|
2728 |
-
|
2729 |
-
|
2730 |
-
|
2731 |
-
|
2732 |
-
|
2733 |
-
|
2734 |
-
}
|
2735 |
-
|
2736 |
-
|
2737 |
-
|
2738 |
-
|
2739 |
-
|
2740 |
-
|
2741 |
-
|
2742 |
-
|
2743 |
-
|
2744 |
-
|
2745 |
-
|
2746 |
-
|
2747 |
-
|
2748 |
-
|
2749 |
-
|
2750 |
-
|
2751 |
-
|
2752 |
-
|
2753 |
-
|
2754 |
-
|
2755 |
-
}
|
2756 |
-
|
2757 |
-
|
2758 |
-
|
2759 |
-
|
2760 |
-
|
2761 |
-
|
2762 |
-
|
2763 |
-
|
2764 |
-
|
2765 |
-
|
2766 |
-
|
2767 |
-
|
2768 |
-
|
2769 |
-
|
2770 |
-
|
2771 |
-
|
2772 |
-
|
2773 |
-
|
2774 |
-
|
2775 |
-
|
2776 |
-
|
2777 |
-
|
2778 |
-
|
2779 |
-
|
2780 |
-
|
2781 |
-
|
2782 |
-
|
2783 |
-
|
2784 |
-
|
2785 |
-
|
2786 |
-
|
2787 |
-
|
2788 |
-
|
2789 |
-
|
2790 |
-
|
2791 |
-
|
2792 |
-
|
2793 |
-
|
2794 |
-
|
2795 |
-
|
2796 |
-
|
2797 |
-
|
2798 |
-
|
2799 |
-
|
2800 |
-
|
2801 |
-
|
2802 |
-
|
2803 |
-
|
2804 |
-
|
2805 |
-
|
2806 |
-
|
2807 |
-
|
2808 |
-
|
2809 |
-
|
2810 |
-
|
2811 |
-
|
2812 |
-
|
2813 |
-
|
2814 |
-
|
2815 |
-
|
2816 |
-
|
2817 |
-
|
2818 |
-
|
2819 |
-
|
2820 |
-
|
2821 |
-
|
2822 |
-
|
2823 |
-
|
2824 |
-
|
2825 |
-
|
2826 |
-
|
2827 |
-
|
2828 |
-
|
2829 |
-
|
2830 |
-
|
2831 |
-
|
2832 |
-
|
2833 |
-
|
2834 |
-
|
2835 |
-
|
2836 |
-
|
2837 |
-
|
2838 |
-
|
2839 |
-
|
2840 |
-
|
2841 |
-
|
2842 |
-
|
2843 |
-
|
2844 |
-
|
2845 |
-
|
2846 |
-
|
2847 |
-
|
2848 |
-
|
2849 |
-
|
2850 |
-
|
2851 |
-
|
2852 |
-
|
2853 |
-
|
2854 |
-
|
2855 |
-
|
2856 |
-
|
2857 |
-
|
2858 |
-
|
2859 |
-
|
2860 |
-
|
2861 |
-
|
2862 |
-
|
2863 |
-
|
2864 |
-
|
2865 |
-
|
2866 |
-
|
2867 |
-
|
2868 |
-
|
2869 |
-
|
2870 |
-
|
2871 |
-
|
2872 |
-
|
2873 |
-
|
2874 |
-
|
2875 |
-
|
2876 |
-
|
2877 |
-
|
2878 |
-
|
2879 |
-
|
2880 |
-
|
2881 |
-
|
2882 |
-
|
2883 |
-
|
2884 |
-
|
2885 |
-
|
2886 |
-
|
2887 |
-
|
2888 |
-
|
2889 |
-
|
2890 |
-
|
2891 |
-
|
2892 |
-
|
2893 |
-
|
2894 |
-
|
2895 |
-
|
2896 |
-
|
2897 |
-
|
2898 |
-
|
2899 |
-
|
2900 |
-
|
2901 |
-
|
2902 |
-
|
2903 |
-
|
2904 |
-
|
2905 |
-
|
2906 |
-
|
2907 |
-
|
2908 |
-
|
2909 |
-
|
2910 |
-
|
2911 |
-
|
2912 |
-
|
2913 |
-
|
2914 |
-
|
2915 |
-
|
2916 |
-
|
2917 |
-
|
2918 |
-
|
2919 |
-
|
2920 |
-
|
2921 |
-
|
2922 |
-
|
2923 |
-
|
2924 |
-
|
2925 |
-
|
2926 |
-
|
2927 |
-
|
2928 |
-
|
2929 |
-
|
2930 |
-
event
|
2931 |
-
|
2932 |
-
|
2933 |
-
|
2934 |
-
|
2935 |
-
|
2936 |
-
|
2937 |
-
|
2938 |
-
|
2939 |
-
|
2940 |
-
|
2941 |
-
|
2942 |
-
|
2943 |
-
|
2944 |
-
|
2945 |
-
|
2946 |
-
|
2947 |
-
|
2948 |
-
|
2949 |
-
|
2950 |
-
|
2951 |
-
|
2952 |
-
|
2953 |
-
|
2954 |
-
|
2955 |
-
|
2956 |
-
|
2957 |
-
|
2958 |
-
|
2959 |
-
|
2960 |
-
|
2961 |
-
|
2962 |
-
|
2963 |
-
}
|
2964 |
-
|
2965 |
-
|
2966 |
-
|
2967 |
-
|
2968 |
-
|
2969 |
-
|
2970 |
-
|
2971 |
-
|
2972 |
-
|
2973 |
-
|
2974 |
-
|
2975 |
-
|
2976 |
-
|
2977 |
-
|
2978 |
-
|
2979 |
-
|
2980 |
-
|
2981 |
-
|
2982 |
-
|
2983 |
-
//
|
2984 |
-
|
2985 |
-
|
2986 |
-
|
2987 |
-
|
2988 |
-
|
2989 |
-
|
2990 |
-
|
2991 |
-
|
2992 |
-
|
2993 |
-
|
2994 |
-
|
2995 |
-
|
2996 |
-
|
2997 |
-
|
2998 |
-
if (
|
2999 |
-
|
3000 |
-
|
3001 |
-
|
3002 |
-
|
3003 |
-
|
3004 |
-
//
|
3005 |
-
|
3006 |
-
|
3007 |
-
|
3008 |
-
|
3009 |
-
|
3010 |
-
|
3011 |
-
|
3012 |
-
|
3013 |
-
|
3014 |
-
|
3015 |
-
|
3016 |
-
|
3017 |
-
|
3018 |
-
|
3019 |
-
|
3020 |
-
|
3021 |
-
|
3022 |
-
|
3023 |
-
|
3024 |
-
|
3025 |
-
|
3026 |
-
|
3027 |
-
|
3028 |
-
|
3029 |
-
|
3030 |
-
|
3031 |
-
|
3032 |
-
|
3033 |
-
|
3034 |
-
|
3035 |
-
|
3036 |
-
|
3037 |
-
|
3038 |
-
|
3039 |
-
|
3040 |
-
|
3041 |
-
|
3042 |
-
|
3043 |
-
|
3044 |
-
|
3045 |
-
|
3046 |
-
|
3047 |
-
|
3048 |
-
|
3049 |
-
|
3050 |
-
|
3051 |
-
if (
|
3052 |
-
|
3053 |
-
|
3054 |
-
|
3055 |
-
|
3056 |
-
|
3057 |
-
|
3058 |
-
|
3059 |
-
|
3060 |
-
|
3061 |
-
|
3062 |
-
|
3063 |
-
|
3064 |
-
|
3065 |
-
|
3066 |
-
|
3067 |
-
|
3068 |
-
|
3069 |
-
|
3070 |
-
|
3071 |
-
|
3072 |
-
|
3073 |
-
|
3074 |
-
|
3075 |
-
|
3076 |
-
|
3077 |
-
|
3078 |
-
|
3079 |
-
|
3080 |
-
|
3081 |
-
|
3082 |
-
|
3083 |
-
|
3084 |
-
|
3085 |
-
|
3086 |
-
|
3087 |
-
|
3088 |
-
|
3089 |
-
|
3090 |
-
|
3091 |
-
|
3092 |
-
|
3093 |
-
|
3094 |
-
|
3095 |
-
|
3096 |
-
|
3097 |
-
|
3098 |
-
|
3099 |
-
|
3100 |
-
|
3101 |
-
|
3102 |
-
|
3103 |
-
|
3104 |
-
|
3105 |
-
|
3106 |
-
|
3107 |
-
|
3108 |
-
|
3109 |
-
|
3110 |
-
|
3111 |
-
|
3112 |
-
|
3113 |
-
|
3114 |
-
|
3115 |
-
|
3116 |
-
|
3117 |
-
|
3118 |
-
|
3119 |
-
|
3120 |
-
|
3121 |
-
|
3122 |
-
|
3123 |
-
|
3124 |
-
|
3125 |
-
|
3126 |
-
|
3127 |
-
|
3128 |
-
|
3129 |
-
|
3130 |
-
|
3131 |
-
|
3132 |
-
|
3133 |
-
|
3134 |
-
|
3135 |
-
|
3136 |
-
|
3137 |
-
|
3138 |
-
|
3139 |
-
|
3140 |
-
|
3141 |
-
|
3142 |
-
|
3143 |
-
|
3144 |
-
|
3145 |
-
|
3146 |
-
|
3147 |
-
|
3148 |
-
|
3149 |
-
|
3150 |
-
|
3151 |
-
|
3152 |
-
|
3153 |
-
|
3154 |
-
|
3155 |
-
|
3156 |
-
|
3157 |
-
|
3158 |
-
|
3159 |
-
|
3160 |
-
|
3161 |
-
|
3162 |
-
|
3163 |
-
|
3164 |
-
|
3165 |
-
|
3166 |
-
|
3167 |
-
|
3168 |
-
|
3169 |
-
|
3170 |
-
|
3171 |
-
|
3172 |
-
|
3173 |
-
|
3174 |
-
|
3175 |
-
|
3176 |
-
|
3177 |
-
|
3178 |
-
|
3179 |
-
|
3180 |
-
|
3181 |
-
|
3182 |
-
|
3183 |
-
|
3184 |
-
|
3185 |
-
|
3186 |
-
|
3187 |
-
|
3188 |
-
|
3189 |
-
|
3190 |
-
|
3191 |
-
|
3192 |
-
|
3193 |
-
|
3194 |
-
|
3195 |
-
|
3196 |
-
|
3197 |
-
|
3198 |
-
|
3199 |
-
|
3200 |
-
|
3201 |
-
|
3202 |
-
|
3203 |
-
|
3204 |
-
|
3205 |
-
|
3206 |
-
|
3207 |
-
|
3208 |
-
|
3209 |
-
|
3210 |
-
|
3211 |
-
|
3212 |
-
|
3213 |
-
|
3214 |
-
|
3215 |
-
|
3216 |
-
|
3217 |
-
|
3218 |
-
|
3219 |
-
|
3220 |
-
|
3221 |
-
|
3222 |
-
|
3223 |
-
|
3224 |
-
|
3225 |
-
|
3226 |
-
|
3227 |
-
|
3228 |
-
|
3229 |
-
|
3230 |
-
|
3231 |
-
|
3232 |
-
|
3233 |
-
|
3234 |
-
|
3235 |
-
|
3236 |
-
|
3237 |
-
|
3238 |
-
|
3239 |
-
|
3240 |
-
|
3241 |
-
|
3242 |
-
|
3243 |
-
|
3244 |
-
|
3245 |
-
|
3246 |
-
|
3247 |
-
|
3248 |
-
|
3249 |
-
|
3250 |
-
|
3251 |
-
|
3252 |
-
|
3253 |
-
|
3254 |
-
|
3255 |
-
|
3256 |
-
|
3257 |
-
|
3258 |
-
|
3259 |
-
|
3260 |
-
|
3261 |
-
|
3262 |
-
|
3263 |
-
|
3264 |
-
|
3265 |
-
|
3266 |
-
|
3267 |
-
|
3268 |
-
|
3269 |
-
|
3270 |
-
|
3271 |
-
|
3272 |
-
|
3273 |
-
|
3274 |
-
|
3275 |
-
|
3276 |
-
|
3277 |
-
|
3278 |
-
|
3279 |
-
|
3280 |
-
|
3281 |
-
|
3282 |
-
|
3283 |
-
|
3284 |
-
|
3285 |
-
|
3286 |
-
|
3287 |
-
|
3288 |
-
|
3289 |
-
|
3290 |
-
|
3291 |
-
|
3292 |
-
|
3293 |
-
|
3294 |
-
|
3295 |
-
|
3296 |
-
|
3297 |
-
|
3298 |
-
|
3299 |
-
|
3300 |
-
|
3301 |
-
|
3302 |
-
|
3303 |
-
|
3304 |
-
|
3305 |
-
|
3306 |
-
|
3307 |
-
|
3308 |
-
|
3309 |
-
|
3310 |
-
|
3311 |
-
|
3312 |
-
|
3313 |
-
|
3314 |
-
|
3315 |
-
}
|
3316 |
-
|
3317 |
-
|
3318 |
-
|
3319 |
-
|
3320 |
-
|
3321 |
-
|
3322 |
-
//
|
3323 |
-
//
|
3324 |
-
|
3325 |
-
|
3326 |
-
|
3327 |
-
|
3328 |
-
|
3329 |
-
|
3330 |
-
|
3331 |
-
|
3332 |
-
|
3333 |
-
|
3334 |
-
|
3335 |
-
|
3336 |
-
|
3337 |
-
|
3338 |
-
|
3339 |
-
|
3340 |
-
|
3341 |
-
|
3342 |
-
|
3343 |
-
|
3344 |
-
|
3345 |
-
|
3346 |
-
|
3347 |
-
|
3348 |
-
|
3349 |
-
|
3350 |
-
|
3351 |
-
|
3352 |
-
|
3353 |
-
|
3354 |
-
|
3355 |
-
|
3356 |
-
|
3357 |
-
|
3358 |
-
|
3359 |
-
|
3360 |
-
|
3361 |
-
|
3362 |
-
|
3363 |
-
|
3364 |
-
|
3365 |
-
//
|
3366 |
-
|
3367 |
-
|
3368 |
-
|
3369 |
-
|
3370 |
-
|
3371 |
-
|
3372 |
-
|
3373 |
-
|
3374 |
-
|
3375 |
-
|
3376 |
-
|
3377 |
-
|
3378 |
-
|
3379 |
-
|
3380 |
-
|
3381 |
-
|
3382 |
-
|
3383 |
-
|
3384 |
-
|
3385 |
-
|
3386 |
-
|
3387 |
-
|
3388 |
-
|
3389 |
-
}
|
3390 |
-
|
3391 |
-
|
3392 |
-
|
3393 |
-
|
3394 |
-
|
3395 |
-
|
3396 |
-
|
3397 |
-
|
3398 |
-
|
3399 |
-
|
3400 |
-
|
3401 |
-
|
3402 |
-
|
3403 |
-
|
3404 |
-
|
3405 |
-
|
3406 |
-
|
3407 |
-
|
3408 |
-
|
3409 |
-
|
3410 |
-
|
3411 |
-
|
3412 |
-
|
3413 |
-
|
3414 |
-
|
3415 |
-
|
3416 |
-
|
3417 |
-
|
3418 |
-
|
3419 |
-
|
3420 |
-
|
3421 |
-
|
3422 |
-
|
3423 |
-
|
3424 |
-
|
3425 |
-
|
3426 |
-
|
3427 |
-
|
3428 |
-
|
3429 |
-
|
3430 |
-
|
3431 |
-
|
3432 |
-
|
3433 |
-
|
3434 |
-
|
3435 |
-
|
3436 |
-
|
3437 |
-
|
3438 |
-
|
3439 |
-
|
3440 |
-
|
3441 |
-
|
3442 |
-
|
3443 |
-
|
3444 |
-
|
3445 |
-
|
3446 |
-
|
3447 |
-
|
3448 |
-
|
3449 |
-
|
3450 |
-
|
3451 |
-
|
3452 |
-
|
3453 |
-
|
3454 |
-
|
3455 |
-
|
3456 |
-
|
3457 |
-
|
3458 |
-
|
3459 |
-
|
3460 |
-
|
3461 |
-
|
3462 |
-
|
3463 |
-
|
3464 |
-
|
3465 |
-
|
3466 |
-
|
3467 |
-
|
3468 |
-
|
3469 |
-
|
3470 |
-
|
3471 |
-
|
3472 |
-
|
3473 |
-
|
3474 |
-
|
3475 |
-
|
3476 |
-
|
3477 |
-
|
3478 |
-
|
3479 |
-
|
3480 |
-
|
3481 |
-
|
3482 |
-
}
|
3483 |
-
|
3484 |
-
|
3485 |
-
|
3486 |
-
|
3487 |
-
|
3488 |
-
|
3489 |
-
|
3490 |
-
|
3491 |
-
|
3492 |
-
|
3493 |
-
|
3494 |
-
|
3495 |
-
|
3496 |
-
|
3497 |
-
|
3498 |
-
|
3499 |
-
|
3500 |
-
|
3501 |
-
|
3502 |
-
|
3503 |
-
|
3504 |
-
|
3505 |
-
|
3506 |
-
|
3507 |
-
|
3508 |
-
|
3509 |
-
|
3510 |
-
|
3511 |
-
|
3512 |
-
|
3513 |
-
|
3514 |
-
|
3515 |
-
|
3516 |
-
|
3517 |
-
|
3518 |
-
|
3519 |
-
|
3520 |
-
|
3521 |
-
|
3522 |
-
|
3523 |
-
|
3524 |
-
|
3525 |
-
|
3526 |
-
|
3527 |
-
|
3528 |
-
|
3529 |
-
|
3530 |
-
|
3531 |
-
|
3532 |
-
|
3533 |
-
|
3534 |
-
|
3535 |
-
|
3536 |
-
|
3537 |
-
|
3538 |
-
|
3539 |
-
|
3540 |
-
|
3541 |
-
|
3542 |
-
|
3543 |
-
|
3544 |
-
|
3545 |
-
|
3546 |
-
|
3547 |
-
|
3548 |
-
|
3549 |
-
|
3550 |
-
|
3551 |
-
|
3552 |
-
|
3553 |
-
|
3554 |
-
|
3555 |
-
|
3556 |
-
|
3557 |
-
|
3558 |
-
|
3559 |
-
|
3560 |
-
|
3561 |
-
|
3562 |
-
|
3563 |
-
|
3564 |
-
|
3565 |
-
|
3566 |
-
|
3567 |
-
|
3568 |
-
|
3569 |
-
|
3570 |
-
|
3571 |
-
|
3572 |
-
|
3573 |
-
|
3574 |
-
|
3575 |
-
|
3576 |
-
|
3577 |
-
|
3578 |
-
|
3579 |
-
|
3580 |
-
|
3581 |
-
|
3582 |
-
|
3583 |
-
|
3584 |
-
|
3585 |
-
|
3586 |
-
|
3587 |
-
|
3588 |
-
|
3589 |
-
|
3590 |
-
|
3591 |
-
|
3592 |
-
|
3593 |
-
|
3594 |
-
|
3595 |
-
|
3596 |
-
|
3597 |
-
|
3598 |
-
|
3599 |
-
|
3600 |
-
|
3601 |
-
|
3602 |
-
|
3603 |
-
|
3604 |
-
|
3605 |
-
|
3606 |
-
|
3607 |
-
|
3608 |
-
|
3609 |
-
|
3610 |
-
|
3611 |
-
|
3612 |
-
|
3613 |
-
|
3614 |
-
|
3615 |
-
|
3616 |
-
|
3617 |
-
|
3618 |
-
|
3619 |
-
|
3620 |
-
|
3621 |
-
|
3622 |
-
|
3623 |
-
|
3624 |
-
|
3625 |
-
|
3626 |
-
|
3627 |
-
|
3628 |
-
|
3629 |
-
|
3630 |
-
if (
|
3631 |
-
|
3632 |
-
|
3633 |
-
|
3634 |
-
|
3635 |
-
|
3636 |
-
|
3637 |
-
|
3638 |
-
return
|
3639 |
-
}
|
3640 |
-
|
3641 |
-
|
3642 |
-
|
3643 |
-
|
3644 |
-
|
3645 |
-
|
3646 |
-
|
3647 |
-
|
3648 |
-
|
3649 |
-
|
3650 |
-
|
3651 |
-
|
3652 |
-
|
3653 |
-
|
3654 |
-
|
3655 |
-
|
3656 |
-
|
3657 |
-
|
3658 |
-
|
3659 |
-
|
3660 |
-
|
3661 |
-
|
3662 |
-
|
3663 |
-
|
3664 |
-
|
3665 |
-
|
3666 |
-
|
3667 |
-
|
3668 |
-
|
3669 |
-
|
3670 |
-
|
3671 |
-
|
3672 |
-
|
3673 |
-
|
3674 |
-
|
3675 |
-
|
3676 |
-
|
3677 |
-
|
3678 |
-
|
3679 |
-
|
3680 |
-
|
3681 |
-
|
3682 |
-
|
3683 |
-
|
3684 |
-
|
3685 |
-
|
3686 |
-
|
3687 |
-
|
3688 |
-
|
3689 |
-
|
3690 |
-
|
3691 |
-
|
3692 |
-
|
3693 |
-
|
3694 |
-
|
3695 |
-
|
3696 |
-
|
3697 |
-
|
3698 |
-
|
3699 |
-
|
3700 |
-
|
3701 |
-
|
3702 |
-
|
3703 |
-
|
3704 |
-
|
3705 |
-
|
3706 |
-
|
3707 |
-
|
3708 |
-
|
3709 |
-
|
3710 |
-
|
3711 |
-
|
3712 |
-
|
3713 |
-
|
3714 |
-
|
3715 |
-
|
3716 |
-
|
3717 |
-
|
3718 |
-
|
3719 |
-
|
3720 |
-
|
3721 |
-
|
3722 |
-
|
3723 |
-
|
3724 |
-
|
3725 |
-
|
3726 |
-
|
3727 |
-
|
3728 |
-
|
3729 |
-
|
3730 |
-
|
3731 |
-
|
3732 |
-
|
3733 |
-
|
3734 |
-
|
3735 |
-
|
3736 |
-
|
3737 |
-
|
3738 |
-
|
3739 |
-
|
3740 |
-
|
3741 |
-
|
3742 |
-
|
3743 |
-
|
3744 |
-
|
3745 |
-
|
3746 |
-
|
3747 |
-
|
3748 |
-
|
3749 |
-
|
3750 |
-
|
3751 |
-
|
3752 |
-
|
3753 |
-
|
3754 |
-
|
3755 |
-
|
3756 |
-
|
3757 |
-
|
3758 |
-
|
3759 |
-
|
3760 |
-
|
3761 |
-
|
3762 |
-
|
3763 |
-
|
3764 |
-
|
3765 |
-
|
3766 |
-
|
3767 |
-
|
3768 |
-
|
3769 |
-
|
3770 |
-
|
3771 |
-
|
3772 |
-
|
3773 |
-
|
3774 |
-
|
3775 |
-
|
3776 |
-
|
3777 |
-
|
3778 |
-
|
3779 |
-
|
3780 |
-
|
3781 |
-
|
3782 |
-
|
3783 |
-
|
3784 |
-
|
3785 |
-
|
3786 |
-
|
3787 |
-
|
3788 |
-
|
3789 |
-
|
3790 |
-
|
3791 |
-
|
3792 |
-
|
3793 |
-
|
3794 |
-
|
3795 |
-
|
3796 |
-
|
3797 |
-
|
3798 |
-
|
3799 |
-
|
3800 |
-
|
3801 |
-
|
3802 |
-
|
3803 |
-
|
3804 |
-
|
3805 |
-
|
3806 |
-
|
3807 |
-
|
3808 |
-
|
3809 |
-
|
3810 |
-
|
3811 |
-
|
3812 |
-
|
3813 |
-
|
3814 |
-
|
3815 |
-
|
3816 |
-
|
3817 |
-
|
3818 |
-
|
3819 |
-
|
3820 |
-
|
3821 |
-
|
3822 |
-
|
3823 |
-
|
3824 |
-
|
3825 |
-
|
3826 |
-
|
3827 |
-
|
3828 |
-
|
3829 |
-
|
3830 |
-
|
3831 |
-
|
3832 |
-
}
|
3833 |
-
|
3834 |
-
}
|
3835 |
-
|
3836 |
-
|
3837 |
-
|
3838 |
-
|
3839 |
-
|
3840 |
-
|
3841 |
-
|
3842 |
-
|
3843 |
-
|
3844 |
-
|
3845 |
-
|
3846 |
-
|
3847 |
-
|
3848 |
-
|
3849 |
-
*
|
3850 |
-
|
3851 |
-
|
3852 |
-
|
3853 |
-
|
3854 |
-
|
3855 |
-
|
3856 |
-
|
3857 |
-
|
3858 |
-
|
3859 |
-
|
3860 |
-
|
3861 |
-
|
3862 |
-
|
3863 |
-
|
3864 |
-
|
3865 |
-
|
3866 |
-
|
3867 |
-
|
3868 |
-
|
3869 |
-
|
3870 |
-
|
3871 |
-
|
3872 |
-
|
3873 |
-
|
3874 |
-
|
3875 |
-
|
3876 |
-
|
3877 |
-
|
3878 |
-
|
3879 |
-
|
3880 |
-
|
3881 |
-
|
3882 |
-
|
3883 |
-
|
3884 |
-
|
3885 |
-
|
3886 |
-
|
3887 |
-
|
3888 |
-
|
3889 |
-
|
3890 |
-
|
3891 |
-
|
3892 |
-
|
3893 |
-
|
3894 |
-
|
3895 |
-
|
3896 |
-
|
3897 |
-
|
3898 |
-
|
3899 |
-
|
3900 |
-
|
3901 |
-
|
3902 |
-
|
3903 |
-
|
3904 |
-
|
3905 |
-
|
3906 |
-
|
3907 |
-
|
3908 |
-
|
3909 |
-
|
3910 |
-
|
3911 |
-
|
3912 |
-
|
3913 |
-
|
3914 |
-
|
3915 |
-
|
3916 |
-
|
3917 |
-
|
3918 |
-
|
3919 |
-
|
3920 |
-
|
3921 |
-
|
3922 |
-
|
3923 |
-
|
3924 |
-
|
3925 |
-
|
3926 |
-
|
3927 |
-
|
3928 |
-
|
3929 |
-
|
3930 |
-
|
3931 |
-
|
3932 |
-
|
3933 |
-
|
3934 |
-
|
3935 |
-
|
3936 |
-
|
3937 |
-
|
3938 |
-
|
3939 |
-
|
3940 |
-
|
3941 |
-
|
3942 |
-
|
3943 |
-
|
3944 |
-
|
3945 |
-
|
3946 |
-
|
3947 |
-
|
3948 |
-
|
3949 |
-
|
3950 |
-
|
3951 |
-
|
3952 |
-
|
3953 |
-
|
3954 |
-
|
3955 |
-
|
3956 |
-
|
3957 |
-
|
3958 |
-
|
3959 |
-
|
3960 |
-
|
3961 |
-
|
3962 |
-
|
3963 |
-
|
3964 |
-
|
3965 |
-
|
3966 |
-
|
3967 |
-
|
3968 |
-
|
3969 |
-
|
3970 |
-
|
3971 |
-
|
3972 |
-
|
3973 |
-
|
3974 |
-
|
3975 |
-
|
3976 |
-
|
3977 |
-
|
3978 |
-
|
3979 |
-
|
3980 |
-
|
3981 |
-
|
3982 |
-
|
3983 |
-
|
3984 |
-
|
3985 |
-
|
3986 |
-
|
3987 |
-
|
3988 |
-
|
3989 |
-
|
3990 |
-
|
3991 |
-
|
3992 |
-
|
3993 |
-
|
3994 |
-
|
3995 |
-
|
3996 |
-
|
3997 |
-
|
3998 |
-
|
3999 |
-
}
|
4000 |
-
|
4001 |
-
|
4002 |
-
|
4003 |
-
|
4004 |
-
|
4005 |
-
|
4006 |
-
|
4007 |
-
|
4008 |
-
|
4009 |
-
|
4010 |
-
|
4011 |
-
|
4012 |
-
|
4013 |
-
|
4014 |
-
|
4015 |
-
|
4016 |
-
|
4017 |
-
|
4018 |
-
|
4019 |
-
|
4020 |
-
|
4021 |
-
|
4022 |
-
|
4023 |
-
|
4024 |
-
|
4025 |
-
|
4026 |
-
|
4027 |
-
|
4028 |
-
|
4029 |
-
|
4030 |
-
|
4031 |
-
|
4032 |
-
|
4033 |
-
|
4034 |
-
|
4035 |
-
|
4036 |
-
|
4037 |
-
|
4038 |
-
|
4039 |
-
|
4040 |
-
|
4041 |
-
|
4042 |
-
|
4043 |
-
|
4044 |
-
|
4045 |
-
|
4046 |
-
|
4047 |
-
|
4048 |
-
|
4049 |
-
|
4050 |
-
|
4051 |
-
|
4052 |
-
|
4053 |
-
|
4054 |
-
|
4055 |
-
|
4056 |
-
|
4057 |
-
|
4058 |
-
|
4059 |
-
|
4060 |
-
|
4061 |
-
|
4062 |
-
|
4063 |
-
|
4064 |
-
|
4065 |
-
|
4066 |
-
|
4067 |
-
|
4068 |
-
|
4069 |
-
|
4070 |
-
|
4071 |
-
|
4072 |
-
|
4073 |
-
|
4074 |
-
|
4075 |
-
|
4076 |
-
|
4077 |
-
|
4078 |
-
|
4079 |
-
|
4080 |
-
|
4081 |
-
|
4082 |
-
|
4083 |
-
|
4084 |
-
|
4085 |
-
|
4086 |
-
|
4087 |
-
|
4088 |
-
|
4089 |
-
|
4090 |
-
|
4091 |
-
|
4092 |
-
|
4093 |
-
|
4094 |
-
|
4095 |
-
|
4096 |
-
|
4097 |
-
|
4098 |
-
|
4099 |
-
|
4100 |
-
|
4101 |
-
|
4102 |
-
|
4103 |
-
|
4104 |
-
|
4105 |
-
|
4106 |
-
|
4107 |
-
|
4108 |
-
|
4109 |
-
return
|
4110 |
-
|
4111 |
-
|
4112 |
-
|
4113 |
-
|
4114 |
-
|
4115 |
-
|
4116 |
-
|
4117 |
-
|
4118 |
-
|
4119 |
-
|
4120 |
-
|
4121 |
-
|
4122 |
-
|
4123 |
-
|
4124 |
-
|
4125 |
-
|
4126 |
-
|
4127 |
-
|
4128 |
-
|
4129 |
-
|
4130 |
-
|
4131 |
-
|
4132 |
-
|
4133 |
-
|
4134 |
-
|
4135 |
-
|
4136 |
-
function(
|
4137 |
-
|
4138 |
-
|
4139 |
-
|
4140 |
-
|
4141 |
-
|
4142 |
-
|
4143 |
-
|
4144 |
-
|
4145 |
-
|
4146 |
-
|
4147 |
-
|
4148 |
-
|
4149 |
-
|
4150 |
-
|
4151 |
-
|
4152 |
-
|
4153 |
-
|
4154 |
-
|
4155 |
-
|
4156 |
-
|
4157 |
-
return
|
4158 |
-
}
|
4159 |
-
|
4160 |
-
|
4161 |
-
|
4162 |
-
|
4163 |
-
|
4164 |
-
|
4165 |
-
|
4166 |
-
|
4167 |
-
|
4168 |
-
|
4169 |
-
|
4170 |
-
|
4171 |
-
|
4172 |
-
|
4173 |
-
|
4174 |
-
|
4175 |
-
|
4176 |
-
|
4177 |
-
|
4178 |
-
|
4179 |
-
|
4180 |
-
|
4181 |
-
|
4182 |
-
|
4183 |
-
|
4184 |
-
|
4185 |
-
|
4186 |
-
|
4187 |
-
|
4188 |
-
|
4189 |
-
|
4190 |
-
|
4191 |
-
|
4192 |
-
|
4193 |
-
|
4194 |
-
|
4195 |
-
|
4196 |
-
|
4197 |
-
|
4198 |
-
|
4199 |
-
|
4200 |
-
|
4201 |
-
|
4202 |
-
|
4203 |
-
|
4204 |
-
|
4205 |
-
|
4206 |
-
|
4207 |
-
|
4208 |
-
|
4209 |
-
|
4210 |
-
|
4211 |
-
|
4212 |
-
|
4213 |
-
|
4214 |
-
|
4215 |
-
|
4216 |
-
|
4217 |
-
|
4218 |
-
|
4219 |
-
|
4220 |
-
|
4221 |
-
|
4222 |
-
|
4223 |
-
|
4224 |
-
|
4225 |
-
|
4226 |
-
|
4227 |
-
|
4228 |
-
|
4229 |
-
|
4230 |
-
|
4231 |
-
|
4232 |
-
|
4233 |
-
|
4234 |
-
|
4235 |
-
|
4236 |
-
|
4237 |
-
|
4238 |
-
|
4239 |
-
|
4240 |
-
|
4241 |
-
|
4242 |
-
|
4243 |
-
|
4244 |
-
|
4245 |
-
|
4246 |
-
|
4247 |
-
|
4248 |
-
|
4249 |
-
|
4250 |
-
|
4251 |
-
|
4252 |
-
|
4253 |
-
|
4254 |
-
|
4255 |
-
|
4256 |
-
|
4257 |
-
|
4258 |
-
|
4259 |
-
|
4260 |
-
|
4261 |
-
|
4262 |
-
|
4263 |
-
|
4264 |
-
|
4265 |
-
|
4266 |
-
|
4267 |
-
|
4268 |
-
|
4269 |
-
|
4270 |
-
|
4271 |
-
|
4272 |
-
|
4273 |
-
|
4274 |
-
|
4275 |
-
|
4276 |
-
|
4277 |
-
|
4278 |
-
|
4279 |
-
|
4280 |
-
|
4281 |
-
|
4282 |
-
|
4283 |
-
|
4284 |
-
|
4285 |
-
|
4286 |
-
|
4287 |
-
|
4288 |
-
|
4289 |
-
|
4290 |
-
|
4291 |
-
|
4292 |
-
|
4293 |
-
|
4294 |
-
|
4295 |
-
|
4296 |
-
|
4297 |
-
|
4298 |
-
|
4299 |
-
|
4300 |
-
|
4301 |
-
|
4302 |
-
|
4303 |
-
|
4304 |
-
|
4305 |
-
|
4306 |
-
|
4307 |
-
|
4308 |
-
|
4309 |
-
|
4310 |
-
|
4311 |
-
|
4312 |
-
|
4313 |
-
|
4314 |
-
|
4315 |
-
|
4316 |
-
|
4317 |
-
|
4318 |
-
|
4319 |
-
|
4320 |
-
|
4321 |
-
|
4322 |
-
|
4323 |
-
|
4324 |
-
|
4325 |
-
|
4326 |
-
|
4327 |
-
|
4328 |
-
|
4329 |
-
|
4330 |
-
|
4331 |
-
|
4332 |
-
|
4333 |
-
|
4334 |
-
|
4335 |
-
|
4336 |
-
|
4337 |
-
|
4338 |
-
|
4339 |
-
|
4340 |
-
|
4341 |
-
|
4342 |
-
|
4343 |
-
|
4344 |
-
|
4345 |
-
|
4346 |
-
|
4347 |
-
|
4348 |
-
|
4349 |
-
|
4350 |
-
|
4351 |
-
|
4352 |
-
|
4353 |
-
|
4354 |
-
|
4355 |
-
|
4356 |
-
|
4357 |
-
}
|
4358 |
-
|
4359 |
-
|
4360 |
-
|
4361 |
-
|
4362 |
-
|
4363 |
-
|
4364 |
-
|
4365 |
-
if (
|
4366 |
-
|
4367 |
-
}
|
4368 |
-
|
4369 |
-
|
4370 |
-
|
4371 |
-
|
4372 |
-
|
4373 |
-
|
4374 |
-
|
4375 |
-
|
4376 |
-
|
4377 |
-
|
4378 |
-
|
4379 |
-
|
4380 |
-
|
4381 |
-
|
4382 |
-
|
4383 |
-
|
4384 |
-
|
4385 |
-
|
4386 |
-
|
4387 |
-
|
4388 |
-
|
4389 |
-
|
4390 |
-
|
4391 |
-
|
4392 |
-
|
4393 |
-
|
4394 |
-
|
4395 |
-
|
4396 |
-
|
4397 |
-
|
4398 |
-
|
4399 |
-
|
4400 |
-
|
4401 |
-
|
4402 |
-
|
4403 |
-
|
4404 |
-
|
4405 |
-
|
4406 |
-
|
4407 |
-
|
4408 |
-
|
4409 |
-
|
4410 |
-
|
4411 |
-
|
4412 |
-
|
4413 |
-
|
4414 |
-
|
4415 |
-
|
4416 |
-
|
4417 |
-
|
4418 |
-
|
4419 |
-
|
4420 |
-
|
4421 |
-
|
4422 |
-
|
4423 |
-
|
4424 |
-
|
4425 |
-
|
4426 |
-
|
4427 |
-
|
4428 |
-
|
4429 |
-
|
4430 |
-
|
4431 |
-
|
4432 |
-
|
4433 |
-
|
4434 |
-
|
4435 |
-
|
4436 |
-
|
4437 |
-
|
4438 |
-
|
4439 |
-
|
4440 |
-
|
4441 |
-
|
4442 |
-
|
4443 |
-
|
4444 |
-
|
4445 |
-
|
4446 |
-
|
4447 |
-
|
4448 |
-
|
4449 |
-
|
4450 |
-
|
4451 |
-
|
4452 |
-
|
4453 |
-
|
4454 |
-
|
4455 |
-
|
4456 |
-
|
4457 |
-
|
4458 |
-
|
4459 |
-
|
4460 |
-
|
4461 |
-
|
4462 |
-
|
4463 |
-
|
4464 |
-
|
4465 |
-
|
4466 |
-
|
4467 |
-
|
4468 |
-
|
4469 |
-
|
4470 |
-
|
4471 |
-
|
4472 |
-
|
4473 |
-
|
4474 |
-
|
4475 |
-
|
4476 |
-
|
4477 |
-
|
4478 |
-
|
4479 |
-
|
4480 |
-
|
4481 |
-
|
4482 |
-
|
4483 |
-
|
4484 |
-
}
|
4485 |
-
|
4486 |
-
|
4487 |
-
|
4488 |
-
|
4489 |
-
|
4490 |
-
|
4491 |
-
|
4492 |
-
|
4493 |
-
|
4494 |
-
|
4495 |
-
|
4496 |
-
|
4497 |
-
|
4498 |
-
|
4499 |
-
|
4500 |
-
|
4501 |
-
|
4502 |
-
|
4503 |
-
|
4504 |
-
|
4505 |
-
|
4506 |
-
|
4507 |
-
|
4508 |
-
|
4509 |
-
|
4510 |
-
|
4511 |
-
|
4512 |
-
|
4513 |
-
|
4514 |
-
|
4515 |
-
|
4516 |
-
|
4517 |
-
|
4518 |
-
|
4519 |
-
|
4520 |
-
|
4521 |
-
|
4522 |
-
|
4523 |
-
|
4524 |
-
|
4525 |
-
|
4526 |
-
|
4527 |
-
|
4528 |
-
|
4529 |
-
|
4530 |
-
|
4531 |
-
|
4532 |
-
|
4533 |
-
|
4534 |
-
|
4535 |
-
|
4536 |
-
|
4537 |
-
|
4538 |
-
|
4539 |
-
|
4540 |
-
|
4541 |
-
|
4542 |
-
|
4543 |
-
|
4544 |
-
|
4545 |
-
|
4546 |
-
|
4547 |
-
|
4548 |
-
|
4549 |
-
|
4550 |
-
|
4551 |
-
|
4552 |
-
|
4553 |
-
|
4554 |
-
|
4555 |
-
|
4556 |
-
|
4557 |
-
|
4558 |
-
|
4559 |
-
|
4560 |
-
|
4561 |
-
|
4562 |
-
|
4563 |
-
|
4564 |
-
|
4565 |
-
if (
|
4566 |
-
|
4567 |
-
|
4568 |
-
|
4569 |
-
return
|
4570 |
-
}
|
4571 |
-
|
4572 |
-
|
4573 |
-
|
4574 |
-
|
4575 |
-
|
4576 |
-
|
4577 |
-
|
4578 |
-
|
4579 |
-
|
4580 |
-
|
4581 |
-
|
4582 |
-
|
4583 |
-
|
4584 |
-
|
4585 |
-
|
4586 |
-
|
4587 |
-
|
4588 |
-
|
4589 |
-
|
4590 |
-
|
4591 |
-
|
4592 |
-
|
4593 |
-
|
4594 |
-
|
4595 |
-
|
4596 |
-
|
4597 |
-
|
4598 |
-
|
4599 |
-
|
4600 |
-
|
4601 |
-
|
4602 |
-
|
4603 |
-
|
4604 |
-
|
4605 |
-
|
4606 |
-
|
4607 |
-
|
4608 |
-
|
4609 |
-
|
4610 |
-
|
4611 |
-
|
4612 |
-
|
4613 |
-
if
|
4614 |
-
|
4615 |
-
|
4616 |
-
|
4617 |
-
|
4618 |
-
|
4619 |
-
|
4620 |
-
|
4621 |
-
|
4622 |
-
|
4623 |
-
|
4624 |
-
|
4625 |
-
|
4626 |
-
|
4627 |
-
|
4628 |
-
|
4629 |
-
|
4630 |
-
|
4631 |
-
|
4632 |
-
|
4633 |
-
|
4634 |
-
|
4635 |
-
|
4636 |
-
|
4637 |
-
|
4638 |
-
|
4639 |
-
|
4640 |
-
|
4641 |
-
|
4642 |
-
|
4643 |
-
|
4644 |
-
|
4645 |
-
|
4646 |
-
|
4647 |
-
|
4648 |
-
|
4649 |
-
|
4650 |
-
|
4651 |
-
|
4652 |
-
|
4653 |
-
|
4654 |
-
|
4655 |
-
|
4656 |
-
|
4657 |
-
|
4658 |
-
|
4659 |
-
|
4660 |
-
|
4661 |
-
|
4662 |
-
|
4663 |
-
|
4664 |
-
|
4665 |
-
|
4666 |
-
|
4667 |
-
|
4668 |
-
|
4669 |
-
|
4670 |
-
|
4671 |
-
|
4672 |
-
|
4673 |
-
|
4674 |
-
|
4675 |
-
|
4676 |
-
|
4677 |
-
|
4678 |
-
|
4679 |
-
|
4680 |
-
|
4681 |
-
|
4682 |
-
|
4683 |
-
|
4684 |
-
|
4685 |
-
|
4686 |
-
|
4687 |
-
|
4688 |
-
|
4689 |
-
|
4690 |
-
|
4691 |
-
|
4692 |
-
|
4693 |
-
|
4694 |
-
|
4695 |
-
|
4696 |
-
|
4697 |
-
|
4698 |
-
|
4699 |
-
if (
|
4700 |
-
|
4701 |
-
|
4702 |
-
|
4703 |
-
|
4704 |
-
|
4705 |
-
|
4706 |
-
|
4707 |
-
|
4708 |
-
|
4709 |
-
|
4710 |
-
|
4711 |
-
|
4712 |
-
|
4713 |
-
|
4714 |
-
|
4715 |
-
|
4716 |
-
|
4717 |
-
|
4718 |
-
|
4719 |
-
|
4720 |
-
|
4721 |
-
|
4722 |
-
|
4723 |
-
|
4724 |
-
|
4725 |
-
|
4726 |
-
|
4727 |
-
|
4728 |
-
|
4729 |
-
|
4730 |
-
|
4731 |
-
|
4732 |
-
|
4733 |
-
|
4734 |
-
|
4735 |
-
|
4736 |
-
|
4737 |
-
|
4738 |
-
|
4739 |
-
|
4740 |
-
|
4741 |
-
|
4742 |
-
|
4743 |
-
|
4744 |
-
|
4745 |
-
|
4746 |
-
|
4747 |
-
|
4748 |
-
|
4749 |
-
|
4750 |
-
|
4751 |
-
|
4752 |
-
|
4753 |
-
|
4754 |
-
|
4755 |
-
|
4756 |
-
|
4757 |
-
|
4758 |
-
|
4759 |
-
|
4760 |
-
|
4761 |
-
|
4762 |
-
|
4763 |
-
|
4764 |
-
|
4765 |
-
|
4766 |
-
|
4767 |
-
|
4768 |
-
|
4769 |
-
|
4770 |
-
|
4771 |
-
|
4772 |
-
|
4773 |
-
|
4774 |
-
|
4775 |
-
|
4776 |
-
|
4777 |
-
|
4778 |
-
|
4779 |
-
|
4780 |
-
|
4781 |
-
|
4782 |
-
|
4783 |
-
|
4784 |
-
|
4785 |
-
|
4786 |
-
|
4787 |
-
|
4788 |
-
|
4789 |
-
|
4790 |
-
|
4791 |
-
|
4792 |
-
|
4793 |
-
|
4794 |
-
|
4795 |
-
|
4796 |
-
|
4797 |
-
|
4798 |
-
|
4799 |
-
|
4800 |
-
|
4801 |
-
|
4802 |
-
|
4803 |
-
|
4804 |
-
|
4805 |
-
},
|
4806 |
-
|
4807 |
-
|
4808 |
-
|
4809 |
-
|
4810 |
-
|
4811 |
-
|
4812 |
-
|
4813 |
-
|
4814 |
-
|
4815 |
-
|
4816 |
-
|
4817 |
-
|
4818 |
-
|
4819 |
-
|
4820 |
-
|
4821 |
-
|
4822 |
-
|
4823 |
-
|
4824 |
-
|
4825 |
-
|
4826 |
-
|
4827 |
-
|
4828 |
-
|
4829 |
-
|
4830 |
-
|
4831 |
-
|
4832 |
-
|
4833 |
-
|
4834 |
-
|
4835 |
-
|
4836 |
-
|
4837 |
-
|
4838 |
-
|
4839 |
-
|
4840 |
-
|
4841 |
-
|
4842 |
-
|
4843 |
-
|
4844 |
-
|
4845 |
-
|
4846 |
-
|
4847 |
-
|
4848 |
-
|
4849 |
-
|
4850 |
-
|
4851 |
-
|
4852 |
-
|
4853 |
-
|
4854 |
-
|
4855 |
-
|
4856 |
-
|
4857 |
-
|
4858 |
-
|
4859 |
-
|
4860 |
-
|
4861 |
-
|
4862 |
-
|
4863 |
-
|
4864 |
-
|
4865 |
-
|
4866 |
-
|
4867 |
-
|
4868 |
-
|
4869 |
-
|
4870 |
-
|
4871 |
-
|
4872 |
-
|
4873 |
-
|
4874 |
-
|
4875 |
-
|
4876 |
-
|
4877 |
-
|
4878 |
-
|
4879 |
-
|
4880 |
-
|
4881 |
-
|
4882 |
-
|
4883 |
-
|
4884 |
-
|
4885 |
-
|
4886 |
-
|
4887 |
-
|
4888 |
-
|
4889 |
-
|
4890 |
-
|
4891 |
-
|
4892 |
-
|
4893 |
-
|
4894 |
-
|
4895 |
-
|
4896 |
-
|
4897 |
-
|
4898 |
-
|
4899 |
-
|
4900 |
-
|
4901 |
-
|
4902 |
-
|
4903 |
-
|
4904 |
-
|
4905 |
-
|
4906 |
-
|
4907 |
-
|
4908 |
-
|
4909 |
-
|
4910 |
-
|
4911 |
-
|
4912 |
-
|
4913 |
-
|
4914 |
-
|
4915 |
-
|
4916 |
-
|
4917 |
-
|
4918 |
-
|
4919 |
-
|
4920 |
-
|
4921 |
-
|
4922 |
-
|
4923 |
-
|
4924 |
-
|
4925 |
-
|
4926 |
-
|
4927 |
-
|
4928 |
-
|
4929 |
-
|
4930 |
-
|
4931 |
-
|
4932 |
-
|
4933 |
-
|
4934 |
-
|
4935 |
-
|
4936 |
-
|
4937 |
-
|
4938 |
-
|
4939 |
-
|
4940 |
-
|
4941 |
-
|
4942 |
-
|
4943 |
-
|
4944 |
-
|
4945 |
-
|
4946 |
-
|
4947 |
-
|
4948 |
-
|
4949 |
-
|
4950 |
-
|
4951 |
-
|
4952 |
-
|
4953 |
-
|
4954 |
-
|
4955 |
-
|
4956 |
-
|
4957 |
-
|
4958 |
-
|
4959 |
-
|
4960 |
-
|
4961 |
-
|
4962 |
-
|
4963 |
-
|
4964 |
-
|
4965 |
-
|
4966 |
-
|
4967 |
-
|
4968 |
-
|
4969 |
-
return
|
4970 |
-
|
4971 |
-
|
4972 |
-
|
4973 |
-
|
4974 |
-
|
4975 |
-
|
4976 |
-
|
4977 |
-
|
4978 |
-
|
4979 |
-
|
4980 |
-
|
4981 |
-
|
4982 |
-
|
4983 |
-
|
4984 |
-
|
4985 |
-
|
4986 |
-
}
|
4987 |
-
|
4988 |
-
|
4989 |
-
|
4990 |
-
|
4991 |
-
|
4992 |
-
|
4993 |
-
|
4994 |
-
}
|
4995 |
-
|
4996 |
-
|
4997 |
-
|
4998 |
-
|
4999 |
-
|
5000 |
-
}
|
5001 |
-
|
5002 |
-
|
5003 |
-
|
5004 |
-
}
|
5005 |
-
|
5006 |
-
|
5007 |
-
|
5008 |
-
|
5009 |
-
}
|
5010 |
-
|
5011 |
-
|
5012 |
-
|
5013 |
-
|
5014 |
-
|
5015 |
-
|
5016 |
-
|
5017 |
-
|
5018 |
-
|
5019 |
-
|
5020 |
-
|
5021 |
-
|
5022 |
-
|
5023 |
-
|
5024 |
-
|
5025 |
-
|
5026 |
-
|
5027 |
-
|
5028 |
-
|
5029 |
-
|
5030 |
-
|
5031 |
-
|
5032 |
-
|
5033 |
-
|
5034 |
-
|
5035 |
-
|
5036 |
-
|
5037 |
-
|
5038 |
-
|
5039 |
-
|
5040 |
-
|
5041 |
-
|
5042 |
-
|
5043 |
-
|
5044 |
-
|
5045 |
-
|
5046 |
-
|
5047 |
-
|
5048 |
-
|
5049 |
-
|
5050 |
-
|
5051 |
-
|
5052 |
-
|
5053 |
-
|
5054 |
-
|
5055 |
-
|
5056 |
-
|
5057 |
-
|
5058 |
-
|
5059 |
-
|
5060 |
-
}
|
5061 |
-
|
5062 |
-
|
5063 |
-
|
5064 |
-
|
5065 |
-
|
5066 |
-
|
5067 |
-
|
5068 |
-
|
5069 |
-
|
5070 |
-
|
5071 |
-
|
5072 |
-
|
5073 |
-
|
5074 |
-
|
5075 |
-
|
5076 |
-
|
5077 |
-
//
|
5078 |
-
|
5079 |
-
|
5080 |
-
|
5081 |
-
|
5082 |
-
|
5083 |
-
|
5084 |
-
|
5085 |
-
|
5086 |
-
|
5087 |
-
|
5088 |
-
|
5089 |
-
|
5090 |
-
|
5091 |
-
|
5092 |
-
|
5093 |
-
|
5094 |
-
|
5095 |
-
|
5096 |
-
|
5097 |
-
|
5098 |
-
|
5099 |
-
|
5100 |
-
|
5101 |
-
|
5102 |
-
|
5103 |
-
|
5104 |
-
|
5105 |
-
|
5106 |
-
|
5107 |
-
|
5108 |
-
|
5109 |
-
|
5110 |
-
|
5111 |
-
|
5112 |
-
|
5113 |
-
|
5114 |
-
|
5115 |
-
|
5116 |
-
|
5117 |
-
|
5118 |
-
|
5119 |
-
}
|
5120 |
-
}
|
5121 |
-
|
5122 |
-
|
5123 |
-
|
5124 |
-
|
5125 |
-
|
5126 |
-
|
5127 |
-
|
5128 |
-
|
5129 |
-
|
5130 |
-
|
5131 |
-
|
5132 |
-
|
5133 |
-
|
5134 |
-
|
5135 |
-
|
5136 |
-
|
5137 |
-
|
5138 |
-
|
5139 |
-
}
|
5140 |
-
|
5141 |
-
|
5142 |
-
|
5143 |
-
|
5144 |
-
|
5145 |
-
|
5146 |
-
|
5147 |
-
|
5148 |
-
|
5149 |
-
|
5150 |
-
|
5151 |
-
|
5152 |
-
|
5153 |
-
|
5154 |
-
|
5155 |
-
|
5156 |
-
|
5157 |
-
|
5158 |
-
|
5159 |
-
|
5160 |
-
|
5161 |
-
|
5162 |
-
|
5163 |
-
|
5164 |
-
|
5165 |
-
|
5166 |
-
|
5167 |
-
|
5168 |
-
|
5169 |
-
|
5170 |
-
|
5171 |
-
|
5172 |
-
|
5173 |
-
|
5174 |
-
|
5175 |
-
|
5176 |
-
|
5177 |
-
|
5178 |
-
|
5179 |
-
|
5180 |
-
|
5181 |
-
|
5182 |
-
|
5183 |
-
|
5184 |
-
|
5185 |
-
|
5186 |
-
|
5187 |
-
|
5188 |
-
|
5189 |
-
|
5190 |
-
|
5191 |
-
|
5192 |
-
|
5193 |
-
|
5194 |
-
|
5195 |
-
|
5196 |
-
|
5197 |
-
|
5198 |
-
|
5199 |
-
|
5200 |
-
|
5201 |
-
|
5202 |
-
|
5203 |
-
|
5204 |
-
|
5205 |
-
|
5206 |
-
|
5207 |
-
|
5208 |
-
|
5209 |
-
|
5210 |
-
|
5211 |
-
|
5212 |
-
|
5213 |
-
|
5214 |
-
|
5215 |
-
|
5216 |
-
|
5217 |
-
|
5218 |
-
|
5219 |
-
|
5220 |
-
|
5221 |
-
|
5222 |
-
|
5223 |
-
|
5224 |
-
|
5225 |
-
|
5226 |
-
|
5227 |
-
|
5228 |
-
|
5229 |
-
|
5230 |
-
|
5231 |
-
|
5232 |
-
|
5233 |
-
|
5234 |
-
|
5235 |
-
|
5236 |
-
|
5237 |
-
|
5238 |
-
|
5239 |
-
|
5240 |
-
|
5241 |
-
|
5242 |
-
|
5243 |
-
|
5244 |
-
|
5245 |
-
|
5246 |
-
|
5247 |
-
|
5248 |
-
|
5249 |
-
|
5250 |
-
|
5251 |
-
|
5252 |
-
|
5253 |
-
|
5254 |
-
|
5255 |
-
|
5256 |
-
|
5257 |
-
|
5258 |
-
|
5259 |
-
|
5260 |
-
|
5261 |
-
|
5262 |
-
|
5263 |
-
|
5264 |
-
|
5265 |
-
|
5266 |
-
|
5267 |
-
}
|
5268 |
-
|
5269 |
-
|
5270 |
-
|
5271 |
-
|
5272 |
-
|
5273 |
-
|
5274 |
-
|
5275 |
-
|
5276 |
-
|
5277 |
-
|
5278 |
-
|
5279 |
-
|
5280 |
-
|
5281 |
-
|
5282 |
-
|
5283 |
-
|
5284 |
-
|
5285 |
-
|
5286 |
-
|
5287 |
-
|
5288 |
-
|
5289 |
-
|
5290 |
-
|
5291 |
-
|
5292 |
-
|
5293 |
-
|
5294 |
-
|
5295 |
-
|
5296 |
-
|
5297 |
-
|
5298 |
-
|
5299 |
-
|
5300 |
-
|
5301 |
-
|
5302 |
-
|
5303 |
-
|
5304 |
-
|
5305 |
-
|
5306 |
-
|
5307 |
-
|
5308 |
-
|
5309 |
-
|
5310 |
-
|
5311 |
-
|
5312 |
-
|
5313 |
-
|
5314 |
-
|
5315 |
-
|
5316 |
-
|
5317 |
-
|
5318 |
-
return
|
5319 |
-
|
5320 |
-
|
5321 |
-
|
5322 |
-
//
|
5323 |
-
|
5324 |
-
|
5325 |
-
|
5326 |
-
|
5327 |
-
|
5328 |
-
|
5329 |
-
|
5330 |
-
|
5331 |
-
|
5332 |
-
|
5333 |
-
|
5334 |
-
|
5335 |
-
|
5336 |
-
|
5337 |
-
|
5338 |
-
|
5339 |
-
|
5340 |
-
|
5341 |
-
|
5342 |
-
|
5343 |
-
|
5344 |
-
//
|
5345 |
-
|
5346 |
-
|
5347 |
-
|
5348 |
-
|
5349 |
-
|
5350 |
-
|
5351 |
-
|
5352 |
-
|
5353 |
-
|
5354 |
-
|
5355 |
-
|
5356 |
-
|
5357 |
-
|
5358 |
-
|
5359 |
-
|
5360 |
-
|
5361 |
-
|
5362 |
-
|
5363 |
-
|
5364 |
-
|
5365 |
-
|
5366 |
-
|
5367 |
-
|
5368 |
-
|
5369 |
-
|
5370 |
-
|
5371 |
-
|
5372 |
-
|
5373 |
-
|
5374 |
-
|
5375 |
-
|
5376 |
-
|
5377 |
-
|
5378 |
-
|
5379 |
-
|
5380 |
-
|
5381 |
-
|
5382 |
-
|
5383 |
-
|
5384 |
-
|
5385 |
-
|
5386 |
-
|
5387 |
-
|
5388 |
-
|
5389 |
-
|
5390 |
-
|
5391 |
-
|
5392 |
-
|
5393 |
-
|
5394 |
-
|
5395 |
-
|
5396 |
-
|
5397 |
-
|
5398 |
-
|
5399 |
-
|
5400 |
-
|
5401 |
-
|
5402 |
-
|
5403 |
-
|
5404 |
-
|
5405 |
-
|
5406 |
-
|
5407 |
-
|
5408 |
-
|
5409 |
-
|
5410 |
-
|
5411 |
-
|
5412 |
-
|
5413 |
-
|
5414 |
-
|
5415 |
-
}
|
5416 |
-
|
5417 |
-
|
5418 |
-
|
5419 |
-
|
5420 |
-
|
5421 |
-
|
5422 |
-
|
5423 |
-
|
5424 |
-
|
5425 |
-
|
5426 |
-
|
5427 |
-
|
5428 |
-
|
5429 |
-
|
5430 |
-
|
5431 |
-
|
5432 |
-
|
5433 |
-
|
5434 |
-
|
5435 |
-
|
5436 |
-
|
5437 |
-
|
5438 |
-
|
5439 |
-
|
5440 |
-
|
5441 |
-
|
5442 |
-
|
5443 |
-
|
5444 |
-
|
5445 |
-
|
5446 |
-
|
5447 |
-
|
5448 |
-
|
5449 |
-
|
5450 |
-
|
5451 |
-
|
5452 |
-
|
5453 |
-
|
5454 |
-
|
5455 |
-
|
5456 |
-
|
5457 |
-
|
5458 |
-
|
5459 |
-
|
5460 |
-
|
5461 |
-
|
5462 |
-
|
5463 |
-
|
5464 |
-
|
5465 |
-
|
5466 |
-
|
5467 |
-
|
5468 |
-
|
5469 |
-
|
5470 |
-
|
5471 |
-
|
5472 |
-
|
5473 |
-
|
5474 |
-
|
5475 |
-
|
5476 |
-
|
5477 |
-
|
5478 |
-
|
5479 |
-
|
5480 |
-
|
5481 |
-
|
5482 |
-
|
5483 |
-
|
5484 |
-
|
5485 |
-
|
5486 |
-
|
5487 |
-
|
5488 |
-
|
5489 |
-
|
5490 |
-
|
5491 |
-
|
5492 |
-
|
5493 |
-
|
5494 |
-
|
5495 |
-
|
5496 |
-
|
5497 |
-
|
5498 |
-
|
5499 |
-
|
5500 |
-
|
5501 |
-
|
5502 |
-
|
5503 |
-
|
5504 |
-
|
5505 |
-
|
5506 |
-
|
5507 |
-
|
5508 |
-
|
5509 |
-
|
5510 |
-
|
5511 |
-
|
5512 |
-
|
5513 |
-
|
5514 |
-
|
5515 |
-
|
5516 |
-
|
5517 |
-
|
5518 |
-
|
5519 |
-
|
5520 |
-
|
5521 |
-
|
5522 |
-
|
5523 |
-
|
5524 |
-
|
5525 |
-
|
5526 |
-
|
5527 |
-
|
5528 |
-
|
5529 |
-
|
5530 |
-
|
5531 |
-
|
5532 |
-
|
5533 |
-
|
5534 |
-
|
5535 |
-
|
5536 |
-
|
5537 |
-
|
5538 |
-
|
5539 |
-
|
5540 |
-
|
5541 |
-
|
5542 |
-
|
5543 |
-
|
5544 |
-
|
5545 |
-
|
5546 |
-
|
5547 |
-
|
5548 |
-
|
5549 |
-
|
5550 |
-
|
5551 |
-
|
5552 |
-
|
5553 |
-
|
5554 |
-
|
5555 |
-
|
5556 |
-
|
5557 |
-
|
5558 |
-
|
5559 |
-
|
5560 |
-
|
5561 |
-
|
5562 |
-
|
5563 |
-
|
5564 |
-
|
5565 |
-
|
5566 |
-
|
5567 |
-
|
5568 |
-
|
5569 |
-
|
5570 |
-
|
5571 |
-
|
5572 |
-
|
5573 |
-
|
5574 |
-
|
5575 |
-
|
5576 |
-
|
5577 |
-
|
5578 |
-
|
5579 |
-
|
5580 |
-
|
5581 |
-
|
5582 |
-
return
|
5583 |
-
}
|
5584 |
-
|
5585 |
-
|
5586 |
-
|
5587 |
-
|
5588 |
-
|
5589 |
-
|
5590 |
-
|
5591 |
-
|
5592 |
-
|
5593 |
-
|
5594 |
-
|
5595 |
-
|
5596 |
-
|
5597 |
-
|
5598 |
-
|
5599 |
-
|
5600 |
-
|
5601 |
-
|
5602 |
-
|
5603 |
-
|
5604 |
-
|
5605 |
-
|
5606 |
-
|
5607 |
-
|
5608 |
-
|
5609 |
-
|
5610 |
-
|
5611 |
-
|
5612 |
-
|
5613 |
-
|
5614 |
-
|
5615 |
-
|
5616 |
-
|
5617 |
-
|
5618 |
-
|
5619 |
-
|
5620 |
-
|
5621 |
-
|
5622 |
-
|
5623 |
-
|
5624 |
-
jQuery(
|
5625 |
-
|
5626 |
-
|
5627 |
-
|
5628 |
-
|
5629 |
-
|
5630 |
-
|
5631 |
-
|
5632 |
-
|
5633 |
-
|
5634 |
-
|
5635 |
-
|
5636 |
-
|
5637 |
-
|
5638 |
-
|
5639 |
-
|
5640 |
-
|
5641 |
-
|
5642 |
-
|
5643 |
-
|
5644 |
-
|
5645 |
-
|
5646 |
-
|
5647 |
-
|
5648 |
-
|
5649 |
-
|
5650 |
-
|
5651 |
-
|
5652 |
-
|
5653 |
-
|
5654 |
-
|
5655 |
-
|
5656 |
-
|
5657 |
-
|
5658 |
-
|
5659 |
-
|
5660 |
-
|
5661 |
-
|
5662 |
-
|
5663 |
-
|
5664 |
-
jQuery(
|
5665 |
-
|
5666 |
-
|
5667 |
-
|
5668 |
-
return
|
5669 |
-
},
|
5670 |
-
|
5671 |
-
|
5672 |
-
|
5673 |
-
|
5674 |
-
|
5675 |
-
|
5676 |
-
|
5677 |
-
|
5678 |
-
|
5679 |
-
|
5680 |
-
|
5681 |
-
|
5682 |
-
|
5683 |
-
|
5684 |
-
|
5685 |
-
|
5686 |
-
|
5687 |
-
|
5688 |
-
|
5689 |
-
|
5690 |
-
|
5691 |
-
|
5692 |
-
|
5693 |
-
|
5694 |
-
|
5695 |
-
|
5696 |
-
|
5697 |
-
|
5698 |
-
|
5699 |
-
|
5700 |
-
|
5701 |
-
|
5702 |
-
|
5703 |
-
|
5704 |
-
|
5705 |
-
|
5706 |
-
|
5707 |
-
|
5708 |
-
|
5709 |
-
|
5710 |
-
|
5711 |
-
|
5712 |
-
|
5713 |
-
|
5714 |
-
|
5715 |
-
|
5716 |
-
|
5717 |
-
|
5718 |
-
|
5719 |
-
|
5720 |
-
|
5721 |
-
|
5722 |
-
|
5723 |
-
|
5724 |
-
|
5725 |
-
|
5726 |
-
|
5727 |
-
|
5728 |
-
|
5729 |
-
|
5730 |
-
|
5731 |
-
|
5732 |
-
|
5733 |
-
|
5734 |
-
|
5735 |
-
|
5736 |
-
|
5737 |
-
|
5738 |
-
|
5739 |
-
|
5740 |
-
|
5741 |
-
|
5742 |
-
|
5743 |
-
|
5744 |
-
|
5745 |
-
|
5746 |
-
|
5747 |
-
|
5748 |
-
|
5749 |
-
|
5750 |
-
|
5751 |
-
|
5752 |
-
|
5753 |
-
|
5754 |
-
|
5755 |
-
|
5756 |
-
|
5757 |
-
|
5758 |
-
|
5759 |
-
|
5760 |
-
|
5761 |
-
|
5762 |
-
|
5763 |
-
|
5764 |
-
|
5765 |
-
|
5766 |
-
|
5767 |
-
|
5768 |
-
|
5769 |
-
|
5770 |
-
|
5771 |
-
|
5772 |
-
|
5773 |
-
|
5774 |
-
|
5775 |
-
|
5776 |
-
|
5777 |
-
|
5778 |
-
|
5779 |
-
|
5780 |
-
|
5781 |
-
|
5782 |
-
|
5783 |
-
|
5784 |
-
|
5785 |
-
|
5786 |
-
|
5787 |
-
|
5788 |
-
|
5789 |
-
|
5790 |
-
|
5791 |
-
|
5792 |
-
|
5793 |
-
|
5794 |
-
|
5795 |
-
|
5796 |
-
|
5797 |
-
|
5798 |
-
|
5799 |
-
|
5800 |
-
|
5801 |
-
|
5802 |
-
|
5803 |
-
|
5804 |
-
|
5805 |
-
|
5806 |
-
|
5807 |
-
|
5808 |
-
|
5809 |
-
|
5810 |
-
|
5811 |
-
|
5812 |
-
|
5813 |
-
|
5814 |
-
|
5815 |
-
|
5816 |
-
|
5817 |
-
|
5818 |
-
|
5819 |
-
|
5820 |
-
|
5821 |
-
|
5822 |
-
|
5823 |
-
|
5824 |
-
|
5825 |
-
|
5826 |
-
|
5827 |
-
|
5828 |
-
|
5829 |
-
|
5830 |
-
|
5831 |
-
|
5832 |
-
|
5833 |
-
|
5834 |
-
|
5835 |
-
|
5836 |
-
|
5837 |
-
|
5838 |
-
|
5839 |
-
|
5840 |
-
|
5841 |
-
|
5842 |
-
|
5843 |
-
|
5844 |
-
|
5845 |
-
|
5846 |
-
|
5847 |
-
|
5848 |
-
|
5849 |
-
|
5850 |
-
|
5851 |
-
|
5852 |
-
|
5853 |
-
|
5854 |
-
|
5855 |
-
|
5856 |
-
|
5857 |
-
|
5858 |
-
|
5859 |
-
|
5860 |
-
|
5861 |
-
|
5862 |
-
|
5863 |
-
//
|
5864 |
-
//
|
5865 |
-
|
5866 |
-
|
5867 |
-
|
5868 |
-
|
5869 |
-
|
5870 |
-
|
5871 |
-
|
5872 |
-
|
5873 |
-
|
5874 |
-
|
5875 |
-
|
5876 |
-
|
5877 |
-
|
5878 |
-
|
5879 |
-
|
5880 |
-
|
5881 |
-
|
5882 |
-
|
5883 |
-
|
5884 |
-
|
5885 |
-
|
5886 |
-
|
5887 |
-
|
5888 |
-
|
5889 |
-
|
5890 |
-
|
5891 |
-
|
5892 |
-
|
5893 |
-
|
5894 |
-
|
5895 |
-
|
5896 |
-
|
5897 |
-
|
5898 |
-
|
5899 |
-
|
5900 |
-
|
5901 |
-
|
5902 |
-
|
5903 |
-
|
5904 |
-
|
5905 |
-
|
5906 |
-
|
5907 |
-
}
|
5908 |
-
|
5909 |
-
|
5910 |
-
|
5911 |
-
|
5912 |
-
|
5913 |
-
|
5914 |
-
|
5915 |
-
jQuery
|
5916 |
-
}
|
5917 |
-
}
|
5918 |
-
|
5919 |
-
|
5920 |
-
|
5921 |
-
|
5922 |
-
|
5923 |
-
|
5924 |
-
|
5925 |
-
|
5926 |
-
|
5927 |
-
|
5928 |
-
|
5929 |
-
|
5930 |
-
|
5931 |
-
|
5932 |
-
|
5933 |
-
|
5934 |
-
|
5935 |
-
|
5936 |
-
|
5937 |
-
|
5938 |
-
|
5939 |
-
|
5940 |
-
|
5941 |
-
|
5942 |
-
|
5943 |
-
|
5944 |
-
|
5945 |
-
|
5946 |
-
|
5947 |
-
|
5948 |
-
|
5949 |
-
|
5950 |
-
|
5951 |
-
|
5952 |
-
|
5953 |
-
|
5954 |
-
|
5955 |
-
|
5956 |
-
|
5957 |
-
|
5958 |
-
|
5959 |
-
|
5960 |
-
|
5961 |
-
|
5962 |
-
|
5963 |
-
|
5964 |
-
|
5965 |
-
|
5966 |
-
|
5967 |
-
|
5968 |
-
|
5969 |
-
|
5970 |
-
|
5971 |
-
|
5972 |
-
|
5973 |
-
|
5974 |
-
|
5975 |
-
|
5976 |
-
|
5977 |
-
|
5978 |
-
|
5979 |
-
|
5980 |
-
|
5981 |
-
|
5982 |
-
|
5983 |
-
|
5984 |
-
|
5985 |
-
|
5986 |
-
|
5987 |
-
|
5988 |
-
|
5989 |
-
|
5990 |
-
|
5991 |
-
|
5992 |
-
|
5993 |
-
|
5994 |
-
|
5995 |
-
|
5996 |
-
|
5997 |
-
|
5998 |
-
|
5999 |
-
|
6000 |
-
|
6001 |
-
|
6002 |
-
|
6003 |
-
|
6004 |
-
|
6005 |
-
|
6006 |
-
|
6007 |
-
|
6008 |
-
|
6009 |
-
|
6010 |
-
|
6011 |
-
|
6012 |
-
|
6013 |
-
|
6014 |
-
|
6015 |
-
|
6016 |
-
|
6017 |
-
|
6018 |
-
|
6019 |
-
|
6020 |
-
|
6021 |
-
|
6022 |
-
|
6023 |
-
|
6024 |
-
|
6025 |
-
|
6026 |
-
|
6027 |
-
|
6028 |
-
|
6029 |
-
|
6030 |
-
|
6031 |
-
|
6032 |
-
|
6033 |
-
|
6034 |
-
|
6035 |
-
|
6036 |
-
|
6037 |
-
|
6038 |
-
|
6039 |
-
|
6040 |
-
|
6041 |
-
|
6042 |
-
|
6043 |
-
|
6044 |
-
|
6045 |
-
|
6046 |
-
|
6047 |
-
|
6048 |
-
|
6049 |
-
|
6050 |
-
|
6051 |
-
|
6052 |
-
|
6053 |
-
|
6054 |
-
|
6055 |
-
|
6056 |
-
|
6057 |
-
|
6058 |
-
|
6059 |
-
|
6060 |
-
|
6061 |
-
|
6062 |
-
|
6063 |
-
|
6064 |
-
|
6065 |
-
|
6066 |
-
|
6067 |
-
|
6068 |
-
|
6069 |
-
|
6070 |
-
|
6071 |
-
|
6072 |
-
|
6073 |
-
|
6074 |
-
|
6075 |
-
|
6076 |
-
|
6077 |
-
|
6078 |
-
|
6079 |
-
|
6080 |
-
|
6081 |
-
|
6082 |
-
|
6083 |
-
|
6084 |
-
|
6085 |
-
|
6086 |
-
|
6087 |
-
|
6088 |
-
|
6089 |
-
|
6090 |
-
|
6091 |
-
|
6092 |
-
|
6093 |
-
|
6094 |
-
|
6095 |
-
|
6096 |
-
|
6097 |
-
|
6098 |
-
|
6099 |
-
|
6100 |
-
|
6101 |
-
|
6102 |
-
|
6103 |
-
|
6104 |
-
|
6105 |
-
|
6106 |
-
|
6107 |
-
|
6108 |
-
|
6109 |
-
|
6110 |
-
|
6111 |
-
|
6112 |
-
|
6113 |
-
|
6114 |
-
|
6115 |
-
|
6116 |
-
|
6117 |
-
|
6118 |
-
|
6119 |
-
|
6120 |
-
|
6121 |
-
|
6122 |
-
|
6123 |
-
|
6124 |
-
|
6125 |
-
|
6126 |
-
|
6127 |
-
|
6128 |
-
|
6129 |
-
|
6130 |
-
|
6131 |
-
|
6132 |
-
|
6133 |
-
|
6134 |
-
|
6135 |
-
|
6136 |
-
|
6137 |
-
|
6138 |
-
|
6139 |
-
|
6140 |
-
|
6141 |
-
|
6142 |
-
|
6143 |
-
|
6144 |
-
|
6145 |
-
|
6146 |
-
|
6147 |
-
|
6148 |
-
|
6149 |
-
|
6150 |
-
|
6151 |
-
|
6152 |
-
|
6153 |
-
|
6154 |
-
|
6155 |
-
|
6156 |
-
|
6157 |
-
|
6158 |
-
|
6159 |
-
|
6160 |
-
|
6161 |
-
|
6162 |
-
|
6163 |
-
|
6164 |
-
|
6165 |
-
|
6166 |
-
|
6167 |
-
|
6168 |
-
|
6169 |
-
|
6170 |
-
|
6171 |
-
|
6172 |
-
|
6173 |
-
|
6174 |
-
|
6175 |
-
|
6176 |
-
|
6177 |
-
|
6178 |
-
|
6179 |
-
|
6180 |
-
|
6181 |
-
|
6182 |
-
|
6183 |
-
|
6184 |
-
|
6185 |
-
|
6186 |
-
|
6187 |
-
|
6188 |
-
|
6189 |
-
|
6190 |
-
|
6191 |
-
|
6192 |
-
|
6193 |
-
|
6194 |
-
|
6195 |
-
|
6196 |
-
|
6197 |
-
|
6198 |
-
|
6199 |
-
|
6200 |
-
}
|
6201 |
-
|
6202 |
-
|
6203 |
-
|
6204 |
-
}
|
6205 |
-
|
6206 |
-
//
|
6207 |
-
|
6208 |
-
|
6209 |
-
|
6210 |
-
|
6211 |
-
|
6212 |
-
|
6213 |
-
|
6214 |
-
|
6215 |
-
|
6216 |
-
|
6217 |
-
|
6218 |
-
|
6219 |
-
|
6220 |
-
|
6221 |
-
|
6222 |
-
|
6223 |
-
|
6224 |
-
|
6225 |
-
|
6226 |
-
|
6227 |
-
|
6228 |
-
|
6229 |
-
|
6230 |
-
|
6231 |
-
|
6232 |
-
|
6233 |
-
|
6234 |
-
|
6235 |
-
|
6236 |
-
|
6237 |
-
|
6238 |
-
|
6239 |
-
|
6240 |
-
|
6241 |
-
|
6242 |
-
|
6243 |
-
|
6244 |
-
|
6245 |
-
|
6246 |
-
|
6247 |
-
|
6248 |
-
|
6249 |
-
|
6250 |
-
|
6251 |
-
|
6252 |
-
|
6253 |
-
|
6254 |
-
|
6255 |
-
|
6256 |
-
|
6257 |
-
|
6258 |
-
|
6259 |
-
|
6260 |
-
|
6261 |
-
|
6262 |
-
|
6263 |
-
|
6264 |
-
|
6265 |
-
|
6266 |
-
|
6267 |
-
|
6268 |
-
|
6269 |
-
|
6270 |
-
|
6271 |
-
|
6272 |
-
|
6273 |
-
|
6274 |
-
|
6275 |
-
|
6276 |
-
|
6277 |
-
|
6278 |
-
|
6279 |
-
|
6280 |
-
|
6281 |
-
|
6282 |
-
|
6283 |
-
|
6284 |
-
|
6285 |
-
|
6286 |
-
|
6287 |
-
|
6288 |
-
|
6289 |
-
|
6290 |
-
|
6291 |
-
|
6292 |
-
|
6293 |
-
|
6294 |
-
|
6295 |
-
|
6296 |
-
|
6297 |
-
|
6298 |
-
|
6299 |
-
|
6300 |
-
|
6301 |
-
|
6302 |
-
|
6303 |
-
|
6304 |
-
|
6305 |
-
|
6306 |
-
|
6307 |
-
|
6308 |
-
|
6309 |
-
|
6310 |
-
|
6311 |
-
|
6312 |
-
|
6313 |
-
|
6314 |
-
|
6315 |
-
|
6316 |
-
|
6317 |
-
|
6318 |
-
|
6319 |
-
|
6320 |
-
|
6321 |
-
|
6322 |
-
|
6323 |
-
|
6324 |
-
|
6325 |
-
|
6326 |
-
|
6327 |
-
|
6328 |
-
|
6329 |
-
|
6330 |
-
|
6331 |
-
|
6332 |
-
}
|
6333 |
-
|
6334 |
-
|
6335 |
-
|
6336 |
-
|
6337 |
-
|
6338 |
-
|
6339 |
-
|
6340 |
-
|
6341 |
-
|
6342 |
-
|
6343 |
-
|
6344 |
-
|
6345 |
-
|
6346 |
-
|
6347 |
-
|
6348 |
-
|
6349 |
-
|
6350 |
-
|
6351 |
-
|
6352 |
-
|
6353 |
-
|
6354 |
-
|
6355 |
-
|
6356 |
-
|
6357 |
-
|
6358 |
-
|
6359 |
-
if (
|
6360 |
-
|
6361 |
-
|
6362 |
-
|
6363 |
-
|
6364 |
-
|
6365 |
-
|
6366 |
-
}
|
6367 |
-
|
6368 |
-
|
6369 |
-
|
6370 |
-
|
6371 |
-
|
6372 |
-
|
6373 |
-
|
6374 |
-
|
6375 |
-
function
|
6376 |
-
|
6377 |
-
|
6378 |
-
}
|
6379 |
-
|
6380 |
-
|
6381 |
-
|
6382 |
-
|
6383 |
-
|
6384 |
-
|
6385 |
-
|
6386 |
-
|
6387 |
-
|
6388 |
-
|
6389 |
-
//
|
6390 |
-
|
6391 |
-
|
6392 |
-
|
6393 |
-
|
6394 |
-
|
6395 |
-
|
6396 |
-
|
6397 |
-
|
6398 |
-
|
6399 |
-
|
6400 |
-
|
6401 |
-
|
6402 |
-
|
6403 |
-
|
6404 |
-
|
6405 |
-
|
6406 |
-
|
6407 |
-
|
6408 |
-
|
6409 |
-
|
6410 |
-
|
6411 |
-
|
6412 |
-
|
6413 |
-
|
6414 |
-
|
6415 |
-
|
6416 |
-
|
6417 |
-
|
6418 |
-
|
6419 |
-
|
6420 |
-
|
6421 |
-
|
6422 |
-
|
6423 |
-
|
6424 |
-
|
6425 |
-
|
6426 |
-
|
6427 |
-
|
6428 |
-
|
6429 |
-
|
6430 |
-
|
6431 |
-
|
6432 |
-
|
6433 |
-
|
6434 |
-
|
6435 |
-
|
6436 |
-
|
6437 |
-
|
6438 |
-
|
6439 |
-
|
6440 |
-
|
6441 |
-
|
6442 |
-
|
6443 |
-
|
6444 |
-
|
6445 |
-
|
6446 |
-
|
6447 |
-
|
6448 |
-
|
6449 |
-
|
6450 |
-
|
6451 |
-
|
6452 |
-
|
6453 |
-
|
6454 |
-
|
6455 |
-
|
6456 |
-
|
6457 |
-
|
6458 |
-
|
6459 |
-
|
6460 |
-
|
6461 |
-
|
6462 |
-
|
6463 |
-
|
6464 |
-
|
6465 |
-
|
6466 |
-
|
6467 |
-
|
6468 |
-
|
6469 |
-
|
6470 |
-
|
6471 |
-
|
6472 |
-
|
6473 |
-
|
6474 |
-
|
6475 |
-
|
6476 |
-
|
6477 |
-
|
6478 |
-
|
6479 |
-
|
6480 |
-
|
6481 |
-
|
6482 |
-
|
6483 |
-
|
6484 |
-
|
6485 |
-
|
6486 |
-
|
6487 |
-
|
6488 |
-
|
6489 |
-
|
6490 |
-
|
6491 |
-
|
6492 |
-
|
6493 |
-
|
6494 |
-
|
6495 |
-
|
6496 |
-
|
6497 |
-
|
6498 |
-
|
6499 |
-
|
6500 |
-
|
6501 |
-
|
6502 |
-
|
6503 |
-
|
6504 |
-
|
6505 |
-
|
6506 |
-
|
6507 |
-
|
6508 |
-
|
6509 |
-
|
6510 |
-
|
6511 |
-
|
6512 |
-
|
6513 |
-
|
6514 |
-
|
6515 |
-
|
6516 |
-
|
6517 |
-
|
6518 |
-
|
6519 |
-
|
6520 |
-
|
6521 |
-
|
6522 |
-
|
6523 |
-
|
6524 |
-
|
6525 |
-
|
6526 |
-
|
6527 |
-
|
6528 |
-
|
6529 |
-
|
6530 |
-
|
6531 |
-
|
6532 |
-
|
6533 |
-
|
6534 |
-
|
6535 |
-
|
6536 |
-
|
6537 |
-
|
6538 |
-
|
6539 |
-
|
6540 |
-
|
6541 |
-
|
6542 |
-
|
6543 |
-
|
6544 |
-
|
6545 |
-
|
6546 |
-
|
6547 |
-
|
6548 |
-
|
6549 |
-
|
6550 |
-
|
6551 |
-
|
6552 |
-
|
6553 |
-
|
6554 |
-
|
6555 |
-
|
6556 |
-
|
6557 |
-
|
6558 |
-
|
6559 |
-
|
6560 |
-
|
6561 |
-
|
6562 |
-
|
6563 |
-
|
6564 |
-
|
6565 |
-
|
6566 |
-
|
6567 |
-
|
6568 |
-
|
6569 |
-
|
6570 |
-
|
6571 |
-
|
6572 |
-
|
6573 |
-
|
6574 |
-
|
6575 |
-
|
6576 |
-
|
6577 |
-
|
6578 |
-
|
6579 |
-
|
6580 |
-
|
6581 |
-
|
6582 |
-
|
6583 |
-
|
6584 |
-
|
6585 |
-
|
6586 |
-
|
6587 |
-
|
6588 |
-
|
6589 |
-
|
6590 |
-
|
6591 |
-
|
6592 |
-
|
6593 |
-
|
6594 |
-
|
6595 |
-
|
6596 |
-
|
6597 |
-
|
6598 |
-
|
6599 |
-
|
6600 |
-
|
6601 |
-
|
6602 |
-
|
6603 |
-
|
6604 |
-
|
6605 |
-
|
6606 |
-
|
6607 |
-
|
6608 |
-
|
6609 |
-
|
6610 |
-
|
6611 |
-
|
6612 |
-
|
6613 |
-
|
6614 |
-
|
6615 |
-
|
6616 |
-
}
|
6617 |
-
|
6618 |
-
|
6619 |
-
|
6620 |
-
|
6621 |
-
|
6622 |
-
|
6623 |
-
|
6624 |
-
|
6625 |
-
|
6626 |
-
|
6627 |
-
|
6628 |
-
|
6629 |
-
|
6630 |
-
|
6631 |
-
|
6632 |
-
|
6633 |
-
|
6634 |
-
|
6635 |
-
|
6636 |
-
|
6637 |
-
|
6638 |
-
|
6639 |
-
|
6640 |
-
|
6641 |
-
|
6642 |
-
|
6643 |
-
|
6644 |
-
|
6645 |
-
|
6646 |
-
|
6647 |
-
|
6648 |
-
|
6649 |
-
|
6650 |
-
|
6651 |
-
|
6652 |
-
|
6653 |
-
|
6654 |
-
|
6655 |
-
|
6656 |
-
|
6657 |
-
|
6658 |
-
|
6659 |
-
|
6660 |
-
|
6661 |
-
|
6662 |
-
|
6663 |
-
|
6664 |
-
|
6665 |
-
|
6666 |
-
|
6667 |
-
|
6668 |
-
|
6669 |
-
|
6670 |
-
|
6671 |
-
|
6672 |
-
|
6673 |
-
|
6674 |
-
|
6675 |
-
|
6676 |
-
|
6677 |
-
|
6678 |
-
|
6679 |
-
}
|
6680 |
-
|
6681 |
-
|
6682 |
-
|
6683 |
-
|
6684 |
-
|
6685 |
-
|
6686 |
-
|
6687 |
-
|
6688 |
-
|
6689 |
-
|
6690 |
-
|
6691 |
-
|
6692 |
-
|
6693 |
-
|
6694 |
-
|
6695 |
-
|
6696 |
-
|
6697 |
-
|
6698 |
-
|
6699 |
-
|
6700 |
-
|
6701 |
-
|
6702 |
-
|
6703 |
-
|
6704 |
-
|
6705 |
-
|
6706 |
-
|
6707 |
-
|
6708 |
-
|
6709 |
-
|
6710 |
-
|
6711 |
-
|
6712 |
-
|
6713 |
-
|
6714 |
-
|
6715 |
-
|
6716 |
-
|
6717 |
-
|
6718 |
-
|
6719 |
-
|
6720 |
-
|
6721 |
-
|
6722 |
-
|
6723 |
-
|
6724 |
-
|
6725 |
-
|
6726 |
-
|
6727 |
-
|
6728 |
-
|
6729 |
-
|
6730 |
-
|
6731 |
-
|
6732 |
-
|
6733 |
-
|
6734 |
-
|
6735 |
-
|
6736 |
-
|
6737 |
-
|
6738 |
-
|
6739 |
-
|
6740 |
-
|
6741 |
-
|
6742 |
-
|
6743 |
-
|
6744 |
-
|
6745 |
-
|
6746 |
-
|
6747 |
-
|
6748 |
-
|
6749 |
-
|
6750 |
-
|
6751 |
-
|
6752 |
-
|
6753 |
-
|
6754 |
-
|
6755 |
-
|
6756 |
-
|
6757 |
-
|
6758 |
-
|
6759 |
-
|
6760 |
-
|
6761 |
-
|
6762 |
-
|
6763 |
-
|
6764 |
-
|
6765 |
-
|
6766 |
-
|
6767 |
-
|
6768 |
-
|
6769 |
-
|
6770 |
-
|
6771 |
-
|
6772 |
-
|
6773 |
-
|
6774 |
-
|
6775 |
-
}
|
6776 |
-
}
|
6777 |
-
|
6778 |
-
|
6779 |
-
|
6780 |
-
|
6781 |
-
|
6782 |
-
|
6783 |
-
|
6784 |
-
|
6785 |
-
|
6786 |
-
|
6787 |
-
|
6788 |
-
|
6789 |
-
|
6790 |
-
|
6791 |
-
|
6792 |
-
|
6793 |
-
|
6794 |
-
|
6795 |
-
|
6796 |
-
|
6797 |
-
|
6798 |
-
|
6799 |
-
|
6800 |
-
|
6801 |
-
|
6802 |
-
|
6803 |
-
|
6804 |
-
|
6805 |
-
|
6806 |
-
|
6807 |
-
|
6808 |
-
|
6809 |
-
|
6810 |
-
|
6811 |
-
|
6812 |
-
|
6813 |
-
|
6814 |
-
|
6815 |
-
|
6816 |
-
|
6817 |
-
|
6818 |
-
|
6819 |
-
|
6820 |
-
|
6821 |
-
|
6822 |
-
|
6823 |
-
|
6824 |
-
|
6825 |
-
|
6826 |
-
|
6827 |
-
|
6828 |
-
|
6829 |
-
|
6830 |
-
|
6831 |
-
|
6832 |
-
|
6833 |
-
|
6834 |
-
|
6835 |
-
|
6836 |
-
|
6837 |
-
|
6838 |
-
|
6839 |
-
|
6840 |
-
|
6841 |
-
|
6842 |
-
|
6843 |
-
|
6844 |
-
|
6845 |
-
|
6846 |
-
|
6847 |
-
|
6848 |
-
|
6849 |
-
|
6850 |
-
|
6851 |
-
|
6852 |
-
|
6853 |
-
}
|
6854 |
-
|
6855 |
-
|
6856 |
-
|
6857 |
-
|
6858 |
-
|
6859 |
-
|
6860 |
-
|
6861 |
-
|
6862 |
-
|
6863 |
-
|
6864 |
-
|
6865 |
-
|
6866 |
-
|
6867 |
-
|
6868 |
-
|
6869 |
-
|
6870 |
-
|
6871 |
-
|
6872 |
-
|
6873 |
-
|
6874 |
-
|
6875 |
-
|
6876 |
-
|
6877 |
-
|
6878 |
-
|
6879 |
-
|
6880 |
-
|
6881 |
-
|
6882 |
-
|
6883 |
-
|
6884 |
-
|
6885 |
-
|
6886 |
-
|
6887 |
-
|
6888 |
-
|
6889 |
-
|
6890 |
-
|
6891 |
-
|
6892 |
-
|
6893 |
-
|
6894 |
-
|
6895 |
-
|
6896 |
-
|
6897 |
-
|
6898 |
-
|
6899 |
-
|
6900 |
-
|
6901 |
-
|
6902 |
-
|
6903 |
-
|
6904 |
-
|
6905 |
-
|
6906 |
-
|
6907 |
-
|
6908 |
-
|
6909 |
-
|
6910 |
-
|
6911 |
-
|
6912 |
-
|
6913 |
-
|
6914 |
-
|
6915 |
-
|
6916 |
-
|
6917 |
-
|
6918 |
-
|
6919 |
-
|
6920 |
-
|
6921 |
-
|
6922 |
-
//
|
6923 |
-
|
6924 |
-
|
6925 |
-
|
6926 |
-
|
6927 |
-
|
6928 |
-
|
6929 |
-
|
6930 |
-
|
6931 |
-
|
6932 |
-
|
6933 |
-
|
6934 |
-
|
6935 |
-
|
6936 |
-
|
6937 |
-
|
6938 |
-
|
6939 |
-
|
6940 |
-
|
6941 |
-
|
6942 |
-
|
6943 |
-
|
6944 |
-
|
6945 |
-
|
6946 |
-
|
6947 |
-
|
6948 |
-
|
6949 |
-
|
6950 |
-
|
6951 |
-
|
6952 |
-
|
6953 |
-
|
6954 |
-
|
6955 |
-
|
6956 |
-
|
6957 |
-
|
6958 |
-
|
6959 |
-
|
6960 |
-
|
6961 |
-
|
6962 |
-
|
6963 |
-
|
6964 |
-
|
6965 |
-
|
6966 |
-
|
6967 |
-
|
6968 |
-
|
6969 |
-
|
6970 |
-
|
6971 |
-
|
6972 |
-
|
6973 |
-
|
6974 |
-
|
6975 |
-
|
6976 |
-
|
6977 |
-
|
6978 |
-
|
6979 |
-
|
6980 |
-
|
6981 |
-
|
6982 |
-
|
6983 |
-
|
6984 |
-
|
6985 |
-
|
6986 |
-
|
6987 |
-
|
6988 |
-
|
6989 |
-
|
6990 |
-
|
6991 |
-
|
6992 |
-
|
6993 |
-
|
6994 |
-
|
6995 |
-
|
6996 |
-
|
6997 |
-
|
6998 |
-
|
6999 |
-
|
7000 |
-
|
7001 |
-
|
7002 |
-
|
7003 |
-
|
7004 |
-
|
7005 |
-
|
7006 |
-
|
7007 |
-
|
7008 |
-
|
7009 |
-
|
7010 |
-
|
7011 |
-
|
7012 |
-
|
7013 |
-
|
7014 |
-
|
7015 |
-
|
7016 |
-
|
7017 |
-
|
7018 |
-
|
7019 |
-
|
7020 |
-
|
7021 |
-
|
7022 |
-
|
7023 |
-
|
7024 |
-
|
7025 |
-
|
7026 |
-
|
7027 |
-
|
7028 |
-
//
|
7029 |
-
|
7030 |
-
|
7031 |
-
|
7032 |
-
|
7033 |
-
|
7034 |
-
|
7035 |
-
if (
|
7036 |
-
|
7037 |
-
}
|
7038 |
-
|
7039 |
-
|
7040 |
-
|
7041 |
-
|
7042 |
-
|
7043 |
-
|
7044 |
-
|
7045 |
-
|
7046 |
-
|
7047 |
-
|
7048 |
-
|
7049 |
-
|
7050 |
-
|
7051 |
-
|
7052 |
-
|
7053 |
-
|
7054 |
-
|
7055 |
-
|
7056 |
-
|
7057 |
-
|
7058 |
-
|
7059 |
-
|
7060 |
-
|
7061 |
-
|
7062 |
-
|
7063 |
-
function
|
7064 |
-
|
7065 |
-
|
7066 |
-
|
7067 |
-
|
7068 |
-
|
7069 |
-
|
7070 |
-
|
7071 |
-
|
7072 |
-
|
7073 |
-
|
7074 |
-
|
7075 |
-
|
7076 |
-
|
7077 |
-
|
7078 |
-
|
7079 |
-
|
7080 |
-
|
7081 |
-
|
7082 |
-
|
7083 |
-
|
7084 |
-
|
7085 |
-
|
7086 |
-
|
7087 |
-
|
7088 |
-
|
7089 |
-
|
7090 |
-
|
7091 |
-
|
7092 |
-
}
|
7093 |
-
|
7094 |
-
|
7095 |
-
|
7096 |
-
|
7097 |
-
|
7098 |
-
|
7099 |
-
|
7100 |
-
|
7101 |
-
|
7102 |
-
|
7103 |
-
)
|
7104 |
-
|
7105 |
-
|
7106 |
-
//
|
7107 |
-
|
7108 |
-
|
7109 |
-
|
7110 |
-
|
7111 |
-
|
7112 |
-
|
7113 |
-
|
7114 |
-
|
7115 |
-
|
7116 |
-
|
7117 |
-
|
7118 |
-
|
7119 |
-
|
7120 |
-
|
7121 |
-
|
7122 |
-
|
7123 |
-
|
7124 |
-
|
7125 |
-
|
7126 |
-
|
7127 |
-
|
7128 |
-
|
7129 |
-
|
7130 |
-
|
7131 |
-
|
7132 |
-
|
7133 |
-
|
7134 |
-
|
7135 |
-
|
7136 |
-
|
7137 |
-
|
7138 |
-
|
7139 |
-
|
7140 |
-
|
7141 |
-
|
7142 |
-
|
7143 |
-
|
7144 |
-
|
7145 |
-
|
7146 |
-
|
7147 |
-
|
7148 |
-
|
7149 |
-
|
7150 |
-
|
7151 |
-
|
7152 |
-
|
7153 |
-
|
7154 |
-
|
7155 |
-
|
7156 |
-
|
7157 |
-
|
7158 |
-
|
7159 |
-
|
7160 |
-
|
7161 |
-
|
7162 |
-
|
7163 |
-
|
7164 |
-
|
7165 |
-
|
7166 |
-
|
7167 |
-
|
7168 |
-
|
7169 |
-
|
7170 |
-
|
7171 |
-
|
7172 |
-
|
7173 |
-
|
7174 |
-
|
7175 |
-
|
7176 |
-
|
7177 |
-
|
7178 |
-
|
7179 |
-
|
7180 |
-
|
7181 |
-
|
7182 |
-
|
7183 |
-
|
7184 |
-
|
7185 |
-
|
7186 |
-
|
7187 |
-
|
7188 |
-
|
7189 |
-
|
7190 |
-
|
7191 |
-
|
7192 |
-
|
7193 |
-
|
7194 |
-
|
7195 |
-
|
7196 |
-
|
7197 |
-
|
7198 |
-
|
7199 |
-
|
7200 |
-
|
7201 |
-
|
7202 |
-
|
7203 |
-
|
7204 |
-
|
7205 |
-
|
7206 |
-
|
7207 |
-
|
7208 |
-
|
7209 |
-
|
7210 |
-
|
7211 |
-
|
7212 |
-
|
7213 |
-
|
7214 |
-
|
7215 |
-
|
7216 |
-
|
7217 |
-
|
7218 |
-
|
7219 |
-
|
7220 |
-
|
7221 |
-
|
7222 |
-
|
7223 |
-
|
7224 |
-
|
7225 |
-
|
7226 |
-
|
7227 |
-
|
7228 |
-
|
7229 |
-
|
7230 |
-
|
7231 |
-
|
7232 |
-
|
7233 |
-
|
7234 |
-
|
7235 |
-
|
7236 |
-
|
7237 |
-
|
7238 |
-
|
7239 |
-
|
7240 |
-
|
7241 |
-
|
7242 |
-
|
7243 |
-
|
7244 |
-
|
7245 |
-
|
7246 |
-
|
7247 |
-
|
7248 |
-
|
7249 |
-
|
7250 |
-
|
7251 |
-
|
7252 |
-
|
7253 |
-
|
7254 |
-
|
7255 |
-
|
7256 |
-
|
7257 |
-
|
7258 |
-
|
7259 |
-
|
7260 |
-
|
7261 |
-
|
7262 |
-
|
7263 |
-
|
7264 |
-
|
7265 |
-
|
7266 |
-
|
7267 |
-
|
7268 |
-
|
7269 |
-
//
|
7270 |
-
|
7271 |
-
|
7272 |
-
|
7273 |
-
|
7274 |
-
|
7275 |
-
|
7276 |
-
|
7277 |
-
|
7278 |
-
|
7279 |
-
|
7280 |
-
|
7281 |
-
|
7282 |
-
|
7283 |
-
|
7284 |
-
|
7285 |
-
|
7286 |
-
|
7287 |
-
|
7288 |
-
|
7289 |
-
|
7290 |
-
|
7291 |
-
|
7292 |
-
|
7293 |
-
|
7294 |
-
|
7295 |
-
|
7296 |
-
|
7297 |
-
|
7298 |
-
|
7299 |
-
|
7300 |
-
|
7301 |
-
|
7302 |
-
jQuery.
|
7303 |
-
|
7304 |
-
|
7305 |
-
|
7306 |
-
|
7307 |
-
|
7308 |
-
|
7309 |
-
|
7310 |
-
|
7311 |
-
}
|
7312 |
-
|
7313 |
-
|
7314 |
-
|
7315 |
-
|
7316 |
-
|
7317 |
-
|
7318 |
-
|
7319 |
-
.
|
7320 |
-
|
7321 |
-
|
7322 |
-
|
7323 |
-
|
7324 |
-
|
7325 |
-
|
7326 |
-
|
7327 |
-
|
7328 |
-
|
7329 |
-
|
7330 |
-
|
7331 |
-
|
7332 |
-
|
7333 |
-
|
7334 |
-
|
7335 |
-
|
7336 |
-
|
7337 |
-
|
7338 |
-
|
7339 |
-
|
7340 |
-
|
7341 |
-
|
7342 |
-
|
7343 |
-
|
7344 |
-
|
7345 |
-
|
7346 |
-
|
7347 |
-
|
7348 |
-
|
7349 |
-
|
7350 |
-
|
7351 |
-
|
7352 |
-
|
7353 |
-
|
7354 |
-
|
7355 |
-
|
7356 |
-
|
7357 |
-
|
7358 |
-
|
7359 |
-
|
7360 |
-
|
7361 |
-
|
7362 |
-
|
7363 |
-
|
7364 |
-
|
7365 |
-
|
7366 |
-
|
7367 |
-
|
7368 |
-
|
7369 |
-
|
7370 |
-
|
7371 |
-
|
7372 |
-
|
7373 |
-
|
7374 |
-
|
7375 |
-
|
7376 |
-
|
7377 |
-
|
7378 |
-
|
7379 |
-
|
7380 |
-
|
7381 |
-
|
7382 |
-
|
7383 |
-
|
7384 |
-
|
7385 |
-
|
7386 |
-
|
7387 |
-
|
7388 |
-
}
|
7389 |
-
|
7390 |
-
|
7391 |
-
|
7392 |
-
|
7393 |
-
}
|
7394 |
-
|
7395 |
-
jQuery.
|
7396 |
-
|
7397 |
-
|
7398 |
-
|
7399 |
-
|
7400 |
-
|
7401 |
-
|
7402 |
-
|
7403 |
-
|
7404 |
-
|
7405 |
-
|
7406 |
-
|
7407 |
-
|
7408 |
-
|
7409 |
-
|
7410 |
-
|
7411 |
-
|
7412 |
-
|
7413 |
-
|
7414 |
-
|
7415 |
-
|
7416 |
-
|
7417 |
-
|
7418 |
-
|
7419 |
-
|
7420 |
-
|
7421 |
-
|
7422 |
-
|
7423 |
-
|
7424 |
-
|
7425 |
-
|
7426 |
-
|
7427 |
-
|
7428 |
-
|
7429 |
-
|
7430 |
-
|
7431 |
-
|
7432 |
-
|
7433 |
-
|
7434 |
-
|
7435 |
-
|
7436 |
-
|
7437 |
-
|
7438 |
-
|
7439 |
-
|
7440 |
-
|
7441 |
-
|
7442 |
-
|
7443 |
-
|
7444 |
-
|
7445 |
-
|
7446 |
-
|
7447 |
-
|
7448 |
-
|
7449 |
-
|
7450 |
-
|
7451 |
-
|
7452 |
-
|
7453 |
-
|
7454 |
-
}
|
7455 |
-
|
7456 |
-
|
7457 |
-
|
7458 |
-
|
7459 |
-
|
7460 |
-
|
7461 |
-
|
7462 |
-
|
7463 |
-
|
7464 |
-
|
7465 |
-
|
7466 |
-
|
7467 |
-
|
7468 |
-
|
7469 |
-
|
7470 |
-
|
7471 |
-
|
7472 |
-
|
7473 |
-
|
7474 |
-
|
7475 |
-
|
7476 |
-
|
7477 |
-
|
7478 |
-
|
7479 |
-
|
7480 |
-
|
7481 |
-
|
7482 |
-
|
7483 |
-
|
7484 |
-
|
7485 |
-
|
7486 |
-
|
7487 |
-
|
7488 |
-
|
7489 |
-
|
7490 |
-
|
7491 |
-
|
7492 |
-
|
7493 |
-
|
7494 |
-
|
7495 |
-
}
|
7496 |
-
|
7497 |
-
|
7498 |
-
|
7499 |
-
|
7500 |
-
|
7501 |
-
|
7502 |
-
|
7503 |
-
|
7504 |
-
|
7505 |
-
|
7506 |
-
|
7507 |
-
|
7508 |
-
|
7509 |
-
|
7510 |
-
|
7511 |
-
|
7512 |
-
|
7513 |
-
|
7514 |
-
|
7515 |
-
|
7516 |
-
|
7517 |
-
}
|
7518 |
-
|
7519 |
-
|
7520 |
-
|
7521 |
-
|
7522 |
-
|
7523 |
-
|
7524 |
-
|
7525 |
-
|
7526 |
-
|
7527 |
-
|
7528 |
-
|
7529 |
-
for (
|
7530 |
-
|
7531 |
-
|
7532 |
-
|
7533 |
-
|
7534 |
-
|
7535 |
-
|
7536 |
-
|
7537 |
-
|
7538 |
-
|
7539 |
-
}
|
7540 |
-
|
7541 |
-
|
7542 |
-
|
7543 |
-
|
7544 |
-
|
7545 |
-
|
7546 |
-
|
7547 |
-
|
7548 |
-
|
7549 |
-
|
7550 |
-
|
7551 |
-
|
7552 |
-
|
7553 |
-
|
7554 |
-
|
7555 |
-
|
7556 |
-
|
7557 |
-
|
7558 |
-
|
7559 |
-
|
7560 |
-
|
7561 |
-
|
7562 |
-
|
7563 |
-
|
7564 |
-
|
7565 |
-
|
7566 |
-
|
7567 |
-
|
7568 |
-
|
7569 |
-
|
7570 |
-
|
7571 |
-
|
7572 |
-
|
7573 |
-
|
7574 |
-
|
7575 |
-
|
7576 |
-
|
7577 |
-
|
7578 |
-
|
7579 |
-
|
7580 |
-
|
7581 |
-
|
7582 |
-
|
7583 |
-
|
7584 |
-
|
7585 |
-
|
7586 |
-
|
7587 |
-
|
7588 |
-
|
7589 |
-
|
7590 |
-
|
7591 |
-
|
7592 |
-
|
7593 |
-
|
7594 |
-
|
7595 |
-
|
7596 |
-
|
7597 |
-
|
7598 |
-
|
7599 |
-
|
7600 |
-
|
7601 |
-
|
7602 |
-
|
7603 |
-
|
7604 |
-
|
7605 |
-
|
7606 |
-
|
7607 |
-
|
7608 |
-
|
7609 |
-
|
7610 |
-
|
7611 |
-
|
7612 |
-
}
|
7613 |
-
|
7614 |
-
|
7615 |
-
|
7616 |
-
|
7617 |
-
|
7618 |
-
|
7619 |
-
|
7620 |
-
|
7621 |
-
|
7622 |
-
|
7623 |
-
|
7624 |
-
|
7625 |
-
|
7626 |
-
|
7627 |
-
|
7628 |
-
|
7629 |
-
|
7630 |
-
|
7631 |
-
|
7632 |
-
|
7633 |
-
|
7634 |
-
|
7635 |
-
|
7636 |
-
|
7637 |
-
|
7638 |
-
|
7639 |
-
|
7640 |
-
|
7641 |
-
|
7642 |
-
|
7643 |
-
|
7644 |
-
|
7645 |
-
|
7646 |
-
|
7647 |
-
|
7648 |
-
|
7649 |
-
|
7650 |
-
|
7651 |
-
|
7652 |
-
|
7653 |
-
|
7654 |
-
|
7655 |
-
|
7656 |
-
|
7657 |
-
|
7658 |
-
|
7659 |
-
|
7660 |
-
|
7661 |
-
|
7662 |
-
|
7663 |
-
|
7664 |
-
|
7665 |
-
|
7666 |
-
|
7667 |
-
|
7668 |
-
|
7669 |
-
|
7670 |
-
|
7671 |
-
|
7672 |
-
|
7673 |
-
|
7674 |
-
|
7675 |
-
|
7676 |
-
|
7677 |
-
|
7678 |
-
|
7679 |
-
|
7680 |
-
|
7681 |
-
|
7682 |
-
|
7683 |
-
|
7684 |
-
|
7685 |
-
|
7686 |
-
|
7687 |
-
|
7688 |
-
|
7689 |
-
|
7690 |
-
|
7691 |
-
|
7692 |
-
|
7693 |
-
|
7694 |
-
|
7695 |
-
|
7696 |
-
|
7697 |
-
|
7698 |
-
|
7699 |
-
|
7700 |
-
|
7701 |
-
|
7702 |
-
|
7703 |
-
|
7704 |
-
|
7705 |
-
|
7706 |
-
|
7707 |
-
|
7708 |
-
|
7709 |
-
|
7710 |
-
|
7711 |
-
|
7712 |
-
|
7713 |
-
|
7714 |
-
|
7715 |
-
|
7716 |
-
|
7717 |
-
|
7718 |
-
|
7719 |
-
|
7720 |
-
|
7721 |
-
|
7722 |
-
|
7723 |
-
|
7724 |
-
|
7725 |
-
|
7726 |
-
|
7727 |
-
|
7728 |
-
|
7729 |
-
|
7730 |
-
|
7731 |
-
//
|
7732 |
-
|
7733 |
-
//
|
7734 |
-
|
7735 |
-
|
7736 |
-
|
7737 |
-
|
7738 |
-
|
7739 |
-
|
7740 |
-
|
7741 |
-
|
7742 |
-
|
7743 |
-
|
7744 |
-
|
7745 |
-
|
7746 |
-
|
7747 |
-
|
7748 |
-
|
7749 |
-
|
7750 |
-
|
7751 |
-
|
7752 |
-
//
|
7753 |
-
|
7754 |
-
|
7755 |
-
|
7756 |
-
|
7757 |
-
//
|
7758 |
-
|
7759 |
-
|
7760 |
-
|
7761 |
-
|
7762 |
-
|
7763 |
-
|
7764 |
-
//
|
7765 |
-
|
7766 |
-
|
7767 |
-
|
7768 |
-
|
7769 |
-
|
7770 |
-
|
7771 |
-
|
7772 |
-
|
7773 |
-
|
7774 |
-
|
7775 |
-
|
7776 |
-
|
7777 |
-
|
7778 |
-
|
7779 |
-
|
7780 |
-
|
7781 |
-
|
7782 |
-
|
7783 |
-
|
7784 |
-
|
7785 |
-
|
7786 |
-
|
7787 |
-
|
7788 |
-
|
7789 |
-
|
7790 |
-
|
7791 |
-
|
7792 |
-
|
7793 |
-
|
7794 |
-
|
7795 |
-
|
7796 |
-
|
7797 |
-
|
7798 |
-
|
7799 |
-
|
7800 |
-
|
7801 |
-
|
7802 |
-
|
7803 |
-
|
7804 |
-
|
7805 |
-
|
7806 |
-
|
7807 |
-
|
7808 |
-
|
7809 |
-
|
7810 |
-
|
7811 |
-
|
7812 |
-
|
7813 |
-
|
7814 |
-
|
7815 |
-
|
7816 |
-
|
7817 |
-
|
7818 |
-
|
7819 |
-
|
7820 |
-
|
7821 |
-
|
7822 |
-
|
7823 |
-
|
7824 |
-
|
7825 |
-
|
7826 |
-
|
7827 |
-
|
7828 |
-
|
7829 |
-
|
7830 |
-
|
7831 |
-
|
7832 |
-
|
7833 |
-
|
7834 |
-
|
7835 |
-
|
7836 |
-
|
7837 |
-
|
7838 |
-
|
7839 |
-
|
7840 |
-
|
7841 |
-
|
7842 |
-
|
7843 |
-
|
7844 |
-
|
7845 |
-
|
7846 |
-
|
7847 |
-
|
7848 |
-
|
7849 |
-
|
7850 |
-
|
7851 |
-
|
7852 |
-
|
7853 |
-
|
7854 |
-
|
7855 |
-
|
7856 |
-
|
7857 |
-
|
7858 |
-
|
7859 |
-
|
7860 |
-
|
7861 |
-
|
7862 |
-
|
7863 |
-
|
7864 |
-
|
7865 |
-
|
7866 |
-
|
7867 |
-
|
7868 |
-
|
7869 |
-
|
7870 |
-
|
7871 |
-
|
7872 |
-
|
7873 |
-
|
7874 |
-
|
7875 |
-
|
7876 |
-
|
7877 |
-
|
7878 |
-
|
7879 |
-
|
7880 |
-
|
7881 |
-
|
7882 |
-
|
7883 |
-
|
7884 |
-
|
7885 |
-
|
7886 |
-
|
7887 |
-
|
7888 |
-
|
7889 |
-
|
7890 |
-
|
7891 |
-
|
7892 |
-
|
7893 |
-
|
7894 |
-
|
7895 |
-
|
7896 |
-
|
7897 |
-
|
7898 |
-
|
7899 |
-
|
7900 |
-
|
7901 |
-
|
7902 |
-
|
7903 |
-
|
7904 |
-
|
7905 |
-
|
7906 |
-
|
7907 |
-
|
7908 |
-
|
7909 |
-
|
7910 |
-
|
7911 |
-
|
7912 |
-
|
7913 |
-
|
7914 |
-
|
7915 |
-
|
7916 |
-
|
7917 |
-
|
7918 |
-
|
7919 |
-
|
7920 |
-
|
7921 |
-
|
7922 |
-
|
7923 |
-
|
7924 |
-
|
7925 |
-
|
7926 |
-
|
7927 |
-
|
7928 |
-
|
7929 |
-
|
7930 |
-
|
7931 |
-
|
7932 |
-
|
7933 |
-
|
7934 |
-
|
7935 |
-
|
7936 |
-
|
7937 |
-
|
7938 |
-
|
7939 |
-
|
7940 |
-
|
7941 |
-
|
7942 |
-
|
7943 |
-
if (
|
7944 |
-
|
7945 |
-
|
7946 |
-
|
7947 |
-
|
7948 |
-
|
7949 |
-
|
7950 |
-
|
7951 |
-
|
7952 |
-
|
7953 |
-
|
7954 |
-
|
7955 |
-
|
7956 |
-
|
7957 |
-
|
7958 |
-
|
7959 |
-
|
7960 |
-
|
7961 |
-
|
7962 |
-
|
7963 |
-
|
7964 |
-
|
7965 |
-
|
7966 |
-
|
7967 |
-
|
7968 |
-
|
7969 |
-
//
|
7970 |
-
|
7971 |
-
|
7972 |
-
|
7973 |
-
|
7974 |
-
|
7975 |
-
|
7976 |
-
|
7977 |
-
|
7978 |
-
|
7979 |
-
|
7980 |
-
|
7981 |
-
|
7982 |
-
|
7983 |
-
|
7984 |
-
|
7985 |
-
|
7986 |
-
|
7987 |
-
|
7988 |
-
|
7989 |
-
|
7990 |
-
|
7991 |
-
|
7992 |
-
|
7993 |
-
|
7994 |
-
|
7995 |
-
|
7996 |
-
|
7997 |
-
|
7998 |
-
|
7999 |
-
|
8000 |
-
|
8001 |
-
|
8002 |
-
|
8003 |
-
|
8004 |
-
if (
|
8005 |
-
|
8006 |
-
|
8007 |
-
|
8008 |
-
|
8009 |
-
|
8010 |
-
|
8011 |
-
|
8012 |
-
|
8013 |
-
|
8014 |
-
|
8015 |
-
|
8016 |
-
|
8017 |
-
|
8018 |
-
|
8019 |
-
|
8020 |
-
|
8021 |
-
|
8022 |
-
|
8023 |
-
|
8024 |
-
|
8025 |
-
|
8026 |
-
|
8027 |
-
|
8028 |
-
|
8029 |
-
|
8030 |
-
|
8031 |
-
|
8032 |
-
|
8033 |
-
|
8034 |
-
|
8035 |
-
|
8036 |
-
|
8037 |
-
|
8038 |
-
|
8039 |
-
|
8040 |
-
|
8041 |
-
|
8042 |
-
|
8043 |
-
|
8044 |
-
|
8045 |
-
|
8046 |
-
|
8047 |
-
|
8048 |
-
|
8049 |
-
|
8050 |
-
|
8051 |
-
|
8052 |
-
|
8053 |
-
|
8054 |
-
|
8055 |
-
|
8056 |
-
|
8057 |
-
|
8058 |
-
|
8059 |
-
|
8060 |
-
|
8061 |
-
|
8062 |
-
|
8063 |
-
|
8064 |
-
|
8065 |
-
|
8066 |
-
|
8067 |
-
|
8068 |
-
|
8069 |
-
|
8070 |
-
|
8071 |
-
|
8072 |
-
|
8073 |
-
|
8074 |
-
|
8075 |
-
|
8076 |
-
|
8077 |
-
|
8078 |
-
|
8079 |
-
|
8080 |
-
|
8081 |
-
|
8082 |
-
|
8083 |
-
if ( fireGlobals ) {
|
8084 |
-
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
|
8085 |
-
[ jqXHR, s, isSuccess ? success : error ] );
|
8086 |
-
}
|
8087 |
-
|
8088 |
-
// Complete
|
8089 |
-
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
|
8090 |
-
|
8091 |
-
if ( fireGlobals ) {
|
8092 |
-
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
|
8093 |
-
// Handle the global AJAX counter
|
8094 |
-
if ( !( --jQuery.active ) ) {
|
8095 |
-
jQuery.event.trigger("ajaxStop");
|
8096 |
-
}
|
8097 |
-
}
|
8098 |
-
}
|
8099 |
-
|
8100 |
-
return jqXHR;
|
8101 |
-
},
|
8102 |
-
|
8103 |
-
getScript: function( url, callback ) {
|
8104 |
-
return jQuery.get( url, undefined, callback, "script" );
|
8105 |
-
},
|
8106 |
-
|
8107 |
-
getJSON: function( url, data, callback ) {
|
8108 |
-
return jQuery.get( url, data, callback, "json" );
|
8109 |
-
}
|
8110 |
-
});
|
8111 |
-
|
8112 |
-
/* Handles responses to an ajax request:
|
8113 |
-
* - sets all responseXXX fields accordingly
|
8114 |
-
* - finds the right dataType (mediates between content-type and expected dataType)
|
8115 |
-
* - returns the corresponding response
|
8116 |
-
*/
|
8117 |
-
function ajaxHandleResponses( s, jqXHR, responses ) {
|
8118 |
-
var firstDataType, ct, finalDataType, type,
|
8119 |
-
contents = s.contents,
|
8120 |
-
dataTypes = s.dataTypes,
|
8121 |
-
responseFields = s.responseFields;
|
8122 |
-
|
8123 |
-
// Fill responseXXX fields
|
8124 |
-
for ( type in responseFields ) {
|
8125 |
-
if ( type in responses ) {
|
8126 |
-
jqXHR[ responseFields[type] ] = responses[ type ];
|
8127 |
-
}
|
8128 |
-
}
|
8129 |
-
|
8130 |
-
// Remove auto dataType and get content-type in the process
|
8131 |
-
while( dataTypes[ 0 ] === "*" ) {
|
8132 |
-
dataTypes.shift();
|
8133 |
-
if ( ct === undefined ) {
|
8134 |
-
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
|
8135 |
-
}
|
8136 |
-
}
|
8137 |
-
|
8138 |
-
// Check if we're dealing with a known content-type
|
8139 |
-
if ( ct ) {
|
8140 |
-
for ( type in contents ) {
|
8141 |
-
if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
8142 |
-
dataTypes.unshift( type );
|
8143 |
-
break;
|
8144 |
-
}
|
8145 |
-
}
|
8146 |
-
}
|
8147 |
-
|
8148 |
-
// Check to see if we have a response for the expected dataType
|
8149 |
-
if ( dataTypes[ 0 ] in responses ) {
|
8150 |
-
finalDataType = dataTypes[ 0 ];
|
8151 |
-
} else {
|
8152 |
-
// Try convertible dataTypes
|
8153 |
-
for ( type in responses ) {
|
8154 |
-
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
|
8155 |
-
finalDataType = type;
|
8156 |
-
break;
|
8157 |
-
}
|
8158 |
-
if ( !firstDataType ) {
|
8159 |
-
firstDataType = type;
|
8160 |
-
}
|
8161 |
-
}
|
8162 |
-
// Or just use first one
|
8163 |
-
finalDataType = finalDataType || firstDataType;
|
8164 |
-
}
|
8165 |
-
|
8166 |
-
// If we found a dataType
|
8167 |
-
// We add the dataType to the list if needed
|
8168 |
-
// and return the corresponding response
|
8169 |
-
if ( finalDataType ) {
|
8170 |
-
if ( finalDataType !== dataTypes[ 0 ] ) {
|
8171 |
-
dataTypes.unshift( finalDataType );
|
8172 |
-
}
|
8173 |
-
return responses[ finalDataType ];
|
8174 |
-
}
|
8175 |
-
}
|
8176 |
-
|
8177 |
-
// Chain conversions given the request and the original response
|
8178 |
-
function ajaxConvert( s, response ) {
|
8179 |
-
var conv2, current, conv, tmp,
|
8180 |
-
converters = {},
|
8181 |
-
i = 0,
|
8182 |
-
// Work with a copy of dataTypes in case we need to modify it for conversion
|
8183 |
-
dataTypes = s.dataTypes.slice(),
|
8184 |
-
prev = dataTypes[ 0 ];
|
8185 |
-
|
8186 |
-
// Apply the dataFilter if provided
|
8187 |
-
if ( s.dataFilter ) {
|
8188 |
-
response = s.dataFilter( response, s.dataType );
|
8189 |
-
}
|
8190 |
-
|
8191 |
-
// Create converters map with lowercased keys
|
8192 |
-
if ( dataTypes[ 1 ] ) {
|
8193 |
-
for ( conv in s.converters ) {
|
8194 |
-
converters[ conv.toLowerCase() ] = s.converters[ conv ];
|
8195 |
-
}
|
8196 |
-
}
|
8197 |
-
|
8198 |
-
// Convert to each sequential dataType, tolerating list modification
|
8199 |
-
for ( ; (current = dataTypes[++i]); ) {
|
8200 |
-
|
8201 |
-
// There's only work to do if current dataType is non-auto
|
8202 |
-
if ( current !== "*" ) {
|
8203 |
-
|
8204 |
-
// Convert response if prev dataType is non-auto and differs from current
|
8205 |
-
if ( prev !== "*" && prev !== current ) {
|
8206 |
-
|
8207 |
-
// Seek a direct converter
|
8208 |
-
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
|
8209 |
-
|
8210 |
-
// If none found, seek a pair
|
8211 |
-
if ( !conv ) {
|
8212 |
-
for ( conv2 in converters ) {
|
8213 |
-
|
8214 |
-
// If conv2 outputs current
|
8215 |
-
tmp = conv2.split(" ");
|
8216 |
-
if ( tmp[ 1 ] === current ) {
|
8217 |
-
|
8218 |
-
// If prev can be converted to accepted input
|
8219 |
-
conv = converters[ prev + " " + tmp[ 0 ] ] ||
|
8220 |
-
converters[ "* " + tmp[ 0 ] ];
|
8221 |
-
if ( conv ) {
|
8222 |
-
// Condense equivalence converters
|
8223 |
-
if ( conv === true ) {
|
8224 |
-
conv = converters[ conv2 ];
|
8225 |
-
|
8226 |
-
// Otherwise, insert the intermediate dataType
|
8227 |
-
} else if ( converters[ conv2 ] !== true ) {
|
8228 |
-
current = tmp[ 0 ];
|
8229 |
-
dataTypes.splice( i--, 0, current );
|
8230 |
-
}
|
8231 |
-
|
8232 |
-
break;
|
8233 |
-
}
|
8234 |
-
}
|
8235 |
-
}
|
8236 |
-
}
|
8237 |
-
|
8238 |
-
// Apply converter (if not an equivalence)
|
8239 |
-
if ( conv !== true ) {
|
8240 |
-
|
8241 |
-
// Unless errors are allowed to bubble, catch and return them
|
8242 |
-
if ( conv && s["throws"] ) {
|
8243 |
-
response = conv( response );
|
8244 |
-
} else {
|
8245 |
-
try {
|
8246 |
-
response = conv( response );
|
8247 |
-
} catch ( e ) {
|
8248 |
-
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
|
8249 |
-
}
|
8250 |
-
}
|
8251 |
-
}
|
8252 |
-
}
|
8253 |
-
|
8254 |
-
// Update prev for next iteration
|
8255 |
-
prev = current;
|
8256 |
-
}
|
8257 |
-
}
|
8258 |
-
|
8259 |
-
return { state: "success", data: response };
|
8260 |
-
}
|
8261 |
-
// Install script dataType
|
8262 |
-
jQuery.ajaxSetup({
|
8263 |
-
accepts: {
|
8264 |
-
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
|
8265 |
-
},
|
8266 |
-
contents: {
|
8267 |
-
script: /(?:java|ecma)script/
|
8268 |
-
},
|
8269 |
-
converters: {
|
8270 |
-
"text script": function( text ) {
|
8271 |
-
jQuery.globalEval( text );
|
8272 |
-
return text;
|
8273 |
-
}
|
8274 |
-
}
|
8275 |
-
});
|
8276 |
-
|
8277 |
-
// Handle cache's special case and global
|
8278 |
-
jQuery.ajaxPrefilter( "script", function( s ) {
|
8279 |
-
if ( s.cache === undefined ) {
|
8280 |
-
s.cache = false;
|
8281 |
-
}
|
8282 |
-
if ( s.crossDomain ) {
|
8283 |
-
s.type = "GET";
|
8284 |
-
s.global = false;
|
8285 |
-
}
|
8286 |
-
});
|
8287 |
-
|
8288 |
-
// Bind script tag hack transport
|
8289 |
-
jQuery.ajaxTransport( "script", function(s) {
|
8290 |
-
|
8291 |
-
// This transport only deals with cross domain requests
|
8292 |
-
if ( s.crossDomain ) {
|
8293 |
-
|
8294 |
-
var script,
|
8295 |
-
head = document.head || jQuery("head")[0] || document.documentElement;
|
8296 |
-
|
8297 |
-
return {
|
8298 |
-
|
8299 |
-
send: function( _, callback ) {
|
8300 |
-
|
8301 |
-
script = document.createElement("script");
|
8302 |
-
|
8303 |
-
script.async = true;
|
8304 |
-
|
8305 |
-
if ( s.scriptCharset ) {
|
8306 |
-
script.charset = s.scriptCharset;
|
8307 |
-
}
|
8308 |
-
|
8309 |
-
script.src = s.url;
|
8310 |
-
|
8311 |
-
// Attach handlers for all browsers
|
8312 |
-
script.onload = script.onreadystatechange = function( _, isAbort ) {
|
8313 |
-
|
8314 |
-
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
|
8315 |
-
|
8316 |
-
// Handle memory leak in IE
|
8317 |
-
script.onload = script.onreadystatechange = null;
|
8318 |
-
|
8319 |
-
// Remove the script
|
8320 |
-
if ( script.parentNode ) {
|
8321 |
-
script.parentNode.removeChild( script );
|
8322 |
-
}
|
8323 |
-
|
8324 |
-
// Dereference the script
|
8325 |
-
script = null;
|
8326 |
-
|
8327 |
-
// Callback if not abort
|
8328 |
-
if ( !isAbort ) {
|
8329 |
-
callback( 200, "success" );
|
8330 |
-
}
|
8331 |
-
}
|
8332 |
-
};
|
8333 |
-
|
8334 |
-
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
|
8335 |
-
// Use native DOM manipulation to avoid our domManip AJAX trickery
|
8336 |
-
head.insertBefore( script, head.firstChild );
|
8337 |
-
},
|
8338 |
-
|
8339 |
-
abort: function() {
|
8340 |
-
if ( script ) {
|
8341 |
-
script.onload( undefined, true );
|
8342 |
-
}
|
8343 |
-
}
|
8344 |
-
};
|
8345 |
-
}
|
8346 |
-
});
|
8347 |
-
var oldCallbacks = [],
|
8348 |
-
rjsonp = /(=)\?(?=&|$)|\?\?/;
|
8349 |
-
|
8350 |
-
// Default jsonp settings
|
8351 |
-
jQuery.ajaxSetup({
|
8352 |
-
jsonp: "callback",
|
8353 |
-
jsonpCallback: function() {
|
8354 |
-
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
|
8355 |
-
this[ callback ] = true;
|
8356 |
-
return callback;
|
8357 |
-
}
|
8358 |
-
});
|
8359 |
-
|
8360 |
-
// Detect, normalize options and install callbacks for jsonp requests
|
8361 |
-
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
8362 |
-
|
8363 |
-
var callbackName, overwritten, responseContainer,
|
8364 |
-
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
|
8365 |
-
"url" :
|
8366 |
-
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
|
8367 |
-
);
|
8368 |
-
|
8369 |
-
// Handle iff the expected data type is "jsonp" or we have a parameter to set
|
8370 |
-
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
|
8371 |
-
|
8372 |
-
// Get callback name, remembering preexisting value associated with it
|
8373 |
-
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
|
8374 |
-
s.jsonpCallback() :
|
8375 |
-
s.jsonpCallback;
|
8376 |
-
|
8377 |
-
// Insert callback into url or form data
|
8378 |
-
if ( jsonProp ) {
|
8379 |
-
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
|
8380 |
-
} else if ( s.jsonp !== false ) {
|
8381 |
-
s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
|
8382 |
-
}
|
8383 |
-
|
8384 |
-
// Use data converter to retrieve json after script execution
|
8385 |
-
s.converters["script json"] = function() {
|
8386 |
-
if ( !responseContainer ) {
|
8387 |
-
jQuery.error( callbackName + " was not called" );
|
8388 |
-
}
|
8389 |
-
return responseContainer[ 0 ];
|
8390 |
-
};
|
8391 |
-
|
8392 |
-
// force json dataType
|
8393 |
-
s.dataTypes[ 0 ] = "json";
|
8394 |
-
|
8395 |
-
// Install callback
|
8396 |
-
overwritten = window[ callbackName ];
|
8397 |
-
window[ callbackName ] = function() {
|
8398 |
-
responseContainer = arguments;
|
8399 |
-
};
|
8400 |
-
|
8401 |
-
// Clean-up function (fires after converters)
|
8402 |
-
jqXHR.always(function() {
|
8403 |
-
// Restore preexisting value
|
8404 |
-
window[ callbackName ] = overwritten;
|
8405 |
-
|
8406 |
-
// Save back as free
|
8407 |
-
if ( s[ callbackName ] ) {
|
8408 |
-
// make sure that re-using the options doesn't screw things around
|
8409 |
-
s.jsonpCallback = originalSettings.jsonpCallback;
|
8410 |
-
|
8411 |
-
// save the callback name for future use
|
8412 |
-
oldCallbacks.push( callbackName );
|
8413 |
-
}
|
8414 |
-
|
8415 |
-
// Call if it was a function and we have a response
|
8416 |
-
if ( responseContainer && jQuery.isFunction( overwritten ) ) {
|
8417 |
-
overwritten( responseContainer[ 0 ] );
|
8418 |
-
}
|
8419 |
-
|
8420 |
-
responseContainer = overwritten = undefined;
|
8421 |
-
});
|
8422 |
-
|
8423 |
-
// Delegate to script
|
8424 |
-
return "script";
|
8425 |
-
}
|
8426 |
-
});
|
8427 |
-
var xhrCallbacks, xhrSupported,
|
8428 |
-
xhrId = 0,
|
8429 |
-
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
|
8430 |
-
xhrOnUnloadAbort = window.ActiveXObject && function() {
|
8431 |
-
// Abort all pending requests
|
8432 |
-
var key;
|
8433 |
-
for ( key in xhrCallbacks ) {
|
8434 |
-
xhrCallbacks[ key ]( undefined, true );
|
8435 |
-
}
|
8436 |
-
};
|
8437 |
-
|
8438 |
-
// Functions to create xhrs
|
8439 |
-
function createStandardXHR() {
|
8440 |
-
try {
|
8441 |
-
return new window.XMLHttpRequest();
|
8442 |
-
} catch( e ) {}
|
8443 |
-
}
|
8444 |
-
|
8445 |
-
function createActiveXHR() {
|
8446 |
-
try {
|
8447 |
-
return new window.ActiveXObject("Microsoft.XMLHTTP");
|
8448 |
-
} catch( e ) {}
|
8449 |
-
}
|
8450 |
-
|
8451 |
-
// Create the request object
|
8452 |
-
// (This is still attached to ajaxSettings for backward compatibility)
|
8453 |
-
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
|
8454 |
-
/* Microsoft failed to properly
|
8455 |
-
* implement the XMLHttpRequest in IE7 (can't request local files),
|
8456 |
-
* so we use the ActiveXObject when it is available
|
8457 |
-
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
|
8458 |
-
* we need a fallback.
|
8459 |
-
*/
|
8460 |
-
function() {
|
8461 |
-
return !this.isLocal && createStandardXHR() || createActiveXHR();
|
8462 |
-
} :
|
8463 |
-
// For all other browsers, use the standard XMLHttpRequest object
|
8464 |
-
createStandardXHR;
|
8465 |
-
|
8466 |
-
// Determine support properties
|
8467 |
-
xhrSupported = jQuery.ajaxSettings.xhr();
|
8468 |
-
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
|
8469 |
-
xhrSupported = jQuery.support.ajax = !!xhrSupported;
|
8470 |
-
|
8471 |
-
// Create transport if the browser can provide an xhr
|
8472 |
-
if ( xhrSupported ) {
|
8473 |
-
|
8474 |
-
jQuery.ajaxTransport(function( s ) {
|
8475 |
-
// Cross domain only allowed if supported through XMLHttpRequest
|
8476 |
-
if ( !s.crossDomain || jQuery.support.cors ) {
|
8477 |
-
|
8478 |
-
var callback;
|
8479 |
-
|
8480 |
-
return {
|
8481 |
-
send: function( headers, complete ) {
|
8482 |
-
|
8483 |
-
// Get a new xhr
|
8484 |
-
var handle, i,
|
8485 |
-
xhr = s.xhr();
|
8486 |
-
|
8487 |
-
// Open the socket
|
8488 |
-
// Passing null username, generates a login popup on Opera (#2865)
|
8489 |
-
if ( s.username ) {
|
8490 |
-
xhr.open( s.type, s.url, s.async, s.username, s.password );
|
8491 |
-
} else {
|
8492 |
-
xhr.open( s.type, s.url, s.async );
|
8493 |
-
}
|
8494 |
-
|
8495 |
-
// Apply custom fields if provided
|
8496 |
-
if ( s.xhrFields ) {
|
8497 |
-
for ( i in s.xhrFields ) {
|
8498 |
-
xhr[ i ] = s.xhrFields[ i ];
|
8499 |
-
}
|
8500 |
-
}
|
8501 |
-
|
8502 |
-
// Override mime type if needed
|
8503 |
-
if ( s.mimeType && xhr.overrideMimeType ) {
|
8504 |
-
xhr.overrideMimeType( s.mimeType );
|
8505 |
-
}
|
8506 |
-
|
8507 |
-
// X-Requested-With header
|
8508 |
-
// For cross-domain requests, seeing as conditions for a preflight are
|
8509 |
-
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
8510 |
-
// (it can always be set on a per-request basis or even using ajaxSetup)
|
8511 |
-
// For same-domain requests, won't change header if already provided.
|
8512 |
-
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
|
8513 |
-
headers["X-Requested-With"] = "XMLHttpRequest";
|
8514 |
-
}
|
8515 |
-
|
8516 |
-
// Need an extra try/catch for cross domain requests in Firefox 3
|
8517 |
-
try {
|
8518 |
-
for ( i in headers ) {
|
8519 |
-
xhr.setRequestHeader( i, headers[ i ] );
|
8520 |
-
}
|
8521 |
-
} catch( err ) {}
|
8522 |
-
|
8523 |
-
// Do send the request
|
8524 |
-
// This may raise an exception which is actually
|
8525 |
-
// handled in jQuery.ajax (so no try/catch here)
|
8526 |
-
xhr.send( ( s.hasContent && s.data ) || null );
|
8527 |
-
|
8528 |
-
// Listener
|
8529 |
-
callback = function( _, isAbort ) {
|
8530 |
-
var status, responseHeaders, statusText, responses;
|
8531 |
-
|
8532 |
-
// Firefox throws exceptions when accessing properties
|
8533 |
-
// of an xhr when a network error occurred
|
8534 |
-
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
|
8535 |
-
try {
|
8536 |
-
|
8537 |
-
// Was never called and is aborted or complete
|
8538 |
-
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
|
8539 |
-
|
8540 |
-
// Only called once
|
8541 |
-
callback = undefined;
|
8542 |
-
|
8543 |
-
// Do not keep as active anymore
|
8544 |
-
if ( handle ) {
|
8545 |
-
xhr.onreadystatechange = jQuery.noop;
|
8546 |
-
if ( xhrOnUnloadAbort ) {
|
8547 |
-
delete xhrCallbacks[ handle ];
|
8548 |
-
}
|
8549 |
-
}
|
8550 |
-
|
8551 |
-
// If it's an abort
|
8552 |
-
if ( isAbort ) {
|
8553 |
-
// Abort it manually if needed
|
8554 |
-
if ( xhr.readyState !== 4 ) {
|
8555 |
-
xhr.abort();
|
8556 |
-
}
|
8557 |
-
} else {
|
8558 |
-
responses = {};
|
8559 |
-
status = xhr.status;
|
8560 |
-
responseHeaders = xhr.getAllResponseHeaders();
|
8561 |
-
|
8562 |
-
// When requesting binary data, IE6-9 will throw an exception
|
8563 |
-
// on any attempt to access responseText (#11426)
|
8564 |
-
if ( typeof xhr.responseText === "string" ) {
|
8565 |
-
responses.text = xhr.responseText;
|
8566 |
-
}
|
8567 |
-
|
8568 |
-
// Firefox throws an exception when accessing
|
8569 |
-
// statusText for faulty cross-domain requests
|
8570 |
-
try {
|
8571 |
-
statusText = xhr.statusText;
|
8572 |
-
} catch( e ) {
|
8573 |
-
// We normalize with Webkit giving an empty statusText
|
8574 |
-
statusText = "";
|
8575 |
-
}
|
8576 |
-
|
8577 |
-
// Filter status for non standard behaviors
|
8578 |
-
|
8579 |
-
// If the request is local and we have data: assume a success
|
8580 |
-
// (success with no data won't get notified, that's the best we
|
8581 |
-
// can do given current implementations)
|
8582 |
-
if ( !status && s.isLocal && !s.crossDomain ) {
|
8583 |
-
status = responses.text ? 200 : 404;
|
8584 |
-
// IE - #1450: sometimes returns 1223 when it should be 204
|
8585 |
-
} else if ( status === 1223 ) {
|
8586 |
-
status = 204;
|
8587 |
-
}
|
8588 |
-
}
|
8589 |
-
}
|
8590 |
-
} catch( firefoxAccessException ) {
|
8591 |
-
if ( !isAbort ) {
|
8592 |
-
complete( -1, firefoxAccessException );
|
8593 |
-
}
|
8594 |
-
}
|
8595 |
-
|
8596 |
-
// Call complete if needed
|
8597 |
-
if ( responses ) {
|
8598 |
-
complete( status, statusText, responses, responseHeaders );
|
8599 |
-
}
|
8600 |
-
};
|
8601 |
-
|
8602 |
-
if ( !s.async ) {
|
8603 |
-
// if we're in sync mode we fire the callback
|
8604 |
-
callback();
|
8605 |
-
} else if ( xhr.readyState === 4 ) {
|
8606 |
-
// (IE6 & IE7) if it's in cache and has been
|
8607 |
-
// retrieved directly we need to fire the callback
|
8608 |
-
setTimeout( callback );
|
8609 |
-
} else {
|
8610 |
-
handle = ++xhrId;
|
8611 |
-
if ( xhrOnUnloadAbort ) {
|
8612 |
-
// Create the active xhrs callbacks list if needed
|
8613 |
-
// and attach the unload handler
|
8614 |
-
if ( !xhrCallbacks ) {
|
8615 |
-
xhrCallbacks = {};
|
8616 |
-
jQuery( window ).unload( xhrOnUnloadAbort );
|
8617 |
-
}
|
8618 |
-
// Add to list of active xhrs callbacks
|
8619 |
-
xhrCallbacks[ handle ] = callback;
|
8620 |
-
}
|
8621 |
-
xhr.onreadystatechange = callback;
|
8622 |
-
}
|
8623 |
-
},
|
8624 |
-
|
8625 |
-
abort: function() {
|
8626 |
-
if ( callback ) {
|
8627 |
-
callback( undefined, true );
|
8628 |
-
}
|
8629 |
-
}
|
8630 |
-
};
|
8631 |
-
}
|
8632 |
-
});
|
8633 |
-
}
|
8634 |
-
var fxNow, timerId,
|
8635 |
-
rfxtypes = /^(?:toggle|show|hide)$/,
|
8636 |
-
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
|
8637 |
-
rrun = /queueHooks$/,
|
8638 |
-
animationPrefilters = [ defaultPrefilter ],
|
8639 |
-
tweeners = {
|
8640 |
-
"*": [function( prop, value ) {
|
8641 |
-
var end, unit,
|
8642 |
-
tween = this.createTween( prop, value ),
|
8643 |
-
parts = rfxnum.exec( value ),
|
8644 |
-
target = tween.cur(),
|
8645 |
-
start = +target || 0,
|
8646 |
-
scale = 1,
|
8647 |
-
maxIterations = 20;
|
8648 |
-
|
8649 |
-
if ( parts ) {
|
8650 |
-
end = +parts[2];
|
8651 |
-
unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
|
8652 |
-
|
8653 |
-
// We need to compute starting value
|
8654 |
-
if ( unit !== "px" && start ) {
|
8655 |
-
// Iteratively approximate from a nonzero starting point
|
8656 |
-
// Prefer the current property, because this process will be trivial if it uses the same units
|
8657 |
-
// Fallback to end or a simple constant
|
8658 |
-
start = jQuery.css( tween.elem, prop, true ) || end || 1;
|
8659 |
-
|
8660 |
-
do {
|
8661 |
-
// If previous iteration zeroed out, double until we get *something*
|
8662 |
-
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
|
8663 |
-
scale = scale || ".5";
|
8664 |
-
|
8665 |
-
// Adjust and apply
|
8666 |
-
start = start / scale;
|
8667 |
-
jQuery.style( tween.elem, prop, start + unit );
|
8668 |
-
|
8669 |
-
// Update scale, tolerating zero or NaN from tween.cur()
|
8670 |
-
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
|
8671 |
-
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
|
8672 |
-
}
|
8673 |
-
|
8674 |
-
tween.unit = unit;
|
8675 |
-
tween.start = start;
|
8676 |
-
// If a +=/-= token was provided, we're doing a relative animation
|
8677 |
-
tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
|
8678 |
-
}
|
8679 |
-
return tween;
|
8680 |
-
}]
|
8681 |
-
};
|
8682 |
-
|
8683 |
-
// Animations created synchronously will run synchronously
|
8684 |
-
function createFxNow() {
|
8685 |
-
setTimeout(function() {
|
8686 |
-
fxNow = undefined;
|
8687 |
-
});
|
8688 |
-
return ( fxNow = jQuery.now() );
|
8689 |
-
}
|
8690 |
-
|
8691 |
-
function createTweens( animation, props ) {
|
8692 |
-
jQuery.each( props, function( prop, value ) {
|
8693 |
-
var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
|
8694 |
-
index = 0,
|
8695 |
-
length = collection.length;
|
8696 |
-
for ( ; index < length; index++ ) {
|
8697 |
-
if ( collection[ index ].call( animation, prop, value ) ) {
|
8698 |
-
|
8699 |
-
// we're done with this property
|
8700 |
-
return;
|
8701 |
-
}
|
8702 |
-
}
|
8703 |
-
});
|
8704 |
-
}
|
8705 |
-
|
8706 |
-
function Animation( elem, properties, options ) {
|
8707 |
-
var result,
|
8708 |
-
stopped,
|
8709 |
-
index = 0,
|
8710 |
-
length = animationPrefilters.length,
|
8711 |
-
deferred = jQuery.Deferred().always( function() {
|
8712 |
-
// don't match elem in the :animated selector
|
8713 |
-
delete tick.elem;
|
8714 |
-
}),
|
8715 |
-
tick = function() {
|
8716 |
-
if ( stopped ) {
|
8717 |
-
return false;
|
8718 |
-
}
|
8719 |
-
var currentTime = fxNow || createFxNow(),
|
8720 |
-
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
|
8721 |
-
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
|
8722 |
-
temp = remaining / animation.duration || 0,
|
8723 |
-
percent = 1 - temp,
|
8724 |
-
index = 0,
|
8725 |
-
length = animation.tweens.length;
|
8726 |
-
|
8727 |
-
for ( ; index < length ; index++ ) {
|
8728 |
-
animation.tweens[ index ].run( percent );
|
8729 |
-
}
|
8730 |
-
|
8731 |
-
deferred.notifyWith( elem, [ animation, percent, remaining ]);
|
8732 |
-
|
8733 |
-
if ( percent < 1 && length ) {
|
8734 |
-
return remaining;
|
8735 |
-
} else {
|
8736 |
-
deferred.resolveWith( elem, [ animation ] );
|
8737 |
-
return false;
|
8738 |
-
}
|
8739 |
-
},
|
8740 |
-
animation = deferred.promise({
|
8741 |
-
elem: elem,
|
8742 |
-
props: jQuery.extend( {}, properties ),
|
8743 |
-
opts: jQuery.extend( true, { specialEasing: {} }, options ),
|
8744 |
-
originalProperties: properties,
|
8745 |
-
originalOptions: options,
|
8746 |
-
startTime: fxNow || createFxNow(),
|
8747 |
-
duration: options.duration,
|
8748 |
-
tweens: [],
|
8749 |
-
createTween: function( prop, end ) {
|
8750 |
-
var tween = jQuery.Tween( elem, animation.opts, prop, end,
|
8751 |
-
animation.opts.specialEasing[ prop ] || animation.opts.easing );
|
8752 |
-
animation.tweens.push( tween );
|
8753 |
-
return tween;
|
8754 |
-
},
|
8755 |
-
stop: function( gotoEnd ) {
|
8756 |
-
var index = 0,
|
8757 |
-
// if we are going to the end, we want to run all the tweens
|
8758 |
-
// otherwise we skip this part
|
8759 |
-
length = gotoEnd ? animation.tweens.length : 0;
|
8760 |
-
if ( stopped ) {
|
8761 |
-
return this;
|
8762 |
-
}
|
8763 |
-
stopped = true;
|
8764 |
-
for ( ; index < length ; index++ ) {
|
8765 |
-
animation.tweens[ index ].run( 1 );
|
8766 |
-
}
|
8767 |
-
|
8768 |
-
// resolve when we played the last frame
|
8769 |
-
// otherwise, reject
|
8770 |
-
if ( gotoEnd ) {
|
8771 |
-
deferred.resolveWith( elem, [ animation, gotoEnd ] );
|
8772 |
-
} else {
|
8773 |
-
deferred.rejectWith( elem, [ animation, gotoEnd ] );
|
8774 |
-
}
|
8775 |
-
return this;
|
8776 |
-
}
|
8777 |
-
}),
|
8778 |
-
props = animation.props;
|
8779 |
-
|
8780 |
-
propFilter( props, animation.opts.specialEasing );
|
8781 |
-
|
8782 |
-
for ( ; index < length ; index++ ) {
|
8783 |
-
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
|
8784 |
-
if ( result ) {
|
8785 |
-
return result;
|
8786 |
-
}
|
8787 |
-
}
|
8788 |
-
|
8789 |
-
createTweens( animation, props );
|
8790 |
-
|
8791 |
-
if ( jQuery.isFunction( animation.opts.start ) ) {
|
8792 |
-
animation.opts.start.call( elem, animation );
|
8793 |
-
}
|
8794 |
-
|
8795 |
-
jQuery.fx.timer(
|
8796 |
-
jQuery.extend( tick, {
|
8797 |
-
elem: elem,
|
8798 |
-
anim: animation,
|
8799 |
-
queue: animation.opts.queue
|
8800 |
-
})
|
8801 |
-
);
|
8802 |
-
|
8803 |
-
// attach callbacks from options
|
8804 |
-
return animation.progress( animation.opts.progress )
|
8805 |
-
.done( animation.opts.done, animation.opts.complete )
|
8806 |
-
.fail( animation.opts.fail )
|
8807 |
-
.always( animation.opts.always );
|
8808 |
-
}
|
8809 |
-
|
8810 |
-
function propFilter( props, specialEasing ) {
|
8811 |
-
var value, name, index, easing, hooks;
|
8812 |
-
|
8813 |
-
// camelCase, specialEasing and expand cssHook pass
|
8814 |
-
for ( index in props ) {
|
8815 |
-
name = jQuery.camelCase( index );
|
8816 |
-
easing = specialEasing[ name ];
|
8817 |
-
value = props[ index ];
|
8818 |
-
if ( jQuery.isArray( value ) ) {
|
8819 |
-
easing = value[ 1 ];
|
8820 |
-
value = props[ index ] = value[ 0 ];
|
8821 |
-
}
|
8822 |
-
|
8823 |
-
if ( index !== name ) {
|
8824 |
-
props[ name ] = value;
|
8825 |
-
delete props[ index ];
|
8826 |
-
}
|
8827 |
-
|
8828 |
-
hooks = jQuery.cssHooks[ name ];
|
8829 |
-
if ( hooks && "expand" in hooks ) {
|
8830 |
-
value = hooks.expand( value );
|
8831 |
-
delete props[ name ];
|
8832 |
-
|
8833 |
-
// not quite $.extend, this wont overwrite keys already present.
|
8834 |
-
// also - reusing 'index' from above because we have the correct "name"
|
8835 |
-
for ( index in value ) {
|
8836 |
-
if ( !( index in props ) ) {
|
8837 |
-
props[ index ] = value[ index ];
|
8838 |
-
specialEasing[ index ] = easing;
|
8839 |
-
}
|
8840 |
-
}
|
8841 |
-
} else {
|
8842 |
-
specialEasing[ name ] = easing;
|
8843 |
-
}
|
8844 |
-
}
|
8845 |
-
}
|
8846 |
-
|
8847 |
-
jQuery.Animation = jQuery.extend( Animation, {
|
8848 |
-
|
8849 |
-
tweener: function( props, callback ) {
|
8850 |
-
if ( jQuery.isFunction( props ) ) {
|
8851 |
-
callback = props;
|
8852 |
-
props = [ "*" ];
|
8853 |
-
} else {
|
8854 |
-
props = props.split(" ");
|
8855 |
-
}
|
8856 |
-
|
8857 |
-
var prop,
|
8858 |
-
index = 0,
|
8859 |
-
length = props.length;
|
8860 |
-
|
8861 |
-
for ( ; index < length ; index++ ) {
|
8862 |
-
prop = props[ index ];
|
8863 |
-
tweeners[ prop ] = tweeners[ prop ] || [];
|
8864 |
-
tweeners[ prop ].unshift( callback );
|
8865 |
-
}
|
8866 |
-
},
|
8867 |
-
|
8868 |
-
prefilter: function( callback, prepend ) {
|
8869 |
-
if ( prepend ) {
|
8870 |
-
animationPrefilters.unshift( callback );
|
8871 |
-
} else {
|
8872 |
-
animationPrefilters.push( callback );
|
8873 |
-
}
|
8874 |
-
}
|
8875 |
-
});
|
8876 |
-
|
8877 |
-
function defaultPrefilter( elem, props, opts ) {
|
8878 |
-
/*jshint validthis:true */
|
8879 |
-
var prop, index, length,
|
8880 |
-
value, dataShow, toggle,
|
8881 |
-
tween, hooks, oldfire,
|
8882 |
-
anim = this,
|
8883 |
-
style = elem.style,
|
8884 |
-
orig = {},
|
8885 |
-
handled = [],
|
8886 |
-
hidden = elem.nodeType && isHidden( elem );
|
8887 |
-
|
8888 |
-
// handle queue: false promises
|
8889 |
-
if ( !opts.queue ) {
|
8890 |
-
hooks = jQuery._queueHooks( elem, "fx" );
|
8891 |
-
if ( hooks.unqueued == null ) {
|
8892 |
-
hooks.unqueued = 0;
|
8893 |
-
oldfire = hooks.empty.fire;
|
8894 |
-
hooks.empty.fire = function() {
|
8895 |
-
if ( !hooks.unqueued ) {
|
8896 |
-
oldfire();
|
8897 |
-
}
|
8898 |
-
};
|
8899 |
-
}
|
8900 |
-
hooks.unqueued++;
|
8901 |
-
|
8902 |
-
anim.always(function() {
|
8903 |
-
// doing this makes sure that the complete handler will be called
|
8904 |
-
// before this completes
|
8905 |
-
anim.always(function() {
|
8906 |
-
hooks.unqueued--;
|
8907 |
-
if ( !jQuery.queue( elem, "fx" ).length ) {
|
8908 |
-
hooks.empty.fire();
|
8909 |
-
}
|
8910 |
-
});
|
8911 |
-
});
|
8912 |
-
}
|
8913 |
-
|
8914 |
-
// height/width overflow pass
|
8915 |
-
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
|
8916 |
-
// Make sure that nothing sneaks out
|
8917 |
-
// Record all 3 overflow attributes because IE does not
|
8918 |
-
// change the overflow attribute when overflowX and
|
8919 |
-
// overflowY are set to the same value
|
8920 |
-
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
|
8921 |
-
|
8922 |
-
// Set display property to inline-block for height/width
|
8923 |
-
// animations on inline elements that are having width/height animated
|
8924 |
-
if ( jQuery.css( elem, "display" ) === "inline" &&
|
8925 |
-
jQuery.css( elem, "float" ) === "none" ) {
|
8926 |
-
|
8927 |
-
// inline-level elements accept inline-block;
|
8928 |
-
// block-level elements need to be inline with layout
|
8929 |
-
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
|
8930 |
-
style.display = "inline-block";
|
8931 |
-
|
8932 |
-
} else {
|
8933 |
-
style.zoom = 1;
|
8934 |
-
}
|
8935 |
-
}
|
8936 |
-
}
|
8937 |
-
|
8938 |
-
if ( opts.overflow ) {
|
8939 |
-
style.overflow = "hidden";
|
8940 |
-
if ( !jQuery.support.shrinkWrapBlocks ) {
|
8941 |
-
anim.always(function() {
|
8942 |
-
style.overflow = opts.overflow[ 0 ];
|
8943 |
-
style.overflowX = opts.overflow[ 1 ];
|
8944 |
-
style.overflowY = opts.overflow[ 2 ];
|
8945 |
-
});
|
8946 |
-
}
|
8947 |
-
}
|
8948 |
-
|
8949 |
-
|
8950 |
-
// show/hide pass
|
8951 |
-
for ( index in props ) {
|
8952 |
-
value = props[ index ];
|
8953 |
-
if ( rfxtypes.exec( value ) ) {
|
8954 |
-
delete props[ index ];
|
8955 |
-
toggle = toggle || value === "toggle";
|
8956 |
-
if ( value === ( hidden ? "hide" : "show" ) ) {
|
8957 |
-
continue;
|
8958 |
-
}
|
8959 |
-
handled.push( index );
|
8960 |
-
}
|
8961 |
-
}
|
8962 |
-
|
8963 |
-
length = handled.length;
|
8964 |
-
if ( length ) {
|
8965 |
-
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
|
8966 |
-
if ( "hidden" in dataShow ) {
|
8967 |
-
hidden = dataShow.hidden;
|
8968 |
-
}
|
8969 |
-
|
8970 |
-
// store state if its toggle - enables .stop().toggle() to "reverse"
|
8971 |
-
if ( toggle ) {
|
8972 |
-
dataShow.hidden = !hidden;
|
8973 |
-
}
|
8974 |
-
if ( hidden ) {
|
8975 |
-
jQuery( elem ).show();
|
8976 |
-
} else {
|
8977 |
-
anim.done(function() {
|
8978 |
-
jQuery( elem ).hide();
|
8979 |
-
});
|
8980 |
-
}
|
8981 |
-
anim.done(function() {
|
8982 |
-
var prop;
|
8983 |
-
jQuery._removeData( elem, "fxshow" );
|
8984 |
-
for ( prop in orig ) {
|
8985 |
-
jQuery.style( elem, prop, orig[ prop ] );
|
8986 |
-
}
|
8987 |
-
});
|
8988 |
-
for ( index = 0 ; index < length ; index++ ) {
|
8989 |
-
prop = handled[ index ];
|
8990 |
-
tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
|
8991 |
-
orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
|
8992 |
-
|
8993 |
-
if ( !( prop in dataShow ) ) {
|
8994 |
-
dataShow[ prop ] = tween.start;
|
8995 |
-
if ( hidden ) {
|
8996 |
-
tween.end = tween.start;
|
8997 |
-
tween.start = prop === "width" || prop === "height" ? 1 : 0;
|
8998 |
-
}
|
8999 |
-
}
|
9000 |
-
}
|
9001 |
-
}
|
9002 |
-
}
|
9003 |
-
|
9004 |
-
function Tween( elem, options, prop, end, easing ) {
|
9005 |
-
return new Tween.prototype.init( elem, options, prop, end, easing );
|
9006 |
-
}
|
9007 |
-
jQuery.Tween = Tween;
|
9008 |
-
|
9009 |
-
Tween.prototype = {
|
9010 |
-
constructor: Tween,
|
9011 |
-
init: function( elem, options, prop, end, easing, unit ) {
|
9012 |
-
this.elem = elem;
|
9013 |
-
this.prop = prop;
|
9014 |
-
this.easing = easing || "swing";
|
9015 |
-
this.options = options;
|
9016 |
-
this.start = this.now = this.cur();
|
9017 |
-
this.end = end;
|
9018 |
-
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
|
9019 |
-
},
|
9020 |
-
cur: function() {
|
9021 |
-
var hooks = Tween.propHooks[ this.prop ];
|
9022 |
-
|
9023 |
-
return hooks && hooks.get ?
|
9024 |
-
hooks.get( this ) :
|
9025 |
-
Tween.propHooks._default.get( this );
|
9026 |
-
},
|
9027 |
-
run: function( percent ) {
|
9028 |
-
var eased,
|
9029 |
-
hooks = Tween.propHooks[ this.prop ];
|
9030 |
-
|
9031 |
-
if ( this.options.duration ) {
|
9032 |
-
this.pos = eased = jQuery.easing[ this.easing ](
|
9033 |
-
percent, this.options.duration * percent, 0, 1, this.options.duration
|
9034 |
-
);
|
9035 |
-
} else {
|
9036 |
-
this.pos = eased = percent;
|
9037 |
-
}
|
9038 |
-
this.now = ( this.end - this.start ) * eased + this.start;
|
9039 |
-
|
9040 |
-
if ( this.options.step ) {
|
9041 |
-
this.options.step.call( this.elem, this.now, this );
|
9042 |
-
}
|
9043 |
-
|
9044 |
-
if ( hooks && hooks.set ) {
|
9045 |
-
hooks.set( this );
|
9046 |
-
} else {
|
9047 |
-
Tween.propHooks._default.set( this );
|
9048 |
-
}
|
9049 |
-
return this;
|
9050 |
-
}
|
9051 |
-
};
|
9052 |
-
|
9053 |
-
Tween.prototype.init.prototype = Tween.prototype;
|
9054 |
-
|
9055 |
-
Tween.propHooks = {
|
9056 |
-
_default: {
|
9057 |
-
get: function( tween ) {
|
9058 |
-
var result;
|
9059 |
-
|
9060 |
-
if ( tween.elem[ tween.prop ] != null &&
|
9061 |
-
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
|
9062 |
-
return tween.elem[ tween.prop ];
|
9063 |
-
}
|
9064 |
-
|
9065 |
-
// passing an empty string as a 3rd parameter to .css will automatically
|
9066 |
-
// attempt a parseFloat and fallback to a string if the parse fails
|
9067 |
-
// so, simple values such as "10px" are parsed to Float.
|
9068 |
-
// complex values such as "rotate(1rad)" are returned as is.
|
9069 |
-
result = jQuery.css( tween.elem, tween.prop, "" );
|
9070 |
-
// Empty strings, null, undefined and "auto" are converted to 0.
|
9071 |
-
return !result || result === "auto" ? 0 : result;
|
9072 |
-
},
|
9073 |
-
set: function( tween ) {
|
9074 |
-
// use step hook for back compat - use cssHook if its there - use .style if its
|
9075 |
-
// available and use plain properties where available
|
9076 |
-
if ( jQuery.fx.step[ tween.prop ] ) {
|
9077 |
-
jQuery.fx.step[ tween.prop ]( tween );
|
9078 |
-
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
|
9079 |
-
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
|
9080 |
-
} else {
|
9081 |
-
tween.elem[ tween.prop ] = tween.now;
|
9082 |
-
}
|
9083 |
-
}
|
9084 |
-
}
|
9085 |
-
};
|
9086 |
-
|
9087 |
-
// Remove in 2.0 - this supports IE8's panic based approach
|
9088 |
-
// to setting things on disconnected nodes
|
9089 |
-
|
9090 |
-
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
|
9091 |
-
set: function( tween ) {
|
9092 |
-
if ( tween.elem.nodeType && tween.elem.parentNode ) {
|
9093 |
-
tween.elem[ tween.prop ] = tween.now;
|
9094 |
-
}
|
9095 |
-
}
|
9096 |
-
};
|
9097 |
-
|
9098 |
-
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
|
9099 |
-
var cssFn = jQuery.fn[ name ];
|
9100 |
-
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
9101 |
-
return speed == null || typeof speed === "boolean" ?
|
9102 |
-
cssFn.apply( this, arguments ) :
|
9103 |
-
this.animate( genFx( name, true ), speed, easing, callback );
|
9104 |
-
};
|
9105 |
-
});
|
9106 |
-
|
9107 |
-
jQuery.fn.extend({
|
9108 |
-
fadeTo: function( speed, to, easing, callback ) {
|
9109 |
-
|
9110 |
-
// show any hidden elements after setting opacity to 0
|
9111 |
-
return this.filter( isHidden ).css( "opacity", 0 ).show()
|
9112 |
-
|
9113 |
-
// animate to the value specified
|
9114 |
-
.end().animate({ opacity: to }, speed, easing, callback );
|
9115 |
-
},
|
9116 |
-
animate: function( prop, speed, easing, callback ) {
|
9117 |
-
var empty = jQuery.isEmptyObject( prop ),
|
9118 |
-
optall = jQuery.speed( speed, easing, callback ),
|
9119 |
-
doAnimation = function() {
|
9120 |
-
// Operate on a copy of prop so per-property easing won't be lost
|
9121 |
-
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
|
9122 |
-
doAnimation.finish = function() {
|
9123 |
-
anim.stop( true );
|
9124 |
-
};
|
9125 |
-
// Empty animations, or finishing resolves immediately
|
9126 |
-
if ( empty || jQuery._data( this, "finish" ) ) {
|
9127 |
-
anim.stop( true );
|
9128 |
-
}
|
9129 |
-
};
|
9130 |
-
doAnimation.finish = doAnimation;
|
9131 |
-
|
9132 |
-
return empty || optall.queue === false ?
|
9133 |
-
this.each( doAnimation ) :
|
9134 |
-
this.queue( optall.queue, doAnimation );
|
9135 |
-
},
|
9136 |
-
stop: function( type, clearQueue, gotoEnd ) {
|
9137 |
-
var stopQueue = function( hooks ) {
|
9138 |
-
var stop = hooks.stop;
|
9139 |
-
delete hooks.stop;
|
9140 |
-
stop( gotoEnd );
|
9141 |
-
};
|
9142 |
-
|
9143 |
-
if ( typeof type !== "string" ) {
|
9144 |
-
gotoEnd = clearQueue;
|
9145 |
-
clearQueue = type;
|
9146 |
-
type = undefined;
|
9147 |
-
}
|
9148 |
-
if ( clearQueue && type !== false ) {
|
9149 |
-
this.queue( type || "fx", [] );
|
9150 |
-
}
|
9151 |
-
|
9152 |
-
return this.each(function() {
|
9153 |
-
var dequeue = true,
|
9154 |
-
index = type != null && type + "queueHooks",
|
9155 |
-
timers = jQuery.timers,
|
9156 |
-
data = jQuery._data( this );
|
9157 |
-
|
9158 |
-
if ( index ) {
|
9159 |
-
if ( data[ index ] && data[ index ].stop ) {
|
9160 |
-
stopQueue( data[ index ] );
|
9161 |
-
}
|
9162 |
-
} else {
|
9163 |
-
for ( index in data ) {
|
9164 |
-
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
|
9165 |
-
stopQueue( data[ index ] );
|
9166 |
-
}
|
9167 |
-
}
|
9168 |
-
}
|
9169 |
-
|
9170 |
-
for ( index = timers.length; index--; ) {
|
9171 |
-
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
|
9172 |
-
timers[ index ].anim.stop( gotoEnd );
|
9173 |
-
dequeue = false;
|
9174 |
-
timers.splice( index, 1 );
|
9175 |
-
}
|
9176 |
-
}
|
9177 |
-
|
9178 |
-
// start the next in the queue if the last step wasn't forced
|
9179 |
-
// timers currently will call their complete callbacks, which will dequeue
|
9180 |
-
// but only if they were gotoEnd
|
9181 |
-
if ( dequeue || !gotoEnd ) {
|
9182 |
-
jQuery.dequeue( this, type );
|
9183 |
-
}
|
9184 |
-
});
|
9185 |
-
},
|
9186 |
-
finish: function( type ) {
|
9187 |
-
if ( type !== false ) {
|
9188 |
-
type = type || "fx";
|
9189 |
-
}
|
9190 |
-
return this.each(function() {
|
9191 |
-
var index,
|
9192 |
-
data = jQuery._data( this ),
|
9193 |
-
queue = data[ type + "queue" ],
|
9194 |
-
hooks = data[ type + "queueHooks" ],
|
9195 |
-
timers = jQuery.timers,
|
9196 |
-
length = queue ? queue.length : 0;
|
9197 |
-
|
9198 |
-
// enable finishing flag on private data
|
9199 |
-
data.finish = true;
|
9200 |
-
|
9201 |
-
// empty the queue first
|
9202 |
-
jQuery.queue( this, type, [] );
|
9203 |
-
|
9204 |
-
if ( hooks && hooks.cur && hooks.cur.finish ) {
|
9205 |
-
hooks.cur.finish.call( this );
|
9206 |
-
}
|
9207 |
-
|
9208 |
-
// look for any active animations, and finish them
|
9209 |
-
for ( index = timers.length; index--; ) {
|
9210 |
-
if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
|
9211 |
-
timers[ index ].anim.stop( true );
|
9212 |
-
timers.splice( index, 1 );
|
9213 |
-
}
|
9214 |
-
}
|
9215 |
-
|
9216 |
-
// look for any animations in the old queue and finish them
|
9217 |
-
for ( index = 0; index < length; index++ ) {
|
9218 |
-
if ( queue[ index ] && queue[ index ].finish ) {
|
9219 |
-
queue[ index ].finish.call( this );
|
9220 |
-
}
|
9221 |
-
}
|
9222 |
-
|
9223 |
-
// turn off finishing flag
|
9224 |
-
delete data.finish;
|
9225 |
-
});
|
9226 |
-
}
|
9227 |
-
});
|
9228 |
-
|
9229 |
-
// Generate parameters to create a standard animation
|
9230 |
-
function genFx( type, includeWidth ) {
|
9231 |
-
var which,
|
9232 |
-
attrs = { height: type },
|
9233 |
-
i = 0;
|
9234 |
-
|
9235 |
-
// if we include width, step value is 1 to do all cssExpand values,
|
9236 |
-
// if we don't include width, step value is 2 to skip over Left and Right
|
9237 |
-
includeWidth = includeWidth? 1 : 0;
|
9238 |
-
for( ; i < 4 ; i += 2 - includeWidth ) {
|
9239 |
-
which = cssExpand[ i ];
|
9240 |
-
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
|
9241 |
-
}
|
9242 |
-
|
9243 |
-
if ( includeWidth ) {
|
9244 |
-
attrs.opacity = attrs.width = type;
|
9245 |
-
}
|
9246 |
-
|
9247 |
-
return attrs;
|
9248 |
-
}
|
9249 |
-
|
9250 |
-
// Generate shortcuts for custom animations
|
9251 |
-
jQuery.each({
|
9252 |
-
slideDown: genFx("show"),
|
9253 |
-
slideUp: genFx("hide"),
|
9254 |
-
slideToggle: genFx("toggle"),
|
9255 |
-
fadeIn: { opacity: "show" },
|
9256 |
-
fadeOut: { opacity: "hide" },
|
9257 |
-
fadeToggle: { opacity: "toggle" }
|
9258 |
-
}, function( name, props ) {
|
9259 |
-
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
9260 |
-
return this.animate( props, speed, easing, callback );
|
9261 |
-
};
|
9262 |
-
});
|
9263 |
-
|
9264 |
-
jQuery.speed = function( speed, easing, fn ) {
|
9265 |
-
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
|
9266 |
-
complete: fn || !fn && easing ||
|
9267 |
-
jQuery.isFunction( speed ) && speed,
|
9268 |
-
duration: speed,
|
9269 |
-
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
|
9270 |
-
};
|
9271 |
-
|
9272 |
-
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
|
9273 |
-
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
|
9274 |
-
|
9275 |
-
// normalize opt.queue - true/undefined/null -> "fx"
|
9276 |
-
if ( opt.queue == null || opt.queue === true ) {
|
9277 |
-
opt.queue = "fx";
|
9278 |
-
}
|
9279 |
-
|
9280 |
-
// Queueing
|
9281 |
-
opt.old = opt.complete;
|
9282 |
-
|
9283 |
-
opt.complete = function() {
|
9284 |
-
if ( jQuery.isFunction( opt.old ) ) {
|
9285 |
-
opt.old.call( this );
|
9286 |
-
}
|
9287 |
-
|
9288 |
-
if ( opt.queue ) {
|
9289 |
-
jQuery.dequeue( this, opt.queue );
|
9290 |
-
}
|
9291 |
-
};
|
9292 |
-
|
9293 |
-
return opt;
|
9294 |
-
};
|
9295 |
-
|
9296 |
-
jQuery.easing = {
|
9297 |
-
linear: function( p ) {
|
9298 |
-
return p;
|
9299 |
-
},
|
9300 |
-
swing: function( p ) {
|
9301 |
-
return 0.5 - Math.cos( p*Math.PI ) / 2;
|
9302 |
-
}
|
9303 |
-
};
|
9304 |
-
|
9305 |
-
jQuery.timers = [];
|
9306 |
-
jQuery.fx = Tween.prototype.init;
|
9307 |
-
jQuery.fx.tick = function() {
|
9308 |
-
var timer,
|
9309 |
-
timers = jQuery.timers,
|
9310 |
-
i = 0;
|
9311 |
-
|
9312 |
-
fxNow = jQuery.now();
|
9313 |
-
|
9314 |
-
for ( ; i < timers.length; i++ ) {
|
9315 |
-
timer = timers[ i ];
|
9316 |
-
// Checks the timer has not already been removed
|
9317 |
-
if ( !timer() && timers[ i ] === timer ) {
|
9318 |
-
timers.splice( i--, 1 );
|
9319 |
-
}
|
9320 |
-
}
|
9321 |
-
|
9322 |
-
if ( !timers.length ) {
|
9323 |
-
jQuery.fx.stop();
|
9324 |
-
}
|
9325 |
-
fxNow = undefined;
|
9326 |
-
};
|
9327 |
-
|
9328 |
-
jQuery.fx.timer = function( timer ) {
|
9329 |
-
if ( timer() && jQuery.timers.push( timer ) ) {
|
9330 |
-
jQuery.fx.start();
|
9331 |
-
}
|
9332 |
-
};
|
9333 |
-
|
9334 |
-
jQuery.fx.interval = 13;
|
9335 |
-
|
9336 |
-
jQuery.fx.start = function() {
|
9337 |
-
if ( !timerId ) {
|
9338 |
-
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
|
9339 |
-
}
|
9340 |
-
};
|
9341 |
-
|
9342 |
-
jQuery.fx.stop = function() {
|
9343 |
-
clearInterval( timerId );
|
9344 |
-
timerId = null;
|
9345 |
-
};
|
9346 |
-
|
9347 |
-
jQuery.fx.speeds = {
|
9348 |
-
slow: 600,
|
9349 |
-
fast: 200,
|
9350 |
-
// Default speed
|
9351 |
-
_default: 400
|
9352 |
-
};
|
9353 |
-
|
9354 |
-
// Back Compat <1.8 extension point
|
9355 |
-
jQuery.fx.step = {};
|
9356 |
-
|
9357 |
-
if ( jQuery.expr && jQuery.expr.filters ) {
|
9358 |
-
jQuery.expr.filters.animated = function( elem ) {
|
9359 |
-
return jQuery.grep(jQuery.timers, function( fn ) {
|
9360 |
-
return elem === fn.elem;
|
9361 |
-
}).length;
|
9362 |
-
};
|
9363 |
-
}
|
9364 |
-
jQuery.fn.offset = function( options ) {
|
9365 |
-
if ( arguments.length ) {
|
9366 |
-
return options === undefined ?
|
9367 |
-
this :
|
9368 |
-
this.each(function( i ) {
|
9369 |
-
jQuery.offset.setOffset( this, options, i );
|
9370 |
-
});
|
9371 |
-
}
|
9372 |
-
|
9373 |
-
var docElem, win,
|
9374 |
-
box = { top: 0, left: 0 },
|
9375 |
-
elem = this[ 0 ],
|
9376 |
-
doc = elem && elem.ownerDocument;
|
9377 |
-
|
9378 |
-
if ( !doc ) {
|
9379 |
-
return;
|
9380 |
-
}
|
9381 |
-
|
9382 |
-
docElem = doc.documentElement;
|
9383 |
-
|
9384 |
-
// Make sure it's not a disconnected DOM node
|
9385 |
-
if ( !jQuery.contains( docElem, elem ) ) {
|
9386 |
-
return box;
|
9387 |
-
}
|
9388 |
-
|
9389 |
-
// If we don't have gBCR, just use 0,0 rather than error
|
9390 |
-
// BlackBerry 5, iOS 3 (original iPhone)
|
9391 |
-
if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
|
9392 |
-
box = elem.getBoundingClientRect();
|
9393 |
-
}
|
9394 |
-
win = getWindow( doc );
|
9395 |
-
return {
|
9396 |
-
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
|
9397 |
-
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
|
9398 |
-
};
|
9399 |
-
};
|
9400 |
-
|
9401 |
-
jQuery.offset = {
|
9402 |
-
|
9403 |
-
setOffset: function( elem, options, i ) {
|
9404 |
-
var position = jQuery.css( elem, "position" );
|
9405 |
-
|
9406 |
-
// set position first, in-case top/left are set even on static elem
|
9407 |
-
if ( position === "static" ) {
|
9408 |
-
elem.style.position = "relative";
|
9409 |
-
}
|
9410 |
-
|
9411 |
-
var curElem = jQuery( elem ),
|
9412 |
-
curOffset = curElem.offset(),
|
9413 |
-
curCSSTop = jQuery.css( elem, "top" ),
|
9414 |
-
curCSSLeft = jQuery.css( elem, "left" ),
|
9415 |
-
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
|
9416 |
-
props = {}, curPosition = {}, curTop, curLeft;
|
9417 |
-
|
9418 |
-
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
9419 |
-
if ( calculatePosition ) {
|
9420 |
-
curPosition = curElem.position();
|
9421 |
-
curTop = curPosition.top;
|
9422 |
-
curLeft = curPosition.left;
|
9423 |
-
} else {
|
9424 |
-
curTop = parseFloat( curCSSTop ) || 0;
|
9425 |
-
curLeft = parseFloat( curCSSLeft ) || 0;
|
9426 |
-
}
|
9427 |
-
|
9428 |
-
if ( jQuery.isFunction( options ) ) {
|
9429 |
-
options = options.call( elem, i, curOffset );
|
9430 |
-
}
|
9431 |
-
|
9432 |
-
if ( options.top != null ) {
|
9433 |
-
props.top = ( options.top - curOffset.top ) + curTop;
|
9434 |
-
}
|
9435 |
-
if ( options.left != null ) {
|
9436 |
-
props.left = ( options.left - curOffset.left ) + curLeft;
|
9437 |
-
}
|
9438 |
-
|
9439 |
-
if ( "using" in options ) {
|
9440 |
-
options.using.call( elem, props );
|
9441 |
-
} else {
|
9442 |
-
curElem.css( props );
|
9443 |
-
}
|
9444 |
-
}
|
9445 |
-
};
|
9446 |
-
|
9447 |
-
|
9448 |
-
jQuery.fn.extend({
|
9449 |
-
|
9450 |
-
position: function() {
|
9451 |
-
if ( !this[ 0 ] ) {
|
9452 |
-
return;
|
9453 |
-
}
|
9454 |
-
|
9455 |
-
var offsetParent, offset,
|
9456 |
-
parentOffset = { top: 0, left: 0 },
|
9457 |
-
elem = this[ 0 ];
|
9458 |
-
|
9459 |
-
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
|
9460 |
-
if ( jQuery.css( elem, "position" ) === "fixed" ) {
|
9461 |
-
// we assume that getBoundingClientRect is available when computed position is fixed
|
9462 |
-
offset = elem.getBoundingClientRect();
|
9463 |
-
} else {
|
9464 |
-
// Get *real* offsetParent
|
9465 |
-
offsetParent = this.offsetParent();
|
9466 |
-
|
9467 |
-
// Get correct offsets
|
9468 |
-
offset = this.offset();
|
9469 |
-
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
|
9470 |
-
parentOffset = offsetParent.offset();
|
9471 |
-
}
|
9472 |
-
|
9473 |
-
// Add offsetParent borders
|
9474 |
-
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
|
9475 |
-
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
|
9476 |
-
}
|
9477 |
-
|
9478 |
-
// Subtract parent offsets and element margins
|
9479 |
-
// note: when an element has margin: auto the offsetLeft and marginLeft
|
9480 |
-
// are the same in Safari causing offset.left to incorrectly be 0
|
9481 |
-
return {
|
9482 |
-
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
|
9483 |
-
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
|
9484 |
-
};
|
9485 |
-
},
|
9486 |
-
|
9487 |
-
offsetParent: function() {
|
9488 |
-
return this.map(function() {
|
9489 |
-
var offsetParent = this.offsetParent || document.documentElement;
|
9490 |
-
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
|
9491 |
-
offsetParent = offsetParent.offsetParent;
|
9492 |
-
}
|
9493 |
-
return offsetParent || document.documentElement;
|
9494 |
-
});
|
9495 |
-
}
|
9496 |
-
});
|
9497 |
-
|
9498 |
-
|
9499 |
-
// Create scrollLeft and scrollTop methods
|
9500 |
-
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
|
9501 |
-
var top = /Y/.test( prop );
|
9502 |
-
|
9503 |
-
jQuery.fn[ method ] = function( val ) {
|
9504 |
-
return jQuery.access( this, function( elem, method, val ) {
|
9505 |
-
var win = getWindow( elem );
|
9506 |
-
|
9507 |
-
if ( val === undefined ) {
|
9508 |
-
return win ? (prop in win) ? win[ prop ] :
|
9509 |
-
win.document.documentElement[ method ] :
|
9510 |
-
elem[ method ];
|
9511 |
-
}
|
9512 |
-
|
9513 |
-
if ( win ) {
|
9514 |
-
win.scrollTo(
|
9515 |
-
!top ? val : jQuery( win ).scrollLeft(),
|
9516 |
-
top ? val : jQuery( win ).scrollTop()
|
9517 |
-
);
|
9518 |
-
|
9519 |
-
} else {
|
9520 |
-
elem[ method ] = val;
|
9521 |
-
}
|
9522 |
-
}, method, val, arguments.length, null );
|
9523 |
-
};
|
9524 |
-
});
|
9525 |
-
|
9526 |
-
function getWindow( elem ) {
|
9527 |
-
return jQuery.isWindow( elem ) ?
|
9528 |
-
elem :
|
9529 |
-
elem.nodeType === 9 ?
|
9530 |
-
elem.defaultView || elem.parentWindow :
|
9531 |
-
false;
|
9532 |
-
}
|
9533 |
-
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
|
9534 |
-
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
9535 |
-
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
|
9536 |
-
// margin is only for outerHeight, outerWidth
|
9537 |
-
jQuery.fn[ funcName ] = function( margin, value ) {
|
9538 |
-
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
|
9539 |
-
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
|
9540 |
-
|
9541 |
-
return jQuery.access( this, function( elem, type, value ) {
|
9542 |
-
var doc;
|
9543 |
-
|
9544 |
-
if ( jQuery.isWindow( elem ) ) {
|
9545 |
-
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
|
9546 |
-
// isn't a whole lot we can do. See pull request at this URL for discussion:
|
9547 |
-
// https://github.com/jquery/jquery/pull/764
|
9548 |
-
return elem.document.documentElement[ "client" + name ];
|
9549 |
-
}
|
9550 |
-
|
9551 |
-
// Get document width or height
|
9552 |
-
if ( elem.nodeType === 9 ) {
|
9553 |
-
doc = elem.documentElement;
|
9554 |
-
|
9555 |
-
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
|
9556 |
-
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
|
9557 |
-
return Math.max(
|
9558 |
-
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
|
9559 |
-
elem.body[ "offset" + name ], doc[ "offset" + name ],
|
9560 |
-
doc[ "client" + name ]
|
9561 |
-
);
|
9562 |
-
}
|
9563 |
-
|
9564 |
-
return value === undefined ?
|
9565 |
-
// Get width or height on the element, requesting but not forcing parseFloat
|
9566 |
-
jQuery.css( elem, type, extra ) :
|
9567 |
-
|
9568 |
-
// Set width or height on the element
|
9569 |
-
jQuery.style( elem, type, value, extra );
|
9570 |
-
}, type, chainable ? margin : undefined, chainable, null );
|
9571 |
-
};
|
9572 |
-
});
|
9573 |
-
});
|
9574 |
-
// Limit scope pollution from any deprecated API
|
9575 |
-
// (function() {
|
9576 |
-
|
9577 |
-
// })();
|
9578 |
-
// Expose jQuery to the global object
|
9579 |
-
window.jQuery = window.$ = jQuery;
|
9580 |
-
|
9581 |
-
// Expose jQuery as an AMD module, but only for AMD loaders that
|
9582 |
-
// understand the issues with loading multiple versions of jQuery
|
9583 |
-
// in a page that all might call define(). The loader will indicate
|
9584 |
-
// they have special allowances for multiple jQuery versions by
|
9585 |
-
// specifying define.amd.jQuery = true. Register as a named module,
|
9586 |
-
// since jQuery can be concatenated with other files that may use define,
|
9587 |
-
// but not use a proper concatenation script that understands anonymous
|
9588 |
-
// AMD modules. A named AMD is safest and most robust way to register.
|
9589 |
-
// Lowercase jquery is used because AMD module names are derived from
|
9590 |
-
// file names, and jQuery is normally delivered in a lowercase file name.
|
9591 |
-
// Do this after creating the global so that if an AMD module wants to call
|
9592 |
-
// noConflict to hide this version of jQuery, it will work.
|
9593 |
-
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
|
9594 |
-
define( "jquery", [], function () { return jQuery; } );
|
9595 |
-
}
|
9596 |
-
|
9597 |
-
})( window );
|
1 |
+
/*!
|
2 |
+
* jQuery JavaScript Library v1.9.1
|
3 |
+
* http://jquery.com/
|
4 |
+
*
|
5 |
+
* Includes Sizzle.js
|
6 |
+
* http://sizzlejs.com/
|
7 |
+
*
|
8 |
+
* Copyright 2005, 2012 jQuery Foundation, Inc. and other contributors
|
9 |
+
* Released under the MIT license
|
10 |
+
* http://jquery.org/license
|
11 |
+
*
|
12 |
+
* Date: 2013-2-4
|
13 |
+
*/
|
14 |
+
(function( window, undefined ) {
|
15 |
+
// Can't do this because several apps including ASP.NET trace
|
16 |
+
// the stack via arguments.caller.callee and Firefox dies if
|
17 |
+
// you try to trace through "use strict" call chains. (#13335)
|
18 |
+
// Support: Firefox 18+
|
19 |
+
//"use strict";
|
20 |
+
var
|
21 |
+
// The deferred used on DOM ready
|
22 |
+
readyList,
|
23 |
+
// A central reference to the root jQuery(document)
|
24 |
+
rootjQuery,
|
25 |
+
// Support: IE<9
|
26 |
+
// For `typeof node.method` instead of `node.method !== undefined`
|
27 |
+
core_strundefined = typeof undefined,
|
28 |
+
// Use the correct document accordingly with window argument (sandbox)
|
29 |
+
document = window.document,
|
30 |
+
location = window.location,
|
31 |
+
// Map over jQuery in case of overwrite
|
32 |
+
_jQuery = window.jQuery,
|
33 |
+
// Map over the $ in case of overwrite
|
34 |
+
_$ = window.$,
|
35 |
+
// [[Class]] -> type pairs
|
36 |
+
class2type = {},
|
37 |
+
// List of deleted data cache ids, so we can reuse them
|
38 |
+
core_deletedIds = [],
|
39 |
+
core_version = "1.9.1",
|
40 |
+
// Save a reference to some core methods
|
41 |
+
core_concat = core_deletedIds.concat,
|
42 |
+
core_push = core_deletedIds.push,
|
43 |
+
core_slice = core_deletedIds.slice,
|
44 |
+
core_indexOf = core_deletedIds.indexOf,
|
45 |
+
core_toString = class2type.toString,
|
46 |
+
core_hasOwn = class2type.hasOwnProperty,
|
47 |
+
core_trim = core_version.trim,
|
48 |
+
// Define a local copy of jQuery
|
49 |
+
jQuery = function( selector, context ) {
|
50 |
+
// The jQuery object is actually just the init constructor 'enhanced'
|
51 |
+
return new jQuery.fn.init( selector, context, rootjQuery );
|
52 |
+
},
|
53 |
+
// Used for matching numbers
|
54 |
+
core_pnum = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,
|
55 |
+
// Used for splitting on whitespace
|
56 |
+
core_rnotwhite = /\S+/g,
|
57 |
+
// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
|
58 |
+
rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
|
59 |
+
// A simple way to check for HTML strings
|
60 |
+
// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
|
61 |
+
// Strict HTML recognition (#11290: must start with <)
|
62 |
+
rquickExpr = /^(?:(<[\w\W]+>)[^>]*|#([\w-]*))$/,
|
63 |
+
// Match a standalone tag
|
64 |
+
rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
|
65 |
+
// JSON RegExp
|
66 |
+
rvalidchars = /^[\],:{}\s]*$/,
|
67 |
+
rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
|
68 |
+
rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
|
69 |
+
rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d+\.|)\d+(?:[eE][+-]?\d+|)/g,
|
70 |
+
// Matches dashed string for camelizing
|
71 |
+
rmsPrefix = /^-ms-/,
|
72 |
+
rdashAlpha = /-([\da-z])/gi,
|
73 |
+
// Used by jQuery.camelCase as callback to replace()
|
74 |
+
fcamelCase = function( all, letter ) {
|
75 |
+
return letter.toUpperCase();
|
76 |
+
},
|
77 |
+
// The ready event handler
|
78 |
+
completed = function( event ) {
|
79 |
+
// readyState === "complete" is good enough for us to call the dom ready in oldIE
|
80 |
+
if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
|
81 |
+
detach();
|
82 |
+
jQuery.ready();
|
83 |
+
}
|
84 |
+
},
|
85 |
+
// Clean-up method for dom ready events
|
86 |
+
detach = function() {
|
87 |
+
if ( document.addEventListener ) {
|
88 |
+
document.removeEventListener( "DOMContentLoaded", completed, false );
|
89 |
+
window.removeEventListener( "load", completed, false );
|
90 |
+
} else {
|
91 |
+
document.detachEvent( "onreadystatechange", completed );
|
92 |
+
window.detachEvent( "onload", completed );
|
93 |
+
}
|
94 |
+
};
|
95 |
+
jQuery.fn = jQuery.prototype = {
|
96 |
+
// The current version of jQuery being used
|
97 |
+
jquery: core_version,
|
98 |
+
constructor: jQuery,
|
99 |
+
init: function( selector, context, rootjQuery ) {
|
100 |
+
var match, elem;
|
101 |
+
// HANDLE: $(""), $(null), $(undefined), $(false)
|
102 |
+
if ( !selector ) {
|
103 |
+
return this;
|
104 |
+
}
|
105 |
+
// Handle HTML strings
|
106 |
+
if ( typeof selector === "string" ) {
|
107 |
+
if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
|
108 |
+
// Assume that strings that start and end with <> are HTML and skip the regex check
|
109 |
+
match = [ null, selector, null ];
|
110 |
+
} else {
|
111 |
+
match = rquickExpr.exec( selector );
|
112 |
+
}
|
113 |
+
// Match html or make sure no context is specified for #id
|
114 |
+
if ( match && (match[1] || !context) ) {
|
115 |
+
// HANDLE: $(html) -> $(array)
|
116 |
+
if ( match[1] ) {
|
117 |
+
context = context instanceof jQuery ? context[0] : context;
|
118 |
+
// scripts is true for back-compat
|
119 |
+
jQuery.merge( this, jQuery.parseHTML(
|
120 |
+
match[1],
|
121 |
+
context && context.nodeType ? context.ownerDocument || context : document,
|
122 |
+
true
|
123 |
+
) );
|
124 |
+
// HANDLE: $(html, props)
|
125 |
+
if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
|
126 |
+
for ( match in context ) {
|
127 |
+
// Properties of context are called as methods if possible
|
128 |
+
if ( jQuery.isFunction( this[ match ] ) ) {
|
129 |
+
this[ match ]( context[ match ] );
|
130 |
+
// ...and otherwise set as attributes
|
131 |
+
} else {
|
132 |
+
this.attr( match, context[ match ] );
|
133 |
+
}
|
134 |
+
}
|
135 |
+
}
|
136 |
+
return this;
|
137 |
+
// HANDLE: $(#id)
|
138 |
+
} else {
|
139 |
+
elem = document.getElementById( match[2] );
|
140 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
141 |
+
// nodes that are no longer in the document #6963
|
142 |
+
if ( elem && elem.parentNode ) {
|
143 |
+
// Handle the case where IE and Opera return items
|
144 |
+
// by name instead of ID
|
145 |
+
if ( elem.id !== match[2] ) {
|
146 |
+
return rootjQuery.find( selector );
|
147 |
+
}
|
148 |
+
// Otherwise, we inject the element directly into the jQuery object
|
149 |
+
this.length = 1;
|
150 |
+
this[0] = elem;
|
151 |
+
}
|
152 |
+
this.context = document;
|
153 |
+
this.selector = selector;
|
154 |
+
return this;
|
155 |
+
}
|
156 |
+
// HANDLE: $(expr, $(...))
|
157 |
+
} else if ( !context || context.jquery ) {
|
158 |
+
return ( context || rootjQuery ).find( selector );
|
159 |
+
// HANDLE: $(expr, context)
|
160 |
+
// (which is just equivalent to: $(context).find(expr)
|
161 |
+
} else {
|
162 |
+
return this.constructor( context ).find( selector );
|
163 |
+
}
|
164 |
+
// HANDLE: $(DOMElement)
|
165 |
+
} else if ( selector.nodeType ) {
|
166 |
+
this.context = this[0] = selector;
|
167 |
+
this.length = 1;
|
168 |
+
return this;
|
169 |
+
// HANDLE: $(function)
|
170 |
+
// Shortcut for document ready
|
171 |
+
} else if ( jQuery.isFunction( selector ) ) {
|
172 |
+
return rootjQuery.ready( selector );
|
173 |
+
}
|
174 |
+
if ( selector.selector !== undefined ) {
|
175 |
+
this.selector = selector.selector;
|
176 |
+
this.context = selector.context;
|
177 |
+
}
|
178 |
+
return jQuery.makeArray( selector, this );
|
179 |
+
},
|
180 |
+
// Start with an empty selector
|
181 |
+
selector: "",
|
182 |
+
// The default length of a jQuery object is 0
|
183 |
+
length: 0,
|
184 |
+
// The number of elements contained in the matched element set
|
185 |
+
size: function() {
|
186 |
+
return this.length;
|
187 |
+
},
|
188 |
+
toArray: function() {
|
189 |
+
return core_slice.call( this );
|
190 |
+
},
|
191 |
+
// Get the Nth element in the matched element set OR
|
192 |
+
// Get the whole matched element set as a clean array
|
193 |
+
get: function( num ) {
|
194 |
+
return num == null ?
|
195 |
+
// Return a 'clean' array
|
196 |
+
this.toArray() :
|
197 |
+
// Return just the object
|
198 |
+
( num < 0 ? this[ this.length + num ] : this[ num ] );
|
199 |
+
},
|
200 |
+
// Take an array of elements and push it onto the stack
|
201 |
+
// (returning the new matched element set)
|
202 |
+
pushStack: function( elems ) {
|
203 |
+
// Build a new jQuery matched element set
|
204 |
+
var ret = jQuery.merge( this.constructor(), elems );
|
205 |
+
// Add the old object onto the stack (as a reference)
|
206 |
+
ret.prevObject = this;
|
207 |
+
ret.context = this.context;
|
208 |
+
// Return the newly-formed element set
|
209 |
+
return ret;
|
210 |
+
},
|
211 |
+
// Execute a callback for every element in the matched set.
|
212 |
+
// (You can seed the arguments with an array of args, but this is
|
213 |
+
// only used internally.)
|
214 |
+
each: function( callback, args ) {
|
215 |
+
return jQuery.each( this, callback, args );
|
216 |
+
},
|
217 |
+
ready: function( fn ) {
|
218 |
+
// Add the callback
|
219 |
+
jQuery.ready.promise().done( fn );
|
220 |
+
return this;
|
221 |
+
},
|
222 |
+
slice: function() {
|
223 |
+
return this.pushStack( core_slice.apply( this, arguments ) );
|
224 |
+
},
|
225 |
+
first: function() {
|
226 |
+
return this.eq( 0 );
|
227 |
+
},
|
228 |
+
last: function() {
|
229 |
+
return this.eq( -1 );
|
230 |
+
},
|
231 |
+
eq: function( i ) {
|
232 |
+
var len = this.length,
|
233 |
+
j = +i + ( i < 0 ? len : 0 );
|
234 |
+
return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
|
235 |
+
},
|
236 |
+
map: function( callback ) {
|
237 |
+
return this.pushStack( jQuery.map(this, function( elem, i ) {
|
238 |
+
return callback.call( elem, i, elem );
|
239 |
+
}));
|
240 |
+
},
|
241 |
+
end: function() {
|
242 |
+
return this.prevObject || this.constructor(null);
|
243 |
+
},
|
244 |
+
// For internal use only.
|
245 |
+
// Behaves like an Array's method, not like a jQuery method.
|
246 |
+
push: core_push,
|
247 |
+
sort: [].sort,
|
248 |
+
splice: [].splice
|
249 |
+
};
|
250 |
+
// Give the init function the jQuery prototype for later instantiation
|
251 |
+
jQuery.fn.init.prototype = jQuery.fn;
|
252 |
+
jQuery.extend = jQuery.fn.extend = function() {
|
253 |
+
var src, copyIsArray, copy, name, options, clone,
|
254 |
+
target = arguments[0] || {},
|
255 |
+
i = 1,
|
256 |
+
length = arguments.length,
|
257 |
+
deep = false;
|
258 |
+
// Handle a deep copy situation
|
259 |
+
if ( typeof target === "boolean" ) {
|
260 |
+
deep = target;
|
261 |
+
target = arguments[1] || {};
|
262 |
+
// skip the boolean and the target
|
263 |
+
i = 2;
|
264 |
+
}
|
265 |
+
// Handle case when target is a string or something (possible in deep copy)
|
266 |
+
if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
|
267 |
+
target = {};
|
268 |
+
}
|
269 |
+
// extend jQuery itself if only one argument is passed
|
270 |
+
if ( length === i ) {
|
271 |
+
target = this;
|
272 |
+
--i;
|
273 |
+
}
|
274 |
+
for ( ; i < length; i++ ) {
|
275 |
+
// Only deal with non-null/undefined values
|
276 |
+
if ( (options = arguments[ i ]) != null ) {
|
277 |
+
// Extend the base object
|
278 |
+
for ( name in options ) {
|
279 |
+
src = target[ name ];
|
280 |
+
copy = options[ name ];
|
281 |
+
// Prevent never-ending loop
|
282 |
+
if ( target === copy ) {
|
283 |
+
continue;
|
284 |
+
}
|
285 |
+
// Recurse if we're merging plain objects or arrays
|
286 |
+
if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
|
287 |
+
if ( copyIsArray ) {
|
288 |
+
copyIsArray = false;
|
289 |
+
clone = src && jQuery.isArray(src) ? src : [];
|
290 |
+
} else {
|
291 |
+
clone = src && jQuery.isPlainObject(src) ? src : {};
|
292 |
+
}
|
293 |
+
// Never move original objects, clone them
|
294 |
+
target[ name ] = jQuery.extend( deep, clone, copy );
|
295 |
+
// Don't bring in undefined values
|
296 |
+
} else if ( copy !== undefined ) {
|
297 |
+
target[ name ] = copy;
|
298 |
+
}
|
299 |
+
}
|
300 |
+
}
|
301 |
+
}
|
302 |
+
// Return the modified object
|
303 |
+
return target;
|
304 |
+
};
|
305 |
+
jQuery.extend({
|
306 |
+
noConflict: function( deep ) {
|
307 |
+
if ( window.$ === jQuery ) {
|
308 |
+
window.$ = _$;
|
309 |
+
}
|
310 |
+
if ( deep && window.jQuery === jQuery ) {
|
311 |
+
window.jQuery = _jQuery;
|
312 |
+
}
|
313 |
+
return jQuery;
|
314 |
+
},
|
315 |
+
// Is the DOM ready to be used? Set to true once it occurs.
|
316 |
+
isReady: false,
|
317 |
+
// A counter to track how many items to wait for before
|
318 |
+
// the ready event fires. See #6781
|
319 |
+
readyWait: 1,
|
320 |
+
// Hold (or release) the ready event
|
321 |
+
holdReady: function( hold ) {
|
322 |
+
if ( hold ) {
|
323 |
+
jQuery.readyWait++;
|
324 |
+
} else {
|
325 |
+
jQuery.ready( true );
|
326 |
+
}
|
327 |
+
},
|
328 |
+
// Handle when the DOM is ready
|
329 |
+
ready: function( wait ) {
|
330 |
+
// Abort if there are pending holds or we're already ready
|
331 |
+
if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
|
332 |
+
return;
|
333 |
+
}
|
334 |
+
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
|
335 |
+
if ( !document.body ) {
|
336 |
+
return setTimeout( jQuery.ready );
|
337 |
+
}
|
338 |
+
// Remember that the DOM is ready
|
339 |
+
jQuery.isReady = true;
|
340 |
+
// If a normal DOM Ready event fired, decrement, and wait if need be
|
341 |
+
if ( wait !== true && --jQuery.readyWait > 0 ) {
|
342 |
+
return;
|
343 |
+
}
|
344 |
+
// If there are functions bound, to execute
|
345 |
+
readyList.resolveWith( document, [ jQuery ] );
|
346 |
+
// Trigger any bound ready events
|
347 |
+
if ( jQuery.fn.trigger ) {
|
348 |
+
jQuery( document ).trigger("ready").off("ready");
|
349 |
+
}
|
350 |
+
},
|
351 |
+
// See test/unit/core.js for details concerning isFunction.
|
352 |
+
// Since version 1.3, DOM methods and functions like alert
|
353 |
+
// aren't supported. They return false on IE (#2968).
|
354 |
+
isFunction: function( obj ) {
|
355 |
+
return jQuery.type(obj) === "function";
|
356 |
+
},
|
357 |
+
isArray: Array.isArray || function( obj ) {
|
358 |
+
return jQuery.type(obj) === "array";
|
359 |
+
},
|
360 |
+
isWindow: function( obj ) {
|
361 |
+
return obj != null && obj == obj.window;
|
362 |
+
},
|
363 |
+
isNumeric: function( obj ) {
|
364 |
+
return !isNaN( parseFloat(obj) ) && isFinite( obj );
|
365 |
+
},
|
366 |
+
type: function( obj ) {
|
367 |
+
if ( obj == null ) {
|
368 |
+
return String( obj );
|
369 |
+
}
|
370 |
+
return typeof obj === "object" || typeof obj === "function" ?
|
371 |
+
class2type[ core_toString.call(obj) ] || "object" :
|
372 |
+
typeof obj;
|
373 |
+
},
|
374 |
+
isPlainObject: function( obj ) {
|
375 |
+
// Must be an Object.
|
376 |
+
// Because of IE, we also have to check the presence of the constructor property.
|
377 |
+
// Make sure that DOM nodes and window objects don't pass through, as well
|
378 |
+
if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
|
379 |
+
return false;
|
380 |
+
}
|
381 |
+
try {
|
382 |
+
// Not own constructor property must be Object
|
383 |
+
if ( obj.constructor &&
|
384 |
+
!core_hasOwn.call(obj, "constructor") &&
|
385 |
+
!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
|
386 |
+
return false;
|
387 |
+
}
|
388 |
+
} catch ( e ) {
|
389 |
+
// IE8,9 Will throw exceptions on certain host objects #9897
|
390 |
+
return false;
|
391 |
+
}
|
392 |
+
// Own properties are enumerated firstly, so to speed up,
|
393 |
+
// if last one is own, then all properties are own.
|
394 |
+
var key;
|
395 |
+
for ( key in obj ) {}
|
396 |
+
return key === undefined || core_hasOwn.call( obj, key );
|
397 |
+
},
|
398 |
+
isEmptyObject: function( obj ) {
|
399 |
+
var name;
|
400 |
+
for ( name in obj ) {
|
401 |
+
return false;
|
402 |
+
}
|
403 |
+
return true;
|
404 |
+
},
|
405 |
+
error: function( msg ) {
|
406 |
+
throw new Error( msg );
|
407 |
+
},
|
408 |
+
// data: string of html
|
409 |
+
// context (optional): If specified, the fragment will be created in this context, defaults to document
|
410 |
+
// keepScripts (optional): If true, will include scripts passed in the html string
|
411 |
+
parseHTML: function( data, context, keepScripts ) {
|
412 |
+
if ( !data || typeof data !== "string" ) {
|
413 |
+
return null;
|
414 |
+
}
|
415 |
+
if ( typeof context === "boolean" ) {
|
416 |
+
keepScripts = context;
|
417 |
+
context = false;
|
418 |
+
}
|
419 |
+
context = context || document;
|
420 |
+
var parsed = rsingleTag.exec( data ),
|
421 |
+
scripts = !keepScripts && [];
|
422 |
+
// Single tag
|
423 |
+
if ( parsed ) {
|
424 |
+
return [ context.createElement( parsed[1] ) ];
|
425 |
+
}
|
426 |
+
parsed = jQuery.buildFragment( [ data ], context, scripts );
|
427 |
+
if ( scripts ) {
|
428 |
+
jQuery( scripts ).remove();
|
429 |
+
}
|
430 |
+
return jQuery.merge( [], parsed.childNodes );
|
431 |
+
},
|
432 |
+
parseJSON: function( data ) {
|
433 |
+
// Attempt to parse using the native JSON parser first
|
434 |
+
if ( window.JSON && window.JSON.parse ) {
|
435 |
+
return window.JSON.parse( data );
|
436 |
+
}
|
437 |
+
if ( data === null ) {
|
438 |
+
return data;
|
439 |
+
}
|
440 |
+
if ( typeof data === "string" ) {
|
441 |
+
// Make sure leading/trailing whitespace is removed (IE can't handle it)
|
442 |
+
data = jQuery.trim( data );
|
443 |
+
if ( data ) {
|
444 |
+
// Make sure the incoming data is actual JSON
|
445 |
+
// Logic borrowed from http://json.org/json2.js
|
446 |
+
if ( rvalidchars.test( data.replace( rvalidescape, "@" )
|
447 |
+
.replace( rvalidtokens, "]" )
|
448 |
+
.replace( rvalidbraces, "")) ) {
|
449 |
+
return ( new Function( "return " + data ) )();
|
450 |
+
}
|
451 |
+
}
|
452 |
+
}
|
453 |
+
jQuery.error( "Invalid JSON: " + data );
|
454 |
+
},
|
455 |
+
// Cross-browser xml parsing
|
456 |
+
parseXML: function( data ) {
|
457 |
+
var xml, tmp;
|
458 |
+
if ( !data || typeof data !== "string" ) {
|
459 |
+
return null;
|
460 |
+
}
|
461 |
+
try {
|
462 |
+
if ( window.DOMParser ) { // Standard
|
463 |
+
tmp = new DOMParser();
|
464 |
+
xml = tmp.parseFromString( data , "text/xml" );
|
465 |
+
} else { // IE
|
466 |
+
xml = new ActiveXObject( "Microsoft.XMLDOM" );
|
467 |
+
xml.async = "false";
|
468 |
+
xml.loadXML( data );
|
469 |
+
}
|
470 |
+
} catch( e ) {
|
471 |
+
xml = undefined;
|
472 |
+
}
|
473 |
+
if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
|
474 |
+
jQuery.error( "Invalid XML: " + data );
|
475 |
+
}
|
476 |
+
return xml;
|
477 |
+
},
|
478 |
+
noop: function() {},
|
479 |
+
// Evaluates a script in a global context
|
480 |
+
// Workarounds based on findings by Jim Driscoll
|
481 |
+
// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
|
482 |
+
globalEval: function( data ) {
|
483 |
+
if ( data && jQuery.trim( data ) ) {
|
484 |
+
// We use execScript on Internet Explorer
|
485 |
+
// We use an anonymous function so that context is window
|
486 |
+
// rather than jQuery in Firefox
|
487 |
+
( window.execScript || function( data ) {
|
488 |
+
window[ "eval" ].call( window, data );
|
489 |
+
} )( data );
|
490 |
+
}
|
491 |
+
},
|
492 |
+
// Convert dashed to camelCase; used by the css and data modules
|
493 |
+
// Microsoft forgot to hump their vendor prefix (#9572)
|
494 |
+
camelCase: function( string ) {
|
495 |
+
return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
|
496 |
+
},
|
497 |
+
nodeName: function( elem, name ) {
|
498 |
+
return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
|
499 |
+
},
|
500 |
+
// args is for internal usage only
|
501 |
+
each: function( obj, callback, args ) {
|
502 |
+
var value,
|
503 |
+
i = 0,
|
504 |
+
length = obj.length,
|
505 |
+
isArray = isArraylike( obj );
|
506 |
+
if ( args ) {
|
507 |
+
if ( isArray ) {
|
508 |
+
for ( ; i < length; i++ ) {
|
509 |
+
value = callback.apply( obj[ i ], args );
|
510 |
+
if ( value === false ) {
|
511 |
+
break;
|
512 |
+
}
|
513 |
+
}
|
514 |
+
} else {
|
515 |
+
for ( i in obj ) {
|
516 |
+
value = callback.apply( obj[ i ], args );
|
517 |
+
if ( value === false ) {
|
518 |
+
break;
|
519 |
+
}
|
520 |
+
}
|
521 |
+
}
|
522 |
+
// A special, fast, case for the most common use of each
|
523 |
+
} else {
|
524 |
+
if ( isArray ) {
|
525 |
+
for ( ; i < length; i++ ) {
|
526 |
+
value = callback.call( obj[ i ], i, obj[ i ] );
|
527 |
+
if ( value === false ) {
|
528 |
+
break;
|
529 |
+
}
|
530 |
+
}
|
531 |
+
} else {
|
532 |
+
for ( i in obj ) {
|
533 |
+
value = callback.call( obj[ i ], i, obj[ i ] );
|
534 |
+
if ( value === false ) {
|
535 |
+
break;
|
536 |
+
}
|
537 |
+
}
|
538 |
+
}
|
539 |
+
}
|
540 |
+
return obj;
|
541 |
+
},
|
542 |
+
// Use native String.trim function wherever possible
|
543 |
+
trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
|
544 |
+
function( text ) {
|
545 |
+
return text == null ?
|
546 |
+
"" :
|
547 |
+
core_trim.call( text );
|
548 |
+
} :
|
549 |
+
// Otherwise use our own trimming functionality
|
550 |
+
function( text ) {
|
551 |
+
return text == null ?
|
552 |
+
"" :
|
553 |
+
( text + "" ).replace( rtrim, "" );
|
554 |
+
},
|
555 |
+
// results is for internal usage only
|
556 |
+
makeArray: function( arr, results ) {
|
557 |
+
var ret = results || [];
|
558 |
+
if ( arr != null ) {
|
559 |
+
if ( isArraylike( Object(arr) ) ) {
|
560 |
+
jQuery.merge( ret,
|
561 |
+
typeof arr === "string" ?
|
562 |
+
[ arr ] : arr
|
563 |
+
);
|
564 |
+
} else {
|
565 |
+
core_push.call( ret, arr );
|
566 |
+
}
|
567 |
+
}
|
568 |
+
return ret;
|
569 |
+
},
|
570 |
+
inArray: function( elem, arr, i ) {
|
571 |
+
var len;
|
572 |
+
if ( arr ) {
|
573 |
+
if ( core_indexOf ) {
|
574 |
+
return core_indexOf.call( arr, elem, i );
|
575 |
+
}
|
576 |
+
len = arr.length;
|
577 |
+
i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
|
578 |
+
for ( ; i < len; i++ ) {
|
579 |
+
// Skip accessing in sparse arrays
|
580 |
+
if ( i in arr && arr[ i ] === elem ) {
|
581 |
+
return i;
|
582 |
+
}
|
583 |
+
}
|
584 |
+
}
|
585 |
+
return -1;
|
586 |
+
},
|
587 |
+
merge: function( first, second ) {
|
588 |
+
var l = second.length,
|
589 |
+
i = first.length,
|
590 |
+
j = 0;
|
591 |
+
if ( typeof l === "number" ) {
|
592 |
+
for ( ; j < l; j++ ) {
|
593 |
+
first[ i++ ] = second[ j ];
|
594 |
+
}
|
595 |
+
} else {
|
596 |
+
while ( second[j] !== undefined ) {
|
597 |
+
first[ i++ ] = second[ j++ ];
|
598 |
+
}
|
599 |
+
}
|
600 |
+
first.length = i;
|
601 |
+
return first;
|
602 |
+
},
|
603 |
+
grep: function( elems, callback, inv ) {
|
604 |
+
var retVal,
|
605 |
+
ret = [],
|
606 |
+
i = 0,
|
607 |
+
length = elems.length;
|
608 |
+
inv = !!inv;
|
609 |
+
// Go through the array, only saving the items
|
610 |
+
// that pass the validator function
|
611 |
+
for ( ; i < length; i++ ) {
|
612 |
+
retVal = !!callback( elems[ i ], i );
|
613 |
+
if ( inv !== retVal ) {
|
614 |
+
ret.push( elems[ i ] );
|
615 |
+
}
|
616 |
+
}
|
617 |
+
return ret;
|
618 |
+
},
|
619 |
+
// arg is for internal usage only
|
620 |
+
map: function( elems, callback, arg ) {
|
621 |
+
var value,
|
622 |
+
i = 0,
|
623 |
+
length = elems.length,
|
624 |
+
isArray = isArraylike( elems ),
|
625 |
+
ret = [];
|
626 |
+
// Go through the array, translating each of the items to their
|
627 |
+
if ( isArray ) {
|
628 |
+
for ( ; i < length; i++ ) {
|
629 |
+
value = callback( elems[ i ], i, arg );
|
630 |
+
if ( value != null ) {
|
631 |
+
ret[ ret.length ] = value;
|
632 |
+
}
|
633 |
+
}
|
634 |
+
// Go through every key on the object,
|
635 |
+
} else {
|
636 |
+
for ( i in elems ) {
|
637 |
+
value = callback( elems[ i ], i, arg );
|
638 |
+
if ( value != null ) {
|
639 |
+
ret[ ret.length ] = value;
|
640 |
+
}
|
641 |
+
}
|
642 |
+
}
|
643 |
+
// Flatten any nested arrays
|
644 |
+
return core_concat.apply( [], ret );
|
645 |
+
},
|
646 |
+
// A global GUID counter for objects
|
647 |
+
guid: 1,
|
648 |
+
// Bind a function to a context, optionally partially applying any
|
649 |
+
// arguments.
|
650 |
+
proxy: function( fn, context ) {
|
651 |
+
var args, proxy, tmp;
|
652 |
+
if ( typeof context === "string" ) {
|
653 |
+
tmp = fn[ context ];
|
654 |
+
context = fn;
|
655 |
+
fn = tmp;
|
656 |
+
}
|
657 |
+
// Quick check to determine if target is callable, in the spec
|
658 |
+
// this throws a TypeError, but we will just return undefined.
|
659 |
+
if ( !jQuery.isFunction( fn ) ) {
|
660 |
+
return undefined;
|
661 |
+
}
|
662 |
+
// Simulated bind
|
663 |
+
args = core_slice.call( arguments, 2 );
|
664 |
+
proxy = function() {
|
665 |
+
return fn.apply( context || this, args.concat( core_slice.call( arguments ) ) );
|
666 |
+
};
|
667 |
+
// Set the guid of unique handler to the same of original handler, so it can be removed
|
668 |
+
proxy.guid = fn.guid = fn.guid || jQuery.guid++;
|
669 |
+
return proxy;
|
670 |
+
},
|
671 |
+
// Multifunctional method to get and set values of a collection
|
672 |
+
// The value/s can optionally be executed if it's a function
|
673 |
+
access: function( elems, fn, key, value, chainable, emptyGet, raw ) {
|
674 |
+
var i = 0,
|
675 |
+
length = elems.length,
|
676 |
+
bulk = key == null;
|
677 |
+
// Sets many values
|
678 |
+
if ( jQuery.type( key ) === "object" ) {
|
679 |
+
chainable = true;
|
680 |
+
for ( i in key ) {
|
681 |
+
jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
|
682 |
+
}
|
683 |
+
// Sets one value
|
684 |
+
} else if ( value !== undefined ) {
|
685 |
+
chainable = true;
|
686 |
+
if ( !jQuery.isFunction( value ) ) {
|
687 |
+
raw = true;
|
688 |
+
}
|
689 |
+
if ( bulk ) {
|
690 |
+
// Bulk operations run against the entire set
|
691 |
+
if ( raw ) {
|
692 |
+
fn.call( elems, value );
|
693 |
+
fn = null;
|
694 |
+
// ...except when executing function values
|
695 |
+
} else {
|
696 |
+
bulk = fn;
|
697 |
+
fn = function( elem, key, value ) {
|
698 |
+
return bulk.call( jQuery( elem ), value );
|
699 |
+
};
|
700 |
+
}
|
701 |
+
}
|
702 |
+
if ( fn ) {
|
703 |
+
for ( ; i < length; i++ ) {
|
704 |
+
fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
|
705 |
+
}
|
706 |
+
}
|
707 |
+
}
|
708 |
+
return chainable ?
|
709 |
+
elems :
|
710 |
+
// Gets
|
711 |
+
bulk ?
|
712 |
+
fn.call( elems ) :
|
713 |
+
length ? fn( elems[0], key ) : emptyGet;
|
714 |
+
},
|
715 |
+
now: function() {
|
716 |
+
return ( new Date() ).getTime();
|
717 |
+
}
|
718 |
+
});
|
719 |
+
jQuery.ready.promise = function( obj ) {
|
720 |
+
if ( !readyList ) {
|
721 |
+
readyList = jQuery.Deferred();
|
722 |
+
// Catch cases where $(document).ready() is called after the browser event has already occurred.
|
723 |
+
// we once tried to use readyState "interactive" here, but it caused issues like the one
|
724 |
+
// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
|
725 |
+
if ( document.readyState === "complete" ) {
|
726 |
+
// Handle it asynchronously to allow scripts the opportunity to delay ready
|
727 |
+
setTimeout( jQuery.ready );
|
728 |
+
// Standards-based browsers support DOMContentLoaded
|
729 |
+
} else if ( document.addEventListener ) {
|
730 |
+
// Use the handy event callback
|
731 |
+
document.addEventListener( "DOMContentLoaded", completed, false );
|
732 |
+
// A fallback to window.onload, that will always work
|
733 |
+
window.addEventListener( "load", completed, false );
|
734 |
+
// If IE event model is used
|
735 |
+
} else {
|
736 |
+
// Ensure firing before onload, maybe late but safe also for iframes
|
737 |
+
document.attachEvent( "onreadystatechange", completed );
|
738 |
+
// A fallback to window.onload, that will always work
|
739 |
+
window.attachEvent( "onload", completed );
|
740 |
+
// If IE and not a frame
|
741 |
+
// continually check to see if the document is ready
|
742 |
+
var top = false;
|
743 |
+
try {
|
744 |
+
top = window.frameElement == null && document.documentElement;
|
745 |
+
} catch(e) {}
|
746 |
+
if ( top && top.doScroll ) {
|
747 |
+
(function doScrollCheck() {
|
748 |
+
if ( !jQuery.isReady ) {
|
749 |
+
try {
|
750 |
+
// Use the trick by Diego Perini
|
751 |
+
// http://javascript.nwbox.com/IEContentLoaded/
|
752 |
+
top.doScroll("left");
|
753 |
+
} catch(e) {
|
754 |
+
return setTimeout( doScrollCheck, 50 );
|
755 |
+
}
|
756 |
+
// detach all dom ready events
|
757 |
+
detach();
|
758 |
+
// and execute any waiting functions
|
759 |
+
jQuery.ready();
|
760 |
+
}
|
761 |
+
})();
|
762 |
+
}
|
763 |
+
}
|
764 |
+
}
|
765 |
+
return readyList.promise( obj );
|
766 |
+
};
|
767 |
+
// Populate the class2type map
|
768 |
+
jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
|
769 |
+
class2type[ "[object " + name + "]" ] = name.toLowerCase();
|
770 |
+
});
|
771 |
+
function isArraylike( obj ) {
|
772 |
+
var length = obj.length,
|
773 |
+
type = jQuery.type( obj );
|
774 |
+
if ( jQuery.isWindow( obj ) ) {
|
775 |
+
return false;
|
776 |
+
}
|
777 |
+
if ( obj.nodeType === 1 && length ) {
|
778 |
+
return true;
|
779 |
+
}
|
780 |
+
return type === "array" || type !== "function" &&
|
781 |
+
( length === 0 ||
|
782 |
+
typeof length === "number" && length > 0 && ( length - 1 ) in obj );
|
783 |
+
}
|
784 |
+
// All jQuery objects should point back to these
|
785 |
+
rootjQuery = jQuery(document);
|
786 |
+
// String to Object options format cache
|
787 |
+
var optionsCache = {};
|
788 |
+
// Convert String-formatted options into Object-formatted ones and store in cache
|
789 |
+
function createOptions( options ) {
|
790 |
+
var object = optionsCache[ options ] = {};
|
791 |
+
jQuery.each( options.match( core_rnotwhite ) || [], function( _, flag ) {
|
792 |
+
object[ flag ] = true;
|
793 |
+
});
|
794 |
+
return object;
|
795 |
+
}
|
796 |
+
/*
|
797 |
+
* Create a callback list using the following parameters:
|
798 |
+
*
|
799 |
+
* options: an optional list of space-separated options that will change how
|
800 |
+
* the callback list behaves or a more traditional option object
|
801 |
+
*
|
802 |
+
* By default a callback list will act like an event callback list and can be
|
803 |
+
* "fired" multiple times.
|
804 |
+
*
|
805 |
+
* Possible options:
|
806 |
+
*
|
807 |
+
* once: will ensure the callback list can only be fired once (like a Deferred)
|
808 |
+
*
|
809 |
+
* memory: will keep track of previous values and will call any callback added
|
810 |
+
* after the list has been fired right away with the latest "memorized"
|
811 |
+
* values (like a Deferred)
|
812 |
+
*
|
813 |
+
* unique: will ensure a callback can only be added once (no duplicate in the list)
|
814 |
+
*
|
815 |
+
* stopOnFalse: interrupt callings when a callback returns false
|
816 |
+
*
|
817 |
+
*/
|
818 |
+
jQuery.Callbacks = function( options ) {
|
819 |
+
// Convert options from String-formatted to Object-formatted if needed
|
820 |
+
// (we check in cache first)
|
821 |
+
options = typeof options === "string" ?
|
822 |
+
( optionsCache[ options ] || createOptions( options ) ) :
|
823 |
+
jQuery.extend( {}, options );
|
824 |
+
var // Flag to know if list is currently firing
|
825 |
+
firing,
|
826 |
+
// Last fire value (for non-forgettable lists)
|
827 |
+
memory,
|
828 |
+
// Flag to know if list was already fired
|
829 |
+
fired,
|
830 |
+
// End of the loop when firing
|
831 |
+
firingLength,
|
832 |
+
// Index of currently firing callback (modified by remove if needed)
|
833 |
+
firingIndex,
|
834 |
+
// First callback to fire (used internally by add and fireWith)
|
835 |
+
firingStart,
|
836 |
+
// Actual callback list
|
837 |
+
list = [],
|
838 |
+
// Stack of fire calls for repeatable lists
|
839 |
+
stack = !options.once && [],
|
840 |
+
// Fire callbacks
|
841 |
+
fire = function( data ) {
|
842 |
+
memory = options.memory && data;
|
843 |
+
fired = true;
|
844 |
+
firingIndex = firingStart || 0;
|
845 |
+
firingStart = 0;
|
846 |
+
firingLength = list.length;
|
847 |
+
firing = true;
|
848 |
+
for ( ; list && firingIndex < firingLength; firingIndex++ ) {
|
849 |
+
if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
|
850 |
+
memory = false; // To prevent further calls using add
|
851 |
+
break;
|
852 |
+
}
|
853 |
+
}
|
854 |
+
firing = false;
|
855 |
+
if ( list ) {
|
856 |
+
if ( stack ) {
|
857 |
+
if ( stack.length ) {
|
858 |
+
fire( stack.shift() );
|
859 |
+
}
|
860 |
+
} else if ( memory ) {
|
861 |
+
list = [];
|
862 |
+
} else {
|
863 |
+
self.disable();
|
864 |
+
}
|
865 |
+
}
|
866 |
+
},
|
867 |
+
// Actual Callbacks object
|
868 |
+
self = {
|
869 |
+
// Add a callback or a collection of callbacks to the list
|
870 |
+
add: function() {
|
871 |
+
if ( list ) {
|
872 |
+
// First, we save the current length
|
873 |
+
var start = list.length;
|
874 |
+
(function add( args ) {
|
875 |
+
jQuery.each( args, function( _, arg ) {
|
876 |
+
var type = jQuery.type( arg );
|
877 |
+
if ( type === "function" ) {
|
878 |
+
if ( !options.unique || !self.has( arg ) ) {
|
879 |
+
list.push( arg );
|
880 |
+
}
|
881 |
+
} else if ( arg && arg.length && type !== "string" ) {
|
882 |
+
// Inspect recursively
|
883 |
+
add( arg );
|
884 |
+
}
|
885 |
+
});
|
886 |
+
})( arguments );
|
887 |
+
// Do we need to add the callbacks to the
|
888 |
+
// current firing batch?
|
889 |
+
if ( firing ) {
|
890 |
+
firingLength = list.length;
|
891 |
+
// With memory, if we're not firing then
|
892 |
+
// we should call right away
|
893 |
+
} else if ( memory ) {
|
894 |
+
firingStart = start;
|
895 |
+
fire( memory );
|
896 |
+
}
|
897 |
+
}
|
898 |
+
return this;
|
899 |
+
},
|
900 |
+
// Remove a callback from the list
|
901 |
+
remove: function() {
|
902 |
+
if ( list ) {
|
903 |
+
jQuery.each( arguments, function( _, arg ) {
|
904 |
+
var index;
|
905 |
+
while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
|
906 |
+
list.splice( index, 1 );
|
907 |
+
// Handle firing indexes
|
908 |
+
if ( firing ) {
|
909 |
+
if ( index <= firingLength ) {
|
910 |
+
firingLength--;
|
911 |
+
}
|
912 |
+
if ( index <= firingIndex ) {
|
913 |
+
firingIndex--;
|
914 |
+
}
|
915 |
+
}
|
916 |
+
}
|
917 |
+
});
|
918 |
+
}
|
919 |
+
return this;
|
920 |
+
},
|
921 |
+
// Check if a given callback is in the list.
|
922 |
+
// If no argument is given, return whether or not list has callbacks attached.
|
923 |
+
has: function( fn ) {
|
924 |
+
return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
|
925 |
+
},
|
926 |
+
// Remove all callbacks from the list
|
927 |
+
empty: function() {
|
928 |
+
list = [];
|
929 |
+
return this;
|
930 |
+
},
|
931 |
+
// Have the list do nothing anymore
|
932 |
+
disable: function() {
|
933 |
+
list = stack = memory = undefined;
|
934 |
+
return this;
|
935 |
+
},
|
936 |
+
// Is it disabled?
|
937 |
+
disabled: function() {
|
938 |
+
return !list;
|
939 |
+
},
|
940 |
+
// Lock the list in its current state
|
941 |
+
lock: function() {
|
942 |
+
stack = undefined;
|
943 |
+
if ( !memory ) {
|
944 |
+
self.disable();
|
945 |
+
}
|
946 |
+
return this;
|
947 |
+
},
|
948 |
+
// Is it locked?
|
949 |
+
locked: function() {
|
950 |
+
return !stack;
|
951 |
+
},
|
952 |
+
// Call all callbacks with the given context and arguments
|
953 |
+
fireWith: function( context, args ) {
|
954 |
+
args = args || [];
|
955 |
+
args = [ context, args.slice ? args.slice() : args ];
|
956 |
+
if ( list && ( !fired || stack ) ) {
|
957 |
+
if ( firing ) {
|
958 |
+
stack.push( args );
|
959 |
+
} else {
|
960 |
+
fire( args );
|
961 |
+
}
|
962 |
+
}
|
963 |
+
return this;
|
964 |
+
},
|
965 |
+
// Call all the callbacks with the given arguments
|
966 |
+
fire: function() {
|
967 |
+
self.fireWith( this, arguments );
|
968 |
+
return this;
|
969 |
+
},
|
970 |
+
// To know if the callbacks have already been called at least once
|
971 |
+
fired: function() {
|
972 |
+
return !!fired;
|
973 |
+
}
|
974 |
+
};
|
975 |
+
return self;
|
976 |
+
};
|
977 |
+
jQuery.extend({
|
978 |
+
Deferred: function( func ) {
|
979 |
+
var tuples = [
|
980 |
+
// action, add listener, listener list, final state
|
981 |
+
[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
|
982 |
+
[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
|
983 |
+
[ "notify", "progress", jQuery.Callbacks("memory") ]
|
984 |
+
],
|
985 |
+
state = "pending",
|
986 |
+
promise = {
|
987 |
+
state: function() {
|
988 |
+
return state;
|
989 |
+
},
|
990 |
+
always: function() {
|
991 |
+
deferred.done( arguments ).fail( arguments );
|
992 |
+
return this;
|
993 |
+
},
|
994 |
+
then: function( /* fnDone, fnFail, fnProgress */ ) {
|
995 |
+
var fns = arguments;
|
996 |
+
return jQuery.Deferred(function( newDefer ) {
|
997 |
+
jQuery.each( tuples, function( i, tuple ) {
|
998 |
+
var action = tuple[ 0 ],
|
999 |
+
fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
|
1000 |
+
// deferred[ done | fail | progress ] for forwarding actions to newDefer
|
1001 |
+
deferred[ tuple[1] ](function() {
|
1002 |
+
var returned = fn && fn.apply( this, arguments );
|
1003 |
+
if ( returned && jQuery.isFunction( returned.promise ) ) {
|
1004 |
+
returned.promise()
|
1005 |
+
.done( newDefer.resolve )
|
1006 |
+
.fail( newDefer.reject )
|
1007 |
+
.progress( newDefer.notify );
|
1008 |
+
} else {
|
1009 |
+
newDefer[ action + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
|
1010 |
+
}
|
1011 |
+
});
|
1012 |
+
});
|
1013 |
+
fns = null;
|
1014 |
+
}).promise();
|
1015 |
+
},
|
1016 |
+
// Get a promise for this deferred
|
1017 |
+
// If obj is provided, the promise aspect is added to the object
|
1018 |
+
promise: function( obj ) {
|
1019 |
+
return obj != null ? jQuery.extend( obj, promise ) : promise;
|
1020 |
+
}
|
1021 |
+
},
|
1022 |
+
deferred = {};
|
1023 |
+
// Keep pipe for back-compat
|
1024 |
+
promise.pipe = promise.then;
|
1025 |
+
// Add list-specific methods
|
1026 |
+
jQuery.each( tuples, function( i, tuple ) {
|
1027 |
+
var list = tuple[ 2 ],
|
1028 |
+
stateString = tuple[ 3 ];
|
1029 |
+
// promise[ done | fail | progress ] = list.add
|
1030 |
+
promise[ tuple[1] ] = list.add;
|
1031 |
+
// Handle state
|
1032 |
+
if ( stateString ) {
|
1033 |
+
list.add(function() {
|
1034 |
+
// state = [ resolved | rejected ]
|
1035 |
+
state = stateString;
|
1036 |
+
// [ reject_list | resolve_list ].disable; progress_list.lock
|
1037 |
+
}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
|
1038 |
+
}
|
1039 |
+
// deferred[ resolve | reject | notify ]
|
1040 |
+
deferred[ tuple[0] ] = function() {
|
1041 |
+
deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
|
1042 |
+
return this;
|
1043 |
+
};
|
1044 |
+
deferred[ tuple[0] + "With" ] = list.fireWith;
|
1045 |
+
});
|
1046 |
+
// Make the deferred a promise
|
1047 |
+
promise.promise( deferred );
|
1048 |
+
// Call given func if any
|
1049 |
+
if ( func ) {
|
1050 |
+
func.call( deferred, deferred );
|
1051 |
+
}
|
1052 |
+
// All done!
|
1053 |
+
return deferred;
|
1054 |
+
},
|
1055 |
+
// Deferred helper
|
1056 |
+
when: function( subordinate /* , ..., subordinateN */ ) {
|
1057 |
+
var i = 0,
|
1058 |
+
resolveValues = core_slice.call( arguments ),
|
1059 |
+
length = resolveValues.length,
|
1060 |
+
// the count of uncompleted subordinates
|
1061 |
+
remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
|
1062 |
+
// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
|
1063 |
+
deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
|
1064 |
+
// Update function for both resolve and progress values
|
1065 |
+
updateFunc = function( i, contexts, values ) {
|
1066 |
+
return function( value ) {
|
1067 |
+
contexts[ i ] = this;
|
1068 |
+
values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
|
1069 |
+
if( values === progressValues ) {
|
1070 |
+
deferred.notifyWith( contexts, values );
|
1071 |
+
} else if ( !( --remaining ) ) {
|
1072 |
+
deferred.resolveWith( contexts, values );
|
1073 |
+
}
|
1074 |
+
};
|
1075 |
+
},
|
1076 |
+
progressValues, progressContexts, resolveContexts;
|
1077 |
+
// add listeners to Deferred subordinates; treat others as resolved
|
1078 |
+
if ( length > 1 ) {
|
1079 |
+
progressValues = new Array( length );
|
1080 |
+
progressContexts = new Array( length );
|
1081 |
+
resolveContexts = new Array( length );
|
1082 |
+
for ( ; i < length; i++ ) {
|
1083 |
+
if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
|
1084 |
+
resolveValues[ i ].promise()
|
1085 |
+
.done( updateFunc( i, resolveContexts, resolveValues ) )
|
1086 |
+
.fail( deferred.reject )
|
1087 |
+
.progress( updateFunc( i, progressContexts, progressValues ) );
|
1088 |
+
} else {
|
1089 |
+
--remaining;
|
1090 |
+
}
|
1091 |
+
}
|
1092 |
+
}
|
1093 |
+
// if we're not waiting on anything, resolve the master
|
1094 |
+
if ( !remaining ) {
|
1095 |
+
deferred.resolveWith( resolveContexts, resolveValues );
|
1096 |
+
}
|
1097 |
+
return deferred.promise();
|
1098 |
+
}
|
1099 |
+
});
|
1100 |
+
jQuery.support = (function() {
|
1101 |
+
var support, all, a,
|
1102 |
+
input, select, fragment,
|
1103 |
+
opt, eventName, isSupported, i,
|
1104 |
+
div = document.createElement("div");
|
1105 |
+
// Setup
|
1106 |
+
div.setAttribute( "className", "t" );
|
1107 |
+
div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
|
1108 |
+
// Support tests won't run in some limited or non-browser environments
|
1109 |
+
all = div.getElementsByTagName("*");
|
1110 |
+
a = div.getElementsByTagName("a")[ 0 ];
|
1111 |
+
if ( !all || !a || !all.length ) {
|
1112 |
+
return {};
|
1113 |
+
}
|
1114 |
+
// First batch of tests
|
1115 |
+
select = document.createElement("select");
|
1116 |
+
opt = select.appendChild( document.createElement("option") );
|
1117 |
+
input = div.getElementsByTagName("input")[ 0 ];
|
1118 |
+
a.style.cssText = "top:1px;float:left;opacity:.5";
|
1119 |
+
support = {
|
1120 |
+
// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
|
1121 |
+
getSetAttribute: div.className !== "t",
|
1122 |
+
// IE strips leading whitespace when .innerHTML is used
|
1123 |
+
leadingWhitespace: div.firstChild.nodeType === 3,
|
1124 |
+
// Make sure that tbody elements aren't automatically inserted
|
1125 |
+
// IE will insert them into empty tables
|
1126 |
+
tbody: !div.getElementsByTagName("tbody").length,
|
1127 |
+
// Make sure that link elements get serialized correctly by innerHTML
|
1128 |
+
// This requires a wrapper element in IE
|
1129 |
+
htmlSerialize: !!div.getElementsByTagName("link").length,
|
1130 |
+
// Get the style information from getAttribute
|
1131 |
+
// (IE uses .cssText instead)
|
1132 |
+
style: /top/.test( a.getAttribute("style") ),
|
1133 |
+
// Make sure that URLs aren't manipulated
|
1134 |
+
// (IE normalizes it by default)
|
1135 |
+
hrefNormalized: a.getAttribute("href") === "/a",
|
1136 |
+
// Make sure that element opacity exists
|
1137 |
+
// (IE uses filter instead)
|
1138 |
+
// Use a regex to work around a WebKit issue. See #5145
|
1139 |
+
opacity: /^0.5/.test( a.style.opacity ),
|
1140 |
+
// Verify style float existence
|
1141 |
+
// (IE uses styleFloat instead of cssFloat)
|
1142 |
+
cssFloat: !!a.style.cssFloat,
|
1143 |
+
// Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
|
1144 |
+
checkOn: !!input.value,
|
1145 |
+
// Make sure that a selected-by-default option has a working selected property.
|
1146 |
+
// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
|
1147 |
+
optSelected: opt.selected,
|
1148 |
+
// Tests for enctype support on a form (#6743)
|
1149 |
+
enctype: !!document.createElement("form").enctype,
|
1150 |
+
// Makes sure cloning an html5 element does not cause problems
|
1151 |
+
// Where outerHTML is undefined, this still works
|
1152 |
+
html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
|
1153 |
+
// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
|
1154 |
+
boxModel: document.compatMode === "CSS1Compat",
|
1155 |
+
// Will be defined later
|
1156 |
+
deleteExpando: true,
|
1157 |
+
noCloneEvent: true,
|
1158 |
+
inlineBlockNeedsLayout: false,
|
1159 |
+
shrinkWrapBlocks: false,
|
1160 |
+
reliableMarginRight: true,
|
1161 |
+
boxSizingReliable: true,
|
1162 |
+
pixelPosition: false
|
1163 |
+
};
|
1164 |
+
// Make sure checked status is properly cloned
|
1165 |
+
input.checked = true;
|
1166 |
+
support.noCloneChecked = input.cloneNode( true ).checked;
|
1167 |
+
// Make sure that the options inside disabled selects aren't marked as disabled
|
1168 |
+
// (WebKit marks them as disabled)
|
1169 |
+
select.disabled = true;
|
1170 |
+
support.optDisabled = !opt.disabled;
|
1171 |
+
// Support: IE<9
|
1172 |
+
try {
|
1173 |
+
delete div.test;
|
1174 |
+
} catch( e ) {
|
1175 |
+
support.deleteExpando = false;
|
1176 |
+
}
|
1177 |
+
// Check if we can trust getAttribute("value")
|
1178 |
+
input = document.createElement("input");
|
1179 |
+
input.setAttribute( "value", "" );
|
1180 |
+
support.input = input.getAttribute( "value" ) === "";
|
1181 |
+
// Check if an input maintains its value after becoming a radio
|
1182 |
+
input.value = "t";
|
1183 |
+
input.setAttribute( "type", "radio" );
|
1184 |
+
support.radioValue = input.value === "t";
|
1185 |
+
// #11217 - WebKit loses check when the name is after the checked attribute
|
1186 |
+
input.setAttribute( "checked", "t" );
|
1187 |
+
input.setAttribute( "name", "t" );
|
1188 |
+
fragment = document.createDocumentFragment();
|
1189 |
+
fragment.appendChild( input );
|
1190 |
+
// Check if a disconnected checkbox will retain its checked
|
1191 |
+
// value of true after appended to the DOM (IE6/7)
|
1192 |
+
support.appendChecked = input.checked;
|
1193 |
+
// WebKit doesn't clone checked state correctly in fragments
|
1194 |
+
support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
|
1195 |
+
// Support: IE<9
|
1196 |
+
// Opera does not clone events (and typeof div.attachEvent === undefined).
|
1197 |
+
// IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
|
1198 |
+
if ( div.attachEvent ) {
|
1199 |
+
div.attachEvent( "onclick", function() {
|
1200 |
+
support.noCloneEvent = false;
|
1201 |
+
});
|
1202 |
+
div.cloneNode( true ).click();
|
1203 |
+
}
|
1204 |
+
// Support: IE<9 (lack submit/change bubble), Firefox 17+ (lack focusin event)
|
1205 |
+
// Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP), test/csp.php
|
1206 |
+
for ( i in { submit: true, change: true, focusin: true }) {
|
1207 |
+
div.setAttribute( eventName = "on" + i, "t" );
|
1208 |
+
support[ i + "Bubbles" ] = eventName in window || div.attributes[ eventName ].expando === false;
|
1209 |
+
}
|
1210 |
+
div.style.backgroundClip = "content-box";
|
1211 |
+
div.cloneNode( true ).style.backgroundClip = "";
|
1212 |
+
support.clearCloneStyle = div.style.backgroundClip === "content-box";
|
1213 |
+
// Run tests that need a body at doc ready
|
1214 |
+
jQuery(function() {
|
1215 |
+
var container, marginDiv, tds,
|
1216 |
+
divReset = "padding:0;margin:0;border:0;display:block;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;",
|
1217 |
+
body = document.getElementsByTagName("body")[0];
|
1218 |
+
if ( !body ) {
|
1219 |
+
// Return for frameset docs that don't have a body
|
1220 |
+
return;
|
1221 |
+
}
|
1222 |
+
container = document.createElement("div");
|
1223 |
+
container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px";
|
1224 |
+
body.appendChild( container ).appendChild( div );
|
1225 |
+
// Support: IE8
|
1226 |
+
// Check if table cells still have offsetWidth/Height when they are set
|
1227 |
+
// to display:none and there are still other visible table cells in a
|
1228 |
+
// table row; if so, offsetWidth/Height are not reliable for use when
|
1229 |
+
// determining if an element has been hidden directly using
|
1230 |
+
// display:none (it is still safe to use offsets if a parent element is
|
1231 |
+
// hidden; don safety goggles and see bug #4512 for more information).
|
1232 |
+
div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
|
1233 |
+
tds = div.getElementsByTagName("td");
|
1234 |
+
tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
|
1235 |
+
isSupported = ( tds[ 0 ].offsetHeight === 0 );
|
1236 |
+
tds[ 0 ].style.display = "";
|
1237 |
+
tds[ 1 ].style.display = "none";
|
1238 |
+
// Support: IE8
|
1239 |
+
// Check if empty table cells still have offsetWidth/Height
|
1240 |
+
support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
|
1241 |
+
// Check box-sizing and margin behavior
|
1242 |
+
div.innerHTML = "";
|
1243 |
+
div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
|
1244 |
+
support.boxSizing = ( div.offsetWidth === 4 );
|
1245 |
+
support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
|
1246 |
+
// Use window.getComputedStyle because jsdom on node.js will break without it.
|
1247 |
+
if ( window.getComputedStyle ) {
|
1248 |
+
support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
|
1249 |
+
support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
|
1250 |
+
// Check if div with explicit width and no margin-right incorrectly
|
1251 |
+
// gets computed margin-right based on width of container. (#3333)
|
1252 |
+
// Fails in WebKit before Feb 2011 nightlies
|
1253 |
+
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
1254 |
+
marginDiv = div.appendChild( document.createElement("div") );
|
1255 |
+
marginDiv.style.cssText = div.style.cssText = divReset;
|
1256 |
+
marginDiv.style.marginRight = marginDiv.style.width = "0";
|
1257 |
+
div.style.width = "1px";
|
1258 |
+
support.reliableMarginRight =
|
1259 |
+
!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
|
1260 |
+
}
|
1261 |
+
if ( typeof div.style.zoom !== core_strundefined ) {
|
1262 |
+
// Support: IE<8
|
1263 |
+
// Check if natively block-level elements act like inline-block
|
1264 |
+
// elements when setting their display to 'inline' and giving
|
1265 |
+
// them layout
|
1266 |
+
div.innerHTML = "";
|
1267 |
+
div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
|
1268 |
+
support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
|
1269 |
+
// Support: IE6
|
1270 |
+
// Check if elements with layout shrink-wrap their children
|
1271 |
+
div.style.display = "block";
|
1272 |
+
div.innerHTML = "<div></div>";
|
1273 |
+
div.firstChild.style.width = "5px";
|
1274 |
+
support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
|
1275 |
+
if ( support.inlineBlockNeedsLayout ) {
|
1276 |
+
// Prevent IE 6 from affecting layout for positioned elements #11048
|
1277 |
+
// Prevent IE from shrinking the body in IE 7 mode #12869
|
1278 |
+
// Support: IE<8
|
1279 |
+
body.style.zoom = 1;
|
1280 |
+
}
|
1281 |
+
}
|
1282 |
+
body.removeChild( container );
|
1283 |
+
// Null elements to avoid leaks in IE
|
1284 |
+
container = div = tds = marginDiv = null;
|
1285 |
+
});
|
1286 |
+
// Null elements to avoid leaks in IE
|
1287 |
+
all = select = fragment = opt = a = input = null;
|
1288 |
+
return support;
|
1289 |
+
})();
|
1290 |
+
var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
|
1291 |
+
rmultiDash = /([A-Z])/g;
|
1292 |
+
function internalData( elem, name, data, pvt /* Internal Use Only */ ){
|
1293 |
+
if ( !jQuery.acceptData( elem ) ) {
|
1294 |
+
return;
|
1295 |
+
}
|
1296 |
+
var thisCache, ret,
|
1297 |
+
internalKey = jQuery.expando,
|
1298 |
+
getByName = typeof name === "string",
|
1299 |
+
// We have to handle DOM nodes and JS objects differently because IE6-7
|
1300 |
+
// can't GC object references properly across the DOM-JS boundary
|
1301 |
+
isNode = elem.nodeType,
|
1302 |
+
// Only DOM nodes need the global jQuery cache; JS object data is
|
1303 |
+
// attached directly to the object so GC can occur automatically
|
1304 |
+
cache = isNode ? jQuery.cache : elem,
|
1305 |
+
// Only defining an ID for JS objects if its cache already exists allows
|
1306 |
+
// the code to shortcut on the same path as a DOM node with no cache
|
1307 |
+
id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
|
1308 |
+
// Avoid doing any more work than we need to when trying to get data on an
|
1309 |
+
// object that has no data at all
|
1310 |
+
if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
|
1311 |
+
return;
|
1312 |
+
}
|
1313 |
+
if ( !id ) {
|
1314 |
+
// Only DOM nodes need a new unique ID for each element since their data
|
1315 |
+
// ends up in the global cache
|
1316 |
+
if ( isNode ) {
|
1317 |
+
elem[ internalKey ] = id = core_deletedIds.pop() || jQuery.guid++;
|
1318 |
+
} else {
|
1319 |
+
id = internalKey;
|
1320 |
+
}
|
1321 |
+
}
|
1322 |
+
if ( !cache[ id ] ) {
|
1323 |
+
cache[ id ] = {};
|
1324 |
+
// Avoids exposing jQuery metadata on plain JS objects when the object
|
1325 |
+
// is serialized using JSON.stringify
|
1326 |
+
if ( !isNode ) {
|
1327 |
+
cache[ id ].toJSON = jQuery.noop;
|
1328 |
+
}
|
1329 |
+
}
|
1330 |
+
// An object can be passed to jQuery.data instead of a key/value pair; this gets
|
1331 |
+
// shallow copied over onto the existing cache
|
1332 |
+
if ( typeof name === "object" || typeof name === "function" ) {
|
1333 |
+
if ( pvt ) {
|
1334 |
+
cache[ id ] = jQuery.extend( cache[ id ], name );
|
1335 |
+
} else {
|
1336 |
+
cache[ id ].data = jQuery.extend( cache[ id ].data, name );
|
1337 |
+
}
|
1338 |
+
}
|
1339 |
+
thisCache = cache[ id ];
|
1340 |
+
// jQuery data() is stored in a separate object inside the object's internal data
|
1341 |
+
// cache in order to avoid key collisions between internal data and user-defined
|
1342 |
+
// data.
|
1343 |
+
if ( !pvt ) {
|
1344 |
+
if ( !thisCache.data ) {
|
1345 |
+
thisCache.data = {};
|
1346 |
+
}
|
1347 |
+
thisCache = thisCache.data;
|
1348 |
+
}
|
1349 |
+
if ( data !== undefined ) {
|
1350 |
+
thisCache[ jQuery.camelCase( name ) ] = data;
|
1351 |
+
}
|
1352 |
+
// Check for both converted-to-camel and non-converted data property names
|
1353 |
+
// If a data property was specified
|
1354 |
+
if ( getByName ) {
|
1355 |
+
// First Try to find as-is property data
|
1356 |
+
ret = thisCache[ name ];
|
1357 |
+
// Test for null|undefined property data
|
1358 |
+
if ( ret == null ) {
|
1359 |
+
// Try to find the camelCased property
|
1360 |
+
ret = thisCache[ jQuery.camelCase( name ) ];
|
1361 |
+
}
|
1362 |
+
} else {
|
1363 |
+
ret = thisCache;
|
1364 |
+
}
|
1365 |
+
return ret;
|
1366 |
+
}
|
1367 |
+
function internalRemoveData( elem, name, pvt ) {
|
1368 |
+
if ( !jQuery.acceptData( elem ) ) {
|
1369 |
+
return;
|
1370 |
+
}
|
1371 |
+
var i, l, thisCache,
|
1372 |
+
isNode = elem.nodeType,
|
1373 |
+
// See jQuery.data for more information
|
1374 |
+
cache = isNode ? jQuery.cache : elem,
|
1375 |
+
id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
|
1376 |
+
// If there is already no cache entry for this object, there is no
|
1377 |
+
// purpose in continuing
|
1378 |
+
if ( !cache[ id ] ) {
|
1379 |
+
return;
|
1380 |
+
}
|
1381 |
+
if ( name ) {
|
1382 |
+
thisCache = pvt ? cache[ id ] : cache[ id ].data;
|
1383 |
+
if ( thisCache ) {
|
1384 |
+
// Support array or space separated string names for data keys
|
1385 |
+
if ( !jQuery.isArray( name ) ) {
|
1386 |
+
// try the string as a key before any manipulation
|
1387 |
+
if ( name in thisCache ) {
|
1388 |
+
name = [ name ];
|
1389 |
+
} else {
|
1390 |
+
// split the camel cased version by spaces unless a key with the spaces exists
|
1391 |
+
name = jQuery.camelCase( name );
|
1392 |
+
if ( name in thisCache ) {
|
1393 |
+
name = [ name ];
|
1394 |
+
} else {
|
1395 |
+
name = name.split(" ");
|
1396 |
+
}
|
1397 |
+
}
|
1398 |
+
} else {
|
1399 |
+
// If "name" is an array of keys...
|
1400 |
+
// When data is initially created, via ("key", "val") signature,
|
1401 |
+
// keys will be converted to camelCase.
|
1402 |
+
// Since there is no way to tell _how_ a key was added, remove
|
1403 |
+
// both plain key and camelCase key. #12786
|
1404 |
+
// This will only penalize the array argument path.
|
1405 |
+
name = name.concat( jQuery.map( name, jQuery.camelCase ) );
|
1406 |
+
}
|
1407 |
+
for ( i = 0, l = name.length; i < l; i++ ) {
|
1408 |
+
delete thisCache[ name[i] ];
|
1409 |
+
}
|
1410 |
+
// If there is no data left in the cache, we want to continue
|
1411 |
+
// and let the cache object itself get destroyed
|
1412 |
+
if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
|
1413 |
+
return;
|
1414 |
+
}
|
1415 |
+
}
|
1416 |
+
}
|
1417 |
+
// See jQuery.data for more information
|
1418 |
+
if ( !pvt ) {
|
1419 |
+
delete cache[ id ].data;
|
1420 |
+
// Don't destroy the parent cache unless the internal data object
|
1421 |
+
// had been the only thing left in it
|
1422 |
+
if ( !isEmptyDataObject( cache[ id ] ) ) {
|
1423 |
+
return;
|
1424 |
+
}
|
1425 |
+
}
|
1426 |
+
// Destroy the cache
|
1427 |
+
if ( isNode ) {
|
1428 |
+
jQuery.cleanData( [ elem ], true );
|
1429 |
+
// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
|
1430 |
+
} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
|
1431 |
+
delete cache[ id ];
|
1432 |
+
// When all else fails, null
|
1433 |
+
} else {
|
1434 |
+
cache[ id ] = null;
|
1435 |
+
}
|
1436 |
+
}
|
1437 |
+
jQuery.extend({
|
1438 |
+
cache: {},
|
1439 |
+
// Unique for each copy of jQuery on the page
|
1440 |
+
// Non-digits removed to match rinlinejQuery
|
1441 |
+
expando: "jQuery" + ( core_version + Math.random() ).replace( /\D/g, "" ),
|
1442 |
+
// The following elements throw uncatchable exceptions if you
|
1443 |
+
// attempt to add expando properties to them.
|
1444 |
+
noData: {
|
1445 |
+
"embed": true,
|
1446 |
+
// Ban all objects except for Flash (which handle expandos)
|
1447 |
+
"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
|
1448 |
+
"applet": true
|
1449 |
+
},
|
1450 |
+
hasData: function( elem ) {
|
1451 |
+
elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
|
1452 |
+
return !!elem && !isEmptyDataObject( elem );
|
1453 |
+
},
|
1454 |
+
data: function( elem, name, data ) {
|
1455 |
+
return internalData( elem, name, data );
|
1456 |
+
},
|
1457 |
+
removeData: function( elem, name ) {
|
1458 |
+
return internalRemoveData( elem, name );
|
1459 |
+
},
|
1460 |
+
// For internal use only.
|
1461 |
+
_data: function( elem, name, data ) {
|
1462 |
+
return internalData( elem, name, data, true );
|
1463 |
+
},
|
1464 |
+
_removeData: function( elem, name ) {
|
1465 |
+
return internalRemoveData( elem, name, true );
|
1466 |
+
},
|
1467 |
+
// A method for determining if a DOM node can handle the data expando
|
1468 |
+
acceptData: function( elem ) {
|
1469 |
+
// Do not set data on non-element because it will not be cleared (#8335).
|
1470 |
+
if ( elem.nodeType && elem.nodeType !== 1 && elem.nodeType !== 9 ) {
|
1471 |
+
return false;
|
1472 |
+
}
|
1473 |
+
var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
|
1474 |
+
// nodes accept data unless otherwise specified; rejection can be conditional
|
1475 |
+
return !noData || noData !== true && elem.getAttribute("classid") === noData;
|
1476 |
+
}
|
1477 |
+
});
|
1478 |
+
jQuery.fn.extend({
|
1479 |
+
data: function( key, value ) {
|
1480 |
+
var attrs, name,
|
1481 |
+
elem = this[0],
|
1482 |
+
i = 0,
|
1483 |
+
data = null;
|
1484 |
+
// Gets all values
|
1485 |
+
if ( key === undefined ) {
|
1486 |
+
if ( this.length ) {
|
1487 |
+
data = jQuery.data( elem );
|
1488 |
+
if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
|
1489 |
+
attrs = elem.attributes;
|
1490 |
+
for ( ; i < attrs.length; i++ ) {
|
1491 |
+
name = attrs[i].name;
|
1492 |
+
if ( !name.indexOf( "data-" ) ) {
|
1493 |
+
name = jQuery.camelCase( name.slice(5) );
|
1494 |
+
dataAttr( elem, name, data[ name ] );
|
1495 |
+
}
|
1496 |
+
}
|
1497 |
+
jQuery._data( elem, "parsedAttrs", true );
|
1498 |
+
}
|
1499 |
+
}
|
1500 |
+
return data;
|
1501 |
+
}
|
1502 |
+
// Sets multiple values
|
1503 |
+
if ( typeof key === "object" ) {
|
1504 |
+
return this.each(function() {
|
1505 |
+
jQuery.data( this, key );
|
1506 |
+
});
|
1507 |
+
}
|
1508 |
+
return jQuery.access( this, function( value ) {
|
1509 |
+
if ( value === undefined ) {
|
1510 |
+
// Try to fetch any internally stored data first
|
1511 |
+
return elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : null;
|
1512 |
+
}
|
1513 |
+
this.each(function() {
|
1514 |
+
jQuery.data( this, key, value );
|
1515 |
+
});
|
1516 |
+
}, null, value, arguments.length > 1, null, true );
|
1517 |
+
},
|
1518 |
+
removeData: function( key ) {
|
1519 |
+
return this.each(function() {
|
1520 |
+
jQuery.removeData( this, key );
|
1521 |
+
});
|
1522 |
+
}
|
1523 |
+
});
|
1524 |
+
function dataAttr( elem, key, data ) {
|
1525 |
+
// If nothing was found internally, try to fetch any
|
1526 |
+
// data from the HTML5 data-* attribute
|
1527 |
+
if ( data === undefined && elem.nodeType === 1 ) {
|
1528 |
+
var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
|
1529 |
+
data = elem.getAttribute( name );
|
1530 |
+
if ( typeof data === "string" ) {
|
1531 |
+
try {
|
1532 |
+
data = data === "true" ? true :
|
1533 |
+
data === "false" ? false :
|
1534 |
+
data === "null" ? null :
|
1535 |
+
// Only convert to a number if it doesn't change the string
|
1536 |
+
+data + "" === data ? +data :
|
1537 |
+
rbrace.test( data ) ? jQuery.parseJSON( data ) :
|
1538 |
+
data;
|
1539 |
+
} catch( e ) {}
|
1540 |
+
// Make sure we set the data so it isn't changed later
|
1541 |
+
jQuery.data( elem, key, data );
|
1542 |
+
} else {
|
1543 |
+
data = undefined;
|
1544 |
+
}
|
1545 |
+
}
|
1546 |
+
return data;
|
1547 |
+
}
|
1548 |
+
// checks a cache object for emptiness
|
1549 |
+
function isEmptyDataObject( obj ) {
|
1550 |
+
var name;
|
1551 |
+
for ( name in obj ) {
|
1552 |
+
// if the public data object is empty, the private is still empty
|
1553 |
+
if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
|
1554 |
+
continue;
|
1555 |
+
}
|
1556 |
+
if ( name !== "toJSON" ) {
|
1557 |
+
return false;
|
1558 |
+
}
|
1559 |
+
}
|
1560 |
+
return true;
|
1561 |
+
}
|
1562 |
+
jQuery.extend({
|
1563 |
+
queue: function( elem, type, data ) {
|
1564 |
+
var queue;
|
1565 |
+
if ( elem ) {
|
1566 |
+
type = ( type || "fx" ) + "queue";
|
1567 |
+
queue = jQuery._data( elem, type );
|
1568 |
+
// Speed up dequeue by getting out quickly if this is just a lookup
|
1569 |
+
if ( data ) {
|
1570 |
+
if ( !queue || jQuery.isArray(data) ) {
|
1571 |
+
queue = jQuery._data( elem, type, jQuery.makeArray(data) );
|
1572 |
+
} else {
|
1573 |
+
queue.push( data );
|
1574 |
+
}
|
1575 |
+
}
|
1576 |
+
return queue || [];
|
1577 |
+
}
|
1578 |
+
},
|
1579 |
+
dequeue: function( elem, type ) {
|
1580 |
+
type = type || "fx";
|
1581 |
+
var queue = jQuery.queue( elem, type ),
|
1582 |
+
startLength = queue.length,
|
1583 |
+
fn = queue.shift(),
|
1584 |
+
hooks = jQuery._queueHooks( elem, type ),
|
1585 |
+
next = function() {
|
1586 |
+
jQuery.dequeue( elem, type );
|
1587 |
+
};
|
1588 |
+
// If the fx queue is dequeued, always remove the progress sentinel
|
1589 |
+
if ( fn === "inprogress" ) {
|
1590 |
+
fn = queue.shift();
|
1591 |
+
startLength--;
|
1592 |
+
}
|
1593 |
+
hooks.cur = fn;
|
1594 |
+
if ( fn ) {
|
1595 |
+
// Add a progress sentinel to prevent the fx queue from being
|
1596 |
+
// automatically dequeued
|
1597 |
+
if ( type === "fx" ) {
|
1598 |
+
queue.unshift( "inprogress" );
|
1599 |
+
}
|
1600 |
+
// clear up the last queue stop function
|
1601 |
+
delete hooks.stop;
|
1602 |
+
fn.call( elem, next, hooks );
|
1603 |
+
}
|
1604 |
+
if ( !startLength && hooks ) {
|
1605 |
+
hooks.empty.fire();
|
1606 |
+
}
|
1607 |
+
},
|
1608 |
+
// not intended for public consumption - generates a queueHooks object, or returns the current one
|
1609 |
+
_queueHooks: function( elem, type ) {
|
1610 |
+
var key = type + "queueHooks";
|
1611 |
+
return jQuery._data( elem, key ) || jQuery._data( elem, key, {
|
1612 |
+
empty: jQuery.Callbacks("once memory").add(function() {
|
1613 |
+
jQuery._removeData( elem, type + "queue" );
|
1614 |
+
jQuery._removeData( elem, key );
|
1615 |
+
})
|
1616 |
+
});
|
1617 |
+
}
|
1618 |
+
});
|
1619 |
+
jQuery.fn.extend({
|
1620 |
+
queue: function( type, data ) {
|
1621 |
+
var setter = 2;
|
1622 |
+
if ( typeof type !== "string" ) {
|
1623 |
+
data = type;
|
1624 |
+
type = "fx";
|
1625 |
+
setter--;
|
1626 |
+
}
|
1627 |
+
if ( arguments.length < setter ) {
|
1628 |
+
return jQuery.queue( this[0], type );
|
1629 |
+
}
|
1630 |
+
return data === undefined ?
|
1631 |
+
this :
|
1632 |
+
this.each(function() {
|
1633 |
+
var queue = jQuery.queue( this, type, data );
|
1634 |
+
// ensure a hooks for this queue
|
1635 |
+
jQuery._queueHooks( this, type );
|
1636 |
+
if ( type === "fx" && queue[0] !== "inprogress" ) {
|
1637 |
+
jQuery.dequeue( this, type );
|
1638 |
+
}
|
1639 |
+
});
|
1640 |
+
},
|
1641 |
+
dequeue: function( type ) {
|
1642 |
+
return this.each(function() {
|
1643 |
+
jQuery.dequeue( this, type );
|
1644 |
+
});
|
1645 |
+
},
|
1646 |
+
// Based off of the plugin by Clint Helfers, with permission.
|
1647 |
+
// http://blindsignals.com/index.php/2009/07/jquery-delay/
|
1648 |
+
delay: function( time, type ) {
|
1649 |
+
time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
|
1650 |
+
type = type || "fx";
|
1651 |
+
return this.queue( type, function( next, hooks ) {
|
1652 |
+
var timeout = setTimeout( next, time );
|
1653 |
+
hooks.stop = function() {
|
1654 |
+
clearTimeout( timeout );
|
1655 |
+
};
|
1656 |
+
});
|
1657 |
+
},
|
1658 |
+
clearQueue: function( type ) {
|
1659 |
+
return this.queue( type || "fx", [] );
|
1660 |
+
},
|
1661 |
+
// Get a promise resolved when queues of a certain type
|
1662 |
+
// are emptied (fx is the type by default)
|
1663 |
+
promise: function( type, obj ) {
|
1664 |
+
var tmp,
|
1665 |
+
count = 1,
|
1666 |
+
defer = jQuery.Deferred(),
|
1667 |
+
elements = this,
|
1668 |
+
i = this.length,
|
1669 |
+
resolve = function() {
|
1670 |
+
if ( !( --count ) ) {
|
1671 |
+
defer.resolveWith( elements, [ elements ] );
|
1672 |
+
}
|
1673 |
+
};
|
1674 |
+
if ( typeof type !== "string" ) {
|
1675 |
+
obj = type;
|
1676 |
+
type = undefined;
|
1677 |
+
}
|
1678 |
+
type = type || "fx";
|
1679 |
+
while( i-- ) {
|
1680 |
+
tmp = jQuery._data( elements[ i ], type + "queueHooks" );
|
1681 |
+
if ( tmp && tmp.empty ) {
|
1682 |
+
count++;
|
1683 |
+
tmp.empty.add( resolve );
|
1684 |
+
}
|
1685 |
+
}
|
1686 |
+
resolve();
|
1687 |
+
return defer.promise( obj );
|
1688 |
+
}
|
1689 |
+
});
|
1690 |
+
var nodeHook, boolHook,
|
1691 |
+
rclass = /[\t\r\n]/g,
|
1692 |
+
rreturn = /\r/g,
|
1693 |
+
rfocusable = /^(?:input|select|textarea|button|object)$/i,
|
1694 |
+
rclickable = /^(?:a|area)$/i,
|
1695 |
+
rboolean = /^(?:checked|selected|autofocus|autoplay|async|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped)$/i,
|
1696 |
+
ruseDefault = /^(?:checked|selected)$/i,
|
1697 |
+
getSetAttribute = jQuery.support.getSetAttribute,
|
1698 |
+
getSetInput = jQuery.support.input;
|
1699 |
+
jQuery.fn.extend({
|
1700 |
+
attr: function( name, value ) {
|
1701 |
+
return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
|
1702 |
+
},
|
1703 |
+
removeAttr: function( name ) {
|
1704 |
+
return this.each(function() {
|
1705 |
+
jQuery.removeAttr( this, name );
|
1706 |
+
});
|
1707 |
+
},
|
1708 |
+
prop: function( name, value ) {
|
1709 |
+
return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
|
1710 |
+
},
|
1711 |
+
removeProp: function( name ) {
|
1712 |
+
name = jQuery.propFix[ name ] || name;
|
1713 |
+
return this.each(function() {
|
1714 |
+
// try/catch handles cases where IE balks (such as removing a property on window)
|
1715 |
+
try {
|
1716 |
+
this[ name ] = undefined;
|
1717 |
+
delete this[ name ];
|
1718 |
+
} catch( e ) {}
|
1719 |
+
});
|
1720 |
+
},
|
1721 |
+
addClass: function( value ) {
|
1722 |
+
var classes, elem, cur, clazz, j,
|
1723 |
+
i = 0,
|
1724 |
+
len = this.length,
|
1725 |
+
proceed = typeof value === "string" && value;
|
1726 |
+
if ( jQuery.isFunction( value ) ) {
|
1727 |
+
return this.each(function( j ) {
|
1728 |
+
jQuery( this ).addClass( value.call( this, j, this.className ) );
|
1729 |
+
});
|
1730 |
+
}
|
1731 |
+
if ( proceed ) {
|
1732 |
+
// The disjunction here is for better compressibility (see removeClass)
|
1733 |
+
classes = ( value || "" ).match( core_rnotwhite ) || [];
|
1734 |
+
for ( ; i < len; i++ ) {
|
1735 |
+
elem = this[ i ];
|
1736 |
+
cur = elem.nodeType === 1 && ( elem.className ?
|
1737 |
+
( " " + elem.className + " " ).replace( rclass, " " ) :
|
1738 |
+
" "
|
1739 |
+
);
|
1740 |
+
if ( cur ) {
|
1741 |
+
j = 0;
|
1742 |
+
while ( (clazz = classes[j++]) ) {
|
1743 |
+
if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
|
1744 |
+
cur += clazz + " ";
|
1745 |
+
}
|
1746 |
+
}
|
1747 |
+
elem.className = jQuery.trim( cur );
|
1748 |
+
}
|
1749 |
+
}
|
1750 |
+
}
|
1751 |
+
return this;
|
1752 |
+
},
|
1753 |
+
removeClass: function( value ) {
|
1754 |
+
var classes, elem, cur, clazz, j,
|
1755 |
+
i = 0,
|
1756 |
+
len = this.length,
|
1757 |
+
proceed = arguments.length === 0 || typeof value === "string" && value;
|
1758 |
+
if ( jQuery.isFunction( value ) ) {
|
1759 |
+
return this.each(function( j ) {
|
1760 |
+
jQuery( this ).removeClass( value.call( this, j, this.className ) );
|
1761 |
+
});
|
1762 |
+
}
|
1763 |
+
if ( proceed ) {
|
1764 |
+
classes = ( value || "" ).match( core_rnotwhite ) || [];
|
1765 |
+
for ( ; i < len; i++ ) {
|
1766 |
+
elem = this[ i ];
|
1767 |
+
// This expression is here for better compressibility (see addClass)
|
1768 |
+
cur = elem.nodeType === 1 && ( elem.className ?
|
1769 |
+
( " " + elem.className + " " ).replace( rclass, " " ) :
|
1770 |
+
""
|
1771 |
+
);
|
1772 |
+
if ( cur ) {
|
1773 |
+
j = 0;
|
1774 |
+
while ( (clazz = classes[j++]) ) {
|
1775 |
+
// Remove *all* instances
|
1776 |
+
while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
|
1777 |
+
cur = cur.replace( " " + clazz + " ", " " );
|
1778 |
+
}
|
1779 |
+
}
|
1780 |
+
elem.className = value ? jQuery.trim( cur ) : "";
|
1781 |
+
}
|
1782 |
+
}
|
1783 |
+
}
|
1784 |
+
return this;
|
1785 |
+
},
|
1786 |
+
toggleClass: function( value, stateVal ) {
|
1787 |
+
var type = typeof value,
|
1788 |
+
isBool = typeof stateVal === "boolean";
|
1789 |
+
if ( jQuery.isFunction( value ) ) {
|
1790 |
+
return this.each(function( i ) {
|
1791 |
+
jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
|
1792 |
+
});
|
1793 |
+
}
|
1794 |
+
return this.each(function() {
|
1795 |
+
if ( type === "string" ) {
|
1796 |
+
// toggle individual class names
|
1797 |
+
var className,
|
1798 |
+
i = 0,
|
1799 |
+
self = jQuery( this ),
|
1800 |
+
state = stateVal,
|
1801 |
+
classNames = value.match( core_rnotwhite ) || [];
|
1802 |
+
while ( (className = classNames[ i++ ]) ) {
|
1803 |
+
// check each className given, space separated list
|
1804 |
+
state = isBool ? state : !self.hasClass( className );
|
1805 |
+
self[ state ? "addClass" : "removeClass" ]( className );
|
1806 |
+
}
|
1807 |
+
// Toggle whole class name
|
1808 |
+
} else if ( type === core_strundefined || type === "boolean" ) {
|
1809 |
+
if ( this.className ) {
|
1810 |
+
// store className if set
|
1811 |
+
jQuery._data( this, "__className__", this.className );
|
1812 |
+
}
|
1813 |
+
// If the element has a class name or if we're passed "false",
|
1814 |
+
// then remove the whole classname (if there was one, the above saved it).
|
1815 |
+
// Otherwise bring back whatever was previously saved (if anything),
|
1816 |
+
// falling back to the empty string if nothing was stored.
|
1817 |
+
this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
|
1818 |
+
}
|
1819 |
+
});
|
1820 |
+
},
|
1821 |
+
hasClass: function( selector ) {
|
1822 |
+
var className = " " + selector + " ",
|
1823 |
+
i = 0,
|
1824 |
+
l = this.length;
|
1825 |
+
for ( ; i < l; i++ ) {
|
1826 |
+
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
|
1827 |
+
return true;
|
1828 |
+
}
|
1829 |
+
}
|
1830 |
+
return false;
|
1831 |
+
},
|
1832 |
+
val: function( value ) {
|
1833 |
+
var ret, hooks, isFunction,
|
1834 |
+
elem = this[0];
|
1835 |
+
if ( !arguments.length ) {
|
1836 |
+
if ( elem ) {
|
1837 |
+
hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
|
1838 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
|
1839 |
+
return ret;
|
1840 |
+
}
|
1841 |
+
ret = elem.value;
|
1842 |
+
return typeof ret === "string" ?
|
1843 |
+
// handle most common string cases
|
1844 |
+
ret.replace(rreturn, "") :
|
1845 |
+
// handle cases where value is null/undef or number
|
1846 |
+
ret == null ? "" : ret;
|
1847 |
+
}
|
1848 |
+
return;
|
1849 |
+
}
|
1850 |
+
isFunction = jQuery.isFunction( value );
|
1851 |
+
return this.each(function( i ) {
|
1852 |
+
var val,
|
1853 |
+
self = jQuery(this);
|
1854 |
+
if ( this.nodeType !== 1 ) {
|
1855 |
+
return;
|
1856 |
+
}
|
1857 |
+
if ( isFunction ) {
|
1858 |
+
val = value.call( this, i, self.val() );
|
1859 |
+
} else {
|
1860 |
+
val = value;
|
1861 |
+
}
|
1862 |
+
// Treat null/undefined as ""; convert numbers to string
|
1863 |
+
if ( val == null ) {
|
1864 |
+
val = "";
|
1865 |
+
} else if ( typeof val === "number" ) {
|
1866 |
+
val += "";
|
1867 |
+
} else if ( jQuery.isArray( val ) ) {
|
1868 |
+
val = jQuery.map(val, function ( value ) {
|
1869 |
+
return value == null ? "" : value + "";
|
1870 |
+
});
|
1871 |
+
}
|
1872 |
+
hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
|
1873 |
+
// If set returns undefined, fall back to normal setting
|
1874 |
+
if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
|
1875 |
+
this.value = val;
|
1876 |
+
}
|
1877 |
+
});
|
1878 |
+
}
|
1879 |
+
});
|
1880 |
+
jQuery.extend({
|
1881 |
+
valHooks: {
|
1882 |
+
option: {
|
1883 |
+
get: function( elem ) {
|
1884 |
+
// attributes.value is undefined in Blackberry 4.7 but
|
1885 |
+
// uses .value. See #6932
|
1886 |
+
var val = elem.attributes.value;
|
1887 |
+
return !val || val.specified ? elem.value : elem.text;
|
1888 |
+
}
|
1889 |
+
},
|
1890 |
+
select: {
|
1891 |
+
get: function( elem ) {
|
1892 |
+
var value, option,
|
1893 |
+
options = elem.options,
|
1894 |
+
index = elem.selectedIndex,
|
1895 |
+
one = elem.type === "select-one" || index < 0,
|
1896 |
+
values = one ? null : [],
|
1897 |
+
max = one ? index + 1 : options.length,
|
1898 |
+
i = index < 0 ?
|
1899 |
+
max :
|
1900 |
+
one ? index : 0;
|
1901 |
+
// Loop through all the selected options
|
1902 |
+
for ( ; i < max; i++ ) {
|
1903 |
+
option = options[ i ];
|
1904 |
+
// oldIE doesn't update selected after form reset (#2551)
|
1905 |
+
if ( ( option.selected || i === index ) &&
|
1906 |
+
// Don't return options that are disabled or in a disabled optgroup
|
1907 |
+
( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
|
1908 |
+
( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
|
1909 |
+
// Get the specific value for the option
|
1910 |
+
value = jQuery( option ).val();
|
1911 |
+
// We don't need an array for one selects
|
1912 |
+
if ( one ) {
|
1913 |
+
return value;
|
1914 |
+
}
|
1915 |
+
// Multi-Selects return an array
|
1916 |
+
values.push( value );
|
1917 |
+
}
|
1918 |
+
}
|
1919 |
+
return values;
|
1920 |
+
},
|
1921 |
+
set: function( elem, value ) {
|
1922 |
+
var values = jQuery.makeArray( value );
|
1923 |
+
jQuery(elem).find("option").each(function() {
|
1924 |
+
this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
|
1925 |
+
});
|
1926 |
+
if ( !values.length ) {
|
1927 |
+
elem.selectedIndex = -1;
|
1928 |
+
}
|
1929 |
+
return values;
|
1930 |
+
}
|
1931 |
+
}
|
1932 |
+
},
|
1933 |
+
attr: function( elem, name, value ) {
|
1934 |
+
var hooks, notxml, ret,
|
1935 |
+
nType = elem.nodeType;
|
1936 |
+
// don't get/set attributes on text, comment and attribute nodes
|
1937 |
+
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
1938 |
+
return;
|
1939 |
+
}
|
1940 |
+
// Fallback to prop when attributes are not supported
|
1941 |
+
if ( typeof elem.getAttribute === core_strundefined ) {
|
1942 |
+
return jQuery.prop( elem, name, value );
|
1943 |
+
}
|
1944 |
+
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
1945 |
+
// All attributes are lowercase
|
1946 |
+
// Grab necessary hook if one is defined
|
1947 |
+
if ( notxml ) {
|
1948 |
+
name = name.toLowerCase();
|
1949 |
+
hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
|
1950 |
+
}
|
1951 |
+
if ( value !== undefined ) {
|
1952 |
+
if ( value === null ) {
|
1953 |
+
jQuery.removeAttr( elem, name );
|
1954 |
+
} else if ( hooks && notxml && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
1955 |
+
return ret;
|
1956 |
+
} else {
|
1957 |
+
elem.setAttribute( name, value + "" );
|
1958 |
+
return value;
|
1959 |
+
}
|
1960 |
+
} else if ( hooks && notxml && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
|
1961 |
+
return ret;
|
1962 |
+
} else {
|
1963 |
+
// In IE9+, Flash objects don't have .getAttribute (#12945)
|
1964 |
+
// Support: IE9+
|
1965 |
+
if ( typeof elem.getAttribute !== core_strundefined ) {
|
1966 |
+
ret = elem.getAttribute( name );
|
1967 |
+
}
|
1968 |
+
// Non-existent attributes return null, we normalize to undefined
|
1969 |
+
return ret == null ?
|
1970 |
+
undefined :
|
1971 |
+
ret;
|
1972 |
+
}
|
1973 |
+
},
|
1974 |
+
removeAttr: function( elem, value ) {
|
1975 |
+
var name, propName,
|
1976 |
+
i = 0,
|
1977 |
+
attrNames = value && value.match( core_rnotwhite );
|
1978 |
+
if ( attrNames && elem.nodeType === 1 ) {
|
1979 |
+
while ( (name = attrNames[i++]) ) {
|
1980 |
+
propName = jQuery.propFix[ name ] || name;
|
1981 |
+
// Boolean attributes get special treatment (#10870)
|
1982 |
+
if ( rboolean.test( name ) ) {
|
1983 |
+
// Set corresponding property to false for boolean attributes
|
1984 |
+
// Also clear defaultChecked/defaultSelected (if appropriate) for IE<8
|
1985 |
+
if ( !getSetAttribute && ruseDefault.test( name ) ) {
|
1986 |
+
elem[ jQuery.camelCase( "default-" + name ) ] =
|
1987 |
+
elem[ propName ] = false;
|
1988 |
+
} else {
|
1989 |
+
elem[ propName ] = false;
|
1990 |
+
}
|
1991 |
+
// See #9699 for explanation of this approach (setting first, then removal)
|
1992 |
+
} else {
|
1993 |
+
jQuery.attr( elem, name, "" );
|
1994 |
+
}
|
1995 |
+
elem.removeAttribute( getSetAttribute ? name : propName );
|
1996 |
+
}
|
1997 |
+
}
|
1998 |
+
},
|
1999 |
+
attrHooks: {
|
2000 |
+
type: {
|
2001 |
+
set: function( elem, value ) {
|
2002 |
+
if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
|
2003 |
+
// Setting the type on a radio button after the value resets the value in IE6-9
|
2004 |
+
// Reset value to default in case type is set after value during creation
|
2005 |
+
var val = elem.value;
|
2006 |
+
elem.setAttribute( "type", value );
|
2007 |
+
if ( val ) {
|
2008 |
+
elem.value = val;
|
2009 |
+
}
|
2010 |
+
return value;
|
2011 |
+
}
|
2012 |
+
}
|
2013 |
+
}
|
2014 |
+
},
|
2015 |
+
propFix: {
|
2016 |
+
tabindex: "tabIndex",
|
2017 |
+
readonly: "readOnly",
|
2018 |
+
"for": "htmlFor",
|
2019 |
+
"class": "className",
|
2020 |
+
maxlength: "maxLength",
|
2021 |
+
cellspacing: "cellSpacing",
|
2022 |
+
cellpadding: "cellPadding",
|
2023 |
+
rowspan: "rowSpan",
|
2024 |
+
colspan: "colSpan",
|
2025 |
+
usemap: "useMap",
|
2026 |
+
frameborder: "frameBorder",
|
2027 |
+
contenteditable: "contentEditable"
|
2028 |
+
},
|
2029 |
+
prop: function( elem, name, value ) {
|
2030 |
+
var ret, hooks, notxml,
|
2031 |
+
nType = elem.nodeType;
|
2032 |
+
// don't get/set properties on text, comment and attribute nodes
|
2033 |
+
if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
|
2034 |
+
return;
|
2035 |
+
}
|
2036 |
+
notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
|
2037 |
+
if ( notxml ) {
|
2038 |
+
// Fix name and attach hooks
|
2039 |
+
name = jQuery.propFix[ name ] || name;
|
2040 |
+
hooks = jQuery.propHooks[ name ];
|
2041 |
+
}
|
2042 |
+
if ( value !== undefined ) {
|
2043 |
+
if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
|
2044 |
+
return ret;
|
2045 |
+
} else {
|
2046 |
+
return ( elem[ name ] = value );
|
2047 |
+
}
|
2048 |
+
} else {
|
2049 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
|
2050 |
+
return ret;
|
2051 |
+
} else {
|
2052 |
+
return elem[ name ];
|
2053 |
+
}
|
2054 |
+
}
|
2055 |
+
},
|
2056 |
+
propHooks: {
|
2057 |
+
tabIndex: {
|
2058 |
+
get: function( elem ) {
|
2059 |
+
// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
|
2060 |
+
// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
|
2061 |
+
var attributeNode = elem.getAttributeNode("tabindex");
|
2062 |
+
return attributeNode && attributeNode.specified ?
|
2063 |
+
parseInt( attributeNode.value, 10 ) :
|
2064 |
+
rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
|
2065 |
+
0 :
|
2066 |
+
undefined;
|
2067 |
+
}
|
2068 |
+
}
|
2069 |
+
}
|
2070 |
+
});
|
2071 |
+
// Hook for boolean attributes
|
2072 |
+
boolHook = {
|
2073 |
+
get: function( elem, name ) {
|
2074 |
+
var
|
2075 |
+
// Use .prop to determine if this attribute is understood as boolean
|
2076 |
+
prop = jQuery.prop( elem, name ),
|
2077 |
+
// Fetch it accordingly
|
2078 |
+
attr = typeof prop === "boolean" && elem.getAttribute( name ),
|
2079 |
+
detail = typeof prop === "boolean" ?
|
2080 |
+
getSetInput && getSetAttribute ?
|
2081 |
+
attr != null :
|
2082 |
+
// oldIE fabricates an empty string for missing boolean attributes
|
2083 |
+
// and conflates checked/selected into attroperties
|
2084 |
+
ruseDefault.test( name ) ?
|
2085 |
+
elem[ jQuery.camelCase( "default-" + name ) ] :
|
2086 |
+
!!attr :
|
2087 |
+
// fetch an attribute node for properties not recognized as boolean
|
2088 |
+
elem.getAttributeNode( name );
|
2089 |
+
return detail && detail.value !== false ?
|
2090 |
+
name.toLowerCase() :
|
2091 |
+
undefined;
|
2092 |
+
},
|
2093 |
+
set: function( elem, value, name ) {
|
2094 |
+
if ( value === false ) {
|
2095 |
+
// Remove boolean attributes when set to false
|
2096 |
+
jQuery.removeAttr( elem, name );
|
2097 |
+
} else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
|
2098 |
+
// IE<8 needs the *property* name
|
2099 |
+
elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
|
2100 |
+
// Use defaultChecked and defaultSelected for oldIE
|
2101 |
+
} else {
|
2102 |
+
elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
|
2103 |
+
}
|
2104 |
+
return name;
|
2105 |
+
}
|
2106 |
+
};
|
2107 |
+
// fix oldIE value attroperty
|
2108 |
+
if ( !getSetInput || !getSetAttribute ) {
|
2109 |
+
jQuery.attrHooks.value = {
|
2110 |
+
get: function( elem, name ) {
|
2111 |
+
var ret = elem.getAttributeNode( name );
|
2112 |
+
return jQuery.nodeName( elem, "input" ) ?
|
2113 |
+
// Ignore the value *property* by using defaultValue
|
2114 |
+
elem.defaultValue :
|
2115 |
+
ret && ret.specified ? ret.value : undefined;
|
2116 |
+
},
|
2117 |
+
set: function( elem, value, name ) {
|
2118 |
+
if ( jQuery.nodeName( elem, "input" ) ) {
|
2119 |
+
// Does not return so that setAttribute is also used
|
2120 |
+
elem.defaultValue = value;
|
2121 |
+
} else {
|
2122 |
+
// Use nodeHook if defined (#1954); otherwise setAttribute is fine
|
2123 |
+
return nodeHook && nodeHook.set( elem, value, name );
|
2124 |
+
}
|
2125 |
+
}
|
2126 |
+
};
|
2127 |
+
}
|
2128 |
+
// IE6/7 do not support getting/setting some attributes with get/setAttribute
|
2129 |
+
if ( !getSetAttribute ) {
|
2130 |
+
// Use this for any attribute in IE6/7
|
2131 |
+
// This fixes almost every IE6/7 issue
|
2132 |
+
nodeHook = jQuery.valHooks.button = {
|
2133 |
+
get: function( elem, name ) {
|
2134 |
+
var ret = elem.getAttributeNode( name );
|
2135 |
+
return ret && ( name === "id" || name === "name" || name === "coords" ? ret.value !== "" : ret.specified ) ?
|
2136 |
+
ret.value :
|
2137 |
+
undefined;
|
2138 |
+
},
|
2139 |
+
set: function( elem, value, name ) {
|
2140 |
+
// Set the existing or create a new attribute node
|
2141 |
+
var ret = elem.getAttributeNode( name );
|
2142 |
+
if ( !ret ) {
|
2143 |
+
elem.setAttributeNode(
|
2144 |
+
(ret = elem.ownerDocument.createAttribute( name ))
|
2145 |
+
);
|
2146 |
+
}
|
2147 |
+
ret.value = value += "";
|
2148 |
+
// Break association with cloned elements by also using setAttribute (#9646)
|
2149 |
+
return name === "value" || value === elem.getAttribute( name ) ?
|
2150 |
+
value :
|
2151 |
+
undefined;
|
2152 |
+
}
|
2153 |
+
};
|
2154 |
+
// Set contenteditable to false on removals(#10429)
|
2155 |
+
// Setting to empty string throws an error as an invalid value
|
2156 |
+
jQuery.attrHooks.contenteditable = {
|
2157 |
+
get: nodeHook.get,
|
2158 |
+
set: function( elem, value, name ) {
|
2159 |
+
nodeHook.set( elem, value === "" ? false : value, name );
|
2160 |
+
}
|
2161 |
+
};
|
2162 |
+
// Set width and height to auto instead of 0 on empty string( Bug #8150 )
|
2163 |
+
// This is for removals
|
2164 |
+
jQuery.each([ "width", "height" ], function( i, name ) {
|
2165 |
+
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
2166 |
+
set: function( elem, value ) {
|
2167 |
+
if ( value === "" ) {
|
2168 |
+
elem.setAttribute( name, "auto" );
|
2169 |
+
return value;
|
2170 |
+
}
|
2171 |
+
}
|
2172 |
+
});
|
2173 |
+
});
|
2174 |
+
}
|
2175 |
+
// Some attributes require a special call on IE
|
2176 |
+
// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
|
2177 |
+
if ( !jQuery.support.hrefNormalized ) {
|
2178 |
+
jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
|
2179 |
+
jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
|
2180 |
+
get: function( elem ) {
|
2181 |
+
var ret = elem.getAttribute( name, 2 );
|
2182 |
+
return ret == null ? undefined : ret;
|
2183 |
+
}
|
2184 |
+
});
|
2185 |
+
});
|
2186 |
+
// href/src property should get the full normalized URL (#10299/#12915)
|
2187 |
+
jQuery.each([ "href", "src" ], function( i, name ) {
|
2188 |
+
jQuery.propHooks[ name ] = {
|
2189 |
+
get: function( elem ) {
|
2190 |
+
return elem.getAttribute( name, 4 );
|
2191 |
+
}
|
2192 |
+
};
|
2193 |
+
});
|
2194 |
+
}
|
2195 |
+
if ( !jQuery.support.style ) {
|
2196 |
+
jQuery.attrHooks.style = {
|
2197 |
+
get: function( elem ) {
|
2198 |
+
// Return undefined in the case of empty string
|
2199 |
+
// Note: IE uppercases css property names, but if we were to .toLowerCase()
|
2200 |
+
// .cssText, that would destroy case senstitivity in URL's, like in "background"
|
2201 |
+
return elem.style.cssText || undefined;
|
2202 |
+
},
|
2203 |
+
set: function( elem, value ) {
|
2204 |
+
return ( elem.style.cssText = value + "" );
|
2205 |
+
}
|
2206 |
+
};
|
2207 |
+
}
|
2208 |
+
// Safari mis-reports the default selected property of an option
|
2209 |
+
// Accessing the parent's selectedIndex property fixes it
|
2210 |
+
if ( !jQuery.support.optSelected ) {
|
2211 |
+
jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
|
2212 |
+
get: function( elem ) {
|
2213 |
+
var parent = elem.parentNode;
|
2214 |
+
if ( parent ) {
|
2215 |
+
parent.selectedIndex;
|
2216 |
+
// Make sure that it also works with optgroups, see #5701
|
2217 |
+
if ( parent.parentNode ) {
|
2218 |
+
parent.parentNode.selectedIndex;
|
2219 |
+
}
|
2220 |
+
}
|
2221 |
+
return null;
|
2222 |
+
}
|
2223 |
+
});
|
2224 |
+
}
|
2225 |
+
// IE6/7 call enctype encoding
|
2226 |
+
if ( !jQuery.support.enctype ) {
|
2227 |
+
jQuery.propFix.enctype = "encoding";
|
2228 |
+
}
|
2229 |
+
// Radios and checkboxes getter/setter
|
2230 |
+
if ( !jQuery.support.checkOn ) {
|
2231 |
+
jQuery.each([ "radio", "checkbox" ], function() {
|
2232 |
+
jQuery.valHooks[ this ] = {
|
2233 |
+
get: function( elem ) {
|
2234 |
+
// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
|
2235 |
+
return elem.getAttribute("value") === null ? "on" : elem.value;
|
2236 |
+
}
|
2237 |
+
};
|
2238 |
+
});
|
2239 |
+
}
|
2240 |
+
jQuery.each([ "radio", "checkbox" ], function() {
|
2241 |
+
jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
|
2242 |
+
set: function( elem, value ) {
|
2243 |
+
if ( jQuery.isArray( value ) ) {
|
2244 |
+
return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
|
2245 |
+
}
|
2246 |
+
}
|
2247 |
+
});
|
2248 |
+
});
|
2249 |
+
var rformElems = /^(?:input|select|textarea)$/i,
|
2250 |
+
rkeyEvent = /^key/,
|
2251 |
+
rmouseEvent = /^(?:mouse|contextmenu)|click/,
|
2252 |
+
rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
|
2253 |
+
rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
|
2254 |
+
function returnTrue() {
|
2255 |
+
return true;
|
2256 |
+
}
|
2257 |
+
function returnFalse() {
|
2258 |
+
return false;
|
2259 |
+
}
|
2260 |
+
/*
|
2261 |
+
* Helper functions for managing events -- not part of the public interface.
|
2262 |
+
* Props to Dean Edwards' addEvent library for many of the ideas.
|
2263 |
+
*/
|
2264 |
+
jQuery.event = {
|
2265 |
+
global: {},
|
2266 |
+
add: function( elem, types, handler, data, selector ) {
|
2267 |
+
var tmp, events, t, handleObjIn,
|
2268 |
+
special, eventHandle, handleObj,
|
2269 |
+
handlers, type, namespaces, origType,
|
2270 |
+
elemData = jQuery._data( elem );
|
2271 |
+
// Don't attach events to noData or text/comment nodes (but allow plain objects)
|
2272 |
+
if ( !elemData ) {
|
2273 |
+
return;
|
2274 |
+
}
|
2275 |
+
// Caller can pass in an object of custom data in lieu of the handler
|
2276 |
+
if ( handler.handler ) {
|
2277 |
+
handleObjIn = handler;
|
2278 |
+
handler = handleObjIn.handler;
|
2279 |
+
selector = handleObjIn.selector;
|
2280 |
+
}
|
2281 |
+
// Make sure that the handler has a unique ID, used to find/remove it later
|
2282 |
+
if ( !handler.guid ) {
|
2283 |
+
handler.guid = jQuery.guid++;
|
2284 |
+
}
|
2285 |
+
// Init the element's event structure and main handler, if this is the first
|
2286 |
+
if ( !(events = elemData.events) ) {
|
2287 |
+
events = elemData.events = {};
|
2288 |
+
}
|
2289 |
+
if ( !(eventHandle = elemData.handle) ) {
|
2290 |
+
eventHandle = elemData.handle = function( e ) {
|
2291 |
+
// Discard the second event of a jQuery.event.trigger() and
|
2292 |
+
// when an event is called after a page has unloaded
|
2293 |
+
return typeof jQuery !== core_strundefined && (!e || jQuery.event.triggered !== e.type) ?
|
2294 |
+
jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
|
2295 |
+
undefined;
|
2296 |
+
};
|
2297 |
+
// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
|
2298 |
+
eventHandle.elem = elem;
|
2299 |
+
}
|
2300 |
+
// Handle multiple events separated by a space
|
2301 |
+
// jQuery(...).bind("mouseover mouseout", fn);
|
2302 |
+
types = ( types || "" ).match( core_rnotwhite ) || [""];
|
2303 |
+
t = types.length;
|
2304 |
+
while ( t-- ) {
|
2305 |
+
tmp = rtypenamespace.exec( types[t] ) || [];
|
2306 |
+
type = origType = tmp[1];
|
2307 |
+
namespaces = ( tmp[2] || "" ).split( "." ).sort();
|
2308 |
+
// If event changes its type, use the special event handlers for the changed type
|
2309 |
+
special = jQuery.event.special[ type ] || {};
|
2310 |
+
// If selector defined, determine special event api type, otherwise given type
|
2311 |
+
type = ( selector ? special.delegateType : special.bindType ) || type;
|
2312 |
+
// Update special based on newly reset type
|
2313 |
+
special = jQuery.event.special[ type ] || {};
|
2314 |
+
// handleObj is passed to all event handlers
|
2315 |
+
handleObj = jQuery.extend({
|
2316 |
+
type: type,
|
2317 |
+
origType: origType,
|
2318 |
+
data: data,
|
2319 |
+
handler: handler,
|
2320 |
+
guid: handler.guid,
|
2321 |
+
selector: selector,
|
2322 |
+
needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
|
2323 |
+
namespace: namespaces.join(".")
|
2324 |
+
}, handleObjIn );
|
2325 |
+
// Init the event handler queue if we're the first
|
2326 |
+
if ( !(handlers = events[ type ]) ) {
|
2327 |
+
handlers = events[ type ] = [];
|
2328 |
+
handlers.delegateCount = 0;
|
2329 |
+
// Only use addEventListener/attachEvent if the special events handler returns false
|
2330 |
+
if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
|
2331 |
+
// Bind the global event handler to the element
|
2332 |
+
if ( elem.addEventListener ) {
|
2333 |
+
elem.addEventListener( type, eventHandle, false );
|
2334 |
+
} else if ( elem.attachEvent ) {
|
2335 |
+
elem.attachEvent( "on" + type, eventHandle );
|
2336 |
+
}
|
2337 |
+
}
|
2338 |
+
}
|
2339 |
+
if ( special.add ) {
|
2340 |
+
special.add.call( elem, handleObj );
|
2341 |
+
if ( !handleObj.handler.guid ) {
|
2342 |
+
handleObj.handler.guid = handler.guid;
|
2343 |
+
}
|
2344 |
+
}
|
2345 |
+
// Add to the element's handler list, delegates in front
|
2346 |
+
if ( selector ) {
|
2347 |
+
handlers.splice( handlers.delegateCount++, 0, handleObj );
|
2348 |
+
} else {
|
2349 |
+
handlers.push( handleObj );
|
2350 |
+
}
|
2351 |
+
// Keep track of which events have ever been used, for event optimization
|
2352 |
+
jQuery.event.global[ type ] = true;
|
2353 |
+
}
|
2354 |
+
// Nullify elem to prevent memory leaks in IE
|
2355 |
+
elem = null;
|
2356 |
+
},
|
2357 |
+
// Detach an event or set of events from an element
|
2358 |
+
remove: function( elem, types, handler, selector, mappedTypes ) {
|
2359 |
+
var j, handleObj, tmp,
|
2360 |
+
origCount, t, events,
|
2361 |
+
special, handlers, type,
|
2362 |
+
namespaces, origType,
|
2363 |
+
elemData = jQuery.hasData( elem ) && jQuery._data( elem );
|
2364 |
+
if ( !elemData || !(events = elemData.events) ) {
|
2365 |
+
return;
|
2366 |
+
}
|
2367 |
+
// Once for each type.namespace in types; type may be omitted
|
2368 |
+
types = ( types || "" ).match( core_rnotwhite ) || [""];
|
2369 |
+
t = types.length;
|
2370 |
+
while ( t-- ) {
|
2371 |
+
tmp = rtypenamespace.exec( types[t] ) || [];
|
2372 |
+
type = origType = tmp[1];
|
2373 |
+
namespaces = ( tmp[2] || "" ).split( "." ).sort();
|
2374 |
+
// Unbind all events (on this namespace, if provided) for the element
|
2375 |
+
if ( !type ) {
|
2376 |
+
for ( type in events ) {
|
2377 |
+
jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
|
2378 |
+
}
|
2379 |
+
continue;
|
2380 |
+
}
|
2381 |
+
special = jQuery.event.special[ type ] || {};
|
2382 |
+
type = ( selector ? special.delegateType : special.bindType ) || type;
|
2383 |
+
handlers = events[ type ] || [];
|
2384 |
+
tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
|
2385 |
+
// Remove matching events
|
2386 |
+
origCount = j = handlers.length;
|
2387 |
+
while ( j-- ) {
|
2388 |
+
handleObj = handlers[ j ];
|
2389 |
+
if ( ( mappedTypes || origType === handleObj.origType ) &&
|
2390 |
+
( !handler || handler.guid === handleObj.guid ) &&
|
2391 |
+
( !tmp || tmp.test( handleObj.namespace ) ) &&
|
2392 |
+
( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
|
2393 |
+
handlers.splice( j, 1 );
|
2394 |
+
if ( handleObj.selector ) {
|
2395 |
+
handlers.delegateCount--;
|
2396 |
+
}
|
2397 |
+
if ( special.remove ) {
|
2398 |
+
special.remove.call( elem, handleObj );
|
2399 |
+
}
|
2400 |
+
}
|
2401 |
+
}
|
2402 |
+
// Remove generic event handler if we removed something and no more handlers exist
|
2403 |
+
// (avoids potential for endless recursion during removal of special event handlers)
|
2404 |
+
if ( origCount && !handlers.length ) {
|
2405 |
+
if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
|
2406 |
+
jQuery.removeEvent( elem, type, elemData.handle );
|
2407 |
+
}
|
2408 |
+
delete events[ type ];
|
2409 |
+
}
|
2410 |
+
}
|
2411 |
+
// Remove the expando if it's no longer used
|
2412 |
+
if ( jQuery.isEmptyObject( events ) ) {
|
2413 |
+
delete elemData.handle;
|
2414 |
+
// removeData also checks for emptiness and clears the expando if empty
|
2415 |
+
// so use it instead of delete
|
2416 |
+
jQuery._removeData( elem, "events" );
|
2417 |
+
}
|
2418 |
+
},
|
2419 |
+
trigger: function( event, data, elem, onlyHandlers ) {
|
2420 |
+
var handle, ontype, cur,
|
2421 |
+
bubbleType, special, tmp, i,
|
2422 |
+
eventPath = [ elem || document ],
|
2423 |
+
type = core_hasOwn.call( event, "type" ) ? event.type : event,
|
2424 |
+
namespaces = core_hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
|
2425 |
+
cur = tmp = elem = elem || document;
|
2426 |
+
// Don't do events on text and comment nodes
|
2427 |
+
if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
|
2428 |
+
return;
|
2429 |
+
}
|
2430 |
+
// focus/blur morphs to focusin/out; ensure we're not firing them right now
|
2431 |
+
if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
|
2432 |
+
return;
|
2433 |
+
}
|
2434 |
+
if ( type.indexOf(".") >= 0 ) {
|
2435 |
+
// Namespaced trigger; create a regexp to match event type in handle()
|
2436 |
+
namespaces = type.split(".");
|
2437 |
+
type = namespaces.shift();
|
2438 |
+
namespaces.sort();
|
2439 |
+
}
|
2440 |
+
ontype = type.indexOf(":") < 0 && "on" + type;
|
2441 |
+
// Caller can pass in a jQuery.Event object, Object, or just an event type string
|
2442 |
+
event = event[ jQuery.expando ] ?
|
2443 |
+
event :
|
2444 |
+
new jQuery.Event( type, typeof event === "object" && event );
|
2445 |
+
event.isTrigger = true;
|
2446 |
+
event.namespace = namespaces.join(".");
|
2447 |
+
event.namespace_re = event.namespace ?
|
2448 |
+
new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
|
2449 |
+
null;
|
2450 |
+
// Clean up the event in case it is being reused
|
2451 |
+
event.result = undefined;
|
2452 |
+
if ( !event.target ) {
|
2453 |
+
event.target = elem;
|
2454 |
+
}
|
2455 |
+
// Clone any incoming data and prepend the event, creating the handler arg list
|
2456 |
+
data = data == null ?
|
2457 |
+
[ event ] :
|
2458 |
+
jQuery.makeArray( data, [ event ] );
|
2459 |
+
// Allow special events to draw outside the lines
|
2460 |
+
special = jQuery.event.special[ type ] || {};
|
2461 |
+
if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
|
2462 |
+
return;
|
2463 |
+
}
|
2464 |
+
// Determine event propagation path in advance, per W3C events spec (#9951)
|
2465 |
+
// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
|
2466 |
+
if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
|
2467 |
+
bubbleType = special.delegateType || type;
|
2468 |
+
if ( !rfocusMorph.test( bubbleType + type ) ) {
|
2469 |
+
cur = cur.parentNode;
|
2470 |
+
}
|
2471 |
+
for ( ; cur; cur = cur.parentNode ) {
|
2472 |
+
eventPath.push( cur );
|
2473 |
+
tmp = cur;
|
2474 |
+
}
|
2475 |
+
// Only add window if we got to document (e.g., not plain obj or detached DOM)
|
2476 |
+
if ( tmp === (elem.ownerDocument || document) ) {
|
2477 |
+
eventPath.push( tmp.defaultView || tmp.parentWindow || window );
|
2478 |
+
}
|
2479 |
+
}
|
2480 |
+
// Fire handlers on the event path
|
2481 |
+
i = 0;
|
2482 |
+
while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
|
2483 |
+
event.type = i > 1 ?
|
2484 |
+
bubbleType :
|
2485 |
+
special.bindType || type;
|
2486 |
+
// jQuery handler
|
2487 |
+
handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
|
2488 |
+
if ( handle ) {
|
2489 |
+
handle.apply( cur, data );
|
2490 |
+
}
|
2491 |
+
// Native handler
|
2492 |
+
handle = ontype && cur[ ontype ];
|
2493 |
+
if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
|
2494 |
+
event.preventDefault();
|
2495 |
+
}
|
2496 |
+
}
|
2497 |
+
event.type = type;
|
2498 |
+
// If nobody prevented the default action, do it now
|
2499 |
+
if ( !onlyHandlers && !event.isDefaultPrevented() ) {
|
2500 |
+
if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
|
2501 |
+
!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
|
2502 |
+
// Call a native DOM method on the target with the same name name as the event.
|
2503 |
+
// Can't use an .isFunction() check here because IE6/7 fails that test.
|
2504 |
+
// Don't do default actions on window, that's where global variables be (#6170)
|
2505 |
+
if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
|
2506 |
+
// Don't re-trigger an onFOO event when we call its FOO() method
|
2507 |
+
tmp = elem[ ontype ];
|
2508 |
+
if ( tmp ) {
|
2509 |
+
elem[ ontype ] = null;
|
2510 |
+
}
|
2511 |
+
// Prevent re-triggering of the same event, since we already bubbled it above
|
2512 |
+
jQuery.event.triggered = type;
|
2513 |
+
try {
|
2514 |
+
elem[ type ]();
|
2515 |
+
} catch ( e ) {
|
2516 |
+
// IE<9 dies on focus/blur to hidden element (#1486,#12518)
|
2517 |
+
// only reproducible on winXP IE8 native, not IE9 in IE8 mode
|
2518 |
+
}
|
2519 |
+
jQuery.event.triggered = undefined;
|
2520 |
+
if ( tmp ) {
|
2521 |
+
elem[ ontype ] = tmp;
|
2522 |
+
}
|
2523 |
+
}
|
2524 |
+
}
|
2525 |
+
}
|
2526 |
+
return event.result;
|
2527 |
+
},
|
2528 |
+
dispatch: function( event ) {
|
2529 |
+
// Make a writable jQuery.Event from the native event object
|
2530 |
+
event = jQuery.event.fix( event );
|
2531 |
+
var i, ret, handleObj, matched, j,
|
2532 |
+
handlerQueue = [],
|
2533 |
+
args = core_slice.call( arguments ),
|
2534 |
+
handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
|
2535 |
+
special = jQuery.event.special[ event.type ] || {};
|
2536 |
+
// Use the fix-ed jQuery.Event rather than the (read-only) native event
|
2537 |
+
args[0] = event;
|
2538 |
+
event.delegateTarget = this;
|
2539 |
+
// Call the preDispatch hook for the mapped type, and let it bail if desired
|
2540 |
+
if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
|
2541 |
+
return;
|
2542 |
+
}
|
2543 |
+
// Determine handlers
|
2544 |
+
handlerQueue = jQuery.event.handlers.call( this, event, handlers );
|
2545 |
+
// Run delegates first; they may want to stop propagation beneath us
|
2546 |
+
i = 0;
|
2547 |
+
while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
|
2548 |
+
event.currentTarget = matched.elem;
|
2549 |
+
j = 0;
|
2550 |
+
while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
|
2551 |
+
// Triggered event must either 1) have no namespace, or
|
2552 |
+
// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
|
2553 |
+
if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
|
2554 |
+
event.handleObj = handleObj;
|
2555 |
+
event.data = handleObj.data;
|
2556 |
+
ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
|
2557 |
+
.apply( matched.elem, args );
|
2558 |
+
if ( ret !== undefined ) {
|
2559 |
+
if ( (event.result = ret) === false ) {
|
2560 |
+
event.preventDefault();
|
2561 |
+
event.stopPropagation();
|
2562 |
+
}
|
2563 |
+
}
|
2564 |
+
}
|
2565 |
+
}
|
2566 |
+
}
|
2567 |
+
// Call the postDispatch hook for the mapped type
|
2568 |
+
if ( special.postDispatch ) {
|
2569 |
+
special.postDispatch.call( this, event );
|
2570 |
+
}
|
2571 |
+
return event.result;
|
2572 |
+
},
|
2573 |
+
handlers: function( event, handlers ) {
|
2574 |
+
var sel, handleObj, matches, i,
|
2575 |
+
handlerQueue = [],
|
2576 |
+
delegateCount = handlers.delegateCount,
|
2577 |
+
cur = event.target;
|
2578 |
+
// Find delegate handlers
|
2579 |
+
// Black-hole SVG <use> instance trees (#13180)
|
2580 |
+
// Avoid non-left-click bubbling in Firefox (#3861)
|
2581 |
+
if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
|
2582 |
+
for ( ; cur != this; cur = cur.parentNode || this ) {
|
2583 |
+
// Don't check non-elements (#13208)
|
2584 |
+
// Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
|
2585 |
+
if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
|
2586 |
+
matches = [];
|
2587 |
+
for ( i = 0; i < delegateCount; i++ ) {
|
2588 |
+
handleObj = handlers[ i ];
|
2589 |
+
// Don't conflict with Object.prototype properties (#13203)
|
2590 |
+
sel = handleObj.selector + " ";
|
2591 |
+
if ( matches[ sel ] === undefined ) {
|
2592 |
+
matches[ sel ] = handleObj.needsContext ?
|
2593 |
+
jQuery( sel, this ).index( cur ) >= 0 :
|
2594 |
+
jQuery.find( sel, this, null, [ cur ] ).length;
|
2595 |
+
}
|
2596 |
+
if ( matches[ sel ] ) {
|
2597 |
+
matches.push( handleObj );
|
2598 |
+
}
|
2599 |
+
}
|
2600 |
+
if ( matches.length ) {
|
2601 |
+
handlerQueue.push({ elem: cur, handlers: matches });
|
2602 |
+
}
|
2603 |
+
}
|
2604 |
+
}
|
2605 |
+
}
|
2606 |
+
// Add the remaining (directly-bound) handlers
|
2607 |
+
if ( delegateCount < handlers.length ) {
|
2608 |
+
handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
|
2609 |
+
}
|
2610 |
+
return handlerQueue;
|
2611 |
+
},
|
2612 |
+
fix: function( event ) {
|
2613 |
+
if ( event[ jQuery.expando ] ) {
|
2614 |
+
return event;
|
2615 |
+
}
|
2616 |
+
// Create a writable copy of the event object and normalize some properties
|
2617 |
+
var i, prop, copy,
|
2618 |
+
type = event.type,
|
2619 |
+
originalEvent = event,
|
2620 |
+
fixHook = this.fixHooks[ type ];
|
2621 |
+
if ( !fixHook ) {
|
2622 |
+
this.fixHooks[ type ] = fixHook =
|
2623 |
+
rmouseEvent.test( type ) ? this.mouseHooks :
|
2624 |
+
rkeyEvent.test( type ) ? this.keyHooks :
|
2625 |
+
{};
|
2626 |
+
}
|
2627 |
+
copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
|
2628 |
+
event = new jQuery.Event( originalEvent );
|
2629 |
+
i = copy.length;
|
2630 |
+
while ( i-- ) {
|
2631 |
+
prop = copy[ i ];
|
2632 |
+
event[ prop ] = originalEvent[ prop ];
|
2633 |
+
}
|
2634 |
+
// Support: IE<9
|
2635 |
+
// Fix target property (#1925)
|
2636 |
+
if ( !event.target ) {
|
2637 |
+
event.target = originalEvent.srcElement || document;
|
2638 |
+
}
|
2639 |
+
// Support: Chrome 23+, Safari?
|
2640 |
+
// Target should not be a text node (#504, #13143)
|
2641 |
+
if ( event.target.nodeType === 3 ) {
|
2642 |
+
event.target = event.target.parentNode;
|
2643 |
+
}
|
2644 |
+
// Support: IE<9
|
2645 |
+
// For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
|
2646 |
+
event.metaKey = !!event.metaKey;
|
2647 |
+
return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
|
2648 |
+
},
|
2649 |
+
// Includes some event props shared by KeyEvent and MouseEvent
|
2650 |
+
props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
|
2651 |
+
fixHooks: {},
|
2652 |
+
keyHooks: {
|
2653 |
+
props: "char charCode key keyCode".split(" "),
|
2654 |
+
filter: function( event, original ) {
|
2655 |
+
// Add which for key events
|
2656 |
+
if ( event.which == null ) {
|
2657 |
+
event.which = original.charCode != null ? original.charCode : original.keyCode;
|
2658 |
+
}
|
2659 |
+
return event;
|
2660 |
+
}
|
2661 |
+
},
|
2662 |
+
mouseHooks: {
|
2663 |
+
props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
|
2664 |
+
filter: function( event, original ) {
|
2665 |
+
var body, eventDoc, doc,
|
2666 |
+
button = original.button,
|
2667 |
+
fromElement = original.fromElement;
|
2668 |
+
// Calculate pageX/Y if missing and clientX/Y available
|
2669 |
+
if ( event.pageX == null && original.clientX != null ) {
|
2670 |
+
eventDoc = event.target.ownerDocument || document;
|
2671 |
+
doc = eventDoc.documentElement;
|
2672 |
+
body = eventDoc.body;
|
2673 |
+
event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
|
2674 |
+
event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
|
2675 |
+
}
|
2676 |
+
// Add relatedTarget, if necessary
|
2677 |
+
if ( !event.relatedTarget && fromElement ) {
|
2678 |
+
event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
|
2679 |
+
}
|
2680 |
+
// Add which for click: 1 === left; 2 === middle; 3 === right
|
2681 |
+
// Note: button is not normalized, so don't use it
|
2682 |
+
if ( !event.which && button !== undefined ) {
|
2683 |
+
event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
|
2684 |
+
}
|
2685 |
+
return event;
|
2686 |
+
}
|
2687 |
+
},
|
2688 |
+
special: {
|
2689 |
+
load: {
|
2690 |
+
// Prevent triggered image.load events from bubbling to window.load
|
2691 |
+
noBubble: true
|
2692 |
+
},
|
2693 |
+
click: {
|
2694 |
+
// For checkbox, fire native event so checked state will be right
|
2695 |
+
trigger: function() {
|
2696 |
+
if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
|
2697 |
+
this.click();
|
2698 |
+
return false;
|
2699 |
+
}
|
2700 |
+
}
|
2701 |
+
},
|
2702 |
+
focus: {
|
2703 |
+
// Fire native event if possible so blur/focus sequence is correct
|
2704 |
+
trigger: function() {
|
2705 |
+
if ( this !== document.activeElement && this.focus ) {
|
2706 |
+
try {
|
2707 |
+
this.focus();
|
2708 |
+
return false;
|
2709 |
+
} catch ( e ) {
|
2710 |
+
// Support: IE<9
|
2711 |
+
// If we error on focus to hidden element (#1486, #12518),
|
2712 |
+
// let .trigger() run the handlers
|
2713 |
+
}
|
2714 |
+
}
|
2715 |
+
},
|
2716 |
+
delegateType: "focusin"
|
2717 |
+
},
|
2718 |
+
blur: {
|
2719 |
+
trigger: function() {
|
2720 |
+
if ( this === document.activeElement && this.blur ) {
|
2721 |
+
this.blur();
|
2722 |
+
return false;
|
2723 |
+
}
|
2724 |
+
},
|
2725 |
+
delegateType: "focusout"
|
2726 |
+
},
|
2727 |
+
beforeunload: {
|
2728 |
+
postDispatch: function( event ) {
|
2729 |
+
// Even when returnValue equals to undefined Firefox will still show alert
|
2730 |
+
if ( event.result !== undefined ) {
|
2731 |
+
event.originalEvent.returnValue = event.result;
|
2732 |
+
}
|
2733 |
+
}
|
2734 |
+
}
|
2735 |
+
},
|
2736 |
+
simulate: function( type, elem, event, bubble ) {
|
2737 |
+
// Piggyback on a donor event to simulate a different one.
|
2738 |
+
// Fake originalEvent to avoid donor's stopPropagation, but if the
|
2739 |
+
// simulated event prevents default then we do the same on the donor.
|
2740 |
+
var e = jQuery.extend(
|
2741 |
+
new jQuery.Event(),
|
2742 |
+
event,
|
2743 |
+
{ type: type,
|
2744 |
+
isSimulated: true,
|
2745 |
+
originalEvent: {}
|
2746 |
+
}
|
2747 |
+
);
|
2748 |
+
if ( bubble ) {
|
2749 |
+
jQuery.event.trigger( e, null, elem );
|
2750 |
+
} else {
|
2751 |
+
jQuery.event.dispatch.call( elem, e );
|
2752 |
+
}
|
2753 |
+
if ( e.isDefaultPrevented() ) {
|
2754 |
+
event.preventDefault();
|
2755 |
+
}
|
2756 |
+
}
|
2757 |
+
};
|
2758 |
+
jQuery.removeEvent = document.removeEventListener ?
|
2759 |
+
function( elem, type, handle ) {
|
2760 |
+
if ( elem.removeEventListener ) {
|
2761 |
+
elem.removeEventListener( type, handle, false );
|
2762 |
+
}
|
2763 |
+
} :
|
2764 |
+
function( elem, type, handle ) {
|
2765 |
+
var name = "on" + type;
|
2766 |
+
if ( elem.detachEvent ) {
|
2767 |
+
// #8545, #7054, preventing memory leaks for custom events in IE6-8
|
2768 |
+
// detachEvent needed property on element, by name of that event, to properly expose it to GC
|
2769 |
+
if ( typeof elem[ name ] === core_strundefined ) {
|
2770 |
+
elem[ name ] = null;
|
2771 |
+
}
|
2772 |
+
elem.detachEvent( name, handle );
|
2773 |
+
}
|
2774 |
+
};
|
2775 |
+
jQuery.Event = function( src, props ) {
|
2776 |
+
// Allow instantiation without the 'new' keyword
|
2777 |
+
if ( !(this instanceof jQuery.Event) ) {
|
2778 |
+
return new jQuery.Event( src, props );
|
2779 |
+
}
|
2780 |
+
// Event object
|
2781 |
+
if ( src && src.type ) {
|
2782 |
+
this.originalEvent = src;
|
2783 |
+
this.type = src.type;
|
2784 |
+
// Events bubbling up the document may have been marked as prevented
|
2785 |
+
// by a handler lower down the tree; reflect the correct value.
|
2786 |
+
this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
|
2787 |
+
src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
|
2788 |
+
// Event type
|
2789 |
+
} else {
|
2790 |
+
this.type = src;
|
2791 |
+
}
|
2792 |
+
// Put explicitly provided properties onto the event object
|
2793 |
+
if ( props ) {
|
2794 |
+
jQuery.extend( this, props );
|
2795 |
+
}
|
2796 |
+
// Create a timestamp if incoming event doesn't have one
|
2797 |
+
this.timeStamp = src && src.timeStamp || jQuery.now();
|
2798 |
+
// Mark it as fixed
|
2799 |
+
this[ jQuery.expando ] = true;
|
2800 |
+
};
|
2801 |
+
// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
|
2802 |
+
// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
|
2803 |
+
jQuery.Event.prototype = {
|
2804 |
+
isDefaultPrevented: returnFalse,
|
2805 |
+
isPropagationStopped: returnFalse,
|
2806 |
+
isImmediatePropagationStopped: returnFalse,
|
2807 |
+
preventDefault: function() {
|
2808 |
+
var e = this.originalEvent;
|
2809 |
+
this.isDefaultPrevented = returnTrue;
|
2810 |
+
if ( !e ) {
|
2811 |
+
return;
|
2812 |
+
}
|
2813 |
+
// If preventDefault exists, run it on the original event
|
2814 |
+
if ( e.preventDefault ) {
|
2815 |
+
e.preventDefault();
|
2816 |
+
// Support: IE
|
2817 |
+
// Otherwise set the returnValue property of the original event to false
|
2818 |
+
} else {
|
2819 |
+
e.returnValue = false;
|
2820 |
+
}
|
2821 |
+
},
|
2822 |
+
stopPropagation: function() {
|
2823 |
+
var e = this.originalEvent;
|
2824 |
+
this.isPropagationStopped = returnTrue;
|
2825 |
+
if ( !e ) {
|
2826 |
+
return;
|
2827 |
+
}
|
2828 |
+
// If stopPropagation exists, run it on the original event
|
2829 |
+
if ( e.stopPropagation ) {
|
2830 |
+
e.stopPropagation();
|
2831 |
+
}
|
2832 |
+
// Support: IE
|
2833 |
+
// Set the cancelBubble property of the original event to true
|
2834 |
+
e.cancelBubble = true;
|
2835 |
+
},
|
2836 |
+
stopImmediatePropagation: function() {
|
2837 |
+
this.isImmediatePropagationStopped = returnTrue;
|
2838 |
+
this.stopPropagation();
|
2839 |
+
}
|
2840 |
+
};
|
2841 |
+
// Create mouseenter/leave events using mouseover/out and event-time checks
|
2842 |
+
jQuery.each({
|
2843 |
+
mouseenter: "mouseover",
|
2844 |
+
mouseleave: "mouseout"
|
2845 |
+
}, function( orig, fix ) {
|
2846 |
+
jQuery.event.special[ orig ] = {
|
2847 |
+
delegateType: fix,
|
2848 |
+
bindType: fix,
|
2849 |
+
handle: function( event ) {
|
2850 |
+
var ret,
|
2851 |
+
target = this,
|
2852 |
+
related = event.relatedTarget,
|
2853 |
+
handleObj = event.handleObj;
|
2854 |
+
// For mousenter/leave call the handler if related is outside the target.
|
2855 |
+
// NB: No relatedTarget if the mouse left/entered the browser window
|
2856 |
+
if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
|
2857 |
+
event.type = handleObj.origType;
|
2858 |
+
ret = handleObj.handler.apply( this, arguments );
|
2859 |
+
event.type = fix;
|
2860 |
+
}
|
2861 |
+
return ret;
|
2862 |
+
}
|
2863 |
+
};
|
2864 |
+
});
|
2865 |
+
// IE submit delegation
|
2866 |
+
if ( !jQuery.support.submitBubbles ) {
|
2867 |
+
jQuery.event.special.submit = {
|
2868 |
+
setup: function() {
|
2869 |
+
// Only need this for delegated form submit events
|
2870 |
+
if ( jQuery.nodeName( this, "form" ) ) {
|
2871 |
+
return false;
|
2872 |
+
}
|
2873 |
+
// Lazy-add a submit handler when a descendant form may potentially be submitted
|
2874 |
+
jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
|
2875 |
+
// Node name check avoids a VML-related crash in IE (#9807)
|
2876 |
+
var elem = e.target,
|
2877 |
+
form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
|
2878 |
+
if ( form && !jQuery._data( form, "submitBubbles" ) ) {
|
2879 |
+
jQuery.event.add( form, "submit._submit", function( event ) {
|
2880 |
+
event._submit_bubble = true;
|
2881 |
+
});
|
2882 |
+
jQuery._data( form, "submitBubbles", true );
|
2883 |
+
}
|
2884 |
+
});
|
2885 |
+
// return undefined since we don't need an event listener
|
2886 |
+
},
|
2887 |
+
postDispatch: function( event ) {
|
2888 |
+
// If form was submitted by the user, bubble the event up the tree
|
2889 |
+
if ( event._submit_bubble ) {
|
2890 |
+
delete event._submit_bubble;
|
2891 |
+
if ( this.parentNode && !event.isTrigger ) {
|
2892 |
+
jQuery.event.simulate( "submit", this.parentNode, event, true );
|
2893 |
+
}
|
2894 |
+
}
|
2895 |
+
},
|
2896 |
+
teardown: function() {
|
2897 |
+
// Only need this for delegated form submit events
|
2898 |
+
if ( jQuery.nodeName( this, "form" ) ) {
|
2899 |
+
return false;
|
2900 |
+
}
|
2901 |
+
// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
|
2902 |
+
jQuery.event.remove( this, "._submit" );
|
2903 |
+
}
|
2904 |
+
};
|
2905 |
+
}
|
2906 |
+
// IE change delegation and checkbox/radio fix
|
2907 |
+
if ( !jQuery.support.changeBubbles ) {
|
2908 |
+
jQuery.event.special.change = {
|
2909 |
+
setup: function() {
|
2910 |
+
if ( rformElems.test( this.nodeName ) ) {
|
2911 |
+
// IE doesn't fire change on a check/radio until blur; trigger it on click
|
2912 |
+
// after a propertychange. Eat the blur-change in special.change.handle.
|
2913 |
+
// This still fires onchange a second time for check/radio after blur.
|
2914 |
+
if ( this.type === "checkbox" || this.type === "radio" ) {
|
2915 |
+
jQuery.event.add( this, "propertychange._change", function( event ) {
|
2916 |
+
if ( event.originalEvent.propertyName === "checked" ) {
|
2917 |
+
this._just_changed = true;
|
2918 |
+
}
|
2919 |
+
});
|
2920 |
+
jQuery.event.add( this, "click._change", function( event ) {
|
2921 |
+
if ( this._just_changed && !event.isTrigger ) {
|
2922 |
+
this._just_changed = false;
|
2923 |
+
}
|
2924 |
+
// Allow triggered, simulated change events (#11500)
|
2925 |
+
jQuery.event.simulate( "change", this, event, true );
|
2926 |
+
});
|
2927 |
+
}
|
2928 |
+
return false;
|
2929 |
+
}
|
2930 |
+
// Delegated event; lazy-add a change handler on descendant inputs
|
2931 |
+
jQuery.event.add( this, "beforeactivate._change", function( e ) {
|
2932 |
+
var elem = e.target;
|
2933 |
+
if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
|
2934 |
+
jQuery.event.add( elem, "change._change", function( event ) {
|
2935 |
+
if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
|
2936 |
+
jQuery.event.simulate( "change", this.parentNode, event, true );
|
2937 |
+
}
|
2938 |
+
});
|
2939 |
+
jQuery._data( elem, "changeBubbles", true );
|
2940 |
+
}
|
2941 |
+
});
|
2942 |
+
},
|
2943 |
+
handle: function( event ) {
|
2944 |
+
var elem = event.target;
|
2945 |
+
// Swallow native change events from checkbox/radio, we already triggered them above
|
2946 |
+
if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
|
2947 |
+
return event.handleObj.handler.apply( this, arguments );
|
2948 |
+
}
|
2949 |
+
},
|
2950 |
+
teardown: function() {
|
2951 |
+
jQuery.event.remove( this, "._change" );
|
2952 |
+
return !rformElems.test( this.nodeName );
|
2953 |
+
}
|
2954 |
+
};
|
2955 |
+
}
|
2956 |
+
// Create "bubbling" focus and blur events
|
2957 |
+
if ( !jQuery.support.focusinBubbles ) {
|
2958 |
+
jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
|
2959 |
+
// Attach a single capturing handler while someone wants focusin/focusout
|
2960 |
+
var attaches = 0,
|
2961 |
+
handler = function( event ) {
|
2962 |
+
jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
|
2963 |
+
};
|
2964 |
+
jQuery.event.special[ fix ] = {
|
2965 |
+
setup: function() {
|
2966 |
+
if ( attaches++ === 0 ) {
|
2967 |
+
document.addEventListener( orig, handler, true );
|
2968 |
+
}
|
2969 |
+
},
|
2970 |
+
teardown: function() {
|
2971 |
+
if ( --attaches === 0 ) {
|
2972 |
+
document.removeEventListener( orig, handler, true );
|
2973 |
+
}
|
2974 |
+
}
|
2975 |
+
};
|
2976 |
+
});
|
2977 |
+
}
|
2978 |
+
jQuery.fn.extend({
|
2979 |
+
on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
|
2980 |
+
var type, origFn;
|
2981 |
+
// Types can be a map of types/handlers
|
2982 |
+
if ( typeof types === "object" ) {
|
2983 |
+
// ( types-Object, selector, data )
|
2984 |
+
if ( typeof selector !== "string" ) {
|
2985 |
+
// ( types-Object, data )
|
2986 |
+
data = data || selector;
|
2987 |
+
selector = undefined;
|
2988 |
+
}
|
2989 |
+
for ( type in types ) {
|
2990 |
+
this.on( type, selector, data, types[ type ], one );
|
2991 |
+
}
|
2992 |
+
return this;
|
2993 |
+
}
|
2994 |
+
if ( data == null && fn == null ) {
|
2995 |
+
// ( types, fn )
|
2996 |
+
fn = selector;
|
2997 |
+
data = selector = undefined;
|
2998 |
+
} else if ( fn == null ) {
|
2999 |
+
if ( typeof selector === "string" ) {
|
3000 |
+
// ( types, selector, fn )
|
3001 |
+
fn = data;
|
3002 |
+
data = undefined;
|
3003 |
+
} else {
|
3004 |
+
// ( types, data, fn )
|
3005 |
+
fn = data;
|
3006 |
+
data = selector;
|
3007 |
+
selector = undefined;
|
3008 |
+
}
|
3009 |
+
}
|
3010 |
+
if ( fn === false ) {
|
3011 |
+
fn = returnFalse;
|
3012 |
+
} else if ( !fn ) {
|
3013 |
+
return this;
|
3014 |
+
}
|
3015 |
+
if ( one === 1 ) {
|
3016 |
+
origFn = fn;
|
3017 |
+
fn = function( event ) {
|
3018 |
+
// Can use an empty set, since event contains the info
|
3019 |
+
jQuery().off( event );
|
3020 |
+
return origFn.apply( this, arguments );
|
3021 |
+
};
|
3022 |
+
// Use same guid so caller can remove using origFn
|
3023 |
+
fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
|
3024 |
+
}
|
3025 |
+
return this.each( function() {
|
3026 |
+
jQuery.event.add( this, types, fn, data, selector );
|
3027 |
+
});
|
3028 |
+
},
|
3029 |
+
one: function( types, selector, data, fn ) {
|
3030 |
+
return this.on( types, selector, data, fn, 1 );
|
3031 |
+
},
|
3032 |
+
off: function( types, selector, fn ) {
|
3033 |
+
var handleObj, type;
|
3034 |
+
if ( types && types.preventDefault && types.handleObj ) {
|
3035 |
+
// ( event ) dispatched jQuery.Event
|
3036 |
+
handleObj = types.handleObj;
|
3037 |
+
jQuery( types.delegateTarget ).off(
|
3038 |
+
handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
|
3039 |
+
handleObj.selector,
|
3040 |
+
handleObj.handler
|
3041 |
+
);
|
3042 |
+
return this;
|
3043 |
+
}
|
3044 |
+
if ( typeof types === "object" ) {
|
3045 |
+
// ( types-object [, selector] )
|
3046 |
+
for ( type in types ) {
|
3047 |
+
this.off( type, selector, types[ type ] );
|
3048 |
+
}
|
3049 |
+
return this;
|
3050 |
+
}
|
3051 |
+
if ( selector === false || typeof selector === "function" ) {
|
3052 |
+
// ( types [, fn] )
|
3053 |
+
fn = selector;
|
3054 |
+
selector = undefined;
|
3055 |
+
}
|
3056 |
+
if ( fn === false ) {
|
3057 |
+
fn = returnFalse;
|
3058 |
+
}
|
3059 |
+
return this.each(function() {
|
3060 |
+
jQuery.event.remove( this, types, fn, selector );
|
3061 |
+
});
|
3062 |
+
},
|
3063 |
+
bind: function( types, data, fn ) {
|
3064 |
+
return this.on( types, null, data, fn );
|
3065 |
+
},
|
3066 |
+
unbind: function( types, fn ) {
|
3067 |
+
return this.off( types, null, fn );
|
3068 |
+
},
|
3069 |
+
delegate: function( selector, types, data, fn ) {
|
3070 |
+
return this.on( types, selector, data, fn );
|
3071 |
+
},
|
3072 |
+
undelegate: function( selector, types, fn ) {
|
3073 |
+
// ( namespace ) or ( selector, types [, fn] )
|
3074 |
+
return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
|
3075 |
+
},
|
3076 |
+
trigger: function( type, data ) {
|
3077 |
+
return this.each(function() {
|
3078 |
+
jQuery.event.trigger( type, data, this );
|
3079 |
+
});
|
3080 |
+
},
|
3081 |
+
triggerHandler: function( type, data ) {
|
3082 |
+
var elem = this[0];
|
3083 |
+
if ( elem ) {
|
3084 |
+
return jQuery.event.trigger( type, data, elem, true );
|
3085 |
+
}
|
3086 |
+
}
|
3087 |
+
});
|
3088 |
+
/*!
|
3089 |
+
* Sizzle CSS Selector Engine
|
3090 |
+
* Copyright 2012 jQuery Foundation and other contributors
|
3091 |
+
* Released under the MIT license
|
3092 |
+
* http://sizzlejs.com/
|
3093 |
+
*/
|
3094 |
+
(function( window, undefined ) {
|
3095 |
+
var i,
|
3096 |
+
cachedruns,
|
3097 |
+
Expr,
|
3098 |
+
getText,
|
3099 |
+
isXML,
|
3100 |
+
compile,
|
3101 |
+
hasDuplicate,
|
3102 |
+
outermostContext,
|
3103 |
+
// Local document vars
|
3104 |
+
setDocument,
|
3105 |
+
document,
|
3106 |
+
docElem,
|
3107 |
+
documentIsXML,
|
3108 |
+
rbuggyQSA,
|
3109 |
+
rbuggyMatches,
|
3110 |
+
matches,
|
3111 |
+
contains,
|
3112 |
+
sortOrder,
|
3113 |
+
// Instance-specific data
|
3114 |
+
expando = "sizzle" + -(new Date()),
|
3115 |
+
preferredDoc = window.document,
|
3116 |
+
support = {},
|
3117 |
+
dirruns = 0,
|
3118 |
+
done = 0,
|
3119 |
+
classCache = createCache(),
|
3120 |
+
tokenCache = createCache(),
|
3121 |
+
compilerCache = createCache(),
|
3122 |
+
// General-purpose constants
|
3123 |
+
strundefined = typeof undefined,
|
3124 |
+
MAX_NEGATIVE = 1 << 31,
|
3125 |
+
// Array methods
|
3126 |
+
arr = [],
|
3127 |
+
pop = arr.pop,
|
3128 |
+
push = arr.push,
|
3129 |
+
slice = arr.slice,
|
3130 |
+
// Use a stripped-down indexOf if we can't use a native one
|
3131 |
+
indexOf = arr.indexOf || function( elem ) {
|
3132 |
+
var i = 0,
|
3133 |
+
len = this.length;
|
3134 |
+
for ( ; i < len; i++ ) {
|
3135 |
+
if ( this[i] === elem ) {
|
3136 |
+
return i;
|
3137 |
+
}
|
3138 |
+
}
|
3139 |
+
return -1;
|
3140 |
+
},
|
3141 |
+
// Regular expressions
|
3142 |
+
// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
|
3143 |
+
whitespace = "[\\x20\\t\\r\\n\\f]",
|
3144 |
+
// http://www.w3.org/TR/css3-syntax/#characters
|
3145 |
+
characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
|
3146 |
+
// Loosely modeled on CSS identifier characters
|
3147 |
+
// An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
|
3148 |
+
// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
|
3149 |
+
identifier = characterEncoding.replace( "w", "w#" ),
|
3150 |
+
// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
|
3151 |
+
operators = "([*^$|!~]?=)",
|
3152 |
+
attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
|
3153 |
+
"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
|
3154 |
+
// Prefer arguments quoted,
|
3155 |
+
// then not containing pseudos/brackets,
|
3156 |
+
// then attribute selectors/non-parenthetical expressions,
|
3157 |
+
// then anything else
|
3158 |
+
// These preferences are here to reduce the number of selectors
|
3159 |
+
// needing tokenize in the PSEUDO preFilter
|
3160 |
+
pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)",
|
3161 |
+
// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
|
3162 |
+
rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
|
3163 |
+
rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
|
3164 |
+
rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
|
3165 |
+
rpseudo = new RegExp( pseudos ),
|
3166 |
+
ridentifier = new RegExp( "^" + identifier + "$" ),
|
3167 |
+
matchExpr = {
|
3168 |
+
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
|
3169 |
+
"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
|
3170 |
+
"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
|
3171 |
+
"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
|
3172 |
+
"ATTR": new RegExp( "^" + attributes ),
|
3173 |
+
"PSEUDO": new RegExp( "^" + pseudos ),
|
3174 |
+
"CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
|
3175 |
+
"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
|
3176 |
+
"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
|
3177 |
+
// For use in libraries implementing .is()
|
3178 |
+
// We use this for POS matching in `select`
|
3179 |
+
"needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
|
3180 |
+
whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
|
3181 |
+
},
|
3182 |
+
rsibling = /[\x20\t\r\n\f]*[+~]/,
|
3183 |
+
rnative = /^[^{]+\{\s*\[native code/,
|
3184 |
+
// Easily-parseable/retrievable ID or TAG or CLASS selectors
|
3185 |
+
rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
|
3186 |
+
rinputs = /^(?:input|select|textarea|button)$/i,
|
3187 |
+
rheader = /^h\d$/i,
|
3188 |
+
rescape = /'|\\/g,
|
3189 |
+
rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
|
3190 |
+
// CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
|
3191 |
+
runescape = /\\([\da-fA-F]{1,6}[\x20\t\r\n\f]?|.)/g,
|
3192 |
+
funescape = function( _, escaped ) {
|
3193 |
+
var high = "0x" + escaped - 0x10000;
|
3194 |
+
// NaN means non-codepoint
|
3195 |
+
return high !== high ?
|
3196 |
+
escaped :
|
3197 |
+
// BMP codepoint
|
3198 |
+
high < 0 ?
|
3199 |
+
String.fromCharCode( high + 0x10000 ) :
|
3200 |
+
// Supplemental Plane codepoint (surrogate pair)
|
3201 |
+
String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
|
3202 |
+
};
|
3203 |
+
// Use a stripped-down slice if we can't use a native one
|
3204 |
+
try {
|
3205 |
+
slice.call( preferredDoc.documentElement.childNodes, 0 )[0].nodeType;
|
3206 |
+
} catch ( e ) {
|
3207 |
+
slice = function( i ) {
|
3208 |
+
var elem,
|
3209 |
+
results = [];
|
3210 |
+
while ( (elem = this[i++]) ) {
|
3211 |
+
results.push( elem );
|
3212 |
+
}
|
3213 |
+
return results;
|
3214 |
+
};
|
3215 |
+
}
|
3216 |
+
/**
|
3217 |
+
* For feature detection
|
3218 |
+
* @param {Function} fn The function to test for native support
|
3219 |
+
*/
|
3220 |
+
function isNative( fn ) {
|
3221 |
+
return rnative.test( fn + "" );
|
3222 |
+
}
|
3223 |
+
/**
|
3224 |
+
* Create key-value caches of limited size
|
3225 |
+
* @returns {Function(string, Object)} Returns the Object data after storing it on itself with
|
3226 |
+
* property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
|
3227 |
+
* deleting the oldest entry
|
3228 |
+
*/
|
3229 |
+
function createCache() {
|
3230 |
+
var cache,
|
3231 |
+
keys = [];
|
3232 |
+
return (cache = function( key, value ) {
|
3233 |
+
// Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
|
3234 |
+
if ( keys.push( key += " " ) > Expr.cacheLength ) {
|
3235 |
+
// Only keep the most recent entries
|
3236 |
+
delete cache[ keys.shift() ];
|
3237 |
+
}
|
3238 |
+
return (cache[ key ] = value);
|
3239 |
+
});
|
3240 |
+
}
|
3241 |
+
/**
|
3242 |
+
* Mark a function for special use by Sizzle
|
3243 |
+
* @param {Function} fn The function to mark
|
3244 |
+
*/
|
3245 |
+
function markFunction( fn ) {
|
3246 |
+
fn[ expando ] = true;
|
3247 |
+
return fn;
|
3248 |
+
}
|
3249 |
+
/**
|
3250 |
+
* Support testing using an element
|
3251 |
+
* @param {Function} fn Passed the created div and expects a boolean result
|
3252 |
+
*/
|
3253 |
+
function assert( fn ) {
|
3254 |
+
var div = document.createElement("div");
|
3255 |
+
try {
|
3256 |
+
return fn( div );
|
3257 |
+
} catch (e) {
|
3258 |
+
return false;
|
3259 |
+
} finally {
|
3260 |
+
// release memory in IE
|
3261 |
+
div = null;
|
3262 |
+
}
|
3263 |
+
}
|
3264 |
+
function Sizzle( selector, context, results, seed ) {
|
3265 |
+
var match, elem, m, nodeType,
|
3266 |
+
// QSA vars
|
3267 |
+
i, groups, old, nid, newContext, newSelector;
|
3268 |
+
if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
|
3269 |
+
setDocument( context );
|
3270 |
+
}
|
3271 |
+
context = context || document;
|
3272 |
+
results = results || [];
|
3273 |
+
if ( !selector || typeof selector !== "string" ) {
|
3274 |
+
return results;
|
3275 |
+
}
|
3276 |
+
if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
|
3277 |
+
return [];
|
3278 |
+
}
|
3279 |
+
if ( !documentIsXML && !seed ) {
|
3280 |
+
// Shortcuts
|
3281 |
+
if ( (match = rquickExpr.exec( selector )) ) {
|
3282 |
+
// Speed-up: Sizzle("#ID")
|
3283 |
+
if ( (m = match[1]) ) {
|
3284 |
+
if ( nodeType === 9 ) {
|
3285 |
+
elem = context.getElementById( m );
|
3286 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
3287 |
+
// nodes that are no longer in the document #6963
|
3288 |
+
if ( elem && elem.parentNode ) {
|
3289 |
+
// Handle the case where IE, Opera, and Webkit return items
|
3290 |
+
// by name instead of ID
|
3291 |
+
if ( elem.id === m ) {
|
3292 |
+
results.push( elem );
|
3293 |
+
return results;
|
3294 |
+
}
|
3295 |
+
} else {
|
3296 |
+
return results;
|
3297 |
+
}
|
3298 |
+
} else {
|
3299 |
+
// Context is not a document
|
3300 |
+
if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
|
3301 |
+
contains( context, elem ) && elem.id === m ) {
|
3302 |
+
results.push( elem );
|
3303 |
+
return results;
|
3304 |
+
}
|
3305 |
+
}
|
3306 |
+
// Speed-up: Sizzle("TAG")
|
3307 |
+
} else if ( match[2] ) {
|
3308 |
+
push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
|
3309 |
+
return results;
|
3310 |
+
// Speed-up: Sizzle(".CLASS")
|
3311 |
+
} else if ( (m = match[3]) && support.getByClassName && context.getElementsByClassName ) {
|
3312 |
+
push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
|
3313 |
+
return results;
|
3314 |
+
}
|
3315 |
+
}
|
3316 |
+
// QSA path
|
3317 |
+
if ( support.qsa && !rbuggyQSA.test(selector) ) {
|
3318 |
+
old = true;
|
3319 |
+
nid = expando;
|
3320 |
+
newContext = context;
|
3321 |
+
newSelector = nodeType === 9 && selector;
|
3322 |
+
// qSA works strangely on Element-rooted queries
|
3323 |
+
// We can work around this by specifying an extra ID on the root
|
3324 |
+
// and working up from there (Thanks to Andrew Dupont for the technique)
|
3325 |
+
// IE 8 doesn't work on object elements
|
3326 |
+
if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
|
3327 |
+
groups = tokenize( selector );
|
3328 |
+
if ( (old = context.getAttribute("id")) ) {
|
3329 |
+
nid = old.replace( rescape, "\\$&" );
|
3330 |
+
} else {
|
3331 |
+
context.setAttribute( "id", nid );
|
3332 |
+
}
|
3333 |
+
nid = "[id='" + nid + "'] ";
|
3334 |
+
i = groups.length;
|
3335 |
+
while ( i-- ) {
|
3336 |
+
groups[i] = nid + toSelector( groups[i] );
|
3337 |
+
}
|
3338 |
+
newContext = rsibling.test( selector ) && context.parentNode || context;
|
3339 |
+
newSelector = groups.join(",");
|
3340 |
+
}
|
3341 |
+
if ( newSelector ) {
|
3342 |
+
try {
|
3343 |
+
push.apply( results, slice.call( newContext.querySelectorAll(
|
3344 |
+
newSelector
|
3345 |
+
), 0 ) );
|
3346 |
+
return results;
|
3347 |
+
} catch(qsaError) {
|
3348 |
+
} finally {
|
3349 |
+
if ( !old ) {
|
3350 |
+
context.removeAttribute("id");
|
3351 |
+
}
|
3352 |
+
}
|
3353 |
+
}
|
3354 |
+
}
|
3355 |
+
}
|
3356 |
+
// All others
|
3357 |
+
return select( selector.replace( rtrim, "$1" ), context, results, seed );
|
3358 |
+
}
|
3359 |
+
/**
|
3360 |
+
* Detect xml
|
3361 |
+
* @param {Element|Object} elem An element or a document
|
3362 |
+
*/
|
3363 |
+
isXML = Sizzle.isXML = function( elem ) {
|
3364 |
+
// documentElement is verified for cases where it doesn't yet exist
|
3365 |
+
// (such as loading iframes in IE - #4833)
|
3366 |
+
var documentElement = elem && (elem.ownerDocument || elem).documentElement;
|
3367 |
+
return documentElement ? documentElement.nodeName !== "HTML" : false;
|
3368 |
+
};
|
3369 |
+
/**
|
3370 |
+
* Sets document-related variables once based on the current document
|
3371 |
+
* @param {Element|Object} [doc] An element or document object to use to set the document
|
3372 |
+
* @returns {Object} Returns the current document
|
3373 |
+
*/
|
3374 |
+
setDocument = Sizzle.setDocument = function( node ) {
|
3375 |
+
var doc = node ? node.ownerDocument || node : preferredDoc;
|
3376 |
+
// If no document and documentElement is available, return
|
3377 |
+
if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
|
3378 |
+
return document;
|
3379 |
+
}
|
3380 |
+
// Set our document
|
3381 |
+
document = doc;
|
3382 |
+
docElem = doc.documentElement;
|
3383 |
+
// Support tests
|
3384 |
+
documentIsXML = isXML( doc );
|
3385 |
+
// Check if getElementsByTagName("*") returns only elements
|
3386 |
+
support.tagNameNoComments = assert(function( div ) {
|
3387 |
+
div.appendChild( doc.createComment("") );
|
3388 |
+
return !div.getElementsByTagName("*").length;
|
3389 |
+
});
|
3390 |
+
// Check if attributes should be retrieved by attribute nodes
|
3391 |
+
support.attributes = assert(function( div ) {
|
3392 |
+
div.innerHTML = "<select></select>";
|
3393 |
+
var type = typeof div.lastChild.getAttribute("multiple");
|
3394 |
+
// IE8 returns a string for some attributes even when not present
|
3395 |
+
return type !== "boolean" && type !== "string";
|
3396 |
+
});
|
3397 |
+
// Check if getElementsByClassName can be trusted
|
3398 |
+
support.getByClassName = assert(function( div ) {
|
3399 |
+
// Opera can't find a second classname (in 9.6)
|
3400 |
+
div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
|
3401 |
+
if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
|
3402 |
+
return false;
|
3403 |
+
}
|
3404 |
+
// Safari 3.2 caches class attributes and doesn't catch changes
|
3405 |
+
div.lastChild.className = "e";
|
3406 |
+
return div.getElementsByClassName("e").length === 2;
|
3407 |
+
});
|
3408 |
+
// Check if getElementById returns elements by name
|
3409 |
+
// Check if getElementsByName privileges form controls or returns elements by ID
|
3410 |
+
support.getByName = assert(function( div ) {
|
3411 |
+
// Inject content
|
3412 |
+
div.id = expando + 0;
|
3413 |
+
div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
|
3414 |
+
docElem.insertBefore( div, docElem.firstChild );
|
3415 |
+
// Test
|
3416 |
+
var pass = doc.getElementsByName &&
|
3417 |
+
// buggy browsers will return fewer than the correct 2
|
3418 |
+
doc.getElementsByName( expando ).length === 2 +
|
3419 |
+
// buggy browsers will return more than the correct 0
|
3420 |
+
doc.getElementsByName( expando + 0 ).length;
|
3421 |
+
support.getIdNotName = !doc.getElementById( expando );
|
3422 |
+
// Cleanup
|
3423 |
+
docElem.removeChild( div );
|
3424 |
+
return pass;
|
3425 |
+
});
|
3426 |
+
// IE6/7 return modified attributes
|
3427 |
+
Expr.attrHandle = assert(function( div ) {
|
3428 |
+
div.innerHTML = "<a href='#'></a>";
|
3429 |
+
return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
|
3430 |
+
div.firstChild.getAttribute("href") === "#";
|
3431 |
+
}) ?
|
3432 |
+
{} :
|
3433 |
+
{
|
3434 |
+
"href": function( elem ) {
|
3435 |
+
return elem.getAttribute( "href", 2 );
|
3436 |
+
},
|
3437 |
+
"type": function( elem ) {
|
3438 |
+
return elem.getAttribute("type");
|
3439 |
+
}
|
3440 |
+
};
|
3441 |
+
// ID find and filter
|
3442 |
+
if ( support.getIdNotName ) {
|
3443 |
+
Expr.find["ID"] = function( id, context ) {
|
3444 |
+
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
|
3445 |
+
var m = context.getElementById( id );
|
3446 |
+
// Check parentNode to catch when Blackberry 4.6 returns
|
3447 |
+
// nodes that are no longer in the document #6963
|
3448 |
+
return m && m.parentNode ? [m] : [];
|
3449 |
+
}
|
3450 |
+
};
|
3451 |
+
Expr.filter["ID"] = function( id ) {
|
3452 |
+
var attrId = id.replace( runescape, funescape );
|
3453 |
+
return function( elem ) {
|
3454 |
+
return elem.getAttribute("id") === attrId;
|
3455 |
+
};
|
3456 |
+
};
|
3457 |
+
} else {
|
3458 |
+
Expr.find["ID"] = function( id, context ) {
|
3459 |
+
if ( typeof context.getElementById !== strundefined && !documentIsXML ) {
|
3460 |
+
var m = context.getElementById( id );
|
3461 |
+
return m ?
|
3462 |
+
m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
|
3463 |
+
[m] :
|
3464 |
+
undefined :
|
3465 |
+
[];
|
3466 |
+
}
|
3467 |
+
};
|
3468 |
+
Expr.filter["ID"] = function( id ) {
|
3469 |
+
var attrId = id.replace( runescape, funescape );
|
3470 |
+
return function( elem ) {
|
3471 |
+
var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
|
3472 |
+
return node && node.value === attrId;
|
3473 |
+
};
|
3474 |
+
};
|
3475 |
+
}
|
3476 |
+
// Tag
|
3477 |
+
Expr.find["TAG"] = support.tagNameNoComments ?
|
3478 |
+
function( tag, context ) {
|
3479 |
+
if ( typeof context.getElementsByTagName !== strundefined ) {
|
3480 |
+
return context.getElementsByTagName( tag );
|
3481 |
+
}
|
3482 |
+
} :
|
3483 |
+
function( tag, context ) {
|
3484 |
+
var elem,
|
3485 |
+
tmp = [],
|
3486 |
+
i = 0,
|
3487 |
+
results = context.getElementsByTagName( tag );
|
3488 |
+
// Filter out possible comments
|
3489 |
+
if ( tag === "*" ) {
|
3490 |
+
while ( (elem = results[i++]) ) {
|
3491 |
+
if ( elem.nodeType === 1 ) {
|
3492 |
+
tmp.push( elem );
|
3493 |
+
}
|
3494 |
+
}
|
3495 |
+
return tmp;
|
3496 |
+
}
|
3497 |
+
return results;
|
3498 |
+
};
|
3499 |
+
// Name
|
3500 |
+
Expr.find["NAME"] = support.getByName && function( tag, context ) {
|
3501 |
+
if ( typeof context.getElementsByName !== strundefined ) {
|
3502 |
+
return context.getElementsByName( name );
|
3503 |
+
}
|
3504 |
+
};
|
3505 |
+
// Class
|
3506 |
+
Expr.find["CLASS"] = support.getByClassName && function( className, context ) {
|
3507 |
+
if ( typeof context.getElementsByClassName !== strundefined && !documentIsXML ) {
|
3508 |
+
return context.getElementsByClassName( className );
|
3509 |
+
}
|
3510 |
+
};
|
3511 |
+
// QSA and matchesSelector support
|
3512 |
+
// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
|
3513 |
+
rbuggyMatches = [];
|
3514 |
+
// qSa(:focus) reports false when true (Chrome 21),
|
3515 |
+
// no need to also add to buggyMatches since matches checks buggyQSA
|
3516 |
+
// A support test would require too much code (would include document ready)
|
3517 |
+
rbuggyQSA = [ ":focus" ];
|
3518 |
+
if ( (support.qsa = isNative(doc.querySelectorAll)) ) {
|
3519 |
+
// Build QSA regex
|
3520 |
+
// Regex strategy adopted from Diego Perini
|
3521 |
+
assert(function( div ) {
|
3522 |
+
// Select is set to empty string on purpose
|
3523 |
+
// This is to test IE's treatment of not explictly
|
3524 |
+
// setting a boolean content attribute,
|
3525 |
+
// since its presence should be enough
|
3526 |
+
// http://bugs.jquery.com/ticket/12359
|
3527 |
+
div.innerHTML = "<select><option selected=''></option></select>";
|
3528 |
+
// IE8 - Some boolean attributes are not treated correctly
|
3529 |
+
if ( !div.querySelectorAll("[selected]").length ) {
|
3530 |
+
rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
|
3531 |
+
}
|
3532 |
+
// Webkit/Opera - :checked should return selected option elements
|
3533 |
+
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
|
3534 |
+
// IE8 throws error here and will not see later tests
|
3535 |
+
if ( !div.querySelectorAll(":checked").length ) {
|
3536 |
+
rbuggyQSA.push(":checked");
|
3537 |
+
}
|
3538 |
+
});
|
3539 |
+
assert(function( div ) {
|
3540 |
+
// Opera 10-12/IE8 - ^= $= *= and empty values
|
3541 |
+
// Should not select anything
|
3542 |
+
div.innerHTML = "<input type='hidden' i=''/>";
|
3543 |
+
if ( div.querySelectorAll("[i^='']").length ) {
|
3544 |
+
rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
|
3545 |
+
}
|
3546 |
+
// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
|
3547 |
+
// IE8 throws error here and will not see later tests
|
3548 |
+
if ( !div.querySelectorAll(":enabled").length ) {
|
3549 |
+
rbuggyQSA.push( ":enabled", ":disabled" );
|
3550 |
+
}
|
3551 |
+
// Opera 10-11 does not throw on post-comma invalid pseudos
|
3552 |
+
div.querySelectorAll("*,:x");
|
3553 |
+
rbuggyQSA.push(",.*:");
|
3554 |
+
});
|
3555 |
+
}
|
3556 |
+
if ( (support.matchesSelector = isNative( (matches = docElem.matchesSelector ||
|
3557 |
+
docElem.mozMatchesSelector ||
|
3558 |
+
docElem.webkitMatchesSelector ||
|
3559 |
+
docElem.oMatchesSelector ||
|
3560 |
+
docElem.msMatchesSelector) )) ) {
|
3561 |
+
assert(function( div ) {
|
3562 |
+
// Check to see if it's possible to do matchesSelector
|
3563 |
+
// on a disconnected node (IE 9)
|
3564 |
+
support.disconnectedMatch = matches.call( div, "div" );
|
3565 |
+
// This should fail with an exception
|
3566 |
+
// Gecko does not error, returns false instead
|
3567 |
+
matches.call( div, "[s!='']:x" );
|
3568 |
+
rbuggyMatches.push( "!=", pseudos );
|
3569 |
+
});
|
3570 |
+
}
|
3571 |
+
rbuggyQSA = new RegExp( rbuggyQSA.join("|") );
|
3572 |
+
rbuggyMatches = new RegExp( rbuggyMatches.join("|") );
|
3573 |
+
// Element contains another
|
3574 |
+
// Purposefully does not implement inclusive descendent
|
3575 |
+
// As in, an element does not contain itself
|
3576 |
+
contains = isNative(docElem.contains) || docElem.compareDocumentPosition ?
|
3577 |
+
function( a, b ) {
|
3578 |
+
var adown = a.nodeType === 9 ? a.documentElement : a,
|
3579 |
+
bup = b && b.parentNode;
|
3580 |
+
return a === bup || !!( bup && bup.nodeType === 1 && (
|
3581 |
+
adown.contains ?
|
3582 |
+
adown.contains( bup ) :
|
3583 |
+
a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
|
3584 |
+
));
|
3585 |
+
} :
|
3586 |
+
function( a, b ) {
|
3587 |
+
if ( b ) {
|
3588 |
+
while ( (b = b.parentNode) ) {
|
3589 |
+
if ( b === a ) {
|
3590 |
+
return true;
|
3591 |
+
}
|
3592 |
+
}
|
3593 |
+
}
|
3594 |
+
return false;
|
3595 |
+
};
|
3596 |
+
// Document order sorting
|
3597 |
+
sortOrder = docElem.compareDocumentPosition ?
|
3598 |
+
function( a, b ) {
|
3599 |
+
var compare;
|
3600 |
+
if ( a === b ) {
|
3601 |
+
hasDuplicate = true;
|
3602 |
+
return 0;
|
3603 |
+
}
|
3604 |
+
if ( (compare = b.compareDocumentPosition && a.compareDocumentPosition && a.compareDocumentPosition( b )) ) {
|
3605 |
+
if ( compare & 1 || a.parentNode && a.parentNode.nodeType === 11 ) {
|
3606 |
+
if ( a === doc || contains( preferredDoc, a ) ) {
|
3607 |
+
return -1;
|
3608 |
+
}
|
3609 |
+
if ( b === doc || contains( preferredDoc, b ) ) {
|
3610 |
+
return 1;
|
3611 |
+
}
|
3612 |
+
return 0;
|
3613 |
+
}
|
3614 |
+
return compare & 4 ? -1 : 1;
|
3615 |
+
}
|
3616 |
+
return a.compareDocumentPosition ? -1 : 1;
|
3617 |
+
} :
|
3618 |
+
function( a, b ) {
|
3619 |
+
var cur,
|
3620 |
+
i = 0,
|
3621 |
+
aup = a.parentNode,
|
3622 |
+
bup = b.parentNode,
|
3623 |
+
ap = [ a ],
|
3624 |
+
bp = [ b ];
|
3625 |
+
// Exit early if the nodes are identical
|
3626 |
+
if ( a === b ) {
|
3627 |
+
hasDuplicate = true;
|
3628 |
+
return 0;
|
3629 |
+
// Parentless nodes are either documents or disconnected
|
3630 |
+
} else if ( !aup || !bup ) {
|
3631 |
+
return a === doc ? -1 :
|
3632 |
+
b === doc ? 1 :
|
3633 |
+
aup ? -1 :
|
3634 |
+
bup ? 1 :
|
3635 |
+
0;
|
3636 |
+
// If the nodes are siblings, we can do a quick check
|
3637 |
+
} else if ( aup === bup ) {
|
3638 |
+
return siblingCheck( a, b );
|
3639 |
+
}
|
3640 |
+
// Otherwise we need full lists of their ancestors for comparison
|
3641 |
+
cur = a;
|
3642 |
+
while ( (cur = cur.parentNode) ) {
|
3643 |
+
ap.unshift( cur );
|
3644 |
+
}
|
3645 |
+
cur = b;
|
3646 |
+
while ( (cur = cur.parentNode) ) {
|
3647 |
+
bp.unshift( cur );
|
3648 |
+
}
|
3649 |
+
// Walk down the tree looking for a discrepancy
|
3650 |
+
while ( ap[i] === bp[i] ) {
|
3651 |
+
i++;
|
3652 |
+
}
|
3653 |
+
return i ?
|
3654 |
+
// Do a sibling check if the nodes have a common ancestor
|
3655 |
+
siblingCheck( ap[i], bp[i] ) :
|
3656 |
+
// Otherwise nodes in our document sort first
|
3657 |
+
ap[i] === preferredDoc ? -1 :
|
3658 |
+
bp[i] === preferredDoc ? 1 :
|
3659 |
+
0;
|
3660 |
+
};
|
3661 |
+
// Always assume the presence of duplicates if sort doesn't
|
3662 |
+
// pass them to our comparison function (as in Google Chrome).
|
3663 |
+
hasDuplicate = false;
|
3664 |
+
[0, 0].sort( sortOrder );
|
3665 |
+
support.detectDuplicates = hasDuplicate;
|
3666 |
+
return document;
|
3667 |
+
};
|
3668 |
+
Sizzle.matches = function( expr, elements ) {
|
3669 |
+
return Sizzle( expr, null, null, elements );
|
3670 |
+
};
|
3671 |
+
Sizzle.matchesSelector = function( elem, expr ) {
|
3672 |
+
// Set document vars if needed
|
3673 |
+
if ( ( elem.ownerDocument || elem ) !== document ) {
|
3674 |
+
setDocument( elem );
|
3675 |
+
}
|
3676 |
+
// Make sure that attribute selectors are quoted
|
3677 |
+
expr = expr.replace( rattributeQuotes, "='$1']" );
|
3678 |
+
// rbuggyQSA always contains :focus, so no need for an existence check
|
3679 |
+
if ( support.matchesSelector && !documentIsXML && (!rbuggyMatches || !rbuggyMatches.test(expr)) && !rbuggyQSA.test(expr) ) {
|
3680 |
+
try {
|
3681 |
+
var ret = matches.call( elem, expr );
|
3682 |
+
// IE 9's matchesSelector returns false on disconnected nodes
|
3683 |
+
if ( ret || support.disconnectedMatch ||
|
3684 |
+
// As well, disconnected nodes are said to be in a document
|
3685 |
+
// fragment in IE 9
|
3686 |
+
elem.document && elem.document.nodeType !== 11 ) {
|
3687 |
+
return ret;
|
3688 |
+
}
|
3689 |
+
} catch(e) {}
|
3690 |
+
}
|
3691 |
+
return Sizzle( expr, document, null, [elem] ).length > 0;
|
3692 |
+
};
|
3693 |
+
Sizzle.contains = function( context, elem ) {
|
3694 |
+
// Set document vars if needed
|
3695 |
+
if ( ( context.ownerDocument || context ) !== document ) {
|
3696 |
+
setDocument( context );
|
3697 |
+
}
|
3698 |
+
return contains( context, elem );
|
3699 |
+
};
|
3700 |
+
Sizzle.attr = function( elem, name ) {
|
3701 |
+
var val;
|
3702 |
+
// Set document vars if needed
|
3703 |
+
if ( ( elem.ownerDocument || elem ) !== document ) {
|
3704 |
+
setDocument( elem );
|
3705 |
+
}
|
3706 |
+
if ( !documentIsXML ) {
|
3707 |
+
name = name.toLowerCase();
|
3708 |
+
}
|
3709 |
+
if ( (val = Expr.attrHandle[ name ]) ) {
|
3710 |
+
return val( elem );
|
3711 |
+
}
|
3712 |
+
if ( documentIsXML || support.attributes ) {
|
3713 |
+
return elem.getAttribute( name );
|
3714 |
+
}
|
3715 |
+
return ( (val = elem.getAttributeNode( name )) || elem.getAttribute( name ) ) && elem[ name ] === true ?
|
3716 |
+
name :
|
3717 |
+
val && val.specified ? val.value : null;
|
3718 |
+
};
|
3719 |
+
Sizzle.error = function( msg ) {
|
3720 |
+
throw new Error( "Syntax error, unrecognized expression: " + msg );
|
3721 |
+
};
|
3722 |
+
// Document sorting and removing duplicates
|
3723 |
+
Sizzle.uniqueSort = function( results ) {
|
3724 |
+
var elem,
|
3725 |
+
duplicates = [],
|
3726 |
+
i = 1,
|
3727 |
+
j = 0;
|
3728 |
+
// Unless we *know* we can detect duplicates, assume their presence
|
3729 |
+
hasDuplicate = !support.detectDuplicates;
|
3730 |
+
results.sort( sortOrder );
|
3731 |
+
if ( hasDuplicate ) {
|
3732 |
+
for ( ; (elem = results[i]); i++ ) {
|
3733 |
+
if ( elem === results[ i - 1 ] ) {
|
3734 |
+
j = duplicates.push( i );
|
3735 |
+
}
|
3736 |
+
}
|
3737 |
+
while ( j-- ) {
|
3738 |
+
results.splice( duplicates[ j ], 1 );
|
3739 |
+
}
|
3740 |
+
}
|
3741 |
+
return results;
|
3742 |
+
};
|
3743 |
+
function siblingCheck( a, b ) {
|
3744 |
+
var cur = b && a,
|
3745 |
+
diff = cur && ( ~b.sourceIndex || MAX_NEGATIVE ) - ( ~a.sourceIndex || MAX_NEGATIVE );
|
3746 |
+
// Use IE sourceIndex if available on both nodes
|
3747 |
+
if ( diff ) {
|
3748 |
+
return diff;
|
3749 |
+
}
|
3750 |
+
// Check if b follows a
|
3751 |
+
if ( cur ) {
|
3752 |
+
while ( (cur = cur.nextSibling) ) {
|
3753 |
+
if ( cur === b ) {
|
3754 |
+
return -1;
|
3755 |
+
}
|
3756 |
+
}
|
3757 |
+
}
|
3758 |
+
return a ? 1 : -1;
|
3759 |
+
}
|
3760 |
+
// Returns a function to use in pseudos for input types
|
3761 |
+
function createInputPseudo( type ) {
|
3762 |
+
return function( elem ) {
|
3763 |
+
var name = elem.nodeName.toLowerCase();
|
3764 |
+
return name === "input" && elem.type === type;
|
3765 |
+
};
|
3766 |
+
}
|
3767 |
+
// Returns a function to use in pseudos for buttons
|
3768 |
+
function createButtonPseudo( type ) {
|
3769 |
+
return function( elem ) {
|
3770 |
+
var name = elem.nodeName.toLowerCase();
|
3771 |
+
return (name === "input" || name === "button") && elem.type === type;
|
3772 |
+
};
|
3773 |
+
}
|
3774 |
+
// Returns a function to use in pseudos for positionals
|
3775 |
+
function createPositionalPseudo( fn ) {
|
3776 |
+
return markFunction(function( argument ) {
|
3777 |
+
argument = +argument;
|
3778 |
+
return markFunction(function( seed, matches ) {
|
3779 |
+
var j,
|
3780 |
+
matchIndexes = fn( [], seed.length, argument ),
|
3781 |
+
i = matchIndexes.length;
|
3782 |
+
// Match elements found at the specified indexes
|
3783 |
+
while ( i-- ) {
|
3784 |
+
if ( seed[ (j = matchIndexes[i]) ] ) {
|
3785 |
+
seed[j] = !(matches[j] = seed[j]);
|
3786 |
+
}
|
3787 |
+
}
|
3788 |
+
});
|
3789 |
+
});
|
3790 |
+
}
|
3791 |
+
/**
|
3792 |
+
* Utility function for retrieving the text value of an array of DOM nodes
|
3793 |
+
* @param {Array|Element} elem
|
3794 |
+
*/
|
3795 |
+
getText = Sizzle.getText = function( elem ) {
|
3796 |
+
var node,
|
3797 |
+
ret = "",
|
3798 |
+
i = 0,
|
3799 |
+
nodeType = elem.nodeType;
|
3800 |
+
if ( !nodeType ) {
|
3801 |
+
// If no nodeType, this is expected to be an array
|
3802 |
+
for ( ; (node = elem[i]); i++ ) {
|
3803 |
+
// Do not traverse comment nodes
|
3804 |
+
ret += getText( node );
|
3805 |
+
}
|
3806 |
+
} else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
|
3807 |
+
// Use textContent for elements
|
3808 |
+
// innerText usage removed for consistency of new lines (see #11153)
|
3809 |
+
if ( typeof elem.textContent === "string" ) {
|
3810 |
+
return elem.textContent;
|
3811 |
+
} else {
|
3812 |
+
// Traverse its children
|
3813 |
+
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
3814 |
+
ret += getText( elem );
|
3815 |
+
}
|
3816 |
+
}
|
3817 |
+
} else if ( nodeType === 3 || nodeType === 4 ) {
|
3818 |
+
return elem.nodeValue;
|
3819 |
+
}
|
3820 |
+
// Do not include comment or processing instruction nodes
|
3821 |
+
return ret;
|
3822 |
+
};
|
3823 |
+
Expr = Sizzle.selectors = {
|
3824 |
+
// Can be adjusted by the user
|
3825 |
+
cacheLength: 50,
|
3826 |
+
createPseudo: markFunction,
|
3827 |
+
match: matchExpr,
|
3828 |
+
find: {},
|
3829 |
+
relative: {
|
3830 |
+
">": { dir: "parentNode", first: true },
|
3831 |
+
" ": { dir: "parentNode" },
|
3832 |
+
"+": { dir: "previousSibling", first: true },
|
3833 |
+
"~": { dir: "previousSibling" }
|
3834 |
+
},
|
3835 |
+
preFilter: {
|
3836 |
+
"ATTR": function( match ) {
|
3837 |
+
match[1] = match[1].replace( runescape, funescape );
|
3838 |
+
// Move the given value to match[3] whether quoted or unquoted
|
3839 |
+
match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape );
|
3840 |
+
if ( match[2] === "~=" ) {
|
3841 |
+
match[3] = " " + match[3] + " ";
|
3842 |
+
}
|
3843 |
+
return match.slice( 0, 4 );
|
3844 |
+
},
|
3845 |
+
"CHILD": function( match ) {
|
3846 |
+
/* matches from matchExpr["CHILD"]
|
3847 |
+
1 type (only|nth|...)
|
3848 |
+
2 what (child|of-type)
|
3849 |
+
3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
|
3850 |
+
4 xn-component of xn+y argument ([+-]?\d*n|)
|
3851 |
+
5 sign of xn-component
|
3852 |
+
6 x of xn-component
|
3853 |
+
7 sign of y-component
|
3854 |
+
8 y of y-component
|
3855 |
+
*/
|
3856 |
+
match[1] = match[1].toLowerCase();
|
3857 |
+
if ( match[1].slice( 0, 3 ) === "nth" ) {
|
3858 |
+
// nth-* requires argument
|
3859 |
+
if ( !match[3] ) {
|
3860 |
+
Sizzle.error( match[0] );
|
3861 |
+
}
|
3862 |
+
// numeric x and y parameters for Expr.filter.CHILD
|
3863 |
+
// remember that false/true cast respectively to 0/1
|
3864 |
+
match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
|
3865 |
+
match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
|
3866 |
+
// other types prohibit arguments
|
3867 |
+
} else if ( match[3] ) {
|
3868 |
+
Sizzle.error( match[0] );
|
3869 |
+
}
|
3870 |
+
return match;
|
3871 |
+
},
|
3872 |
+
"PSEUDO": function( match ) {
|
3873 |
+
var excess,
|
3874 |
+
unquoted = !match[5] && match[2];
|
3875 |
+
if ( matchExpr["CHILD"].test( match[0] ) ) {
|
3876 |
+
return null;
|
3877 |
+
}
|
3878 |
+
// Accept quoted arguments as-is
|
3879 |
+
if ( match[4] ) {
|
3880 |
+
match[2] = match[4];
|
3881 |
+
// Strip excess characters from unquoted arguments
|
3882 |
+
} else if ( unquoted && rpseudo.test( unquoted ) &&
|
3883 |
+
// Get excess from tokenize (recursively)
|
3884 |
+
(excess = tokenize( unquoted, true )) &&
|
3885 |
+
// advance to the next closing parenthesis
|
3886 |
+
(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
|
3887 |
+
// excess is a negative index
|
3888 |
+
match[0] = match[0].slice( 0, excess );
|
3889 |
+
match[2] = unquoted.slice( 0, excess );
|
3890 |
+
}
|
3891 |
+
// Return only captures needed by the pseudo filter method (type and argument)
|
3892 |
+
return match.slice( 0, 3 );
|
3893 |
+
}
|
3894 |
+
},
|
3895 |
+
filter: {
|
3896 |
+
"TAG": function( nodeName ) {
|
3897 |
+
if ( nodeName === "*" ) {
|
3898 |
+
return function() { return true; };
|
3899 |
+
}
|
3900 |
+
nodeName = nodeName.replace( runescape, funescape ).toLowerCase();
|
3901 |
+
return function( elem ) {
|
3902 |
+
return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
|
3903 |
+
};
|
3904 |
+
},
|
3905 |
+
"CLASS": function( className ) {
|
3906 |
+
var pattern = classCache[ className + " " ];
|
3907 |
+
return pattern ||
|
3908 |
+
(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
|
3909 |
+
classCache( className, function( elem ) {
|
3910 |
+
return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
|
3911 |
+
});
|
3912 |
+
},
|
3913 |
+
"ATTR": function( name, operator, check ) {
|
3914 |
+
return function( elem ) {
|
3915 |
+
var result = Sizzle.attr( elem, name );
|
3916 |
+
if ( result == null ) {
|
3917 |
+
return operator === "!=";
|
3918 |
+
}
|
3919 |
+
if ( !operator ) {
|
3920 |
+
return true;
|
3921 |
+
}
|
3922 |
+
result += "";
|
3923 |
+
return operator === "=" ? result === check :
|
3924 |
+
operator === "!=" ? result !== check :
|
3925 |
+
operator === "^=" ? check && result.indexOf( check ) === 0 :
|
3926 |
+
operator === "*=" ? check && result.indexOf( check ) > -1 :
|
3927 |
+
operator === "$=" ? check && result.slice( -check.length ) === check :
|
3928 |
+
operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
|
3929 |
+
operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
|
3930 |
+
false;
|
3931 |
+
};
|
3932 |
+
},
|
3933 |
+
"CHILD": function( type, what, argument, first, last ) {
|
3934 |
+
var simple = type.slice( 0, 3 ) !== "nth",
|
3935 |
+
forward = type.slice( -4 ) !== "last",
|
3936 |
+
ofType = what === "of-type";
|
3937 |
+
return first === 1 && last === 0 ?
|
3938 |
+
// Shortcut for :nth-*(n)
|
3939 |
+
function( elem ) {
|
3940 |
+
return !!elem.parentNode;
|
3941 |
+
} :
|
3942 |
+
function( elem, context, xml ) {
|
3943 |
+
var cache, outerCache, node, diff, nodeIndex, start,
|
3944 |
+
dir = simple !== forward ? "nextSibling" : "previousSibling",
|
3945 |
+
parent = elem.parentNode,
|
3946 |
+
name = ofType && elem.nodeName.toLowerCase(),
|
3947 |
+
useCache = !xml && !ofType;
|
3948 |
+
if ( parent ) {
|
3949 |
+
// :(first|last|only)-(child|of-type)
|
3950 |
+
if ( simple ) {
|
3951 |
+
while ( dir ) {
|
3952 |
+
node = elem;
|
3953 |
+
while ( (node = node[ dir ]) ) {
|
3954 |
+
if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
|
3955 |
+
return false;
|
3956 |
+
}
|
3957 |
+
}
|
3958 |
+
// Reverse direction for :only-* (if we haven't yet done so)
|
3959 |
+
start = dir = type === "only" && !start && "nextSibling";
|
3960 |
+
}
|
3961 |
+
return true;
|
3962 |
+
}
|
3963 |
+
start = [ forward ? parent.firstChild : parent.lastChild ];
|
3964 |
+
// non-xml :nth-child(...) stores cache data on `parent`
|
3965 |
+
if ( forward && useCache ) {
|
3966 |
+
// Seek `elem` from a previously-cached index
|
3967 |
+
outerCache = parent[ expando ] || (parent[ expando ] = {});
|
3968 |
+
cache = outerCache[ type ] || [];
|
3969 |
+
nodeIndex = cache[0] === dirruns && cache[1];
|
3970 |
+
diff = cache[0] === dirruns && cache[2];
|
3971 |
+
node = nodeIndex && parent.childNodes[ nodeIndex ];
|
3972 |
+
while ( (node = ++nodeIndex && node && node[ dir ] ||
|
3973 |
+
// Fallback to seeking `elem` from the start
|
3974 |
+
(diff = nodeIndex = 0) || start.pop()) ) {
|
3975 |
+
// When found, cache indexes on `parent` and break
|
3976 |
+
if ( node.nodeType === 1 && ++diff && node === elem ) {
|
3977 |
+
outerCache[ type ] = [ dirruns, nodeIndex, diff ];
|
3978 |
+
break;
|
3979 |
+
}
|
3980 |
+
}
|
3981 |
+
// Use previously-cached element index if available
|
3982 |
+
} else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
|
3983 |
+
diff = cache[1];
|
3984 |
+
// xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
|
3985 |
+
} else {
|
3986 |
+
// Use the same loop as above to seek `elem` from the start
|
3987 |
+
while ( (node = ++nodeIndex && node && node[ dir ] ||
|
3988 |
+
(diff = nodeIndex = 0) || start.pop()) ) {
|
3989 |
+
if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
|
3990 |
+
// Cache the index of each encountered element
|
3991 |
+
if ( useCache ) {
|
3992 |
+
(node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
|
3993 |
+
}
|
3994 |
+
if ( node === elem ) {
|
3995 |
+
break;
|
3996 |
+
}
|
3997 |
+
}
|
3998 |
+
}
|
3999 |
+
}
|
4000 |
+
// Incorporate the offset, then check against cycle size
|
4001 |
+
diff -= last;
|
4002 |
+
return diff === first || ( diff % first === 0 && diff / first >= 0 );
|
4003 |
+
}
|
4004 |
+
};
|
4005 |
+
},
|
4006 |
+
"PSEUDO": function( pseudo, argument ) {
|
4007 |
+
// pseudo-class names are case-insensitive
|
4008 |
+
// http://www.w3.org/TR/selectors/#pseudo-classes
|
4009 |
+
// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
|
4010 |
+
// Remember that setFilters inherits from pseudos
|
4011 |
+
var args,
|
4012 |
+
fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
|
4013 |
+
Sizzle.error( "unsupported pseudo: " + pseudo );
|
4014 |
+
// The user may use createPseudo to indicate that
|
4015 |
+
// arguments are needed to create the filter function
|
4016 |
+
// just as Sizzle does
|
4017 |
+
if ( fn[ expando ] ) {
|
4018 |
+
return fn( argument );
|
4019 |
+
}
|
4020 |
+
// But maintain support for old signatures
|
4021 |
+
if ( fn.length > 1 ) {
|
4022 |
+
args = [ pseudo, pseudo, "", argument ];
|
4023 |
+
return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
|
4024 |
+
markFunction(function( seed, matches ) {
|
4025 |
+
var idx,
|
4026 |
+
matched = fn( seed, argument ),
|
4027 |
+
i = matched.length;
|
4028 |
+
while ( i-- ) {
|
4029 |
+
idx = indexOf.call( seed, matched[i] );
|
4030 |
+
seed[ idx ] = !( matches[ idx ] = matched[i] );
|
4031 |
+
}
|
4032 |
+
}) :
|
4033 |
+
function( elem ) {
|
4034 |
+
return fn( elem, 0, args );
|
4035 |
+
};
|
4036 |
+
}
|
4037 |
+
return fn;
|
4038 |
+
}
|
4039 |
+
},
|
4040 |
+
pseudos: {
|
4041 |
+
// Potentially complex pseudos
|
4042 |
+
"not": markFunction(function( selector ) {
|
4043 |
+
// Trim the selector passed to compile
|
4044 |
+
// to avoid treating leading and trailing
|
4045 |
+
// spaces as combinators
|
4046 |
+
var input = [],
|
4047 |
+
results = [],
|
4048 |
+
matcher = compile( selector.replace( rtrim, "$1" ) );
|
4049 |
+
return matcher[ expando ] ?
|
4050 |
+
markFunction(function( seed, matches, context, xml ) {
|
4051 |
+
var elem,
|
4052 |
+
unmatched = matcher( seed, null, xml, [] ),
|
4053 |
+
i = seed.length;
|
4054 |
+
// Match elements unmatched by `matcher`
|
4055 |
+
while ( i-- ) {
|
4056 |
+
if ( (elem = unmatched[i]) ) {
|
4057 |
+
seed[i] = !(matches[i] = elem);
|
4058 |
+
}
|
4059 |
+
}
|
4060 |
+
}) :
|
4061 |
+
function( elem, context, xml ) {
|
4062 |
+
input[0] = elem;
|
4063 |
+
matcher( input, null, xml, results );
|
4064 |
+
return !results.pop();
|
4065 |
+
};
|
4066 |
+
}),
|
4067 |
+
"has": markFunction(function( selector ) {
|
4068 |
+
return function( elem ) {
|
4069 |
+
return Sizzle( selector, elem ).length > 0;
|
4070 |
+
};
|
4071 |
+
}),
|
4072 |
+
"contains": markFunction(function( text ) {
|
4073 |
+
return function( elem ) {
|
4074 |
+
return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
|
4075 |
+
};
|
4076 |
+
}),
|
4077 |
+
// "Whether an element is represented by a :lang() selector
|
4078 |
+
// is based solely on the element's language value
|
4079 |
+
// being equal to the identifier C,
|
4080 |
+
// or beginning with the identifier C immediately followed by "-".
|
4081 |
+
// The matching of C against the element's language value is performed case-insensitively.
|
4082 |
+
// The identifier C does not have to be a valid language name."
|
4083 |
+
// http://www.w3.org/TR/selectors/#lang-pseudo
|
4084 |
+
"lang": markFunction( function( lang ) {
|
4085 |
+
// lang value must be a valid identifider
|
4086 |
+
if ( !ridentifier.test(lang || "") ) {
|
4087 |
+
Sizzle.error( "unsupported lang: " + lang );
|
4088 |
+
}
|
4089 |
+
lang = lang.replace( runescape, funescape ).toLowerCase();
|
4090 |
+
return function( elem ) {
|
4091 |
+
var elemLang;
|
4092 |
+
do {
|
4093 |
+
if ( (elemLang = documentIsXML ?
|
4094 |
+
elem.getAttribute("xml:lang") || elem.getAttribute("lang") :
|
4095 |
+
elem.lang) ) {
|
4096 |
+
elemLang = elemLang.toLowerCase();
|
4097 |
+
return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
|
4098 |
+
}
|
4099 |
+
} while ( (elem = elem.parentNode) && elem.nodeType === 1 );
|
4100 |
+
return false;
|
4101 |
+
};
|
4102 |
+
}),
|
4103 |
+
// Miscellaneous
|
4104 |
+
"target": function( elem ) {
|
4105 |
+
var hash = window.location && window.location.hash;
|
4106 |
+
return hash && hash.slice( 1 ) === elem.id;
|
4107 |
+
},
|
4108 |
+
"root": function( elem ) {
|
4109 |
+
return elem === docElem;
|
4110 |
+
},
|
4111 |
+
"focus": function( elem ) {
|
4112 |
+
return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
|
4113 |
+
},
|
4114 |
+
// Boolean properties
|
4115 |
+
"enabled": function( elem ) {
|
4116 |
+
return elem.disabled === false;
|
4117 |
+
},
|
4118 |
+
"disabled": function( elem ) {
|
4119 |
+
return elem.disabled === true;
|
4120 |
+
},
|
4121 |
+
"checked": function( elem ) {
|
4122 |
+
// In CSS3, :checked should return both checked and selected elements
|
4123 |
+
// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
|
4124 |
+
var nodeName = elem.nodeName.toLowerCase();
|
4125 |
+
return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
|
4126 |
+
},
|
4127 |
+
"selected": function( elem ) {
|
4128 |
+
// Accessing this property makes selected-by-default
|
4129 |
+
// options in Safari work properly
|
4130 |
+
if ( elem.parentNode ) {
|
4131 |
+
elem.parentNode.selectedIndex;
|
4132 |
+
}
|
4133 |
+
return elem.selected === true;
|
4134 |
+
},
|
4135 |
+
// Contents
|
4136 |
+
"empty": function( elem ) {
|
4137 |
+
// http://www.w3.org/TR/selectors/#empty-pseudo
|
4138 |
+
// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
|
4139 |
+
// not comment, processing instructions, or others
|
4140 |
+
// Thanks to Diego Perini for the nodeName shortcut
|
4141 |
+
// Greater than "@" means alpha characters (specifically not starting with "#" or "?")
|
4142 |
+
for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
|
4143 |
+
if ( elem.nodeName > "@" || elem.nodeType === 3 || elem.nodeType === 4 ) {
|
4144 |
+
return false;
|
4145 |
+
}
|
4146 |
+
}
|
4147 |
+
return true;
|
4148 |
+
},
|
4149 |
+
"parent": function( elem ) {
|
4150 |
+
return !Expr.pseudos["empty"]( elem );
|
4151 |
+
},
|
4152 |
+
// Element/input types
|
4153 |
+
"header": function( elem ) {
|
4154 |
+
return rheader.test( elem.nodeName );
|
4155 |
+
},
|
4156 |
+
"input": function( elem ) {
|
4157 |
+
return rinputs.test( elem.nodeName );
|
4158 |
+
},
|
4159 |
+
"button": function( elem ) {
|
4160 |
+
var name = elem.nodeName.toLowerCase();
|
4161 |
+
return name === "input" && elem.type === "button" || name === "button";
|
4162 |
+
},
|
4163 |
+
"text": function( elem ) {
|
4164 |
+
var attr;
|
4165 |
+
// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
|
4166 |
+
// use getAttribute instead to test this case
|
4167 |
+
return elem.nodeName.toLowerCase() === "input" &&
|
4168 |
+
elem.type === "text" &&
|
4169 |
+
( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === elem.type );
|
4170 |
+
},
|
4171 |
+
// Position-in-collection
|
4172 |
+
"first": createPositionalPseudo(function() {
|
4173 |
+
return [ 0 ];
|
4174 |
+
}),
|
4175 |
+
"last": createPositionalPseudo(function( matchIndexes, length ) {
|
4176 |
+
return [ length - 1 ];
|
4177 |
+
}),
|
4178 |
+
"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
4179 |
+
return [ argument < 0 ? argument + length : argument ];
|
4180 |
+
}),
|
4181 |
+
"even": createPositionalPseudo(function( matchIndexes, length ) {
|
4182 |
+
var i = 0;
|
4183 |
+
for ( ; i < length; i += 2 ) {
|
4184 |
+
matchIndexes.push( i );
|
4185 |
+
}
|
4186 |
+
return matchIndexes;
|
4187 |
+
}),
|
4188 |
+
"odd": createPositionalPseudo(function( matchIndexes, length ) {
|
4189 |
+
var i = 1;
|
4190 |
+
for ( ; i < length; i += 2 ) {
|
4191 |
+
matchIndexes.push( i );
|
4192 |
+
}
|
4193 |
+
return matchIndexes;
|
4194 |
+
}),
|
4195 |
+
"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
4196 |
+
var i = argument < 0 ? argument + length : argument;
|
4197 |
+
for ( ; --i >= 0; ) {
|
4198 |
+
matchIndexes.push( i );
|
4199 |
+
}
|
4200 |
+
return matchIndexes;
|
4201 |
+
}),
|
4202 |
+
"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
|
4203 |
+
var i = argument < 0 ? argument + length : argument;
|
4204 |
+
for ( ; ++i < length; ) {
|
4205 |
+
matchIndexes.push( i );
|
4206 |
+
}
|
4207 |
+
return matchIndexes;
|
4208 |
+
})
|
4209 |
+
}
|
4210 |
+
};
|
4211 |
+
// Add button/input type pseudos
|
4212 |
+
for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
|
4213 |
+
Expr.pseudos[ i ] = createInputPseudo( i );
|
4214 |
+
}
|
4215 |
+
for ( i in { submit: true, reset: true } ) {
|
4216 |
+
Expr.pseudos[ i ] = createButtonPseudo( i );
|
4217 |
+
}
|
4218 |
+
function tokenize( selector, parseOnly ) {
|
4219 |
+
var matched, match, tokens, type,
|
4220 |
+
soFar, groups, preFilters,
|
4221 |
+
cached = tokenCache[ selector + " " ];
|
4222 |
+
if ( cached ) {
|
4223 |
+
return parseOnly ? 0 : cached.slice( 0 );
|
4224 |
+
}
|
4225 |
+
soFar = selector;
|
4226 |
+
groups = [];
|
4227 |
+
preFilters = Expr.preFilter;
|
4228 |
+
while ( soFar ) {
|
4229 |
+
// Comma and first run
|
4230 |
+
if ( !matched || (match = rcomma.exec( soFar )) ) {
|
4231 |
+
if ( match ) {
|
4232 |
+
// Don't consume trailing commas as valid
|
4233 |
+
soFar = soFar.slice( match[0].length ) || soFar;
|
4234 |
+
}
|
4235 |
+
groups.push( tokens = [] );
|
4236 |
+
}
|
4237 |
+
matched = false;
|
4238 |
+
// Combinators
|
4239 |
+
if ( (match = rcombinators.exec( soFar )) ) {
|
4240 |
+
matched = match.shift();
|
4241 |
+
tokens.push( {
|
4242 |
+
value: matched,
|
4243 |
+
// Cast descendant combinators to space
|
4244 |
+
type: match[0].replace( rtrim, " " )
|
4245 |
+
} );
|
4246 |
+
soFar = soFar.slice( matched.length );
|
4247 |
+
}
|
4248 |
+
// Filters
|
4249 |
+
for ( type in Expr.filter ) {
|
4250 |
+
if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
|
4251 |
+
(match = preFilters[ type ]( match ))) ) {
|
4252 |
+
matched = match.shift();
|
4253 |
+
tokens.push( {
|
4254 |
+
value: matched,
|
4255 |
+
type: type,
|
4256 |
+
matches: match
|
4257 |
+
} );
|
4258 |
+
soFar = soFar.slice( matched.length );
|
4259 |
+
}
|
4260 |
+
}
|
4261 |
+
if ( !matched ) {
|
4262 |
+
break;
|
4263 |
+
}
|
4264 |
+
}
|
4265 |
+
// Return the length of the invalid excess
|
4266 |
+
// if we're just parsing
|
4267 |
+
// Otherwise, throw an error or return tokens
|
4268 |
+
return parseOnly ?
|
4269 |
+
soFar.length :
|
4270 |
+
soFar ?
|
4271 |
+
Sizzle.error( selector ) :
|
4272 |
+
// Cache the tokens
|
4273 |
+
tokenCache( selector, groups ).slice( 0 );
|
4274 |
+
}
|
4275 |
+
function toSelector( tokens ) {
|
4276 |
+
var i = 0,
|
4277 |
+
len = tokens.length,
|
4278 |
+
selector = "";
|
4279 |
+
for ( ; i < len; i++ ) {
|
4280 |
+
selector += tokens[i].value;
|
4281 |
+
}
|
4282 |
+
return selector;
|
4283 |
+
}
|
4284 |
+
function addCombinator( matcher, combinator, base ) {
|
4285 |
+
var dir = combinator.dir,
|
4286 |
+
checkNonElements = base && dir === "parentNode",
|
4287 |
+
doneName = done++;
|
4288 |
+
return combinator.first ?
|
4289 |
+
// Check against closest ancestor/preceding element
|
4290 |
+
function( elem, context, xml ) {
|
4291 |
+
while ( (elem = elem[ dir ]) ) {
|
4292 |
+
if ( elem.nodeType === 1 || checkNonElements ) {
|
4293 |
+
return matcher( elem, context, xml );
|
4294 |
+
}
|
4295 |
+
}
|
4296 |
+
} :
|
4297 |
+
// Check against all ancestor/preceding elements
|
4298 |
+
function( elem, context, xml ) {
|
4299 |
+
var data, cache, outerCache,
|
4300 |
+
dirkey = dirruns + " " + doneName;
|
4301 |
+
// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
|
4302 |
+
if ( xml ) {
|
4303 |
+
while ( (elem = elem[ dir ]) ) {
|
4304 |
+
if ( elem.nodeType === 1 || checkNonElements ) {
|
4305 |
+
if ( matcher( elem, context, xml ) ) {
|
4306 |
+
return true;
|
4307 |
+
}
|
4308 |
+
}
|
4309 |
+
}
|
4310 |
+
} else {
|
4311 |
+
while ( (elem = elem[ dir ]) ) {
|
4312 |
+
if ( elem.nodeType === 1 || checkNonElements ) {
|
4313 |
+
outerCache = elem[ expando ] || (elem[ expando ] = {});
|
4314 |
+
if ( (cache = outerCache[ dir ]) && cache[0] === dirkey ) {
|
4315 |
+
if ( (data = cache[1]) === true || data === cachedruns ) {
|
4316 |
+
return data === true;
|
4317 |
+
}
|
4318 |
+
} else {
|
4319 |
+
cache = outerCache[ dir ] = [ dirkey ];
|
4320 |
+
cache[1] = matcher( elem, context, xml ) || cachedruns;
|
4321 |
+
if ( cache[1] === true ) {
|
4322 |
+
return true;
|
4323 |
+
}
|
4324 |
+
}
|
4325 |
+
}
|
4326 |
+
}
|
4327 |
+
}
|
4328 |
+
};
|
4329 |
+
}
|
4330 |
+
function elementMatcher( matchers ) {
|
4331 |
+
return matchers.length > 1 ?
|
4332 |
+
function( elem, context, xml ) {
|
4333 |
+
var i = matchers.length;
|
4334 |
+
while ( i-- ) {
|
4335 |
+
if ( !matchers[i]( elem, context, xml ) ) {
|
4336 |
+
return false;
|
4337 |
+
}
|
4338 |
+
}
|
4339 |
+
return true;
|
4340 |
+
} :
|
4341 |
+
matchers[0];
|
4342 |
+
}
|
4343 |
+
function condense( unmatched, map, filter, context, xml ) {
|
4344 |
+
var elem,
|
4345 |
+
newUnmatched = [],
|
4346 |
+
i = 0,
|
4347 |
+
len = unmatched.length,
|
4348 |
+
mapped = map != null;
|
4349 |
+
for ( ; i < len; i++ ) {
|
4350 |
+
if ( (elem = unmatched[i]) ) {
|
4351 |
+
if ( !filter || filter( elem, context, xml ) ) {
|
4352 |
+
newUnmatched.push( elem );
|
4353 |
+
if ( mapped ) {
|
4354 |
+
map.push( i );
|
4355 |
+
}
|
4356 |
+
}
|
4357 |
+
}
|
4358 |
+
}
|
4359 |
+
return newUnmatched;
|
4360 |
+
}
|
4361 |
+
function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
|
4362 |
+
if ( postFilter && !postFilter[ expando ] ) {
|
4363 |
+
postFilter = setMatcher( postFilter );
|
4364 |
+
}
|
4365 |
+
if ( postFinder && !postFinder[ expando ] ) {
|
4366 |
+
postFinder = setMatcher( postFinder, postSelector );
|
4367 |
+
}
|
4368 |
+
return markFunction(function( seed, results, context, xml ) {
|
4369 |
+
var temp, i, elem,
|
4370 |
+
preMap = [],
|
4371 |
+
postMap = [],
|
4372 |
+
preexisting = results.length,
|
4373 |
+
// Get initial elements from seed or context
|
4374 |
+
elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
|
4375 |
+
// Prefilter to get matcher input, preserving a map for seed-results synchronization
|
4376 |
+
matcherIn = preFilter && ( seed || !selector ) ?
|
4377 |
+
condense( elems, preMap, preFilter, context, xml ) :
|
4378 |
+
elems,
|
4379 |
+
matcherOut = matcher ?
|
4380 |
+
// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
|
4381 |
+
postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
|
4382 |
+
// ...intermediate processing is necessary
|
4383 |
+
[] :
|
4384 |
+
// ...otherwise use results directly
|
4385 |
+
results :
|
4386 |
+
matcherIn;
|
4387 |
+
// Find primary matches
|
4388 |
+
if ( matcher ) {
|
4389 |
+
matcher( matcherIn, matcherOut, context, xml );
|
4390 |
+
}
|
4391 |
+
// Apply postFilter
|
4392 |
+
if ( postFilter ) {
|
4393 |
+
temp = condense( matcherOut, postMap );
|
4394 |
+
postFilter( temp, [], context, xml );
|
4395 |
+
// Un-match failing elements by moving them back to matcherIn
|
4396 |
+
i = temp.length;
|
4397 |
+
while ( i-- ) {
|
4398 |
+
if ( (elem = temp[i]) ) {
|
4399 |
+
matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
|
4400 |
+
}
|
4401 |
+
}
|
4402 |
+
}
|
4403 |
+
if ( seed ) {
|
4404 |
+
if ( postFinder || preFilter ) {
|
4405 |
+
if ( postFinder ) {
|
4406 |
+
// Get the final matcherOut by condensing this intermediate into postFinder contexts
|
4407 |
+
temp = [];
|
4408 |
+
i = matcherOut.length;
|
4409 |
+
while ( i-- ) {
|
4410 |
+
if ( (elem = matcherOut[i]) ) {
|
4411 |
+
// Restore matcherIn since elem is not yet a final match
|
4412 |
+
temp.push( (matcherIn[i] = elem) );
|
4413 |
+
}
|
4414 |
+
}
|
4415 |
+
postFinder( null, (matcherOut = []), temp, xml );
|
4416 |
+
}
|
4417 |
+
// Move matched elements from seed to results to keep them synchronized
|
4418 |
+
i = matcherOut.length;
|
4419 |
+
while ( i-- ) {
|
4420 |
+
if ( (elem = matcherOut[i]) &&
|
4421 |
+
(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
|
4422 |
+
seed[temp] = !(results[temp] = elem);
|
4423 |
+
}
|
4424 |
+
}
|
4425 |
+
}
|
4426 |
+
// Add elements to results, through postFinder if defined
|
4427 |
+
} else {
|
4428 |
+
matcherOut = condense(
|
4429 |
+
matcherOut === results ?
|
4430 |
+
matcherOut.splice( preexisting, matcherOut.length ) :
|
4431 |
+
matcherOut
|
4432 |
+
);
|
4433 |
+
if ( postFinder ) {
|
4434 |
+
postFinder( null, results, matcherOut, xml );
|
4435 |
+
} else {
|
4436 |
+
push.apply( results, matcherOut );
|
4437 |
+
}
|
4438 |
+
}
|
4439 |
+
});
|
4440 |
+
}
|
4441 |
+
function matcherFromTokens( tokens ) {
|
4442 |
+
var checkContext, matcher, j,
|
4443 |
+
len = tokens.length,
|
4444 |
+
leadingRelative = Expr.relative[ tokens[0].type ],
|
4445 |
+
implicitRelative = leadingRelative || Expr.relative[" "],
|
4446 |
+
i = leadingRelative ? 1 : 0,
|
4447 |
+
// The foundational matcher ensures that elements are reachable from top-level context(s)
|
4448 |
+
matchContext = addCombinator( function( elem ) {
|
4449 |
+
return elem === checkContext;
|
4450 |
+
}, implicitRelative, true ),
|
4451 |
+
matchAnyContext = addCombinator( function( elem ) {
|
4452 |
+
return indexOf.call( checkContext, elem ) > -1;
|
4453 |
+
}, implicitRelative, true ),
|
4454 |
+
matchers = [ function( elem, context, xml ) {
|
4455 |
+
return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
|
4456 |
+
(checkContext = context).nodeType ?
|
4457 |
+
matchContext( elem, context, xml ) :
|
4458 |
+
matchAnyContext( elem, context, xml ) );
|
4459 |
+
} ];
|
4460 |
+
for ( ; i < len; i++ ) {
|
4461 |
+
if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
|
4462 |
+
matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
|
4463 |
+
} else {
|
4464 |
+
matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
|
4465 |
+
// Return special upon seeing a positional matcher
|
4466 |
+
if ( matcher[ expando ] ) {
|
4467 |
+
// Find the next relative operator (if any) for proper handling
|
4468 |
+
j = ++i;
|
4469 |
+
for ( ; j < len; j++ ) {
|
4470 |
+
if ( Expr.relative[ tokens[j].type ] ) {
|
4471 |
+
break;
|
4472 |
+
}
|
4473 |
+
}
|
4474 |
+
return setMatcher(
|
4475 |
+
i > 1 && elementMatcher( matchers ),
|
4476 |
+
i > 1 && toSelector( tokens.slice( 0, i - 1 ) ).replace( rtrim, "$1" ),
|
4477 |
+
matcher,
|
4478 |
+
i < j && matcherFromTokens( tokens.slice( i, j ) ),
|
4479 |
+
j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
|
4480 |
+
j < len && toSelector( tokens )
|
4481 |
+
);
|
4482 |
+
}
|
4483 |
+
matchers.push( matcher );
|
4484 |
+
}
|
4485 |
+
}
|
4486 |
+
return elementMatcher( matchers );
|
4487 |
+
}
|
4488 |
+
function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
|
4489 |
+
// A counter to specify which element is currently being matched
|
4490 |
+
var matcherCachedRuns = 0,
|
4491 |
+
bySet = setMatchers.length > 0,
|
4492 |
+
byElement = elementMatchers.length > 0,
|
4493 |
+
superMatcher = function( seed, context, xml, results, expandContext ) {
|
4494 |
+
var elem, j, matcher,
|
4495 |
+
setMatched = [],
|
4496 |
+
matchedCount = 0,
|
4497 |
+
i = "0",
|
4498 |
+
unmatched = seed && [],
|
4499 |
+
outermost = expandContext != null,
|
4500 |
+
contextBackup = outermostContext,
|
4501 |
+
// We must always have either seed elements or context
|
4502 |
+
elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
|
4503 |
+
// Use integer dirruns iff this is the outermost matcher
|
4504 |
+
dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1);
|
4505 |
+
if ( outermost ) {
|
4506 |
+
outermostContext = context !== document && context;
|
4507 |
+
cachedruns = matcherCachedRuns;
|
4508 |
+
}
|
4509 |
+
// Add elements passing elementMatchers directly to results
|
4510 |
+
// Keep `i` a string if there are no elements so `matchedCount` will be "00" below
|
4511 |
+
for ( ; (elem = elems[i]) != null; i++ ) {
|
4512 |
+
if ( byElement && elem ) {
|
4513 |
+
j = 0;
|
4514 |
+
while ( (matcher = elementMatchers[j++]) ) {
|
4515 |
+
if ( matcher( elem, context, xml ) ) {
|
4516 |
+
results.push( elem );
|
4517 |
+
break;
|
4518 |
+
}
|
4519 |
+
}
|
4520 |
+
if ( outermost ) {
|
4521 |
+
dirruns = dirrunsUnique;
|
4522 |
+
cachedruns = ++matcherCachedRuns;
|
4523 |
+
}
|
4524 |
+
}
|
4525 |
+
// Track unmatched elements for set filters
|
4526 |
+
if ( bySet ) {
|
4527 |
+
// They will have gone through all possible matchers
|
4528 |
+
if ( (elem = !matcher && elem) ) {
|
4529 |
+
matchedCount--;
|
4530 |
+
}
|
4531 |
+
// Lengthen the array for every element, matched or not
|
4532 |
+
if ( seed ) {
|
4533 |
+
unmatched.push( elem );
|
4534 |
+
}
|
4535 |
+
}
|
4536 |
+
}
|
4537 |
+
// Apply set filters to unmatched elements
|
4538 |
+
matchedCount += i;
|
4539 |
+
if ( bySet && i !== matchedCount ) {
|
4540 |
+
j = 0;
|
4541 |
+
while ( (matcher = setMatchers[j++]) ) {
|
4542 |
+
matcher( unmatched, setMatched, context, xml );
|
4543 |
+
}
|
4544 |
+
if ( seed ) {
|
4545 |
+
// Reintegrate element matches to eliminate the need for sorting
|
4546 |
+
if ( matchedCount > 0 ) {
|
4547 |
+
while ( i-- ) {
|
4548 |
+
if ( !(unmatched[i] || setMatched[i]) ) {
|
4549 |
+
setMatched[i] = pop.call( results );
|
4550 |
+
}
|
4551 |
+
}
|
4552 |
+
}
|
4553 |
+
// Discard index placeholder values to get only actual matches
|
4554 |
+
setMatched = condense( setMatched );
|
4555 |
+
}
|
4556 |
+
// Add matches to results
|
4557 |
+
push.apply( results, setMatched );
|
4558 |
+
// Seedless set matches succeeding multiple successful matchers stipulate sorting
|
4559 |
+
if ( outermost && !seed && setMatched.length > 0 &&
|
4560 |
+
( matchedCount + setMatchers.length ) > 1 ) {
|
4561 |
+
Sizzle.uniqueSort( results );
|
4562 |
+
}
|
4563 |
+
}
|
4564 |
+
// Override manipulation of globals by nested matchers
|
4565 |
+
if ( outermost ) {
|
4566 |
+
dirruns = dirrunsUnique;
|
4567 |
+
outermostContext = contextBackup;
|
4568 |
+
}
|
4569 |
+
return unmatched;
|
4570 |
+
};
|
4571 |
+
return bySet ?
|
4572 |
+
markFunction( superMatcher ) :
|
4573 |
+
superMatcher;
|
4574 |
+
}
|
4575 |
+
compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
|
4576 |
+
var i,
|
4577 |
+
setMatchers = [],
|
4578 |
+
elementMatchers = [],
|
4579 |
+
cached = compilerCache[ selector + " " ];
|
4580 |
+
if ( !cached ) {
|
4581 |
+
// Generate a function of recursive functions that can be used to check each element
|
4582 |
+
if ( !group ) {
|
4583 |
+
group = tokenize( selector );
|
4584 |
+
}
|
4585 |
+
i = group.length;
|
4586 |
+
while ( i-- ) {
|
4587 |
+
cached = matcherFromTokens( group[i] );
|
4588 |
+
if ( cached[ expando ] ) {
|
4589 |
+
setMatchers.push( cached );
|
4590 |
+
} else {
|
4591 |
+
elementMatchers.push( cached );
|
4592 |
+
}
|
4593 |
+
}
|
4594 |
+
// Cache the compiled function
|
4595 |
+
cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
|
4596 |
+
}
|
4597 |
+
return cached;
|
4598 |
+
};
|
4599 |
+
function multipleContexts( selector, contexts, results ) {
|
4600 |
+
var i = 0,
|
4601 |
+
len = contexts.length;
|
4602 |
+
for ( ; i < len; i++ ) {
|
4603 |
+
Sizzle( selector, contexts[i], results );
|
4604 |
+
}
|
4605 |
+
return results;
|
4606 |
+
}
|
4607 |
+
function select( selector, context, results, seed ) {
|
4608 |
+
var i, tokens, token, type, find,
|
4609 |
+
match = tokenize( selector );
|
4610 |
+
if ( !seed ) {
|
4611 |
+
// Try to minimize operations if there is only one group
|
4612 |
+
if ( match.length === 1 ) {
|
4613 |
+
// Take a shortcut and set the context if the root selector is an ID
|
4614 |
+
tokens = match[0] = match[0].slice( 0 );
|
4615 |
+
if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
|
4616 |
+
context.nodeType === 9 && !documentIsXML &&
|
4617 |
+
Expr.relative[ tokens[1].type ] ) {
|
4618 |
+
context = Expr.find["ID"]( token.matches[0].replace( runescape, funescape ), context )[0];
|
4619 |
+
if ( !context ) {
|
4620 |
+
return results;
|
4621 |
+
}
|
4622 |
+
selector = selector.slice( tokens.shift().value.length );
|
4623 |
+
}
|
4624 |
+
// Fetch a seed set for right-to-left matching
|
4625 |
+
i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
|
4626 |
+
while ( i-- ) {
|
4627 |
+
token = tokens[i];
|
4628 |
+
// Abort if we hit a combinator
|
4629 |
+
if ( Expr.relative[ (type = token.type) ] ) {
|
4630 |
+
break;
|
4631 |
+
}
|
4632 |
+
if ( (find = Expr.find[ type ]) ) {
|
4633 |
+
// Search, expanding context for leading sibling combinators
|
4634 |
+
if ( (seed = find(
|
4635 |
+
token.matches[0].replace( runescape, funescape ),
|
4636 |
+
rsibling.test( tokens[0].type ) && context.parentNode || context
|
4637 |
+
)) ) {
|
4638 |
+
// If seed is empty or no tokens remain, we can return early
|
4639 |
+
tokens.splice( i, 1 );
|
4640 |
+
selector = seed.length && toSelector( tokens );
|
4641 |
+
if ( !selector ) {
|
4642 |
+
push.apply( results, slice.call( seed, 0 ) );
|
4643 |
+
return results;
|
4644 |
+
}
|
4645 |
+
break;
|
4646 |
+
}
|
4647 |
+
}
|
4648 |
+
}
|
4649 |
+
}
|
4650 |
+
}
|
4651 |
+
// Compile and execute a filtering function
|
4652 |
+
// Provide `match` to avoid retokenization if we modified the selector above
|
4653 |
+
compile( selector, match )(
|
4654 |
+
seed,
|
4655 |
+
context,
|
4656 |
+
documentIsXML,
|
4657 |
+
results,
|
4658 |
+
rsibling.test( selector )
|
4659 |
+
);
|
4660 |
+
return results;
|
4661 |
+
}
|
4662 |
+
// Deprecated
|
4663 |
+
Expr.pseudos["nth"] = Expr.pseudos["eq"];
|
4664 |
+
// Easy API for creating new setFilters
|
4665 |
+
function setFilters() {}
|
4666 |
+
Expr.filters = setFilters.prototype = Expr.pseudos;
|
4667 |
+
Expr.setFilters = new setFilters();
|
4668 |
+
// Initialize with the default document
|
4669 |
+
setDocument();
|
4670 |
+
// Override sizzle attribute retrieval
|
4671 |
+
Sizzle.attr = jQuery.attr;
|
4672 |
+
jQuery.find = Sizzle;
|
4673 |
+
jQuery.expr = Sizzle.selectors;
|
4674 |
+
jQuery.expr[":"] = jQuery.expr.pseudos;
|
4675 |
+
jQuery.unique = Sizzle.uniqueSort;
|
4676 |
+
jQuery.text = Sizzle.getText;
|
4677 |
+
jQuery.isXMLDoc = Sizzle.isXML;
|
4678 |
+
jQuery.contains = Sizzle.contains;
|
4679 |
+
})( window );
|
4680 |
+
var runtil = /Until$/,
|
4681 |
+
rparentsprev = /^(?:parents|prev(?:Until|All))/,
|
4682 |
+
isSimple = /^.[^:#\[\.,]*$/,
|
4683 |
+
rneedsContext = jQuery.expr.match.needsContext,
|
4684 |
+
// methods guaranteed to produce a unique set when starting from a unique set
|
4685 |
+
guaranteedUnique = {
|
4686 |
+
children: true,
|
4687 |
+
contents: true,
|
4688 |
+
next: true,
|
4689 |
+
prev: true
|
4690 |
+
};
|
4691 |
+
jQuery.fn.extend({
|
4692 |
+
find: function( selector ) {
|
4693 |
+
var i, ret, self,
|
4694 |
+
len = this.length;
|
4695 |
+
if ( typeof selector !== "string" ) {
|
4696 |
+
self = this;
|
4697 |
+
return this.pushStack( jQuery( selector ).filter(function() {
|
4698 |
+
for ( i = 0; i < len; i++ ) {
|
4699 |
+
if ( jQuery.contains( self[ i ], this ) ) {
|
4700 |
+
return true;
|
4701 |
+
}
|
4702 |
+
}
|
4703 |
+
}) );
|
4704 |
+
}
|
4705 |
+
ret = [];
|
4706 |
+
for ( i = 0; i < len; i++ ) {
|
4707 |
+
jQuery.find( selector, this[ i ], ret );
|
4708 |
+
}
|
4709 |
+
// Needed because $( selector, context ) becomes $( context ).find( selector )
|
4710 |
+
ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
|
4711 |
+
ret.selector = ( this.selector ? this.selector + " " : "" ) + selector;
|
4712 |
+
return ret;
|
4713 |
+
},
|
4714 |
+
has: function( target ) {
|
4715 |
+
var i,
|
4716 |
+
targets = jQuery( target, this ),
|
4717 |
+
len = targets.length;
|
4718 |
+
return this.filter(function() {
|
4719 |
+
for ( i = 0; i < len; i++ ) {
|
4720 |
+
if ( jQuery.contains( this, targets[i] ) ) {
|
4721 |
+
return true;
|
4722 |
+
}
|
4723 |
+
}
|
4724 |
+
});
|
4725 |
+
},
|
4726 |
+
not: function( selector ) {
|
4727 |
+
return this.pushStack( winnow(this, selector, false) );
|
4728 |
+
},
|
4729 |
+
filter: function( selector ) {
|
4730 |
+
return this.pushStack( winnow(this, selector, true) );
|
4731 |
+
},
|
4732 |
+
is: function( selector ) {
|
4733 |
+
return !!selector && (
|
4734 |
+
typeof selector === "string" ?
|
4735 |
+
// If this is a positional/relative selector, check membership in the returned set
|
4736 |
+
// so $("p:first").is("p:last") won't return true for a doc with two "p".
|
4737 |
+
rneedsContext.test( selector ) ?
|
4738 |
+
jQuery( selector, this.context ).index( this[0] ) >= 0 :
|
4739 |
+
jQuery.filter( selector, this ).length > 0 :
|
4740 |
+
this.filter( selector ).length > 0 );
|
4741 |
+
},
|
4742 |
+
closest: function( selectors, context ) {
|
4743 |
+
var cur,
|
4744 |
+
i = 0,
|
4745 |
+
l = this.length,
|
4746 |
+
ret = [],
|
4747 |
+
pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
|
4748 |
+
jQuery( selectors, context || this.context ) :
|
4749 |
+
0;
|
4750 |
+
for ( ; i < l; i++ ) {
|
4751 |
+
cur = this[i];
|
4752 |
+
while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
|
4753 |
+
if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
|
4754 |
+
ret.push( cur );
|
4755 |
+
break;
|
4756 |
+
}
|
4757 |
+
cur = cur.parentNode;
|
4758 |
+
}
|
4759 |
+
}
|
4760 |
+
return this.pushStack( ret.length > 1 ? jQuery.unique( ret ) : ret );
|
4761 |
+
},
|
4762 |
+
// Determine the position of an element within
|
4763 |
+
// the matched set of elements
|
4764 |
+
index: function( elem ) {
|
4765 |
+
// No argument, return index in parent
|
4766 |
+
if ( !elem ) {
|
4767 |
+
return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
|
4768 |
+
}
|
4769 |
+
// index in selector
|
4770 |
+
if ( typeof elem === "string" ) {
|
4771 |
+
return jQuery.inArray( this[0], jQuery( elem ) );
|
4772 |
+
}
|
4773 |
+
// Locate the position of the desired element
|
4774 |
+
return jQuery.inArray(
|
4775 |
+
// If it receives a jQuery object, the first element is used
|
4776 |
+
elem.jquery ? elem[0] : elem, this );
|
4777 |
+
},
|
4778 |
+
add: function( selector, context ) {
|
4779 |
+
var set = typeof selector === "string" ?
|
4780 |
+
jQuery( selector, context ) :
|
4781 |
+
jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
|
4782 |
+
all = jQuery.merge( this.get(), set );
|
4783 |
+
return this.pushStack( jQuery.unique(all) );
|
4784 |
+
},
|
4785 |
+
addBack: function( selector ) {
|
4786 |
+
return this.add( selector == null ?
|
4787 |
+
this.prevObject : this.prevObject.filter(selector)
|
4788 |
+
);
|
4789 |
+
}
|
4790 |
+
});
|
4791 |
+
jQuery.fn.andSelf = jQuery.fn.addBack;
|
4792 |
+
function sibling( cur, dir ) {
|
4793 |
+
do {
|
4794 |
+
cur = cur[ dir ];
|
4795 |
+
} while ( cur && cur.nodeType !== 1 );
|
4796 |
+
return cur;
|
4797 |
+
}
|
4798 |
+
jQuery.each({
|
4799 |
+
parent: function( elem ) {
|
4800 |
+
var parent = elem.parentNode;
|
4801 |
+
return parent && parent.nodeType !== 11 ? parent : null;
|
4802 |
+
},
|
4803 |
+
parents: function( elem ) {
|
4804 |
+
return jQuery.dir( elem, "parentNode" );
|
4805 |
+
},
|
4806 |
+
parentsUntil: function( elem, i, until ) {
|
4807 |
+
return jQuery.dir( elem, "parentNode", until );
|
4808 |
+
},
|
4809 |
+
next: function( elem ) {
|
4810 |
+
return sibling( elem, "nextSibling" );
|
4811 |
+
},
|
4812 |
+
prev: function( elem ) {
|
4813 |
+
return sibling( elem, "previousSibling" );
|
4814 |
+
},
|
4815 |
+
nextAll: function( elem ) {
|
4816 |
+
return jQuery.dir( elem, "nextSibling" );
|
4817 |
+
},
|
4818 |
+
prevAll: function( elem ) {
|
4819 |
+
return jQuery.dir( elem, "previousSibling" );
|
4820 |
+
},
|
4821 |
+
nextUntil: function( elem, i, until ) {
|
4822 |
+
return jQuery.dir( elem, "nextSibling", until );
|
4823 |
+
},
|
4824 |
+
prevUntil: function( elem, i, until ) {
|
4825 |
+
return jQuery.dir( elem, "previousSibling", until );
|
4826 |
+
},
|
4827 |
+
siblings: function( elem ) {
|
4828 |
+
return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
|
4829 |
+
},
|
4830 |
+
children: function( elem ) {
|
4831 |
+
return jQuery.sibling( elem.firstChild );
|
4832 |
+
},
|
4833 |
+
contents: function( elem ) {
|
4834 |
+
return jQuery.nodeName( elem, "iframe" ) ?
|
4835 |
+
elem.contentDocument || elem.contentWindow.document :
|
4836 |
+
jQuery.merge( [], elem.childNodes );
|
4837 |
+
}
|
4838 |
+
}, function( name, fn ) {
|
4839 |
+
jQuery.fn[ name ] = function( until, selector ) {
|
4840 |
+
var ret = jQuery.map( this, fn, until );
|
4841 |
+
if ( !runtil.test( name ) ) {
|
4842 |
+
selector = until;
|
4843 |
+
}
|
4844 |
+
if ( selector && typeof selector === "string" ) {
|
4845 |
+
ret = jQuery.filter( selector, ret );
|
4846 |
+
}
|
4847 |
+
ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
|
4848 |
+
if ( this.length > 1 && rparentsprev.test( name ) ) {
|
4849 |
+
ret = ret.reverse();
|
4850 |
+
}
|
4851 |
+
return this.pushStack( ret );
|
4852 |
+
};
|
4853 |
+
});
|
4854 |
+
jQuery.extend({
|
4855 |
+
filter: function( expr, elems, not ) {
|
4856 |
+
if ( not ) {
|
4857 |
+
expr = ":not(" + expr + ")";
|
4858 |
+
}
|
4859 |
+
return elems.length === 1 ?
|
4860 |
+
jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
|
4861 |
+
jQuery.find.matches(expr, elems);
|
4862 |
+
},
|
4863 |
+
dir: function( elem, dir, until ) {
|
4864 |
+
var matched = [],
|
4865 |
+
cur = elem[ dir ];
|
4866 |
+
while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
|
4867 |
+
if ( cur.nodeType === 1 ) {
|
4868 |
+
matched.push( cur );
|
4869 |
+
}
|
4870 |
+
cur = cur[dir];
|
4871 |
+
}
|
4872 |
+
return matched;
|
4873 |
+
},
|
4874 |
+
sibling: function( n, elem ) {
|
4875 |
+
var r = [];
|
4876 |
+
for ( ; n; n = n.nextSibling ) {
|
4877 |
+
if ( n.nodeType === 1 && n !== elem ) {
|
4878 |
+
r.push( n );
|
4879 |
+
}
|
4880 |
+
}
|
4881 |
+
return r;
|
4882 |
+
}
|
4883 |
+
});
|
4884 |
+
// Implement the identical functionality for filter and not
|
4885 |
+
function winnow( elements, qualifier, keep ) {
|
4886 |
+
// Can't pass null or undefined to indexOf in Firefox 4
|
4887 |
+
// Set to 0 to skip string check
|
4888 |
+
qualifier = qualifier || 0;
|
4889 |
+
if ( jQuery.isFunction( qualifier ) ) {
|
4890 |
+
return jQuery.grep(elements, function( elem, i ) {
|
4891 |
+
var retVal = !!qualifier.call( elem, i, elem );
|
4892 |
+
return retVal === keep;
|
4893 |
+
});
|
4894 |
+
} else if ( qualifier.nodeType ) {
|
4895 |
+
return jQuery.grep(elements, function( elem ) {
|
4896 |
+
return ( elem === qualifier ) === keep;
|
4897 |
+
});
|
4898 |
+
} else if ( typeof qualifier === "string" ) {
|
4899 |
+
var filtered = jQuery.grep(elements, function( elem ) {
|
4900 |
+
return elem.nodeType === 1;
|
4901 |
+
});
|
4902 |
+
if ( isSimple.test( qualifier ) ) {
|
4903 |
+
return jQuery.filter(qualifier, filtered, !keep);
|
4904 |
+
} else {
|
4905 |
+
qualifier = jQuery.filter( qualifier, filtered );
|
4906 |
+
}
|
4907 |
+
}
|
4908 |
+
return jQuery.grep(elements, function( elem ) {
|
4909 |
+
return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
|
4910 |
+
});
|
4911 |
+
}
|
4912 |
+
function createSafeFragment( document ) {
|
4913 |
+
var list = nodeNames.split( "|" ),
|
4914 |
+
safeFrag = document.createDocumentFragment();
|
4915 |
+
if ( safeFrag.createElement ) {
|
4916 |
+
while ( list.length ) {
|
4917 |
+
safeFrag.createElement(
|
4918 |
+
list.pop()
|
4919 |
+
);
|
4920 |
+
}
|
4921 |
+
}
|
4922 |
+
return safeFrag;
|
4923 |
+
}
|
4924 |
+
var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
|
4925 |
+
"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
|
4926 |
+
rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
|
4927 |
+
rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
|
4928 |
+
rleadingWhitespace = /^\s+/,
|
4929 |
+
rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
|
4930 |
+
rtagName = /<([\w:]+)/,
|
4931 |
+
rtbody = /<tbody/i,
|
4932 |
+
rhtml = /<|&#?\w+;/,
|
4933 |
+
rnoInnerhtml = /<(?:script|style|link)/i,
|
4934 |
+
manipulation_rcheckableType = /^(?:checkbox|radio)$/i,
|
4935 |
+
// checked="checked" or checked
|
4936 |
+
rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
|
4937 |
+
rscriptType = /^$|\/(?:java|ecma)script/i,
|
4938 |
+
rscriptTypeMasked = /^true\/(.*)/,
|
4939 |
+
rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
|
4940 |
+
// We have to close these tags to support XHTML (#13200)
|
4941 |
+
wrapMap = {
|
4942 |
+
option: [ 1, "<select multiple='multiple'>", "</select>" ],
|
4943 |
+
legend: [ 1, "<fieldset>", "</fieldset>" ],
|
4944 |
+
area: [ 1, "<map>", "</map>" ],
|
4945 |
+
param: [ 1, "<object>", "</object>" ],
|
4946 |
+
thead: [ 1, "<table>", "</table>" ],
|
4947 |
+
tr: [ 2, "<table><tbody>", "</tbody></table>" ],
|
4948 |
+
col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
|
4949 |
+
td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
|
4950 |
+
// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
|
4951 |
+
// unless wrapped in a div with non-breaking characters in front of it.
|
4952 |
+
_default: jQuery.support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
|
4953 |
+
},
|
4954 |
+
safeFragment = createSafeFragment( document ),
|
4955 |
+
fragmentDiv = safeFragment.appendChild( document.createElement("div") );
|
4956 |
+
wrapMap.optgroup = wrapMap.option;
|
4957 |
+
wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
|
4958 |
+
wrapMap.th = wrapMap.td;
|
4959 |
+
jQuery.fn.extend({
|
4960 |
+
text: function( value ) {
|
4961 |
+
return jQuery.access( this, function( value ) {
|
4962 |
+
return value === undefined ?
|
4963 |
+
jQuery.text( this ) :
|
4964 |
+
this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
|
4965 |
+
}, null, value, arguments.length );
|
4966 |
+
},
|
4967 |
+
wrapAll: function( html ) {
|
4968 |
+
if ( jQuery.isFunction( html ) ) {
|
4969 |
+
return this.each(function(i) {
|
4970 |
+
jQuery(this).wrapAll( html.call(this, i) );
|
4971 |
+
});
|
4972 |
+
}
|
4973 |
+
if ( this[0] ) {
|
4974 |
+
// The elements to wrap the target around
|
4975 |
+
var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
|
4976 |
+
if ( this[0].parentNode ) {
|
4977 |
+
wrap.insertBefore( this[0] );
|
4978 |
+
}
|
4979 |
+
wrap.map(function() {
|
4980 |
+
var elem = this;
|
4981 |
+
while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
|
4982 |
+
elem = elem.firstChild;
|
4983 |
+
}
|
4984 |
+
return elem;
|
4985 |
+
}).append( this );
|
4986 |
+
}
|
4987 |
+
return this;
|
4988 |
+
},
|
4989 |
+
wrapInner: function( html ) {
|
4990 |
+
if ( jQuery.isFunction( html ) ) {
|
4991 |
+
return this.each(function(i) {
|
4992 |
+
jQuery(this).wrapInner( html.call(this, i) );
|
4993 |
+
});
|
4994 |
+
}
|
4995 |
+
return this.each(function() {
|
4996 |
+
var self = jQuery( this ),
|
4997 |
+
contents = self.contents();
|
4998 |
+
if ( contents.length ) {
|
4999 |
+
contents.wrapAll( html );
|
5000 |
+
} else {
|
5001 |
+
self.append( html );
|
5002 |
+
}
|
5003 |
+
});
|
5004 |
+
},
|
5005 |
+
wrap: function( html ) {
|
5006 |
+
var isFunction = jQuery.isFunction( html );
|
5007 |
+
return this.each(function(i) {
|
5008 |
+
jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
|
5009 |
+
});
|
5010 |
+
},
|
5011 |
+
unwrap: function() {
|
5012 |
+
return this.parent().each(function() {
|
5013 |
+
if ( !jQuery.nodeName( this, "body" ) ) {
|
5014 |
+
jQuery( this ).replaceWith( this.childNodes );
|
5015 |
+
}
|
5016 |
+
}).end();
|
5017 |
+
},
|
5018 |
+
append: function() {
|
5019 |
+
return this.domManip(arguments, true, function( elem ) {
|
5020 |
+
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
|
5021 |
+
this.appendChild( elem );
|
5022 |
+
}
|
5023 |
+
});
|
5024 |
+
},
|
5025 |
+
prepend: function() {
|
5026 |
+
return this.domManip(arguments, true, function( elem ) {
|
5027 |
+
if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
|
5028 |
+
this.insertBefore( elem, this.firstChild );
|
5029 |
+
}
|
5030 |
+
});
|
5031 |
+
},
|
5032 |
+
before: function() {
|
5033 |
+
return this.domManip( arguments, false, function( elem ) {
|
5034 |
+
if ( this.parentNode ) {
|
5035 |
+
this.parentNode.insertBefore( elem, this );
|
5036 |
+
}
|
5037 |
+
});
|
5038 |
+
},
|
5039 |
+
after: function() {
|
5040 |
+
return this.domManip( arguments, false, function( elem ) {
|
5041 |
+
if ( this.parentNode ) {
|
5042 |
+
this.parentNode.insertBefore( elem, this.nextSibling );
|
5043 |
+
}
|
5044 |
+
});
|
5045 |
+
},
|
5046 |
+
// keepData is for internal use only--do not document
|
5047 |
+
remove: function( selector, keepData ) {
|
5048 |
+
var elem,
|
5049 |
+
i = 0;
|
5050 |
+
for ( ; (elem = this[i]) != null; i++ ) {
|
5051 |
+
if ( !selector || jQuery.filter( selector, [ elem ] ).length > 0 ) {
|
5052 |
+
if ( !keepData && elem.nodeType === 1 ) {
|
5053 |
+
jQuery.cleanData( getAll( elem ) );
|
5054 |
+
}
|
5055 |
+
if ( elem.parentNode ) {
|
5056 |
+
if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
|
5057 |
+
setGlobalEval( getAll( elem, "script" ) );
|
5058 |
+
}
|
5059 |
+
elem.parentNode.removeChild( elem );
|
5060 |
+
}
|
5061 |
+
}
|
5062 |
+
}
|
5063 |
+
return this;
|
5064 |
+
},
|
5065 |
+
empty: function() {
|
5066 |
+
var elem,
|
5067 |
+
i = 0;
|
5068 |
+
for ( ; (elem = this[i]) != null; i++ ) {
|
5069 |
+
// Remove element nodes and prevent memory leaks
|
5070 |
+
if ( elem.nodeType === 1 ) {
|
5071 |
+
jQuery.cleanData( getAll( elem, false ) );
|
5072 |
+
}
|
5073 |
+
// Remove any remaining nodes
|
5074 |
+
while ( elem.firstChild ) {
|
5075 |
+
elem.removeChild( elem.firstChild );
|
5076 |
+
}
|
5077 |
+
// If this is a select, ensure that it displays empty (#12336)
|
5078 |
+
// Support: IE<9
|
5079 |
+
if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
|
5080 |
+
elem.options.length = 0;
|
5081 |
+
}
|
5082 |
+
}
|
5083 |
+
return this;
|
5084 |
+
},
|
5085 |
+
clone: function( dataAndEvents, deepDataAndEvents ) {
|
5086 |
+
dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
|
5087 |
+
deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
|
5088 |
+
return this.map( function () {
|
5089 |
+
return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
|
5090 |
+
});
|
5091 |
+
},
|
5092 |
+
html: function( value ) {
|
5093 |
+
return jQuery.access( this, function( value ) {
|
5094 |
+
var elem = this[0] || {},
|
5095 |
+
i = 0,
|
5096 |
+
l = this.length;
|
5097 |
+
if ( value === undefined ) {
|
5098 |
+
return elem.nodeType === 1 ?
|
5099 |
+
elem.innerHTML.replace( rinlinejQuery, "" ) :
|
5100 |
+
undefined;
|
5101 |
+
}
|
5102 |
+
// See if we can take a shortcut and just use innerHTML
|
5103 |
+
if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
|
5104 |
+
( jQuery.support.htmlSerialize || !rnoshimcache.test( value ) ) &&
|
5105 |
+
( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
|
5106 |
+
!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
|
5107 |
+
value = value.replace( rxhtmlTag, "<$1></$2>" );
|
5108 |
+
try {
|
5109 |
+
for (; i < l; i++ ) {
|
5110 |
+
// Remove element nodes and prevent memory leaks
|
5111 |
+
elem = this[i] || {};
|
5112 |
+
if ( elem.nodeType === 1 ) {
|
5113 |
+
jQuery.cleanData( getAll( elem, false ) );
|
5114 |
+
elem.innerHTML = value;
|
5115 |
+
}
|
5116 |
+
}
|
5117 |
+
elem = 0;
|
5118 |
+
// If using innerHTML throws an exception, use the fallback method
|
5119 |
+
} catch(e) {}
|
5120 |
+
}
|
5121 |
+
if ( elem ) {
|
5122 |
+
this.empty().append( value );
|
5123 |
+
}
|
5124 |
+
}, null, value, arguments.length );
|
5125 |
+
},
|
5126 |
+
replaceWith: function( value ) {
|
5127 |
+
var isFunc = jQuery.isFunction( value );
|
5128 |
+
// Make sure that the elements are removed from the DOM before they are inserted
|
5129 |
+
// this can help fix replacing a parent with child elements
|
5130 |
+
if ( !isFunc && typeof value !== "string" ) {
|
5131 |
+
value = jQuery( value ).not( this ).detach();
|
5132 |
+
}
|
5133 |
+
return this.domManip( [ value ], true, function( elem ) {
|
5134 |
+
var next = this.nextSibling,
|
5135 |
+
parent = this.parentNode;
|
5136 |
+
if ( parent ) {
|
5137 |
+
jQuery( this ).remove();
|
5138 |
+
parent.insertBefore( elem, next );
|
5139 |
+
}
|
5140 |
+
});
|
5141 |
+
},
|
5142 |
+
detach: function( selector ) {
|
5143 |
+
return this.remove( selector, true );
|
5144 |
+
},
|
5145 |
+
domManip: function( args, table, callback ) {
|
5146 |
+
// Flatten any nested arrays
|
5147 |
+
args = core_concat.apply( [], args );
|
5148 |
+
var first, node, hasScripts,
|
5149 |
+
scripts, doc, fragment,
|
5150 |
+
i = 0,
|
5151 |
+
l = this.length,
|
5152 |
+
set = this,
|
5153 |
+
iNoClone = l - 1,
|
5154 |
+
value = args[0],
|
5155 |
+
isFunction = jQuery.isFunction( value );
|
5156 |
+
// We can't cloneNode fragments that contain checked, in WebKit
|
5157 |
+
if ( isFunction || !( l <= 1 || typeof value !== "string" || jQuery.support.checkClone || !rchecked.test( value ) ) ) {
|
5158 |
+
return this.each(function( index ) {
|
5159 |
+
var self = set.eq( index );
|
5160 |
+
if ( isFunction ) {
|
5161 |
+
args[0] = value.call( this, index, table ? self.html() : undefined );
|
5162 |
+
}
|
5163 |
+
self.domManip( args, table, callback );
|
5164 |
+
});
|
5165 |
+
}
|
5166 |
+
if ( l ) {
|
5167 |
+
fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
|
5168 |
+
first = fragment.firstChild;
|
5169 |
+
if ( fragment.childNodes.length === 1 ) {
|
5170 |
+
fragment = first;
|
5171 |
+
}
|
5172 |
+
if ( first ) {
|
5173 |
+
table = table && jQuery.nodeName( first, "tr" );
|
5174 |
+
scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
|
5175 |
+
hasScripts = scripts.length;
|
5176 |
+
// Use the original fragment for the last item instead of the first because it can end up
|
5177 |
+
// being emptied incorrectly in certain situations (#8070).
|
5178 |
+
for ( ; i < l; i++ ) {
|
5179 |
+
node = fragment;
|
5180 |
+
if ( i !== iNoClone ) {
|
5181 |
+
node = jQuery.clone( node, true, true );
|
5182 |
+
// Keep references to cloned scripts for later restoration
|
5183 |
+
if ( hasScripts ) {
|
5184 |
+
jQuery.merge( scripts, getAll( node, "script" ) );
|
5185 |
+
}
|
5186 |
+
}
|
5187 |
+
callback.call(
|
5188 |
+
table && jQuery.nodeName( this[i], "table" ) ?
|
5189 |
+
findOrAppend( this[i], "tbody" ) :
|
5190 |
+
this[i],
|
5191 |
+
node,
|
5192 |
+
i
|
5193 |
+
);
|
5194 |
+
}
|
5195 |
+
if ( hasScripts ) {
|
5196 |
+
doc = scripts[ scripts.length - 1 ].ownerDocument;
|
5197 |
+
// Reenable scripts
|
5198 |
+
jQuery.map( scripts, restoreScript );
|
5199 |
+
// Evaluate executable scripts on first document insertion
|
5200 |
+
for ( i = 0; i < hasScripts; i++ ) {
|
5201 |
+
node = scripts[ i ];
|
5202 |
+
if ( rscriptType.test( node.type || "" ) &&
|
5203 |
+
!jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
|
5204 |
+
if ( node.src ) {
|
5205 |
+
// Hope ajax is available...
|
5206 |
+
jQuery.ajax({
|
5207 |
+
url: node.src,
|
5208 |
+
type: "GET",
|
5209 |
+
dataType: "script",
|
5210 |
+
async: false,
|
5211 |
+
global: false,
|
5212 |
+
"throws": true
|
5213 |
+
});
|
5214 |
+
} else {
|
5215 |
+
jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
|
5216 |
+
}
|
5217 |
+
}
|
5218 |
+
}
|
5219 |
+
}
|
5220 |
+
// Fix #11809: Avoid leaking memory
|
5221 |
+
fragment = first = null;
|
5222 |
+
}
|
5223 |
+
}
|
5224 |
+
return this;
|
5225 |
+
}
|
5226 |
+
});
|
5227 |
+
function findOrAppend( elem, tag ) {
|
5228 |
+
return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
|
5229 |
+
}
|
5230 |
+
// Replace/restore the type attribute of script elements for safe DOM manipulation
|
5231 |
+
function disableScript( elem ) {
|
5232 |
+
var attr = elem.getAttributeNode("type");
|
5233 |
+
elem.type = ( attr && attr.specified ) + "/" + elem.type;
|
5234 |
+
return elem;
|
5235 |
+
}
|
5236 |
+
function restoreScript( elem ) {
|
5237 |
+
var match = rscriptTypeMasked.exec( elem.type );
|
5238 |
+
if ( match ) {
|
5239 |
+
elem.type = match[1];
|
5240 |
+
} else {
|
5241 |
+
elem.removeAttribute("type");
|
5242 |
+
}
|
5243 |
+
return elem;
|
5244 |
+
}
|
5245 |
+
// Mark scripts as having already been evaluated
|
5246 |
+
function setGlobalEval( elems, refElements ) {
|
5247 |
+
var elem,
|
5248 |
+
i = 0;
|
5249 |
+
for ( ; (elem = elems[i]) != null; i++ ) {
|
5250 |
+
jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
|
5251 |
+
}
|
5252 |
+
}
|
5253 |
+
function cloneCopyEvent( src, dest ) {
|
5254 |
+
if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
|
5255 |
+
return;
|
5256 |
+
}
|
5257 |
+
var type, i, l,
|
5258 |
+
oldData = jQuery._data( src ),
|
5259 |
+
curData = jQuery._data( dest, oldData ),
|
5260 |
+
events = oldData.events;
|
5261 |
+
if ( events ) {
|
5262 |
+
delete curData.handle;
|
5263 |
+
curData.events = {};
|
5264 |
+
for ( type in events ) {
|
5265 |
+
for ( i = 0, l = events[ type ].length; i < l; i++ ) {
|
5266 |
+
jQuery.event.add( dest, type, events[ type ][ i ] );
|
5267 |
+
}
|
5268 |
+
}
|
5269 |
+
}
|
5270 |
+
// make the cloned public data object a copy from the original
|
5271 |
+
if ( curData.data ) {
|
5272 |
+
curData.data = jQuery.extend( {}, curData.data );
|
5273 |
+
}
|
5274 |
+
}
|
5275 |
+
function fixCloneNodeIssues( src, dest ) {
|
5276 |
+
var nodeName, e, data;
|
5277 |
+
// We do not need to do anything for non-Elements
|
5278 |
+
if ( dest.nodeType !== 1 ) {
|
5279 |
+
return;
|
5280 |
+
}
|
5281 |
+
nodeName = dest.nodeName.toLowerCase();
|
5282 |
+
// IE6-8 copies events bound via attachEvent when using cloneNode.
|
5283 |
+
if ( !jQuery.support.noCloneEvent && dest[ jQuery.expando ] ) {
|
5284 |
+
data = jQuery._data( dest );
|
5285 |
+
for ( e in data.events ) {
|
5286 |
+
jQuery.removeEvent( dest, e, data.handle );
|
5287 |
+
}
|
5288 |
+
// Event data gets referenced instead of copied if the expando gets copied too
|
5289 |
+
dest.removeAttribute( jQuery.expando );
|
5290 |
+
}
|
5291 |
+
// IE blanks contents when cloning scripts, and tries to evaluate newly-set text
|
5292 |
+
if ( nodeName === "script" && dest.text !== src.text ) {
|
5293 |
+
disableScript( dest ).text = src.text;
|
5294 |
+
restoreScript( dest );
|
5295 |
+
// IE6-10 improperly clones children of object elements using classid.
|
5296 |
+
// IE10 throws NoModificationAllowedError if parent is null, #12132.
|
5297 |
+
} else if ( nodeName === "object" ) {
|
5298 |
+
if ( dest.parentNode ) {
|
5299 |
+
dest.outerHTML = src.outerHTML;
|
5300 |
+
}
|
5301 |
+
// This path appears unavoidable for IE9. When cloning an object
|
5302 |
+
// element in IE9, the outerHTML strategy above is not sufficient.
|
5303 |
+
// If the src has innerHTML and the destination does not,
|
5304 |
+
// copy the src.innerHTML into the dest.innerHTML. #10324
|
5305 |
+
if ( jQuery.support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
|
5306 |
+
dest.innerHTML = src.innerHTML;
|
5307 |
+
}
|
5308 |
+
} else if ( nodeName === "input" && manipulation_rcheckableType.test( src.type ) ) {
|
5309 |
+
// IE6-8 fails to persist the checked state of a cloned checkbox
|
5310 |
+
// or radio button. Worse, IE6-7 fail to give the cloned element
|
5311 |
+
// a checked appearance if the defaultChecked value isn't also set
|
5312 |
+
dest.defaultChecked = dest.checked = src.checked;
|
5313 |
+
// IE6-7 get confused and end up setting the value of a cloned
|
5314 |
+
// checkbox/radio button to an empty string instead of "on"
|
5315 |
+
if ( dest.value !== src.value ) {
|
5316 |
+
dest.value = src.value;
|
5317 |
+
}
|
5318 |
+
// IE6-8 fails to return the selected option to the default selected
|
5319 |
+
// state when cloning options
|
5320 |
+
} else if ( nodeName === "option" ) {
|
5321 |
+
dest.defaultSelected = dest.selected = src.defaultSelected;
|
5322 |
+
// IE6-8 fails to set the defaultValue to the correct value when
|
5323 |
+
// cloning other types of input fields
|
5324 |
+
} else if ( nodeName === "input" || nodeName === "textarea" ) {
|
5325 |
+
dest.defaultValue = src.defaultValue;
|
5326 |
+
}
|
5327 |
+
}
|
5328 |
+
jQuery.each({
|
5329 |
+
appendTo: "append",
|
5330 |
+
prependTo: "prepend",
|
5331 |
+
insertBefore: "before",
|
5332 |
+
insertAfter: "after",
|
5333 |
+
replaceAll: "replaceWith"
|
5334 |
+
}, function( name, original ) {
|
5335 |
+
jQuery.fn[ name ] = function( selector ) {
|
5336 |
+
var elems,
|
5337 |
+
i = 0,
|
5338 |
+
ret = [],
|
5339 |
+
insert = jQuery( selector ),
|
5340 |
+
last = insert.length - 1;
|
5341 |
+
for ( ; i <= last; i++ ) {
|
5342 |
+
elems = i === last ? this : this.clone(true);
|
5343 |
+
jQuery( insert[i] )[ original ]( elems );
|
5344 |
+
// Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
|
5345 |
+
core_push.apply( ret, elems.get() );
|
5346 |
+
}
|
5347 |
+
return this.pushStack( ret );
|
5348 |
+
};
|
5349 |
+
});
|
5350 |
+
function getAll( context, tag ) {
|
5351 |
+
var elems, elem,
|
5352 |
+
i = 0,
|
5353 |
+
found = typeof context.getElementsByTagName !== core_strundefined ? context.getElementsByTagName( tag || "*" ) :
|
5354 |
+
typeof context.querySelectorAll !== core_strundefined ? context.querySelectorAll( tag || "*" ) :
|
5355 |
+
undefined;
|
5356 |
+
if ( !found ) {
|
5357 |
+
for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
|
5358 |
+
if ( !tag || jQuery.nodeName( elem, tag ) ) {
|
5359 |
+
found.push( elem );
|
5360 |
+
} else {
|
5361 |
+
jQuery.merge( found, getAll( elem, tag ) );
|
5362 |
+
}
|
5363 |
+
}
|
5364 |
+
}
|
5365 |
+
return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
|
5366 |
+
jQuery.merge( [ context ], found ) :
|
5367 |
+
found;
|
5368 |
+
}
|
5369 |
+
// Used in buildFragment, fixes the defaultChecked property
|
5370 |
+
function fixDefaultChecked( elem ) {
|
5371 |
+
if ( manipulation_rcheckableType.test( elem.type ) ) {
|
5372 |
+
elem.defaultChecked = elem.checked;
|
5373 |
+
}
|
5374 |
+
}
|
5375 |
+
jQuery.extend({
|
5376 |
+
clone: function( elem, dataAndEvents, deepDataAndEvents ) {
|
5377 |
+
var destElements, node, clone, i, srcElements,
|
5378 |
+
inPage = jQuery.contains( elem.ownerDocument, elem );
|
5379 |
+
if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
|
5380 |
+
clone = elem.cloneNode( true );
|
5381 |
+
// IE<=8 does not properly clone detached, unknown element nodes
|
5382 |
+
} else {
|
5383 |
+
fragmentDiv.innerHTML = elem.outerHTML;
|
5384 |
+
fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
|
5385 |
+
}
|
5386 |
+
if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
|
5387 |
+
(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
|
5388 |
+
// We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
|
5389 |
+
destElements = getAll( clone );
|
5390 |
+
srcElements = getAll( elem );
|
5391 |
+
// Fix all IE cloning issues
|
5392 |
+
for ( i = 0; (node = srcElements[i]) != null; ++i ) {
|
5393 |
+
// Ensure that the destination node is not null; Fixes #9587
|
5394 |
+
if ( destElements[i] ) {
|
5395 |
+
fixCloneNodeIssues( node, destElements[i] );
|
5396 |
+
}
|
5397 |
+
}
|
5398 |
+
}
|
5399 |
+
// Copy the events from the original to the clone
|
5400 |
+
if ( dataAndEvents ) {
|
5401 |
+
if ( deepDataAndEvents ) {
|
5402 |
+
srcElements = srcElements || getAll( elem );
|
5403 |
+
destElements = destElements || getAll( clone );
|
5404 |
+
for ( i = 0; (node = srcElements[i]) != null; i++ ) {
|
5405 |
+
cloneCopyEvent( node, destElements[i] );
|
5406 |
+
}
|
5407 |
+
} else {
|
5408 |
+
cloneCopyEvent( elem, clone );
|
5409 |
+
}
|
5410 |
+
}
|
5411 |
+
// Preserve script evaluation history
|
5412 |
+
destElements = getAll( clone, "script" );
|
5413 |
+
if ( destElements.length > 0 ) {
|
5414 |
+
setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
|
5415 |
+
}
|
5416 |
+
destElements = srcElements = node = null;
|
5417 |
+
// Return the cloned set
|
5418 |
+
return clone;
|
5419 |
+
},
|
5420 |
+
buildFragment: function( elems, context, scripts, selection ) {
|
5421 |
+
var j, elem, contains,
|
5422 |
+
tmp, tag, tbody, wrap,
|
5423 |
+
l = elems.length,
|
5424 |
+
// Ensure a safe fragment
|
5425 |
+
safe = createSafeFragment( context ),
|
5426 |
+
nodes = [],
|
5427 |
+
i = 0;
|
5428 |
+
for ( ; i < l; i++ ) {
|
5429 |
+
elem = elems[ i ];
|
5430 |
+
if ( elem || elem === 0 ) {
|
5431 |
+
// Add nodes directly
|
5432 |
+
if ( jQuery.type( elem ) === "object" ) {
|
5433 |
+
jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
|
5434 |
+
// Convert non-html into a text node
|
5435 |
+
} else if ( !rhtml.test( elem ) ) {
|
5436 |
+
nodes.push( context.createTextNode( elem ) );
|
5437 |
+
// Convert html into DOM nodes
|
5438 |
+
} else {
|
5439 |
+
tmp = tmp || safe.appendChild( context.createElement("div") );
|
5440 |
+
// Deserialize a standard representation
|
5441 |
+
tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
|
5442 |
+
wrap = wrapMap[ tag ] || wrapMap._default;
|
5443 |
+
tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
|
5444 |
+
// Descend through wrappers to the right content
|
5445 |
+
j = wrap[0];
|
5446 |
+
while ( j-- ) {
|
5447 |
+
tmp = tmp.lastChild;
|
5448 |
+
}
|
5449 |
+
// Manually add leading whitespace removed by IE
|
5450 |
+
if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
|
5451 |
+
nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
|
5452 |
+
}
|
5453 |
+
// Remove IE's autoinserted <tbody> from table fragments
|
5454 |
+
if ( !jQuery.support.tbody ) {
|
5455 |
+
// String was a <table>, *may* have spurious <tbody>
|
5456 |
+
elem = tag === "table" && !rtbody.test( elem ) ?
|
5457 |
+
tmp.firstChild :
|
5458 |
+
// String was a bare <thead> or <tfoot>
|
5459 |
+
wrap[1] === "<table>" && !rtbody.test( elem ) ?
|
5460 |
+
tmp :
|
5461 |
+
0;
|
5462 |
+
j = elem && elem.childNodes.length;
|
5463 |
+
while ( j-- ) {
|
5464 |
+
if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
|
5465 |
+
elem.removeChild( tbody );
|
5466 |
+
}
|
5467 |
+
}
|
5468 |
+
}
|
5469 |
+
jQuery.merge( nodes, tmp.childNodes );
|
5470 |
+
// Fix #12392 for WebKit and IE > 9
|
5471 |
+
tmp.textContent = "";
|
5472 |
+
// Fix #12392 for oldIE
|
5473 |
+
while ( tmp.firstChild ) {
|
5474 |
+
tmp.removeChild( tmp.firstChild );
|
5475 |
+
}
|
5476 |
+
// Remember the top-level container for proper cleanup
|
5477 |
+
tmp = safe.lastChild;
|
5478 |
+
}
|
5479 |
+
}
|
5480 |
+
}
|
5481 |
+
// Fix #11356: Clear elements from fragment
|
5482 |
+
if ( tmp ) {
|
5483 |
+
safe.removeChild( tmp );
|
5484 |
+
}
|
5485 |
+
// Reset defaultChecked for any radios and checkboxes
|
5486 |
+
// about to be appended to the DOM in IE 6/7 (#8060)
|
5487 |
+
if ( !jQuery.support.appendChecked ) {
|
5488 |
+
jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
|
5489 |
+
}
|
5490 |
+
i = 0;
|
5491 |
+
while ( (elem = nodes[ i++ ]) ) {
|
5492 |
+
// #4087 - If origin and destination elements are the same, and this is
|
5493 |
+
// that element, do not do anything
|
5494 |
+
if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
|
5495 |
+
continue;
|
5496 |
+
}
|
5497 |
+
contains = jQuery.contains( elem.ownerDocument, elem );
|
5498 |
+
// Append to fragment
|
5499 |
+
tmp = getAll( safe.appendChild( elem ), "script" );
|
5500 |
+
// Preserve script evaluation history
|
5501 |
+
if ( contains ) {
|
5502 |
+
setGlobalEval( tmp );
|
5503 |
+
}
|
5504 |
+
// Capture executables
|
5505 |
+
if ( scripts ) {
|
5506 |
+
j = 0;
|
5507 |
+
while ( (elem = tmp[ j++ ]) ) {
|
5508 |
+
if ( rscriptType.test( elem.type || "" ) ) {
|
5509 |
+
scripts.push( elem );
|
5510 |
+
}
|
5511 |
+
}
|
5512 |
+
}
|
5513 |
+
}
|
5514 |
+
tmp = null;
|
5515 |
+
return safe;
|
5516 |
+
},
|
5517 |
+
cleanData: function( elems, /* internal */ acceptData ) {
|
5518 |
+
var elem, type, id, data,
|
5519 |
+
i = 0,
|
5520 |
+
internalKey = jQuery.expando,
|
5521 |
+
cache = jQuery.cache,
|
5522 |
+
deleteExpando = jQuery.support.deleteExpando,
|
5523 |
+
special = jQuery.event.special;
|
5524 |
+
for ( ; (elem = elems[i]) != null; i++ ) {
|
5525 |
+
if ( acceptData || jQuery.acceptData( elem ) ) {
|
5526 |
+
id = elem[ internalKey ];
|
5527 |
+
data = id && cache[ id ];
|
5528 |
+
if ( data ) {
|
5529 |
+
if ( data.events ) {
|
5530 |
+
for ( type in data.events ) {
|
5531 |
+
if ( special[ type ] ) {
|
5532 |
+
jQuery.event.remove( elem, type );
|
5533 |
+
// This is a shortcut to avoid jQuery.event.remove's overhead
|
5534 |
+
} else {
|
5535 |
+
jQuery.removeEvent( elem, type, data.handle );
|
5536 |
+
}
|
5537 |
+
}
|
5538 |
+
}
|
5539 |
+
// Remove cache only if it was not already removed by jQuery.event.remove
|
5540 |
+
if ( cache[ id ] ) {
|
5541 |
+
delete cache[ id ];
|
5542 |
+
// IE does not allow us to delete expando properties from nodes,
|
5543 |
+
// nor does it have a removeAttribute function on Document nodes;
|
5544 |
+
// we must handle all of these cases
|
5545 |
+
if ( deleteExpando ) {
|
5546 |
+
delete elem[ internalKey ];
|
5547 |
+
} else if ( typeof elem.removeAttribute !== core_strundefined ) {
|
5548 |
+
elem.removeAttribute( internalKey );
|
5549 |
+
} else {
|
5550 |
+
elem[ internalKey ] = null;
|
5551 |
+
}
|
5552 |
+
core_deletedIds.push( id );
|
5553 |
+
}
|
5554 |
+
}
|
5555 |
+
}
|
5556 |
+
}
|
5557 |
+
}
|
5558 |
+
});
|
5559 |
+
var iframe, getStyles, curCSS,
|
5560 |
+
ralpha = /alpha\([^)]*\)/i,
|
5561 |
+
ropacity = /opacity\s*=\s*([^)]*)/,
|
5562 |
+
rposition = /^(top|right|bottom|left)$/,
|
5563 |
+
// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
|
5564 |
+
// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
|
5565 |
+
rdisplayswap = /^(none|table(?!-c[ea]).+)/,
|
5566 |
+
rmargin = /^margin/,
|
5567 |
+
rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
|
5568 |
+
rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
|
5569 |
+
rrelNum = new RegExp( "^([+-])=(" + core_pnum + ")", "i" ),
|
5570 |
+
elemdisplay = { BODY: "block" },
|
5571 |
+
cssShow = { position: "absolute", visibility: "hidden", display: "block" },
|
5572 |
+
cssNormalTransform = {
|
5573 |
+
letterSpacing: 0,
|
5574 |
+
fontWeight: 400
|
5575 |
+
},
|
5576 |
+
cssExpand = [ "Top", "Right", "Bottom", "Left" ],
|
5577 |
+
cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
|
5578 |
+
// return a css property mapped to a potentially vendor prefixed property
|
5579 |
+
function vendorPropName( style, name ) {
|
5580 |
+
// shortcut for names that are not vendor prefixed
|
5581 |
+
if ( name in style ) {
|
5582 |
+
return name;
|
5583 |
+
}
|
5584 |
+
// check for vendor prefixed names
|
5585 |
+
var capName = name.charAt(0).toUpperCase() + name.slice(1),
|
5586 |
+
origName = name,
|
5587 |
+
i = cssPrefixes.length;
|
5588 |
+
while ( i-- ) {
|
5589 |
+
name = cssPrefixes[ i ] + capName;
|
5590 |
+
if ( name in style ) {
|
5591 |
+
return name;
|
5592 |
+
}
|
5593 |
+
}
|
5594 |
+
return origName;
|
5595 |
+
}
|
5596 |
+
function isHidden( elem, el ) {
|
5597 |
+
// isHidden might be called from jQuery#filter function;
|
5598 |
+
// in that case, element will be second argument
|
5599 |
+
elem = el || elem;
|
5600 |
+
return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
|
5601 |
+
}
|
5602 |
+
function showHide( elements, show ) {
|
5603 |
+
var display, elem, hidden,
|
5604 |
+
values = [],
|
5605 |
+
index = 0,
|
5606 |
+
length = elements.length;
|
5607 |
+
for ( ; index < length; index++ ) {
|
5608 |
+
elem = elements[ index ];
|
5609 |
+
if ( !elem.style ) {
|
5610 |
+
continue;
|
5611 |
+
}
|
5612 |
+
values[ index ] = jQuery._data( elem, "olddisplay" );
|
5613 |
+
display = elem.style.display;
|
5614 |
+
if ( show ) {
|
5615 |
+
// Reset the inline display of this element to learn if it is
|
5616 |
+
// being hidden by cascaded rules or not
|
5617 |
+
if ( !values[ index ] && display === "none" ) {
|
5618 |
+
elem.style.display = "";
|
5619 |
+
}
|
5620 |
+
// Set elements which have been overridden with display: none
|
5621 |
+
// in a stylesheet to whatever the default browser style is
|
5622 |
+
// for such an element
|
5623 |
+
if ( elem.style.display === "" && isHidden( elem ) ) {
|
5624 |
+
values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
|
5625 |
+
}
|
5626 |
+
} else {
|
5627 |
+
if ( !values[ index ] ) {
|
5628 |
+
hidden = isHidden( elem );
|
5629 |
+
if ( display && display !== "none" || !hidden ) {
|
5630 |
+
jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
|
5631 |
+
}
|
5632 |
+
}
|
5633 |
+
}
|
5634 |
+
}
|
5635 |
+
// Set the display of most of the elements in a second loop
|
5636 |
+
// to avoid the constant reflow
|
5637 |
+
for ( index = 0; index < length; index++ ) {
|
5638 |
+
elem = elements[ index ];
|
5639 |
+
if ( !elem.style ) {
|
5640 |
+
continue;
|
5641 |
+
}
|
5642 |
+
if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
|
5643 |
+
elem.style.display = show ? values[ index ] || "" : "none";
|
5644 |
+
}
|
5645 |
+
}
|
5646 |
+
return elements;
|
5647 |
+
}
|
5648 |
+
jQuery.fn.extend({
|
5649 |
+
css: function( name, value ) {
|
5650 |
+
return jQuery.access( this, function( elem, name, value ) {
|
5651 |
+
var len, styles,
|
5652 |
+
map = {},
|
5653 |
+
i = 0;
|
5654 |
+
if ( jQuery.isArray( name ) ) {
|
5655 |
+
styles = getStyles( elem );
|
5656 |
+
len = name.length;
|
5657 |
+
for ( ; i < len; i++ ) {
|
5658 |
+
map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
|
5659 |
+
}
|
5660 |
+
return map;
|
5661 |
+
}
|
5662 |
+
return value !== undefined ?
|
5663 |
+
jQuery.style( elem, name, value ) :
|
5664 |
+
jQuery.css( elem, name );
|
5665 |
+
}, name, value, arguments.length > 1 );
|
5666 |
+
},
|
5667 |
+
show: function() {
|
5668 |
+
return showHide( this, true );
|
5669 |
+
},
|
5670 |
+
hide: function() {
|
5671 |
+
return showHide( this );
|
5672 |
+
},
|
5673 |
+
toggle: function( state ) {
|
5674 |
+
var bool = typeof state === "boolean";
|
5675 |
+
return this.each(function() {
|
5676 |
+
if ( bool ? state : isHidden( this ) ) {
|
5677 |
+
jQuery( this ).show();
|
5678 |
+
} else {
|
5679 |
+
jQuery( this ).hide();
|
5680 |
+
}
|
5681 |
+
});
|
5682 |
+
}
|
5683 |
+
});
|
5684 |
+
jQuery.extend({
|
5685 |
+
// Add in style property hooks for overriding the default
|
5686 |
+
// behavior of getting and setting a style property
|
5687 |
+
cssHooks: {
|
5688 |
+
opacity: {
|
5689 |
+
get: function( elem, computed ) {
|
5690 |
+
if ( computed ) {
|
5691 |
+
// We should always get a number back from opacity
|
5692 |
+
var ret = curCSS( elem, "opacity" );
|
5693 |
+
return ret === "" ? "1" : ret;
|
5694 |
+
}
|
5695 |
+
}
|
5696 |
+
}
|
5697 |
+
},
|
5698 |
+
// Exclude the following css properties to add px
|
5699 |
+
cssNumber: {
|
5700 |
+
"columnCount": true,
|
5701 |
+
"fillOpacity": true,
|
5702 |
+
"fontWeight": true,
|
5703 |
+
"lineHeight": true,
|
5704 |
+
"opacity": true,
|
5705 |
+
"orphans": true,
|
5706 |
+
"widows": true,
|
5707 |
+
"zIndex": true,
|
5708 |
+
"zoom": true
|
5709 |
+
},
|
5710 |
+
// Add in properties whose names you wish to fix before
|
5711 |
+
// setting or getting the value
|
5712 |
+
cssProps: {
|
5713 |
+
// normalize float css property
|
5714 |
+
"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
|
5715 |
+
},
|
5716 |
+
// Get and set the style property on a DOM Node
|
5717 |
+
style: function( elem, name, value, extra ) {
|
5718 |
+
// Don't set styles on text and comment nodes
|
5719 |
+
if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
|
5720 |
+
return;
|
5721 |
+
}
|
5722 |
+
// Make sure that we're working with the right name
|
5723 |
+
var ret, type, hooks,
|
5724 |
+
origName = jQuery.camelCase( name ),
|
5725 |
+
style = elem.style;
|
5726 |
+
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
|
5727 |
+
// gets hook for the prefixed version
|
5728 |
+
// followed by the unprefixed version
|
5729 |
+
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
|
5730 |
+
// Check if we're setting a value
|
5731 |
+
if ( value !== undefined ) {
|
5732 |
+
type = typeof value;
|
5733 |
+
// convert relative number strings (+= or -=) to relative numbers. #7345
|
5734 |
+
if ( type === "string" && (ret = rrelNum.exec( value )) ) {
|
5735 |
+
value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
|
5736 |
+
// Fixes bug #9237
|
5737 |
+
type = "number";
|
5738 |
+
}
|
5739 |
+
// Make sure that NaN and null values aren't set. See: #7116
|
5740 |
+
if ( value == null || type === "number" && isNaN( value ) ) {
|
5741 |
+
return;
|
5742 |
+
}
|
5743 |
+
// If a number was passed in, add 'px' to the (except for certain CSS properties)
|
5744 |
+
if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
|
5745 |
+
value += "px";
|
5746 |
+
}
|
5747 |
+
// Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
|
5748 |
+
// but it would mean to define eight (for every problematic property) identical functions
|
5749 |
+
if ( !jQuery.support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
|
5750 |
+
style[ name ] = "inherit";
|
5751 |
+
}
|
5752 |
+
// If a hook was provided, use that value, otherwise just set the specified value
|
5753 |
+
if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
|
5754 |
+
// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
|
5755 |
+
// Fixes bug #5509
|
5756 |
+
try {
|
5757 |
+
style[ name ] = value;
|
5758 |
+
} catch(e) {}
|
5759 |
+
}
|
5760 |
+
} else {
|
5761 |
+
// If a hook was provided get the non-computed value from there
|
5762 |
+
if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
|
5763 |
+
return ret;
|
5764 |
+
}
|
5765 |
+
// Otherwise just get the value from the style object
|
5766 |
+
return style[ name ];
|
5767 |
+
}
|
5768 |
+
},
|
5769 |
+
css: function( elem, name, extra, styles ) {
|
5770 |
+
var num, val, hooks,
|
5771 |
+
origName = jQuery.camelCase( name );
|
5772 |
+
// Make sure that we're working with the right name
|
5773 |
+
name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
|
5774 |
+
// gets hook for the prefixed version
|
5775 |
+
// followed by the unprefixed version
|
5776 |
+
hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
|
5777 |
+
// If a hook was provided get the computed value from there
|
5778 |
+
if ( hooks && "get" in hooks ) {
|
5779 |
+
val = hooks.get( elem, true, extra );
|
5780 |
+
}
|
5781 |
+
// Otherwise, if a way to get the computed value exists, use that
|
5782 |
+
if ( val === undefined ) {
|
5783 |
+
val = curCSS( elem, name, styles );
|
5784 |
+
}
|
5785 |
+
//convert "normal" to computed value
|
5786 |
+
if ( val === "normal" && name in cssNormalTransform ) {
|
5787 |
+
val = cssNormalTransform[ name ];
|
5788 |
+
}
|
5789 |
+
// Return, converting to number if forced or a qualifier was provided and val looks numeric
|
5790 |
+
if ( extra === "" || extra ) {
|
5791 |
+
num = parseFloat( val );
|
5792 |
+
return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
|
5793 |
+
}
|
5794 |
+
return val;
|
5795 |
+
},
|
5796 |
+
// A method for quickly swapping in/out CSS properties to get correct calculations
|
5797 |
+
swap: function( elem, options, callback, args ) {
|
5798 |
+
var ret, name,
|
5799 |
+
old = {};
|
5800 |
+
// Remember the old values, and insert the new ones
|
5801 |
+
for ( name in options ) {
|
5802 |
+
old[ name ] = elem.style[ name ];
|
5803 |
+
elem.style[ name ] = options[ name ];
|
5804 |
+
}
|
5805 |
+
ret = callback.apply( elem, args || [] );
|
5806 |
+
// Revert the old values
|
5807 |
+
for ( name in options ) {
|
5808 |
+
elem.style[ name ] = old[ name ];
|
5809 |
+
}
|
5810 |
+
return ret;
|
5811 |
+
}
|
5812 |
+
});
|
5813 |
+
// NOTE: we've included the "window" in window.getComputedStyle
|
5814 |
+
// because jsdom on node.js will break without it.
|
5815 |
+
if ( window.getComputedStyle ) {
|
5816 |
+
getStyles = function( elem ) {
|
5817 |
+
return window.getComputedStyle( elem, null );
|
5818 |
+
};
|
5819 |
+
curCSS = function( elem, name, _computed ) {
|
5820 |
+
var width, minWidth, maxWidth,
|
5821 |
+
computed = _computed || getStyles( elem ),
|
5822 |
+
// getPropertyValue is only needed for .css('filter') in IE9, see #12537
|
5823 |
+
ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined,
|
5824 |
+
style = elem.style;
|
5825 |
+
if ( computed ) {
|
5826 |
+
if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
|
5827 |
+
ret = jQuery.style( elem, name );
|
5828 |
+
}
|
5829 |
+
// A tribute to the "awesome hack by Dean Edwards"
|
5830 |
+
// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
|
5831 |
+
// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
|
5832 |
+
// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
|
5833 |
+
if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
|
5834 |
+
// Remember the original values
|
5835 |
+
width = style.width;
|
5836 |
+
minWidth = style.minWidth;
|
5837 |
+
maxWidth = style.maxWidth;
|
5838 |
+
// Put in the new values to get a computed value out
|
5839 |
+
style.minWidth = style.maxWidth = style.width = ret;
|
5840 |
+
ret = computed.width;
|
5841 |
+
// Revert the changed values
|
5842 |
+
style.width = width;
|
5843 |
+
style.minWidth = minWidth;
|
5844 |
+
style.maxWidth = maxWidth;
|
5845 |
+
}
|
5846 |
+
}
|
5847 |
+
return ret;
|
5848 |
+
};
|
5849 |
+
} else if ( document.documentElement.currentStyle ) {
|
5850 |
+
getStyles = function( elem ) {
|
5851 |
+
return elem.currentStyle;
|
5852 |
+
};
|
5853 |
+
curCSS = function( elem, name, _computed ) {
|
5854 |
+
var left, rs, rsLeft,
|
5855 |
+
computed = _computed || getStyles( elem ),
|
5856 |
+
ret = computed ? computed[ name ] : undefined,
|
5857 |
+
style = elem.style;
|
5858 |
+
// Avoid setting ret to empty string here
|
5859 |
+
// so we don't default to auto
|
5860 |
+
if ( ret == null && style && style[ name ] ) {
|
5861 |
+
ret = style[ name ];
|
5862 |
+
}
|
5863 |
+
// From the awesome hack by Dean Edwards
|
5864 |
+
// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
|
5865 |
+
// If we're not dealing with a regular pixel number
|
5866 |
+
// but a number that has a weird ending, we need to convert it to pixels
|
5867 |
+
// but not position css attributes, as those are proportional to the parent element instead
|
5868 |
+
// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
|
5869 |
+
if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
|
5870 |
+
// Remember the original values
|
5871 |
+
left = style.left;
|
5872 |
+
rs = elem.runtimeStyle;
|
5873 |
+
rsLeft = rs && rs.left;
|
5874 |
+
// Put in the new values to get a computed value out
|
5875 |
+
if ( rsLeft ) {
|
5876 |
+
rs.left = elem.currentStyle.left;
|
5877 |
+
}
|
5878 |
+
style.left = name === "fontSize" ? "1em" : ret;
|
5879 |
+
ret = style.pixelLeft + "px";
|
5880 |
+
// Revert the changed values
|
5881 |
+
style.left = left;
|
5882 |
+
if ( rsLeft ) {
|
5883 |
+
rs.left = rsLeft;
|
5884 |
+
}
|
5885 |
+
}
|
5886 |
+
return ret === "" ? "auto" : ret;
|
5887 |
+
};
|
5888 |
+
}
|
5889 |
+
function setPositiveNumber( elem, value, subtract ) {
|
5890 |
+
var matches = rnumsplit.exec( value );
|
5891 |
+
return matches ?
|
5892 |
+
// Guard against undefined "subtract", e.g., when used as in cssHooks
|
5893 |
+
Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
|
5894 |
+
value;
|
5895 |
+
}
|
5896 |
+
function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
|
5897 |
+
var i = extra === ( isBorderBox ? "border" : "content" ) ?
|
5898 |
+
// If we already have the right measurement, avoid augmentation
|
5899 |
+
4 :
|
5900 |
+
// Otherwise initialize for horizontal or vertical properties
|
5901 |
+
name === "width" ? 1 : 0,
|
5902 |
+
val = 0;
|
5903 |
+
for ( ; i < 4; i += 2 ) {
|
5904 |
+
// both box models exclude margin, so add it if we want it
|
5905 |
+
if ( extra === "margin" ) {
|
5906 |
+
val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
|
5907 |
+
}
|
5908 |
+
if ( isBorderBox ) {
|
5909 |
+
// border-box includes padding, so remove it if we want content
|
5910 |
+
if ( extra === "content" ) {
|
5911 |
+
val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
5912 |
+
}
|
5913 |
+
// at this point, extra isn't border nor margin, so remove border
|
5914 |
+
if ( extra !== "margin" ) {
|
5915 |
+
val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
5916 |
+
}
|
5917 |
+
} else {
|
5918 |
+
// at this point, extra isn't content, so add padding
|
5919 |
+
val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
|
5920 |
+
// at this point, extra isn't content nor padding, so add border
|
5921 |
+
if ( extra !== "padding" ) {
|
5922 |
+
val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
|
5923 |
+
}
|
5924 |
+
}
|
5925 |
+
}
|
5926 |
+
return val;
|
5927 |
+
}
|
5928 |
+
function getWidthOrHeight( elem, name, extra ) {
|
5929 |
+
// Start with offset property, which is equivalent to the border-box value
|
5930 |
+
var valueIsBorderBox = true,
|
5931 |
+
val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
|
5932 |
+
styles = getStyles( elem ),
|
5933 |
+
isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
|
5934 |
+
// some non-html elements return undefined for offsetWidth, so check for null/undefined
|
5935 |
+
// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
|
5936 |
+
// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
|
5937 |
+
if ( val <= 0 || val == null ) {
|
5938 |
+
// Fall back to computed then uncomputed css if necessary
|
5939 |
+
val = curCSS( elem, name, styles );
|
5940 |
+
if ( val < 0 || val == null ) {
|
5941 |
+
val = elem.style[ name ];
|
5942 |
+
}
|
5943 |
+
// Computed unit is not pixels. Stop here and return.
|
5944 |
+
if ( rnumnonpx.test(val) ) {
|
5945 |
+
return val;
|
5946 |
+
}
|
5947 |
+
// we need the check for style in case a browser which returns unreliable values
|
5948 |
+
// for getComputedStyle silently falls back to the reliable elem.style
|
5949 |
+
valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
|
5950 |
+
// Normalize "", auto, and prepare for extra
|
5951 |
+
val = parseFloat( val ) || 0;
|
5952 |
+
}
|
5953 |
+
// use the active box-sizing model to add/subtract irrelevant styles
|
5954 |
+
return ( val +
|
5955 |
+
augmentWidthOrHeight(
|
5956 |
+
elem,
|
5957 |
+
name,
|
5958 |
+
extra || ( isBorderBox ? "border" : "content" ),
|
5959 |
+
valueIsBorderBox,
|
5960 |
+
styles
|
5961 |
+
)
|
5962 |
+
) + "px";
|
5963 |
+
}
|
5964 |
+
// Try to determine the default display value of an element
|
5965 |
+
function css_defaultDisplay( nodeName ) {
|
5966 |
+
var doc = document,
|
5967 |
+
display = elemdisplay[ nodeName ];
|
5968 |
+
if ( !display ) {
|
5969 |
+
display = actualDisplay( nodeName, doc );
|
5970 |
+
// If the simple way fails, read from inside an iframe
|
5971 |
+
if ( display === "none" || !display ) {
|
5972 |
+
// Use the already-created iframe if possible
|
5973 |
+
iframe = ( iframe ||
|
5974 |
+
jQuery("<iframe frameborder='0' width='0' height='0'/>")
|
5975 |
+
.css( "cssText", "display:block !important" )
|
5976 |
+
).appendTo( doc.documentElement );
|
5977 |
+
// Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
|
5978 |
+
doc = ( iframe[0].contentWindow || iframe[0].contentDocument ).document;
|
5979 |
+
doc.write("<!doctype html><html><body>");
|
5980 |
+
doc.close();
|
5981 |
+
display = actualDisplay( nodeName, doc );
|
5982 |
+
iframe.detach();
|
5983 |
+
}
|
5984 |
+
// Store the correct default display
|
5985 |
+
elemdisplay[ nodeName ] = display;
|
5986 |
+
}
|
5987 |
+
return display;
|
5988 |
+
}
|
5989 |
+
// Called ONLY from within css_defaultDisplay
|
5990 |
+
function actualDisplay( name, doc ) {
|
5991 |
+
var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
|
5992 |
+
display = jQuery.css( elem[0], "display" );
|
5993 |
+
elem.remove();
|
5994 |
+
return display;
|
5995 |
+
}
|
5996 |
+
jQuery.each([ "height", "width" ], function( i, name ) {
|
5997 |
+
jQuery.cssHooks[ name ] = {
|
5998 |
+
get: function( elem, computed, extra ) {
|
5999 |
+
if ( computed ) {
|
6000 |
+
// certain elements can have dimension info if we invisibly show them
|
6001 |
+
// however, it must have a current display style that would benefit from this
|
6002 |
+
return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ?
|
6003 |
+
jQuery.swap( elem, cssShow, function() {
|
6004 |
+
return getWidthOrHeight( elem, name, extra );
|
6005 |
+
}) :
|
6006 |
+
getWidthOrHeight( elem, name, extra );
|
6007 |
+
}
|
6008 |
+
},
|
6009 |
+
set: function( elem, value, extra ) {
|
6010 |
+
var styles = extra && getStyles( elem );
|
6011 |
+
return setPositiveNumber( elem, value, extra ?
|
6012 |
+
augmentWidthOrHeight(
|
6013 |
+
elem,
|
6014 |
+
name,
|
6015 |
+
extra,
|
6016 |
+
jQuery.support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
|
6017 |
+
styles
|
6018 |
+
) : 0
|
6019 |
+
);
|
6020 |
+
}
|
6021 |
+
};
|
6022 |
+
});
|
6023 |
+
if ( !jQuery.support.opacity ) {
|
6024 |
+
jQuery.cssHooks.opacity = {
|
6025 |
+
get: function( elem, computed ) {
|
6026 |
+
// IE uses filters for opacity
|
6027 |
+
return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
|
6028 |
+
( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
|
6029 |
+
computed ? "1" : "";
|
6030 |
+
},
|
6031 |
+
set: function( elem, value ) {
|
6032 |
+
var style = elem.style,
|
6033 |
+
currentStyle = elem.currentStyle,
|
6034 |
+
opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
|
6035 |
+
filter = currentStyle && currentStyle.filter || style.filter || "";
|
6036 |
+
// IE has trouble with opacity if it does not have layout
|
6037 |
+
// Force it by setting the zoom level
|
6038 |
+
style.zoom = 1;
|
6039 |
+
// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
|
6040 |
+
// if value === "", then remove inline opacity #12685
|
6041 |
+
if ( ( value >= 1 || value === "" ) &&
|
6042 |
+
jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
|
6043 |
+
style.removeAttribute ) {
|
6044 |
+
// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
|
6045 |
+
// if "filter:" is present at all, clearType is disabled, we want to avoid this
|
6046 |
+
// style.removeAttribute is IE Only, but so apparently is this code path...
|
6047 |
+
style.removeAttribute( "filter" );
|
6048 |
+
// if there is no filter style applied in a css rule or unset inline opacity, we are done
|
6049 |
+
if ( value === "" || currentStyle && !currentStyle.filter ) {
|
6050 |
+
return;
|
6051 |
+
}
|
6052 |
+
}
|
6053 |
+
// otherwise, set new filter values
|
6054 |
+
style.filter = ralpha.test( filter ) ?
|
6055 |
+
filter.replace( ralpha, opacity ) :
|
6056 |
+
filter + " " + opacity;
|
6057 |
+
}
|
6058 |
+
};
|
6059 |
+
}
|
6060 |
+
// These hooks cannot be added until DOM ready because the support test
|
6061 |
+
// for it is not run until after DOM ready
|
6062 |
+
jQuery(function() {
|
6063 |
+
if ( !jQuery.support.reliableMarginRight ) {
|
6064 |
+
jQuery.cssHooks.marginRight = {
|
6065 |
+
get: function( elem, computed ) {
|
6066 |
+
if ( computed ) {
|
6067 |
+
// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
|
6068 |
+
// Work around by temporarily setting element display to inline-block
|
6069 |
+
return jQuery.swap( elem, { "display": "inline-block" },
|
6070 |
+
curCSS, [ elem, "marginRight" ] );
|
6071 |
+
}
|
6072 |
+
}
|
6073 |
+
};
|
6074 |
+
}
|
6075 |
+
// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
|
6076 |
+
// getComputedStyle returns percent when specified for top/left/bottom/right
|
6077 |
+
// rather than make the css module depend on the offset module, we just check for it here
|
6078 |
+
if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
|
6079 |
+
jQuery.each( [ "top", "left" ], function( i, prop ) {
|
6080 |
+
jQuery.cssHooks[ prop ] = {
|
6081 |
+
get: function( elem, computed ) {
|
6082 |
+
if ( computed ) {
|
6083 |
+
computed = curCSS( elem, prop );
|
6084 |
+
// if curCSS returns percentage, fallback to offset
|
6085 |
+
return rnumnonpx.test( computed ) ?
|
6086 |
+
jQuery( elem ).position()[ prop ] + "px" :
|
6087 |
+
computed;
|
6088 |
+
}
|
6089 |
+
}
|
6090 |
+
};
|
6091 |
+
});
|
6092 |
+
}
|
6093 |
+
});
|
6094 |
+
if ( jQuery.expr && jQuery.expr.filters ) {
|
6095 |
+
jQuery.expr.filters.hidden = function( elem ) {
|
6096 |
+
// Support: Opera <= 12.12
|
6097 |
+
// Opera reports offsetWidths and offsetHeights less than zero on some elements
|
6098 |
+
return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
|
6099 |
+
(!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
|
6100 |
+
};
|
6101 |
+
jQuery.expr.filters.visible = function( elem ) {
|
6102 |
+
return !jQuery.expr.filters.hidden( elem );
|
6103 |
+
};
|
6104 |
+
}
|
6105 |
+
// These hooks are used by animate to expand properties
|
6106 |
+
jQuery.each({
|
6107 |
+
margin: "",
|
6108 |
+
padding: "",
|
6109 |
+
border: "Width"
|
6110 |
+
}, function( prefix, suffix ) {
|
6111 |
+
jQuery.cssHooks[ prefix + suffix ] = {
|
6112 |
+
expand: function( value ) {
|
6113 |
+
var i = 0,
|
6114 |
+
expanded = {},
|
6115 |
+
// assumes a single number if not a string
|
6116 |
+
parts = typeof value === "string" ? value.split(" ") : [ value ];
|
6117 |
+
for ( ; i < 4; i++ ) {
|
6118 |
+
expanded[ prefix + cssExpand[ i ] + suffix ] =
|
6119 |
+
parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
|
6120 |
+
}
|
6121 |
+
return expanded;
|
6122 |
+
}
|
6123 |
+
};
|
6124 |
+
if ( !rmargin.test( prefix ) ) {
|
6125 |
+
jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
|
6126 |
+
}
|
6127 |
+
});
|
6128 |
+
var r20 = /%20/g,
|
6129 |
+
rbracket = /\[\]$/,
|
6130 |
+
rCRLF = /\r?\n/g,
|
6131 |
+
rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
|
6132 |
+
rsubmittable = /^(?:input|select|textarea|keygen)/i;
|
6133 |
+
jQuery.fn.extend({
|
6134 |
+
serialize: function() {
|
6135 |
+
return jQuery.param( this.serializeArray() );
|
6136 |
+
},
|
6137 |
+
serializeArray: function() {
|
6138 |
+
return this.map(function(){
|
6139 |
+
// Can add propHook for "elements" to filter or add form elements
|
6140 |
+
var elements = jQuery.prop( this, "elements" );
|
6141 |
+
return elements ? jQuery.makeArray( elements ) : this;
|
6142 |
+
})
|
6143 |
+
.filter(function(){
|
6144 |
+
var type = this.type;
|
6145 |
+
// Use .is(":disabled") so that fieldset[disabled] works
|
6146 |
+
return this.name && !jQuery( this ).is( ":disabled" ) &&
|
6147 |
+
rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
|
6148 |
+
( this.checked || !manipulation_rcheckableType.test( type ) );
|
6149 |
+
})
|
6150 |
+
.map(function( i, elem ){
|
6151 |
+
var val = jQuery( this ).val();
|
6152 |
+
return val == null ?
|
6153 |
+
null :
|
6154 |
+
jQuery.isArray( val ) ?
|
6155 |
+
jQuery.map( val, function( val ){
|
6156 |
+
return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
6157 |
+
}) :
|
6158 |
+
{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
|
6159 |
+
}).get();
|
6160 |
+
}
|
6161 |
+
});
|
6162 |
+
//Serialize an array of form elements or a set of
|
6163 |
+
//key/values into a query string
|
6164 |
+
jQuery.param = function( a, traditional ) {
|
6165 |
+
var prefix,
|
6166 |
+
s = [],
|
6167 |
+
add = function( key, value ) {
|
6168 |
+
// If value is a function, invoke it and return its value
|
6169 |
+
value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
|
6170 |
+
s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
|
6171 |
+
};
|
6172 |
+
// Set traditional to true for jQuery <= 1.3.2 behavior.
|
6173 |
+
if ( traditional === undefined ) {
|
6174 |
+
traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
|
6175 |
+
}
|
6176 |
+
// If an array was passed in, assume that it is an array of form elements.
|
6177 |
+
if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
|
6178 |
+
// Serialize the form elements
|
6179 |
+
jQuery.each( a, function() {
|
6180 |
+
add( this.name, this.value );
|
6181 |
+
});
|
6182 |
+
} else {
|
6183 |
+
// If traditional, encode the "old" way (the way 1.3.2 or older
|
6184 |
+
// did it), otherwise encode params recursively.
|
6185 |
+
for ( prefix in a ) {
|
6186 |
+
buildParams( prefix, a[ prefix ], traditional, add );
|
6187 |
+
}
|
6188 |
+
}
|
6189 |
+
// Return the resulting serialization
|
6190 |
+
return s.join( "&" ).replace( r20, "+" );
|
6191 |
+
};
|
6192 |
+
function buildParams( prefix, obj, traditional, add ) {
|
6193 |
+
var name;
|
6194 |
+
if ( jQuery.isArray( obj ) ) {
|
6195 |
+
// Serialize array item.
|
6196 |
+
jQuery.each( obj, function( i, v ) {
|
6197 |
+
if ( traditional || rbracket.test( prefix ) ) {
|
6198 |
+
// Treat each array item as a scalar.
|
6199 |
+
add( prefix, v );
|
6200 |
+
} else {
|
6201 |
+
// Item is non-scalar (array or object), encode its numeric index.
|
6202 |
+
buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
|
6203 |
+
}
|
6204 |
+
});
|
6205 |
+
} else if ( !traditional && jQuery.type( obj ) === "object" ) {
|
6206 |
+
// Serialize object item.
|
6207 |
+
for ( name in obj ) {
|
6208 |
+
buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
|
6209 |
+
}
|
6210 |
+
} else {
|
6211 |
+
// Serialize scalar item.
|
6212 |
+
add( prefix, obj );
|
6213 |
+
}
|
6214 |
+
}
|
6215 |
+
jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
|
6216 |
+
"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
|
6217 |
+
"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
|
6218 |
+
// Handle event binding
|
6219 |
+
jQuery.fn[ name ] = function( data, fn ) {
|
6220 |
+
return arguments.length > 0 ?
|
6221 |
+
this.on( name, null, data, fn ) :
|
6222 |
+
this.trigger( name );
|
6223 |
+
};
|
6224 |
+
});
|
6225 |
+
jQuery.fn.hover = function( fnOver, fnOut ) {
|
6226 |
+
return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
|
6227 |
+
};
|
6228 |
+
var
|
6229 |
+
// Document location
|
6230 |
+
ajaxLocParts,
|
6231 |
+
ajaxLocation,
|
6232 |
+
ajax_nonce = jQuery.now(),
|
6233 |
+
ajax_rquery = /\?/,
|
6234 |
+
rhash = /#.*$/,
|
6235 |
+
rts = /([?&])_=[^&]*/,
|
6236 |
+
rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
|
6237 |
+
// #7653, #8125, #8152: local protocol detection
|
6238 |
+
rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
|
6239 |
+
rnoContent = /^(?:GET|HEAD)$/,
|
6240 |
+
rprotocol = /^\/\//,
|
6241 |
+
rurl = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
|
6242 |
+
// Keep a copy of the old load method
|
6243 |
+
_load = jQuery.fn.load,
|
6244 |
+
/* Prefilters
|
6245 |
+
* 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
|
6246 |
+
* 2) These are called:
|
6247 |
+
* - BEFORE asking for a transport
|
6248 |
+
* - AFTER param serialization (s.data is a string if s.processData is true)
|
6249 |
+
* 3) key is the dataType
|
6250 |
+
* 4) the catchall symbol "*" can be used
|
6251 |
+
* 5) execution will start with transport dataType and THEN continue down to "*" if needed
|
6252 |
+
*/
|
6253 |
+
prefilters = {},
|
6254 |
+
/* Transports bindings
|
6255 |
+
* 1) key is the dataType
|
6256 |
+
* 2) the catchall symbol "*" can be used
|
6257 |
+
* 3) selection will start with transport dataType and THEN go to "*" if needed
|
6258 |
+
*/
|
6259 |
+
transports = {},
|
6260 |
+
// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
|
6261 |
+
allTypes = "*/".concat("*");
|
6262 |
+
// #8138, IE may throw an exception when accessing
|
6263 |
+
// a field from window.location if document.domain has been set
|
6264 |
+
try {
|
6265 |
+
ajaxLocation = location.href;
|
6266 |
+
} catch( e ) {
|
6267 |
+
// Use the href attribute of an A element
|
6268 |
+
// since IE will modify it given document.location
|
6269 |
+
ajaxLocation = document.createElement( "a" );
|
6270 |
+
ajaxLocation.href = "";
|
6271 |
+
ajaxLocation = ajaxLocation.href;
|
6272 |
+
}
|
6273 |
+
// Segment location into parts
|
6274 |
+
ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
|
6275 |
+
// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
|
6276 |
+
function addToPrefiltersOrTransports( structure ) {
|
6277 |
+
// dataTypeExpression is optional and defaults to "*"
|
6278 |
+
return function( dataTypeExpression, func ) {
|
6279 |
+
if ( typeof dataTypeExpression !== "string" ) {
|
6280 |
+
func = dataTypeExpression;
|
6281 |
+
dataTypeExpression = "*";
|
6282 |
+
}
|
6283 |
+
var dataType,
|
6284 |
+
i = 0,
|
6285 |
+
dataTypes = dataTypeExpression.toLowerCase().match( core_rnotwhite ) || [];
|
6286 |
+
if ( jQuery.isFunction( func ) ) {
|
6287 |
+
// For each dataType in the dataTypeExpression
|
6288 |
+
while ( (dataType = dataTypes[i++]) ) {
|
6289 |
+
// Prepend if requested
|
6290 |
+
if ( dataType[0] === "+" ) {
|
6291 |
+
dataType = dataType.slice( 1 ) || "*";
|
6292 |
+
(structure[ dataType ] = structure[ dataType ] || []).unshift( func );
|
6293 |
+
// Otherwise append
|
6294 |
+
} else {
|
6295 |
+
(structure[ dataType ] = structure[ dataType ] || []).push( func );
|
6296 |
+
}
|
6297 |
+
}
|
6298 |
+
}
|
6299 |
+
};
|
6300 |
+
}
|
6301 |
+
// Base inspection function for prefilters and transports
|
6302 |
+
function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
|
6303 |
+
var inspected = {},
|
6304 |
+
seekingTransport = ( structure === transports );
|
6305 |
+
function inspect( dataType ) {
|
6306 |
+
var selected;
|
6307 |
+
inspected[ dataType ] = true;
|
6308 |
+
jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
|
6309 |
+
var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
|
6310 |
+
if( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
|
6311 |
+
options.dataTypes.unshift( dataTypeOrTransport );
|
6312 |
+
inspect( dataTypeOrTransport );
|
6313 |
+
return false;
|
6314 |
+
} else if ( seekingTransport ) {
|
6315 |
+
return !( selected = dataTypeOrTransport );
|
6316 |
+
}
|
6317 |
+
});
|
6318 |
+
return selected;
|
6319 |
+
}
|
6320 |
+
return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
|
6321 |
+
}
|
6322 |
+
// A special extend for ajax options
|
6323 |
+
// that takes "flat" options (not to be deep extended)
|
6324 |
+
// Fixes #9887
|
6325 |
+
function ajaxExtend( target, src ) {
|
6326 |
+
var deep, key,
|
6327 |
+
flatOptions = jQuery.ajaxSettings.flatOptions || {};
|
6328 |
+
for ( key in src ) {
|
6329 |
+
if ( src[ key ] !== undefined ) {
|
6330 |
+
( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
|
6331 |
+
}
|
6332 |
+
}
|
6333 |
+
if ( deep ) {
|
6334 |
+
jQuery.extend( true, target, deep );
|
6335 |
+
}
|
6336 |
+
return target;
|
6337 |
+
}
|
6338 |
+
jQuery.fn.load = function( url, params, callback ) {
|
6339 |
+
if ( typeof url !== "string" && _load ) {
|
6340 |
+
return _load.apply( this, arguments );
|
6341 |
+
}
|
6342 |
+
var selector, response, type,
|
6343 |
+
self = this,
|
6344 |
+
off = url.indexOf(" ");
|
6345 |
+
if ( off >= 0 ) {
|
6346 |
+
selector = url.slice( off, url.length );
|
6347 |
+
url = url.slice( 0, off );
|
6348 |
+
}
|
6349 |
+
// If it's a function
|
6350 |
+
if ( jQuery.isFunction( params ) ) {
|
6351 |
+
// We assume that it's the callback
|
6352 |
+
callback = params;
|
6353 |
+
params = undefined;
|
6354 |
+
// Otherwise, build a param string
|
6355 |
+
} else if ( params && typeof params === "object" ) {
|
6356 |
+
type = "POST";
|
6357 |
+
}
|
6358 |
+
// If we have elements to modify, make the request
|
6359 |
+
if ( self.length > 0 ) {
|
6360 |
+
jQuery.ajax({
|
6361 |
+
url: url,
|
6362 |
+
// if "type" variable is undefined, then "GET" method will be used
|
6363 |
+
type: type,
|
6364 |
+
dataType: "html",
|
6365 |
+
data: params
|
6366 |
+
}).done(function( responseText ) {
|
6367 |
+
// Save response for use in complete callback
|
6368 |
+
response = arguments;
|
6369 |
+
self.html( selector ?
|
6370 |
+
// If a selector was specified, locate the right elements in a dummy div
|
6371 |
+
// Exclude scripts to avoid IE 'Permission Denied' errors
|
6372 |
+
jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
|
6373 |
+
// Otherwise use the full result
|
6374 |
+
responseText );
|
6375 |
+
}).complete( callback && function( jqXHR, status ) {
|
6376 |
+
self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
|
6377 |
+
});
|
6378 |
+
}
|
6379 |
+
return this;
|
6380 |
+
};
|
6381 |
+
// Attach a bunch of functions for handling common AJAX events
|
6382 |
+
jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ){
|
6383 |
+
jQuery.fn[ type ] = function( fn ){
|
6384 |
+
return this.on( type, fn );
|
6385 |
+
};
|
6386 |
+
});
|
6387 |
+
jQuery.each( [ "get", "post" ], function( i, method ) {
|
6388 |
+
jQuery[ method ] = function( url, data, callback, type ) {
|
6389 |
+
// shift arguments if data argument was omitted
|
6390 |
+
if ( jQuery.isFunction( data ) ) {
|
6391 |
+
type = type || callback;
|
6392 |
+
callback = data;
|
6393 |
+
data = undefined;
|
6394 |
+
}
|
6395 |
+
return jQuery.ajax({
|
6396 |
+
url: url,
|
6397 |
+
type: method,
|
6398 |
+
dataType: type,
|
6399 |
+
data: data,
|
6400 |
+
success: callback
|
6401 |
+
});
|
6402 |
+
};
|
6403 |
+
});
|
6404 |
+
jQuery.extend({
|
6405 |
+
// Counter for holding the number of active queries
|
6406 |
+
active: 0,
|
6407 |
+
// Last-Modified header cache for next request
|
6408 |
+
lastModified: {},
|
6409 |
+
etag: {},
|
6410 |
+
ajaxSettings: {
|
6411 |
+
url: ajaxLocation,
|
6412 |
+
type: "GET",
|
6413 |
+
isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
|
6414 |
+
global: true,
|
6415 |
+
processData: true,
|
6416 |
+
async: true,
|
6417 |
+
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
|
6418 |
+
/*
|
6419 |
+
timeout: 0,
|
6420 |
+
data: null,
|
6421 |
+
dataType: null,
|
6422 |
+
username: null,
|
6423 |
+
password: null,
|
6424 |
+
cache: null,
|
6425 |
+
throws: false,
|
6426 |
+
traditional: false,
|
6427 |
+
headers: {},
|
6428 |
+
*/
|
6429 |
+
accepts: {
|
6430 |
+
"*": allTypes,
|
6431 |
+
text: "text/plain",
|
6432 |
+
html: "text/html",
|
6433 |
+
xml: "application/xml, text/xml",
|
6434 |
+
json: "application/json, text/javascript"
|
6435 |
+
},
|
6436 |
+
contents: {
|
6437 |
+
xml: /xml/,
|
6438 |
+
html: /html/,
|
6439 |
+
json: /json/
|
6440 |
+
},
|
6441 |
+
responseFields: {
|
6442 |
+
xml: "responseXML",
|
6443 |
+
text: "responseText"
|
6444 |
+
},
|
6445 |
+
// Data converters
|
6446 |
+
// Keys separate source (or catchall "*") and destination types with a single space
|
6447 |
+
converters: {
|
6448 |
+
// Convert anything to text
|
6449 |
+
"* text": window.String,
|
6450 |
+
// Text to html (true = no transformation)
|
6451 |
+
"text html": true,
|
6452 |
+
// Evaluate text as a json expression
|
6453 |
+
"text json": jQuery.parseJSON,
|
6454 |
+
// Parse text as xml
|
6455 |
+
"text xml": jQuery.parseXML
|
6456 |
+
},
|
6457 |
+
// For options that shouldn't be deep extended:
|
6458 |
+
// you can add your own custom options here if
|
6459 |
+
// and when you create one that shouldn't be
|
6460 |
+
// deep extended (see ajaxExtend)
|
6461 |
+
flatOptions: {
|
6462 |
+
url: true,
|
6463 |
+
context: true
|
6464 |
+
}
|
6465 |
+
},
|
6466 |
+
// Creates a full fledged settings object into target
|
6467 |
+
// with both ajaxSettings and settings fields.
|
6468 |
+
// If target is omitted, writes into ajaxSettings.
|
6469 |
+
ajaxSetup: function( target, settings ) {
|
6470 |
+
return settings ?
|
6471 |
+
// Building a settings object
|
6472 |
+
ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
|
6473 |
+
// Extending ajaxSettings
|
6474 |
+
ajaxExtend( jQuery.ajaxSettings, target );
|
6475 |
+
},
|
6476 |
+
ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
|
6477 |
+
ajaxTransport: addToPrefiltersOrTransports( transports ),
|
6478 |
+
// Main method
|
6479 |
+
ajax: function( url, options ) {
|
6480 |
+
// If url is an object, simulate pre-1.5 signature
|
6481 |
+
if ( typeof url === "object" ) {
|
6482 |
+
options = url;
|
6483 |
+
url = undefined;
|
6484 |
+
}
|
6485 |
+
// Force options to be an object
|
6486 |
+
options = options || {};
|
6487 |
+
var // Cross-domain detection vars
|
6488 |
+
parts,
|
6489 |
+
// Loop variable
|
6490 |
+
i,
|
6491 |
+
// URL without anti-cache param
|
6492 |
+
cacheURL,
|
6493 |
+
// Response headers as string
|
6494 |
+
responseHeadersString,
|
6495 |
+
// timeout handle
|
6496 |
+
timeoutTimer,
|
6497 |
+
// To know if global events are to be dispatched
|
6498 |
+
fireGlobals,
|
6499 |
+
transport,
|
6500 |
+
// Response headers
|
6501 |
+
responseHeaders,
|
6502 |
+
// Create the final options object
|
6503 |
+
s = jQuery.ajaxSetup( {}, options ),
|
6504 |
+
// Callbacks context
|
6505 |
+
callbackContext = s.context || s,
|
6506 |
+
// Context for global events is callbackContext if it is a DOM node or jQuery collection
|
6507 |
+
globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
|
6508 |
+
jQuery( callbackContext ) :
|
6509 |
+
jQuery.event,
|
6510 |
+
// Deferreds
|
6511 |
+
deferred = jQuery.Deferred(),
|
6512 |
+
completeDeferred = jQuery.Callbacks("once memory"),
|
6513 |
+
// Status-dependent callbacks
|
6514 |
+
statusCode = s.statusCode || {},
|
6515 |
+
// Headers (they are sent all at once)
|
6516 |
+
requestHeaders = {},
|
6517 |
+
requestHeadersNames = {},
|
6518 |
+
// The jqXHR state
|
6519 |
+
state = 0,
|
6520 |
+
// Default abort message
|
6521 |
+
strAbort = "canceled",
|
6522 |
+
// Fake xhr
|
6523 |
+
jqXHR = {
|
6524 |
+
readyState: 0,
|
6525 |
+
// Builds headers hashtable if needed
|
6526 |
+
getResponseHeader: function( key ) {
|
6527 |
+
var match;
|
6528 |
+
if ( state === 2 ) {
|
6529 |
+
if ( !responseHeaders ) {
|
6530 |
+
responseHeaders = {};
|
6531 |
+
while ( (match = rheaders.exec( responseHeadersString )) ) {
|
6532 |
+
responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
|
6533 |
+
}
|
6534 |
+
}
|
6535 |
+
match = responseHeaders[ key.toLowerCase() ];
|
6536 |
+
}
|
6537 |
+
return match == null ? null : match;
|
6538 |
+
},
|
6539 |
+
// Raw string
|
6540 |
+
getAllResponseHeaders: function() {
|
6541 |
+
return state === 2 ? responseHeadersString : null;
|
6542 |
+
},
|
6543 |
+
// Caches the header
|
6544 |
+
setRequestHeader: function( name, value ) {
|
6545 |
+
var lname = name.toLowerCase();
|
6546 |
+
if ( !state ) {
|
6547 |
+
name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
|
6548 |
+
requestHeaders[ name ] = value;
|
6549 |
+
}
|
6550 |
+
return this;
|
6551 |
+
},
|
6552 |
+
// Overrides response content-type header
|
6553 |
+
overrideMimeType: function( type ) {
|
6554 |
+
if ( !state ) {
|
6555 |
+
s.mimeType = type;
|
6556 |
+
}
|
6557 |
+
return this;
|
6558 |
+
},
|
6559 |
+
// Status-dependent callbacks
|
6560 |
+
statusCode: function( map ) {
|
6561 |
+
var code;
|
6562 |
+
if ( map ) {
|
6563 |
+
if ( state < 2 ) {
|
6564 |
+
for ( code in map ) {
|
6565 |
+
// Lazy-add the new callback in a way that preserves old ones
|
6566 |
+
statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
|
6567 |
+
}
|
6568 |
+
} else {
|
6569 |
+
// Execute the appropriate callbacks
|
6570 |
+
jqXHR.always( map[ jqXHR.status ] );
|
6571 |
+
}
|
6572 |
+
}
|
6573 |
+
return this;
|
6574 |
+
},
|
6575 |
+
// Cancel the request
|
6576 |
+
abort: function( statusText ) {
|
6577 |
+
var finalText = statusText || strAbort;
|
6578 |
+
if ( transport ) {
|
6579 |
+
transport.abort( finalText );
|
6580 |
+
}
|
6581 |
+
done( 0, finalText );
|
6582 |
+
return this;
|
6583 |
+
}
|
6584 |
+
};
|
6585 |
+
// Attach deferreds
|
6586 |
+
deferred.promise( jqXHR ).complete = completeDeferred.add;
|
6587 |
+
jqXHR.success = jqXHR.done;
|
6588 |
+
jqXHR.error = jqXHR.fail;
|
6589 |
+
// Remove hash character (#7531: and string promotion)
|
6590 |
+
// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
|
6591 |
+
// Handle falsy url in the settings object (#10093: consistency with old signature)
|
6592 |
+
// We also use the url parameter if available
|
6593 |
+
s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
|
6594 |
+
// Alias method option to type as per ticket #12004
|
6595 |
+
s.type = options.method || options.type || s.method || s.type;
|
6596 |
+
// Extract dataTypes list
|
6597 |
+
s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( core_rnotwhite ) || [""];
|
6598 |
+
// A cross-domain request is in order when we have a protocol:host:port mismatch
|
6599 |
+
if ( s.crossDomain == null ) {
|
6600 |
+
parts = rurl.exec( s.url.toLowerCase() );
|
6601 |
+
s.crossDomain = !!( parts &&
|
6602 |
+
( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
|
6603 |
+
( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
|
6604 |
+
( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
|
6605 |
+
);
|
6606 |
+
}
|
6607 |
+
// Convert data if not already a string
|
6608 |
+
if ( s.data && s.processData && typeof s.data !== "string" ) {
|
6609 |
+
s.data = jQuery.param( s.data, s.traditional );
|
6610 |
+
}
|
6611 |
+
// Apply prefilters
|
6612 |
+
inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
|
6613 |
+
// If request was aborted inside a prefilter, stop there
|
6614 |
+
if ( state === 2 ) {
|
6615 |
+
return jqXHR;
|
6616 |
+
}
|
6617 |
+
// We can fire global events as of now if asked to
|
6618 |
+
fireGlobals = s.global;
|
6619 |
+
// Watch for a new set of requests
|
6620 |
+
if ( fireGlobals && jQuery.active++ === 0 ) {
|
6621 |
+
jQuery.event.trigger("ajaxStart");
|
6622 |
+
}
|
6623 |
+
// Uppercase the type
|
6624 |
+
s.type = s.type.toUpperCase();
|
6625 |
+
// Determine if request has content
|
6626 |
+
s.hasContent = !rnoContent.test( s.type );
|
6627 |
+
// Save the URL in case we're toying with the If-Modified-Since
|
6628 |
+
// and/or If-None-Match header later on
|
6629 |
+
cacheURL = s.url;
|
6630 |
+
// More options handling for requests with no content
|
6631 |
+
if ( !s.hasContent ) {
|
6632 |
+
// If data is available, append data to url
|
6633 |
+
if ( s.data ) {
|
6634 |
+
cacheURL = ( s.url += ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
|
6635 |
+
// #9682: remove data so that it's not used in an eventual retry
|
6636 |
+
delete s.data;
|
6637 |
+
}
|
6638 |
+
// Add anti-cache in url if needed
|
6639 |
+
if ( s.cache === false ) {
|
6640 |
+
s.url = rts.test( cacheURL ) ?
|
6641 |
+
// If there is already a '_' parameter, set its value
|
6642 |
+
cacheURL.replace( rts, "$1_=" + ajax_nonce++ ) :
|
6643 |
+
// Otherwise add one to the end
|
6644 |
+
cacheURL + ( ajax_rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ajax_nonce++;
|
6645 |
+
}
|
6646 |
+
}
|
6647 |
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
6648 |
+
if ( s.ifModified ) {
|
6649 |
+
if ( jQuery.lastModified[ cacheURL ] ) {
|
6650 |
+
jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
|
6651 |
+
}
|
6652 |
+
if ( jQuery.etag[ cacheURL ] ) {
|
6653 |
+
jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
|
6654 |
+
}
|
6655 |
+
}
|
6656 |
+
// Set the correct header, if data is being sent
|
6657 |
+
if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
|
6658 |
+
jqXHR.setRequestHeader( "Content-Type", s.contentType );
|
6659 |
+
}
|
6660 |
+
// Set the Accepts header for the server, depending on the dataType
|
6661 |
+
jqXHR.setRequestHeader(
|
6662 |
+
"Accept",
|
6663 |
+
s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
|
6664 |
+
s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
|
6665 |
+
s.accepts[ "*" ]
|
6666 |
+
);
|
6667 |
+
// Check for headers option
|
6668 |
+
for ( i in s.headers ) {
|
6669 |
+
jqXHR.setRequestHeader( i, s.headers[ i ] );
|
6670 |
+
}
|
6671 |
+
// Allow custom headers/mimetypes and early abort
|
6672 |
+
if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
|
6673 |
+
// Abort if not done already and return
|
6674 |
+
return jqXHR.abort();
|
6675 |
+
}
|
6676 |
+
// aborting is no longer a cancellation
|
6677 |
+
strAbort = "abort";
|
6678 |
+
// Install callbacks on deferreds
|
6679 |
+
for ( i in { success: 1, error: 1, complete: 1 } ) {
|
6680 |
+
jqXHR[ i ]( s[ i ] );
|
6681 |
+
}
|
6682 |
+
// Get transport
|
6683 |
+
transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
|
6684 |
+
// If no transport, we auto-abort
|
6685 |
+
if ( !transport ) {
|
6686 |
+
done( -1, "No Transport" );
|
6687 |
+
} else {
|
6688 |
+
jqXHR.readyState = 1;
|
6689 |
+
// Send global event
|
6690 |
+
if ( fireGlobals ) {
|
6691 |
+
globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
|
6692 |
+
}
|
6693 |
+
// Timeout
|
6694 |
+
if ( s.async && s.timeout > 0 ) {
|
6695 |
+
timeoutTimer = setTimeout(function() {
|
6696 |
+
jqXHR.abort("timeout");
|
6697 |
+
}, s.timeout );
|
6698 |
+
}
|
6699 |
+
try {
|
6700 |
+
state = 1;
|
6701 |
+
transport.send( requestHeaders, done );
|
6702 |
+
} catch ( e ) {
|
6703 |
+
// Propagate exception as error if not done
|
6704 |
+
if ( state < 2 ) {
|
6705 |
+
done( -1, e );
|
6706 |
+
// Simply rethrow otherwise
|
6707 |
+
} else {
|
6708 |
+
throw e;
|
6709 |
+
}
|
6710 |
+
}
|
6711 |
+
}
|
6712 |
+
// Callback for when everything is done
|
6713 |
+
function done( status, nativeStatusText, responses, headers ) {
|
6714 |
+
var isSuccess, success, error, response, modified,
|
6715 |
+
statusText = nativeStatusText;
|
6716 |
+
// Called once
|
6717 |
+
if ( state === 2 ) {
|
6718 |
+
return;
|
6719 |
+
}
|
6720 |
+
// State is "done" now
|
6721 |
+
state = 2;
|
6722 |
+
// Clear timeout if it exists
|
6723 |
+
if ( timeoutTimer ) {
|
6724 |
+
clearTimeout( timeoutTimer );
|
6725 |
+
}
|
6726 |
+
// Dereference transport for early garbage collection
|
6727 |
+
// (no matter how long the jqXHR object will be used)
|
6728 |
+
transport = undefined;
|
6729 |
+
// Cache response headers
|
6730 |
+
responseHeadersString = headers || "";
|
6731 |
+
// Set readyState
|
6732 |
+
jqXHR.readyState = status > 0 ? 4 : 0;
|
6733 |
+
// Get response data
|
6734 |
+
if ( responses ) {
|
6735 |
+
response = ajaxHandleResponses( s, jqXHR, responses );
|
6736 |
+
}
|
6737 |
+
// If successful, handle type chaining
|
6738 |
+
if ( status >= 200 && status < 300 || status === 304 ) {
|
6739 |
+
// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
|
6740 |
+
if ( s.ifModified ) {
|
6741 |
+
modified = jqXHR.getResponseHeader("Last-Modified");
|
6742 |
+
if ( modified ) {
|
6743 |
+
jQuery.lastModified[ cacheURL ] = modified;
|
6744 |
+
}
|
6745 |
+
modified = jqXHR.getResponseHeader("etag");
|
6746 |
+
if ( modified ) {
|
6747 |
+
jQuery.etag[ cacheURL ] = modified;
|
6748 |
+
}
|
6749 |
+
}
|
6750 |
+
// if no content
|
6751 |
+
if ( status === 204 ) {
|
6752 |
+
isSuccess = true;
|
6753 |
+
statusText = "nocontent";
|
6754 |
+
// if not modified
|
6755 |
+
} else if ( status === 304 ) {
|
6756 |
+
isSuccess = true;
|
6757 |
+
statusText = "notmodified";
|
6758 |
+
// If we have data, let's convert it
|
6759 |
+
} else {
|
6760 |
+
isSuccess = ajaxConvert( s, response );
|
6761 |
+
statusText = isSuccess.state;
|
6762 |
+
success = isSuccess.data;
|
6763 |
+
error = isSuccess.error;
|
6764 |
+
isSuccess = !error;
|
6765 |
+
}
|
6766 |
+
} else {
|
6767 |
+
// We extract error from statusText
|
6768 |
+
// then normalize statusText and status for non-aborts
|
6769 |
+
error = statusText;
|
6770 |
+
if ( status || !statusText ) {
|
6771 |
+
statusText = "error";
|
6772 |
+
if ( status < 0 ) {
|
6773 |
+
status = 0;
|
6774 |
+
}
|
6775 |
+
}
|
6776 |
+
}
|
6777 |
+
// Set data for the fake xhr object
|
6778 |
+
jqXHR.status = status;
|
6779 |
+
jqXHR.statusText = ( nativeStatusText || statusText ) + "";
|
6780 |
+
// Success/Error
|
6781 |
+
if ( isSuccess ) {
|
6782 |
+
deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
|
6783 |
+
} else {
|
6784 |
+
deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
|
6785 |
+
}
|
6786 |
+
// Status-dependent callbacks
|
6787 |
+
jqXHR.statusCode( statusCode );
|
6788 |
+
statusCode = undefined;
|
6789 |
+
if ( fireGlobals ) {
|
6790 |
+
globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
|
6791 |
+
[ jqXHR, s, isSuccess ? success : error ] );
|
6792 |
+
}
|
6793 |
+
// Complete
|
6794 |
+
completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
|
6795 |
+
if ( fireGlobals ) {
|
6796 |
+
globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
|
6797 |
+
// Handle the global AJAX counter
|
6798 |
+
if ( !( --jQuery.active ) ) {
|
6799 |
+
jQuery.event.trigger("ajaxStop");
|
6800 |
+
}
|
6801 |
+
}
|
6802 |
+
}
|
6803 |
+
return jqXHR;
|
6804 |
+
},
|
6805 |
+
getScript: function( url, callback ) {
|
6806 |
+
return jQuery.get( url, undefined, callback, "script" );
|
6807 |
+
},
|
6808 |
+
getJSON: function( url, data, callback ) {
|
6809 |
+
return jQuery.get( url, data, callback, "json" );
|
6810 |
+
}
|
6811 |
+
});
|
6812 |
+
/* Handles responses to an ajax request:
|
6813 |
+
* - sets all responseXXX fields accordingly
|
6814 |
+
* - finds the right dataType (mediates between content-type and expected dataType)
|
6815 |
+
* - returns the corresponding response
|
6816 |
+
*/
|
6817 |
+
function ajaxHandleResponses( s, jqXHR, responses ) {
|
6818 |
+
var firstDataType, ct, finalDataType, type,
|
6819 |
+
contents = s.contents,
|
6820 |
+
dataTypes = s.dataTypes,
|
6821 |
+
responseFields = s.responseFields;
|
6822 |
+
// Fill responseXXX fields
|
6823 |
+
for ( type in responseFields ) {
|
6824 |
+
if ( type in responses ) {
|
6825 |
+
jqXHR[ responseFields[type] ] = responses[ type ];
|
6826 |
+
}
|
6827 |
+
}
|
6828 |
+
// Remove auto dataType and get content-type in the process
|
6829 |
+
while( dataTypes[ 0 ] === "*" ) {
|
6830 |
+
dataTypes.shift();
|
6831 |
+
if ( ct === undefined ) {
|
6832 |
+
ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
|
6833 |
+
}
|
6834 |
+
}
|
6835 |
+
// Check if we're dealing with a known content-type
|
6836 |
+
if ( ct ) {
|
6837 |
+
for ( type in contents ) {
|
6838 |
+
if ( contents[ type ] && contents[ type ].test( ct ) ) {
|
6839 |
+
dataTypes.unshift( type );
|
6840 |
+
break;
|
6841 |
+
}
|
6842 |
+
}
|
6843 |
+
}
|
6844 |
+
// Check to see if we have a response for the expected dataType
|
6845 |
+
if ( dataTypes[ 0 ] in responses ) {
|
6846 |
+
finalDataType = dataTypes[ 0 ];
|
6847 |
+
} else {
|
6848 |
+
// Try convertible dataTypes
|
6849 |
+
for ( type in responses ) {
|
6850 |
+
if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
|
6851 |
+
finalDataType = type;
|
6852 |
+
break;
|
6853 |
+
}
|
6854 |
+
if ( !firstDataType ) {
|
6855 |
+
firstDataType = type;
|
6856 |
+
}
|
6857 |
+
}
|
6858 |
+
// Or just use first one
|
6859 |
+
finalDataType = finalDataType || firstDataType;
|
6860 |
+
}
|
6861 |
+
// If we found a dataType
|
6862 |
+
// We add the dataType to the list if needed
|
6863 |
+
// and return the corresponding response
|
6864 |
+
if ( finalDataType ) {
|
6865 |
+
if ( finalDataType !== dataTypes[ 0 ] ) {
|
6866 |
+
dataTypes.unshift( finalDataType );
|
6867 |
+
}
|
6868 |
+
return responses[ finalDataType ];
|
6869 |
+
}
|
6870 |
+
}
|
6871 |
+
// Chain conversions given the request and the original response
|
6872 |
+
function ajaxConvert( s, response ) {
|
6873 |
+
var conv2, current, conv, tmp,
|
6874 |
+
converters = {},
|
6875 |
+
i = 0,
|
6876 |
+
// Work with a copy of dataTypes in case we need to modify it for conversion
|
6877 |
+
dataTypes = s.dataTypes.slice(),
|
6878 |
+
prev = dataTypes[ 0 ];
|
6879 |
+
// Apply the dataFilter if provided
|
6880 |
+
if ( s.dataFilter ) {
|
6881 |
+
response = s.dataFilter( response, s.dataType );
|
6882 |
+
}
|
6883 |
+
// Create converters map with lowercased keys
|
6884 |
+
if ( dataTypes[ 1 ] ) {
|
6885 |
+
for ( conv in s.converters ) {
|
6886 |
+
converters[ conv.toLowerCase() ] = s.converters[ conv ];
|
6887 |
+
}
|
6888 |
+
}
|
6889 |
+
// Convert to each sequential dataType, tolerating list modification
|
6890 |
+
for ( ; (current = dataTypes[++i]); ) {
|
6891 |
+
// There's only work to do if current dataType is non-auto
|
6892 |
+
if ( current !== "*" ) {
|
6893 |
+
// Convert response if prev dataType is non-auto and differs from current
|
6894 |
+
if ( prev !== "*" && prev !== current ) {
|
6895 |
+
// Seek a direct converter
|
6896 |
+
conv = converters[ prev + " " + current ] || converters[ "* " + current ];
|
6897 |
+
// If none found, seek a pair
|
6898 |
+
if ( !conv ) {
|
6899 |
+
for ( conv2 in converters ) {
|
6900 |
+
// If conv2 outputs current
|
6901 |
+
tmp = conv2.split(" ");
|
6902 |
+
if ( tmp[ 1 ] === current ) {
|
6903 |
+
// If prev can be converted to accepted input
|
6904 |
+
conv = converters[ prev + " " + tmp[ 0 ] ] ||
|
6905 |
+
converters[ "* " + tmp[ 0 ] ];
|
6906 |
+
if ( conv ) {
|
6907 |
+
// Condense equivalence converters
|
6908 |
+
if ( conv === true ) {
|
6909 |
+
conv = converters[ conv2 ];
|
6910 |
+
// Otherwise, insert the intermediate dataType
|
6911 |
+
} else if ( converters[ conv2 ] !== true ) {
|
6912 |
+
current = tmp[ 0 ];
|
6913 |
+
dataTypes.splice( i--, 0, current );
|
6914 |
+
}
|
6915 |
+
break;
|
6916 |
+
}
|
6917 |
+
}
|
6918 |
+
}
|
6919 |
+
}
|
6920 |
+
// Apply converter (if not an equivalence)
|
6921 |
+
if ( conv !== true ) {
|
6922 |
+
// Unless errors are allowed to bubble, catch and return them
|
6923 |
+
if ( conv && s["throws"] ) {
|
6924 |
+
response = conv( response );
|
6925 |
+
} else {
|
6926 |
+
try {
|
6927 |
+
response = conv( response );
|
6928 |
+
} catch ( e ) {
|
6929 |
+
return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
|
6930 |
+
}
|
6931 |
+
}
|
6932 |
+
}
|
6933 |
+
}
|
6934 |
+
// Update prev for next iteration
|
6935 |
+
prev = current;
|
6936 |
+
}
|
6937 |
+
}
|
6938 |
+
return { state: "success", data: response };
|
6939 |
+
}
|
6940 |
+
// Install script dataType
|
6941 |
+
jQuery.ajaxSetup({
|
6942 |
+
accepts: {
|
6943 |
+
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
|
6944 |
+
},
|
6945 |
+
contents: {
|
6946 |
+
script: /(?:java|ecma)script/
|
6947 |
+
},
|
6948 |
+
converters: {
|
6949 |
+
"text script": function( text ) {
|
6950 |
+
jQuery.globalEval( text );
|
6951 |
+
return text;
|
6952 |
+
}
|
6953 |
+
}
|
6954 |
+
});
|
6955 |
+
// Handle cache's special case and global
|
6956 |
+
jQuery.ajaxPrefilter( "script", function( s ) {
|
6957 |
+
if ( s.cache === undefined ) {
|
6958 |
+
s.cache = false;
|
6959 |
+
}
|
6960 |
+
if ( s.crossDomain ) {
|
6961 |
+
s.type = "GET";
|
6962 |
+
s.global = false;
|
6963 |
+
}
|
6964 |
+
});
|
6965 |
+
// Bind script tag hack transport
|
6966 |
+
jQuery.ajaxTransport( "script", function(s) {
|
6967 |
+
// This transport only deals with cross domain requests
|
6968 |
+
if ( s.crossDomain ) {
|
6969 |
+
var script,
|
6970 |
+
head = document.head || jQuery("head")[0] || document.documentElement;
|
6971 |
+
return {
|
6972 |
+
send: function( _, callback ) {
|
6973 |
+
script = document.createElement("script");
|
6974 |
+
script.async = true;
|
6975 |
+
if ( s.scriptCharset ) {
|
6976 |
+
script.charset = s.scriptCharset;
|
6977 |
+
}
|
6978 |
+
script.src = s.url;
|
6979 |
+
// Attach handlers for all browsers
|
6980 |
+
script.onload = script.onreadystatechange = function( _, isAbort ) {
|
6981 |
+
if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
|
6982 |
+
// Handle memory leak in IE
|
6983 |
+
script.onload = script.onreadystatechange = null;
|
6984 |
+
// Remove the script
|
6985 |
+
if ( script.parentNode ) {
|
6986 |
+
script.parentNode.removeChild( script );
|
6987 |
+
}
|
6988 |
+
// Dereference the script
|
6989 |
+
script = null;
|
6990 |
+
// Callback if not abort
|
6991 |
+
if ( !isAbort ) {
|
6992 |
+
callback( 200, "success" );
|
6993 |
+
}
|
6994 |
+
}
|
6995 |
+
};
|
6996 |
+
// Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
|
6997 |
+
// Use native DOM manipulation to avoid our domManip AJAX trickery
|
6998 |
+
head.insertBefore( script, head.firstChild );
|
6999 |
+
},
|
7000 |
+
abort: function() {
|
7001 |
+
if ( script ) {
|
7002 |
+
script.onload( undefined, true );
|
7003 |
+
}
|
7004 |
+
}
|
7005 |
+
};
|
7006 |
+
}
|
7007 |
+
});
|
7008 |
+
var oldCallbacks = [],
|
7009 |
+
rjsonp = /(=)\?(?=&|$)|\?\?/;
|
7010 |
+
// Default jsonp settings
|
7011 |
+
jQuery.ajaxSetup({
|
7012 |
+
jsonp: "callback",
|
7013 |
+
jsonpCallback: function() {
|
7014 |
+
var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( ajax_nonce++ ) );
|
7015 |
+
this[ callback ] = true;
|
7016 |
+
return callback;
|
7017 |
+
}
|
7018 |
+
});
|
7019 |
+
// Detect, normalize options and install callbacks for jsonp requests
|
7020 |
+
jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
|
7021 |
+
var callbackName, overwritten, responseContainer,
|
7022 |
+
jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
|
7023 |
+
"url" :
|
7024 |
+
typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
|
7025 |
+
);
|
7026 |
+
// Handle iff the expected data type is "jsonp" or we have a parameter to set
|
7027 |
+
if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
|
7028 |
+
// Get callback name, remembering preexisting value associated with it
|
7029 |
+
callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
|
7030 |
+
s.jsonpCallback() :
|
7031 |
+
s.jsonpCallback;
|
7032 |
+
// Insert callback into url or form data
|
7033 |
+
if ( jsonProp ) {
|
7034 |
+
s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
|
7035 |
+
} else if ( s.jsonp !== false ) {
|
7036 |
+
s.url += ( ajax_rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
|
7037 |
+
}
|
7038 |
+
// Use data converter to retrieve json after script execution
|
7039 |
+
s.converters["script json"] = function() {
|
7040 |
+
if ( !responseContainer ) {
|
7041 |
+
jQuery.error( callbackName + " was not called" );
|
7042 |
+
}
|
7043 |
+
return responseContainer[ 0 ];
|
7044 |
+
};
|
7045 |
+
// force json dataType
|
7046 |
+
s.dataTypes[ 0 ] = "json";
|
7047 |
+
// Install callback
|
7048 |
+
overwritten = window[ callbackName ];
|
7049 |
+
window[ callbackName ] = function() {
|
7050 |
+
responseContainer = arguments;
|
7051 |
+
};
|
7052 |
+
// Clean-up function (fires after converters)
|
7053 |
+
jqXHR.always(function() {
|
7054 |
+
// Restore preexisting value
|
7055 |
+
window[ callbackName ] = overwritten;
|
7056 |
+
// Save back as free
|
7057 |
+
if ( s[ callbackName ] ) {
|
7058 |
+
// make sure that re-using the options doesn't screw things around
|
7059 |
+
s.jsonpCallback = originalSettings.jsonpCallback;
|
7060 |
+
// save the callback name for future use
|
7061 |
+
oldCallbacks.push( callbackName );
|
7062 |
+
}
|
7063 |
+
// Call if it was a function and we have a response
|
7064 |
+
if ( responseContainer && jQuery.isFunction( overwritten ) ) {
|
7065 |
+
overwritten( responseContainer[ 0 ] );
|
7066 |
+
}
|
7067 |
+
responseContainer = overwritten = undefined;
|
7068 |
+
});
|
7069 |
+
// Delegate to script
|
7070 |
+
return "script";
|
7071 |
+
}
|
7072 |
+
});
|
7073 |
+
var xhrCallbacks, xhrSupported,
|
7074 |
+
xhrId = 0,
|
7075 |
+
// #5280: Internet Explorer will keep connections alive if we don't abort on unload
|
7076 |
+
xhrOnUnloadAbort = window.ActiveXObject && function() {
|
7077 |
+
// Abort all pending requests
|
7078 |
+
var key;
|
7079 |
+
for ( key in xhrCallbacks ) {
|
7080 |
+
xhrCallbacks[ key ]( undefined, true );
|
7081 |
+
}
|
7082 |
+
};
|
7083 |
+
// Functions to create xhrs
|
7084 |
+
function createStandardXHR() {
|
7085 |
+
try {
|
7086 |
+
return new window.XMLHttpRequest();
|
7087 |
+
} catch( e ) {}
|
7088 |
+
}
|
7089 |
+
function createActiveXHR() {
|
7090 |
+
try {
|
7091 |
+
return new window.ActiveXObject("Microsoft.XMLHTTP");
|
7092 |
+
} catch( e ) {}
|
7093 |
+
}
|
7094 |
+
// Create the request object
|
7095 |
+
// (This is still attached to ajaxSettings for backward compatibility)
|
7096 |
+
jQuery.ajaxSettings.xhr = window.ActiveXObject ?
|
7097 |
+
/* Microsoft failed to properly
|
7098 |
+
* implement the XMLHttpRequest in IE7 (can't request local files),
|
7099 |
+
* so we use the ActiveXObject when it is available
|
7100 |
+
* Additionally XMLHttpRequest can be disabled in IE7/IE8 so
|
7101 |
+
* we need a fallback.
|
7102 |
+
*/
|
7103 |
+
function() {
|
7104 |
+
return !this.isLocal && createStandardXHR() || createActiveXHR();
|
7105 |
+
} :
|
7106 |
+
// For all other browsers, use the standard XMLHttpRequest object
|
7107 |
+
createStandardXHR;
|
7108 |
+
// Determine support properties
|
7109 |
+
xhrSupported = jQuery.ajaxSettings.xhr();
|
7110 |
+
jQuery.support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
|
7111 |
+
xhrSupported = jQuery.support.ajax = !!xhrSupported;
|
7112 |
+
// Create transport if the browser can provide an xhr
|
7113 |
+
if ( xhrSupported ) {
|
7114 |
+
jQuery.ajaxTransport(function( s ) {
|
7115 |
+
// Cross domain only allowed if supported through XMLHttpRequest
|
7116 |
+
if ( !s.crossDomain || jQuery.support.cors ) {
|
7117 |
+
var callback;
|
7118 |
+
return {
|
7119 |
+
send: function( headers, complete ) {
|
7120 |
+
// Get a new xhr
|
7121 |
+
var handle, i,
|
7122 |
+
xhr = s.xhr();
|
7123 |
+
// Open the socket
|
7124 |
+
// Passing null username, generates a login popup on Opera (#2865)
|
7125 |
+
if ( s.username ) {
|
7126 |
+
xhr.open( s.type, s.url, s.async, s.username, s.password );
|
7127 |
+
} else {
|
7128 |
+
xhr.open( s.type, s.url, s.async );
|
7129 |
+
}
|
7130 |
+
// Apply custom fields if provided
|
7131 |
+
if ( s.xhrFields ) {
|
7132 |
+
for ( i in s.xhrFields ) {
|
7133 |
+
xhr[ i ] = s.xhrFields[ i ];
|
7134 |
+
}
|
7135 |
+
}
|
7136 |
+
// Override mime type if needed
|
7137 |
+
if ( s.mimeType && xhr.overrideMimeType ) {
|
7138 |
+
xhr.overrideMimeType( s.mimeType );
|
7139 |
+
}
|
7140 |
+
// X-Requested-With header
|
7141 |
+
// For cross-domain requests, seeing as conditions for a preflight are
|
7142 |
+
// akin to a jigsaw puzzle, we simply never set it to be sure.
|
7143 |
+
// (it can always be set on a per-request basis or even using ajaxSetup)
|
7144 |
+
// For same-domain requests, won't change header if already provided.
|
7145 |
+
if ( !s.crossDomain && !headers["X-Requested-With"] ) {
|
7146 |
+
headers["X-Requested-With"] = "XMLHttpRequest";
|
7147 |
+
}
|
7148 |
+
// Need an extra try/catch for cross domain requests in Firefox 3
|
7149 |
+
try {
|
7150 |
+
for ( i in headers ) {
|
7151 |
+
xhr.setRequestHeader( i, headers[ i ] );
|
7152 |
+
}
|
7153 |
+
} catch( err ) {}
|
7154 |
+
// Do send the request
|
7155 |
+
// This may raise an exception which is actually
|
7156 |
+
// handled in jQuery.ajax (so no try/catch here)
|
7157 |
+
xhr.send( ( s.hasContent && s.data ) || null );
|
7158 |
+
// Listener
|
7159 |
+
callback = function( _, isAbort ) {
|
7160 |
+
var status, responseHeaders, statusText, responses;
|
7161 |
+
// Firefox throws exceptions when accessing properties
|
7162 |
+
// of an xhr when a network error occurred
|
7163 |
+
// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
|
7164 |
+
try {
|
7165 |
+
// Was never called and is aborted or complete
|
7166 |
+
if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
|
7167 |
+
// Only called once
|
7168 |
+
callback = undefined;
|
7169 |
+
// Do not keep as active anymore
|
7170 |
+
if ( handle ) {
|
7171 |
+
xhr.onreadystatechange = jQuery.noop;
|
7172 |
+
if ( xhrOnUnloadAbort ) {
|
7173 |
+
delete xhrCallbacks[ handle ];
|
7174 |
+
}
|
7175 |
+
}
|
7176 |
+
// If it's an abort
|
7177 |
+
if ( isAbort ) {
|
7178 |
+
// Abort it manually if needed
|
7179 |
+
if ( xhr.readyState !== 4 ) {
|
7180 |
+
xhr.abort();
|
7181 |
+
}
|
7182 |
+
} else {
|
7183 |
+
responses = {};
|
7184 |
+
status = xhr.status;
|
7185 |
+
responseHeaders = xhr.getAllResponseHeaders();
|
7186 |
+
// When requesting binary data, IE6-9 will throw an exception
|
7187 |
+
// on any attempt to access responseText (#11426)
|
7188 |
+
if ( typeof xhr.responseText === "string" ) {
|
7189 |
+
responses.text = xhr.responseText;
|
7190 |
+
}
|
7191 |
+
// Firefox throws an exception when accessing
|
7192 |
+
// statusText for faulty cross-domain requests
|
7193 |
+
try {
|
7194 |
+
statusText = xhr.statusText;
|
7195 |
+
} catch( e ) {
|
7196 |
+
// We normalize with Webkit giving an empty statusText
|
7197 |
+
statusText = "";
|
7198 |
+
}
|
7199 |
+
// Filter status for non standard behaviors
|
7200 |
+
// If the request is local and we have data: assume a success
|
7201 |
+
// (success with no data won't get notified, that's the best we
|
7202 |
+
// can do given current implementations)
|
7203 |
+
if ( !status && s.isLocal && !s.crossDomain ) {
|
7204 |
+
status = responses.text ? 200 : 404;
|
7205 |
+
// IE - #1450: sometimes returns 1223 when it should be 204
|
7206 |
+
} else if ( status === 1223 ) {
|
7207 |
+
status = 204;
|
7208 |
+
}
|
7209 |
+
}
|
7210 |
+
}
|
7211 |
+
} catch( firefoxAccessException ) {
|
7212 |
+
if ( !isAbort ) {
|
7213 |
+
complete( -1, firefoxAccessException );
|
7214 |
+
}
|
7215 |
+
}
|
7216 |
+
// Call complete if needed
|
7217 |
+
if ( responses ) {
|
7218 |
+
complete( status, statusText, responses, responseHeaders );
|
7219 |
+
}
|
7220 |
+
};
|
7221 |
+
if ( !s.async ) {
|
7222 |
+
// if we're in sync mode we fire the callback
|
7223 |
+
callback();
|
7224 |
+
} else if ( xhr.readyState === 4 ) {
|
7225 |
+
// (IE6 & IE7) if it's in cache and has been
|
7226 |
+
// retrieved directly we need to fire the callback
|
7227 |
+
setTimeout( callback );
|
7228 |
+
} else {
|
7229 |
+
handle = ++xhrId;
|
7230 |
+
if ( xhrOnUnloadAbort ) {
|
7231 |
+
// Create the active xhrs callbacks list if needed
|
7232 |
+
// and attach the unload handler
|
7233 |
+
if ( !xhrCallbacks ) {
|
7234 |
+
xhrCallbacks = {};
|
7235 |
+
jQuery( window ).unload( xhrOnUnloadAbort );
|
7236 |
+
}
|
7237 |
+
// Add to list of active xhrs callbacks
|
7238 |
+
xhrCallbacks[ handle ] = callback;
|
7239 |
+
}
|
7240 |
+
xhr.onreadystatechange = callback;
|
7241 |
+
}
|
7242 |
+
},
|
7243 |
+
abort: function() {
|
7244 |
+
if ( callback ) {
|
7245 |
+
callback( undefined, true );
|
7246 |
+
}
|
7247 |
+
}
|
7248 |
+
};
|
7249 |
+
}
|
7250 |
+
});
|
7251 |
+
}
|
7252 |
+
var fxNow, timerId,
|
7253 |
+
rfxtypes = /^(?:toggle|show|hide)$/,
|
7254 |
+
rfxnum = new RegExp( "^(?:([+-])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
|
7255 |
+
rrun = /queueHooks$/,
|
7256 |
+
animationPrefilters = [ defaultPrefilter ],
|
7257 |
+
tweeners = {
|
7258 |
+
"*": [function( prop, value ) {
|
7259 |
+
var end, unit,
|
7260 |
+
tween = this.createTween( prop, value ),
|
7261 |
+
parts = rfxnum.exec( value ),
|
7262 |
+
target = tween.cur(),
|
7263 |
+
start = +target || 0,
|
7264 |
+
scale = 1,
|
7265 |
+
maxIterations = 20;
|
7266 |
+
if ( parts ) {
|
7267 |
+
end = +parts[2];
|
7268 |
+
unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
|
7269 |
+
// We need to compute starting value
|
7270 |
+
if ( unit !== "px" && start ) {
|
7271 |
+
// Iteratively approximate from a nonzero starting point
|
7272 |
+
// Prefer the current property, because this process will be trivial if it uses the same units
|
7273 |
+
// Fallback to end or a simple constant
|
7274 |
+
start = jQuery.css( tween.elem, prop, true ) || end || 1;
|
7275 |
+
do {
|
7276 |
+
// If previous iteration zeroed out, double until we get *something*
|
7277 |
+
// Use a string for doubling factor so we don't accidentally see scale as unchanged below
|
7278 |
+
scale = scale || ".5";
|
7279 |
+
// Adjust and apply
|
7280 |
+
start = start / scale;
|
7281 |
+
jQuery.style( tween.elem, prop, start + unit );
|
7282 |
+
// Update scale, tolerating zero or NaN from tween.cur()
|
7283 |
+
// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
|
7284 |
+
} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
|
7285 |
+
}
|
7286 |
+
tween.unit = unit;
|
7287 |
+
tween.start = start;
|
7288 |
+
// If a +=/-= token was provided, we're doing a relative animation
|
7289 |
+
tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
|
7290 |
+
}
|
7291 |
+
return tween;
|
7292 |
+
}]
|
7293 |
+
};
|
7294 |
+
// Animations created synchronously will run synchronously
|
7295 |
+
function createFxNow() {
|
7296 |
+
setTimeout(function() {
|
7297 |
+
fxNow = undefined;
|
7298 |
+
});
|
7299 |
+
return ( fxNow = jQuery.now() );
|
7300 |
+
}
|
7301 |
+
function createTweens( animation, props ) {
|
7302 |
+
jQuery.each( props, function( prop, value ) {
|
7303 |
+
var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
|
7304 |
+
index = 0,
|
7305 |
+
length = collection.length;
|
7306 |
+
for ( ; index < length; index++ ) {
|
7307 |
+
if ( collection[ index ].call( animation, prop, value ) ) {
|
7308 |
+
// we're done with this property
|
7309 |
+
return;
|
7310 |
+
}
|
7311 |
+
}
|
7312 |
+
});
|
7313 |
+
}
|
7314 |
+
function Animation( elem, properties, options ) {
|
7315 |
+
var result,
|
7316 |
+
stopped,
|
7317 |
+
index = 0,
|
7318 |
+
length = animationPrefilters.length,
|
7319 |
+
deferred = jQuery.Deferred().always( function() {
|
7320 |
+
// don't match elem in the :animated selector
|
7321 |
+
delete tick.elem;
|
7322 |
+
}),
|
7323 |
+
tick = function() {
|
7324 |
+
if ( stopped ) {
|
7325 |
+
return false;
|
7326 |
+
}
|
7327 |
+
var currentTime = fxNow || createFxNow(),
|
7328 |
+
remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
|
7329 |
+
// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
|
7330 |
+
temp = remaining / animation.duration || 0,
|
7331 |
+
percent = 1 - temp,
|
7332 |
+
index = 0,
|
7333 |
+
length = animation.tweens.length;
|
7334 |
+
for ( ; index < length ; index++ ) {
|
7335 |
+
animation.tweens[ index ].run( percent );
|
7336 |
+
}
|
7337 |
+
deferred.notifyWith( elem, [ animation, percent, remaining ]);
|
7338 |
+
if ( percent < 1 && length ) {
|
7339 |
+
return remaining;
|
7340 |
+
} else {
|
7341 |
+
deferred.resolveWith( elem, [ animation ] );
|
7342 |
+
return false;
|
7343 |
+
}
|
7344 |
+
},
|
7345 |
+
animation = deferred.promise({
|
7346 |
+
elem: elem,
|
7347 |
+
props: jQuery.extend( {}, properties ),
|
7348 |
+
opts: jQuery.extend( true, { specialEasing: {} }, options ),
|
7349 |
+
originalProperties: properties,
|
7350 |
+
originalOptions: options,
|
7351 |
+
startTime: fxNow || createFxNow(),
|
7352 |
+
duration: options.duration,
|
7353 |
+
tweens: [],
|
7354 |
+
createTween: function( prop, end ) {
|
7355 |
+
var tween = jQuery.Tween( elem, animation.opts, prop, end,
|
7356 |
+
animation.opts.specialEasing[ prop ] || animation.opts.easing );
|
7357 |
+
animation.tweens.push( tween );
|
7358 |
+
return tween;
|
7359 |
+
},
|
7360 |
+
stop: function( gotoEnd ) {
|
7361 |
+
var index = 0,
|
7362 |
+
// if we are going to the end, we want to run all the tweens
|
7363 |
+
// otherwise we skip this part
|
7364 |
+
length = gotoEnd ? animation.tweens.length : 0;
|
7365 |
+
if ( stopped ) {
|
7366 |
+
return this;
|
7367 |
+
}
|
7368 |
+
stopped = true;
|
7369 |
+
for ( ; index < length ; index++ ) {
|
7370 |
+
animation.tweens[ index ].run( 1 );
|
7371 |
+
}
|
7372 |
+
// resolve when we played the last frame
|
7373 |
+
// otherwise, reject
|
7374 |
+
if ( gotoEnd ) {
|
7375 |
+
deferred.resolveWith( elem, [ animation, gotoEnd ] );
|
7376 |
+
} else {
|
7377 |
+
deferred.rejectWith( elem, [ animation, gotoEnd ] );
|
7378 |
+
}
|
7379 |
+
return this;
|
7380 |
+
}
|
7381 |
+
}),
|
7382 |
+
props = animation.props;
|
7383 |
+
propFilter( props, animation.opts.specialEasing );
|
7384 |
+
for ( ; index < length ; index++ ) {
|
7385 |
+
result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
|
7386 |
+
if ( result ) {
|
7387 |
+
return result;
|
7388 |
+
}
|
7389 |
+
}
|
7390 |
+
createTweens( animation, props );
|
7391 |
+
if ( jQuery.isFunction( animation.opts.start ) ) {
|
7392 |
+
animation.opts.start.call( elem, animation );
|
7393 |
+
}
|
7394 |
+
jQuery.fx.timer(
|
7395 |
+
jQuery.extend( tick, {
|
7396 |
+
elem: elem,
|
7397 |
+
anim: animation,
|
7398 |
+
queue: animation.opts.queue
|
7399 |
+
})
|
7400 |
+
);
|
7401 |
+
// attach callbacks from options
|
7402 |
+
return animation.progress( animation.opts.progress )
|
7403 |
+
.done( animation.opts.done, animation.opts.complete )
|
7404 |
+
.fail( animation.opts.fail )
|
7405 |
+
.always( animation.opts.always );
|
7406 |
+
}
|
7407 |
+
function propFilter( props, specialEasing ) {
|
7408 |
+
var value, name, index, easing, hooks;
|
7409 |
+
// camelCase, specialEasing and expand cssHook pass
|
7410 |
+
for ( index in props ) {
|
7411 |
+
name = jQuery.camelCase( index );
|
7412 |
+
easing = specialEasing[ name ];
|
7413 |
+
value = props[ index ];
|
7414 |
+
if ( jQuery.isArray( value ) ) {
|
7415 |
+
easing = value[ 1 ];
|
7416 |
+
value = props[ index ] = value[ 0 ];
|
7417 |
+
}
|
7418 |
+
if ( index !== name ) {
|
7419 |
+
props[ name ] = value;
|
7420 |
+
delete props[ index ];
|
7421 |
+
}
|
7422 |
+
hooks = jQuery.cssHooks[ name ];
|
7423 |
+
if ( hooks && "expand" in hooks ) {
|
7424 |
+
value = hooks.expand( value );
|
7425 |
+
delete props[ name ];
|
7426 |
+
// not quite $.extend, this wont overwrite keys already present.
|
7427 |
+
// also - reusing 'index' from above because we have the correct "name"
|
7428 |
+
for ( index in value ) {
|
7429 |
+
if ( !( index in props ) ) {
|
7430 |
+
props[ index ] = value[ index ];
|
7431 |
+
specialEasing[ index ] = easing;
|
7432 |
+
}
|
7433 |
+
}
|
7434 |
+
} else {
|
7435 |
+
specialEasing[ name ] = easing;
|
7436 |
+
}
|
7437 |
+
}
|
7438 |
+
}
|
7439 |
+
jQuery.Animation = jQuery.extend( Animation, {
|
7440 |
+
tweener: function( props, callback ) {
|
7441 |
+
if ( jQuery.isFunction( props ) ) {
|
7442 |
+
callback = props;
|
7443 |
+
props = [ "*" ];
|
7444 |
+
} else {
|
7445 |
+
props = props.split(" ");
|
7446 |
+
}
|
7447 |
+
var prop,
|
7448 |
+
index = 0,
|
7449 |
+
length = props.length;
|
7450 |
+
for ( ; index < length ; index++ ) {
|
7451 |
+
prop = props[ index ];
|
7452 |
+
tweeners[ prop ] = tweeners[ prop ] || [];
|
7453 |
+
tweeners[ prop ].unshift( callback );
|
7454 |
+
}
|
7455 |
+
},
|
7456 |
+
prefilter: function( callback, prepend ) {
|
7457 |
+
if ( prepend ) {
|
7458 |
+
animationPrefilters.unshift( callback );
|
7459 |
+
} else {
|
7460 |
+
animationPrefilters.push( callback );
|
7461 |
+
}
|
7462 |
+
}
|
7463 |
+
});
|
7464 |
+
function defaultPrefilter( elem, props, opts ) {
|
7465 |
+
/*jshint validthis:true */
|
7466 |
+
var prop, index, length,
|
7467 |
+
value, dataShow, toggle,
|
7468 |
+
tween, hooks, oldfire,
|
7469 |
+
anim = this,
|
7470 |
+
style = elem.style,
|
7471 |
+
orig = {},
|
7472 |
+
handled = [],
|
7473 |
+
hidden = elem.nodeType && isHidden( elem );
|
7474 |
+
// handle queue: false promises
|
7475 |
+
if ( !opts.queue ) {
|
7476 |
+
hooks = jQuery._queueHooks( elem, "fx" );
|
7477 |
+
if ( hooks.unqueued == null ) {
|
7478 |
+
hooks.unqueued = 0;
|
7479 |
+
oldfire = hooks.empty.fire;
|
7480 |
+
hooks.empty.fire = function() {
|
7481 |
+
if ( !hooks.unqueued ) {
|
7482 |
+
oldfire();
|
7483 |
+
}
|
7484 |
+
};
|
7485 |
+
}
|
7486 |
+
hooks.unqueued++;
|
7487 |
+
anim.always(function() {
|
7488 |
+
// doing this makes sure that the complete handler will be called
|
7489 |
+
// before this completes
|
7490 |
+
anim.always(function() {
|
7491 |
+
hooks.unqueued--;
|
7492 |
+
if ( !jQuery.queue( elem, "fx" ).length ) {
|
7493 |
+
hooks.empty.fire();
|
7494 |
+
}
|
7495 |
+
});
|
7496 |
+
});
|
7497 |
+
}
|
7498 |
+
// height/width overflow pass
|
7499 |
+
if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
|
7500 |
+
// Make sure that nothing sneaks out
|
7501 |
+
// Record all 3 overflow attributes because IE does not
|
7502 |
+
// change the overflow attribute when overflowX and
|
7503 |
+
// overflowY are set to the same value
|
7504 |
+
opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
|
7505 |
+
// Set display property to inline-block for height/width
|
7506 |
+
// animations on inline elements that are having width/height animated
|
7507 |
+
if ( jQuery.css( elem, "display" ) === "inline" &&
|
7508 |
+
jQuery.css( elem, "float" ) === "none" ) {
|
7509 |
+
// inline-level elements accept inline-block;
|
7510 |
+
// block-level elements need to be inline with layout
|
7511 |
+
if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
|
7512 |
+
style.display = "inline-block";
|
7513 |
+
} else {
|
7514 |
+
style.zoom = 1;
|
7515 |
+
}
|
7516 |
+
}
|
7517 |
+
}
|
7518 |
+
if ( opts.overflow ) {
|
7519 |
+
style.overflow = "hidden";
|
7520 |
+
if ( !jQuery.support.shrinkWrapBlocks ) {
|
7521 |
+
anim.always(function() {
|
7522 |
+
style.overflow = opts.overflow[ 0 ];
|
7523 |
+
style.overflowX = opts.overflow[ 1 ];
|
7524 |
+
style.overflowY = opts.overflow[ 2 ];
|
7525 |
+
});
|
7526 |
+
}
|
7527 |
+
}
|
7528 |
+
// show/hide pass
|
7529 |
+
for ( index in props ) {
|
7530 |
+
value = props[ index ];
|
7531 |
+
if ( rfxtypes.exec( value ) ) {
|
7532 |
+
delete props[ index ];
|
7533 |
+
toggle = toggle || value === "toggle";
|
7534 |
+
if ( value === ( hidden ? "hide" : "show" ) ) {
|
7535 |
+
continue;
|
7536 |
+
}
|
7537 |
+
handled.push( index );
|
7538 |
+
}
|
7539 |
+
}
|
7540 |
+
length = handled.length;
|
7541 |
+
if ( length ) {
|
7542 |
+
dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
|
7543 |
+
if ( "hidden" in dataShow ) {
|
7544 |
+
hidden = dataShow.hidden;
|
7545 |
+
}
|
7546 |
+
// store state if its toggle - enables .stop().toggle() to "reverse"
|
7547 |
+
if ( toggle ) {
|
7548 |
+
dataShow.hidden = !hidden;
|
7549 |
+
}
|
7550 |
+
if ( hidden ) {
|
7551 |
+
jQuery( elem ).show();
|
7552 |
+
} else {
|
7553 |
+
anim.done(function() {
|
7554 |
+
jQuery( elem ).hide();
|
7555 |
+
});
|
7556 |
+
}
|
7557 |
+
anim.done(function() {
|
7558 |
+
var prop;
|
7559 |
+
jQuery._removeData( elem, "fxshow" );
|
7560 |
+
for ( prop in orig ) {
|
7561 |
+
jQuery.style( elem, prop, orig[ prop ] );
|
7562 |
+
}
|
7563 |
+
});
|
7564 |
+
for ( index = 0 ; index < length ; index++ ) {
|
7565 |
+
prop = handled[ index ];
|
7566 |
+
tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
|
7567 |
+
orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
|
7568 |
+
if ( !( prop in dataShow ) ) {
|
7569 |
+
dataShow[ prop ] = tween.start;
|
7570 |
+
if ( hidden ) {
|
7571 |
+
tween.end = tween.start;
|
7572 |
+
tween.start = prop === "width" || prop === "height" ? 1 : 0;
|
7573 |
+
}
|
7574 |
+
}
|
7575 |
+
}
|
7576 |
+
}
|
7577 |
+
}
|
7578 |
+
function Tween( elem, options, prop, end, easing ) {
|
7579 |
+
return new Tween.prototype.init( elem, options, prop, end, easing );
|
7580 |
+
}
|
7581 |
+
jQuery.Tween = Tween;
|
7582 |
+
Tween.prototype = {
|
7583 |
+
constructor: Tween,
|
7584 |
+
init: function( elem, options, prop, end, easing, unit ) {
|
7585 |
+
this.elem = elem;
|
7586 |
+
this.prop = prop;
|
7587 |
+
this.easing = easing || "swing";
|
7588 |
+
this.options = options;
|
7589 |
+
this.start = this.now = this.cur();
|
7590 |
+
this.end = end;
|
7591 |
+
this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
|
7592 |
+
},
|
7593 |
+
cur: function() {
|
7594 |
+
var hooks = Tween.propHooks[ this.prop ];
|
7595 |
+
return hooks && hooks.get ?
|
7596 |
+
hooks.get( this ) :
|
7597 |
+
Tween.propHooks._default.get( this );
|
7598 |
+
},
|
7599 |
+
run: function( percent ) {
|
7600 |
+
var eased,
|
7601 |
+
hooks = Tween.propHooks[ this.prop ];
|
7602 |
+
if ( this.options.duration ) {
|
7603 |
+
this.pos = eased = jQuery.easing[ this.easing ](
|
7604 |
+
percent, this.options.duration * percent, 0, 1, this.options.duration
|
7605 |
+
);
|
7606 |
+
} else {
|
7607 |
+
this.pos = eased = percent;
|
7608 |
+
}
|
7609 |
+
this.now = ( this.end - this.start ) * eased + this.start;
|
7610 |
+
if ( this.options.step ) {
|
7611 |
+
this.options.step.call( this.elem, this.now, this );
|
7612 |
+
}
|
7613 |
+
if ( hooks && hooks.set ) {
|
7614 |
+
hooks.set( this );
|
7615 |
+
} else {
|
7616 |
+
Tween.propHooks._default.set( this );
|
7617 |
+
}
|
7618 |
+
return this;
|
7619 |
+
}
|
7620 |
+
};
|
7621 |
+
Tween.prototype.init.prototype = Tween.prototype;
|
7622 |
+
Tween.propHooks = {
|
7623 |
+
_default: {
|
7624 |
+
get: function( tween ) {
|
7625 |
+
var result;
|
7626 |
+
if ( tween.elem[ tween.prop ] != null &&
|
7627 |
+
(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
|
7628 |
+
return tween.elem[ tween.prop ];
|
7629 |
+
}
|
7630 |
+
// passing an empty string as a 3rd parameter to .css will automatically
|
7631 |
+
// attempt a parseFloat and fallback to a string if the parse fails
|
7632 |
+
// so, simple values such as "10px" are parsed to Float.
|
7633 |
+
// complex values such as "rotate(1rad)" are returned as is.
|
7634 |
+
result = jQuery.css( tween.elem, tween.prop, "" );
|
7635 |
+
// Empty strings, null, undefined and "auto" are converted to 0.
|
7636 |
+
return !result || result === "auto" ? 0 : result;
|
7637 |
+
},
|
7638 |
+
set: function( tween ) {
|
7639 |
+
// use step hook for back compat - use cssHook if its there - use .style if its
|
7640 |
+
// available and use plain properties where available
|
7641 |
+
if ( jQuery.fx.step[ tween.prop ] ) {
|
7642 |
+
jQuery.fx.step[ tween.prop ]( tween );
|
7643 |
+
} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
|
7644 |
+
jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
|
7645 |
+
} else {
|
7646 |
+
tween.elem[ tween.prop ] = tween.now;
|
7647 |
+
}
|
7648 |
+
}
|
7649 |
+
}
|
7650 |
+
};
|
7651 |
+
// Remove in 2.0 - this supports IE8's panic based approach
|
7652 |
+
// to setting things on disconnected nodes
|
7653 |
+
Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
|
7654 |
+
set: function( tween ) {
|
7655 |
+
if ( tween.elem.nodeType && tween.elem.parentNode ) {
|
7656 |
+
tween.elem[ tween.prop ] = tween.now;
|
7657 |
+
}
|
7658 |
+
}
|
7659 |
+
};
|
7660 |
+
jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
|
7661 |
+
var cssFn = jQuery.fn[ name ];
|
7662 |
+
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
7663 |
+
return speed == null || typeof speed === "boolean" ?
|
7664 |
+
cssFn.apply( this, arguments ) :
|
7665 |
+
this.animate( genFx( name, true ), speed, easing, callback );
|
7666 |
+
};
|
7667 |
+
});
|
7668 |
+
jQuery.fn.extend({
|
7669 |
+
fadeTo: function( speed, to, easing, callback ) {
|
7670 |
+
// show any hidden elements after setting opacity to 0
|
7671 |
+
return this.filter( isHidden ).css( "opacity", 0 ).show()
|
7672 |
+
// animate to the value specified
|
7673 |
+
.end().animate({ opacity: to }, speed, easing, callback );
|
7674 |
+
},
|
7675 |
+
animate: function( prop, speed, easing, callback ) {
|
7676 |
+
var empty = jQuery.isEmptyObject( prop ),
|
7677 |
+
optall = jQuery.speed( speed, easing, callback ),
|
7678 |
+
doAnimation = function() {
|
7679 |
+
// Operate on a copy of prop so per-property easing won't be lost
|
7680 |
+
var anim = Animation( this, jQuery.extend( {}, prop ), optall );
|
7681 |
+
doAnimation.finish = function() {
|
7682 |
+
anim.stop( true );
|
7683 |
+
};
|
7684 |
+
// Empty animations, or finishing resolves immediately
|
7685 |
+
if ( empty || jQuery._data( this, "finish" ) ) {
|
7686 |
+
anim.stop( true );
|
7687 |
+
}
|
7688 |
+
};
|
7689 |
+
doAnimation.finish = doAnimation;
|
7690 |
+
return empty || optall.queue === false ?
|
7691 |
+
this.each( doAnimation ) :
|
7692 |
+
this.queue( optall.queue, doAnimation );
|
7693 |
+
},
|
7694 |
+
stop: function( type, clearQueue, gotoEnd ) {
|
7695 |
+
var stopQueue = function( hooks ) {
|
7696 |
+
var stop = hooks.stop;
|
7697 |
+
delete hooks.stop;
|
7698 |
+
stop( gotoEnd );
|
7699 |
+
};
|
7700 |
+
if ( typeof type !== "string" ) {
|
7701 |
+
gotoEnd = clearQueue;
|
7702 |
+
clearQueue = type;
|
7703 |
+
type = undefined;
|
7704 |
+
}
|
7705 |
+
if ( clearQueue && type !== false ) {
|
7706 |
+
this.queue( type || "fx", [] );
|
7707 |
+
}
|
7708 |
+
return this.each(function() {
|
7709 |
+
var dequeue = true,
|
7710 |
+
index = type != null && type + "queueHooks",
|
7711 |
+
timers = jQuery.timers,
|
7712 |
+
data = jQuery._data( this );
|
7713 |
+
if ( index ) {
|
7714 |
+
if ( data[ index ] && data[ index ].stop ) {
|
7715 |
+
stopQueue( data[ index ] );
|
7716 |
+
}
|
7717 |
+
} else {
|
7718 |
+
for ( index in data ) {
|
7719 |
+
if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
|
7720 |
+
stopQueue( data[ index ] );
|
7721 |
+
}
|
7722 |
+
}
|
7723 |
+
}
|
7724 |
+
for ( index = timers.length; index--; ) {
|
7725 |
+
if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
|
7726 |
+
timers[ index ].anim.stop( gotoEnd );
|
7727 |
+
dequeue = false;
|
7728 |
+
timers.splice( index, 1 );
|
7729 |
+
}
|
7730 |
+
}
|
7731 |
+
// start the next in the queue if the last step wasn't forced
|
7732 |
+
// timers currently will call their complete callbacks, which will dequeue
|
7733 |
+
// but only if they were gotoEnd
|
7734 |
+
if ( dequeue || !gotoEnd ) {
|
7735 |
+
jQuery.dequeue( this, type );
|
7736 |
+
}
|
7737 |
+
});
|
7738 |
+
},
|
7739 |
+
finish: function( type ) {
|
7740 |
+
if ( type !== false ) {
|
7741 |
+
type = type || "fx";
|
7742 |
+
}
|
7743 |
+
return this.each(function() {
|
7744 |
+
var index,
|
7745 |
+
data = jQuery._data( this ),
|
7746 |
+
queue = data[ type + "queue" ],
|
7747 |
+
hooks = data[ type + "queueHooks" ],
|
7748 |
+
timers = jQuery.timers,
|
7749 |
+
length = queue ? queue.length : 0;
|
7750 |
+
// enable finishing flag on private data
|
7751 |
+
data.finish = true;
|
7752 |
+
// empty the queue first
|
7753 |
+
jQuery.queue( this, type, [] );
|
7754 |
+
if ( hooks && hooks.cur && hooks.cur.finish ) {
|
7755 |
+
hooks.cur.finish.call( this );
|
7756 |
+
}
|
7757 |
+
// look for any active animations, and finish them
|
7758 |
+
for ( index = timers.length; index--; ) {
|
7759 |
+
if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
|
7760 |
+
timers[ index ].anim.stop( true );
|
7761 |
+
timers.splice( index, 1 );
|
7762 |
+
}
|
7763 |
+
}
|
7764 |
+
// look for any animations in the old queue and finish them
|
7765 |
+
for ( index = 0; index < length; index++ ) {
|
7766 |
+
if ( queue[ index ] && queue[ index ].finish ) {
|
7767 |
+
queue[ index ].finish.call( this );
|
7768 |
+
}
|
7769 |
+
}
|
7770 |
+
// turn off finishing flag
|
7771 |
+
delete data.finish;
|
7772 |
+
});
|
7773 |
+
}
|
7774 |
+
});
|
7775 |
+
// Generate parameters to create a standard animation
|
7776 |
+
function genFx( type, includeWidth ) {
|
7777 |
+
var which,
|
7778 |
+
attrs = { height: type },
|
7779 |
+
i = 0;
|
7780 |
+
// if we include width, step value is 1 to do all cssExpand values,
|
7781 |
+
// if we don't include width, step value is 2 to skip over Left and Right
|
7782 |
+
includeWidth = includeWidth? 1 : 0;
|
7783 |
+
for( ; i < 4 ; i += 2 - includeWidth ) {
|
7784 |
+
which = cssExpand[ i ];
|
7785 |
+
attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
|
7786 |
+
}
|
7787 |
+
if ( includeWidth ) {
|
7788 |
+
attrs.opacity = attrs.width = type;
|
7789 |
+
}
|
7790 |
+
return attrs;
|
7791 |
+
}
|
7792 |
+
// Generate shortcuts for custom animations
|
7793 |
+
jQuery.each({
|
7794 |
+
slideDown: genFx("show"),
|
7795 |
+
slideUp: genFx("hide"),
|
7796 |
+
slideToggle: genFx("toggle"),
|
7797 |
+
fadeIn: { opacity: "show" },
|
7798 |
+
fadeOut: { opacity: "hide" },
|
7799 |
+
fadeToggle: { opacity: "toggle" }
|
7800 |
+
}, function( name, props ) {
|
7801 |
+
jQuery.fn[ name ] = function( speed, easing, callback ) {
|
7802 |
+
return this.animate( props, speed, easing, callback );
|
7803 |
+
};
|
7804 |
+
});
|
7805 |
+
jQuery.speed = function( speed, easing, fn ) {
|
7806 |
+
var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
|
7807 |
+
complete: fn || !fn && easing ||
|
7808 |
+
jQuery.isFunction( speed ) && speed,
|
7809 |
+
duration: speed,
|
7810 |
+
easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
|
7811 |
+
};
|
7812 |
+
opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
|
7813 |
+
opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
|
7814 |
+
// normalize opt.queue - true/undefined/null -> "fx"
|
7815 |
+
if ( opt.queue == null || opt.queue === true ) {
|
7816 |
+
opt.queue = "fx";
|
7817 |
+
}
|
7818 |
+
// Queueing
|
7819 |
+
opt.old = opt.complete;
|
7820 |
+
opt.complete = function() {
|
7821 |
+
if ( jQuery.isFunction( opt.old ) ) {
|
7822 |
+
opt.old.call( this );
|
7823 |
+
}
|
7824 |
+
if ( opt.queue ) {
|
7825 |
+
jQuery.dequeue( this, opt.queue );
|
7826 |
+
}
|
7827 |
+
};
|
7828 |
+
return opt;
|
7829 |
+
};
|
7830 |
+
jQuery.easing = {
|
7831 |
+
linear: function( p ) {
|
7832 |
+
return p;
|
7833 |
+
},
|
7834 |
+
swing: function( p ) {
|
7835 |
+
return 0.5 - Math.cos( p*Math.PI ) / 2;
|
7836 |
+
}
|
7837 |
+
};
|
7838 |
+
jQuery.timers = [];
|
7839 |
+
jQuery.fx = Tween.prototype.init;
|
7840 |
+
jQuery.fx.tick = function() {
|
7841 |
+
var timer,
|
7842 |
+
timers = jQuery.timers,
|
7843 |
+
i = 0;
|
7844 |
+
fxNow = jQuery.now();
|
7845 |
+
for ( ; i < timers.length; i++ ) {
|
7846 |
+
timer = timers[ i ];
|
7847 |
+
// Checks the timer has not already been removed
|
7848 |
+
if ( !timer() && timers[ i ] === timer ) {
|
7849 |
+
timers.splice( i--, 1 );
|
7850 |
+
}
|
7851 |
+
}
|
7852 |
+
if ( !timers.length ) {
|
7853 |
+
jQuery.fx.stop();
|
7854 |
+
}
|
7855 |
+
fxNow = undefined;
|
7856 |
+
};
|
7857 |
+
jQuery.fx.timer = function( timer ) {
|
7858 |
+
if ( timer() && jQuery.timers.push( timer ) ) {
|
7859 |
+
jQuery.fx.start();
|
7860 |
+
}
|
7861 |
+
};
|
7862 |
+
jQuery.fx.interval = 13;
|
7863 |
+
jQuery.fx.start = function() {
|
7864 |
+
if ( !timerId ) {
|
7865 |
+
timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
|
7866 |
+
}
|
7867 |
+
};
|
7868 |
+
jQuery.fx.stop = function() {
|
7869 |
+
clearInterval( timerId );
|
7870 |
+
timerId = null;
|
7871 |
+
};
|
7872 |
+
jQuery.fx.speeds = {
|
7873 |
+
slow: 600,
|
7874 |
+
fast: 200,
|
7875 |
+
// Default speed
|
7876 |
+
_default: 400
|
7877 |
+
};
|
7878 |
+
// Back Compat <1.8 extension point
|
7879 |
+
jQuery.fx.step = {};
|
7880 |
+
if ( jQuery.expr && jQuery.expr.filters ) {
|
7881 |
+
jQuery.expr.filters.animated = function( elem ) {
|
7882 |
+
return jQuery.grep(jQuery.timers, function( fn ) {
|
7883 |
+
return elem === fn.elem;
|
7884 |
+
}).length;
|
7885 |
+
};
|
7886 |
+
}
|
7887 |
+
jQuery.fn.offset = function( options ) {
|
7888 |
+
if ( arguments.length ) {
|
7889 |
+
return options === undefined ?
|
7890 |
+
this :
|
7891 |
+
this.each(function( i ) {
|
7892 |
+
jQuery.offset.setOffset( this, options, i );
|
7893 |
+
});
|
7894 |
+
}
|
7895 |
+
var docElem, win,
|
7896 |
+
box = { top: 0, left: 0 },
|
7897 |
+
elem = this[ 0 ],
|
7898 |
+
doc = elem && elem.ownerDocument;
|
7899 |
+
if ( !doc ) {
|
7900 |
+
return;
|
7901 |
+
}
|
7902 |
+
docElem = doc.documentElement;
|
7903 |
+
// Make sure it's not a disconnected DOM node
|
7904 |
+
if ( !jQuery.contains( docElem, elem ) ) {
|
7905 |
+
return box;
|
7906 |
+
}
|
7907 |
+
// If we don't have gBCR, just use 0,0 rather than error
|
7908 |
+
// BlackBerry 5, iOS 3 (original iPhone)
|
7909 |
+
if ( typeof elem.getBoundingClientRect !== core_strundefined ) {
|
7910 |
+
box = elem.getBoundingClientRect();
|
7911 |
+
}
|
7912 |
+
win = getWindow( doc );
|
7913 |
+
return {
|
7914 |
+
top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
|
7915 |
+
left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
|
7916 |
+
};
|
7917 |
+
};
|
7918 |
+
jQuery.offset = {
|
7919 |
+
setOffset: function( elem, options, i ) {
|
7920 |
+
var position = jQuery.css( elem, "position" );
|
7921 |
+
// set position first, in-case top/left are set even on static elem
|
7922 |
+
if ( position === "static" ) {
|
7923 |
+
elem.style.position = "relative";
|
7924 |
+
}
|
7925 |
+
var curElem = jQuery( elem ),
|
7926 |
+
curOffset = curElem.offset(),
|
7927 |
+
curCSSTop = jQuery.css( elem, "top" ),
|
7928 |
+
curCSSLeft = jQuery.css( elem, "left" ),
|
7929 |
+
calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
|
7930 |
+
props = {}, curPosition = {}, curTop, curLeft;
|
7931 |
+
// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
|
7932 |
+
if ( calculatePosition ) {
|
7933 |
+
curPosition = curElem.position();
|
7934 |
+
curTop = curPosition.top;
|
7935 |
+
curLeft = curPosition.left;
|
7936 |
+
} else {
|
7937 |
+
curTop = parseFloat( curCSSTop ) || 0;
|
7938 |
+
curLeft = parseFloat( curCSSLeft ) || 0;
|
7939 |
+
}
|
7940 |
+
if ( jQuery.isFunction( options ) ) {
|
7941 |
+
options = options.call( elem, i, curOffset );
|
7942 |
+
}
|
7943 |
+
if ( options.top != null ) {
|
7944 |
+
props.top = ( options.top - curOffset.top ) + curTop;
|
7945 |
+
}
|
7946 |
+
if ( options.left != null ) {
|
7947 |
+
props.left = ( options.left - curOffset.left ) + curLeft;
|
7948 |
+
}
|
7949 |
+
if ( "using" in options ) {
|
7950 |
+
options.using.call( elem, props );
|
7951 |
+
} else {
|
7952 |
+
curElem.css( props );
|
7953 |
+
}
|
7954 |
+
}
|
7955 |
+
};
|
7956 |
+
jQuery.fn.extend({
|
7957 |
+
position: function() {
|
7958 |
+
if ( !this[ 0 ] ) {
|
7959 |
+
return;
|
7960 |
+
}
|
7961 |
+
var offsetParent, offset,
|
7962 |
+
parentOffset = { top: 0, left: 0 },
|
7963 |
+
elem = this[ 0 ];
|
7964 |
+
// fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is it's only offset parent
|
7965 |
+
if ( jQuery.css( elem, "position" ) === "fixed" ) {
|
7966 |
+
// we assume that getBoundingClientRect is available when computed position is fixed
|
7967 |
+
offset = elem.getBoundingClientRect();
|
7968 |
+
} else {
|
7969 |
+
// Get *real* offsetParent
|
7970 |
+
offsetParent = this.offsetParent();
|
7971 |
+
// Get correct offsets
|
7972 |
+
offset = this.offset();
|
7973 |
+
if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
|
7974 |
+
parentOffset = offsetParent.offset();
|
7975 |
+
}
|
7976 |
+
// Add offsetParent borders
|
7977 |
+
parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
|
7978 |
+
parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
|
7979 |
+
}
|
7980 |
+
// Subtract parent offsets and element margins
|
7981 |
+
// note: when an element has margin: auto the offsetLeft and marginLeft
|
7982 |
+
// are the same in Safari causing offset.left to incorrectly be 0
|
7983 |
+
return {
|
7984 |
+
top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
|
7985 |
+
left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
|
7986 |
+
};
|
7987 |
+
},
|
7988 |
+
offsetParent: function() {
|
7989 |
+
return this.map(function() {
|
7990 |
+
var offsetParent = this.offsetParent || document.documentElement;
|
7991 |
+
while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position") === "static" ) ) {
|
7992 |
+
offsetParent = offsetParent.offsetParent;
|
7993 |
+
}
|
7994 |
+
return offsetParent || document.documentElement;
|
7995 |
+
});
|
7996 |
+
}
|
7997 |
+
});
|
7998 |
+
// Create scrollLeft and scrollTop methods
|
7999 |
+
jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
|
8000 |
+
var top = /Y/.test( prop );
|
8001 |
+
jQuery.fn[ method ] = function( val ) {
|
8002 |
+
return jQuery.access( this, function( elem, method, val ) {
|
8003 |
+
var win = getWindow( elem );
|
8004 |
+
if ( val === undefined ) {
|
8005 |
+
return win ? (prop in win) ? win[ prop ] :
|
8006 |
+
win.document.documentElement[ method ] :
|
8007 |
+
elem[ method ];
|
8008 |
+
}
|
8009 |
+
if ( win ) {
|
8010 |
+
win.scrollTo(
|
8011 |
+
!top ? val : jQuery( win ).scrollLeft(),
|
8012 |
+
top ? val : jQuery( win ).scrollTop()
|
8013 |
+
);
|
8014 |
+
} else {
|
8015 |
+
elem[ method ] = val;
|
8016 |
+
}
|
8017 |
+
}, method, val, arguments.length, null );
|
8018 |
+
};
|
8019 |
+
});
|
8020 |
+
function getWindow( elem ) {
|
8021 |
+
return jQuery.isWindow( elem ) ?
|
8022 |
+
elem :
|
8023 |
+
elem.nodeType === 9 ?
|
8024 |
+
elem.defaultView || elem.parentWindow :
|
8025 |
+
false;
|
8026 |
+
}
|
8027 |
+
// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
|
8028 |
+
jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
|
8029 |
+
jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
|
8030 |
+
// margin is only for outerHeight, outerWidth
|
8031 |
+
jQuery.fn[ funcName ] = function( margin, value ) {
|
8032 |
+
var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
|
8033 |
+
extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
|
8034 |
+
return jQuery.access( this, function( elem, type, value ) {
|
8035 |
+
var doc;
|
8036 |
+
if ( jQuery.isWindow( elem ) ) {
|
8037 |
+
// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
|
8038 |
+
// isn't a whole lot we can do. See pull request at this URL for discussion:
|
8039 |
+
// https://github.com/jquery/jquery/pull/764
|
8040 |
+
return elem.document.documentElement[ "client" + name ];
|
8041 |
+
}
|
8042 |
+
// Get document width or height
|
8043 |
+
if ( elem.nodeType === 9 ) {
|
8044 |
+
doc = elem.documentElement;
|
8045 |
+
// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
|
8046 |
+
// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
|
8047 |
+
return Math.max(
|
8048 |
+
elem.body[ "scroll" + name ], doc[ "scroll" + name ],
|
8049 |
+
elem.body[ "offset" + name ], doc[ "offset" + name ],
|
8050 |
+
doc[ "client" + name ]
|
8051 |
+
);
|
8052 |
+
}
|
8053 |
+
return value === undefined ?
|
8054 |
+
// Get width or height on the element, requesting but not forcing parseFloat
|
8055 |
+
jQuery.css( elem, type, extra ) :
|
8056 |
+
// Set width or height on the element
|
8057 |
+
jQuery.style( elem, type, value, extra );
|
8058 |
+
}, type, chainable ? margin : undefined, chainable, null );
|
8059 |
+
};
|
8060 |
+
});
|
8061 |
+
});
|
8062 |
+
// Limit scope pollution from any deprecated API
|
8063 |
+
// (function() {
|
8064 |
+
// })();
|
8065 |
+
// Expose jQuery to the global object
|
8066 |
+
window.jQuery = window.$ = jQuery;
|
8067 |
+
// Expose jQuery as an AMD module, but only for AMD loaders that
|
8068 |
+
// understand the issues with loading multiple versions of jQuery
|
8069 |
+
// in a page that all might call define(). The loader will indicate
|
8070 |
+
// they have special allowances for multiple jQuery versions by
|
8071 |
+
// specifying define.amd.jQuery = true. Register as a named module,
|
8072 |
+
// since jQuery can be concatenated with other files that may use define,
|
8073 |
+
// but not use a proper concatenation script that understands anonymous
|
8074 |
+
// AMD modules. A named AMD is safest and most robust way to register.
|
8075 |
+
// Lowercase jquery is used because AMD module names are derived from
|
8076 |
+
// file names, and jQuery is normally delivered in a lowercase file name.
|
8077 |
+
// Do this after creating the global so that if an AMD module wants to call
|
8078 |
+
// noConflict to hide this version of jQuery, it will work.
|
8079 |
+
if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
|
8080 |
+
define( "jquery", [], function () { return jQuery; } );
|
8081 |
+
}
|
8082 |
+
})( window );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
js/media.js
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
jQuery(document).ready(function($){
|
2 |
+
var _custom_media = true,
|
3 |
+
_orig_send_attachment = wp.media.editor.send.attachment;
|
4 |
+
|
5 |
+
$('.bsf_upload_button').click(function(e) {
|
6 |
+
var send_attachment_bkp = wp.media.editor.send.attachment;
|
7 |
+
var button = $(this);
|
8 |
+
var id = 'bsf_upload_file'; //button.attr('id').replace('_button', '');
|
9 |
+
_custom_media = true;
|
10 |
+
wp.media.editor.send.attachment = function(props, attachment){
|
11 |
+
if ( _custom_media ) {
|
12 |
+
$("."+id).val(attachment.url);
|
13 |
+
$(".bsf_media_status").html('<img src="'+ attachment.url +'" />');
|
14 |
+
} else {
|
15 |
+
return _orig_send_attachment.apply( this, [props, attachment] );
|
16 |
+
};
|
17 |
+
}
|
18 |
+
|
19 |
+
wp.media.editor.open(button);
|
20 |
+
return false;
|
21 |
+
});
|
22 |
+
|
23 |
+
$('.add_media').on('click', function(){
|
24 |
+
_custom_media = false;
|
25 |
+
});
|
26 |
+
});
|
js/retina.js
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
-
// retina.js, a high-resolution image swapper (http://retinajs.com), v0.0.2
|
2 |
-
|
3 |
(function(){function t(e){this.path=e;var t=this.path.split("."),n=t.slice(0,t.length-1).join("."),r=t[t.length-1];this.at_2x_path=n+"@2x."+r}function n(e){this.el=e,this.path=new t(this.el.getAttribute("src"));var n=this;this.path.check_2x_variant(function(e){e&&n.swap()})}var e=typeof exports=="undefined"?window:exports;e.RetinaImagePath=t,t.confirmed_paths=[],t.prototype.is_external=function(){return!!this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain)},t.prototype.check_2x_variant=function(e){var n,r=this;if(this.is_external())return e(!1);if(this.at_2x_path in t.confirmed_paths)return e(!0);n=new XMLHttpRequest,n.open("HEAD",this.at_2x_path),n.onreadystatechange=function(){return n.readyState!=4?e(!1):n.status>=200&&n.status<=399?(t.confirmed_paths.push(r.at_2x_path),e(!0)):e(!1)},n.send()},e.RetinaImage=n,n.prototype.swap=function(e){function n(){t.el.complete?(t.el.setAttribute("width",t.el.offsetWidth),t.el.setAttribute("height",t.el.offsetHeight),t.el.setAttribute("src",e)):setTimeout(n,5)}typeof e=="undefined"&&(e=this.path.at_2x_path);var t=this;n()},e.devicePixelRatio>1&&(window.onload=function(){var e=document.getElementsByTagName("img"),t=[],r,i;for(r=0;r<e.length;r++)i=e[r],t.push(new n(i))})})();
|
1 |
+
// retina.js, a high-resolution image swapper (http://retinajs.com), v0.0.2
|
2 |
+
|
3 |
(function(){function t(e){this.path=e;var t=this.path.split("."),n=t.slice(0,t.length-1).join("."),r=t[t.length-1];this.at_2x_path=n+"@2x."+r}function n(e){this.el=e,this.path=new t(this.el.getAttribute("src"));var n=this;this.path.check_2x_variant(function(e){e&&n.swap()})}var e=typeof exports=="undefined"?window:exports;e.RetinaImagePath=t,t.confirmed_paths=[],t.prototype.is_external=function(){return!!this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain)},t.prototype.check_2x_variant=function(e){var n,r=this;if(this.is_external())return e(!1);if(this.at_2x_path in t.confirmed_paths)return e(!0);n=new XMLHttpRequest,n.open("HEAD",this.at_2x_path),n.onreadystatechange=function(){return n.readyState!=4?e(!1):n.status>=200&&n.status<=399?(t.confirmed_paths.push(r.at_2x_path),e(!0)):e(!1)},n.send()},e.RetinaImage=n,n.prototype.swap=function(e){function n(){t.el.complete?(t.el.setAttribute("width",t.el.offsetWidth),t.el.setAttribute("height",t.el.offsetHeight),t.el.setAttribute("src",e)):setTimeout(n,5)}typeof e=="undefined"&&(e=this.path.at_2x_path);var t=this;n()},e.devicePixelRatio>1&&(window.onload=function(){var e=document.getElementsByTagName("img"),t=[],r,i;for(r=0;r<e.length;r++)i=e[r],t.push(new n(i))})})();
|
js/toggle.js
CHANGED
@@ -1,100 +1,108 @@
|
|
1 |
-
jQuery(document).ready(function() {
|
2 |
-
var selected = jQuery("#_bsf_post_type").val();
|
3 |
-
if(selected == "0")
|
4 |
-
hidden();
|
5 |
-
else
|
6 |
-
expand_default(selected);
|
7 |
-
//Function to hide all the snippet blocks
|
8 |
-
function hidden() {
|
9 |
-
jQuery(".review").hide();
|
10 |
-
jQuery(".events").hide();
|
11 |
-
jQuery(".music").hide();
|
12 |
-
jQuery(".organization").hide();
|
13 |
-
jQuery(".people").hide();
|
14 |
-
jQuery(".product").hide();
|
15 |
-
jQuery(".recipes").hide();
|
16 |
-
jQuery(".software").hide();
|
17 |
-
jQuery(".video").hide();
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
}
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
{
|
69 |
-
jQuery(".
|
70 |
-
}
|
71 |
-
else if(type == '
|
72 |
-
{
|
73 |
-
jQuery(".
|
74 |
-
}
|
75 |
-
else if(type == '
|
76 |
-
{
|
77 |
-
jQuery(".
|
78 |
-
}
|
79 |
-
else if(type == '
|
80 |
-
{
|
81 |
-
jQuery(".
|
82 |
-
}
|
83 |
-
else if(type == '
|
84 |
-
{
|
85 |
-
jQuery(".
|
86 |
-
}
|
87 |
-
else if(type == '
|
88 |
-
{
|
89 |
-
jQuery(".
|
90 |
-
}
|
91 |
-
else if(type == '
|
92 |
-
{
|
93 |
-
jQuery(".
|
94 |
-
}
|
95 |
-
else if(type == '
|
96 |
-
{
|
97 |
-
jQuery(".
|
98 |
-
}
|
99 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
});
|
1 |
+
jQuery(document).ready(function() {
|
2 |
+
var selected = jQuery("#_bsf_post_type").val();
|
3 |
+
if(selected == "0")
|
4 |
+
hidden();
|
5 |
+
else
|
6 |
+
expand_default(selected);
|
7 |
+
//Function to hide all the snippet blocks
|
8 |
+
function hidden() {
|
9 |
+
jQuery(".review").hide();
|
10 |
+
jQuery(".events").hide();
|
11 |
+
jQuery(".music").hide();
|
12 |
+
jQuery(".organization").hide();
|
13 |
+
jQuery(".people").hide();
|
14 |
+
jQuery(".product").hide();
|
15 |
+
jQuery(".recipes").hide();
|
16 |
+
jQuery(".software").hide();
|
17 |
+
jQuery(".video").hide();
|
18 |
+
jQuery(".article").hide();
|
19 |
+
}
|
20 |
+
//Function to expand the updated snippet block
|
21 |
+
function expand_default(selected) {
|
22 |
+
hidden();
|
23 |
+
if(selected == '1')
|
24 |
+
{
|
25 |
+
jQuery(".review").show(500);
|
26 |
+
}
|
27 |
+
else if(selected == '2')
|
28 |
+
{
|
29 |
+
jQuery(".events").show(500);
|
30 |
+
}
|
31 |
+
else if(selected == '3')
|
32 |
+
{
|
33 |
+
jQuery(".music").show(500);
|
34 |
+
}
|
35 |
+
else if(selected == '4')
|
36 |
+
{
|
37 |
+
jQuery(".organization").show(500);
|
38 |
+
}
|
39 |
+
else if(selected == '5')
|
40 |
+
{
|
41 |
+
jQuery(".people").show(500);
|
42 |
+
}
|
43 |
+
else if(selected == '6')
|
44 |
+
{
|
45 |
+
jQuery(".product").show(500);
|
46 |
+
}
|
47 |
+
else if(selected == '7')
|
48 |
+
{
|
49 |
+
jQuery(".recipes").show(500);
|
50 |
+
}
|
51 |
+
else if(selected == '8')
|
52 |
+
{
|
53 |
+
jQuery(".software").show(500);
|
54 |
+
}
|
55 |
+
else if(selected == '9')
|
56 |
+
{
|
57 |
+
jQuery(".video").show(500);
|
58 |
+
}
|
59 |
+
else if(selected == '10')
|
60 |
+
{
|
61 |
+
jQuery(".article").show(500);
|
62 |
+
}
|
63 |
+
}
|
64 |
+
jQuery("#_bsf_post_type").change(function() {
|
65 |
+
hidden();
|
66 |
+
var type=jQuery(this).val();
|
67 |
+
if(type == '1')
|
68 |
+
{
|
69 |
+
jQuery(".review").show(500);
|
70 |
+
}
|
71 |
+
else if(type == '2')
|
72 |
+
{
|
73 |
+
jQuery(".events").show(500);
|
74 |
+
}
|
75 |
+
else if(type == '3')
|
76 |
+
{
|
77 |
+
jQuery(".music").show(500);
|
78 |
+
}
|
79 |
+
else if(type == '4')
|
80 |
+
{
|
81 |
+
jQuery(".organization").show(500);
|
82 |
+
}
|
83 |
+
else if(type == '5')
|
84 |
+
{
|
85 |
+
jQuery(".people").show(500);
|
86 |
+
}
|
87 |
+
else if(type == '6')
|
88 |
+
{
|
89 |
+
jQuery(".product").show(500);
|
90 |
+
}
|
91 |
+
else if(type == '7')
|
92 |
+
{
|
93 |
+
jQuery(".recipes").show(500);
|
94 |
+
}
|
95 |
+
else if(type == '8')
|
96 |
+
{
|
97 |
+
jQuery(".software").show(500);
|
98 |
+
}
|
99 |
+
else if(type == '9')
|
100 |
+
{
|
101 |
+
jQuery(".video").show(500);
|
102 |
+
}
|
103 |
+
else if(type == '10')
|
104 |
+
{
|
105 |
+
jQuery(".article").show(500);
|
106 |
+
}
|
107 |
+
});
|
108 |
});
|
meta-boxes.php
CHANGED
@@ -1,577 +1,611 @@
|
|
1 |
-
<?php
|
2 |
-
// Metabox for review
|
3 |
-
function bsf_metaboxes( array $meta_boxes ) {
|
4 |
-
|
5 |
-
|
6 |
-
$
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
'
|
11 |
-
'
|
12 |
-
'
|
13 |
-
'
|
14 |
-
'
|
15 |
-
'
|
16 |
-
|
17 |
-
|
18 |
-
'
|
19 |
-
'
|
20 |
-
'
|
21 |
-
'
|
22 |
-
'
|
23 |
-
|
24 |
-
array( 'name' => __('
|
25 |
-
array( 'name' => __('
|
26 |
-
array( 'name' => __('
|
27 |
-
// array( 'name' => __('
|
28 |
-
|
29 |
-
array( 'name' => __('
|
30 |
-
array( 'name' => __('
|
31 |
-
array( 'name' => __('
|
32 |
-
array( 'name' => __('
|
33 |
-
array( 'name' => __('
|
34 |
-
),
|
35 |
-
),
|
36 |
-
// Meta Settings for Item Review
|
37 |
-
array(
|
38 |
-
'name' => __('Rich Snippets - Item Review','rich-snippets'),
|
39 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
40 |
-
'id' => $prefix . 'review_title',
|
41 |
-
'class' => 'review',
|
42 |
-
'type' => 'title',
|
43 |
-
),
|
44 |
-
array(
|
45 |
-
'name' => __('Reviewer’s Name ','rich-snippets'),
|
46 |
-
'desc' => __('Enter the name of Item Reviewer or The Post Author.','rich-snippets'),
|
47 |
-
'id' => $prefix . 'item_reviewer',
|
48 |
-
'class' => 'review',
|
49 |
-
'type' => 'text_medium',
|
50 |
-
),
|
51 |
-
array(
|
52 |
-
'name' => __('Item to be reviewed','rich-snippets'),
|
53 |
-
'desc' => __('Enter the name of the item, you are writing review about.','rich-snippets'),
|
54 |
-
'id' => $prefix . 'item_name',
|
55 |
-
'class' => 'review',
|
56 |
-
'type' => 'text',
|
57 |
-
),
|
58 |
-
array(
|
59 |
-
'name' => __('Your Rating','rich-snippets'),
|
60 |
-
'desc' => __(' Rate this item (1-5)','rich-snippets'),
|
61 |
-
'id' => $prefix . 'rating',
|
62 |
-
'class' => 'star review',
|
63 |
-
'type' => 'radio',
|
64 |
-
'options' => array(
|
65 |
-
array( 'name' => __('','rich-snippets'), 'value' => '1', ),
|
66 |
-
array( 'name' => __('','rich-snippets'), 'value' => '2', ),
|
67 |
-
array( 'name' => __('','rich-snippets'), 'value' => '3', ),
|
68 |
-
array( 'name' => __('','rich-snippets'), 'value' => '4', ),
|
69 |
-
array( 'name' => __('','rich-snippets'), 'value' => '5', ),
|
70 |
-
),
|
71 |
-
),
|
72 |
-
/* array(
|
73 |
-
'name' => __('','rich-snippets'),
|
74 |
-
'desc' => __('Enter the item description here','rich-snippets'),
|
75 |
-
'id' => $prefix . 'item_desc',
|
76 |
-
'class' => 'review',
|
77 |
-
'type' => 'textarea_small1',
|
78 |
-
),*/
|
79 |
-
// Meta Settings for Events
|
80 |
-
array(
|
81 |
-
'name' => __('Rich Snippets - Events','rich-snippets'),
|
82 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
83 |
-
'id' => $prefix . 'events',
|
84 |
-
'class' => 'events',
|
85 |
-
'type' => 'title',
|
86 |
-
),
|
87 |
-
array(
|
88 |
-
'name' => __('Event Title ','rich-snippets'),
|
89 |
-
'desc' => __('What would be the name of the event?','rich-snippets'),
|
90 |
-
'id' => $prefix . 'event_title',
|
91 |
-
'class' => 'events',
|
92 |
-
'type' => 'text',
|
93 |
-
),
|
94 |
-
array(
|
95 |
-
'name' => __('Location ','rich-snippets'),
|
96 |
-
'desc' => __('Organization Name Here','rich-snippets'),
|
97 |
-
'id' => $prefix . 'event_organization',
|
98 |
-
'class' => 'events',
|
99 |
-
'type' => 'text_medium',
|
100 |
-
),
|
101 |
-
array(
|
102 |
-
'name' => __('','rich-snippets'),
|
103 |
-
'desc' => __('Street Address','rich-snippets'),
|
104 |
-
'id' => $prefix . 'event_street',
|
105 |
-
'class' => 'events',
|
106 |
-
'type' => 'text_medium',
|
107 |
-
),
|
108 |
-
array(
|
109 |
-
'name' => __('','rich-snippets'),
|
110 |
-
'desc' => __('Locality','rich-snippets'),
|
111 |
-
'id' => $prefix . 'event_local',
|
112 |
-
'class' => 'events',
|
113 |
-
'type' => 'text_medium',
|
114 |
-
),
|
115 |
-
array(
|
116 |
-
'name' => __('','rich-snippets'),
|
117 |
-
'desc' => __('Region','rich-snippets'),
|
118 |
-
'id' => $prefix . 'event_region',
|
119 |
-
'class' => 'events',
|
120 |
-
'type' => 'text_medium',
|
121 |
-
),
|
122 |
-
/* array(
|
123 |
-
'name' => __('Description ','rich-snippets'),
|
124 |
-
'desc' => __('Describe the event in short.','rich-snippets'),
|
125 |
-
'id' => $prefix . 'event_desc',
|
126 |
-
'class' => 'events',
|
127 |
-
'type' => 'textarea_small',
|
128 |
-
),*/
|
129 |
-
array(
|
130 |
-
'name' => __('Start Date ','rich-snippets'),
|
131 |
-
'desc' => __('Provide the Event Start Date.','rich-snippets'),
|
132 |
-
'id' => $prefix . 'event_start_date',
|
133 |
-
'class' => 'events',
|
134 |
-
'type' => 'text_date',
|
135 |
-
),
|
136 |
-
array(
|
137 |
-
'name' => __('End Date ','rich-snippets'),
|
138 |
-
'desc' => __('Provide the Event End Date.','rich-snippets'),
|
139 |
-
'id' => $prefix . 'event_end_date',
|
140 |
-
'class' => 'events',
|
141 |
-
'type' => 'text_date',
|
142 |
-
),
|
143 |
-
array(
|
144 |
-
'name' => __('GEO Location ','rich-snippets'),
|
145 |
-
'desc' => __('Enter Latitude. <a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank">Find Here.</a>','rich-snippets'),
|
146 |
-
'id' => $prefix . 'event_geo_latitude',
|
147 |
-
'class' => 'events',
|
148 |
-
'type' => 'text_medium',
|
149 |
-
),
|
150 |
-
array(
|
151 |
-
'name' => __('','rich-snippets'),
|
152 |
-
'desc' => __('Enter Longitude','rich-snippets'),
|
153 |
-
'id' => $prefix . 'event_geo_longitude',
|
154 |
-
'class' => 'events',
|
155 |
-
'type' => 'text_medium',
|
156 |
-
),
|
157 |
-
array(
|
158 |
-
'name' => __('Event Photo ','rich-snippets'),
|
159 |
-
'desc' => __('Upload or Select from media gallery. Medium size is recommended (300px X 300px)','rich-snippets'),
|
160 |
-
'id' => $prefix . 'event_photo',
|
161 |
-
'class' => 'events',
|
162 |
-
'type' => 'file',
|
163 |
-
),
|
164 |
-
// Meta Settings for Music
|
165 |
-
array(
|
166 |
-
'name' => __('Rich Snippets - Music','rich-snippets'),
|
167 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
168 |
-
'id' => $prefix . 'music',
|
169 |
-
'class' => 'music',
|
170 |
-
'type' => 'title',
|
171 |
-
),
|
172 |
-
// Meta Settings for Organization
|
173 |
-
array(
|
174 |
-
'name' => __('Rich Snippets - Organization','rich-snippets'),
|
175 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
176 |
-
'id' => $prefix . 'organization',
|
177 |
-
'class' => 'organization',
|
178 |
-
'type' => 'title',
|
179 |
-
),
|
180 |
-
array(
|
181 |
-
'name' => __('Organization Name ','rich-snippets'),
|
182 |
-
'desc' => __('Enter the Company or Organization Name.','rich-snippets'),
|
183 |
-
'id' => $prefix . 'organization_name',
|
184 |
-
'class' => 'organization',
|
185 |
-
'type' => 'text',
|
186 |
-
),
|
187 |
-
array(
|
188 |
-
'name' => __('Website URL ','rich-snippets'),
|
189 |
-
'desc' => __('Enter the Organization homepage url.','rich-snippets'),
|
190 |
-
'id' => $prefix . 'organization_url',
|
191 |
-
'class' => 'organization',
|
192 |
-
'type' => 'text_medium',
|
193 |
-
),
|
194 |
-
array(
|
195 |
-
'name' => __('Contact No. ','rich-snippets'),
|
196 |
-
'desc' => __('Enter the Telephone No.','rich-snippets'),
|
197 |
-
'id' => $prefix . 'organization_tel',
|
198 |
-
'class' => 'organization',
|
199 |
-
'type' => 'text_medium',
|
200 |
-
),
|
201 |
-
array(
|
202 |
-
'name' => __('Address ','rich-snippets'),
|
203 |
-
'desc' => __('Street Name.','rich-snippets'),
|
204 |
-
'id' => $prefix . 'organization_street',
|
205 |
-
'class' => 'organization',
|
206 |
-
'type' => 'text_medium',
|
207 |
-
),
|
208 |
-
array(
|
209 |
-
'name' => __('','rich-snippets'),
|
210 |
-
'desc' => __('Locality.','rich-snippets'),
|
211 |
-
'id' => $prefix . 'organization_local',
|
212 |
-
'class' => 'organization',
|
213 |
-
'type' => 'text_medium',
|
214 |
-
),
|
215 |
-
array(
|
216 |
-
'name' => __('','rich-snippets'),
|
217 |
-
'desc' => __('Region.','rich-snippets'),
|
218 |
-
'id' => $prefix . 'organization_region',
|
219 |
-
'class' => 'organization',
|
220 |
-
'type' => 'text_medium',
|
221 |
-
),
|
222 |
-
array(
|
223 |
-
'name' => __('','rich-snippets'),
|
224 |
-
'desc' => __('Postal Code','rich-snippets'),
|
225 |
-
'id' => $prefix . 'organization_zip',
|
226 |
-
'class' => 'organization',
|
227 |
-
'type' => 'text_medium',
|
228 |
-
),
|
229 |
-
array(
|
230 |
-
'name' => __('','rich-snippets'),
|
231 |
-
'desc' => __('Country Name','rich-snippets'),
|
232 |
-
'id' => $prefix . 'organization_country',
|
233 |
-
'class' => 'organization',
|
234 |
-
'type' => 'text_medium',
|
235 |
-
),
|
236 |
-
array(
|
237 |
-
'name' => __('GEO Location','rich-snippets'),
|
238 |
-
'desc' => __('Latitude. <a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank">Find Here.</a>','rich-snippets'),
|
239 |
-
'id' => $prefix . 'organization_latitide',
|
240 |
-
'class' => 'organization',
|
241 |
-
'type' => 'text_medium',
|
242 |
-
),
|
243 |
-
array(
|
244 |
-
'name' => __('','rich-snippets'),
|
245 |
-
'desc' => __('Longitude.','rich-snippets'),
|
246 |
-
'id' => $prefix . 'organization_longitude',
|
247 |
-
'class' => 'organization',
|
248 |
-
'type' => 'text_medium',
|
249 |
-
),
|
250 |
-
// Meta Settings for People
|
251 |
-
array(
|
252 |
-
'name' => __('Rich Snippets - People','rich-snippets'),
|
253 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
254 |
-
'id' => $prefix . 'people',
|
255 |
-
'class' => 'people',
|
256 |
-
'type' => 'title',
|
257 |
-
),
|
258 |
-
array(
|
259 |
-
'name' => __('Person‘s Name','rich-snippets'),
|
260 |
-
'desc' => __('Enter the relative person‘s name.','rich-snippets'),
|
261 |
-
'id' => $prefix . 'people_fn',
|
262 |
-
'class' => 'people',
|
263 |
-
'type' => 'text_medium',
|
264 |
-
),
|
265 |
-
array(
|
266 |
-
'name' => __('Nickname','rich-snippets'),
|
267 |
-
'desc' => __('Enter the nickname (if any).','rich-snippets'),
|
268 |
-
'id' => $prefix . 'people_nickname',
|
269 |
-
'class' => 'people',
|
270 |
-
'type' => 'text_medium',
|
271 |
-
),
|
272 |
-
array(
|
273 |
-
'name' => __('Photograph','rich-snippets'),
|
274 |
-
'desc' => __('Upload the photo or select from media library. Medium size is recommended (300px X 300px)','rich-snippets'),
|
275 |
-
'id' => $prefix . 'people_photo',
|
276 |
-
'class' => 'people',
|
277 |
-
'type' => 'file',
|
278 |
-
),
|
279 |
-
array(
|
280 |
-
'name' => __('Job Title ','rich-snippets'),
|
281 |
-
'desc' => __('Enter job title.','rich-snippets'),
|
282 |
-
'id' => $prefix . 'people_job_title',
|
283 |
-
'class' => 'people',
|
284 |
-
'type' => 'text_medium',
|
285 |
-
),
|
286 |
-
array(
|
287 |
-
'name' => __('Homepage URL','rich-snippets'),
|
288 |
-
'desc' => __('Enter homepage URL(if any).','rich-snippets'),
|
289 |
-
'id' => $prefix . 'people_website',
|
290 |
-
'class' => 'people',
|
291 |
-
'type' => 'text_medium',
|
292 |
-
),
|
293 |
-
array(
|
294 |
-
'name' => __('Company / Organization','rich-snippets'),
|
295 |
-
'desc' => __('Enter Company or Organization name in affiliation.','rich-snippets'),
|
296 |
-
'id' => $prefix . 'people_company',
|
297 |
-
'class' => 'people',
|
298 |
-
'type' => 'text_medium',
|
299 |
-
),
|
300 |
-
array(
|
301 |
-
'name' => __('Address','rich-snippets'),
|
302 |
-
'desc' => __('Enter Locality','rich-snippets'),
|
303 |
-
'id' => $prefix . 'people_local',
|
304 |
-
'class' => 'people',
|
305 |
-
'type' => 'text_medium',
|
306 |
-
),
|
307 |
-
array(
|
308 |
-
'name' => __('','rich-snippets'),
|
309 |
-
'desc' => __('Region','rich-snippets'),
|
310 |
-
'id' => $prefix . 'people_region',
|
311 |
-
'class' => 'people',
|
312 |
-
'type' => 'text_medium',
|
313 |
-
),
|
314 |
-
// Meta Settings for Products
|
315 |
-
array(
|
316 |
-
'name' => __('Rich Snippets - Products','rich-snippets'),
|
317 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
318 |
-
'id' => $prefix . 'product',
|
319 |
-
'class' => 'product',
|
320 |
-
'type' => 'title',
|
321 |
-
),
|
322 |
-
array(
|
323 |
-
'name' => __('Your Rating','rich-snippets'),
|
324 |
-
'desc' => __('Rate this product or aggregate rating.','rich-snippets'),
|
325 |
-
'id' => $prefix . 'product_rating',
|
326 |
-
'class' => 'star product',
|
327 |
-
'type' => 'radio',
|
328 |
-
'options' => array(
|
329 |
-
array( 'name' => __('','rich-snippets'), 'value' => '1', ),
|
330 |
-
array( 'name' => __('','rich-snippets'), 'value' => '2', ),
|
331 |
-
array( 'name' => __('','rich-snippets'), 'value' => '3', ),
|
332 |
-
array( 'name' => __('','rich-snippets'), 'value' => '4', ),
|
333 |
-
array( 'name' => __('','rich-snippets'), 'value' => '5', ),
|
334 |
-
),
|
335 |
-
),
|
336 |
-
array(
|
337 |
-
'name' => __('Brand Name','rich-snippets'),
|
338 |
-
'desc' => __('Enter the products brand name','rich-snippets'),
|
339 |
-
'id' => $prefix . 'product_brand',
|
340 |
-
'class' => 'product',
|
341 |
-
'type' => 'text_medium',
|
342 |
-
),
|
343 |
-
array(
|
344 |
-
'name' => __('Product Name','rich-snippets'),
|
345 |
-
'desc' => __('Enter the product name.','rich-snippets'),
|
346 |
-
'id' => $prefix . 'product_name',
|
347 |
-
'class' => 'product',
|
348 |
-
'type' => 'text_medium',
|
349 |
-
),
|
350 |
-
array(
|
351 |
-
'name' => __('Product Image','rich-snippets'),
|
352 |
-
'desc' => __('Upload the product image or select from library. Medium size is recommended (300px X 300px)','rich-snippets'),
|
353 |
-
'id' => $prefix . 'product_image',
|
354 |
-
'class' => 'product',
|
355 |
-
'type' => 'file',
|
356 |
-
),
|
357 |
-
/* array(
|
358 |
-
'name' => __('Product Category','rich-snippets'),
|
359 |
-
'desc' => __('Select the product category.','rich-snippets'),
|
360 |
-
'id' => $prefix . 'product_cat',
|
361 |
-
'class' => 'product',
|
362 |
-
'type' => 'text_medium',
|
363 |
-
),*/
|
364 |
-
array(
|
365 |
-
'name' => __('Product Price','rich-snippets'),
|
366 |
-
'desc' => __('Enter the product Price.','rich-snippets'),
|
367 |
-
'id' => $prefix . 'product_price',
|
368 |
-
'class' => 'product',
|
369 |
-
'type' => 'text_small',
|
370 |
-
),
|
371 |
-
array(
|
372 |
-
'name' => __('Currency ','rich-snippets'),
|
373 |
-
'desc' => __('Enter the Currency Code(e.g USD, INR, AUD, EUR, GBP). <a href="http://www.science.co.il/International/Currency-Codes.asp" target="_blank"> Know you currency code</a>','rich-snippets'),
|
374 |
-
'id' => $prefix . 'product_cur',
|
375 |
-
'class' => 'product',
|
376 |
-
'type' => 'text_small',
|
377 |
-
),
|
378 |
-
array(
|
379 |
-
'name' => __('Availability','rich-snippets'),
|
380 |
-
'desc' => __('Select the products availability.','rich-snippets'),
|
381 |
-
'id' => $prefix . 'product_status',
|
382 |
-
'class' => 'product',
|
383 |
-
'type' => 'select',
|
384 |
-
'options' => array(
|
385 |
-
array('name' => __('__ Please Select __','rich-snippets'), 'value' => ''),
|
386 |
-
array('name' => __('Out of Stock','rich-snippets'), 'value' => 'out_of_stock'),
|
387 |
-
array('name' => __('In Stock','rich-snippets'), 'value' => 'in_stock'),
|
388 |
-
array('name' => __('In Store Only','rich-snippets'), 'value' => 'instore_only'),
|
389 |
-
array('name' => __('Pre-Order','rich-snippets'), 'value' => 'preorder'),
|
390 |
-
),
|
391 |
-
),
|
392 |
-
// Meta Settings for Recipes
|
393 |
-
array(
|
394 |
-
'name' => __('Rich Snippets - Recipes','rich-snippets'),
|
395 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
396 |
-
'id' => $prefix . 'recipes',
|
397 |
-
'class' => 'recipes',
|
398 |
-
'type' => 'title',
|
399 |
-
),
|
400 |
-
array(
|
401 |
-
'name' => __('Recipe Name ','rich-snippets'),
|
402 |
-
'desc' => __('Enter the recipe name.','rich-snippets'),
|
403 |
-
'id' => $prefix . 'recipes_name',
|
404 |
-
'class' => 'recipes',
|
405 |
-
'type' => 'text_medium',
|
406 |
-
),
|
407 |
-
array(
|
408 |
-
'name' => __('Time Required ','rich-snippets'),
|
409 |
-
'desc' => __('Preperation time (Format: 1H30M. H - Hours, M - Minutes )','rich-snippets'),
|
410 |
-
'id' => $prefix . 'recipes_preptime',
|
411 |
-
'class' => 'recipes',
|
412 |
-
'type' => 'text_small',
|
413 |
-
),
|
414 |
-
array(
|
415 |
-
'name' => __('','rich-snippets'),
|
416 |
-
'desc' => __('Cook Time. (Format: 1H30M. H - Hours, M - Minutes )','rich-snippets'),
|
417 |
-
'id' => $prefix . 'recipes_cooktime',
|
418 |
-
'class' => 'recipes',
|
419 |
-
'type' => 'text_small',
|
420 |
-
),
|
421 |
-
array(
|
422 |
-
'name' => __('','rich-snippets'),
|
423 |
-
'desc' => __('Total Time (Format: 1H30M. H - Hours, M - Minutes )','rich-snippets'),
|
424 |
-
'id' => $prefix . 'recipes_totaltime',
|
425 |
-
'class' => 'recipes',
|
426 |
-
'type' => 'text_small',
|
427 |
-
),
|
428 |
-
array(
|
429 |
-
'name' => __('Recipe Photo','rich-snippets'),
|
430 |
-
'desc' => __('Upload or Select recipe photo. Medium size is recommended (300px X 300px)','rich-snippets'),
|
431 |
-
'id' => $prefix . 'recipes_photo',
|
432 |
-
'class' => 'recipes',
|
433 |
-
'type' => 'file',
|
434 |
-
),
|
435 |
-
/* array(
|
436 |
-
'name' => __('','rich-snippets'),
|
437 |
-
'desc' => __('Enter the ingredients used','rich-snippets'),
|
438 |
-
'id' => $prefix . 'recipes_ingredient',
|
439 |
-
'class' => 'recipes',
|
440 |
-
'type' => 'textarea_small1',
|
441 |
-
),
|
442 |
-
array(
|
443 |
-
'name' => __('','rich-snippets'),
|
444 |
-
'desc' => __('Describe the recipe in short.','rich-snippets'),
|
445 |
-
'id' => $prefix . 'recipes_desc',
|
446 |
-
'class' => 'recipes',
|
447 |
-
'type' => 'textarea_small1',
|
448 |
-
),*/
|
449 |
-
// Meta Settings for Software Application
|
450 |
-
array(
|
451 |
-
'name' => __('Rich Snippets - Software Application','rich-snippets'),
|
452 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
453 |
-
'id' => $prefix . 'software',
|
454 |
-
'class' => 'software',
|
455 |
-
'type' => 'title',
|
456 |
-
),
|
457 |
-
array(
|
458 |
-
'name' => __('Software Rating','rich-snippets'),
|
459 |
-
'desc' => __('Rate this software.','rich-snippets'),
|
460 |
-
'id' => $prefix . 'software_rating',
|
461 |
-
'class' => 'star software',
|
462 |
-
'type' => 'radio',
|
463 |
-
'options' => array(
|
464 |
-
array( 'name' => __('','rich-snippets'), 'value' => '1', ),
|
465 |
-
array( 'name' => __('','rich-snippets'), 'value' => '2', ),
|
466 |
-
array( 'name' => __('','rich-snippets'), 'value' => '3', ),
|
467 |
-
array( 'name' => __('','rich-snippets'), 'value' => '4', ),
|
468 |
-
array( 'name' => __('','rich-snippets'), 'value' => '5', ),
|
469 |
-
),
|
470 |
-
),
|
471 |
-
array(
|
472 |
-
'name' => __('Price','rich-snippets'),
|
473 |
-
'desc' => __('Enter the Price of Software','rich-snippets'),
|
474 |
-
'id' => $prefix . 'software_price',
|
475 |
-
'class' => 'software',
|
476 |
-
'type' => 'text_small',
|
477 |
-
),
|
478 |
-
array(
|
479 |
-
'name' => __('Currency','rich-snippets'),
|
480 |
-
'desc' => __('Enter the Currency Code(e.g USD, INR, AUD, EUR, GBP). <a href="http://www.science.co.il/International/Currency-Codes.asp" target="_blank"> Know you currency code</a>','rich-snippets'),
|
481 |
-
'id' => $prefix . 'software_cur',
|
482 |
-
'class'=> 'software',
|
483 |
-
'type' => 'text_small',
|
484 |
-
),
|
485 |
-
array(
|
486 |
-
'name' => __('Software Name ','rich-snippets'),
|
487 |
-
'desc' => __('Enter the Software Name.','rich-snippets'),
|
488 |
-
'id' => $prefix . 'software_name',
|
489 |
-
'class' => 'software',
|
490 |
-
'type' => 'text_medium',
|
491 |
-
),
|
492 |
-
array(
|
493 |
-
'name' => __('Operating System','rich-snippets'),
|
494 |
-
'desc' => __('Enter the software Operating System.','rich-snippets'),
|
495 |
-
'id' => $prefix . 'software_os',
|
496 |
-
'class' => 'software',
|
497 |
-
'type' => 'text_medium',
|
498 |
-
),
|
499 |
-
array(
|
500 |
-
'name' => __('Software Image','rich-snippets'),
|
501 |
-
'desc' => __('Upload or select image of software. Medium size is recommended (300px X 300px)','rich-snippets'),
|
502 |
-
'id' => $prefix . 'software_image',
|
503 |
-
'class' => 'software',
|
504 |
-
'type' => 'file',
|
505 |
-
),
|
506 |
-
array(
|
507 |
-
'name' => __('Landing Page','rich-snippets'),
|
508 |
-
'desc' => __('Enter the landing page url for software','rich-snippets'),
|
509 |
-
'id' => $prefix . 'software_landing',
|
510 |
-
'class' => 'software',
|
511 |
-
'type' => 'text',
|
512 |
-
),
|
513 |
-
/*array(
|
514 |
-
'name' => __('Software Description','rich-snippets'),
|
515 |
-
'desc' => __('Enter the software description.','rich-snippets'),
|
516 |
-
'id' => $prefix . 'software_desc',
|
517 |
-
'class' => 'software',
|
518 |
-
'type' => 'textarea_small',
|
519 |
-
),*/
|
520 |
-
// Meta Settings for Video
|
521 |
-
array(
|
522 |
-
'name' => __('Rich Snippets - Videos','rich-snippets'),
|
523 |
-
'desc' => __('Please provide the following information.','rich-snippets'),
|
524 |
-
'id' => $prefix . 'video',
|
525 |
-
'class' => 'video',
|
526 |
-
'type' => 'title',
|
527 |
-
),
|
528 |
-
array(
|
529 |
-
'name' => __('Video Title','rich-snippets'),
|
530 |
-
'desc' => __('Enter the title for this video','rich-snippets'),
|
531 |
-
'id' => $prefix . 'video_title',
|
532 |
-
'class' => 'video',
|
533 |
-
'type' => 'text',
|
534 |
-
),
|
535 |
-
array(
|
536 |
-
'name' => __('Video Description','rich-snippets'),
|
537 |
-
'desc' => __('Enter the brief description for this video','rich-snippets'),
|
538 |
-
'id' => $prefix . 'video_desc',
|
539 |
-
'class' => 'video',
|
540 |
-
'type' => 'textarea_small',
|
541 |
-
),
|
542 |
-
array(
|
543 |
-
'name' => __('Video Thumbnail','rich-snippets'),
|
544 |
-
'desc' => __('Upload or select video thumbnail from gallery. Medium size is recommended (300px X 300px)','rich-snippets'),
|
545 |
-
'id' => $prefix . 'video_thumb',
|
546 |
-
'class' => 'video',
|
547 |
-
'type' => 'file',
|
548 |
-
),
|
549 |
-
array(
|
550 |
-
'name' => __('Video','rich-snippets'),
|
551 |
-
'desc' => __('Upload Video or enter the video file url','rich-snippets'),
|
552 |
-
'id' => $prefix . 'video_url',
|
553 |
-
'class' => 'video',
|
554 |
-
'type' => 'file',
|
555 |
-
),
|
556 |
-
array(
|
557 |
-
'name' => __('Video Duration','rich-snippets'),
|
558 |
-
'desc' => __('Enter the duration for this video','rich-snippets'),
|
559 |
-
'id' => $prefix . 'video_duration',
|
560 |
-
'class' => 'video',
|
561 |
-
'type' => 'text_small',
|
562 |
-
),
|
563 |
-
array(
|
564 |
-
'name' => __('Upload Date','rich-snippets'),
|
565 |
-
'desc' => __('Provide the date when the video is uploaded','rich-snippets'),
|
566 |
-
'id' => $prefix . 'video_date',
|
567 |
-
'class' => 'video',
|
568 |
-
'type' => 'text_date',
|
569 |
-
),
|
570 |
-
|
571 |
-
|
572 |
-
|
573 |
-
|
574 |
-
|
575 |
-
|
576 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
577 |
?>
|
1 |
+
<?php
|
2 |
+
// Metabox for review
|
3 |
+
function bsf_metaboxes( array $meta_boxes ) {
|
4 |
+
// Start with an underscore to hide fields from custom fields list
|
5 |
+
$prefix = '_bsf_';
|
6 |
+
$post_types=get_post_types('','names');
|
7 |
+
|
8 |
+
$meta_boxes[] = array(
|
9 |
+
'id' => 'review_metabox',
|
10 |
+
'title' => __('Configure Rich Snippet','rich-snippets'),
|
11 |
+
'pages' => $post_types, //array( 'post','page' ), // Custom Post types
|
12 |
+
'context' => 'normal',
|
13 |
+
'priority' => 'high',
|
14 |
+
'show_names' => true, // Show field names on the left
|
15 |
+
'fields' => array(
|
16 |
+
array(
|
17 |
+
'name' => __('','rich-snippets'),
|
18 |
+
'desc' => __('','rich-snippets'),
|
19 |
+
'id' => $prefix . 'post_type',
|
20 |
+
'class' => 'snippet-type',
|
21 |
+
'type' => 'select',
|
22 |
+
'options' => array(
|
23 |
+
array( 'name' => __('Select what this post is about','rich-snippets'), 'value' => '0', ),
|
24 |
+
array( 'name' => __('Item Review','rich-snippets'), 'value' => '1', ),
|
25 |
+
array( 'name' => __('Event','rich-snippets'), 'value' => '2', ),
|
26 |
+
// array( 'name' => __('Music','rich-snippets'), 'value' => '3', ),
|
27 |
+
// array( 'name' => __('Organization','rich-snippets'), 'value' => '4', ),
|
28 |
+
array( 'name' => __('People','rich-snippets'), 'value' => '5', ),
|
29 |
+
array( 'name' => __('Product','rich-snippets'), 'value' => '6', ),
|
30 |
+
array( 'name' => __('Recipe','rich-snippets'), 'value' => '7', ),
|
31 |
+
array( 'name' => __('Software Application','rich-snippets'), 'value' => '8', ),
|
32 |
+
array( 'name' => __('Video','rich-snippets'), 'value' => '9', ),
|
33 |
+
array( 'name' => __('Article','rich-snippets'), 'value' => '10', ),
|
34 |
+
),
|
35 |
+
),
|
36 |
+
// Meta Settings for Item Review
|
37 |
+
array(
|
38 |
+
'name' => __('Rich Snippets - Item Review','rich-snippets'),
|
39 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
40 |
+
'id' => $prefix . 'review_title',
|
41 |
+
'class' => 'review',
|
42 |
+
'type' => 'title',
|
43 |
+
),
|
44 |
+
array(
|
45 |
+
'name' => __('Reviewer’s Name ','rich-snippets'),
|
46 |
+
'desc' => __('Enter the name of Item Reviewer or The Post Author.','rich-snippets'),
|
47 |
+
'id' => $prefix . 'item_reviewer',
|
48 |
+
'class' => 'review',
|
49 |
+
'type' => 'text_medium',
|
50 |
+
),
|
51 |
+
array(
|
52 |
+
'name' => __('Item to be reviewed','rich-snippets'),
|
53 |
+
'desc' => __('Enter the name of the item, you are writing review about.','rich-snippets'),
|
54 |
+
'id' => $prefix . 'item_name',
|
55 |
+
'class' => 'review',
|
56 |
+
'type' => 'text',
|
57 |
+
),
|
58 |
+
array(
|
59 |
+
'name' => __('Your Rating','rich-snippets'),
|
60 |
+
'desc' => __(' Rate this item (1-5)','rich-snippets'),
|
61 |
+
'id' => $prefix . 'rating',
|
62 |
+
'class' => 'star review',
|
63 |
+
'type' => 'radio',
|
64 |
+
'options' => array(
|
65 |
+
array( 'name' => __('','rich-snippets'), 'value' => '1', ),
|
66 |
+
array( 'name' => __('','rich-snippets'), 'value' => '2', ),
|
67 |
+
array( 'name' => __('','rich-snippets'), 'value' => '3', ),
|
68 |
+
array( 'name' => __('','rich-snippets'), 'value' => '4', ),
|
69 |
+
array( 'name' => __('','rich-snippets'), 'value' => '5', ),
|
70 |
+
),
|
71 |
+
),
|
72 |
+
/* array(
|
73 |
+
'name' => __('','rich-snippets'),
|
74 |
+
'desc' => __('Enter the item description here','rich-snippets'),
|
75 |
+
'id' => $prefix . 'item_desc',
|
76 |
+
'class' => 'review',
|
77 |
+
'type' => 'textarea_small1',
|
78 |
+
),*/
|
79 |
+
// Meta Settings for Events
|
80 |
+
array(
|
81 |
+
'name' => __('Rich Snippets - Events','rich-snippets'),
|
82 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
83 |
+
'id' => $prefix . 'events',
|
84 |
+
'class' => 'events',
|
85 |
+
'type' => 'title',
|
86 |
+
),
|
87 |
+
array(
|
88 |
+
'name' => __('Event Title ','rich-snippets'),
|
89 |
+
'desc' => __('What would be the name of the event?','rich-snippets'),
|
90 |
+
'id' => $prefix . 'event_title',
|
91 |
+
'class' => 'events',
|
92 |
+
'type' => 'text',
|
93 |
+
),
|
94 |
+
array(
|
95 |
+
'name' => __('Location ','rich-snippets'),
|
96 |
+
'desc' => __('Organization Name Here','rich-snippets'),
|
97 |
+
'id' => $prefix . 'event_organization',
|
98 |
+
'class' => 'events',
|
99 |
+
'type' => 'text_medium',
|
100 |
+
),
|
101 |
+
array(
|
102 |
+
'name' => __('','rich-snippets'),
|
103 |
+
'desc' => __('Street Address','rich-snippets'),
|
104 |
+
'id' => $prefix . 'event_street',
|
105 |
+
'class' => 'events',
|
106 |
+
'type' => 'text_medium',
|
107 |
+
),
|
108 |
+
array(
|
109 |
+
'name' => __('','rich-snippets'),
|
110 |
+
'desc' => __('Locality','rich-snippets'),
|
111 |
+
'id' => $prefix . 'event_local',
|
112 |
+
'class' => 'events',
|
113 |
+
'type' => 'text_medium',
|
114 |
+
),
|
115 |
+
array(
|
116 |
+
'name' => __('','rich-snippets'),
|
117 |
+
'desc' => __('Region','rich-snippets'),
|
118 |
+
'id' => $prefix . 'event_region',
|
119 |
+
'class' => 'events',
|
120 |
+
'type' => 'text_medium',
|
121 |
+
),
|
122 |
+
/* array(
|
123 |
+
'name' => __('Description ','rich-snippets'),
|
124 |
+
'desc' => __('Describe the event in short.','rich-snippets'),
|
125 |
+
'id' => $prefix . 'event_desc',
|
126 |
+
'class' => 'events',
|
127 |
+
'type' => 'textarea_small',
|
128 |
+
),*/
|
129 |
+
array(
|
130 |
+
'name' => __('Start Date ','rich-snippets'),
|
131 |
+
'desc' => __('Provide the Event Start Date.','rich-snippets'),
|
132 |
+
'id' => $prefix . 'event_start_date',
|
133 |
+
'class' => 'events',
|
134 |
+
'type' => 'text_date',
|
135 |
+
),
|
136 |
+
array(
|
137 |
+
'name' => __('End Date ','rich-snippets'),
|
138 |
+
'desc' => __('Provide the Event End Date.','rich-snippets'),
|
139 |
+
'id' => $prefix . 'event_end_date',
|
140 |
+
'class' => 'events',
|
141 |
+
'type' => 'text_date',
|
142 |
+
),
|
143 |
+
array(
|
144 |
+
'name' => __('GEO Location ','rich-snippets'),
|
145 |
+
'desc' => __('Enter Latitude. <a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank">Find Here.</a>','rich-snippets'),
|
146 |
+
'id' => $prefix . 'event_geo_latitude',
|
147 |
+
'class' => 'events',
|
148 |
+
'type' => 'text_medium',
|
149 |
+
),
|
150 |
+
array(
|
151 |
+
'name' => __('','rich-snippets'),
|
152 |
+
'desc' => __('Enter Longitude','rich-snippets'),
|
153 |
+
'id' => $prefix . 'event_geo_longitude',
|
154 |
+
'class' => 'events',
|
155 |
+
'type' => 'text_medium',
|
156 |
+
),
|
157 |
+
array(
|
158 |
+
'name' => __('Event Photo ','rich-snippets'),
|
159 |
+
'desc' => __('Upload or Select from media gallery. Medium size is recommended (300px X 300px)','rich-snippets'),
|
160 |
+
'id' => $prefix . 'event_photo',
|
161 |
+
'class' => 'events',
|
162 |
+
'type' => 'file',
|
163 |
+
),
|
164 |
+
// Meta Settings for Music
|
165 |
+
array(
|
166 |
+
'name' => __('Rich Snippets - Music','rich-snippets'),
|
167 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
168 |
+
'id' => $prefix . 'music',
|
169 |
+
'class' => 'music',
|
170 |
+
'type' => 'title',
|
171 |
+
),
|
172 |
+
// Meta Settings for Organization
|
173 |
+
array(
|
174 |
+
'name' => __('Rich Snippets - Organization','rich-snippets'),
|
175 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
176 |
+
'id' => $prefix . 'organization',
|
177 |
+
'class' => 'organization',
|
178 |
+
'type' => 'title',
|
179 |
+
),
|
180 |
+
array(
|
181 |
+
'name' => __('Organization Name ','rich-snippets'),
|
182 |
+
'desc' => __('Enter the Company or Organization Name.','rich-snippets'),
|
183 |
+
'id' => $prefix . 'organization_name',
|
184 |
+
'class' => 'organization',
|
185 |
+
'type' => 'text',
|
186 |
+
),
|
187 |
+
array(
|
188 |
+
'name' => __('Website URL ','rich-snippets'),
|
189 |
+
'desc' => __('Enter the Organization homepage url.','rich-snippets'),
|
190 |
+
'id' => $prefix . 'organization_url',
|
191 |
+
'class' => 'organization',
|
192 |
+
'type' => 'text_medium',
|
193 |
+
),
|
194 |
+
array(
|
195 |
+
'name' => __('Contact No. ','rich-snippets'),
|
196 |
+
'desc' => __('Enter the Telephone No.','rich-snippets'),
|
197 |
+
'id' => $prefix . 'organization_tel',
|
198 |
+
'class' => 'organization',
|
199 |
+
'type' => 'text_medium',
|
200 |
+
),
|
201 |
+
array(
|
202 |
+
'name' => __('Address ','rich-snippets'),
|
203 |
+
'desc' => __('Street Name.','rich-snippets'),
|
204 |
+
'id' => $prefix . 'organization_street',
|
205 |
+
'class' => 'organization',
|
206 |
+
'type' => 'text_medium',
|
207 |
+
),
|
208 |
+
array(
|
209 |
+
'name' => __('','rich-snippets'),
|
210 |
+
'desc' => __('Locality.','rich-snippets'),
|
211 |
+
'id' => $prefix . 'organization_local',
|
212 |
+
'class' => 'organization',
|
213 |
+
'type' => 'text_medium',
|
214 |
+
),
|
215 |
+
array(
|
216 |
+
'name' => __('','rich-snippets'),
|
217 |
+
'desc' => __('Region.','rich-snippets'),
|
218 |
+
'id' => $prefix . 'organization_region',
|
219 |
+
'class' => 'organization',
|
220 |
+
'type' => 'text_medium',
|
221 |
+
),
|
222 |
+
array(
|
223 |
+
'name' => __('','rich-snippets'),
|
224 |
+
'desc' => __('Postal Code','rich-snippets'),
|
225 |
+
'id' => $prefix . 'organization_zip',
|
226 |
+
'class' => 'organization',
|
227 |
+
'type' => 'text_medium',
|
228 |
+
),
|
229 |
+
array(
|
230 |
+
'name' => __('','rich-snippets'),
|
231 |
+
'desc' => __('Country Name','rich-snippets'),
|
232 |
+
'id' => $prefix . 'organization_country',
|
233 |
+
'class' => 'organization',
|
234 |
+
'type' => 'text_medium',
|
235 |
+
),
|
236 |
+
array(
|
237 |
+
'name' => __('GEO Location','rich-snippets'),
|
238 |
+
'desc' => __('Latitude. <a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank">Find Here.</a>','rich-snippets'),
|
239 |
+
'id' => $prefix . 'organization_latitide',
|
240 |
+
'class' => 'organization',
|
241 |
+
'type' => 'text_medium',
|
242 |
+
),
|
243 |
+
array(
|
244 |
+
'name' => __('','rich-snippets'),
|
245 |
+
'desc' => __('Longitude.','rich-snippets'),
|
246 |
+
'id' => $prefix . 'organization_longitude',
|
247 |
+
'class' => 'organization',
|
248 |
+
'type' => 'text_medium',
|
249 |
+
),
|
250 |
+
// Meta Settings for People
|
251 |
+
array(
|
252 |
+
'name' => __('Rich Snippets - People','rich-snippets'),
|
253 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
254 |
+
'id' => $prefix . 'people',
|
255 |
+
'class' => 'people',
|
256 |
+
'type' => 'title',
|
257 |
+
),
|
258 |
+
array(
|
259 |
+
'name' => __('Person‘s Name','rich-snippets'),
|
260 |
+
'desc' => __('Enter the relative person‘s name.','rich-snippets'),
|
261 |
+
'id' => $prefix . 'people_fn',
|
262 |
+
'class' => 'people',
|
263 |
+
'type' => 'text_medium',
|
264 |
+
),
|
265 |
+
array(
|
266 |
+
'name' => __('Nickname','rich-snippets'),
|
267 |
+
'desc' => __('Enter the nickname (if any).','rich-snippets'),
|
268 |
+
'id' => $prefix . 'people_nickname',
|
269 |
+
'class' => 'people',
|
270 |
+
'type' => 'text_medium',
|
271 |
+
),
|
272 |
+
array(
|
273 |
+
'name' => __('Photograph','rich-snippets'),
|
274 |
+
'desc' => __('Upload the photo or select from media library. Medium size is recommended (300px X 300px)','rich-snippets'),
|
275 |
+
'id' => $prefix . 'people_photo',
|
276 |
+
'class' => 'people',
|
277 |
+
'type' => 'file',
|
278 |
+
),
|
279 |
+
array(
|
280 |
+
'name' => __('Job Title ','rich-snippets'),
|
281 |
+
'desc' => __('Enter job title.','rich-snippets'),
|
282 |
+
'id' => $prefix . 'people_job_title',
|
283 |
+
'class' => 'people',
|
284 |
+
'type' => 'text_medium',
|
285 |
+
),
|
286 |
+
array(
|
287 |
+
'name' => __('Homepage URL','rich-snippets'),
|
288 |
+
'desc' => __('Enter homepage URL(if any).','rich-snippets'),
|
289 |
+
'id' => $prefix . 'people_website',
|
290 |
+
'class' => 'people',
|
291 |
+
'type' => 'text_medium',
|
292 |
+
),
|
293 |
+
array(
|
294 |
+
'name' => __('Company / Organization','rich-snippets'),
|
295 |
+
'desc' => __('Enter Company or Organization name in affiliation.','rich-snippets'),
|
296 |
+
'id' => $prefix . 'people_company',
|
297 |
+
'class' => 'people',
|
298 |
+
'type' => 'text_medium',
|
299 |
+
),
|
300 |
+
array(
|
301 |
+
'name' => __('Address','rich-snippets'),
|
302 |
+
'desc' => __('Enter Locality','rich-snippets'),
|
303 |
+
'id' => $prefix . 'people_local',
|
304 |
+
'class' => 'people',
|
305 |
+
'type' => 'text_medium',
|
306 |
+
),
|
307 |
+
array(
|
308 |
+
'name' => __('','rich-snippets'),
|
309 |
+
'desc' => __('Region','rich-snippets'),
|
310 |
+
'id' => $prefix . 'people_region',
|
311 |
+
'class' => 'people',
|
312 |
+
'type' => 'text_medium',
|
313 |
+
),
|
314 |
+
// Meta Settings for Products
|
315 |
+
array(
|
316 |
+
'name' => __('Rich Snippets - Products','rich-snippets'),
|
317 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
318 |
+
'id' => $prefix . 'product',
|
319 |
+
'class' => 'product',
|
320 |
+
'type' => 'title',
|
321 |
+
),
|
322 |
+
array(
|
323 |
+
'name' => __('Your Rating','rich-snippets'),
|
324 |
+
'desc' => __('Rate this product or aggregate rating.','rich-snippets'),
|
325 |
+
'id' => $prefix . 'product_rating',
|
326 |
+
'class' => 'star product',
|
327 |
+
'type' => 'radio',
|
328 |
+
'options' => array(
|
329 |
+
array( 'name' => __('','rich-snippets'), 'value' => '1', ),
|
330 |
+
array( 'name' => __('','rich-snippets'), 'value' => '2', ),
|
331 |
+
array( 'name' => __('','rich-snippets'), 'value' => '3', ),
|
332 |
+
array( 'name' => __('','rich-snippets'), 'value' => '4', ),
|
333 |
+
array( 'name' => __('','rich-snippets'), 'value' => '5', ),
|
334 |
+
),
|
335 |
+
),
|
336 |
+
array(
|
337 |
+
'name' => __('Brand Name','rich-snippets'),
|
338 |
+
'desc' => __('Enter the products brand name','rich-snippets'),
|
339 |
+
'id' => $prefix . 'product_brand',
|
340 |
+
'class' => 'product',
|
341 |
+
'type' => 'text_medium',
|
342 |
+
),
|
343 |
+
array(
|
344 |
+
'name' => __('Product Name','rich-snippets'),
|
345 |
+
'desc' => __('Enter the product name.','rich-snippets'),
|
346 |
+
'id' => $prefix . 'product_name',
|
347 |
+
'class' => 'product',
|
348 |
+
'type' => 'text_medium',
|
349 |
+
),
|
350 |
+
array(
|
351 |
+
'name' => __('Product Image','rich-snippets'),
|
352 |
+
'desc' => __('Upload the product image or select from library. Medium size is recommended (300px X 300px)','rich-snippets'),
|
353 |
+
'id' => $prefix . 'product_image',
|
354 |
+
'class' => 'product',
|
355 |
+
'type' => 'file',
|
356 |
+
),
|
357 |
+
/* array(
|
358 |
+
'name' => __('Product Category','rich-snippets'),
|
359 |
+
'desc' => __('Select the product category.','rich-snippets'),
|
360 |
+
'id' => $prefix . 'product_cat',
|
361 |
+
'class' => 'product',
|
362 |
+
'type' => 'text_medium',
|
363 |
+
),*/
|
364 |
+
array(
|
365 |
+
'name' => __('Product Price','rich-snippets'),
|
366 |
+
'desc' => __('Enter the product Price.','rich-snippets'),
|
367 |
+
'id' => $prefix . 'product_price',
|
368 |
+
'class' => 'product',
|
369 |
+
'type' => 'text_small',
|
370 |
+
),
|
371 |
+
array(
|
372 |
+
'name' => __('Currency ','rich-snippets'),
|
373 |
+
'desc' => __('Enter the Currency Code(e.g USD, INR, AUD, EUR, GBP). <a href="http://www.science.co.il/International/Currency-Codes.asp" target="_blank"> Know you currency code</a>','rich-snippets'),
|
374 |
+
'id' => $prefix . 'product_cur',
|
375 |
+
'class' => 'product',
|
376 |
+
'type' => 'text_small',
|
377 |
+
),
|
378 |
+
array(
|
379 |
+
'name' => __('Availability','rich-snippets'),
|
380 |
+
'desc' => __('Select the products availability.','rich-snippets'),
|
381 |
+
'id' => $prefix . 'product_status',
|
382 |
+
'class' => 'product',
|
383 |
+
'type' => 'select',
|
384 |
+
'options' => array(
|
385 |
+
array('name' => __('__ Please Select __','rich-snippets'), 'value' => ''),
|
386 |
+
array('name' => __('Out of Stock','rich-snippets'), 'value' => 'out_of_stock'),
|
387 |
+
array('name' => __('In Stock','rich-snippets'), 'value' => 'in_stock'),
|
388 |
+
array('name' => __('In Store Only','rich-snippets'), 'value' => 'instore_only'),
|
389 |
+
array('name' => __('Pre-Order','rich-snippets'), 'value' => 'preorder'),
|
390 |
+
),
|
391 |
+
),
|
392 |
+
// Meta Settings for Recipes
|
393 |
+
array(
|
394 |
+
'name' => __('Rich Snippets - Recipes','rich-snippets'),
|
395 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
396 |
+
'id' => $prefix . 'recipes',
|
397 |
+
'class' => 'recipes',
|
398 |
+
'type' => 'title',
|
399 |
+
),
|
400 |
+
array(
|
401 |
+
'name' => __('Recipe Name ','rich-snippets'),
|
402 |
+
'desc' => __('Enter the recipe name.','rich-snippets'),
|
403 |
+
'id' => $prefix . 'recipes_name',
|
404 |
+
'class' => 'recipes',
|
405 |
+
'type' => 'text_medium',
|
406 |
+
),
|
407 |
+
array(
|
408 |
+
'name' => __('Time Required ','rich-snippets'),
|
409 |
+
'desc' => __('Preperation time (Format: 1H30M. H - Hours, M - Minutes )','rich-snippets'),
|
410 |
+
'id' => $prefix . 'recipes_preptime',
|
411 |
+
'class' => 'recipes',
|
412 |
+
'type' => 'text_small',
|
413 |
+
),
|
414 |
+
array(
|
415 |
+
'name' => __('','rich-snippets'),
|
416 |
+
'desc' => __('Cook Time. (Format: 1H30M. H - Hours, M - Minutes )','rich-snippets'),
|
417 |
+
'id' => $prefix . 'recipes_cooktime',
|
418 |
+
'class' => 'recipes',
|
419 |
+
'type' => 'text_small',
|
420 |
+
),
|
421 |
+
array(
|
422 |
+
'name' => __('','rich-snippets'),
|
423 |
+
'desc' => __('Total Time (Format: 1H30M. H - Hours, M - Minutes )','rich-snippets'),
|
424 |
+
'id' => $prefix . 'recipes_totaltime',
|
425 |
+
'class' => 'recipes',
|
426 |
+
'type' => 'text_small',
|
427 |
+
),
|
428 |
+
array(
|
429 |
+
'name' => __('Recipe Photo','rich-snippets'),
|
430 |
+
'desc' => __('Upload or Select recipe photo. Medium size is recommended (300px X 300px)','rich-snippets'),
|
431 |
+
'id' => $prefix . 'recipes_photo',
|
432 |
+
'class' => 'recipes',
|
433 |
+
'type' => 'file',
|
434 |
+
),
|
435 |
+
/* array(
|
436 |
+
'name' => __('','rich-snippets'),
|
437 |
+
'desc' => __('Enter the ingredients used','rich-snippets'),
|
438 |
+
'id' => $prefix . 'recipes_ingredient',
|
439 |
+
'class' => 'recipes',
|
440 |
+
'type' => 'textarea_small1',
|
441 |
+
),
|
442 |
+
array(
|
443 |
+
'name' => __('','rich-snippets'),
|
444 |
+
'desc' => __('Describe the recipe in short.','rich-snippets'),
|
445 |
+
'id' => $prefix . 'recipes_desc',
|
446 |
+
'class' => 'recipes',
|
447 |
+
'type' => 'textarea_small1',
|
448 |
+
),*/
|
449 |
+
// Meta Settings for Software Application
|
450 |
+
array(
|
451 |
+
'name' => __('Rich Snippets - Software Application','rich-snippets'),
|
452 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
453 |
+
'id' => $prefix . 'software',
|
454 |
+
'class' => 'software',
|
455 |
+
'type' => 'title',
|
456 |
+
),
|
457 |
+
array(
|
458 |
+
'name' => __('Software Rating','rich-snippets'),
|
459 |
+
'desc' => __('Rate this software.','rich-snippets'),
|
460 |
+
'id' => $prefix . 'software_rating',
|
461 |
+
'class' => 'star software',
|
462 |
+
'type' => 'radio',
|
463 |
+
'options' => array(
|
464 |
+
array( 'name' => __('','rich-snippets'), 'value' => '1', ),
|
465 |
+
array( 'name' => __('','rich-snippets'), 'value' => '2', ),
|
466 |
+
array( 'name' => __('','rich-snippets'), 'value' => '3', ),
|
467 |
+
array( 'name' => __('','rich-snippets'), 'value' => '4', ),
|
468 |
+
array( 'name' => __('','rich-snippets'), 'value' => '5', ),
|
469 |
+
),
|
470 |
+
),
|
471 |
+
array(
|
472 |
+
'name' => __('Price','rich-snippets'),
|
473 |
+
'desc' => __('Enter the Price of Software','rich-snippets'),
|
474 |
+
'id' => $prefix . 'software_price',
|
475 |
+
'class' => 'software',
|
476 |
+
'type' => 'text_small',
|
477 |
+
),
|
478 |
+
array(
|
479 |
+
'name' => __('Currency','rich-snippets'),
|
480 |
+
'desc' => __('Enter the Currency Code(e.g USD, INR, AUD, EUR, GBP). <a href="http://www.science.co.il/International/Currency-Codes.asp" target="_blank"> Know you currency code</a>','rich-snippets'),
|
481 |
+
'id' => $prefix . 'software_cur',
|
482 |
+
'class'=> 'software',
|
483 |
+
'type' => 'text_small',
|
484 |
+
),
|
485 |
+
array(
|
486 |
+
'name' => __('Software Name ','rich-snippets'),
|
487 |
+
'desc' => __('Enter the Software Name.','rich-snippets'),
|
488 |
+
'id' => $prefix . 'software_name',
|
489 |
+
'class' => 'software',
|
490 |
+
'type' => 'text_medium',
|
491 |
+
),
|
492 |
+
array(
|
493 |
+
'name' => __('Operating System','rich-snippets'),
|
494 |
+
'desc' => __('Enter the software Operating System.','rich-snippets'),
|
495 |
+
'id' => $prefix . 'software_os',
|
496 |
+
'class' => 'software',
|
497 |
+
'type' => 'text_medium',
|
498 |
+
),
|
499 |
+
array(
|
500 |
+
'name' => __('Software Image','rich-snippets'),
|
501 |
+
'desc' => __('Upload or select image of software. Medium size is recommended (300px X 300px)','rich-snippets'),
|
502 |
+
'id' => $prefix . 'software_image',
|
503 |
+
'class' => 'software',
|
504 |
+
'type' => 'file',
|
505 |
+
),
|
506 |
+
array(
|
507 |
+
'name' => __('Landing Page','rich-snippets'),
|
508 |
+
'desc' => __('Enter the landing page url for software','rich-snippets'),
|
509 |
+
'id' => $prefix . 'software_landing',
|
510 |
+
'class' => 'software',
|
511 |
+
'type' => 'text',
|
512 |
+
),
|
513 |
+
/*array(
|
514 |
+
'name' => __('Software Description','rich-snippets'),
|
515 |
+
'desc' => __('Enter the software description.','rich-snippets'),
|
516 |
+
'id' => $prefix . 'software_desc',
|
517 |
+
'class' => 'software',
|
518 |
+
'type' => 'textarea_small',
|
519 |
+
),*/
|
520 |
+
// Meta Settings for Video
|
521 |
+
array(
|
522 |
+
'name' => __('Rich Snippets - Videos','rich-snippets'),
|
523 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
524 |
+
'id' => $prefix . 'video',
|
525 |
+
'class' => 'video',
|
526 |
+
'type' => 'title',
|
527 |
+
),
|
528 |
+
array(
|
529 |
+
'name' => __('Video Title','rich-snippets'),
|
530 |
+
'desc' => __('Enter the title for this video','rich-snippets'),
|
531 |
+
'id' => $prefix . 'video_title',
|
532 |
+
'class' => 'video',
|
533 |
+
'type' => 'text',
|
534 |
+
),
|
535 |
+
array(
|
536 |
+
'name' => __('Video Description','rich-snippets'),
|
537 |
+
'desc' => __('Enter the brief description for this video','rich-snippets'),
|
538 |
+
'id' => $prefix . 'video_desc',
|
539 |
+
'class' => 'video',
|
540 |
+
'type' => 'textarea_small',
|
541 |
+
),
|
542 |
+
array(
|
543 |
+
'name' => __('Video Thumbnail','rich-snippets'),
|
544 |
+
'desc' => __('Upload or select video thumbnail from gallery. Medium size is recommended (300px X 300px)','rich-snippets'),
|
545 |
+
'id' => $prefix . 'video_thumb',
|
546 |
+
'class' => 'video',
|
547 |
+
'type' => 'file',
|
548 |
+
),
|
549 |
+
array(
|
550 |
+
'name' => __('Video','rich-snippets'),
|
551 |
+
'desc' => __('Upload Video or enter the video file url','rich-snippets'),
|
552 |
+
'id' => $prefix . 'video_url',
|
553 |
+
'class' => 'video',
|
554 |
+
'type' => 'file',
|
555 |
+
),
|
556 |
+
array(
|
557 |
+
'name' => __('Video Duration','rich-snippets'),
|
558 |
+
'desc' => __('Enter the duration for this video','rich-snippets'),
|
559 |
+
'id' => $prefix . 'video_duration',
|
560 |
+
'class' => 'video',
|
561 |
+
'type' => 'text_small',
|
562 |
+
),
|
563 |
+
array(
|
564 |
+
'name' => __('Upload Date','rich-snippets'),
|
565 |
+
'desc' => __('Provide the date when the video is uploaded','rich-snippets'),
|
566 |
+
'id' => $prefix . 'video_date',
|
567 |
+
'class' => 'video',
|
568 |
+
'type' => 'text_date',
|
569 |
+
),
|
570 |
+
// Meta Settings for Article
|
571 |
+
array(
|
572 |
+
'name' => __('Rich Snippets - Article','rich-snippets'),
|
573 |
+
'desc' => __('Please provide the following information.','rich-snippets'),
|
574 |
+
'id' => $prefix . 'article',
|
575 |
+
'class' => 'article',
|
576 |
+
'type' => 'title',
|
577 |
+
),
|
578 |
+
array(
|
579 |
+
'name' => __('Article Name','rich-snippets'),
|
580 |
+
'desc' => __('Enter the name for this article','rich-snippets'),
|
581 |
+
'id' => $prefix . 'article_name',
|
582 |
+
'class' => 'article',
|
583 |
+
'type' => 'text',
|
584 |
+
),
|
585 |
+
array(
|
586 |
+
'name' => __('Author','rich-snippets'),
|
587 |
+
'desc' => __('Enter the author name for this article','rich-snippets'),
|
588 |
+
'id' => $prefix . 'article_author',
|
589 |
+
'class' => 'article',
|
590 |
+
'type' => 'text',
|
591 |
+
),
|
592 |
+
array(
|
593 |
+
'name' => __('Short Description','rich-snippets'),
|
594 |
+
'desc' => __('Enter the brief description about this article (About 30 Words)','rich-snippets'),
|
595 |
+
'id' => $prefix . 'article_desc',
|
596 |
+
'class' => 'article',
|
597 |
+
'type' => 'textarea_small',
|
598 |
+
),
|
599 |
+
array(
|
600 |
+
'name' => __('Article Image','rich-snippets'),
|
601 |
+
'desc' => __('Upload or select image from gallery. Medium size is recommended (300px X 300px)','rich-snippets'),
|
602 |
+
'id' => $prefix . 'article_image',
|
603 |
+
'class' => 'article',
|
604 |
+
'type' => 'file',
|
605 |
+
),
|
606 |
+
),
|
607 |
+
);
|
608 |
+
// Add other metaboxes as needed
|
609 |
+
return $meta_boxes;
|
610 |
+
}
|
611 |
?>
|
readme.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
=== All In One Schema.org Rich Snippets ===
|
2 |
-
It gives search engines only the important & precise information to display in search result snippets.
|
3 |
-
Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
|
4 |
-
[See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
|
5 |
-
Helps you rank higher in search results
|
6 |
-
Helps Facebook display proper information when users share your links on Facebook
|
7 |
-
Even simpler, shorter, typographic and more beautiful design of MicroData box. May be like this https://moqups.com/brainstormforce/5P0EaLtt
|
8 |
-
Redesigned admin panel
|
9 |
-
Refined MicroData input options
|
10 |
-
Support for more post types (Local Business, etc)
|
11 |
-
It gives search engines only the important & precise information to display in search result snippets.
|
12 |
-
Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
|
13 |
-
[See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
|
14 |
-
Helps you rank higher in search results
|
15 |
-
Helps Facebook display proper information when users share your links on Facebook
|
16 |
-
It gives search engines only the important & precise information to display in search result snippets.
|
17 |
-
Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
|
18 |
-
[See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
|
19 |
-
Helps you rank higher in search results
|
20 |
-
Helps Facebook display proper information when users share your links on Facebook
|
21 |
-
Even simpler, shorter, typographic and more beautiful design of MicroData box. May be like this https://moqups.com/brainstormforce/5P0EaLtt
|
22 |
-
Redesigned admin panel
|
23 |
-
Refined MicroData input options
|
24 |
-
Support for more post types (Local Business, etc)
|
25 |
-
It gives search engines only the important & precise information to display in search result snippets.
|
26 |
-
Rich Snippets are very interactive (photos, star ratings, price, author, etc.) to let you stand out from competition
|
27 |
-
[See what difference it makes](http://dashburst.com/google-search-what-are-rich-snippets/ "See the difference") in CTR (Click Through Rate)
|
28 |
-
Helps you rank higher in search results
|
29 |
-
Helps Facebook display proper information when users share your links on Facebook
|
1 |
+
=== All In One Schema.org Rich Snippets ===
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
settings.php
CHANGED
@@ -1,112 +1,124 @@
|
|
1 |
-
<?php
|
2 |
-
// Function to add review option for settings
|
3 |
-
function add_review_option()
|
4 |
-
{
|
5 |
-
$review_opt = array(
|
6 |
-
'review_title' => __('Summary','rich-snippets'),
|
7 |
-
'item_reviewer' => __('Reviewer','rich-snippets'),
|
8 |
-
'review_date' => __('Review Date','rich-snippets'),
|
9 |
-
'item_name' => __('Reviewed Item','rich-snippets'),
|
10 |
-
// 'item_description' => __('Description','rich-snippets'),
|
11 |
-
'item_rating' => __('Author Rating','rich-snippets')
|
12 |
-
);
|
13 |
-
add_option('bsf_review',$review_opt);
|
14 |
-
}
|
15 |
-
// Function to add event option for settings
|
16 |
-
function add_event_option()
|
17 |
-
{
|
18 |
-
$event_opt = array(
|
19 |
-
'snippet_title' => __('Summary','rich-snippets'),
|
20 |
-
'event_title' => __('Event','rich-snippets'),
|
21 |
-
'event_location' => __('Location','rich-snippets'),
|
22 |
-
// 'event_desc' => __('Description','rich-snippets'),
|
23 |
-
'start_time' => __('Starting on','rich-snippets'),
|
24 |
-
'end_time' => __('Ending on','rich-snippets')
|
25 |
-
|
26 |
-
)
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
'
|
35 |
-
'
|
36 |
-
'
|
37 |
-
'
|
38 |
-
'
|
39 |
-
'
|
40 |
-
)
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
'
|
49 |
-
'
|
50 |
-
'
|
51 |
-
'
|
52 |
-
'
|
53 |
-
'
|
54 |
-
)
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
'
|
63 |
-
'
|
64 |
-
'
|
65 |
-
'
|
66 |
-
'
|
67 |
-
|
68 |
-
// '
|
69 |
-
'
|
70 |
-
)
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
'
|
79 |
-
'
|
80 |
-
'
|
81 |
-
'
|
82 |
-
'
|
83 |
-
|
84 |
-
)
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
'
|
93 |
-
'
|
94 |
-
'
|
95 |
-
'
|
96 |
-
)
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
'
|
105 |
-
'
|
106 |
-
'
|
107 |
-
'
|
108 |
-
)
|
109 |
-
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
112 |
?>
|
1 |
+
<?php
|
2 |
+
// Function to add review option for settings
|
3 |
+
function add_review_option()
|
4 |
+
{
|
5 |
+
$review_opt = array(
|
6 |
+
'review_title' => __('Summary','rich-snippets'),
|
7 |
+
'item_reviewer' => __('Reviewer','rich-snippets'),
|
8 |
+
'review_date' => __('Review Date','rich-snippets'),
|
9 |
+
'item_name' => __('Reviewed Item','rich-snippets'),
|
10 |
+
// 'item_description' => __('Description','rich-snippets'),
|
11 |
+
'item_rating' => __('Author Rating','rich-snippets')
|
12 |
+
);
|
13 |
+
add_option('bsf_review',$review_opt);
|
14 |
+
}
|
15 |
+
// Function to add event option for settings
|
16 |
+
function add_event_option()
|
17 |
+
{
|
18 |
+
$event_opt = array(
|
19 |
+
'snippet_title' => __('Summary','rich-snippets'),
|
20 |
+
'event_title' => __('Event','rich-snippets'),
|
21 |
+
'event_location' => __('Location','rich-snippets'),
|
22 |
+
// 'event_desc' => __('Description','rich-snippets'),
|
23 |
+
'start_time' => __('Starting on','rich-snippets'),
|
24 |
+
'end_time' => __('Ending on','rich-snippets')
|
25 |
+
|
26 |
+
// 'geo_location' => __('GEO Location','rich-snippets')
|
27 |
+
);
|
28 |
+
add_option('bsf_event',$event_opt);
|
29 |
+
}
|
30 |
+
// Function to add person option for settings
|
31 |
+
function add_person_option()
|
32 |
+
{
|
33 |
+
$person_opt = array(
|
34 |
+
'snippet_title' => __('Summary','rich-snippets'),
|
35 |
+
'person_name' => __('Name','rich-snippets'),
|
36 |
+
'person_nickname' => __('Nickname','rich-snippets'),
|
37 |
+
'person_job_title' => __('Job Title','rich-snippets'),
|
38 |
+
'person_website' => __('Website','rich-snippets'),
|
39 |
+
'person_company' => __('Company','rich-snippets'),
|
40 |
+
'person_address' => __('Address','rich-snippets')
|
41 |
+
);
|
42 |
+
add_option('bsf_person',$person_opt);
|
43 |
+
}
|
44 |
+
// Function to add product option for settings
|
45 |
+
function add_product_option()
|
46 |
+
{
|
47 |
+
$product_opt = array(
|
48 |
+
'snippet_title' => __('Summary','rich-snippets'),
|
49 |
+
'product_rating' => __('Author Rating','rich-snippets'),
|
50 |
+
'product_brand' => __('Brand Name','rich-snippets'),
|
51 |
+
'product_name' => __('Product Name','rich-snippets'),
|
52 |
+
'product_agr' => __('Aggregate Rating','rich-snippets'),
|
53 |
+
'product_price' => __('Price','rich-snippets'),
|
54 |
+
'product_avail' => __('Product Availability','rich-snippets')
|
55 |
+
);
|
56 |
+
add_option('bsf_product',$product_opt);
|
57 |
+
}
|
58 |
+
// Function to add recipe option for settings
|
59 |
+
function add_recipe_option()
|
60 |
+
{
|
61 |
+
$recipe_opt = array(
|
62 |
+
'snippet_title' => __('Summary','rich-snippets'),
|
63 |
+
'recipe_name' => __('Recipe Name','rich-snippets'),
|
64 |
+
'recipe_pub' => __('Published On','rich-snippets'),
|
65 |
+
'recipe_prep' => __('Preparation Time','rich-snippets'),
|
66 |
+
'recipe_cook' => __('Cook Time','rich-snippets'),
|
67 |
+
'recipe_time' => __('Total Time','rich-snippets'),
|
68 |
+
// 'recipe_ingred' => __('Ingredients','rich-snippets'),
|
69 |
+
// 'recipe_summary' => __('Brief Summary','rich-snippets'),
|
70 |
+
'recipe_rating' => __('Average Rating','rich-snippets')
|
71 |
+
);
|
72 |
+
add_option('bsf_recipe',$recipe_opt);
|
73 |
+
}
|
74 |
+
// Function to add software option for settings
|
75 |
+
function add_software_option()
|
76 |
+
{
|
77 |
+
$software_opt = array(
|
78 |
+
'snippet_title' => __('Summary','rich-snippets'),
|
79 |
+
'software_rating' => __('Author Rating','rich-snippets'),
|
80 |
+
'software_price' => __('Price','rich-snippets'),
|
81 |
+
'software_name' => __('Software Name','rich-snippets'),
|
82 |
+
'software_os' => __('Operating System','rich-snippets'),
|
83 |
+
'software_website' => __('Landing Page','rich-snippets')
|
84 |
+
// 'software_desc' => __('Brief Description','rich-snippets')
|
85 |
+
);
|
86 |
+
add_option('bsf_software',$software_opt);
|
87 |
+
}
|
88 |
+
// Function to add video option for settings
|
89 |
+
function add_video_option()
|
90 |
+
{
|
91 |
+
$video_opt = array(
|
92 |
+
'snippet_title' => __('Summary','rich-snippets'),
|
93 |
+
'video_title' => __('Title','rich-snippets'),
|
94 |
+
'video_desc' => __('Description','rich-snippets'),
|
95 |
+
'video_time' => __('Duration','rich-snippets'),
|
96 |
+
'video_date' => __('Upload Date','rich-snippets')
|
97 |
+
);
|
98 |
+
add_option('bsf_video',$video_opt);
|
99 |
+
}
|
100 |
+
// Function to add article option for settings
|
101 |
+
function add_article_option()
|
102 |
+
{
|
103 |
+
$article_opt = array(
|
104 |
+
'snippet_title' => __('Summary','rich-snippets'),
|
105 |
+
'article_name' => __('Article Name','rich-snippets'),
|
106 |
+
'article_author' => __('Author','rich-snippets'),
|
107 |
+
'article_desc' => __('Description','rich-snippets'),
|
108 |
+
'article_image' => __('Image','rich-snippets')
|
109 |
+
);
|
110 |
+
add_option('bsf_article',$article_opt);
|
111 |
+
}
|
112 |
+
// Function for customization
|
113 |
+
function add_color_option()
|
114 |
+
{
|
115 |
+
$color_opt = array(
|
116 |
+
'snippet_box_bg' => '#F5F5F5',
|
117 |
+
'snippet_title_bg' => '#E4E4E4',
|
118 |
+
'snippet_border' => '#ACACAC',
|
119 |
+
'snippet_title_color' => '#333333',
|
120 |
+
'snippet_box_color' => '#333333',
|
121 |
+
);
|
122 |
+
add_option('bsf_custom',$color_opt);
|
123 |
+
}
|
124 |
?>
|