Merge lp:~fougner/ubuntu-packaging-guide/retheming into lp:ubuntu-packaging-guide
- retheming
- Merge into trunk
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~fougner/ubuntu-packaging-guide/retheming | ||||
Merge into: | lp:ubuntu-packaging-guide | ||||
Diff against target: |
11864 lines (+11703/-2) 26 files modified
BORROWED-CODE (+7/-0) conf.py (+2/-2) debian/copyright (+41/-0) themes/ubuntu/defindex.html (+35/-0) themes/ubuntu/domainindex.html (+57/-0) themes/ubuntu/genindex-single.html (+48/-0) themes/ubuntu/genindex-split.html (+41/-0) themes/ubuntu/genindex.html (+59/-0) themes/ubuntu/globaltoc.html (+11/-0) themes/ubuntu/layout.html (+224/-0) themes/ubuntu/localtoc.html (+13/-0) themes/ubuntu/opensearch.xml (+10/-0) themes/ubuntu/page.html (+13/-0) themes/ubuntu/relations.html (+19/-0) themes/ubuntu/search.html (+56/-0) themes/ubuntu/searchbox.html (+24/-0) themes/ubuntu/sourcelink.html (+16/-0) themes/ubuntu/static/default.css_t (+56/-0) themes/ubuntu/static/doctools.js (+247/-0) themes/ubuntu/static/jquery.js (+8176/-0) themes/ubuntu/static/light-django-theme.css (+1265/-0) themes/ubuntu/static/newstyle.css (+592/-0) themes/ubuntu/static/searchtools.js (+518/-0) themes/ubuntu/static/sidebar.js (+148/-0) themes/ubuntu/static/underscore.js (+16/-0) themes/ubuntu/theme.conf (+9/-0) |
||||
To merge this branch: | bzr merge lp:~fougner/ubuntu-packaging-guide/retheming | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Iain Lane | Needs Fixing | ||
Review via email:
|
This proposal has been superseded by a proposal from 2011-07-22.
Commit message
Description of the change
more Ubuntu-ish Sphinx theme!
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Holbach (dholbach) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Holbach (dholbach) wrote : | # |
Thanks a lot Alexander! Fantastic work!
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Alexander Fougner (fougner) wrote : | # |
> Thanks a lot Alexander! Fantastic work!
You're welcome! Just give me a ping if there's more web stuff to do :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Holbach (dholbach) wrote : | # |
I feel what we still need to do is:
- adding copyright/
- remove the website links for now, as they're not really relevant to an HTML offline guide,
and replace them with a <!-- website links --> HTML comment, which can be replace with actual
HTML (for website links) for the more official location by a script
If you can think of anything else, please comment. :)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Iain Lane (laney) wrote : | # |
(I re-merged your branch with trunk before looking)
Cheers for this! Looks very nice :-)
Comments:
- I see "¶" at the end of headings that probably shouldn't be there.
- "Index" in the main orange bar seems to go nowhere and the other index link leads to a page with only one entry. Do we plan on fleshing this out?
- Looking at http://
- What's the login link for?
- Is it possible to indent the code blocks a bit and/or give them a slightly shaded background?
- Code blocks should probably have a fixed width font. For example, indentation matters when writing debian/changelog entries, and this should be clear on the page. See debian-dir-overview for examples of this.
Cheers!
Iain
- 47. By Alexander Fougner
-
some style fixes and removal of links as per dholbach's request
- 48. By Alexander Fougner
-
permalink appears when headers are hovered
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Holbach (dholbach) wrote : | # |
I'm very happy with the changes that Alexander got in. Do we want to merge this, go ahead with the current approach and file bugs for the rest of the issues or do we want to fix all of this before merging?
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Stefano Rivera (stefanor) wrote : | # |
I'm happy with either approach. If Alexander is prepared to do a few rounds of review, we can try and get this all in shape now, but I think it's pretty much mergeable as is.
Issues I see:
* Double copyright footer.
* What's the plan for the top bar? I assume it'll be static links to other related resources?
* The knowledge base articles have an odd link to the knowledge base section, in the second bar.
* The knowledge base page's nested lists don't look great.
* Licencing:
- We are adding some BSD licensed code that refers to a non-existent LICENCE file.
+ Add such a file, add this to debian/copyright too.
- Adding a new CC-BY-SA copyright holder.
+ Add the copyright holder to debian/copyright.
- I guess our articles should get decent copyright attribution headers at some point, but that's out of the scope for this merge.
* Searching doesn't work, but it didn't seem to work before, either.
- 49. By Alexander Fougner
-
added js docs, added divider to sidebar
- 50. By Alexander Fougner
-
merged dholbach's changes
- 51. By Alexander Fougner
-
removed searchbox in relbar
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Daniel Holbach (dholbach) wrote : | # |
Maybe we should remove all the Javascript bits for now and remove the search bits and file a bug for it, so we can follow up on that later on (and hopefully avoid duplicating jquery bits).
- 52. By Alexander Fougner
-
disable js, remove searchbox, some style fixes
- 53. By Alexander Fougner
-
remove duplicate copyright text, some styling
- 54. By Alexander Fougner
-
removed all unchanged templates, inherits from basic theme instead
- 55. By Alexander Fougner
-
merged dholbach's js removals and fixes
Unmerged revisions
Preview Diff
1 | === added file 'BORROWED-CODE' |
2 | --- BORROWED-CODE 1970-01-01 00:00:00 +0000 |
3 | +++ BORROWED-CODE 2011-07-22 11:22:44 +0000 |
4 | @@ -0,0 +1,7 @@ |
5 | +themes/ubuntu/static/newstyle.css |
6 | +themes/ubuntu/static/images/* |
7 | + From http://loco.ubuntu.com/media/css/newstyle.css |
8 | + http://loco.ubuntu.com/media/images |
9 | + |
10 | +themes/ubuntu/static/light-django-theme.css |
11 | + From lp:ubuntu-community-webthemes/light-django-theme |
12 | |
13 | === modified file 'conf.py' |
14 | --- conf.py 2010-11-19 12:07:36 +0000 |
15 | +++ conf.py 2011-07-22 11:22:44 +0000 |
16 | @@ -101,7 +101,7 @@ |
17 | |
18 | # The theme to use for HTML and HTML Help pages. See the documentation for |
19 | # a list of builtin themes. |
20 | -html_theme = 'default' |
21 | +html_theme = 'ubuntu' |
22 | |
23 | # Theme options are theme-specific and customize the look and feel of a theme |
24 | # further. For a list of options available for each theme, see the |
25 | @@ -109,7 +109,7 @@ |
26 | #html_theme_options = {} |
27 | |
28 | # Add any paths that contain custom themes here, relative to this directory. |
29 | -#html_theme_path = [] |
30 | +html_theme_path = ['themes'] |
31 | |
32 | # The name for this set of Sphinx documents. If None, it defaults to |
33 | # "<project> v<release> documentation". |
34 | |
35 | === modified file 'debian/copyright' |
36 | --- debian/copyright 2011-04-19 08:27:41 +0000 |
37 | +++ debian/copyright 2011-07-22 11:22:44 +0000 |
38 | @@ -341,3 +341,44 @@ |
39 | this trademark restriction does not form part of the License. |
40 | . |
41 | Creative Commons may be contacted at http://creativecommons.org/. |
42 | + |
43 | +Files: themes/ubuntu/static/newstyle.css |
44 | + themes/ubuntu/static/images/* |
45 | +Copyright: 2009-2011 LoCo Directory Hackers <loco-directory-dev@lists.ubuntu.com> |
46 | +License: AGPL-3 |
47 | + This program is free software: you can redistribute it and/or modify |
48 | + it under the terms of the GNU Affero General Public License as published by |
49 | + the Free Software Foundation, either version 3 of the License, or |
50 | + (at your option) any later version. |
51 | + . |
52 | + This program is distributed in the hope that it will be useful, |
53 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
54 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
55 | + GNU Affero General Public License for more details. |
56 | + . |
57 | + You should have received a copy of the GNU Affero General Public License |
58 | + along with this program. If not, see <http://www.gnu.org/licenses/>. |
59 | + |
60 | +Files: themes/ubuntu/static/light-django-theme.css |
61 | +Copyright: Ubuntu Community Web Themes Developers (https://launchpad.net/~ubuntu-community-webthemes) |
62 | +License: GPL-2+ |
63 | + This program is free software; you can redistribute it |
64 | + and/or modify it under the terms of the GNU General Public |
65 | + License as published by the Free Software Foundation; either |
66 | + version 2 of the License, or (at your option) any later |
67 | + version. |
68 | + . |
69 | + This program is distributed in the hope that it will be |
70 | + useful, but WITHOUT ANY WARRANTY; without even the implied |
71 | + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR |
72 | + PURPOSE. See the GNU General Public License for more |
73 | + details. |
74 | + . |
75 | + You should have received a copy of the GNU General Public |
76 | + License along with this package; if not, write to the Free |
77 | + Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
78 | + Boston, MA 02110-1301 USA |
79 | + . |
80 | + On Debian systems, the full text of the GNU General Public |
81 | + License version 2 can be found in the file |
82 | + `/usr/share/common-licenses/GPL-2'. |
83 | |
84 | === added directory 'themes' |
85 | === added directory 'themes/ubuntu' |
86 | === added file 'themes/ubuntu/defindex.html' |
87 | --- themes/ubuntu/defindex.html 1970-01-01 00:00:00 +0000 |
88 | +++ themes/ubuntu/defindex.html 2011-07-22 11:22:44 +0000 |
89 | @@ -0,0 +1,35 @@ |
90 | +{# |
91 | + basic/defindex.html |
92 | + ~~~~~~~~~~~~~~~~~~~ |
93 | + |
94 | + Default template for the "index" page. |
95 | + |
96 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
97 | + :license: BSD, see LICENSE for details. |
98 | +#} |
99 | +{% extends "layout.html" %} |
100 | +{% set title = _('Overview') %} |
101 | +{% block body %} |
102 | + <h1>{{ docstitle|e }}</h1> |
103 | + <p> |
104 | + Welcome! This is |
105 | + {% block description %}the documentation for {{ project|e }} |
106 | + {{ release|e }}{% if last_updated %}, last updated {{ last_updated|e }}{% endif %}{% endblock %}. |
107 | + </p> |
108 | + {% block tables %} |
109 | + <p><strong>{{ _('Indices and tables:') }}</strong></p> |
110 | + <table class="contentstable" align="center"><tr> |
111 | + <td width="50%"> |
112 | + <p class="biglink"><a class="biglink" href="{{ pathto("contents") }}">{{ _('Complete Table of Contents') }}</a><br> |
113 | + <span class="linkdescr">{{ _('lists all sections and subsections') }}</span></p> |
114 | + <p class="biglink"><a class="biglink" href="{{ pathto("search") }}">{{ _('Search Page') }}</a><br> |
115 | + <span class="linkdescr">{{ _('search this documentation') }}</span></p> |
116 | + </td><td width="50%"> |
117 | + <p class="biglink"><a class="biglink" href="{{ pathto("modindex") }}">{{ _('Global Module Index') }}</a><br> |
118 | + <span class="linkdescr">{{ _('quick access to all modules') }}</span></p> |
119 | + <p class="biglink"><a class="biglink" href="{{ pathto("genindex") }}">{{ _('General Index') }}</a><br> |
120 | + <span class="linkdescr">{{ _('all functions, classes, terms') }}</span></p> |
121 | + </td></tr> |
122 | + </table> |
123 | + {% endblock %} |
124 | +{% endblock %} |
125 | |
126 | === added file 'themes/ubuntu/domainindex.html' |
127 | --- themes/ubuntu/domainindex.html 1970-01-01 00:00:00 +0000 |
128 | +++ themes/ubuntu/domainindex.html 2011-07-22 11:22:44 +0000 |
129 | @@ -0,0 +1,57 @@ |
130 | +{# |
131 | + basic/domainindex.html |
132 | + ~~~~~~~~~~~~~~~~~~~~~~ |
133 | + |
134 | + Template for domain indices (module index, ...). |
135 | + |
136 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
137 | + :license: BSD, see LICENSE for details. |
138 | +#} |
139 | +{% extends "layout.html" %} |
140 | +{% set title = indextitle %} |
141 | +{% block extrahead %} |
142 | +{{ super() }} |
143 | +{% if not embedded and collapse_index %} |
144 | + <script type="text/javascript"> |
145 | + DOCUMENTATION_OPTIONS.COLLAPSE_INDEX = true; |
146 | + </script> |
147 | +{% endif %} |
148 | +{% endblock %} |
149 | +{% block body %} |
150 | + |
151 | + {%- set curr_group = 0 %} |
152 | + |
153 | + <h1>{{ indextitle }}</h1> |
154 | + |
155 | + <div class="modindex-jumpbox"> |
156 | + {%- for (letter, entries) in content %} |
157 | + <a href="#cap-{{ letter }}"><strong>{{ letter }}</strong></a> |
158 | + {%- if not loop.last %} | {% endif %} |
159 | + {%- endfor %} |
160 | + </div> |
161 | + |
162 | + <table class="indextable modindextable" cellspacing="0" cellpadding="2"> |
163 | + {%- for letter, entries in content %} |
164 | + <tr class="pcap"><td></td><td> </td><td></td></tr> |
165 | + <tr class="cap"><td></td><td><a name="cap-{{ letter }}"> |
166 | + <strong>{{ letter }}</strong></a></td><td></td></tr> |
167 | + {%- for (name, grouptype, page, anchor, extra, qualifier, description) |
168 | + in entries %} |
169 | + {%- if grouptype == 1 %}{% set curr_group = curr_group + 1 %}{% endif %} |
170 | + <tr{% if grouptype == 2 %} class="cg-{{ curr_group }}"{% endif %}> |
171 | + <td>{% if grouptype == 1 -%} |
172 | + <img src="{{ pathto('_static/minus.png', 1) }}" id="toggle-{{ curr_group }}" |
173 | + class="toggler" style="display: none" alt="-" /> |
174 | + {%- endif %}</td> |
175 | + <td>{% if grouptype == 2 %} {% endif %} |
176 | + {% if page %}<a href="{{ pathto(page) }}#{{ anchor }}">{% endif -%} |
177 | + <tt class="xref">{{ name|e }}</tt> |
178 | + {%- if page %}</a>{% endif %} |
179 | + {%- if extra %} <em>({{ extra|e }})</em>{% endif -%} |
180 | + </td><td>{% if qualifier %}<strong>{{ qualifier|e }}:</strong>{% endif %} |
181 | + <em>{{ description|e }}</em></td></tr> |
182 | + {%- endfor %} |
183 | + {%- endfor %} |
184 | + </table> |
185 | + |
186 | +{% endblock %} |
187 | |
188 | === added file 'themes/ubuntu/genindex-single.html' |
189 | --- themes/ubuntu/genindex-single.html 1970-01-01 00:00:00 +0000 |
190 | +++ themes/ubuntu/genindex-single.html 2011-07-22 11:22:44 +0000 |
191 | @@ -0,0 +1,48 @@ |
192 | +{# |
193 | + basic/genindex-single.html |
194 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~ |
195 | + |
196 | + Template for a "single" page of a split index. |
197 | + |
198 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
199 | + :license: BSD, see LICENSE for details. |
200 | +#} |
201 | +{% extends "layout.html" %} |
202 | +{% set title = _('Index') %} |
203 | +{% block body %} |
204 | + |
205 | + <h1 id="index">{% trans key=key %}Index – {{ key }}{% endtrans %}</h1> |
206 | + |
207 | +<table width="100%" class="indextable"><tr> |
208 | + {%- for column in entries|slice(2) if column %} |
209 | + <td width="33%" valign="top"><dl> |
210 | + {%- for entryname, (links, subitems) in column %} |
211 | + <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a> |
212 | + {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %} |
213 | + {%- else %}{{ entryname|e }}{% endif %}</dt> |
214 | + {%- if subitems %} |
215 | + <dd><dl> |
216 | + {%- for subentryname, subentrylinks in subitems %} |
217 | + <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a> |
218 | + {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%} |
219 | + </dt> |
220 | + {%- endfor %} |
221 | + </dl></dd> |
222 | + {%- endif -%} |
223 | +{%- endfor %} |
224 | +</dl></td> |
225 | +{%- endfor %} |
226 | +</tr></table> |
227 | + |
228 | +{% endblock %} |
229 | + |
230 | +{% block sidebarrel %} |
231 | + <h4>Index</h4> |
232 | + <p>{% for key, dummy in genindexentries -%} |
233 | + <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a> |
234 | + {% if not loop.last %}| {% endif %} |
235 | + {%- endfor %}</p> |
236 | + |
237 | + <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong></a></p> |
238 | + {{ super() }} |
239 | +{% endblock %} |
240 | |
241 | === added file 'themes/ubuntu/genindex-split.html' |
242 | --- themes/ubuntu/genindex-split.html 1970-01-01 00:00:00 +0000 |
243 | +++ themes/ubuntu/genindex-split.html 2011-07-22 11:22:44 +0000 |
244 | @@ -0,0 +1,41 @@ |
245 | +{# |
246 | + basic/genindex-split.html |
247 | + ~~~~~~~~~~~~~~~~~~~~~~~~~ |
248 | + |
249 | + Template for a "split" index overview page. |
250 | + |
251 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
252 | + :license: BSD, see LICENSE for details. |
253 | +#} |
254 | +{% extends "layout.html" %} |
255 | +{% set title = _('Index') %} |
256 | +{% block body %} |
257 | + |
258 | + <h1 id="index">{{ _('Index') }}</h1> |
259 | + |
260 | + <p>{{ _('Index pages by letter') }}:</p> |
261 | + |
262 | + <div class="genindex-jumpbox"> |
263 | + <p>{% for key, dummy in genindexentries -%} |
264 | + <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a> |
265 | + {% if not loop.last %}| {% endif %} |
266 | + {%- endfor %}</p> |
267 | + |
268 | + <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong> |
269 | + ({{ _('can be huge') }})</a></p> |
270 | + </div> |
271 | + |
272 | +{% endblock %} |
273 | + |
274 | +{% block sidebarrel %} |
275 | +{% if split_index %} |
276 | + <h4>Index</h4> |
277 | + <p>{% for key, dummy in genindexentries -%} |
278 | + <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a> |
279 | + {% if not loop.last %}| {% endif %} |
280 | + {%- endfor %}</p> |
281 | + |
282 | + <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong></a></p> |
283 | +{% endif %} |
284 | + {{ super() }} |
285 | +{% endblock %} |
286 | |
287 | === added file 'themes/ubuntu/genindex.html' |
288 | --- themes/ubuntu/genindex.html 1970-01-01 00:00:00 +0000 |
289 | +++ themes/ubuntu/genindex.html 2011-07-22 11:22:44 +0000 |
290 | @@ -0,0 +1,59 @@ |
291 | +{# |
292 | + basic/genindex.html |
293 | + ~~~~~~~~~~~~~~~~~~~ |
294 | + |
295 | + Template for an "all-in-one" index. |
296 | + |
297 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
298 | + :license: BSD, see LICENSE for details. |
299 | +#} |
300 | +{% extends "layout.html" %} |
301 | +{% set title = _('Index') %} |
302 | +{% block body %} |
303 | + |
304 | + <h1 id="index">{{ _('Index') }}</h1> |
305 | + |
306 | + <div class="genindex-jumpbox"> |
307 | + {% for key, dummy in genindexentries -%} |
308 | + <a href="#{{ key }}"><strong>{{ key }}</strong></a> {% if not loop.last %}| {% endif %} |
309 | + {%- endfor %} |
310 | + </div> |
311 | + |
312 | + {%- for key, entries in genindexentries %} |
313 | +<h2 id="{{ key }}">{{ key }}</h2> |
314 | +<table width="100%" class="indextable genindextable"><tr> |
315 | + {%- for column in entries|slice(2) if column %} |
316 | + <td width="33%" valign="top"><dl> |
317 | + {%- for entryname, (links, subitems) in column %} |
318 | + <dt>{% if links %}<a href="{{ links[0] }}">{{ entryname|e }}</a> |
319 | + {%- for link in links[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor %} |
320 | + {%- else %}{{ entryname|e }}{% endif %}</dt> |
321 | + {%- if subitems %} |
322 | + <dd><dl> |
323 | + {%- for subentryname, subentrylinks in subitems %} |
324 | + <dt><a href="{{ subentrylinks[0] }}">{{ subentryname|e }}</a> |
325 | + {%- for link in subentrylinks[1:] %}, <a href="{{ link }}">[{{ loop.index }}]</a>{% endfor -%} |
326 | + </dt> |
327 | + {%- endfor %} |
328 | + </dl></dd> |
329 | + {%- endif -%} |
330 | +{%- endfor %} |
331 | +</dl></td> |
332 | +{%- endfor %} |
333 | +</tr></table> |
334 | +{% endfor %} |
335 | + |
336 | +{% endblock %} |
337 | + |
338 | +{% block sidebarrel %} |
339 | +{% if split_index %} |
340 | + <h4>{{ _('Index') }}</h4> |
341 | + <p>{% for key, dummy in genindexentries -%} |
342 | + <a href="{{ pathto('genindex-' + key) }}"><strong>{{ key }}</strong></a> |
343 | + {% if not loop.last %}| {% endif %} |
344 | + {%- endfor %}</p> |
345 | + |
346 | + <p><a href="{{ pathto('genindex-all') }}"><strong>{{ _('Full index on one page') }}</strong></a></p> |
347 | +{% endif %} |
348 | + {{ super() }} |
349 | +{% endblock %} |
350 | |
351 | === added file 'themes/ubuntu/globaltoc.html' |
352 | --- themes/ubuntu/globaltoc.html 1970-01-01 00:00:00 +0000 |
353 | +++ themes/ubuntu/globaltoc.html 2011-07-22 11:22:44 +0000 |
354 | @@ -0,0 +1,11 @@ |
355 | +{# |
356 | + basic/globaltoc.html |
357 | + ~~~~~~~~~~~~~~~~~~~~ |
358 | + |
359 | + Sphinx sidebar template: global table of contents. |
360 | + |
361 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
362 | + :license: BSD, see LICENSE for details. |
363 | +#} |
364 | +<h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> |
365 | +{{ toctree() }} |
366 | |
367 | === added file 'themes/ubuntu/layout.html' |
368 | --- themes/ubuntu/layout.html 1970-01-01 00:00:00 +0000 |
369 | +++ themes/ubuntu/layout.html 2011-07-22 11:22:44 +0000 |
370 | @@ -0,0 +1,224 @@ |
371 | +{# |
372 | + ubuntu/layout.html |
373 | + ~~~~~~~~~~~~~~~~~ |
374 | + |
375 | + Ubuntu layout template for Sphinx themes. |
376 | + |
377 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
378 | + :license: BSD, see LICENSE for details. |
379 | +#} |
380 | +{%- block doctype -%} |
381 | +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" |
382 | + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
383 | +{%- endblock %} |
384 | +{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} |
385 | +{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} |
386 | +{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and |
387 | + (sidebars != []) %} |
388 | +{%- set url_root = pathto('', 1) %} |
389 | +{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} |
390 | + |
391 | + |
392 | +{%- macro relbar() %} |
393 | + <aside id="page-related"> |
394 | + <div class="container" id="sub-nav-container" > |
395 | + <nav id="sub-nav"> |
396 | + {%- for rellink in rellinks %} |
397 | + <a class="sub-nav-item" {% if loop.first %}style="margin-right: 10px"{% endif %} |
398 | + href="{{ pathto(rellink[0]) }}" title="{{ rellink[1]|striptags|e }}" |
399 | + {{ accesskey(rellink[2]) }}>{{ rellink[3] }}</a> |
400 | + {%- endfor %} |
401 | + {%- block rootrellink %} |
402 | + <a class="sub-nav-item" href="{{ pathto(master_doc) }}">{{ shorttitle|e }} {{ reldelim1 }}</a> |
403 | + {%- endblock %} |
404 | + {%- for parent in parents %} |
405 | + <a class="sub-nav-item" href="{{ parent.link|e }}" {% if loop.last %}{{ accesskey("U") }}{% endif %}>{{ parent.title }} {{ reldelim1 }}</a> |
406 | + {%- endfor %} |
407 | + {%- block relbaritems %} {% endblock %} |
408 | + </nav> |
409 | + </div> |
410 | +</aside> |
411 | +{%- endmacro %} |
412 | + |
413 | +{%- macro sidebar() %} |
414 | + {%- if render_sidebar %} |
415 | + <div class="sphinxsidebar"> |
416 | + <div class="sphinxsidebarwrapper"> |
417 | + {%- block sidebarlogo %} |
418 | + {%- if logo %} |
419 | + <p class="logo"><a href="{{ pathto(master_doc) }}"> |
420 | + <img class="logo" src="{{ pathto('_static/' + logo, 1) }}" alt="Logo"/> |
421 | + </a></p> |
422 | + {%- endif %} |
423 | + {%- endblock %} |
424 | + {%- if sidebars != None %} |
425 | + {#- new style sidebar: explicitly include/exclude templates #} |
426 | + {%- for sidebartemplate in sidebars %} |
427 | + {%- include sidebartemplate %} |
428 | + {%- endfor %} |
429 | + {%- else %} |
430 | + {#- old style sidebars: using blocks -- should be deprecated #} |
431 | + {%- block sidebartoc %} |
432 | + {%- include "localtoc.html" %} |
433 | + {%- endblock %} |
434 | + {%- block sidebarrel %} |
435 | + {%- include "relations.html" %} |
436 | + {%- endblock %} |
437 | + {%- block sidebarsourcelink %} |
438 | + {%- include "sourcelink.html" %} |
439 | + {%- endblock %} |
440 | + {%- if customsidebar %} |
441 | + {%- include customsidebar %} |
442 | + {%- endif %} |
443 | + {%- block sidebarsearch %} |
444 | + {%- include "searchbox.html" %} |
445 | + {%- endblock %} |
446 | + {%- endif %} |
447 | + </div> |
448 | + </div> |
449 | + {%- endif %} |
450 | +{%- endmacro %} |
451 | + |
452 | +<html xmlns="http://www.w3.org/1999/xhtml"> |
453 | + <head> |
454 | + <meta http-equiv="Content-Type" content="text/html; charset={{ encoding }}" /> |
455 | + {{ metatags }} |
456 | + {%- if not embedded and docstitle %} |
457 | + {%- set titlesuffix = " — "|safe + docstitle|e %} |
458 | + {%- else %} |
459 | + {%- set titlesuffix = "" %} |
460 | + {%- endif %} |
461 | + {%- block htmltitle %} |
462 | + <title>{{ title|striptags|e }}{{ titlesuffix }}</title> |
463 | + {%- endblock %} |
464 | + <link rel="stylesheet" href="{{ pathto('_static/' + style, 1) }}" type="text/css" /> |
465 | + <link rel="stylesheet" href="{{ pathto('_static/pygments.css', 1) }}" type="text/css" /> |
466 | + {%- for cssfile in css_files %} |
467 | + <link rel="stylesheet" href="{{ pathto(cssfile, 1) }}" type="text/css" /> |
468 | + {%- endfor %} |
469 | + {%- if not embedded %} |
470 | + <script type="text/javascript"> |
471 | + var DOCUMENTATION_OPTIONS = { |
472 | + URL_ROOT: '{{ url_root }}', |
473 | + VERSION: '{{ release|e }}', |
474 | + COLLAPSE_INDEX: false, |
475 | + FILE_SUFFIX: '{{ '' if no_search_suffix else file_suffix }}', |
476 | + HAS_SOURCE: {{ has_source|lower }} |
477 | + }; |
478 | + </script> |
479 | + {# %- for scriptfile in script_files %} |
480 | + <script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script> |
481 | + {%- endfor % #} |
482 | + {%- if use_opensearch %} |
483 | + <link rel="search" type="application/opensearchdescription+xml" |
484 | + title="{% trans docstitle=docstitle|e %}Search within {{ docstitle }}{% endtrans %}" |
485 | + href="{{ pathto('_static/opensearch.xml', 1) }}"/> |
486 | + {%- endif %} |
487 | + {%- if favicon %} |
488 | + <link rel="shortcut icon" href="{{ pathto('_static/' + favicon, 1) }}"/> |
489 | + {%- endif %} |
490 | + {%- endif %} |
491 | +{%- block linktags %} |
492 | + {%- if hasdoc('about') %} |
493 | + <link rel="author" title="{{ _('About these documents') }}" href="{{ pathto('about') }}" /> |
494 | + {%- endif %} |
495 | + {%- if hasdoc('genindex') %} |
496 | + <link rel="index" title="{{ _('Index') }}" href="{{ pathto('genindex') }}" /> |
497 | + {%- endif %} |
498 | + {%- if hasdoc('search') %} |
499 | + <link rel="search" title="{{ _('Search') }}" href="{{ pathto('search') }}" /> |
500 | + {%- endif %} |
501 | + {%- if hasdoc('copyright') %} |
502 | + <link rel="copyright" title="{{ _('Copyright') }}" href="{{ pathto('copyright') }}" /> |
503 | + {%- endif %} |
504 | + <link rel="top" title="{{ docstitle|e }}" href="{{ pathto('index') }}" /> |
505 | + {%- if parents %} |
506 | + <link rel="up" title="{{ parents[-1].title|striptags|e }}" href="{{ parents[-1].link|e }}" /> |
507 | + {%- endif %} |
508 | + {%- if next %} |
509 | + <link rel="next" title="{{ next.title|striptags|e }}" href="{{ next.link|e }}" /> |
510 | + {%- endif %} |
511 | + {%- if prev %} |
512 | + <link rel="prev" title="{{ prev.title|striptags|e }}" href="{{ prev.link|e }}" /> |
513 | + {%- endif %} |
514 | +{%- endblock %} |
515 | +{%- block extrahead %} {% endblock %} |
516 | + </head> |
517 | + <body id="home"> |
518 | + |
519 | +<!-- |
520 | +<aside id="top-nav"> |
521 | + <div class="container"> |
522 | + |
523 | + <section id="top-login"> |
524 | + <a class="top-login-item" href="/openid/login?next=/events/" title="Login">Login</a> |
525 | + </section> |
526 | + <nav id="top-related"> |
527 | + <a class="top-nav-item" href="http://www.ubuntu.com">Ubuntu.com</a> |
528 | + <a class="top-nav-item" href="http://www.ubuntu.com/community">Community</a> |
529 | + <a class="top-nav-item" href="http://www.ubuntu.com/support">Support</a> |
530 | + <a class="top-nav-item" href="http://www.ubuntu.com/partners">Partners</a> |
531 | + </nav> |
532 | + </div> |
533 | +</aside> |
534 | +--> |
535 | + |
536 | +<header id="page-header"> |
537 | + <div class="container" > |
538 | + <nav id="main-nav"> |
539 | + <a class="main-nav-item " title="Index" href="index.html">Index</a> |
540 | + </nav> |
541 | + </div> |
542 | +</header> |
543 | + |
544 | +{%- block header %}{% endblock %} |
545 | + |
546 | +{%- block relbar1 %}{{ relbar() }}{% endblock %} |
547 | + |
548 | +{%- block content %} |
549 | + {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} |
550 | + |
551 | + <section id="main-section"> |
552 | + {%- block document %} |
553 | + <div class="container" > |
554 | + {%- if render_sidebar %} |
555 | + <section id="content"> |
556 | + {%- endif %} |
557 | + <div class="body"> |
558 | + {%- block sidebar2 %}{{ sidebar() }}{% endblock %} |
559 | + {% block body %} {% endblock %} |
560 | + <div class="divide"></div> |
561 | + |
562 | + </div> |
563 | + {%- if render_sidebar %} |
564 | + </section> |
565 | + {%- endif %} |
566 | + </div> |
567 | + {%- endblock %} |
568 | + </section> |
569 | +{%- endblock %} |
570 | + |
571 | +{%- block footer %} |
572 | + <footer id="page-footer"> |
573 | + <div class="container"> |
574 | + <div class="copyright"> |
575 | +© 2008-2011 Canonical Ltd., Ubuntu Community. Ubuntu is a registered trademark of Canonical Ltd.<br /> |
576 | +</div> |
577 | + {%- if show_copyright %} |
578 | + {%- if hasdoc('copyright') %} |
579 | + {% trans path=pathto('copyright'), copyright=copyright|e %}© <a href="{{ path }}">Copyright</a> {{ copyright }}.{% endtrans %} |
580 | + {%- else %} |
581 | + {% trans copyright=copyright|e %}© Copyright {{ copyright }}.{% endtrans %} |
582 | + {%- endif %} |
583 | + {%- endif %} |
584 | + {%- if last_updated %} |
585 | + {% trans last_updated=last_updated|e %}Last updated on {{ last_updated }}.{% endtrans %} |
586 | + {%- endif %} |
587 | + {%- if show_sphinx %} |
588 | + {% trans sphinx_version=sphinx_version|e %}Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> {{ sphinx_version }}.{% endtrans %} |
589 | + {%- endif %} |
590 | + </div> |
591 | + </footer> |
592 | +{%- endblock %} |
593 | + </body> |
594 | +</html> |
595 | |
596 | === added file 'themes/ubuntu/localtoc.html' |
597 | --- themes/ubuntu/localtoc.html 1970-01-01 00:00:00 +0000 |
598 | +++ themes/ubuntu/localtoc.html 2011-07-22 11:22:44 +0000 |
599 | @@ -0,0 +1,13 @@ |
600 | +{# |
601 | + basic/localtoc.html |
602 | + ~~~~~~~~~~~~~~~~~~~ |
603 | + |
604 | + Sphinx sidebar template: local table of contents. |
605 | + |
606 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
607 | + :license: BSD, see LICENSE for details. |
608 | +#} |
609 | +{%- if display_toc %} |
610 | + <h3><a href="{{ pathto(master_doc) }}">{{ _('Table Of Contents') }}</a></h3> |
611 | + {{ toc }} |
612 | +{%- endif %} |
613 | |
614 | === added file 'themes/ubuntu/opensearch.xml' |
615 | --- themes/ubuntu/opensearch.xml 1970-01-01 00:00:00 +0000 |
616 | +++ themes/ubuntu/opensearch.xml 2011-07-22 11:22:44 +0000 |
617 | @@ -0,0 +1,10 @@ |
618 | +<?xml version="1.0" encoding="UTF-8"?> |
619 | +<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> |
620 | + <ShortName>{{ project|e }}</ShortName> |
621 | + <Description>{% trans docstitle=docstitle|e %}Search {{ docstitle }}{% endtrans %}</Description> |
622 | + <InputEncoding>utf-8</InputEncoding> |
623 | + <Url type="text/html" method="get" |
624 | + template="{{ use_opensearch }}/{{ pathto('search') }}?q={searchTerms}&check_keywords=yes&area=default"/> |
625 | + <LongName>{{ docstitle|e }}</LongName> |
626 | +{% block extra %} {# Put e.g. an <Image> element here. #} {% endblock %} |
627 | +</OpenSearchDescription> |
628 | |
629 | === added file 'themes/ubuntu/page.html' |
630 | --- themes/ubuntu/page.html 1970-01-01 00:00:00 +0000 |
631 | +++ themes/ubuntu/page.html 2011-07-22 11:22:44 +0000 |
632 | @@ -0,0 +1,13 @@ |
633 | +{# |
634 | + basic/page.html |
635 | + ~~~~~~~~~~~~~~~ |
636 | + |
637 | + Master template for simple pages. |
638 | + |
639 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
640 | + :license: BSD, see LICENSE for details. |
641 | +#} |
642 | +{% extends "layout.html" %} |
643 | +{% block body %} |
644 | + {{ body }} |
645 | +{% endblock %} |
646 | |
647 | === added file 'themes/ubuntu/relations.html' |
648 | --- themes/ubuntu/relations.html 1970-01-01 00:00:00 +0000 |
649 | +++ themes/ubuntu/relations.html 2011-07-22 11:22:44 +0000 |
650 | @@ -0,0 +1,19 @@ |
651 | +{# |
652 | + basic/relations.html |
653 | + ~~~~~~~~~~~~~~~~~~~~ |
654 | + |
655 | + Sphinx sidebar template: relation links. |
656 | + |
657 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
658 | + :license: BSD, see LICENSE for details. |
659 | +#} |
660 | +{%- if prev %} |
661 | + <h4>{{ _('Previous topic') }}</h4> |
662 | + <p class="topless"><a href="{{ prev.link|e }}" |
663 | + title="{{ _('previous chapter') }}">{{ prev.title }}</a></p> |
664 | +{%- endif %} |
665 | +{%- if next %} |
666 | + <h4>{{ _('Next topic') }}</h4> |
667 | + <p class="topless"><a href="{{ next.link|e }}" |
668 | + title="{{ _('next chapter') }}">{{ next.title }}</a></p> |
669 | +{%- endif %} |
670 | |
671 | === added file 'themes/ubuntu/search.html' |
672 | --- themes/ubuntu/search.html 1970-01-01 00:00:00 +0000 |
673 | +++ themes/ubuntu/search.html 2011-07-22 11:22:44 +0000 |
674 | @@ -0,0 +1,56 @@ |
675 | +{# |
676 | + basic/search.html |
677 | + ~~~~~~~~~~~~~~~~~ |
678 | + |
679 | + Template for the search page. |
680 | + |
681 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
682 | + :license: BSD, see LICENSE for details. |
683 | +#} |
684 | +{% extends "layout.html" %} |
685 | +{% set title = _('Search') %} |
686 | +{% set script_files = script_files + ['_static/searchtools.js'] %} |
687 | +{% block extrahead %} |
688 | + <script type="text/javascript"> |
689 | + jQuery(function() { Search.loadIndex("{{ pathto('searchindex.js', 1) }}"); }); |
690 | + </script> |
691 | + {{ super() }} |
692 | +{% endblock %} |
693 | +{% block body %} |
694 | + <h1 id="search-documentation">{{ _('Search') }}</h1> |
695 | + <div id="fallback" class="admonition warning"> |
696 | + <script type="text/javascript">$('#fallback').hide();</script> |
697 | + <p> |
698 | + {% trans %}Please activate JavaScript to enable the search |
699 | + functionality.{% endtrans %} |
700 | + </p> |
701 | + </div> |
702 | + <p> |
703 | + {% trans %}From here you can search these documents. Enter your search |
704 | + words into the box below and click "search". Note that the search |
705 | + function will automatically search for all of the words. Pages |
706 | + containing fewer words won't appear in the result list.{% endtrans %} |
707 | + </p> |
708 | + <form action="" method="get"> |
709 | + <input type="text" name="q" value="" /> |
710 | + <input type="submit" value="{{ _('search') }}" /> |
711 | + <span id="search-progress" style="padding-left: 10px"></span> |
712 | + </form> |
713 | + {% if search_performed %} |
714 | + <h2>{{ _('Search Results') }}</h2> |
715 | + {% if not search_results %} |
716 | + <p>{{ _('Your search did not match any results.') }}</p> |
717 | + {% endif %} |
718 | + {% endif %} |
719 | + <div id="search-results"> |
720 | + {% if search_results %} |
721 | + <ul> |
722 | + {% for href, caption, context in search_results %} |
723 | + <li><a href="{{ pathto(item.href) }}">{{ caption }}</a> |
724 | + <div class="context">{{ context|e }}</div> |
725 | + </li> |
726 | + {% endfor %} |
727 | + </ul> |
728 | + {% endif %} |
729 | + </div> |
730 | +{% endblock %} |
731 | |
732 | === added file 'themes/ubuntu/searchbox.html' |
733 | --- themes/ubuntu/searchbox.html 1970-01-01 00:00:00 +0000 |
734 | +++ themes/ubuntu/searchbox.html 2011-07-22 11:22:44 +0000 |
735 | @@ -0,0 +1,24 @@ |
736 | +{# |
737 | + basic/searchbox.html |
738 | + ~~~~~~~~~~~~~~~~~~~~ |
739 | + |
740 | + Sphinx sidebar template: quick search box. |
741 | + |
742 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
743 | + :license: BSD, see LICENSE for details. |
744 | +#} |
745 | +{%- if pagename != "search" %} |
746 | +<div id="searchbox" style="display: none"> |
747 | + <h4>{{ _('Quick search') }}</h4> |
748 | + <form class="search" action="{{ pathto('search') }}" method="get"> |
749 | + <input type="text" name="q" size="18" /> |
750 | + <input type="submit" value="{{ _('Go') }}" /> |
751 | + <input type="hidden" name="check_keywords" value="yes" /> |
752 | + <input type="hidden" name="area" value="default" /> |
753 | + </form> |
754 | + <p class="searchtip" style="font-size: 90%"> |
755 | + {{ _('Enter search terms or a module, class or function name.') }} |
756 | + </p> |
757 | +</div> |
758 | +<!--<script type="text/javascript">$('#searchbox').show(0);</script>--> |
759 | +{%- endif %} |
760 | |
761 | === added file 'themes/ubuntu/sourcelink.html' |
762 | --- themes/ubuntu/sourcelink.html 1970-01-01 00:00:00 +0000 |
763 | +++ themes/ubuntu/sourcelink.html 2011-07-22 11:22:44 +0000 |
764 | @@ -0,0 +1,16 @@ |
765 | +{# |
766 | + basic/sourcelink.html |
767 | + ~~~~~~~~~~~~~~~~~~~~~ |
768 | + |
769 | + Sphinx sidebar template: "show source" link. |
770 | + |
771 | + :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
772 | + :license: BSD, see LICENSE for details. |
773 | +#} |
774 | +{%- if show_source and has_source and sourcename %} |
775 | + <h3>{{ _('This Page') }}</h3> |
776 | + <ul class="this-page-menu"> |
777 | + <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}" |
778 | + rel="nofollow">{{ _('Show Source') }}</a></li> |
779 | + </ul> |
780 | +{%- endif %} |
781 | |
782 | === added directory 'themes/ubuntu/static' |
783 | === added file 'themes/ubuntu/static/default.css_t' |
784 | --- themes/ubuntu/static/default.css_t 1970-01-01 00:00:00 +0000 |
785 | +++ themes/ubuntu/static/default.css_t 2011-07-22 11:22:44 +0000 |
786 | @@ -0,0 +1,56 @@ |
787 | +/* |
788 | +* License: GPLv2 |
789 | +* Author : Alexander Fougner <fougner89 at gmail dot com> |
790 | +* Source : http://loco.ubuntu.com/media/css/newstyle.css |
791 | +* https://code.launchpad.net/~ubuntu-website-community/ubuntu-website/light-django-theme |
792 | +*/ |
793 | + |
794 | +@import url("light-django-theme.css"); |
795 | +@import url("newstyle.css"); |
796 | + |
797 | +body { |
798 | + background: url("images/dotted.png") repeat scroll 0 0 #FFFFFF; |
799 | +} |
800 | + |
801 | +#page-header { |
802 | + background: url("images/header.png") repeat-x scroll 0 0 #DD4814; |
803 | +} |
804 | + |
805 | +div.sphinxsidebar { |
806 | + float:right; |
807 | + background: #f5f5f5; |
808 | + border: 1px solid #ddd; |
809 | + padding: 15px; |
810 | + margin: 10px; |
811 | + width: 230px; |
812 | +} |
813 | + |
814 | +div.sphinxsidebar ul { |
815 | + margin-left: 10px; |
816 | +} |
817 | + |
818 | +pre { |
819 | + font-family: monospace; |
820 | + border: 1px solid #ddd; |
821 | + background: #f5f5f5; |
822 | + margin: 5px; |
823 | + padding: 5px; |
824 | +} |
825 | + |
826 | +a.headerlink { |
827 | + visibility: hidden; |
828 | +} |
829 | + |
830 | +h1:hover > a.headerlink, |
831 | +h2:hover > a.headerlink, |
832 | +h3:hover > a.headerlink, |
833 | +h4:hover > a.headerlink, |
834 | +h5:hover > a.headerlink, |
835 | +h6:hover > a.headerlink, |
836 | +dt:hover > a.headerlink { |
837 | +visibility: visible; |
838 | +} |
839 | + |
840 | +form.search_form input, #searchbox { |
841 | +height: auto; |
842 | +} |
843 | |
844 | === added file 'themes/ubuntu/static/doctools.js' |
845 | --- themes/ubuntu/static/doctools.js 1970-01-01 00:00:00 +0000 |
846 | +++ themes/ubuntu/static/doctools.js 2011-07-22 11:22:44 +0000 |
847 | @@ -0,0 +1,247 @@ |
848 | +/* |
849 | + * doctools.js |
850 | + * ~~~~~~~~~~~ |
851 | + * |
852 | + * Sphinx JavaScript utilties for all documentation. |
853 | + * |
854 | + * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. |
855 | + * :license: BSD, see LICENSE for details. |
856 | + * |
857 | + */ |
858 | + |
859 | +/** |
860 | + * select a different prefix for underscore |
861 | + */ |
862 | +$u = _.noConflict(); |
863 | + |
864 | +/** |
865 | + * make the code below compatible with browsers without |
866 | + * an installed firebug like debugger |
867 | +if (!window.console || !console.firebug) { |
868 | + var names = ["log", "debug", "info", "warn", "error", "assert", "dir", |
869 | + "dirxml", "group", "groupEnd", "time", "timeEnd", "count", "trace", |
870 | + "profile", "profileEnd"]; |
871 | + window.console = {}; |
872 | + for (var i = 0; i < names.length; ++i) |
873 | + window.console[names[i]] = function() {}; |
874 | +} |
875 | + */ |
876 | + |
877 | +/** |
878 | + * small helper function to urldecode strings |
879 | + */ |
880 | +jQuery.urldecode = function(x) { |
881 | + return decodeURIComponent(x).replace(/\+/g, ' '); |
882 | +} |
883 | + |
884 | +/** |
885 | + * small helper function to urlencode strings |
886 | + */ |
887 | +jQuery.urlencode = encodeURIComponent; |
888 | + |
889 | +/** |
890 | + * This function returns the parsed url parameters of the |
891 | + * current request. Multiple values per key are supported, |
892 | + * it will always return arrays of strings for the value parts. |
893 | + */ |
894 | +jQuery.getQueryParameters = function(s) { |
895 | + if (typeof s == 'undefined') |
896 | + s = document.location.search; |
897 | + var parts = s.substr(s.indexOf('?') + 1).split('&'); |
898 | + var result = {}; |
899 | + for (var i = 0; i < parts.length; i++) { |
900 | + var tmp = parts[i].split('=', 2); |
901 | + var key = jQuery.urldecode(tmp[0]); |
902 | + var value = jQuery.urldecode(tmp[1]); |
903 | + if (key in result) |
904 | + result[key].push(value); |
905 | + else |
906 | + result[key] = [value]; |
907 | + } |
908 | + return result; |
909 | +}; |
910 | + |
911 | +/** |
912 | + * small function to check if an array contains |
913 | + * a given item. |
914 | + */ |
915 | +jQuery.contains = function(arr, item) { |
916 | + for (var i = 0; i < arr.length; i++) { |
917 | + if (arr[i] == item) |
918 | + return true; |
919 | + } |
920 | + return false; |
921 | +}; |
922 | + |
923 | +/** |
924 | + * highlight a given string on a jquery object by wrapping it in |
925 | + * span elements with the given class name. |
926 | + */ |
927 | +jQuery.fn.highlightText = function(text, className) { |
928 | + function highlight(node) { |
929 | + if (node.nodeType == 3) { |
930 | + var val = node.nodeValue; |
931 | + var pos = val.toLowerCase().indexOf(text); |
932 | + if (pos >= 0 && !jQuery(node.parentNode).hasClass(className)) { |
933 | + var span = document.createElement("span"); |
934 | + span.className = className; |
935 | + span.appendChild(document.createTextNode(val.substr(pos, text.length))); |
936 | + node.parentNode.insertBefore(span, node.parentNode.insertBefore( |
937 | + document.createTextNode(val.substr(pos + text.length)), |
938 | + node.nextSibling)); |
939 | + node.nodeValue = val.substr(0, pos); |
940 | + } |
941 | + } |
942 | + else if (!jQuery(node).is("button, select, textarea")) { |
943 | + jQuery.each(node.childNodes, function() { |
944 | + highlight(this); |
945 | + }); |
946 | + } |
947 | + } |
948 | + return this.each(function() { |
949 | + highlight(this); |
950 | + }); |
951 | +}; |
952 | + |
953 | +/** |
954 | + * Small JavaScript module for the documentation. |
955 | + */ |
956 | +var Documentation = { |
957 | + |
958 | + init : function() { |
959 | + this.fixFirefoxAnchorBug(); |
960 | + this.highlightSearchWords(); |
961 | + this.initIndexTable(); |
962 | + }, |
963 | + |
964 | + /** |
965 | + * i18n support |
966 | + */ |
967 | + TRANSLATIONS : {}, |
968 | + PLURAL_EXPR : function(n) { return n == 1 ? 0 : 1; }, |
969 | + LOCALE : 'unknown', |
970 | + |
971 | + // gettext and ngettext don't access this so that the functions |
972 | + // can safely bound to a different name (_ = Documentation.gettext) |
973 | + gettext : function(string) { |
974 | + var translated = Documentation.TRANSLATIONS[string]; |
975 | + if (typeof translated == 'undefined') |
976 | + return string; |
977 | + return (typeof translated == 'string') ? translated : translated[0]; |
978 | + }, |
979 | + |
980 | + ngettext : function(singular, plural, n) { |
981 | + var translated = Documentation.TRANSLATIONS[singular]; |
982 | + if (typeof translated == 'undefined') |
983 | + return (n == 1) ? singular : plural; |
984 | + return translated[Documentation.PLURALEXPR(n)]; |
985 | + }, |
986 | + |
987 | + addTranslations : function(catalog) { |
988 | + for (var key in catalog.messages) |
989 | + this.TRANSLATIONS[key] = catalog.messages[key]; |
990 | + this.PLURAL_EXPR = new Function('n', 'return +(' + catalog.plural_expr + ')'); |
991 | + this.LOCALE = catalog.locale; |
992 | + }, |
993 | + |
994 | + /** |
995 | + * add context elements like header anchor links |
996 | + */ |
997 | + addContextElements : function() { |
998 | + $('div[id] > :header:first').each(function() { |
999 | + $('<a class="headerlink">\u00B6</a>'). |
1000 | + attr('href', '#' + this.id). |
1001 | + attr('title', _('Permalink to this headline')). |
1002 | + appendTo(this); |
1003 | + }); |
1004 | + $('dt[id]').each(function() { |
1005 | + $('<a class="headerlink">\u00B6</a>'). |
1006 | + attr('href', '#' + this.id). |
1007 | + attr('title', _('Permalink to this definition')). |
1008 | + appendTo(this); |
1009 | + }); |
1010 | + }, |
1011 | + |
1012 | + /** |
1013 | + * workaround a firefox stupidity |
1014 | + */ |
1015 | + fixFirefoxAnchorBug : function() { |
1016 | + if (document.location.hash && $.browser.mozilla) |
1017 | + window.setTimeout(function() { |
1018 | + document.location.href += ''; |
1019 | + }, 10); |
1020 | + }, |
1021 | + |
1022 | + /** |
1023 | + * highlight the search words provided in the url in the text |
1024 | + */ |
1025 | + highlightSearchWords : function() { |
1026 | + var params = $.getQueryParameters(); |
1027 | + var terms = (params.highlight) ? params.highlight[0].split(/\s+/) : []; |
1028 | + if (terms.length) { |
1029 | + var body = $('div.body'); |
1030 | + window.setTimeout(function() { |
1031 | + $.each(terms, function() { |
1032 | + body.highlightText(this.toLowerCase(), 'highlighted'); |
1033 | + }); |
1034 | + }, 10); |
1035 | + $('<li class="highlight-link"><a href="javascript:Documentation.' + |
1036 | + 'hideSearchWords()">' + _('Hide Search Matches') + '</a></li>') |
1037 | + .appendTo($('.sidebar .this-page-menu')); |
1038 | + } |
1039 | + }, |
1040 | + |
1041 | + /** |
1042 | + * init the domain index toggle buttons |
1043 | + */ |
1044 | + initIndexTable : function() { |
1045 | + var togglers = $('img.toggler').click(function() { |
1046 | + var src = $(this).attr('src'); |
1047 | + var idnum = $(this).attr('id').substr(7); |
1048 | + $('tr.cg-' + idnum).toggle(); |
1049 | + if (src.substr(-9) == 'minus.png') |
1050 | + $(this).attr('src', src.substr(0, src.length-9) + 'plus.png'); |
1051 | + else |
1052 | + $(this).attr('src', src.substr(0, src.length-8) + 'minus.png'); |
1053 | + }).css('display', ''); |
1054 | + if (DOCUMENTATION_OPTIONS.COLLAPSE_INDEX) { |
1055 | + togglers.click(); |
1056 | + } |
1057 | + }, |
1058 | + |
1059 | + /** |
1060 | + * helper function to hide the search marks again |
1061 | + */ |
1062 | + hideSearchWords : function() { |
1063 | + $('.sidebar .this-page-menu li.highlight-link').fadeOut(300); |
1064 | + $('span.highlighted').removeClass('highlighted'); |
1065 | + }, |
1066 | + |
1067 | + /** |
1068 | + * make the url absolute |
1069 | + */ |
1070 | + makeURL : function(relativeURL) { |
1071 | + return DOCUMENTATION_OPTIONS.URL_ROOT + '/' + relativeURL; |
1072 | + }, |
1073 | + |
1074 | + /** |
1075 | + * get the current relative url |
1076 | + */ |
1077 | + getCurrentURL : function() { |
1078 | + var path = document.location.pathname; |
1079 | + var parts = path.split(/\//); |
1080 | + $.each(DOCUMENTATION_OPTIONS.URL_ROOT.split(/\//), function() { |
1081 | + if (this == '..') |
1082 | + parts.pop(); |
1083 | + }); |
1084 | + var url = parts.join('/'); |
1085 | + return path.substring(url.lastIndexOf('/') + 1, path.length - 1); |
1086 | + } |
1087 | +}; |
1088 | + |
1089 | +// quick alias for translations |
1090 | +_ = Documentation.gettext; |
1091 | + |
1092 | +$(document).ready(function() { |
1093 | + Documentation.init(); |
1094 | +}); |
1095 | |
1096 | === added directory 'themes/ubuntu/static/images' |
1097 | === added file 'themes/ubuntu/static/images/dotted.png' |
1098 | Binary files themes/ubuntu/static/images/dotted.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/images/dotted.png 2011-07-22 11:22:44 +0000 differ |
1099 | === added file 'themes/ubuntu/static/images/favicon.ico' |
1100 | Binary files themes/ubuntu/static/images/favicon.ico 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/images/favicon.ico 2011-07-22 11:22:44 +0000 differ |
1101 | === added file 'themes/ubuntu/static/images/footer.png' |
1102 | Binary files themes/ubuntu/static/images/footer.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/images/footer.png 2011-07-22 11:22:44 +0000 differ |
1103 | === added file 'themes/ubuntu/static/images/header.png' |
1104 | Binary files themes/ubuntu/static/images/header.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/images/header.png 2011-07-22 11:22:44 +0000 differ |
1105 | === added file 'themes/ubuntu/static/images/search.png' |
1106 | Binary files themes/ubuntu/static/images/search.png 1970-01-01 00:00:00 +0000 and themes/ubuntu/static/images/search.png 2011-07-22 11:22:44 +0000 differ |
1107 | === added file 'themes/ubuntu/static/jquery.js' |
1108 | --- themes/ubuntu/static/jquery.js 1970-01-01 00:00:00 +0000 |
1109 | +++ themes/ubuntu/static/jquery.js 2011-07-22 11:22:44 +0000 |
1110 | @@ -0,0 +1,8176 @@ |
1111 | +/*! |
1112 | + * jQuery JavaScript Library v1.5 |
1113 | + * http://jquery.com/ |
1114 | + * |
1115 | + * Copyright 2011, John Resig |
1116 | + * Dual licensed under the MIT or GPL Version 2 licenses. |
1117 | + * http://jquery.org/license |
1118 | + * |
1119 | + * Includes Sizzle.js |
1120 | + * http://sizzlejs.com/ |
1121 | + * Copyright 2011, The Dojo Foundation |
1122 | + * Released under the MIT, BSD, and GPL Licenses. |
1123 | + * |
1124 | + * Date: Mon Jan 31 08:31:29 2011 -0500 |
1125 | + */ |
1126 | +(function( window, undefined ) { |
1127 | + |
1128 | +// Use the correct document accordingly with window argument (sandbox) |
1129 | +var document = window.document; |
1130 | +var jQuery = (function() { |
1131 | + |
1132 | +// Define a local copy of jQuery |
1133 | +var jQuery = function( selector, context ) { |
1134 | + // The jQuery object is actually just the init constructor 'enhanced' |
1135 | + return new jQuery.fn.init( selector, context, rootjQuery ); |
1136 | + }, |
1137 | + |
1138 | + // Map over jQuery in case of overwrite |
1139 | + _jQuery = window.jQuery, |
1140 | + |
1141 | + // Map over the $ in case of overwrite |
1142 | + _$ = window.$, |
1143 | + |
1144 | + // A central reference to the root jQuery(document) |
1145 | + rootjQuery, |
1146 | + |
1147 | + // A simple way to check for HTML strings or ID strings |
1148 | + // (both of which we optimize for) |
1149 | + quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/, |
1150 | + |
1151 | + // Check if a string has a non-whitespace character in it |
1152 | + rnotwhite = /\S/, |
1153 | + |
1154 | + // Used for trimming whitespace |
1155 | + trimLeft = /^\s+/, |
1156 | + trimRight = /\s+$/, |
1157 | + |
1158 | + // Check for digits |
1159 | + rdigit = /\d/, |
1160 | + |
1161 | + // Match a standalone tag |
1162 | + rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/, |
1163 | + |
1164 | + // JSON RegExp |
1165 | + rvalidchars = /^[\],:{}\s]*$/, |
1166 | + rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, |
1167 | + rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, |
1168 | + rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g, |
1169 | + |
1170 | + // Useragent RegExp |
1171 | + rwebkit = /(webkit)[ \/]([\w.]+)/, |
1172 | + ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/, |
1173 | + rmsie = /(msie) ([\w.]+)/, |
1174 | + rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/, |
1175 | + |
1176 | + // Keep a UserAgent string for use with jQuery.browser |
1177 | + userAgent = navigator.userAgent, |
1178 | + |
1179 | + // For matching the engine and version of the browser |
1180 | + browserMatch, |
1181 | + |
1182 | + // Has the ready events already been bound? |
1183 | + readyBound = false, |
1184 | + |
1185 | + // The deferred used on DOM ready |
1186 | + readyList, |
1187 | + |
1188 | + // Promise methods |
1189 | + promiseMethods = "then done fail isResolved isRejected promise".split( " " ), |
1190 | + |
1191 | + // The ready event handler |
1192 | + DOMContentLoaded, |
1193 | + |
1194 | + // Save a reference to some core methods |
1195 | + toString = Object.prototype.toString, |
1196 | + hasOwn = Object.prototype.hasOwnProperty, |
1197 | + push = Array.prototype.push, |
1198 | + slice = Array.prototype.slice, |
1199 | + trim = String.prototype.trim, |
1200 | + indexOf = Array.prototype.indexOf, |
1201 | + |
1202 | + // [[Class]] -> type pairs |
1203 | + class2type = {}; |
1204 | + |
1205 | +jQuery.fn = jQuery.prototype = { |
1206 | + constructor: jQuery, |
1207 | + init: function( selector, context, rootjQuery ) { |
1208 | + var match, elem, ret, doc; |
1209 | + |
1210 | + // Handle $(""), $(null), or $(undefined) |
1211 | + if ( !selector ) { |
1212 | + return this; |
1213 | + } |
1214 | + |
1215 | + // Handle $(DOMElement) |
1216 | + if ( selector.nodeType ) { |
1217 | + this.context = this[0] = selector; |
1218 | + this.length = 1; |
1219 | + return this; |
1220 | + } |
1221 | + |
1222 | + // The body element only exists once, optimize finding it |
1223 | + if ( selector === "body" && !context && document.body ) { |
1224 | + this.context = document; |
1225 | + this[0] = document.body; |
1226 | + this.selector = "body"; |
1227 | + this.length = 1; |
1228 | + return this; |
1229 | + } |
1230 | + |
1231 | + // Handle HTML strings |
1232 | + if ( typeof selector === "string" ) { |
1233 | + // Are we dealing with HTML string or an ID? |
1234 | + match = quickExpr.exec( selector ); |
1235 | + |
1236 | + // Verify a match, and that no context was specified for #id |
1237 | + if ( match && (match[1] || !context) ) { |
1238 | + |
1239 | + // HANDLE: $(html) -> $(array) |
1240 | + if ( match[1] ) { |
1241 | + context = context instanceof jQuery ? context[0] : context; |
1242 | + doc = (context ? context.ownerDocument || context : document); |
1243 | + |
1244 | + // If a single string is passed in and it's a single tag |
1245 | + // just do a createElement and skip the rest |
1246 | + ret = rsingleTag.exec( selector ); |
1247 | + |
1248 | + if ( ret ) { |
1249 | + if ( jQuery.isPlainObject( context ) ) { |
1250 | + selector = [ document.createElement( ret[1] ) ]; |
1251 | + jQuery.fn.attr.call( selector, context, true ); |
1252 | + |
1253 | + } else { |
1254 | + selector = [ doc.createElement( ret[1] ) ]; |
1255 | + } |
1256 | + |
1257 | + } else { |
1258 | + ret = jQuery.buildFragment( [ match[1] ], [ doc ] ); |
1259 | + selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes; |
1260 | + } |
1261 | + |
1262 | + return jQuery.merge( this, selector ); |
1263 | + |
1264 | + // HANDLE: $("#id") |
1265 | + } else { |
1266 | + elem = document.getElementById( match[2] ); |
1267 | + |
1268 | + // Check parentNode to catch when Blackberry 4.6 returns |
1269 | + // nodes that are no longer in the document #6963 |
1270 | + if ( elem && elem.parentNode ) { |
1271 | + // Handle the case where IE and Opera return items |
1272 | + // by name instead of ID |
1273 | + if ( elem.id !== match[2] ) { |
1274 | + return rootjQuery.find( selector ); |
1275 | + } |
1276 | + |
1277 | + // Otherwise, we inject the element directly into the jQuery object |
1278 | + this.length = 1; |
1279 | + this[0] = elem; |
1280 | + } |
1281 | + |
1282 | + this.context = document; |
1283 | + this.selector = selector; |
1284 | + return this; |
1285 | + } |
1286 | + |
1287 | + // HANDLE: $(expr, $(...)) |
1288 | + } else if ( !context || context.jquery ) { |
1289 | + return (context || rootjQuery).find( selector ); |
1290 | + |
1291 | + // HANDLE: $(expr, context) |
1292 | + // (which is just equivalent to: $(context).find(expr) |
1293 | + } else { |
1294 | + return this.constructor( context ).find( selector ); |
1295 | + } |
1296 | + |
1297 | + // HANDLE: $(function) |
1298 | + // Shortcut for document ready |
1299 | + } else if ( jQuery.isFunction( selector ) ) { |
1300 | + return rootjQuery.ready( selector ); |
1301 | + } |
1302 | + |
1303 | + if (selector.selector !== undefined) { |
1304 | + this.selector = selector.selector; |
1305 | + this.context = selector.context; |
1306 | + } |
1307 | + |
1308 | + return jQuery.makeArray( selector, this ); |
1309 | + }, |
1310 | + |
1311 | + // Start with an empty selector |
1312 | + selector: "", |
1313 | + |
1314 | + // The current version of jQuery being used |
1315 | + jquery: "1.5", |
1316 | + |
1317 | + // The default length of a jQuery object is 0 |
1318 | + length: 0, |
1319 | + |
1320 | + // The number of elements contained in the matched element set |
1321 | + size: function() { |
1322 | + return this.length; |
1323 | + }, |
1324 | + |
1325 | + toArray: function() { |
1326 | + return slice.call( this, 0 ); |
1327 | + }, |
1328 | + |
1329 | + // Get the Nth element in the matched element set OR |
1330 | + // Get the whole matched element set as a clean array |
1331 | + get: function( num ) { |
1332 | + return num == null ? |
1333 | + |
1334 | + // Return a 'clean' array |
1335 | + this.toArray() : |
1336 | + |
1337 | + // Return just the object |
1338 | + ( num < 0 ? this[ this.length + num ] : this[ num ] ); |
1339 | + }, |
1340 | + |
1341 | + // Take an array of elements and push it onto the stack |
1342 | + // (returning the new matched element set) |
1343 | + pushStack: function( elems, name, selector ) { |
1344 | + // Build a new jQuery matched element set |
1345 | + var ret = this.constructor(); |
1346 | + |
1347 | + if ( jQuery.isArray( elems ) ) { |
1348 | + push.apply( ret, elems ); |
1349 | + |
1350 | + } else { |
1351 | + jQuery.merge( ret, elems ); |
1352 | + } |
1353 | + |
1354 | + // Add the old object onto the stack (as a reference) |
1355 | + ret.prevObject = this; |
1356 | + |
1357 | + ret.context = this.context; |
1358 | + |
1359 | + if ( name === "find" ) { |
1360 | + ret.selector = this.selector + (this.selector ? " " : "") + selector; |
1361 | + } else if ( name ) { |
1362 | + ret.selector = this.selector + "." + name + "(" + selector + ")"; |
1363 | + } |
1364 | + |
1365 | + // Return the newly-formed element set |
1366 | + return ret; |
1367 | + }, |
1368 | + |
1369 | + // Execute a callback for every element in the matched set. |
1370 | + // (You can seed the arguments with an array of args, but this is |
1371 | + // only used internally.) |
1372 | + each: function( callback, args ) { |
1373 | + return jQuery.each( this, callback, args ); |
1374 | + }, |
1375 | + |
1376 | + ready: function( fn ) { |
1377 | + // Attach the listeners |
1378 | + jQuery.bindReady(); |
1379 | + |
1380 | + // Add the callback |
1381 | + readyList.done( fn ); |
1382 | + |
1383 | + return this; |
1384 | + }, |
1385 | + |
1386 | + eq: function( i ) { |
1387 | + return i === -1 ? |
1388 | + this.slice( i ) : |
1389 | + this.slice( i, +i + 1 ); |
1390 | + }, |
1391 | + |
1392 | + first: function() { |
1393 | + return this.eq( 0 ); |
1394 | + }, |
1395 | + |
1396 | + last: function() { |
1397 | + return this.eq( -1 ); |
1398 | + }, |
1399 | + |
1400 | + slice: function() { |
1401 | + return this.pushStack( slice.apply( this, arguments ), |
1402 | + "slice", slice.call(arguments).join(",") ); |
1403 | + }, |
1404 | + |
1405 | + map: function( callback ) { |
1406 | + return this.pushStack( jQuery.map(this, function( elem, i ) { |
1407 | + return callback.call( elem, i, elem ); |
1408 | + })); |
1409 | + }, |
1410 | + |
1411 | + end: function() { |
1412 | + return this.prevObject || this.constructor(null); |
1413 | + }, |
1414 | + |
1415 | + // For internal use only. |
1416 | + // Behaves like an Array's method, not like a jQuery method. |
1417 | + push: push, |
1418 | + sort: [].sort, |
1419 | + splice: [].splice |
1420 | +}; |
1421 | + |
1422 | +// Give the init function the jQuery prototype for later instantiation |
1423 | +jQuery.fn.init.prototype = jQuery.fn; |
1424 | + |
1425 | +jQuery.extend = jQuery.fn.extend = function() { |
1426 | + var options, name, src, copy, copyIsArray, clone, |
1427 | + target = arguments[0] || {}, |
1428 | + i = 1, |
1429 | + length = arguments.length, |
1430 | + deep = false; |
1431 | + |
1432 | + // Handle a deep copy situation |
1433 | + if ( typeof target === "boolean" ) { |
1434 | + deep = target; |
1435 | + target = arguments[1] || {}; |
1436 | + // skip the boolean and the target |
1437 | + i = 2; |
1438 | + } |
1439 | + |
1440 | + // Handle case when target is a string or something (possible in deep copy) |
1441 | + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { |
1442 | + target = {}; |
1443 | + } |
1444 | + |
1445 | + // extend jQuery itself if only one argument is passed |
1446 | + if ( length === i ) { |
1447 | + target = this; |
1448 | + --i; |
1449 | + } |
1450 | + |
1451 | + for ( ; i < length; i++ ) { |
1452 | + // Only deal with non-null/undefined values |
1453 | + if ( (options = arguments[ i ]) != null ) { |
1454 | + // Extend the base object |
1455 | + for ( name in options ) { |
1456 | + src = target[ name ]; |
1457 | + copy = options[ name ]; |
1458 | + |
1459 | + // Prevent never-ending loop |
1460 | + if ( target === copy ) { |
1461 | + continue; |
1462 | + } |
1463 | + |
1464 | + // Recurse if we're merging plain objects or arrays |
1465 | + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { |
1466 | + if ( copyIsArray ) { |
1467 | + copyIsArray = false; |
1468 | + clone = src && jQuery.isArray(src) ? src : []; |
1469 | + |
1470 | + } else { |
1471 | + clone = src && jQuery.isPlainObject(src) ? src : {}; |
1472 | + } |
1473 | + |
1474 | + // Never move original objects, clone them |
1475 | + target[ name ] = jQuery.extend( deep, clone, copy ); |
1476 | + |
1477 | + // Don't bring in undefined values |
1478 | + } else if ( copy !== undefined ) { |
1479 | + target[ name ] = copy; |
1480 | + } |
1481 | + } |
1482 | + } |
1483 | + } |
1484 | + |
1485 | + // Return the modified object |
1486 | + return target; |
1487 | +}; |
1488 | + |
1489 | +jQuery.extend({ |
1490 | + noConflict: function( deep ) { |
1491 | + window.$ = _$; |
1492 | + |
1493 | + if ( deep ) { |
1494 | + window.jQuery = _jQuery; |
1495 | + } |
1496 | + |
1497 | + return jQuery; |
1498 | + }, |
1499 | + |
1500 | + // Is the DOM ready to be used? Set to true once it occurs. |
1501 | + isReady: false, |
1502 | + |
1503 | + // A counter to track how many items to wait for before |
1504 | + // the ready event fires. See #6781 |
1505 | + readyWait: 1, |
1506 | + |
1507 | + // Handle when the DOM is ready |
1508 | + ready: function( wait ) { |
1509 | + // A third-party is pushing the ready event forwards |
1510 | + if ( wait === true ) { |
1511 | + jQuery.readyWait--; |
1512 | + } |
1513 | + |
1514 | + // Make sure that the DOM is not already loaded |
1515 | + if ( !jQuery.readyWait || (wait !== true && !jQuery.isReady) ) { |
1516 | + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). |
1517 | + if ( !document.body ) { |
1518 | + return setTimeout( jQuery.ready, 1 ); |
1519 | + } |
1520 | + |
1521 | + // Remember that the DOM is ready |
1522 | + jQuery.isReady = true; |
1523 | + |
1524 | + // If a normal DOM Ready event fired, decrement, and wait if need be |
1525 | + if ( wait !== true && --jQuery.readyWait > 0 ) { |
1526 | + return; |
1527 | + } |
1528 | + |
1529 | + // If there are functions bound, to execute |
1530 | + readyList.resolveWith( document, [ jQuery ] ); |
1531 | + |
1532 | + // Trigger any bound ready events |
1533 | + if ( jQuery.fn.trigger ) { |
1534 | + jQuery( document ).trigger( "ready" ).unbind( "ready" ); |
1535 | + } |
1536 | + } |
1537 | + }, |
1538 | + |
1539 | + bindReady: function() { |
1540 | + if ( readyBound ) { |
1541 | + return; |
1542 | + } |
1543 | + |
1544 | + readyBound = true; |
1545 | + |
1546 | + // Catch cases where $(document).ready() is called after the |
1547 | + // browser event has already occurred. |
1548 | + if ( document.readyState === "complete" ) { |
1549 | + // Handle it asynchronously to allow scripts the opportunity to delay ready |
1550 | + return setTimeout( jQuery.ready, 1 ); |
1551 | + } |
1552 | + |
1553 | + // Mozilla, Opera and webkit nightlies currently support this event |
1554 | + if ( document.addEventListener ) { |
1555 | + // Use the handy event callback |
1556 | + document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false ); |
1557 | + |
1558 | + // A fallback to window.onload, that will always work |
1559 | + window.addEventListener( "load", jQuery.ready, false ); |
1560 | + |
1561 | + // If IE event model is used |
1562 | + } else if ( document.attachEvent ) { |
1563 | + // ensure firing before onload, |
1564 | + // maybe late but safe also for iframes |
1565 | + document.attachEvent("onreadystatechange", DOMContentLoaded); |
1566 | + |
1567 | + // A fallback to window.onload, that will always work |
1568 | + window.attachEvent( "onload", jQuery.ready ); |
1569 | + |
1570 | + // If IE and not a frame |
1571 | + // continually check to see if the document is ready |
1572 | + var toplevel = false; |
1573 | + |
1574 | + try { |
1575 | + toplevel = window.frameElement == null; |
1576 | + } catch(e) {} |
1577 | + |
1578 | + if ( document.documentElement.doScroll && toplevel ) { |
1579 | + doScrollCheck(); |
1580 | + } |
1581 | + } |
1582 | + }, |
1583 | + |
1584 | + // See test/unit/core.js for details concerning isFunction. |
1585 | + // Since version 1.3, DOM methods and functions like alert |
1586 | + // aren't supported. They return false on IE (#2968). |
1587 | + isFunction: function( obj ) { |
1588 | + return jQuery.type(obj) === "function"; |
1589 | + }, |
1590 | + |
1591 | + isArray: Array.isArray || function( obj ) { |
1592 | + return jQuery.type(obj) === "array"; |
1593 | + }, |
1594 | + |
1595 | + // A crude way of determining if an object is a window |
1596 | + isWindow: function( obj ) { |
1597 | + return obj && typeof obj === "object" && "setInterval" in obj; |
1598 | + }, |
1599 | + |
1600 | + isNaN: function( obj ) { |
1601 | + return obj == null || !rdigit.test( obj ) || isNaN( obj ); |
1602 | + }, |
1603 | + |
1604 | + type: function( obj ) { |
1605 | + return obj == null ? |
1606 | + String( obj ) : |
1607 | + class2type[ toString.call(obj) ] || "object"; |
1608 | + }, |
1609 | + |
1610 | + isPlainObject: function( obj ) { |
1611 | + // Must be an Object. |
1612 | + // Because of IE, we also have to check the presence of the constructor property. |
1613 | + // Make sure that DOM nodes and window objects don't pass through, as well |
1614 | + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { |
1615 | + return false; |
1616 | + } |
1617 | + |
1618 | + // Not own constructor property must be Object |
1619 | + if ( obj.constructor && |
1620 | + !hasOwn.call(obj, "constructor") && |
1621 | + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { |
1622 | + return false; |
1623 | + } |
1624 | + |
1625 | + // Own properties are enumerated firstly, so to speed up, |
1626 | + // if last one is own, then all properties are own. |
1627 | + |
1628 | + var key; |
1629 | + for ( key in obj ) {} |
1630 | + |
1631 | + return key === undefined || hasOwn.call( obj, key ); |
1632 | + }, |
1633 | + |
1634 | + isEmptyObject: function( obj ) { |
1635 | + for ( var name in obj ) { |
1636 | + return false; |
1637 | + } |
1638 | + return true; |
1639 | + }, |
1640 | + |
1641 | + error: function( msg ) { |
1642 | + throw msg; |
1643 | + }, |
1644 | + |
1645 | + parseJSON: function( data ) { |
1646 | + if ( typeof data !== "string" || !data ) { |
1647 | + return null; |
1648 | + } |
1649 | + |
1650 | + // Make sure leading/trailing whitespace is removed (IE can't handle it) |
1651 | + data = jQuery.trim( data ); |
1652 | + |
1653 | + // Make sure the incoming data is actual JSON |
1654 | + // Logic borrowed from http://json.org/json2.js |
1655 | + if ( rvalidchars.test(data.replace(rvalidescape, "@") |
1656 | + .replace(rvalidtokens, "]") |
1657 | + .replace(rvalidbraces, "")) ) { |
1658 | + |
1659 | + // Try to use the native JSON parser first |
1660 | + return window.JSON && window.JSON.parse ? |
1661 | + window.JSON.parse( data ) : |
1662 | + (new Function("return " + data))(); |
1663 | + |
1664 | + } else { |
1665 | + jQuery.error( "Invalid JSON: " + data ); |
1666 | + } |
1667 | + }, |
1668 | + |
1669 | + // Cross-browser xml parsing |
1670 | + // (xml & tmp used internally) |
1671 | + parseXML: function( data , xml , tmp ) { |
1672 | + |
1673 | + if ( window.DOMParser ) { // Standard |
1674 | + tmp = new DOMParser(); |
1675 | + xml = tmp.parseFromString( data , "text/xml" ); |
1676 | + } else { // IE |
1677 | + xml = new ActiveXObject( "Microsoft.XMLDOM" ); |
1678 | + xml.async = "false"; |
1679 | + xml.loadXML( data ); |
1680 | + } |
1681 | + |
1682 | + tmp = xml.documentElement; |
1683 | + |
1684 | + if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) { |
1685 | + jQuery.error( "Invalid XML: " + data ); |
1686 | + } |
1687 | + |
1688 | + return xml; |
1689 | + }, |
1690 | + |
1691 | + noop: function() {}, |
1692 | + |
1693 | + // Evalulates a script in a global context |
1694 | + globalEval: function( data ) { |
1695 | + if ( data && rnotwhite.test(data) ) { |
1696 | + // Inspired by code by Andrea Giammarchi |
1697 | + // http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html |
1698 | + var head = document.getElementsByTagName("head")[0] || document.documentElement, |
1699 | + script = document.createElement("script"); |
1700 | + |
1701 | + script.type = "text/javascript"; |
1702 | + |
1703 | + if ( jQuery.support.scriptEval() ) { |
1704 | + script.appendChild( document.createTextNode( data ) ); |
1705 | + } else { |
1706 | + script.text = data; |
1707 | + } |
1708 | + |
1709 | + // Use insertBefore instead of appendChild to circumvent an IE6 bug. |
1710 | + // This arises when a base node is used (#2709). |
1711 | + head.insertBefore( script, head.firstChild ); |
1712 | + head.removeChild( script ); |
1713 | + } |
1714 | + }, |
1715 | + |
1716 | + nodeName: function( elem, name ) { |
1717 | + return elem.nodeName && elem.nodeName.toUpperCase() === name.toUpperCase(); |
1718 | + }, |
1719 | + |
1720 | + // args is for internal usage only |
1721 | + each: function( object, callback, args ) { |
1722 | + var name, i = 0, |
1723 | + length = object.length, |
1724 | + isObj = length === undefined || jQuery.isFunction(object); |
1725 | + |
1726 | + if ( args ) { |
1727 | + if ( isObj ) { |
1728 | + for ( name in object ) { |
1729 | + if ( callback.apply( object[ name ], args ) === false ) { |
1730 | + break; |
1731 | + } |
1732 | + } |
1733 | + } else { |
1734 | + for ( ; i < length; ) { |
1735 | + if ( callback.apply( object[ i++ ], args ) === false ) { |
1736 | + break; |
1737 | + } |
1738 | + } |
1739 | + } |
1740 | + |
1741 | + // A special, fast, case for the most common use of each |
1742 | + } else { |
1743 | + if ( isObj ) { |
1744 | + for ( name in object ) { |
1745 | + if ( callback.call( object[ name ], name, object[ name ] ) === false ) { |
1746 | + break; |
1747 | + } |
1748 | + } |
1749 | + } else { |
1750 | + for ( var value = object[0]; |
1751 | + i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {} |
1752 | + } |
1753 | + } |
1754 | + |
1755 | + return object; |
1756 | + }, |
1757 | + |
1758 | + // Use native String.trim function wherever possible |
1759 | + trim: trim ? |
1760 | + function( text ) { |
1761 | + return text == null ? |
1762 | + "" : |
1763 | + trim.call( text ); |
1764 | + } : |
1765 | + |
1766 | + // Otherwise use our own trimming functionality |
1767 | + function( text ) { |
1768 | + return text == null ? |
1769 | + "" : |
1770 | + text.toString().replace( trimLeft, "" ).replace( trimRight, "" ); |
1771 | + }, |
1772 | + |
1773 | + // results is for internal usage only |
1774 | + makeArray: function( array, results ) { |
1775 | + var ret = results || []; |
1776 | + |
1777 | + if ( array != null ) { |
1778 | + // The window, strings (and functions) also have 'length' |
1779 | + // The extra typeof function check is to prevent crashes |
1780 | + // in Safari 2 (See: #3039) |
1781 | + // Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930 |
1782 | + var type = jQuery.type(array); |
1783 | + |
1784 | + if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) { |
1785 | + push.call( ret, array ); |
1786 | + } else { |
1787 | + jQuery.merge( ret, array ); |
1788 | + } |
1789 | + } |
1790 | + |
1791 | + return ret; |
1792 | + }, |
1793 | + |
1794 | + inArray: function( elem, array ) { |
1795 | + if ( array.indexOf ) { |
1796 | + return array.indexOf( elem ); |
1797 | + } |
1798 | + |
1799 | + for ( var i = 0, length = array.length; i < length; i++ ) { |
1800 | + if ( array[ i ] === elem ) { |
1801 | + return i; |
1802 | + } |
1803 | + } |
1804 | + |
1805 | + return -1; |
1806 | + }, |
1807 | + |
1808 | + merge: function( first, second ) { |
1809 | + var i = first.length, |
1810 | + j = 0; |
1811 | + |
1812 | + if ( typeof second.length === "number" ) { |
1813 | + for ( var l = second.length; j < l; j++ ) { |
1814 | + first[ i++ ] = second[ j ]; |
1815 | + } |
1816 | + |
1817 | + } else { |
1818 | + while ( second[j] !== undefined ) { |
1819 | + first[ i++ ] = second[ j++ ]; |
1820 | + } |
1821 | + } |
1822 | + |
1823 | + first.length = i; |
1824 | + |
1825 | + return first; |
1826 | + }, |
1827 | + |
1828 | + grep: function( elems, callback, inv ) { |
1829 | + var ret = [], retVal; |
1830 | + inv = !!inv; |
1831 | + |
1832 | + // Go through the array, only saving the items |
1833 | + // that pass the validator function |
1834 | + for ( var i = 0, length = elems.length; i < length; i++ ) { |
1835 | + retVal = !!callback( elems[ i ], i ); |
1836 | + if ( inv !== retVal ) { |
1837 | + ret.push( elems[ i ] ); |
1838 | + } |
1839 | + } |
1840 | + |
1841 | + return ret; |
1842 | + }, |
1843 | + |
1844 | + // arg is for internal usage only |
1845 | + map: function( elems, callback, arg ) { |
1846 | + var ret = [], value; |
1847 | + |
1848 | + // Go through the array, translating each of the items to their |
1849 | + // new value (or values). |
1850 | + for ( var i = 0, length = elems.length; i < length; i++ ) { |
1851 | + value = callback( elems[ i ], i, arg ); |
1852 | + |
1853 | + if ( value != null ) { |
1854 | + ret[ ret.length ] = value; |
1855 | + } |
1856 | + } |
1857 | + |
1858 | + // Flatten any nested arrays |
1859 | + return ret.concat.apply( [], ret ); |
1860 | + }, |
1861 | + |
1862 | + // A global GUID counter for objects |
1863 | + guid: 1, |
1864 | + |
1865 | + proxy: function( fn, proxy, thisObject ) { |
1866 | + if ( arguments.length === 2 ) { |
1867 | + if ( typeof proxy === "string" ) { |
1868 | + thisObject = fn; |
1869 | + fn = thisObject[ proxy ]; |
1870 | + proxy = undefined; |
1871 | + |
1872 | + } else if ( proxy && !jQuery.isFunction( proxy ) ) { |
1873 | + thisObject = proxy; |
1874 | + proxy = undefined; |
1875 | + } |
1876 | + } |
1877 | + |
1878 | + if ( !proxy && fn ) { |
1879 | + proxy = function() { |
1880 | + return fn.apply( thisObject || this, arguments ); |
1881 | + }; |
1882 | + } |
1883 | + |
1884 | + // Set the guid of unique handler to the same of original handler, so it can be removed |
1885 | + if ( fn ) { |
1886 | + proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++; |
1887 | + } |
1888 | + |
1889 | + // So proxy can be declared as an argument |
1890 | + return proxy; |
1891 | + }, |
1892 | + |
1893 | + // Mutifunctional method to get and set values to a collection |
1894 | + // The value/s can be optionally by executed if its a function |
1895 | + access: function( elems, key, value, exec, fn, pass ) { |
1896 | + var length = elems.length; |
1897 | + |
1898 | + // Setting many attributes |
1899 | + if ( typeof key === "object" ) { |
1900 | + for ( var k in key ) { |
1901 | + jQuery.access( elems, k, key[k], exec, fn, value ); |
1902 | + } |
1903 | + return elems; |
1904 | + } |
1905 | + |
1906 | + // Setting one attribute |
1907 | + if ( value !== undefined ) { |
1908 | + // Optionally, function values get executed if exec is true |
1909 | + exec = !pass && exec && jQuery.isFunction(value); |
1910 | + |
1911 | + for ( var i = 0; i < length; i++ ) { |
1912 | + fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass ); |
1913 | + } |
1914 | + |
1915 | + return elems; |
1916 | + } |
1917 | + |
1918 | + // Getting an attribute |
1919 | + return length ? fn( elems[0], key ) : undefined; |
1920 | + }, |
1921 | + |
1922 | + now: function() { |
1923 | + return (new Date()).getTime(); |
1924 | + }, |
1925 | + |
1926 | + // Create a simple deferred (one callbacks list) |
1927 | + _Deferred: function() { |
1928 | + var // callbacks list |
1929 | + callbacks = [], |
1930 | + // stored [ context , args ] |
1931 | + fired, |
1932 | + // to avoid firing when already doing so |
1933 | + firing, |
1934 | + // flag to know if the deferred has been cancelled |
1935 | + cancelled, |
1936 | + // the deferred itself |
1937 | + deferred = { |
1938 | + |
1939 | + // done( f1, f2, ...) |
1940 | + done: function() { |
1941 | + if ( !cancelled ) { |
1942 | + var args = arguments, |
1943 | + i, |
1944 | + length, |
1945 | + elem, |
1946 | + type, |
1947 | + _fired; |
1948 | + if ( fired ) { |
1949 | + _fired = fired; |
1950 | + fired = 0; |
1951 | + } |
1952 | + for ( i = 0, length = args.length; i < length; i++ ) { |
1953 | + elem = args[ i ]; |
1954 | + type = jQuery.type( elem ); |
1955 | + if ( type === "array" ) { |
1956 | + deferred.done.apply( deferred, elem ); |
1957 | + } else if ( type === "function" ) { |
1958 | + callbacks.push( elem ); |
1959 | + } |
1960 | + } |
1961 | + if ( _fired ) { |
1962 | + deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] ); |
1963 | + } |
1964 | + } |
1965 | + return this; |
1966 | + }, |
1967 | + |
1968 | + // resolve with given context and args |
1969 | + resolveWith: function( context, args ) { |
1970 | + if ( !cancelled && !fired && !firing ) { |
1971 | + firing = 1; |
1972 | + try { |
1973 | + while( callbacks[ 0 ] ) { |
1974 | + callbacks.shift().apply( context, args ); |
1975 | + } |
1976 | + } |
1977 | + finally { |
1978 | + fired = [ context, args ]; |
1979 | + firing = 0; |
1980 | + } |
1981 | + } |
1982 | + return this; |
1983 | + }, |
1984 | + |
1985 | + // resolve with this as context and given arguments |
1986 | + resolve: function() { |
1987 | + deferred.resolveWith( jQuery.isFunction( this.promise ) ? this.promise() : this, arguments ); |
1988 | + return this; |
1989 | + }, |
1990 | + |
1991 | + // Has this deferred been resolved? |
1992 | + isResolved: function() { |
1993 | + return !!( firing || fired ); |
1994 | + }, |
1995 | + |
1996 | + // Cancel |
1997 | + cancel: function() { |
1998 | + cancelled = 1; |
1999 | + callbacks = []; |
2000 | + return this; |
2001 | + } |
2002 | + }; |
2003 | + |
2004 | + return deferred; |
2005 | + }, |
2006 | + |
2007 | + // Full fledged deferred (two callbacks list) |
2008 | + Deferred: function( func ) { |
2009 | + var deferred = jQuery._Deferred(), |
2010 | + failDeferred = jQuery._Deferred(), |
2011 | + promise; |
2012 | + // Add errorDeferred methods, then and promise |
2013 | + jQuery.extend( deferred, { |
2014 | + then: function( doneCallbacks, failCallbacks ) { |
2015 | + deferred.done( doneCallbacks ).fail( failCallbacks ); |
2016 | + return this; |
2017 | + }, |
2018 | + fail: failDeferred.done, |
2019 | + rejectWith: failDeferred.resolveWith, |
2020 | + reject: failDeferred.resolve, |
2021 | + isRejected: failDeferred.isResolved, |
2022 | + // Get a promise for this deferred |
2023 | + // If obj is provided, the promise aspect is added to the object |
2024 | + promise: function( obj , i /* internal */ ) { |
2025 | + if ( obj == null ) { |
2026 | + if ( promise ) { |
2027 | + return promise; |
2028 | + } |
2029 | + promise = obj = {}; |
2030 | + } |
2031 | + i = promiseMethods.length; |
2032 | + while( i-- ) { |
2033 | + obj[ promiseMethods[ i ] ] = deferred[ promiseMethods[ i ] ]; |
2034 | + } |
2035 | + return obj; |
2036 | + } |
2037 | + } ); |
2038 | + // Make sure only one callback list will be used |
2039 | + deferred.then( failDeferred.cancel, deferred.cancel ); |
2040 | + // Unexpose cancel |
2041 | + delete deferred.cancel; |
2042 | + // Call given func if any |
2043 | + if ( func ) { |
2044 | + func.call( deferred, deferred ); |
2045 | + } |
2046 | + return deferred; |
2047 | + }, |
2048 | + |
2049 | + // Deferred helper |
2050 | + when: function( object ) { |
2051 | + var args = arguments, |
2052 | + length = args.length, |
2053 | + deferred = length <= 1 && object && jQuery.isFunction( object.promise ) ? |
2054 | + object : |
2055 | + jQuery.Deferred(), |
2056 | + promise = deferred.promise(), |
2057 | + resolveArray; |
2058 | + |
2059 | + if ( length > 1 ) { |
2060 | + resolveArray = new Array( length ); |
2061 | + jQuery.each( args, function( index, element ) { |
2062 | + jQuery.when( element ).then( function( value ) { |
2063 | + resolveArray[ index ] = arguments.length > 1 ? slice.call( arguments, 0 ) : value; |
2064 | + if( ! --length ) { |
2065 | + deferred.resolveWith( promise, resolveArray ); |
2066 | + } |
2067 | + }, deferred.reject ); |
2068 | + } ); |
2069 | + } else if ( deferred !== object ) { |
2070 | + deferred.resolve( object ); |
2071 | + } |
2072 | + return promise; |
2073 | + }, |
2074 | + |
2075 | + // Use of jQuery.browser is frowned upon. |
2076 | + // More details: http://docs.jquery.com/Utilities/jQuery.browser |
2077 | + uaMatch: function( ua ) { |
2078 | + ua = ua.toLowerCase(); |
2079 | + |
2080 | + var match = rwebkit.exec( ua ) || |
2081 | + ropera.exec( ua ) || |
2082 | + rmsie.exec( ua ) || |
2083 | + ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) || |
2084 | + []; |
2085 | + |
2086 | + return { browser: match[1] || "", version: match[2] || "0" }; |
2087 | + }, |
2088 | + |
2089 | + sub: function() { |
2090 | + function jQuerySubclass( selector, context ) { |
2091 | + return new jQuerySubclass.fn.init( selector, context ); |
2092 | + } |
2093 | + jQuery.extend( true, jQuerySubclass, this ); |
2094 | + jQuerySubclass.superclass = this; |
2095 | + jQuerySubclass.fn = jQuerySubclass.prototype = this(); |
2096 | + jQuerySubclass.fn.constructor = jQuerySubclass; |
2097 | + jQuerySubclass.subclass = this.subclass; |
2098 | + jQuerySubclass.fn.init = function init( selector, context ) { |
2099 | + if ( context && context instanceof jQuery && !(context instanceof jQuerySubclass) ) { |
2100 | + context = jQuerySubclass(context); |
2101 | + } |
2102 | + |
2103 | + return jQuery.fn.init.call( this, selector, context, rootjQuerySubclass ); |
2104 | + }; |
2105 | + jQuerySubclass.fn.init.prototype = jQuerySubclass.fn; |
2106 | + var rootjQuerySubclass = jQuerySubclass(document); |
2107 | + return jQuerySubclass; |
2108 | + }, |
2109 | + |
2110 | + browser: {} |
2111 | +}); |
2112 | + |
2113 | +// Create readyList deferred |
2114 | +readyList = jQuery._Deferred(); |
2115 | + |
2116 | +// Populate the class2type map |
2117 | +jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) { |
2118 | + class2type[ "[object " + name + "]" ] = name.toLowerCase(); |
2119 | +}); |
2120 | + |
2121 | +browserMatch = jQuery.uaMatch( userAgent ); |
2122 | +if ( browserMatch.browser ) { |
2123 | + jQuery.browser[ browserMatch.browser ] = true; |
2124 | + jQuery.browser.version = browserMatch.version; |
2125 | +} |
2126 | + |
2127 | +// Deprecated, use jQuery.browser.webkit instead |
2128 | +if ( jQuery.browser.webkit ) { |
2129 | + jQuery.browser.safari = true; |
2130 | +} |
2131 | + |
2132 | +if ( indexOf ) { |
2133 | + jQuery.inArray = function( elem, array ) { |
2134 | + return indexOf.call( array, elem ); |
2135 | + }; |
2136 | +} |
2137 | + |
2138 | +// IE doesn't match non-breaking spaces with \s |
2139 | +if ( rnotwhite.test( "\xA0" ) ) { |
2140 | + trimLeft = /^[\s\xA0]+/; |
2141 | + trimRight = /[\s\xA0]+$/; |
2142 | +} |
2143 | + |
2144 | +// All jQuery objects should point back to these |
2145 | +rootjQuery = jQuery(document); |
2146 | + |
2147 | +// Cleanup functions for the document ready method |
2148 | +if ( document.addEventListener ) { |
2149 | + DOMContentLoaded = function() { |
2150 | + document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false ); |
2151 | + jQuery.ready(); |
2152 | + }; |
2153 | + |
2154 | +} else if ( document.attachEvent ) { |
2155 | + DOMContentLoaded = function() { |
2156 | + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). |
2157 | + if ( document.readyState === "complete" ) { |
2158 | + document.detachEvent( "onreadystatechange", DOMContentLoaded ); |
2159 | + jQuery.ready(); |
2160 | + } |
2161 | + }; |
2162 | +} |
2163 | + |
2164 | +// The DOM ready check for Internet Explorer |
2165 | +function doScrollCheck() { |
2166 | + if ( jQuery.isReady ) { |
2167 | + return; |
2168 | + } |
2169 | + |
2170 | + try { |
2171 | + // If IE is used, use the trick by Diego Perini |
2172 | + // http://javascript.nwbox.com/IEContentLoaded/ |
2173 | + document.documentElement.doScroll("left"); |
2174 | + } catch(e) { |
2175 | + setTimeout( doScrollCheck, 1 ); |
2176 | + return; |
2177 | + } |
2178 | + |
2179 | + // and execute any waiting functions |
2180 | + jQuery.ready(); |
2181 | +} |
2182 | + |
2183 | +// Expose jQuery to the global object |
2184 | +return (window.jQuery = window.$ = jQuery); |
2185 | + |
2186 | +})(); |
2187 | + |
2188 | + |
2189 | +(function() { |
2190 | + |
2191 | + jQuery.support = {}; |
2192 | + |
2193 | + var div = document.createElement("div"); |
2194 | + |
2195 | + div.style.display = "none"; |
2196 | + div.innerHTML = " <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>"; |
2197 | + |
2198 | + var all = div.getElementsByTagName("*"), |
2199 | + a = div.getElementsByTagName("a")[0], |
2200 | + select = document.createElement("select"), |
2201 | + opt = select.appendChild( document.createElement("option") ); |
2202 | + |
2203 | + // Can't get basic test support |
2204 | + if ( !all || !all.length || !a ) { |
2205 | + return; |
2206 | + } |
2207 | + |
2208 | + jQuery.support = { |
2209 | + // IE strips leading whitespace when .innerHTML is used |
2210 | + leadingWhitespace: div.firstChild.nodeType === 3, |
2211 | + |
2212 | + // Make sure that tbody elements aren't automatically inserted |
2213 | + // IE will insert them into empty tables |
2214 | + tbody: !div.getElementsByTagName("tbody").length, |
2215 | + |
2216 | + // Make sure that link elements get serialized correctly by innerHTML |
2217 | + // This requires a wrapper element in IE |
2218 | + htmlSerialize: !!div.getElementsByTagName("link").length, |
2219 | + |
2220 | + // Get the style information from getAttribute |
2221 | + // (IE uses .cssText insted) |
2222 | + style: /red/.test( a.getAttribute("style") ), |
2223 | + |
2224 | + // Make sure that URLs aren't manipulated |
2225 | + // (IE normalizes it by default) |
2226 | + hrefNormalized: a.getAttribute("href") === "/a", |
2227 | + |
2228 | + // Make sure that element opacity exists |
2229 | + // (IE uses filter instead) |
2230 | + // Use a regex to work around a WebKit issue. See #5145 |
2231 | + opacity: /^0.55$/.test( a.style.opacity ), |
2232 | + |
2233 | + // Verify style float existence |
2234 | + // (IE uses styleFloat instead of cssFloat) |
2235 | + cssFloat: !!a.style.cssFloat, |
2236 | + |
2237 | + // Make sure that if no value is specified for a checkbox |
2238 | + // that it defaults to "on". |
2239 | + // (WebKit defaults to "" instead) |
2240 | + checkOn: div.getElementsByTagName("input")[0].value === "on", |
2241 | + |
2242 | + // Make sure that a selected-by-default option has a working selected property. |
2243 | + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) |
2244 | + optSelected: opt.selected, |
2245 | + |
2246 | + // Will be defined later |
2247 | + deleteExpando: true, |
2248 | + optDisabled: false, |
2249 | + checkClone: false, |
2250 | + _scriptEval: null, |
2251 | + noCloneEvent: true, |
2252 | + boxModel: null, |
2253 | + inlineBlockNeedsLayout: false, |
2254 | + shrinkWrapBlocks: false, |
2255 | + reliableHiddenOffsets: true |
2256 | + }; |
2257 | + |
2258 | + // Make sure that the options inside disabled selects aren't marked as disabled |
2259 | + // (WebKit marks them as diabled) |
2260 | + select.disabled = true; |
2261 | + jQuery.support.optDisabled = !opt.disabled; |
2262 | + |
2263 | + jQuery.support.scriptEval = function() { |
2264 | + if ( jQuery.support._scriptEval === null ) { |
2265 | + var root = document.documentElement, |
2266 | + script = document.createElement("script"), |
2267 | + id = "script" + jQuery.now(); |
2268 | + |
2269 | + script.type = "text/javascript"; |
2270 | + try { |
2271 | + script.appendChild( document.createTextNode( "window." + id + "=1;" ) ); |
2272 | + } catch(e) {} |
2273 | + |
2274 | + root.insertBefore( script, root.firstChild ); |
2275 | + |
2276 | + // Make sure that the execution of code works by injecting a script |
2277 | + // tag with appendChild/createTextNode |
2278 | + // (IE doesn't support this, fails, and uses .text instead) |
2279 | + if ( window[ id ] ) { |
2280 | + jQuery.support._scriptEval = true; |
2281 | + delete window[ id ]; |
2282 | + } else { |
2283 | + jQuery.support._scriptEval = false; |
2284 | + } |
2285 | + |
2286 | + root.removeChild( script ); |
2287 | + // release memory in IE |
2288 | + root = script = id = null; |
2289 | + } |
2290 | + |
2291 | + return jQuery.support._scriptEval; |
2292 | + }; |
2293 | + |
2294 | + // Test to see if it's possible to delete an expando from an element |
2295 | + // Fails in Internet Explorer |
2296 | + try { |
2297 | + delete div.test; |
2298 | + |
2299 | + } catch(e) { |
2300 | + jQuery.support.deleteExpando = false; |
2301 | + } |
2302 | + |
2303 | + if ( div.attachEvent && div.fireEvent ) { |
2304 | + div.attachEvent("onclick", function click() { |
2305 | + // Cloning a node shouldn't copy over any |
2306 | + // bound event handlers (IE does this) |
2307 | + jQuery.support.noCloneEvent = false; |
2308 | + div.detachEvent("onclick", click); |
2309 | + }); |
2310 | + div.cloneNode(true).fireEvent("onclick"); |
2311 | + } |
2312 | + |
2313 | + div = document.createElement("div"); |
2314 | + div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>"; |
2315 | + |
2316 | + var fragment = document.createDocumentFragment(); |
2317 | + fragment.appendChild( div.firstChild ); |
2318 | + |
2319 | + // WebKit doesn't clone checked state correctly in fragments |
2320 | + jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked; |
2321 | + |
2322 | + // Figure out if the W3C box model works as expected |
2323 | + // document.body must exist before we can do this |
2324 | + jQuery(function() { |
2325 | + var div = document.createElement("div"), |
2326 | + body = document.getElementsByTagName("body")[0]; |
2327 | + |
2328 | + // Frameset documents with no body should not run this code |
2329 | + if ( !body ) { |
2330 | + return; |
2331 | + } |
2332 | + |
2333 | + div.style.width = div.style.paddingLeft = "1px"; |
2334 | + body.appendChild( div ); |
2335 | + jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2; |
2336 | + |
2337 | + if ( "zoom" in div.style ) { |
2338 | + // Check if natively block-level elements act like inline-block |
2339 | + // elements when setting their display to 'inline' and giving |
2340 | + // them layout |
2341 | + // (IE < 8 does this) |
2342 | + div.style.display = "inline"; |
2343 | + div.style.zoom = 1; |
2344 | + jQuery.support.inlineBlockNeedsLayout = div.offsetWidth === 2; |
2345 | + |
2346 | + // Check if elements with layout shrink-wrap their children |
2347 | + // (IE 6 does this) |
2348 | + div.style.display = ""; |
2349 | + div.innerHTML = "<div style='width:4px;'></div>"; |
2350 | + jQuery.support.shrinkWrapBlocks = div.offsetWidth !== 2; |
2351 | + } |
2352 | + |
2353 | + div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>"; |
2354 | + var tds = div.getElementsByTagName("td"); |
2355 | + |
2356 | + // Check if table cells still have offsetWidth/Height when they are set |
2357 | + // to display:none and there are still other visible table cells in a |
2358 | + // table row; if so, offsetWidth/Height are not reliable for use when |
2359 | + // determining if an element has been hidden directly using |
2360 | + // display:none (it is still safe to use offsets if a parent element is |
2361 | + // hidden; don safety goggles and see bug #4512 for more information). |
2362 | + // (only IE 8 fails this test) |
2363 | + jQuery.support.reliableHiddenOffsets = tds[0].offsetHeight === 0; |
2364 | + |
2365 | + tds[0].style.display = ""; |
2366 | + tds[1].style.display = "none"; |
2367 | + |
2368 | + // Check if empty table cells still have offsetWidth/Height |
2369 | + // (IE < 8 fail this test) |
2370 | + jQuery.support.reliableHiddenOffsets = jQuery.support.reliableHiddenOffsets && tds[0].offsetHeight === 0; |
2371 | + div.innerHTML = ""; |
2372 | + |
2373 | + body.removeChild( div ).style.display = "none"; |
2374 | + div = tds = null; |
2375 | + }); |
2376 | + |
2377 | + // Technique from Juriy Zaytsev |
2378 | + // http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ |
2379 | + var eventSupported = function( eventName ) { |
2380 | + var el = document.createElement("div"); |
2381 | + eventName = "on" + eventName; |
2382 | + |
2383 | + // We only care about the case where non-standard event systems |
2384 | + // are used, namely in IE. Short-circuiting here helps us to |
2385 | + // avoid an eval call (in setAttribute) which can cause CSP |
2386 | + // to go haywire. See: https://developer.mozilla.org/en/Security/CSP |
2387 | + if ( !el.attachEvent ) { |
2388 | + return true; |
2389 | + } |
2390 | + |
2391 | + var isSupported = (eventName in el); |
2392 | + if ( !isSupported ) { |
2393 | + el.setAttribute(eventName, "return;"); |
2394 | + isSupported = typeof el[eventName] === "function"; |
2395 | + } |
2396 | + el = null; |
2397 | + |
2398 | + return isSupported; |
2399 | + }; |
2400 | + |
2401 | + jQuery.support.submitBubbles = eventSupported("submit"); |
2402 | + jQuery.support.changeBubbles = eventSupported("change"); |
2403 | + |
2404 | + // release memory in IE |
2405 | + div = all = a = null; |
2406 | +})(); |
2407 | + |
2408 | + |
2409 | + |
2410 | +var rbrace = /^(?:\{.*\}|\[.*\])$/; |
2411 | + |
2412 | +jQuery.extend({ |
2413 | + cache: {}, |
2414 | + |
2415 | + // Please use with caution |
2416 | + uuid: 0, |
2417 | + |
2418 | + // Unique for each copy of jQuery on the page |
2419 | + // Non-digits removed to match rinlinejQuery |
2420 | + expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ), |
2421 | + |
2422 | + // The following elements throw uncatchable exceptions if you |
2423 | + // attempt to add expando properties to them. |
2424 | + noData: { |
2425 | + "embed": true, |
2426 | + // Ban all objects except for Flash (which handle expandos) |
2427 | + "object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000", |
2428 | + "applet": true |
2429 | + }, |
2430 | + |
2431 | + hasData: function( elem ) { |
2432 | + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; |
2433 | + |
2434 | + return !!elem && !jQuery.isEmptyObject(elem); |
2435 | + }, |
2436 | + |
2437 | + data: function( elem, name, data, pvt /* Internal Use Only */ ) { |
2438 | + if ( !jQuery.acceptData( elem ) ) { |
2439 | + return; |
2440 | + } |
2441 | + |
2442 | + var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache, |
2443 | + |
2444 | + // We have to handle DOM nodes and JS objects differently because IE6-7 |
2445 | + // can't GC object references properly across the DOM-JS boundary |
2446 | + isNode = elem.nodeType, |
2447 | + |
2448 | + // Only DOM nodes need the global jQuery cache; JS object data is |
2449 | + // attached directly to the object so GC can occur automatically |
2450 | + cache = isNode ? jQuery.cache : elem, |
2451 | + |
2452 | + // Only defining an ID for JS objects if its cache already exists allows |
2453 | + // the code to shortcut on the same path as a DOM node with no cache |
2454 | + id = isNode ? elem[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando; |
2455 | + |
2456 | + // Avoid doing any more work than we need to when trying to get data on an |
2457 | + // object that has no data at all |
2458 | + if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) { |
2459 | + return; |
2460 | + } |
2461 | + |
2462 | + if ( !id ) { |
2463 | + // Only DOM nodes need a new unique ID for each element since their data |
2464 | + // ends up in the global cache |
2465 | + if ( isNode ) { |
2466 | + elem[ jQuery.expando ] = id = ++jQuery.uuid; |
2467 | + } else { |
2468 | + id = jQuery.expando; |
2469 | + } |
2470 | + } |
2471 | + |
2472 | + if ( !cache[ id ] ) { |
2473 | + cache[ id ] = {}; |
2474 | + } |
2475 | + |
2476 | + // An object can be passed to jQuery.data instead of a key/value pair; this gets |
2477 | + // shallow copied over onto the existing cache |
2478 | + if ( typeof name === "object" ) { |
2479 | + if ( pvt ) { |
2480 | + cache[ id ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name); |
2481 | + } else { |
2482 | + cache[ id ] = jQuery.extend(cache[ id ], name); |
2483 | + } |
2484 | + } |
2485 | + |
2486 | + thisCache = cache[ id ]; |
2487 | + |
2488 | + // Internal jQuery data is stored in a separate object inside the object's data |
2489 | + // cache in order to avoid key collisions between internal data and user-defined |
2490 | + // data |
2491 | + if ( pvt ) { |
2492 | + if ( !thisCache[ internalKey ] ) { |
2493 | + thisCache[ internalKey ] = {}; |
2494 | + } |
2495 | + |
2496 | + thisCache = thisCache[ internalKey ]; |
2497 | + } |
2498 | + |
2499 | + if ( data !== undefined ) { |
2500 | + thisCache[ name ] = data; |
2501 | + } |
2502 | + |
2503 | + // TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should |
2504 | + // not attempt to inspect the internal events object using jQuery.data, as this |
2505 | + // internal data object is undocumented and subject to change. |
2506 | + if ( name === "events" && !thisCache[name] ) { |
2507 | + return thisCache[ internalKey ] && thisCache[ internalKey ].events; |
2508 | + } |
2509 | + |
2510 | + return getByName ? thisCache[ name ] : thisCache; |
2511 | + }, |
2512 | + |
2513 | + removeData: function( elem, name, pvt /* Internal Use Only */ ) { |
2514 | + if ( !jQuery.acceptData( elem ) ) { |
2515 | + return; |
2516 | + } |
2517 | + |
2518 | + var internalKey = jQuery.expando, isNode = elem.nodeType, |
2519 | + |
2520 | + // See jQuery.data for more information |
2521 | + cache = isNode ? jQuery.cache : elem, |
2522 | + |
2523 | + // See jQuery.data for more information |
2524 | + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; |
2525 | + |
2526 | + // If there is already no cache entry for this object, there is no |
2527 | + // purpose in continuing |
2528 | + if ( !cache[ id ] ) { |
2529 | + return; |
2530 | + } |
2531 | + |
2532 | + if ( name ) { |
2533 | + var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ]; |
2534 | + |
2535 | + if ( thisCache ) { |
2536 | + delete thisCache[ name ]; |
2537 | + |
2538 | + // If there is no data left in the cache, we want to continue |
2539 | + // and let the cache object itself get destroyed |
2540 | + if ( !jQuery.isEmptyObject(thisCache) ) { |
2541 | + return; |
2542 | + } |
2543 | + } |
2544 | + } |
2545 | + |
2546 | + // See jQuery.data for more information |
2547 | + if ( pvt ) { |
2548 | + delete cache[ id ][ internalKey ]; |
2549 | + |
2550 | + // Don't destroy the parent cache unless the internal data object |
2551 | + // had been the only thing left in it |
2552 | + if ( !jQuery.isEmptyObject(cache[ id ]) ) { |
2553 | + return; |
2554 | + } |
2555 | + } |
2556 | + |
2557 | + var internalCache = cache[ id ][ internalKey ]; |
2558 | + |
2559 | + // Browsers that fail expando deletion also refuse to delete expandos on |
2560 | + // the window, but it will allow it on all other JS objects; other browsers |
2561 | + // don't care |
2562 | + if ( jQuery.support.deleteExpando || cache != window ) { |
2563 | + delete cache[ id ]; |
2564 | + } else { |
2565 | + cache[ id ] = null; |
2566 | + } |
2567 | + |
2568 | + // We destroyed the entire user cache at once because it's faster than |
2569 | + // iterating through each key, but we need to continue to persist internal |
2570 | + // data if it existed |
2571 | + if ( internalCache ) { |
2572 | + cache[ id ] = {}; |
2573 | + cache[ id ][ internalKey ] = internalCache; |
2574 | + |
2575 | + // Otherwise, we need to eliminate the expando on the node to avoid |
2576 | + // false lookups in the cache for entries that no longer exist |
2577 | + } else if ( isNode ) { |
2578 | + // IE does not allow us to delete expando properties from nodes, |
2579 | + // nor does it have a removeAttribute function on Document nodes; |
2580 | + // we must handle all of these cases |
2581 | + if ( jQuery.support.deleteExpando ) { |
2582 | + delete elem[ jQuery.expando ]; |
2583 | + } else if ( elem.removeAttribute ) { |
2584 | + elem.removeAttribute( jQuery.expando ); |
2585 | + } else { |
2586 | + elem[ jQuery.expando ] = null; |
2587 | + } |
2588 | + } |
2589 | + }, |
2590 | + |
2591 | + // For internal use only. |
2592 | + _data: function( elem, name, data ) { |
2593 | + return jQuery.data( elem, name, data, true ); |
2594 | + }, |
2595 | + |
2596 | + // A method for determining if a DOM node can handle the data expando |
2597 | + acceptData: function( elem ) { |
2598 | + if ( elem.nodeName ) { |
2599 | + var match = jQuery.noData[ elem.nodeName.toLowerCase() ]; |
2600 | + |
2601 | + if ( match ) { |
2602 | + return !(match === true || elem.getAttribute("classid") !== match); |
2603 | + } |
2604 | + } |
2605 | + |
2606 | + return true; |
2607 | + } |
2608 | +}); |
2609 | + |
2610 | +jQuery.fn.extend({ |
2611 | + data: function( key, value ) { |
2612 | + var data = null; |
2613 | + |
2614 | + if ( typeof key === "undefined" ) { |
2615 | + if ( this.length ) { |
2616 | + data = jQuery.data( this[0] ); |
2617 | + |
2618 | + if ( this[0].nodeType === 1 ) { |
2619 | + var attr = this[0].attributes, name; |
2620 | + for ( var i = 0, l = attr.length; i < l; i++ ) { |
2621 | + name = attr[i].name; |
2622 | + |
2623 | + if ( name.indexOf( "data-" ) === 0 ) { |
2624 | + name = name.substr( 5 ); |
2625 | + dataAttr( this[0], name, data[ name ] ); |
2626 | + } |
2627 | + } |
2628 | + } |
2629 | + } |
2630 | + |
2631 | + return data; |
2632 | + |
2633 | + } else if ( typeof key === "object" ) { |
2634 | + return this.each(function() { |
2635 | + jQuery.data( this, key ); |
2636 | + }); |
2637 | + } |
2638 | + |
2639 | + var parts = key.split("."); |
2640 | + parts[1] = parts[1] ? "." + parts[1] : ""; |
2641 | + |
2642 | + if ( value === undefined ) { |
2643 | + data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]); |
2644 | + |
2645 | + // Try to fetch any internally stored data first |
2646 | + if ( data === undefined && this.length ) { |
2647 | + data = jQuery.data( this[0], key ); |
2648 | + data = dataAttr( this[0], key, data ); |
2649 | + } |
2650 | + |
2651 | + return data === undefined && parts[1] ? |
2652 | + this.data( parts[0] ) : |
2653 | + data; |
2654 | + |
2655 | + } else { |
2656 | + return this.each(function() { |
2657 | + var $this = jQuery( this ), |
2658 | + args = [ parts[0], value ]; |
2659 | + |
2660 | + $this.triggerHandler( "setData" + parts[1] + "!", args ); |
2661 | + jQuery.data( this, key, value ); |
2662 | + $this.triggerHandler( "changeData" + parts[1] + "!", args ); |
2663 | + }); |
2664 | + } |
2665 | + }, |
2666 | + |
2667 | + removeData: function( key ) { |
2668 | + return this.each(function() { |
2669 | + jQuery.removeData( this, key ); |
2670 | + }); |
2671 | + } |
2672 | +}); |
2673 | + |
2674 | +function dataAttr( elem, key, data ) { |
2675 | + // If nothing was found internally, try to fetch any |
2676 | + // data from the HTML5 data-* attribute |
2677 | + if ( data === undefined && elem.nodeType === 1 ) { |
2678 | + data = elem.getAttribute( "data-" + key ); |
2679 | + |
2680 | + if ( typeof data === "string" ) { |
2681 | + try { |
2682 | + data = data === "true" ? true : |
2683 | + data === "false" ? false : |
2684 | + data === "null" ? null : |
2685 | + !jQuery.isNaN( data ) ? parseFloat( data ) : |
2686 | + rbrace.test( data ) ? jQuery.parseJSON( data ) : |
2687 | + data; |
2688 | + } catch( e ) {} |
2689 | + |
2690 | + // Make sure we set the data so it isn't changed later |
2691 | + jQuery.data( elem, key, data ); |
2692 | + |
2693 | + } else { |
2694 | + data = undefined; |
2695 | + } |
2696 | + } |
2697 | + |
2698 | + return data; |
2699 | +} |
2700 | + |
2701 | + |
2702 | + |
2703 | + |
2704 | +jQuery.extend({ |
2705 | + queue: function( elem, type, data ) { |
2706 | + if ( !elem ) { |
2707 | + return; |
2708 | + } |
2709 | + |
2710 | + type = (type || "fx") + "queue"; |
2711 | + var q = jQuery._data( elem, type ); |
2712 | + |
2713 | + // Speed up dequeue by getting out quickly if this is just a lookup |
2714 | + if ( !data ) { |
2715 | + return q || []; |
2716 | + } |
2717 | + |
2718 | + if ( !q || jQuery.isArray(data) ) { |
2719 | + q = jQuery._data( elem, type, jQuery.makeArray(data) ); |
2720 | + |
2721 | + } else { |
2722 | + q.push( data ); |
2723 | + } |
2724 | + |
2725 | + return q; |
2726 | + }, |
2727 | + |
2728 | + dequeue: function( elem, type ) { |
2729 | + type = type || "fx"; |
2730 | + |
2731 | + var queue = jQuery.queue( elem, type ), |
2732 | + fn = queue.shift(); |
2733 | + |
2734 | + // If the fx queue is dequeued, always remove the progress sentinel |
2735 | + if ( fn === "inprogress" ) { |
2736 | + fn = queue.shift(); |
2737 | + } |
2738 | + |
2739 | + if ( fn ) { |
2740 | + // Add a progress sentinel to prevent the fx queue from being |
2741 | + // automatically dequeued |
2742 | + if ( type === "fx" ) { |
2743 | + queue.unshift("inprogress"); |
2744 | + } |
2745 | + |
2746 | + fn.call(elem, function() { |
2747 | + jQuery.dequeue(elem, type); |
2748 | + }); |
2749 | + } |
2750 | + |
2751 | + if ( !queue.length ) { |
2752 | + jQuery.removeData( elem, type + "queue", true ); |
2753 | + } |
2754 | + } |
2755 | +}); |
2756 | + |
2757 | +jQuery.fn.extend({ |
2758 | + queue: function( type, data ) { |
2759 | + if ( typeof type !== "string" ) { |
2760 | + data = type; |
2761 | + type = "fx"; |
2762 | + } |
2763 | + |
2764 | + if ( data === undefined ) { |
2765 | + return jQuery.queue( this[0], type ); |
2766 | + } |
2767 | + return this.each(function( i ) { |
2768 | + var queue = jQuery.queue( this, type, data ); |
2769 | + |
2770 | + if ( type === "fx" && queue[0] !== "inprogress" ) { |
2771 | + jQuery.dequeue( this, type ); |
2772 | + } |
2773 | + }); |
2774 | + }, |
2775 | + dequeue: function( type ) { |
2776 | + return this.each(function() { |
2777 | + jQuery.dequeue( this, type ); |
2778 | + }); |
2779 | + }, |
2780 | + |
2781 | + // Based off of the plugin by Clint Helfers, with permission. |
2782 | + // http://blindsignals.com/index.php/2009/07/jquery-delay/ |
2783 | + delay: function( time, type ) { |
2784 | + time = jQuery.fx ? jQuery.fx.speeds[time] || time : time; |
2785 | + type = type || "fx"; |
2786 | + |
2787 | + return this.queue( type, function() { |
2788 | + var elem = this; |
2789 | + setTimeout(function() { |
2790 | + jQuery.dequeue( elem, type ); |
2791 | + }, time ); |
2792 | + }); |
2793 | + }, |
2794 | + |
2795 | + clearQueue: function( type ) { |
2796 | + return this.queue( type || "fx", [] ); |
2797 | + } |
2798 | +}); |
2799 | + |
2800 | + |
2801 | + |
2802 | + |
2803 | +var rclass = /[\n\t\r]/g, |
2804 | + rspaces = /\s+/, |
2805 | + rreturn = /\r/g, |
2806 | + rspecialurl = /^(?:href|src|style)$/, |
2807 | + rtype = /^(?:button|input)$/i, |
2808 | + rfocusable = /^(?:button|input|object|select|textarea)$/i, |
2809 | + rclickable = /^a(?:rea)?$/i, |
2810 | + rradiocheck = /^(?:radio|checkbox)$/i; |
2811 | + |
2812 | +jQuery.props = { |
2813 | + "for": "htmlFor", |
2814 | + "class": "className", |
2815 | + readonly: "readOnly", |
2816 | + maxlength: "maxLength", |
2817 | + cellspacing: "cellSpacing", |
2818 | + rowspan: "rowSpan", |
2819 | + colspan: "colSpan", |
2820 | + tabindex: "tabIndex", |
2821 | + usemap: "useMap", |
2822 | + frameborder: "frameBorder" |
2823 | +}; |
2824 | + |
2825 | +jQuery.fn.extend({ |
2826 | + attr: function( name, value ) { |
2827 | + return jQuery.access( this, name, value, true, jQuery.attr ); |
2828 | + }, |
2829 | + |
2830 | + removeAttr: function( name, fn ) { |
2831 | + return this.each(function(){ |
2832 | + jQuery.attr( this, name, "" ); |
2833 | + if ( this.nodeType === 1 ) { |
2834 | + this.removeAttribute( name ); |
2835 | + } |
2836 | + }); |
2837 | + }, |
2838 | + |
2839 | + addClass: function( value ) { |
2840 | + if ( jQuery.isFunction(value) ) { |
2841 | + return this.each(function(i) { |
2842 | + var self = jQuery(this); |
2843 | + self.addClass( value.call(this, i, self.attr("class")) ); |
2844 | + }); |
2845 | + } |
2846 | + |
2847 | + if ( value && typeof value === "string" ) { |
2848 | + var classNames = (value || "").split( rspaces ); |
2849 | + |
2850 | + for ( var i = 0, l = this.length; i < l; i++ ) { |
2851 | + var elem = this[i]; |
2852 | + |
2853 | + if ( elem.nodeType === 1 ) { |
2854 | + if ( !elem.className ) { |
2855 | + elem.className = value; |
2856 | + |
2857 | + } else { |
2858 | + var className = " " + elem.className + " ", |
2859 | + setClass = elem.className; |
2860 | + |
2861 | + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { |
2862 | + if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) { |
2863 | + setClass += " " + classNames[c]; |
2864 | + } |
2865 | + } |
2866 | + elem.className = jQuery.trim( setClass ); |
2867 | + } |
2868 | + } |
2869 | + } |
2870 | + } |
2871 | + |
2872 | + return this; |
2873 | + }, |
2874 | + |
2875 | + removeClass: function( value ) { |
2876 | + if ( jQuery.isFunction(value) ) { |
2877 | + return this.each(function(i) { |
2878 | + var self = jQuery(this); |
2879 | + self.removeClass( value.call(this, i, self.attr("class")) ); |
2880 | + }); |
2881 | + } |
2882 | + |
2883 | + if ( (value && typeof value === "string") || value === undefined ) { |
2884 | + var classNames = (value || "").split( rspaces ); |
2885 | + |
2886 | + for ( var i = 0, l = this.length; i < l; i++ ) { |
2887 | + var elem = this[i]; |
2888 | + |
2889 | + if ( elem.nodeType === 1 && elem.className ) { |
2890 | + if ( value ) { |
2891 | + var className = (" " + elem.className + " ").replace(rclass, " "); |
2892 | + for ( var c = 0, cl = classNames.length; c < cl; c++ ) { |
2893 | + className = className.replace(" " + classNames[c] + " ", " "); |
2894 | + } |
2895 | + elem.className = jQuery.trim( className ); |
2896 | + |
2897 | + } else { |
2898 | + elem.className = ""; |
2899 | + } |
2900 | + } |
2901 | + } |
2902 | + } |
2903 | + |
2904 | + return this; |
2905 | + }, |
2906 | + |
2907 | + toggleClass: function( value, stateVal ) { |
2908 | + var type = typeof value, |
2909 | + isBool = typeof stateVal === "boolean"; |
2910 | + |
2911 | + if ( jQuery.isFunction( value ) ) { |
2912 | + return this.each(function(i) { |
2913 | + var self = jQuery(this); |
2914 | + self.toggleClass( value.call(this, i, self.attr("class"), stateVal), stateVal ); |
2915 | + }); |
2916 | + } |
2917 | + |
2918 | + return this.each(function() { |
2919 | + if ( type === "string" ) { |
2920 | + // toggle individual class names |
2921 | + var className, |
2922 | + i = 0, |
2923 | + self = jQuery( this ), |
2924 | + state = stateVal, |
2925 | + classNames = value.split( rspaces ); |
2926 | + |
2927 | + while ( (className = classNames[ i++ ]) ) { |
2928 | + // check each className given, space seperated list |
2929 | + state = isBool ? state : !self.hasClass( className ); |
2930 | + self[ state ? "addClass" : "removeClass" ]( className ); |
2931 | + } |
2932 | + |
2933 | + } else if ( type === "undefined" || type === "boolean" ) { |
2934 | + if ( this.className ) { |
2935 | + // store className if set |
2936 | + jQuery._data( this, "__className__", this.className ); |
2937 | + } |
2938 | + |
2939 | + // toggle whole className |
2940 | + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; |
2941 | + } |
2942 | + }); |
2943 | + }, |
2944 | + |
2945 | + hasClass: function( selector ) { |
2946 | + var className = " " + selector + " "; |
2947 | + for ( var i = 0, l = this.length; i < l; i++ ) { |
2948 | + if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) { |
2949 | + return true; |
2950 | + } |
2951 | + } |
2952 | + |
2953 | + return false; |
2954 | + }, |
2955 | + |
2956 | + val: function( value ) { |
2957 | + if ( !arguments.length ) { |
2958 | + var elem = this[0]; |
2959 | + |
2960 | + if ( elem ) { |
2961 | + if ( jQuery.nodeName( elem, "option" ) ) { |
2962 | + // attributes.value is undefined in Blackberry 4.7 but |
2963 | + // uses .value. See #6932 |
2964 | + var val = elem.attributes.value; |
2965 | + return !val || val.specified ? elem.value : elem.text; |
2966 | + } |
2967 | + |
2968 | + // We need to handle select boxes special |
2969 | + if ( jQuery.nodeName( elem, "select" ) ) { |
2970 | + var index = elem.selectedIndex, |
2971 | + values = [], |
2972 | + options = elem.options, |
2973 | + one = elem.type === "select-one"; |
2974 | + |
2975 | + // Nothing was selected |
2976 | + if ( index < 0 ) { |
2977 | + return null; |
2978 | + } |
2979 | + |
2980 | + // Loop through all the selected options |
2981 | + for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { |
2982 | + var option = options[ i ]; |
2983 | + |
2984 | + // Don't return options that are disabled or in a disabled optgroup |
2985 | + if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && |
2986 | + (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { |
2987 | + |
2988 | + // Get the specific value for the option |
2989 | + value = jQuery(option).val(); |
2990 | + |
2991 | + // We don't need an array for one selects |
2992 | + if ( one ) { |
2993 | + return value; |
2994 | + } |
2995 | + |
2996 | + // Multi-Selects return an array |
2997 | + values.push( value ); |
2998 | + } |
2999 | + } |
3000 | + |
3001 | + return values; |
3002 | + } |
3003 | + |
3004 | + // Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified |
3005 | + if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) { |
3006 | + return elem.getAttribute("value") === null ? "on" : elem.value; |
3007 | + } |
3008 | + |
3009 | + // Everything else, we just grab the value |
3010 | + return (elem.value || "").replace(rreturn, ""); |
3011 | + |
3012 | + } |
3013 | + |
3014 | + return undefined; |
3015 | + } |
3016 | + |
3017 | + var isFunction = jQuery.isFunction(value); |
3018 | + |
3019 | + return this.each(function(i) { |
3020 | + var self = jQuery(this), val = value; |
3021 | + |
3022 | + if ( this.nodeType !== 1 ) { |
3023 | + return; |
3024 | + } |
3025 | + |
3026 | + if ( isFunction ) { |
3027 | + val = value.call(this, i, self.val()); |
3028 | + } |
3029 | + |
3030 | + // Treat null/undefined as ""; convert numbers to string |
3031 | + if ( val == null ) { |
3032 | + val = ""; |
3033 | + } else if ( typeof val === "number" ) { |
3034 | + val += ""; |
3035 | + } else if ( jQuery.isArray(val) ) { |
3036 | + val = jQuery.map(val, function (value) { |
3037 | + return value == null ? "" : value + ""; |
3038 | + }); |
3039 | + } |
3040 | + |
3041 | + if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) { |
3042 | + this.checked = jQuery.inArray( self.val(), val ) >= 0; |
3043 | + |
3044 | + } else if ( jQuery.nodeName( this, "select" ) ) { |
3045 | + var values = jQuery.makeArray(val); |
3046 | + |
3047 | + jQuery( "option", this ).each(function() { |
3048 | + this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0; |
3049 | + }); |
3050 | + |
3051 | + if ( !values.length ) { |
3052 | + this.selectedIndex = -1; |
3053 | + } |
3054 | + |
3055 | + } else { |
3056 | + this.value = val; |
3057 | + } |
3058 | + }); |
3059 | + } |
3060 | +}); |
3061 | + |
3062 | +jQuery.extend({ |
3063 | + attrFn: { |
3064 | + val: true, |
3065 | + css: true, |
3066 | + html: true, |
3067 | + text: true, |
3068 | + data: true, |
3069 | + width: true, |
3070 | + height: true, |
3071 | + offset: true |
3072 | + }, |
3073 | + |
3074 | + attr: function( elem, name, value, pass ) { |
3075 | + // don't get/set attributes on text, comment and attribute nodes |
3076 | + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || elem.nodeType === 2 ) { |
3077 | + return undefined; |
3078 | + } |
3079 | + |
3080 | + if ( pass && name in jQuery.attrFn ) { |
3081 | + return jQuery(elem)[name](value); |
3082 | + } |
3083 | + |
3084 | + var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ), |
3085 | + // Whether we are setting (or getting) |
3086 | + set = value !== undefined; |
3087 | + |
3088 | + // Try to normalize/fix the name |
3089 | + name = notxml && jQuery.props[ name ] || name; |
3090 | + |
3091 | + // Only do all the following if this is a node (faster for style) |
3092 | + if ( elem.nodeType === 1 ) { |
3093 | + // These attributes require special treatment |
3094 | + var special = rspecialurl.test( name ); |
3095 | + |
3096 | + // Safari mis-reports the default selected property of an option |
3097 | + // Accessing the parent's selectedIndex property fixes it |
3098 | + if ( name === "selected" && !jQuery.support.optSelected ) { |
3099 | + var parent = elem.parentNode; |
3100 | + if ( parent ) { |
3101 | + parent.selectedIndex; |
3102 | + |
3103 | + // Make sure that it also works with optgroups, see #5701 |
3104 | + if ( parent.parentNode ) { |
3105 | + parent.parentNode.selectedIndex; |
3106 | + } |
3107 | + } |
3108 | + } |
3109 | + |
3110 | + // If applicable, access the attribute via the DOM 0 way |
3111 | + // 'in' checks fail in Blackberry 4.7 #6931 |
3112 | + if ( (name in elem || elem[ name ] !== undefined) && notxml && !special ) { |
3113 | + if ( set ) { |
3114 | + // We can't allow the type property to be changed (since it causes problems in IE) |
3115 | + if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) { |
3116 | + jQuery.error( "type property can't be changed" ); |
3117 | + } |
3118 | + |
3119 | + if ( value === null ) { |
3120 | + if ( elem.nodeType === 1 ) { |
3121 | + elem.removeAttribute( name ); |
3122 | + } |
3123 | + |
3124 | + } else { |
3125 | + elem[ name ] = value; |
3126 | + } |
3127 | + } |
3128 | + |
3129 | + // browsers index elements by id/name on forms, give priority to attributes. |
3130 | + if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) { |
3131 | + return elem.getAttributeNode( name ).nodeValue; |
3132 | + } |
3133 | + |
3134 | + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set |
3135 | + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ |
3136 | + if ( name === "tabIndex" ) { |
3137 | + var attributeNode = elem.getAttributeNode( "tabIndex" ); |
3138 | + |
3139 | + return attributeNode && attributeNode.specified ? |
3140 | + attributeNode.value : |
3141 | + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? |
3142 | + 0 : |
3143 | + undefined; |
3144 | + } |
3145 | + |
3146 | + return elem[ name ]; |
3147 | + } |
3148 | + |
3149 | + if ( !jQuery.support.style && notxml && name === "style" ) { |
3150 | + if ( set ) { |
3151 | + elem.style.cssText = "" + value; |
3152 | + } |
3153 | + |
3154 | + return elem.style.cssText; |
3155 | + } |
3156 | + |
3157 | + if ( set ) { |
3158 | + // convert the value to a string (all browsers do this but IE) see #1070 |
3159 | + elem.setAttribute( name, "" + value ); |
3160 | + } |
3161 | + |
3162 | + // Ensure that missing attributes return undefined |
3163 | + // Blackberry 4.7 returns "" from getAttribute #6938 |
3164 | + if ( !elem.attributes[ name ] && (elem.hasAttribute && !elem.hasAttribute( name )) ) { |
3165 | + return undefined; |
3166 | + } |
3167 | + |
3168 | + var attr = !jQuery.support.hrefNormalized && notxml && special ? |
3169 | + // Some attributes require a special call on IE |
3170 | + elem.getAttribute( name, 2 ) : |
3171 | + elem.getAttribute( name ); |
3172 | + |
3173 | + // Non-existent attributes return null, we normalize to undefined |
3174 | + return attr === null ? undefined : attr; |
3175 | + } |
3176 | + // Handle everything which isn't a DOM element node |
3177 | + if ( set ) { |
3178 | + elem[ name ] = value; |
3179 | + } |
3180 | + return elem[ name ]; |
3181 | + } |
3182 | +}); |
3183 | + |
3184 | + |
3185 | + |
3186 | + |
3187 | +var rnamespaces = /\.(.*)$/, |
3188 | + rformElems = /^(?:textarea|input|select)$/i, |
3189 | + rperiod = /\./g, |
3190 | + rspace = / /g, |
3191 | + rescape = /[^\w\s.|`]/g, |
3192 | + fcleanup = function( nm ) { |
3193 | + return nm.replace(rescape, "\\$&"); |
3194 | + }, |
3195 | + eventKey = "events"; |
3196 | + |
3197 | +/* |
3198 | + * A number of helper functions used for managing events. |
3199 | + * Many of the ideas behind this code originated from |
3200 | + * Dean Edwards' addEvent library. |
3201 | + */ |
3202 | +jQuery.event = { |
3203 | + |
3204 | + // Bind an event to an element |
3205 | + // Original by Dean Edwards |
3206 | + add: function( elem, types, handler, data ) { |
3207 | + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { |
3208 | + return; |
3209 | + } |
3210 | + |
3211 | + // For whatever reason, IE has trouble passing the window object |
3212 | + // around, causing it to be cloned in the process |
3213 | + if ( jQuery.isWindow( elem ) && ( elem !== window && !elem.frameElement ) ) { |
3214 | + elem = window; |
3215 | + } |
3216 | + |
3217 | + if ( handler === false ) { |
3218 | + handler = returnFalse; |
3219 | + } else if ( !handler ) { |
3220 | + // Fixes bug #7229. Fix recommended by jdalton |
3221 | + return; |
3222 | + } |
3223 | + |
3224 | + var handleObjIn, handleObj; |
3225 | + |
3226 | + if ( handler.handler ) { |
3227 | + handleObjIn = handler; |
3228 | + handler = handleObjIn.handler; |
3229 | + } |
3230 | + |
3231 | + // Make sure that the function being executed has a unique ID |
3232 | + if ( !handler.guid ) { |
3233 | + handler.guid = jQuery.guid++; |
3234 | + } |
3235 | + |
3236 | + // Init the element's event structure |
3237 | + var elemData = jQuery._data( elem ); |
3238 | + |
3239 | + // If no elemData is found then we must be trying to bind to one of the |
3240 | + // banned noData elements |
3241 | + if ( !elemData ) { |
3242 | + return; |
3243 | + } |
3244 | + |
3245 | + var events = elemData[ eventKey ], |
3246 | + eventHandle = elemData.handle; |
3247 | + |
3248 | + if ( typeof events === "function" ) { |
3249 | + // On plain objects events is a fn that holds the the data |
3250 | + // which prevents this data from being JSON serialized |
3251 | + // the function does not need to be called, it just contains the data |
3252 | + eventHandle = events.handle; |
3253 | + events = events.events; |
3254 | + |
3255 | + } else if ( !events ) { |
3256 | + if ( !elem.nodeType ) { |
3257 | + // On plain objects, create a fn that acts as the holder |
3258 | + // of the values to avoid JSON serialization of event data |
3259 | + elemData[ eventKey ] = elemData = function(){}; |
3260 | + } |
3261 | + |
3262 | + elemData.events = events = {}; |
3263 | + } |
3264 | + |
3265 | + if ( !eventHandle ) { |
3266 | + elemData.handle = eventHandle = function() { |
3267 | + // Handle the second event of a trigger and when |
3268 | + // an event is called after a page has unloaded |
3269 | + return typeof jQuery !== "undefined" && !jQuery.event.triggered ? |
3270 | + jQuery.event.handle.apply( eventHandle.elem, arguments ) : |
3271 | + undefined; |
3272 | + }; |
3273 | + } |
3274 | + |
3275 | + // Add elem as a property of the handle function |
3276 | + // This is to prevent a memory leak with non-native events in IE. |
3277 | + eventHandle.elem = elem; |
3278 | + |
3279 | + // Handle multiple events separated by a space |
3280 | + // jQuery(...).bind("mouseover mouseout", fn); |
3281 | + types = types.split(" "); |
3282 | + |
3283 | + var type, i = 0, namespaces; |
3284 | + |
3285 | + while ( (type = types[ i++ ]) ) { |
3286 | + handleObj = handleObjIn ? |
3287 | + jQuery.extend({}, handleObjIn) : |
3288 | + { handler: handler, data: data }; |
3289 | + |
3290 | + // Namespaced event handlers |
3291 | + if ( type.indexOf(".") > -1 ) { |
3292 | + namespaces = type.split("."); |
3293 | + type = namespaces.shift(); |
3294 | + handleObj.namespace = namespaces.slice(0).sort().join("."); |
3295 | + |
3296 | + } else { |
3297 | + namespaces = []; |
3298 | + handleObj.namespace = ""; |
3299 | + } |
3300 | + |
3301 | + handleObj.type = type; |
3302 | + if ( !handleObj.guid ) { |
3303 | + handleObj.guid = handler.guid; |
3304 | + } |
3305 | + |
3306 | + // Get the current list of functions bound to this event |
3307 | + var handlers = events[ type ], |
3308 | + special = jQuery.event.special[ type ] || {}; |
3309 | + |
3310 | + // Init the event handler queue |
3311 | + if ( !handlers ) { |
3312 | + handlers = events[ type ] = []; |
3313 | + |
3314 | + // Check for a special event handler |
3315 | + // Only use addEventListener/attachEvent if the special |
3316 | + // events handler returns false |
3317 | + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { |
3318 | + // Bind the global event handler to the element |
3319 | + if ( elem.addEventListener ) { |
3320 | + elem.addEventListener( type, eventHandle, false ); |
3321 | + |
3322 | + } else if ( elem.attachEvent ) { |
3323 | + elem.attachEvent( "on" + type, eventHandle ); |
3324 | + } |
3325 | + } |
3326 | + } |
3327 | + |
3328 | + if ( special.add ) { |
3329 | + special.add.call( elem, handleObj ); |
3330 | + |
3331 | + if ( !handleObj.handler.guid ) { |
3332 | + handleObj.handler.guid = handler.guid; |
3333 | + } |
3334 | + } |
3335 | + |
3336 | + // Add the function to the element's handler list |
3337 | + handlers.push( handleObj ); |
3338 | + |
3339 | + // Keep track of which events have been used, for global triggering |
3340 | + jQuery.event.global[ type ] = true; |
3341 | + } |
3342 | + |
3343 | + // Nullify elem to prevent memory leaks in IE |
3344 | + elem = null; |
3345 | + }, |
3346 | + |
3347 | + global: {}, |
3348 | + |
3349 | + // Detach an event or set of events from an element |
3350 | + remove: function( elem, types, handler, pos ) { |
3351 | + // don't do events on text and comment nodes |
3352 | + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { |
3353 | + return; |
3354 | + } |
3355 | + |
3356 | + if ( handler === false ) { |
3357 | + handler = returnFalse; |
3358 | + } |
3359 | + |
3360 | + var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType, |
3361 | + elemData = jQuery.hasData( elem ) && jQuery._data( elem ), |
3362 | + events = elemData && elemData[ eventKey ]; |
3363 | + |
3364 | + if ( !elemData || !events ) { |
3365 | + return; |
3366 | + } |
3367 | + |
3368 | + if ( typeof events === "function" ) { |
3369 | + elemData = events; |
3370 | + events = events.events; |
3371 | + } |
3372 | + |
3373 | + // types is actually an event object here |
3374 | + if ( types && types.type ) { |
3375 | + handler = types.handler; |
3376 | + types = types.type; |
3377 | + } |
3378 | + |
3379 | + // Unbind all events for the element |
3380 | + if ( !types || typeof types === "string" && types.charAt(0) === "." ) { |
3381 | + types = types || ""; |
3382 | + |
3383 | + for ( type in events ) { |
3384 | + jQuery.event.remove( elem, type + types ); |
3385 | + } |
3386 | + |
3387 | + return; |
3388 | + } |
3389 | + |
3390 | + // Handle multiple events separated by a space |
3391 | + // jQuery(...).unbind("mouseover mouseout", fn); |
3392 | + types = types.split(" "); |
3393 | + |
3394 | + while ( (type = types[ i++ ]) ) { |
3395 | + origType = type; |
3396 | + handleObj = null; |
3397 | + all = type.indexOf(".") < 0; |
3398 | + namespaces = []; |
3399 | + |
3400 | + if ( !all ) { |
3401 | + // Namespaced event handlers |
3402 | + namespaces = type.split("."); |
3403 | + type = namespaces.shift(); |
3404 | + |
3405 | + namespace = new RegExp("(^|\\.)" + |
3406 | + jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)"); |
3407 | + } |
3408 | + |
3409 | + eventType = events[ type ]; |
3410 | + |
3411 | + if ( !eventType ) { |
3412 | + continue; |
3413 | + } |
3414 | + |
3415 | + if ( !handler ) { |
3416 | + for ( j = 0; j < eventType.length; j++ ) { |
3417 | + handleObj = eventType[ j ]; |
3418 | + |
3419 | + if ( all || namespace.test( handleObj.namespace ) ) { |
3420 | + jQuery.event.remove( elem, origType, handleObj.handler, j ); |
3421 | + eventType.splice( j--, 1 ); |
3422 | + } |
3423 | + } |
3424 | + |
3425 | + continue; |
3426 | + } |
3427 | + |
3428 | + special = jQuery.event.special[ type ] || {}; |
3429 | + |
3430 | + for ( j = pos || 0; j < eventType.length; j++ ) { |
3431 | + handleObj = eventType[ j ]; |
3432 | + |
3433 | + if ( handler.guid === handleObj.guid ) { |
3434 | + // remove the given handler for the given type |
3435 | + if ( all || namespace.test( handleObj.namespace ) ) { |
3436 | + if ( pos == null ) { |
3437 | + eventType.splice( j--, 1 ); |
3438 | + } |
3439 | + |
3440 | + if ( special.remove ) { |
3441 | + special.remove.call( elem, handleObj ); |
3442 | + } |
3443 | + } |
3444 | + |
3445 | + if ( pos != null ) { |
3446 | + break; |
3447 | + } |
3448 | + } |
3449 | + } |
3450 | + |
3451 | + // remove generic event handler if no more handlers exist |
3452 | + if ( eventType.length === 0 || pos != null && eventType.length === 1 ) { |
3453 | + if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) { |
3454 | + jQuery.removeEvent( elem, type, elemData.handle ); |
3455 | + } |
3456 | + |
3457 | + ret = null; |
3458 | + delete events[ type ]; |
3459 | + } |
3460 | + } |
3461 | + |
3462 | + // Remove the expando if it's no longer used |
3463 | + if ( jQuery.isEmptyObject( events ) ) { |
3464 | + var handle = elemData.handle; |
3465 | + if ( handle ) { |
3466 | + handle.elem = null; |
3467 | + } |
3468 | + |
3469 | + delete elemData.events; |
3470 | + delete elemData.handle; |
3471 | + |
3472 | + if ( typeof elemData === "function" ) { |
3473 | + jQuery.removeData( elem, eventKey, true ); |
3474 | + |
3475 | + } else if ( jQuery.isEmptyObject( elemData ) ) { |
3476 | + jQuery.removeData( elem, undefined, true ); |
3477 | + } |
3478 | + } |
3479 | + }, |
3480 | + |
3481 | + // bubbling is internal |
3482 | + trigger: function( event, data, elem /*, bubbling */ ) { |
3483 | + // Event object or event type |
3484 | + var type = event.type || event, |
3485 | + bubbling = arguments[3]; |
3486 | + |
3487 | + if ( !bubbling ) { |
3488 | + event = typeof event === "object" ? |
3489 | + // jQuery.Event object |
3490 | + event[ jQuery.expando ] ? event : |
3491 | + // Object literal |
3492 | + jQuery.extend( jQuery.Event(type), event ) : |
3493 | + // Just the event type (string) |
3494 | + jQuery.Event(type); |
3495 | + |
3496 | + if ( type.indexOf("!") >= 0 ) { |
3497 | + event.type = type = type.slice(0, -1); |
3498 | + event.exclusive = true; |
3499 | + } |
3500 | + |
3501 | + // Handle a global trigger |
3502 | + if ( !elem ) { |
3503 | + // Don't bubble custom events when global (to avoid too much overhead) |
3504 | + event.stopPropagation(); |
3505 | + |
3506 | + // Only trigger if we've ever bound an event for it |
3507 | + if ( jQuery.event.global[ type ] ) { |
3508 | + // XXX This code smells terrible. event.js should not be directly |
3509 | + // inspecting the data cache |
3510 | + jQuery.each( jQuery.cache, function() { |
3511 | + // internalKey variable is just used to make it easier to find |
3512 | + // and potentially change this stuff later; currently it just |
3513 | + // points to jQuery.expando |
3514 | + var internalKey = jQuery.expando, |
3515 | + internalCache = this[ internalKey ]; |
3516 | + if ( internalCache && internalCache.events && internalCache.events[type] ) { |
3517 | + jQuery.event.trigger( event, data, internalCache.handle.elem ); |
3518 | + } |
3519 | + }); |
3520 | + } |
3521 | + } |
3522 | + |
3523 | + // Handle triggering a single element |
3524 | + |
3525 | + // don't do events on text and comment nodes |
3526 | + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) { |
3527 | + return undefined; |
3528 | + } |
3529 | + |
3530 | + // Clean up in case it is reused |
3531 | + event.result = undefined; |
3532 | + event.target = elem; |
3533 | + |
3534 | + // Clone the incoming data, if any |
3535 | + data = jQuery.makeArray( data ); |
3536 | + data.unshift( event ); |
3537 | + } |
3538 | + |
3539 | + event.currentTarget = elem; |
3540 | + |
3541 | + // Trigger the event, it is assumed that "handle" is a function |
3542 | + var handle = elem.nodeType ? |
3543 | + jQuery._data( elem, "handle" ) : |
3544 | + (jQuery._data( elem, eventKey ) || {}).handle; |
3545 | + |
3546 | + if ( handle ) { |
3547 | + handle.apply( elem, data ); |
3548 | + } |
3549 | + |
3550 | + var parent = elem.parentNode || elem.ownerDocument; |
3551 | + |
3552 | + // Trigger an inline bound script |
3553 | + try { |
3554 | + if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) { |
3555 | + if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) { |
3556 | + event.result = false; |
3557 | + event.preventDefault(); |
3558 | + } |
3559 | + } |
3560 | + |
3561 | + // prevent IE from throwing an error for some elements with some event types, see #3533 |
3562 | + } catch (inlineError) {} |
3563 | + |
3564 | + if ( !event.isPropagationStopped() && parent ) { |
3565 | + jQuery.event.trigger( event, data, parent, true ); |
3566 | + |
3567 | + } else if ( !event.isDefaultPrevented() ) { |
3568 | + var old, |
3569 | + target = event.target, |
3570 | + targetType = type.replace( rnamespaces, "" ), |
3571 | + isClick = jQuery.nodeName( target, "a" ) && targetType === "click", |
3572 | + special = jQuery.event.special[ targetType ] || {}; |
3573 | + |
3574 | + if ( (!special._default || special._default.call( elem, event ) === false) && |
3575 | + !isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) { |
3576 | + |
3577 | + try { |
3578 | + if ( target[ targetType ] ) { |
3579 | + // Make sure that we don't accidentally re-trigger the onFOO events |
3580 | + old = target[ "on" + targetType ]; |
3581 | + |
3582 | + if ( old ) { |
3583 | + target[ "on" + targetType ] = null; |
3584 | + } |
3585 | + |
3586 | + jQuery.event.triggered = true; |
3587 | + target[ targetType ](); |
3588 | + } |
3589 | + |
3590 | + // prevent IE from throwing an error for some elements with some event types, see #3533 |
3591 | + } catch (triggerError) {} |
3592 | + |
3593 | + if ( old ) { |
3594 | + target[ "on" + targetType ] = old; |
3595 | + } |
3596 | + |
3597 | + jQuery.event.triggered = false; |
3598 | + } |
3599 | + } |
3600 | + }, |
3601 | + |
3602 | + handle: function( event ) { |
3603 | + var all, handlers, namespaces, namespace_re, events, |
3604 | + namespace_sort = [], |
3605 | + args = jQuery.makeArray( arguments ); |
3606 | + |
3607 | + event = args[0] = jQuery.event.fix( event || window.event ); |
3608 | + event.currentTarget = this; |
3609 | + |
3610 | + // Namespaced event handlers |
3611 | + all = event.type.indexOf(".") < 0 && !event.exclusive; |
3612 | + |
3613 | + if ( !all ) { |
3614 | + namespaces = event.type.split("."); |
3615 | + event.type = namespaces.shift(); |
3616 | + namespace_sort = namespaces.slice(0).sort(); |
3617 | + namespace_re = new RegExp("(^|\\.)" + namespace_sort.join("\\.(?:.*\\.)?") + "(\\.|$)"); |
3618 | + } |
3619 | + |
3620 | + event.namespace = event.namespace || namespace_sort.join("."); |
3621 | + |
3622 | + events = jQuery._data(this, eventKey); |
3623 | + |
3624 | + if ( typeof events === "function" ) { |
3625 | + events = events.events; |
3626 | + } |
3627 | + |
3628 | + handlers = (events || {})[ event.type ]; |
3629 | + |
3630 | + if ( events && handlers ) { |
3631 | + // Clone the handlers to prevent manipulation |
3632 | + handlers = handlers.slice(0); |
3633 | + |
3634 | + for ( var j = 0, l = handlers.length; j < l; j++ ) { |
3635 | + var handleObj = handlers[ j ]; |
3636 | + |
3637 | + // Filter the functions by class |
3638 | + if ( all || namespace_re.test( handleObj.namespace ) ) { |
3639 | + // Pass in a reference to the handler function itself |
3640 | + // So that we can later remove it |
3641 | + event.handler = handleObj.handler; |
3642 | + event.data = handleObj.data; |
3643 | + event.handleObj = handleObj; |
3644 | + |
3645 | + var ret = handleObj.handler.apply( this, args ); |
3646 | + |
3647 | + if ( ret !== undefined ) { |
3648 | + event.result = ret; |
3649 | + if ( ret === false ) { |
3650 | + event.preventDefault(); |
3651 | + event.stopPropagation(); |
3652 | + } |
3653 | + } |
3654 | + |
3655 | + if ( event.isImmediatePropagationStopped() ) { |
3656 | + break; |
3657 | + } |
3658 | + } |
3659 | + } |
3660 | + } |
3661 | + |
3662 | + return event.result; |
3663 | + }, |
3664 | + |
3665 | + props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "), |
3666 | + |
3667 | + fix: function( event ) { |
3668 | + if ( event[ jQuery.expando ] ) { |
3669 | + return event; |
3670 | + } |
3671 | + |
3672 | + // store a copy of the original event object |
3673 | + // and "clone" to set read-only properties |
3674 | + var originalEvent = event; |
3675 | + event = jQuery.Event( originalEvent ); |
3676 | + |
3677 | + for ( var i = this.props.length, prop; i; ) { |
3678 | + prop = this.props[ --i ]; |
3679 | + event[ prop ] = originalEvent[ prop ]; |
3680 | + } |
3681 | + |
3682 | + // Fix target property, if necessary |
3683 | + if ( !event.target ) { |
3684 | + // Fixes #1925 where srcElement might not be defined either |
3685 | + event.target = event.srcElement || document; |
3686 | + } |
3687 | + |
3688 | + // check if target is a textnode (safari) |
3689 | + if ( event.target.nodeType === 3 ) { |
3690 | + event.target = event.target.parentNode; |
3691 | + } |
3692 | + |
3693 | + // Add relatedTarget, if necessary |
3694 | + if ( !event.relatedTarget && event.fromElement ) { |
3695 | + event.relatedTarget = event.fromElement === event.target ? event.toElement : event.fromElement; |
3696 | + } |
3697 | + |
3698 | + // Calculate pageX/Y if missing and clientX/Y available |
3699 | + if ( event.pageX == null && event.clientX != null ) { |
3700 | + var doc = document.documentElement, |
3701 | + body = document.body; |
3702 | + |
3703 | + event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0); |
3704 | + event.pageY = event.clientY + (doc && doc.scrollTop || body && body.scrollTop || 0) - (doc && doc.clientTop || body && body.clientTop || 0); |
3705 | + } |
3706 | + |
3707 | + // Add which for key events |
3708 | + if ( event.which == null && (event.charCode != null || event.keyCode != null) ) { |
3709 | + event.which = event.charCode != null ? event.charCode : event.keyCode; |
3710 | + } |
3711 | + |
3712 | + // Add metaKey to non-Mac browsers (use ctrl for PC's and Meta for Macs) |
3713 | + if ( !event.metaKey && event.ctrlKey ) { |
3714 | + event.metaKey = event.ctrlKey; |
3715 | + } |
3716 | + |
3717 | + // Add which for click: 1 === left; 2 === middle; 3 === right |
3718 | + // Note: button is not normalized, so don't use it |
3719 | + if ( !event.which && event.button !== undefined ) { |
3720 | + event.which = (event.button & 1 ? 1 : ( event.button & 2 ? 3 : ( event.button & 4 ? 2 : 0 ) )); |
3721 | + } |
3722 | + |
3723 | + return event; |
3724 | + }, |
3725 | + |
3726 | + // Deprecated, use jQuery.guid instead |
3727 | + guid: 1E8, |
3728 | + |
3729 | + // Deprecated, use jQuery.proxy instead |
3730 | + proxy: jQuery.proxy, |
3731 | + |
3732 | + special: { |
3733 | + ready: { |
3734 | + // Make sure the ready event is setup |
3735 | + setup: jQuery.bindReady, |
3736 | + teardown: jQuery.noop |
3737 | + }, |
3738 | + |
3739 | + live: { |
3740 | + add: function( handleObj ) { |
3741 | + jQuery.event.add( this, |
3742 | + liveConvert( handleObj.origType, handleObj.selector ), |
3743 | + jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) ); |
3744 | + }, |
3745 | + |
3746 | + remove: function( handleObj ) { |
3747 | + jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj ); |
3748 | + } |
3749 | + }, |
3750 | + |
3751 | + beforeunload: { |
3752 | + setup: function( data, namespaces, eventHandle ) { |
3753 | + // We only want to do this special case on windows |
3754 | + if ( jQuery.isWindow( this ) ) { |
3755 | + this.onbeforeunload = eventHandle; |
3756 | + } |
3757 | + }, |
3758 | + |
3759 | + teardown: function( namespaces, eventHandle ) { |
3760 | + if ( this.onbeforeunload === eventHandle ) { |
3761 | + this.onbeforeunload = null; |
3762 | + } |
3763 | + } |
3764 | + } |
3765 | + } |
3766 | +}; |
3767 | + |
3768 | +jQuery.removeEvent = document.removeEventListener ? |
3769 | + function( elem, type, handle ) { |
3770 | + if ( elem.removeEventListener ) { |
3771 | + elem.removeEventListener( type, handle, false ); |
3772 | + } |
3773 | + } : |
3774 | + function( elem, type, handle ) { |
3775 | + if ( elem.detachEvent ) { |
3776 | + elem.detachEvent( "on" + type, handle ); |
3777 | + } |
3778 | + }; |
3779 | + |
3780 | +jQuery.Event = function( src ) { |
3781 | + // Allow instantiation without the 'new' keyword |
3782 | + if ( !this.preventDefault ) { |
3783 | + return new jQuery.Event( src ); |
3784 | + } |
3785 | + |
3786 | + // Event object |
3787 | + if ( src && src.type ) { |
3788 | + this.originalEvent = src; |
3789 | + this.type = src.type; |
3790 | + |
3791 | + // Events bubbling up the document may have been marked as prevented |
3792 | + // by a handler lower down the tree; reflect the correct value. |
3793 | + this.isDefaultPrevented = (src.defaultPrevented || src.returnValue === false || |
3794 | + src.getPreventDefault && src.getPreventDefault()) ? returnTrue : returnFalse; |
3795 | + |
3796 | + // Event type |
3797 | + } else { |
3798 | + this.type = src; |
3799 | + } |
3800 | + |
3801 | + // timeStamp is buggy for some events on Firefox(#3843) |
3802 | + // So we won't rely on the native value |
3803 | + this.timeStamp = jQuery.now(); |
3804 | + |
3805 | + // Mark it as fixed |
3806 | + this[ jQuery.expando ] = true; |
3807 | +}; |
3808 | + |
3809 | +function returnFalse() { |
3810 | + return false; |
3811 | +} |
3812 | +function returnTrue() { |
3813 | + return true; |
3814 | +} |
3815 | + |
3816 | +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding |
3817 | +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html |
3818 | +jQuery.Event.prototype = { |
3819 | + preventDefault: function() { |
3820 | + this.isDefaultPrevented = returnTrue; |
3821 | + |
3822 | + var e = this.originalEvent; |
3823 | + if ( !e ) { |
3824 | + return; |
3825 | + } |
3826 | + |
3827 | + // if preventDefault exists run it on the original event |
3828 | + if ( e.preventDefault ) { |
3829 | + e.preventDefault(); |
3830 | + |
3831 | + // otherwise set the returnValue property of the original event to false (IE) |
3832 | + } else { |
3833 | + e.returnValue = false; |
3834 | + } |
3835 | + }, |
3836 | + stopPropagation: function() { |
3837 | + this.isPropagationStopped = returnTrue; |
3838 | + |
3839 | + var e = this.originalEvent; |
3840 | + if ( !e ) { |
3841 | + return; |
3842 | + } |
3843 | + // if stopPropagation exists run it on the original event |
3844 | + if ( e.stopPropagation ) { |
3845 | + e.stopPropagation(); |
3846 | + } |
3847 | + // otherwise set the cancelBubble property of the original event to true (IE) |
3848 | + e.cancelBubble = true; |
3849 | + }, |
3850 | + stopImmediatePropagation: function() { |
3851 | + this.isImmediatePropagationStopped = returnTrue; |
3852 | + this.stopPropagation(); |
3853 | + }, |
3854 | + isDefaultPrevented: returnFalse, |
3855 | + isPropagationStopped: returnFalse, |
3856 | + isImmediatePropagationStopped: returnFalse |
3857 | +}; |
3858 | + |
3859 | +// Checks if an event happened on an element within another element |
3860 | +// Used in jQuery.event.special.mouseenter and mouseleave handlers |
3861 | +var withinElement = function( event ) { |
3862 | + // Check if mouse(over|out) are still within the same parent element |
3863 | + var parent = event.relatedTarget; |
3864 | + |
3865 | + // Firefox sometimes assigns relatedTarget a XUL element |
3866 | + // which we cannot access the parentNode property of |
3867 | + try { |
3868 | + // Traverse up the tree |
3869 | + while ( parent && parent !== this ) { |
3870 | + parent = parent.parentNode; |
3871 | + } |
3872 | + |
3873 | + if ( parent !== this ) { |
3874 | + // set the correct event type |
3875 | + event.type = event.data; |
3876 | + |
3877 | + // handle event if we actually just moused on to a non sub-element |
3878 | + jQuery.event.handle.apply( this, arguments ); |
3879 | + } |
3880 | + |
3881 | + // assuming we've left the element since we most likely mousedover a xul element |
3882 | + } catch(e) { } |
3883 | +}, |
3884 | + |
3885 | +// In case of event delegation, we only need to rename the event.type, |
3886 | +// liveHandler will take care of the rest. |
3887 | +delegate = function( event ) { |
3888 | + event.type = event.data; |
3889 | + jQuery.event.handle.apply( this, arguments ); |
3890 | +}; |
3891 | + |
3892 | +// Create mouseenter and mouseleave events |
3893 | +jQuery.each({ |
3894 | + mouseenter: "mouseover", |
3895 | + mouseleave: "mouseout" |
3896 | +}, function( orig, fix ) { |
3897 | + jQuery.event.special[ orig ] = { |
3898 | + setup: function( data ) { |
3899 | + jQuery.event.add( this, fix, data && data.selector ? delegate : withinElement, orig ); |
3900 | + }, |
3901 | + teardown: function( data ) { |
3902 | + jQuery.event.remove( this, fix, data && data.selector ? delegate : withinElement ); |
3903 | + } |
3904 | + }; |
3905 | +}); |
3906 | + |
3907 | +// submit delegation |
3908 | +if ( !jQuery.support.submitBubbles ) { |
3909 | + |
3910 | + jQuery.event.special.submit = { |
3911 | + setup: function( data, namespaces ) { |
3912 | + if ( this.nodeName && this.nodeName.toLowerCase() !== "form" ) { |
3913 | + jQuery.event.add(this, "click.specialSubmit", function( e ) { |
3914 | + var elem = e.target, |
3915 | + type = elem.type; |
3916 | + |
3917 | + if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) { |
3918 | + e.liveFired = undefined; |
3919 | + return trigger( "submit", this, arguments ); |
3920 | + } |
3921 | + }); |
3922 | + |
3923 | + jQuery.event.add(this, "keypress.specialSubmit", function( e ) { |
3924 | + var elem = e.target, |
3925 | + type = elem.type; |
3926 | + |
3927 | + if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) { |
3928 | + e.liveFired = undefined; |
3929 | + return trigger( "submit", this, arguments ); |
3930 | + } |
3931 | + }); |
3932 | + |
3933 | + } else { |
3934 | + return false; |
3935 | + } |
3936 | + }, |
3937 | + |
3938 | + teardown: function( namespaces ) { |
3939 | + jQuery.event.remove( this, ".specialSubmit" ); |
3940 | + } |
3941 | + }; |
3942 | + |
3943 | +} |
3944 | + |
3945 | +// change delegation, happens here so we have bind. |
3946 | +if ( !jQuery.support.changeBubbles ) { |
3947 | + |
3948 | + var changeFilters, |
3949 | + |
3950 | + getVal = function( elem ) { |
3951 | + var type = elem.type, val = elem.value; |
3952 | + |
3953 | + if ( type === "radio" || type === "checkbox" ) { |
3954 | + val = elem.checked; |
3955 | + |
3956 | + } else if ( type === "select-multiple" ) { |
3957 | + val = elem.selectedIndex > -1 ? |
3958 | + jQuery.map( elem.options, function( elem ) { |
3959 | + return elem.selected; |
3960 | + }).join("-") : |
3961 | + ""; |
3962 | + |
3963 | + } else if ( elem.nodeName.toLowerCase() === "select" ) { |
3964 | + val = elem.selectedIndex; |
3965 | + } |
3966 | + |
3967 | + return val; |
3968 | + }, |
3969 | + |
3970 | + testChange = function testChange( e ) { |
3971 | + var elem = e.target, data, val; |
3972 | + |
3973 | + if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) { |
3974 | + return; |
3975 | + } |
3976 | + |
3977 | + data = jQuery._data( elem, "_change_data" ); |
3978 | + val = getVal(elem); |
3979 | + |
3980 | + // the current data will be also retrieved by beforeactivate |
3981 | + if ( e.type !== "focusout" || elem.type !== "radio" ) { |
3982 | + jQuery._data( elem, "_change_data", val ); |
3983 | + } |
3984 | + |
3985 | + if ( data === undefined || val === data ) { |
3986 | + return; |
3987 | + } |
3988 | + |
3989 | + if ( data != null || val ) { |
3990 | + e.type = "change"; |
3991 | + e.liveFired = undefined; |
3992 | + return jQuery.event.trigger( e, arguments[1], elem ); |
3993 | + } |
3994 | + }; |
3995 | + |
3996 | + jQuery.event.special.change = { |
3997 | + filters: { |
3998 | + focusout: testChange, |
3999 | + |
4000 | + beforedeactivate: testChange, |
4001 | + |
4002 | + click: function( e ) { |
4003 | + var elem = e.target, type = elem.type; |
4004 | + |
4005 | + if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) { |
4006 | + return testChange.call( this, e ); |
4007 | + } |
4008 | + }, |
4009 | + |
4010 | + // Change has to be called before submit |
4011 | + // Keydown will be called before keypress, which is used in submit-event delegation |
4012 | + keydown: function( e ) { |
4013 | + var elem = e.target, type = elem.type; |
4014 | + |
4015 | + if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") || |
4016 | + (e.keyCode === 32 && (type === "checkbox" || type === "radio")) || |
4017 | + type === "select-multiple" ) { |
4018 | + return testChange.call( this, e ); |
4019 | + } |
4020 | + }, |
4021 | + |
4022 | + // Beforeactivate happens also before the previous element is blurred |
4023 | + // with this event you can't trigger a change event, but you can store |
4024 | + // information |
4025 | + beforeactivate: function( e ) { |
4026 | + var elem = e.target; |
4027 | + jQuery._data( elem, "_change_data", getVal(elem) ); |
4028 | + } |
4029 | + }, |
4030 | + |
4031 | + setup: function( data, namespaces ) { |
4032 | + if ( this.type === "file" ) { |
4033 | + return false; |
4034 | + } |
4035 | + |
4036 | + for ( var type in changeFilters ) { |
4037 | + jQuery.event.add( this, type + ".specialChange", changeFilters[type] ); |
4038 | + } |
4039 | + |
4040 | + return rformElems.test( this.nodeName ); |
4041 | + }, |
4042 | + |
4043 | + teardown: function( namespaces ) { |
4044 | + jQuery.event.remove( this, ".specialChange" ); |
4045 | + |
4046 | + return rformElems.test( this.nodeName ); |
4047 | + } |
4048 | + }; |
4049 | + |
4050 | + changeFilters = jQuery.event.special.change.filters; |
4051 | + |
4052 | + // Handle when the input is .focus()'d |
4053 | + changeFilters.focus = changeFilters.beforeactivate; |
4054 | +} |
4055 | + |
4056 | +function trigger( type, elem, args ) { |
4057 | + args[0].type = type; |
4058 | + return jQuery.event.handle.apply( elem, args ); |
4059 | +} |
4060 | + |
4061 | +// Create "bubbling" focus and blur events |
4062 | +if ( document.addEventListener ) { |
4063 | + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { |
4064 | + jQuery.event.special[ fix ] = { |
4065 | + setup: function() { |
4066 | + this.addEventListener( orig, handler, true ); |
4067 | + }, |
4068 | + teardown: function() { |
4069 | + this.removeEventListener( orig, handler, true ); |
4070 | + } |
4071 | + }; |
4072 | + |
4073 | + function handler( e ) { |
4074 | + e = jQuery.event.fix( e ); |
4075 | + e.type = fix; |
4076 | + return jQuery.event.handle.call( this, e ); |
4077 | + } |
4078 | + }); |
4079 | +} |
4080 | + |
4081 | +jQuery.each(["bind", "one"], function( i, name ) { |
4082 | + jQuery.fn[ name ] = function( type, data, fn ) { |
4083 | + // Handle object literals |
4084 | + if ( typeof type === "object" ) { |
4085 | + for ( var key in type ) { |
4086 | + this[ name ](key, data, type[key], fn); |
4087 | + } |
4088 | + return this; |
4089 | + } |
4090 | + |
4091 | + if ( jQuery.isFunction( data ) || data === false ) { |
4092 | + fn = data; |
4093 | + data = undefined; |
4094 | + } |
4095 | + |
4096 | + var handler = name === "one" ? jQuery.proxy( fn, function( event ) { |
4097 | + jQuery( this ).unbind( event, handler ); |
4098 | + return fn.apply( this, arguments ); |
4099 | + }) : fn; |
4100 | + |
4101 | + if ( type === "unload" && name !== "one" ) { |
4102 | + this.one( type, data, fn ); |
4103 | + |
4104 | + } else { |
4105 | + for ( var i = 0, l = this.length; i < l; i++ ) { |
4106 | + jQuery.event.add( this[i], type, handler, data ); |
4107 | + } |
4108 | + } |
4109 | + |
4110 | + return this; |
4111 | + }; |
4112 | +}); |
4113 | + |
4114 | +jQuery.fn.extend({ |
4115 | + unbind: function( type, fn ) { |
4116 | + // Handle object literals |
4117 | + if ( typeof type === "object" && !type.preventDefault ) { |
4118 | + for ( var key in type ) { |
4119 | + this.unbind(key, type[key]); |
4120 | + } |
4121 | + |
4122 | + } else { |
4123 | + for ( var i = 0, l = this.length; i < l; i++ ) { |
4124 | + jQuery.event.remove( this[i], type, fn ); |
4125 | + } |
4126 | + } |
4127 | + |
4128 | + return this; |
4129 | + }, |
4130 | + |
4131 | + delegate: function( selector, types, data, fn ) { |
4132 | + return this.live( types, data, fn, selector ); |
4133 | + }, |
4134 | + |
4135 | + undelegate: function( selector, types, fn ) { |
4136 | + if ( arguments.length === 0 ) { |
4137 | + return this.unbind( "live" ); |
4138 | + |
4139 | + } else { |
4140 | + return this.die( types, null, fn, selector ); |
4141 | + } |
4142 | + }, |
4143 | + |
4144 | + trigger: function( type, data ) { |
4145 | + return this.each(function() { |
4146 | + jQuery.event.trigger( type, data, this ); |
4147 | + }); |
4148 | + }, |
4149 | + |
4150 | + triggerHandler: function( type, data ) { |
4151 | + if ( this[0] ) { |
4152 | + var event = jQuery.Event( type ); |
4153 | + event.preventDefault(); |
4154 | + event.stopPropagation(); |
4155 | + jQuery.event.trigger( event, data, this[0] ); |
4156 | + return event.result; |
4157 | + } |
4158 | + }, |
4159 | + |
4160 | + toggle: function( fn ) { |
4161 | + // Save reference to arguments for access in closure |
4162 | + var args = arguments, |
4163 | + i = 1; |
4164 | + |
4165 | + // link all the functions, so any of them can unbind this click handler |
4166 | + while ( i < args.length ) { |
4167 | + jQuery.proxy( fn, args[ i++ ] ); |
4168 | + } |
4169 | + |
4170 | + return this.click( jQuery.proxy( fn, function( event ) { |
4171 | + // Figure out which function to execute |
4172 | + var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i; |
4173 | + jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 ); |
4174 | + |
4175 | + // Make sure that clicks stop |
4176 | + event.preventDefault(); |
4177 | + |
4178 | + // and execute the function |
4179 | + return args[ lastToggle ].apply( this, arguments ) || false; |
4180 | + })); |
4181 | + }, |
4182 | + |
4183 | + hover: function( fnOver, fnOut ) { |
4184 | + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); |
4185 | + } |
4186 | +}); |
4187 | + |
4188 | +var liveMap = { |
4189 | + focus: "focusin", |
4190 | + blur: "focusout", |
4191 | + mouseenter: "mouseover", |
4192 | + mouseleave: "mouseout" |
4193 | +}; |
4194 | + |
4195 | +jQuery.each(["live", "die"], function( i, name ) { |
4196 | + jQuery.fn[ name ] = function( types, data, fn, origSelector /* Internal Use Only */ ) { |
4197 | + var type, i = 0, match, namespaces, preType, |
4198 | + selector = origSelector || this.selector, |
4199 | + context = origSelector ? this : jQuery( this.context ); |
4200 | + |
4201 | + if ( typeof types === "object" && !types.preventDefault ) { |
4202 | + for ( var key in types ) { |
4203 | + context[ name ]( key, data, types[key], selector ); |
4204 | + } |
4205 | + |
4206 | + return this; |
4207 | + } |
4208 | + |
4209 | + if ( jQuery.isFunction( data ) ) { |
4210 | + fn = data; |
4211 | + data = undefined; |
4212 | + } |
4213 | + |
4214 | + types = (types || "").split(" "); |
4215 | + |
4216 | + while ( (type = types[ i++ ]) != null ) { |
4217 | + match = rnamespaces.exec( type ); |
4218 | + namespaces = ""; |
4219 | + |
4220 | + if ( match ) { |
4221 | + namespaces = match[0]; |
4222 | + type = type.replace( rnamespaces, "" ); |
4223 | + } |
4224 | + |
4225 | + if ( type === "hover" ) { |
4226 | + types.push( "mouseenter" + namespaces, "mouseleave" + namespaces ); |
4227 | + continue; |
4228 | + } |
4229 | + |
4230 | + preType = type; |
4231 | + |
4232 | + if ( type === "focus" || type === "blur" ) { |
4233 | + types.push( liveMap[ type ] + namespaces ); |
4234 | + type = type + namespaces; |
4235 | + |
4236 | + } else { |
4237 | + type = (liveMap[ type ] || type) + namespaces; |
4238 | + } |
4239 | + |
4240 | + if ( name === "live" ) { |
4241 | + // bind live handler |
4242 | + for ( var j = 0, l = context.length; j < l; j++ ) { |
4243 | + jQuery.event.add( context[j], "live." + liveConvert( type, selector ), |
4244 | + { data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } ); |
4245 | + } |
4246 | + |
4247 | + } else { |
4248 | + // unbind live handler |
4249 | + context.unbind( "live." + liveConvert( type, selector ), fn ); |
4250 | + } |
4251 | + } |
4252 | + |
4253 | + return this; |
4254 | + }; |
4255 | +}); |
4256 | + |
4257 | +function liveHandler( event ) { |
4258 | + var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret, |
4259 | + elems = [], |
4260 | + selectors = [], |
4261 | + events = jQuery._data( this, eventKey ); |
4262 | + |
4263 | + if ( typeof events === "function" ) { |
4264 | + events = events.events; |
4265 | + } |
4266 | + |
4267 | + // Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911) |
4268 | + if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) { |
4269 | + return; |
4270 | + } |
4271 | + |
4272 | + if ( event.namespace ) { |
4273 | + namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)"); |
4274 | + } |
4275 | + |
4276 | + event.liveFired = this; |
4277 | + |
4278 | + var live = events.live.slice(0); |
4279 | + |
4280 | + for ( j = 0; j < live.length; j++ ) { |
4281 | + handleObj = live[j]; |
4282 | + |
4283 | + if ( handleObj.origType.replace( rnamespaces, "" ) === event.type ) { |
4284 | + selectors.push( handleObj.selector ); |
4285 | + |
4286 | + } else { |
4287 | + live.splice( j--, 1 ); |
4288 | + } |
4289 | + } |
4290 | + |
4291 | + match = jQuery( event.target ).closest( selectors, event.currentTarget ); |
4292 | + |
4293 | + for ( i = 0, l = match.length; i < l; i++ ) { |
4294 | + close = match[i]; |
4295 | + |
4296 | + for ( j = 0; j < live.length; j++ ) { |
4297 | + handleObj = live[j]; |
4298 | + |
4299 | + if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) ) { |
4300 | + elem = close.elem; |
4301 | + related = null; |
4302 | + |
4303 | + // Those two events require additional checking |
4304 | + if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) { |
4305 | + event.type = handleObj.preType; |
4306 | + related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0]; |
4307 | + } |
4308 | + |
4309 | + if ( !related || related !== elem ) { |
4310 | + elems.push({ elem: elem, handleObj: handleObj, level: close.level }); |
4311 | + } |
4312 | + } |
4313 | + } |
4314 | + } |
4315 | + |
4316 | + for ( i = 0, l = elems.length; i < l; i++ ) { |
4317 | + match = elems[i]; |
4318 | + |
4319 | + if ( maxLevel && match.level > maxLevel ) { |
4320 | + break; |
4321 | + } |
4322 | + |
4323 | + event.currentTarget = match.elem; |
4324 | + event.data = match.handleObj.data; |
4325 | + event.handleObj = match.handleObj; |
4326 | + |
4327 | + ret = match.handleObj.origHandler.apply( match.elem, arguments ); |
4328 | + |
4329 | + if ( ret === false || event.isPropagationStopped() ) { |
4330 | + maxLevel = match.level; |
4331 | + |
4332 | + if ( ret === false ) { |
4333 | + stop = false; |
4334 | + } |
4335 | + if ( event.isImmediatePropagationStopped() ) { |
4336 | + break; |
4337 | + } |
4338 | + } |
4339 | + } |
4340 | + |
4341 | + return stop; |
4342 | +} |
4343 | + |
4344 | +function liveConvert( type, selector ) { |
4345 | + return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspace, "&"); |
4346 | +} |
4347 | + |
4348 | +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + |
4349 | + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + |
4350 | + "change select submit keydown keypress keyup error").split(" "), function( i, name ) { |
4351 | + |
4352 | + // Handle event binding |
4353 | + jQuery.fn[ name ] = function( data, fn ) { |
4354 | + if ( fn == null ) { |
4355 | + fn = data; |
4356 | + data = null; |
4357 | + } |
4358 | + |
4359 | + return arguments.length > 0 ? |
4360 | + this.bind( name, data, fn ) : |
4361 | + this.trigger( name ); |
4362 | + }; |
4363 | + |
4364 | + if ( jQuery.attrFn ) { |
4365 | + jQuery.attrFn[ name ] = true; |
4366 | + } |
4367 | +}); |
4368 | + |
4369 | + |
4370 | +/*! |
4371 | + * Sizzle CSS Selector Engine |
4372 | + * Copyright 2011, The Dojo Foundation |
4373 | + * Released under the MIT, BSD, and GPL Licenses. |
4374 | + * More information: http://sizzlejs.com/ |
4375 | + */ |
4376 | +(function(){ |
4377 | + |
4378 | +var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g, |
4379 | + done = 0, |
4380 | + toString = Object.prototype.toString, |
4381 | + hasDuplicate = false, |
4382 | + baseHasDuplicate = true; |
4383 | + |
4384 | +// Here we check if the JavaScript engine is using some sort of |
4385 | +// optimization where it does not always call our comparision |
4386 | +// function. If that is the case, discard the hasDuplicate value. |
4387 | +// Thus far that includes Google Chrome. |
4388 | +[0, 0].sort(function() { |
4389 | + baseHasDuplicate = false; |
4390 | + return 0; |
4391 | +}); |
4392 | + |
4393 | +var Sizzle = function( selector, context, results, seed ) { |
4394 | + results = results || []; |
4395 | + context = context || document; |
4396 | + |
4397 | + var origContext = context; |
4398 | + |
4399 | + if ( context.nodeType !== 1 && context.nodeType !== 9 ) { |
4400 | + return []; |
4401 | + } |
4402 | + |
4403 | + if ( !selector || typeof selector !== "string" ) { |
4404 | + return results; |
4405 | + } |
4406 | + |
4407 | + var m, set, checkSet, extra, ret, cur, pop, i, |
4408 | + prune = true, |
4409 | + contextXML = Sizzle.isXML( context ), |
4410 | + parts = [], |
4411 | + soFar = selector; |
4412 | + |
4413 | + // Reset the position of the chunker regexp (start from head) |
4414 | + do { |
4415 | + chunker.exec( "" ); |
4416 | + m = chunker.exec( soFar ); |
4417 | + |
4418 | + if ( m ) { |
4419 | + soFar = m[3]; |
4420 | + |
4421 | + parts.push( m[1] ); |
4422 | + |
4423 | + if ( m[2] ) { |
4424 | + extra = m[3]; |
4425 | + break; |
4426 | + } |
4427 | + } |
4428 | + } while ( m ); |
4429 | + |
4430 | + if ( parts.length > 1 && origPOS.exec( selector ) ) { |
4431 | + |
4432 | + if ( parts.length === 2 && Expr.relative[ parts[0] ] ) { |
4433 | + set = posProcess( parts[0] + parts[1], context ); |
4434 | + |
4435 | + } else { |
4436 | + set = Expr.relative[ parts[0] ] ? |
4437 | + [ context ] : |
4438 | + Sizzle( parts.shift(), context ); |
4439 | + |
4440 | + while ( parts.length ) { |
4441 | + selector = parts.shift(); |
4442 | + |
4443 | + if ( Expr.relative[ selector ] ) { |
4444 | + selector += parts.shift(); |
4445 | + } |
4446 | + |
4447 | + set = posProcess( selector, set ); |
4448 | + } |
4449 | + } |
4450 | + |
4451 | + } else { |
4452 | + // Take a shortcut and set the context if the root selector is an ID |
4453 | + // (but not if it'll be faster if the inner selector is an ID) |
4454 | + if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML && |
4455 | + Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) { |
4456 | + |
4457 | + ret = Sizzle.find( parts.shift(), context, contextXML ); |
4458 | + context = ret.expr ? |
4459 | + Sizzle.filter( ret.expr, ret.set )[0] : |
4460 | + ret.set[0]; |
4461 | + } |
4462 | + |
4463 | + if ( context ) { |
4464 | + ret = seed ? |
4465 | + { expr: parts.pop(), set: makeArray(seed) } : |
4466 | + Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML ); |
4467 | + |
4468 | + set = ret.expr ? |
4469 | + Sizzle.filter( ret.expr, ret.set ) : |
4470 | + ret.set; |
4471 | + |
4472 | + if ( parts.length > 0 ) { |
4473 | + checkSet = makeArray( set ); |
4474 | + |
4475 | + } else { |
4476 | + prune = false; |
4477 | + } |
4478 | + |
4479 | + while ( parts.length ) { |
4480 | + cur = parts.pop(); |
4481 | + pop = cur; |
4482 | + |
4483 | + if ( !Expr.relative[ cur ] ) { |
4484 | + cur = ""; |
4485 | + } else { |
4486 | + pop = parts.pop(); |
4487 | + } |
4488 | + |
4489 | + if ( pop == null ) { |
4490 | + pop = context; |
4491 | + } |
4492 | + |
4493 | + Expr.relative[ cur ]( checkSet, pop, contextXML ); |
4494 | + } |
4495 | + |
4496 | + } else { |
4497 | + checkSet = parts = []; |
4498 | + } |
4499 | + } |
4500 | + |
4501 | + if ( !checkSet ) { |
4502 | + checkSet = set; |
4503 | + } |
4504 | + |
4505 | + if ( !checkSet ) { |
4506 | + Sizzle.error( cur || selector ); |
4507 | + } |
4508 | + |
4509 | + if ( toString.call(checkSet) === "[object Array]" ) { |
4510 | + if ( !prune ) { |
4511 | + results.push.apply( results, checkSet ); |
4512 | + |
4513 | + } else if ( context && context.nodeType === 1 ) { |
4514 | + for ( i = 0; checkSet[i] != null; i++ ) { |
4515 | + if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) { |
4516 | + results.push( set[i] ); |
4517 | + } |
4518 | + } |
4519 | + |
4520 | + } else { |
4521 | + for ( i = 0; checkSet[i] != null; i++ ) { |
4522 | + if ( checkSet[i] && checkSet[i].nodeType === 1 ) { |
4523 | + results.push( set[i] ); |
4524 | + } |
4525 | + } |
4526 | + } |
4527 | + |
4528 | + } else { |
4529 | + makeArray( checkSet, results ); |
4530 | + } |
4531 | + |
4532 | + if ( extra ) { |
4533 | + Sizzle( extra, origContext, results, seed ); |
4534 | + Sizzle.uniqueSort( results ); |
4535 | + } |
4536 | + |
4537 | + return results; |
4538 | +}; |
4539 | + |
4540 | +Sizzle.uniqueSort = function( results ) { |
4541 | + if ( sortOrder ) { |
4542 | + hasDuplicate = baseHasDuplicate; |
4543 | + results.sort( sortOrder ); |
4544 | + |
4545 | + if ( hasDuplicate ) { |
4546 | + for ( var i = 1; i < results.length; i++ ) { |
4547 | + if ( results[i] === results[ i - 1 ] ) { |
4548 | + results.splice( i--, 1 ); |
4549 | + } |
4550 | + } |
4551 | + } |
4552 | + } |
4553 | + |
4554 | + return results; |
4555 | +}; |
4556 | + |
4557 | +Sizzle.matches = function( expr, set ) { |
4558 | + return Sizzle( expr, null, null, set ); |
4559 | +}; |
4560 | + |
4561 | +Sizzle.matchesSelector = function( node, expr ) { |
4562 | + return Sizzle( expr, null, null, [node] ).length > 0; |
4563 | +}; |
4564 | + |
4565 | +Sizzle.find = function( expr, context, isXML ) { |
4566 | + var set; |
4567 | + |
4568 | + if ( !expr ) { |
4569 | + return []; |
4570 | + } |
4571 | + |
4572 | + for ( var i = 0, l = Expr.order.length; i < l; i++ ) { |
4573 | + var match, |
4574 | + type = Expr.order[i]; |
4575 | + |
4576 | + if ( (match = Expr.leftMatch[ type ].exec( expr )) ) { |
4577 | + var left = match[1]; |
4578 | + match.splice( 1, 1 ); |
4579 | + |
4580 | + if ( left.substr( left.length - 1 ) !== "\\" ) { |
4581 | + match[1] = (match[1] || "").replace(/\\/g, ""); |
4582 | + set = Expr.find[ type ]( match, context, isXML ); |
4583 | + |
4584 | + if ( set != null ) { |
4585 | + expr = expr.replace( Expr.match[ type ], "" ); |
4586 | + break; |
4587 | + } |
4588 | + } |
4589 | + } |
4590 | + } |
4591 | + |
4592 | + if ( !set ) { |
4593 | + set = typeof context.getElementsByTagName !== "undefined" ? |
4594 | + context.getElementsByTagName( "*" ) : |
4595 | + []; |
4596 | + } |
4597 | + |
4598 | + return { set: set, expr: expr }; |
4599 | +}; |
4600 | + |
4601 | +Sizzle.filter = function( expr, set, inplace, not ) { |
4602 | + var match, anyFound, |
4603 | + old = expr, |
4604 | + result = [], |
4605 | + curLoop = set, |
4606 | + isXMLFilter = set && set[0] && Sizzle.isXML( set[0] ); |
4607 | + |
4608 | + while ( expr && set.length ) { |
4609 | + for ( var type in Expr.filter ) { |
4610 | + if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) { |
4611 | + var found, item, |
4612 | + filter = Expr.filter[ type ], |
4613 | + left = match[1]; |
4614 | + |
4615 | + anyFound = false; |
4616 | + |
4617 | + match.splice(1,1); |
4618 | + |
4619 | + if ( left.substr( left.length - 1 ) === "\\" ) { |
4620 | + continue; |
4621 | + } |
4622 | + |
4623 | + if ( curLoop === result ) { |
4624 | + result = []; |
4625 | + } |
4626 | + |
4627 | + if ( Expr.preFilter[ type ] ) { |
4628 | + match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter ); |
4629 | + |
4630 | + if ( !match ) { |
4631 | + anyFound = found = true; |
4632 | + |
4633 | + } else if ( match === true ) { |
4634 | + continue; |
4635 | + } |
4636 | + } |
4637 | + |
4638 | + if ( match ) { |
4639 | + for ( var i = 0; (item = curLoop[i]) != null; i++ ) { |
4640 | + if ( item ) { |
4641 | + found = filter( item, match, i, curLoop ); |
4642 | + var pass = not ^ !!found; |
4643 | + |
4644 | + if ( inplace && found != null ) { |
4645 | + if ( pass ) { |
4646 | + anyFound = true; |
4647 | + |
4648 | + } else { |
4649 | + curLoop[i] = false; |
4650 | + } |
4651 | + |
4652 | + } else if ( pass ) { |
4653 | + result.push( item ); |
4654 | + anyFound = true; |
4655 | + } |
4656 | + } |
4657 | + } |
4658 | + } |
4659 | + |
4660 | + if ( found !== undefined ) { |
4661 | + if ( !inplace ) { |
4662 | + curLoop = result; |
4663 | + } |
4664 | + |
4665 | + expr = expr.replace( Expr.match[ type ], "" ); |
4666 | + |
4667 | + if ( !anyFound ) { |
4668 | + return []; |
4669 | + } |
4670 | + |
4671 | + break; |
4672 | + } |
4673 | + } |
4674 | + } |
4675 | + |
4676 | + // Improper expression |
4677 | + if ( expr === old ) { |
4678 | + if ( anyFound == null ) { |
4679 | + Sizzle.error( expr ); |
4680 | + |
4681 | + } else { |
4682 | + break; |
4683 | + } |
4684 | + } |
4685 | + |
4686 | + old = expr; |
4687 | + } |
4688 | + |
4689 | + return curLoop; |
4690 | +}; |
4691 | + |
4692 | +Sizzle.error = function( msg ) { |
4693 | + throw "Syntax error, unrecognized expression: " + msg; |
4694 | +}; |
4695 | + |
4696 | +var Expr = Sizzle.selectors = { |
4697 | + order: [ "ID", "NAME", "TAG" ], |
4698 | + |
4699 | + match: { |
4700 | + ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, |
4701 | + CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/, |
4702 | + NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/, |
4703 | + ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/, |
4704 | + TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/, |
4705 | + CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/, |
4706 | + POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/, |
4707 | + PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/ |
4708 | + }, |
4709 | + |
4710 | + leftMatch: {}, |
4711 | + |
4712 | + attrMap: { |
4713 | + "class": "className", |
4714 | + "for": "htmlFor" |
4715 | + }, |
4716 | + |
4717 | + attrHandle: { |
4718 | + href: function( elem ) { |
4719 | + return elem.getAttribute( "href" ); |
4720 | + } |
4721 | + }, |
4722 | + |
4723 | + relative: { |
4724 | + "+": function(checkSet, part){ |
4725 | + var isPartStr = typeof part === "string", |
4726 | + isTag = isPartStr && !/\W/.test( part ), |
4727 | + isPartStrNotTag = isPartStr && !isTag; |
4728 | + |
4729 | + if ( isTag ) { |
4730 | + part = part.toLowerCase(); |
4731 | + } |
4732 | + |
4733 | + for ( var i = 0, l = checkSet.length, elem; i < l; i++ ) { |
4734 | + if ( (elem = checkSet[i]) ) { |
4735 | + while ( (elem = elem.previousSibling) && elem.nodeType !== 1 ) {} |
4736 | + |
4737 | + checkSet[i] = isPartStrNotTag || elem && elem.nodeName.toLowerCase() === part ? |
4738 | + elem || false : |
4739 | + elem === part; |
4740 | + } |
4741 | + } |
4742 | + |
4743 | + if ( isPartStrNotTag ) { |
4744 | + Sizzle.filter( part, checkSet, true ); |
4745 | + } |
4746 | + }, |
4747 | + |
4748 | + ">": function( checkSet, part ) { |
4749 | + var elem, |
4750 | + isPartStr = typeof part === "string", |
4751 | + i = 0, |
4752 | + l = checkSet.length; |
4753 | + |
4754 | + if ( isPartStr && !/\W/.test( part ) ) { |
4755 | + part = part.toLowerCase(); |
4756 | + |
4757 | + for ( ; i < l; i++ ) { |
4758 | + elem = checkSet[i]; |
4759 | + |
4760 | + if ( elem ) { |
4761 | + var parent = elem.parentNode; |
4762 | + checkSet[i] = parent.nodeName.toLowerCase() === part ? parent : false; |
4763 | + } |
4764 | + } |
4765 | + |
4766 | + } else { |
4767 | + for ( ; i < l; i++ ) { |
4768 | + elem = checkSet[i]; |
4769 | + |
4770 | + if ( elem ) { |
4771 | + checkSet[i] = isPartStr ? |
4772 | + elem.parentNode : |
4773 | + elem.parentNode === part; |
4774 | + } |
4775 | + } |
4776 | + |
4777 | + if ( isPartStr ) { |
4778 | + Sizzle.filter( part, checkSet, true ); |
4779 | + } |
4780 | + } |
4781 | + }, |
4782 | + |
4783 | + "": function(checkSet, part, isXML){ |
4784 | + var nodeCheck, |
4785 | + doneName = done++, |
4786 | + checkFn = dirCheck; |
4787 | + |
4788 | + if ( typeof part === "string" && !/\W/.test(part) ) { |
4789 | + part = part.toLowerCase(); |
4790 | + nodeCheck = part; |
4791 | + checkFn = dirNodeCheck; |
4792 | + } |
4793 | + |
4794 | + checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML ); |
4795 | + }, |
4796 | + |
4797 | + "~": function( checkSet, part, isXML ) { |
4798 | + var nodeCheck, |
4799 | + doneName = done++, |
4800 | + checkFn = dirCheck; |
4801 | + |
4802 | + if ( typeof part === "string" && !/\W/.test( part ) ) { |
4803 | + part = part.toLowerCase(); |
4804 | + nodeCheck = part; |
4805 | + checkFn = dirNodeCheck; |
4806 | + } |
4807 | + |
4808 | + checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML ); |
4809 | + } |
4810 | + }, |
4811 | + |
4812 | + find: { |
4813 | + ID: function( match, context, isXML ) { |
4814 | + if ( typeof context.getElementById !== "undefined" && !isXML ) { |
4815 | + var m = context.getElementById(match[1]); |
4816 | + // Check parentNode to catch when Blackberry 4.6 returns |
4817 | + // nodes that are no longer in the document #6963 |
4818 | + return m && m.parentNode ? [m] : []; |
4819 | + } |
4820 | + }, |
4821 | + |
4822 | + NAME: function( match, context ) { |
4823 | + if ( typeof context.getElementsByName !== "undefined" ) { |
4824 | + var ret = [], |
4825 | + results = context.getElementsByName( match[1] ); |
4826 | + |
4827 | + for ( var i = 0, l = results.length; i < l; i++ ) { |
4828 | + if ( results[i].getAttribute("name") === match[1] ) { |
4829 | + ret.push( results[i] ); |
4830 | + } |
4831 | + } |
4832 | + |
4833 | + return ret.length === 0 ? null : ret; |
4834 | + } |
4835 | + }, |
4836 | + |
4837 | + TAG: function( match, context ) { |
4838 | + if ( typeof context.getElementsByTagName !== "undefined" ) { |
4839 | + return context.getElementsByTagName( match[1] ); |
4840 | + } |
4841 | + } |
4842 | + }, |
4843 | + preFilter: { |
4844 | + CLASS: function( match, curLoop, inplace, result, not, isXML ) { |
4845 | + match = " " + match[1].replace(/\\/g, "") + " "; |
4846 | + |
4847 | + if ( isXML ) { |
4848 | + return match; |
4849 | + } |
4850 | + |
4851 | + for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) { |
4852 | + if ( elem ) { |
4853 | + if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) { |
4854 | + if ( !inplace ) { |
4855 | + result.push( elem ); |
4856 | + } |
4857 | + |
4858 | + } else if ( inplace ) { |
4859 | + curLoop[i] = false; |
4860 | + } |
4861 | + } |
4862 | + } |
4863 | + |
4864 | + return false; |
4865 | + }, |
4866 | + |
4867 | + ID: function( match ) { |
4868 | + return match[1].replace(/\\/g, ""); |
4869 | + }, |
4870 | + |
4871 | + TAG: function( match, curLoop ) { |
4872 | + return match[1].toLowerCase(); |
4873 | + }, |
4874 | + |
4875 | + CHILD: function( match ) { |
4876 | + if ( match[1] === "nth" ) { |
4877 | + if ( !match[2] ) { |
4878 | + Sizzle.error( match[0] ); |
4879 | + } |
4880 | + |
4881 | + match[2] = match[2].replace(/^\+|\s*/g, ''); |
4882 | + |
4883 | + // parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6' |
4884 | + var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec( |
4885 | + match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" || |
4886 | + !/\D/.test( match[2] ) && "0n+" + match[2] || match[2]); |
4887 | + |
4888 | + // calculate the numbers (first)n+(last) including if they are negative |
4889 | + match[2] = (test[1] + (test[2] || 1)) - 0; |
4890 | + match[3] = test[3] - 0; |
4891 | + } |
4892 | + else if ( match[2] ) { |
4893 | + Sizzle.error( match[0] ); |
4894 | + } |
4895 | + |
4896 | + // TODO: Move to normal caching system |
4897 | + match[0] = done++; |
4898 | + |
4899 | + return match; |
4900 | + }, |
4901 | + |
4902 | + ATTR: function( match, curLoop, inplace, result, not, isXML ) { |
4903 | + var name = match[1] = match[1].replace(/\\/g, ""); |
4904 | + |
4905 | + if ( !isXML && Expr.attrMap[name] ) { |
4906 | + match[1] = Expr.attrMap[name]; |
4907 | + } |
4908 | + |
4909 | + // Handle if an un-quoted value was used |
4910 | + match[4] = ( match[4] || match[5] || "" ).replace(/\\/g, ""); |
4911 | + |
4912 | + if ( match[2] === "~=" ) { |
4913 | + match[4] = " " + match[4] + " "; |
4914 | + } |
4915 | + |
4916 | + return match; |
4917 | + }, |
4918 | + |
4919 | + PSEUDO: function( match, curLoop, inplace, result, not ) { |
4920 | + if ( match[1] === "not" ) { |
4921 | + // If we're dealing with a complex expression, or a simple one |
4922 | + if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) { |
4923 | + match[3] = Sizzle(match[3], null, null, curLoop); |
4924 | + |
4925 | + } else { |
4926 | + var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not); |
4927 | + |
4928 | + if ( !inplace ) { |
4929 | + result.push.apply( result, ret ); |
4930 | + } |
4931 | + |
4932 | + return false; |
4933 | + } |
4934 | + |
4935 | + } else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) { |
4936 | + return true; |
4937 | + } |
4938 | + |
4939 | + return match; |
4940 | + }, |
4941 | + |
4942 | + POS: function( match ) { |
4943 | + match.unshift( true ); |
4944 | + |
4945 | + return match; |
4946 | + } |
4947 | + }, |
4948 | + |
4949 | + filters: { |
4950 | + enabled: function( elem ) { |
4951 | + return elem.disabled === false && elem.type !== "hidden"; |
4952 | + }, |
4953 | + |
4954 | + disabled: function( elem ) { |
4955 | + return elem.disabled === true; |
4956 | + }, |
4957 | + |
4958 | + checked: function( elem ) { |
4959 | + return elem.checked === true; |
4960 | + }, |
4961 | + |
4962 | + selected: function( elem ) { |
4963 | + // Accessing this property makes selected-by-default |
4964 | + // options in Safari work properly |
4965 | + elem.parentNode.selectedIndex; |
4966 | + |
4967 | + return elem.selected === true; |
4968 | + }, |
4969 | + |
4970 | + parent: function( elem ) { |
4971 | + return !!elem.firstChild; |
4972 | + }, |
4973 | + |
4974 | + empty: function( elem ) { |
4975 | + return !elem.firstChild; |
4976 | + }, |
4977 | + |
4978 | + has: function( elem, i, match ) { |
4979 | + return !!Sizzle( match[3], elem ).length; |
4980 | + }, |
4981 | + |
4982 | + header: function( elem ) { |
4983 | + return (/h\d/i).test( elem.nodeName ); |
4984 | + }, |
4985 | + |
4986 | + text: function( elem ) { |
4987 | + return "text" === elem.type; |
4988 | + }, |
4989 | + radio: function( elem ) { |
4990 | + return "radio" === elem.type; |
4991 | + }, |
4992 | + |
4993 | + checkbox: function( elem ) { |
4994 | + return "checkbox" === elem.type; |
4995 | + }, |
4996 | + |
4997 | + file: function( elem ) { |
4998 | + return "file" === elem.type; |
4999 | + }, |
5000 | + password: function( elem ) { |
The diff is not as bad as it looks. I'm quite happy with the changes (for a first start with the retheming). I would like to get somebody else's opinion though.
- daniel@miyazaki:~$ wget -q http:// loco.ubuntu. com/media/ css/newstyle. css miyazaki: ~$ diff -u newstyle.css bzr/ubuntu- packaging- guide.retheming /themes/ ubuntu/ static/ newstyle. css miyazaki: ~$
daniel@
daniel@
- Actual theme changes: http:// paste.ubuntu. com/642710/ (compared to standard sphinx theme)
- Changes in the CSS: miyazaki: ~$ bzr branch lp:ubuntu-website/light-django-theme
daniel@
Branched 31 revision(s).
daniel@ miyazaki: ~$ diff -u light-django- theme/media/ css/default. css bzr/ubuntu- packaging- guide.retheming /themes/ ubuntu/ static/ light-django- theme.css theme/media/ css/default. css 2011-07-12 17:29:45.334779000 +0200 packaging- guide.retheming /themes/ ubuntu/ static/ light-django- theme.css 2011-07-12 17:26:58.420591381 +0200
--- light-django-
+++ bzr/ubuntu-
@@ -876,11 +876,11 @@
}
#page-footer { /images/ footer. png") repeat-x scroll 0 0 #EEECEA
- background: url("..
+ background: url("footer.png") repeat-x scroll 0 0 #EEECEA
}
#page-footer .container { /images/ footer. png") repeat-x scroll 0 0 #EEECEA; miyazaki: ~$
- background: url("..
+ background: url("footer.png") repeat-x scroll 0 0 #EEECEA;
padding: 0px 10px;
width: 960px;
}
daniel@