Codebase list django-stronghold / 3b88d549-a271-4b26-b4c5-419e89649e88/main
[ Debian Janitor ] New upstream release. Debian Janitor 2 years ago
46 changed file(s) with 3263 addition(s) and 144 deletion(s). Raw diff Collapse all Expand all
33 *.egg-info
44 build
55 *.ropeproject
6 .python-version
00 language: python
1 dist: xenial
12 python:
2 - "2.6"
33 - "2.7"
44 - "3.4"
55 - "3.5"
66 - "3.6"
7 - "3.7"
78 env:
8 - DJANGO_VERSION="django>=1.4,<1.5"
9 - DJANGO_VERSION="django>=1.5,<1.6"
10 - DJANGO_VERSION="django>=1.6,<1.7"
11 - DJANGO_VERSION="django>=1.7,<1.8"
129 - DJANGO_VERSION="django>=1.8,<1.9"
1310 - DJANGO_VERSION="django>=1.9,<1.10"
1411 - DJANGO_VERSION="django>=1.10,<1.11"
1512 - DJANGO_VERSION="django>=1.11,<1.12"
1613 - DJANGO_VERSION="django>=2.0,<2.1"
14 - DJANGO_VERSION="django>=2.1,<2.2"
15 - DJANGO_VERSION="django>=2.2,<2.3"
1716 matrix:
1817 exclude:
19 - python: "2.6"
20 env: DJANGO_VERSION="django>=1.7,<1.8"
21 - python: "2.6"
22 env: DJANGO_VERSION="django>=1.8,<1.9"
23 - python: "2.6"
24 env: DJANGO_VERSION="django>=1.9,<1.10"
25 - python: "2.6"
26 env: DJANGO_VERSION="django>=1.10,<1.11"
27 - python: "2.6"
28 env: DJANGO_VERSION="django>=1.11,<1.12"
29 - python: "2.6"
18 - python: "2.7"
3019 env: DJANGO_VERSION="django>=2.0,<2.1"
3120 - python: "2.7"
32 env: DJANGO_VERSION="django>=2.0,<2.1"
21 env: DJANGO_VERSION="django>=2.1,<2.2"
22 - python: "2.7"
23 env: DJANGO_VERSION="django>=2.2,<2.3"
3324 - python: "3.4"
34 env: DJANGO_VERSION="django>=1.4,<1.5"
25 env: DJANGO_VERSION="django>=2.1,<2.2"
3526 - python: "3.4"
36 env: DJANGO_VERSION="django>=1.5,<1.6"
37 - python: "3.4"
38 env: DJANGO_VERSION="django>=1.6,<1.7"
39 - python: "3.4"
40 env: DJANGO_VERSION="django>=1.7,<1.8"
41 - python: "3.5"
42 env: DJANGO_VERSION="django>=1.4,<1.5"
43 - python: "3.5"
44 env: DJANGO_VERSION="django>=1.5,<1.6"
45 - python: "3.5"
46 env: DJANGO_VERSION="django>=1.6,<1.7"
47 - python: "3.5"
48 env: DJANGO_VERSION="django>=1.7,<1.8"
49 - python: "3.6"
50 env: DJANGO_VERSION="django>=1.4,<1.5"
51 - python: "3.6"
52 env: DJANGO_VERSION="django>=1.5,<1.6"
53 - python: "3.6"
54 env: DJANGO_VERSION="django>=1.6,<1.7"
55 - python: "3.6"
56 env: DJANGO_VERSION="django>=1.7,<1.8"
27 env: DJANGO_VERSION="django>=2.2,<2.3"
5728 install:
5829 - pip install -r requirements.txt
5930 - pip install $DJANGO_VERSION
4141 To make a view public again you can use the public decorator provided in `stronghold.decorators` like so:
4242
4343 ### For function based views
44
4445 ```python
4546 from stronghold.decorators import public
4647
8182
8283 ## Configuration (optional)
8384
84
8585 ### STRONGHOLD_DEFAULTS
8686
8787 Use Strongholds defaults in addition to your own settings.
9494
9595 You can add a tuple of url regexes in your settings file with the
9696 `STRONGHOLD_PUBLIC_URLS` setting. Any url that matches against these patterns
97 will be made public without using the `@public` decorator.
98
97 will be made public without using the `@public` decorator.
9998
10099 ### STRONGHOLD_PUBLIC_URLS
101100
102101 **Default**:
102
103103 ```python
104104 STRONGHOLD_PUBLIC_URLS = ()
105105 ```
106106
107107 If STRONGHOLD_DEFAULTS is True STRONGHOLD_PUBLIC_URLS contains:
108
108109 ```python
109110 (
110111 r'^%s.+$' % settings.STATIC_URL,
112113 )
113114
114115 ```
116
115117 When settings.DEBUG = True. This is additive to your settings to support serving
116118 Static files and media files from the development server. It does not replace any
117119 settings you may have in `STRONGHOLD_PUBLIC_URLS`.
119121 > Note: Public URL regexes are matched against [HttpRequest.path_info](https://docs.djangoproject.com/en/dev/ref/request-response/#django.http.HttpRequest.path_info).
120122
121123 ### STRONGHOLD_PUBLIC_NAMED_URLS
124
122125 You can add a tuple of url names in your settings file with the
123126 `STRONGHOLD_PUBLIC_NAMED_URLS` setting. Names in this setting will be reversed using
124127 `django.core.urlresolvers.reverse` and any url matching the output of the reverse
125128 call will be made public without using the `@public` decorator:
126129
127130 **Default**:
131
128132 ```python
129133 STRONGHOLD_PUBLIC_NAMED_URLS = ()
130134 ```
133137 if it exists, we add the login and logout view names to `STRONGHOLD_PUBLIC_NAMED_URLS`
134138
135139 ### STRONGHOLD_USER_TEST_FUNC
140
136141 Optionally, set STRONGHOLD_USER_TEST_FUNC to a callable to limit access to users
137142 that pass a custom test. The callback receives a `User` object and should
138143 return `True` if the user is authorized. This is equivalent to decorating a
150155 STRONGHOLD_USER_TEST_FUNC = lambda user: user.is_authenticated
151156 ```
152157
153 ##Compatiblity
158 ## Compatiblity
154159
155160 Tested with:
156 * Django 1.4.x
157 * Django 1.5.x
158 * Django 1.6.x
159 * Django 1.7.x
160 * Django 1.8.x
161 * Django 1.9.x
162 * Django 1.10.x
163 * Django 1.11.x
164 * Django 2.0.x
161
162 - Django 1.8.x
163 - Django 1.9.x
164 - Django 1.10.x
165 - Django 1.11.x
166 - Django 2.0.x
167 - Django 2.1.x
168 - Django 2.2.x
165169
166170 ## Contribute
167171
175175
176176 Tested with:
177177
178 - Django 1.4.x
179 - Django 1.5.x
180 - Django 1.6.x
181 - Django 1.7.x
182178 - Django 1.8.x
183179 - Django 1.9.x
184180 - Django 1.10.x
185181 - Django 1.11.x
186182 - Django 2.0.x
183 - Django 2.1.x
184 - Django 2.2.x
187185
188186 Contribute
189187 ----------
0 django-stronghold (0.3.0+debian-3) UNRELEASED; urgency=medium
0 django-stronghold (0.4.0-1) UNRELEASED; urgency=medium
11
22 [ Louis-Philippe Véronneau ]
33 * Update the VCS paths. Closes: #946101
1414 * d/control: Update Vcs-* fields with new Debian Python Team Salsa
1515 layout.
1616
17 -- Louis-Philippe Véronneau <pollo@debian.org> Mon, 24 Feb 2020 17:52:10 -0500
17 [ Debian Janitor ]
18 * New upstream release.
19
20 -- Louis-Philippe Véronneau <pollo@debian.org> Sat, 29 May 2021 20:19:31 -0000
1821
1922 django-stronghold (0.3.0+debian-2) unstable; urgency=medium
2023
0 # Sphinx build info version 1
1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
2 config: 67de63735401dad07cfe6ce3cf96a43f
3 tags: fbb0d17656682115ca4d033fb2f83ba1
0 .. django-stronghold documentation master file, created by
1 sphinx-quickstart on Fri Mar 22 22:25:59 2013.
2 You can adapt this file completely to your liking, but it should at least
3 contain the root `toctree` directive.
4
5 Welcome to django-stronghold's documentation!
6 =============================================
7
8 Contents:
9
10 .. toctree::
11 :maxdepth: 2
12
13
14
15 Indices and tables
16 ==================
17
18 * :ref:`genindex`
19 * :ref:`modindex`
20 * :ref:`search`
21
0 /*
1 * basic.css
2 * ~~~~~~~~~
3 *
4 * Sphinx stylesheet -- basic theme.
5 *
6 * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11 /* -- main layout ----------------------------------------------------------- */
12
13 div.clearer {
14 clear: both;
15 }
16
17 /* -- relbar ---------------------------------------------------------------- */
18
19 div.related {
20 width: 100%;
21 font-size: 90%;
22 }
23
24 div.related h3 {
25 display: none;
26 }
27
28 div.related ul {
29 margin: 0;
30 padding: 0 0 0 10px;
31 list-style: none;
32 }
33
34 div.related li {
35 display: inline;
36 }
37
38 div.related li.right {
39 float: right;
40 margin-right: 5px;
41 }
42
43 /* -- sidebar --------------------------------------------------------------- */
44
45 div.sphinxsidebarwrapper {
46 padding: 10px 5px 0 10px;
47 }
48
49 div.sphinxsidebar {
50 float: left;
51 width: 230px;
52 margin-left: -100%;
53 font-size: 90%;
54 }
55
56 div.sphinxsidebar ul {
57 list-style: none;
58 }
59
60 div.sphinxsidebar ul ul,
61 div.sphinxsidebar ul.want-points {
62 margin-left: 20px;
63 list-style: square;
64 }
65
66 div.sphinxsidebar ul ul {
67 margin-top: 0;
68 margin-bottom: 0;
69 }
70
71 div.sphinxsidebar form {
72 margin-top: 10px;
73 }
74
75 div.sphinxsidebar input {
76 border: 1px solid #98dbcc;
77 font-family: sans-serif;
78 font-size: 1em;
79 }
80
81 div.sphinxsidebar #searchbox input[type="text"] {
82 width: 170px;
83 }
84
85 div.sphinxsidebar #searchbox input[type="submit"] {
86 width: 30px;
87 }
88
89 img {
90 border: 0;
91 }
92
93 /* -- search page ----------------------------------------------------------- */
94
95 ul.search {
96 margin: 10px 0 0 20px;
97 padding: 0;
98 }
99
100 ul.search li {
101 padding: 5px 0 5px 20px;
102 background-image: url(file.png);
103 background-repeat: no-repeat;
104 background-position: 0 7px;
105 }
106
107 ul.search li a {
108 font-weight: bold;
109 }
110
111 ul.search li div.context {
112 color: #888;
113 margin: 2px 0 0 30px;
114 text-align: left;
115 }
116
117 ul.keywordmatches li.goodmatch a {
118 font-weight: bold;
119 }
120
121 /* -- index page ------------------------------------------------------------ */
122
123 table.contentstable {
124 width: 90%;
125 }
126
127 table.contentstable p.biglink {
128 line-height: 150%;
129 }
130
131 a.biglink {
132 font-size: 1.3em;
133 }
134
135 span.linkdescr {
136 font-style: italic;
137 padding-top: 5px;
138 font-size: 90%;
139 }
140
141 /* -- general index --------------------------------------------------------- */
142
143 table.indextable {
144 width: 100%;
145 }
146
147 table.indextable td {
148 text-align: left;
149 vertical-align: top;
150 }
151
152 table.indextable dl, table.indextable dd {
153 margin-top: 0;
154 margin-bottom: 0;
155 }
156
157 table.indextable tr.pcap {
158 height: 10px;
159 }
160
161 table.indextable tr.cap {
162 margin-top: 10px;
163 background-color: #f2f2f2;
164 }
165
166 img.toggler {
167 margin-right: 3px;
168 margin-top: 3px;
169 cursor: pointer;
170 }
171
172 div.modindex-jumpbox {
173 border-top: 1px solid #ddd;
174 border-bottom: 1px solid #ddd;
175 margin: 1em 0 1em 0;
176 padding: 0.4em;
177 }
178
179 div.genindex-jumpbox {
180 border-top: 1px solid #ddd;
181 border-bottom: 1px solid #ddd;
182 margin: 1em 0 1em 0;
183 padding: 0.4em;
184 }
185
186 /* -- general body styles --------------------------------------------------- */
187
188 a.headerlink {
189 visibility: hidden;
190 }
191
192 h1:hover > a.headerlink,
193 h2:hover > a.headerlink,
194 h3:hover > a.headerlink,
195 h4:hover > a.headerlink,
196 h5:hover > a.headerlink,
197 h6:hover > a.headerlink,
198 dt:hover > a.headerlink {
199 visibility: visible;
200 }
201
202 div.body p.caption {
203 text-align: inherit;
204 }
205
206 div.body td {
207 text-align: left;
208 }
209
210 .field-list ul {
211 padding-left: 1em;
212 }
213
214 .first {
215 margin-top: 0 !important;
216 }
217
218 p.rubric {
219 margin-top: 30px;
220 font-weight: bold;
221 }
222
223 img.align-left, .figure.align-left, object.align-left {
224 clear: left;
225 float: left;
226 margin-right: 1em;
227 }
228
229 img.align-right, .figure.align-right, object.align-right {
230 clear: right;
231 float: right;
232 margin-left: 1em;
233 }
234
235 img.align-center, .figure.align-center, object.align-center {
236 display: block;
237 margin-left: auto;
238 margin-right: auto;
239 }
240
241 .align-left {
242 text-align: left;
243 }
244
245 .align-center {
246 text-align: center;
247 }
248
249 .align-right {
250 text-align: right;
251 }
252
253 /* -- sidebars -------------------------------------------------------------- */
254
255 div.sidebar {
256 margin: 0 0 0.5em 1em;
257 border: 1px solid #ddb;
258 padding: 7px 7px 0 7px;
259 background-color: #ffe;
260 width: 40%;
261 float: right;
262 }
263
264 p.sidebar-title {
265 font-weight: bold;
266 }
267
268 /* -- topics ---------------------------------------------------------------- */
269
270 div.topic {
271 border: 1px solid #ccc;
272 padding: 7px 7px 0 7px;
273 margin: 10px 0 10px 0;
274 }
275
276 p.topic-title {
277 font-size: 1.1em;
278 font-weight: bold;
279 margin-top: 10px;
280 }
281
282 /* -- admonitions ----------------------------------------------------------- */
283
284 div.admonition {
285 margin-top: 10px;
286 margin-bottom: 10px;
287 padding: 7px;
288 }
289
290 div.admonition dt {
291 font-weight: bold;
292 }
293
294 div.admonition dl {
295 margin-bottom: 0;
296 }
297
298 p.admonition-title {
299 margin: 0px 10px 5px 0px;
300 font-weight: bold;
301 }
302
303 div.body p.centered {
304 text-align: center;
305 margin-top: 25px;
306 }
307
308 /* -- tables ---------------------------------------------------------------- */
309
310 table.docutils {
311 border: 0;
312 border-collapse: collapse;
313 }
314
315 table.docutils td, table.docutils th {
316 padding: 1px 8px 1px 5px;
317 border-top: 0;
318 border-left: 0;
319 border-right: 0;
320 border-bottom: 1px solid #aaa;
321 }
322
323 table.field-list td, table.field-list th {
324 border: 0 !important;
325 }
326
327 table.footnote td, table.footnote th {
328 border: 0 !important;
329 }
330
331 th {
332 text-align: left;
333 padding-right: 5px;
334 }
335
336 table.citation {
337 border-left: solid 1px gray;
338 margin-left: 1px;
339 }
340
341 table.citation td {
342 border-bottom: none;
343 }
344
345 /* -- other body styles ----------------------------------------------------- */
346
347 ol.arabic {
348 list-style: decimal;
349 }
350
351 ol.loweralpha {
352 list-style: lower-alpha;
353 }
354
355 ol.upperalpha {
356 list-style: upper-alpha;
357 }
358
359 ol.lowerroman {
360 list-style: lower-roman;
361 }
362
363 ol.upperroman {
364 list-style: upper-roman;
365 }
366
367 dl {
368 margin-bottom: 15px;
369 }
370
371 dd p {
372 margin-top: 0px;
373 }
374
375 dd ul, dd table {
376 margin-bottom: 10px;
377 }
378
379 dd {
380 margin-top: 3px;
381 margin-bottom: 10px;
382 margin-left: 30px;
383 }
384
385 dt:target, .highlighted {
386 background-color: #fbe54e;
387 }
388
389 dl.glossary dt {
390 font-weight: bold;
391 font-size: 1.1em;
392 }
393
394 .field-list ul {
395 margin: 0;
396 padding-left: 1em;
397 }
398
399 .field-list p {
400 margin: 0;
401 }
402
403 .refcount {
404 color: #060;
405 }
406
407 .optional {
408 font-size: 1.3em;
409 }
410
411 .versionmodified {
412 font-style: italic;
413 }
414
415 .system-message {
416 background-color: #fda;
417 padding: 5px;
418 border: 3px solid red;
419 }
420
421 .footnote:target {
422 background-color: #ffa;
423 }
424
425 .line-block {
426 display: block;
427 margin-top: 1em;
428 margin-bottom: 1em;
429 }
430
431 .line-block .line-block {
432 margin-top: 0;
433 margin-bottom: 0;
434 margin-left: 1.5em;
435 }
436
437 .guilabel, .menuselection {
438 font-family: sans-serif;
439 }
440
441 .accelerator {
442 text-decoration: underline;
443 }
444
445 .classifier {
446 font-style: oblique;
447 }
448
449 abbr, acronym {
450 border-bottom: dotted 1px;
451 cursor: help;
452 }
453
454 /* -- code displays --------------------------------------------------------- */
455
456 pre {
457 overflow: auto;
458 overflow-y: hidden; /* fixes display issues on Chrome browsers */
459 }
460
461 td.linenos pre {
462 padding: 5px 0px;
463 border: 0;
464 background-color: transparent;
465 color: #aaa;
466 }
467
468 table.highlighttable {
469 margin-left: 0.5em;
470 }
471
472 table.highlighttable td {
473 padding: 0 0.5em 0 0.5em;
474 }
475
476 tt.descname {
477 background-color: transparent;
478 font-weight: bold;
479 font-size: 1.2em;
480 }
481
482 tt.descclassname {
483 background-color: transparent;
484 }
485
486 tt.xref, a tt {
487 background-color: transparent;
488 font-weight: bold;
489 }
490
491 h1 tt, h2 tt, h3 tt, h4 tt, h5 tt, h6 tt {
492 background-color: transparent;
493 }
494
495 .viewcode-link {
496 float: right;
497 }
498
499 .viewcode-back {
500 float: right;
501 font-family: sans-serif;
502 }
503
504 div.viewcode-block:target {
505 margin: -1px -10px;
506 padding: 0 10px;
507 }
508
509 /* -- math display ---------------------------------------------------------- */
510
511 img.math {
512 vertical-align: middle;
513 }
514
515 div.body div.math p {
516 text-align: center;
517 }
518
519 span.eqno {
520 float: right;
521 }
522
523 /* -- printout stylesheet --------------------------------------------------- */
524
525 @media print {
526 div.document,
527 div.documentwrapper,
528 div.bodywrapper {
529 margin: 0 !important;
530 width: 100%;
531 }
532
533 div.sphinxsidebar,
534 div.related,
535 div.footer,
536 #top-link {
537 display: none;
538 }
539 }
0 /*
1 * default.css_t
2 * ~~~~~~~~~~~~~
3 *
4 * Sphinx stylesheet -- default theme.
5 *
6 * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11 @import url("basic.css");
12
13 /* -- page layout ----------------------------------------------------------- */
14
15 body {
16 font-family: sans-serif;
17 font-size: 100%;
18 background-color: #11303d;
19 color: #000;
20 margin: 0;
21 padding: 0;
22 }
23
24 div.document {
25 background-color: #1c4e63;
26 }
27
28 div.documentwrapper {
29 float: left;
30 width: 100%;
31 }
32
33 div.bodywrapper {
34 margin: 0 0 0 230px;
35 }
36
37 div.body {
38 background-color: #ffffff;
39 color: #000000;
40 padding: 0 20px 30px 20px;
41 }
42
43 div.footer {
44 color: #ffffff;
45 width: 100%;
46 padding: 9px 0 9px 0;
47 text-align: center;
48 font-size: 75%;
49 }
50
51 div.footer a {
52 color: #ffffff;
53 text-decoration: underline;
54 }
55
56 div.related {
57 background-color: #133f52;
58 line-height: 30px;
59 color: #ffffff;
60 }
61
62 div.related a {
63 color: #ffffff;
64 }
65
66 div.sphinxsidebar {
67 }
68
69 div.sphinxsidebar h3 {
70 font-family: 'Trebuchet MS', sans-serif;
71 color: #ffffff;
72 font-size: 1.4em;
73 font-weight: normal;
74 margin: 0;
75 padding: 0;
76 }
77
78 div.sphinxsidebar h3 a {
79 color: #ffffff;
80 }
81
82 div.sphinxsidebar h4 {
83 font-family: 'Trebuchet MS', sans-serif;
84 color: #ffffff;
85 font-size: 1.3em;
86 font-weight: normal;
87 margin: 5px 0 0 0;
88 padding: 0;
89 }
90
91 div.sphinxsidebar p {
92 color: #ffffff;
93 }
94
95 div.sphinxsidebar p.topless {
96 margin: 5px 10px 10px 10px;
97 }
98
99 div.sphinxsidebar ul {
100 margin: 10px;
101 padding: 0;
102 color: #ffffff;
103 }
104
105 div.sphinxsidebar a {
106 color: #98dbcc;
107 }
108
109 div.sphinxsidebar input {
110 border: 1px solid #98dbcc;
111 font-family: sans-serif;
112 font-size: 1em;
113 }
114
115
116
117 /* -- hyperlink styles ------------------------------------------------------ */
118
119 a {
120 color: #355f7c;
121 text-decoration: none;
122 }
123
124 a:visited {
125 color: #355f7c;
126 text-decoration: none;
127 }
128
129 a:hover {
130 text-decoration: underline;
131 }
132
133
134
135 /* -- body styles ----------------------------------------------------------- */
136
137 div.body h1,
138 div.body h2,
139 div.body h3,
140 div.body h4,
141 div.body h5,
142 div.body h6 {
143 font-family: 'Trebuchet MS', sans-serif;
144 background-color: #f2f2f2;
145 font-weight: normal;
146 color: #20435c;
147 border-bottom: 1px solid #ccc;
148 margin: 20px -20px 10px -20px;
149 padding: 3px 0 3px 10px;
150 }
151
152 div.body h1 { margin-top: 0; font-size: 200%; }
153 div.body h2 { font-size: 160%; }
154 div.body h3 { font-size: 140%; }
155 div.body h4 { font-size: 120%; }
156 div.body h5 { font-size: 110%; }
157 div.body h6 { font-size: 100%; }
158
159 a.headerlink {
160 color: #c60f0f;
161 font-size: 0.8em;
162 padding: 0 4px 0 4px;
163 text-decoration: none;
164 }
165
166 a.headerlink:hover {
167 background-color: #c60f0f;
168 color: white;
169 }
170
171 div.body p, div.body dd, div.body li {
172 text-align: justify;
173 line-height: 130%;
174 }
175
176 div.admonition p.admonition-title + p {
177 display: inline;
178 }
179
180 div.admonition p {
181 margin-bottom: 5px;
182 }
183
184 div.admonition pre {
185 margin-bottom: 5px;
186 }
187
188 div.admonition ul, div.admonition ol {
189 margin-bottom: 5px;
190 }
191
192 div.note {
193 background-color: #eee;
194 border: 1px solid #ccc;
195 }
196
197 div.seealso {
198 background-color: #ffc;
199 border: 1px solid #ff6;
200 }
201
202 div.topic {
203 background-color: #eee;
204 }
205
206 div.warning {
207 background-color: #ffe4e4;
208 border: 1px solid #f66;
209 }
210
211 p.admonition-title {
212 display: inline;
213 }
214
215 p.admonition-title:after {
216 content: ":";
217 }
218
219 pre {
220 padding: 5px;
221 background-color: #eeffcc;
222 color: #333333;
223 line-height: 120%;
224 border: 1px solid #ac9;
225 border-left: none;
226 border-right: none;
227 }
228
229 tt {
230 background-color: #ecf0f3;
231 padding: 0 1px 0 1px;
232 font-size: 0.95em;
233 }
234
235 th {
236 background-color: #ede;
237 }
238
239 .warning tt {
240 background: #efc2c2;
241 }
242
243 .note tt {
244 background: #d6d6d6;
245 }
246
247 .viewcode-back {
248 font-family: sans-serif;
249 }
250
251 div.viewcode-block:target {
252 background-color: #f4debf;
253 border-top: 1px solid #ac9;
254 border-bottom: 1px solid #ac9;
255 }
0 /*
1 * doctools.js
2 * ~~~~~~~~~~~
3 *
4 * Sphinx JavaScript utilities for all documentation.
5 *
6 * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11 /**
12 * select a different prefix for underscore
13 */
14 $u = _.noConflict();
15
16 /**
17 * make the code below compatible with browsers without
18 * an installed firebug like debugger
19 if (!window.console || !console.firebug) {
20 var names = ["log", "debug", "info", "warn", "error", "assert", "dir",
21 "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace",
22 "profile", "profileEnd"];
23 window.console = {};
24 for (var i = 0; i < names.length; ++i)
25 window.console[names[i]] = function() {};
26 }
27 */
28
29 /**
30 * small helper function to urldecode strings
31 */
32 jQuery.urldecode = function(x) {
33 return decodeURIComponent(x).replace(/\+/g, ' ');
34 }
35
36 /**
37 * small helper function to urlencode strings
38 */
39 jQuery.urlencode = encodeURIComponent;
40
41 /**
42 * This function returns the parsed url parameters of the
43 * current request. Multiple values per key are supported,
44 * it will always return arrays of strings for the value parts.
45 */
46 jQuery.getQueryParameters = function(s) {
47 if (typeof s == 'undefined')
48 s = document.location.search;
49 var parts = s.substr(s.indexOf('?') + 1).split('&');
50 var result = {};
51 for (var i = 0; i < parts.length; i++) {
52 var tmp = parts[i].split('=', 2);
53 var key = jQuery.urldecode(tmp[0]);
54 var value = jQuery.urldecode(tmp[1]);
55 if (key in result)
56 result[key].push(value);
57 else
58 result[key] = [value];
59 }
60 return result;
61 };
62
63 /**
64 * small function to check if an array contains
65 * a given item.
66 */
67 jQuery.contains = function(arr, item) {
68 for (var i = 0; i < arr.length; i++) {
69 if (arr[i] == item)
70 return true;
71 }
72 return false;
73 };
74
75 /**
76 * highlight a given string on a jquery object by wrapping it in
77 * span elements with the given class name.
78 */
79 jQuery.fn.highlightText = function(text, className) {
80 function highlight(node) {
81 if (node.nodeType == 3) {
82 var val = node.nodeValue;
83 var pos = val.toLowerCase().indexOf(text);
84 if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) {
85 var span = document.createElement("span");
86 span.className = className;
87 span.appendChild(document.createTextNode(val.substr(pos, text.length)));
88 node.parentNode.insertBefore(span, node.parentNode.insertBefore(
89 document.createTextNode(val.substr(pos + text.length)),
90 node.nextSibling));
91 node.nodeValue = val.substr(0, pos);
92 }
93 }
94 else if (!jQuery(node).is("button, select, textarea")) {
95 jQuery.each(node.childNodes, function() {
96 highlight(this);
97 });
98 }
99 }
100 return this.each(function() {
101 highlight(this);
102 });
103 };
104
105 /**
106 * Small JavaScript module for the documentation.
107 */
108 var Documentation = {
109
110 init : function() {
111 this.fixFirefoxAnchorBug();
112 this.highlightSearchWords();
113 this.initIndexTable();
114 },
115
116 /**
117 * i18n support
118 */
119 TRANSLATIONS : {},
120 PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; },
121 LOCALE : 'unknown',
122
123 // gettext and ngettext don't access this so that the functions
124 // can safely bound to a different name (_ = Documentation.gettext)
125 gettext : function(string) {
126 var translated = Documentation.TRANSLATIONS[string];
127 if (typeof translated == 'undefined')
128 return string;
129 return (typeof translated == 'string') ? translated : translated[0];
130 },
131
132 ngettext : function(singular, plural, n) {
133 var translated = Documentation.TRANSLATIONS[singular];
134 if (typeof translated == 'undefined')
135 return (n == 1) ? singular : plural;
136 return translated[Documentation.PLURALEXPR(n)];
137 },
138
139 addTranslations : function(catalog) {
140 for (var key in catalog.messages)
141 this.TRANSLATIONS[key] = catalog.messages[key];
142 this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')');
143 this.LOCALE = catalog.locale;
144 },
145
146 /**
147 * add context elements like header anchor links
148 */
149 addContextElements : function() {
150 $('div[id] > :header:first').each(function() {
151 $('<a class="headerlink">\u00B6</a>').
152 attr('href', '#' + this.id).
153 attr('title', _('Permalink to this headline')).
154 appendTo(this);
155 });
156 $('dt[id]').each(function() {
157 $('<a class="headerlink">\u00B6</a>').
158 attr('href', '#' + this.id).
159 attr('title', _('Permalink to this definition')).
160 appendTo(this);
161 });
162 },
163
164 /**
165 * workaround a firefox stupidity
166 */
167 fixFirefoxAnchorBug : function() {
168 if (document.location.hash && $.browser.mozilla)
169 window.setTimeout(function() {
170 document.location.href += '';
171 }, 10);
172 },
173
174 /**
175 * highlight the search words provided in the url in the text
176 */
177 highlightSearchWords : function() {
178 var params = $.getQueryParameters();
179 var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : [];
180 if (terms.length) {
181 var body = $('div.body');
182 window.setTimeout(function() {
183 $.each(terms, function() {
184 body.highlightText(this.toLowerCase(), 'highlighted');
185 });
186 }, 10);
187 $('<p class="highlight-link"><a href="javascript:Documentation.' +
188 'hideSearchWords()">' + _('Hide Search Matches') + '</a></p>')
189 .appendTo($('#searchbox'));
190 }
191 },
192
193 /**
194 * init the domain index toggle buttons
195 */
196 initIndexTable : function() {
197 var togglers = $('img.toggler').click(function() {
198 var src = $(this).attr('src');
199 var idnum = $(this).attr('id').substr(7);
200 $('tr.cg-' + idnum).toggle();
201 if (src.substr(-9) == 'minus.png')
202 $(this).attr('src', src.substr(0, src.length-9) + 'plus.png');
203 else
204 $(this).attr('src', src.substr(0, src.length-8) + 'minus.png');
205 }).css('display', '');
206 if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) {
207 togglers.click();
208 }
209 },
210
211 /**
212 * helper function to hide the search marks again
213 */
214 hideSearchWords : function() {
215 $('#searchbox .highlight-link').fadeOut(300);
216 $('span.highlighted').removeClass('highlighted');
217 },
218
219 /**
220 * make the url absolute
221 */
222 makeURL : function(relativeURL) {
223 return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL;
224 },
225
226 /**
227 * get the current relative url
228 */
229 getCurrentURL : function() {
230 var path = document.location.pathname;
231 var parts = path.split(/\//);
232 $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() {
233 if (this == '..')
234 parts.pop();
235 });
236 var url = parts.join('/');
237 return path.substring(url.lastIndexOf('/') + 1, path.length - 1);
238 }
239 };
240
241 // quick alias for translations
242 _ = Documentation.gettext;
243
244 $(document).ready(function() {
245 Documentation.init();
246 });
0 /*!
1 * jQuery JavaScript Library v1.4.2
2 * http://jquery.com/
3 *
4 * Copyright 2010, John Resig
5 * Dual licensed under the MIT or GPL Version 2 licenses.
6 * http://jquery.org/license
7 *
8 * Includes Sizzle.js
9 * http://sizzlejs.com/
10 * Copyright 2010, The Dojo Foundation
11 * Released under the MIT, BSD, and GPL Licenses.
12 *
13 * Date: Sat Feb 13 22:33:48 2010 -0500
14 */
15 (function(A,w){function ma(){if(!c.isReady){try{s.documentElement.doScroll("left")}catch(a){setTimeout(ma,1);return}c.ready()}}function Qa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function X(a,b,d,f,e,j){var i=a.length;if(typeof b==="object"){for(var o in b)X(a,o,b[o],f,e,d);return a}if(d!==w){f=!j&&f&&c.isFunction(d);for(o=0;o<i;o++)e(a[o],b,f?d.call(a[o],o,e(a[o],b)):d,j);return a}return i?
16 e(a[0],b):w}function J(){return(new Date).getTime()}function Y(){return false}function Z(){return true}function na(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function oa(a){var b,d=[],f=[],e=arguments,j,i,o,k,n,r;i=c.data(this,"events");if(!(a.liveFired===this||!i||!i.live||a.button&&a.type==="click")){a.liveFired=this;var u=i.live.slice(0);for(k=0;k<u.length;k++){i=u[k];i.origType.replace(O,"")===a.type?f.push(i.selector):u.splice(k--,1)}j=c(a.target).closest(f,a.currentTarget);n=0;for(r=
17 j.length;n<r;n++)for(k=0;k<u.length;k++){i=u[k];if(j[n].selector===i.selector){o=j[n].elem;f=null;if(i.preType==="mouseenter"||i.preType==="mouseleave")f=c(a.relatedTarget).closest(i.selector)[0];if(!f||f!==o)d.push({elem:o,handleObj:i})}}n=0;for(r=d.length;n<r;n++){j=d[n];a.currentTarget=j.elem;a.data=j.handleObj.data;a.handleObj=j.handleObj;if(j.handleObj.origHandler.apply(j.elem,e)===false){b=false;break}}return b}}function pa(a,b){return"live."+(a&&a!=="*"?a+".":"")+b.replace(/\./g,"`").replace(/ /g,
18 "&")}function qa(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function ra(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var f=c.data(a[d++]),e=c.data(this,f);if(f=f&&f.events){delete e.handle;e.events={};for(var j in f)for(var i in f[j])c.event.add(this,j,f[j][i],f[j][i].data)}}})}function sa(a,b,d){var f,e,j;b=b&&b[0]?b[0].ownerDocument||b[0]:s;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===s&&!ta.test(a[0])&&(c.support.checkClone||!ua.test(a[0]))){e=
19 true;if(j=c.fragments[a[0]])if(j!==1)f=j}if(!f){f=b.createDocumentFragment();c.clean(a,b,f,d)}if(e)c.fragments[a[0]]=j?f:1;return{fragment:f,cacheable:e}}function K(a,b){var d={};c.each(va.concat.apply([],va.slice(0,b)),function(){d[this]=a});return d}function wa(a){return"scrollTo"in a&&a.document?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var c=function(a,b){return new c.fn.init(a,b)},Ra=A.jQuery,Sa=A.$,s=A.document,T,Ta=/^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,Ua=/^.[^:#\[\.,]*$/,Va=/\S/,
20 Wa=/^(\s|\u00A0)+|(\s|\u00A0)+$/g,Xa=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,P=navigator.userAgent,xa=false,Q=[],L,$=Object.prototype.toString,aa=Object.prototype.hasOwnProperty,ba=Array.prototype.push,R=Array.prototype.slice,ya=Array.prototype.indexOf;c.fn=c.prototype={init:function(a,b){var d,f;if(!a)return this;if(a.nodeType){this.context=this[0]=a;this.length=1;return this}if(a==="body"&&!b){this.context=s;this[0]=s.body;this.selector="body";this.length=1;return this}if(typeof a==="string")if((d=Ta.exec(a))&&
21 (d[1]||!b))if(d[1]){f=b?b.ownerDocument||b:s;if(a=Xa.exec(a))if(c.isPlainObject(b)){a=[s.createElement(a[1])];c.fn.attr.call(a,b,true)}else a=[f.createElement(a[1])];else{a=sa([d[1]],[f]);a=(a.cacheable?a.fragment.cloneNode(true):a.fragment).childNodes}return c.merge(this,a)}else{if(b=s.getElementById(d[2])){if(b.id!==d[2])return T.find(a);this.length=1;this[0]=b}this.context=s;this.selector=a;return this}else if(!b&&/^\w+$/.test(a)){this.selector=a;this.context=s;a=s.getElementsByTagName(a);return c.merge(this,
22 a)}else return!b||b.jquery?(b||T).find(a):c(b).find(a);else if(c.isFunction(a))return T.ready(a);if(a.selector!==w){this.selector=a.selector;this.context=a.context}return c.makeArray(a,this)},selector:"",jquery:"1.4.2",length:0,size:function(){return this.length},toArray:function(){return R.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this.slice(a)[0]:this[a]},pushStack:function(a,b,d){var f=c();c.isArray(a)?ba.apply(f,a):c.merge(f,a);f.prevObject=this;f.context=this.context;if(b===
23 "find")f.selector=this.selector+(this.selector?" ":"")+d;else if(b)f.selector=this.selector+"."+b+"("+d+")";return f},each:function(a,b){return c.each(this,a,b)},ready:function(a){c.bindReady();if(c.isReady)a.call(s,c);else Q&&Q.push(a);return this},eq:function(a){return a===-1?this.slice(a):this.slice(a,+a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(R.apply(this,arguments),"slice",R.call(arguments).join(","))},map:function(a){return this.pushStack(c.map(this,
24 function(b,d){return a.call(b,d,b)}))},end:function(){return this.prevObject||c(null)},push:ba,sort:[].sort,splice:[].splice};c.fn.init.prototype=c.fn;c.extend=c.fn.extend=function(){var a=arguments[0]||{},b=1,d=arguments.length,f=false,e,j,i,o;if(typeof a==="boolean"){f=a;a=arguments[1]||{};b=2}if(typeof a!=="object"&&!c.isFunction(a))a={};if(d===b){a=this;--b}for(;b<d;b++)if((e=arguments[b])!=null)for(j in e){i=a[j];o=e[j];if(a!==o)if(f&&o&&(c.isPlainObject(o)||c.isArray(o))){i=i&&(c.isPlainObject(i)||
25 c.isArray(i))?i:c.isArray(o)?[]:{};a[j]=c.extend(f,i,o)}else if(o!==w)a[j]=o}return a};c.extend({noConflict:function(a){A.$=Sa;if(a)A.jQuery=Ra;return c},isReady:false,ready:function(){if(!c.isReady){if(!s.body)return setTimeout(c.ready,13);c.isReady=true;if(Q){for(var a,b=0;a=Q[b++];)a.call(s,c);Q=null}c.fn.triggerHandler&&c(s).triggerHandler("ready")}},bindReady:function(){if(!xa){xa=true;if(s.readyState==="complete")return c.ready();if(s.addEventListener){s.addEventListener("DOMContentLoaded",
26 L,false);A.addEventListener("load",c.ready,false)}else if(s.attachEvent){s.attachEvent("onreadystatechange",L);A.attachEvent("onload",c.ready);var a=false;try{a=A.frameElement==null}catch(b){}s.documentElement.doScroll&&a&&ma()}}},isFunction:function(a){return $.call(a)==="[object Function]"},isArray:function(a){return $.call(a)==="[object Array]"},isPlainObject:function(a){if(!a||$.call(a)!=="[object Object]"||a.nodeType||a.setInterval)return false;if(a.constructor&&!aa.call(a,"constructor")&&!aa.call(a.constructor.prototype,
27 "isPrototypeOf"))return false;var b;for(b in a);return b===w||aa.call(a,b)},isEmptyObject:function(a){for(var b in a)return false;return true},error:function(a){throw a;},parseJSON:function(a){if(typeof a!=="string"||!a)return null;a=c.trim(a);if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return A.JSON&&A.JSON.parse?A.JSON.parse(a):(new Function("return "+
28 a))();else c.error("Invalid JSON: "+a)},noop:function(){},globalEval:function(a){if(a&&Va.test(a)){var b=s.getElementsByTagName("head")[0]||s.documentElement,d=s.createElement("script");d.type="text/javascript";if(c.support.scriptEval)d.appendChild(s.createTextNode(a));else d.text=a;b.insertBefore(d,b.firstChild);b.removeChild(d)}},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,b,d){var f,e=0,j=a.length,i=j===w||c.isFunction(a);if(d)if(i)for(f in a){if(b.apply(a[f],
29 d)===false)break}else for(;e<j;){if(b.apply(a[e++],d)===false)break}else if(i)for(f in a){if(b.call(a[f],f,a[f])===false)break}else for(d=a[0];e<j&&b.call(d,e,d)!==false;d=a[++e]);return a},trim:function(a){return(a||"").replace(Wa,"")},makeArray:function(a,b){b=b||[];if(a!=null)a.length==null||typeof a==="string"||c.isFunction(a)||typeof a!=="function"&&a.setInterval?ba.call(b,a):c.merge(b,a);return b},inArray:function(a,b){if(b.indexOf)return b.indexOf(a);for(var d=0,f=b.length;d<f;d++)if(b[d]===
30 a)return d;return-1},merge:function(a,b){var d=a.length,f=0;if(typeof b.length==="number")for(var e=b.length;f<e;f++)a[d++]=b[f];else for(;b[f]!==w;)a[d++]=b[f++];a.length=d;return a},grep:function(a,b,d){for(var f=[],e=0,j=a.length;e<j;e++)!d!==!b(a[e],e)&&f.push(a[e]);return f},map:function(a,b,d){for(var f=[],e,j=0,i=a.length;j<i;j++){e=b(a[j],j,d);if(e!=null)f[f.length]=e}return f.concat.apply([],f)},guid:1,proxy:function(a,b,d){if(arguments.length===2)if(typeof b==="string"){d=a;a=d[b];b=w}else if(b&&
31 !c.isFunction(b)){d=b;b=w}if(!b&&a)b=function(){return a.apply(d||this,arguments)};if(a)b.guid=a.guid=a.guid||b.guid||c.guid++;return b},uaMatch:function(a){a=a.toLowerCase();a=/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version)?[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||!/compatible/.test(a)&&/(mozilla)(?:.*? rv:([\w.]+))?/.exec(a)||[];return{browser:a[1]||"",version:a[2]||"0"}},browser:{}});P=c.uaMatch(P);if(P.browser){c.browser[P.browser]=true;c.browser.version=P.version}if(c.browser.webkit)c.browser.safari=
32 true;if(ya)c.inArray=function(a,b){return ya.call(b,a)};T=c(s);if(s.addEventListener)L=function(){s.removeEventListener("DOMContentLoaded",L,false);c.ready()};else if(s.attachEvent)L=function(){if(s.readyState==="complete"){s.detachEvent("onreadystatechange",L);c.ready()}};(function(){c.support={};var a=s.documentElement,b=s.createElement("script"),d=s.createElement("div"),f="script"+J();d.style.display="none";d.innerHTML=" <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
33 var e=d.getElementsByTagName("*"),j=d.getElementsByTagName("a")[0];if(!(!e||!e.length||!j)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(j.getAttribute("style")),hrefNormalized:j.getAttribute("href")==="/a",opacity:/^0.55$/.test(j.style.opacity),cssFloat:!!j.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:s.createElement("select").appendChild(s.createElement("option")).selected,
34 parentNode:d.removeChild(d.appendChild(s.createElement("div"))).parentNode===null,deleteExpando:true,checkClone:false,scriptEval:false,noCloneEvent:true,boxModel:null};b.type="text/javascript";try{b.appendChild(s.createTextNode("window."+f+"=1;"))}catch(i){}a.insertBefore(b,a.firstChild);if(A[f]){c.support.scriptEval=true;delete A[f]}try{delete b.test}catch(o){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function k(){c.support.noCloneEvent=
35 false;d.detachEvent("onclick",k)});d.cloneNode(true).fireEvent("onclick")}d=s.createElement("div");d.innerHTML="<input type='radio' name='radiotest' checked='checked'/>";a=s.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var k=s.createElement("div");k.style.width=k.style.paddingLeft="1px";s.body.appendChild(k);c.boxModel=c.support.boxModel=k.offsetWidth===2;s.body.removeChild(k).style.display="none"});a=function(k){var n=
36 s.createElement("div");k="on"+k;var r=k in n;if(!r){n.setAttribute(k,"return;");r=typeof n[k]==="function"}return r};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=e=j=null}})();c.props={"for":"htmlFor","class":"className",readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder"};var G="jQuery"+J(),Ya=0,za={};c.extend({cache:{},expando:G,noData:{embed:true,object:true,
37 applet:true},data:function(a,b,d){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var f=a[G],e=c.cache;if(!f&&typeof b==="string"&&d===w)return null;f||(f=++Ya);if(typeof b==="object"){a[G]=f;e[f]=c.extend(true,{},b)}else if(!e[f]){a[G]=f;e[f]={}}a=e[f];if(d!==w)a[b]=d;return typeof b==="string"?a[b]:a}},removeData:function(a,b){if(!(a.nodeName&&c.noData[a.nodeName.toLowerCase()])){a=a==A?za:a;var d=a[G],f=c.cache,e=f[d];if(b){if(e){delete e[b];c.isEmptyObject(e)&&c.removeData(a)}}else{if(c.support.deleteExpando)delete a[c.expando];
38 else a.removeAttribute&&a.removeAttribute(c.expando);delete f[d]}}}});c.fn.extend({data:function(a,b){if(typeof a==="undefined"&&this.length)return c.data(this[0]);else if(typeof a==="object")return this.each(function(){c.data(this,a)});var d=a.split(".");d[1]=d[1]?"."+d[1]:"";if(b===w){var f=this.triggerHandler("getData"+d[1]+"!",[d[0]]);if(f===w&&this.length)f=c.data(this[0],a);return f===w&&d[1]?this.data(d[0]):f}else return this.trigger("setData"+d[1]+"!",[d[0],b]).each(function(){c.data(this,
39 a,b)})},removeData:function(a){return this.each(function(){c.removeData(this,a)})}});c.extend({queue:function(a,b,d){if(a){b=(b||"fx")+"queue";var f=c.data(a,b);if(!d)return f||[];if(!f||c.isArray(d))f=c.data(a,b,c.makeArray(d));else f.push(d);return f}},dequeue:function(a,b){b=b||"fx";var d=c.queue(a,b),f=d.shift();if(f==="inprogress")f=d.shift();if(f){b==="fx"&&d.unshift("inprogress");f.call(a,function(){c.dequeue(a,b)})}}});c.fn.extend({queue:function(a,b){if(typeof a!=="string"){b=a;a="fx"}if(b===
40 w)return c.queue(this[0],a);return this.each(function(){var d=c.queue(this,a,b);a==="fx"&&d[0]!=="inprogress"&&c.dequeue(this,a)})},dequeue:function(a){return this.each(function(){c.dequeue(this,a)})},delay:function(a,b){a=c.fx?c.fx.speeds[a]||a:a;b=b||"fx";return this.queue(b,function(){var d=this;setTimeout(function(){c.dequeue(d,b)},a)})},clearQueue:function(a){return this.queue(a||"fx",[])}});var Aa=/[\n\t]/g,ca=/\s+/,Za=/\r/g,$a=/href|src|style/,ab=/(button|input)/i,bb=/(button|input|object|select|textarea)/i,
41 cb=/^(a|area)$/i,Ba=/radio|checkbox/;c.fn.extend({attr:function(a,b){return X(this,a,b,true,c.attr)},removeAttr:function(a){return this.each(function(){c.attr(this,a,"");this.nodeType===1&&this.removeAttribute(a)})},addClass:function(a){if(c.isFunction(a))return this.each(function(n){var r=c(this);r.addClass(a.call(this,n,r.attr("class")))});if(a&&typeof a==="string")for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1)if(e.className){for(var j=" "+e.className+" ",
42 i=e.className,o=0,k=b.length;o<k;o++)if(j.indexOf(" "+b[o]+" ")<0)i+=" "+b[o];e.className=c.trim(i)}else e.className=a}return this},removeClass:function(a){if(c.isFunction(a))return this.each(function(k){var n=c(this);n.removeClass(a.call(this,k,n.attr("class")))});if(a&&typeof a==="string"||a===w)for(var b=(a||"").split(ca),d=0,f=this.length;d<f;d++){var e=this[d];if(e.nodeType===1&&e.className)if(a){for(var j=(" "+e.className+" ").replace(Aa," "),i=0,o=b.length;i<o;i++)j=j.replace(" "+b[i]+" ",
43 " ");e.className=c.trim(j)}else e.className=""}return this},toggleClass:function(a,b){var d=typeof a,f=typeof b==="boolean";if(c.isFunction(a))return this.each(function(e){var j=c(this);j.toggleClass(a.call(this,e,j.attr("class"),b),b)});return this.each(function(){if(d==="string")for(var e,j=0,i=c(this),o=b,k=a.split(ca);e=k[j++];){o=f?o:!i.hasClass(e);i[o?"addClass":"removeClass"](e)}else if(d==="undefined"||d==="boolean"){this.className&&c.data(this,"__className__",this.className);this.className=
44 this.className||a===false?"":c.data(this,"__className__")||""}})},hasClass:function(a){a=" "+a+" ";for(var b=0,d=this.length;b<d;b++)if((" "+this[b].className+" ").replace(Aa," ").indexOf(a)>-1)return true;return false},val:function(a){if(a===w){var b=this[0];if(b){if(c.nodeName(b,"option"))return(b.attributes.value||{}).specified?b.value:b.text;if(c.nodeName(b,"select")){var d=b.selectedIndex,f=[],e=b.options;b=b.type==="select-one";if(d<0)return null;var j=b?d:0;for(d=b?d+1:e.length;j<d;j++){var i=
45 e[j];if(i.selected){a=c(i).val();if(b)return a;f.push(a)}}return f}if(Ba.test(b.type)&&!c.support.checkOn)return b.getAttribute("value")===null?"on":b.value;return(b.value||"").replace(Za,"")}return w}var o=c.isFunction(a);return this.each(function(k){var n=c(this),r=a;if(this.nodeType===1){if(o)r=a.call(this,k,n.val());if(typeof r==="number")r+="";if(c.isArray(r)&&Ba.test(this.type))this.checked=c.inArray(n.val(),r)>=0;else if(c.nodeName(this,"select")){var u=c.makeArray(r);c("option",this).each(function(){this.selected=
46 c.inArray(c(this).val(),u)>=0});if(!u.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true},attr:function(a,b,d,f){if(!a||a.nodeType===3||a.nodeType===8)return w;if(f&&b in c.attrFn)return c(a)[b](d);f=a.nodeType!==1||!c.isXMLDoc(a);var e=d!==w;b=f&&c.props[b]||b;if(a.nodeType===1){var j=$a.test(b);if(b in a&&f&&!j){if(e){b==="type"&&ab.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");
47 a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&&b.specified?b.value:bb.test(a.nodeName)||cb.test(a.nodeName)&&a.href?0:w;return a[b]}if(!c.support.style&&f&&b==="style"){if(e)a.style.cssText=""+d;return a.style.cssText}e&&a.setAttribute(b,""+d);a=!c.support.hrefNormalized&&f&&j?a.getAttribute(b,2):a.getAttribute(b);return a===null?w:a}return c.style(a,b,d)}});var O=/\.(.*)$/,db=function(a){return a.replace(/[^\w\s\.\|`]/g,
48 function(b){return"\\"+b})};c.event={add:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){if(a.setInterval&&a!==A&&!a.frameElement)a=A;var e,j;if(d.handler){e=d;d=e.handler}if(!d.guid)d.guid=c.guid++;if(j=c.data(a)){var i=j.events=j.events||{},o=j.handle;if(!o)j.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem,arguments):w};o.elem=a;b=b.split(" ");for(var k,n=0,r;k=b[n++];){j=e?c.extend({},e):{handler:d,data:f};if(k.indexOf(".")>-1){r=k.split(".");
49 k=r.shift();j.namespace=r.slice(0).sort().join(".")}else{r=[];j.namespace=""}j.type=k;j.guid=d.guid;var u=i[k],z=c.event.special[k]||{};if(!u){u=i[k]=[];if(!z.setup||z.setup.call(a,f,r,o)===false)if(a.addEventListener)a.addEventListener(k,o,false);else a.attachEvent&&a.attachEvent("on"+k,o)}if(z.add){z.add.call(a,j);if(!j.handler.guid)j.handler.guid=d.guid}u.push(j);c.event.global[k]=true}a=null}}},global:{},remove:function(a,b,d,f){if(!(a.nodeType===3||a.nodeType===8)){var e,j=0,i,o,k,n,r,u,z=c.data(a),
50 C=z&&z.events;if(z&&C){if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(e in C)c.event.remove(a,e+b)}else{for(b=b.split(" ");e=b[j++];){n=e;i=e.indexOf(".")<0;o=[];if(!i){o=e.split(".");e=o.shift();k=new RegExp("(^|\\.)"+c.map(o.slice(0).sort(),db).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(r=C[e])if(d){n=c.event.special[e]||{};for(B=f||0;B<r.length;B++){u=r[B];if(d.guid===u.guid){if(i||k.test(u.namespace)){f==null&&r.splice(B--,1);n.remove&&n.remove.call(a,u)}if(f!=
51 null)break}}if(r.length===0||f!=null&&r.length===1){if(!n.teardown||n.teardown.call(a,o)===false)Ca(a,e,z.handle);delete C[e]}}else for(var B=0;B<r.length;B++){u=r[B];if(i||k.test(u.namespace)){c.event.remove(a,n,u.handler,B);r.splice(B--,1)}}}if(c.isEmptyObject(C)){if(b=z.handle)b.elem=null;delete z.events;delete z.handle;c.isEmptyObject(z)&&c.removeData(a)}}}}},trigger:function(a,b,d,f){var e=a.type||a;if(!f){a=typeof a==="object"?a[G]?a:c.extend(c.Event(e),a):c.Event(e);if(e.indexOf("!")>=0){a.type=
52 e=e.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[e]&&c.each(c.cache,function(){this.events&&this.events[e]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType===8)return w;a.result=w;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(f=c.data(d,"handle"))&&f.apply(d,b);f=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+e]&&d["on"+e].apply(d,b)===false)a.result=false}catch(j){}if(!a.isPropagationStopped()&&
53 f)c.event.trigger(a,b,f,true);else if(!a.isDefaultPrevented()){f=a.target;var i,o=c.nodeName(f,"a")&&e==="click",k=c.event.special[e]||{};if((!k._default||k._default.call(d,a)===false)&&!o&&!(f&&f.nodeName&&c.noData[f.nodeName.toLowerCase()])){try{if(f[e]){if(i=f["on"+e])f["on"+e]=null;c.event.triggered=true;f[e]()}}catch(n){}if(i)f["on"+e]=i;c.event.triggered=false}}},handle:function(a){var b,d,f,e;a=arguments[0]=c.event.fix(a||A.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;
54 if(!b){d=a.type.split(".");a.type=d.shift();f=new RegExp("(^|\\.)"+d.slice(0).sort().join("\\.(?:.*\\.)?")+"(\\.|$)")}e=c.data(this,"events");d=e[a.type];if(e&&d){d=d.slice(0);e=0;for(var j=d.length;e<j;e++){var i=d[e];if(b||f.test(i.namespace)){a.handler=i.handler;a.data=i.data;a.handleObj=i;i=i.handler.apply(this,arguments);if(i!==w){a.result=i;if(i===false){a.preventDefault();a.stopPropagation()}}if(a.isImmediatePropagationStopped())break}}}return a.result},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
55 fix:function(a){if(a[G])return a;var b=a;a=c.Event(b);for(var d=this.props.length,f;d;){f=this.props[--d];a[f]=b[f]}if(!a.target)a.target=a.srcElement||s;if(a.target.nodeType===3)a.target=a.target.parentNode;if(!a.relatedTarget&&a.fromElement)a.relatedTarget=a.fromElement===a.target?a.toElement:a.fromElement;if(a.pageX==null&&a.clientX!=null){b=s.documentElement;d=s.body;a.pageX=a.clientX+(b&&b.scrollLeft||d&&d.scrollLeft||0)-(b&&b.clientLeft||d&&d.clientLeft||0);a.pageY=a.clientY+(b&&b.scrollTop||
56 d&&d.scrollTop||0)-(b&&b.clientTop||d&&d.clientTop||0)}if(!a.which&&(a.charCode||a.charCode===0?a.charCode:a.keyCode))a.which=a.charCode||a.keyCode;if(!a.metaKey&&a.ctrlKey)a.metaKey=a.ctrlKey;if(!a.which&&a.button!==w)a.which=a.button&1?1:a.button&2?3:a.button&4?2:0;return a},guid:1E8,proxy:c.proxy,special:{ready:{setup:c.bindReady,teardown:c.noop},live:{add:function(a){c.event.add(this,a.origType,c.extend({},a,{handler:oa}))},remove:function(a){var b=true,d=a.origType.replace(O,"");c.each(c.data(this,
57 "events").live||[],function(){if(d===this.origType.replace(O,""))return b=false});b&&c.event.remove(this,a.origType,oa)}},beforeunload:{setup:function(a,b,d){if(this.setInterval)this.onbeforeunload=d;return false},teardown:function(a,b){if(this.onbeforeunload===b)this.onbeforeunload=null}}}};var Ca=s.removeEventListener?function(a,b,d){a.removeEventListener(b,d,false)}:function(a,b,d){a.detachEvent("on"+b,d)};c.Event=function(a){if(!this.preventDefault)return new c.Event(a);if(a&&a.type){this.originalEvent=
58 a;this.type=a.type}else this.type=a;this.timeStamp=J();this[G]=true};c.Event.prototype={preventDefault:function(){this.isDefaultPrevented=Z;var a=this.originalEvent;if(a){a.preventDefault&&a.preventDefault();a.returnValue=false}},stopPropagation:function(){this.isPropagationStopped=Z;var a=this.originalEvent;if(a){a.stopPropagation&&a.stopPropagation();a.cancelBubble=true}},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=Z;this.stopPropagation()},isDefaultPrevented:Y,isPropagationStopped:Y,
59 isImmediatePropagationStopped:Y};var Da=function(a){var b=a.relatedTarget;try{for(;b&&b!==this;)b=b.parentNode;if(b!==this){a.type=a.data;c.event.handle.apply(this,arguments)}}catch(d){}},Ea=function(a){a.type=a.data;c.event.handle.apply(this,arguments)};c.each({mouseenter:"mouseover",mouseleave:"mouseout"},function(a,b){c.event.special[a]={setup:function(d){c.event.add(this,b,d&&d.selector?Ea:Da,a)},teardown:function(d){c.event.remove(this,b,d&&d.selector?Ea:Da)}}});if(!c.support.submitBubbles)c.event.special.submit=
60 {setup:function(){if(this.nodeName.toLowerCase()!=="form"){c.event.add(this,"click.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="submit"||d==="image")&&c(b).closest("form").length)return na("submit",this,arguments)});c.event.add(this,"keypress.specialSubmit",function(a){var b=a.target,d=b.type;if((d==="text"||d==="password")&&c(b).closest("form").length&&a.keyCode===13)return na("submit",this,arguments)})}else return false},teardown:function(){c.event.remove(this,".specialSubmit")}};
61 if(!c.support.changeBubbles){var da=/textarea|input|select/i,ea,Fa=function(a){var b=a.type,d=a.value;if(b==="radio"||b==="checkbox")d=a.checked;else if(b==="select-multiple")d=a.selectedIndex>-1?c.map(a.options,function(f){return f.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},fa=function(a,b){var d=a.target,f,e;if(!(!da.test(d.nodeName)||d.readOnly)){f=c.data(d,"_change_data");e=Fa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",
62 e);if(!(f===w||e===f))if(f!=null||e){a.type="change";return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:fa,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return fa.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return fa.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,
63 "_change_data",Fa(a))}},setup:function(){if(this.type==="file")return false;for(var a in ea)c.event.add(this,a+".specialChange",ea[a]);return da.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return da.test(this.nodeName)}};ea=c.event.special.change.filters}s.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(f){f=c.event.fix(f);f.type=b;return c.event.handle.call(this,f)}c.event.special[b]={setup:function(){this.addEventListener(a,
64 d,true)},teardown:function(){this.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,f,e){if(typeof d==="object"){for(var j in d)this[b](j,f,d[j],e);return this}if(c.isFunction(f)){e=f;f=w}var i=b==="one"?c.proxy(e,function(k){c(this).unbind(k,i);return e.apply(this,arguments)}):e;if(d==="unload"&&b!=="one")this.one(d,f,e);else{j=0;for(var o=this.length;j<o;j++)c.event.add(this[j],d,i,f)}return this}});c.fn.extend({unbind:function(a,b){if(typeof a==="object"&&
65 !a.preventDefault)for(var d in a)this.unbind(d,a[d]);else{d=0;for(var f=this.length;d<f;d++)c.event.remove(this[d],a,b)}return this},delegate:function(a,b,d,f){return this.live(b,d,f,a)},undelegate:function(a,b,d){return arguments.length===0?this.unbind("live"):this.die(b,null,d,a)},trigger:function(a,b){return this.each(function(){c.event.trigger(a,b,this)})},triggerHandler:function(a,b){if(this[0]){a=c.Event(a);a.preventDefault();a.stopPropagation();c.event.trigger(a,b,this[0]);return a.result}},
66 toggle:function(a){for(var b=arguments,d=1;d<b.length;)c.proxy(a,b[d++]);return this.click(c.proxy(a,function(f){var e=(c.data(this,"lastToggle"+a.guid)||0)%d;c.data(this,"lastToggle"+a.guid,e+1);f.preventDefault();return b[e].apply(this,arguments)||false}))},hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}});var Ga={focus:"focusin",blur:"focusout",mouseenter:"mouseover",mouseleave:"mouseout"};c.each(["live","die"],function(a,b){c.fn[b]=function(d,f,e,j){var i,o=0,k,n,r=j||this.selector,
67 u=j?this:c(this.context);if(c.isFunction(f)){e=f;f=w}for(d=(d||"").split(" ");(i=d[o++])!=null;){j=O.exec(i);k="";if(j){k=j[0];i=i.replace(O,"")}if(i==="hover")d.push("mouseenter"+k,"mouseleave"+k);else{n=i;if(i==="focus"||i==="blur"){d.push(Ga[i]+k);i+=k}else i=(Ga[i]||i)+k;b==="live"?u.each(function(){c.event.add(this,pa(i,r),{data:f,selector:r,handler:e,origType:i,origHandler:e,preType:n})}):u.unbind(pa(i,r),e)}}return this}});c.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error".split(" "),
68 function(a,b){c.fn[b]=function(d){return d?this.bind(b,d):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});A.attachEvent&&!A.addEventListener&&A.attachEvent("onunload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}});(function(){function a(g){for(var h="",l,m=0;g[m];m++){l=g[m];if(l.nodeType===3||l.nodeType===4)h+=l.nodeValue;else if(l.nodeType!==8)h+=a(l.childNodes)}return h}function b(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];
69 if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1&&!p){t.sizcache=l;t.sizset=q}if(t.nodeName.toLowerCase()===h){y=t;break}t=t[g]}m[q]=y}}}function d(g,h,l,m,q,p){q=0;for(var v=m.length;q<v;q++){var t=m[q];if(t){t=t[g];for(var y=false;t;){if(t.sizcache===l){y=m[t.sizset];break}if(t.nodeType===1){if(!p){t.sizcache=l;t.sizset=q}if(typeof h!=="string"){if(t===h){y=true;break}}else if(k.filter(h,[t]).length>0){y=t;break}}t=t[g]}m[q]=y}}}var f=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
70 e=0,j=Object.prototype.toString,i=false,o=true;[0,0].sort(function(){o=false;return 0});var k=function(g,h,l,m){l=l||[];var q=h=h||s;if(h.nodeType!==1&&h.nodeType!==9)return[];if(!g||typeof g!=="string")return l;for(var p=[],v,t,y,S,H=true,M=x(h),I=g;(f.exec(""),v=f.exec(I))!==null;){I=v[3];p.push(v[1]);if(v[2]){S=v[3];break}}if(p.length>1&&r.exec(g))if(p.length===2&&n.relative[p[0]])t=ga(p[0]+p[1],h);else for(t=n.relative[p[0]]?[h]:k(p.shift(),h);p.length;){g=p.shift();if(n.relative[g])g+=p.shift();
71 t=ga(g,t)}else{if(!m&&p.length>1&&h.nodeType===9&&!M&&n.match.ID.test(p[0])&&!n.match.ID.test(p[p.length-1])){v=k.find(p.shift(),h,M);h=v.expr?k.filter(v.expr,v.set)[0]:v.set[0]}if(h){v=m?{expr:p.pop(),set:z(m)}:k.find(p.pop(),p.length===1&&(p[0]==="~"||p[0]==="+")&&h.parentNode?h.parentNode:h,M);t=v.expr?k.filter(v.expr,v.set):v.set;if(p.length>0)y=z(t);else H=false;for(;p.length;){var D=p.pop();v=D;if(n.relative[D])v=p.pop();else D="";if(v==null)v=h;n.relative[D](y,v,M)}}else y=[]}y||(y=t);y||k.error(D||
72 g);if(j.call(y)==="[object Array]")if(H)if(h&&h.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&E(h,y[g])))l.push(t[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&l.push(t[g]);else l.push.apply(l,y);else z(y,l);if(S){k(S,q,l,m);k.uniqueSort(l)}return l};k.uniqueSort=function(g){if(B){i=o;g.sort(B);if(i)for(var h=1;h<g.length;h++)g[h]===g[h-1]&&g.splice(h--,1)}return g};k.matches=function(g,h){return k(g,null,null,h)};k.find=function(g,h,l){var m,q;if(!g)return[];
73 for(var p=0,v=n.order.length;p<v;p++){var t=n.order[p];if(q=n.leftMatch[t].exec(g)){var y=q[1];q.splice(1,1);if(y.substr(y.length-1)!=="\\"){q[1]=(q[1]||"").replace(/\\/g,"");m=n.find[t](q,h,l);if(m!=null){g=g.replace(n.match[t],"");break}}}}m||(m=h.getElementsByTagName("*"));return{set:m,expr:g}};k.filter=function(g,h,l,m){for(var q=g,p=[],v=h,t,y,S=h&&h[0]&&x(h[0]);g&&h.length;){for(var H in n.filter)if((t=n.leftMatch[H].exec(g))!=null&&t[2]){var M=n.filter[H],I,D;D=t[1];y=false;t.splice(1,1);if(D.substr(D.length-
74 1)!=="\\"){if(v===p)p=[];if(n.preFilter[H])if(t=n.preFilter[H](t,v,l,p,m,S)){if(t===true)continue}else y=I=true;if(t)for(var U=0;(D=v[U])!=null;U++)if(D){I=M(D,t,U,v);var Ha=m^!!I;if(l&&I!=null)if(Ha)y=true;else v[U]=false;else if(Ha){p.push(D);y=true}}if(I!==w){l||(v=p);g=g.replace(n.match[H],"");if(!y)return[];break}}}if(g===q)if(y==null)k.error(g);else break;q=g}return v};k.error=function(g){throw"Syntax error, unrecognized expression: "+g;};var n=k.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
75 CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(g){return g.getAttribute("href")}},
76 relative:{"+":function(g,h){var l=typeof h==="string",m=l&&!/\W/.test(h);l=l&&!m;if(m)h=h.toLowerCase();m=0;for(var q=g.length,p;m<q;m++)if(p=g[m]){for(;(p=p.previousSibling)&&p.nodeType!==1;);g[m]=l||p&&p.nodeName.toLowerCase()===h?p||false:p===h}l&&k.filter(h,g,true)},">":function(g,h){var l=typeof h==="string";if(l&&!/\W/.test(h)){h=h.toLowerCase();for(var m=0,q=g.length;m<q;m++){var p=g[m];if(p){l=p.parentNode;g[m]=l.nodeName.toLowerCase()===h?l:false}}}else{m=0;for(q=g.length;m<q;m++)if(p=g[m])g[m]=
77 l?p.parentNode:p.parentNode===h;l&&k.filter(h,g,true)}},"":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("parentNode",h,m,g,p,l)},"~":function(g,h,l){var m=e++,q=d;if(typeof h==="string"&&!/\W/.test(h)){var p=h=h.toLowerCase();q=b}q("previousSibling",h,m,g,p,l)}},find:{ID:function(g,h,l){if(typeof h.getElementById!=="undefined"&&!l)return(g=h.getElementById(g[1]))?[g]:[]},NAME:function(g,h){if(typeof h.getElementsByName!=="undefined"){var l=[];
78 h=h.getElementsByName(g[1]);for(var m=0,q=h.length;m<q;m++)h[m].getAttribute("name")===g[1]&&l.push(h[m]);return l.length===0?null:l}},TAG:function(g,h){return h.getElementsByTagName(g[1])}},preFilter:{CLASS:function(g,h,l,m,q,p){g=" "+g[1].replace(/\\/g,"")+" ";if(p)return g;p=0;for(var v;(v=h[p])!=null;p++)if(v)if(q^(v.className&&(" "+v.className+" ").replace(/[\t\n]/g," ").indexOf(g)>=0))l||m.push(v);else if(l)h[p]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},
79 CHILD:function(g){if(g[1]==="nth"){var h=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=h[1]+(h[2]||1)-0;g[3]=h[3]-0}g[0]=e++;return g},ATTR:function(g,h,l,m,q,p){h=g[1].replace(/\\/g,"");if(!p&&n.attrMap[h])g[1]=n.attrMap[h];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,h,l,m,q){if(g[1]==="not")if((f.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,h);else{g=k.filter(g[3],h,l,true^q);l||m.push.apply(m,
80 g);return false}else if(n.match.POS.test(g[0])||n.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled===true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,h,l){return!!k(l[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},
81 text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"===g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},
82 setFilters:{first:function(g,h){return h===0},last:function(g,h,l,m){return h===m.length-1},even:function(g,h){return h%2===0},odd:function(g,h){return h%2===1},lt:function(g,h,l){return h<l[3]-0},gt:function(g,h,l){return h>l[3]-0},nth:function(g,h,l){return l[3]-0===h},eq:function(g,h,l){return l[3]-0===h}},filter:{PSEUDO:function(g,h,l,m){var q=h[1],p=n.filters[q];if(p)return p(g,l,h,m);else if(q==="contains")return(g.textContent||g.innerText||a([g])||"").indexOf(h[3])>=0;else if(q==="not"){h=
83 h[3];l=0;for(m=h.length;l<m;l++)if(h[l]===g)return false;return true}else k.error("Syntax error, unrecognized expression: "+q)},CHILD:function(g,h){var l=h[1],m=g;switch(l){case "only":case "first":for(;m=m.previousSibling;)if(m.nodeType===1)return false;if(l==="first")return true;m=g;case "last":for(;m=m.nextSibling;)if(m.nodeType===1)return false;return true;case "nth":l=h[2];var q=h[3];if(l===1&&q===0)return true;h=h[0];var p=g.parentNode;if(p&&(p.sizcache!==h||!g.nodeIndex)){var v=0;for(m=p.firstChild;m;m=
84 m.nextSibling)if(m.nodeType===1)m.nodeIndex=++v;p.sizcache=h}g=g.nodeIndex-q;return l===0?g===0:g%l===0&&g/l>=0}},ID:function(g,h){return g.nodeType===1&&g.getAttribute("id")===h},TAG:function(g,h){return h==="*"&&g.nodeType===1||g.nodeName.toLowerCase()===h},CLASS:function(g,h){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(h)>-1},ATTR:function(g,h){var l=h[1];g=n.attrHandle[l]?n.attrHandle[l](g):g[l]!=null?g[l]:g.getAttribute(l);l=g+"";var m=h[2];h=h[4];return g==null?m==="!=":m===
85 "="?l===h:m==="*="?l.indexOf(h)>=0:m==="~="?(" "+l+" ").indexOf(h)>=0:!h?l&&g!==false:m==="!="?l!==h:m==="^="?l.indexOf(h)===0:m==="$="?l.substr(l.length-h.length)===h:m==="|="?l===h||l.substr(0,h.length+1)===h+"-":false},POS:function(g,h,l,m){var q=n.setFilters[h[2]];if(q)return q(g,l,h,m)}}},r=n.match.POS;for(var u in n.match){n.match[u]=new RegExp(n.match[u].source+/(?![^\[]*\])(?![^\(]*\))/.source);n.leftMatch[u]=new RegExp(/(^(?:.|\r|\n)*?)/.source+n.match[u].source.replace(/\\(\d+)/g,function(g,
86 h){return"\\"+(h-0+1)}))}var z=function(g,h){g=Array.prototype.slice.call(g,0);if(h){h.push.apply(h,g);return h}return g};try{Array.prototype.slice.call(s.documentElement.childNodes,0)}catch(C){z=function(g,h){h=h||[];if(j.call(g)==="[object Array]")Array.prototype.push.apply(h,g);else if(typeof g.length==="number")for(var l=0,m=g.length;l<m;l++)h.push(g[l]);else for(l=0;g[l];l++)h.push(g[l]);return h}}var B;if(s.documentElement.compareDocumentPosition)B=function(g,h){if(!g.compareDocumentPosition||
87 !h.compareDocumentPosition){if(g==h)i=true;return g.compareDocumentPosition?-1:1}g=g.compareDocumentPosition(h)&4?-1:g===h?0:1;if(g===0)i=true;return g};else if("sourceIndex"in s.documentElement)B=function(g,h){if(!g.sourceIndex||!h.sourceIndex){if(g==h)i=true;return g.sourceIndex?-1:1}g=g.sourceIndex-h.sourceIndex;if(g===0)i=true;return g};else if(s.createRange)B=function(g,h){if(!g.ownerDocument||!h.ownerDocument){if(g==h)i=true;return g.ownerDocument?-1:1}var l=g.ownerDocument.createRange(),m=
88 h.ownerDocument.createRange();l.setStart(g,0);l.setEnd(g,0);m.setStart(h,0);m.setEnd(h,0);g=l.compareBoundaryPoints(Range.START_TO_END,m);if(g===0)i=true;return g};(function(){var g=s.createElement("div"),h="script"+(new Date).getTime();g.innerHTML="<a name='"+h+"'/>";var l=s.documentElement;l.insertBefore(g,l.firstChild);if(s.getElementById(h)){n.find.ID=function(m,q,p){if(typeof q.getElementById!=="undefined"&&!p)return(q=q.getElementById(m[1]))?q.id===m[1]||typeof q.getAttributeNode!=="undefined"&&
89 q.getAttributeNode("id").nodeValue===m[1]?[q]:w:[]};n.filter.ID=function(m,q){var p=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&p&&p.nodeValue===q}}l.removeChild(g);l=g=null})();(function(){var g=s.createElement("div");g.appendChild(s.createComment(""));if(g.getElementsByTagName("*").length>0)n.find.TAG=function(h,l){l=l.getElementsByTagName(h[1]);if(h[1]==="*"){h=[];for(var m=0;l[m];m++)l[m].nodeType===1&&h.push(l[m]);l=h}return l};g.innerHTML="<a href='#'></a>";
90 if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")n.attrHandle.href=function(h){return h.getAttribute("href",2)};g=null})();s.querySelectorAll&&function(){var g=k,h=s.createElement("div");h.innerHTML="<p class='TEST'></p>";if(!(h.querySelectorAll&&h.querySelectorAll(".TEST").length===0)){k=function(m,q,p,v){q=q||s;if(!v&&q.nodeType===9&&!x(q))try{return z(q.querySelectorAll(m),p)}catch(t){}return g(m,q,p,v)};for(var l in g)k[l]=g[l];h=null}}();
91 (function(){var g=s.createElement("div");g.innerHTML="<div class='test e'></div><div class='test'></div>";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){n.order.splice(1,0,"CLASS");n.find.CLASS=function(h,l,m){if(typeof l.getElementsByClassName!=="undefined"&&!m)return l.getElementsByClassName(h[1])};g=null}}})();var E=s.compareDocumentPosition?function(g,h){return!!(g.compareDocumentPosition(h)&16)}:
92 function(g,h){return g!==h&&(g.contains?g.contains(h):true)},x=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false},ga=function(g,h){var l=[],m="",q;for(h=h.nodeType?[h]:h;q=n.match.PSEUDO.exec(g);){m+=q[0];g=g.replace(n.match.PSEUDO,"")}g=n.relative[g]?g+"*":g;q=0;for(var p=h.length;q<p;q++)k(g,h[q],l);return k.filter(m,l)};c.find=k;c.expr=k.selectors;c.expr[":"]=c.expr.filters;c.unique=k.uniqueSort;c.text=a;c.isXMLDoc=x;c.contains=E})();var eb=/Until$/,fb=/^(?:parents|prevUntil|prevAll)/,
93 gb=/,/;R=Array.prototype.slice;var Ia=function(a,b,d){if(c.isFunction(b))return c.grep(a,function(e,j){return!!b.call(e,j,e)===d});else if(b.nodeType)return c.grep(a,function(e){return e===b===d});else if(typeof b==="string"){var f=c.grep(a,function(e){return e.nodeType===1});if(Ua.test(b))return c.filter(b,f,!d);else b=c.filter(b,f)}return c.grep(a,function(e){return c.inArray(e,b)>=0===d})};c.fn.extend({find:function(a){for(var b=this.pushStack("","find",a),d=0,f=0,e=this.length;f<e;f++){d=b.length;
94 c.find(a,this[f],b);if(f>0)for(var j=d;j<b.length;j++)for(var i=0;i<d;i++)if(b[i]===b[j]){b.splice(j--,1);break}}return b},has:function(a){var b=c(a);return this.filter(function(){for(var d=0,f=b.length;d<f;d++)if(c.contains(this,b[d]))return true})},not:function(a){return this.pushStack(Ia(this,a,false),"not",a)},filter:function(a){return this.pushStack(Ia(this,a,true),"filter",a)},is:function(a){return!!a&&c.filter(a,this).length>0},closest:function(a,b){if(c.isArray(a)){var d=[],f=this[0],e,j=
95 {},i;if(f&&a.length){e=0;for(var o=a.length;e<o;e++){i=a[e];j[i]||(j[i]=c.expr.match.POS.test(i)?c(i,b||this.context):i)}for(;f&&f.ownerDocument&&f!==b;){for(i in j){e=j[i];if(e.jquery?e.index(f)>-1:c(f).is(e)){d.push({selector:i,elem:f});delete j[i]}}f=f.parentNode}}return d}var k=c.expr.match.POS.test(a)?c(a,b||this.context):null;return this.map(function(n,r){for(;r&&r.ownerDocument&&r!==b;){if(k?k.index(r)>-1:c(r).is(a))return r;r=r.parentNode}return null})},index:function(a){if(!a||typeof a===
96 "string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){a=typeof a==="string"?c(a,b||this.context):c.makeArray(a);b=c.merge(this.get(),a);return this.pushStack(qa(a[0])||qa(b[0])?b:c.unique(b))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",
97 d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a,2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?
98 a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a,b){c.fn[a]=function(d,f){var e=c.map(this,b,d);eb.test(a)||(f=d);if(f&&typeof f==="string")e=c.filter(f,e);e=this.length>1?c.unique(e):e;if((this.length>1||gb.test(f))&&fb.test(a))e=e.reverse();return this.pushStack(e,a,R.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return c.find.matches(a,b)},dir:function(a,b,d){var f=[];for(a=a[b];a&&a.nodeType!==9&&(d===w||a.nodeType!==1||!c(a).is(d));){a.nodeType===
99 1&&f.push(a);a=a[b]}return f},nth:function(a,b,d){b=b||1;for(var f=0;a;a=a[d])if(a.nodeType===1&&++f===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var Ja=/ jQuery\d+="(?:\d+|null)"/g,V=/^\s+/,Ka=/(<([\w:]+)[^>]*?)\/>/g,hb=/^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,La=/<([\w:]+)/,ib=/<tbody/i,jb=/<|&#?\w+;/,ta=/<script|<object|<embed|<option|<style/i,ua=/checked\s*(?:[^=]|=\s*.checked.)/i,Ma=function(a,b,d){return hb.test(d)?
100 a:b+"></"+d+">"},F={option:[1,"<select multiple='multiple'>","</select>"],legend:[1,"<fieldset>","</fieldset>"],thead:[1,"<table>","</table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],col:[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"],area:[1,"<map>","</map>"],_default:[0,"",""]};F.optgroup=F.option;F.tbody=F.tfoot=F.colgroup=F.caption=F.thead;F.th=F.td;if(!c.support.htmlSerialize)F._default=[1,"div<div>","</div>"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d=
101 c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==w)return this.empty().append((this[0]&&this[0].ownerDocument||s).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this},
102 wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})},
103 prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,
104 this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,f;(f=this[d])!=null;d++)if(!a||c.filter(a,[f]).length){if(!b&&f.nodeType===1){c.cleanData(f.getElementsByTagName("*"));c.cleanData([f])}f.parentNode&&f.parentNode.removeChild(f)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild);
105 return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,f=this.ownerDocument;if(!d){d=f.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(Ja,"").replace(/=([^="'>\s]+\/)>/g,'="$1">').replace(V,"")],f)[0]}else return this.cloneNode(true)});if(a===true){ra(this,b);ra(this.find("*"),b.find("*"))}return b},html:function(a){if(a===w)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(Ja,
106 ""):null;else if(typeof a==="string"&&!ta.test(a)&&(c.support.leadingWhitespace||!V.test(a))&&!F[(La.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Ka,Ma);try{for(var b=0,d=this.length;b<d;b++)if(this[b].nodeType===1){c.cleanData(this[b].getElementsByTagName("*"));this[b].innerHTML=a}}catch(f){this.empty().append(a)}}else c.isFunction(a)?this.each(function(e){var j=c(this),i=j.html();j.empty().append(function(){return a.call(this,e,i)})}):this.empty().append(a);return this},replaceWith:function(a){if(this[0]&&
107 this[0].parentNode){if(c.isFunction(a))return this.each(function(b){var d=c(this),f=d.html();d.replaceWith(a.call(this,b,f))});if(typeof a!=="string")a=c(a).detach();return this.each(function(){var b=this.nextSibling,d=this.parentNode;c(this).remove();b?c(b).before(a):c(d).append(a)})}else return this.pushStack(c(c.isFunction(a)?a():a),"replaceWith",a)},detach:function(a){return this.remove(a,true)},domManip:function(a,b,d){function f(u){return c.nodeName(u,"table")?u.getElementsByTagName("tbody")[0]||
108 u.appendChild(u.ownerDocument.createElement("tbody")):u}var e,j,i=a[0],o=[],k;if(!c.support.checkClone&&arguments.length===3&&typeof i==="string"&&ua.test(i))return this.each(function(){c(this).domManip(a,b,d,true)});if(c.isFunction(i))return this.each(function(u){var z=c(this);a[0]=i.call(this,u,b?z.html():w);z.domManip(a,b,d)});if(this[0]){e=i&&i.parentNode;e=c.support.parentNode&&e&&e.nodeType===11&&e.childNodes.length===this.length?{fragment:e}:sa(a,this,o);k=e.fragment;if(j=k.childNodes.length===
109 1?(k=k.firstChild):k.firstChild){b=b&&c.nodeName(j,"tr");for(var n=0,r=this.length;n<r;n++)d.call(b?f(this[n],j):this[n],n>0||e.cacheable||this.length>1?k.cloneNode(true):k)}o.length&&c.each(o,Qa)}return this}});c.fragments={};c.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var f=[];d=c(d);var e=this.length===1&&this[0].parentNode;if(e&&e.nodeType===11&&e.childNodes.length===1&&d.length===1){d[b](this[0]);
110 return this}else{e=0;for(var j=d.length;e<j;e++){var i=(e>0?this.clone(true):this).get();c.fn[b].apply(c(d[e]),i);f=f.concat(i)}return this.pushStack(f,a,d.selector)}}});c.extend({clean:function(a,b,d,f){b=b||s;if(typeof b.createElement==="undefined")b=b.ownerDocument||b[0]&&b[0].ownerDocument||s;for(var e=[],j=0,i;(i=a[j])!=null;j++){if(typeof i==="number")i+="";if(i){if(typeof i==="string"&&!jb.test(i))i=b.createTextNode(i);else if(typeof i==="string"){i=i.replace(Ka,Ma);var o=(La.exec(i)||["",
111 ""])[1].toLowerCase(),k=F[o]||F._default,n=k[0],r=b.createElement("div");for(r.innerHTML=k[1]+i+k[2];n--;)r=r.lastChild;if(!c.support.tbody){n=ib.test(i);o=o==="table"&&!n?r.firstChild&&r.firstChild.childNodes:k[1]==="<table>"&&!n?r.childNodes:[];for(k=o.length-1;k>=0;--k)c.nodeName(o[k],"tbody")&&!o[k].childNodes.length&&o[k].parentNode.removeChild(o[k])}!c.support.leadingWhitespace&&V.test(i)&&r.insertBefore(b.createTextNode(V.exec(i)[0]),r.firstChild);i=r.childNodes}if(i.nodeType)e.push(i);else e=
112 c.merge(e,i)}}if(d)for(j=0;e[j];j++)if(f&&c.nodeName(e[j],"script")&&(!e[j].type||e[j].type.toLowerCase()==="text/javascript"))f.push(e[j].parentNode?e[j].parentNode.removeChild(e[j]):e[j]);else{e[j].nodeType===1&&e.splice.apply(e,[j+1,0].concat(c.makeArray(e[j].getElementsByTagName("script"))));d.appendChild(e[j])}return e},cleanData:function(a){for(var b,d,f=c.cache,e=c.event.special,j=c.support.deleteExpando,i=0,o;(o=a[i])!=null;i++)if(d=o[c.expando]){b=f[d];if(b.events)for(var k in b.events)e[k]?
113 c.event.remove(o,k):Ca(o,k,b.handle);if(j)delete o[c.expando];else o.removeAttribute&&o.removeAttribute(c.expando);delete f[d]}}});var kb=/z-?index|font-?weight|opacity|zoom|line-?height/i,Na=/alpha\([^)]*\)/,Oa=/opacity=([^)]*)/,ha=/float/i,ia=/-([a-z])/ig,lb=/([A-Z])/g,mb=/^-?\d+(?:px)?$/i,nb=/^-?\d/,ob={position:"absolute",visibility:"hidden",display:"block"},pb=["Left","Right"],qb=["Top","Bottom"],rb=s.defaultView&&s.defaultView.getComputedStyle,Pa=c.support.cssFloat?"cssFloat":"styleFloat",ja=
114 function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){return X(this,a,b,true,function(d,f,e){if(e===w)return c.curCSS(d,f);if(typeof e==="number"&&!kb.test(f))e+="px";c.style(d,f,e)})};c.extend({style:function(a,b,d){if(!a||a.nodeType===3||a.nodeType===8)return w;if((b==="width"||b==="height")&&parseFloat(d)<0)d=w;var f=a.style||a,e=d!==w;if(!c.support.opacity&&b==="opacity"){if(e){f.zoom=1;b=parseInt(d,10)+""==="NaN"?"":"alpha(opacity="+d*100+")";a=f.filter||c.curCSS(a,"filter")||"";f.filter=
115 Na.test(a)?a.replace(Na,b):b}return f.filter&&f.filter.indexOf("opacity=")>=0?parseFloat(Oa.exec(f.filter)[1])/100+"":""}if(ha.test(b))b=Pa;b=b.replace(ia,ja);if(e)f[b]=d;return f[b]},css:function(a,b,d,f){if(b==="width"||b==="height"){var e,j=b==="width"?pb:qb;function i(){e=b==="width"?a.offsetWidth:a.offsetHeight;f!=="border"&&c.each(j,function(){f||(e-=parseFloat(c.curCSS(a,"padding"+this,true))||0);if(f==="margin")e+=parseFloat(c.curCSS(a,"margin"+this,true))||0;else e-=parseFloat(c.curCSS(a,
116 "border"+this+"Width",true))||0})}a.offsetWidth!==0?i():c.swap(a,ob,i);return Math.max(0,Math.round(e))}return c.curCSS(a,b,d)},curCSS:function(a,b,d){var f,e=a.style;if(!c.support.opacity&&b==="opacity"&&a.currentStyle){f=Oa.test(a.currentStyle.filter||"")?parseFloat(RegExp.$1)/100+"":"";return f===""?"1":f}if(ha.test(b))b=Pa;if(!d&&e&&e[b])f=e[b];else if(rb){if(ha.test(b))b="float";b=b.replace(lb,"-$1").toLowerCase();e=a.ownerDocument.defaultView;if(!e)return null;if(a=e.getComputedStyle(a,null))f=
117 a.getPropertyValue(b);if(b==="opacity"&&f==="")f="1"}else if(a.currentStyle){d=b.replace(ia,ja);f=a.currentStyle[b]||a.currentStyle[d];if(!mb.test(f)&&nb.test(f)){b=e.left;var j=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;e.left=d==="fontSize"?"1em":f||0;f=e.pixelLeft+"px";e.left=b;a.runtimeStyle.left=j}}return f},swap:function(a,b,d){var f={};for(var e in b){f[e]=a.style[e];a.style[e]=b[e]}d.call(a);for(e in b)a.style[e]=f[e]}});if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=
118 a.offsetWidth,d=a.offsetHeight,f=a.nodeName.toLowerCase()==="tr";return b===0&&d===0&&!f?true:b>0&&d>0&&!f?false:c.curCSS(a,"display")==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var sb=J(),tb=/<script(.|\s)*?\/script>/gi,ub=/select|textarea/i,vb=/color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,N=/=\?(&|$)/,ka=/\?/,wb=/(\?|&)_=.*?(&|$)/,xb=/^(\w+:)?\/\/([^\/?#]+)/,yb=/%20/g,zb=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!==
119 "string")return zb.call(this,a);else if(!this.length)return this;var f=a.indexOf(" ");if(f>=0){var e=a.slice(f,a.length);a=a.slice(0,f)}f="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b==="object"){b=c.param(b,c.ajaxSettings.traditional);f="POST"}var j=this;c.ajax({url:a,type:f,dataType:"html",data:b,complete:function(i,o){if(o==="success"||o==="notmodified")j.html(e?c("<div />").append(i.responseText.replace(tb,"")).find(e):i.responseText);d&&j.each(d,[i.responseText,o,i])}});return this},
120 serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||ub.test(this.nodeName)||vb.test(this.type))}).map(function(a,b){a=c(this).val();return a==null?null:c.isArray(a)?c.map(a,function(d){return{name:b.name,value:d}}):{name:b.name,value:a}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
121 function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:f})},getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,f){if(c.isFunction(b)){f=f||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:f})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,
122 global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:A.XMLHttpRequest&&(A.location.protocol!=="file:"||!A.ActiveXObject)?function(){return new A.XMLHttpRequest}:function(){try{return new A.ActiveXObject("Microsoft.XMLHTTP")}catch(a){}},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},etag:{},ajax:function(a){function b(){e.success&&
123 e.success.call(k,o,i,x);e.global&&f("ajaxSuccess",[x,e])}function d(){e.complete&&e.complete.call(k,x,i);e.global&&f("ajaxComplete",[x,e]);e.global&&!--c.active&&c.event.trigger("ajaxStop")}function f(q,p){(e.context?c(e.context):c.event).trigger(q,p)}var e=c.extend(true,{},c.ajaxSettings,a),j,i,o,k=a&&a.context||e,n=e.type.toUpperCase();if(e.data&&e.processData&&typeof e.data!=="string")e.data=c.param(e.data,e.traditional);if(e.dataType==="jsonp"){if(n==="GET")N.test(e.url)||(e.url+=(ka.test(e.url)?
124 "&":"?")+(e.jsonp||"callback")+"=?");else if(!e.data||!N.test(e.data))e.data=(e.data?e.data+"&":"")+(e.jsonp||"callback")+"=?";e.dataType="json"}if(e.dataType==="json"&&(e.data&&N.test(e.data)||N.test(e.url))){j=e.jsonpCallback||"jsonp"+sb++;if(e.data)e.data=(e.data+"").replace(N,"="+j+"$1");e.url=e.url.replace(N,"="+j+"$1");e.dataType="script";A[j]=A[j]||function(q){o=q;b();d();A[j]=w;try{delete A[j]}catch(p){}z&&z.removeChild(C)}}if(e.dataType==="script"&&e.cache===null)e.cache=false;if(e.cache===
125 false&&n==="GET"){var r=J(),u=e.url.replace(wb,"$1_="+r+"$2");e.url=u+(u===e.url?(ka.test(e.url)?"&":"?")+"_="+r:"")}if(e.data&&n==="GET")e.url+=(ka.test(e.url)?"&":"?")+e.data;e.global&&!c.active++&&c.event.trigger("ajaxStart");r=(r=xb.exec(e.url))&&(r[1]&&r[1]!==location.protocol||r[2]!==location.host);if(e.dataType==="script"&&n==="GET"&&r){var z=s.getElementsByTagName("head")[0]||s.documentElement,C=s.createElement("script");C.src=e.url;if(e.scriptCharset)C.charset=e.scriptCharset;if(!j){var B=
126 false;C.onload=C.onreadystatechange=function(){if(!B&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){B=true;b();d();C.onload=C.onreadystatechange=null;z&&C.parentNode&&z.removeChild(C)}}}z.insertBefore(C,z.firstChild);return w}var E=false,x=e.xhr();if(x){e.username?x.open(n,e.url,e.async,e.username,e.password):x.open(n,e.url,e.async);try{if(e.data||a&&a.contentType)x.setRequestHeader("Content-Type",e.contentType);if(e.ifModified){c.lastModified[e.url]&&x.setRequestHeader("If-Modified-Since",
127 c.lastModified[e.url]);c.etag[e.url]&&x.setRequestHeader("If-None-Match",c.etag[e.url])}r||x.setRequestHeader("X-Requested-With","XMLHttpRequest");x.setRequestHeader("Accept",e.dataType&&e.accepts[e.dataType]?e.accepts[e.dataType]+", */*":e.accepts._default)}catch(ga){}if(e.beforeSend&&e.beforeSend.call(k,x,e)===false){e.global&&!--c.active&&c.event.trigger("ajaxStop");x.abort();return false}e.global&&f("ajaxSend",[x,e]);var g=x.onreadystatechange=function(q){if(!x||x.readyState===0||q==="abort"){E||
128 d();E=true;if(x)x.onreadystatechange=c.noop}else if(!E&&x&&(x.readyState===4||q==="timeout")){E=true;x.onreadystatechange=c.noop;i=q==="timeout"?"timeout":!c.httpSuccess(x)?"error":e.ifModified&&c.httpNotModified(x,e.url)?"notmodified":"success";var p;if(i==="success")try{o=c.httpData(x,e.dataType,e)}catch(v){i="parsererror";p=v}if(i==="success"||i==="notmodified")j||b();else c.handleError(e,x,i,p);d();q==="timeout"&&x.abort();if(e.async)x=null}};try{var h=x.abort;x.abort=function(){x&&h.call(x);
129 g("abort")}}catch(l){}e.async&&e.timeout>0&&setTimeout(function(){x&&!E&&g("timeout")},e.timeout);try{x.send(n==="POST"||n==="PUT"||n==="DELETE"?e.data:null)}catch(m){c.handleError(e,x,null,m);d()}e.async||g();return x}},handleError:function(a,b,d,f){if(a.error)a.error.call(a.context||a,b,d,f);if(a.global)(a.context?c(a.context):c.event).trigger("ajaxError",[b,a,f])},active:0,httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===
130 1223||a.status===0}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"),f=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(f)c.etag[b]=f;return a.status===304||a.status===0},httpData:function(a,b,d){var f=a.getResponseHeader("content-type")||"",e=b==="xml"||!b&&f.indexOf("xml")>=0;a=e?a.responseXML:a.responseText;e&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b===
131 "json"||!b&&f.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&f.indexOf("javascript")>=0)c.globalEval(a);return a},param:function(a,b){function d(i,o){if(c.isArray(o))c.each(o,function(k,n){b||/\[\]$/.test(i)?f(i,n):d(i+"["+(typeof n==="object"||c.isArray(n)?k:"")+"]",n)});else!b&&o!=null&&typeof o==="object"?c.each(o,function(k,n){d(i+"["+k+"]",n)}):f(i,o)}function f(i,o){o=c.isFunction(o)?o():o;e[e.length]=encodeURIComponent(i)+"="+encodeURIComponent(o)}var e=[];if(b===w)b=c.ajaxSettings.traditional;
132 if(c.isArray(a)||a.jquery)c.each(a,function(){f(this.name,this.value)});else for(var j in a)d(j,a[j]);return e.join("&").replace(yb,"+")}});var la={},Ab=/toggle|show|hide/,Bb=/^([+-]=)?([\d+-.]+)(.*)$/,W,va=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b){if(a||a===0)return this.animate(K("show",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");
133 this[a].style.display=d||"";if(c.css(this[a],"display")==="none"){d=this[a].nodeName;var f;if(la[d])f=la[d];else{var e=c("<"+d+" />").appendTo("body");f=e.css("display");if(f==="none")f="block";e.remove();la[d]=f}c.data(this[a],"olddisplay",f)}}a=0;for(b=this.length;a<b;a++)this[a].style.display=c.data(this[a],"olddisplay")||"";return this}},hide:function(a,b){if(a||a===0)return this.animate(K("hide",3),a,b);else{a=0;for(b=this.length;a<b;a++){var d=c.data(this[a],"olddisplay");!d&&d!=="none"&&c.data(this[a],
134 "olddisplay",c.css(this[a],"display"))}a=0;for(b=this.length;a<b;a++)this[a].style.display="none";return this}},_toggle:c.fn.toggle,toggle:function(a,b){var d=typeof a==="boolean";if(c.isFunction(a)&&c.isFunction(b))this._toggle.apply(this,arguments);else a==null||d?this.each(function(){var f=d?a:c(this).is(":hidden");c(this)[f?"show":"hide"]()}):this.animate(K("toggle",3),a,b);return this},fadeTo:function(a,b,d){return this.filter(":hidden").css("opacity",0).show().end().animate({opacity:b},a,d)},
135 animate:function(a,b,d,f){var e=c.speed(b,d,f);if(c.isEmptyObject(a))return this.each(e.complete);return this[e.queue===false?"each":"queue"](function(){var j=c.extend({},e),i,o=this.nodeType===1&&c(this).is(":hidden"),k=this;for(i in a){var n=i.replace(ia,ja);if(i!==n){a[n]=a[i];delete a[i];i=n}if(a[i]==="hide"&&o||a[i]==="show"&&!o)return j.complete.call(this);if((i==="height"||i==="width")&&this.style){j.display=c.css(this,"display");j.overflow=this.style.overflow}if(c.isArray(a[i])){(j.specialEasing=
136 j.specialEasing||{})[i]=a[i][1];a[i]=a[i][0]}}if(j.overflow!=null)this.style.overflow="hidden";j.curAnim=c.extend({},a);c.each(a,function(r,u){var z=new c.fx(k,j,r);if(Ab.test(u))z[u==="toggle"?o?"show":"hide":u](a);else{var C=Bb.exec(u),B=z.cur(true)||0;if(C){u=parseFloat(C[2]);var E=C[3]||"px";if(E!=="px"){k.style[r]=(u||1)+E;B=(u||1)/z.cur(true)*B;k.style[r]=B+E}if(C[1])u=(C[1]==="-="?-1:1)*u+B;z.custom(B,u,E)}else z.custom(B,u,"")}});return true})},stop:function(a,b){var d=c.timers;a&&this.queue([]);
137 this.each(function(){for(var f=d.length-1;f>=0;f--)if(d[f].elem===this){b&&d[f](true);d.splice(f,1)}});b||this.dequeue();return this}});c.each({slideDown:K("show",1),slideUp:K("hide",1),slideToggle:K("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(a,b){c.fn[a]=function(d,f){return this.animate(b,d,f)}});c.extend({speed:function(a,b,d){var f=a&&typeof a==="object"?a:{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};f.duration=c.fx.off?0:typeof f.duration===
138 "number"?f.duration:c.fx.speeds[f.duration]||c.fx.speeds._default;f.old=f.complete;f.complete=function(){f.queue!==false&&c(this).dequeue();c.isFunction(f.old)&&f.old.call(this)};return f},easing:{linear:function(a,b,d,f){return d+f*a},swing:function(a,b,d,f){return(-Math.cos(a*Math.PI)/2+0.5)*f+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||
139 c.fx.step._default)(this);if((this.prop==="height"||this.prop==="width")&&this.elem.style)this.elem.style.display="block"},cur:function(a){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];return(a=parseFloat(c.css(this.elem,this.prop,a)))&&a>-10000?a:parseFloat(c.curCSS(this.elem,this.prop))||0},custom:function(a,b,d){function f(j){return e.step(j)}this.startTime=J();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;
140 this.pos=this.state=0;var e=this;f.elem=this.elem;if(f()&&c.timers.push(f)&&!W)W=setInterval(c.fx.tick,13)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(a){var b=J(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=
141 this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var f in this.options.curAnim)if(this.options.curAnim[f]!==true)d=false;if(d){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;a=c.data(this.elem,"olddisplay");this.elem.style.display=a?a:this.options.display;if(c.css(this.elem,"display")==="none")this.elem.style.display="block"}this.options.hide&&c(this.elem).hide();if(this.options.hide||this.options.show)for(var e in this.options.curAnim)c.style(this.elem,
142 e,this.options.orig[e]);this.options.complete.call(this.elem)}return false}else{e=b-this.startTime;this.state=e/this.options.duration;a=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||a](this.state,e,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a=c.timers,b=0;b<a.length;b++)a[b]()||a.splice(b--,1);a.length||
143 c.fx.stop()},stop:function(){clearInterval(W);W=null},speeds:{slow:600,fast:200,_default:400},step:{opacity:function(a){c.style(a.elem,"opacity",a.now)},_default:function(a){if(a.elem.style&&a.elem.style[a.prop]!=null)a.elem.style[a.prop]=(a.prop==="width"||a.prop==="height"?Math.max(0,a.now):a.now)+a.unit;else a.elem[a.prop]=a.now}}});if(c.expr&&c.expr.filters)c.expr.filters.animated=function(a){return c.grep(c.timers,function(b){return a===b.elem}).length};c.fn.offset="getBoundingClientRect"in s.documentElement?
144 function(a){var b=this[0];if(a)return this.each(function(e){c.offset.setOffset(this,a,e)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);var d=b.getBoundingClientRect(),f=b.ownerDocument;b=f.body;f=f.documentElement;return{top:d.top+(self.pageYOffset||c.support.boxModel&&f.scrollTop||b.scrollTop)-(f.clientTop||b.clientTop||0),left:d.left+(self.pageXOffset||c.support.boxModel&&f.scrollLeft||b.scrollLeft)-(f.clientLeft||b.clientLeft||0)}}:function(a){var b=
145 this[0];if(a)return this.each(function(r){c.offset.setOffset(this,a,r)});if(!b||!b.ownerDocument)return null;if(b===b.ownerDocument.body)return c.offset.bodyOffset(b);c.offset.initialize();var d=b.offsetParent,f=b,e=b.ownerDocument,j,i=e.documentElement,o=e.body;f=(e=e.defaultView)?e.getComputedStyle(b,null):b.currentStyle;for(var k=b.offsetTop,n=b.offsetLeft;(b=b.parentNode)&&b!==o&&b!==i;){if(c.offset.supportsFixedPosition&&f.position==="fixed")break;j=e?e.getComputedStyle(b,null):b.currentStyle;
146 k-=b.scrollTop;n-=b.scrollLeft;if(b===d){k+=b.offsetTop;n+=b.offsetLeft;if(c.offset.doesNotAddBorder&&!(c.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(b.nodeName))){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=d;d=b.offsetParent}if(c.offset.subtractsBorderForOverflowNotVisible&&j.overflow!=="visible"){k+=parseFloat(j.borderTopWidth)||0;n+=parseFloat(j.borderLeftWidth)||0}f=j}if(f.position==="relative"||f.position==="static"){k+=o.offsetTop;n+=o.offsetLeft}if(c.offset.supportsFixedPosition&&
147 f.position==="fixed"){k+=Math.max(i.scrollTop,o.scrollTop);n+=Math.max(i.scrollLeft,o.scrollLeft)}return{top:k,left:n}};c.offset={initialize:function(){var a=s.body,b=s.createElement("div"),d,f,e,j=parseFloat(c.curCSS(a,"marginTop",true))||0;c.extend(b.style,{position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"});b.innerHTML="<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
148 a.insertBefore(b,a.firstChild);d=b.firstChild;f=d.firstChild;e=d.nextSibling.firstChild.firstChild;this.doesNotAddBorder=f.offsetTop!==5;this.doesAddBorderForTableAndCells=e.offsetTop===5;f.style.position="fixed";f.style.top="20px";this.supportsFixedPosition=f.offsetTop===20||f.offsetTop===15;f.style.position=f.style.top="";d.style.overflow="hidden";d.style.position="relative";this.subtractsBorderForOverflowNotVisible=f.offsetTop===-5;this.doesNotIncludeMarginInBodyOffset=a.offsetTop!==j;a.removeChild(b);
149 c.offset.initialize=c.noop},bodyOffset:function(a){var b=a.offsetTop,d=a.offsetLeft;c.offset.initialize();if(c.offset.doesNotIncludeMarginInBodyOffset){b+=parseFloat(c.curCSS(a,"marginTop",true))||0;d+=parseFloat(c.curCSS(a,"marginLeft",true))||0}return{top:b,left:d}},setOffset:function(a,b,d){if(/static/.test(c.curCSS(a,"position")))a.style.position="relative";var f=c(a),e=f.offset(),j=parseInt(c.curCSS(a,"top",true),10)||0,i=parseInt(c.curCSS(a,"left",true),10)||0;if(c.isFunction(b))b=b.call(a,
150 d,e);d={top:b.top-e.top+j,left:b.left-e.left+i};"using"in b?b.using.call(a,d):f.css(d)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),f=/^body|html$/i.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.curCSS(a,"marginTop",true))||0;d.left-=parseFloat(c.curCSS(a,"marginLeft",true))||0;f.top+=parseFloat(c.curCSS(b[0],"borderTopWidth",true))||0;f.left+=parseFloat(c.curCSS(b[0],"borderLeftWidth",true))||0;return{top:d.top-
151 f.top,left:d.left-f.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||s.body;a&&!/^body|html$/i.test(a.nodeName)&&c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(f){var e=this[0],j;if(!e)return null;if(f!==w)return this.each(function(){if(j=wa(this))j.scrollTo(!a?f:c(j).scrollLeft(),a?f:c(j).scrollTop());else this[d]=f});else return(j=wa(e))?"pageXOffset"in j?j[a?"pageYOffset":
152 "pageXOffset"]:c.support.boxModel&&j.document.documentElement[d]||j.document.body[d]:e[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase();c.fn["inner"+b]=function(){return this[0]?c.css(this[0],d,false,"padding"):null};c.fn["outer"+b]=function(f){return this[0]?c.css(this[0],d,false,f?"margin":"border"):null};c.fn[d]=function(f){var e=this[0];if(!e)return f==null?null:this;if(c.isFunction(f))return this.each(function(j){var i=c(this);i[d](f.call(this,j,i[d]()))});return"scrollTo"in
153 e&&e.document?e.document.compatMode==="CSS1Compat"&&e.document.documentElement["client"+b]||e.document.body["client"+b]:e.nodeType===9?Math.max(e.documentElement["client"+b],e.body["scroll"+b],e.documentElement["scroll"+b],e.body["offset"+b],e.documentElement["offset"+b]):f===w?c.css(e,d):this.css(d,typeof f==="string"?f:f+"px")}});A.jQuery=A.$=c})(window);
0 .highlight .hll { background-color: #ffffcc }
1 .highlight { background: #eeffcc; }
2 .highlight .c { color: #408090; font-style: italic } /* Comment */
3 .highlight .err { border: 1px solid #FF0000 } /* Error */
4 .highlight .k { color: #007020; font-weight: bold } /* Keyword */
5 .highlight .o { color: #666666 } /* Operator */
6 .highlight .cm { color: #408090; font-style: italic } /* Comment.Multiline */
7 .highlight .cp { color: #007020 } /* Comment.Preproc */
8 .highlight .c1 { color: #408090; font-style: italic } /* Comment.Single */
9 .highlight .cs { color: #408090; background-color: #fff0f0 } /* Comment.Special */
10 .highlight .gd { color: #A00000 } /* Generic.Deleted */
11 .highlight .ge { font-style: italic } /* Generic.Emph */
12 .highlight .gr { color: #FF0000 } /* Generic.Error */
13 .highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
14 .highlight .gi { color: #00A000 } /* Generic.Inserted */
15 .highlight .go { color: #333333 } /* Generic.Output */
16 .highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
17 .highlight .gs { font-weight: bold } /* Generic.Strong */
18 .highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
19 .highlight .gt { color: #0044DD } /* Generic.Traceback */
20 .highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
21 .highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
22 .highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
23 .highlight .kp { color: #007020 } /* Keyword.Pseudo */
24 .highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
25 .highlight .kt { color: #902000 } /* Keyword.Type */
26 .highlight .m { color: #208050 } /* Literal.Number */
27 .highlight .s { color: #4070a0 } /* Literal.String */
28 .highlight .na { color: #4070a0 } /* Name.Attribute */
29 .highlight .nb { color: #007020 } /* Name.Builtin */
30 .highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
31 .highlight .no { color: #60add5 } /* Name.Constant */
32 .highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
33 .highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
34 .highlight .ne { color: #007020 } /* Name.Exception */
35 .highlight .nf { color: #06287e } /* Name.Function */
36 .highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
37 .highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
38 .highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
39 .highlight .nv { color: #bb60d5 } /* Name.Variable */
40 .highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
41 .highlight .w { color: #bbbbbb } /* Text.Whitespace */
42 .highlight .mf { color: #208050 } /* Literal.Number.Float */
43 .highlight .mh { color: #208050 } /* Literal.Number.Hex */
44 .highlight .mi { color: #208050 } /* Literal.Number.Integer */
45 .highlight .mo { color: #208050 } /* Literal.Number.Oct */
46 .highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
47 .highlight .sc { color: #4070a0 } /* Literal.String.Char */
48 .highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
49 .highlight .s2 { color: #4070a0 } /* Literal.String.Double */
50 .highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
51 .highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
52 .highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
53 .highlight .sx { color: #c65d09 } /* Literal.String.Other */
54 .highlight .sr { color: #235388 } /* Literal.String.Regex */
55 .highlight .s1 { color: #4070a0 } /* Literal.String.Single */
56 .highlight .ss { color: #517918 } /* Literal.String.Symbol */
57 .highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
58 .highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
59 .highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
60 .highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
61 .highlight .il { color: #208050 } /* Literal.Number.Integer.Long */
0 /*
1 * searchtools.js_t
2 * ~~~~~~~~~~~~~~~~
3 *
4 * Sphinx JavaScript utilties for the full-text search.
5 *
6 * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11 /**
12 * helper function to return a node containing the
13 * search summary for a given text. keywords is a list
14 * of stemmed words, hlwords is the list of normal, unstemmed
15 * words. the first one is used to find the occurance, the
16 * latter for highlighting it.
17 */
18
19 jQuery.makeSearchSummary = function(text, keywords, hlwords) {
20 var textLower = text.toLowerCase();
21 var start = 0;
22 $.each(keywords, function() {
23 var i = textLower.indexOf(this.toLowerCase());
24 if (i > -1)
25 start = i;
26 });
27 start = Math.max(start - 120, 0);
28 var excerpt = ((start > 0) ? '...' : '') +
29 $.trim(text.substr(start, 240)) +
30 ((start + 240 - text.length) ? '...' : '');
31 var rv = $('<div class="context"></div>').text(excerpt);
32 $.each(hlwords, function() {
33 rv = rv.highlightText(this, 'highlighted');
34 });
35 return rv;
36 }
37
38
39 /**
40 * Porter Stemmer
41 */
42 var Stemmer = function() {
43
44 var step2list = {
45 ational: 'ate',
46 tional: 'tion',
47 enci: 'ence',
48 anci: 'ance',
49 izer: 'ize',
50 bli: 'ble',
51 alli: 'al',
52 entli: 'ent',
53 eli: 'e',
54 ousli: 'ous',
55 ization: 'ize',
56 ation: 'ate',
57 ator: 'ate',
58 alism: 'al',
59 iveness: 'ive',
60 fulness: 'ful',
61 ousness: 'ous',
62 aliti: 'al',
63 iviti: 'ive',
64 biliti: 'ble',
65 logi: 'log'
66 };
67
68 var step3list = {
69 icate: 'ic',
70 ative: '',
71 alize: 'al',
72 iciti: 'ic',
73 ical: 'ic',
74 ful: '',
75 ness: ''
76 };
77
78 var c = "[^aeiou]"; // consonant
79 var v = "[aeiouy]"; // vowel
80 var C = c + "[^aeiouy]*"; // consonant sequence
81 var V = v + "[aeiou]*"; // vowel sequence
82
83 var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
84 var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
85 var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
86 var s_v = "^(" + C + ")?" + v; // vowel in stem
87
88 this.stemWord = function (w) {
89 var stem;
90 var suffix;
91 var firstch;
92 var origword = w;
93
94 if (w.length < 3)
95 return w;
96
97 var re;
98 var re2;
99 var re3;
100 var re4;
101
102 firstch = w.substr(0,1);
103 if (firstch == "y")
104 w = firstch.toUpperCase() + w.substr(1);
105
106 // Step 1a
107 re = /^(.+?)(ss|i)es$/;
108 re2 = /^(.+?)([^s])s$/;
109
110 if (re.test(w))
111 w = w.replace(re,"$1$2");
112 else if (re2.test(w))
113 w = w.replace(re2,"$1$2");
114
115 // Step 1b
116 re = /^(.+?)eed$/;
117 re2 = /^(.+?)(ed|ing)$/;
118 if (re.test(w)) {
119 var fp = re.exec(w);
120 re = new RegExp(mgr0);
121 if (re.test(fp[1])) {
122 re = /.$/;
123 w = w.replace(re,"");
124 }
125 }
126 else if (re2.test(w)) {
127 var fp = re2.exec(w);
128 stem = fp[1];
129 re2 = new RegExp(s_v);
130 if (re2.test(stem)) {
131 w = stem;
132 re2 = /(at|bl|iz)$/;
133 re3 = new RegExp("([^aeiouylsz])\\1$");
134 re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
135 if (re2.test(w))
136 w = w + "e";
137 else if (re3.test(w)) {
138 re = /.$/;
139 w = w.replace(re,"");
140 }
141 else if (re4.test(w))
142 w = w + "e";
143 }
144 }
145
146 // Step 1c
147 re = /^(.+?)y$/;
148 if (re.test(w)) {
149 var fp = re.exec(w);
150 stem = fp[1];
151 re = new RegExp(s_v);
152 if (re.test(stem))
153 w = stem + "i";
154 }
155
156 // Step 2
157 re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
158 if (re.test(w)) {
159 var fp = re.exec(w);
160 stem = fp[1];
161 suffix = fp[2];
162 re = new RegExp(mgr0);
163 if (re.test(stem))
164 w = stem + step2list[suffix];
165 }
166
167 // Step 3
168 re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
169 if (re.test(w)) {
170 var fp = re.exec(w);
171 stem = fp[1];
172 suffix = fp[2];
173 re = new RegExp(mgr0);
174 if (re.test(stem))
175 w = stem + step3list[suffix];
176 }
177
178 // Step 4
179 re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
180 re2 = /^(.+?)(s|t)(ion)$/;
181 if (re.test(w)) {
182 var fp = re.exec(w);
183 stem = fp[1];
184 re = new RegExp(mgr1);
185 if (re.test(stem))
186 w = stem;
187 }
188 else if (re2.test(w)) {
189 var fp = re2.exec(w);
190 stem = fp[1] + fp[2];
191 re2 = new RegExp(mgr1);
192 if (re2.test(stem))
193 w = stem;
194 }
195
196 // Step 5
197 re = /^(.+?)e$/;
198 if (re.test(w)) {
199 var fp = re.exec(w);
200 stem = fp[1];
201 re = new RegExp(mgr1);
202 re2 = new RegExp(meq1);
203 re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
204 if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
205 w = stem;
206 }
207 re = /ll$/;
208 re2 = new RegExp(mgr1);
209 if (re.test(w) && re2.test(w)) {
210 re = /.$/;
211 w = w.replace(re,"");
212 }
213
214 // and turn initial Y back to y
215 if (firstch == "y")
216 w = firstch.toLowerCase() + w.substr(1);
217 return w;
218 }
219 }
220
221
222 /**
223 * Search Module
224 */
225 var Search = {
226
227 _index : null,
228 _queued_query : null,
229 _pulse_status : -1,
230
231 init : function() {
232 var params = $.getQueryParameters();
233 if (params.q) {
234 var query = params.q[0];
235 $('input[name="q"]')[0].value = query;
236 this.performSearch(query);
237 }
238 },
239
240 loadIndex : function(url) {
241 $.ajax({type: "GET", url: url, data: null, success: null,
242 dataType: "script", cache: true});
243 },
244
245 setIndex : function(index) {
246 var q;
247 this._index = index;
248 if ((q = this._queued_query) !== null) {
249 this._queued_query = null;
250 Search.query(q);
251 }
252 },
253
254 hasIndex : function() {
255 return this._index !== null;
256 },
257
258 deferQuery : function(query) {
259 this._queued_query = query;
260 },
261
262 stopPulse : function() {
263 this._pulse_status = 0;
264 },
265
266 startPulse : function() {
267 if (this._pulse_status >= 0)
268 return;
269 function pulse() {
270 Search._pulse_status = (Search._pulse_status + 1) % 4;
271 var dotString = '';
272 for (var i = 0; i < Search._pulse_status; i++)
273 dotString += '.';
274 Search.dots.text(dotString);
275 if (Search._pulse_status > -1)
276 window.setTimeout(pulse, 500);
277 };
278 pulse();
279 },
280
281 /**
282 * perform a search for something
283 */
284 performSearch : function(query) {
285 // create the required interface elements
286 this.out = $('#search-results');
287 this.title = $('<h2>' + _('Searching') + '</h2>').appendTo(this.out);
288 this.dots = $('<span></span>').appendTo(this.title);
289 this.status = $('<p style="display: none"></p>').appendTo(this.out);
290 this.output = $('<ul class="search"/>').appendTo(this.out);
291
292 $('#search-progress').text(_('Preparing search...'));
293 this.startPulse();
294
295 // index already loaded, the browser was quick!
296 if (this.hasIndex())
297 this.query(query);
298 else
299 this.deferQuery(query);
300 },
301
302 query : function(query) {
303 var stopwords = ["and","then","into","it","as","are","in","if","for","no","there","their","was","is","be","to","that","but","they","not","such","with","by","a","on","these","of","will","this","near","the","or","at"];
304
305 // Stem the searchterms and add them to the correct list
306 var stemmer = new Stemmer();
307 var searchterms = [];
308 var excluded = [];
309 var hlterms = [];
310 var tmp = query.split(/\s+/);
311 var objectterms = [];
312 for (var i = 0; i < tmp.length; i++) {
313 if (tmp[i] != "") {
314 objectterms.push(tmp[i].toLowerCase());
315 }
316
317 if ($u.indexOf(stopwords, tmp[i]) != -1 || tmp[i].match(/^\d+$/) ||
318 tmp[i] == "") {
319 // skip this "word"
320 continue;
321 }
322 // stem the word
323 var word = stemmer.stemWord(tmp[i]).toLowerCase();
324 // select the correct list
325 if (word[0] == '-') {
326 var toAppend = excluded;
327 word = word.substr(1);
328 }
329 else {
330 var toAppend = searchterms;
331 hlterms.push(tmp[i].toLowerCase());
332 }
333 // only add if not already in the list
334 if (!$.contains(toAppend, word))
335 toAppend.push(word);
336 };
337 var highlightstring = '?highlight=' + $.urlencode(hlterms.join(" "));
338
339 // console.debug('SEARCH: searching for:');
340 // console.info('required: ', searchterms);
341 // console.info('excluded: ', excluded);
342
343 // prepare search
344 var filenames = this._index.filenames;
345 var titles = this._index.titles;
346 var terms = this._index.terms;
347 var fileMap = {};
348 var files = null;
349 // different result priorities
350 var importantResults = [];
351 var objectResults = [];
352 var regularResults = [];
353 var unimportantResults = [];
354 $('#search-progress').empty();
355
356 // lookup as object
357 for (var i = 0; i < objectterms.length; i++) {
358 var others = [].concat(objectterms.slice(0,i),
359 objectterms.slice(i+1, objectterms.length))
360 var results = this.performObjectSearch(objectterms[i], others);
361 // Assume first word is most likely to be the object,
362 // other words more likely to be in description.
363 // Therefore put matches for earlier words first.
364 // (Results are eventually used in reverse order).
365 objectResults = results[0].concat(objectResults);
366 importantResults = results[1].concat(importantResults);
367 unimportantResults = results[2].concat(unimportantResults);
368 }
369
370 // perform the search on the required terms
371 for (var i = 0; i < searchterms.length; i++) {
372 var word = searchterms[i];
373 // no match but word was a required one
374 if ((files = terms[word]) == null)
375 break;
376 if (files.length == undefined) {
377 files = [files];
378 }
379 // create the mapping
380 for (var j = 0; j < files.length; j++) {
381 var file = files[j];
382 if (file in fileMap)
383 fileMap[file].push(word);
384 else
385 fileMap[file] = [word];
386 }
387 }
388
389 // now check if the files don't contain excluded terms
390 for (var file in fileMap) {
391 var valid = true;
392
393 // check if all requirements are matched
394 if (fileMap[file].length != searchterms.length)
395 continue;
396
397 // ensure that none of the excluded terms is in the
398 // search result.
399 for (var i = 0; i < excluded.length; i++) {
400 if (terms[excluded[i]] == file ||
401 $.contains(terms[excluded[i]] || [], file)) {
402 valid = false;
403 break;
404 }
405 }
406
407 // if we have still a valid result we can add it
408 // to the result list
409 if (valid)
410 regularResults.push([filenames[file], titles[file], '', null]);
411 }
412
413 // delete unused variables in order to not waste
414 // memory until list is retrieved completely
415 delete filenames, titles, terms;
416
417 // now sort the regular results descending by title
418 regularResults.sort(function(a, b) {
419 var left = a[1].toLowerCase();
420 var right = b[1].toLowerCase();
421 return (left > right) ? -1 : ((left < right) ? 1 : 0);
422 });
423
424 // combine all results
425 var results = unimportantResults.concat(regularResults)
426 .concat(objectResults).concat(importantResults);
427
428 // print the results
429 var resultCount = results.length;
430 function displayNextItem() {
431 // results left, load the summary and display it
432 if (results.length) {
433 var item = results.pop();
434 var listItem = $('<li style="display:none"></li>');
435 if (DOCUMENTATION_OPTIONS.FILE_SUFFIX == '') {
436 // dirhtml builder
437 var dirname = item[0] + '/';
438 if (dirname.match(/\/index\/$/)) {
439 dirname = dirname.substring(0, dirname.length-6);
440 } else if (dirname == 'index/') {
441 dirname = '';
442 }
443 listItem.append($('<a/>').attr('href',
444 DOCUMENTATION_OPTIONS.URL_ROOT + dirname +
445 highlightstring + item[2]).html(item[1]));
446 } else {
447 // normal html builders
448 listItem.append($('<a/>').attr('href',
449 item[0] + DOCUMENTATION_OPTIONS.FILE_SUFFIX +
450 highlightstring + item[2]).html(item[1]));
451 }
452 if (item[3]) {
453 listItem.append($('<span> (' + item[3] + ')</span>'));
454 Search.output.append(listItem);
455 listItem.slideDown(5, function() {
456 displayNextItem();
457 });
458 } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
459 $.get(DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' +
460 item[0] + '.txt', function(data) {
461 if (data != '') {
462 listItem.append($.makeSearchSummary(data, searchterms, hlterms));
463 Search.output.append(listItem);
464 }
465 listItem.slideDown(5, function() {
466 displayNextItem();
467 });
468 }, "text");
469 } else {
470 // no source available, just display title
471 Search.output.append(listItem);
472 listItem.slideDown(5, function() {
473 displayNextItem();
474 });
475 }
476 }
477 // search finished, update title and status message
478 else {
479 Search.stopPulse();
480 Search.title.text(_('Search Results'));
481 if (!resultCount)
482 Search.status.text(_('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.'));
483 else
484 Search.status.text(_('Search finished, found %s page(s) matching the search query.').replace('%s', resultCount));
485 Search.status.fadeIn(500);
486 }
487 }
488 displayNextItem();
489 },
490
491 performObjectSearch : function(object, otherterms) {
492 var filenames = this._index.filenames;
493 var objects = this._index.objects;
494 var objnames = this._index.objnames;
495 var titles = this._index.titles;
496
497 var importantResults = [];
498 var objectResults = [];
499 var unimportantResults = [];
500
501 for (var prefix in objects) {
502 for (var name in objects[prefix]) {
503 var fullname = (prefix ? prefix + '.' : '') + name;
504 if (fullname.toLowerCase().indexOf(object) > -1) {
505 var match = objects[prefix][name];
506 var objname = objnames[match[1]][2];
507 var title = titles[match[0]];
508 // If more than one term searched for, we require other words to be
509 // found in the name/title/description
510 if (otherterms.length > 0) {
511 var haystack = (prefix + ' ' + name + ' ' +
512 objname + ' ' + title).toLowerCase();
513 var allfound = true;
514 for (var i = 0; i < otherterms.length; i++) {
515 if (haystack.indexOf(otherterms[i]) == -1) {
516 allfound = false;
517 break;
518 }
519 }
520 if (!allfound) {
521 continue;
522 }
523 }
524 var descr = objname + _(', in ') + title;
525 anchor = match[3];
526 if (anchor == '')
527 anchor = fullname;
528 else if (anchor == '-')
529 anchor = objnames[match[1]][1] + '-' + fullname;
530 result = [filenames[match[0]], fullname, '#'+anchor, descr];
531 switch (match[2]) {
532 case 1: objectResults.push(result); break;
533 case 0: importantResults.push(result); break;
534 case 2: unimportantResults.push(result); break;
535 }
536 }
537 }
538 }
539
540 // sort results descending
541 objectResults.sort(function(a, b) {
542 return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
543 });
544
545 importantResults.sort(function(a, b) {
546 return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
547 });
548
549 unimportantResults.sort(function(a, b) {
550 return (a[1] > b[1]) ? -1 : ((a[1] < b[1]) ? 1 : 0);
551 });
552
553 return [importantResults, objectResults, unimportantResults]
554 }
555 }
556
557 $(document).ready(function() {
558 Search.init();
559 });
0 /*
1 * sidebar.js
2 * ~~~~~~~~~~
3 *
4 * This script makes the Sphinx sidebar collapsible.
5 *
6 * .sphinxsidebar contains .sphinxsidebarwrapper. This script adds
7 * in .sphixsidebar, after .sphinxsidebarwrapper, the #sidebarbutton
8 * used to collapse and expand the sidebar.
9 *
10 * When the sidebar is collapsed the .sphinxsidebarwrapper is hidden
11 * and the width of the sidebar and the margin-left of the document
12 * are decreased. When the sidebar is expanded the opposite happens.
13 * This script saves a per-browser/per-session cookie used to
14 * remember the position of the sidebar among the pages.
15 * Once the browser is closed the cookie is deleted and the position
16 * reset to the default (expanded).
17 *
18 * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
19 * :license: BSD, see LICENSE for details.
20 *
21 */
22
23 $(function() {
24 // global elements used by the functions.
25 // the 'sidebarbutton' element is defined as global after its
26 // creation, in the add_sidebar_button function
27 var bodywrapper = $('.bodywrapper');
28 var sidebar = $('.sphinxsidebar');
29 var sidebarwrapper = $('.sphinxsidebarwrapper');
30
31 // for some reason, the document has no sidebar; do not run into errors
32 if (!sidebar.length) return;
33
34 // original margin-left of the bodywrapper and width of the sidebar
35 // with the sidebar expanded
36 var bw_margin_expanded = bodywrapper.css('margin-left');
37 var ssb_width_expanded = sidebar.width();
38
39 // margin-left of the bodywrapper and width of the sidebar
40 // with the sidebar collapsed
41 var bw_margin_collapsed = '.8em';
42 var ssb_width_collapsed = '.8em';
43
44 // colors used by the current theme
45 var dark_color = $('.related').css('background-color');
46 var light_color = $('.document').css('background-color');
47
48 function sidebar_is_collapsed() {
49 return sidebarwrapper.is(':not(:visible)');
50 }
51
52 function toggle_sidebar() {
53 if (sidebar_is_collapsed())
54 expand_sidebar();
55 else
56 collapse_sidebar();
57 }
58
59 function collapse_sidebar() {
60 sidebarwrapper.hide();
61 sidebar.css('width', ssb_width_collapsed);
62 bodywrapper.css('margin-left', bw_margin_collapsed);
63 sidebarbutton.css({
64 'margin-left': '0',
65 'height': bodywrapper.height()
66 });
67 sidebarbutton.find('span').text('»');
68 sidebarbutton.attr('title', _('Expand sidebar'));
69 document.cookie = 'sidebar=collapsed';
70 }
71
72 function expand_sidebar() {
73 bodywrapper.css('margin-left', bw_margin_expanded);
74 sidebar.css('width', ssb_width_expanded);
75 sidebarwrapper.show();
76 sidebarbutton.css({
77 'margin-left': ssb_width_expanded-12,
78 'height': bodywrapper.height()
79 });
80 sidebarbutton.find('span').text('«');
81 sidebarbutton.attr('title', _('Collapse sidebar'));
82 document.cookie = 'sidebar=expanded';
83 }
84
85 function add_sidebar_button() {
86 sidebarwrapper.css({
87 'float': 'left',
88 'margin-right': '0',
89 'width': ssb_width_expanded - 28
90 });
91 // create the button
92 sidebar.append(
93 '<div id="sidebarbutton"><span>&laquo;</span></div>'
94 );
95 var sidebarbutton = $('#sidebarbutton');
96 light_color = sidebarbutton.css('background-color');
97 // find the height of the viewport to center the '<<' in the page
98 var viewport_height;
99 if (window.innerHeight)
100 viewport_height = window.innerHeight;
101 else
102 viewport_height = $(window).height();
103 sidebarbutton.find('span').css({
104 'display': 'block',
105 'margin-top': (viewport_height - sidebar.position().top - 20) / 2
106 });
107
108 sidebarbutton.click(toggle_sidebar);
109 sidebarbutton.attr('title', _('Collapse sidebar'));
110 sidebarbutton.css({
111 'color': '#FFFFFF',
112 'border-left': '1px solid ' + dark_color,
113 'font-size': '1.2em',
114 'cursor': 'pointer',
115 'height': bodywrapper.height(),
116 'padding-top': '1px',
117 'margin-left': ssb_width_expanded - 12
118 });
119
120 sidebarbutton.hover(
121 function () {
122 $(this).css('background-color', dark_color);
123 },
124 function () {
125 $(this).css('background-color', light_color);
126 }
127 );
128 }
129
130 function set_position_from_cookie() {
131 if (!document.cookie)
132 return;
133 var items = document.cookie.split(';');
134 for(var k=0; k<items.length; k++) {
135 var key_val = items[k].split('=');
136 var key = key_val[0];
137 if (key == 'sidebar') {
138 var value = key_val[1];
139 if ((value == 'collapsed') && (!sidebar_is_collapsed()))
140 collapse_sidebar();
141 else if ((value == 'expanded') && (sidebar_is_collapsed()))
142 expand_sidebar();
143 }
144 }
145 }
146
147 add_sidebar_button();
148 var sidebarbutton = $('#sidebarbutton');
149 set_position_from_cookie();
150 });
0 // Underscore.js 0.5.5
1 // (c) 2009 Jeremy Ashkenas, DocumentCloud Inc.
2 // Underscore is freely distributable under the terms of the MIT license.
3 // Portions of Underscore are inspired by or borrowed from Prototype.js,
4 // Oliver Steele's Functional, and John Resig's Micro-Templating.
5 // For all details and documentation:
6 // http://documentcloud.github.com/underscore/
7 (function(){var j=this,n=j._,i=function(a){this._wrapped=a},m=typeof StopIteration!=="undefined"?StopIteration:"__break__",b=j._=function(a){return new i(a)};if(typeof exports!=="undefined")exports._=b;var k=Array.prototype.slice,o=Array.prototype.unshift,p=Object.prototype.toString,q=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;b.VERSION="0.5.5";b.each=function(a,c,d){try{if(a.forEach)a.forEach(c,d);else if(b.isArray(a)||b.isArguments(a))for(var e=0,f=a.length;e<f;e++)c.call(d,
8 a[e],e,a);else{var g=b.keys(a);f=g.length;for(e=0;e<f;e++)c.call(d,a[g[e]],g[e],a)}}catch(h){if(h!=m)throw h;}return a};b.map=function(a,c,d){if(a&&b.isFunction(a.map))return a.map(c,d);var e=[];b.each(a,function(f,g,h){e.push(c.call(d,f,g,h))});return e};b.reduce=function(a,c,d,e){if(a&&b.isFunction(a.reduce))return a.reduce(b.bind(d,e),c);b.each(a,function(f,g,h){c=d.call(e,c,f,g,h)});return c};b.reduceRight=function(a,c,d,e){if(a&&b.isFunction(a.reduceRight))return a.reduceRight(b.bind(d,e),c);
9 var f=b.clone(b.toArray(a)).reverse();b.each(f,function(g,h){c=d.call(e,c,g,h,a)});return c};b.detect=function(a,c,d){var e;b.each(a,function(f,g,h){if(c.call(d,f,g,h)){e=f;b.breakLoop()}});return e};b.select=function(a,c,d){if(a&&b.isFunction(a.filter))return a.filter(c,d);var e=[];b.each(a,function(f,g,h){c.call(d,f,g,h)&&e.push(f)});return e};b.reject=function(a,c,d){var e=[];b.each(a,function(f,g,h){!c.call(d,f,g,h)&&e.push(f)});return e};b.all=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.every))return a.every(c,
10 d);var e=true;b.each(a,function(f,g,h){(e=e&&c.call(d,f,g,h))||b.breakLoop()});return e};b.any=function(a,c,d){c=c||b.identity;if(a&&b.isFunction(a.some))return a.some(c,d);var e=false;b.each(a,function(f,g,h){if(e=c.call(d,f,g,h))b.breakLoop()});return e};b.include=function(a,c){if(b.isArray(a))return b.indexOf(a,c)!=-1;var d=false;b.each(a,function(e){if(d=e===c)b.breakLoop()});return d};b.invoke=function(a,c){var d=b.rest(arguments,2);return b.map(a,function(e){return(c?e[c]:e).apply(e,d)})};b.pluck=
11 function(a,c){return b.map(a,function(d){return d[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);var e={computed:-Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g>=e.computed&&(e={value:f,computed:g})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);var e={computed:Infinity};b.each(a,function(f,g,h){g=c?c.call(d,f,g,h):f;g<e.computed&&(e={value:f,computed:g})});return e.value};b.sortBy=function(a,c,d){return b.pluck(b.map(a,
12 function(e,f,g){return{value:e,criteria:c.call(d,e,f,g)}}).sort(function(e,f){e=e.criteria;f=f.criteria;return e<f?-1:e>f?1:0}),"value")};b.sortedIndex=function(a,c,d){d=d||b.identity;for(var e=0,f=a.length;e<f;){var g=e+f>>1;d(a[g])<d(c)?(e=g+1):(f=g)}return e};b.toArray=function(a){if(!a)return[];if(a.toArray)return a.toArray();if(b.isArray(a))return a;if(b.isArguments(a))return k.call(a);return b.values(a)};b.size=function(a){return b.toArray(a).length};b.first=function(a,c,d){return c&&!d?k.call(a,
13 0,c):a[0]};b.rest=function(a,c,d){return k.call(a,b.isUndefined(c)||d?1:c)};b.last=function(a){return a[a.length-1]};b.compact=function(a){return b.select(a,function(c){return!!c})};b.flatten=function(a){return b.reduce(a,[],function(c,d){if(b.isArray(d))return c.concat(b.flatten(d));c.push(d);return c})};b.without=function(a){var c=b.rest(arguments);return b.select(a,function(d){return!b.include(c,d)})};b.uniq=function(a,c){return b.reduce(a,[],function(d,e,f){if(0==f||(c===true?b.last(d)!=e:!b.include(d,
14 e)))d.push(e);return d})};b.intersect=function(a){var c=b.rest(arguments);return b.select(b.uniq(a),function(d){return b.all(c,function(e){return b.indexOf(e,d)>=0})})};b.zip=function(){for(var a=b.toArray(arguments),c=b.max(b.pluck(a,"length")),d=new Array(c),e=0;e<c;e++)d[e]=b.pluck(a,String(e));return d};b.indexOf=function(a,c){if(a.indexOf)return a.indexOf(c);for(var d=0,e=a.length;d<e;d++)if(a[d]===c)return d;return-1};b.lastIndexOf=function(a,c){if(a.lastIndexOf)return a.lastIndexOf(c);for(var d=
15 a.length;d--;)if(a[d]===c)return d;return-1};b.range=function(a,c,d){var e=b.toArray(arguments),f=e.length<=1;a=f?0:e[0];c=f?e[0]:e[1];d=e[2]||1;e=Math.ceil((c-a)/d);if(e<=0)return[];e=new Array(e);f=a;for(var g=0;1;f+=d){if((d>0?f-c:c-f)>=0)return e;e[g++]=f}};b.bind=function(a,c){var d=b.rest(arguments,2);return function(){return a.apply(c||j,d.concat(b.toArray(arguments)))}};b.bindAll=function(a){var c=b.rest(arguments);if(c.length==0)c=b.functions(a);b.each(c,function(d){a[d]=b.bind(a[d],a)});
16 return a};b.delay=function(a,c){var d=b.rest(arguments,2);return setTimeout(function(){return a.apply(a,d)},c)};b.defer=function(a){return b.delay.apply(b,[a,1].concat(b.rest(arguments)))};b.wrap=function(a,c){return function(){var d=[a].concat(b.toArray(arguments));return c.apply(c,d)}};b.compose=function(){var a=b.toArray(arguments);return function(){for(var c=b.toArray(arguments),d=a.length-1;d>=0;d--)c=[a[d].apply(this,c)];return c[0]}};b.keys=function(a){if(b.isArray(a))return b.range(0,a.length);
17 var c=[];for(var d in a)q.call(a,d)&&c.push(d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=function(a){return b.select(b.keys(a),function(c){return b.isFunction(a[c])}).sort()};b.extend=function(a,c){for(var d in c)a[d]=c[d];return a};b.clone=function(a){if(b.isArray(a))return a.slice(0);return b.extend({},a)};b.tap=function(a,c){c(a);return a};b.isEqual=function(a,c){if(a===c)return true;var d=typeof a;if(d!=typeof c)return false;if(a==c)return true;if(!a&&c||a&&!c)return false;
18 if(a.isEqual)return a.isEqual(c);if(b.isDate(a)&&b.isDate(c))return a.getTime()===c.getTime();if(b.isNaN(a)&&b.isNaN(c))return true;if(b.isRegExp(a)&&b.isRegExp(c))return a.source===c.source&&a.global===c.global&&a.ignoreCase===c.ignoreCase&&a.multiline===c.multiline;if(d!=="object")return false;if(a.length&&a.length!==c.length)return false;d=b.keys(a);var e=b.keys(c);if(d.length!=e.length)return false;for(var f in a)if(!b.isEqual(a[f],c[f]))return false;return true};b.isEmpty=function(a){return b.keys(a).length==
19 0};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=function(a){return!!(a&&a.concat&&a.unshift)};b.isArguments=function(a){return a&&b.isNumber(a.length)&&!b.isArray(a)&&!r.call(a,"length")};b.isFunction=function(a){return!!(a&&a.constructor&&a.call&&a.apply)};b.isString=function(a){return!!(a===""||a&&a.charCodeAt&&a.substr)};b.isNumber=function(a){return p.call(a)==="[object Number]"};b.isDate=function(a){return!!(a&&a.getTimezoneOffset&&a.setUTCFullYear)};b.isRegExp=function(a){return!!(a&&
20 a.test&&a.exec&&(a.ignoreCase||a.ignoreCase===false))};b.isNaN=function(a){return b.isNumber(a)&&isNaN(a)};b.isNull=function(a){return a===null};b.isUndefined=function(a){return typeof a=="undefined"};b.noConflict=function(){j._=n;return this};b.identity=function(a){return a};b.breakLoop=function(){throw m;};var s=0;b.uniqueId=function(a){var c=s++;return a?a+c:c};b.template=function(a,c){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g,
21 " ").replace(/'(?=[^%]*%>)/g,"\t").split("'").join("\\'").split("\t").join("'").replace(/<%=(.+?)%>/g,"',$1,'").split("<%").join("');").split("%>").join("p.push('")+"');}return p.join('');");return c?a(c):a};b.forEach=b.each;b.foldl=b.inject=b.reduce;b.foldr=b.reduceRight;b.filter=b.select;b.every=b.all;b.some=b.any;b.head=b.first;b.tail=b.rest;b.methods=b.functions;var l=function(a,c){return c?b(a).chain():a};b.each(b.functions(b),function(a){var c=b[a];i.prototype[a]=function(){var d=b.toArray(arguments);
22 o.call(d,this._wrapped);return l(c.apply(b,d),this._chain)}});b.each(["pop","push","reverse","shift","sort","splice","unshift"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){c.apply(this._wrapped,arguments);return l(this._wrapped,this._chain)}});b.each(["concat","join","slice"],function(a){var c=Array.prototype[a];i.prototype[a]=function(){return l(c.apply(this._wrapped,arguments),this._chain)}});i.prototype.chain=function(){this._chain=true;return this};i.prototype.value=function(){return this._wrapped}})();
0 /*
1 * websupport.js
2 * ~~~~~~~~~~~~~
3 *
4 * sphinx.websupport utilties for all documentation.
5 *
6 * :copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
7 * :license: BSD, see LICENSE for details.
8 *
9 */
10
11 (function($) {
12 $.fn.autogrow = function() {
13 return this.each(function() {
14 var textarea = this;
15
16 $.fn.autogrow.resize(textarea);
17
18 $(textarea)
19 .focus(function() {
20 textarea.interval = setInterval(function() {
21 $.fn.autogrow.resize(textarea);
22 }, 500);
23 })
24 .blur(function() {
25 clearInterval(textarea.interval);
26 });
27 });
28 };
29
30 $.fn.autogrow.resize = function(textarea) {
31 var lineHeight = parseInt($(textarea).css('line-height'), 10);
32 var lines = textarea.value.split('\n');
33 var columns = textarea.cols;
34 var lineCount = 0;
35 $.each(lines, function() {
36 lineCount += Math.ceil(this.length / columns) || 1;
37 });
38 var height = lineHeight * (lineCount + 1);
39 $(textarea).css('height', height);
40 };
41 })(jQuery);
42
43 (function($) {
44 var comp, by;
45
46 function init() {
47 initEvents();
48 initComparator();
49 }
50
51 function initEvents() {
52 $('a.comment-close').live("click", function(event) {
53 event.preventDefault();
54 hide($(this).attr('id').substring(2));
55 });
56 $('a.vote').live("click", function(event) {
57 event.preventDefault();
58 handleVote($(this));
59 });
60 $('a.reply').live("click", function(event) {
61 event.preventDefault();
62 openReply($(this).attr('id').substring(2));
63 });
64 $('a.close-reply').live("click", function(event) {
65 event.preventDefault();
66 closeReply($(this).attr('id').substring(2));
67 });
68 $('a.sort-option').live("click", function(event) {
69 event.preventDefault();
70 handleReSort($(this));
71 });
72 $('a.show-proposal').live("click", function(event) {
73 event.preventDefault();
74 showProposal($(this).attr('id').substring(2));
75 });
76 $('a.hide-proposal').live("click", function(event) {
77 event.preventDefault();
78 hideProposal($(this).attr('id').substring(2));
79 });
80 $('a.show-propose-change').live("click", function(event) {
81 event.preventDefault();
82 showProposeChange($(this).attr('id').substring(2));
83 });
84 $('a.hide-propose-change').live("click", function(event) {
85 event.preventDefault();
86 hideProposeChange($(this).attr('id').substring(2));
87 });
88 $('a.accept-comment').live("click", function(event) {
89 event.preventDefault();
90 acceptComment($(this).attr('id').substring(2));
91 });
92 $('a.delete-comment').live("click", function(event) {
93 event.preventDefault();
94 deleteComment($(this).attr('id').substring(2));
95 });
96 $('a.comment-markup').live("click", function(event) {
97 event.preventDefault();
98 toggleCommentMarkupBox($(this).attr('id').substring(2));
99 });
100 }
101
102 /**
103 * Set comp, which is a comparator function used for sorting and
104 * inserting comments into the list.
105 */
106 function setComparator() {
107 // If the first three letters are "asc", sort in ascending order
108 // and remove the prefix.
109 if (by.substring(0,3) == 'asc') {
110 var i = by.substring(3);
111 comp = function(a, b) { return a[i] - b[i]; };
112 } else {
113 // Otherwise sort in descending order.
114 comp = function(a, b) { return b[by] - a[by]; };
115 }
116
117 // Reset link styles and format the selected sort option.
118 $('a.sel').attr('href', '#').removeClass('sel');
119 $('a.by' + by).removeAttr('href').addClass('sel');
120 }
121
122 /**
123 * Create a comp function. If the user has preferences stored in
124 * the sortBy cookie, use those, otherwise use the default.
125 */
126 function initComparator() {
127 by = 'rating'; // Default to sort by rating.
128 // If the sortBy cookie is set, use that instead.
129 if (document.cookie.length > 0) {
130 var start = document.cookie.indexOf('sortBy=');
131 if (start != -1) {
132 start = start + 7;
133 var end = document.cookie.indexOf(";", start);
134 if (end == -1) {
135 end = document.cookie.length;
136 by = unescape(document.cookie.substring(start, end));
137 }
138 }
139 }
140 setComparator();
141 }
142
143 /**
144 * Show a comment div.
145 */
146 function show(id) {
147 $('#ao' + id).hide();
148 $('#ah' + id).show();
149 var context = $.extend({id: id}, opts);
150 var popup = $(renderTemplate(popupTemplate, context)).hide();
151 popup.find('textarea[name="proposal"]').hide();
152 popup.find('a.by' + by).addClass('sel');
153 var form = popup.find('#cf' + id);
154 form.submit(function(event) {
155 event.preventDefault();
156 addComment(form);
157 });
158 $('#s' + id).after(popup);
159 popup.slideDown('fast', function() {
160 getComments(id);
161 });
162 }
163
164 /**
165 * Hide a comment div.
166 */
167 function hide(id) {
168 $('#ah' + id).hide();
169 $('#ao' + id).show();
170 var div = $('#sc' + id);
171 div.slideUp('fast', function() {
172 div.remove();
173 });
174 }
175
176 /**
177 * Perform an ajax request to get comments for a node
178 * and insert the comments into the comments tree.
179 */
180 function getComments(id) {
181 $.ajax({
182 type: 'GET',
183 url: opts.getCommentsURL,
184 data: {node: id},
185 success: function(data, textStatus, request) {
186 var ul = $('#cl' + id);
187 var speed = 100;
188 $('#cf' + id)
189 .find('textarea[name="proposal"]')
190 .data('source', data.source);
191
192 if (data.comments.length === 0) {
193 ul.html('<li>No comments yet.</li>');
194 ul.data('empty', true);
195 } else {
196 // If there are comments, sort them and put them in the list.
197 var comments = sortComments(data.comments);
198 speed = data.comments.length * 100;
199 appendComments(comments, ul);
200 ul.data('empty', false);
201 }
202 $('#cn' + id).slideUp(speed + 200);
203 ul.slideDown(speed);
204 },
205 error: function(request, textStatus, error) {
206 showError('Oops, there was a problem retrieving the comments.');
207 },
208 dataType: 'json'
209 });
210 }
211
212 /**
213 * Add a comment via ajax and insert the comment into the comment tree.
214 */
215 function addComment(form) {
216 var node_id = form.find('input[name="node"]').val();
217 var parent_id = form.find('input[name="parent"]').val();
218 var text = form.find('textarea[name="comment"]').val();
219 var proposal = form.find('textarea[name="proposal"]').val();
220
221 if (text == '') {
222 showError('Please enter a comment.');
223 return;
224 }
225
226 // Disable the form that is being submitted.
227 form.find('textarea,input').attr('disabled', 'disabled');
228
229 // Send the comment to the server.
230 $.ajax({
231 type: "POST",
232 url: opts.addCommentURL,
233 dataType: 'json',
234 data: {
235 node: node_id,
236 parent: parent_id,
237 text: text,
238 proposal: proposal
239 },
240 success: function(data, textStatus, error) {
241 // Reset the form.
242 if (node_id) {
243 hideProposeChange(node_id);
244 }
245 form.find('textarea')
246 .val('')
247 .add(form.find('input'))
248 .removeAttr('disabled');
249 var ul = $('#cl' + (node_id || parent_id));
250 if (ul.data('empty')) {
251 $(ul).empty();
252 ul.data('empty', false);
253 }
254 insertComment(data.comment);
255 var ao = $('#ao' + node_id);
256 ao.find('img').attr({'src': opts.commentBrightImage});
257 if (node_id) {
258 // if this was a "root" comment, remove the commenting box
259 // (the user can get it back by reopening the comment popup)
260 $('#ca' + node_id).slideUp();
261 }
262 },
263 error: function(request, textStatus, error) {
264 form.find('textarea,input').removeAttr('disabled');
265 showError('Oops, there was a problem adding the comment.');
266 }
267 });
268 }
269
270 /**
271 * Recursively append comments to the main comment list and children
272 * lists, creating the comment tree.
273 */
274 function appendComments(comments, ul) {
275 $.each(comments, function() {
276 var div = createCommentDiv(this);
277 ul.append($(document.createElement('li')).html(div));
278 appendComments(this.children, div.find('ul.comment-children'));
279 // To avoid stagnating data, don't store the comments children in data.
280 this.children = null;
281 div.data('comment', this);
282 });
283 }
284
285 /**
286 * After adding a new comment, it must be inserted in the correct
287 * location in the comment tree.
288 */
289 function insertComment(comment) {
290 var div = createCommentDiv(comment);
291
292 // To avoid stagnating data, don't store the comments children in data.
293 comment.children = null;
294 div.data('comment', comment);
295
296 var ul = $('#cl' + (comment.node || comment.parent));
297 var siblings = getChildren(ul);
298
299 var li = $(document.createElement('li'));
300 li.hide();
301
302 // Determine where in the parents children list to insert this comment.
303 for(i=0; i < siblings.length; i++) {
304 if (comp(comment, siblings[i]) <= 0) {
305 $('#cd' + siblings[i].id)
306 .parent()
307 .before(li.html(div));
308 li.slideDown('fast');
309 return;
310 }
311 }
312
313 // If we get here, this comment rates lower than all the others,
314 // or it is the only comment in the list.
315 ul.append(li.html(div));
316 li.slideDown('fast');
317 }
318
319 function acceptComment(id) {
320 $.ajax({
321 type: 'POST',
322 url: opts.acceptCommentURL,
323 data: {id: id},
324 success: function(data, textStatus, request) {
325 $('#cm' + id).fadeOut('fast');
326 $('#cd' + id).removeClass('moderate');
327 },
328 error: function(request, textStatus, error) {
329 showError('Oops, there was a problem accepting the comment.');
330 }
331 });
332 }
333
334 function deleteComment(id) {
335 $.ajax({
336 type: 'POST',
337 url: opts.deleteCommentURL,
338 data: {id: id},
339 success: function(data, textStatus, request) {
340 var div = $('#cd' + id);
341 if (data == 'delete') {
342 // Moderator mode: remove the comment and all children immediately
343 div.slideUp('fast', function() {
344 div.remove();
345 });
346 return;
347 }
348 // User mode: only mark the comment as deleted
349 div
350 .find('span.user-id:first')
351 .text('[deleted]').end()
352 .find('div.comment-text:first')
353 .text('[deleted]').end()
354 .find('#cm' + id + ', #dc' + id + ', #ac' + id + ', #rc' + id +
355 ', #sp' + id + ', #hp' + id + ', #cr' + id + ', #rl' + id)
356 .remove();
357 var comment = div.data('comment');
358 comment.username = '[deleted]';
359 comment.text = '[deleted]';
360 div.data('comment', comment);
361 },
362 error: function(request, textStatus, error) {
363 showError('Oops, there was a problem deleting the comment.');
364 }
365 });
366 }
367
368 function showProposal(id) {
369 $('#sp' + id).hide();
370 $('#hp' + id).show();
371 $('#pr' + id).slideDown('fast');
372 }
373
374 function hideProposal(id) {
375 $('#hp' + id).hide();
376 $('#sp' + id).show();
377 $('#pr' + id).slideUp('fast');
378 }
379
380 function showProposeChange(id) {
381 $('#pc' + id).hide();
382 $('#hc' + id).show();
383 var textarea = $('#pt' + id);
384 textarea.val(textarea.data('source'));
385 $.fn.autogrow.resize(textarea[0]);
386 textarea.slideDown('fast');
387 }
388
389 function hideProposeChange(id) {
390 $('#hc' + id).hide();
391 $('#pc' + id).show();
392 var textarea = $('#pt' + id);
393 textarea.val('').removeAttr('disabled');
394 textarea.slideUp('fast');
395 }
396
397 function toggleCommentMarkupBox(id) {
398 $('#mb' + id).toggle();
399 }
400
401 /** Handle when the user clicks on a sort by link. */
402 function handleReSort(link) {
403 var classes = link.attr('class').split(/\s+/);
404 for (var i=0; i<classes.length; i++) {
405 if (classes[i] != 'sort-option') {
406 by = classes[i].substring(2);
407 }
408 }
409 setComparator();
410 // Save/update the sortBy cookie.
411 var expiration = new Date();
412 expiration.setDate(expiration.getDate() + 365);
413 document.cookie= 'sortBy=' + escape(by) +
414 ';expires=' + expiration.toUTCString();
415 $('ul.comment-ul').each(function(index, ul) {
416 var comments = getChildren($(ul), true);
417 comments = sortComments(comments);
418 appendComments(comments, $(ul).empty());
419 });
420 }
421
422 /**
423 * Function to process a vote when a user clicks an arrow.
424 */
425 function handleVote(link) {
426 if (!opts.voting) {
427 showError("You'll need to login to vote.");
428 return;
429 }
430
431 var id = link.attr('id');
432 if (!id) {
433 // Didn't click on one of the voting arrows.
434 return;
435 }
436 // If it is an unvote, the new vote value is 0,
437 // Otherwise it's 1 for an upvote, or -1 for a downvote.
438 var value = 0;
439 if (id.charAt(1) != 'u') {
440 value = id.charAt(0) == 'u' ? 1 : -1;
441 }
442 // The data to be sent to the server.
443 var d = {
444 comment_id: id.substring(2),
445 value: value
446 };
447
448 // Swap the vote and unvote links.
449 link.hide();
450 $('#' + id.charAt(0) + (id.charAt(1) == 'u' ? 'v' : 'u') + d.comment_id)
451 .show();
452
453 // The div the comment is displayed in.
454 var div = $('div#cd' + d.comment_id);
455 var data = div.data('comment');
456
457 // If this is not an unvote, and the other vote arrow has
458 // already been pressed, unpress it.
459 if ((d.value !== 0) && (data.vote === d.value * -1)) {
460 $('#' + (d.value == 1 ? 'd' : 'u') + 'u' + d.comment_id).hide();
461 $('#' + (d.value == 1 ? 'd' : 'u') + 'v' + d.comment_id).show();
462 }
463
464 // Update the comments rating in the local data.
465 data.rating += (data.vote === 0) ? d.value : (d.value - data.vote);
466 data.vote = d.value;
467 div.data('comment', data);
468
469 // Change the rating text.
470 div.find('.rating:first')
471 .text(data.rating + ' point' + (data.rating == 1 ? '' : 's'));
472
473 // Send the vote information to the server.
474 $.ajax({
475 type: "POST",
476 url: opts.processVoteURL,
477 data: d,
478 error: function(request, textStatus, error) {
479 showError('Oops, there was a problem casting that vote.');
480 }
481 });
482 }
483
484 /**
485 * Open a reply form used to reply to an existing comment.
486 */
487 function openReply(id) {
488 // Swap out the reply link for the hide link
489 $('#rl' + id).hide();
490 $('#cr' + id).show();
491
492 // Add the reply li to the children ul.
493 var div = $(renderTemplate(replyTemplate, {id: id})).hide();
494 $('#cl' + id)
495 .prepend(div)
496 // Setup the submit handler for the reply form.
497 .find('#rf' + id)
498 .submit(function(event) {
499 event.preventDefault();
500 addComment($('#rf' + id));
501 closeReply(id);
502 })
503 .find('input[type=button]')
504 .click(function() {
505 closeReply(id);
506 });
507 div.slideDown('fast', function() {
508 $('#rf' + id).find('textarea').focus();
509 });
510 }
511
512 /**
513 * Close the reply form opened with openReply.
514 */
515 function closeReply(id) {
516 // Remove the reply div from the DOM.
517 $('#rd' + id).slideUp('fast', function() {
518 $(this).remove();
519 });
520
521 // Swap out the hide link for the reply link
522 $('#cr' + id).hide();
523 $('#rl' + id).show();
524 }
525
526 /**
527 * Recursively sort a tree of comments using the comp comparator.
528 */
529 function sortComments(comments) {
530 comments.sort(comp);
531 $.each(comments, function() {
532 this.children = sortComments(this.children);
533 });
534 return comments;
535 }
536
537 /**
538 * Get the children comments from a ul. If recursive is true,
539 * recursively include childrens' children.
540 */
541 function getChildren(ul, recursive) {
542 var children = [];
543 ul.children().children("[id^='cd']")
544 .each(function() {
545 var comment = $(this).data('comment');
546 if (recursive)
547 comment.children = getChildren($(this).find('#cl' + comment.id), true);
548 children.push(comment);
549 });
550 return children;
551 }
552
553 /** Create a div to display a comment in. */
554 function createCommentDiv(comment) {
555 if (!comment.displayed && !opts.moderator) {
556 return $('<div class="moderate">Thank you! Your comment will show up '
557 + 'once it is has been approved by a moderator.</div>');
558 }
559 // Prettify the comment rating.
560 comment.pretty_rating = comment.rating + ' point' +
561 (comment.rating == 1 ? '' : 's');
562 // Make a class (for displaying not yet moderated comments differently)
563 comment.css_class = comment.displayed ? '' : ' moderate';
564 // Create a div for this comment.
565 var context = $.extend({}, opts, comment);
566 var div = $(renderTemplate(commentTemplate, context));
567
568 // If the user has voted on this comment, highlight the correct arrow.
569 if (comment.vote) {
570 var direction = (comment.vote == 1) ? 'u' : 'd';
571 div.find('#' + direction + 'v' + comment.id).hide();
572 div.find('#' + direction + 'u' + comment.id).show();
573 }
574
575 if (opts.moderator || comment.text != '[deleted]') {
576 div.find('a.reply').show();
577 if (comment.proposal_diff)
578 div.find('#sp' + comment.id).show();
579 if (opts.moderator && !comment.displayed)
580 div.find('#cm' + comment.id).show();
581 if (opts.moderator || (opts.username == comment.username))
582 div.find('#dc' + comment.id).show();
583 }
584 return div;
585 }
586
587 /**
588 * A simple template renderer. Placeholders such as <%id%> are replaced
589 * by context['id'] with items being escaped. Placeholders such as <#id#>
590 * are not escaped.
591 */
592 function renderTemplate(template, context) {
593 var esc = $(document.createElement('div'));
594
595 function handle(ph, escape) {
596 var cur = context;
597 $.each(ph.split('.'), function() {
598 cur = cur[this];
599 });
600 return escape ? esc.text(cur || "").html() : cur;
601 }
602
603 return template.replace(/<([%#])([\w\.]*)\1>/g, function() {
604 return handle(arguments[2], arguments[1] == '%' ? true : false);
605 });
606 }
607
608 /** Flash an error message briefly. */
609 function showError(message) {
610 $(document.createElement('div')).attr({'class': 'popup-error'})
611 .append($(document.createElement('div'))
612 .attr({'class': 'error-message'}).text(message))
613 .appendTo('body')
614 .fadeIn("slow")
615 .delay(2000)
616 .fadeOut("slow");
617 }
618
619 /** Add a link the user uses to open the comments popup. */
620 $.fn.comment = function() {
621 return this.each(function() {
622 var id = $(this).attr('id').substring(1);
623 var count = COMMENT_METADATA[id];
624 var title = count + ' comment' + (count == 1 ? '' : 's');
625 var image = count > 0 ? opts.commentBrightImage : opts.commentImage;
626 var addcls = count == 0 ? ' nocomment' : '';
627 $(this)
628 .append(
629 $(document.createElement('a')).attr({
630 href: '#',
631 'class': 'sphinx-comment-open' + addcls,
632 id: 'ao' + id
633 })
634 .append($(document.createElement('img')).attr({
635 src: image,
636 alt: 'comment',
637 title: title
638 }))
639 .click(function(event) {
640 event.preventDefault();
641 show($(this).attr('id').substring(2));
642 })
643 )
644 .append(
645 $(document.createElement('a')).attr({
646 href: '#',
647 'class': 'sphinx-comment-close hidden',
648 id: 'ah' + id
649 })
650 .append($(document.createElement('img')).attr({
651 src: opts.closeCommentImage,
652 alt: 'close',
653 title: 'close'
654 }))
655 .click(function(event) {
656 event.preventDefault();
657 hide($(this).attr('id').substring(2));
658 })
659 );
660 });
661 };
662
663 var opts = {
664 processVoteURL: '/_process_vote',
665 addCommentURL: '/_add_comment',
666 getCommentsURL: '/_get_comments',
667 acceptCommentURL: '/_accept_comment',
668 deleteCommentURL: '/_delete_comment',
669 commentImage: '/static/_static/comment.png',
670 closeCommentImage: '/static/_static/comment-close.png',
671 loadingImage: '/static/_static/ajax-loader.gif',
672 commentBrightImage: '/static/_static/comment-bright.png',
673 upArrow: '/static/_static/up.png',
674 downArrow: '/static/_static/down.png',
675 upArrowPressed: '/static/_static/up-pressed.png',
676 downArrowPressed: '/static/_static/down-pressed.png',
677 voting: false,
678 moderator: false
679 };
680
681 if (typeof COMMENT_OPTIONS != "undefined") {
682 opts = jQuery.extend(opts, COMMENT_OPTIONS);
683 }
684
685 var popupTemplate = '\
686 <div class="sphinx-comments" id="sc<%id%>">\
687 <p class="sort-options">\
688 Sort by:\
689 <a href="#" class="sort-option byrating">best rated</a>\
690 <a href="#" class="sort-option byascage">newest</a>\
691 <a href="#" class="sort-option byage">oldest</a>\
692 </p>\
693 <div class="comment-header">Comments</div>\
694 <div class="comment-loading" id="cn<%id%>">\
695 loading comments... <img src="<%loadingImage%>" alt="" /></div>\
696 <ul id="cl<%id%>" class="comment-ul"></ul>\
697 <div id="ca<%id%>">\
698 <p class="add-a-comment">Add a comment\
699 (<a href="#" class="comment-markup" id="ab<%id%>">markup</a>):</p>\
700 <div class="comment-markup-box" id="mb<%id%>">\
701 reStructured text markup: <i>*emph*</i>, <b>**strong**</b>, \
702 <tt>``code``</tt>, \
703 code blocks: <tt>::</tt> and an indented block after blank line</div>\
704 <form method="post" id="cf<%id%>" class="comment-form" action="">\
705 <textarea name="comment" cols="80"></textarea>\
706 <p class="propose-button">\
707 <a href="#" id="pc<%id%>" class="show-propose-change">\
708 Propose a change &#9657;\
709 </a>\
710 <a href="#" id="hc<%id%>" class="hide-propose-change">\
711 Propose a change &#9663;\
712 </a>\
713 </p>\
714 <textarea name="proposal" id="pt<%id%>" cols="80"\
715 spellcheck="false"></textarea>\
716 <input type="submit" value="Add comment" />\
717 <input type="hidden" name="node" value="<%id%>" />\
718 <input type="hidden" name="parent" value="" />\
719 </form>\
720 </div>\
721 </div>';
722
723 var commentTemplate = '\
724 <div id="cd<%id%>" class="sphinx-comment<%css_class%>">\
725 <div class="vote">\
726 <div class="arrow">\
727 <a href="#" id="uv<%id%>" class="vote" title="vote up">\
728 <img src="<%upArrow%>" />\
729 </a>\
730 <a href="#" id="uu<%id%>" class="un vote" title="vote up">\
731 <img src="<%upArrowPressed%>" />\
732 </a>\
733 </div>\
734 <div class="arrow">\
735 <a href="#" id="dv<%id%>" class="vote" title="vote down">\
736 <img src="<%downArrow%>" id="da<%id%>" />\
737 </a>\
738 <a href="#" id="du<%id%>" class="un vote" title="vote down">\
739 <img src="<%downArrowPressed%>" />\
740 </a>\
741 </div>\
742 </div>\
743 <div class="comment-content">\
744 <p class="tagline comment">\
745 <span class="user-id"><%username%></span>\
746 <span class="rating"><%pretty_rating%></span>\
747 <span class="delta"><%time.delta%></span>\
748 </p>\
749 <div class="comment-text comment"><#text#></div>\
750 <p class="comment-opts comment">\
751 <a href="#" class="reply hidden" id="rl<%id%>">reply &#9657;</a>\
752 <a href="#" class="close-reply" id="cr<%id%>">reply &#9663;</a>\
753 <a href="#" id="sp<%id%>" class="show-proposal">proposal &#9657;</a>\
754 <a href="#" id="hp<%id%>" class="hide-proposal">proposal &#9663;</a>\
755 <a href="#" id="dc<%id%>" class="delete-comment hidden">delete</a>\
756 <span id="cm<%id%>" class="moderation hidden">\
757 <a href="#" id="ac<%id%>" class="accept-comment">accept</a>\
758 </span>\
759 </p>\
760 <pre class="proposal" id="pr<%id%>">\
761 <#proposal_diff#>\
762 </pre>\
763 <ul class="comment-children" id="cl<%id%>"></ul>\
764 </div>\
765 <div class="clearleft"></div>\
766 </div>\
767 </div>';
768
769 var replyTemplate = '\
770 <li>\
771 <div class="reply-div" id="rd<%id%>">\
772 <form id="rf<%id%>">\
773 <textarea name="comment" cols="80"></textarea>\
774 <input type="submit" value="Add reply" />\
775 <input type="button" value="Cancel" />\
776 <input type="hidden" name="parent" value="<%id%>" />\
777 <input type="hidden" name="node" value="" />\
778 </form>\
779 </div>\
780 </li>';
781
782 $(document).ready(function() {
783 init();
784 });
785 })(jQuery);
786
787 $(document).ready(function() {
788 // add comment anchors for all paragraphs that are commentable
789 $('.sphinx-has-comment').comment();
790
791 // highlight search words in search results
792 $("div.context").each(function() {
793 var params = $.getQueryParameters();
794 var terms = (params.q) ? params.q[0].split(/\s+/) : [];
795 var result = $(this);
796 $.each(terms, function() {
797 result.highlightText(this.toLowerCase(), 'highlighted');
798 });
799 });
800
801 // directly open comment window if requested
802 var anchor = document.location.hash;
803 if (anchor.substring(0, 9) == '#comment-') {
804 $('#ao' + anchor.substring(9)).click();
805 document.location.hash = '#s' + anchor.substring(9);
806 }
807 });
0
1
2
3
4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
5 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
6
7
8 <html xmlns="http://www.w3.org/1999/xhtml">
9 <head>
10 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
11
12 <title>Index &mdash; django-stronghold 0.1.1 documentation</title>
13
14 <link rel="stylesheet" href="_static/default.css" type="text/css" />
15 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
16
17 <script type="text/javascript">
18 var DOCUMENTATION_OPTIONS = {
19 URL_ROOT: '',
20 VERSION: '0.1.1',
21 COLLAPSE_INDEX: false,
22 FILE_SUFFIX: '.html',
23 HAS_SOURCE: true
24 };
25 </script>
26 <script type="text/javascript" src="_static/jquery.js"></script>
27 <script type="text/javascript" src="_static/underscore.js"></script>
28 <script type="text/javascript" src="_static/doctools.js"></script>
29 <link rel="top" title="django-stronghold 0.1.1 documentation" href="index.html" />
30 </head>
31 <body>
32 <div class="related">
33 <h3>Navigation</h3>
34 <ul>
35 <li class="right" style="margin-right: 10px">
36 <a href="#" title="General Index"
37 accesskey="I">index</a></li>
38 <li><a href="index.html">django-stronghold 0.1.1 documentation</a> &raquo;</li>
39 </ul>
40 </div>
41
42 <div class="document">
43 <div class="documentwrapper">
44 <div class="bodywrapper">
45 <div class="body">
46
47
48 <h1 id="index">Index</h1>
49
50 <div class="genindex-jumpbox">
51
52 </div>
53
54
55 </div>
56 </div>
57 </div>
58 <div class="sphinxsidebar">
59 <div class="sphinxsidebarwrapper">
60
61
62
63 <div id="searchbox" style="display: none">
64 <h3>Quick search</h3>
65 <form class="search" action="search.html" method="get">
66 <input type="text" name="q" />
67 <input type="submit" value="Go" />
68 <input type="hidden" name="check_keywords" value="yes" />
69 <input type="hidden" name="area" value="default" />
70 </form>
71 <p class="searchtip" style="font-size: 90%">
72 Enter search terms or a module, class or function name.
73 </p>
74 </div>
75 <script type="text/javascript">$('#searchbox').show(0);</script>
76 </div>
77 </div>
78 <div class="clearer"></div>
79 </div>
80 <div class="related">
81 <h3>Navigation</h3>
82 <ul>
83 <li class="right" style="margin-right: 10px">
84 <a href="#" title="General Index"
85 >index</a></li>
86 <li><a href="index.html">django-stronghold 0.1.1 documentation</a> &raquo;</li>
87 </ul>
88 </div>
89 <div class="footer">
90 &copy; Copyright 2013, Mike Grouchy.
91 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
92 </div>
93 </body>
94 </html>
0
1
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5
6 <html xmlns="http://www.w3.org/1999/xhtml">
7 <head>
8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
10 <title>Welcome to django-stronghold’s documentation! &mdash; django-stronghold 0.1.1 documentation</title>
11
12 <link rel="stylesheet" href="_static/default.css" type="text/css" />
13 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
14
15 <script type="text/javascript">
16 var DOCUMENTATION_OPTIONS = {
17 URL_ROOT: '',
18 VERSION: '0.1.1',
19 COLLAPSE_INDEX: false,
20 FILE_SUFFIX: '.html',
21 HAS_SOURCE: true
22 };
23 </script>
24 <script type="text/javascript" src="_static/jquery.js"></script>
25 <script type="text/javascript" src="_static/underscore.js"></script>
26 <script type="text/javascript" src="_static/doctools.js"></script>
27 <link rel="top" title="django-stronghold 0.1.1 documentation" href="#" />
28 </head>
29 <body>
30 <div class="related">
31 <h3>Navigation</h3>
32 <ul>
33 <li class="right" style="margin-right: 10px">
34 <a href="genindex.html" title="General Index"
35 accesskey="I">index</a></li>
36 <li><a href="#">django-stronghold 0.1.1 documentation</a> &raquo;</li>
37 </ul>
38 </div>
39
40 <div class="document">
41 <div class="documentwrapper">
42 <div class="bodywrapper">
43 <div class="body">
44
45 <div class="section" id="welcome-to-django-stronghold-s-documentation">
46 <h1>Welcome to django-stronghold&#8217;s documentation!<a class="headerlink" href="#welcome-to-django-stronghold-s-documentation" title="Permalink to this headline">¶</a></h1>
47 <p>Contents:</p>
48 <div class="toctree-wrapper compound">
49 <ul class="simple">
50 </ul>
51 </div>
52 </div>
53 <div class="section" id="indices-and-tables">
54 <h1>Indices and tables<a class="headerlink" href="#indices-and-tables" title="Permalink to this headline">¶</a></h1>
55 <ul class="simple">
56 <li><a class="reference internal" href="genindex.html"><em>Index</em></a></li>
57 <li><a class="reference internal" href="py-modindex.html"><em>Module Index</em></a></li>
58 <li><a class="reference internal" href="search.html"><em>Search Page</em></a></li>
59 </ul>
60 </div>
61
62
63 </div>
64 </div>
65 </div>
66 <div class="sphinxsidebar">
67 <div class="sphinxsidebarwrapper">
68 <h3><a href="#">Table Of Contents</a></h3>
69 <ul>
70 <li><a class="reference internal" href="#">Welcome to django-stronghold&#8217;s documentation!</a><ul>
71 </ul>
72 </li>
73 <li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
74 </ul>
75
76 <h3>This Page</h3>
77 <ul class="this-page-menu">
78 <li><a href="_sources/index.txt"
79 rel="nofollow">Show Source</a></li>
80 </ul>
81 <div id="searchbox" style="display: none">
82 <h3>Quick search</h3>
83 <form class="search" action="search.html" method="get">
84 <input type="text" name="q" />
85 <input type="submit" value="Go" />
86 <input type="hidden" name="check_keywords" value="yes" />
87 <input type="hidden" name="area" value="default" />
88 </form>
89 <p class="searchtip" style="font-size: 90%">
90 Enter search terms or a module, class or function name.
91 </p>
92 </div>
93 <script type="text/javascript">$('#searchbox').show(0);</script>
94 </div>
95 </div>
96 <div class="clearer"></div>
97 </div>
98 <div class="related">
99 <h3>Navigation</h3>
100 <ul>
101 <li class="right" style="margin-right: 10px">
102 <a href="genindex.html" title="General Index"
103 >index</a></li>
104 <li><a href="#">django-stronghold 0.1.1 documentation</a> &raquo;</li>
105 </ul>
106 </div>
107 <div class="footer">
108 &copy; Copyright 2013, Mike Grouchy.
109 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
110 </div>
111 </body>
112 </html>
0
1
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5
6 <html xmlns="http://www.w3.org/1999/xhtml">
7 <head>
8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
10 <title>Search &mdash; django-stronghold 0.1.1 documentation</title>
11
12 <link rel="stylesheet" href="_static/default.css" type="text/css" />
13 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
14
15 <script type="text/javascript">
16 var DOCUMENTATION_OPTIONS = {
17 URL_ROOT: '',
18 VERSION: '0.1.1',
19 COLLAPSE_INDEX: false,
20 FILE_SUFFIX: '.html',
21 HAS_SOURCE: true
22 };
23 </script>
24 <script type="text/javascript" src="_static/jquery.js"></script>
25 <script type="text/javascript" src="_static/underscore.js"></script>
26 <script type="text/javascript" src="_static/doctools.js"></script>
27 <script type="text/javascript" src="_static/searchtools.js"></script>
28 <link rel="top" title="django-stronghold 0.1.1 documentation" href="index.html" />
29 <script type="text/javascript">
30 jQuery(function() { Search.loadIndex("searchindex.js"); });
31 </script>
32
33
34 </head>
35 <body>
36 <div class="related">
37 <h3>Navigation</h3>
38 <ul>
39 <li class="right" style="margin-right: 10px">
40 <a href="genindex.html" title="General Index"
41 accesskey="I">index</a></li>
42 <li><a href="index.html">django-stronghold 0.1.1 documentation</a> &raquo;</li>
43 </ul>
44 </div>
45
46 <div class="document">
47 <div class="documentwrapper">
48 <div class="bodywrapper">
49 <div class="body">
50
51 <h1 id="search-documentation">Search</h1>
52 <div id="fallback" class="admonition warning">
53 <script type="text/javascript">$('#fallback').hide();</script>
54 <p>
55 Please activate JavaScript to enable the search
56 functionality.
57 </p>
58 </div>
59 <p>
60 From here you can search these documents. Enter your search
61 words into the box below and click "search". Note that the search
62 function will automatically search for all of the words. Pages
63 containing fewer words won't appear in the result list.
64 </p>
65 <form action="" method="get">
66 <input type="text" name="q" value="" />
67 <input type="submit" value="search" />
68 <span id="search-progress" style="padding-left: 10px"></span>
69 </form>
70
71 <div id="search-results">
72
73 </div>
74
75 </div>
76 </div>
77 </div>
78 <div class="sphinxsidebar">
79 <div class="sphinxsidebarwrapper">
80 </div>
81 </div>
82 <div class="clearer"></div>
83 </div>
84 <div class="related">
85 <h3>Navigation</h3>
86 <ul>
87 <li class="right" style="margin-right: 10px">
88 <a href="genindex.html" title="General Index"
89 >index</a></li>
90 <li><a href="index.html">django-stronghold 0.1.1 documentation</a> &raquo;</li>
91 </ul>
92 </div>
93 <div class="footer">
94 &copy; Copyright 2013, Mike Grouchy.
95 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
96 </div>
97 </body>
98 </html>
0 Search.setIndex({objects:{},terms:{stronghold:0,index:0,search:0,welcom:0,modul:0,indic:0,django:0,content:0,tabl:0,document:0,page:0},objtypes:{},titles:["Welcome to django-stronghold&#8217;s documentation!"],objnames:{},filenames:["index"]})
0 Jinja2==2.6
0 Jinja2==2.10.3
11 Pygments==1.6
22 Sphinx==1.1.3
33 docutils==0.10
44 mock==1.0.1
5 django-discover-runner==1.0
6
77
88
99 dependencies = []
10 test_dependencies = ['django>1.4.0']
10 test_dependencies = ["django>1.8.0"]
1111
1212 setup(
13 name='django-stronghold',
14 version='0.3.0',
15 description='Get inside your stronghold and make all your Django views default login_required',
16 url='https://github.com/mgrouchy/django-stronghold',
17 author='Mike Grouchy',
13 name="django-stronghold",
14 version="0.4.0",
15 description="Get inside your stronghold and make all your Django views default login_required",
16 url="https://github.com/mgrouchy/django-stronghold",
17 author="Mike Grouchy",
1818 author_email="mgrouchy@gmail.com",
19 packages=[
20 'stronghold',
21 'stronghold.tests',
22 ],
23 license='MIT license',
19 packages=["stronghold", "stronghold.tests",],
20 license="MIT license",
2421 install_requires=dependencies,
2522 tests_require=test_dependencies,
26 long_description=open('README.rst').read(),
23 long_description=open("README.md").read(),
24 long_description_content_type="text/markdown",
2725 classifiers=[
28 'Development Status :: 5 - Production/Stable',
29 'Intended Audience :: Developers',
30 'Natural Language :: English',
31 'License :: OSI Approved :: MIT License',
32 'Programming Language :: Python',
33 'Programming Language :: Python :: 2.6',
34 'Programming Language :: Python :: 2.7',
35 'Programming Language :: Python :: 3',
36 'Programming Language :: Python :: 3.4',
37 'Programming Language :: Python :: 3.5',
38 'Programming Language :: Python :: 3.6',
26 "Development Status :: 5 - Production/Stable",
27 "Intended Audience :: Developers",
28 "Natural Language :: English",
29 "License :: OSI Approved :: MIT License",
30 "Programming Language :: Python",
31 "Programming Language :: Python :: 2.7",
32 "Programming Language :: Python :: 3",
33 "Programming Language :: Python :: 3.4",
34 "Programming Language :: Python :: 3.5",
35 "Programming Language :: Python :: 3.6",
36 "Programming Language :: Python :: 3.7",
3937 ],
4038 )
66 from django.conf import settings
77 from django.contrib.auth.decorators import login_required
88
9 STRONGHOLD_PUBLIC_URLS = getattr(settings, 'STRONGHOLD_PUBLIC_URLS', ())
10 STRONGHOLD_DEFAULTS = getattr(settings, 'STRONGHOLD_DEFAULTS', True)
11 STRONGHOLD_PUBLIC_NAMED_URLS = getattr(settings, 'STRONGHOLD_PUBLIC_NAMED_URLS', ())
9 STRONGHOLD_PUBLIC_URLS = getattr(settings, "STRONGHOLD_PUBLIC_URLS", ())
10 STRONGHOLD_DEFAULTS = getattr(settings, "STRONGHOLD_DEFAULTS", True)
11 STRONGHOLD_PUBLIC_NAMED_URLS = getattr(settings, "STRONGHOLD_PUBLIC_NAMED_URLS", ())
12
1213
1314 def is_authenticated(user):
1415 """ make compatible with django 1 and 2 """
1718 except TypeError:
1819 return user.is_authenticated
1920
20 STRONGHOLD_USER_TEST_FUNC = getattr(settings, 'STRONGHOLD_USER_TEST_FUNC', is_authenticated)
21
22 def test_request(request, view_func, view_args, view_kwargs):
23 """
24 Default test against request in middleware.
25
26 Set this in STRONGHOLD_USER_TEST_FUNC in your django.conf.settings if you
27 want to use the request details to deny permission.
28 """
29 return True
2130
2231
32 STRONGHOLD_USER_TEST_FUNC = getattr(settings, "STRONGHOLD_USER_TEST_FUNC", is_authenticated)
33 STRONGHOLD_REQUEST_TEST_FUNC = getattr(settings, "STRONGHOLD_REQUEST_TEST_FUNC", test_request)
34
2335 if STRONGHOLD_DEFAULTS:
24 if 'django.contrib.auth' in settings.INSTALLED_APPS:
25 STRONGHOLD_PUBLIC_NAMED_URLS += ('login', 'logout')
36 if "django.contrib.auth" in settings.INSTALLED_APPS:
37 STRONGHOLD_PUBLIC_NAMED_URLS += ("login", "logout")
2638
2739 # Do not login protect the logout url, causes an infinite loop
28 logout_url = getattr(settings, 'LOGOUT_URL', None)
40 logout_url = getattr(settings, "LOGOUT_URL", None)
2941 if logout_url:
30 STRONGHOLD_PUBLIC_URLS += (r'^%s.+$' % logout_url, )
42 STRONGHOLD_PUBLIC_URLS += (r"^%s.+$" % logout_url,)
3143
3244 if settings.DEBUG:
3345 # In Debug mode we serve the media urls as public by default as a
3446 # convenience. We make no other assumptions
35 static_url = getattr(settings, 'STATIC_URL', None)
36 media_url = getattr(settings, 'MEDIA_URL', None)
47 static_url = getattr(settings, "STATIC_URL", None)
48 media_url = getattr(settings, "MEDIA_URL", None)
3749
3850 if static_url:
39 STRONGHOLD_PUBLIC_URLS += (r'^%s.+$' % static_url, )
51 STRONGHOLD_PUBLIC_URLS += (r"^%s.+$" % static_url,)
4052
4153 if media_url:
42 STRONGHOLD_PUBLIC_URLS += (r'^%s.+$' % media_url, )
54 STRONGHOLD_PUBLIC_URLS += (r"^%s.+$" % media_url,)
4355
4456 # named urls can be unsafe if a user puts the wrong url in. Right now urls that
4557 # dont reverse are just ignored with a warning. Maybe in the future make this
5567 pass
5668
5769
58 STRONGHOLD_PUBLIC_URLS += tuple(['^%s$' % url for url in named_urls])
70 STRONGHOLD_PUBLIC_URLS += tuple(["^%s$" % url for url in named_urls])
5971
6072 if STRONGHOLD_PUBLIC_URLS:
6173 STRONGHOLD_PUBLIC_URLS = [re.compile(v) for v in STRONGHOLD_PUBLIC_URLS]
77 Sets an attribute in the fuction STRONGHOLD_IS_PUBLIC to True
88 """
99 orig_func = function
10 outer_partial_wrapper = None
1011 while isinstance(orig_func, partial):
12 outer_partial_wrapper = orig_func
1113 orig_func = orig_func.func
14 # For Django >= 2.1.x:
15 # If `function` is a bound method, django will wrap it in a partial
16 # to allow setting attributes on a bound method.
17 # Bound methods have the attr "__self__". If this is the case,
18 # we reapply the partial wrapper before setting the attribute.
19 if hasattr(orig_func, "__self__") and outer_partial_wrapper != None:
20 orig_func = outer_partial_wrapper
1221 set_view_func_public(orig_func)
1322
1423 return function
2222 def __init__(self, *args, **kwargs):
2323 if MiddlewareMixin != object:
2424 super(LoginRequiredMiddleware, self).__init__(*args, **kwargs)
25 self.public_view_urls = getattr(conf, 'STRONGHOLD_PUBLIC_URLS', ())
25 self.public_view_urls = getattr(conf, "STRONGHOLD_PUBLIC_URLS", ())
2626
2727 def process_view(self, request, view_func, view_args, view_kwargs):
28 if conf.STRONGHOLD_USER_TEST_FUNC(request.user) \
29 or utils.is_view_func_public(view_func) \
30 or self.is_public_url(request.path_info):
28 if (
29 utils.is_view_func_public(view_func)
30 or self.is_public_url(request.path_info)
31 or conf.STRONGHOLD_USER_TEST_FUNC(request.user)
32 and conf.STRONGHOLD_REQUEST_TEST_FUNC(request, view_func, view_args, view_kwargs)
33 ):
3134 return None
3235
3336 decorator = user_passes_test(conf.STRONGHOLD_USER_TEST_FUNC)
66 from django.utils import unittest
77 else:
88 import unittest
9 from django.utils.decorators import method_decorator
910
1011
1112 class StrongholdDecoratorTests(unittest.TestCase):
3637 decorators.public(partial)
3738
3839 self.assertTrue(function.STRONGHOLD_IS_PUBLIC)
40
41 def test_public_decorator_works_with_method_decorator(self):
42 class TestClass:
43 @method_decorator(decorators.public)
44 def function(self):
45 pass
46
47 self.assertTrue(TestClass.function.STRONGHOLD_IS_PUBLIC)
22 Returns whether a view is public or not (ie/ has the STRONGHOLD_IS_PUBLIC
33 attribute set)
44 """
5 return getattr(func, 'STRONGHOLD_IS_PUBLIC', False)
5 return getattr(func, "STRONGHOLD_IS_PUBLIC", False)
66
77
88 def set_view_func_public(func):
99 """
1010 Set the STRONGHOLD_IS_PUBLIC attribute on a given function to True
1111 """
12 setattr(func, 'STRONGHOLD_IS_PUBLIC', True)
12 setattr(func, "STRONGHOLD_IS_PUBLIC", True)
22
33
44 class StrongholdPublicMixin(object):
5
65 @method_decorator(public)
76 def dispatch(self, *args, **kwargs):
87 return super(StrongholdPublicMixin, self).dispatch(*args, **kwargs)
3030
3131 STATIC_ROOT = ''
3232 STATIC_URL = '/static/'
33
34 # Additional locations of static files
35 STATICFILES_DIRS = (
36 )
37
38 # List of finder classes that know how to find static files in
39 # various locations.
40 STATICFILES_FINDERS = (
41 'django.contrib.staticfiles.finders.FileSystemFinder',
42 'django.contrib.staticfiles.finders.AppDirectoriesFinder',
43 #'django.contrib.staticfiles.finders.DefaultStorageFinder',
44 )
4533
4634 # Make this unique, and don't share it with anybody.
4735 SECRET_KEY = 'dq73h&amp;uf%a5p(*ns7*!y&amp;7f=)lnn(#aoax_1$e*j)2ziy9b3^!'
11199 },
112100 }
113101 }
114
115
116 import django
117
118 if django.VERSION[:2] < (1, 6):
119 TEST_RUNNER = 'discover_runner.DiscoverRunner'
120 else:
121 TEST_RUNNER = 'django.test.runner.DiscoverRunner'
44 urlpatterns = [
55 url(r'^protected/$', views.ProtectedView.as_view(), name="protected_view"),
66 url(r'^public/$', views.PublicView.as_view(), name="public_view"),
7 url(r'^public2/$', views.PublicView2.as_view(), name="public_view2"),
8 url(r'^public3/$', views.public_view3, name="public_view3")
79 ]
22 from django.utils.decorators import method_decorator
33
44 from stronghold.decorators import public
5 from stronghold.views import StrongholdPublicMixin
56
67
78 class ProtectedView(View):
1819
1920 def get(self, request, *args, **kwargs):
2021 return HttpResponse("PublicView")
22
23 class PublicView2(StrongholdPublicMixin, View):
24 """ A view we want to be public, using the StrongholdPublicMixin"""
25 def get(self, request, *args, **kwargs):
26 return HttpResponse("PublicView")
27
28 @public
29 def public_view3(request):
30 """ A function view we want to be public"""
31 return HttpResponse("PublicView")
00 """
11 WSGI config for test_project project.
2 It exposes the WSGI callable as a module-level variable named ``application``.
3 For more information on this file, see
4 https://docs.djangoproject.com/en/stable/howto/deployment/wsgi/
5 """
26
3 This module contains the WSGI application used by Django's development server
4 and any production WSGI deployments. It should expose a module-level variable
5 named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
6 this application via the ``WSGI_APPLICATION`` setting.
7 import os
78
8 Usually you will have the standard Django WSGI application here, but it also
9 might make sense to replace the whole Django WSGI application with a custom one
10 that later delegates to the Django one. For example, you could introduce WSGI
11 middleware here, or combine a Django application with an application of another
12 framework.
13
14 """
15 import os
9 from django.core.wsgi import get_wsgi_application
1610
1711 os.environ.setdefault("DJANGO_SETTINGS_MODULE", "test_project.settings")
1812
19 # This application object is used by any WSGI server configured to use this
20 # file. This includes Django's development server, if the WSGI_APPLICATION
21 # setting points here.
22 from django.core.wsgi import get_wsgi_application
2313 application = get_wsgi_application()
24
25 # Apply WSGI middleware here.
26 # from helloworld.wsgi import HelloWorldApplication
27 # application = HelloWorldApplication(application)