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