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