Codebase list groonga / 5213e4b
Import upstream version 11.0.0+git20210309.1.586ad97 Debian Janitor 2 years ago
54 changed file(s) with 14320 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 groonga (11.0.0-2) unstable; urgency=medium
1
2 * debian/control,debian/groonga-server-common.postinst
3 Support statoverride migration to bullseye (Closes: #984569)
4
5 -- Kentaro Hayashi <kenhys@xdump.org> Tue, 09 Mar 2021 20:40:08 +0900
6
7 groonga (11.0.0-1) unstable; urgency=medium
8
9 * New upstream version 11.0.0
10
11 -- Kentaro Hayashi <kenhys@xdump.org> Mon, 08 Feb 2021 17:57:37 +0900
12
13 groonga (10.1.1-1) unstable; urgency=medium
14
15 * New upstream version 10.1.1
16
17 -- Kentaro Hayashi <kenhys@xdump.org> Mon, 25 Jan 2021 14:56:47 +0900
18
19 groonga (10.1.0-1) unstable; urgency=medium
20
21 * New upstream version 10.1.0
22 * debian/patches/0003-Use-_GNU_SOURCE-on-GNU-kFreeBSD.patch
23 - Refresh patch to support nginx 1.19.6
24
25 -- Kentaro Hayashi <kenhys@xdump.org> Fri, 25 Dec 2020 11:52:56 +0900
26
27 groonga (10.0.9-1) unstable; urgency=medium
28
29 * New upstream version 10.0.9
30 * debian/patches/0003-Use-_GNU_SOURCE-on-GNU-kFreeBSD.patch
31 - Refresh patch to support 1.19.5
32 * debian/patches/0004-Enable-user-site-configuration.patch
33 - Enable additional server configuration
34
35 -- Kentaro Hayashi <kenhys@xdump.org> Wed, 02 Dec 2020 13:14:22 +0900
36
37 groonga (10.0.8-1) unstable; urgency=medium
38
39 * New upstream version 10.0.8
40
41 -- Kentaro Hayashi <kenhys@xdump.org> Mon, 02 Nov 2020 09:51:28 +0900
42
43 groonga (10.0.7-1) unstable; urgency=medium
44
45 * New upstream version 10.0.7
46 * debian/control
47 - Do not require libjemalloc-dev on hurd-i386 (missing)
48 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
49 - Refresh patch to support 1.19.2
50
51 -- Kentaro Hayashi <kenhys@xdump.org> Wed, 30 Sep 2020 09:53:16 +0900
52
53 groonga (10.0.6-1) unstable; urgency=medium
54
55 * New upstream version 10.0.6
56
57 -- Kentaro Hayashi <kenhys@xdump.org> Mon, 31 Aug 2020 09:31:41 +0900
58
59 groonga (10.0.5-2) unstable; urgency=medium
60
61 * debian/copyright
62 - Use spaces rather than tabs to start continuation lines
63 * debian/control
64 - Use secure URI in Homepage field
65 * debian/rules
66 - Rely on pre-initialized dpkg-architecture variables
67 * debian/changelog
68 - Fix day-of-week for changelog entry 0.7.6-2
69 * debian/groonga-bin.install
70 - Install utility scripts
71 * debian/groonga-bin.lintian-overrides
72 - Refresh ignore pattern for utility scripts
73
74 -- Kentaro Hayashi <kenhys@xdump.org> Sun, 23 Aug 2020 21:26:51 +0900
75
76 groonga (10.0.5-1) unstable; urgency=medium
77
78 * New upstream version 10.0.5
79 * debian/copyright
80 - Fix duplicate globbing patterns
81 - Fix redundant globbing patterns
82 * Install tools/* scripts
83
84 -- Kentaro Hayashi <kenhys@xdump.org> Sat, 22 Aug 2020 17:29:23 +0900
85
86 groonga (10.0.4-1) unstable; urgency=medium
87
88 * New upstream version 10.0.4
89
90 -- Kentaro Hayashi <kenhys@xdump.org> Mon, 29 Jun 2020 08:49:10 +0900
91
92 groonga (10.0.3-1) unstable; urgency=medium
93
94 * New upstream version 10.0.3
95
96 -- Kentaro Hayashi <kenhys@xdump.org> Mon, 01 Jun 2020 08:51:35 +0900
97
98 groonga (10.0.2-1) unstable; urgency=medium
99
100 * New upstream version 10.0.2
101 * debian/patches/fix-ngx-mruby-gcc10.patch
102 - Remove needless patch which was fixed in upstream
103
104 -- Kentaro Hayashi <kenhys@xdump.org> Fri, 01 May 2020 09:44:41 +0900
105
106 groonga (10.0.0-2) unstable; urgency=medium
107
108 * debian/patches/fix-ngx-mruby-gcc10.patch
109 - Fix FTBFS with GCC 10 (Closes: #957311)
110
111 -- Kentaro Hayashi <hayashi@clear-code.com> Mon, 20 Apr 2020 08:19:56 +0900
112
113 groonga (10.0.0-1) unstable; urgency=medium
114
115 * New upstream version 10.0.0
116
117 -- Kentaro Hayashi <hayashi@clear-code.com> Sat, 28 Mar 2020 20:03:07 +0900
118
119 groonga (9.1.2-1) unstable; urgency=medium
120
121 * New upstream version 9.1.2
122 * debian/control
123 - Bump standard-version to 4.5.0.
124 - Use debhelper-compat (=12).
125 - Mark Rules-Requires-Root to no.
126 * debian/*.service
127 - Add underscore as prefix for user name.
128 - Enable PrivateTmp for hardening.
129 * debian/groonga-server-common.postinst
130 debian/groonga-munin-plugins.conf
131 debian/groonga-httpd.*
132 debian/groonga-server-gqtp.*
133 - Update new user name with underscore in script.
134 * debian/patches/0003-Use-user-name-with-underline.patch
135 - Fix default user name with underscore.
136
137 -- Kentaro Hayashi <hayashi@clear-code.com> Sat, 01 Feb 2020 19:32:28 +0900
138
139 groonga (9.1.1-1) unstable; urgency=medium
140
141 * New upstream version 9.1.1
142 * debian/patches/0002-Remove-needless-groonga-keyring-postrm.patch
143 - Refresh patch file
144 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
145 - Refresh patch file for nginx 1.17.7
146
147 -- Kentaro Hayashi <hayashi@clear-code.com> Tue, 14 Jan 2020 20:54:48 +0900
148
149 groonga (9.1.0-1) unstable; urgency=medium
150
151 * New upstream version 9.1.0
152 * debian/patches/0002-Remove-needless-groonga-keyring-postrm.patch
153 - Refresh patch file
154
155 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 27 Dec 2019 18:05:43 +0900
156
157 groonga (9.0.9-1) unstable; urgency=medium
158
159 * New upstream version 9.0.9
160 * debian/salsa-ci.yml
161 - Rename Salsa CI configuration file name
162 * debian/upstream/signing-key.asc
163 - Import new signing key from upstream (RSA4096)
164
165 -- Kentaro Hayashi <hayashi@clear-code.com> Sat, 02 Nov 2019 20:47:46 +0900
166
167 groonga (9.0.8-1) unstable; urgency=medium
168
169 * New upstream version 9.0.8
170
171 -- Kentaro Hayashi <hayashi@clear-code.com> Mon, 30 Sep 2019 22:12:30 +0900
172
173 groonga (9.0.7-2) unstable; urgency=medium
174
175 * debian/groonga-httpd.logrotate
176 - Use groonga-httpd -s reopen for reopening log files
177
178 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 20 Sep 2019 23:56:57 +0900
179
180 groonga (9.0.7-1) unstable; urgency=medium
181
182 * New upstream version 9.0.7
183 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
184 - Refresh patch file by gbp pq
185 * debian/patches/remove-groonga-keyring-postrm.patch
186 - Refresh patch to apply
187
188 -- Kentaro Hayashi <hayashi@clear-code.com> Tue, 03 Sep 2019 22:53:05 +0900
189
190 groonga (9.0.6-1) unstable; urgency=medium
191
192 * New upstream version 9.0.6
193 * debian/control
194 - Bump standard version to 4.4.0. No other changes are required.
195
196 -- Kentaro Hayashi <hayashi@clear-code.com> Wed, 07 Aug 2019 18:07:12 +0900
197
198 groonga (9.0.4-2) unstable; urgency=medium
199
200 * debian/control
201 - Add RapidJSON dependency to enable a cast functionality in Groonga 9.0.4.
202
203 -- Kentaro Hayashi <hayashi@clear-code.com> Sun, 07 Jul 2019 00:25:35 +0900
204
205 groonga (9.0.4-1) unstable; urgency=medium
206
207 * New upstream version 9.0.4
208
209 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 05 Jul 2019 21:58:50 +0900
210
211 groonga (9.0.3-1) unstable; urgency=medium
212
213 * New upstream version 9.0.3
214
215 -- Kentaro Hayashi <hayashi@clear-code.com> Wed, 29 May 2019 23:23:19 +0900
216
217 groonga (9.0.1-2) unstable; urgency=medium
218
219 * debian/groonga-httpd.logrotate
220 debian/groonga-server-gqtp.logrotate
221 - Mitigate privilege escalation by changing the owner and group of logs
222 with "su" option. Reported by Wolfgang Hotwagner.
223 (Closes: #928304) (CVE-2019-11675)
224
225 -- Kentaro Hayashi <hayashi@clear-code.com> Thu, 09 May 2019 23:34:20 +0900
226
227 groonga (9.0.1-1) unstable; urgency=medium
228
229 * New upstream version 9.0.1
230
231 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 29 Mar 2019 23:12:32 +0900
232
233 groonga (9.0.0-1) unstable; urgency=medium
234
235 * New upstream version 9.0.0
236
237 -- Kentaro Hayashi <hayashi@clear-code.com> Sat, 09 Feb 2019 22:13:00 +0900
238
239 groonga (8.1.1-1) unstable; urgency=medium
240
241 * New upstream version 8.1.1
242
243 -- Kentaro Hayashi <hayashi@clear-code.com> Thu, 31 Jan 2019 23:05:48 +0900
244
245 groonga (8.1.0-1) unstable; urgency=medium
246
247 * New upstream version 8.1.0
248 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
249 - Refresh patch file by gbp pq
250 * debian/control
251 - Bump standard-version to 4.3.0. No other changes are required.
252 - Use debhelper-compat (=11).
253
254 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 04 Jan 2019 21:29:31 +0900
255
256 groonga (8.0.9-1) unstable; urgency=medium
257
258 * New upstream version 8.0.9
259 * debian/.gitlab-ci.yml
260 - Add CI configuration
261 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
262 - Refresh patch to fix FTBFS on kFreeBSD.
263 * debian/patches/remove-groonga-keyring-postrm.patch
264 - Refresh patch to apply
265
266 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 30 Nov 2018 13:31:13 +0900
267
268 groonga (8.0.8-1) unstable; urgency=medium
269
270 * New upstream version 8.0.8.
271 * debian/uscan
272 - Use @PACKAGE@,@ANY_VERSION@,@ARCHIVE_EXT@ macros.
273 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
274 - Refresh patch to fix FTBFS on kFreeBSD.
275
276 -- Kentaro Hayashi <hayashi@clear-code.com> Mon, 29 Oct 2018 13:23:35 +0900
277
278 groonga (8.0.7-1) unstable; urgency=medium
279
280 * New upstream version 8.0.7.
281 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
282 - Refresh patch to fix FTBFS on kFreeBSD.
283
284 -- Kentaro Hayashi <hayashi@clear-code.com> Mon, 01 Oct 2018 09:32:57 +0900
285
286 groonga (8.0.6-2) unstable; urgency=medium
287
288 * debian/control
289 - Remove needless directly described dependency for libgroonga0.
290 Without removing it, it causes RC bugs when library is updated.
291 (Reported by Gianfranco Costamagn)
292
293 -- Kentaro Hayashi <hayashi@clear-code.com> Wed, 05 Sep 2018 08:34:05 +0900
294
295 groonga (8.0.6-1) unstable; urgency=medium
296
297 * New upstream version 8.0.6.
298 * debian/changelog
299 - Apply M-x wh-cl to remove trailing whitespace.
300 * debian/control
301 - Bump standard-version to 4.2.1. No other changes are required.
302
303 -- Kentaro Hayashi <hayashi@clear-code.com> Wed, 29 Aug 2018 17:17:55 +0900
304
305 groonga (8.0.5-1) unstable; urgency=medium
306
307 * New upstream version 8.0.5.
308 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
309 - Refresh patch to fix FTBFS on kFreeBSD.
310 * debian/copyright
311 - Use secure(HTTPS) copyright format uri.
312 * debian/control
313 - Bump standard-version to 4.1.5. No other changes are required.
314 - Add Vcs-* fields.
315 * debian/compat
316 - Bump debhelper compat version to 11.
317
318 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 27 Jul 2018 22:46:23 +0900
319
320 groonga (8.0.4-1) unstable; urgency=medium
321
322 * New upstream version 8.0.4.
323 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
324 - Refresh patch to fix FTBFS on kFreeBSD.
325
326 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 29 Jun 2018 23:02:26 +0900
327
328 groonga (8.0.3-1) unstable; urgency=medium
329
330 * New upstream version 8.0.3.
331 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
332 - Refresh patch to fix FTBFS on kFreeBSD.
333
334 -- Kentaro Hayashi <hayashi@clear-code.com> Wed, 30 May 2018 21:41:56 +0900
335
336 groonga (8.0.2-1) unstable; urgency=medium
337
338 * New upstream version 8.0.2.
339
340 -- Kentaro Hayashi <hayashi@clear-code.com> Wed, 02 May 2018 10:25:09 +0900
341
342 groonga (8.0.1-1) unstable; urgency=medium
343
344 * New upstream version 8.0.1
345 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
346 - Refresh patch to fix FTBFS on kFreeBSD.
347 * debian/patches/remove-groonga-keyring-postrm.patch
348 - Remove non-existent file.
349
350 -- Kentaro Hayashi <hayashi@clear-code.com> Tue, 03 Apr 2018 11:15:46 +0900
351
352 groonga (8.0.0-1) unstable; urgency=medium
353
354 * New upstream release.
355 * debian/control
356 - Bump Standards-Version, no other changes are required.
357
358 -- Kentaro Hayashi <hayashi@clear-code.com> Wed, 14 Feb 2018 23:35:34 +0900
359
360 groonga (7.1.1-1) unstable; urgency=medium
361
362 * New upstream release.
363 * debian/control
364 - Bump Standards-Version, no other changes are required.
365
366 -- Kentaro Hayashi <hayashi@clear-code.com> Tue, 30 Jan 2018 17:59:15 +0900
367
368 groonga (7.1.0-1) unstable; urgency=medium
369
370 * New upstream release.
371 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
372 - Refresh patch to fix FTBFS on kFreeBSD.
373 * debian/control
374 - Bump Standards-Version, no other changes are required.
375
376 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 29 Dec 2017 13:17:40 +0900
377
378 groonga (7.0.9-1) unstable; urgency=medium
379
380 * New upstream release.
381 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
382 - Refresh patch to fix FTBFS on kFreeBSD.
383
384 -- Kentaro Hayashi <hayashi@clear-code.com> Sun, 03 Dec 2017 13:18:43 +0900
385
386 groonga (7.0.8-1) unstable; urgency=medium
387
388 * New upstream release.
389 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
390 - Refresh patch to fix FTBFS on kFreeBSD.
391
392 -- Kentaro Hayashi <hayashi@clear-code.com> Wed, 01 Nov 2017 10:01:58 +0900
393
394 groonga (7.0.7-1) unstable; urgency=medium
395
396 * New upstream release.
397 * debian/control
398 - Bump version to 4.1.1 (no other changes are required)
399 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
400 - Refresh patch to fix FTBFS on kFreeBSD.
401
402 -- Kentaro Hayashi <hayashi@clear-code.com> Sun, 08 Oct 2017 09:28:30 +0900
403
404 groonga (7.0.6-1) unstable; urgency=medium
405
406 * New upstream release.
407 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
408 - Refresh patch to fix FTBFS on kFreeBSD.
409 * debian/groonga-httpd.service
410 - Ensure to create /var/run/groonga directory.
411
412 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 08 Sep 2017 22:08:28 +0900
413
414 groonga (7.0.5-1) unstable; urgency=medium
415
416 * New upstream release.
417 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
418 - Refresh patch to fix FTBFS on kFreeBSD.
419
420 -- Kentaro Hayashi <hayashi@clear-code.com> Sun, 30 Jul 2017 17:39:17 +0900
421
422 groonga (7.0.4-1) unstable; urgency=medium
423
424 * New upstream release.
425 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
426 - Refresh patch to fix FTBFS on kFreeBSD.
427 * debian/control
428 - Bump version to 4.0.0 (no other changes are required)
429
430 -- Kentaro Hayashi <hayashi@clear-code.com> Fri, 30 Jun 2017 22:15:05 +0900
431
432 groonga (7.0.3-2) unstable; urgency=medium
433
434 * New upstream release.
435 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
436 - Refresh patch to fix FTBFS on kFreeBSD.
437 * debian/copyright
438 - Add missing copyright about benchmark.
439
440 -- Kentaro Hayashi <hayashi@clear-code.com> Sun, 18 Jun 2017 12:42:13 +0900
441
442 groonga (7.0.3-1) experimental; urgency=medium
443
444 * New upstream release.
445 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
446 - Refresh patch to fix FTBFS on kFreeBSD.
447 * debian/copyright
448 - Add missing copyright about benchmark.
449
450 -- Kentaro Hayashi <hayashi@clear-code.com> Thu, 01 Jun 2017 22:10:59 +0900
451
452 groonga (7.0.2-1) experimental; urgency=medium
453
454 * New upstream release.
455 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
456 - Refresh patch to fix FTBFS on kFreeBSD.
457
458 -- Kentaro Hayashi <hayashi@clear-code.com> Mon, 15 May 2017 15:56:38 +0900
459
460 groonga (7.0.1-1) experimental; urgency=medium
461
462 * New upstream release.
463 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
464 - Refresh patch to fix FTBFS on kFreeBSD.
465
466 -- Kentaro Hayashi <hayashi@clear-code.com> Thu, 30 Mar 2017 14:38:48 +0900
467
468 groonga (7.0.0-1) unstable; urgency=medium
469
470 * New upstream release.
471 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
472 - Refresh patch to fix FTBFS on kFreeBSD.
473
474 -- Kentaro Hayashi <hayashi@clear-code.com> Mon, 27 Feb 2017 15:27:20 +0900
475
476 groonga (6.1.5-1) unstable; urgency=medium
477
478 * New upstream release.
479 * debian/patches/fix-a-bug-that-AND-optimization-may-skip-matched-rec.patch
480 debian/patches/really-fix-a-bug-that-AND-optimization-may-skip-matc.patch
481 - Drop needless patch files. These changes are already merged in
482 Groonga 6.1.5.
483
484 -- Kentaro Hayashi <hayashi@clear-code.com> Mon, 23 Jan 2017 19:14:09 +0900
485
486 groonga (6.1.4-1) unstable; urgency=medium
487
488 * New upstream release.
489 * debian/patches/fix-a-bug-that-AND-optimization-may-skip-matched-rec.patch
490 debian/patches/really-fix-a-bug-that-AND-optimization-may-skip-matc.patch
491 - Apply patches to fix an index search bug that index search may
492 not return records that should be matched.
493
494 -- Kentaro Hayashi <hayashi@clear-code.com> Thu, 19 Jan 2017 17:12:44 +0900
495
496 groonga (6.1.3-1) unstable; urgency=medium
497
498 * New upstream release.
499 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
500 - Refresh patch to fix FTBFS on kFreeBSD.
501 * debian/libgroonga0.install
502 - Drop removed file since Groonga 6.1.2.
503
504 -- Kentaro Hayashi <hayashi@clear-code.com> Sat, 07 Jan 2017 13:49:34 +0900
505
506 groonga (6.1.1-1) unstable; urgency=medium
507
508 * New upstream release.
509 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
510 - Refresh patch to fix FTBFS on kFreeBSD.
511 * debian/control
512 - Add dependency to support Zstd column compression.
513
514 -- Kentaro Hayashi <hayashi@clear-code.com> Sun, 04 Dec 2016 14:41:51 +0900
515
516 groonga (6.1.0-2) unstable; urgency=medium
517
518 * debian/patches/fix-nginx-FTBFS-on-kfreebsd.patch
519 - Add patch to fix FTBFS on kFreeBSD.
520 * debian/copyright
521 - Add copyright about bundled ngx-mruby.
522
523 -- Kentaro Hayashi <hayashi@clear-code.com> Sun, 30 Oct 2016 07:31:31 +0900
524
525 groonga (6.1.0-1) unstable; urgency=medium
526
527 * New upstream release.
528 * debian/control
529 - Add missing dependency to lsb-base because of init.d script.
530
531 -- Kentaro Hayashi <hayashi@clear-code.com> Sat, 29 Oct 2016 13:50:37 +0900
532
533 groonga (6.0.9-1) unstable; urgency=medium
534
535 * New upstream release.
536 * debian/patches/fix-nginx-build-error-with-openssl-1.1.patch
537 - Drop needless patch because it was fixed in upstream.
538
539 -- Kentaro Hayashi <hayashi@clear-code.com> Sat, 01 Oct 2016 21:35:07 +0900
540
541 groonga (6.0.8-1) unstable; urgency=medium
542
543 * New upstream release.
544
545 -- Kentaro Hayashi <hayashi@clear-code.com> Mon, 29 Aug 2016 14:40:39 +0900
546
547 groonga (6.0.7-1) unstable; urgency=medium
548
549 * New upstream release.
550 * debian/patches/fix-nginx-build-error-with-openssl-1.1.patch
551 - Update OpenSSL patch for bundled nginx 1.11.3
552
553 -- Kentaro Hayashi <hayashi@clear-code.com> Thu, 04 Aug 2016 22:00:19 +0900
554
555 groonga (6.0.5-2) unstable; urgency=medium
556
557 * debian/patches/fix-nginx-build-error-with-openssl-1.1.patch
558 - Fix FTBFS with OpenSSL 1.1.0 (Closes: #828331)
559 * debian/copyright
560 - Update copyright year about vendor/mruby.
561
562 -- Kentaro Hayashi <hayashi@clear-code.com> Sat, 16 Jul 2016 17:26:18 +0900
563
564 groonga (6.0.5-1) unstable; urgency=medium
565
566 * New upstream release.
567
568 -- Kentaro Hayashi <hayashi@clear-code.com> Thu, 30 Jun 2016 23:37:23 +0900
569
570 groonga (6.0.4-1) unstable; urgency=medium
571
572 * New upstream release.
573 * debian/control
574 - Drop needless dependency to autotools-dev.
575 * debian/groonga-httpd.service,
576 debian/groonga-server-gqtp.service
577 - Add Documentation= entry to service unit.
578 * debian/groonga-httpd.default,
579 debian/groonga-server-gqtp.default
580 - Update default configuration in this release.
581
582 -- Kentaro Hayashi <hayashi@clear-code.com> Tue, 07 Jun 2016 22:09:26 +0900
583
584 groonga (6.0.2-1) unstable; urgency=medium
585
586 * Team upload.
587 * New upstream release.
588 * debian/control
589 - Update standards version to 3.9.8.
590 - Update compat level to 10.
591 - Drop needless dependency to dh-autoreconf.
592 * debian/upstream/signing-key.asc
593 - Add signing key to check signature.
594 * debian/watch
595 - Add pgpsigurlmangle to verify the archive.
596 * debian/groonga-bin.install
597 - Drop man files which are not provided anymore.
598 - Install missing grndb command.
599 * debian/groonga-httpd.service
600 - Make package description more clear.
601 - Use EnvironmentFile directive to customize.
602 - Drop unused Conflicts directive.
603 * debian/groonga-gqtp.service
604 - Make package description more clear.
605 - Use server mode which does not fork.
606 * debian/libgroonga0.install
607 - Install missing functions plugin.
608 * debian/copyright
609 - Update copyright year.
610 * debian/groonga-bin.lintian-overrides,
611 debian/groonga-httpd.lintian-overrides,
612 debian/groonga-plugin-suggest.lintian-overrides
613 - Suppress binary-without-manpage lintian warnings because
614 upstream dropped man support explicitly.
615 * debian/rule
616 - Remove bundled jquery and underscore correctly.
617
618 -- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Apr 2016 00:51:25 +0900
619
620 groonga (6.0.1-1) unstable; urgency=medium
621
622 * Team upload.
623 * New upstream release.
624 * debian/control
625 - Use Architecture: any to support more architectures.
626 - Drop transitional groonga-server-http package.
627 * debian/rules
628 - Remove needless DEB_BUILD_HARDENING flag.
629 - Disable static library.
630 * debian/groonga-httpd.default
631 - Set variables to enable fast phrase search feature.
632
633 -- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 28 Mar 2016 21:59:57 +0900
634
635 groonga (6.0.0-1) unstable; urgency=medium
636
637 * Team upload.
638 * New upstream release.
639 * debian/control
640 - Fix "undefined reference to `GRN_ATOMIC_ADD_EX'" on mips,mipsel,m68k.
641 Closes: #770243
642 - Update standards-version to 3.9.7
643 - Add SSL/TLS dependency which is required by groonga-httpd.
644 * patches/*
645 - Remove needless use-jquery-flot-0.8.3.patch because it is fixed
646 in upstream.
647
648 -- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 28 Feb 2016 12:34:17 +0900
649
650 groonga (5.1.2-1) unstable; urgency=medium
651
652 * Team upload.
653 * New upstream release.
654 * patches/use-jquery-flot-0.8.3.patch
655 - Fix source-is-missing lintian error.
656 * debian/rules,debian/control
657 - Fix automake related FTBFS issue which is caused by added patch.
658
659 -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 30 Jan 2016 21:48:00 +0900
660
661 groonga (5.1.1-1) unstable; urgency=medium
662
663 * Team upload.
664 * New upstream release.
665 * debian/copyright
666 - Fix I:unused-file-paragraph-in-dep5-copyright paragraph notifications.
667 * debian/rules
668 - Fix FTBFS on ppc64el due to outdated config.guess in vendor/onigmo-source.
669
670 -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 02 Jan 2016 20:47:09 +0900
671
672 groonga (5.1.0-1) unstable; urgency=medium
673
674 * Team upload.
675 * New upstream release.
676 * Import upstream debian/* changes.
677 - Closes: #799167, #800451
678 * Do not delete conffiles which are owned by other packages
679 - Closes: #773029
680 * debian/source.lintian-overrides
681 - Suppress source-is-missing error.
682 * debian/tests/*
683 - Add files for autopkgtest.
684
685 -- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 27 Dec 2015 00:00:00 +0900
686
687 groonga (4.0.6.1-2) unstable; urgency=low
688
689 * Team upload.
690 * debian/control
691 - Support amd64,i386,kfreebsd-amd64,kfreebsd-i386 and ppc64el only
692 because of build failure for other architectures. It is a just workaroud.
693 - Follow Standard-Version to 3.9.6.
694
695 -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 25 Oct 2014 02:58:33 +0000
696
697 groonga (4.0.6.1-1) unstable; urgency=low
698
699 * Team upload.
700 * debian/copyright
701 - Add missing copyright about sphinx bundled js/css.
702 - Add missing copyright about jquery-ui css.
703 * Initial upload to Debian (Closes: #732055)
704
705 -- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 15 Oct 2014 12:09:48 +0000
706
707 groonga (4.0.6-1) unstable; urgency=low
708
709 * New upstream release.
710
711 -- Kouhei Sutou <kou@cozmixng.org> Mon, 29 Sep 2014 00:00:00 +0900
712
713 groonga (4.0.5-1) unstable; urgency=low
714
715 * New upstream release.
716 * debian/copyright
717 - Add missing copyright about bundled .js and .css
718 * debian/missing-sources
719 - Add missing-sources for bundled JavaScript.
720
721 -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Aug 2014 00:00:00 +0900
722
723 groonga (4.0.4-1) unstable; urgency=low
724
725 * New upstream release.
726
727 -- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Jul 2014 00:00:00 +0900
728
729 groonga (4.0.3-1) unstable; urgency=low
730
731 * New upstream release.
732
733 -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Jun 2014 00:00:00 +0900
734
735 groonga (4.0.2-1) unstable; urgency=low
736
737 * New upstream release.
738
739 -- Kouhei Sutou <kou@clear-code.com> Thu, 29 May 2014 00:00:00 +0900
740
741 groonga (4.0.1-2) unstable; urgency=low
742
743 * debian/control
744 - Add a missing pkg-config dependency to libgroonga-dev.
745 - Depend on mecab-naist-jdic instead of mecab-ipadic-utf8 because
746 mecab-naist-jdic is a replacement of mecab-ipadic-utf8.
747
748 -- Kouhei Sutou <kou@clear-code.com> Thu, 29 May 2014 00:00:00 +0900
749
750 groonga (4.0.1-1) unstable; urgency=low
751
752 * New upstream release.
753
754 -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Mar 2014 00:00:00 +0900
755
756 groonga (4.0.0-1) unstable; urgency=low
757
758 * New upstream release.
759
760 -- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 09 Feb 2014 00:00:00 +0900
761
762 groonga (3.1.2-1) unstable; urgency=low
763
764 * New upstream release.
765 * debian/control
766 - Add proper description to fix "duplicate-long-description" lintian warning
767 for groonga-server-gqtp and groonga-server-http packages.
768 - Remove needless period to fix I:description-synopsis-might-not-be-phrased-properly lintian warning.
769 - Use "all" in Architecture field to fix I: package-contains-no-arch-dependent-files
770 lintian warning for groonga-example package.
771 * debian/rules
772 - Add DEB_BUILD_HARDENING flag to fix lintian warning "hardening-no-relro" and
773 "hardening-no-fortify-functions"
774
775 -- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Jan 2014 00:00:00 +0900
776
777 groonga (3.1.1-1) unstable; urgency=low
778
779 * New upstream release.
780
781 -- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Dec 2013 00:00:00 +0900
782
783 groonga (3.1.0-1) unstable; urgency=low
784
785 * New upstream release.
786
787 -- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Nov 2013 00:00:00 +0900
788
789 groonga (3.0.9-1) unstable; urgency=low
790
791 * New upstream release.
792
793 -- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Oct 2013 00:00:00 +0900
794
795 groonga (3.0.8-1) unstable; urgency=low
796
797 * New upstream release.
798
799 -- HAYASHI Kentaro <hayashi@clear-code.com> Sun, 29 Sep 2013 00:00:00 +0900
800
801 groonga (3.0.7-1) unstable; urgency=low
802
803 * New upstream release.
804
805 -- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Aug 2013 00:00:00 +0900
806
807 groonga (3.0.6-1) unstable; urgency=low
808
809 * New upstream release.
810
811 -- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Jul 2013 00:00:00 +0900
812
813 groonga (3.0.5-1) unstable; urgency=low
814
815 * New upstream release.
816
817 -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Jun 2013 00:00:00 +0900
818
819 groonga (3.0.4-1) unstable; urgency=low
820
821 * New upstream release.
822
823 -- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 May 2013 00:00:00 +0900
824
825 groonga (3.0.3-1) unstable; urgency=low
826
827 * New upstream release.
828
829 -- HAYASHI Kentaro <hayashi@clear-code.com> Mon, 29 Apr 2013 00:00:00 +0900
830
831 groonga (3.0.2-1) unstable; urgency=low
832
833 * New upstream release.
834
835 -- HAYASHI Kentaro <hayashi@clear-code.com> Fri, 29 Mar 2013 00:00:00 +0900
836
837 groonga (3.0.1-1) unstable; urgency=low
838
839 * New upstream release.
840
841 -- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 28 Feb 2013 00:00:00 +0900
842
843 groonga (3.0.0-1) unstable; urgency=low
844
845 * New upstream release.
846
847 -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 09 Feb 2013 00:00:00 +0900
848
849 groonga (2.1.2-1) unstable; urgency=low
850
851 * New upstream release.
852
853 -- HAYASHI Kentaro <hayashi@clear-code.com> Tue, 29 Jan 2013 00:00:00 +0900
854
855 groonga (2.1.1-1) unstable; urgency=low
856
857 * New upstream release.
858
859 -- Kouhei Sutou <kou@clear-code.com> Sat, 29 Dec 2012 15:04:41 +0900
860
861 groonga (2.1.0-1) unstable; urgency=low
862
863 * New upstream release.
864
865 -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Dec 2012 00:00:00 +0900
866
867 groonga (2.0.9-1) unstable; urgency=low
868
869 * New upstream release.
870
871 -- HAYASHI Kentaro <hayashi@clear-code.com> Thu, 29 Nov 2012 00:00:00 +0900
872
873 groonga (2.0.8-1) unstable; urgency=low
874
875 * New upstream release.
876
877 -- Kouhei Sutou <kou@clear-code.com> Mon, 29 Oct 2012 00:00:00 +0900
878
879 groonga (2.0.7-1) unstable; urgency=low
880
881 * New upstream release.
882
883 -- HAYASHI Kentaro <hayashi@clear-code.com> Sat, 29 Sep 2012 00:00:00 +0900
884
885 groonga (2.0.6-1) unstable; urgency=low
886
887 * New upstream release.
888 * Split common tasks for server use into groonga-server-common package.
889 * groonga-server and groonga-httpd require groonga-server-common package.
890
891 -- HAYASHI Kentaro <hayashi@clear-code.com> Wed, 29 Aug 2012 00:00:00 +0900
892
893 groonga (2.0.5-1) unstable; urgency=low
894
895 * New upstream release.
896
897 -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Jul 2012 00:00:00 +0900
898
899 groonga (2.0.4-1) unstable; urgency=low
900
901 * New upstream release.
902
903 -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Jun 2012 00:00:00 +0900
904
905 groonga (2.0.3-1) unstable; urgency=low
906
907 * New upstream release.
908 * Fix a bug that log_reopen command in logrotate uses wrong protocol.
909
910 -- Kouhei Sutou <kou@clear-code.com> Tue, 29 May 2012 00:00:00 +0900
911
912 groonga (2.0.2-1) unstable; urgency=low
913
914 * New upstream release.
915 * Set missing default values.
916
917 -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Apr 2012 00:00:00 +0900
918
919 groonga (2.0.1-3) unstable; urgency=low
920
921 * Fix default file path: /etc/default/groonga -> /etc/default/groonga-server
922 * Use shutdown command for stop.
923
924 -- Kouhei Sutou <kou@clear-code.com> Fri, 30 Mar 2012 00:00:00 +0900
925
926 groonga (2.0.1-2) unstable; urgency=low
927
928 * Fix bind address argument parameter.
929 Patch by Masaharu IWAI. Thanks!!!
930
931 -- Kouhei Sutou <kou@clear-code.com> Fri, 30 Mar 2012 00:00:00 +0900
932
933 groonga (2.0.1-1) unstable; urgency=low
934
935 * New upstream release.
936 * grntest -> groonga-benchmark.
937 * Remove groogna-tools package.
938
939 -- Kouhei Sutou <kou@clear-code.com> Thu, 29 Mar 2012 00:00:00 +0900
940
941 groonga (2.0.0-1) unstable; urgency=low
942
943 * New upstream release.
944 * Use HTTP as the default protocol.
945
946 -- Kouhei Sutou <kou@clear-code.com> Wed, 29 Feb 2012 00:00:00 +0900
947
948 groonga (1.3.0-1) unstable; urgency=low
949
950 * New upstream release.
951 * groonga-server doesn't require groonga-munin-plugins.
952 Suggested by Masaharu IWAI. Thanks!!!
953
954 -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Jan 2012 00:00:00 +0900
955
956 groonga (1.2.9-1) unstable; urgency=low
957
958 * New upstream release.
959
960 -- Kouhei Sutou <kou@clear-code.com> Thu, 29 Dec 2011 00:00:00 +0900
961
962 groonga (1.2.8-1) unstable; urgency=low
963
964 * New upstream release.
965 * Enable zlib support.
966 * Enable lzo support.
967
968 -- Kouhei Sutou <kou@clear-code.com> Tue, 29 Nov 2011 00:00:00 +0900
969
970 groonga (1.2.7-1) unstable; urgency=low
971
972 * New upstream release.
973
974 -- Kouhei Sutou <kou@clear-code.com> Sat, 29 Oct 2011 00:00:00 +0900
975
976 groonga (1.2.6-1) unstable; urgency=low
977
978 * New upstream release.
979
980 -- Kouhei Sutou <kou@clear-code.com> Thu, 29 Sep 2011 00:00:00 +0900
981
982 groonga (1.2.5-1) unstable; urgency=low
983
984 * New upstream release.
985
986 -- Kouhei Sutou <kou@clear-code.com> Mon, 29 Aug 2011 00:00:00 +0900
987
988 groonga (1.2.4-1) unstable; urgency=low
989
990 * New upstream release.
991
992 -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Jul 2011 00:00:00 +0900
993
994 groonga (1.2.3-1) unstable; urgency=low
995
996 * New upstream release.
997
998 -- Kouhei Sutou <kou@clear-code.com> Wed, 29 Jun 2011 00:00:00 +0900
999
1000 groonga (1.2.2-1) unstable; urgency=low
1001
1002 * New upstream release.
1003
1004 -- Kouhei Sutou <kou@clear-code.com> Sun, 29 May 2011 00:00:00 +0900
1005
1006 groonga (1.2.1-1) unstable; urgency=low
1007
1008 * New upstream release.
1009
1010 -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Apr 2011 00:00:00 +0900
1011
1012 groonga (1.2.0-3) unstable; urgency=low
1013
1014 * libgronga-dev: add missing libgroonga.so.
1015
1016 -- Kouhei Sutou <kou@clear-code.com> Wed, 06 Apr 2011 21:00:00 +0900
1017
1018 groonga (1.2.0-2) unstable; urgency=low
1019
1020 * libgronga-dev: add missing libgroonga.so.
1021
1022 -- Kouhei Sutou <kou@clear-code.com> Tue, 29 Mar 2011 21:00:00 +0900
1023
1024 groonga (1.2.0-1) unstable; urgency=low
1025
1026 * New upstream release.
1027
1028 -- Kouhei Sutou <kou@clear-code.com> Tue, 29 Mar 2011 00:00:00 +0900
1029
1030 groonga (1.1.0-1) unstable; urgency=low
1031
1032 * New upstream release.
1033
1034 -- Kouhei Sutou <kou@clear-code.com> Wed, 09 Feb 2011 00:00:00 +0900
1035
1036 groonga (1.0.8-1) unstable; urgency=low
1037
1038 * New upstream release.
1039
1040 -- Kouhei Sutou <kou@clear-code.com> Wed, 02 Feb 2011 00:00:00 +0900
1041
1042 groonga (1.0.7-1) unstable; urgency=low
1043
1044 * New upstream release.
1045
1046 -- Kouhei Sutou <kou@clear-code.com> Sat, 29 Jan 2011 00:00:00 +0900
1047
1048 groonga (1.0.6-1) unstable; urgency=low
1049
1050 * New upstream release.
1051
1052 -- Kouhei Sutou <kou@clear-code.com> Fri, 31 Dec 2010 00:00:00 +0900
1053
1054 groonga (1.0.5-1) unstable; urgency=low
1055
1056 * New upstream release.
1057
1058 -- Kouhei Sutou <kou@clear-code.com> Wed, 29 Dec 2010 00:00:00 +0900
1059
1060 groonga (1.0.4-1) unstable; urgency=low
1061
1062 * New upstream release.
1063
1064 -- Kouhei Sutou <kou@clear-code.com> Mon, 29 Nov 2010 00:00:00 +0900
1065
1066 groonga (1.0.3-1) lucid; urgency=low
1067
1068 * New upstream release.
1069
1070 -- Kouhei Sutou <kou@clear-code.com> Fri, 29 Oct 2010 16:00:22 +0900
1071
1072 groonga (1.0.2-1) lucid; urgency=low
1073
1074 * New upstream release.
1075
1076 -- Kouhei Sutou <kou@clear-code.com> Thu, 09 Sep 2010 15:19:24 +0900
1077
1078 groonga (1.0.1-1) lucid; urgency=low
1079
1080 * New upstream release.
1081
1082 -- Kouhei Sutou <kou@clear-code.com> Mon, 06 Sep 2010 16:21:35 +0900
1083
1084 groonga (1.0.0-1) lucid; urgency=low
1085
1086 * New upstream release.
1087
1088 -- Kouhei Sutou <kou@clear-code.com> Sun, 29 Aug 2010 00:07:53 +0900
1089
1090 groonga (0.7.7-1) lucid; urgency=low
1091
1092 * New upstream release.
1093
1094 -- Kouhei Sutou <kou@clear-code.com> Wed, 25 Aug 2010 17:05:58 +0900
1095
1096 groonga (0.7.6-2) unstable; urgency=low
1097
1098 * Split packages.
1099
1100 -- Kouhei Sutou <kou@clear-code.com> Wed, 25 Aug 2010 22:11:14 +0900
1101
1102 groonga (0.7.6) unstable; urgency=low
1103
1104 * New upstream release.
1105
1106 -- Kouhei Sutou <kou@clear-code.com> Thu, 19 Aug 2010 22:11:14 +0900
1107
1108 groonga (0.7.4) unstable; urgency=low
1109
1110 * New upstream release.
1111
1112 -- Kouhei Sutou <kou@clear-code.com> Thu, 29 Jul 2010 14:24:00 +0900
1113
1114 groonga (0.1.9) unstable; urgency=low
1115
1116 * New upstream release.
1117
1118 -- Kouhei Sutou <kou@clear-code.com> Tue, 20 Apr 2010 15:10:04 +0900
1119
1120 groonga (0.1.6) unstable; urgency=low
1121
1122 * New upstream release.
1123
1124 -- Kouhei Sutou <kou@clear-code.com> Wed, 10 Feb 2010 13:00:55 +0900
1125
1126 groonga (0.1.5) unstable; urgency=low
1127
1128 * Initial release.
1129
1130 -- Kouhei Sutou <kou@clear-code.com> Fri, 15 Jan 2010 16:41:04 +0900
0 Source: groonga
1 Section: database
2 Priority: optional
3 Maintainer: Groonga Project <packages@groonga.org>
4 Uploaders: Kentaro Hayashi <kenhys@xdump.org>
5 Build-Depends:
6 debhelper-compat (= 12),
7 pkg-config,
8 liblz4-dev,
9 zlib1g-dev,
10 libmsgpack-dev,
11 libzmq3-dev | libzmq-dev,
12 libevent-dev,
13 libmecab-dev,
14 libpcre3-dev,
15 libstemmer-dev,
16 libjemalloc-dev [!hurd-i386],
17 libssl-dev,
18 libzstd-dev,
19 rapidjson-dev
20 Standards-Version: 4.5.0
21 Homepage: https://groonga.org/
22 Vcs-Browser: https://salsa.debian.org/debian/groonga/
23 Vcs-Git: https://salsa.debian.org/debian/groonga.git
24 Rules-Requires-Root: no
25
26 Package: groonga
27 Architecture: any
28 Depends:
29 ${misc:Depends},
30 ${shlibs:Depends},
31 groonga-bin (= ${binary:Version}),
32 groonga-plugin-suggest (= ${binary:Version}),
33 groonga-doc (= ${source:Version})
34 Description: Fulltext search engine (metapackage for library use)
35 Groonga is an open-source fulltext search engine and column store.
36 It lets you write high-performance applications that requires fulltext search.
37 .
38 This package depends all Groonga related package for library use.
39
40 Package: groonga-server-common
41 Architecture: all
42 Pre-Depends: ${misc:Pre-Depends}
43 Depends:
44 ${misc:Depends},
45 ${shlibs:Depends},
46 adduser,
47 groonga (>= ${source:Version}),
48 procps
49 Description: Fulltext search engine (metapackage for server use)
50 Groonga is an open-source fulltext search engine and column store.
51 It lets you write high-performance applications that requires fulltext search.
52 .
53 This package provides common settings for server use.
54
55 Package: groonga-server-gqtp
56 Architecture: all
57 Replaces: groonga-server (<< 2.0.7-1)
58 Breaks: groonga-server (<< 2.0.7-1)
59 Pre-Depends: ${misc:Pre-Depends}
60 Depends:
61 ${misc:Depends},
62 ${shlibs:Depends},
63 adduser,
64 groonga-server-common (= ${binary:Version}),
65 lsb-base
66 Description: Fulltext search engine (metapackage for GQTP server use)
67 Groonga is an open-source fulltext search engine and column store.
68 It lets you write high-performance applications that requires fulltext search.
69 .
70 This package depends all Groonga related package for GQTP server use.
71
72 Package: libgroonga-dev
73 Section: libdevel
74 Architecture: any
75 Multi-Arch: same
76 Replaces: libgroonga (<< 1.2.0-1)
77 Breaks: libgroonga (<< 1.2.0-1)
78 Depends:
79 ${misc:Depends},
80 ${shlibs:Depends},
81 pkg-config,
82 libgroonga0 (= ${binary:Version})
83 Description: Development files to use Groonga as a library
84 Groonga is an open-source fulltext search engine and column store.
85 It lets you write high-performance applications that requires fulltext search.
86 .
87 This package provides header files to use Groonga as a library.
88
89 Package: libgroonga0
90 Section: libs
91 Architecture: any
92 Multi-Arch: same
93 Replaces: libgroonga (<< 1.2.0-1)
94 Breaks: libgroonga (<< 1.2.0-1)
95 Pre-Depends: ${misc:Pre-Depends}
96 Depends:
97 ${misc:Depends},
98 ${shlibs:Depends}
99 Description: Library files for Groonga
100 Groonga is an open-source fulltext search engine and column store.
101 It lets you write high-performance applications that requires fulltext search.
102 .
103 This package provides library files.
104
105 Package: groonga-tokenizer-mecab
106 Section: libs
107 Architecture: any
108 Replaces: libgroonga-tokenizer-mecab (<< 1.2.0-1)
109 Breaks: libgroonga-tokenizer-mecab (<< 1.2.0-1)
110 Depends:
111 ${misc:Depends},
112 ${shlibs:Depends},
113 libgroonga0 (= ${binary:Version}),
114 mecab-naist-jdic | mecab-jumandic-utf8
115 Description: MeCab tokenizer for Groonga
116 Groonga is an open-source fulltext search engine and column store.
117 It lets you write high-performance applications that requires fulltext search.
118 .
119 This package provides MeCab tokenizer.
120
121 Package: groonga-token-filter-stem
122 Section: libs
123 Architecture: any
124 Depends:
125 ${misc:Depends},
126 ${shlibs:Depends},
127 libgroonga0 (= ${binary:Version}),
128 libstemmer0d
129 Description: Stemming token filter for Groonga
130 Groonga is an open-source fulltext search engine and column store.
131 It lets you write high-performance applications that requires fulltext search.
132 .
133 This package provides TokenFilterStem token filter that stem each token.
134 The token filter uses libstemmer that uses stemming algorithm written
135 by Snowball.
136
137 Package: groonga-plugin-suggest
138 Section: libs
139 Architecture: any
140 Replaces: libgroonga-plugin-suggest (<< 1.2.0-1)
141 Breaks: libgroonga-plugin-suggest (<< 1.2.0-1)
142 Depends:
143 ${misc:Depends},
144 ${shlibs:Depends},
145 libgroonga0 (= ${binary:Version})
146 Description: Suggest plugin for Groonga
147 Groonga is an open-source fulltext search engine and column store.
148 It lets you write high-performance applications that requires fulltext search.
149 .
150 This package provides suggest plugin.
151
152 Package: groonga-bin
153 Architecture: any
154 Replaces: groonga (<< 1.2.0-1)
155 Breaks: groonga (<< 1.2.0-1)
156 Depends:
157 ${misc:Depends},
158 ${shlibs:Depends},
159 libgroonga0 (= ${binary:Version})
160 Description: Commands for Groonga
161 Groonga is an open-source fulltext search engine and column store.
162 It lets you write high-performance applications that requires fulltext search.
163 .
164 This package provides 'groonga' command.
165
166 Package: groonga-httpd
167 Architecture: any
168 Replaces: groonga (<< 1.2.0-1), groonga-server-http (<< 4.0.8-1)
169 Breaks: groonga (<< 1.2.0-1), groonga-server-http (<< 4.0.8-1)
170 Provides: groonga-server-http
171 Pre-Depends: ${misc:Pre-Depends}
172 Depends:
173 ${misc:Depends},
174 ${shlibs:Depends},
175 curl,
176 groonga-server-common (= ${source:Version}),
177 lsb-base
178 Description: Groonga HTTP server
179 Groonga is an open-source fulltext search engine and column store.
180 It lets you write high-performance applications that requires fulltext search.
181 .
182 This package provides 'groonga-httpd' command.
183
184 Package: groonga-doc
185 Section: doc
186 Architecture: all
187 Depends:
188 ${misc:Depends},
189 libjs-underscore,
190 libjs-jquery
191 Description: Documentation of Groonga
192 Groonga is an open-source fulltext search engine and column store.
193 It lets you write high-performance applications that requires fulltext search.
194 .
195 This package provides documentation of Groonga.
196
197 Package: groonga-examples
198 Architecture: all
199 Depends:
200 ${misc:Depends},
201 ${shlibs:Depends},
202 groonga-bin (>= ${source:Version}),
203 ruby
204 Description: Examples of Groonga
205 Groonga is an open-source fulltext search engine and column store.
206 It lets you write high-performance applications that requires fulltext search.
207 .
208 This package provides examples of Groonga.
209
210 Package: groonga-munin-plugins
211 Section: net
212 Architecture: all
213 Depends:
214 ${misc:Depends},
215 groonga-bin (>= ${source:Version}),
216 munin-node,
217 ruby
218 Description: munin-node plugins for Groonga
219 Groonga is an open-source fulltext search engine and column store.
220 It lets you write high-performance applications that requires fulltext search.
221 .
222 This package provides munin-node plugins to monitor Groonga.
0 Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
1 Upstream-Name: Groonga
2 Upstream-Contact: Groonga Project <packages@groonga.org>
3 Source: http://packages.groonga.org/source/groonga/
4
5 Files: *
6 Copyright: 2009-2016 Brazil, Inc.
7 License: LGPL-2.1
8
9 Files: debian/*
10 Copyright: 2011 Kouhei Sutou <kou@clear-code.com>
11 HAYASHI Kentaro <hayashi@clear-code.com>
12 IWAI, Masaharu <iwaim.sub@gmail.com>
13 SATOH Fumiyasu <fumiyas@osstech.co.jp>
14 orangain <orangain@gmail.com>
15 License: LGPL-2.1
16
17 Files: data/html/admin/css/redmond/* examples/dictionary/html/css/smoothness/jquery-ui-1.8.12.custom.css data/html/admin/js/jquery-ui-1.8.18.custom.js
18 Copyright: 2011, Brandon Aaron
19 Paul Bakaus (paulbakaus.com)
20 David Bolter
21 Rich Caloggero
22 Chi Cheng (cloudream@gmail.com)
23 Colin Clark (http://colin.atrc.utoronto.ca/)
24 Michelle D'Souza
25 Aaron Eisenberger (aaronchi@gmail.com)
26 Ariel Flesler
27 Bohdan Ganicky
28 Scott González
29 Marc Grabanski (m@marcgrabanski.com)
30 Klaus Hartl (stilbuero.de)
31 Scott Jehl
32 Cody Lindley
33 Eduardo Lundgren (eduardolundgren@gmail.com)
34 Todd Parker
35 John Resig
36 Patty Toland
37 Ca-Phun Ung (yelotofu.com)
38 Keith Wood (kbwood@virginbroadband.com.au)
39 Maggie Costello Wachs
40 Richard D. Worth (rdworth.org)
41 Jörn Zaefferer (bassistance.de)
42 License: MIT or GPL-2
43
44 Files: data/html/admin/js/jquery.flot*
45 Copyright: 2007-2014 IOLA and Ole Laursen
46 License: MIT
47
48 Files: data/html/admin/js/jquery-1.7.2.js
49 Copyright: 2011, John Resig
50 License: MIT or GPL-2
51
52 Files: doc/locale/*/jquery*.js
53 Copyright: 2005, 2014 jQuery Foundation, Inc. and other contributors
54 License: MIT
55
56 Files: doc/locale/*/underscore*.js
57 Copyright: 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
58 License: MIT
59
60 Files: doc/locale/*/doctools.js
61 Copyright: 2007-2016 the Sphinx team
62 License: BSD-2-clause
63
64 Files: doc/locale/*/searchtools.js
65 Copyright: 2007-2016 the Sphinx team
66 License: BSD-2-clause
67
68 Files: doc/locale/*/websupport.js
69 Copyright: 2007-2016 the Sphinx team
70 License: BSD-2-clause
71
72 Files: doc/locale/*/basic.css doc/locale/*/pygments.css
73 Copyright: 2007-2016 the Sphinx team
74 License: BSD-2-clause
75
76 Files: benchmark/bench-cache.c
77 Copyright: 2017 Kouhei Sutou <kou@clear-code.com>
78 License: LGPL-2.1
79
80 Files: benchmark/bench-between-sequential.c
81 Copyright: 2016 Kouhei Sutou <kou@clear-code.com>
82 License: LGPL-2.1
83
84 Files: benchmark/bench-ctx-create.c
85 Copyright: 2013-2016 Kouhei Sutou <kou@clear-code.com>
86 License: LGPL-2.1
87
88 Files: benchmark/bench-geo-distance.c
89 Copyright: 2009-2016 Kouhei Sutou <kou@clear-code.com>
90 License: LGPL-2.1
91
92 Files: benchmark/bench-geo-select.c
93 Copyright: 2011-2016 Kouhei Sutou <kou@clear-code.com>
94 License: LGPL-2.1
95
96 Files: benchmark/bench-nfkc.c
97 benchmark/bench-result-set.c
98 Copyright: 2015-2016 Kouhei Sutou <kou@clear-code.com>
99 License: LGPL-2.1
100
101 Files: benchmark/bench-query-optimizer.c
102 benchmark/bench-range-select.c
103 Copyright: 2014-2016 Kouhei Sutou <kou@clear-code.com>
104 License: LGPL-2.1
105
106 Files: benchmark/bench-table-factory.c
107 Copyright: 2008-2016 Kouhei Sutou <kou@clear-code.com>
108 License: LGPL-2.1
109
110 Files: vendor/onigmo-source/*
111 Copyright: 2002-2009 K.Kosako <sndgk393@ybb.ne.jp>
112 2011-2014 K.Takata <kentkt@csc.jp>
113 License: BSD-2-clause
114
115 Files: vendor/onigmo-source/m4/ltversion.m4
116 Copyright: 2004, 2011-2015 Free Software Foundation, Inc.
117 Scott James Remnant, 2004
118 License: Permissive
119
120 Files: vendor/onigmo-source/m4/lt~obsolete.m4
121 Copyright: 2004-2005, 2007, 2009, 2011-2015 Free Software
122 Scott James Remnant, 2004
123 License: Permissive
124
125 Files: vendor/onigmo-source/m4/libtool.m4
126 Copyright: 1996-2001, 2003-2015 Free Software Foundation, Inc.
127 Gordon Matzigkeit, 1996
128 License: Permissive
129
130 Files: vendor/onigmo-source/m4/ltoptions.m4
131 vendor/onigmo-source/m4/ltsugar.m4
132 Copyright: 2004-2005, 2007-2009, 2011-2015 Free Software Foundation, Inc.
133 Gary V. Vaughan, 2004
134 License: Permissive
135
136 Files: vendor/nginx-*/*
137 Copyright: 2002-2016 Igor Sysoev
138 2011-2016 Nginx, Inc.
139 License: BSD-2-clause
140
141 Files: vendor/nginx-*/src/core/ngx_sha1.c
142 vendor/nginx-*/src/event/ngx_event_openssl_stapling.c
143 vendor/nginx-*/src/http/modules/ngx_http_auth_request_module.c
144 vendor/nginx-*/src/http/modules/ngx_http_upstream_keepalive_module.c
145 vendor/nginx-*/src/http/modules/ngx_http_upstream_least_conn_module.c
146 vendor/nginx-*/src/os/unix/ngx_dlopen.c
147 vendor/nginx-*/src/os/unix/ngx_dlopen.h
148 vendor/nginx-*/src/os/win32/ngx_dlopen.c
149 vendor/nginx-*/src/os/win32/ngx_dlopen.h
150 vendor/nginx-*/src/stream/ngx_stream_upstream_least_conn_module.c
151 vendor/ngx_mruby-source/src/http/ngx_http_mruby_upstream.h
152 Copyright: Nginx, Inc.
153 Maxim Dounin
154 License: BSD-2-clause
155
156 Files: vendor/nginx-*/src/core/ngx_proxy_protocol.c
157 vendor/nginx-*/src/core/ngx_proxy_protocol.h
158 vendor/nginx-*/src/http/modules/ngx_http_slice_filter_module.c
159 vendor/nginx-*/src/http/modules/ngx_http_upstream_hash_module.c
160 vendor/nginx-*/src/stream/ngx_stream.c
161 vendor/nginx-*/src/stream/ngx_stream.h
162 vendor/nginx-*/src/stream/ngx_stream_core_module.c
163 vendor/nginx-*/src/stream/ngx_stream_handler.c
164 vendor/nginx-*/src/stream/ngx_stream_proxy_module.c
165 vendor/nginx-*/src/stream/ngx_stream_return_module.c
166 vendor/nginx-*/src/stream/ngx_stream_upstream_hash_module.c
167 Copyright: Nginx, Inc.
168 Roman Arutyunyan
169 License: BSD-2-clause
170
171 Files: vendor/nginx-*/src/core/ngx_thread_pool.h
172 vendor/nginx-*/src/http/v2/ngx_http_v2.c
173 vendor/nginx-*/src/http/v2/ngx_http_v2.h
174 vendor/nginx-*/src/http/v2/ngx_http_v2_filter_module.c
175 vendor/nginx-*/src/http/v2/ngx_http_v2_huff_decode.c
176 vendor/nginx-*/src/http/v2/ngx_http_v2_module.c
177 vendor/nginx-*/src/http/v2/ngx_http_v2_module.h
178 vendor/nginx-*/src/http/v2/ngx_http_v2_table.c
179 Copyright: Nginx, Inc.
180 Valentin V. Bartenev
181 License: BSD-2-clause
182
183 Files: vendor/nginx-*/auto/module
184 vendor/nginx-*/src/core/ngx_rwlock.c
185 vendor/nginx-*/src/core/ngx_rwlock.h
186 vendor/nginx-*/src/http/modules/ngx_http_upstream_zone_module.c
187 vendor/nginx-*/src/stream/ngx_stream_upstream_zone_module.c
188 Copyright: Nginx, Inc.
189 Ruslan Ermilov
190 License: BSD-2-clause
191
192 Files: vendor/nginx-*/src/core/ngx_module.c
193 vendor/nginx-*/src/core/ngx_module.h
194 vendor/nginx-*/src/http/modules/ngx_http_gunzip_filter_module.c
195 Copyright: Igor Sysoev
196 Maxim Dounin
197 Nginx, Inc.
198 License: BSD-2-clause
199
200 Files: vendor/nginx-*/src/http/modules/ngx_http_uwsgi_module.c
201 Copyright: 2008, Manlio Perillo (manlio.perillo@gmail.com)
202 Igor Sysoev
203 Nginx, Inc.
204 Unbit S.a.s. 2009-2010
205 License: BSD-2-clause
206
207 Files: vendor/nginx-*/src/http/v2/ngx_http_v2_huff_encode.c
208 Copyright: 2015, Vlad Krasnov
209 Nginx, Inc.
210 Valentin V. Bartenev
211 License: BSD-2-clause
212
213 Files: vendor/nginx-*/contrib/geo2nginx.pl
214 Copyright: Andrei Nigmatulin, 2005
215 License: BSD-2-clause
216
217 Files: vendor/nginx-*/src/http/modules/ngx_http_scgi_module.c
218 Copyright: Igor Sysoev
219 Manlio Perillo (manlio.perillo@gmail.com)
220 Nginx, Inc.
221 License: BSD-2-clause
222
223 Files: vendor/nginx-*/src/core/ngx_murmurhash.c
224 Copyright: Austin Appleby
225 License: BSD-2-clause
226
227 Files: vendor/ngx_mruby-source/dependence/ngx_devel_kit/docs/patches/more_logging_info
228 Copyright: Brian Moran - bmoran@onehub.com (posted to nginx-devel mailing list on 15/01/10)
229 License: BSD-2-clause
230
231 Files: vendor/nginx-*/src/core/ngx_crypt.c
232 Copyright: Maxim Dounin
233 License: BSD-2-clause
234
235 Files: vendor/nginx-*/src/core/ngx_thread_pool.c
236 Copyright: Nginx, Inc.
237 Ruslan Ermilov
238 Valentin V. Bartenev
239 License: BSD-2-clause
240
241 Files: vendor/mruby-source/*
242 Copyright: 2016 mruby devevlopers
243 License: MIT
244
245 Files: vendor/mruby/*
246 Copyright: 2013-2016 Kouhei Sutou <kou@clear-code.com>
247 License: LGPL-2.1
248
249 Files: vendor/mruby/mruby-compiler/core/parse.c
250 Copyright: 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
251 License: GPL-3+-WITH-BISON-EXCEPTION
252
253 Files: vendor/mruby/mruby-onig-regexp/src/mruby_onig_regexp.c
254 Copyright: 2015 mattn <mattn.jp@gmail.com>
255 License: MIT
256
257 Files: vendor/mruby/mruby-io/*
258 Copyright: 2013 Internet Initiative Japan Inc.
259 License: MIT
260
261 Files: vendor/ngx_mruby-source/*
262 Copyright: 2012-2016 MATSUMOTO Ryosuke
263 2014-2015 Tatsuhiko Kubo
264 2016 SHIBATA Hiroshi
265 2016 SAWANOBORI Yukihiko
266 License: MIT
267
268 Files: vendor/ngx_mruby-source/dependence/ngx_devel_kit/*
269 Copyright: 2010-2015 Marcus Clyne
270 License: BSD-3-clause
271
272 License: BSD-2-clause
273 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
274 .
275 1) Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
276 .
277 2) Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
278 .
279 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
280
281 License: BSD-3-clause
282 Redistribution and use in source and binary forms, with or without
283 modification, are permitted provided that the following conditions are met:
284 .
285 Redistributions of source code must retain the above copyright notice, this
286 list of conditions and the following disclaimer.
287 .
288 Redistributions in binary form must reproduce the above copyright notice,
289 this list of conditions and the following disclaimer in the documentation
290 and/or other materials provided with the distribution.
291 .
292 The name of the author may not be used to endorse or promote products
293 derived from this software without specific prior written permission.
294 .
295 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
296 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
297 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
298 EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
299 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
300 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
301 OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
302 WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
303 OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
304 ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
305
306 License: LGPL-2.1
307 This library is free software; you can redistribute it and/or
308 modify it under the terms of the GNU Lesser General Public
309 License as published by the Free Software Foundation; either
310 version 2.1 of the License, or (at your option) any later version.
311 .
312 This package is distributed in the hope that it will be useful,
313 but WITHOUT ANY WARRANTY; without even the implied warranty of
314 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
315 Lesser General Public License for more details.
316 .
317 You should have received a copy of the GNU Lesser General Public
318 License along with this package; if not, write to the Free Software
319 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
320 .
321 On Debian systems, the complete text of the GNU Lesser General
322 Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
323
324 License: MIT
325 Permission is hereby granted, free of charge, to any person
326 obtaining a copy of this software and associated documentation
327 files (the "Software"), to deal in the Software without
328 restriction, including without limitation the rights to use,
329 copy, modify, merge, publish, distribute, sublicense, and/or sell
330 copies of the Software, and to permit persons to whom the
331 Software is furnished to do so, subject to the following
332 conditions:
333 .
334 The above copyright notice and this permission notice shall be
335 included in all copies or substantial portions of the Software.
336 .
337 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
338 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
339 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
340 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
341 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
342 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
343 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
344 OTHER DEALINGS IN THE SOFTWARE.
345
346 License: GPL-2
347 This program is free software; you can redistribute it and/or modify
348 it under the terms of the GNU General Public License as published by
349 the Free Software Foundation; version 2.
350 .
351 This program is distributed in the hope that it will be useful, but
352 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
353 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
354 for more details.
355 .
356 You should have received a copy of the GNU General Public License
357 along with this program; if not, write to the Free Software Foundation,
358 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
359 .
360 On Debian systems, the complete text of the GNU General Public
361 License Version 2 can be found in `/usr/share/common-licenses/GPL-2'.
362
363 License: GPL-3+-WITH-BISON-EXCEPTION
364 This program is free software: you can redistribute it and/or modify
365 it under the terms of the GNU General Public License as published by
366 the Free Software Foundation, either version 3 of the License, or
367 (at your option) any later version.
368 .
369 This program is distributed in the hope that it will be useful,
370 but WITHOUT ANY WARRANTY; without even the implied warranty of
371 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
372 GNU General Public License for more details.
373 .
374 You should have received a copy of the GNU General Public License
375 along with this program. If not, see <http://www.gnu.org/licenses/>.
376 .
377 As a special exception, you may create a larger work that contains
378 part or all of the Bison parser skeleton and distribute that work
379 under terms of your choice, so long as that work isn't itself a
380 parser generator using the skeleton or a modified version thereof
381 as a parser skeleton. Alternatively, if you modify or redistribute
382 the parser skeleton itself, you may (at your option) remove this
383 special exception, which will cause the skeleton and the resulting
384 Bison output files to be licensed under the GNU General Public
385 License without this special exception.
386 .
387 This special exception was added by the Free Software Foundation in
388 version 2.2 of Bison.
389 .
390 On Debian systems, the complete text of the GNU General Public
391 License Version 3 can be found in `/usr/share/common-licenses/GPL-3'.
392
393 License: Permissive
394 This file is free software; the Free Software Foundation gives
395 unlimited permission to copy and/or distribute it, with or without
396 modifications, as long as this notice is preserved.
0 usr/bin/groonga
1 usr/bin/groonga-benchmark
2 usr/bin/grndb
3 usr/share/groonga/html/*
4 usr/share/groonga/tools/*
5 etc/groonga/groonga.conf
0 groonga-bin: binary-without-manpage usr/bin/grndb
1 groonga-bin: binary-without-manpage usr/bin/groonga
2 groonga-bin: binary-without-manpage usr/bin/groonga-benchmark
3 # Until dependency to groonga-log is met, we should suppress it.
4 groonga-bin: script-not-executable usr/share/groonga/tools/check-index-merge-source-dump.rb
5 groonga-bin: script-not-executable usr/share/groonga/tools/check-small-index-limit.rb
6 groonga-bin: script-not-executable usr/share/groonga/tools/copy-related-files.rb
7 groonga-bin: script-not-executable usr/share/groonga/tools/extract-index-source-from-dump.rb
8 groonga-bin: script-not-executable usr/share/groonga/tools/generate-long-posting-list-data.rb
9 groonga-bin: script-not-executable usr/share/groonga/tools/generate-many-segment-data.rb
10 groonga-bin: script-not-executable usr/share/groonga/tools/groonga-benchmark-indexing.rb
11 groonga-bin: script-not-executable usr/share/groonga/tools/groonga-memory-leak-checker.rb
12 groonga-bin: script-not-executable usr/share/groonga/tools/groonga-memory-usage-analyzer.rb
13 groonga-bin: script-not-executable usr/share/groonga/tools/groonga-object-list-checker.rb
14 groonga-bin: script-not-executable usr/share/groonga/tools/index-column-diff-all.sh
15 groonga-bin: script-not-executable usr/share/groonga/tools/object-inspect-all.sh
16 groonga-bin: script-not-executable usr/share/groonga/tools/prepare-sphinx-html.rb
17 groonga-bin: script-not-executable usr/share/groonga/tools/ucd-symbol-list.rb
0 usr/share/doc/groonga-doc/
0 usr/share/javascript/jquery/jquery.js usr/share/doc/groonga-doc/en/html/_static/jquery.js
1 usr/share/javascript/jquery/jquery.js usr/share/doc/groonga-doc/ja/html/_static/jquery.js
2 usr/share/javascript/underscore/underscore.js usr/share/doc/groonga-doc/ja/html/_static/underscore.js
3 usr/share/javascript/underscore/underscore.js usr/share/doc/groonga-doc/en/html/_static/underscore.js
0 usr/share/groonga/examples/*
0 # Default
1 #GROONGA_HTTPD_ARGS=""
2 TIMEOUT=3
3 # Comment out this to disable groonga-httpd daemon.
4 ENABLE=yes
5 # Set the threshold value to force sequential search for in_values()
6 GRN_IN_VALUES_TOO_MANY_INDEX_MATCH_RATIO=0.01
7 # Set the threshold value to force sequential search for between()
8 GRN_BETWEEN_TOO_MANY_INDEX_MATCH_RATIO=0.01
9 # Define this variable to disable skipping posting list (default: yes)
10 #GRN_II_CURSOR_SET_MIN_ENABLE=no
11 # Define this variable to disable chunk split on offline index construction (default: yes)
12 #GRN_INDEX_CHUNK_SPLIT_ENABLE=no
13 # Set "yes" to enable chunked tokenize feature
14 GRN_MECAB_CHUNKED_TOKENIZE_ENABLED=no
15 # Set the threshold value for chunk size (default: 8192)
16 GRN_MECAB_CHUNK_SIZE_THRESHOLD=8192
0 var/log/groonga/httpd
1 etc/groonga/httpd
2 etc/groonga/httpd/logs
3 etc/groonga/httpd/scgi_temp
4 etc/groonga/httpd/proxy_temp
5 etc/groonga/httpd/uwsgi_temp
6 etc/groonga/httpd/fastcgi_temp
7 etc/groonga/httpd/client_body_temp
8 etc/groonga/httpd/html
0 #! /bin/sh
1 ### BEGIN INIT INFO
2 # Provides: groonga-httpd
3 # Required-Start: $remote_fs $network
4 # Required-Stop: $remote_fs $network
5 # Default-Start: 2 3 4 5
6 # Default-Stop: 0 1 6
7 # Short-Description: groonga-httpd's init script
8 # Description: groonga-httpd is a HTTP server for groonga.
9 ### END INIT INFO
10
11 # Author: Kouhei Sutou <kou@clear-code.com>
12
13 # Do NOT "set -e"
14
15 # PATH should only include /usr/* if it runs after the mountnfs.sh script
16 PATH=/sbin:/usr/sbin:/bin:/usr/bin
17 DESC="a HTTP server for Groonga which provides full-text search engine and column store"
18 NAME=groonga-httpd
19 DAEMON=/usr/sbin/$NAME
20 DAEMON_RESTART=/usr/sbin/$NAME-restart
21 SCRIPTNAME=/etc/init.d/$NAME
22 GROONGA_HTTPD_ARGS=""
23 START_STOP_DAEMON_ARGS=""
24 ENABLE="no"
25
26 DEFAULT_FILE=/etc/default/$NAME
27
28 # Exit if the package is not installed
29 [ -x "$DAEMON" ] || exit 0
30
31 # Read configuration variable file if it is present
32 [ -r $DEFAULT_FILE ] && . $DEFAULT_FILE
33
34 [ "$ENABLE" = "yes" ] || exit 0
35
36 # Load the VERBOSE setting and other rcS variables
37 . /lib/init/vars.sh
38
39 # Define LSB log_* functions.
40 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
41 . /lib/lsb/init-functions
42
43 if [ -z "$PID_FILE" ]; then
44 PID_FILE=$(grep '^\s*pid\s' /etc/groonga/httpd/groonga-httpd.conf | sed -re 's/^\s*pid\s+(.+);$/\1/g' | head -n1)
45 if [ -z "$PID_FILE" ]; then
46 PID_FILE=/var/run/groonga/groonga-httpd.pid
47 fi
48 fi
49
50 #
51 # Function that starts the daemon/service
52 #
53 do_start()
54 {
55 pid_file_dir=$(dirname "$PID_FILE")
56 if [ ! -d "${pid_file_dir}" ]; then
57 mkdir -p "${pid_file_dir}"
58 fi
59 # Return
60 # 0 if daemon has been started
61 # 1 if daemon was already running
62 # 2 if daemon could not be started
63 start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $DAEMON \
64 ${START_STOP_DAEMON_ARGS} --test > /dev/null || return 1
65 start-stop-daemon --start --quiet --pidfile $PID_FILE --exec $DAEMON \
66 ${START_STOP_DAEMON_ARGS} -- $GROONGA_HTTPD_ARGS || return 2
67 # Add code here, if necessary, that waits for the process to be ready
68 # to handle requests from services started subsequently which depend
69 # on this one. As a last resort, sleep for some time.
70 }
71
72 #
73 # Function that stops the daemon/service
74 #
75 do_stop()
76 {
77 # Return
78 # 0 if daemon has been stopped
79 # 1 if daemon was already stopped
80 # 2 if daemon could not be stopped
81 # other if a failure occurred
82
83 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
84 --pidfile $PID_FILE --name $NAME
85 RETVAL="$?"
86 [ "$RETVAL" = 2 ] && return 2
87 # Wait for children to finish too if this is a daemon that forks
88 # and if the daemon is only ever run from this initscript.
89 # If the above conditions are not satisfied then add some other code
90 # that waits for the process to drop all resources that could be
91 # needed by services started subsequently. A last resort is to
92 # sleep for some time.
93 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
94 [ "$?" = 2 ] && return 2
95 # Many daemons don't delete their pidfiles when they exit.
96 rm -f $PID_FILE
97 return "$RETVAL"
98 }
99
100 #
101 # Function that sends a SIGHUP to the daemon/service
102 #
103 do_reload() {
104 #
105 # If the daemon can reload its configuration without
106 # restarting (for example, when it is sent a SIGHUP),
107 # then implement that here.
108 #
109 start-stop-daemon --stop --signal HUP --quiet --pidfile $PID_FILE --name $NAME
110 return 0
111 }
112
113 do_status() {
114 status_of_proc -p $PID_FILE "$DAEMON" "$NAME"
115 return $?
116 }
117
118 case "$1" in
119 start)
120 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
121 do_start
122 case "$?" in
123 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
124 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
125 esac
126 ;;
127 stop)
128 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
129 do_stop
130 case "$?" in
131 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
132 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
133 esac
134 ;;
135 reload|force-reload)
136 log_daemon_msg "Reloading $DESC" "$NAME"
137 do_reload
138 log_end_msg $?
139 ;;
140 restart)
141 log_daemon_msg "Restarting $DESC" "$NAME"
142 if [ -f ${PID_FILE} ]; then
143 $DAEMON_RESTART
144 else
145 do_start
146 fi
147 case "$?" in
148 0) log_end_msg 0 ;;
149 *) log_end_msg 1 ;;
150 esac
151 ;;
152 status)
153 do_status
154 case "$?" in
155 0) ;; # service is OK
156 *) exit 3 ;; # program is not running
157 esac
158 ;;
159 *)
160 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
161 exit 3
162 ;;
163 esac
164
165 :
0 usr/sbin/groonga-httpd
1 usr/sbin/groonga-httpd-restart
2 etc/groonga/httpd/*
0 groonga-httpd: binary-without-manpage usr/sbin/groonga-httpd
1 groonga-httpd: binary-without-manpage usr/sbin/groonga-httpd-restart
0 /var/log/groonga/httpd/*.log {
1 su _groonga groonga
2 daily
3 missingok
4 rotate 30
5 compress
6 delaycompress
7 notifempty
8 sharedscripts
9 postrotate
10 . /etc/default/groonga-httpd
11 if [ x"$ENABLE" = x"yes" ]; then
12 /usr/sbin/groonga-httpd -s reopen
13 fi
14 endscript
15 }
0 #! /bin/sh
1
2 set -e
3
4 fixperms() {
5 for target in /etc/groonga/httpd /etc/groonga/httpd/logs /var/log/groonga/httpd /etc/groonga/httpd/scgi_temp /etc/groonga/httpd/proxy_temp /etc/groonga/httpd/uwsgi_temp /etc/groonga/httpd/fastcgi_temp /etc/groonga/httpd/client_body_temp /etc/groonga/httpd/html
6 do
7 dpkg-statoverride --list $target >/dev/null || \
8 dpkg-statoverride --update --add _groonga groonga 0755 $target
9 done
10 }
11
12 case "$1" in
13 configure)
14 fixperms
15 ;;
16 abort-upgrade|abort-deconfigure|abort-remove)
17 :
18 ;;
19 *)
20 echo "Called with unknown argument $1, bailing out."
21 exit 1
22 ;;
23 esac
24
25 #DEBHELPER#
0 #! /bin/sh
1
2 set -e
3
4 if [ "$1" = "purge" ]; then
5 for target in /etc/groonga/httpd /etc/groonga/httpd/logs /var/log/groonga/httpd /etc/groonga/httpd/scgi_temp /etc/groonga/httpd/proxy_temp /etc/groonga/httpd/uwsgi_temp /etc/groonga/httpd/fastcgi_temp /etc/groonga/httpd/client_body_temp /etc/groonga/httpd/html
6 do
7 if dpkg-statoverride --list $target >/dev/null; then
8 dpkg-statoverride --remove $target
9 fi
10 done
11 fi
12
13 #DEBHELPER#
0 [Unit]
1 Description=Groonga full text search HTTP server
2 Documentation=http://groonga.org/docs/server/package.html#groonga-httpd
3 Wants=network-online.target
4 After=network-online.target
5
6 [Service]
7 Type=forking
8 User=root
9 Group=root
10 EnvironmentFile=-/etc/default/groonga-httpd
11 ExecStartPre=-/bin/mkdir -p /var/log/groonga/httpd
12 ExecStartPre=-/bin/mkdir -p /var/run/groonga
13 ExecStart=/usr/sbin/groonga-httpd
14 ExecStop=/usr/sbin/groonga-httpd -s stop
15 AmbientCapabilities=CAP_NET_BIND_SERVICE
16 PrivateTmp=yes
17
18 [Install]
19 WantedBy=multi-user.target
0 [groonga_*]
1 user _groonga
2 group _groonga
3 env.PATH /usr/bin:/bin:/usr/local/bin
4 env.database_path /var/lib/groonga/db/db
5 env.host 127.0.0.1
6
7 env.http_host 127.0.0.1
8 env.http_port 10041
9 env.http_database_path /var/lib/groonga/db/db
10 env.http_pid_path /var/run/groonga/groonga-http.pid
11 env.http_query_log_path /var/log/groonga/query-http.log
12
13 env.httpd_host 127.0.0.1
14 env.httpd_port 10041
15 env.httpd_database_path /var/lib/groonga/db/db
16 env.httpd_pid_path /var/run/groonga/groonga-httpd.pid
17 env.httpd_query_log_path /var/log/groonga/httpd/groonga-query.log
18
19 env.gqtp_host 127.0.0.1
20 env.gqtp_port 10043
21 env.gqtp_database_path /var/lib/groonga/db/db
22 env.gqtp_pid_path /var/run/groonga/groonga-gqtp.pid
23 env.gqtp_query_log_path /var/log/groonga/query-gqtp.log
0 etc/munin/plugin-conf.d/*
1 usr/share/groonga/munin/plugins/*
0 usr/share/groonga/munin/plugins/groonga_cpu_load_ /usr/share/munin/plugins/groonga_cpu_load_
1 usr/share/groonga/munin/plugins/groonga_cpu_time_ /usr/share/munin/plugins/groonga_cpu_time_
2 usr/share/groonga/munin/plugins/groonga_disk_ /usr/share/munin/plugins/groonga_disk_
3 usr/share/groonga/munin/plugins/groonga_memory_ /usr/share/munin/plugins/groonga_memory_
4 usr/share/groonga/munin/plugins/groonga_n_records_ /usr/share/munin/plugins/groonga_n_records_
5 usr/share/groonga/munin/plugins/groonga_query_performance_ /usr/share/munin/plugins/groonga_query_performance_
6 usr/share/groonga/munin/plugins/groonga_status_ /usr/share/munin/plugins/groonga_status_
7 usr/share/groonga/munin/plugins/groonga_throughput_ /usr/share/munin/plugins/groonga_throughput_
0 #! /bin/sh
1
2 set -e
3
4 prevver="$2"
5
6 init_plugins() {
7 munin-node-configure --shell --remove-also | \
8 grep -e 'groonga_' | \
9 sh
10 invoke-rc.d munin-node restart
11 }
12
13 case "$1" in
14 configure)
15 init_plugins
16 ;;
17 abort-upgrade|abort-deconfigure|abort-remove)
18 :
19 ;;
20 *)
21 echo "Called with unknown argument $1, bailing out."
22 exit 1
23 ;;
24 esac
25
26 #DEBHELPER#
0 #! /bin/sh
1
2 set -e
3
4 if [ "$1" = "purge" ]; then
5 rm -f /etc/munin/plugins/groonga_* > /dev/null 2>&1
6 fi
7
8 #DEBHELPER#
0 usr/bin/groonga-suggest-*
1 usr/lib/*/groonga/plugins/suggest/*
0 groonga-plugin-suggest: binary-without-manpage usr/bin/groonga-suggest-create-dataset
1 groonga-plugin-suggest: binary-without-manpage usr/bin/groonga-suggest-httpd
2 groonga-plugin-suggest: binary-without-manpage usr/bin/groonga-suggest-learner
0 #! /bin/sh
1
2 set -e
3
4 add_system_user() {
5 if ! getent passwd _groonga >/dev/null; then
6 if getent passwd groonga >/dev/null; then
7 usermod -g nogroup groonga
8 if pgrep -u groonga groonga-httpd >/dev/null; then
9 invoke-rc.d groonga-httpd stop
10 fi
11 if pgrep -u groonga groonga >/dev/null; then
12 invoke-rc.d groonga-server-gqtp stop
13 fi
14 deluser --system groonga
15 adduser --system --no-create-home --home /var/lib/groonga --ingroup groonga --force-badname _groonga
16 else
17 addgroup --system groonga
18 adduser --system --home /var/lib/groonga --ingroup groonga --force-badname _groonga
19 fi
20 fi
21 }
22
23 fixperms() {
24 for target in /var/run/groonga /var/lib/groonga /var/log/groonga
25 do
26 dpkg-statoverride --list $target >/dev/null || \
27 dpkg-statoverride --update --add _groonga groonga 0755 $target
28 done
29 }
30
31 create_database() {
32 if [ ! -d /var/lib/groonga/db ]; then
33 mkdir -p /var/lib/groonga/db
34 groonga -n /var/lib/groonga/db/db shutdown > /dev/null
35 chown _groonga:groonga /var/lib/groonga
36 chown _groonga:groonga /var/lib/groonga/db
37 chown _groonga:groonga /var/lib/groonga/db/db*
38 else
39 owner=`stat --format '%U' /var/lib/groonga`
40 if [ "$owner" = "groonga" ]; then
41 chown _groonga:groonga /var/lib/groonga
42 chown _groonga:groonga /var/lib/groonga/db
43 chown _groonga:groonga /var/lib/groonga/db/db*
44 fi
45 fi
46 }
47
48 case "$1" in
49 configure)
50 add_system_user
51 create_database
52 # buster -> bullseye upgrade migration
53 if dpkg --compare-versions "$2" lt "11.0.0-2" ; then
54 dpkg-statoverride --list | \
55 while read user group mod path
56 do
57 if [ "$user" = "groonga" ]; then
58 dpkg-statoverride --remove $path
59 dpkg-statoverride --update --add _groonga $group $mod $path
60 fi
61 done
62 fi
63 fixperms
64 ;;
65 abort-upgrade|abort-deconfigure|abort-remove)
66 :
67 ;;
68 *)
69 echo "Called with unknown argument $1, bailing out."
70 exit 1
71 ;;
72 esac
73
74 #DEBHELPER#
0 #! /bin/sh
1
2 set -e
3
4 if [ "$1" = "purge" ]; then
5 for target in /var/run/groonga /var/lib/groonga /var/log/groonga
6 do
7 if dpkg-statoverride --list $target >/dev/null; then
8 dpkg-statoverride --remove $target
9 fi
10 if [ -d $target ]; then
11 rm -fr $target
12 fi
13 done
14 fi
15
16 #DEBHELPER#
0 # Default
1 #USER=_groonga
2 #GROUP=_groonga
3 ADDRESS=127.0.0.1
4 PORT=10043
5 DATABASE=/var/lib/groonga/db/db
6 LOG_PATH=/var/log/groonga/groonga-gqtp.log
7 QUERY_LOG_PATH=/var/log/groonga/query-gqtp.log
8 #GRN_QUERY_EXPANDER_TSV_SYNONYMS_FILE=/usr/share/groonga/synonyms.tsv
9
10 # Comment out this to disable groonga daemon.
11 ENABLE=yes
12 # Set the threshold value to force sequential search for in_values()
13 GRN_IN_VALUES_TOO_MANY_INDEX_MATCH_RATIO=0.01
14 # Set the threshold value to force sequential search for between()
15 GRN_BETWEEN_TOO_MANY_INDEX_MATCH_RATIO=0.01
16 # Define this variable to disable skipping posting list (default: yes)
17 #GRN_II_CURSOR_SET_MIN_ENABLE=no
18 # Define this variable to disable chunk split on offline index construction (default: yes)
19 #GRN_INDEX_CHUNK_SPLIT_ENABLE=no
20 # Set "yes" to enable chunked tokenize feature
21 GRN_MECAB_CHUNKED_TOKENIZE_ENABLED=no
22 # Set the threshold value for chunk size (default: 8192)
23 GRN_MECAB_CHUNK_SIZE_THRESHOLD=8192
0 var/log/groonga
1 var/lib/groonga
0 #! /bin/sh
1 ### BEGIN INIT INFO
2 # Provides: groonga-server-gqtp
3 # Required-Start: $remote_fs $network
4 # Required-Stop: $remote_fs $network
5 # Default-Start: 2 3 4 5
6 # Default-Stop: 0 1 6
7 # Short-Description: groonga's init script
8 # Description: groonga is a full-text search engine and column store.
9 ### END INIT INFO
10
11 # Author: Kouhei Sutou <kou@clear-code.com>
12
13 # Do NOT "set -e"
14
15 # PATH should only include /usr/* if it runs after the mountnfs.sh script
16 PATH=/sbin:/usr/sbin:/bin:/usr/bin
17 DESC="a full-text search engine and column store"
18 NAME=groonga
19 DAEMON=/usr/bin/$NAME
20 USER=_groonga
21 GROUP=groonga
22 DATABASE=/var/lib/groonga/db/db
23 ADDRESS=127.0.0.1
24 PORT=10043
25 PROTOCOL=gqtp
26 LOG_PATH=/var/log/groonga/groonga-$PROTOCOL.log
27 QUERY_LOG_PATH=/var/log/groonga/query-$PROTOCOL.log
28 PIDFILE=/var/run/groonga/$NAME-$PROTOCOL.pid
29 SCRIPTNAME=/etc/init.d/$NAME-server-$PROTOCOL
30 OPTION_ARGS=""
31 START_STOP_DAEMON_ARGS=""
32 ENABLE="no"
33
34 DEFAULT_FILE=/etc/default/groonga-server-gqtp
35
36 # Exit if the package is not installed
37 [ -x "$DAEMON" ] || exit 0
38
39 # Read configuration variable file if it is present
40 [ -r $DEFAULT_FILE ] && . $DEFAULT_FILE
41
42 [ "$ENABLE" = "yes" ] || exit 0
43
44 DAEMON_ARGS="-d --pid-path ${PIDFILE}"
45 if [ -n "${ADDRESS}" ]; then
46 DAEMON_ARGS="${DAEMON_ARGS} --bind-address ${ADDRESS}"
47 fi
48 if [ -n "${PORT}" ]; then
49 DAEMON_ARGS="${DAEMON_ARGS} --port ${PORT}"
50 fi
51 if [ -n "${LOG_PATH}" ]; then
52 DAEMON_ARGS="${DAEMON_ARGS} --log-path ${LOG_PATH}"
53 fi
54 if [ -n "${QUERY_LOG_PATH}" ]; then
55 DAEMON_ARGS="${DAEMON_ARGS} --query-log-path ${QUERY_LOG_PATH}"
56 fi
57 if [ -n "${PROTOCOL}" ]; then
58 DAEMON_ARGS="${DAEMON_ARGS} --protocol ${PROTOCOL}"
59 fi
60 mkdir -p $(dirname ${PIDFILE})
61 if [ -n "${USER}" ]; then
62 if ! getent passwd | grep -q "^${USER}:"; then
63 echo "$0: user for running groonga doesn't exist: ${USER}" >&2
64 exit 1
65 fi
66 chown -R ${USER} $(dirname ${PIDFILE})
67 START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --chuid ${USER}"
68 fi
69 if [ -n "${GROUP}" ]; then
70 if ! getent group | grep -q "^${GROUP}:"; then
71 echo "$0: group for running groonga doesn't exist: ${GROUP}" >&2
72 exit 1
73 fi
74 START_STOP_DAEMON_ARGS="${START_STOP_DAEMON_ARGS} --group ${GROUP}"
75 fi
76 DAEMON_ARGS="${DAEMON_ARGS} ${OPTION_ARGS}"
77
78 if [ -z "${DATABASE}" ]; then
79 echo "$0: DATABASE should not be empty" >&2
80 exit 1
81 fi
82
83 if [ -f "${DATABASE}" ]; then
84 DAEMON_ARGS="${DAEMON_ARGS} ${DATABASE}"
85 else
86 mkdir -p $(dirname ${DATABASE})
87 if [ -n "${USER}" ]; then
88 chown -R ${USER} $(dirname ${DATABASE})
89 fi
90 if [ -n "${GROUP}" ]; then
91 chgrp -R ${GROUP} $(dirname ${DATABASE})
92 fi
93 DAEMON_ARGS="${DAEMON_ARGS} -n ${DATABASE}"
94 fi
95
96 # Load the VERBOSE setting and other rcS variables
97 . /lib/init/vars.sh
98
99 # Define LSB log_* functions.
100 # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
101 . /lib/lsb/init-functions
102
103 send_command()
104 {
105 command=$1
106 $DAEMON --port ${PORT} -c ${ADDRESS} ${command}
107 }
108
109 #
110 # Function that starts the daemon/service
111 #
112 do_start()
113 {
114 # Return
115 # 0 if daemon has been started
116 # 1 if daemon was already running
117 # 2 if daemon could not be started
118 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
119 ${START_STOP_DAEMON_ARGS} --test > /dev/null || return 1
120 start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON \
121 ${START_STOP_DAEMON_ARGS} -- $DAEMON_ARGS || return 2
122 # Add code here, if necessary, that waits for the process to be ready
123 # to handle requests from services started subsequently which depend
124 # on this one. As a last resort, sleep for some time.
125 }
126
127 #
128 # Function that stops the daemon/service
129 #
130 do_stop()
131 {
132 # Return
133 # 0 if daemon has been stopped
134 # 1 if daemon was already stopped
135 # 2 if daemon could not be stopped
136 # other if a failure occurred
137
138 send_command shutdown
139
140 start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
141 --pidfile $PIDFILE --name $NAME
142 RETVAL="$?"
143 [ "$RETVAL" = 2 ] && return 2
144 # Wait for children to finish too if this is a daemon that forks
145 # and if the daemon is only ever run from this initscript.
146 # If the above conditions are not satisfied then add some other code
147 # that waits for the process to drop all resources that could be
148 # needed by services started subsequently. A last resort is to
149 # sleep for some time.
150 start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 \
151 --pidfile $PIDFILE --exec $DAEMON
152 [ "$?" = 2 ] && return 2
153 # Many daemons don't delete their pidfiles when they exit.
154 rm -f $PIDFILE
155 return "$RETVAL"
156 }
157
158 #
159 # Function that sends a SIGHUP to the daemon/service
160 #
161 do_reload() {
162 #
163 # If the daemon can reload its configuration without
164 # restarting (for example, when it is sent a SIGHUP),
165 # then implement that here.
166 #
167 start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
168 return 0
169 }
170
171 do_status() {
172 if [ -z "${ADDRESS}" ]; then
173 ADDRESS="localhost"
174 fi
175 send_command status
176 return $?
177 }
178
179 case "$1" in
180 start)
181 [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
182 do_start
183 case "$?" in
184 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
185 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
186 esac
187 ;;
188 stop)
189 [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
190 do_stop
191 case "$?" in
192 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
193 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
194 esac
195 ;;
196 reload|force-reload)
197 log_daemon_msg "Reloading $DESC" "$NAME"
198 do_reload
199 log_end_msg $?
200 ;;
201 restart)
202 log_daemon_msg "Restarting $DESC" "$NAME"
203 do_stop
204 case "$?" in
205 0|1)
206 do_start
207 case "$?" in
208 0) log_end_msg 0 ;;
209 1) log_end_msg 1 ;; # Old process is still running
210 *) log_end_msg 1 ;; # Failed to start
211 esac
212 ;;
213 *)
214 # Failed to stop
215 log_end_msg 1
216 ;;
217 esac
218 ;;
219 status)
220 do_status
221 case "$?" in
222 0) ;; # service is OK
223 *) exit 3 ;; # program is not running
224 esac
225 ;;
226 *)
227 echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload|status}" >&2
228 exit 3
229 ;;
230 esac
231
232 :
0 /var/log/groonga/*-gqtp.log {
1 su _groonga groonga
2 daily
3 missingok
4 rotate 30
5 compress
6 delaycompress
7 notifempty
8 sharedscripts
9 postrotate
10 . /etc/default/groonga-server-gqtp
11 if x"$ENABLE" = x"yes"; then
12 /usr/bin/groonga --port "${PORT:-10043}" -c 127.0.0.1 \
13 log_reopen > /dev/null
14 fi
15 endscript
16 }
0 [Unit]
1 Description=Groonga full text search GQTP server
2 Documentation=http://groonga.org/docs/server/package.html#groonga-server-gqtp
3 Wants=network-online.target
4 After=network-online.target
5
6 [Service]
7 Type=simple
8 EnvironmentFile=-/etc/default/groonga-server-gqtp
9 User=_groonga
10 Group=groonga
11 ExecStart=/usr/bin/groonga --protocol gqtp --bind-address $ADDRESS --log-path $LOG_PATH --query-log-path $QUERY_LOG_PATH --port $PORT -s $DATABASE
12 AmbientCapabilities=CAP_NET_BIND_SERVICE
13 PrivateTmp=yes
14
15 [Install]
16 WantedBy=multi-user.target
0 usr/lib/*/groonga/plugins/token_filters/stem*
0 usr/lib/*/groonga/plugins/tokenizers/mecab*
0 # Build uses -D_FORTIFY_SOURCE=2, but hardening-check reports false positive:
1 # % hardening-check -v /usr/lib/x86_64-linux-gnu/groonga/plugins/tokenizers/mecab.so
2 # Fortify Source functions: no, only unprotected functions found!
3 # unprotected: strncpy
4 groonga-tokenizer-mecab: hardening-no-fortify-functions usr/lib/*/groonga/plugins/tokenizers/mecab*
0 usr/include/groonga/*
1 usr/lib/*/pkgconfig/*
2 usr/lib/*/libgroonga.so
0 usr/lib/*/libgroonga*.so.*
1 usr/lib/*/groonga/plugins/functions/*
2 usr/lib/*/groonga/plugins/query_expanders/*
3 usr/lib/*/groonga/plugins/token_filters/stop_word*
4 usr/lib/*/groonga/plugins/ruby/*
5 usr/lib/*/groonga/plugins/sharding.rb
6 usr/lib/*/groonga/plugins/sharding/*
7 usr/lib/*/groonga/scripts/*
8 etc/groonga/synonyms.tsv
0 # Build uses -D_FORTIFY_SOURCE=2, but hardening-check reports false positive:
1 # % hardening-check -v /usr/lib/x86_64-linux-gnu/groonga/plugins/query_expanders/tsv.so
2 # Fortify Source functions: no, only unprotected functions found!
3 # unprotected: strncpy
4 # unprotected: memcpy
5 libgroonga0: hardening-no-fortify-functions usr/lib/*/groonga/plugins/query_expanders/tsv*
0 /*!
1 * jQuery resize event - v1.1 - 3/14/2010
2 * http://benalman.com/projects/jquery-resize-plugin/
3 *
4 * Copyright (c) 2010 "Cowboy" Ben Alman
5 * Dual licensed under the MIT and GPL licenses.
6 * http://benalman.com/about/license/
7 */
8
9 // Script: jQuery resize event
10 //
11 // *Version: 1.1, Last updated: 3/14/2010*
12 //
13 // Project Home - http://benalman.com/projects/jquery-resize-plugin/
14 // GitHub - http://github.com/cowboy/jquery-resize/
15 // Source - http://github.com/cowboy/jquery-resize/raw/master/jquery.ba-resize.js
16 // (Minified) - http://github.com/cowboy/jquery-resize/raw/master/jquery.ba-resize.min.js (1.0kb)
17 //
18 // About: License
19 //
20 // Copyright (c) 2010 "Cowboy" Ben Alman,
21 // Dual licensed under the MIT and GPL licenses.
22 // http://benalman.com/about/license/
23 //
24 // About: Examples
25 //
26 // This working example, complete with fully commented code, illustrates a few
27 // ways in which this plugin can be used.
28 //
29 // resize event - http://benalman.com/code/projects/jquery-resize/examples/resize/
30 //
31 // About: Support and Testing
32 //
33 // Information about what version or versions of jQuery this plugin has been
34 // tested with, what browsers it has been tested in, and where the unit tests
35 // reside (so you can test it yourself).
36 //
37 // jQuery Versions - 1.3.2, 1.4.1, 1.4.2
38 // Browsers Tested - Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome, Opera 9.6-10.1.
39 // Unit Tests - http://benalman.com/code/projects/jquery-resize/unit/
40 //
41 // About: Release History
42 //
43 // 1.1 - (3/14/2010) Fixed a minor bug that was causing the event to trigger
44 // immediately after bind in some circumstances. Also changed $.fn.data
45 // to $.data to improve performance.
46 // 1.0 - (2/10/2010) Initial release
47
48 (function($,window,undefined){
49 '$:nomunge'; // Used by YUI compressor.
50
51 // A jQuery object containing all non-window elements to which the resize
52 // event is bound.
53 var elems = $([]),
54
55 // Extend $.resize if it already exists, otherwise create it.
56 jq_resize = $.resize = $.extend( $.resize, {} ),
57
58 timeout_id,
59
60 // Reused strings.
61 str_setTimeout = 'setTimeout',
62 str_resize = 'resize',
63 str_data = str_resize + '-special-event',
64 str_delay = 'delay',
65 str_throttle = 'throttleWindow';
66
67 // Property: jQuery.resize.delay
68 //
69 // The numeric interval (in milliseconds) at which the resize event polling
70 // loop executes. Defaults to 250.
71
72 jq_resize[ str_delay ] = 250;
73
74 // Property: jQuery.resize.throttleWindow
75 //
76 // Throttle the native window object resize event to fire no more than once
77 // every <jQuery.resize.delay> milliseconds. Defaults to true.
78 //
79 // Because the window object has its own resize event, it doesn't need to be
80 // provided by this plugin, and its execution can be left entirely up to the
81 // browser. However, since certain browsers fire the resize event continuously
82 // while others do not, enabling this will throttle the window resize event,
83 // making event behavior consistent across all elements in all browsers.
84 //
85 // While setting this property to false will disable window object resize
86 // event throttling, please note that this property must be changed before any
87 // window object resize event callbacks are bound.
88
89 jq_resize[ str_throttle ] = true;
90
91 // Event: resize event
92 //
93 // Fired when an element's width or height changes. Because browsers only
94 // provide this event for the window element, for other elements a polling
95 // loop is initialized, running every <jQuery.resize.delay> milliseconds
96 // to see if elements' dimensions have changed. You may bind with either
97 // .resize( fn ) or .bind( "resize", fn ), and unbind with .unbind( "resize" ).
98 //
99 // Usage:
100 //
101 // > jQuery('selector').bind( 'resize', function(e) {
102 // > // element's width or height has changed!
103 // > ...
104 // > });
105 //
106 // Additional Notes:
107 //
108 // * The polling loop is not created until at least one callback is actually
109 // bound to the 'resize' event, and this single polling loop is shared
110 // across all elements.
111 //
112 // Double firing issue in jQuery 1.3.2:
113 //
114 // While this plugin works in jQuery 1.3.2, if an element's event callbacks
115 // are manually triggered via .trigger( 'resize' ) or .resize() those
116 // callbacks may double-fire, due to limitations in the jQuery 1.3.2 special
117 // events system. This is not an issue when using jQuery 1.4+.
118 //
119 // > // While this works in jQuery 1.4+
120 // > $(elem).css({ width: new_w, height: new_h }).resize();
121 // >
122 // > // In jQuery 1.3.2, you need to do this:
123 // > var elem = $(elem);
124 // > elem.css({ width: new_w, height: new_h });
125 // > elem.data( 'resize-special-event', { width: elem.width(), height: elem.height() } );
126 // > elem.resize();
127
128 $.event.special[ str_resize ] = {
129
130 // Called only when the first 'resize' event callback is bound per element.
131 setup: function() {
132 // Since window has its own native 'resize' event, return false so that
133 // jQuery will bind the event using DOM methods. Since only 'window'
134 // objects have a .setTimeout method, this should be a sufficient test.
135 // Unless, of course, we're throttling the 'resize' event for window.
136 if ( !jq_resize[ str_throttle ] && this[ str_setTimeout ] ) { return false; }
137
138 var elem = $(this);
139
140 // Add this element to the list of internal elements to monitor.
141 elems = elems.add( elem );
142
143 // Initialize data store on the element.
144 $.data( this, str_data, { w: elem.width(), h: elem.height() } );
145
146 // If this is the first element added, start the polling loop.
147 if ( elems.length === 1 ) {
148 loopy();
149 }
150 },
151
152 // Called only when the last 'resize' event callback is unbound per element.
153 teardown: function() {
154 // Since window has its own native 'resize' event, return false so that
155 // jQuery will unbind the event using DOM methods. Since only 'window'
156 // objects have a .setTimeout method, this should be a sufficient test.
157 // Unless, of course, we're throttling the 'resize' event for window.
158 if ( !jq_resize[ str_throttle ] && this[ str_setTimeout ] ) { return false; }
159
160 var elem = $(this);
161
162 // Remove this element from the list of internal elements to monitor.
163 elems = elems.not( elem );
164
165 // Remove any data stored on the element.
166 elem.removeData( str_data );
167
168 // If this is the last element removed, stop the polling loop.
169 if ( !elems.length ) {
170 clearTimeout( timeout_id );
171 }
172 },
173
174 // Called every time a 'resize' event callback is bound per element (new in
175 // jQuery 1.4).
176 add: function( handleObj ) {
177 // Since window has its own native 'resize' event, return false so that
178 // jQuery doesn't modify the event object. Unless, of course, we're
179 // throttling the 'resize' event for window.
180 if ( !jq_resize[ str_throttle ] && this[ str_setTimeout ] ) { return false; }
181
182 var old_handler;
183
184 // The new_handler function is executed every time the event is triggered.
185 // This is used to update the internal element data store with the width
186 // and height when the event is triggered manually, to avoid double-firing
187 // of the event callback. See the "Double firing issue in jQuery 1.3.2"
188 // comments above for more information.
189
190 function new_handler( e, w, h ) {
191 var elem = $(this),
192 data = $.data( this, str_data );
193
194 // If called from the polling loop, w and h will be passed in as
195 // arguments. If called manually, via .trigger( 'resize' ) or .resize(),
196 // those values will need to be computed.
197 data.w = w !== undefined ? w : elem.width();
198 data.h = h !== undefined ? h : elem.height();
199
200 old_handler.apply( this, arguments );
201 };
202
203 // This may seem a little complicated, but it normalizes the special event
204 // .add method between jQuery 1.4/1.4.1 and 1.4.2+
205 if ( $.isFunction( handleObj ) ) {
206 // 1.4, 1.4.1
207 old_handler = handleObj;
208 return new_handler;
209 } else {
210 // 1.4.2+
211 old_handler = handleObj.handler;
212 handleObj.handler = new_handler;
213 }
214 }
215
216 };
217
218 function loopy() {
219
220 // Start the polling loop, asynchronously.
221 timeout_id = window[ str_setTimeout ](function(){
222
223 // Iterate over all elements to which the 'resize' event is bound.
224 elems.each(function(){
225 var elem = $(this),
226 width = elem.width(),
227 height = elem.height(),
228 data = $.data( this, str_data );
229
230 // If element size has changed since the last time, update the element
231 // data store and trigger the 'resize' event.
232 if ( width !== data.w || height !== data.h ) {
233 elem.trigger( str_resize, [ data.w = width, data.h = height ] );
234 }
235
236 });
237
238 // Loop.
239 loopy();
240
241 }, jq_resize[ str_delay ] );
242
243 };
244
245 })(jQuery,this);
0 /*!
1 * jQuery JavaScript Library v1.11.1
2 * http://jquery.com/
3 *
4 * Includes Sizzle.js
5 * http://sizzlejs.com/
6 *
7 * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
8 * Released under the MIT license
9 * http://jquery.org/license
10 *
11 * Date: 2014-05-01T17:42Z
12 */
13
14 (function( global, factory ) {
15
16 if ( typeof module === "object" && typeof module.exports === "object" ) {
17 // For CommonJS and CommonJS-like environments where a proper window is present,
18 // execute the factory and get jQuery
19 // For environments that do not inherently posses a window with a document
20 // (such as Node.js), expose a jQuery-making factory as module.exports
21 // This accentuates the need for the creation of a real window
22 // e.g. var jQuery = require("jquery")(window);
23 // See ticket #14549 for more info
24 module.exports = global.document ?
25 factory( global, true ) :
26 function( w ) {
27 if ( !w.document ) {
28 throw new Error( "jQuery requires a window with a document" );
29 }
30 return factory( w );
31 };
32 } else {
33 factory( global );
34 }
35
36 // Pass this if window is not defined yet
37 }(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
38
39 // Can't do this because several apps including ASP.NET trace
40 // the stack via arguments.caller.callee and Firefox dies if
41 // you try to trace through "use strict" call chains. (#13335)
42 // Support: Firefox 18+
43 //
44
45 var deletedIds = [];
46
47 var slice = deletedIds.slice;
48
49 var concat = deletedIds.concat;
50
51 var push = deletedIds.push;
52
53 var indexOf = deletedIds.indexOf;
54
55 var class2type = {};
56
57 var toString = class2type.toString;
58
59 var hasOwn = class2type.hasOwnProperty;
60
61 var support = {};
62
63
64
65 var
66 version = "1.11.1",
67
68 // Define a local copy of jQuery
69 jQuery = function( selector, context ) {
70 // The jQuery object is actually just the init constructor 'enhanced'
71 // Need init if jQuery is called (just allow error to be thrown if not included)
72 return new jQuery.fn.init( selector, context );
73 },
74
75 // Support: Android<4.1, IE<9
76 // Make sure we trim BOM and NBSP
77 rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
78
79 // Matches dashed string for camelizing
80 rmsPrefix = /^-ms-/,
81 rdashAlpha = /-([\da-z])/gi,
82
83 // Used by jQuery.camelCase as callback to replace()
84 fcamelCase = function( all, letter ) {
85 return letter.toUpperCase();
86 };
87
88 jQuery.fn = jQuery.prototype = {
89 // The current version of jQuery being used
90 jquery: version,
91
92 constructor: jQuery,
93
94 // Start with an empty selector
95 selector: "",
96
97 // The default length of a jQuery object is 0
98 length: 0,
99
100 toArray: function() {
101 return slice.call( this );
102 },
103
104 // Get the Nth element in the matched element set OR
105 // Get the whole matched element set as a clean array
106 get: function( num ) {
107 return num != null ?
108
109 // Return just the one element from the set
110 ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
111
112 // Return all the elements in a clean array
113 slice.call( this );
114 },
115
116 // Take an array of elements and push it onto the stack
117 // (returning the new matched element set)
118 pushStack: function( elems ) {
119
120 // Build a new jQuery matched element set
121 var ret = jQuery.merge( this.constructor(), elems );
122
123 // Add the old object onto the stack (as a reference)
124 ret.prevObject = this;
125 ret.context = this.context;
126
127 // Return the newly-formed element set
128 return ret;
129 },
130
131 // Execute a callback for every element in the matched set.
132 // (You can seed the arguments with an array of args, but this is
133 // only used internally.)
134 each: function( callback, args ) {
135 return jQuery.each( this, callback, args );
136 },
137
138 map: function( callback ) {
139 return this.pushStack( jQuery.map(this, function( elem, i ) {
140 return callback.call( elem, i, elem );
141 }));
142 },
143
144 slice: function() {
145 return this.pushStack( slice.apply( this, arguments ) );
146 },
147
148 first: function() {
149 return this.eq( 0 );
150 },
151
152 last: function() {
153 return this.eq( -1 );
154 },
155
156 eq: function( i ) {
157 var len = this.length,
158 j = +i + ( i < 0 ? len : 0 );
159 return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] );
160 },
161
162 end: function() {
163 return this.prevObject || this.constructor(null);
164 },
165
166 // For internal use only.
167 // Behaves like an Array's method, not like a jQuery method.
168 push: push,
169 sort: deletedIds.sort,
170 splice: deletedIds.splice
171 };
172
173 jQuery.extend = jQuery.fn.extend = function() {
174 var src, copyIsArray, copy, name, options, clone,
175 target = arguments[0] || {},
176 i = 1,
177 length = arguments.length,
178 deep = false;
179
180 // Handle a deep copy situation
181 if ( typeof target === "boolean" ) {
182 deep = target;
183
184 // skip the boolean and the target
185 target = arguments[ i ] || {};
186 i++;
187 }
188
189 // Handle case when target is a string or something (possible in deep copy)
190 if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
191 target = {};
192 }
193
194 // extend jQuery itself if only one argument is passed
195 if ( i === length ) {
196 target = this;
197 i--;
198 }
199
200 for ( ; i < length; i++ ) {
201 // Only deal with non-null/undefined values
202 if ( (options = arguments[ i ]) != null ) {
203 // Extend the base object
204 for ( name in options ) {
205 src = target[ name ];
206 copy = options[ name ];
207
208 // Prevent never-ending loop
209 if ( target === copy ) {
210 continue;
211 }
212
213 // Recurse if we're merging plain objects or arrays
214 if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
215 if ( copyIsArray ) {
216 copyIsArray = false;
217 clone = src && jQuery.isArray(src) ? src : [];
218
219 } else {
220 clone = src && jQuery.isPlainObject(src) ? src : {};
221 }
222
223 // Never move original objects, clone them
224 target[ name ] = jQuery.extend( deep, clone, copy );
225
226 // Don't bring in undefined values
227 } else if ( copy !== undefined ) {
228 target[ name ] = copy;
229 }
230 }
231 }
232 }
233
234 // Return the modified object
235 return target;
236 };
237
238 jQuery.extend({
239 // Unique for each copy of jQuery on the page
240 expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
241
242 // Assume jQuery is ready without the ready module
243 isReady: true,
244
245 error: function( msg ) {
246 throw new Error( msg );
247 },
248
249 noop: function() {},
250
251 // See test/unit/core.js for details concerning isFunction.
252 // Since version 1.3, DOM methods and functions like alert
253 // aren't supported. They return false on IE (#2968).
254 isFunction: function( obj ) {
255 return jQuery.type(obj) === "function";
256 },
257
258 isArray: Array.isArray || function( obj ) {
259 return jQuery.type(obj) === "array";
260 },
261
262 isWindow: function( obj ) {
263 /* jshint eqeqeq: false */
264 return obj != null && obj == obj.window;
265 },
266
267 isNumeric: function( obj ) {
268 // parseFloat NaNs numeric-cast false positives (null|true|false|"")
269 // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
270 // subtraction forces infinities to NaN
271 return !jQuery.isArray( obj ) && obj - parseFloat( obj ) >= 0;
272 },
273
274 isEmptyObject: function( obj ) {
275 var name;
276 for ( name in obj ) {
277 return false;
278 }
279 return true;
280 },
281
282 isPlainObject: function( obj ) {
283 var key;
284
285 // Must be an Object.
286 // Because of IE, we also have to check the presence of the constructor property.
287 // Make sure that DOM nodes and window objects don't pass through, as well
288 if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
289 return false;
290 }
291
292 try {
293 // Not own constructor property must be Object
294 if ( obj.constructor &&
295 !hasOwn.call(obj, "constructor") &&
296 !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
297 return false;
298 }
299 } catch ( e ) {
300 // IE8,9 Will throw exceptions on certain host objects #9897
301 return false;
302 }
303
304 // Support: IE<9
305 // Handle iteration over inherited properties before own properties.
306 if ( support.ownLast ) {
307 for ( key in obj ) {
308 return hasOwn.call( obj, key );
309 }
310 }
311
312 // Own properties are enumerated firstly, so to speed up,
313 // if last one is own, then all properties are own.
314 for ( key in obj ) {}
315
316 return key === undefined || hasOwn.call( obj, key );
317 },
318
319 type: function( obj ) {
320 if ( obj == null ) {
321 return obj + "";
322 }
323 return typeof obj === "object" || typeof obj === "function" ?
324 class2type[ toString.call(obj) ] || "object" :
325 typeof obj;
326 },
327
328 // Evaluates a script in a global context
329 // Workarounds based on findings by Jim Driscoll
330 // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
331 globalEval: function( data ) {
332 if ( data && jQuery.trim( data ) ) {
333 // We use execScript on Internet Explorer
334 // We use an anonymous function so that context is window
335 // rather than jQuery in Firefox
336 ( window.execScript || function( data ) {
337 window[ "eval" ].call( window, data );
338 } )( data );
339 }
340 },
341
342 // Convert dashed to camelCase; used by the css and data modules
343 // Microsoft forgot to hump their vendor prefix (#9572)
344 camelCase: function( string ) {
345 return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
346 },
347
348 nodeName: function( elem, name ) {
349 return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
350 },
351
352 // args is for internal usage only
353 each: function( obj, callback, args ) {
354 var value,
355 i = 0,
356 length = obj.length,
357 isArray = isArraylike( obj );
358
359 if ( args ) {
360 if ( isArray ) {
361 for ( ; i < length; i++ ) {
362 value = callback.apply( obj[ i ], args );
363
364 if ( value === false ) {
365 break;
366 }
367 }
368 } else {
369 for ( i in obj ) {
370 value = callback.apply( obj[ i ], args );
371
372 if ( value === false ) {
373 break;
374 }
375 }
376 }
377
378 // A special, fast, case for the most common use of each
379 } else {
380 if ( isArray ) {
381 for ( ; i < length; i++ ) {
382 value = callback.call( obj[ i ], i, obj[ i ] );
383
384 if ( value === false ) {
385 break;
386 }
387 }
388 } else {
389 for ( i in obj ) {
390 value = callback.call( obj[ i ], i, obj[ i ] );
391
392 if ( value === false ) {
393 break;
394 }
395 }
396 }
397 }
398
399 return obj;
400 },
401
402 // Support: Android<4.1, IE<9
403 trim: function( text ) {
404 return text == null ?
405 "" :
406 ( text + "" ).replace( rtrim, "" );
407 },
408
409 // results is for internal usage only
410 makeArray: function( arr, results ) {
411 var ret = results || [];
412
413 if ( arr != null ) {
414 if ( isArraylike( Object(arr) ) ) {
415 jQuery.merge( ret,
416 typeof arr === "string" ?
417 [ arr ] : arr
418 );
419 } else {
420 push.call( ret, arr );
421 }
422 }
423
424 return ret;
425 },
426
427 inArray: function( elem, arr, i ) {
428 var len;
429
430 if ( arr ) {
431 if ( indexOf ) {
432 return indexOf.call( arr, elem, i );
433 }
434
435 len = arr.length;
436 i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
437
438 for ( ; i < len; i++ ) {
439 // Skip accessing in sparse arrays
440 if ( i in arr && arr[ i ] === elem ) {
441 return i;
442 }
443 }
444 }
445
446 return -1;
447 },
448
449 merge: function( first, second ) {
450 var len = +second.length,
451 j = 0,
452 i = first.length;
453
454 while ( j < len ) {
455 first[ i++ ] = second[ j++ ];
456 }
457
458 // Support: IE<9
459 // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)
460 if ( len !== len ) {
461 while ( second[j] !== undefined ) {
462 first[ i++ ] = second[ j++ ];
463 }
464 }
465
466 first.length = i;
467
468 return first;
469 },
470
471 grep: function( elems, callback, invert ) {
472 var callbackInverse,
473 matches = [],
474 i = 0,
475 length = elems.length,
476 callbackExpect = !invert;
477
478 // Go through the array, only saving the items
479 // that pass the validator function
480 for ( ; i < length; i++ ) {
481 callbackInverse = !callback( elems[ i ], i );
482 if ( callbackInverse !== callbackExpect ) {
483 matches.push( elems[ i ] );
484 }
485 }
486
487 return matches;
488 },
489
490 // arg is for internal usage only
491 map: function( elems, callback, arg ) {
492 var value,
493 i = 0,
494 length = elems.length,
495 isArray = isArraylike( elems ),
496 ret = [];
497
498 // Go through the array, translating each of the items to their new values
499 if ( isArray ) {
500 for ( ; i < length; i++ ) {
501 value = callback( elems[ i ], i, arg );
502
503 if ( value != null ) {
504 ret.push( value );
505 }
506 }
507
508 // Go through every key on the object,
509 } else {
510 for ( i in elems ) {
511 value = callback( elems[ i ], i, arg );
512
513 if ( value != null ) {
514 ret.push( value );
515 }
516 }
517 }
518
519 // Flatten any nested arrays
520 return concat.apply( [], ret );
521 },
522
523 // A global GUID counter for objects
524 guid: 1,
525
526 // Bind a function to a context, optionally partially applying any
527 // arguments.
528 proxy: function( fn, context ) {
529 var args, proxy, tmp;
530
531 if ( typeof context === "string" ) {
532 tmp = fn[ context ];
533 context = fn;
534 fn = tmp;
535 }
536
537 // Quick check to determine if target is callable, in the spec
538 // this throws a TypeError, but we will just return undefined.
539 if ( !jQuery.isFunction( fn ) ) {
540 return undefined;
541 }
542
543 // Simulated bind
544 args = slice.call( arguments, 2 );
545 proxy = function() {
546 return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
547 };
548
549 // Set the guid of unique handler to the same of original handler, so it can be removed
550 proxy.guid = fn.guid = fn.guid || jQuery.guid++;
551
552 return proxy;
553 },
554
555 now: function() {
556 return +( new Date() );
557 },
558
559 // jQuery.support is not used in Core but other projects attach their
560 // properties to it so it needs to exist.
561 support: support
562 });
563
564 // Populate the class2type map
565 jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
566 class2type[ "[object " + name + "]" ] = name.toLowerCase();
567 });
568
569 function isArraylike( obj ) {
570 var length = obj.length,
571 type = jQuery.type( obj );
572
573 if ( type === "function" || jQuery.isWindow( obj ) ) {
574 return false;
575 }
576
577 if ( obj.nodeType === 1 && length ) {
578 return true;
579 }
580
581 return type === "array" || length === 0 ||
582 typeof length === "number" && length > 0 && ( length - 1 ) in obj;
583 }
584 var Sizzle =
585 /*!
586 * Sizzle CSS Selector Engine v1.10.19
587 * http://sizzlejs.com/
588 *
589 * Copyright 2013 jQuery Foundation, Inc. and other contributors
590 * Released under the MIT license
591 * http://jquery.org/license
592 *
593 * Date: 2014-04-18
594 */
595 (function( window ) {
596
597 var i,
598 support,
599 Expr,
600 getText,
601 isXML,
602 tokenize,
603 compile,
604 select,
605 outermostContext,
606 sortInput,
607 hasDuplicate,
608
609 // Local document vars
610 setDocument,
611 document,
612 docElem,
613 documentIsHTML,
614 rbuggyQSA,
615 rbuggyMatches,
616 matches,
617 contains,
618
619 // Instance-specific data
620 expando = "sizzle" + -(new Date()),
621 preferredDoc = window.document,
622 dirruns = 0,
623 done = 0,
624 classCache = createCache(),
625 tokenCache = createCache(),
626 compilerCache = createCache(),
627 sortOrder = function( a, b ) {
628 if ( a === b ) {
629 hasDuplicate = true;
630 }
631 return 0;
632 },
633
634 // General-purpose constants
635 strundefined = typeof undefined,
636 MAX_NEGATIVE = 1 << 31,
637
638 // Instance methods
639 hasOwn = ({}).hasOwnProperty,
640 arr = [],
641 pop = arr.pop,
642 push_native = arr.push,
643 push = arr.push,
644 slice = arr.slice,
645 // Use a stripped-down indexOf if we can't use a native one
646 indexOf = arr.indexOf || function( elem ) {
647 var i = 0,
648 len = this.length;
649 for ( ; i < len; i++ ) {
650 if ( this[i] === elem ) {
651 return i;
652 }
653 }
654 return -1;
655 },
656
657 booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
658
659 // Regular expressions
660
661 // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
662 whitespace = "[\\x20\\t\\r\\n\\f]",
663 // http://www.w3.org/TR/css3-syntax/#characters
664 characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
665
666 // Loosely modeled on CSS identifier characters
667 // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors
668 // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
669 identifier = characterEncoding.replace( "w", "w#" ),
670
671 // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
672 attributes = "\\[" + whitespace + "*(" + characterEncoding + ")(?:" + whitespace +
673 // Operator (capture 2)
674 "*([*^$|!~]?=)" + whitespace +
675 // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
676 "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
677 "*\\]",
678
679 pseudos = ":(" + characterEncoding + ")(?:\\((" +
680 // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
681 // 1. quoted (capture 3; capture 4 or capture 5)
682 "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
683 // 2. simple (capture 6)
684 "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
685 // 3. anything else (capture 2)
686 ".*" +
687 ")\\)|)",
688
689 // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
690 rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
691
692 rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
693 rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
694
695 rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
696
697 rpseudo = new RegExp( pseudos ),
698 ridentifier = new RegExp( "^" + identifier + "$" ),
699
700 matchExpr = {
701 "ID": new RegExp( "^#(" + characterEncoding + ")" ),
702 "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
703 "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
704 "ATTR": new RegExp( "^" + attributes ),
705 "PSEUDO": new RegExp( "^" + pseudos ),
706 "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
707 "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
708 "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
709 "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
710 // For use in libraries implementing .is()
711 // We use this for POS matching in `select`
712 "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
713 whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
714 },
715
716 rinputs = /^(?:input|select|textarea|button)$/i,
717 rheader = /^h\d$/i,
718
719 rnative = /^[^{]+\{\s*\[native \w/,
720
721 // Easily-parseable/retrievable ID or TAG or CLASS selectors
722 rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
723
724 rsibling = /[+~]/,
725 rescape = /'|\\/g,
726
727 // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
728 runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
729 funescape = function( _, escaped, escapedWhitespace ) {
730 var high = "0x" + escaped - 0x10000;
731 // NaN means non-codepoint
732 // Support: Firefox<24
733 // Workaround erroneous numeric interpretation of +"0x"
734 return high !== high || escapedWhitespace ?
735 escaped :
736 high < 0 ?
737 // BMP codepoint
738 String.fromCharCode( high + 0x10000 ) :
739 // Supplemental Plane codepoint (surrogate pair)
740 String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
741 };
742
743 // Optimize for push.apply( _, NodeList )
744 try {
745 push.apply(
746 (arr = slice.call( preferredDoc.childNodes )),
747 preferredDoc.childNodes
748 );
749 // Support: Android<4.0
750 // Detect silently failing push.apply
751 arr[ preferredDoc.childNodes.length ].nodeType;
752 } catch ( e ) {
753 push = { apply: arr.length ?
754
755 // Leverage slice if possible
756 function( target, els ) {
757 push_native.apply( target, slice.call(els) );
758 } :
759
760 // Support: IE<9
761 // Otherwise append directly
762 function( target, els ) {
763 var j = target.length,
764 i = 0;
765 // Can't trust NodeList.length
766 while ( (target[j++] = els[i++]) ) {}
767 target.length = j - 1;
768 }
769 };
770 }
771
772 function Sizzle( selector, context, results, seed ) {
773 var match, elem, m, nodeType,
774 // QSA vars
775 i, groups, old, nid, newContext, newSelector;
776
777 if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) {
778 setDocument( context );
779 }
780
781 context = context || document;
782 results = results || [];
783
784 if ( !selector || typeof selector !== "string" ) {
785 return results;
786 }
787
788 if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) {
789 return [];
790 }
791
792 if ( documentIsHTML && !seed ) {
793
794 // Shortcuts
795 if ( (match = rquickExpr.exec( selector )) ) {
796 // Speed-up: Sizzle("#ID")
797 if ( (m = match[1]) ) {
798 if ( nodeType === 9 ) {
799 elem = context.getElementById( m );
800 // Check parentNode to catch when Blackberry 4.6 returns
801 // nodes that are no longer in the document (jQuery #6963)
802 if ( elem && elem.parentNode ) {
803 // Handle the case where IE, Opera, and Webkit return items
804 // by name instead of ID
805 if ( elem.id === m ) {
806 results.push( elem );
807 return results;
808 }
809 } else {
810 return results;
811 }
812 } else {
813 // Context is not a document
814 if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
815 contains( context, elem ) && elem.id === m ) {
816 results.push( elem );
817 return results;
818 }
819 }
820
821 // Speed-up: Sizzle("TAG")
822 } else if ( match[2] ) {
823 push.apply( results, context.getElementsByTagName( selector ) );
824 return results;
825
826 // Speed-up: Sizzle(".CLASS")
827 } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) {
828 push.apply( results, context.getElementsByClassName( m ) );
829 return results;
830 }
831 }
832
833 // QSA path
834 if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) {
835 nid = old = expando;
836 newContext = context;
837 newSelector = nodeType === 9 && selector;
838
839 // qSA works strangely on Element-rooted queries
840 // We can work around this by specifying an extra ID on the root
841 // and working up from there (Thanks to Andrew Dupont for the technique)
842 // IE 8 doesn't work on object elements
843 if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
844 groups = tokenize( selector );
845
846 if ( (old = context.getAttribute("id")) ) {
847 nid = old.replace( rescape, "\\$&" );
848 } else {
849 context.setAttribute( "id", nid );
850 }
851 nid = "[id='" + nid + "'] ";
852
853 i = groups.length;
854 while ( i-- ) {
855 groups[i] = nid + toSelector( groups[i] );
856 }
857 newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context;
858 newSelector = groups.join(",");
859 }
860
861 if ( newSelector ) {
862 try {
863 push.apply( results,
864 newContext.querySelectorAll( newSelector )
865 );
866 return results;
867 } catch(qsaError) {
868 } finally {
869 if ( !old ) {
870 context.removeAttribute("id");
871 }
872 }
873 }
874 }
875 }
876
877 // All others
878 return select( selector.replace( rtrim, "$1" ), context, results, seed );
879 }
880
881 /**
882 * Create key-value caches of limited size
883 * @returns {Function(string, Object)} Returns the Object data after storing it on itself with
884 * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength)
885 * deleting the oldest entry
886 */
887 function createCache() {
888 var keys = [];
889
890 function cache( key, value ) {
891 // Use (key + " ") to avoid collision with native prototype properties (see Issue #157)
892 if ( keys.push( key + " " ) > Expr.cacheLength ) {
893 // Only keep the most recent entries
894 delete cache[ keys.shift() ];
895 }
896 return (cache[ key + " " ] = value);
897 }
898 return cache;
899 }
900
901 /**
902 * Mark a function for special use by Sizzle
903 * @param {Function} fn The function to mark
904 */
905 function markFunction( fn ) {
906 fn[ expando ] = true;
907 return fn;
908 }
909
910 /**
911 * Support testing using an element
912 * @param {Function} fn Passed the created div and expects a boolean result
913 */
914 function assert( fn ) {
915 var div = document.createElement("div");
916
917 try {
918 return !!fn( div );
919 } catch (e) {
920 return false;
921 } finally {
922 // Remove from its parent by default
923 if ( div.parentNode ) {
924 div.parentNode.removeChild( div );
925 }
926 // release memory in IE
927 div = null;
928 }
929 }
930
931 /**
932 * Adds the same handler for all of the specified attrs
933 * @param {String} attrs Pipe-separated list of attributes
934 * @param {Function} handler The method that will be applied
935 */
936 function addHandle( attrs, handler ) {
937 var arr = attrs.split("|"),
938 i = attrs.length;
939
940 while ( i-- ) {
941 Expr.attrHandle[ arr[i] ] = handler;
942 }
943 }
944
945 /**
946 * Checks document order of two siblings
947 * @param {Element} a
948 * @param {Element} b
949 * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b
950 */
951 function siblingCheck( a, b ) {
952 var cur = b && a,
953 diff = cur && a.nodeType === 1 && b.nodeType === 1 &&
954 ( ~b.sourceIndex || MAX_NEGATIVE ) -
955 ( ~a.sourceIndex || MAX_NEGATIVE );
956
957 // Use IE sourceIndex if available on both nodes
958 if ( diff ) {
959 return diff;
960 }
961
962 // Check if b follows a
963 if ( cur ) {
964 while ( (cur = cur.nextSibling) ) {
965 if ( cur === b ) {
966 return -1;
967 }
968 }
969 }
970
971 return a ? 1 : -1;
972 }
973
974 /**
975 * Returns a function to use in pseudos for input types
976 * @param {String} type
977 */
978 function createInputPseudo( type ) {
979 return function( elem ) {
980 var name = elem.nodeName.toLowerCase();
981 return name === "input" && elem.type === type;
982 };
983 }
984
985 /**
986 * Returns a function to use in pseudos for buttons
987 * @param {String} type
988 */
989 function createButtonPseudo( type ) {
990 return function( elem ) {
991 var name = elem.nodeName.toLowerCase();
992 return (name === "input" || name === "button") && elem.type === type;
993 };
994 }
995
996 /**
997 * Returns a function to use in pseudos for positionals
998 * @param {Function} fn
999 */
1000 function createPositionalPseudo( fn ) {
1001 return markFunction(function( argument ) {
1002 argument = +argument;
1003 return markFunction(function( seed, matches ) {
1004 var j,
1005 matchIndexes = fn( [], seed.length, argument ),
1006 i = matchIndexes.length;
1007
1008 // Match elements found at the specified indexes
1009 while ( i-- ) {
1010 if ( seed[ (j = matchIndexes[i]) ] ) {
1011 seed[j] = !(matches[j] = seed[j]);
1012 }
1013 }
1014 });
1015 });
1016 }
1017
1018 /**
1019 * Checks a node for validity as a Sizzle context
1020 * @param {Element|Object=} context
1021 * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value
1022 */
1023 function testContext( context ) {
1024 return context && typeof context.getElementsByTagName !== strundefined && context;
1025 }
1026
1027 // Expose support vars for convenience
1028 support = Sizzle.support = {};
1029
1030 /**
1031 * Detects XML nodes
1032 * @param {Element|Object} elem An element or a document
1033 * @returns {Boolean} True iff elem is a non-HTML XML node
1034 */
1035 isXML = Sizzle.isXML = function( elem ) {
1036 // documentElement is verified for cases where it doesn't yet exist
1037 // (such as loading iframes in IE - #4833)
1038 var documentElement = elem && (elem.ownerDocument || elem).documentElement;
1039 return documentElement ? documentElement.nodeName !== "HTML" : false;
1040 };
1041
1042 /**
1043 * Sets document-related variables once based on the current document
1044 * @param {Element|Object} [doc] An element or document object to use to set the document
1045 * @returns {Object} Returns the current document
1046 */
1047 setDocument = Sizzle.setDocument = function( node ) {
1048 var hasCompare,
1049 doc = node ? node.ownerDocument || node : preferredDoc,
1050 parent = doc.defaultView;
1051
1052 // If no document and documentElement is available, return
1053 if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) {
1054 return document;
1055 }
1056
1057 // Set our document
1058 document = doc;
1059 docElem = doc.documentElement;
1060
1061 // Support tests
1062 documentIsHTML = !isXML( doc );
1063
1064 // Support: IE>8
1065 // If iframe document is assigned to "document" variable and if iframe has been reloaded,
1066 // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936
1067 // IE6-8 do not support the defaultView property so parent will be undefined
1068 if ( parent && parent !== parent.top ) {
1069 // IE11 does not have attachEvent, so all must suffer
1070 if ( parent.addEventListener ) {
1071 parent.addEventListener( "unload", function() {
1072 setDocument();
1073 }, false );
1074 } else if ( parent.attachEvent ) {
1075 parent.attachEvent( "onunload", function() {
1076 setDocument();
1077 });
1078 }
1079 }
1080
1081 /* Attributes
1082 ---------------------------------------------------------------------- */
1083
1084 // Support: IE<8
1085 // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans)
1086 support.attributes = assert(function( div ) {
1087 div.className = "i";
1088 return !div.getAttribute("className");
1089 });
1090
1091 /* getElement(s)By*
1092 ---------------------------------------------------------------------- */
1093
1094 // Check if getElementsByTagName("*") returns only elements
1095 support.getElementsByTagName = assert(function( div ) {
1096 div.appendChild( doc.createComment("") );
1097 return !div.getElementsByTagName("*").length;
1098 });
1099
1100 // Check if getElementsByClassName can be trusted
1101 support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) {
1102 div.innerHTML = "<div class='a'></div><div class='a i'></div>";
1103
1104 // Support: Safari<4
1105 // Catch class over-caching
1106 div.firstChild.className = "i";
1107 // Support: Opera<10
1108 // Catch gEBCN failure to find non-leading classes
1109 return div.getElementsByClassName("i").length === 2;
1110 });
1111
1112 // Support: IE<10
1113 // Check if getElementById returns elements by name
1114 // The broken getElementById methods don't pick up programatically-set names,
1115 // so use a roundabout getElementsByName test
1116 support.getById = assert(function( div ) {
1117 docElem.appendChild( div ).id = expando;
1118 return !doc.getElementsByName || !doc.getElementsByName( expando ).length;
1119 });
1120
1121 // ID find and filter
1122 if ( support.getById ) {
1123 Expr.find["ID"] = function( id, context ) {
1124 if ( typeof context.getElementById !== strundefined && documentIsHTML ) {
1125 var m = context.getElementById( id );
1126 // Check parentNode to catch when Blackberry 4.6 returns
1127 // nodes that are no longer in the document #6963
1128 return m && m.parentNode ? [ m ] : [];
1129 }
1130 };
1131 Expr.filter["ID"] = function( id ) {
1132 var attrId = id.replace( runescape, funescape );
1133 return function( elem ) {
1134 return elem.getAttribute("id") === attrId;
1135 };
1136 };
1137 } else {
1138 // Support: IE6/7
1139 // getElementById is not reliable as a find shortcut
1140 delete Expr.find["ID"];
1141
1142 Expr.filter["ID"] = function( id ) {
1143 var attrId = id.replace( runescape, funescape );
1144 return function( elem ) {
1145 var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
1146 return node && node.value === attrId;
1147 };
1148 };
1149 }
1150
1151 // Tag
1152 Expr.find["TAG"] = support.getElementsByTagName ?
1153 function( tag, context ) {
1154 if ( typeof context.getElementsByTagName !== strundefined ) {
1155 return context.getElementsByTagName( tag );
1156 }
1157 } :
1158 function( tag, context ) {
1159 var elem,
1160 tmp = [],
1161 i = 0,
1162 results = context.getElementsByTagName( tag );
1163
1164 // Filter out possible comments
1165 if ( tag === "*" ) {
1166 while ( (elem = results[i++]) ) {
1167 if ( elem.nodeType === 1 ) {
1168 tmp.push( elem );
1169 }
1170 }
1171
1172 return tmp;
1173 }
1174 return results;
1175 };
1176
1177 // Class
1178 Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) {
1179 if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) {
1180 return context.getElementsByClassName( className );
1181 }
1182 };
1183
1184 /* QSA/matchesSelector
1185 ---------------------------------------------------------------------- */
1186
1187 // QSA and matchesSelector support
1188
1189 // matchesSelector(:active) reports false when true (IE9/Opera 11.5)
1190 rbuggyMatches = [];
1191
1192 // qSa(:focus) reports false when true (Chrome 21)
1193 // We allow this because of a bug in IE8/9 that throws an error
1194 // whenever `document.activeElement` is accessed on an iframe
1195 // So, we allow :focus to pass through QSA all the time to avoid the IE error
1196 // See http://bugs.jquery.com/ticket/13378
1197 rbuggyQSA = [];
1198
1199 if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) {
1200 // Build QSA regex
1201 // Regex strategy adopted from Diego Perini
1202 assert(function( div ) {
1203 // Select is set to empty string on purpose
1204 // This is to test IE's treatment of not explicitly
1205 // setting a boolean content attribute,
1206 // since its presence should be enough
1207 // http://bugs.jquery.com/ticket/12359
1208 div.innerHTML = "<select msallowclip=''><option selected=''></option></select>";
1209
1210 // Support: IE8, Opera 11-12.16
1211 // Nothing should be selected when empty strings follow ^= or $= or *=
1212 // The test attribute must be unknown in Opera but "safe" for WinRT
1213 // http://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section
1214 if ( div.querySelectorAll("[msallowclip^='']").length ) {
1215 rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" );
1216 }
1217
1218 // Support: IE8
1219 // Boolean attributes and "value" are not treated correctly
1220 if ( !div.querySelectorAll("[selected]").length ) {
1221 rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" );
1222 }
1223
1224 // Webkit/Opera - :checked should return selected option elements
1225 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1226 // IE8 throws error here and will not see later tests
1227 if ( !div.querySelectorAll(":checked").length ) {
1228 rbuggyQSA.push(":checked");
1229 }
1230 });
1231
1232 assert(function( div ) {
1233 // Support: Windows 8 Native Apps
1234 // The type and name attributes are restricted during .innerHTML assignment
1235 var input = doc.createElement("input");
1236 input.setAttribute( "type", "hidden" );
1237 div.appendChild( input ).setAttribute( "name", "D" );
1238
1239 // Support: IE8
1240 // Enforce case-sensitivity of name attribute
1241 if ( div.querySelectorAll("[name=d]").length ) {
1242 rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" );
1243 }
1244
1245 // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
1246 // IE8 throws error here and will not see later tests
1247 if ( !div.querySelectorAll(":enabled").length ) {
1248 rbuggyQSA.push( ":enabled", ":disabled" );
1249 }
1250
1251 // Opera 10-11 does not throw on post-comma invalid pseudos
1252 div.querySelectorAll("*,:x");
1253 rbuggyQSA.push(",.*:");
1254 });
1255 }
1256
1257 if ( (support.matchesSelector = rnative.test( (matches = docElem.matches ||
1258 docElem.webkitMatchesSelector ||
1259 docElem.mozMatchesSelector ||
1260 docElem.oMatchesSelector ||
1261 docElem.msMatchesSelector) )) ) {
1262
1263 assert(function( div ) {
1264 // Check to see if it's possible to do matchesSelector
1265 // on a disconnected node (IE 9)
1266 support.disconnectedMatch = matches.call( div, "div" );
1267
1268 // This should fail with an exception
1269 // Gecko does not error, returns false instead
1270 matches.call( div, "[s!='']:x" );
1271 rbuggyMatches.push( "!=", pseudos );
1272 });
1273 }
1274
1275 rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") );
1276 rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") );
1277
1278 /* Contains
1279 ---------------------------------------------------------------------- */
1280 hasCompare = rnative.test( docElem.compareDocumentPosition );
1281
1282 // Element contains another
1283 // Purposefully does not implement inclusive descendent
1284 // As in, an element does not contain itself
1285 contains = hasCompare || rnative.test( docElem.contains ) ?
1286 function( a, b ) {
1287 var adown = a.nodeType === 9 ? a.documentElement : a,
1288 bup = b && b.parentNode;
1289 return a === bup || !!( bup && bup.nodeType === 1 && (
1290 adown.contains ?
1291 adown.contains( bup ) :
1292 a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16
1293 ));
1294 } :
1295 function( a, b ) {
1296 if ( b ) {
1297 while ( (b = b.parentNode) ) {
1298 if ( b === a ) {
1299 return true;
1300 }
1301 }
1302 }
1303 return false;
1304 };
1305
1306 /* Sorting
1307 ---------------------------------------------------------------------- */
1308
1309 // Document order sorting
1310 sortOrder = hasCompare ?
1311 function( a, b ) {
1312
1313 // Flag for duplicate removal
1314 if ( a === b ) {
1315 hasDuplicate = true;
1316 return 0;
1317 }
1318
1319 // Sort on method existence if only one input has compareDocumentPosition
1320 var compare = !a.compareDocumentPosition - !b.compareDocumentPosition;
1321 if ( compare ) {
1322 return compare;
1323 }
1324
1325 // Calculate position if both inputs belong to the same document
1326 compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ?
1327 a.compareDocumentPosition( b ) :
1328
1329 // Otherwise we know they are disconnected
1330 1;
1331
1332 // Disconnected nodes
1333 if ( compare & 1 ||
1334 (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) {
1335
1336 // Choose the first element that is related to our preferred document
1337 if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) {
1338 return -1;
1339 }
1340 if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) {
1341 return 1;
1342 }
1343
1344 // Maintain original order
1345 return sortInput ?
1346 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1347 0;
1348 }
1349
1350 return compare & 4 ? -1 : 1;
1351 } :
1352 function( a, b ) {
1353 // Exit early if the nodes are identical
1354 if ( a === b ) {
1355 hasDuplicate = true;
1356 return 0;
1357 }
1358
1359 var cur,
1360 i = 0,
1361 aup = a.parentNode,
1362 bup = b.parentNode,
1363 ap = [ a ],
1364 bp = [ b ];
1365
1366 // Parentless nodes are either documents or disconnected
1367 if ( !aup || !bup ) {
1368 return a === doc ? -1 :
1369 b === doc ? 1 :
1370 aup ? -1 :
1371 bup ? 1 :
1372 sortInput ?
1373 ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) :
1374 0;
1375
1376 // If the nodes are siblings, we can do a quick check
1377 } else if ( aup === bup ) {
1378 return siblingCheck( a, b );
1379 }
1380
1381 // Otherwise we need full lists of their ancestors for comparison
1382 cur = a;
1383 while ( (cur = cur.parentNode) ) {
1384 ap.unshift( cur );
1385 }
1386 cur = b;
1387 while ( (cur = cur.parentNode) ) {
1388 bp.unshift( cur );
1389 }
1390
1391 // Walk down the tree looking for a discrepancy
1392 while ( ap[i] === bp[i] ) {
1393 i++;
1394 }
1395
1396 return i ?
1397 // Do a sibling check if the nodes have a common ancestor
1398 siblingCheck( ap[i], bp[i] ) :
1399
1400 // Otherwise nodes in our document sort first
1401 ap[i] === preferredDoc ? -1 :
1402 bp[i] === preferredDoc ? 1 :
1403 0;
1404 };
1405
1406 return doc;
1407 };
1408
1409 Sizzle.matches = function( expr, elements ) {
1410 return Sizzle( expr, null, null, elements );
1411 };
1412
1413 Sizzle.matchesSelector = function( elem, expr ) {
1414 // Set document vars if needed
1415 if ( ( elem.ownerDocument || elem ) !== document ) {
1416 setDocument( elem );
1417 }
1418
1419 // Make sure that attribute selectors are quoted
1420 expr = expr.replace( rattributeQuotes, "='$1']" );
1421
1422 if ( support.matchesSelector && documentIsHTML &&
1423 ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) &&
1424 ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) {
1425
1426 try {
1427 var ret = matches.call( elem, expr );
1428
1429 // IE 9's matchesSelector returns false on disconnected nodes
1430 if ( ret || support.disconnectedMatch ||
1431 // As well, disconnected nodes are said to be in a document
1432 // fragment in IE 9
1433 elem.document && elem.document.nodeType !== 11 ) {
1434 return ret;
1435 }
1436 } catch(e) {}
1437 }
1438
1439 return Sizzle( expr, document, null, [ elem ] ).length > 0;
1440 };
1441
1442 Sizzle.contains = function( context, elem ) {
1443 // Set document vars if needed
1444 if ( ( context.ownerDocument || context ) !== document ) {
1445 setDocument( context );
1446 }
1447 return contains( context, elem );
1448 };
1449
1450 Sizzle.attr = function( elem, name ) {
1451 // Set document vars if needed
1452 if ( ( elem.ownerDocument || elem ) !== document ) {
1453 setDocument( elem );
1454 }
1455
1456 var fn = Expr.attrHandle[ name.toLowerCase() ],
1457 // Don't get fooled by Object.prototype properties (jQuery #13807)
1458 val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ?
1459 fn( elem, name, !documentIsHTML ) :
1460 undefined;
1461
1462 return val !== undefined ?
1463 val :
1464 support.attributes || !documentIsHTML ?
1465 elem.getAttribute( name ) :
1466 (val = elem.getAttributeNode(name)) && val.specified ?
1467 val.value :
1468 null;
1469 };
1470
1471 Sizzle.error = function( msg ) {
1472 throw new Error( "Syntax error, unrecognized expression: " + msg );
1473 };
1474
1475 /**
1476 * Document sorting and removing duplicates
1477 * @param {ArrayLike} results
1478 */
1479 Sizzle.uniqueSort = function( results ) {
1480 var elem,
1481 duplicates = [],
1482 j = 0,
1483 i = 0;
1484
1485 // Unless we *know* we can detect duplicates, assume their presence
1486 hasDuplicate = !support.detectDuplicates;
1487 sortInput = !support.sortStable && results.slice( 0 );
1488 results.sort( sortOrder );
1489
1490 if ( hasDuplicate ) {
1491 while ( (elem = results[i++]) ) {
1492 if ( elem === results[ i ] ) {
1493 j = duplicates.push( i );
1494 }
1495 }
1496 while ( j-- ) {
1497 results.splice( duplicates[ j ], 1 );
1498 }
1499 }
1500
1501 // Clear input after sorting to release objects
1502 // See https://github.com/jquery/sizzle/pull/225
1503 sortInput = null;
1504
1505 return results;
1506 };
1507
1508 /**
1509 * Utility function for retrieving the text value of an array of DOM nodes
1510 * @param {Array|Element} elem
1511 */
1512 getText = Sizzle.getText = function( elem ) {
1513 var node,
1514 ret = "",
1515 i = 0,
1516 nodeType = elem.nodeType;
1517
1518 if ( !nodeType ) {
1519 // If no nodeType, this is expected to be an array
1520 while ( (node = elem[i++]) ) {
1521 // Do not traverse comment nodes
1522 ret += getText( node );
1523 }
1524 } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
1525 // Use textContent for elements
1526 // innerText usage removed for consistency of new lines (jQuery #11153)
1527 if ( typeof elem.textContent === "string" ) {
1528 return elem.textContent;
1529 } else {
1530 // Traverse its children
1531 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1532 ret += getText( elem );
1533 }
1534 }
1535 } else if ( nodeType === 3 || nodeType === 4 ) {
1536 return elem.nodeValue;
1537 }
1538 // Do not include comment or processing instruction nodes
1539
1540 return ret;
1541 };
1542
1543 Expr = Sizzle.selectors = {
1544
1545 // Can be adjusted by the user
1546 cacheLength: 50,
1547
1548 createPseudo: markFunction,
1549
1550 match: matchExpr,
1551
1552 attrHandle: {},
1553
1554 find: {},
1555
1556 relative: {
1557 ">": { dir: "parentNode", first: true },
1558 " ": { dir: "parentNode" },
1559 "+": { dir: "previousSibling", first: true },
1560 "~": { dir: "previousSibling" }
1561 },
1562
1563 preFilter: {
1564 "ATTR": function( match ) {
1565 match[1] = match[1].replace( runescape, funescape );
1566
1567 // Move the given value to match[3] whether quoted or unquoted
1568 match[3] = ( match[3] || match[4] || match[5] || "" ).replace( runescape, funescape );
1569
1570 if ( match[2] === "~=" ) {
1571 match[3] = " " + match[3] + " ";
1572 }
1573
1574 return match.slice( 0, 4 );
1575 },
1576
1577 "CHILD": function( match ) {
1578 /* matches from matchExpr["CHILD"]
1579 1 type (only|nth|...)
1580 2 what (child|of-type)
1581 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
1582 4 xn-component of xn+y argument ([+-]?\d*n|)
1583 5 sign of xn-component
1584 6 x of xn-component
1585 7 sign of y-component
1586 8 y of y-component
1587 */
1588 match[1] = match[1].toLowerCase();
1589
1590 if ( match[1].slice( 0, 3 ) === "nth" ) {
1591 // nth-* requires argument
1592 if ( !match[3] ) {
1593 Sizzle.error( match[0] );
1594 }
1595
1596 // numeric x and y parameters for Expr.filter.CHILD
1597 // remember that false/true cast respectively to 0/1
1598 match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) );
1599 match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" );
1600
1601 // other types prohibit arguments
1602 } else if ( match[3] ) {
1603 Sizzle.error( match[0] );
1604 }
1605
1606 return match;
1607 },
1608
1609 "PSEUDO": function( match ) {
1610 var excess,
1611 unquoted = !match[6] && match[2];
1612
1613 if ( matchExpr["CHILD"].test( match[0] ) ) {
1614 return null;
1615 }
1616
1617 // Accept quoted arguments as-is
1618 if ( match[3] ) {
1619 match[2] = match[4] || match[5] || "";
1620
1621 // Strip excess characters from unquoted arguments
1622 } else if ( unquoted && rpseudo.test( unquoted ) &&
1623 // Get excess from tokenize (recursively)
1624 (excess = tokenize( unquoted, true )) &&
1625 // advance to the next closing parenthesis
1626 (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
1627
1628 // excess is a negative index
1629 match[0] = match[0].slice( 0, excess );
1630 match[2] = unquoted.slice( 0, excess );
1631 }
1632
1633 // Return only captures needed by the pseudo filter method (type and argument)
1634 return match.slice( 0, 3 );
1635 }
1636 },
1637
1638 filter: {
1639
1640 "TAG": function( nodeNameSelector ) {
1641 var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase();
1642 return nodeNameSelector === "*" ?
1643 function() { return true; } :
1644 function( elem ) {
1645 return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
1646 };
1647 },
1648
1649 "CLASS": function( className ) {
1650 var pattern = classCache[ className + " " ];
1651
1652 return pattern ||
1653 (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
1654 classCache( className, function( elem ) {
1655 return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" );
1656 });
1657 },
1658
1659 "ATTR": function( name, operator, check ) {
1660 return function( elem ) {
1661 var result = Sizzle.attr( elem, name );
1662
1663 if ( result == null ) {
1664 return operator === "!=";
1665 }
1666 if ( !operator ) {
1667 return true;
1668 }
1669
1670 result += "";
1671
1672 return operator === "=" ? result === check :
1673 operator === "!=" ? result !== check :
1674 operator === "^=" ? check && result.indexOf( check ) === 0 :
1675 operator === "*=" ? check && result.indexOf( check ) > -1 :
1676 operator === "$=" ? check && result.slice( -check.length ) === check :
1677 operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
1678 operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" :
1679 false;
1680 };
1681 },
1682
1683 "CHILD": function( type, what, argument, first, last ) {
1684 var simple = type.slice( 0, 3 ) !== "nth",
1685 forward = type.slice( -4 ) !== "last",
1686 ofType = what === "of-type";
1687
1688 return first === 1 && last === 0 ?
1689
1690 // Shortcut for :nth-*(n)
1691 function( elem ) {
1692 return !!elem.parentNode;
1693 } :
1694
1695 function( elem, context, xml ) {
1696 var cache, outerCache, node, diff, nodeIndex, start,
1697 dir = simple !== forward ? "nextSibling" : "previousSibling",
1698 parent = elem.parentNode,
1699 name = ofType && elem.nodeName.toLowerCase(),
1700 useCache = !xml && !ofType;
1701
1702 if ( parent ) {
1703
1704 // :(first|last|only)-(child|of-type)
1705 if ( simple ) {
1706 while ( dir ) {
1707 node = elem;
1708 while ( (node = node[ dir ]) ) {
1709 if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) {
1710 return false;
1711 }
1712 }
1713 // Reverse direction for :only-* (if we haven't yet done so)
1714 start = dir = type === "only" && !start && "nextSibling";
1715 }
1716 return true;
1717 }
1718
1719 start = [ forward ? parent.firstChild : parent.lastChild ];
1720
1721 // non-xml :nth-child(...) stores cache data on `parent`
1722 if ( forward && useCache ) {
1723 // Seek `elem` from a previously-cached index
1724 outerCache = parent[ expando ] || (parent[ expando ] = {});
1725 cache = outerCache[ type ] || [];
1726 nodeIndex = cache[0] === dirruns && cache[1];
1727 diff = cache[0] === dirruns && cache[2];
1728 node = nodeIndex && parent.childNodes[ nodeIndex ];
1729
1730 while ( (node = ++nodeIndex && node && node[ dir ] ||
1731
1732 // Fallback to seeking `elem` from the start
1733 (diff = nodeIndex = 0) || start.pop()) ) {
1734
1735 // When found, cache indexes on `parent` and break
1736 if ( node.nodeType === 1 && ++diff && node === elem ) {
1737 outerCache[ type ] = [ dirruns, nodeIndex, diff ];
1738 break;
1739 }
1740 }
1741
1742 // Use previously-cached element index if available
1743 } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) {
1744 diff = cache[1];
1745
1746 // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...)
1747 } else {
1748 // Use the same loop as above to seek `elem` from the start
1749 while ( (node = ++nodeIndex && node && node[ dir ] ||
1750 (diff = nodeIndex = 0) || start.pop()) ) {
1751
1752 if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) {
1753 // Cache the index of each encountered element
1754 if ( useCache ) {
1755 (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ];
1756 }
1757
1758 if ( node === elem ) {
1759 break;
1760 }
1761 }
1762 }
1763 }
1764
1765 // Incorporate the offset, then check against cycle size
1766 diff -= last;
1767 return diff === first || ( diff % first === 0 && diff / first >= 0 );
1768 }
1769 };
1770 },
1771
1772 "PSEUDO": function( pseudo, argument ) {
1773 // pseudo-class names are case-insensitive
1774 // http://www.w3.org/TR/selectors/#pseudo-classes
1775 // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
1776 // Remember that setFilters inherits from pseudos
1777 var args,
1778 fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
1779 Sizzle.error( "unsupported pseudo: " + pseudo );
1780
1781 // The user may use createPseudo to indicate that
1782 // arguments are needed to create the filter function
1783 // just as Sizzle does
1784 if ( fn[ expando ] ) {
1785 return fn( argument );
1786 }
1787
1788 // But maintain support for old signatures
1789 if ( fn.length > 1 ) {
1790 args = [ pseudo, pseudo, "", argument ];
1791 return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
1792 markFunction(function( seed, matches ) {
1793 var idx,
1794 matched = fn( seed, argument ),
1795 i = matched.length;
1796 while ( i-- ) {
1797 idx = indexOf.call( seed, matched[i] );
1798 seed[ idx ] = !( matches[ idx ] = matched[i] );
1799 }
1800 }) :
1801 function( elem ) {
1802 return fn( elem, 0, args );
1803 };
1804 }
1805
1806 return fn;
1807 }
1808 },
1809
1810 pseudos: {
1811 // Potentially complex pseudos
1812 "not": markFunction(function( selector ) {
1813 // Trim the selector passed to compile
1814 // to avoid treating leading and trailing
1815 // spaces as combinators
1816 var input = [],
1817 results = [],
1818 matcher = compile( selector.replace( rtrim, "$1" ) );
1819
1820 return matcher[ expando ] ?
1821 markFunction(function( seed, matches, context, xml ) {
1822 var elem,
1823 unmatched = matcher( seed, null, xml, [] ),
1824 i = seed.length;
1825
1826 // Match elements unmatched by `matcher`
1827 while ( i-- ) {
1828 if ( (elem = unmatched[i]) ) {
1829 seed[i] = !(matches[i] = elem);
1830 }
1831 }
1832 }) :
1833 function( elem, context, xml ) {
1834 input[0] = elem;
1835 matcher( input, null, xml, results );
1836 return !results.pop();
1837 };
1838 }),
1839
1840 "has": markFunction(function( selector ) {
1841 return function( elem ) {
1842 return Sizzle( selector, elem ).length > 0;
1843 };
1844 }),
1845
1846 "contains": markFunction(function( text ) {
1847 return function( elem ) {
1848 return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
1849 };
1850 }),
1851
1852 // "Whether an element is represented by a :lang() selector
1853 // is based solely on the element's language value
1854 // being equal to the identifier C,
1855 // or beginning with the identifier C immediately followed by "-".
1856 // The matching of C against the element's language value is performed case-insensitively.
1857 // The identifier C does not have to be a valid language name."
1858 // http://www.w3.org/TR/selectors/#lang-pseudo
1859 "lang": markFunction( function( lang ) {
1860 // lang value must be a valid identifier
1861 if ( !ridentifier.test(lang || "") ) {
1862 Sizzle.error( "unsupported lang: " + lang );
1863 }
1864 lang = lang.replace( runescape, funescape ).toLowerCase();
1865 return function( elem ) {
1866 var elemLang;
1867 do {
1868 if ( (elemLang = documentIsHTML ?
1869 elem.lang :
1870 elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) {
1871
1872 elemLang = elemLang.toLowerCase();
1873 return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0;
1874 }
1875 } while ( (elem = elem.parentNode) && elem.nodeType === 1 );
1876 return false;
1877 };
1878 }),
1879
1880 // Miscellaneous
1881 "target": function( elem ) {
1882 var hash = window.location && window.location.hash;
1883 return hash && hash.slice( 1 ) === elem.id;
1884 },
1885
1886 "root": function( elem ) {
1887 return elem === docElem;
1888 },
1889
1890 "focus": function( elem ) {
1891 return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
1892 },
1893
1894 // Boolean properties
1895 "enabled": function( elem ) {
1896 return elem.disabled === false;
1897 },
1898
1899 "disabled": function( elem ) {
1900 return elem.disabled === true;
1901 },
1902
1903 "checked": function( elem ) {
1904 // In CSS3, :checked should return both checked and selected elements
1905 // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
1906 var nodeName = elem.nodeName.toLowerCase();
1907 return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
1908 },
1909
1910 "selected": function( elem ) {
1911 // Accessing this property makes selected-by-default
1912 // options in Safari work properly
1913 if ( elem.parentNode ) {
1914 elem.parentNode.selectedIndex;
1915 }
1916
1917 return elem.selected === true;
1918 },
1919
1920 // Contents
1921 "empty": function( elem ) {
1922 // http://www.w3.org/TR/selectors/#empty-pseudo
1923 // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5),
1924 // but not by others (comment: 8; processing instruction: 7; etc.)
1925 // nodeType < 6 works because attributes (2) do not appear as children
1926 for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
1927 if ( elem.nodeType < 6 ) {
1928 return false;
1929 }
1930 }
1931 return true;
1932 },
1933
1934 "parent": function( elem ) {
1935 return !Expr.pseudos["empty"]( elem );
1936 },
1937
1938 // Element/input types
1939 "header": function( elem ) {
1940 return rheader.test( elem.nodeName );
1941 },
1942
1943 "input": function( elem ) {
1944 return rinputs.test( elem.nodeName );
1945 },
1946
1947 "button": function( elem ) {
1948 var name = elem.nodeName.toLowerCase();
1949 return name === "input" && elem.type === "button" || name === "button";
1950 },
1951
1952 "text": function( elem ) {
1953 var attr;
1954 return elem.nodeName.toLowerCase() === "input" &&
1955 elem.type === "text" &&
1956
1957 // Support: IE<8
1958 // New HTML5 attribute values (e.g., "search") appear with elem.type === "text"
1959 ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" );
1960 },
1961
1962 // Position-in-collection
1963 "first": createPositionalPseudo(function() {
1964 return [ 0 ];
1965 }),
1966
1967 "last": createPositionalPseudo(function( matchIndexes, length ) {
1968 return [ length - 1 ];
1969 }),
1970
1971 "eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
1972 return [ argument < 0 ? argument + length : argument ];
1973 }),
1974
1975 "even": createPositionalPseudo(function( matchIndexes, length ) {
1976 var i = 0;
1977 for ( ; i < length; i += 2 ) {
1978 matchIndexes.push( i );
1979 }
1980 return matchIndexes;
1981 }),
1982
1983 "odd": createPositionalPseudo(function( matchIndexes, length ) {
1984 var i = 1;
1985 for ( ; i < length; i += 2 ) {
1986 matchIndexes.push( i );
1987 }
1988 return matchIndexes;
1989 }),
1990
1991 "lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
1992 var i = argument < 0 ? argument + length : argument;
1993 for ( ; --i >= 0; ) {
1994 matchIndexes.push( i );
1995 }
1996 return matchIndexes;
1997 }),
1998
1999 "gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
2000 var i = argument < 0 ? argument + length : argument;
2001 for ( ; ++i < length; ) {
2002 matchIndexes.push( i );
2003 }
2004 return matchIndexes;
2005 })
2006 }
2007 };
2008
2009 Expr.pseudos["nth"] = Expr.pseudos["eq"];
2010
2011 // Add button/input type pseudos
2012 for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) {
2013 Expr.pseudos[ i ] = createInputPseudo( i );
2014 }
2015 for ( i in { submit: true, reset: true } ) {
2016 Expr.pseudos[ i ] = createButtonPseudo( i );
2017 }
2018
2019 // Easy API for creating new setFilters
2020 function setFilters() {}
2021 setFilters.prototype = Expr.filters = Expr.pseudos;
2022 Expr.setFilters = new setFilters();
2023
2024 tokenize = Sizzle.tokenize = function( selector, parseOnly ) {
2025 var matched, match, tokens, type,
2026 soFar, groups, preFilters,
2027 cached = tokenCache[ selector + " " ];
2028
2029 if ( cached ) {
2030 return parseOnly ? 0 : cached.slice( 0 );
2031 }
2032
2033 soFar = selector;
2034 groups = [];
2035 preFilters = Expr.preFilter;
2036
2037 while ( soFar ) {
2038
2039 // Comma and first run
2040 if ( !matched || (match = rcomma.exec( soFar )) ) {
2041 if ( match ) {
2042 // Don't consume trailing commas as valid
2043 soFar = soFar.slice( match[0].length ) || soFar;
2044 }
2045 groups.push( (tokens = []) );
2046 }
2047
2048 matched = false;
2049
2050 // Combinators
2051 if ( (match = rcombinators.exec( soFar )) ) {
2052 matched = match.shift();
2053 tokens.push({
2054 value: matched,
2055 // Cast descendant combinators to space
2056 type: match[0].replace( rtrim, " " )
2057 });
2058 soFar = soFar.slice( matched.length );
2059 }
2060
2061 // Filters
2062 for ( type in Expr.filter ) {
2063 if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
2064 (match = preFilters[ type ]( match ))) ) {
2065 matched = match.shift();
2066 tokens.push({
2067 value: matched,
2068 type: type,
2069 matches: match
2070 });
2071 soFar = soFar.slice( matched.length );
2072 }
2073 }
2074
2075 if ( !matched ) {
2076 break;
2077 }
2078 }
2079
2080 // Return the length of the invalid excess
2081 // if we're just parsing
2082 // Otherwise, throw an error or return tokens
2083 return parseOnly ?
2084 soFar.length :
2085 soFar ?
2086 Sizzle.error( selector ) :
2087 // Cache the tokens
2088 tokenCache( selector, groups ).slice( 0 );
2089 };
2090
2091 function toSelector( tokens ) {
2092 var i = 0,
2093 len = tokens.length,
2094 selector = "";
2095 for ( ; i < len; i++ ) {
2096 selector += tokens[i].value;
2097 }
2098 return selector;
2099 }
2100
2101 function addCombinator( matcher, combinator, base ) {
2102 var dir = combinator.dir,
2103 checkNonElements = base && dir === "parentNode",
2104 doneName = done++;
2105
2106 return combinator.first ?
2107 // Check against closest ancestor/preceding element
2108 function( elem, context, xml ) {
2109 while ( (elem = elem[ dir ]) ) {
2110 if ( elem.nodeType === 1 || checkNonElements ) {
2111 return matcher( elem, context, xml );
2112 }
2113 }
2114 } :
2115
2116 // Check against all ancestor/preceding elements
2117 function( elem, context, xml ) {
2118 var oldCache, outerCache,
2119 newCache = [ dirruns, doneName ];
2120
2121 // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
2122 if ( xml ) {
2123 while ( (elem = elem[ dir ]) ) {
2124 if ( elem.nodeType === 1 || checkNonElements ) {
2125 if ( matcher( elem, context, xml ) ) {
2126 return true;
2127 }
2128 }
2129 }
2130 } else {
2131 while ( (elem = elem[ dir ]) ) {
2132 if ( elem.nodeType === 1 || checkNonElements ) {
2133 outerCache = elem[ expando ] || (elem[ expando ] = {});
2134 if ( (oldCache = outerCache[ dir ]) &&
2135 oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) {
2136
2137 // Assign to newCache so results back-propagate to previous elements
2138 return (newCache[ 2 ] = oldCache[ 2 ]);
2139 } else {
2140 // Reuse newcache so results back-propagate to previous elements
2141 outerCache[ dir ] = newCache;
2142
2143 // A match means we're done; a fail means we have to keep checking
2144 if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) {
2145 return true;
2146 }
2147 }
2148 }
2149 }
2150 }
2151 };
2152 }
2153
2154 function elementMatcher( matchers ) {
2155 return matchers.length > 1 ?
2156 function( elem, context, xml ) {
2157 var i = matchers.length;
2158 while ( i-- ) {
2159 if ( !matchers[i]( elem, context, xml ) ) {
2160 return false;
2161 }
2162 }
2163 return true;
2164 } :
2165 matchers[0];
2166 }
2167
2168 function multipleContexts( selector, contexts, results ) {
2169 var i = 0,
2170 len = contexts.length;
2171 for ( ; i < len; i++ ) {
2172 Sizzle( selector, contexts[i], results );
2173 }
2174 return results;
2175 }
2176
2177 function condense( unmatched, map, filter, context, xml ) {
2178 var elem,
2179 newUnmatched = [],
2180 i = 0,
2181 len = unmatched.length,
2182 mapped = map != null;
2183
2184 for ( ; i < len; i++ ) {
2185 if ( (elem = unmatched[i]) ) {
2186 if ( !filter || filter( elem, context, xml ) ) {
2187 newUnmatched.push( elem );
2188 if ( mapped ) {
2189 map.push( i );
2190 }
2191 }
2192 }
2193 }
2194
2195 return newUnmatched;
2196 }
2197
2198 function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
2199 if ( postFilter && !postFilter[ expando ] ) {
2200 postFilter = setMatcher( postFilter );
2201 }
2202 if ( postFinder && !postFinder[ expando ] ) {
2203 postFinder = setMatcher( postFinder, postSelector );
2204 }
2205 return markFunction(function( seed, results, context, xml ) {
2206 var temp, i, elem,
2207 preMap = [],
2208 postMap = [],
2209 preexisting = results.length,
2210
2211 // Get initial elements from seed or context
2212 elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
2213
2214 // Prefilter to get matcher input, preserving a map for seed-results synchronization
2215 matcherIn = preFilter && ( seed || !selector ) ?
2216 condense( elems, preMap, preFilter, context, xml ) :
2217 elems,
2218
2219 matcherOut = matcher ?
2220 // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
2221 postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
2222
2223 // ...intermediate processing is necessary
2224 [] :
2225
2226 // ...otherwise use results directly
2227 results :
2228 matcherIn;
2229
2230 // Find primary matches
2231 if ( matcher ) {
2232 matcher( matcherIn, matcherOut, context, xml );
2233 }
2234
2235 // Apply postFilter
2236 if ( postFilter ) {
2237 temp = condense( matcherOut, postMap );
2238 postFilter( temp, [], context, xml );
2239
2240 // Un-match failing elements by moving them back to matcherIn
2241 i = temp.length;
2242 while ( i-- ) {
2243 if ( (elem = temp[i]) ) {
2244 matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
2245 }
2246 }
2247 }
2248
2249 if ( seed ) {
2250 if ( postFinder || preFilter ) {
2251 if ( postFinder ) {
2252 // Get the final matcherOut by condensing this intermediate into postFinder contexts
2253 temp = [];
2254 i = matcherOut.length;
2255 while ( i-- ) {
2256 if ( (elem = matcherOut[i]) ) {
2257 // Restore matcherIn since elem is not yet a final match
2258 temp.push( (matcherIn[i] = elem) );
2259 }
2260 }
2261 postFinder( null, (matcherOut = []), temp, xml );
2262 }
2263
2264 // Move matched elements from seed to results to keep them synchronized
2265 i = matcherOut.length;
2266 while ( i-- ) {
2267 if ( (elem = matcherOut[i]) &&
2268 (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
2269
2270 seed[temp] = !(results[temp] = elem);
2271 }
2272 }
2273 }
2274
2275 // Add elements to results, through postFinder if defined
2276 } else {
2277 matcherOut = condense(
2278 matcherOut === results ?
2279 matcherOut.splice( preexisting, matcherOut.length ) :
2280 matcherOut
2281 );
2282 if ( postFinder ) {
2283 postFinder( null, results, matcherOut, xml );
2284 } else {
2285 push.apply( results, matcherOut );
2286 }
2287 }
2288 });
2289 }
2290
2291 function matcherFromTokens( tokens ) {
2292 var checkContext, matcher, j,
2293 len = tokens.length,
2294 leadingRelative = Expr.relative[ tokens[0].type ],
2295 implicitRelative = leadingRelative || Expr.relative[" "],
2296 i = leadingRelative ? 1 : 0,
2297
2298 // The foundational matcher ensures that elements are reachable from top-level context(s)
2299 matchContext = addCombinator( function( elem ) {
2300 return elem === checkContext;
2301 }, implicitRelative, true ),
2302 matchAnyContext = addCombinator( function( elem ) {
2303 return indexOf.call( checkContext, elem ) > -1;
2304 }, implicitRelative, true ),
2305 matchers = [ function( elem, context, xml ) {
2306 return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
2307 (checkContext = context).nodeType ?
2308 matchContext( elem, context, xml ) :
2309 matchAnyContext( elem, context, xml ) );
2310 } ];
2311
2312 for ( ; i < len; i++ ) {
2313 if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
2314 matchers = [ addCombinator(elementMatcher( matchers ), matcher) ];
2315 } else {
2316 matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
2317
2318 // Return special upon seeing a positional matcher
2319 if ( matcher[ expando ] ) {
2320 // Find the next relative operator (if any) for proper handling
2321 j = ++i;
2322 for ( ; j < len; j++ ) {
2323 if ( Expr.relative[ tokens[j].type ] ) {
2324 break;
2325 }
2326 }
2327 return setMatcher(
2328 i > 1 && elementMatcher( matchers ),
2329 i > 1 && toSelector(
2330 // If the preceding token was a descendant combinator, insert an implicit any-element `*`
2331 tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" })
2332 ).replace( rtrim, "$1" ),
2333 matcher,
2334 i < j && matcherFromTokens( tokens.slice( i, j ) ),
2335 j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
2336 j < len && toSelector( tokens )
2337 );
2338 }
2339 matchers.push( matcher );
2340 }
2341 }
2342
2343 return elementMatcher( matchers );
2344 }
2345
2346 function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
2347 var bySet = setMatchers.length > 0,
2348 byElement = elementMatchers.length > 0,
2349 superMatcher = function( seed, context, xml, results, outermost ) {
2350 var elem, j, matcher,
2351 matchedCount = 0,
2352 i = "0",
2353 unmatched = seed && [],
2354 setMatched = [],
2355 contextBackup = outermostContext,
2356 // We must always have either seed elements or outermost context
2357 elems = seed || byElement && Expr.find["TAG"]( "*", outermost ),
2358 // Use integer dirruns iff this is the outermost matcher
2359 dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1),
2360 len = elems.length;
2361
2362 if ( outermost ) {
2363 outermostContext = context !== document && context;
2364 }
2365
2366 // Add elements passing elementMatchers directly to results
2367 // Keep `i` a string if there are no elements so `matchedCount` will be "00" below
2368 // Support: IE<9, Safari
2369 // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id
2370 for ( ; i !== len && (elem = elems[i]) != null; i++ ) {
2371 if ( byElement && elem ) {
2372 j = 0;
2373 while ( (matcher = elementMatchers[j++]) ) {
2374 if ( matcher( elem, context, xml ) ) {
2375 results.push( elem );
2376 break;
2377 }
2378 }
2379 if ( outermost ) {
2380 dirruns = dirrunsUnique;
2381 }
2382 }
2383
2384 // Track unmatched elements for set filters
2385 if ( bySet ) {
2386 // They will have gone through all possible matchers
2387 if ( (elem = !matcher && elem) ) {
2388 matchedCount--;
2389 }
2390
2391 // Lengthen the array for every element, matched or not
2392 if ( seed ) {
2393 unmatched.push( elem );
2394 }
2395 }
2396 }
2397
2398 // Apply set filters to unmatched elements
2399 matchedCount += i;
2400 if ( bySet && i !== matchedCount ) {
2401 j = 0;
2402 while ( (matcher = setMatchers[j++]) ) {
2403 matcher( unmatched, setMatched, context, xml );
2404 }
2405
2406 if ( seed ) {
2407 // Reintegrate element matches to eliminate the need for sorting
2408 if ( matchedCount > 0 ) {
2409 while ( i-- ) {
2410 if ( !(unmatched[i] || setMatched[i]) ) {
2411 setMatched[i] = pop.call( results );
2412 }
2413 }
2414 }
2415
2416 // Discard index placeholder values to get only actual matches
2417 setMatched = condense( setMatched );
2418 }
2419
2420 // Add matches to results
2421 push.apply( results, setMatched );
2422
2423 // Seedless set matches succeeding multiple successful matchers stipulate sorting
2424 if ( outermost && !seed && setMatched.length > 0 &&
2425 ( matchedCount + setMatchers.length ) > 1 ) {
2426
2427 Sizzle.uniqueSort( results );
2428 }
2429 }
2430
2431 // Override manipulation of globals by nested matchers
2432 if ( outermost ) {
2433 dirruns = dirrunsUnique;
2434 outermostContext = contextBackup;
2435 }
2436
2437 return unmatched;
2438 };
2439
2440 return bySet ?
2441 markFunction( superMatcher ) :
2442 superMatcher;
2443 }
2444
2445 compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) {
2446 var i,
2447 setMatchers = [],
2448 elementMatchers = [],
2449 cached = compilerCache[ selector + " " ];
2450
2451 if ( !cached ) {
2452 // Generate a function of recursive functions that can be used to check each element
2453 if ( !match ) {
2454 match = tokenize( selector );
2455 }
2456 i = match.length;
2457 while ( i-- ) {
2458 cached = matcherFromTokens( match[i] );
2459 if ( cached[ expando ] ) {
2460 setMatchers.push( cached );
2461 } else {
2462 elementMatchers.push( cached );
2463 }
2464 }
2465
2466 // Cache the compiled function
2467 cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
2468
2469 // Save selector and tokenization
2470 cached.selector = selector;
2471 }
2472 return cached;
2473 };
2474
2475 /**
2476 * A low-level selection function that works with Sizzle's compiled
2477 * selector functions
2478 * @param {String|Function} selector A selector or a pre-compiled
2479 * selector function built with Sizzle.compile
2480 * @param {Element} context
2481 * @param {Array} [results]
2482 * @param {Array} [seed] A set of elements to match against
2483 */
2484 select = Sizzle.select = function( selector, context, results, seed ) {
2485 var i, tokens, token, type, find,
2486 compiled = typeof selector === "function" && selector,
2487 match = !seed && tokenize( (selector = compiled.selector || selector) );
2488
2489 results = results || [];
2490
2491 // Try to minimize operations if there is no seed and only one group
2492 if ( match.length === 1 ) {
2493
2494 // Take a shortcut and set the context if the root selector is an ID
2495 tokens = match[0] = match[0].slice( 0 );
2496 if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
2497 support.getById && context.nodeType === 9 && documentIsHTML &&
2498 Expr.relative[ tokens[1].type ] ) {
2499
2500 context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0];
2501 if ( !context ) {
2502 return results;
2503
2504 // Precompiled matchers will still verify ancestry, so step up a level
2505 } else if ( compiled ) {
2506 context = context.parentNode;
2507 }
2508
2509 selector = selector.slice( tokens.shift().value.length );
2510 }
2511
2512 // Fetch a seed set for right-to-left matching
2513 i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length;
2514 while ( i-- ) {
2515 token = tokens[i];
2516
2517 // Abort if we hit a combinator
2518 if ( Expr.relative[ (type = token.type) ] ) {
2519 break;
2520 }
2521 if ( (find = Expr.find[ type ]) ) {
2522 // Search, expanding context for leading sibling combinators
2523 if ( (seed = find(
2524 token.matches[0].replace( runescape, funescape ),
2525 rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context
2526 )) ) {
2527
2528 // If seed is empty or no tokens remain, we can return early
2529 tokens.splice( i, 1 );
2530 selector = seed.length && toSelector( tokens );
2531 if ( !selector ) {
2532 push.apply( results, seed );
2533 return results;
2534 }
2535
2536 break;
2537 }
2538 }
2539 }
2540 }
2541
2542 // Compile and execute a filtering function if one is not provided
2543 // Provide `match` to avoid retokenization if we modified the selector above
2544 ( compiled || compile( selector, match ) )(
2545 seed,
2546 context,
2547 !documentIsHTML,
2548 results,
2549 rsibling.test( selector ) && testContext( context.parentNode ) || context
2550 );
2551 return results;
2552 };
2553
2554 // One-time assignments
2555
2556 // Sort stability
2557 support.sortStable = expando.split("").sort( sortOrder ).join("") === expando;
2558
2559 // Support: Chrome<14
2560 // Always assume duplicates if they aren't passed to the comparison function
2561 support.detectDuplicates = !!hasDuplicate;
2562
2563 // Initialize against the default document
2564 setDocument();
2565
2566 // Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27)
2567 // Detached nodes confoundingly follow *each other*
2568 support.sortDetached = assert(function( div1 ) {
2569 // Should return 1, but returns 4 (following)
2570 return div1.compareDocumentPosition( document.createElement("div") ) & 1;
2571 });
2572
2573 // Support: IE<8
2574 // Prevent attribute/property "interpolation"
2575 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
2576 if ( !assert(function( div ) {
2577 div.innerHTML = "<a href='#'></a>";
2578 return div.firstChild.getAttribute("href") === "#" ;
2579 }) ) {
2580 addHandle( "type|href|height|width", function( elem, name, isXML ) {
2581 if ( !isXML ) {
2582 return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 );
2583 }
2584 });
2585 }
2586
2587 // Support: IE<9
2588 // Use defaultValue in place of getAttribute("value")
2589 if ( !support.attributes || !assert(function( div ) {
2590 div.innerHTML = "<input/>";
2591 div.firstChild.setAttribute( "value", "" );
2592 return div.firstChild.getAttribute( "value" ) === "";
2593 }) ) {
2594 addHandle( "value", function( elem, name, isXML ) {
2595 if ( !isXML && elem.nodeName.toLowerCase() === "input" ) {
2596 return elem.defaultValue;
2597 }
2598 });
2599 }
2600
2601 // Support: IE<9
2602 // Use getAttributeNode to fetch booleans when getAttribute lies
2603 if ( !assert(function( div ) {
2604 return div.getAttribute("disabled") == null;
2605 }) ) {
2606 addHandle( booleans, function( elem, name, isXML ) {
2607 var val;
2608 if ( !isXML ) {
2609 return elem[ name ] === true ? name.toLowerCase() :
2610 (val = elem.getAttributeNode( name )) && val.specified ?
2611 val.value :
2612 null;
2613 }
2614 });
2615 }
2616
2617 return Sizzle;
2618
2619 })( window );
2620
2621
2622
2623 jQuery.find = Sizzle;
2624 jQuery.expr = Sizzle.selectors;
2625 jQuery.expr[":"] = jQuery.expr.pseudos;
2626 jQuery.unique = Sizzle.uniqueSort;
2627 jQuery.text = Sizzle.getText;
2628 jQuery.isXMLDoc = Sizzle.isXML;
2629 jQuery.contains = Sizzle.contains;
2630
2631
2632
2633 var rneedsContext = jQuery.expr.match.needsContext;
2634
2635 var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/);
2636
2637
2638
2639 var risSimple = /^.[^:#\[\.,]*$/;
2640
2641 // Implement the identical functionality for filter and not
2642 function winnow( elements, qualifier, not ) {
2643 if ( jQuery.isFunction( qualifier ) ) {
2644 return jQuery.grep( elements, function( elem, i ) {
2645 /* jshint -W018 */
2646 return !!qualifier.call( elem, i, elem ) !== not;
2647 });
2648
2649 }
2650
2651 if ( qualifier.nodeType ) {
2652 return jQuery.grep( elements, function( elem ) {
2653 return ( elem === qualifier ) !== not;
2654 });
2655
2656 }
2657
2658 if ( typeof qualifier === "string" ) {
2659 if ( risSimple.test( qualifier ) ) {
2660 return jQuery.filter( qualifier, elements, not );
2661 }
2662
2663 qualifier = jQuery.filter( qualifier, elements );
2664 }
2665
2666 return jQuery.grep( elements, function( elem ) {
2667 return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not;
2668 });
2669 }
2670
2671 jQuery.filter = function( expr, elems, not ) {
2672 var elem = elems[ 0 ];
2673
2674 if ( not ) {
2675 expr = ":not(" + expr + ")";
2676 }
2677
2678 return elems.length === 1 && elem.nodeType === 1 ?
2679 jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] :
2680 jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) {
2681 return elem.nodeType === 1;
2682 }));
2683 };
2684
2685 jQuery.fn.extend({
2686 find: function( selector ) {
2687 var i,
2688 ret = [],
2689 self = this,
2690 len = self.length;
2691
2692 if ( typeof selector !== "string" ) {
2693 return this.pushStack( jQuery( selector ).filter(function() {
2694 for ( i = 0; i < len; i++ ) {
2695 if ( jQuery.contains( self[ i ], this ) ) {
2696 return true;
2697 }
2698 }
2699 }) );
2700 }
2701
2702 for ( i = 0; i < len; i++ ) {
2703 jQuery.find( selector, self[ i ], ret );
2704 }
2705
2706 // Needed because $( selector, context ) becomes $( context ).find( selector )
2707 ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret );
2708 ret.selector = this.selector ? this.selector + " " + selector : selector;
2709 return ret;
2710 },
2711 filter: function( selector ) {
2712 return this.pushStack( winnow(this, selector || [], false) );
2713 },
2714 not: function( selector ) {
2715 return this.pushStack( winnow(this, selector || [], true) );
2716 },
2717 is: function( selector ) {
2718 return !!winnow(
2719 this,
2720
2721 // If this is a positional/relative selector, check membership in the returned set
2722 // so $("p:first").is("p:last") won't return true for a doc with two "p".
2723 typeof selector === "string" && rneedsContext.test( selector ) ?
2724 jQuery( selector ) :
2725 selector || [],
2726 false
2727 ).length;
2728 }
2729 });
2730
2731
2732 // Initialize a jQuery object
2733
2734
2735 // A central reference to the root jQuery(document)
2736 var rootjQuery,
2737
2738 // Use the correct document accordingly with window argument (sandbox)
2739 document = window.document,
2740
2741 // A simple way to check for HTML strings
2742 // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
2743 // Strict HTML recognition (#11290: must start with <)
2744 rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,
2745
2746 init = jQuery.fn.init = function( selector, context ) {
2747 var match, elem;
2748
2749 // HANDLE: $(""), $(null), $(undefined), $(false)
2750 if ( !selector ) {
2751 return this;
2752 }
2753
2754 // Handle HTML strings
2755 if ( typeof selector === "string" ) {
2756 if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
2757 // Assume that strings that start and end with <> are HTML and skip the regex check
2758 match = [ null, selector, null ];
2759
2760 } else {
2761 match = rquickExpr.exec( selector );
2762 }
2763
2764 // Match html or make sure no context is specified for #id
2765 if ( match && (match[1] || !context) ) {
2766
2767 // HANDLE: $(html) -> $(array)
2768 if ( match[1] ) {
2769 context = context instanceof jQuery ? context[0] : context;
2770
2771 // scripts is true for back-compat
2772 // Intentionally let the error be thrown if parseHTML is not present
2773 jQuery.merge( this, jQuery.parseHTML(
2774 match[1],
2775 context && context.nodeType ? context.ownerDocument || context : document,
2776 true
2777 ) );
2778
2779 // HANDLE: $(html, props)
2780 if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
2781 for ( match in context ) {
2782 // Properties of context are called as methods if possible
2783 if ( jQuery.isFunction( this[ match ] ) ) {
2784 this[ match ]( context[ match ] );
2785
2786 // ...and otherwise set as attributes
2787 } else {
2788 this.attr( match, context[ match ] );
2789 }
2790 }
2791 }
2792
2793 return this;
2794
2795 // HANDLE: $(#id)
2796 } else {
2797 elem = document.getElementById( match[2] );
2798
2799 // Check parentNode to catch when Blackberry 4.6 returns
2800 // nodes that are no longer in the document #6963
2801 if ( elem && elem.parentNode ) {
2802 // Handle the case where IE and Opera return items
2803 // by name instead of ID
2804 if ( elem.id !== match[2] ) {
2805 return rootjQuery.find( selector );
2806 }
2807
2808 // Otherwise, we inject the element directly into the jQuery object
2809 this.length = 1;
2810 this[0] = elem;
2811 }
2812
2813 this.context = document;
2814 this.selector = selector;
2815 return this;
2816 }
2817
2818 // HANDLE: $(expr, $(...))
2819 } else if ( !context || context.jquery ) {
2820 return ( context || rootjQuery ).find( selector );
2821
2822 // HANDLE: $(expr, context)
2823 // (which is just equivalent to: $(context).find(expr)
2824 } else {
2825 return this.constructor( context ).find( selector );
2826 }
2827
2828 // HANDLE: $(DOMElement)
2829 } else if ( selector.nodeType ) {
2830 this.context = this[0] = selector;
2831 this.length = 1;
2832 return this;
2833
2834 // HANDLE: $(function)
2835 // Shortcut for document ready
2836 } else if ( jQuery.isFunction( selector ) ) {
2837 return typeof rootjQuery.ready !== "undefined" ?
2838 rootjQuery.ready( selector ) :
2839 // Execute immediately if ready is not present
2840 selector( jQuery );
2841 }
2842
2843 if ( selector.selector !== undefined ) {
2844 this.selector = selector.selector;
2845 this.context = selector.context;
2846 }
2847
2848 return jQuery.makeArray( selector, this );
2849 };
2850
2851 // Give the init function the jQuery prototype for later instantiation
2852 init.prototype = jQuery.fn;
2853
2854 // Initialize central reference
2855 rootjQuery = jQuery( document );
2856
2857
2858 var rparentsprev = /^(?:parents|prev(?:Until|All))/,
2859 // methods guaranteed to produce a unique set when starting from a unique set
2860 guaranteedUnique = {
2861 children: true,
2862 contents: true,
2863 next: true,
2864 prev: true
2865 };
2866
2867 jQuery.extend({
2868 dir: function( elem, dir, until ) {
2869 var matched = [],
2870 cur = elem[ dir ];
2871
2872 while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
2873 if ( cur.nodeType === 1 ) {
2874 matched.push( cur );
2875 }
2876 cur = cur[dir];
2877 }
2878 return matched;
2879 },
2880
2881 sibling: function( n, elem ) {
2882 var r = [];
2883
2884 for ( ; n; n = n.nextSibling ) {
2885 if ( n.nodeType === 1 && n !== elem ) {
2886 r.push( n );
2887 }
2888 }
2889
2890 return r;
2891 }
2892 });
2893
2894 jQuery.fn.extend({
2895 has: function( target ) {
2896 var i,
2897 targets = jQuery( target, this ),
2898 len = targets.length;
2899
2900 return this.filter(function() {
2901 for ( i = 0; i < len; i++ ) {
2902 if ( jQuery.contains( this, targets[i] ) ) {
2903 return true;
2904 }
2905 }
2906 });
2907 },
2908
2909 closest: function( selectors, context ) {
2910 var cur,
2911 i = 0,
2912 l = this.length,
2913 matched = [],
2914 pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
2915 jQuery( selectors, context || this.context ) :
2916 0;
2917
2918 for ( ; i < l; i++ ) {
2919 for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) {
2920 // Always skip document fragments
2921 if ( cur.nodeType < 11 && (pos ?
2922 pos.index(cur) > -1 :
2923
2924 // Don't pass non-elements to Sizzle
2925 cur.nodeType === 1 &&
2926 jQuery.find.matchesSelector(cur, selectors)) ) {
2927
2928 matched.push( cur );
2929 break;
2930 }
2931 }
2932 }
2933
2934 return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched );
2935 },
2936
2937 // Determine the position of an element within
2938 // the matched set of elements
2939 index: function( elem ) {
2940
2941 // No argument, return index in parent
2942 if ( !elem ) {
2943 return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1;
2944 }
2945
2946 // index in selector
2947 if ( typeof elem === "string" ) {
2948 return jQuery.inArray( this[0], jQuery( elem ) );
2949 }
2950
2951 // Locate the position of the desired element
2952 return jQuery.inArray(
2953 // If it receives a jQuery object, the first element is used
2954 elem.jquery ? elem[0] : elem, this );
2955 },
2956
2957 add: function( selector, context ) {
2958 return this.pushStack(
2959 jQuery.unique(
2960 jQuery.merge( this.get(), jQuery( selector, context ) )
2961 )
2962 );
2963 },
2964
2965 addBack: function( selector ) {
2966 return this.add( selector == null ?
2967 this.prevObject : this.prevObject.filter(selector)
2968 );
2969 }
2970 });
2971
2972 function sibling( cur, dir ) {
2973 do {
2974 cur = cur[ dir ];
2975 } while ( cur && cur.nodeType !== 1 );
2976
2977 return cur;
2978 }
2979
2980 jQuery.each({
2981 parent: function( elem ) {
2982 var parent = elem.parentNode;
2983 return parent && parent.nodeType !== 11 ? parent : null;
2984 },
2985 parents: function( elem ) {
2986 return jQuery.dir( elem, "parentNode" );
2987 },
2988 parentsUntil: function( elem, i, until ) {
2989 return jQuery.dir( elem, "parentNode", until );
2990 },
2991 next: function( elem ) {
2992 return sibling( elem, "nextSibling" );
2993 },
2994 prev: function( elem ) {
2995 return sibling( elem, "previousSibling" );
2996 },
2997 nextAll: function( elem ) {
2998 return jQuery.dir( elem, "nextSibling" );
2999 },
3000 prevAll: function( elem ) {
3001 return jQuery.dir( elem, "previousSibling" );
3002 },
3003 nextUntil: function( elem, i, until ) {
3004 return jQuery.dir( elem, "nextSibling", until );
3005 },
3006 prevUntil: function( elem, i, until ) {
3007 return jQuery.dir( elem, "previousSibling", until );
3008 },
3009 siblings: function( elem ) {
3010 return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
3011 },
3012 children: function( elem ) {
3013 return jQuery.sibling( elem.firstChild );
3014 },
3015 contents: function( elem ) {
3016 return jQuery.nodeName( elem, "iframe" ) ?
3017 elem.contentDocument || elem.contentWindow.document :
3018 jQuery.merge( [], elem.childNodes );
3019 }
3020 }, function( name, fn ) {
3021 jQuery.fn[ name ] = function( until, selector ) {
3022 var ret = jQuery.map( this, fn, until );
3023
3024 if ( name.slice( -5 ) !== "Until" ) {
3025 selector = until;
3026 }
3027
3028 if ( selector && typeof selector === "string" ) {
3029 ret = jQuery.filter( selector, ret );
3030 }
3031
3032 if ( this.length > 1 ) {
3033 // Remove duplicates
3034 if ( !guaranteedUnique[ name ] ) {
3035 ret = jQuery.unique( ret );
3036 }
3037
3038 // Reverse order for parents* and prev-derivatives
3039 if ( rparentsprev.test( name ) ) {
3040 ret = ret.reverse();
3041 }
3042 }
3043
3044 return this.pushStack( ret );
3045 };
3046 });
3047 var rnotwhite = (/\S+/g);
3048
3049
3050
3051 // String to Object options format cache
3052 var optionsCache = {};
3053
3054 // Convert String-formatted options into Object-formatted ones and store in cache
3055 function createOptions( options ) {
3056 var object = optionsCache[ options ] = {};
3057 jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) {
3058 object[ flag ] = true;
3059 });
3060 return object;
3061 }
3062
3063 /*
3064 * Create a callback list using the following parameters:
3065 *
3066 * options: an optional list of space-separated options that will change how
3067 * the callback list behaves or a more traditional option object
3068 *
3069 * By default a callback list will act like an event callback list and can be
3070 * "fired" multiple times.
3071 *
3072 * Possible options:
3073 *
3074 * once: will ensure the callback list can only be fired once (like a Deferred)
3075 *
3076 * memory: will keep track of previous values and will call any callback added
3077 * after the list has been fired right away with the latest "memorized"
3078 * values (like a Deferred)
3079 *
3080 * unique: will ensure a callback can only be added once (no duplicate in the list)
3081 *
3082 * stopOnFalse: interrupt callings when a callback returns false
3083 *
3084 */
3085 jQuery.Callbacks = function( options ) {
3086
3087 // Convert options from String-formatted to Object-formatted if needed
3088 // (we check in cache first)
3089 options = typeof options === "string" ?
3090 ( optionsCache[ options ] || createOptions( options ) ) :
3091 jQuery.extend( {}, options );
3092
3093 var // Flag to know if list is currently firing
3094 firing,
3095 // Last fire value (for non-forgettable lists)
3096 memory,
3097 // Flag to know if list was already fired
3098 fired,
3099 // End of the loop when firing
3100 firingLength,
3101 // Index of currently firing callback (modified by remove if needed)
3102 firingIndex,
3103 // First callback to fire (used internally by add and fireWith)
3104 firingStart,
3105 // Actual callback list
3106 list = [],
3107 // Stack of fire calls for repeatable lists
3108 stack = !options.once && [],
3109 // Fire callbacks
3110 fire = function( data ) {
3111 memory = options.memory && data;
3112 fired = true;
3113 firingIndex = firingStart || 0;
3114 firingStart = 0;
3115 firingLength = list.length;
3116 firing = true;
3117 for ( ; list && firingIndex < firingLength; firingIndex++ ) {
3118 if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
3119 memory = false; // To prevent further calls using add
3120 break;
3121 }
3122 }
3123 firing = false;
3124 if ( list ) {
3125 if ( stack ) {
3126 if ( stack.length ) {
3127 fire( stack.shift() );
3128 }
3129 } else if ( memory ) {
3130 list = [];
3131 } else {
3132 self.disable();
3133 }
3134 }
3135 },
3136 // Actual Callbacks object
3137 self = {
3138 // Add a callback or a collection of callbacks to the list
3139 add: function() {
3140 if ( list ) {
3141 // First, we save the current length
3142 var start = list.length;
3143 (function add( args ) {
3144 jQuery.each( args, function( _, arg ) {
3145 var type = jQuery.type( arg );
3146 if ( type === "function" ) {
3147 if ( !options.unique || !self.has( arg ) ) {
3148 list.push( arg );
3149 }
3150 } else if ( arg && arg.length && type !== "string" ) {
3151 // Inspect recursively
3152 add( arg );
3153 }
3154 });
3155 })( arguments );
3156 // Do we need to add the callbacks to the
3157 // current firing batch?
3158 if ( firing ) {
3159 firingLength = list.length;
3160 // With memory, if we're not firing then
3161 // we should call right away
3162 } else if ( memory ) {
3163 firingStart = start;
3164 fire( memory );
3165 }
3166 }
3167 return this;
3168 },
3169 // Remove a callback from the list
3170 remove: function() {
3171 if ( list ) {
3172 jQuery.each( arguments, function( _, arg ) {
3173 var index;
3174 while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
3175 list.splice( index, 1 );
3176 // Handle firing indexes
3177 if ( firing ) {
3178 if ( index <= firingLength ) {
3179 firingLength--;
3180 }
3181 if ( index <= firingIndex ) {
3182 firingIndex--;
3183 }
3184 }
3185 }
3186 });
3187 }
3188 return this;
3189 },
3190 // Check if a given callback is in the list.
3191 // If no argument is given, return whether or not list has callbacks attached.
3192 has: function( fn ) {
3193 return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length );
3194 },
3195 // Remove all callbacks from the list
3196 empty: function() {
3197 list = [];
3198 firingLength = 0;
3199 return this;
3200 },
3201 // Have the list do nothing anymore
3202 disable: function() {
3203 list = stack = memory = undefined;
3204 return this;
3205 },
3206 // Is it disabled?
3207 disabled: function() {
3208 return !list;
3209 },
3210 // Lock the list in its current state
3211 lock: function() {
3212 stack = undefined;
3213 if ( !memory ) {
3214 self.disable();
3215 }
3216 return this;
3217 },
3218 // Is it locked?
3219 locked: function() {
3220 return !stack;
3221 },
3222 // Call all callbacks with the given context and arguments
3223 fireWith: function( context, args ) {
3224 if ( list && ( !fired || stack ) ) {
3225 args = args || [];
3226 args = [ context, args.slice ? args.slice() : args ];
3227 if ( firing ) {
3228 stack.push( args );
3229 } else {
3230 fire( args );
3231 }
3232 }
3233 return this;
3234 },
3235 // Call all the callbacks with the given arguments
3236 fire: function() {
3237 self.fireWith( this, arguments );
3238 return this;
3239 },
3240 // To know if the callbacks have already been called at least once
3241 fired: function() {
3242 return !!fired;
3243 }
3244 };
3245
3246 return self;
3247 };
3248
3249
3250 jQuery.extend({
3251
3252 Deferred: function( func ) {
3253 var tuples = [
3254 // action, add listener, listener list, final state
3255 [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
3256 [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
3257 [ "notify", "progress", jQuery.Callbacks("memory") ]
3258 ],
3259 state = "pending",
3260 promise = {
3261 state: function() {
3262 return state;
3263 },
3264 always: function() {
3265 deferred.done( arguments ).fail( arguments );
3266 return this;
3267 },
3268 then: function( /* fnDone, fnFail, fnProgress */ ) {
3269 var fns = arguments;
3270 return jQuery.Deferred(function( newDefer ) {
3271 jQuery.each( tuples, function( i, tuple ) {
3272 var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];
3273 // deferred[ done | fail | progress ] for forwarding actions to newDefer
3274 deferred[ tuple[1] ](function() {
3275 var returned = fn && fn.apply( this, arguments );
3276 if ( returned && jQuery.isFunction( returned.promise ) ) {
3277 returned.promise()
3278 .done( newDefer.resolve )
3279 .fail( newDefer.reject )
3280 .progress( newDefer.notify );
3281 } else {
3282 newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );
3283 }
3284 });
3285 });
3286 fns = null;
3287 }).promise();
3288 },
3289 // Get a promise for this deferred
3290 // If obj is provided, the promise aspect is added to the object
3291 promise: function( obj ) {
3292 return obj != null ? jQuery.extend( obj, promise ) : promise;
3293 }
3294 },
3295 deferred = {};
3296
3297 // Keep pipe for back-compat
3298 promise.pipe = promise.then;
3299
3300 // Add list-specific methods
3301 jQuery.each( tuples, function( i, tuple ) {
3302 var list = tuple[ 2 ],
3303 stateString = tuple[ 3 ];
3304
3305 // promise[ done | fail | progress ] = list.add
3306 promise[ tuple[1] ] = list.add;
3307
3308 // Handle state
3309 if ( stateString ) {
3310 list.add(function() {
3311 // state = [ resolved | rejected ]
3312 state = stateString;
3313
3314 // [ reject_list | resolve_list ].disable; progress_list.lock
3315 }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
3316 }
3317
3318 // deferred[ resolve | reject | notify ]
3319 deferred[ tuple[0] ] = function() {
3320 deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments );
3321 return this;
3322 };
3323 deferred[ tuple[0] + "With" ] = list.fireWith;
3324 });
3325
3326 // Make the deferred a promise
3327 promise.promise( deferred );
3328
3329 // Call given func if any
3330 if ( func ) {
3331 func.call( deferred, deferred );
3332 }
3333
3334 // All done!
3335 return deferred;
3336 },
3337
3338 // Deferred helper
3339 when: function( subordinate /* , ..., subordinateN */ ) {
3340 var i = 0,
3341 resolveValues = slice.call( arguments ),
3342 length = resolveValues.length,
3343
3344 // the count of uncompleted subordinates
3345 remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
3346
3347 // the master Deferred. If resolveValues consist of only a single Deferred, just use that.
3348 deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
3349
3350 // Update function for both resolve and progress values
3351 updateFunc = function( i, contexts, values ) {
3352 return function( value ) {
3353 contexts[ i ] = this;
3354 values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;
3355 if ( values === progressValues ) {
3356 deferred.notifyWith( contexts, values );
3357
3358 } else if ( !(--remaining) ) {
3359 deferred.resolveWith( contexts, values );
3360 }
3361 };
3362 },
3363
3364 progressValues, progressContexts, resolveContexts;
3365
3366 // add listeners to Deferred subordinates; treat others as resolved
3367 if ( length > 1 ) {
3368 progressValues = new Array( length );
3369 progressContexts = new Array( length );
3370 resolveContexts = new Array( length );
3371 for ( ; i < length; i++ ) {
3372 if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
3373 resolveValues[ i ].promise()
3374 .done( updateFunc( i, resolveContexts, resolveValues ) )
3375 .fail( deferred.reject )
3376 .progress( updateFunc( i, progressContexts, progressValues ) );
3377 } else {
3378 --remaining;
3379 }
3380 }
3381 }
3382
3383 // if we're not waiting on anything, resolve the master
3384 if ( !remaining ) {
3385 deferred.resolveWith( resolveContexts, resolveValues );
3386 }
3387
3388 return deferred.promise();
3389 }
3390 });
3391
3392
3393 // The deferred used on DOM ready
3394 var readyList;
3395
3396 jQuery.fn.ready = function( fn ) {
3397 // Add the callback
3398 jQuery.ready.promise().done( fn );
3399
3400 return this;
3401 };
3402
3403 jQuery.extend({
3404 // Is the DOM ready to be used? Set to true once it occurs.
3405 isReady: false,
3406
3407 // A counter to track how many items to wait for before
3408 // the ready event fires. See #6781
3409 readyWait: 1,
3410
3411 // Hold (or release) the ready event
3412 holdReady: function( hold ) {
3413 if ( hold ) {
3414 jQuery.readyWait++;
3415 } else {
3416 jQuery.ready( true );
3417 }
3418 },
3419
3420 // Handle when the DOM is ready
3421 ready: function( wait ) {
3422
3423 // Abort if there are pending holds or we're already ready
3424 if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
3425 return;
3426 }
3427
3428 // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
3429 if ( !document.body ) {
3430 return setTimeout( jQuery.ready );
3431 }
3432
3433 // Remember that the DOM is ready
3434 jQuery.isReady = true;
3435
3436 // If a normal DOM Ready event fired, decrement, and wait if need be
3437 if ( wait !== true && --jQuery.readyWait > 0 ) {
3438 return;
3439 }
3440
3441 // If there are functions bound, to execute
3442 readyList.resolveWith( document, [ jQuery ] );
3443
3444 // Trigger any bound ready events
3445 if ( jQuery.fn.triggerHandler ) {
3446 jQuery( document ).triggerHandler( "ready" );
3447 jQuery( document ).off( "ready" );
3448 }
3449 }
3450 });
3451
3452 /**
3453 * Clean-up method for dom ready events
3454 */
3455 function detach() {
3456 if ( document.addEventListener ) {
3457 document.removeEventListener( "DOMContentLoaded", completed, false );
3458 window.removeEventListener( "load", completed, false );
3459
3460 } else {
3461 document.detachEvent( "onreadystatechange", completed );
3462 window.detachEvent( "onload", completed );
3463 }
3464 }
3465
3466 /**
3467 * The ready event handler and self cleanup method
3468 */
3469 function completed() {
3470 // readyState === "complete" is good enough for us to call the dom ready in oldIE
3471 if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) {
3472 detach();
3473 jQuery.ready();
3474 }
3475 }
3476
3477 jQuery.ready.promise = function( obj ) {
3478 if ( !readyList ) {
3479
3480 readyList = jQuery.Deferred();
3481
3482 // Catch cases where $(document).ready() is called after the browser event has already occurred.
3483 // we once tried to use readyState "interactive" here, but it caused issues like the one
3484 // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
3485 if ( document.readyState === "complete" ) {
3486 // Handle it asynchronously to allow scripts the opportunity to delay ready
3487 setTimeout( jQuery.ready );
3488
3489 // Standards-based browsers support DOMContentLoaded
3490 } else if ( document.addEventListener ) {
3491 // Use the handy event callback
3492 document.addEventListener( "DOMContentLoaded", completed, false );
3493
3494 // A fallback to window.onload, that will always work
3495 window.addEventListener( "load", completed, false );
3496
3497 // If IE event model is used
3498 } else {
3499 // Ensure firing before onload, maybe late but safe also for iframes
3500 document.attachEvent( "onreadystatechange", completed );
3501
3502 // A fallback to window.onload, that will always work
3503 window.attachEvent( "onload", completed );
3504
3505 // If IE and not a frame
3506 // continually check to see if the document is ready
3507 var top = false;
3508
3509 try {
3510 top = window.frameElement == null && document.documentElement;
3511 } catch(e) {}
3512
3513 if ( top && top.doScroll ) {
3514 (function doScrollCheck() {
3515 if ( !jQuery.isReady ) {
3516
3517 try {
3518 // Use the trick by Diego Perini
3519 // http://javascript.nwbox.com/IEContentLoaded/
3520 top.doScroll("left");
3521 } catch(e) {
3522 return setTimeout( doScrollCheck, 50 );
3523 }
3524
3525 // detach all dom ready events
3526 detach();
3527
3528 // and execute any waiting functions
3529 jQuery.ready();
3530 }
3531 })();
3532 }
3533 }
3534 }
3535 return readyList.promise( obj );
3536 };
3537
3538
3539 var strundefined = typeof undefined;
3540
3541
3542
3543 // Support: IE<9
3544 // Iteration over object's inherited properties before its own
3545 var i;
3546 for ( i in jQuery( support ) ) {
3547 break;
3548 }
3549 support.ownLast = i !== "0";
3550
3551 // Note: most support tests are defined in their respective modules.
3552 // false until the test is run
3553 support.inlineBlockNeedsLayout = false;
3554
3555 // Execute ASAP in case we need to set body.style.zoom
3556 jQuery(function() {
3557 // Minified: var a,b,c,d
3558 var val, div, body, container;
3559
3560 body = document.getElementsByTagName( "body" )[ 0 ];
3561 if ( !body || !body.style ) {
3562 // Return for frameset docs that don't have a body
3563 return;
3564 }
3565
3566 // Setup
3567 div = document.createElement( "div" );
3568 container = document.createElement( "div" );
3569 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
3570 body.appendChild( container ).appendChild( div );
3571
3572 if ( typeof div.style.zoom !== strundefined ) {
3573 // Support: IE<8
3574 // Check if natively block-level elements act like inline-block
3575 // elements when setting their display to 'inline' and giving
3576 // them layout
3577 div.style.cssText = "display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1";
3578
3579 support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;
3580 if ( val ) {
3581 // Prevent IE 6 from affecting layout for positioned elements #11048
3582 // Prevent IE from shrinking the body in IE 7 mode #12869
3583 // Support: IE<8
3584 body.style.zoom = 1;
3585 }
3586 }
3587
3588 body.removeChild( container );
3589 });
3590
3591
3592
3593
3594 (function() {
3595 var div = document.createElement( "div" );
3596
3597 // Execute the test only if not already executed in another module.
3598 if (support.deleteExpando == null) {
3599 // Support: IE<9
3600 support.deleteExpando = true;
3601 try {
3602 delete div.test;
3603 } catch( e ) {
3604 support.deleteExpando = false;
3605 }
3606 }
3607
3608 // Null elements to avoid leaks in IE.
3609 div = null;
3610 })();
3611
3612
3613 /**
3614 * Determines whether an object can have data
3615 */
3616 jQuery.acceptData = function( elem ) {
3617 var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ],
3618 nodeType = +elem.nodeType || 1;
3619
3620 // Do not set data on non-element DOM nodes because it will not be cleared (#8335).
3621 return nodeType !== 1 && nodeType !== 9 ?
3622 false :
3623
3624 // Nodes accept data unless otherwise specified; rejection can be conditional
3625 !noData || noData !== true && elem.getAttribute("classid") === noData;
3626 };
3627
3628
3629 var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,
3630 rmultiDash = /([A-Z])/g;
3631
3632 function dataAttr( elem, key, data ) {
3633 // If nothing was found internally, try to fetch any
3634 // data from the HTML5 data-* attribute
3635 if ( data === undefined && elem.nodeType === 1 ) {
3636
3637 var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
3638
3639 data = elem.getAttribute( name );
3640
3641 if ( typeof data === "string" ) {
3642 try {
3643 data = data === "true" ? true :
3644 data === "false" ? false :
3645 data === "null" ? null :
3646 // Only convert to a number if it doesn't change the string
3647 +data + "" === data ? +data :
3648 rbrace.test( data ) ? jQuery.parseJSON( data ) :
3649 data;
3650 } catch( e ) {}
3651
3652 // Make sure we set the data so it isn't changed later
3653 jQuery.data( elem, key, data );
3654
3655 } else {
3656 data = undefined;
3657 }
3658 }
3659
3660 return data;
3661 }
3662
3663 // checks a cache object for emptiness
3664 function isEmptyDataObject( obj ) {
3665 var name;
3666 for ( name in obj ) {
3667
3668 // if the public data object is empty, the private is still empty
3669 if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
3670 continue;
3671 }
3672 if ( name !== "toJSON" ) {
3673 return false;
3674 }
3675 }
3676
3677 return true;
3678 }
3679
3680 function internalData( elem, name, data, pvt /* Internal Use Only */ ) {
3681 if ( !jQuery.acceptData( elem ) ) {
3682 return;
3683 }
3684
3685 var ret, thisCache,
3686 internalKey = jQuery.expando,
3687
3688 // We have to handle DOM nodes and JS objects differently because IE6-7
3689 // can't GC object references properly across the DOM-JS boundary
3690 isNode = elem.nodeType,
3691
3692 // Only DOM nodes need the global jQuery cache; JS object data is
3693 // attached directly to the object so GC can occur automatically
3694 cache = isNode ? jQuery.cache : elem,
3695
3696 // Only defining an ID for JS objects if its cache already exists allows
3697 // the code to shortcut on the same path as a DOM node with no cache
3698 id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
3699
3700 // Avoid doing any more work than we need to when trying to get data on an
3701 // object that has no data at all
3702 if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) {
3703 return;
3704 }
3705
3706 if ( !id ) {
3707 // Only DOM nodes need a new unique ID for each element since their data
3708 // ends up in the global cache
3709 if ( isNode ) {
3710 id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++;
3711 } else {
3712 id = internalKey;
3713 }
3714 }
3715
3716 if ( !cache[ id ] ) {
3717 // Avoid exposing jQuery metadata on plain JS objects when the object
3718 // is serialized using JSON.stringify
3719 cache[ id ] = isNode ? {} : { toJSON: jQuery.noop };
3720 }
3721
3722 // An object can be passed to jQuery.data instead of a key/value pair; this gets
3723 // shallow copied over onto the existing cache
3724 if ( typeof name === "object" || typeof name === "function" ) {
3725 if ( pvt ) {
3726 cache[ id ] = jQuery.extend( cache[ id ], name );
3727 } else {
3728 cache[ id ].data = jQuery.extend( cache[ id ].data, name );
3729 }
3730 }
3731
3732 thisCache = cache[ id ];
3733
3734 // jQuery data() is stored in a separate object inside the object's internal data
3735 // cache in order to avoid key collisions between internal data and user-defined
3736 // data.
3737 if ( !pvt ) {
3738 if ( !thisCache.data ) {
3739 thisCache.data = {};
3740 }
3741
3742 thisCache = thisCache.data;
3743 }
3744
3745 if ( data !== undefined ) {
3746 thisCache[ jQuery.camelCase( name ) ] = data;
3747 }
3748
3749 // Check for both converted-to-camel and non-converted data property names
3750 // If a data property was specified
3751 if ( typeof name === "string" ) {
3752
3753 // First Try to find as-is property data
3754 ret = thisCache[ name ];
3755
3756 // Test for null|undefined property data
3757 if ( ret == null ) {
3758
3759 // Try to find the camelCased property
3760 ret = thisCache[ jQuery.camelCase( name ) ];
3761 }
3762 } else {
3763 ret = thisCache;
3764 }
3765
3766 return ret;
3767 }
3768
3769 function internalRemoveData( elem, name, pvt ) {
3770 if ( !jQuery.acceptData( elem ) ) {
3771 return;
3772 }
3773
3774 var thisCache, i,
3775 isNode = elem.nodeType,
3776
3777 // See jQuery.data for more information
3778 cache = isNode ? jQuery.cache : elem,
3779 id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
3780
3781 // If there is already no cache entry for this object, there is no
3782 // purpose in continuing
3783 if ( !cache[ id ] ) {
3784 return;
3785 }
3786
3787 if ( name ) {
3788
3789 thisCache = pvt ? cache[ id ] : cache[ id ].data;
3790
3791 if ( thisCache ) {
3792
3793 // Support array or space separated string names for data keys
3794 if ( !jQuery.isArray( name ) ) {
3795
3796 // try the string as a key before any manipulation
3797 if ( name in thisCache ) {
3798 name = [ name ];
3799 } else {
3800
3801 // split the camel cased version by spaces unless a key with the spaces exists
3802 name = jQuery.camelCase( name );
3803 if ( name in thisCache ) {
3804 name = [ name ];
3805 } else {
3806 name = name.split(" ");
3807 }
3808 }
3809 } else {
3810 // If "name" is an array of keys...
3811 // When data is initially created, via ("key", "val") signature,
3812 // keys will be converted to camelCase.
3813 // Since there is no way to tell _how_ a key was added, remove
3814 // both plain key and camelCase key. #12786
3815 // This will only penalize the array argument path.
3816 name = name.concat( jQuery.map( name, jQuery.camelCase ) );
3817 }
3818
3819 i = name.length;
3820 while ( i-- ) {
3821 delete thisCache[ name[i] ];
3822 }
3823
3824 // If there is no data left in the cache, we want to continue
3825 // and let the cache object itself get destroyed
3826 if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) {
3827 return;
3828 }
3829 }
3830 }
3831
3832 // See jQuery.data for more information
3833 if ( !pvt ) {
3834 delete cache[ id ].data;
3835
3836 // Don't destroy the parent cache unless the internal data object
3837 // had been the only thing left in it
3838 if ( !isEmptyDataObject( cache[ id ] ) ) {
3839 return;
3840 }
3841 }
3842
3843 // Destroy the cache
3844 if ( isNode ) {
3845 jQuery.cleanData( [ elem ], true );
3846
3847 // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
3848 /* jshint eqeqeq: false */
3849 } else if ( support.deleteExpando || cache != cache.window ) {
3850 /* jshint eqeqeq: true */
3851 delete cache[ id ];
3852
3853 // When all else fails, null
3854 } else {
3855 cache[ id ] = null;
3856 }
3857 }
3858
3859 jQuery.extend({
3860 cache: {},
3861
3862 // The following elements (space-suffixed to avoid Object.prototype collisions)
3863 // throw uncatchable exceptions if you attempt to set expando properties
3864 noData: {
3865 "applet ": true,
3866 "embed ": true,
3867 // ...but Flash objects (which have this classid) *can* handle expandos
3868 "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
3869 },
3870
3871 hasData: function( elem ) {
3872 elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
3873 return !!elem && !isEmptyDataObject( elem );
3874 },
3875
3876 data: function( elem, name, data ) {
3877 return internalData( elem, name, data );
3878 },
3879
3880 removeData: function( elem, name ) {
3881 return internalRemoveData( elem, name );
3882 },
3883
3884 // For internal use only.
3885 _data: function( elem, name, data ) {
3886 return internalData( elem, name, data, true );
3887 },
3888
3889 _removeData: function( elem, name ) {
3890 return internalRemoveData( elem, name, true );
3891 }
3892 });
3893
3894 jQuery.fn.extend({
3895 data: function( key, value ) {
3896 var i, name, data,
3897 elem = this[0],
3898 attrs = elem && elem.attributes;
3899
3900 // Special expections of .data basically thwart jQuery.access,
3901 // so implement the relevant behavior ourselves
3902
3903 // Gets all values
3904 if ( key === undefined ) {
3905 if ( this.length ) {
3906 data = jQuery.data( elem );
3907
3908 if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
3909 i = attrs.length;
3910 while ( i-- ) {
3911
3912 // Support: IE11+
3913 // The attrs elements can be null (#14894)
3914 if ( attrs[ i ] ) {
3915 name = attrs[ i ].name;
3916 if ( name.indexOf( "data-" ) === 0 ) {
3917 name = jQuery.camelCase( name.slice(5) );
3918 dataAttr( elem, name, data[ name ] );
3919 }
3920 }
3921 }
3922 jQuery._data( elem, "parsedAttrs", true );
3923 }
3924 }
3925
3926 return data;
3927 }
3928
3929 // Sets multiple values
3930 if ( typeof key === "object" ) {
3931 return this.each(function() {
3932 jQuery.data( this, key );
3933 });
3934 }
3935
3936 return arguments.length > 1 ?
3937
3938 // Sets one value
3939 this.each(function() {
3940 jQuery.data( this, key, value );
3941 }) :
3942
3943 // Gets one value
3944 // Try to fetch any internally stored data first
3945 elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined;
3946 },
3947
3948 removeData: function( key ) {
3949 return this.each(function() {
3950 jQuery.removeData( this, key );
3951 });
3952 }
3953 });
3954
3955
3956 jQuery.extend({
3957 queue: function( elem, type, data ) {
3958 var queue;
3959
3960 if ( elem ) {
3961 type = ( type || "fx" ) + "queue";
3962 queue = jQuery._data( elem, type );
3963
3964 // Speed up dequeue by getting out quickly if this is just a lookup
3965 if ( data ) {
3966 if ( !queue || jQuery.isArray(data) ) {
3967 queue = jQuery._data( elem, type, jQuery.makeArray(data) );
3968 } else {
3969 queue.push( data );
3970 }
3971 }
3972 return queue || [];
3973 }
3974 },
3975
3976 dequeue: function( elem, type ) {
3977 type = type || "fx";
3978
3979 var queue = jQuery.queue( elem, type ),
3980 startLength = queue.length,
3981 fn = queue.shift(),
3982 hooks = jQuery._queueHooks( elem, type ),
3983 next = function() {
3984 jQuery.dequeue( elem, type );
3985 };
3986
3987 // If the fx queue is dequeued, always remove the progress sentinel
3988 if ( fn === "inprogress" ) {
3989 fn = queue.shift();
3990 startLength--;
3991 }
3992
3993 if ( fn ) {
3994
3995 // Add a progress sentinel to prevent the fx queue from being
3996 // automatically dequeued
3997 if ( type === "fx" ) {
3998 queue.unshift( "inprogress" );
3999 }
4000
4001 // clear up the last queue stop function
4002 delete hooks.stop;
4003 fn.call( elem, next, hooks );
4004 }
4005
4006 if ( !startLength && hooks ) {
4007 hooks.empty.fire();
4008 }
4009 },
4010
4011 // not intended for public consumption - generates a queueHooks object, or returns the current one
4012 _queueHooks: function( elem, type ) {
4013 var key = type + "queueHooks";
4014 return jQuery._data( elem, key ) || jQuery._data( elem, key, {
4015 empty: jQuery.Callbacks("once memory").add(function() {
4016 jQuery._removeData( elem, type + "queue" );
4017 jQuery._removeData( elem, key );
4018 })
4019 });
4020 }
4021 });
4022
4023 jQuery.fn.extend({
4024 queue: function( type, data ) {
4025 var setter = 2;
4026
4027 if ( typeof type !== "string" ) {
4028 data = type;
4029 type = "fx";
4030 setter--;
4031 }
4032
4033 if ( arguments.length < setter ) {
4034 return jQuery.queue( this[0], type );
4035 }
4036
4037 return data === undefined ?
4038 this :
4039 this.each(function() {
4040 var queue = jQuery.queue( this, type, data );
4041
4042 // ensure a hooks for this queue
4043 jQuery._queueHooks( this, type );
4044
4045 if ( type === "fx" && queue[0] !== "inprogress" ) {
4046 jQuery.dequeue( this, type );
4047 }
4048 });
4049 },
4050 dequeue: function( type ) {
4051 return this.each(function() {
4052 jQuery.dequeue( this, type );
4053 });
4054 },
4055 clearQueue: function( type ) {
4056 return this.queue( type || "fx", [] );
4057 },
4058 // Get a promise resolved when queues of a certain type
4059 // are emptied (fx is the type by default)
4060 promise: function( type, obj ) {
4061 var tmp,
4062 count = 1,
4063 defer = jQuery.Deferred(),
4064 elements = this,
4065 i = this.length,
4066 resolve = function() {
4067 if ( !( --count ) ) {
4068 defer.resolveWith( elements, [ elements ] );
4069 }
4070 };
4071
4072 if ( typeof type !== "string" ) {
4073 obj = type;
4074 type = undefined;
4075 }
4076 type = type || "fx";
4077
4078 while ( i-- ) {
4079 tmp = jQuery._data( elements[ i ], type + "queueHooks" );
4080 if ( tmp && tmp.empty ) {
4081 count++;
4082 tmp.empty.add( resolve );
4083 }
4084 }
4085 resolve();
4086 return defer.promise( obj );
4087 }
4088 });
4089 var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source;
4090
4091 var cssExpand = [ "Top", "Right", "Bottom", "Left" ];
4092
4093 var isHidden = function( elem, el ) {
4094 // isHidden might be called from jQuery#filter function;
4095 // in that case, element will be second argument
4096 elem = el || elem;
4097 return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
4098 };
4099
4100
4101
4102 // Multifunctional method to get and set values of a collection
4103 // The value/s can optionally be executed if it's a function
4104 var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) {
4105 var i = 0,
4106 length = elems.length,
4107 bulk = key == null;
4108
4109 // Sets many values
4110 if ( jQuery.type( key ) === "object" ) {
4111 chainable = true;
4112 for ( i in key ) {
4113 jQuery.access( elems, fn, i, key[i], true, emptyGet, raw );
4114 }
4115
4116 // Sets one value
4117 } else if ( value !== undefined ) {
4118 chainable = true;
4119
4120 if ( !jQuery.isFunction( value ) ) {
4121 raw = true;
4122 }
4123
4124 if ( bulk ) {
4125 // Bulk operations run against the entire set
4126 if ( raw ) {
4127 fn.call( elems, value );
4128 fn = null;
4129
4130 // ...except when executing function values
4131 } else {
4132 bulk = fn;
4133 fn = function( elem, key, value ) {
4134 return bulk.call( jQuery( elem ), value );
4135 };
4136 }
4137 }
4138
4139 if ( fn ) {
4140 for ( ; i < length; i++ ) {
4141 fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) );
4142 }
4143 }
4144 }
4145
4146 return chainable ?
4147 elems :
4148
4149 // Gets
4150 bulk ?
4151 fn.call( elems ) :
4152 length ? fn( elems[0], key ) : emptyGet;
4153 };
4154 var rcheckableType = (/^(?:checkbox|radio)$/i);
4155
4156
4157
4158 (function() {
4159 // Minified: var a,b,c
4160 var input = document.createElement( "input" ),
4161 div = document.createElement( "div" ),
4162 fragment = document.createDocumentFragment();
4163
4164 // Setup
4165 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
4166
4167 // IE strips leading whitespace when .innerHTML is used
4168 support.leadingWhitespace = div.firstChild.nodeType === 3;
4169
4170 // Make sure that tbody elements aren't automatically inserted
4171 // IE will insert them into empty tables
4172 support.tbody = !div.getElementsByTagName( "tbody" ).length;
4173
4174 // Make sure that link elements get serialized correctly by innerHTML
4175 // This requires a wrapper element in IE
4176 support.htmlSerialize = !!div.getElementsByTagName( "link" ).length;
4177
4178 // Makes sure cloning an html5 element does not cause problems
4179 // Where outerHTML is undefined, this still works
4180 support.html5Clone =
4181 document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>";
4182
4183 // Check if a disconnected checkbox will retain its checked
4184 // value of true after appended to the DOM (IE6/7)
4185 input.type = "checkbox";
4186 input.checked = true;
4187 fragment.appendChild( input );
4188 support.appendChecked = input.checked;
4189
4190 // Make sure textarea (and checkbox) defaultValue is properly cloned
4191 // Support: IE6-IE11+
4192 div.innerHTML = "<textarea>x</textarea>";
4193 support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue;
4194
4195 // #11217 - WebKit loses check when the name is after the checked attribute
4196 fragment.appendChild( div );
4197 div.innerHTML = "<input type='radio' checked='checked' name='t'/>";
4198
4199 // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3
4200 // old WebKit doesn't clone checked state correctly in fragments
4201 support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked;
4202
4203 // Support: IE<9
4204 // Opera does not clone events (and typeof div.attachEvent === undefined).
4205 // IE9-10 clones events bound via attachEvent, but they don't trigger with .click()
4206 support.noCloneEvent = true;
4207 if ( div.attachEvent ) {
4208 div.attachEvent( "onclick", function() {
4209 support.noCloneEvent = false;
4210 });
4211
4212 div.cloneNode( true ).click();
4213 }
4214
4215 // Execute the test only if not already executed in another module.
4216 if (support.deleteExpando == null) {
4217 // Support: IE<9
4218 support.deleteExpando = true;
4219 try {
4220 delete div.test;
4221 } catch( e ) {
4222 support.deleteExpando = false;
4223 }
4224 }
4225 })();
4226
4227
4228 (function() {
4229 var i, eventName,
4230 div = document.createElement( "div" );
4231
4232 // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event)
4233 for ( i in { submit: true, change: true, focusin: true }) {
4234 eventName = "on" + i;
4235
4236 if ( !(support[ i + "Bubbles" ] = eventName in window) ) {
4237 // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP)
4238 div.setAttribute( eventName, "t" );
4239 support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false;
4240 }
4241 }
4242
4243 // Null elements to avoid leaks in IE.
4244 div = null;
4245 })();
4246
4247
4248 var rformElems = /^(?:input|select|textarea)$/i,
4249 rkeyEvent = /^key/,
4250 rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,
4251 rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
4252 rtypenamespace = /^([^.]*)(?:\.(.+)|)$/;
4253
4254 function returnTrue() {
4255 return true;
4256 }
4257
4258 function returnFalse() {
4259 return false;
4260 }
4261
4262 function safeActiveElement() {
4263 try {
4264 return document.activeElement;
4265 } catch ( err ) { }
4266 }
4267
4268 /*
4269 * Helper functions for managing events -- not part of the public interface.
4270 * Props to Dean Edwards' addEvent library for many of the ideas.
4271 */
4272 jQuery.event = {
4273
4274 global: {},
4275
4276 add: function( elem, types, handler, data, selector ) {
4277 var tmp, events, t, handleObjIn,
4278 special, eventHandle, handleObj,
4279 handlers, type, namespaces, origType,
4280 elemData = jQuery._data( elem );
4281
4282 // Don't attach events to noData or text/comment nodes (but allow plain objects)
4283 if ( !elemData ) {
4284 return;
4285 }
4286
4287 // Caller can pass in an object of custom data in lieu of the handler
4288 if ( handler.handler ) {
4289 handleObjIn = handler;
4290 handler = handleObjIn.handler;
4291 selector = handleObjIn.selector;
4292 }
4293
4294 // Make sure that the handler has a unique ID, used to find/remove it later
4295 if ( !handler.guid ) {
4296 handler.guid = jQuery.guid++;
4297 }
4298
4299 // Init the element's event structure and main handler, if this is the first
4300 if ( !(events = elemData.events) ) {
4301 events = elemData.events = {};
4302 }
4303 if ( !(eventHandle = elemData.handle) ) {
4304 eventHandle = elemData.handle = function( e ) {
4305 // Discard the second event of a jQuery.event.trigger() and
4306 // when an event is called after a page has unloaded
4307 return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?
4308 jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
4309 undefined;
4310 };
4311 // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
4312 eventHandle.elem = elem;
4313 }
4314
4315 // Handle multiple events separated by a space
4316 types = ( types || "" ).match( rnotwhite ) || [ "" ];
4317 t = types.length;
4318 while ( t-- ) {
4319 tmp = rtypenamespace.exec( types[t] ) || [];
4320 type = origType = tmp[1];
4321 namespaces = ( tmp[2] || "" ).split( "." ).sort();
4322
4323 // There *must* be a type, no attaching namespace-only handlers
4324 if ( !type ) {
4325 continue;
4326 }
4327
4328 // If event changes its type, use the special event handlers for the changed type
4329 special = jQuery.event.special[ type ] || {};
4330
4331 // If selector defined, determine special event api type, otherwise given type
4332 type = ( selector ? special.delegateType : special.bindType ) || type;
4333
4334 // Update special based on newly reset type
4335 special = jQuery.event.special[ type ] || {};
4336
4337 // handleObj is passed to all event handlers
4338 handleObj = jQuery.extend({
4339 type: type,
4340 origType: origType,
4341 data: data,
4342 handler: handler,
4343 guid: handler.guid,
4344 selector: selector,
4345 needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
4346 namespace: namespaces.join(".")
4347 }, handleObjIn );
4348
4349 // Init the event handler queue if we're the first
4350 if ( !(handlers = events[ type ]) ) {
4351 handlers = events[ type ] = [];
4352 handlers.delegateCount = 0;
4353
4354 // Only use addEventListener/attachEvent if the special events handler returns false
4355 if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
4356 // Bind the global event handler to the element
4357 if ( elem.addEventListener ) {
4358 elem.addEventListener( type, eventHandle, false );
4359
4360 } else if ( elem.attachEvent ) {
4361 elem.attachEvent( "on" + type, eventHandle );
4362 }
4363 }
4364 }
4365
4366 if ( special.add ) {
4367 special.add.call( elem, handleObj );
4368
4369 if ( !handleObj.handler.guid ) {
4370 handleObj.handler.guid = handler.guid;
4371 }
4372 }
4373
4374 // Add to the element's handler list, delegates in front
4375 if ( selector ) {
4376 handlers.splice( handlers.delegateCount++, 0, handleObj );
4377 } else {
4378 handlers.push( handleObj );
4379 }
4380
4381 // Keep track of which events have ever been used, for event optimization
4382 jQuery.event.global[ type ] = true;
4383 }
4384
4385 // Nullify elem to prevent memory leaks in IE
4386 elem = null;
4387 },
4388
4389 // Detach an event or set of events from an element
4390 remove: function( elem, types, handler, selector, mappedTypes ) {
4391 var j, handleObj, tmp,
4392 origCount, t, events,
4393 special, handlers, type,
4394 namespaces, origType,
4395 elemData = jQuery.hasData( elem ) && jQuery._data( elem );
4396
4397 if ( !elemData || !(events = elemData.events) ) {
4398 return;
4399 }
4400
4401 // Once for each type.namespace in types; type may be omitted
4402 types = ( types || "" ).match( rnotwhite ) || [ "" ];
4403 t = types.length;
4404 while ( t-- ) {
4405 tmp = rtypenamespace.exec( types[t] ) || [];
4406 type = origType = tmp[1];
4407 namespaces = ( tmp[2] || "" ).split( "." ).sort();
4408
4409 // Unbind all events (on this namespace, if provided) for the element
4410 if ( !type ) {
4411 for ( type in events ) {
4412 jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
4413 }
4414 continue;
4415 }
4416
4417 special = jQuery.event.special[ type ] || {};
4418 type = ( selector ? special.delegateType : special.bindType ) || type;
4419 handlers = events[ type ] || [];
4420 tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" );
4421
4422 // Remove matching events
4423 origCount = j = handlers.length;
4424 while ( j-- ) {
4425 handleObj = handlers[ j ];
4426
4427 if ( ( mappedTypes || origType === handleObj.origType ) &&
4428 ( !handler || handler.guid === handleObj.guid ) &&
4429 ( !tmp || tmp.test( handleObj.namespace ) ) &&
4430 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
4431 handlers.splice( j, 1 );
4432
4433 if ( handleObj.selector ) {
4434 handlers.delegateCount--;
4435 }
4436 if ( special.remove ) {
4437 special.remove.call( elem, handleObj );
4438 }
4439 }
4440 }
4441
4442 // Remove generic event handler if we removed something and no more handlers exist
4443 // (avoids potential for endless recursion during removal of special event handlers)
4444 if ( origCount && !handlers.length ) {
4445 if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
4446 jQuery.removeEvent( elem, type, elemData.handle );
4447 }
4448
4449 delete events[ type ];
4450 }
4451 }
4452
4453 // Remove the expando if it's no longer used
4454 if ( jQuery.isEmptyObject( events ) ) {
4455 delete elemData.handle;
4456
4457 // removeData also checks for emptiness and clears the expando if empty
4458 // so use it instead of delete
4459 jQuery._removeData( elem, "events" );
4460 }
4461 },
4462
4463 trigger: function( event, data, elem, onlyHandlers ) {
4464 var handle, ontype, cur,
4465 bubbleType, special, tmp, i,
4466 eventPath = [ elem || document ],
4467 type = hasOwn.call( event, "type" ) ? event.type : event,
4468 namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : [];
4469
4470 cur = tmp = elem = elem || document;
4471
4472 // Don't do events on text and comment nodes
4473 if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
4474 return;
4475 }
4476
4477 // focus/blur morphs to focusin/out; ensure we're not firing them right now
4478 if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
4479 return;
4480 }
4481
4482 if ( type.indexOf(".") >= 0 ) {
4483 // Namespaced trigger; create a regexp to match event type in handle()
4484 namespaces = type.split(".");
4485 type = namespaces.shift();
4486 namespaces.sort();
4487 }
4488 ontype = type.indexOf(":") < 0 && "on" + type;
4489
4490 // Caller can pass in a jQuery.Event object, Object, or just an event type string
4491 event = event[ jQuery.expando ] ?
4492 event :
4493 new jQuery.Event( type, typeof event === "object" && event );
4494
4495 // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)
4496 event.isTrigger = onlyHandlers ? 2 : 3;
4497 event.namespace = namespaces.join(".");
4498 event.namespace_re = event.namespace ?
4499 new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) :
4500 null;
4501
4502 // Clean up the event in case it is being reused
4503 event.result = undefined;
4504 if ( !event.target ) {
4505 event.target = elem;
4506 }
4507
4508 // Clone any incoming data and prepend the event, creating the handler arg list
4509 data = data == null ?
4510 [ event ] :
4511 jQuery.makeArray( data, [ event ] );
4512
4513 // Allow special events to draw outside the lines
4514 special = jQuery.event.special[ type ] || {};
4515 if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) {
4516 return;
4517 }
4518
4519 // Determine event propagation path in advance, per W3C events spec (#9951)
4520 // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
4521 if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
4522
4523 bubbleType = special.delegateType || type;
4524 if ( !rfocusMorph.test( bubbleType + type ) ) {
4525 cur = cur.parentNode;
4526 }
4527 for ( ; cur; cur = cur.parentNode ) {
4528 eventPath.push( cur );
4529 tmp = cur;
4530 }
4531
4532 // Only add window if we got to document (e.g., not plain obj or detached DOM)
4533 if ( tmp === (elem.ownerDocument || document) ) {
4534 eventPath.push( tmp.defaultView || tmp.parentWindow || window );
4535 }
4536 }
4537
4538 // Fire handlers on the event path
4539 i = 0;
4540 while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) {
4541
4542 event.type = i > 1 ?
4543 bubbleType :
4544 special.bindType || type;
4545
4546 // jQuery handler
4547 handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
4548 if ( handle ) {
4549 handle.apply( cur, data );
4550 }
4551
4552 // Native handler
4553 handle = ontype && cur[ ontype ];
4554 if ( handle && handle.apply && jQuery.acceptData( cur ) ) {
4555 event.result = handle.apply( cur, data );
4556 if ( event.result === false ) {
4557 event.preventDefault();
4558 }
4559 }
4560 }
4561 event.type = type;
4562
4563 // If nobody prevented the default action, do it now
4564 if ( !onlyHandlers && !event.isDefaultPrevented() ) {
4565
4566 if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) &&
4567 jQuery.acceptData( elem ) ) {
4568
4569 // Call a native DOM method on the target with the same name name as the event.
4570 // Can't use an .isFunction() check here because IE6/7 fails that test.
4571 // Don't do default actions on window, that's where global variables be (#6170)
4572 if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) {
4573
4574 // Don't re-trigger an onFOO event when we call its FOO() method
4575 tmp = elem[ ontype ];
4576
4577 if ( tmp ) {
4578 elem[ ontype ] = null;
4579 }
4580
4581 // Prevent re-triggering of the same event, since we already bubbled it above
4582 jQuery.event.triggered = type;
4583 try {
4584 elem[ type ]();
4585 } catch ( e ) {
4586 // IE<9 dies on focus/blur to hidden element (#1486,#12518)
4587 // only reproducible on winXP IE8 native, not IE9 in IE8 mode
4588 }
4589 jQuery.event.triggered = undefined;
4590
4591 if ( tmp ) {
4592 elem[ ontype ] = tmp;
4593 }
4594 }
4595 }
4596 }
4597
4598 return event.result;
4599 },
4600
4601 dispatch: function( event ) {
4602
4603 // Make a writable jQuery.Event from the native event object
4604 event = jQuery.event.fix( event );
4605
4606 var i, ret, handleObj, matched, j,
4607 handlerQueue = [],
4608 args = slice.call( arguments ),
4609 handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [],
4610 special = jQuery.event.special[ event.type ] || {};
4611
4612 // Use the fix-ed jQuery.Event rather than the (read-only) native event
4613 args[0] = event;
4614 event.delegateTarget = this;
4615
4616 // Call the preDispatch hook for the mapped type, and let it bail if desired
4617 if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
4618 return;
4619 }
4620
4621 // Determine handlers
4622 handlerQueue = jQuery.event.handlers.call( this, event, handlers );
4623
4624 // Run delegates first; they may want to stop propagation beneath us
4625 i = 0;
4626 while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) {
4627 event.currentTarget = matched.elem;
4628
4629 j = 0;
4630 while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) {
4631
4632 // Triggered event must either 1) have no namespace, or
4633 // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
4634 if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) {
4635
4636 event.handleObj = handleObj;
4637 event.data = handleObj.data;
4638
4639 ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4640 .apply( matched.elem, args );
4641
4642 if ( ret !== undefined ) {
4643 if ( (event.result = ret) === false ) {
4644 event.preventDefault();
4645 event.stopPropagation();
4646 }
4647 }
4648 }
4649 }
4650 }
4651
4652 // Call the postDispatch hook for the mapped type
4653 if ( special.postDispatch ) {
4654 special.postDispatch.call( this, event );
4655 }
4656
4657 return event.result;
4658 },
4659
4660 handlers: function( event, handlers ) {
4661 var sel, handleObj, matches, i,
4662 handlerQueue = [],
4663 delegateCount = handlers.delegateCount,
4664 cur = event.target;
4665
4666 // Find delegate handlers
4667 // Black-hole SVG <use> instance trees (#13180)
4668 // Avoid non-left-click bubbling in Firefox (#3861)
4669 if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) {
4670
4671 /* jshint eqeqeq: false */
4672 for ( ; cur != this; cur = cur.parentNode || this ) {
4673 /* jshint eqeqeq: true */
4674
4675 // Don't check non-elements (#13208)
4676 // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)
4677 if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) {
4678 matches = [];
4679 for ( i = 0; i < delegateCount; i++ ) {
4680 handleObj = handlers[ i ];
4681
4682 // Don't conflict with Object.prototype properties (#13203)
4683 sel = handleObj.selector + " ";
4684
4685 if ( matches[ sel ] === undefined ) {
4686 matches[ sel ] = handleObj.needsContext ?
4687 jQuery( sel, this ).index( cur ) >= 0 :
4688 jQuery.find( sel, this, null, [ cur ] ).length;
4689 }
4690 if ( matches[ sel ] ) {
4691 matches.push( handleObj );
4692 }
4693 }
4694 if ( matches.length ) {
4695 handlerQueue.push({ elem: cur, handlers: matches });
4696 }
4697 }
4698 }
4699 }
4700
4701 // Add the remaining (directly-bound) handlers
4702 if ( delegateCount < handlers.length ) {
4703 handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) });
4704 }
4705
4706 return handlerQueue;
4707 },
4708
4709 fix: function( event ) {
4710 if ( event[ jQuery.expando ] ) {
4711 return event;
4712 }
4713
4714 // Create a writable copy of the event object and normalize some properties
4715 var i, prop, copy,
4716 type = event.type,
4717 originalEvent = event,
4718 fixHook = this.fixHooks[ type ];
4719
4720 if ( !fixHook ) {
4721 this.fixHooks[ type ] = fixHook =
4722 rmouseEvent.test( type ) ? this.mouseHooks :
4723 rkeyEvent.test( type ) ? this.keyHooks :
4724 {};
4725 }
4726 copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
4727
4728 event = new jQuery.Event( originalEvent );
4729
4730 i = copy.length;
4731 while ( i-- ) {
4732 prop = copy[ i ];
4733 event[ prop ] = originalEvent[ prop ];
4734 }
4735
4736 // Support: IE<9
4737 // Fix target property (#1925)
4738 if ( !event.target ) {
4739 event.target = originalEvent.srcElement || document;
4740 }
4741
4742 // Support: Chrome 23+, Safari?
4743 // Target should not be a text node (#504, #13143)
4744 if ( event.target.nodeType === 3 ) {
4745 event.target = event.target.parentNode;
4746 }
4747
4748 // Support: IE<9
4749 // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)
4750 event.metaKey = !!event.metaKey;
4751
4752 return fixHook.filter ? fixHook.filter( event, originalEvent ) : event;
4753 },
4754
4755 // Includes some event props shared by KeyEvent and MouseEvent
4756 props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
4757
4758 fixHooks: {},
4759
4760 keyHooks: {
4761 props: "char charCode key keyCode".split(" "),
4762 filter: function( event, original ) {
4763
4764 // Add which for key events
4765 if ( event.which == null ) {
4766 event.which = original.charCode != null ? original.charCode : original.keyCode;
4767 }
4768
4769 return event;
4770 }
4771 },
4772
4773 mouseHooks: {
4774 props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
4775 filter: function( event, original ) {
4776 var body, eventDoc, doc,
4777 button = original.button,
4778 fromElement = original.fromElement;
4779
4780 // Calculate pageX/Y if missing and clientX/Y available
4781 if ( event.pageX == null && original.clientX != null ) {
4782 eventDoc = event.target.ownerDocument || document;
4783 doc = eventDoc.documentElement;
4784 body = eventDoc.body;
4785
4786 event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
4787 event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );
4788 }
4789
4790 // Add relatedTarget, if necessary
4791 if ( !event.relatedTarget && fromElement ) {
4792 event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
4793 }
4794
4795 // Add which for click: 1 === left; 2 === middle; 3 === right
4796 // Note: button is not normalized, so don't use it
4797 if ( !event.which && button !== undefined ) {
4798 event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
4799 }
4800
4801 return event;
4802 }
4803 },
4804
4805 special: {
4806 load: {
4807 // Prevent triggered image.load events from bubbling to window.load
4808 noBubble: true
4809 },
4810 focus: {
4811 // Fire native event if possible so blur/focus sequence is correct
4812 trigger: function() {
4813 if ( this !== safeActiveElement() && this.focus ) {
4814 try {
4815 this.focus();
4816 return false;
4817 } catch ( e ) {
4818 // Support: IE<9
4819 // If we error on focus to hidden element (#1486, #12518),
4820 // let .trigger() run the handlers
4821 }
4822 }
4823 },
4824 delegateType: "focusin"
4825 },
4826 blur: {
4827 trigger: function() {
4828 if ( this === safeActiveElement() && this.blur ) {
4829 this.blur();
4830 return false;
4831 }
4832 },
4833 delegateType: "focusout"
4834 },
4835 click: {
4836 // For checkbox, fire native event so checked state will be right
4837 trigger: function() {
4838 if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) {
4839 this.click();
4840 return false;
4841 }
4842 },
4843
4844 // For cross-browser consistency, don't fire native .click() on links
4845 _default: function( event ) {
4846 return jQuery.nodeName( event.target, "a" );
4847 }
4848 },
4849
4850 beforeunload: {
4851 postDispatch: function( event ) {
4852
4853 // Support: Firefox 20+
4854 // Firefox doesn't alert if the returnValue field is not set.
4855 if ( event.result !== undefined && event.originalEvent ) {
4856 event.originalEvent.returnValue = event.result;
4857 }
4858 }
4859 }
4860 },
4861
4862 simulate: function( type, elem, event, bubble ) {
4863 // Piggyback on a donor event to simulate a different one.
4864 // Fake originalEvent to avoid donor's stopPropagation, but if the
4865 // simulated event prevents default then we do the same on the donor.
4866 var e = jQuery.extend(
4867 new jQuery.Event(),
4868 event,
4869 {
4870 type: type,
4871 isSimulated: true,
4872 originalEvent: {}
4873 }
4874 );
4875 if ( bubble ) {
4876 jQuery.event.trigger( e, null, elem );
4877 } else {
4878 jQuery.event.dispatch.call( elem, e );
4879 }
4880 if ( e.isDefaultPrevented() ) {
4881 event.preventDefault();
4882 }
4883 }
4884 };
4885
4886 jQuery.removeEvent = document.removeEventListener ?
4887 function( elem, type, handle ) {
4888 if ( elem.removeEventListener ) {
4889 elem.removeEventListener( type, handle, false );
4890 }
4891 } :
4892 function( elem, type, handle ) {
4893 var name = "on" + type;
4894
4895 if ( elem.detachEvent ) {
4896
4897 // #8545, #7054, preventing memory leaks for custom events in IE6-8
4898 // detachEvent needed property on element, by name of that event, to properly expose it to GC
4899 if ( typeof elem[ name ] === strundefined ) {
4900 elem[ name ] = null;
4901 }
4902
4903 elem.detachEvent( name, handle );
4904 }
4905 };
4906
4907 jQuery.Event = function( src, props ) {
4908 // Allow instantiation without the 'new' keyword
4909 if ( !(this instanceof jQuery.Event) ) {
4910 return new jQuery.Event( src, props );
4911 }
4912
4913 // Event object
4914 if ( src && src.type ) {
4915 this.originalEvent = src;
4916 this.type = src.type;
4917
4918 // Events bubbling up the document may have been marked as prevented
4919 // by a handler lower down the tree; reflect the correct value.
4920 this.isDefaultPrevented = src.defaultPrevented ||
4921 src.defaultPrevented === undefined &&
4922 // Support: IE < 9, Android < 4.0
4923 src.returnValue === false ?
4924 returnTrue :
4925 returnFalse;
4926
4927 // Event type
4928 } else {
4929 this.type = src;
4930 }
4931
4932 // Put explicitly provided properties onto the event object
4933 if ( props ) {
4934 jQuery.extend( this, props );
4935 }
4936
4937 // Create a timestamp if incoming event doesn't have one
4938 this.timeStamp = src && src.timeStamp || jQuery.now();
4939
4940 // Mark it as fixed
4941 this[ jQuery.expando ] = true;
4942 };
4943
4944 // jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
4945 // http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
4946 jQuery.Event.prototype = {
4947 isDefaultPrevented: returnFalse,
4948 isPropagationStopped: returnFalse,
4949 isImmediatePropagationStopped: returnFalse,
4950
4951 preventDefault: function() {
4952 var e = this.originalEvent;
4953
4954 this.isDefaultPrevented = returnTrue;
4955 if ( !e ) {
4956 return;
4957 }
4958
4959 // If preventDefault exists, run it on the original event
4960 if ( e.preventDefault ) {
4961 e.preventDefault();
4962
4963 // Support: IE
4964 // Otherwise set the returnValue property of the original event to false
4965 } else {
4966 e.returnValue = false;
4967 }
4968 },
4969 stopPropagation: function() {
4970 var e = this.originalEvent;
4971
4972 this.isPropagationStopped = returnTrue;
4973 if ( !e ) {
4974 return;
4975 }
4976 // If stopPropagation exists, run it on the original event
4977 if ( e.stopPropagation ) {
4978 e.stopPropagation();
4979 }
4980
4981 // Support: IE
4982 // Set the cancelBubble property of the original event to true
4983 e.cancelBubble = true;
4984 },
4985 stopImmediatePropagation: function() {
4986 var e = this.originalEvent;
4987
4988 this.isImmediatePropagationStopped = returnTrue;
4989
4990 if ( e && e.stopImmediatePropagation ) {
4991 e.stopImmediatePropagation();
4992 }
4993
4994 this.stopPropagation();
4995 }
4996 };
4997
4998 // Create mouseenter/leave events using mouseover/out and event-time checks
4999 jQuery.each({
5000 mouseenter: "mouseover",
5001 mouseleave: "mouseout",
5002 pointerenter: "pointerover",
5003 pointerleave: "pointerout"
5004 }, function( orig, fix ) {
5005 jQuery.event.special[ orig ] = {
5006 delegateType: fix,
5007 bindType: fix,
5008
5009 handle: function( event ) {
5010 var ret,
5011 target = this,
5012 related = event.relatedTarget,
5013 handleObj = event.handleObj;
5014
5015 // For mousenter/leave call the handler if related is outside the target.
5016 // NB: No relatedTarget if the mouse left/entered the browser window
5017 if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
5018 event.type = handleObj.origType;
5019 ret = handleObj.handler.apply( this, arguments );
5020 event.type = fix;
5021 }
5022 return ret;
5023 }
5024 };
5025 });
5026
5027 // IE submit delegation
5028 if ( !support.submitBubbles ) {
5029
5030 jQuery.event.special.submit = {
5031 setup: function() {
5032 // Only need this for delegated form submit events
5033 if ( jQuery.nodeName( this, "form" ) ) {
5034 return false;
5035 }
5036
5037 // Lazy-add a submit handler when a descendant form may potentially be submitted
5038 jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
5039 // Node name check avoids a VML-related crash in IE (#9807)
5040 var elem = e.target,
5041 form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
5042 if ( form && !jQuery._data( form, "submitBubbles" ) ) {
5043 jQuery.event.add( form, "submit._submit", function( event ) {
5044 event._submit_bubble = true;
5045 });
5046 jQuery._data( form, "submitBubbles", true );
5047 }
5048 });
5049 // return undefined since we don't need an event listener
5050 },
5051
5052 postDispatch: function( event ) {
5053 // If form was submitted by the user, bubble the event up the tree
5054 if ( event._submit_bubble ) {
5055 delete event._submit_bubble;
5056 if ( this.parentNode && !event.isTrigger ) {
5057 jQuery.event.simulate( "submit", this.parentNode, event, true );
5058 }
5059 }
5060 },
5061
5062 teardown: function() {
5063 // Only need this for delegated form submit events
5064 if ( jQuery.nodeName( this, "form" ) ) {
5065 return false;
5066 }
5067
5068 // Remove delegated handlers; cleanData eventually reaps submit handlers attached above
5069 jQuery.event.remove( this, "._submit" );
5070 }
5071 };
5072 }
5073
5074 // IE change delegation and checkbox/radio fix
5075 if ( !support.changeBubbles ) {
5076
5077 jQuery.event.special.change = {
5078
5079 setup: function() {
5080
5081 if ( rformElems.test( this.nodeName ) ) {
5082 // IE doesn't fire change on a check/radio until blur; trigger it on click
5083 // after a propertychange. Eat the blur-change in special.change.handle.
5084 // This still fires onchange a second time for check/radio after blur.
5085 if ( this.type === "checkbox" || this.type === "radio" ) {
5086 jQuery.event.add( this, "propertychange._change", function( event ) {
5087 if ( event.originalEvent.propertyName === "checked" ) {
5088 this._just_changed = true;
5089 }
5090 });
5091 jQuery.event.add( this, "click._change", function( event ) {
5092 if ( this._just_changed && !event.isTrigger ) {
5093 this._just_changed = false;
5094 }
5095 // Allow triggered, simulated change events (#11500)
5096 jQuery.event.simulate( "change", this, event, true );
5097 });
5098 }
5099 return false;
5100 }
5101 // Delegated event; lazy-add a change handler on descendant inputs
5102 jQuery.event.add( this, "beforeactivate._change", function( e ) {
5103 var elem = e.target;
5104
5105 if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) {
5106 jQuery.event.add( elem, "change._change", function( event ) {
5107 if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
5108 jQuery.event.simulate( "change", this.parentNode, event, true );
5109 }
5110 });
5111 jQuery._data( elem, "changeBubbles", true );
5112 }
5113 });
5114 },
5115
5116 handle: function( event ) {
5117 var elem = event.target;
5118
5119 // Swallow native change events from checkbox/radio, we already triggered them above
5120 if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
5121 return event.handleObj.handler.apply( this, arguments );
5122 }
5123 },
5124
5125 teardown: function() {
5126 jQuery.event.remove( this, "._change" );
5127
5128 return !rformElems.test( this.nodeName );
5129 }
5130 };
5131 }
5132
5133 // Create "bubbling" focus and blur events
5134 if ( !support.focusinBubbles ) {
5135 jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
5136
5137 // Attach a single capturing handler on the document while someone wants focusin/focusout
5138 var handler = function( event ) {
5139 jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
5140 };
5141
5142 jQuery.event.special[ fix ] = {
5143 setup: function() {
5144 var doc = this.ownerDocument || this,
5145 attaches = jQuery._data( doc, fix );
5146
5147 if ( !attaches ) {
5148 doc.addEventListener( orig, handler, true );
5149 }
5150 jQuery._data( doc, fix, ( attaches || 0 ) + 1 );
5151 },
5152 teardown: function() {
5153 var doc = this.ownerDocument || this,
5154 attaches = jQuery._data( doc, fix ) - 1;
5155
5156 if ( !attaches ) {
5157 doc.removeEventListener( orig, handler, true );
5158 jQuery._removeData( doc, fix );
5159 } else {
5160 jQuery._data( doc, fix, attaches );
5161 }
5162 }
5163 };
5164 });
5165 }
5166
5167 jQuery.fn.extend({
5168
5169 on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
5170 var type, origFn;
5171
5172 // Types can be a map of types/handlers
5173 if ( typeof types === "object" ) {
5174 // ( types-Object, selector, data )
5175 if ( typeof selector !== "string" ) {
5176 // ( types-Object, data )
5177 data = data || selector;
5178 selector = undefined;
5179 }
5180 for ( type in types ) {
5181 this.on( type, selector, data, types[ type ], one );
5182 }
5183 return this;
5184 }
5185
5186 if ( data == null && fn == null ) {
5187 // ( types, fn )
5188 fn = selector;
5189 data = selector = undefined;
5190 } else if ( fn == null ) {
5191 if ( typeof selector === "string" ) {
5192 // ( types, selector, fn )
5193 fn = data;
5194 data = undefined;
5195 } else {
5196 // ( types, data, fn )
5197 fn = data;
5198 data = selector;
5199 selector = undefined;
5200 }
5201 }
5202 if ( fn === false ) {
5203 fn = returnFalse;
5204 } else if ( !fn ) {
5205 return this;
5206 }
5207
5208 if ( one === 1 ) {
5209 origFn = fn;
5210 fn = function( event ) {
5211 // Can use an empty set, since event contains the info
5212 jQuery().off( event );
5213 return origFn.apply( this, arguments );
5214 };
5215 // Use same guid so caller can remove using origFn
5216 fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
5217 }
5218 return this.each( function() {
5219 jQuery.event.add( this, types, fn, data, selector );
5220 });
5221 },
5222 one: function( types, selector, data, fn ) {
5223 return this.on( types, selector, data, fn, 1 );
5224 },
5225 off: function( types, selector, fn ) {
5226 var handleObj, type;
5227 if ( types && types.preventDefault && types.handleObj ) {
5228 // ( event ) dispatched jQuery.Event
5229 handleObj = types.handleObj;
5230 jQuery( types.delegateTarget ).off(
5231 handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
5232 handleObj.selector,
5233 handleObj.handler
5234 );
5235 return this;
5236 }
5237 if ( typeof types === "object" ) {
5238 // ( types-object [, selector] )
5239 for ( type in types ) {
5240 this.off( type, selector, types[ type ] );
5241 }
5242 return this;
5243 }
5244 if ( selector === false || typeof selector === "function" ) {
5245 // ( types [, fn] )
5246 fn = selector;
5247 selector = undefined;
5248 }
5249 if ( fn === false ) {
5250 fn = returnFalse;
5251 }
5252 return this.each(function() {
5253 jQuery.event.remove( this, types, fn, selector );
5254 });
5255 },
5256
5257 trigger: function( type, data ) {
5258 return this.each(function() {
5259 jQuery.event.trigger( type, data, this );
5260 });
5261 },
5262 triggerHandler: function( type, data ) {
5263 var elem = this[0];
5264 if ( elem ) {
5265 return jQuery.event.trigger( type, data, elem, true );
5266 }
5267 }
5268 });
5269
5270
5271 function createSafeFragment( document ) {
5272 var list = nodeNames.split( "|" ),
5273 safeFrag = document.createDocumentFragment();
5274
5275 if ( safeFrag.createElement ) {
5276 while ( list.length ) {
5277 safeFrag.createElement(
5278 list.pop()
5279 );
5280 }
5281 }
5282 return safeFrag;
5283 }
5284
5285 var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
5286 "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
5287 rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
5288 rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
5289 rleadingWhitespace = /^\s+/,
5290 rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
5291 rtagName = /<([\w:]+)/,
5292 rtbody = /<tbody/i,
5293 rhtml = /<|&#?\w+;/,
5294 rnoInnerhtml = /<(?:script|style|link)/i,
5295 // checked="checked" or checked
5296 rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
5297 rscriptType = /^$|\/(?:java|ecma)script/i,
5298 rscriptTypeMasked = /^true\/(.*)/,
5299 rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,
5300
5301 // We have to close these tags to support XHTML (#13200)
5302 wrapMap = {
5303 option: [ 1, "<select multiple='multiple'>", "</select>" ],
5304 legend: [ 1, "<fieldset>", "</fieldset>" ],
5305 area: [ 1, "<map>", "</map>" ],
5306 param: [ 1, "<object>", "</object>" ],
5307 thead: [ 1, "<table>", "</table>" ],
5308 tr: [ 2, "<table><tbody>", "</tbody></table>" ],
5309 col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
5310 td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
5311
5312 // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
5313 // unless wrapped in a div with non-breaking characters in front of it.
5314 _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ]
5315 },
5316 safeFragment = createSafeFragment( document ),
5317 fragmentDiv = safeFragment.appendChild( document.createElement("div") );
5318
5319 wrapMap.optgroup = wrapMap.option;
5320 wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
5321 wrapMap.th = wrapMap.td;
5322
5323 function getAll( context, tag ) {
5324 var elems, elem,
5325 i = 0,
5326 found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) :
5327 typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) :
5328 undefined;
5329
5330 if ( !found ) {
5331 for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) {
5332 if ( !tag || jQuery.nodeName( elem, tag ) ) {
5333 found.push( elem );
5334 } else {
5335 jQuery.merge( found, getAll( elem, tag ) );
5336 }
5337 }
5338 }
5339
5340 return tag === undefined || tag && jQuery.nodeName( context, tag ) ?
5341 jQuery.merge( [ context ], found ) :
5342 found;
5343 }
5344
5345 // Used in buildFragment, fixes the defaultChecked property
5346 function fixDefaultChecked( elem ) {
5347 if ( rcheckableType.test( elem.type ) ) {
5348 elem.defaultChecked = elem.checked;
5349 }
5350 }
5351
5352 // Support: IE<8
5353 // Manipulating tables requires a tbody
5354 function manipulationTarget( elem, content ) {
5355 return jQuery.nodeName( elem, "table" ) &&
5356 jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ?
5357
5358 elem.getElementsByTagName("tbody")[0] ||
5359 elem.appendChild( elem.ownerDocument.createElement("tbody") ) :
5360 elem;
5361 }
5362
5363 // Replace/restore the type attribute of script elements for safe DOM manipulation
5364 function disableScript( elem ) {
5365 elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type;
5366 return elem;
5367 }
5368 function restoreScript( elem ) {
5369 var match = rscriptTypeMasked.exec( elem.type );
5370 if ( match ) {
5371 elem.type = match[1];
5372 } else {
5373 elem.removeAttribute("type");
5374 }
5375 return elem;
5376 }
5377
5378 // Mark scripts as having already been evaluated
5379 function setGlobalEval( elems, refElements ) {
5380 var elem,
5381 i = 0;
5382 for ( ; (elem = elems[i]) != null; i++ ) {
5383 jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) );
5384 }
5385 }
5386
5387 function cloneCopyEvent( src, dest ) {
5388
5389 if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
5390 return;
5391 }
5392
5393 var type, i, l,
5394 oldData = jQuery._data( src ),
5395 curData = jQuery._data( dest, oldData ),
5396 events = oldData.events;
5397
5398 if ( events ) {
5399 delete curData.handle;
5400 curData.events = {};
5401
5402 for ( type in events ) {
5403 for ( i = 0, l = events[ type ].length; i < l; i++ ) {
5404 jQuery.event.add( dest, type, events[ type ][ i ] );
5405 }
5406 }
5407 }
5408
5409 // make the cloned public data object a copy from the original
5410 if ( curData.data ) {
5411 curData.data = jQuery.extend( {}, curData.data );
5412 }
5413 }
5414
5415 function fixCloneNodeIssues( src, dest ) {
5416 var nodeName, e, data;
5417
5418 // We do not need to do anything for non-Elements
5419 if ( dest.nodeType !== 1 ) {
5420 return;
5421 }
5422
5423 nodeName = dest.nodeName.toLowerCase();
5424
5425 // IE6-8 copies events bound via attachEvent when using cloneNode.
5426 if ( !support.noCloneEvent && dest[ jQuery.expando ] ) {
5427 data = jQuery._data( dest );
5428
5429 for ( e in data.events ) {
5430 jQuery.removeEvent( dest, e, data.handle );
5431 }
5432
5433 // Event data gets referenced instead of copied if the expando gets copied too
5434 dest.removeAttribute( jQuery.expando );
5435 }
5436
5437 // IE blanks contents when cloning scripts, and tries to evaluate newly-set text
5438 if ( nodeName === "script" && dest.text !== src.text ) {
5439 disableScript( dest ).text = src.text;
5440 restoreScript( dest );
5441
5442 // IE6-10 improperly clones children of object elements using classid.
5443 // IE10 throws NoModificationAllowedError if parent is null, #12132.
5444 } else if ( nodeName === "object" ) {
5445 if ( dest.parentNode ) {
5446 dest.outerHTML = src.outerHTML;
5447 }
5448
5449 // This path appears unavoidable for IE9. When cloning an object
5450 // element in IE9, the outerHTML strategy above is not sufficient.
5451 // If the src has innerHTML and the destination does not,
5452 // copy the src.innerHTML into the dest.innerHTML. #10324
5453 if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) {
5454 dest.innerHTML = src.innerHTML;
5455 }
5456
5457 } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
5458 // IE6-8 fails to persist the checked state of a cloned checkbox
5459 // or radio button. Worse, IE6-7 fail to give the cloned element
5460 // a checked appearance if the defaultChecked value isn't also set
5461
5462 dest.defaultChecked = dest.checked = src.checked;
5463
5464 // IE6-7 get confused and end up setting the value of a cloned
5465 // checkbox/radio button to an empty string instead of "on"
5466 if ( dest.value !== src.value ) {
5467 dest.value = src.value;
5468 }
5469
5470 // IE6-8 fails to return the selected option to the default selected
5471 // state when cloning options
5472 } else if ( nodeName === "option" ) {
5473 dest.defaultSelected = dest.selected = src.defaultSelected;
5474
5475 // IE6-8 fails to set the defaultValue to the correct value when
5476 // cloning other types of input fields
5477 } else if ( nodeName === "input" || nodeName === "textarea" ) {
5478 dest.defaultValue = src.defaultValue;
5479 }
5480 }
5481
5482 jQuery.extend({
5483 clone: function( elem, dataAndEvents, deepDataAndEvents ) {
5484 var destElements, node, clone, i, srcElements,
5485 inPage = jQuery.contains( elem.ownerDocument, elem );
5486
5487 if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
5488 clone = elem.cloneNode( true );
5489
5490 // IE<=8 does not properly clone detached, unknown element nodes
5491 } else {
5492 fragmentDiv.innerHTML = elem.outerHTML;
5493 fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
5494 }
5495
5496 if ( (!support.noCloneEvent || !support.noCloneChecked) &&
5497 (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
5498
5499 // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2
5500 destElements = getAll( clone );
5501 srcElements = getAll( elem );
5502
5503 // Fix all IE cloning issues
5504 for ( i = 0; (node = srcElements[i]) != null; ++i ) {
5505 // Ensure that the destination node is not null; Fixes #9587
5506 if ( destElements[i] ) {
5507 fixCloneNodeIssues( node, destElements[i] );
5508 }
5509 }
5510 }
5511
5512 // Copy the events from the original to the clone
5513 if ( dataAndEvents ) {
5514 if ( deepDataAndEvents ) {
5515 srcElements = srcElements || getAll( elem );
5516 destElements = destElements || getAll( clone );
5517
5518 for ( i = 0; (node = srcElements[i]) != null; i++ ) {
5519 cloneCopyEvent( node, destElements[i] );
5520 }
5521 } else {
5522 cloneCopyEvent( elem, clone );
5523 }
5524 }
5525
5526 // Preserve script evaluation history
5527 destElements = getAll( clone, "script" );
5528 if ( destElements.length > 0 ) {
5529 setGlobalEval( destElements, !inPage && getAll( elem, "script" ) );
5530 }
5531
5532 destElements = srcElements = node = null;
5533
5534 // Return the cloned set
5535 return clone;
5536 },
5537
5538 buildFragment: function( elems, context, scripts, selection ) {
5539 var j, elem, contains,
5540 tmp, tag, tbody, wrap,
5541 l = elems.length,
5542
5543 // Ensure a safe fragment
5544 safe = createSafeFragment( context ),
5545
5546 nodes = [],
5547 i = 0;
5548
5549 for ( ; i < l; i++ ) {
5550 elem = elems[ i ];
5551
5552 if ( elem || elem === 0 ) {
5553
5554 // Add nodes directly
5555 if ( jQuery.type( elem ) === "object" ) {
5556 jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem );
5557
5558 // Convert non-html into a text node
5559 } else if ( !rhtml.test( elem ) ) {
5560 nodes.push( context.createTextNode( elem ) );
5561
5562 // Convert html into DOM nodes
5563 } else {
5564 tmp = tmp || safe.appendChild( context.createElement("div") );
5565
5566 // Deserialize a standard representation
5567 tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase();
5568 wrap = wrapMap[ tag ] || wrapMap._default;
5569
5570 tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2];
5571
5572 // Descend through wrappers to the right content
5573 j = wrap[0];
5574 while ( j-- ) {
5575 tmp = tmp.lastChild;
5576 }
5577
5578 // Manually add leading whitespace removed by IE
5579 if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
5580 nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) );
5581 }
5582
5583 // Remove IE's autoinserted <tbody> from table fragments
5584 if ( !support.tbody ) {
5585
5586 // String was a <table>, *may* have spurious <tbody>
5587 elem = tag === "table" && !rtbody.test( elem ) ?
5588 tmp.firstChild :
5589
5590 // String was a bare <thead> or <tfoot>
5591 wrap[1] === "<table>" && !rtbody.test( elem ) ?
5592 tmp :
5593 0;
5594
5595 j = elem && elem.childNodes.length;
5596 while ( j-- ) {
5597 if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) {
5598 elem.removeChild( tbody );
5599 }
5600 }
5601 }
5602
5603 jQuery.merge( nodes, tmp.childNodes );
5604
5605 // Fix #12392 for WebKit and IE > 9
5606 tmp.textContent = "";
5607
5608 // Fix #12392 for oldIE
5609 while ( tmp.firstChild ) {
5610 tmp.removeChild( tmp.firstChild );
5611 }
5612
5613 // Remember the top-level container for proper cleanup
5614 tmp = safe.lastChild;
5615 }
5616 }
5617 }
5618
5619 // Fix #11356: Clear elements from fragment
5620 if ( tmp ) {
5621 safe.removeChild( tmp );
5622 }
5623
5624 // Reset defaultChecked for any radios and checkboxes
5625 // about to be appended to the DOM in IE 6/7 (#8060)
5626 if ( !support.appendChecked ) {
5627 jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked );
5628 }
5629
5630 i = 0;
5631 while ( (elem = nodes[ i++ ]) ) {
5632
5633 // #4087 - If origin and destination elements are the same, and this is
5634 // that element, do not do anything
5635 if ( selection && jQuery.inArray( elem, selection ) !== -1 ) {
5636 continue;
5637 }
5638
5639 contains = jQuery.contains( elem.ownerDocument, elem );
5640
5641 // Append to fragment
5642 tmp = getAll( safe.appendChild( elem ), "script" );
5643
5644 // Preserve script evaluation history
5645 if ( contains ) {
5646 setGlobalEval( tmp );
5647 }
5648
5649 // Capture executables
5650 if ( scripts ) {
5651 j = 0;
5652 while ( (elem = tmp[ j++ ]) ) {
5653 if ( rscriptType.test( elem.type || "" ) ) {
5654 scripts.push( elem );
5655 }
5656 }
5657 }
5658 }
5659
5660 tmp = null;
5661
5662 return safe;
5663 },
5664
5665 cleanData: function( elems, /* internal */ acceptData ) {
5666 var elem, type, id, data,
5667 i = 0,
5668 internalKey = jQuery.expando,
5669 cache = jQuery.cache,
5670 deleteExpando = support.deleteExpando,
5671 special = jQuery.event.special;
5672
5673 for ( ; (elem = elems[i]) != null; i++ ) {
5674 if ( acceptData || jQuery.acceptData( elem ) ) {
5675
5676 id = elem[ internalKey ];
5677 data = id && cache[ id ];
5678
5679 if ( data ) {
5680 if ( data.events ) {
5681 for ( type in data.events ) {
5682 if ( special[ type ] ) {
5683 jQuery.event.remove( elem, type );
5684
5685 // This is a shortcut to avoid jQuery.event.remove's overhead
5686 } else {
5687 jQuery.removeEvent( elem, type, data.handle );
5688 }
5689 }
5690 }
5691
5692 // Remove cache only if it was not already removed by jQuery.event.remove
5693 if ( cache[ id ] ) {
5694
5695 delete cache[ id ];
5696
5697 // IE does not allow us to delete expando properties from nodes,
5698 // nor does it have a removeAttribute function on Document nodes;
5699 // we must handle all of these cases
5700 if ( deleteExpando ) {
5701 delete elem[ internalKey ];
5702
5703 } else if ( typeof elem.removeAttribute !== strundefined ) {
5704 elem.removeAttribute( internalKey );
5705
5706 } else {
5707 elem[ internalKey ] = null;
5708 }
5709
5710 deletedIds.push( id );
5711 }
5712 }
5713 }
5714 }
5715 }
5716 });
5717
5718 jQuery.fn.extend({
5719 text: function( value ) {
5720 return access( this, function( value ) {
5721 return value === undefined ?
5722 jQuery.text( this ) :
5723 this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
5724 }, null, value, arguments.length );
5725 },
5726
5727 append: function() {
5728 return this.domManip( arguments, function( elem ) {
5729 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5730 var target = manipulationTarget( this, elem );
5731 target.appendChild( elem );
5732 }
5733 });
5734 },
5735
5736 prepend: function() {
5737 return this.domManip( arguments, function( elem ) {
5738 if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) {
5739 var target = manipulationTarget( this, elem );
5740 target.insertBefore( elem, target.firstChild );
5741 }
5742 });
5743 },
5744
5745 before: function() {
5746 return this.domManip( arguments, function( elem ) {
5747 if ( this.parentNode ) {
5748 this.parentNode.insertBefore( elem, this );
5749 }
5750 });
5751 },
5752
5753 after: function() {
5754 return this.domManip( arguments, function( elem ) {
5755 if ( this.parentNode ) {
5756 this.parentNode.insertBefore( elem, this.nextSibling );
5757 }
5758 });
5759 },
5760
5761 remove: function( selector, keepData /* Internal Use Only */ ) {
5762 var elem,
5763 elems = selector ? jQuery.filter( selector, this ) : this,
5764 i = 0;
5765
5766 for ( ; (elem = elems[i]) != null; i++ ) {
5767
5768 if ( !keepData && elem.nodeType === 1 ) {
5769 jQuery.cleanData( getAll( elem ) );
5770 }
5771
5772 if ( elem.parentNode ) {
5773 if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) {
5774 setGlobalEval( getAll( elem, "script" ) );
5775 }
5776 elem.parentNode.removeChild( elem );
5777 }
5778 }
5779
5780 return this;
5781 },
5782
5783 empty: function() {
5784 var elem,
5785 i = 0;
5786
5787 for ( ; (elem = this[i]) != null; i++ ) {
5788 // Remove element nodes and prevent memory leaks
5789 if ( elem.nodeType === 1 ) {
5790 jQuery.cleanData( getAll( elem, false ) );
5791 }
5792
5793 // Remove any remaining nodes
5794 while ( elem.firstChild ) {
5795 elem.removeChild( elem.firstChild );
5796 }
5797
5798 // If this is a select, ensure that it displays empty (#12336)
5799 // Support: IE<9
5800 if ( elem.options && jQuery.nodeName( elem, "select" ) ) {
5801 elem.options.length = 0;
5802 }
5803 }
5804
5805 return this;
5806 },
5807
5808 clone: function( dataAndEvents, deepDataAndEvents ) {
5809 dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
5810 deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
5811
5812 return this.map(function() {
5813 return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
5814 });
5815 },
5816
5817 html: function( value ) {
5818 return access( this, function( value ) {
5819 var elem = this[ 0 ] || {},
5820 i = 0,
5821 l = this.length;
5822
5823 if ( value === undefined ) {
5824 return elem.nodeType === 1 ?
5825 elem.innerHTML.replace( rinlinejQuery, "" ) :
5826 undefined;
5827 }
5828
5829 // See if we can take a shortcut and just use innerHTML
5830 if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
5831 ( support.htmlSerialize || !rnoshimcache.test( value ) ) &&
5832 ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
5833 !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) {
5834
5835 value = value.replace( rxhtmlTag, "<$1></$2>" );
5836
5837 try {
5838 for (; i < l; i++ ) {
5839 // Remove element nodes and prevent memory leaks
5840 elem = this[i] || {};
5841 if ( elem.nodeType === 1 ) {
5842 jQuery.cleanData( getAll( elem, false ) );
5843 elem.innerHTML = value;
5844 }
5845 }
5846
5847 elem = 0;
5848
5849 // If using innerHTML throws an exception, use the fallback method
5850 } catch(e) {}
5851 }
5852
5853 if ( elem ) {
5854 this.empty().append( value );
5855 }
5856 }, null, value, arguments.length );
5857 },
5858
5859 replaceWith: function() {
5860 var arg = arguments[ 0 ];
5861
5862 // Make the changes, replacing each context element with the new content
5863 this.domManip( arguments, function( elem ) {
5864 arg = this.parentNode;
5865
5866 jQuery.cleanData( getAll( this ) );
5867
5868 if ( arg ) {
5869 arg.replaceChild( elem, this );
5870 }
5871 });
5872
5873 // Force removal if there was no new content (e.g., from empty arguments)
5874 return arg && (arg.length || arg.nodeType) ? this : this.remove();
5875 },
5876
5877 detach: function( selector ) {
5878 return this.remove( selector, true );
5879 },
5880
5881 domManip: function( args, callback ) {
5882
5883 // Flatten any nested arrays
5884 args = concat.apply( [], args );
5885
5886 var first, node, hasScripts,
5887 scripts, doc, fragment,
5888 i = 0,
5889 l = this.length,
5890 set = this,
5891 iNoClone = l - 1,
5892 value = args[0],
5893 isFunction = jQuery.isFunction( value );
5894
5895 // We can't cloneNode fragments that contain checked, in WebKit
5896 if ( isFunction ||
5897 ( l > 1 && typeof value === "string" &&
5898 !support.checkClone && rchecked.test( value ) ) ) {
5899 return this.each(function( index ) {
5900 var self = set.eq( index );
5901 if ( isFunction ) {
5902 args[0] = value.call( this, index, self.html() );
5903 }
5904 self.domManip( args, callback );
5905 });
5906 }
5907
5908 if ( l ) {
5909 fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this );
5910 first = fragment.firstChild;
5911
5912 if ( fragment.childNodes.length === 1 ) {
5913 fragment = first;
5914 }
5915
5916 if ( first ) {
5917 scripts = jQuery.map( getAll( fragment, "script" ), disableScript );
5918 hasScripts = scripts.length;
5919
5920 // Use the original fragment for the last item instead of the first because it can end up
5921 // being emptied incorrectly in certain situations (#8070).
5922 for ( ; i < l; i++ ) {
5923 node = fragment;
5924
5925 if ( i !== iNoClone ) {
5926 node = jQuery.clone( node, true, true );
5927
5928 // Keep references to cloned scripts for later restoration
5929 if ( hasScripts ) {
5930 jQuery.merge( scripts, getAll( node, "script" ) );
5931 }
5932 }
5933
5934 callback.call( this[i], node, i );
5935 }
5936
5937 if ( hasScripts ) {
5938 doc = scripts[ scripts.length - 1 ].ownerDocument;
5939
5940 // Reenable scripts
5941 jQuery.map( scripts, restoreScript );
5942
5943 // Evaluate executable scripts on first document insertion
5944 for ( i = 0; i < hasScripts; i++ ) {
5945 node = scripts[ i ];
5946 if ( rscriptType.test( node.type || "" ) &&
5947 !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) {
5948
5949 if ( node.src ) {
5950 // Optional AJAX dependency, but won't run scripts if not present
5951 if ( jQuery._evalUrl ) {
5952 jQuery._evalUrl( node.src );
5953 }
5954 } else {
5955 jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) );
5956 }
5957 }
5958 }
5959 }
5960
5961 // Fix #11809: Avoid leaking memory
5962 fragment = first = null;
5963 }
5964 }
5965
5966 return this;
5967 }
5968 });
5969
5970 jQuery.each({
5971 appendTo: "append",
5972 prependTo: "prepend",
5973 insertBefore: "before",
5974 insertAfter: "after",
5975 replaceAll: "replaceWith"
5976 }, function( name, original ) {
5977 jQuery.fn[ name ] = function( selector ) {
5978 var elems,
5979 i = 0,
5980 ret = [],
5981 insert = jQuery( selector ),
5982 last = insert.length - 1;
5983
5984 for ( ; i <= last; i++ ) {
5985 elems = i === last ? this : this.clone(true);
5986 jQuery( insert[i] )[ original ]( elems );
5987
5988 // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get()
5989 push.apply( ret, elems.get() );
5990 }
5991
5992 return this.pushStack( ret );
5993 };
5994 });
5995
5996
5997 var iframe,
5998 elemdisplay = {};
5999
6000 /**
6001 * Retrieve the actual display of a element
6002 * @param {String} name nodeName of the element
6003 * @param {Object} doc Document object
6004 */
6005 // Called only from within defaultDisplay
6006 function actualDisplay( name, doc ) {
6007 var style,
6008 elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ),
6009
6010 // getDefaultComputedStyle might be reliably used only on attached element
6011 display = window.getDefaultComputedStyle && ( style = window.getDefaultComputedStyle( elem[ 0 ] ) ) ?
6012
6013 // Use of this method is a temporary fix (more like optmization) until something better comes along,
6014 // since it was removed from specification and supported only in FF
6015 style.display : jQuery.css( elem[ 0 ], "display" );
6016
6017 // We don't have any data stored on the element,
6018 // so use "detach" method as fast way to get rid of the element
6019 elem.detach();
6020
6021 return display;
6022 }
6023
6024 /**
6025 * Try to determine the default display value of an element
6026 * @param {String} nodeName
6027 */
6028 function defaultDisplay( nodeName ) {
6029 var doc = document,
6030 display = elemdisplay[ nodeName ];
6031
6032 if ( !display ) {
6033 display = actualDisplay( nodeName, doc );
6034
6035 // If the simple way fails, read from inside an iframe
6036 if ( display === "none" || !display ) {
6037
6038 // Use the already-created iframe if possible
6039 iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement );
6040
6041 // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse
6042 doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document;
6043
6044 // Support: IE
6045 doc.write();
6046 doc.close();
6047
6048 display = actualDisplay( nodeName, doc );
6049 iframe.detach();
6050 }
6051
6052 // Store the correct default display
6053 elemdisplay[ nodeName ] = display;
6054 }
6055
6056 return display;
6057 }
6058
6059
6060 (function() {
6061 var shrinkWrapBlocksVal;
6062
6063 support.shrinkWrapBlocks = function() {
6064 if ( shrinkWrapBlocksVal != null ) {
6065 return shrinkWrapBlocksVal;
6066 }
6067
6068 // Will be changed later if needed.
6069 shrinkWrapBlocksVal = false;
6070
6071 // Minified: var b,c,d
6072 var div, body, container;
6073
6074 body = document.getElementsByTagName( "body" )[ 0 ];
6075 if ( !body || !body.style ) {
6076 // Test fired too early or in an unsupported environment, exit.
6077 return;
6078 }
6079
6080 // Setup
6081 div = document.createElement( "div" );
6082 container = document.createElement( "div" );
6083 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
6084 body.appendChild( container ).appendChild( div );
6085
6086 // Support: IE6
6087 // Check if elements with layout shrink-wrap their children
6088 if ( typeof div.style.zoom !== strundefined ) {
6089 // Reset CSS: box-sizing; display; margin; border
6090 div.style.cssText =
6091 // Support: Firefox<29, Android 2.3
6092 // Vendor-prefix box-sizing
6093 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6094 "box-sizing:content-box;display:block;margin:0;border:0;" +
6095 "padding:1px;width:1px;zoom:1";
6096 div.appendChild( document.createElement( "div" ) ).style.width = "5px";
6097 shrinkWrapBlocksVal = div.offsetWidth !== 3;
6098 }
6099
6100 body.removeChild( container );
6101
6102 return shrinkWrapBlocksVal;
6103 };
6104
6105 })();
6106 var rmargin = (/^margin/);
6107
6108 var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" );
6109
6110
6111
6112 var getStyles, curCSS,
6113 rposition = /^(top|right|bottom|left)$/;
6114
6115 if ( window.getComputedStyle ) {
6116 getStyles = function( elem ) {
6117 return elem.ownerDocument.defaultView.getComputedStyle( elem, null );
6118 };
6119
6120 curCSS = function( elem, name, computed ) {
6121 var width, minWidth, maxWidth, ret,
6122 style = elem.style;
6123
6124 computed = computed || getStyles( elem );
6125
6126 // getPropertyValue is only needed for .css('filter') in IE9, see #12537
6127 ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined;
6128
6129 if ( computed ) {
6130
6131 if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
6132 ret = jQuery.style( elem, name );
6133 }
6134
6135 // A tribute to the "awesome hack by Dean Edwards"
6136 // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
6137 // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
6138 // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
6139 if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
6140
6141 // Remember the original values
6142 width = style.width;
6143 minWidth = style.minWidth;
6144 maxWidth = style.maxWidth;
6145
6146 // Put in the new values to get a computed value out
6147 style.minWidth = style.maxWidth = style.width = ret;
6148 ret = computed.width;
6149
6150 // Revert the changed values
6151 style.width = width;
6152 style.minWidth = minWidth;
6153 style.maxWidth = maxWidth;
6154 }
6155 }
6156
6157 // Support: IE
6158 // IE returns zIndex value as an integer.
6159 return ret === undefined ?
6160 ret :
6161 ret + "";
6162 };
6163 } else if ( document.documentElement.currentStyle ) {
6164 getStyles = function( elem ) {
6165 return elem.currentStyle;
6166 };
6167
6168 curCSS = function( elem, name, computed ) {
6169 var left, rs, rsLeft, ret,
6170 style = elem.style;
6171
6172 computed = computed || getStyles( elem );
6173 ret = computed ? computed[ name ] : undefined;
6174
6175 // Avoid setting ret to empty string here
6176 // so we don't default to auto
6177 if ( ret == null && style && style[ name ] ) {
6178 ret = style[ name ];
6179 }
6180
6181 // From the awesome hack by Dean Edwards
6182 // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
6183
6184 // If we're not dealing with a regular pixel number
6185 // but a number that has a weird ending, we need to convert it to pixels
6186 // but not position css attributes, as those are proportional to the parent element instead
6187 // and we can't measure the parent instead because it might trigger a "stacking dolls" problem
6188 if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
6189
6190 // Remember the original values
6191 left = style.left;
6192 rs = elem.runtimeStyle;
6193 rsLeft = rs && rs.left;
6194
6195 // Put in the new values to get a computed value out
6196 if ( rsLeft ) {
6197 rs.left = elem.currentStyle.left;
6198 }
6199 style.left = name === "fontSize" ? "1em" : ret;
6200 ret = style.pixelLeft + "px";
6201
6202 // Revert the changed values
6203 style.left = left;
6204 if ( rsLeft ) {
6205 rs.left = rsLeft;
6206 }
6207 }
6208
6209 // Support: IE
6210 // IE returns zIndex value as an integer.
6211 return ret === undefined ?
6212 ret :
6213 ret + "" || "auto";
6214 };
6215 }
6216
6217
6218
6219
6220 function addGetHookIf( conditionFn, hookFn ) {
6221 // Define the hook, we'll check on the first run if it's really needed.
6222 return {
6223 get: function() {
6224 var condition = conditionFn();
6225
6226 if ( condition == null ) {
6227 // The test was not ready at this point; screw the hook this time
6228 // but check again when needed next time.
6229 return;
6230 }
6231
6232 if ( condition ) {
6233 // Hook not needed (or it's not possible to use it due to missing dependency),
6234 // remove it.
6235 // Since there are no other hooks for marginRight, remove the whole object.
6236 delete this.get;
6237 return;
6238 }
6239
6240 // Hook needed; redefine it so that the support test is not executed again.
6241
6242 return (this.get = hookFn).apply( this, arguments );
6243 }
6244 };
6245 }
6246
6247
6248 (function() {
6249 // Minified: var b,c,d,e,f,g, h,i
6250 var div, style, a, pixelPositionVal, boxSizingReliableVal,
6251 reliableHiddenOffsetsVal, reliableMarginRightVal;
6252
6253 // Setup
6254 div = document.createElement( "div" );
6255 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
6256 a = div.getElementsByTagName( "a" )[ 0 ];
6257 style = a && a.style;
6258
6259 // Finish early in limited (non-browser) environments
6260 if ( !style ) {
6261 return;
6262 }
6263
6264 style.cssText = "float:left;opacity:.5";
6265
6266 // Support: IE<9
6267 // Make sure that element opacity exists (as opposed to filter)
6268 support.opacity = style.opacity === "0.5";
6269
6270 // Verify style float existence
6271 // (IE uses styleFloat instead of cssFloat)
6272 support.cssFloat = !!style.cssFloat;
6273
6274 div.style.backgroundClip = "content-box";
6275 div.cloneNode( true ).style.backgroundClip = "";
6276 support.clearCloneStyle = div.style.backgroundClip === "content-box";
6277
6278 // Support: Firefox<29, Android 2.3
6279 // Vendor-prefix box-sizing
6280 support.boxSizing = style.boxSizing === "" || style.MozBoxSizing === "" ||
6281 style.WebkitBoxSizing === "";
6282
6283 jQuery.extend(support, {
6284 reliableHiddenOffsets: function() {
6285 if ( reliableHiddenOffsetsVal == null ) {
6286 computeStyleTests();
6287 }
6288 return reliableHiddenOffsetsVal;
6289 },
6290
6291 boxSizingReliable: function() {
6292 if ( boxSizingReliableVal == null ) {
6293 computeStyleTests();
6294 }
6295 return boxSizingReliableVal;
6296 },
6297
6298 pixelPosition: function() {
6299 if ( pixelPositionVal == null ) {
6300 computeStyleTests();
6301 }
6302 return pixelPositionVal;
6303 },
6304
6305 // Support: Android 2.3
6306 reliableMarginRight: function() {
6307 if ( reliableMarginRightVal == null ) {
6308 computeStyleTests();
6309 }
6310 return reliableMarginRightVal;
6311 }
6312 });
6313
6314 function computeStyleTests() {
6315 // Minified: var b,c,d,j
6316 var div, body, container, contents;
6317
6318 body = document.getElementsByTagName( "body" )[ 0 ];
6319 if ( !body || !body.style ) {
6320 // Test fired too early or in an unsupported environment, exit.
6321 return;
6322 }
6323
6324 // Setup
6325 div = document.createElement( "div" );
6326 container = document.createElement( "div" );
6327 container.style.cssText = "position:absolute;border:0;width:0;height:0;top:0;left:-9999px";
6328 body.appendChild( container ).appendChild( div );
6329
6330 div.style.cssText =
6331 // Support: Firefox<29, Android 2.3
6332 // Vendor-prefix box-sizing
6333 "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;" +
6334 "box-sizing:border-box;display:block;margin-top:1%;top:1%;" +
6335 "border:1px;padding:1px;width:4px;position:absolute";
6336
6337 // Support: IE<9
6338 // Assume reasonable values in the absence of getComputedStyle
6339 pixelPositionVal = boxSizingReliableVal = false;
6340 reliableMarginRightVal = true;
6341
6342 // Check for getComputedStyle so that this code is not run in IE<9.
6343 if ( window.getComputedStyle ) {
6344 pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
6345 boxSizingReliableVal =
6346 ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
6347
6348 // Support: Android 2.3
6349 // Div with explicit width and no margin-right incorrectly
6350 // gets computed margin-right based on width of container (#3333)
6351 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6352 contents = div.appendChild( document.createElement( "div" ) );
6353
6354 // Reset CSS: box-sizing; display; margin; border; padding
6355 contents.style.cssText = div.style.cssText =
6356 // Support: Firefox<29, Android 2.3
6357 // Vendor-prefix box-sizing
6358 "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;" +
6359 "box-sizing:content-box;display:block;margin:0;border:0;padding:0";
6360 contents.style.marginRight = contents.style.width = "0";
6361 div.style.width = "1px";
6362
6363 reliableMarginRightVal =
6364 !parseFloat( ( window.getComputedStyle( contents, null ) || {} ).marginRight );
6365 }
6366
6367 // Support: IE8
6368 // Check if table cells still have offsetWidth/Height when they are set
6369 // to display:none and there are still other visible table cells in a
6370 // table row; if so, offsetWidth/Height are not reliable for use when
6371 // determining if an element has been hidden directly using
6372 // display:none (it is still safe to use offsets if a parent element is
6373 // hidden; don safety goggles and see bug #4512 for more information).
6374 div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
6375 contents = div.getElementsByTagName( "td" );
6376 contents[ 0 ].style.cssText = "margin:0;border:0;padding:0;display:none";
6377 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6378 if ( reliableHiddenOffsetsVal ) {
6379 contents[ 0 ].style.display = "";
6380 contents[ 1 ].style.display = "none";
6381 reliableHiddenOffsetsVal = contents[ 0 ].offsetHeight === 0;
6382 }
6383
6384 body.removeChild( container );
6385 }
6386
6387 })();
6388
6389
6390 // A method for quickly swapping in/out CSS properties to get correct calculations.
6391 jQuery.swap = function( elem, options, callback, args ) {
6392 var ret, name,
6393 old = {};
6394
6395 // Remember the old values, and insert the new ones
6396 for ( name in options ) {
6397 old[ name ] = elem.style[ name ];
6398 elem.style[ name ] = options[ name ];
6399 }
6400
6401 ret = callback.apply( elem, args || [] );
6402
6403 // Revert the old values
6404 for ( name in options ) {
6405 elem.style[ name ] = old[ name ];
6406 }
6407
6408 return ret;
6409 };
6410
6411
6412 var
6413 ralpha = /alpha\([^)]*\)/i,
6414 ropacity = /opacity\s*=\s*([^)]*)/,
6415
6416 // swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
6417 // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
6418 rdisplayswap = /^(none|table(?!-c[ea]).+)/,
6419 rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ),
6420 rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ),
6421
6422 cssShow = { position: "absolute", visibility: "hidden", display: "block" },
6423 cssNormalTransform = {
6424 letterSpacing: "0",
6425 fontWeight: "400"
6426 },
6427
6428 cssPrefixes = [ "Webkit", "O", "Moz", "ms" ];
6429
6430
6431 // return a css property mapped to a potentially vendor prefixed property
6432 function vendorPropName( style, name ) {
6433
6434 // shortcut for names that are not vendor prefixed
6435 if ( name in style ) {
6436 return name;
6437 }
6438
6439 // check for vendor prefixed names
6440 var capName = name.charAt(0).toUpperCase() + name.slice(1),
6441 origName = name,
6442 i = cssPrefixes.length;
6443
6444 while ( i-- ) {
6445 name = cssPrefixes[ i ] + capName;
6446 if ( name in style ) {
6447 return name;
6448 }
6449 }
6450
6451 return origName;
6452 }
6453
6454 function showHide( elements, show ) {
6455 var display, elem, hidden,
6456 values = [],
6457 index = 0,
6458 length = elements.length;
6459
6460 for ( ; index < length; index++ ) {
6461 elem = elements[ index ];
6462 if ( !elem.style ) {
6463 continue;
6464 }
6465
6466 values[ index ] = jQuery._data( elem, "olddisplay" );
6467 display = elem.style.display;
6468 if ( show ) {
6469 // Reset the inline display of this element to learn if it is
6470 // being hidden by cascaded rules or not
6471 if ( !values[ index ] && display === "none" ) {
6472 elem.style.display = "";
6473 }
6474
6475 // Set elements which have been overridden with display: none
6476 // in a stylesheet to whatever the default browser style is
6477 // for such an element
6478 if ( elem.style.display === "" && isHidden( elem ) ) {
6479 values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) );
6480 }
6481 } else {
6482 hidden = isHidden( elem );
6483
6484 if ( display && display !== "none" || !hidden ) {
6485 jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) );
6486 }
6487 }
6488 }
6489
6490 // Set the display of most of the elements in a second loop
6491 // to avoid the constant reflow
6492 for ( index = 0; index < length; index++ ) {
6493 elem = elements[ index ];
6494 if ( !elem.style ) {
6495 continue;
6496 }
6497 if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
6498 elem.style.display = show ? values[ index ] || "" : "none";
6499 }
6500 }
6501
6502 return elements;
6503 }
6504
6505 function setPositiveNumber( elem, value, subtract ) {
6506 var matches = rnumsplit.exec( value );
6507 return matches ?
6508 // Guard against undefined "subtract", e.g., when used as in cssHooks
6509 Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
6510 value;
6511 }
6512
6513 function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) {
6514 var i = extra === ( isBorderBox ? "border" : "content" ) ?
6515 // If we already have the right measurement, avoid augmentation
6516 4 :
6517 // Otherwise initialize for horizontal or vertical properties
6518 name === "width" ? 1 : 0,
6519
6520 val = 0;
6521
6522 for ( ; i < 4; i += 2 ) {
6523 // both box models exclude margin, so add it if we want it
6524 if ( extra === "margin" ) {
6525 val += jQuery.css( elem, extra + cssExpand[ i ], true, styles );
6526 }
6527
6528 if ( isBorderBox ) {
6529 // border-box includes padding, so remove it if we want content
6530 if ( extra === "content" ) {
6531 val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6532 }
6533
6534 // at this point, extra isn't border nor margin, so remove border
6535 if ( extra !== "margin" ) {
6536 val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6537 }
6538 } else {
6539 // at this point, extra isn't content, so add padding
6540 val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles );
6541
6542 // at this point, extra isn't content nor padding, so add border
6543 if ( extra !== "padding" ) {
6544 val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles );
6545 }
6546 }
6547 }
6548
6549 return val;
6550 }
6551
6552 function getWidthOrHeight( elem, name, extra ) {
6553
6554 // Start with offset property, which is equivalent to the border-box value
6555 var valueIsBorderBox = true,
6556 val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
6557 styles = getStyles( elem ),
6558 isBorderBox = support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box";
6559
6560 // some non-html elements return undefined for offsetWidth, so check for null/undefined
6561 // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
6562 // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
6563 if ( val <= 0 || val == null ) {
6564 // Fall back to computed then uncomputed css if necessary
6565 val = curCSS( elem, name, styles );
6566 if ( val < 0 || val == null ) {
6567 val = elem.style[ name ];
6568 }
6569
6570 // Computed unit is not pixels. Stop here and return.
6571 if ( rnumnonpx.test(val) ) {
6572 return val;
6573 }
6574
6575 // we need the check for style in case a browser which returns unreliable values
6576 // for getComputedStyle silently falls back to the reliable elem.style
6577 valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] );
6578
6579 // Normalize "", auto, and prepare for extra
6580 val = parseFloat( val ) || 0;
6581 }
6582
6583 // use the active box-sizing model to add/subtract irrelevant styles
6584 return ( val +
6585 augmentWidthOrHeight(
6586 elem,
6587 name,
6588 extra || ( isBorderBox ? "border" : "content" ),
6589 valueIsBorderBox,
6590 styles
6591 )
6592 ) + "px";
6593 }
6594
6595 jQuery.extend({
6596 // Add in style property hooks for overriding the default
6597 // behavior of getting and setting a style property
6598 cssHooks: {
6599 opacity: {
6600 get: function( elem, computed ) {
6601 if ( computed ) {
6602 // We should always get a number back from opacity
6603 var ret = curCSS( elem, "opacity" );
6604 return ret === "" ? "1" : ret;
6605 }
6606 }
6607 }
6608 },
6609
6610 // Don't automatically add "px" to these possibly-unitless properties
6611 cssNumber: {
6612 "columnCount": true,
6613 "fillOpacity": true,
6614 "flexGrow": true,
6615 "flexShrink": true,
6616 "fontWeight": true,
6617 "lineHeight": true,
6618 "opacity": true,
6619 "order": true,
6620 "orphans": true,
6621 "widows": true,
6622 "zIndex": true,
6623 "zoom": true
6624 },
6625
6626 // Add in properties whose names you wish to fix before
6627 // setting or getting the value
6628 cssProps: {
6629 // normalize float css property
6630 "float": support.cssFloat ? "cssFloat" : "styleFloat"
6631 },
6632
6633 // Get and set the style property on a DOM Node
6634 style: function( elem, name, value, extra ) {
6635 // Don't set styles on text and comment nodes
6636 if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
6637 return;
6638 }
6639
6640 // Make sure that we're working with the right name
6641 var ret, type, hooks,
6642 origName = jQuery.camelCase( name ),
6643 style = elem.style;
6644
6645 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
6646
6647 // gets hook for the prefixed version
6648 // followed by the unprefixed version
6649 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6650
6651 // Check if we're setting a value
6652 if ( value !== undefined ) {
6653 type = typeof value;
6654
6655 // convert relative number strings (+= or -=) to relative numbers. #7345
6656 if ( type === "string" && (ret = rrelNum.exec( value )) ) {
6657 value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
6658 // Fixes bug #9237
6659 type = "number";
6660 }
6661
6662 // Make sure that null and NaN values aren't set. See: #7116
6663 if ( value == null || value !== value ) {
6664 return;
6665 }
6666
6667 // If a number was passed in, add 'px' to the (except for certain CSS properties)
6668 if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
6669 value += "px";
6670 }
6671
6672 // Fixes #8908, it can be done more correctly by specifing setters in cssHooks,
6673 // but it would mean to define eight (for every problematic property) identical functions
6674 if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) {
6675 style[ name ] = "inherit";
6676 }
6677
6678 // If a hook was provided, use that value, otherwise just set the specified value
6679 if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
6680
6681 // Support: IE
6682 // Swallow errors from 'invalid' CSS values (#5509)
6683 try {
6684 style[ name ] = value;
6685 } catch(e) {}
6686 }
6687
6688 } else {
6689 // If a hook was provided get the non-computed value from there
6690 if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
6691 return ret;
6692 }
6693
6694 // Otherwise just get the value from the style object
6695 return style[ name ];
6696 }
6697 },
6698
6699 css: function( elem, name, extra, styles ) {
6700 var num, val, hooks,
6701 origName = jQuery.camelCase( name );
6702
6703 // Make sure that we're working with the right name
6704 name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
6705
6706 // gets hook for the prefixed version
6707 // followed by the unprefixed version
6708 hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
6709
6710 // If a hook was provided get the computed value from there
6711 if ( hooks && "get" in hooks ) {
6712 val = hooks.get( elem, true, extra );
6713 }
6714
6715 // Otherwise, if a way to get the computed value exists, use that
6716 if ( val === undefined ) {
6717 val = curCSS( elem, name, styles );
6718 }
6719
6720 //convert "normal" to computed value
6721 if ( val === "normal" && name in cssNormalTransform ) {
6722 val = cssNormalTransform[ name ];
6723 }
6724
6725 // Return, converting to number if forced or a qualifier was provided and val looks numeric
6726 if ( extra === "" || extra ) {
6727 num = parseFloat( val );
6728 return extra === true || jQuery.isNumeric( num ) ? num || 0 : val;
6729 }
6730 return val;
6731 }
6732 });
6733
6734 jQuery.each([ "height", "width" ], function( i, name ) {
6735 jQuery.cssHooks[ name ] = {
6736 get: function( elem, computed, extra ) {
6737 if ( computed ) {
6738 // certain elements can have dimension info if we invisibly show them
6739 // however, it must have a current display style that would benefit from this
6740 return rdisplayswap.test( jQuery.css( elem, "display" ) ) && elem.offsetWidth === 0 ?
6741 jQuery.swap( elem, cssShow, function() {
6742 return getWidthOrHeight( elem, name, extra );
6743 }) :
6744 getWidthOrHeight( elem, name, extra );
6745 }
6746 },
6747
6748 set: function( elem, value, extra ) {
6749 var styles = extra && getStyles( elem );
6750 return setPositiveNumber( elem, value, extra ?
6751 augmentWidthOrHeight(
6752 elem,
6753 name,
6754 extra,
6755 support.boxSizing && jQuery.css( elem, "boxSizing", false, styles ) === "border-box",
6756 styles
6757 ) : 0
6758 );
6759 }
6760 };
6761 });
6762
6763 if ( !support.opacity ) {
6764 jQuery.cssHooks.opacity = {
6765 get: function( elem, computed ) {
6766 // IE uses filters for opacity
6767 return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
6768 ( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
6769 computed ? "1" : "";
6770 },
6771
6772 set: function( elem, value ) {
6773 var style = elem.style,
6774 currentStyle = elem.currentStyle,
6775 opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
6776 filter = currentStyle && currentStyle.filter || style.filter || "";
6777
6778 // IE has trouble with opacity if it does not have layout
6779 // Force it by setting the zoom level
6780 style.zoom = 1;
6781
6782 // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
6783 // if value === "", then remove inline opacity #12685
6784 if ( ( value >= 1 || value === "" ) &&
6785 jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
6786 style.removeAttribute ) {
6787
6788 // Setting style.filter to null, "" & " " still leave "filter:" in the cssText
6789 // if "filter:" is present at all, clearType is disabled, we want to avoid this
6790 // style.removeAttribute is IE Only, but so apparently is this code path...
6791 style.removeAttribute( "filter" );
6792
6793 // if there is no filter style applied in a css rule or unset inline opacity, we are done
6794 if ( value === "" || currentStyle && !currentStyle.filter ) {
6795 return;
6796 }
6797 }
6798
6799 // otherwise, set new filter values
6800 style.filter = ralpha.test( filter ) ?
6801 filter.replace( ralpha, opacity ) :
6802 filter + " " + opacity;
6803 }
6804 };
6805 }
6806
6807 jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight,
6808 function( elem, computed ) {
6809 if ( computed ) {
6810 // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
6811 // Work around by temporarily setting element display to inline-block
6812 return jQuery.swap( elem, { "display": "inline-block" },
6813 curCSS, [ elem, "marginRight" ] );
6814 }
6815 }
6816 );
6817
6818 // These hooks are used by animate to expand properties
6819 jQuery.each({
6820 margin: "",
6821 padding: "",
6822 border: "Width"
6823 }, function( prefix, suffix ) {
6824 jQuery.cssHooks[ prefix + suffix ] = {
6825 expand: function( value ) {
6826 var i = 0,
6827 expanded = {},
6828
6829 // assumes a single number if not a string
6830 parts = typeof value === "string" ? value.split(" ") : [ value ];
6831
6832 for ( ; i < 4; i++ ) {
6833 expanded[ prefix + cssExpand[ i ] + suffix ] =
6834 parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
6835 }
6836
6837 return expanded;
6838 }
6839 };
6840
6841 if ( !rmargin.test( prefix ) ) {
6842 jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
6843 }
6844 });
6845
6846 jQuery.fn.extend({
6847 css: function( name, value ) {
6848 return access( this, function( elem, name, value ) {
6849 var styles, len,
6850 map = {},
6851 i = 0;
6852
6853 if ( jQuery.isArray( name ) ) {
6854 styles = getStyles( elem );
6855 len = name.length;
6856
6857 for ( ; i < len; i++ ) {
6858 map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles );
6859 }
6860
6861 return map;
6862 }
6863
6864 return value !== undefined ?
6865 jQuery.style( elem, name, value ) :
6866 jQuery.css( elem, name );
6867 }, name, value, arguments.length > 1 );
6868 },
6869 show: function() {
6870 return showHide( this, true );
6871 },
6872 hide: function() {
6873 return showHide( this );
6874 },
6875 toggle: function( state ) {
6876 if ( typeof state === "boolean" ) {
6877 return state ? this.show() : this.hide();
6878 }
6879
6880 return this.each(function() {
6881 if ( isHidden( this ) ) {
6882 jQuery( this ).show();
6883 } else {
6884 jQuery( this ).hide();
6885 }
6886 });
6887 }
6888 });
6889
6890
6891 function Tween( elem, options, prop, end, easing ) {
6892 return new Tween.prototype.init( elem, options, prop, end, easing );
6893 }
6894 jQuery.Tween = Tween;
6895
6896 Tween.prototype = {
6897 constructor: Tween,
6898 init: function( elem, options, prop, end, easing, unit ) {
6899 this.elem = elem;
6900 this.prop = prop;
6901 this.easing = easing || "swing";
6902 this.options = options;
6903 this.start = this.now = this.cur();
6904 this.end = end;
6905 this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
6906 },
6907 cur: function() {
6908 var hooks = Tween.propHooks[ this.prop ];
6909
6910 return hooks && hooks.get ?
6911 hooks.get( this ) :
6912 Tween.propHooks._default.get( this );
6913 },
6914 run: function( percent ) {
6915 var eased,
6916 hooks = Tween.propHooks[ this.prop ];
6917
6918 if ( this.options.duration ) {
6919 this.pos = eased = jQuery.easing[ this.easing ](
6920 percent, this.options.duration * percent, 0, 1, this.options.duration
6921 );
6922 } else {
6923 this.pos = eased = percent;
6924 }
6925 this.now = ( this.end - this.start ) * eased + this.start;
6926
6927 if ( this.options.step ) {
6928 this.options.step.call( this.elem, this.now, this );
6929 }
6930
6931 if ( hooks && hooks.set ) {
6932 hooks.set( this );
6933 } else {
6934 Tween.propHooks._default.set( this );
6935 }
6936 return this;
6937 }
6938 };
6939
6940 Tween.prototype.init.prototype = Tween.prototype;
6941
6942 Tween.propHooks = {
6943 _default: {
6944 get: function( tween ) {
6945 var result;
6946
6947 if ( tween.elem[ tween.prop ] != null &&
6948 (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
6949 return tween.elem[ tween.prop ];
6950 }
6951
6952 // passing an empty string as a 3rd parameter to .css will automatically
6953 // attempt a parseFloat and fallback to a string if the parse fails
6954 // so, simple values such as "10px" are parsed to Float.
6955 // complex values such as "rotate(1rad)" are returned as is.
6956 result = jQuery.css( tween.elem, tween.prop, "" );
6957 // Empty strings, null, undefined and "auto" are converted to 0.
6958 return !result || result === "auto" ? 0 : result;
6959 },
6960 set: function( tween ) {
6961 // use step hook for back compat - use cssHook if its there - use .style if its
6962 // available and use plain properties where available
6963 if ( jQuery.fx.step[ tween.prop ] ) {
6964 jQuery.fx.step[ tween.prop ]( tween );
6965 } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
6966 jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
6967 } else {
6968 tween.elem[ tween.prop ] = tween.now;
6969 }
6970 }
6971 }
6972 };
6973
6974 // Support: IE <=9
6975 // Panic based approach to setting things on disconnected nodes
6976
6977 Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
6978 set: function( tween ) {
6979 if ( tween.elem.nodeType && tween.elem.parentNode ) {
6980 tween.elem[ tween.prop ] = tween.now;
6981 }
6982 }
6983 };
6984
6985 jQuery.easing = {
6986 linear: function( p ) {
6987 return p;
6988 },
6989 swing: function( p ) {
6990 return 0.5 - Math.cos( p * Math.PI ) / 2;
6991 }
6992 };
6993
6994 jQuery.fx = Tween.prototype.init;
6995
6996 // Back Compat <1.8 extension point
6997 jQuery.fx.step = {};
6998
6999
7000
7001
7002 var
7003 fxNow, timerId,
7004 rfxtypes = /^(?:toggle|show|hide)$/,
7005 rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ),
7006 rrun = /queueHooks$/,
7007 animationPrefilters = [ defaultPrefilter ],
7008 tweeners = {
7009 "*": [ function( prop, value ) {
7010 var tween = this.createTween( prop, value ),
7011 target = tween.cur(),
7012 parts = rfxnum.exec( value ),
7013 unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ),
7014
7015 // Starting value computation is required for potential unit mismatches
7016 start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) &&
7017 rfxnum.exec( jQuery.css( tween.elem, prop ) ),
7018 scale = 1,
7019 maxIterations = 20;
7020
7021 if ( start && start[ 3 ] !== unit ) {
7022 // Trust units reported by jQuery.css
7023 unit = unit || start[ 3 ];
7024
7025 // Make sure we update the tween properties later on
7026 parts = parts || [];
7027
7028 // Iteratively approximate from a nonzero starting point
7029 start = +target || 1;
7030
7031 do {
7032 // If previous iteration zeroed out, double until we get *something*
7033 // Use a string for doubling factor so we don't accidentally see scale as unchanged below
7034 scale = scale || ".5";
7035
7036 // Adjust and apply
7037 start = start / scale;
7038 jQuery.style( tween.elem, prop, start + unit );
7039
7040 // Update scale, tolerating zero or NaN from tween.cur()
7041 // And breaking the loop if scale is unchanged or perfect, or if we've just had enough
7042 } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
7043 }
7044
7045 // Update tween properties
7046 if ( parts ) {
7047 start = tween.start = +start || +target || 0;
7048 tween.unit = unit;
7049 // If a +=/-= token was provided, we're doing a relative animation
7050 tween.end = parts[ 1 ] ?
7051 start + ( parts[ 1 ] + 1 ) * parts[ 2 ] :
7052 +parts[ 2 ];
7053 }
7054
7055 return tween;
7056 } ]
7057 };
7058
7059 // Animations created synchronously will run synchronously
7060 function createFxNow() {
7061 setTimeout(function() {
7062 fxNow = undefined;
7063 });
7064 return ( fxNow = jQuery.now() );
7065 }
7066
7067 // Generate parameters to create a standard animation
7068 function genFx( type, includeWidth ) {
7069 var which,
7070 attrs = { height: type },
7071 i = 0;
7072
7073 // if we include width, step value is 1 to do all cssExpand values,
7074 // if we don't include width, step value is 2 to skip over Left and Right
7075 includeWidth = includeWidth ? 1 : 0;
7076 for ( ; i < 4 ; i += 2 - includeWidth ) {
7077 which = cssExpand[ i ];
7078 attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
7079 }
7080
7081 if ( includeWidth ) {
7082 attrs.opacity = attrs.width = type;
7083 }
7084
7085 return attrs;
7086 }
7087
7088 function createTween( value, prop, animation ) {
7089 var tween,
7090 collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
7091 index = 0,
7092 length = collection.length;
7093 for ( ; index < length; index++ ) {
7094 if ( (tween = collection[ index ].call( animation, prop, value )) ) {
7095
7096 // we're done with this property
7097 return tween;
7098 }
7099 }
7100 }
7101
7102 function defaultPrefilter( elem, props, opts ) {
7103 /* jshint validthis: true */
7104 var prop, value, toggle, tween, hooks, oldfire, display, checkDisplay,
7105 anim = this,
7106 orig = {},
7107 style = elem.style,
7108 hidden = elem.nodeType && isHidden( elem ),
7109 dataShow = jQuery._data( elem, "fxshow" );
7110
7111 // handle queue: false promises
7112 if ( !opts.queue ) {
7113 hooks = jQuery._queueHooks( elem, "fx" );
7114 if ( hooks.unqueued == null ) {
7115 hooks.unqueued = 0;
7116 oldfire = hooks.empty.fire;
7117 hooks.empty.fire = function() {
7118 if ( !hooks.unqueued ) {
7119 oldfire();
7120 }
7121 };
7122 }
7123 hooks.unqueued++;
7124
7125 anim.always(function() {
7126 // doing this makes sure that the complete handler will be called
7127 // before this completes
7128 anim.always(function() {
7129 hooks.unqueued--;
7130 if ( !jQuery.queue( elem, "fx" ).length ) {
7131 hooks.empty.fire();
7132 }
7133 });
7134 });
7135 }
7136
7137 // height/width overflow pass
7138 if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
7139 // Make sure that nothing sneaks out
7140 // Record all 3 overflow attributes because IE does not
7141 // change the overflow attribute when overflowX and
7142 // overflowY are set to the same value
7143 opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
7144
7145 // Set display property to inline-block for height/width
7146 // animations on inline elements that are having width/height animated
7147 display = jQuery.css( elem, "display" );
7148
7149 // Test default display if display is currently "none"
7150 checkDisplay = display === "none" ?
7151 jQuery._data( elem, "olddisplay" ) || defaultDisplay( elem.nodeName ) : display;
7152
7153 if ( checkDisplay === "inline" && jQuery.css( elem, "float" ) === "none" ) {
7154
7155 // inline-level elements accept inline-block;
7156 // block-level elements need to be inline with layout
7157 if ( !support.inlineBlockNeedsLayout || defaultDisplay( elem.nodeName ) === "inline" ) {
7158 style.display = "inline-block";
7159 } else {
7160 style.zoom = 1;
7161 }
7162 }
7163 }
7164
7165 if ( opts.overflow ) {
7166 style.overflow = "hidden";
7167 if ( !support.shrinkWrapBlocks() ) {
7168 anim.always(function() {
7169 style.overflow = opts.overflow[ 0 ];
7170 style.overflowX = opts.overflow[ 1 ];
7171 style.overflowY = opts.overflow[ 2 ];
7172 });
7173 }
7174 }
7175
7176 // show/hide pass
7177 for ( prop in props ) {
7178 value = props[ prop ];
7179 if ( rfxtypes.exec( value ) ) {
7180 delete props[ prop ];
7181 toggle = toggle || value === "toggle";
7182 if ( value === ( hidden ? "hide" : "show" ) ) {
7183
7184 // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden
7185 if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) {
7186 hidden = true;
7187 } else {
7188 continue;
7189 }
7190 }
7191 orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop );
7192
7193 // Any non-fx value stops us from restoring the original display value
7194 } else {
7195 display = undefined;
7196 }
7197 }
7198
7199 if ( !jQuery.isEmptyObject( orig ) ) {
7200 if ( dataShow ) {
7201 if ( "hidden" in dataShow ) {
7202 hidden = dataShow.hidden;
7203 }
7204 } else {
7205 dataShow = jQuery._data( elem, "fxshow", {} );
7206 }
7207
7208 // store state if its toggle - enables .stop().toggle() to "reverse"
7209 if ( toggle ) {
7210 dataShow.hidden = !hidden;
7211 }
7212 if ( hidden ) {
7213 jQuery( elem ).show();
7214 } else {
7215 anim.done(function() {
7216 jQuery( elem ).hide();
7217 });
7218 }
7219 anim.done(function() {
7220 var prop;
7221 jQuery._removeData( elem, "fxshow" );
7222 for ( prop in orig ) {
7223 jQuery.style( elem, prop, orig[ prop ] );
7224 }
7225 });
7226 for ( prop in orig ) {
7227 tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim );
7228
7229 if ( !( prop in dataShow ) ) {
7230 dataShow[ prop ] = tween.start;
7231 if ( hidden ) {
7232 tween.end = tween.start;
7233 tween.start = prop === "width" || prop === "height" ? 1 : 0;
7234 }
7235 }
7236 }
7237
7238 // If this is a noop like .hide().hide(), restore an overwritten display value
7239 } else if ( (display === "none" ? defaultDisplay( elem.nodeName ) : display) === "inline" ) {
7240 style.display = display;
7241 }
7242 }
7243
7244 function propFilter( props, specialEasing ) {
7245 var index, name, easing, value, hooks;
7246
7247 // camelCase, specialEasing and expand cssHook pass
7248 for ( index in props ) {
7249 name = jQuery.camelCase( index );
7250 easing = specialEasing[ name ];
7251 value = props[ index ];
7252 if ( jQuery.isArray( value ) ) {
7253 easing = value[ 1 ];
7254 value = props[ index ] = value[ 0 ];
7255 }
7256
7257 if ( index !== name ) {
7258 props[ name ] = value;
7259 delete props[ index ];
7260 }
7261
7262 hooks = jQuery.cssHooks[ name ];
7263 if ( hooks && "expand" in hooks ) {
7264 value = hooks.expand( value );
7265 delete props[ name ];
7266
7267 // not quite $.extend, this wont overwrite keys already present.
7268 // also - reusing 'index' from above because we have the correct "name"
7269 for ( index in value ) {
7270 if ( !( index in props ) ) {
7271 props[ index ] = value[ index ];
7272 specialEasing[ index ] = easing;
7273 }
7274 }
7275 } else {
7276 specialEasing[ name ] = easing;
7277 }
7278 }
7279 }
7280
7281 function Animation( elem, properties, options ) {
7282 var result,
7283 stopped,
7284 index = 0,
7285 length = animationPrefilters.length,
7286 deferred = jQuery.Deferred().always( function() {
7287 // don't match elem in the :animated selector
7288 delete tick.elem;
7289 }),
7290 tick = function() {
7291 if ( stopped ) {
7292 return false;
7293 }
7294 var currentTime = fxNow || createFxNow(),
7295 remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
7296 // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
7297 temp = remaining / animation.duration || 0,
7298 percent = 1 - temp,
7299 index = 0,
7300 length = animation.tweens.length;
7301
7302 for ( ; index < length ; index++ ) {
7303 animation.tweens[ index ].run( percent );
7304 }
7305
7306 deferred.notifyWith( elem, [ animation, percent, remaining ]);
7307
7308 if ( percent < 1 && length ) {
7309 return remaining;
7310 } else {
7311 deferred.resolveWith( elem, [ animation ] );
7312 return false;
7313 }
7314 },
7315 animation = deferred.promise({
7316 elem: elem,
7317 props: jQuery.extend( {}, properties ),
7318 opts: jQuery.extend( true, { specialEasing: {} }, options ),
7319 originalProperties: properties,
7320 originalOptions: options,
7321 startTime: fxNow || createFxNow(),
7322 duration: options.duration,
7323 tweens: [],
7324 createTween: function( prop, end ) {
7325 var tween = jQuery.Tween( elem, animation.opts, prop, end,
7326 animation.opts.specialEasing[ prop ] || animation.opts.easing );
7327 animation.tweens.push( tween );
7328 return tween;
7329 },
7330 stop: function( gotoEnd ) {
7331 var index = 0,
7332 // if we are going to the end, we want to run all the tweens
7333 // otherwise we skip this part
7334 length = gotoEnd ? animation.tweens.length : 0;
7335 if ( stopped ) {
7336 return this;
7337 }
7338 stopped = true;
7339 for ( ; index < length ; index++ ) {
7340 animation.tweens[ index ].run( 1 );
7341 }
7342
7343 // resolve when we played the last frame
7344 // otherwise, reject
7345 if ( gotoEnd ) {
7346 deferred.resolveWith( elem, [ animation, gotoEnd ] );
7347 } else {
7348 deferred.rejectWith( elem, [ animation, gotoEnd ] );
7349 }
7350 return this;
7351 }
7352 }),
7353 props = animation.props;
7354
7355 propFilter( props, animation.opts.specialEasing );
7356
7357 for ( ; index < length ; index++ ) {
7358 result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
7359 if ( result ) {
7360 return result;
7361 }
7362 }
7363
7364 jQuery.map( props, createTween, animation );
7365
7366 if ( jQuery.isFunction( animation.opts.start ) ) {
7367 animation.opts.start.call( elem, animation );
7368 }
7369
7370 jQuery.fx.timer(
7371 jQuery.extend( tick, {
7372 elem: elem,
7373 anim: animation,
7374 queue: animation.opts.queue
7375 })
7376 );
7377
7378 // attach callbacks from options
7379 return animation.progress( animation.opts.progress )
7380 .done( animation.opts.done, animation.opts.complete )
7381 .fail( animation.opts.fail )
7382 .always( animation.opts.always );
7383 }
7384
7385 jQuery.Animation = jQuery.extend( Animation, {
7386 tweener: function( props, callback ) {
7387 if ( jQuery.isFunction( props ) ) {
7388 callback = props;
7389 props = [ "*" ];
7390 } else {
7391 props = props.split(" ");
7392 }
7393
7394 var prop,
7395 index = 0,
7396 length = props.length;
7397
7398 for ( ; index < length ; index++ ) {
7399 prop = props[ index ];
7400 tweeners[ prop ] = tweeners[ prop ] || [];
7401 tweeners[ prop ].unshift( callback );
7402 }
7403 },
7404
7405 prefilter: function( callback, prepend ) {
7406 if ( prepend ) {
7407 animationPrefilters.unshift( callback );
7408 } else {
7409 animationPrefilters.push( callback );
7410 }
7411 }
7412 });
7413
7414 jQuery.speed = function( speed, easing, fn ) {
7415 var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
7416 complete: fn || !fn && easing ||
7417 jQuery.isFunction( speed ) && speed,
7418 duration: speed,
7419 easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
7420 };
7421
7422 opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
7423 opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
7424
7425 // normalize opt.queue - true/undefined/null -> "fx"
7426 if ( opt.queue == null || opt.queue === true ) {
7427 opt.queue = "fx";
7428 }
7429
7430 // Queueing
7431 opt.old = opt.complete;
7432
7433 opt.complete = function() {
7434 if ( jQuery.isFunction( opt.old ) ) {
7435 opt.old.call( this );
7436 }
7437
7438 if ( opt.queue ) {
7439 jQuery.dequeue( this, opt.queue );
7440 }
7441 };
7442
7443 return opt;
7444 };
7445
7446 jQuery.fn.extend({
7447 fadeTo: function( speed, to, easing, callback ) {
7448
7449 // show any hidden elements after setting opacity to 0
7450 return this.filter( isHidden ).css( "opacity", 0 ).show()
7451
7452 // animate to the value specified
7453 .end().animate({ opacity: to }, speed, easing, callback );
7454 },
7455 animate: function( prop, speed, easing, callback ) {
7456 var empty = jQuery.isEmptyObject( prop ),
7457 optall = jQuery.speed( speed, easing, callback ),
7458 doAnimation = function() {
7459 // Operate on a copy of prop so per-property easing won't be lost
7460 var anim = Animation( this, jQuery.extend( {}, prop ), optall );
7461
7462 // Empty animations, or finishing resolves immediately
7463 if ( empty || jQuery._data( this, "finish" ) ) {
7464 anim.stop( true );
7465 }
7466 };
7467 doAnimation.finish = doAnimation;
7468
7469 return empty || optall.queue === false ?
7470 this.each( doAnimation ) :
7471 this.queue( optall.queue, doAnimation );
7472 },
7473 stop: function( type, clearQueue, gotoEnd ) {
7474 var stopQueue = function( hooks ) {
7475 var stop = hooks.stop;
7476 delete hooks.stop;
7477 stop( gotoEnd );
7478 };
7479
7480 if ( typeof type !== "string" ) {
7481 gotoEnd = clearQueue;
7482 clearQueue = type;
7483 type = undefined;
7484 }
7485 if ( clearQueue && type !== false ) {
7486 this.queue( type || "fx", [] );
7487 }
7488
7489 return this.each(function() {
7490 var dequeue = true,
7491 index = type != null && type + "queueHooks",
7492 timers = jQuery.timers,
7493 data = jQuery._data( this );
7494
7495 if ( index ) {
7496 if ( data[ index ] && data[ index ].stop ) {
7497 stopQueue( data[ index ] );
7498 }
7499 } else {
7500 for ( index in data ) {
7501 if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
7502 stopQueue( data[ index ] );
7503 }
7504 }
7505 }
7506
7507 for ( index = timers.length; index--; ) {
7508 if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
7509 timers[ index ].anim.stop( gotoEnd );
7510 dequeue = false;
7511 timers.splice( index, 1 );
7512 }
7513 }
7514
7515 // start the next in the queue if the last step wasn't forced
7516 // timers currently will call their complete callbacks, which will dequeue
7517 // but only if they were gotoEnd
7518 if ( dequeue || !gotoEnd ) {
7519 jQuery.dequeue( this, type );
7520 }
7521 });
7522 },
7523 finish: function( type ) {
7524 if ( type !== false ) {
7525 type = type || "fx";
7526 }
7527 return this.each(function() {
7528 var index,
7529 data = jQuery._data( this ),
7530 queue = data[ type + "queue" ],
7531 hooks = data[ type + "queueHooks" ],
7532 timers = jQuery.timers,
7533 length = queue ? queue.length : 0;
7534
7535 // enable finishing flag on private data
7536 data.finish = true;
7537
7538 // empty the queue first
7539 jQuery.queue( this, type, [] );
7540
7541 if ( hooks && hooks.stop ) {
7542 hooks.stop.call( this, true );
7543 }
7544
7545 // look for any active animations, and finish them
7546 for ( index = timers.length; index--; ) {
7547 if ( timers[ index ].elem === this && timers[ index ].queue === type ) {
7548 timers[ index ].anim.stop( true );
7549 timers.splice( index, 1 );
7550 }
7551 }
7552
7553 // look for any animations in the old queue and finish them
7554 for ( index = 0; index < length; index++ ) {
7555 if ( queue[ index ] && queue[ index ].finish ) {
7556 queue[ index ].finish.call( this );
7557 }
7558 }
7559
7560 // turn off finishing flag
7561 delete data.finish;
7562 });
7563 }
7564 });
7565
7566 jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
7567 var cssFn = jQuery.fn[ name ];
7568 jQuery.fn[ name ] = function( speed, easing, callback ) {
7569 return speed == null || typeof speed === "boolean" ?
7570 cssFn.apply( this, arguments ) :
7571 this.animate( genFx( name, true ), speed, easing, callback );
7572 };
7573 });
7574
7575 // Generate shortcuts for custom animations
7576 jQuery.each({
7577 slideDown: genFx("show"),
7578 slideUp: genFx("hide"),
7579 slideToggle: genFx("toggle"),
7580 fadeIn: { opacity: "show" },
7581 fadeOut: { opacity: "hide" },
7582 fadeToggle: { opacity: "toggle" }
7583 }, function( name, props ) {
7584 jQuery.fn[ name ] = function( speed, easing, callback ) {
7585 return this.animate( props, speed, easing, callback );
7586 };
7587 });
7588
7589 jQuery.timers = [];
7590 jQuery.fx.tick = function() {
7591 var timer,
7592 timers = jQuery.timers,
7593 i = 0;
7594
7595 fxNow = jQuery.now();
7596
7597 for ( ; i < timers.length; i++ ) {
7598 timer = timers[ i ];
7599 // Checks the timer has not already been removed
7600 if ( !timer() && timers[ i ] === timer ) {
7601 timers.splice( i--, 1 );
7602 }
7603 }
7604
7605 if ( !timers.length ) {
7606 jQuery.fx.stop();
7607 }
7608 fxNow = undefined;
7609 };
7610
7611 jQuery.fx.timer = function( timer ) {
7612 jQuery.timers.push( timer );
7613 if ( timer() ) {
7614 jQuery.fx.start();
7615 } else {
7616 jQuery.timers.pop();
7617 }
7618 };
7619
7620 jQuery.fx.interval = 13;
7621
7622 jQuery.fx.start = function() {
7623 if ( !timerId ) {
7624 timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
7625 }
7626 };
7627
7628 jQuery.fx.stop = function() {
7629 clearInterval( timerId );
7630 timerId = null;
7631 };
7632
7633 jQuery.fx.speeds = {
7634 slow: 600,
7635 fast: 200,
7636 // Default speed
7637 _default: 400
7638 };
7639
7640
7641 // Based off of the plugin by Clint Helfers, with permission.
7642 // http://blindsignals.com/index.php/2009/07/jquery-delay/
7643 jQuery.fn.delay = function( time, type ) {
7644 time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
7645 type = type || "fx";
7646
7647 return this.queue( type, function( next, hooks ) {
7648 var timeout = setTimeout( next, time );
7649 hooks.stop = function() {
7650 clearTimeout( timeout );
7651 };
7652 });
7653 };
7654
7655
7656 (function() {
7657 // Minified: var a,b,c,d,e
7658 var input, div, select, a, opt;
7659
7660 // Setup
7661 div = document.createElement( "div" );
7662 div.setAttribute( "className", "t" );
7663 div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
7664 a = div.getElementsByTagName("a")[ 0 ];
7665
7666 // First batch of tests.
7667 select = document.createElement("select");
7668 opt = select.appendChild( document.createElement("option") );
7669 input = div.getElementsByTagName("input")[ 0 ];
7670
7671 a.style.cssText = "top:1px";
7672
7673 // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
7674 support.getSetAttribute = div.className !== "t";
7675
7676 // Get the style information from getAttribute
7677 // (IE uses .cssText instead)
7678 support.style = /top/.test( a.getAttribute("style") );
7679
7680 // Make sure that URLs aren't manipulated
7681 // (IE normalizes it by default)
7682 support.hrefNormalized = a.getAttribute("href") === "/a";
7683
7684 // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere)
7685 support.checkOn = !!input.value;
7686
7687 // Make sure that a selected-by-default option has a working selected property.
7688 // (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
7689 support.optSelected = opt.selected;
7690
7691 // Tests for enctype support on a form (#6743)
7692 support.enctype = !!document.createElement("form").enctype;
7693
7694 // Make sure that the options inside disabled selects aren't marked as disabled
7695 // (WebKit marks them as disabled)
7696 select.disabled = true;
7697 support.optDisabled = !opt.disabled;
7698
7699 // Support: IE8 only
7700 // Check if we can trust getAttribute("value")
7701 input = document.createElement( "input" );
7702 input.setAttribute( "value", "" );
7703 support.input = input.getAttribute( "value" ) === "";
7704
7705 // Check if an input maintains its value after becoming a radio
7706 input.value = "t";
7707 input.setAttribute( "type", "radio" );
7708 support.radioValue = input.value === "t";
7709 })();
7710
7711
7712 var rreturn = /\r/g;
7713
7714 jQuery.fn.extend({
7715 val: function( value ) {
7716 var hooks, ret, isFunction,
7717 elem = this[0];
7718
7719 if ( !arguments.length ) {
7720 if ( elem ) {
7721 hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
7722
7723 if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
7724 return ret;
7725 }
7726
7727 ret = elem.value;
7728
7729 return typeof ret === "string" ?
7730 // handle most common string cases
7731 ret.replace(rreturn, "") :
7732 // handle cases where value is null/undef or number
7733 ret == null ? "" : ret;
7734 }
7735
7736 return;
7737 }
7738
7739 isFunction = jQuery.isFunction( value );
7740
7741 return this.each(function( i ) {
7742 var val;
7743
7744 if ( this.nodeType !== 1 ) {
7745 return;
7746 }
7747
7748 if ( isFunction ) {
7749 val = value.call( this, i, jQuery( this ).val() );
7750 } else {
7751 val = value;
7752 }
7753
7754 // Treat null/undefined as ""; convert numbers to string
7755 if ( val == null ) {
7756 val = "";
7757 } else if ( typeof val === "number" ) {
7758 val += "";
7759 } else if ( jQuery.isArray( val ) ) {
7760 val = jQuery.map( val, function( value ) {
7761 return value == null ? "" : value + "";
7762 });
7763 }
7764
7765 hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
7766
7767 // If set returns undefined, fall back to normal setting
7768 if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
7769 this.value = val;
7770 }
7771 });
7772 }
7773 });
7774
7775 jQuery.extend({
7776 valHooks: {
7777 option: {
7778 get: function( elem ) {
7779 var val = jQuery.find.attr( elem, "value" );
7780 return val != null ?
7781 val :
7782 // Support: IE10-11+
7783 // option.text throws exceptions (#14686, #14858)
7784 jQuery.trim( jQuery.text( elem ) );
7785 }
7786 },
7787 select: {
7788 get: function( elem ) {
7789 var value, option,
7790 options = elem.options,
7791 index = elem.selectedIndex,
7792 one = elem.type === "select-one" || index < 0,
7793 values = one ? null : [],
7794 max = one ? index + 1 : options.length,
7795 i = index < 0 ?
7796 max :
7797 one ? index : 0;
7798
7799 // Loop through all the selected options
7800 for ( ; i < max; i++ ) {
7801 option = options[ i ];
7802
7803 // oldIE doesn't update selected after form reset (#2551)
7804 if ( ( option.selected || i === index ) &&
7805 // Don't return options that are disabled or in a disabled optgroup
7806 ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
7807 ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
7808
7809 // Get the specific value for the option
7810 value = jQuery( option ).val();
7811
7812 // We don't need an array for one selects
7813 if ( one ) {
7814 return value;
7815 }
7816
7817 // Multi-Selects return an array
7818 values.push( value );
7819 }
7820 }
7821
7822 return values;
7823 },
7824
7825 set: function( elem, value ) {
7826 var optionSet, option,
7827 options = elem.options,
7828 values = jQuery.makeArray( value ),
7829 i = options.length;
7830
7831 while ( i-- ) {
7832 option = options[ i ];
7833
7834 if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) {
7835
7836 // Support: IE6
7837 // When new option element is added to select box we need to
7838 // force reflow of newly added node in order to workaround delay
7839 // of initialization properties
7840 try {
7841 option.selected = optionSet = true;
7842
7843 } catch ( _ ) {
7844
7845 // Will be executed only in IE6
7846 option.scrollHeight;
7847 }
7848
7849 } else {
7850 option.selected = false;
7851 }
7852 }
7853
7854 // Force browsers to behave consistently when non-matching value is set
7855 if ( !optionSet ) {
7856 elem.selectedIndex = -1;
7857 }
7858
7859 return options;
7860 }
7861 }
7862 }
7863 });
7864
7865 // Radios and checkboxes getter/setter
7866 jQuery.each([ "radio", "checkbox" ], function() {
7867 jQuery.valHooks[ this ] = {
7868 set: function( elem, value ) {
7869 if ( jQuery.isArray( value ) ) {
7870 return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
7871 }
7872 }
7873 };
7874 if ( !support.checkOn ) {
7875 jQuery.valHooks[ this ].get = function( elem ) {
7876 // Support: Webkit
7877 // "" is returned instead of "on" if a value isn't specified
7878 return elem.getAttribute("value") === null ? "on" : elem.value;
7879 };
7880 }
7881 });
7882
7883
7884
7885
7886 var nodeHook, boolHook,
7887 attrHandle = jQuery.expr.attrHandle,
7888 ruseDefault = /^(?:checked|selected)$/i,
7889 getSetAttribute = support.getSetAttribute,
7890 getSetInput = support.input;
7891
7892 jQuery.fn.extend({
7893 attr: function( name, value ) {
7894 return access( this, jQuery.attr, name, value, arguments.length > 1 );
7895 },
7896
7897 removeAttr: function( name ) {
7898 return this.each(function() {
7899 jQuery.removeAttr( this, name );
7900 });
7901 }
7902 });
7903
7904 jQuery.extend({
7905 attr: function( elem, name, value ) {
7906 var hooks, ret,
7907 nType = elem.nodeType;
7908
7909 // don't get/set attributes on text, comment and attribute nodes
7910 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
7911 return;
7912 }
7913
7914 // Fallback to prop when attributes are not supported
7915 if ( typeof elem.getAttribute === strundefined ) {
7916 return jQuery.prop( elem, name, value );
7917 }
7918
7919 // All attributes are lowercase
7920 // Grab necessary hook if one is defined
7921 if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) {
7922 name = name.toLowerCase();
7923 hooks = jQuery.attrHooks[ name ] ||
7924 ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook );
7925 }
7926
7927 if ( value !== undefined ) {
7928
7929 if ( value === null ) {
7930 jQuery.removeAttr( elem, name );
7931
7932 } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
7933 return ret;
7934
7935 } else {
7936 elem.setAttribute( name, value + "" );
7937 return value;
7938 }
7939
7940 } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
7941 return ret;
7942
7943 } else {
7944 ret = jQuery.find.attr( elem, name );
7945
7946 // Non-existent attributes return null, we normalize to undefined
7947 return ret == null ?
7948 undefined :
7949 ret;
7950 }
7951 },
7952
7953 removeAttr: function( elem, value ) {
7954 var name, propName,
7955 i = 0,
7956 attrNames = value && value.match( rnotwhite );
7957
7958 if ( attrNames && elem.nodeType === 1 ) {
7959 while ( (name = attrNames[i++]) ) {
7960 propName = jQuery.propFix[ name ] || name;
7961
7962 // Boolean attributes get special treatment (#10870)
7963 if ( jQuery.expr.match.bool.test( name ) ) {
7964 // Set corresponding property to false
7965 if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
7966 elem[ propName ] = false;
7967 // Support: IE<9
7968 // Also clear defaultChecked/defaultSelected (if appropriate)
7969 } else {
7970 elem[ jQuery.camelCase( "default-" + name ) ] =
7971 elem[ propName ] = false;
7972 }
7973
7974 // See #9699 for explanation of this approach (setting first, then removal)
7975 } else {
7976 jQuery.attr( elem, name, "" );
7977 }
7978
7979 elem.removeAttribute( getSetAttribute ? name : propName );
7980 }
7981 }
7982 },
7983
7984 attrHooks: {
7985 type: {
7986 set: function( elem, value ) {
7987 if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
7988 // Setting the type on a radio button after the value resets the value in IE6-9
7989 // Reset value to default in case type is set after value during creation
7990 var val = elem.value;
7991 elem.setAttribute( "type", value );
7992 if ( val ) {
7993 elem.value = val;
7994 }
7995 return value;
7996 }
7997 }
7998 }
7999 }
8000 });
8001
8002 // Hook for boolean attributes
8003 boolHook = {
8004 set: function( elem, value, name ) {
8005 if ( value === false ) {
8006 // Remove boolean attributes when set to false
8007 jQuery.removeAttr( elem, name );
8008 } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) {
8009 // IE<8 needs the *property* name
8010 elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name );
8011
8012 // Use defaultChecked and defaultSelected for oldIE
8013 } else {
8014 elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true;
8015 }
8016
8017 return name;
8018 }
8019 };
8020
8021 // Retrieve booleans specially
8022 jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) {
8023
8024 var getter = attrHandle[ name ] || jQuery.find.attr;
8025
8026 attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ?
8027 function( elem, name, isXML ) {
8028 var ret, handle;
8029 if ( !isXML ) {
8030 // Avoid an infinite loop by temporarily removing this function from the getter
8031 handle = attrHandle[ name ];
8032 attrHandle[ name ] = ret;
8033 ret = getter( elem, name, isXML ) != null ?
8034 name.toLowerCase() :
8035 null;
8036 attrHandle[ name ] = handle;
8037 }
8038 return ret;
8039 } :
8040 function( elem, name, isXML ) {
8041 if ( !isXML ) {
8042 return elem[ jQuery.camelCase( "default-" + name ) ] ?
8043 name.toLowerCase() :
8044 null;
8045 }
8046 };
8047 });
8048
8049 // fix oldIE attroperties
8050 if ( !getSetInput || !getSetAttribute ) {
8051 jQuery.attrHooks.value = {
8052 set: function( elem, value, name ) {
8053 if ( jQuery.nodeName( elem, "input" ) ) {
8054 // Does not return so that setAttribute is also used
8055 elem.defaultValue = value;
8056 } else {
8057 // Use nodeHook if defined (#1954); otherwise setAttribute is fine
8058 return nodeHook && nodeHook.set( elem, value, name );
8059 }
8060 }
8061 };
8062 }
8063
8064 // IE6/7 do not support getting/setting some attributes with get/setAttribute
8065 if ( !getSetAttribute ) {
8066
8067 // Use this for any attribute in IE6/7
8068 // This fixes almost every IE6/7 issue
8069 nodeHook = {
8070 set: function( elem, value, name ) {
8071 // Set the existing or create a new attribute node
8072 var ret = elem.getAttributeNode( name );
8073 if ( !ret ) {
8074 elem.setAttributeNode(
8075 (ret = elem.ownerDocument.createAttribute( name ))
8076 );
8077 }
8078
8079 ret.value = value += "";
8080
8081 // Break association with cloned elements by also using setAttribute (#9646)
8082 if ( name === "value" || value === elem.getAttribute( name ) ) {
8083 return value;
8084 }
8085 }
8086 };
8087
8088 // Some attributes are constructed with empty-string values when not defined
8089 attrHandle.id = attrHandle.name = attrHandle.coords =
8090 function( elem, name, isXML ) {
8091 var ret;
8092 if ( !isXML ) {
8093 return (ret = elem.getAttributeNode( name )) && ret.value !== "" ?
8094 ret.value :
8095 null;
8096 }
8097 };
8098
8099 // Fixing value retrieval on a button requires this module
8100 jQuery.valHooks.button = {
8101 get: function( elem, name ) {
8102 var ret = elem.getAttributeNode( name );
8103 if ( ret && ret.specified ) {
8104 return ret.value;
8105 }
8106 },
8107 set: nodeHook.set
8108 };
8109
8110 // Set contenteditable to false on removals(#10429)
8111 // Setting to empty string throws an error as an invalid value
8112 jQuery.attrHooks.contenteditable = {
8113 set: function( elem, value, name ) {
8114 nodeHook.set( elem, value === "" ? false : value, name );
8115 }
8116 };
8117
8118 // Set width and height to auto instead of 0 on empty string( Bug #8150 )
8119 // This is for removals
8120 jQuery.each([ "width", "height" ], function( i, name ) {
8121 jQuery.attrHooks[ name ] = {
8122 set: function( elem, value ) {
8123 if ( value === "" ) {
8124 elem.setAttribute( name, "auto" );
8125 return value;
8126 }
8127 }
8128 };
8129 });
8130 }
8131
8132 if ( !support.style ) {
8133 jQuery.attrHooks.style = {
8134 get: function( elem ) {
8135 // Return undefined in the case of empty string
8136 // Note: IE uppercases css property names, but if we were to .toLowerCase()
8137 // .cssText, that would destroy case senstitivity in URL's, like in "background"
8138 return elem.style.cssText || undefined;
8139 },
8140 set: function( elem, value ) {
8141 return ( elem.style.cssText = value + "" );
8142 }
8143 };
8144 }
8145
8146
8147
8148
8149 var rfocusable = /^(?:input|select|textarea|button|object)$/i,
8150 rclickable = /^(?:a|area)$/i;
8151
8152 jQuery.fn.extend({
8153 prop: function( name, value ) {
8154 return access( this, jQuery.prop, name, value, arguments.length > 1 );
8155 },
8156
8157 removeProp: function( name ) {
8158 name = jQuery.propFix[ name ] || name;
8159 return this.each(function() {
8160 // try/catch handles cases where IE balks (such as removing a property on window)
8161 try {
8162 this[ name ] = undefined;
8163 delete this[ name ];
8164 } catch( e ) {}
8165 });
8166 }
8167 });
8168
8169 jQuery.extend({
8170 propFix: {
8171 "for": "htmlFor",
8172 "class": "className"
8173 },
8174
8175 prop: function( elem, name, value ) {
8176 var ret, hooks, notxml,
8177 nType = elem.nodeType;
8178
8179 // don't get/set properties on text, comment and attribute nodes
8180 if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
8181 return;
8182 }
8183
8184 notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
8185
8186 if ( notxml ) {
8187 // Fix name and attach hooks
8188 name = jQuery.propFix[ name ] || name;
8189 hooks = jQuery.propHooks[ name ];
8190 }
8191
8192 if ( value !== undefined ) {
8193 return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ?
8194 ret :
8195 ( elem[ name ] = value );
8196
8197 } else {
8198 return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ?
8199 ret :
8200 elem[ name ];
8201 }
8202 },
8203
8204 propHooks: {
8205 tabIndex: {
8206 get: function( elem ) {
8207 // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
8208 // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
8209 // Use proper attribute retrieval(#12072)
8210 var tabindex = jQuery.find.attr( elem, "tabindex" );
8211
8212 return tabindex ?
8213 parseInt( tabindex, 10 ) :
8214 rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
8215 0 :
8216 -1;
8217 }
8218 }
8219 }
8220 });
8221
8222 // Some attributes require a special call on IE
8223 // http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx
8224 if ( !support.hrefNormalized ) {
8225 // href/src property should get the full normalized URL (#10299/#12915)
8226 jQuery.each([ "href", "src" ], function( i, name ) {
8227 jQuery.propHooks[ name ] = {
8228 get: function( elem ) {
8229 return elem.getAttribute( name, 4 );
8230 }
8231 };
8232 });
8233 }
8234
8235 // Support: Safari, IE9+
8236 // mis-reports the default selected property of an option
8237 // Accessing the parent's selectedIndex property fixes it
8238 if ( !support.optSelected ) {
8239 jQuery.propHooks.selected = {
8240 get: function( elem ) {
8241 var parent = elem.parentNode;
8242
8243 if ( parent ) {
8244 parent.selectedIndex;
8245
8246 // Make sure that it also works with optgroups, see #5701
8247 if ( parent.parentNode ) {
8248 parent.parentNode.selectedIndex;
8249 }
8250 }
8251 return null;
8252 }
8253 };
8254 }
8255
8256 jQuery.each([
8257 "tabIndex",
8258 "readOnly",
8259 "maxLength",
8260 "cellSpacing",
8261 "cellPadding",
8262 "rowSpan",
8263 "colSpan",
8264 "useMap",
8265 "frameBorder",
8266 "contentEditable"
8267 ], function() {
8268 jQuery.propFix[ this.toLowerCase() ] = this;
8269 });
8270
8271 // IE6/7 call enctype encoding
8272 if ( !support.enctype ) {
8273 jQuery.propFix.enctype = "encoding";
8274 }
8275
8276
8277
8278
8279 var rclass = /[\t\r\n\f]/g;
8280
8281 jQuery.fn.extend({
8282 addClass: function( value ) {
8283 var classes, elem, cur, clazz, j, finalValue,
8284 i = 0,
8285 len = this.length,
8286 proceed = typeof value === "string" && value;
8287
8288 if ( jQuery.isFunction( value ) ) {
8289 return this.each(function( j ) {
8290 jQuery( this ).addClass( value.call( this, j, this.className ) );
8291 });
8292 }
8293
8294 if ( proceed ) {
8295 // The disjunction here is for better compressibility (see removeClass)
8296 classes = ( value || "" ).match( rnotwhite ) || [];
8297
8298 for ( ; i < len; i++ ) {
8299 elem = this[ i ];
8300 cur = elem.nodeType === 1 && ( elem.className ?
8301 ( " " + elem.className + " " ).replace( rclass, " " ) :
8302 " "
8303 );
8304
8305 if ( cur ) {
8306 j = 0;
8307 while ( (clazz = classes[j++]) ) {
8308 if ( cur.indexOf( " " + clazz + " " ) < 0 ) {
8309 cur += clazz + " ";
8310 }
8311 }
8312
8313 // only assign if different to avoid unneeded rendering.
8314 finalValue = jQuery.trim( cur );
8315 if ( elem.className !== finalValue ) {
8316 elem.className = finalValue;
8317 }
8318 }
8319 }
8320 }
8321
8322 return this;
8323 },
8324
8325 removeClass: function( value ) {
8326 var classes, elem, cur, clazz, j, finalValue,
8327 i = 0,
8328 len = this.length,
8329 proceed = arguments.length === 0 || typeof value === "string" && value;
8330
8331 if ( jQuery.isFunction( value ) ) {
8332 return this.each(function( j ) {
8333 jQuery( this ).removeClass( value.call( this, j, this.className ) );
8334 });
8335 }
8336 if ( proceed ) {
8337 classes = ( value || "" ).match( rnotwhite ) || [];
8338
8339 for ( ; i < len; i++ ) {
8340 elem = this[ i ];
8341 // This expression is here for better compressibility (see addClass)
8342 cur = elem.nodeType === 1 && ( elem.className ?
8343 ( " " + elem.className + " " ).replace( rclass, " " ) :
8344 ""
8345 );
8346
8347 if ( cur ) {
8348 j = 0;
8349 while ( (clazz = classes[j++]) ) {
8350 // Remove *all* instances
8351 while ( cur.indexOf( " " + clazz + " " ) >= 0 ) {
8352 cur = cur.replace( " " + clazz + " ", " " );
8353 }
8354 }
8355
8356 // only assign if different to avoid unneeded rendering.
8357 finalValue = value ? jQuery.trim( cur ) : "";
8358 if ( elem.className !== finalValue ) {
8359 elem.className = finalValue;
8360 }
8361 }
8362 }
8363 }
8364
8365 return this;
8366 },
8367
8368 toggleClass: function( value, stateVal ) {
8369 var type = typeof value;
8370
8371 if ( typeof stateVal === "boolean" && type === "string" ) {
8372 return stateVal ? this.addClass( value ) : this.removeClass( value );
8373 }
8374
8375 if ( jQuery.isFunction( value ) ) {
8376 return this.each(function( i ) {
8377 jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
8378 });
8379 }
8380
8381 return this.each(function() {
8382 if ( type === "string" ) {
8383 // toggle individual class names
8384 var className,
8385 i = 0,
8386 self = jQuery( this ),
8387 classNames = value.match( rnotwhite ) || [];
8388
8389 while ( (className = classNames[ i++ ]) ) {
8390 // check each className given, space separated list
8391 if ( self.hasClass( className ) ) {
8392 self.removeClass( className );
8393 } else {
8394 self.addClass( className );
8395 }
8396 }
8397
8398 // Toggle whole class name
8399 } else if ( type === strundefined || type === "boolean" ) {
8400 if ( this.className ) {
8401 // store className if set
8402 jQuery._data( this, "__className__", this.className );
8403 }
8404
8405 // If the element has a class name or if we're passed "false",
8406 // then remove the whole classname (if there was one, the above saved it).
8407 // Otherwise bring back whatever was previously saved (if anything),
8408 // falling back to the empty string if nothing was stored.
8409 this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
8410 }
8411 });
8412 },
8413
8414 hasClass: function( selector ) {
8415 var className = " " + selector + " ",
8416 i = 0,
8417 l = this.length;
8418 for ( ; i < l; i++ ) {
8419 if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
8420 return true;
8421 }
8422 }
8423
8424 return false;
8425 }
8426 });
8427
8428
8429
8430
8431 // Return jQuery for attributes-only inclusion
8432
8433
8434 jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
8435 "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
8436 "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
8437
8438 // Handle event binding
8439 jQuery.fn[ name ] = function( data, fn ) {
8440 return arguments.length > 0 ?
8441 this.on( name, null, data, fn ) :
8442 this.trigger( name );
8443 };
8444 });
8445
8446 jQuery.fn.extend({
8447 hover: function( fnOver, fnOut ) {
8448 return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
8449 },
8450
8451 bind: function( types, data, fn ) {
8452 return this.on( types, null, data, fn );
8453 },
8454 unbind: function( types, fn ) {
8455 return this.off( types, null, fn );
8456 },
8457
8458 delegate: function( selector, types, data, fn ) {
8459 return this.on( types, selector, data, fn );
8460 },
8461 undelegate: function( selector, types, fn ) {
8462 // ( namespace ) or ( selector, types [, fn] )
8463 return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
8464 }
8465 });
8466
8467
8468 var nonce = jQuery.now();
8469
8470 var rquery = (/\?/);
8471
8472
8473
8474 var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g;
8475
8476 jQuery.parseJSON = function( data ) {
8477 // Attempt to parse using the native JSON parser first
8478 if ( window.JSON && window.JSON.parse ) {
8479 // Support: Android 2.3
8480 // Workaround failure to string-cast null input
8481 return window.JSON.parse( data + "" );
8482 }
8483
8484 var requireNonComma,
8485 depth = null,
8486 str = jQuery.trim( data + "" );
8487
8488 // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains
8489 // after removing valid tokens
8490 return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) {
8491
8492 // Force termination if we see a misplaced comma
8493 if ( requireNonComma && comma ) {
8494 depth = 0;
8495 }
8496
8497 // Perform no more replacements after returning to outermost depth
8498 if ( depth === 0 ) {
8499 return token;
8500 }
8501
8502 // Commas must not follow "[", "{", or ","
8503 requireNonComma = open || comma;
8504
8505 // Determine new depth
8506 // array/object open ("[" or "{"): depth += true - false (increment)
8507 // array/object close ("]" or "}"): depth += false - true (decrement)
8508 // other cases ("," or primitive): depth += true - true (numeric cast)
8509 depth += !close - !open;
8510
8511 // Remove this token
8512 return "";
8513 }) ) ?
8514 ( Function( "return " + str ) )() :
8515 jQuery.error( "Invalid JSON: " + data );
8516 };
8517
8518
8519 // Cross-browser xml parsing
8520 jQuery.parseXML = function( data ) {
8521 var xml, tmp;
8522 if ( !data || typeof data !== "string" ) {
8523 return null;
8524 }
8525 try {
8526 if ( window.DOMParser ) { // Standard
8527 tmp = new DOMParser();
8528 xml = tmp.parseFromString( data, "text/xml" );
8529 } else { // IE
8530 xml = new ActiveXObject( "Microsoft.XMLDOM" );
8531 xml.async = "false";
8532 xml.loadXML( data );
8533 }
8534 } catch( e ) {
8535 xml = undefined;
8536 }
8537 if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
8538 jQuery.error( "Invalid XML: " + data );
8539 }
8540 return xml;
8541 };
8542
8543
8544 var
8545 // Document location
8546 ajaxLocParts,
8547 ajaxLocation,
8548
8549 rhash = /#.*$/,
8550 rts = /([?&])_=[^&]*/,
8551 rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
8552 // #7653, #8125, #8152: local protocol detection
8553 rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,
8554 rnoContent = /^(?:GET|HEAD)$/,
8555 rprotocol = /^\/\//,
8556 rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,
8557
8558 /* Prefilters
8559 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
8560 * 2) These are called:
8561 * - BEFORE asking for a transport
8562 * - AFTER param serialization (s.data is a string if s.processData is true)
8563 * 3) key is the dataType
8564 * 4) the catchall symbol "*" can be used
8565 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
8566 */
8567 prefilters = {},
8568
8569 /* Transports bindings
8570 * 1) key is the dataType
8571 * 2) the catchall symbol "*" can be used
8572 * 3) selection will start with transport dataType and THEN go to "*" if needed
8573 */
8574 transports = {},
8575
8576 // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
8577 allTypes = "*/".concat("*");
8578
8579 // #8138, IE may throw an exception when accessing
8580 // a field from window.location if document.domain has been set
8581 try {
8582 ajaxLocation = location.href;
8583 } catch( e ) {
8584 // Use the href attribute of an A element
8585 // since IE will modify it given document.location
8586 ajaxLocation = document.createElement( "a" );
8587 ajaxLocation.href = "";
8588 ajaxLocation = ajaxLocation.href;
8589 }
8590
8591 // Segment location into parts
8592 ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
8593
8594 // Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
8595 function addToPrefiltersOrTransports( structure ) {
8596
8597 // dataTypeExpression is optional and defaults to "*"
8598 return function( dataTypeExpression, func ) {
8599
8600 if ( typeof dataTypeExpression !== "string" ) {
8601 func = dataTypeExpression;
8602 dataTypeExpression = "*";
8603 }
8604
8605 var dataType,
8606 i = 0,
8607 dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || [];
8608
8609 if ( jQuery.isFunction( func ) ) {
8610 // For each dataType in the dataTypeExpression
8611 while ( (dataType = dataTypes[i++]) ) {
8612 // Prepend if requested
8613 if ( dataType.charAt( 0 ) === "+" ) {
8614 dataType = dataType.slice( 1 ) || "*";
8615 (structure[ dataType ] = structure[ dataType ] || []).unshift( func );
8616
8617 // Otherwise append
8618 } else {
8619 (structure[ dataType ] = structure[ dataType ] || []).push( func );
8620 }
8621 }
8622 }
8623 };
8624 }
8625
8626 // Base inspection function for prefilters and transports
8627 function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) {
8628
8629 var inspected = {},
8630 seekingTransport = ( structure === transports );
8631
8632 function inspect( dataType ) {
8633 var selected;
8634 inspected[ dataType ] = true;
8635 jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) {
8636 var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR );
8637 if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) {
8638 options.dataTypes.unshift( dataTypeOrTransport );
8639 inspect( dataTypeOrTransport );
8640 return false;
8641 } else if ( seekingTransport ) {
8642 return !( selected = dataTypeOrTransport );
8643 }
8644 });
8645 return selected;
8646 }
8647
8648 return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" );
8649 }
8650
8651 // A special extend for ajax options
8652 // that takes "flat" options (not to be deep extended)
8653 // Fixes #9887
8654 function ajaxExtend( target, src ) {
8655 var deep, key,
8656 flatOptions = jQuery.ajaxSettings.flatOptions || {};
8657
8658 for ( key in src ) {
8659 if ( src[ key ] !== undefined ) {
8660 ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ];
8661 }
8662 }
8663 if ( deep ) {
8664 jQuery.extend( true, target, deep );
8665 }
8666
8667 return target;
8668 }
8669
8670 /* Handles responses to an ajax request:
8671 * - finds the right dataType (mediates between content-type and expected dataType)
8672 * - returns the corresponding response
8673 */
8674 function ajaxHandleResponses( s, jqXHR, responses ) {
8675 var firstDataType, ct, finalDataType, type,
8676 contents = s.contents,
8677 dataTypes = s.dataTypes;
8678
8679 // Remove auto dataType and get content-type in the process
8680 while ( dataTypes[ 0 ] === "*" ) {
8681 dataTypes.shift();
8682 if ( ct === undefined ) {
8683 ct = s.mimeType || jqXHR.getResponseHeader("Content-Type");
8684 }
8685 }
8686
8687 // Check if we're dealing with a known content-type
8688 if ( ct ) {
8689 for ( type in contents ) {
8690 if ( contents[ type ] && contents[ type ].test( ct ) ) {
8691 dataTypes.unshift( type );
8692 break;
8693 }
8694 }
8695 }
8696
8697 // Check to see if we have a response for the expected dataType
8698 if ( dataTypes[ 0 ] in responses ) {
8699 finalDataType = dataTypes[ 0 ];
8700 } else {
8701 // Try convertible dataTypes
8702 for ( type in responses ) {
8703 if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
8704 finalDataType = type;
8705 break;
8706 }
8707 if ( !firstDataType ) {
8708 firstDataType = type;
8709 }
8710 }
8711 // Or just use first one
8712 finalDataType = finalDataType || firstDataType;
8713 }
8714
8715 // If we found a dataType
8716 // We add the dataType to the list if needed
8717 // and return the corresponding response
8718 if ( finalDataType ) {
8719 if ( finalDataType !== dataTypes[ 0 ] ) {
8720 dataTypes.unshift( finalDataType );
8721 }
8722 return responses[ finalDataType ];
8723 }
8724 }
8725
8726 /* Chain conversions given the request and the original response
8727 * Also sets the responseXXX fields on the jqXHR instance
8728 */
8729 function ajaxConvert( s, response, jqXHR, isSuccess ) {
8730 var conv2, current, conv, tmp, prev,
8731 converters = {},
8732 // Work with a copy of dataTypes in case we need to modify it for conversion
8733 dataTypes = s.dataTypes.slice();
8734
8735 // Create converters map with lowercased keys
8736 if ( dataTypes[ 1 ] ) {
8737 for ( conv in s.converters ) {
8738 converters[ conv.toLowerCase() ] = s.converters[ conv ];
8739 }
8740 }
8741
8742 current = dataTypes.shift();
8743
8744 // Convert to each sequential dataType
8745 while ( current ) {
8746
8747 if ( s.responseFields[ current ] ) {
8748 jqXHR[ s.responseFields[ current ] ] = response;
8749 }
8750
8751 // Apply the dataFilter if provided
8752 if ( !prev && isSuccess && s.dataFilter ) {
8753 response = s.dataFilter( response, s.dataType );
8754 }
8755
8756 prev = current;
8757 current = dataTypes.shift();
8758
8759 if ( current ) {
8760
8761 // There's only work to do if current dataType is non-auto
8762 if ( current === "*" ) {
8763
8764 current = prev;
8765
8766 // Convert response if prev dataType is non-auto and differs from current
8767 } else if ( prev !== "*" && prev !== current ) {
8768
8769 // Seek a direct converter
8770 conv = converters[ prev + " " + current ] || converters[ "* " + current ];
8771
8772 // If none found, seek a pair
8773 if ( !conv ) {
8774 for ( conv2 in converters ) {
8775
8776 // If conv2 outputs current
8777 tmp = conv2.split( " " );
8778 if ( tmp[ 1 ] === current ) {
8779
8780 // If prev can be converted to accepted input
8781 conv = converters[ prev + " " + tmp[ 0 ] ] ||
8782 converters[ "* " + tmp[ 0 ] ];
8783 if ( conv ) {
8784 // Condense equivalence converters
8785 if ( conv === true ) {
8786 conv = converters[ conv2 ];
8787
8788 // Otherwise, insert the intermediate dataType
8789 } else if ( converters[ conv2 ] !== true ) {
8790 current = tmp[ 0 ];
8791 dataTypes.unshift( tmp[ 1 ] );
8792 }
8793 break;
8794 }
8795 }
8796 }
8797 }
8798
8799 // Apply converter (if not an equivalence)
8800 if ( conv !== true ) {
8801
8802 // Unless errors are allowed to bubble, catch and return them
8803 if ( conv && s[ "throws" ] ) {
8804 response = conv( response );
8805 } else {
8806 try {
8807 response = conv( response );
8808 } catch ( e ) {
8809 return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
8810 }
8811 }
8812 }
8813 }
8814 }
8815 }
8816
8817 return { state: "success", data: response };
8818 }
8819
8820 jQuery.extend({
8821
8822 // Counter for holding the number of active queries
8823 active: 0,
8824
8825 // Last-Modified header cache for next request
8826 lastModified: {},
8827 etag: {},
8828
8829 ajaxSettings: {
8830 url: ajaxLocation,
8831 type: "GET",
8832 isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
8833 global: true,
8834 processData: true,
8835 async: true,
8836 contentType: "application/x-www-form-urlencoded; charset=UTF-8",
8837 /*
8838 timeout: 0,
8839 data: null,
8840 dataType: null,
8841 username: null,
8842 password: null,
8843 cache: null,
8844 throws: false,
8845 traditional: false,
8846 headers: {},
8847 */
8848
8849 accepts: {
8850 "*": allTypes,
8851 text: "text/plain",
8852 html: "text/html",
8853 xml: "application/xml, text/xml",
8854 json: "application/json, text/javascript"
8855 },
8856
8857 contents: {
8858 xml: /xml/,
8859 html: /html/,
8860 json: /json/
8861 },
8862
8863 responseFields: {
8864 xml: "responseXML",
8865 text: "responseText",
8866 json: "responseJSON"
8867 },
8868
8869 // Data converters
8870 // Keys separate source (or catchall "*") and destination types with a single space
8871 converters: {
8872
8873 // Convert anything to text
8874 "* text": String,
8875
8876 // Text to html (true = no transformation)
8877 "text html": true,
8878
8879 // Evaluate text as a json expression
8880 "text json": jQuery.parseJSON,
8881
8882 // Parse text as xml
8883 "text xml": jQuery.parseXML
8884 },
8885
8886 // For options that shouldn't be deep extended:
8887 // you can add your own custom options here if
8888 // and when you create one that shouldn't be
8889 // deep extended (see ajaxExtend)
8890 flatOptions: {
8891 url: true,
8892 context: true
8893 }
8894 },
8895
8896 // Creates a full fledged settings object into target
8897 // with both ajaxSettings and settings fields.
8898 // If target is omitted, writes into ajaxSettings.
8899 ajaxSetup: function( target, settings ) {
8900 return settings ?
8901
8902 // Building a settings object
8903 ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) :
8904
8905 // Extending ajaxSettings
8906 ajaxExtend( jQuery.ajaxSettings, target );
8907 },
8908
8909 ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
8910 ajaxTransport: addToPrefiltersOrTransports( transports ),
8911
8912 // Main method
8913 ajax: function( url, options ) {
8914
8915 // If url is an object, simulate pre-1.5 signature
8916 if ( typeof url === "object" ) {
8917 options = url;
8918 url = undefined;
8919 }
8920
8921 // Force options to be an object
8922 options = options || {};
8923
8924 var // Cross-domain detection vars
8925 parts,
8926 // Loop variable
8927 i,
8928 // URL without anti-cache param
8929 cacheURL,
8930 // Response headers as string
8931 responseHeadersString,
8932 // timeout handle
8933 timeoutTimer,
8934
8935 // To know if global events are to be dispatched
8936 fireGlobals,
8937
8938 transport,
8939 // Response headers
8940 responseHeaders,
8941 // Create the final options object
8942 s = jQuery.ajaxSetup( {}, options ),
8943 // Callbacks context
8944 callbackContext = s.context || s,
8945 // Context for global events is callbackContext if it is a DOM node or jQuery collection
8946 globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?
8947 jQuery( callbackContext ) :
8948 jQuery.event,
8949 // Deferreds
8950 deferred = jQuery.Deferred(),
8951 completeDeferred = jQuery.Callbacks("once memory"),
8952 // Status-dependent callbacks
8953 statusCode = s.statusCode || {},
8954 // Headers (they are sent all at once)
8955 requestHeaders = {},
8956 requestHeadersNames = {},
8957 // The jqXHR state
8958 state = 0,
8959 // Default abort message
8960 strAbort = "canceled",
8961 // Fake xhr
8962 jqXHR = {
8963 readyState: 0,
8964
8965 // Builds headers hashtable if needed
8966 getResponseHeader: function( key ) {
8967 var match;
8968 if ( state === 2 ) {
8969 if ( !responseHeaders ) {
8970 responseHeaders = {};
8971 while ( (match = rheaders.exec( responseHeadersString )) ) {
8972 responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
8973 }
8974 }
8975 match = responseHeaders[ key.toLowerCase() ];
8976 }
8977 return match == null ? null : match;
8978 },
8979
8980 // Raw string
8981 getAllResponseHeaders: function() {
8982 return state === 2 ? responseHeadersString : null;
8983 },
8984
8985 // Caches the header
8986 setRequestHeader: function( name, value ) {
8987 var lname = name.toLowerCase();
8988 if ( !state ) {
8989 name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
8990 requestHeaders[ name ] = value;
8991 }
8992 return this;
8993 },
8994
8995 // Overrides response content-type header
8996 overrideMimeType: function( type ) {
8997 if ( !state ) {
8998 s.mimeType = type;
8999 }
9000 return this;
9001 },
9002
9003 // Status-dependent callbacks
9004 statusCode: function( map ) {
9005 var code;
9006 if ( map ) {
9007 if ( state < 2 ) {
9008 for ( code in map ) {
9009 // Lazy-add the new callback in a way that preserves old ones
9010 statusCode[ code ] = [ statusCode[ code ], map[ code ] ];
9011 }
9012 } else {
9013 // Execute the appropriate callbacks
9014 jqXHR.always( map[ jqXHR.status ] );
9015 }
9016 }
9017 return this;
9018 },
9019
9020 // Cancel the request
9021 abort: function( statusText ) {
9022 var finalText = statusText || strAbort;
9023 if ( transport ) {
9024 transport.abort( finalText );
9025 }
9026 done( 0, finalText );
9027 return this;
9028 }
9029 };
9030
9031 // Attach deferreds
9032 deferred.promise( jqXHR ).complete = completeDeferred.add;
9033 jqXHR.success = jqXHR.done;
9034 jqXHR.error = jqXHR.fail;
9035
9036 // Remove hash character (#7531: and string promotion)
9037 // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
9038 // Handle falsy url in the settings object (#10093: consistency with old signature)
9039 // We also use the url parameter if available
9040 s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
9041
9042 // Alias method option to type as per ticket #12004
9043 s.type = options.method || options.type || s.method || s.type;
9044
9045 // Extract dataTypes list
9046 s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ];
9047
9048 // A cross-domain request is in order when we have a protocol:host:port mismatch
9049 if ( s.crossDomain == null ) {
9050 parts = rurl.exec( s.url.toLowerCase() );
9051 s.crossDomain = !!( parts &&
9052 ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
9053 ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !==
9054 ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) )
9055 );
9056 }
9057
9058 // Convert data if not already a string
9059 if ( s.data && s.processData && typeof s.data !== "string" ) {
9060 s.data = jQuery.param( s.data, s.traditional );
9061 }
9062
9063 // Apply prefilters
9064 inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
9065
9066 // If request was aborted inside a prefilter, stop there
9067 if ( state === 2 ) {
9068 return jqXHR;
9069 }
9070
9071 // We can fire global events as of now if asked to
9072 fireGlobals = s.global;
9073
9074 // Watch for a new set of requests
9075 if ( fireGlobals && jQuery.active++ === 0 ) {
9076 jQuery.event.trigger("ajaxStart");
9077 }
9078
9079 // Uppercase the type
9080 s.type = s.type.toUpperCase();
9081
9082 // Determine if request has content
9083 s.hasContent = !rnoContent.test( s.type );
9084
9085 // Save the URL in case we're toying with the If-Modified-Since
9086 // and/or If-None-Match header later on
9087 cacheURL = s.url;
9088
9089 // More options handling for requests with no content
9090 if ( !s.hasContent ) {
9091
9092 // If data is available, append data to url
9093 if ( s.data ) {
9094 cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data );
9095 // #9682: remove data so that it's not used in an eventual retry
9096 delete s.data;
9097 }
9098
9099 // Add anti-cache in url if needed
9100 if ( s.cache === false ) {
9101 s.url = rts.test( cacheURL ) ?
9102
9103 // If there is already a '_' parameter, set its value
9104 cacheURL.replace( rts, "$1_=" + nonce++ ) :
9105
9106 // Otherwise add one to the end
9107 cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++;
9108 }
9109 }
9110
9111 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9112 if ( s.ifModified ) {
9113 if ( jQuery.lastModified[ cacheURL ] ) {
9114 jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] );
9115 }
9116 if ( jQuery.etag[ cacheURL ] ) {
9117 jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] );
9118 }
9119 }
9120
9121 // Set the correct header, if data is being sent
9122 if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
9123 jqXHR.setRequestHeader( "Content-Type", s.contentType );
9124 }
9125
9126 // Set the Accepts header for the server, depending on the dataType
9127 jqXHR.setRequestHeader(
9128 "Accept",
9129 s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
9130 s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
9131 s.accepts[ "*" ]
9132 );
9133
9134 // Check for headers option
9135 for ( i in s.headers ) {
9136 jqXHR.setRequestHeader( i, s.headers[ i ] );
9137 }
9138
9139 // Allow custom headers/mimetypes and early abort
9140 if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
9141 // Abort if not done already and return
9142 return jqXHR.abort();
9143 }
9144
9145 // aborting is no longer a cancellation
9146 strAbort = "abort";
9147
9148 // Install callbacks on deferreds
9149 for ( i in { success: 1, error: 1, complete: 1 } ) {
9150 jqXHR[ i ]( s[ i ] );
9151 }
9152
9153 // Get transport
9154 transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
9155
9156 // If no transport, we auto-abort
9157 if ( !transport ) {
9158 done( -1, "No Transport" );
9159 } else {
9160 jqXHR.readyState = 1;
9161
9162 // Send global event
9163 if ( fireGlobals ) {
9164 globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
9165 }
9166 // Timeout
9167 if ( s.async && s.timeout > 0 ) {
9168 timeoutTimer = setTimeout(function() {
9169 jqXHR.abort("timeout");
9170 }, s.timeout );
9171 }
9172
9173 try {
9174 state = 1;
9175 transport.send( requestHeaders, done );
9176 } catch ( e ) {
9177 // Propagate exception as error if not done
9178 if ( state < 2 ) {
9179 done( -1, e );
9180 // Simply rethrow otherwise
9181 } else {
9182 throw e;
9183 }
9184 }
9185 }
9186
9187 // Callback for when everything is done
9188 function done( status, nativeStatusText, responses, headers ) {
9189 var isSuccess, success, error, response, modified,
9190 statusText = nativeStatusText;
9191
9192 // Called once
9193 if ( state === 2 ) {
9194 return;
9195 }
9196
9197 // State is "done" now
9198 state = 2;
9199
9200 // Clear timeout if it exists
9201 if ( timeoutTimer ) {
9202 clearTimeout( timeoutTimer );
9203 }
9204
9205 // Dereference transport for early garbage collection
9206 // (no matter how long the jqXHR object will be used)
9207 transport = undefined;
9208
9209 // Cache response headers
9210 responseHeadersString = headers || "";
9211
9212 // Set readyState
9213 jqXHR.readyState = status > 0 ? 4 : 0;
9214
9215 // Determine if successful
9216 isSuccess = status >= 200 && status < 300 || status === 304;
9217
9218 // Get response data
9219 if ( responses ) {
9220 response = ajaxHandleResponses( s, jqXHR, responses );
9221 }
9222
9223 // Convert no matter what (that way responseXXX fields are always set)
9224 response = ajaxConvert( s, response, jqXHR, isSuccess );
9225
9226 // If successful, handle type chaining
9227 if ( isSuccess ) {
9228
9229 // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
9230 if ( s.ifModified ) {
9231 modified = jqXHR.getResponseHeader("Last-Modified");
9232 if ( modified ) {
9233 jQuery.lastModified[ cacheURL ] = modified;
9234 }
9235 modified = jqXHR.getResponseHeader("etag");
9236 if ( modified ) {
9237 jQuery.etag[ cacheURL ] = modified;
9238 }
9239 }
9240
9241 // if no content
9242 if ( status === 204 || s.type === "HEAD" ) {
9243 statusText = "nocontent";
9244
9245 // if not modified
9246 } else if ( status === 304 ) {
9247 statusText = "notmodified";
9248
9249 // If we have data, let's convert it
9250 } else {
9251 statusText = response.state;
9252 success = response.data;
9253 error = response.error;
9254 isSuccess = !error;
9255 }
9256 } else {
9257 // We extract error from statusText
9258 // then normalize statusText and status for non-aborts
9259 error = statusText;
9260 if ( status || !statusText ) {
9261 statusText = "error";
9262 if ( status < 0 ) {
9263 status = 0;
9264 }
9265 }
9266 }
9267
9268 // Set data for the fake xhr object
9269 jqXHR.status = status;
9270 jqXHR.statusText = ( nativeStatusText || statusText ) + "";
9271
9272 // Success/Error
9273 if ( isSuccess ) {
9274 deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
9275 } else {
9276 deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
9277 }
9278
9279 // Status-dependent callbacks
9280 jqXHR.statusCode( statusCode );
9281 statusCode = undefined;
9282
9283 if ( fireGlobals ) {
9284 globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError",
9285 [ jqXHR, s, isSuccess ? success : error ] );
9286 }
9287
9288 // Complete
9289 completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
9290
9291 if ( fireGlobals ) {
9292 globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
9293 // Handle the global AJAX counter
9294 if ( !( --jQuery.active ) ) {
9295 jQuery.event.trigger("ajaxStop");
9296 }
9297 }
9298 }
9299
9300 return jqXHR;
9301 },
9302
9303 getJSON: function( url, data, callback ) {
9304 return jQuery.get( url, data, callback, "json" );
9305 },
9306
9307 getScript: function( url, callback ) {
9308 return jQuery.get( url, undefined, callback, "script" );
9309 }
9310 });
9311
9312 jQuery.each( [ "get", "post" ], function( i, method ) {
9313 jQuery[ method ] = function( url, data, callback, type ) {
9314 // shift arguments if data argument was omitted
9315 if ( jQuery.isFunction( data ) ) {
9316 type = type || callback;
9317 callback = data;
9318 data = undefined;
9319 }
9320
9321 return jQuery.ajax({
9322 url: url,
9323 type: method,
9324 dataType: type,
9325 data: data,
9326 success: callback
9327 });
9328 };
9329 });
9330
9331 // Attach a bunch of functions for handling common AJAX events
9332 jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) {
9333 jQuery.fn[ type ] = function( fn ) {
9334 return this.on( type, fn );
9335 };
9336 });
9337
9338
9339 jQuery._evalUrl = function( url ) {
9340 return jQuery.ajax({
9341 url: url,
9342 type: "GET",
9343 dataType: "script",
9344 async: false,
9345 global: false,
9346 "throws": true
9347 });
9348 };
9349
9350
9351 jQuery.fn.extend({
9352 wrapAll: function( html ) {
9353 if ( jQuery.isFunction( html ) ) {
9354 return this.each(function(i) {
9355 jQuery(this).wrapAll( html.call(this, i) );
9356 });
9357 }
9358
9359 if ( this[0] ) {
9360 // The elements to wrap the target around
9361 var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
9362
9363 if ( this[0].parentNode ) {
9364 wrap.insertBefore( this[0] );
9365 }
9366
9367 wrap.map(function() {
9368 var elem = this;
9369
9370 while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
9371 elem = elem.firstChild;
9372 }
9373
9374 return elem;
9375 }).append( this );
9376 }
9377
9378 return this;
9379 },
9380
9381 wrapInner: function( html ) {
9382 if ( jQuery.isFunction( html ) ) {
9383 return this.each(function(i) {
9384 jQuery(this).wrapInner( html.call(this, i) );
9385 });
9386 }
9387
9388 return this.each(function() {
9389 var self = jQuery( this ),
9390 contents = self.contents();
9391
9392 if ( contents.length ) {
9393 contents.wrapAll( html );
9394
9395 } else {
9396 self.append( html );
9397 }
9398 });
9399 },
9400
9401 wrap: function( html ) {
9402 var isFunction = jQuery.isFunction( html );
9403
9404 return this.each(function(i) {
9405 jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
9406 });
9407 },
9408
9409 unwrap: function() {
9410 return this.parent().each(function() {
9411 if ( !jQuery.nodeName( this, "body" ) ) {
9412 jQuery( this ).replaceWith( this.childNodes );
9413 }
9414 }).end();
9415 }
9416 });
9417
9418
9419 jQuery.expr.filters.hidden = function( elem ) {
9420 // Support: Opera <= 12.12
9421 // Opera reports offsetWidths and offsetHeights less than zero on some elements
9422 return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 ||
9423 (!support.reliableHiddenOffsets() &&
9424 ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none");
9425 };
9426
9427 jQuery.expr.filters.visible = function( elem ) {
9428 return !jQuery.expr.filters.hidden( elem );
9429 };
9430
9431
9432
9433
9434 var r20 = /%20/g,
9435 rbracket = /\[\]$/,
9436 rCRLF = /\r?\n/g,
9437 rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
9438 rsubmittable = /^(?:input|select|textarea|keygen)/i;
9439
9440 function buildParams( prefix, obj, traditional, add ) {
9441 var name;
9442
9443 if ( jQuery.isArray( obj ) ) {
9444 // Serialize array item.
9445 jQuery.each( obj, function( i, v ) {
9446 if ( traditional || rbracket.test( prefix ) ) {
9447 // Treat each array item as a scalar.
9448 add( prefix, v );
9449
9450 } else {
9451 // Item is non-scalar (array or object), encode its numeric index.
9452 buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
9453 }
9454 });
9455
9456 } else if ( !traditional && jQuery.type( obj ) === "object" ) {
9457 // Serialize object item.
9458 for ( name in obj ) {
9459 buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
9460 }
9461
9462 } else {
9463 // Serialize scalar item.
9464 add( prefix, obj );
9465 }
9466 }
9467
9468 // Serialize an array of form elements or a set of
9469 // key/values into a query string
9470 jQuery.param = function( a, traditional ) {
9471 var prefix,
9472 s = [],
9473 add = function( key, value ) {
9474 // If value is a function, invoke it and return its value
9475 value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
9476 s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
9477 };
9478
9479 // Set traditional to true for jQuery <= 1.3.2 behavior.
9480 if ( traditional === undefined ) {
9481 traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
9482 }
9483
9484 // If an array was passed in, assume that it is an array of form elements.
9485 if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
9486 // Serialize the form elements
9487 jQuery.each( a, function() {
9488 add( this.name, this.value );
9489 });
9490
9491 } else {
9492 // If traditional, encode the "old" way (the way 1.3.2 or older
9493 // did it), otherwise encode params recursively.
9494 for ( prefix in a ) {
9495 buildParams( prefix, a[ prefix ], traditional, add );
9496 }
9497 }
9498
9499 // Return the resulting serialization
9500 return s.join( "&" ).replace( r20, "+" );
9501 };
9502
9503 jQuery.fn.extend({
9504 serialize: function() {
9505 return jQuery.param( this.serializeArray() );
9506 },
9507 serializeArray: function() {
9508 return this.map(function() {
9509 // Can add propHook for "elements" to filter or add form elements
9510 var elements = jQuery.prop( this, "elements" );
9511 return elements ? jQuery.makeArray( elements ) : this;
9512 })
9513 .filter(function() {
9514 var type = this.type;
9515 // Use .is(":disabled") so that fieldset[disabled] works
9516 return this.name && !jQuery( this ).is( ":disabled" ) &&
9517 rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) &&
9518 ( this.checked || !rcheckableType.test( type ) );
9519 })
9520 .map(function( i, elem ) {
9521 var val = jQuery( this ).val();
9522
9523 return val == null ?
9524 null :
9525 jQuery.isArray( val ) ?
9526 jQuery.map( val, function( val ) {
9527 return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9528 }) :
9529 { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
9530 }).get();
9531 }
9532 });
9533
9534
9535 // Create the request object
9536 // (This is still attached to ajaxSettings for backward compatibility)
9537 jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?
9538 // Support: IE6+
9539 function() {
9540
9541 // XHR cannot access local files, always use ActiveX for that case
9542 return !this.isLocal &&
9543
9544 // Support: IE7-8
9545 // oldIE XHR does not support non-RFC2616 methods (#13240)
9546 // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx
9547 // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9
9548 // Although this check for six methods instead of eight
9549 // since IE also does not support "trace" and "connect"
9550 /^(get|post|head|put|delete|options)$/i.test( this.type ) &&
9551
9552 createStandardXHR() || createActiveXHR();
9553 } :
9554 // For all other browsers, use the standard XMLHttpRequest object
9555 createStandardXHR;
9556
9557 var xhrId = 0,
9558 xhrCallbacks = {},
9559 xhrSupported = jQuery.ajaxSettings.xhr();
9560
9561 // Support: IE<10
9562 // Open requests must be manually aborted on unload (#5280)
9563 if ( window.ActiveXObject ) {
9564 jQuery( window ).on( "unload", function() {
9565 for ( var key in xhrCallbacks ) {
9566 xhrCallbacks[ key ]( undefined, true );
9567 }
9568 });
9569 }
9570
9571 // Determine support properties
9572 support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported );
9573 xhrSupported = support.ajax = !!xhrSupported;
9574
9575 // Create transport if the browser can provide an xhr
9576 if ( xhrSupported ) {
9577
9578 jQuery.ajaxTransport(function( options ) {
9579 // Cross domain only allowed if supported through XMLHttpRequest
9580 if ( !options.crossDomain || support.cors ) {
9581
9582 var callback;
9583
9584 return {
9585 send: function( headers, complete ) {
9586 var i,
9587 xhr = options.xhr(),
9588 id = ++xhrId;
9589
9590 // Open the socket
9591 xhr.open( options.type, options.url, options.async, options.username, options.password );
9592
9593 // Apply custom fields if provided
9594 if ( options.xhrFields ) {
9595 for ( i in options.xhrFields ) {
9596 xhr[ i ] = options.xhrFields[ i ];
9597 }
9598 }
9599
9600 // Override mime type if needed
9601 if ( options.mimeType && xhr.overrideMimeType ) {
9602 xhr.overrideMimeType( options.mimeType );
9603 }
9604
9605 // X-Requested-With header
9606 // For cross-domain requests, seeing as conditions for a preflight are
9607 // akin to a jigsaw puzzle, we simply never set it to be sure.
9608 // (it can always be set on a per-request basis or even using ajaxSetup)
9609 // For same-domain requests, won't change header if already provided.
9610 if ( !options.crossDomain && !headers["X-Requested-With"] ) {
9611 headers["X-Requested-With"] = "XMLHttpRequest";
9612 }
9613
9614 // Set headers
9615 for ( i in headers ) {
9616 // Support: IE<9
9617 // IE's ActiveXObject throws a 'Type Mismatch' exception when setting
9618 // request header to a null-value.
9619 //
9620 // To keep consistent with other XHR implementations, cast the value
9621 // to string and ignore `undefined`.
9622 if ( headers[ i ] !== undefined ) {
9623 xhr.setRequestHeader( i, headers[ i ] + "" );
9624 }
9625 }
9626
9627 // Do send the request
9628 // This may raise an exception which is actually
9629 // handled in jQuery.ajax (so no try/catch here)
9630 xhr.send( ( options.hasContent && options.data ) || null );
9631
9632 // Listener
9633 callback = function( _, isAbort ) {
9634 var status, statusText, responses;
9635
9636 // Was never called and is aborted or complete
9637 if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
9638 // Clean up
9639 delete xhrCallbacks[ id ];
9640 callback = undefined;
9641 xhr.onreadystatechange = jQuery.noop;
9642
9643 // Abort manually if needed
9644 if ( isAbort ) {
9645 if ( xhr.readyState !== 4 ) {
9646 xhr.abort();
9647 }
9648 } else {
9649 responses = {};
9650 status = xhr.status;
9651
9652 // Support: IE<10
9653 // Accessing binary-data responseText throws an exception
9654 // (#11426)
9655 if ( typeof xhr.responseText === "string" ) {
9656 responses.text = xhr.responseText;
9657 }
9658
9659 // Firefox throws an exception when accessing
9660 // statusText for faulty cross-domain requests
9661 try {
9662 statusText = xhr.statusText;
9663 } catch( e ) {
9664 // We normalize with Webkit giving an empty statusText
9665 statusText = "";
9666 }
9667
9668 // Filter status for non standard behaviors
9669
9670 // If the request is local and we have data: assume a success
9671 // (success with no data won't get notified, that's the best we
9672 // can do given current implementations)
9673 if ( !status && options.isLocal && !options.crossDomain ) {
9674 status = responses.text ? 200 : 404;
9675 // IE - #1450: sometimes returns 1223 when it should be 204
9676 } else if ( status === 1223 ) {
9677 status = 204;
9678 }
9679 }
9680 }
9681
9682 // Call complete if needed
9683 if ( responses ) {
9684 complete( status, statusText, responses, xhr.getAllResponseHeaders() );
9685 }
9686 };
9687
9688 if ( !options.async ) {
9689 // if we're in sync mode we fire the callback
9690 callback();
9691 } else if ( xhr.readyState === 4 ) {
9692 // (IE6 & IE7) if it's in cache and has been
9693 // retrieved directly we need to fire the callback
9694 setTimeout( callback );
9695 } else {
9696 // Add to the list of active xhr callbacks
9697 xhr.onreadystatechange = xhrCallbacks[ id ] = callback;
9698 }
9699 },
9700
9701 abort: function() {
9702 if ( callback ) {
9703 callback( undefined, true );
9704 }
9705 }
9706 };
9707 }
9708 });
9709 }
9710
9711 // Functions to create xhrs
9712 function createStandardXHR() {
9713 try {
9714 return new window.XMLHttpRequest();
9715 } catch( e ) {}
9716 }
9717
9718 function createActiveXHR() {
9719 try {
9720 return new window.ActiveXObject( "Microsoft.XMLHTTP" );
9721 } catch( e ) {}
9722 }
9723
9724
9725
9726
9727 // Install script dataType
9728 jQuery.ajaxSetup({
9729 accepts: {
9730 script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
9731 },
9732 contents: {
9733 script: /(?:java|ecma)script/
9734 },
9735 converters: {
9736 "text script": function( text ) {
9737 jQuery.globalEval( text );
9738 return text;
9739 }
9740 }
9741 });
9742
9743 // Handle cache's special case and global
9744 jQuery.ajaxPrefilter( "script", function( s ) {
9745 if ( s.cache === undefined ) {
9746 s.cache = false;
9747 }
9748 if ( s.crossDomain ) {
9749 s.type = "GET";
9750 s.global = false;
9751 }
9752 });
9753
9754 // Bind script tag hack transport
9755 jQuery.ajaxTransport( "script", function(s) {
9756
9757 // This transport only deals with cross domain requests
9758 if ( s.crossDomain ) {
9759
9760 var script,
9761 head = document.head || jQuery("head")[0] || document.documentElement;
9762
9763 return {
9764
9765 send: function( _, callback ) {
9766
9767 script = document.createElement("script");
9768
9769 script.async = true;
9770
9771 if ( s.scriptCharset ) {
9772 script.charset = s.scriptCharset;
9773 }
9774
9775 script.src = s.url;
9776
9777 // Attach handlers for all browsers
9778 script.onload = script.onreadystatechange = function( _, isAbort ) {
9779
9780 if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
9781
9782 // Handle memory leak in IE
9783 script.onload = script.onreadystatechange = null;
9784
9785 // Remove the script
9786 if ( script.parentNode ) {
9787 script.parentNode.removeChild( script );
9788 }
9789
9790 // Dereference the script
9791 script = null;
9792
9793 // Callback if not abort
9794 if ( !isAbort ) {
9795 callback( 200, "success" );
9796 }
9797 }
9798 };
9799
9800 // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending
9801 // Use native DOM manipulation to avoid our domManip AJAX trickery
9802 head.insertBefore( script, head.firstChild );
9803 },
9804
9805 abort: function() {
9806 if ( script ) {
9807 script.onload( undefined, true );
9808 }
9809 }
9810 };
9811 }
9812 });
9813
9814
9815
9816
9817 var oldCallbacks = [],
9818 rjsonp = /(=)\?(?=&|$)|\?\?/;
9819
9820 // Default jsonp settings
9821 jQuery.ajaxSetup({
9822 jsonp: "callback",
9823 jsonpCallback: function() {
9824 var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
9825 this[ callback ] = true;
9826 return callback;
9827 }
9828 });
9829
9830 // Detect, normalize options and install callbacks for jsonp requests
9831 jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
9832
9833 var callbackName, overwritten, responseContainer,
9834 jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ?
9835 "url" :
9836 typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data"
9837 );
9838
9839 // Handle iff the expected data type is "jsonp" or we have a parameter to set
9840 if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) {
9841
9842 // Get callback name, remembering preexisting value associated with it
9843 callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
9844 s.jsonpCallback() :
9845 s.jsonpCallback;
9846
9847 // Insert callback into url or form data
9848 if ( jsonProp ) {
9849 s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName );
9850 } else if ( s.jsonp !== false ) {
9851 s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
9852 }
9853
9854 // Use data converter to retrieve json after script execution
9855 s.converters["script json"] = function() {
9856 if ( !responseContainer ) {
9857 jQuery.error( callbackName + " was not called" );
9858 }
9859 return responseContainer[ 0 ];
9860 };
9861
9862 // force json dataType
9863 s.dataTypes[ 0 ] = "json";
9864
9865 // Install callback
9866 overwritten = window[ callbackName ];
9867 window[ callbackName ] = function() {
9868 responseContainer = arguments;
9869 };
9870
9871 // Clean-up function (fires after converters)
9872 jqXHR.always(function() {
9873 // Restore preexisting value
9874 window[ callbackName ] = overwritten;
9875
9876 // Save back as free
9877 if ( s[ callbackName ] ) {
9878 // make sure that re-using the options doesn't screw things around
9879 s.jsonpCallback = originalSettings.jsonpCallback;
9880
9881 // save the callback name for future use
9882 oldCallbacks.push( callbackName );
9883 }
9884
9885 // Call if it was a function and we have a response
9886 if ( responseContainer && jQuery.isFunction( overwritten ) ) {
9887 overwritten( responseContainer[ 0 ] );
9888 }
9889
9890 responseContainer = overwritten = undefined;
9891 });
9892
9893 // Delegate to script
9894 return "script";
9895 }
9896 });
9897
9898
9899
9900
9901 // data: string of html
9902 // context (optional): If specified, the fragment will be created in this context, defaults to document
9903 // keepScripts (optional): If true, will include scripts passed in the html string
9904 jQuery.parseHTML = function( data, context, keepScripts ) {
9905 if ( !data || typeof data !== "string" ) {
9906 return null;
9907 }
9908 if ( typeof context === "boolean" ) {
9909 keepScripts = context;
9910 context = false;
9911 }
9912 context = context || document;
9913
9914 var parsed = rsingleTag.exec( data ),
9915 scripts = !keepScripts && [];
9916
9917 // Single tag
9918 if ( parsed ) {
9919 return [ context.createElement( parsed[1] ) ];
9920 }
9921
9922 parsed = jQuery.buildFragment( [ data ], context, scripts );
9923
9924 if ( scripts && scripts.length ) {
9925 jQuery( scripts ).remove();
9926 }
9927
9928 return jQuery.merge( [], parsed.childNodes );
9929 };
9930
9931
9932 // Keep a copy of the old load method
9933 var _load = jQuery.fn.load;
9934
9935 /**
9936 * Load a url into a page
9937 */
9938 jQuery.fn.load = function( url, params, callback ) {
9939 if ( typeof url !== "string" && _load ) {
9940 return _load.apply( this, arguments );
9941 }
9942
9943 var selector, response, type,
9944 self = this,
9945 off = url.indexOf(" ");
9946
9947 if ( off >= 0 ) {
9948 selector = jQuery.trim( url.slice( off, url.length ) );
9949 url = url.slice( 0, off );
9950 }
9951
9952 // If it's a function
9953 if ( jQuery.isFunction( params ) ) {
9954
9955 // We assume that it's the callback
9956 callback = params;
9957 params = undefined;
9958
9959 // Otherwise, build a param string
9960 } else if ( params && typeof params === "object" ) {
9961 type = "POST";
9962 }
9963
9964 // If we have elements to modify, make the request
9965 if ( self.length > 0 ) {
9966 jQuery.ajax({
9967 url: url,
9968
9969 // if "type" variable is undefined, then "GET" method will be used
9970 type: type,
9971 dataType: "html",
9972 data: params
9973 }).done(function( responseText ) {
9974
9975 // Save response for use in complete callback
9976 response = arguments;
9977
9978 self.html( selector ?
9979
9980 // If a selector was specified, locate the right elements in a dummy div
9981 // Exclude scripts to avoid IE 'Permission Denied' errors
9982 jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) :
9983
9984 // Otherwise use the full result
9985 responseText );
9986
9987 }).complete( callback && function( jqXHR, status ) {
9988 self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
9989 });
9990 }
9991
9992 return this;
9993 };
9994
9995
9996
9997
9998 jQuery.expr.filters.animated = function( elem ) {
9999 return jQuery.grep(jQuery.timers, function( fn ) {
10000 return elem === fn.elem;
10001 }).length;
10002 };
10003
10004
10005
10006
10007
10008 var docElem = window.document.documentElement;
10009
10010 /**
10011 * Gets a window from an element
10012 */
10013 function getWindow( elem ) {
10014 return jQuery.isWindow( elem ) ?
10015 elem :
10016 elem.nodeType === 9 ?
10017 elem.defaultView || elem.parentWindow :
10018 false;
10019 }
10020
10021 jQuery.offset = {
10022 setOffset: function( elem, options, i ) {
10023 var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition,
10024 position = jQuery.css( elem, "position" ),
10025 curElem = jQuery( elem ),
10026 props = {};
10027
10028 // set position first, in-case top/left are set even on static elem
10029 if ( position === "static" ) {
10030 elem.style.position = "relative";
10031 }
10032
10033 curOffset = curElem.offset();
10034 curCSSTop = jQuery.css( elem, "top" );
10035 curCSSLeft = jQuery.css( elem, "left" );
10036 calculatePosition = ( position === "absolute" || position === "fixed" ) &&
10037 jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1;
10038
10039 // need to be able to calculate position if either top or left is auto and position is either absolute or fixed
10040 if ( calculatePosition ) {
10041 curPosition = curElem.position();
10042 curTop = curPosition.top;
10043 curLeft = curPosition.left;
10044 } else {
10045 curTop = parseFloat( curCSSTop ) || 0;
10046 curLeft = parseFloat( curCSSLeft ) || 0;
10047 }
10048
10049 if ( jQuery.isFunction( options ) ) {
10050 options = options.call( elem, i, curOffset );
10051 }
10052
10053 if ( options.top != null ) {
10054 props.top = ( options.top - curOffset.top ) + curTop;
10055 }
10056 if ( options.left != null ) {
10057 props.left = ( options.left - curOffset.left ) + curLeft;
10058 }
10059
10060 if ( "using" in options ) {
10061 options.using.call( elem, props );
10062 } else {
10063 curElem.css( props );
10064 }
10065 }
10066 };
10067
10068 jQuery.fn.extend({
10069 offset: function( options ) {
10070 if ( arguments.length ) {
10071 return options === undefined ?
10072 this :
10073 this.each(function( i ) {
10074 jQuery.offset.setOffset( this, options, i );
10075 });
10076 }
10077
10078 var docElem, win,
10079 box = { top: 0, left: 0 },
10080 elem = this[ 0 ],
10081 doc = elem && elem.ownerDocument;
10082
10083 if ( !doc ) {
10084 return;
10085 }
10086
10087 docElem = doc.documentElement;
10088
10089 // Make sure it's not a disconnected DOM node
10090 if ( !jQuery.contains( docElem, elem ) ) {
10091 return box;
10092 }
10093
10094 // If we don't have gBCR, just use 0,0 rather than error
10095 // BlackBerry 5, iOS 3 (original iPhone)
10096 if ( typeof elem.getBoundingClientRect !== strundefined ) {
10097 box = elem.getBoundingClientRect();
10098 }
10099 win = getWindow( doc );
10100 return {
10101 top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ),
10102 left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 )
10103 };
10104 },
10105
10106 position: function() {
10107 if ( !this[ 0 ] ) {
10108 return;
10109 }
10110
10111 var offsetParent, offset,
10112 parentOffset = { top: 0, left: 0 },
10113 elem = this[ 0 ];
10114
10115 // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent
10116 if ( jQuery.css( elem, "position" ) === "fixed" ) {
10117 // we assume that getBoundingClientRect is available when computed position is fixed
10118 offset = elem.getBoundingClientRect();
10119 } else {
10120 // Get *real* offsetParent
10121 offsetParent = this.offsetParent();
10122
10123 // Get correct offsets
10124 offset = this.offset();
10125 if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) {
10126 parentOffset = offsetParent.offset();
10127 }
10128
10129 // Add offsetParent borders
10130 parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true );
10131 parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true );
10132 }
10133
10134 // Subtract parent offsets and element margins
10135 // note: when an element has margin: auto the offsetLeft and marginLeft
10136 // are the same in Safari causing offset.left to incorrectly be 0
10137 return {
10138 top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ),
10139 left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true)
10140 };
10141 },
10142
10143 offsetParent: function() {
10144 return this.map(function() {
10145 var offsetParent = this.offsetParent || docElem;
10146
10147 while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) {
10148 offsetParent = offsetParent.offsetParent;
10149 }
10150 return offsetParent || docElem;
10151 });
10152 }
10153 });
10154
10155 // Create scrollLeft and scrollTop methods
10156 jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) {
10157 var top = /Y/.test( prop );
10158
10159 jQuery.fn[ method ] = function( val ) {
10160 return access( this, function( elem, method, val ) {
10161 var win = getWindow( elem );
10162
10163 if ( val === undefined ) {
10164 return win ? (prop in win) ? win[ prop ] :
10165 win.document.documentElement[ method ] :
10166 elem[ method ];
10167 }
10168
10169 if ( win ) {
10170 win.scrollTo(
10171 !top ? val : jQuery( win ).scrollLeft(),
10172 top ? val : jQuery( win ).scrollTop()
10173 );
10174
10175 } else {
10176 elem[ method ] = val;
10177 }
10178 }, method, val, arguments.length, null );
10179 };
10180 });
10181
10182 // Add the top/left cssHooks using jQuery.fn.position
10183 // Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
10184 // getComputedStyle returns percent when specified for top/left/bottom/right
10185 // rather than make the css module depend on the offset module, we just check for it here
10186 jQuery.each( [ "top", "left" ], function( i, prop ) {
10187 jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition,
10188 function( elem, computed ) {
10189 if ( computed ) {
10190 computed = curCSS( elem, prop );
10191 // if curCSS returns percentage, fallback to offset
10192 return rnumnonpx.test( computed ) ?
10193 jQuery( elem ).position()[ prop ] + "px" :
10194 computed;
10195 }
10196 }
10197 );
10198 });
10199
10200
10201 // Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
10202 jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
10203 jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
10204 // margin is only for outerHeight, outerWidth
10205 jQuery.fn[ funcName ] = function( margin, value ) {
10206 var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
10207 extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
10208
10209 return access( this, function( elem, type, value ) {
10210 var doc;
10211
10212 if ( jQuery.isWindow( elem ) ) {
10213 // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
10214 // isn't a whole lot we can do. See pull request at this URL for discussion:
10215 // https://github.com/jquery/jquery/pull/764
10216 return elem.document.documentElement[ "client" + name ];
10217 }
10218
10219 // Get document width or height
10220 if ( elem.nodeType === 9 ) {
10221 doc = elem.documentElement;
10222
10223 // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
10224 // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
10225 return Math.max(
10226 elem.body[ "scroll" + name ], doc[ "scroll" + name ],
10227 elem.body[ "offset" + name ], doc[ "offset" + name ],
10228 doc[ "client" + name ]
10229 );
10230 }
10231
10232 return value === undefined ?
10233 // Get width or height on the element, requesting but not forcing parseFloat
10234 jQuery.css( elem, type, extra ) :
10235
10236 // Set width or height on the element
10237 jQuery.style( elem, type, value, extra );
10238 }, type, chainable ? margin : undefined, chainable, null );
10239 };
10240 });
10241 });
10242
10243
10244 // The number of elements contained in the matched element set
10245 jQuery.fn.size = function() {
10246 return this.length;
10247 };
10248
10249 jQuery.fn.andSelf = jQuery.fn.addBack;
10250
10251
10252
10253
10254 // Register as a named AMD module, since jQuery can be concatenated with other
10255 // files that may use define, but not via a proper concatenation script that
10256 // understands anonymous AMD modules. A named AMD is safest and most robust
10257 // way to register. Lowercase jquery is used because AMD module names are
10258 // derived from file names, and jQuery is normally delivered in a lowercase
10259 // file name. Do this after creating the global so that if an AMD module wants
10260 // to call noConflict to hide this version of jQuery, it will work.
10261
10262 // Note that for maximum portability, libraries that are not jQuery should
10263 // declare themselves as anonymous modules, and avoid setting a global if an
10264 // AMD loader is present. jQuery is a special case. For more information, see
10265 // https://github.com/jrburke/requirejs/wiki/Updating-existing-libraries#wiki-anon
10266
10267 if ( typeof define === "function" && define.amd ) {
10268 define( "jquery", [], function() {
10269 return jQuery;
10270 });
10271 }
10272
10273
10274
10275
10276 var
10277 // Map over jQuery in case of overwrite
10278 _jQuery = window.jQuery,
10279
10280 // Map over the $ in case of overwrite
10281 _$ = window.$;
10282
10283 jQuery.noConflict = function( deep ) {
10284 if ( window.$ === jQuery ) {
10285 window.$ = _$;
10286 }
10287
10288 if ( deep && window.jQuery === jQuery ) {
10289 window.jQuery = _jQuery;
10290 }
10291
10292 return jQuery;
10293 };
10294
10295 // Expose jQuery and $ identifiers, even in
10296 // AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557)
10297 // and CommonJS for browser emulators (#13566)
10298 if ( typeof noGlobal === strundefined ) {
10299 window.jQuery = window.$ = jQuery;
10300 }
10301
10302
10303
10304
10305 return jQuery;
10306
10307 }));
0 // Underscore.js 1.3.1
1 // (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
2 // Underscore is freely distributable under the MIT license.
3 // Portions of Underscore are inspired or borrowed from Prototype,
4 // Oliver Steele's Functional, and John Resig's Micro-Templating.
5 // For all details and documentation:
6 // http://documentcloud.github.com/underscore
7
8 (function() {
9
10 // Baseline setup
11 // --------------
12
13 // Establish the root object, `window` in the browser, or `global` on the server.
14 var root = this;
15
16 // Save the previous value of the `_` variable.
17 var previousUnderscore = root._;
18
19 // Establish the object that gets returned to break out of a loop iteration.
20 var breaker = {};
21
22 // Save bytes in the minified (but not gzipped) version:
23 var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
24
25 // Create quick reference variables for speed access to core prototypes.
26 var slice = ArrayProto.slice,
27 unshift = ArrayProto.unshift,
28 toString = ObjProto.toString,
29 hasOwnProperty = ObjProto.hasOwnProperty;
30
31 // All **ECMAScript 5** native function implementations that we hope to use
32 // are declared here.
33 var
34 nativeForEach = ArrayProto.forEach,
35 nativeMap = ArrayProto.map,
36 nativeReduce = ArrayProto.reduce,
37 nativeReduceRight = ArrayProto.reduceRight,
38 nativeFilter = ArrayProto.filter,
39 nativeEvery = ArrayProto.every,
40 nativeSome = ArrayProto.some,
41 nativeIndexOf = ArrayProto.indexOf,
42 nativeLastIndexOf = ArrayProto.lastIndexOf,
43 nativeIsArray = Array.isArray,
44 nativeKeys = Object.keys,
45 nativeBind = FuncProto.bind;
46
47 // Create a safe reference to the Underscore object for use below.
48 var _ = function(obj) { return new wrapper(obj); };
49
50 // Export the Underscore object for **Node.js**, with
51 // backwards-compatibility for the old `require()` API. If we're in
52 // the browser, add `_` as a global object via a string identifier,
53 // for Closure Compiler "advanced" mode.
54 if (typeof exports !== 'undefined') {
55 if (typeof module !== 'undefined' && module.exports) {
56 exports = module.exports = _;
57 }
58 exports._ = _;
59 } else {
60 root['_'] = _;
61 }
62
63 // Current version.
64 _.VERSION = '1.3.1';
65
66 // Collection Functions
67 // --------------------
68
69 // The cornerstone, an `each` implementation, aka `forEach`.
70 // Handles objects with the built-in `forEach`, arrays, and raw objects.
71 // Delegates to **ECMAScript 5**'s native `forEach` if available.
72 var each = _.each = _.forEach = function(obj, iterator, context) {
73 if (obj == null) return;
74 if (nativeForEach && obj.forEach === nativeForEach) {
75 obj.forEach(iterator, context);
76 } else if (obj.length === +obj.length) {
77 for (var i = 0, l = obj.length; i < l; i++) {
78 if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
79 }
80 } else {
81 for (var key in obj) {
82 if (_.has(obj, key)) {
83 if (iterator.call(context, obj[key], key, obj) === breaker) return;
84 }
85 }
86 }
87 };
88
89 // Return the results of applying the iterator to each element.
90 // Delegates to **ECMAScript 5**'s native `map` if available.
91 _.map = _.collect = function(obj, iterator, context) {
92 var results = [];
93 if (obj == null) return results;
94 if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
95 each(obj, function(value, index, list) {
96 results[results.length] = iterator.call(context, value, index, list);
97 });
98 if (obj.length === +obj.length) results.length = obj.length;
99 return results;
100 };
101
102 // **Reduce** builds up a single result from a list of values, aka `inject`,
103 // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
104 _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
105 var initial = arguments.length > 2;
106 if (obj == null) obj = [];
107 if (nativeReduce && obj.reduce === nativeReduce) {
108 if (context) iterator = _.bind(iterator, context);
109 return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
110 }
111 each(obj, function(value, index, list) {
112 if (!initial) {
113 memo = value;
114 initial = true;
115 } else {
116 memo = iterator.call(context, memo, value, index, list);
117 }
118 });
119 if (!initial) throw new TypeError('Reduce of empty array with no initial value');
120 return memo;
121 };
122
123 // The right-associative version of reduce, also known as `foldr`.
124 // Delegates to **ECMAScript 5**'s native `reduceRight` if available.
125 _.reduceRight = _.foldr = function(obj, iterator, memo, context) {
126 var initial = arguments.length > 2;
127 if (obj == null) obj = [];
128 if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
129 if (context) iterator = _.bind(iterator, context);
130 return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
131 }
132 var reversed = _.toArray(obj).reverse();
133 if (context && !initial) iterator = _.bind(iterator, context);
134 return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);
135 };
136
137 // Return the first value which passes a truth test. Aliased as `detect`.
138 _.find = _.detect = function(obj, iterator, context) {
139 var result;
140 any(obj, function(value, index, list) {
141 if (iterator.call(context, value, index, list)) {
142 result = value;
143 return true;
144 }
145 });
146 return result;
147 };
148
149 // Return all the elements that pass a truth test.
150 // Delegates to **ECMAScript 5**'s native `filter` if available.
151 // Aliased as `select`.
152 _.filter = _.select = function(obj, iterator, context) {
153 var results = [];
154 if (obj == null) return results;
155 if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
156 each(obj, function(value, index, list) {
157 if (iterator.call(context, value, index, list)) results[results.length] = value;
158 });
159 return results;
160 };
161
162 // Return all the elements for which a truth test fails.
163 _.reject = function(obj, iterator, context) {
164 var results = [];
165 if (obj == null) return results;
166 each(obj, function(value, index, list) {
167 if (!iterator.call(context, value, index, list)) results[results.length] = value;
168 });
169 return results;
170 };
171
172 // Determine whether all of the elements match a truth test.
173 // Delegates to **ECMAScript 5**'s native `every` if available.
174 // Aliased as `all`.
175 _.every = _.all = function(obj, iterator, context) {
176 var result = true;
177 if (obj == null) return result;
178 if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
179 each(obj, function(value, index, list) {
180 if (!(result = result && iterator.call(context, value, index, list))) return breaker;
181 });
182 return result;
183 };
184
185 // Determine if at least one element in the object matches a truth test.
186 // Delegates to **ECMAScript 5**'s native `some` if available.
187 // Aliased as `any`.
188 var any = _.some = _.any = function(obj, iterator, context) {
189 iterator || (iterator = _.identity);
190 var result = false;
191 if (obj == null) return result;
192 if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
193 each(obj, function(value, index, list) {
194 if (result || (result = iterator.call(context, value, index, list))) return breaker;
195 });
196 return !!result;
197 };
198
199 // Determine if a given value is included in the array or object using `===`.
200 // Aliased as `contains`.
201 _.include = _.contains = function(obj, target) {
202 var found = false;
203 if (obj == null) return found;
204 if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
205 found = any(obj, function(value) {
206 return value === target;
207 });
208 return found;
209 };
210
211 // Invoke a method (with arguments) on every item in a collection.
212 _.invoke = function(obj, method) {
213 var args = slice.call(arguments, 2);
214 return _.map(obj, function(value) {
215 return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
216 });
217 };
218
219 // Convenience version of a common use case of `map`: fetching a property.
220 _.pluck = function(obj, key) {
221 return _.map(obj, function(value){ return value[key]; });
222 };
223
224 // Return the maximum element or (element-based computation).
225 _.max = function(obj, iterator, context) {
226 if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
227 if (!iterator && _.isEmpty(obj)) return -Infinity;
228 var result = {computed : -Infinity};
229 each(obj, function(value, index, list) {
230 var computed = iterator ? iterator.call(context, value, index, list) : value;
231 computed >= result.computed && (result = {value : value, computed : computed});
232 });
233 return result.value;
234 };
235
236 // Return the minimum element (or element-based computation).
237 _.min = function(obj, iterator, context) {
238 if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
239 if (!iterator && _.isEmpty(obj)) return Infinity;
240 var result = {computed : Infinity};
241 each(obj, function(value, index, list) {
242 var computed = iterator ? iterator.call(context, value, index, list) : value;
243 computed < result.computed && (result = {value : value, computed : computed});
244 });
245 return result.value;
246 };
247
248 // Shuffle an array.
249 _.shuffle = function(obj) {
250 var shuffled = [], rand;
251 each(obj, function(value, index, list) {
252 if (index == 0) {
253 shuffled[0] = value;
254 } else {
255 rand = Math.floor(Math.random() * (index + 1));
256 shuffled[index] = shuffled[rand];
257 shuffled[rand] = value;
258 }
259 });
260 return shuffled;
261 };
262
263 // Sort the object's values by a criterion produced by an iterator.
264 _.sortBy = function(obj, iterator, context) {
265 return _.pluck(_.map(obj, function(value, index, list) {
266 return {
267 value : value,
268 criteria : iterator.call(context, value, index, list)
269 };
270 }).sort(function(left, right) {
271 var a = left.criteria, b = right.criteria;
272 return a < b ? -1 : a > b ? 1 : 0;
273 }), 'value');
274 };
275
276 // Groups the object's values by a criterion. Pass either a string attribute
277 // to group by, or a function that returns the criterion.
278 _.groupBy = function(obj, val) {
279 var result = {};
280 var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
281 each(obj, function(value, index) {
282 var key = iterator(value, index);
283 (result[key] || (result[key] = [])).push(value);
284 });
285 return result;
286 };
287
288 // Use a comparator function to figure out at what index an object should
289 // be inserted so as to maintain order. Uses binary search.
290 _.sortedIndex = function(array, obj, iterator) {
291 iterator || (iterator = _.identity);
292 var low = 0, high = array.length;
293 while (low < high) {
294 var mid = (low + high) >> 1;
295 iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
296 }
297 return low;
298 };
299
300 // Safely convert anything iterable into a real, live array.
301 _.toArray = function(iterable) {
302 if (!iterable) return [];
303 if (iterable.toArray) return iterable.toArray();
304 if (_.isArray(iterable)) return slice.call(iterable);
305 if (_.isArguments(iterable)) return slice.call(iterable);
306 return _.values(iterable);
307 };
308
309 // Return the number of elements in an object.
310 _.size = function(obj) {
311 return _.toArray(obj).length;
312 };
313
314 // Array Functions
315 // ---------------
316
317 // Get the first element of an array. Passing **n** will return the first N
318 // values in the array. Aliased as `head`. The **guard** check allows it to work
319 // with `_.map`.
320 _.first = _.head = function(array, n, guard) {
321 return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
322 };
323
324 // Returns everything but the last entry of the array. Especcialy useful on
325 // the arguments object. Passing **n** will return all the values in
326 // the array, excluding the last N. The **guard** check allows it to work with
327 // `_.map`.
328 _.initial = function(array, n, guard) {
329 return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
330 };
331
332 // Get the last element of an array. Passing **n** will return the last N
333 // values in the array. The **guard** check allows it to work with `_.map`.
334 _.last = function(array, n, guard) {
335 if ((n != null) && !guard) {
336 return slice.call(array, Math.max(array.length - n, 0));
337 } else {
338 return array[array.length - 1];
339 }
340 };
341
342 // Returns everything but the first entry of the array. Aliased as `tail`.
343 // Especially useful on the arguments object. Passing an **index** will return
344 // the rest of the values in the array from that index onward. The **guard**
345 // check allows it to work with `_.map`.
346 _.rest = _.tail = function(array, index, guard) {
347 return slice.call(array, (index == null) || guard ? 1 : index);
348 };
349
350 // Trim out all falsy values from an array.
351 _.compact = function(array) {
352 return _.filter(array, function(value){ return !!value; });
353 };
354
355 // Return a completely flattened version of an array.
356 _.flatten = function(array, shallow) {
357 return _.reduce(array, function(memo, value) {
358 if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));
359 memo[memo.length] = value;
360 return memo;
361 }, []);
362 };
363
364 // Return a version of the array that does not contain the specified value(s).
365 _.without = function(array) {
366 return _.difference(array, slice.call(arguments, 1));
367 };
368
369 // Produce a duplicate-free version of the array. If the array has already
370 // been sorted, you have the option of using a faster algorithm.
371 // Aliased as `unique`.
372 _.uniq = _.unique = function(array, isSorted, iterator) {
373 var initial = iterator ? _.map(array, iterator) : array;
374 var result = [];
375 _.reduce(initial, function(memo, el, i) {
376 if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) {
377 memo[memo.length] = el;
378 result[result.length] = array[i];
379 }
380 return memo;
381 }, []);
382 return result;
383 };
384
385 // Produce an array that contains the union: each distinct element from all of
386 // the passed-in arrays.
387 _.union = function() {
388 return _.uniq(_.flatten(arguments, true));
389 };
390
391 // Produce an array that contains every item shared between all the
392 // passed-in arrays. (Aliased as "intersect" for back-compat.)
393 _.intersection = _.intersect = function(array) {
394 var rest = slice.call(arguments, 1);
395 return _.filter(_.uniq(array), function(item) {
396 return _.every(rest, function(other) {
397 return _.indexOf(other, item) >= 0;
398 });
399 });
400 };
401
402 // Take the difference between one array and a number of other arrays.
403 // Only the elements present in just the first array will remain.
404 _.difference = function(array) {
405 var rest = _.flatten(slice.call(arguments, 1));
406 return _.filter(array, function(value){ return !_.include(rest, value); });
407 };
408
409 // Zip together multiple lists into a single array -- elements that share
410 // an index go together.
411 _.zip = function() {
412 var args = slice.call(arguments);
413 var length = _.max(_.pluck(args, 'length'));
414 var results = new Array(length);
415 for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
416 return results;
417 };
418
419 // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
420 // we need this function. Return the position of the first occurrence of an
421 // item in an array, or -1 if the item is not included in the array.
422 // Delegates to **ECMAScript 5**'s native `indexOf` if available.
423 // If the array is large and already in sort order, pass `true`
424 // for **isSorted** to use binary search.
425 _.indexOf = function(array, item, isSorted) {
426 if (array == null) return -1;
427 var i, l;
428 if (isSorted) {
429 i = _.sortedIndex(array, item);
430 return array[i] === item ? i : -1;
431 }
432 if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
433 for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;
434 return -1;
435 };
436
437 // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
438 _.lastIndexOf = function(array, item) {
439 if (array == null) return -1;
440 if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
441 var i = array.length;
442 while (i--) if (i in array && array[i] === item) return i;
443 return -1;
444 };
445
446 // Generate an integer Array containing an arithmetic progression. A port of
447 // the native Python `range()` function. See
448 // [the Python documentation](http://docs.python.org/library/functions.html#range).
449 _.range = function(start, stop, step) {
450 if (arguments.length <= 1) {
451 stop = start || 0;
452 start = 0;
453 }
454 step = arguments[2] || 1;
455
456 var len = Math.max(Math.ceil((stop - start) / step), 0);
457 var idx = 0;
458 var range = new Array(len);
459
460 while(idx < len) {
461 range[idx++] = start;
462 start += step;
463 }
464
465 return range;
466 };
467
468 // Function (ahem) Functions
469 // ------------------
470
471 // Reusable constructor function for prototype setting.
472 var ctor = function(){};
473
474 // Create a function bound to a given object (assigning `this`, and arguments,
475 // optionally). Binding with arguments is also known as `curry`.
476 // Delegates to **ECMAScript 5**'s native `Function.bind` if available.
477 // We check for `func.bind` first, to fail fast when `func` is undefined.
478 _.bind = function bind(func, context) {
479 var bound, args;
480 if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
481 if (!_.isFunction(func)) throw new TypeError;
482 args = slice.call(arguments, 2);
483 return bound = function() {
484 if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
485 ctor.prototype = func.prototype;
486 var self = new ctor;
487 var result = func.apply(self, args.concat(slice.call(arguments)));
488 if (Object(result) === result) return result;
489 return self;
490 };
491 };
492
493 // Bind all of an object's methods to that object. Useful for ensuring that
494 // all callbacks defined on an object belong to it.
495 _.bindAll = function(obj) {
496 var funcs = slice.call(arguments, 1);
497 if (funcs.length == 0) funcs = _.functions(obj);
498 each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
499 return obj;
500 };
501
502 // Memoize an expensive function by storing its results.
503 _.memoize = function(func, hasher) {
504 var memo = {};
505 hasher || (hasher = _.identity);
506 return function() {
507 var key = hasher.apply(this, arguments);
508 return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
509 };
510 };
511
512 // Delays a function for the given number of milliseconds, and then calls
513 // it with the arguments supplied.
514 _.delay = function(func, wait) {
515 var args = slice.call(arguments, 2);
516 return setTimeout(function(){ return func.apply(func, args); }, wait);
517 };
518
519 // Defers a function, scheduling it to run after the current call stack has
520 // cleared.
521 _.defer = function(func) {
522 return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
523 };
524
525 // Returns a function, that, when invoked, will only be triggered at most once
526 // during a given window of time.
527 _.throttle = function(func, wait) {
528 var context, args, timeout, throttling, more;
529 var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
530 return function() {
531 context = this; args = arguments;
532 var later = function() {
533 timeout = null;
534 if (more) func.apply(context, args);
535 whenDone();
536 };
537 if (!timeout) timeout = setTimeout(later, wait);
538 if (throttling) {
539 more = true;
540 } else {
541 func.apply(context, args);
542 }
543 whenDone();
544 throttling = true;
545 };
546 };
547
548 // Returns a function, that, as long as it continues to be invoked, will not
549 // be triggered. The function will be called after it stops being called for
550 // N milliseconds.
551 _.debounce = function(func, wait) {
552 var timeout;
553 return function() {
554 var context = this, args = arguments;
555 var later = function() {
556 timeout = null;
557 func.apply(context, args);
558 };
559 clearTimeout(timeout);
560 timeout = setTimeout(later, wait);
561 };
562 };
563
564 // Returns a function that will be executed at most one time, no matter how
565 // often you call it. Useful for lazy initialization.
566 _.once = function(func) {
567 var ran = false, memo;
568 return function() {
569 if (ran) return memo;
570 ran = true;
571 return memo = func.apply(this, arguments);
572 };
573 };
574
575 // Returns the first function passed as an argument to the second,
576 // allowing you to adjust arguments, run code before and after, and
577 // conditionally execute the original function.
578 _.wrap = function(func, wrapper) {
579 return function() {
580 var args = [func].concat(slice.call(arguments, 0));
581 return wrapper.apply(this, args);
582 };
583 };
584
585 // Returns a function that is the composition of a list of functions, each
586 // consuming the return value of the function that follows.
587 _.compose = function() {
588 var funcs = arguments;
589 return function() {
590 var args = arguments;
591 for (var i = funcs.length - 1; i >= 0; i--) {
592 args = [funcs[i].apply(this, args)];
593 }
594 return args[0];
595 };
596 };
597
598 // Returns a function that will only be executed after being called N times.
599 _.after = function(times, func) {
600 if (times <= 0) return func();
601 return function() {
602 if (--times < 1) { return func.apply(this, arguments); }
603 };
604 };
605
606 // Object Functions
607 // ----------------
608
609 // Retrieve the names of an object's properties.
610 // Delegates to **ECMAScript 5**'s native `Object.keys`
611 _.keys = nativeKeys || function(obj) {
612 if (obj !== Object(obj)) throw new TypeError('Invalid object');
613 var keys = [];
614 for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
615 return keys;
616 };
617
618 // Retrieve the values of an object's properties.
619 _.values = function(obj) {
620 return _.map(obj, _.identity);
621 };
622
623 // Return a sorted list of the function names available on the object.
624 // Aliased as `methods`
625 _.functions = _.methods = function(obj) {
626 var names = [];
627 for (var key in obj) {
628 if (_.isFunction(obj[key])) names.push(key);
629 }
630 return names.sort();
631 };
632
633 // Extend a given object with all the properties in passed-in object(s).
634 _.extend = function(obj) {
635 each(slice.call(arguments, 1), function(source) {
636 for (var prop in source) {
637 obj[prop] = source[prop];
638 }
639 });
640 return obj;
641 };
642
643 // Fill in a given object with default properties.
644 _.defaults = function(obj) {
645 each(slice.call(arguments, 1), function(source) {
646 for (var prop in source) {
647 if (obj[prop] == null) obj[prop] = source[prop];
648 }
649 });
650 return obj;
651 };
652
653 // Create a (shallow-cloned) duplicate of an object.
654 _.clone = function(obj) {
655 if (!_.isObject(obj)) return obj;
656 return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
657 };
658
659 // Invokes interceptor with the obj, and then returns obj.
660 // The primary purpose of this method is to "tap into" a method chain, in
661 // order to perform operations on intermediate results within the chain.
662 _.tap = function(obj, interceptor) {
663 interceptor(obj);
664 return obj;
665 };
666
667 // Internal recursive comparison function.
668 function eq(a, b, stack) {
669 // Identical objects are equal. `0 === -0`, but they aren't identical.
670 // See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
671 if (a === b) return a !== 0 || 1 / a == 1 / b;
672 // A strict comparison is necessary because `null == undefined`.
673 if (a == null || b == null) return a === b;
674 // Unwrap any wrapped objects.
675 if (a._chain) a = a._wrapped;
676 if (b._chain) b = b._wrapped;
677 // Invoke a custom `isEqual` method if one is provided.
678 if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);
679 if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);
680 // Compare `[[Class]]` names.
681 var className = toString.call(a);
682 if (className != toString.call(b)) return false;
683 switch (className) {
684 // Strings, numbers, dates, and booleans are compared by value.
685 case '[object String]':
686 // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
687 // equivalent to `new String("5")`.
688 return a == String(b);
689 case '[object Number]':
690 // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
691 // other numeric values.
692 return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
693 case '[object Date]':
694 case '[object Boolean]':
695 // Coerce dates and booleans to numeric primitive values. Dates are compared by their
696 // millisecond representations. Note that invalid dates with millisecond representations
697 // of `NaN` are not equivalent.
698 return +a == +b;
699 // RegExps are compared by their source patterns and flags.
700 case '[object RegExp]':
701 return a.source == b.source &&
702 a.global == b.global &&
703 a.multiline == b.multiline &&
704 a.ignoreCase == b.ignoreCase;
705 }
706 if (typeof a != 'object' || typeof b != 'object') return false;
707 // Assume equality for cyclic structures. The algorithm for detecting cyclic
708 // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
709 var length = stack.length;
710 while (length--) {
711 // Linear search. Performance is inversely proportional to the number of
712 // unique nested structures.
713 if (stack[length] == a) return true;
714 }
715 // Add the first object to the stack of traversed objects.
716 stack.push(a);
717 var size = 0, result = true;
718 // Recursively compare objects and arrays.
719 if (className == '[object Array]') {
720 // Compare array lengths to determine if a deep comparison is necessary.
721 size = a.length;
722 result = size == b.length;
723 if (result) {
724 // Deep compare the contents, ignoring non-numeric properties.
725 while (size--) {
726 // Ensure commutative equality for sparse arrays.
727 if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;
728 }
729 }
730 } else {
731 // Objects with different constructors are not equivalent.
732 if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
733 // Deep compare objects.
734 for (var key in a) {
735 if (_.has(a, key)) {
736 // Count the expected number of properties.
737 size++;
738 // Deep compare each member.
739 if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;
740 }
741 }
742 // Ensure that both objects contain the same number of properties.
743 if (result) {
744 for (key in b) {
745 if (_.has(b, key) && !(size--)) break;
746 }
747 result = !size;
748 }
749 }
750 // Remove the first object from the stack of traversed objects.
751 stack.pop();
752 return result;
753 }
754
755 // Perform a deep comparison to check if two objects are equal.
756 _.isEqual = function(a, b) {
757 return eq(a, b, []);
758 };
759
760 // Is a given array, string, or object empty?
761 // An "empty" object has no enumerable own-properties.
762 _.isEmpty = function(obj) {
763 if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
764 for (var key in obj) if (_.has(obj, key)) return false;
765 return true;
766 };
767
768 // Is a given value a DOM element?
769 _.isElement = function(obj) {
770 return !!(obj && obj.nodeType == 1);
771 };
772
773 // Is a given value an array?
774 // Delegates to ECMA5's native Array.isArray
775 _.isArray = nativeIsArray || function(obj) {
776 return toString.call(obj) == '[object Array]';
777 };
778
779 // Is a given variable an object?
780 _.isObject = function(obj) {
781 return obj === Object(obj);
782 };
783
784 // Is a given variable an arguments object?
785 _.isArguments = function(obj) {
786 return toString.call(obj) == '[object Arguments]';
787 };
788 if (!_.isArguments(arguments)) {
789 _.isArguments = function(obj) {
790 return !!(obj && _.has(obj, 'callee'));
791 };
792 }
793
794 // Is a given value a function?
795 _.isFunction = function(obj) {
796 return toString.call(obj) == '[object Function]';
797 };
798
799 // Is a given value a string?
800 _.isString = function(obj) {
801 return toString.call(obj) == '[object String]';
802 };
803
804 // Is a given value a number?
805 _.isNumber = function(obj) {
806 return toString.call(obj) == '[object Number]';
807 };
808
809 // Is the given value `NaN`?
810 _.isNaN = function(obj) {
811 // `NaN` is the only value for which `===` is not reflexive.
812 return obj !== obj;
813 };
814
815 // Is a given value a boolean?
816 _.isBoolean = function(obj) {
817 return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
818 };
819
820 // Is a given value a date?
821 _.isDate = function(obj) {
822 return toString.call(obj) == '[object Date]';
823 };
824
825 // Is the given value a regular expression?
826 _.isRegExp = function(obj) {
827 return toString.call(obj) == '[object RegExp]';
828 };
829
830 // Is a given value equal to null?
831 _.isNull = function(obj) {
832 return obj === null;
833 };
834
835 // Is a given variable undefined?
836 _.isUndefined = function(obj) {
837 return obj === void 0;
838 };
839
840 // Has own property?
841 _.has = function(obj, key) {
842 return hasOwnProperty.call(obj, key);
843 };
844
845 // Utility Functions
846 // -----------------
847
848 // Run Underscore.js in *noConflict* mode, returning the `_` variable to its
849 // previous owner. Returns a reference to the Underscore object.
850 _.noConflict = function() {
851 root._ = previousUnderscore;
852 return this;
853 };
854
855 // Keep the identity function around for default iterators.
856 _.identity = function(value) {
857 return value;
858 };
859
860 // Run a function **n** times.
861 _.times = function (n, iterator, context) {
862 for (var i = 0; i < n; i++) iterator.call(context, i);
863 };
864
865 // Escape a string for HTML interpolation.
866 _.escape = function(string) {
867 return (''+string).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g,'&#x2F;');
868 };
869
870 // Add your own custom functions to the Underscore object, ensuring that
871 // they're correctly added to the OOP wrapper as well.
872 _.mixin = function(obj) {
873 each(_.functions(obj), function(name){
874 addToWrapper(name, _[name] = obj[name]);
875 });
876 };
877
878 // Generate a unique integer id (unique within the entire client session).
879 // Useful for temporary DOM ids.
880 var idCounter = 0;
881 _.uniqueId = function(prefix) {
882 var id = idCounter++;
883 return prefix ? prefix + id : id;
884 };
885
886 // By default, Underscore uses ERB-style template delimiters, change the
887 // following template settings to use alternative delimiters.
888 _.templateSettings = {
889 evaluate : /<%([\s\S]+?)%>/g,
890 interpolate : /<%=([\s\S]+?)%>/g,
891 escape : /<%-([\s\S]+?)%>/g
892 };
893
894 // When customizing `templateSettings`, if you don't want to define an
895 // interpolation, evaluation or escaping regex, we need one that is
896 // guaranteed not to match.
897 var noMatch = /.^/;
898
899 // Within an interpolation, evaluation, or escaping, remove HTML escaping
900 // that had been previously added.
901 var unescape = function(code) {
902 return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'");
903 };
904
905 // JavaScript micro-templating, similar to John Resig's implementation.
906 // Underscore templating handles arbitrary delimiters, preserves whitespace,
907 // and correctly escapes quotes within interpolated code.
908 _.template = function(str, data) {
909 var c = _.templateSettings;
910 var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
911 'with(obj||{}){__p.push(\'' +
912 str.replace(/\\/g, '\\\\')
913 .replace(/'/g, "\\'")
914 .replace(c.escape || noMatch, function(match, code) {
915 return "',_.escape(" + unescape(code) + "),'";
916 })
917 .replace(c.interpolate || noMatch, function(match, code) {
918 return "'," + unescape(code) + ",'";
919 })
920 .replace(c.evaluate || noMatch, function(match, code) {
921 return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('";
922 })
923 .replace(/\r/g, '\\r')
924 .replace(/\n/g, '\\n')
925 .replace(/\t/g, '\\t')
926 + "');}return __p.join('');";
927 var func = new Function('obj', '_', tmpl);
928 if (data) return func(data, _);
929 return function(data) {
930 return func.call(this, data, _);
931 };
932 };
933
934 // Add a "chain" function, which will delegate to the wrapper.
935 _.chain = function(obj) {
936 return _(obj).chain();
937 };
938
939 // The OOP Wrapper
940 // ---------------
941
942 // If Underscore is called as a function, it returns a wrapped object that
943 // can be used OO-style. This wrapper holds altered versions of all the
944 // underscore functions. Wrapped objects may be chained.
945 var wrapper = function(obj) { this._wrapped = obj; };
946
947 // Expose `wrapper.prototype` as `_.prototype`
948 _.prototype = wrapper.prototype;
949
950 // Helper function to continue chaining intermediate results.
951 var result = function(obj, chain) {
952 return chain ? _(obj).chain() : obj;
953 };
954
955 // A method to easily add functions to the OOP wrapper.
956 var addToWrapper = function(name, func) {
957 wrapper.prototype[name] = function() {
958 var args = slice.call(arguments);
959 unshift.call(args, this._wrapped);
960 return result(func.apply(_, args), this._chain);
961 };
962 };
963
964 // Add all of the Underscore functions to the wrapper object.
965 _.mixin(_);
966
967 // Add all mutator Array functions to the wrapper.
968 each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
969 var method = ArrayProto[name];
970 wrapper.prototype[name] = function() {
971 var wrapped = this._wrapped;
972 method.apply(wrapped, arguments);
973 var length = wrapped.length;
974 if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
975 return result(wrapped, this._chain);
976 };
977 });
978
979 // Add all accessor Array functions to the wrapper.
980 each(['concat', 'join', 'slice'], function(name) {
981 var method = ArrayProto[name];
982 wrapper.prototype[name] = function() {
983 return result(method.apply(this._wrapped, arguments), this._chain);
984 };
985 });
986
987 // Start chaining a wrapped Underscore object.
988 wrapper.prototype.chain = function() {
989 this._chain = true;
990 return this;
991 };
992
993 // Extracts the result from a wrapped and chained object.
994 wrapper.prototype.value = function() {
995 return this._wrapped;
996 };
997
998 }).call(this);
0 From: Kentaro Hayashi <kenhys@gmail.com>
1 Date: Wed, 5 Feb 2020 20:08:19 +0900
2 Subject: Use user name with underline
3
4 ---
5 data/groonga-httpd.conf.in | 2 +-
6 1 file changed, 1 insertion(+), 1 deletion(-)
7
8 diff --git a/data/groonga-httpd.conf.in b/data/groonga-httpd.conf.in
9 index 9aab975..e4d8aad 100644
10 --- a/data/groonga-httpd.conf.in
11 +++ b/data/groonga-httpd.conf.in
12 @@ -3,7 +3,7 @@ pid @GROONGA_HTTPD_PID_PATH@;
13
14 # Match this to the file owner of Groonga database files if groonga-httpd is
15 # run as root.
16 -user groonga groonga;
17 +user _groonga groonga;
18
19 env GRN_IN_VALUES_TOO_MANY_INDEX_MATCH_RATIO;
20 env GRN_BETWEEN_TOO_MANY_INDEX_MATCH_RATIO;
0 From: Kentaro Hayashi <kenhys@gmail.com>
1 Date: Sat, 2 Nov 2019 21:01:03 +0900
2 Subject: Remove needless groonga-keyring postrm
3
4 ---
5 configure.ac | 1 -
6 1 file changed, 1 deletion(-)
7
8 diff --git a/configure.ac b/configure.ac
9 index c974cd5..03a8f96 100644
10 --- a/configure.ac
11 +++ b/configure.ac
12 @@ -1851,7 +1851,6 @@ AC_CONFIG_FILES([
13 lib/mrb/scripts/query_logger/Makefile
14 lib/proc/Makefile
15 packages/Makefile
16 - packages/apt/debian/groonga-keyring.postrm
17 packages/apt/env.sh
18 packages/source/Makefile
19 plugins/Makefile
0 From: Kentaro Hayashi <hayashi@clear-code.com>
1 Date: Fri, 25 Dec 2020 11:58:58 +0900
2 Subject: Use _GNU_SOURCE on GNU/kFreeBSD
3
4 Define _GNU_SOURCE not only on GNU/Hurd, but also other glibc-based
5 platforms including GNU/kFreeBSD.
6
7 See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826061#10
8 ---
9 vendor/nginx-1.19.6/src/os/unix/ngx_posix_config.h | 3 ++-
10 1 file changed, 2 insertions(+), 1 deletion(-)
11
12 diff --git a/vendor/nginx-1.19.6/src/os/unix/ngx_posix_config.h b/vendor/nginx-1.19.6/src/os/unix/ngx_posix_config.h
13 index 2a8c413..772cfa6 100644
14 --- a/vendor/nginx-1.19.6/src/os/unix/ngx_posix_config.h
15 +++ b/vendor/nginx-1.19.6/src/os/unix/ngx_posix_config.h
16 @@ -21,10 +21,11 @@
17 #endif
18
19
20 -#if (NGX_GNU_HURD)
21 +#if defined(__GLIBC__)
22 #ifndef _GNU_SOURCE
23 #define _GNU_SOURCE /* accept4() */
24 #endif
25 +
26 #define _FILE_OFFSET_BITS 64
27 #endif
28
0 From: Kentaro Hayashi <hayashi@clear-code.com>
1 Date: Wed, 2 Dec 2020 20:29:31 +0900
2 Subject: Enable user site configuration
3
4 ---
5 data/groonga-httpd.conf.in | 2 ++
6 1 file changed, 2 insertions(+)
7
8 diff --git a/data/groonga-httpd.conf.in b/data/groonga-httpd.conf.in
9 index e4d8aad..d7788ff 100644
10 --- a/data/groonga-httpd.conf.in
11 +++ b/data/groonga-httpd.conf.in
12 @@ -78,4 +78,6 @@ http {
13 root html;
14 }
15 }
16 + # Configure application
17 + include /etc/groonga/httpd/conf.d/*.conf;
18 }
0 0001-Use-user-name-with-underline.patch
1 0002-Remove-needless-groonga-keyring-postrm.patch
2 0003-Use-_GNU_SOURCE-on-GNU-kFreeBSD.patch
3 0004-Enable-user-site-configuration.patch
0 #!/usr/bin/make -f
1 # -*- makefile-gmake -*-
2 #
3 # Uncomment this to turn on verbose mode.
4 #export DH_VERBOSE=1
5 # This has to be exported to make some magic below work.
6 export DH_OPTIONS
7 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
8 DPKG_EXPORT_BUILDFLAGS = 1
9 include /usr/share/dpkg/buildflags.mk
10 include /usr/share/dpkg/architecture.mk
11
12 %:
13 dh $@
14
15 override_dh_auto_configure:
16 dh_auto_configure -- --with-munin-plugins --enable-mruby --disable-static
17
18 # disable 'make check'.
19 override_dh_auto_test:
20
21 override_dh_install:
22 find $(CURDIR)/debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ -name *.la -delete
23 find $(CURDIR)/debian/tmp/usr/share/doc/ -name 'underscore*.js' -delete
24 find $(CURDIR)/debian/tmp/usr/share/doc/ -name 'jquery*.js' -delete
25 install -d debian/tmp/etc/munin/plugin-conf.d/
26 install -m 0644 debian/groonga-munin-plugins.conf \
27 debian/tmp/etc/munin/plugin-conf.d/groonga
28 mv debian/tmp/usr/share/doc/groonga/ \
29 debian/tmp/usr/share/doc/groonga-doc/
30 dh_install
0 include:
1 - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml
2 - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml
3
4 reprotest:
5 allow_failure: true
0 3.0 (quilt)
0 # vendor/rapidjson-1.1.0 is not used for Debian package build process
1 # because rapidjson-dev is used instead.
2 groonga source: license-problem-json-evil vendor/rapidjson-1.1.0/license.txt
3 # jquery.flot.resize embeds minified debian/missing-source/jquery.ba-resize.js
4 groonga source: source-is-missing data/html/admin/assets/flot-4.2.1/source/jquery.flot.resize.js line length is 1676 characters (>512)
0 #!/bin/sh
1
2 set -e
3 cat <<EOF > grntest.c
4 #include <groonga.h>
5
6 int main(void)
7 {
8 grn_rc rc = grn_init();
9 if (rc != GRN_SUCCESS) {
10 return -1;
11 }
12 grn_fin();
13 return 0;
14 }
15 EOF
16
17 gcc -o grntest grntest.c `pkg-config --cflags --libs groonga`
18 echo "build: OK"
19 [ -x grntest ]
20 ./grntest
21 echo "run: OK"
0 Tests: build, status
1 Depends: libgroonga-dev, build-essential, pkg-config, groonga-httpd, curl, jq
0 #!/bin/sh
1
2 set -e
3
4 set -e
5
6 PKG_VERSION=`dpkg-query -W -f='${Version}' groonga`
7 VERSION=`echo $PKG_VERSION | cut -d '-' -f1`
8 FETCHED_VERSION=`curl --silent http://localhost:10041/d/status | jq --raw-output ".[1].version"`
9 if [ "$VERSION" = "$FETCHED_VERSION" ]; then
10 echo "run: OK"
11 fi
0 -----BEGIN PGP PUBLIC KEY BLOCK-----
1
2 mQINBFpuo48BEAC/4UomZcZt2wjDb4WoFGxVxDISaf4k/xliQCz3V11CHN53If3d
3 GsqjOQrJTRpu5euXEoecb0YiiUWI28eD1IajTruunGDjI672/u3+iR6Ga1wk7nia
4 /5tlo4LMYl5va/BQkxVIx95OcoHBh46loVAnbaq+OyfV+r9dILJUf1txAJ65RIGZ
5 SikgkoSCoVnRwNhhLo4ssu65M6o4lRsI6dUP8wpny8dK8EpRlSwrbicrll+lBDxF
6 ZIh1OKll2u5qZ7mtQKOMbCwVhildyHrdUG1PI4ynIIDv9/8r+Wf4weoCqlnsKdKr
7 eHf990yWde0qSMTZnyjJfyY8pKNPkz2cWHKpxiKz6DaDSXJA/soAAmneRh370L0+
8 q9YbUL/TKa3iBmNZOaiJxS+w2pt4n7Z0GPocz56MtGHY0zLplmrm/+z8bBH+Vv1M
9 DQEt1hIE+fdB2tGIDCgjvegEVRckCdWb6ZHeRvcmE7/VKoY0GZZC2088AEyc6Hd9
10 6B0NWEDpooDFTfkaZ5IVc1VW3K7FF6l0Xm+9fLzmL7L8vzAnMZD5xB1AnDw/Woix
11 7Hl7uTdVXBlFWckiuU2N83mtT/IflsK3oBfZ7UVJJWzXiY1iGiEDmAqnENmSiN+D
12 NKGZusJM75rCcUM47XIxC1tV+bYbVf/ToPdmXfn5ElR9nMjl77jY+TEmqQARAQAB
13 tEFHcm9vbmdhIEtleSAoR3Jvb25nYSBPZmZpY2lhbCBTaWduaW5nIEtleSkgPHBh
14 Y2thZ2VzQGdyb29uZ2Eub3JnPokCTgQTAQgAOBYhBCcB8xfPzMuXXK3pwmJM93Q0
15 g5IlBQJabqOPAhsDBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAAAoJEGJM93Q0g5Il
16 v5IP/0K+YEP051EH82R/9F2Krhc4+cI/ktrrqLk1dvshkpU5m5jc+p8Ynjdc9Orq
17 oEotKUIDCQVtyVdk/bOWd75tgCScclslsXLdpx6hGYA6eRKAV4yPtXQnSd8FutQW
18 iu9poaMPMgODH8bf8PuDGrkLjNhdA0ZuLf1eiabIO94HaF1o1tZ0jVg6UbZ8MwLt
19 LhU9ox81VjEPOssGiR8MCBgHZCxhfe2gSR1mmxDE9d80Kb2DYb4kCke2MjoSku0S
20 h2BtIl/9Gn2VGp5E1klf+VRjoxK6MjvefY7yG5mSWBsE8YmKholzVD4QUSXWY0e3
21 ed8LPt38WXM43eUJt1uD5fd+XoVfTR+ZSaU2P9cEbYb8iec23t2AfXHowhpOcUqy
22 LSnTGPdTeVmZQmp6LSjtIAYwz5Bjdq3kDkPZikYKGYykYuoO4gIuOiBCoWEKUil+
23 bTIG3eU1rfCLjWsWvTJfmsxrB9hX+DjLQUNP7GH/DGAxwt4oSu0hhlGrpAs1ir09
24 KeIQreCyw+yP8t2yFwQ4Lo264Q1euAl29DauB8jfAzS4VVR6U08TpxtzrzTBpKgI
25 0wY+Xg2TgTG1JrdZFAYfgnppkeRfwvppZ51EKgtMtDYsHj07Ds6XcoTrpd9Ttj4k
26 F/Oe8Y8xg7NkRmPF3CXK1HRsdTkfpvR2lUEMKCiMBWmFGWnIiF0EEBEIAB0WIQTJ
27 fkZJogUdDOoac/lyp0lrRUmUKQUCWm7LEwAKCRByp0lrRUmUKa4LAKCgIrLSP8tw
28 jEcmqx9b2t9n4xzYsgCfYu1w6kEwW609cjISEo6xPZbHK9y5Ag0EWm6jjwEQALUg
29 eK8Dm49GcenJZS6WOPBFDfxMZM24d4NbRcbJyGJ9RJoky4CQTY42QbAJ4V3bC/p9
30 kD9hW/w6aeDB6G8EuV4NQJL0A1dy5AD0N4fVmYDTfbNze0DzJSrs1eCwhExYDGgv
31 cR36tlrmK9ZMvzq85ej1mQ/g8iUPgPPkpFI5BtgPHKlHghyDmK/JYcFwLmjz0R1c
32 bsKPWEXMAdESq5UojBH51xnXMKwB3aUHyU2gO7iqQxf5p1lXPMOX4ssnMuiz3DGW
33 UkaQhy1sgJZtzYiX3To1NTijbdSKlRJ+CXlG/vFagexgDWfMYrjbcmLQllKNt+Sc
34 0FPUcUqGtXKFxSI0ny3tUv+eTF8d5kqSaJk67nfHB6abxLjmXLoUMwMtlnyKPxHp
35 KXJEe7+UlTDo8UGT8ZILscftAWZPW2WLn8FOCXQQcIDG/G/7Adi374u/WQpOhi5Y
36 86MPnbLV53Bx2pP+XTbYDKFc/2wfKOVpxLHDDWCIsM3DL7YY63B1pSt5B3lJUnvj
37 xuHhXtWNG9UIgkaFCzvY8jgAXIVBnWAJcdkruUCwOD0tXmK45YPyK7fNLte4kWcO
38 Lxoh7rNDqo/wUyK9pB5G/CdE8J1G+T+egF+6qUM9IEIR8OJWQt9uR00ogMXdCAVz
39 tm4ZImX6boiW5SbWEzHnzv4mdH0WlbQtzjrKkwClABEBAAGJAjYEGAEIACAWIQQn
40 AfMXz8zLl1yt6cJiTPd0NIOSJQUCWm6jjwIbDAAKCRBiTPd0NIOSJXtkD/9IthyF
41 6CnQBazMQO/JIHp3Kfe/9ll+4hSSSc9tpijYznXpNQVv3rQQwVooL3oV5XoATK8H
42 6kv2IOyhtGq2szMt9YQ2JuGdjcOb5Mc2A+QWD3Tn7KCcwpIdOWiL74EWBKX6yM5J
43 G103nI0Xy1W5FSyCJ6lB1xDoCKgUdqrgfEwAgkt8kDeoi57j9wYilt2d5+UK85pX
44 qNgOMKxR0tLCHcngN1XKq4irfjBVVlh205qjsTApVzLrYYe0nGae/yejmGwCLMu3
45 7yd/XiNfjMi56gEYvIU/ZehqJQf00O4Cmneggu5A+KCG7cEULtuPLcwUho7swdsm
46 +bTCNAAMCvhSFeTUAs1atIOIsw1rStonPPOvjd0Ig3qWyaVs2PgK8xh21aLg5tIX
47 mn2bTegcmFJGGfv6YAkkPAKqtjJ/RPVZZH93PzouR590dAX/mZWZYRfo6ipxgv6A
48 LhL51z7lE/Zqcdg7TSkG2tY2NJnoXLROpXg9Bs7gFkb6ia7YeSJTz3Q0uBbQMqWk
49 Qyrj1RB8i18m28J9/OkLiSryhsyLh4UULqm7PUNyNKMV31TaIBQVvutKtLZ/GLWm
50 Pc/tBSa3Uy5CBG5oTrh1xo/3ZO0JRUW2CYU+gMvTRowmLP2uhU7JOAtz3QAerpHp
51 NhtRdfPs0HAz6RfxSr0qk9eQec/UPhOATDujkA==
52 =KA4q
53 -----END PGP PUBLIC KEY BLOCK-----
0 version=4
1 opts=pgpsigurlmangle=s/$/.asc/ https://packages.groonga.org/source/@PACKAGE@/@PACKAGE@-@ANY_VERSION@@ARCHIVE_EXT@ debian uupdate