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